Peach: Local-first video metadata scraper and media manager.
fix(web):接续设置页处理进度并提供首页跳转
longmeidao3f2d4c94bf1d
diff --git a/README.en.md b/README.en.mdindex 5c9f29a6d..5c40db350 100644--- a/README.en.md+++ b/README.en.md@@ -41,7 +41,7 @@ First-run setup offers an optional browser-history import guide. Completed imporTray-managed services let you adjust media sources under Manage → Configuration on the host computer, including through its LAN hostname. Setup and configuration provide download links when dependencies are not detected, with mount drivers shown for the host operating system.-In Data Management, Scan and enrich scans folders, detects existing NFO files and local posters, and fetches missing metadata. Same-name NFO files, `movie.nfo` in single-movie folders, and episode NFO files are supported. Metadata retains its original source and enters the review queue before updating the catalog. Local custom tags are preserved; folders containing multiple videos do not share `movie.nfo`.+In Configuration or Data Management, Scan and enrich scans folders, detects existing NFO files and local posters, and fetches missing metadata. While processing, the home page links to progress in Configuration. Same-name NFO files, `movie.nfo` in single-movie folders, and episode NFO files are supported. Metadata retains its original source and enters the review queue before updating the catalog. Local custom tags are preserved; folders containing multiple videos do not share `movie.nfo`.Follow sources include FANBOX, Patreon, SubscribeStar, Kemono, Pawchive, Coomer, the Rule34 family and F95zone. Availability depends on the site and your access rights. See [source collection](docs/SOURCING.md) for supported workflows and boundaries.diff --git a/README.md b/README.mdindex 79f52504a..ff0eca6b3 100644--- a/README.md+++ b/README.md@@ -37,7 +37,7 @@ CloudDrive · 115 与 CloudDrive · PikPak 按本机文件夹接入;先在 Clo托盘管理的服务可在本机通过「管理 → 配置」调整媒体来源;使用局域网域名打开也能进入。首启页和配置页检测缺失依赖时提供下载链接,挂载驱动提示按操作系统显示。-在「数据管理」点击「扫描并补全资料」,可统一扫描文件夹、识别已有 NFO 和本地海报,并采集缺失资料。支持同名 NFO、单影片目录的 `movie.nfo` 和单集 NFO;资料保留原始出处,在「复核资料」确认后写入馆藏。已有本地标签会保留,目录中有多部影片时不会共用 `movie.nfo`。+在「配置」或「数据管理」点击「扫描并补全资料」,可统一扫描文件夹、识别已有 NFO 和本地海报,并采集缺失资料。首页在处理期间提供进度入口,配置页显示当前阶段。支持同名 NFO、单影片目录的 `movie.nfo` 和单集 NFO;资料保留原始出处,在「复核资料」确认后写入馆藏。已有本地标签会保留,目录中有多部影片时不会共用 `movie.nfo`。首次设置可选择进入浏览器历史记录导入指南;完成导入后指南隐藏,点击「跳过」会在当前浏览器记住选择,折叠仍保留指南。需要补充记录时使用「口味」页的读取或导入按钮。设置中的「SFW 模式」会模糊、降低饱和度并压暗图片和视频,停止悬停预览,文字保持可见。数据管理中的「网盘与本地数据库」仅在配置网盘后显示;空文件夹清理也支持本地磁盘。diff --git a/docs/HANDOFF.md b/docs/HANDOFF.mdindex 052fe860f..a6dc27c1d 100644--- a/docs/HANDOFF.md+++ b/docs/HANDOFF.md@@ -4,7 +4,7 @@## 界面、媒体与复核的既定判据-- 后台任务、断线恢复与 NFO 边车兼容范围见 `docs/REUSE.md`。+- 统一处理、NFO 兼容见 `docs/REUSE.md`;[Banner](https://vercel.com/geist/banner) 2026-09-06 实测与 hash 见 `vercel-geist-library-banner.md`。页面密度、控件、提示与响应式的实现门槛见 `.claude/skills/peach-web-ui/SKILL.md`,这里只留代码看不出来的判据。diff --git a/docs/REUSE.md b/docs/REUSE.mdindex 704e9e124..9118d6d38 100644--- a/docs/REUSE.md+++ b/docs/REUSE.md@@ -1,5 +1,7 @@# 复用清单+首页进度 Banner 与配置页复用 `LibraryProcessing`、`watchJob` 和 `/api/library-processing`,启动只提交一次,状态查询接续托盘首次处理。首页在完成后收起,失败提供设置跳转;配置页持续读取阶段与真实计数。Geist Banner 官方 DOM/CSS 已于 2026-09-06 取得,取证与 Peach 差异见 `docs/reference-snapshots/vercel-geist-library-banner.md`。+JAV 默认封面(官方封面/预览图)与默认大小(大图/小图)独立保存,复用 localStorage、共享 Switch 和既有 `/cover`、`/poster` 接口,不新增依赖。`frontend/src/jav-artwork.ts` 负责作品身份、偏好恢复与缺图回退;首页、接着看、实体作品、详情推荐、Mix 静止与翻图、播放队列共用封面选择。小图保留所选来源,设置换图保留播放和滚动位置。这是 Codex 与 Claude 共用的实现查找表。新增、恢复或重写代码前必须按diff --git a/docs/STATUS.md b/docs/STATUS.mdindex cd731fca2..8e3dca068 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -8,7 +8,7 @@## 运行态-- 测试包本机可访问,含无缩略图视频;mDNS 待办。+- 测试包 0.18.0 本机可访问;mDNS 待办。- JAV 封面、大小独立设置。diff --git a/docs/reference-snapshots/vercel-geist-library-banner.md b/docs/reference-snapshots/vercel-geist-library-banner.mdnew file mode 100644index 000000000..8bbcb3035--- /dev/null+++ b/docs/reference-snapshots/vercel-geist-library-banner.md@@ -0,0 +1,8 @@+# 首页处理进度 Banner++- 日期:2026-09-06;URL:<https://vercel.com/geist/banner>。+- Chrome 读取实际 DOM、getComputedStyle;渲染 HTML SHA-256:`06785ff700e2649130de056264061a22c0389045514cf9ae3c63b44a3ec6cbb3`。+- 桌面示例容器:`flex items-center justify-center gap-3 p-4`,内边距 16px,间距 12px,正文 16px;跳转按钮 `--height:32px`、`rounded-full`、14px 字体,锚点无下划线。+- 小屏上游收为带右箭头的整枚胶囊;Peach 保留阶段全文、独立跳转按钮和换行,方便显示真实进度。背景复用 Peach 中性色,无渐变宣传装饰。+- 执行环境中的 Chrome 两次返回 `ERR_NETWORK_ACCESS_DENIED`,插件入口超时;允许联网的执行环境重试成功。先前“外观未取得”记录已由本次实测补齐。+- 人工取证笔记,不在 reference-sources.json 登记;它不是可由上游文本覆盖的快照。diff --git a/frontend/src/islands/configuration.tsx b/frontend/src/islands/configuration.tsxindex b81d28e37..ef4bfd5b0 100644--- a/frontend/src/islands/configuration.tsx+++ b/frontend/src/islands/configuration.tsx@@ -13,6 +13,7 @@ import type { JSX } from 'preact';import { fieldsetTitle, noteHtml, setActionBusy, selectFieldHtml, wireSelectField, MEDIA_SOURCE_ICONS, selectOptionIconHtml } from '@peach/legacy/ui';import { ApiError, apiGet, apiSend, errorMessage } from '../api';import { AccessSettings, type AccessState } from './access-settings';+import { LibraryProcessing, type LibraryProcessingData } from './library-processing';export interface ConfigurationProps {/** 保存成功后的过去时回执(遗留层的 Toast)。 */@@ -27,6 +28,7 @@ export interface ConfigurationFact {}export interface ConfigurationData {+ processing?: LibraryProcessingData;access?: AccessState;editable: boolean;/** 不能编辑时给用户看的原因,可编辑时为空。 */@@ -63,7 +65,10 @@ export const RESTART_REDIRECT_MS = 8000;export const loadConfiguration = (_props: ConfigurationProps,signal: AbortSignal,-): Promise<ConfigurationData> => apiGet<ConfigurationData>(CONFIGURATION_URL, signal);+): Promise<ConfigurationData> => Promise.all([+ apiGet<ConfigurationData>(CONFIGURATION_URL, signal),+ apiGet<LibraryProcessingData>('/api/library-processing', signal).catch(cause => ({ status: 'failed', error: errorMessage(cause) })),+]).then(([configuration, processing]) => ({ ...configuration, processing }));type State = { data: ConfigurationData | null; error: string };@@ -318,7 +323,7 @@ function ConfigurationForm({ data, receipt }: { data: ConfigurationData; receipt<input type="checkbox" checked={scanNow} onChange={(event) => setScanNow(event.currentTarget.checked)} /><span aria-hidden="true"><svg viewBox="0 0 24 24"><use href="#i-check" /></svg></span></span>- <span>保存后扫描媒体文件夹</span>+ <span>保存后扫描并补全资料</span></label>{failure ? <Html html={noteHtml(failure, { variant: 'error', label: '没有保存' })} /> : null}</div>@@ -340,6 +345,9 @@ export function Configuration({ receipt, data, error }: ConfigurationProps & Sta? <ConfigurationForm data={data} receipt={receipt} />: <Html html={noteHtml(data.notice, { variant: 'secondary', label: '只读' })} />}{data.access ? <AccessSettings initial={data.access} receipt={receipt} /> : null}+ <section id="libraryProcessing" class="configfieldset" data-geist-fieldset aria-labelledby="cleanupScrapingTitle">+ <LibraryProcessing data={data.processing || { status: 'idle' }} error="" toast={receipt} monitor />+ </section><Facts facts={data.facts} /><MountStatus data={data} /></div>diff --git a/frontend/src/islands/library-processing.tsx b/frontend/src/islands/library-processing.tsxindex ab5e02d1b..49a874cc3 100644--- a/frontend/src/islands/library-processing.tsx+++ b/frontend/src/islands/library-processing.tsx@@ -9,17 +9,18 @@ export interface LibraryProcessingData extends JobState {stage?: string; scanned?: number; identified?: number; candidates?: number; covers?: number;issues?: { asset_id: number | null; message: string }[];}-export interface LibraryProcessingProps { toast(message: string): void; onComplete?(): void }+export interface LibraryProcessingProps { toast(message: string): void; onComplete?(): void; mode?: 'notice'; monitor?: boolean }export const loadLibraryProcessing = (_props: LibraryProcessingProps, signal: AbortSignal) =>apiGet<LibraryProcessingData>('/api/library-processing', signal);-export function LibraryProcessing({ data, error, toast, onComplete }: LibraryProcessingProps & IslandState<LibraryProcessingData>) {+export function LibraryProcessing({ data, error, toast, onComplete, mode, monitor }: LibraryProcessingProps & IslandState<LibraryProcessingData>) {const [state, setState] = useState<LibraryProcessingData>(data || { status: 'idle' });const [problem, setProblem] = useState(error);const [submitting, setSubmitting] = useState(false);const [receipt, setReceipt] = useState(false);const lifetime = useRef(new AbortController());const generation = useRef(0);+ const previousStatus = useRef(state.status);const button = useRef<HTMLButtonElement>(null);const busy = submitting || state.status === 'running';useLayoutEffect(() => setActionBusy(button.current, busy), [busy]);@@ -28,16 +29,18 @@ export function LibraryProcessing({ data, error, toast, onComplete }: LibraryProawait watchJob<LibraryProcessingData>({read: signal => apiGet('/api/library-processing', signal),active: () => !lifetime.current.signal.aborted && generation.current === epoch,+ keepWatching: mode === 'notice' || !!monitor,render: next => {setState(next); setProblem('');- if (next.status === 'complete') { setReceipt(true); toast('已完成扫描与资料采集'); }- if (next.status === 'complete' || next.status === 'failed') onComplete?.();+ if (next.status === 'complete' && previousStatus.current === 'running' && mode !== 'notice') { setReceipt(true); toast('已完成扫描与资料采集'); }+ if (previousStatus.current === 'running' && (next.status === 'complete' || next.status === 'failed')) onComplete?.();+ previousStatus.current = next.status;},disconnected: () => setProblem('连接中断,正在重新读取处理进度'),});}useEffect(() => {- if (state.status === 'running') void follow();+ if (state.status === 'running' || mode === 'notice' || monitor) void follow();return () => lifetime.current.abort();}, []);async function start() {@@ -46,18 +49,26 @@ export function LibraryProcessing({ data, error, toast, onComplete }: LibraryProtry {const next = await apiSend<LibraryProcessingData>('/api/library-processing', {}, 'POST', lifetime.current.signal);if (lifetime.current.signal.aborted) return;+ previousStatus.current = next.status;setState(next); setSubmitting(false); await follow();} catch (cause) {if (!lifetime.current.signal.aborted) { setProblem(errorMessage(cause)); setSubmitting(false); }}}+ if (mode === 'notice') {+ if (!problem && state.status !== 'running' && state.status !== 'failed') return null;+ return <div class="library-processing-banner" role="status">+ <span>{problem || (state.status === 'failed' ? '扫描与资料采集未完成' : `${state.stage || '正在整理馆藏'}${state.total ? ` · ${state.checked || 0} / ${state.total}` : ''}`)}</span>+ <a class="geist-button" href="/configuration#libraryProcessing">{problem || state.status === 'failed' ? '查看并处理' : '查看进度'}</a>+ </div>;+ }return <><div class="geist-fieldset-content library-processing"><div dangerouslySetInnerHTML={{ __html: fieldsetTitle('cleanupScrapingTitle', '扫描与采集') }} /><p>扫描媒体文件夹,导入已有资料,采集缺失信息。</p><div aria-live="polite">{state.status === 'running' && <>- <div dangerouslySetInnerHTML={{ __html: loadingDotsHtml(state.stage || '正在处理') }} />+ <div dangerouslySetInnerHTML={{ __html: loadingDotsHtml(`${state.stage || '正在处理'}${state.total ? ` · ${state.checked || 0} / ${state.total}` : ''}`) }} />{!!state.total && <div dangerouslySetInnerHTML={{ __html: progressHtml(`已处理 ${state.checked || 0} / ${state.total} 个视频`, state.checked || 0, state.total) }} />}</>}{(problem || state.status === 'failed') && <div role="alert" dangerouslySetInnerHTML={{ __html: noteHtml(problem || state.error || '处理未完成,请重试', { variant: 'error' }) }} />}diff --git a/frontend/test/library-processing.test.tsx b/frontend/test/library-processing.test.tsxindex e9cb1e63f..07650c980 100644--- a/frontend/test/library-processing.test.tsx+++ b/frontend/test/library-processing.test.tsx@@ -4,7 +4,7 @@ import { act } from 'preact/test-utils';import { LibraryProcessing } from '../src/islands/library-processing';let host: HTMLDivElement;-afterEach(() => { if(host)render(null, host); document.body.innerHTML=''; vi.unstubAllGlobals(); });+afterEach(() => { if(host)render(null, host); document.body.innerHTML=''; vi.useRealTimers(); vi.unstubAllGlobals(); });it('启动只提交一次,进度用 GET 读取并提供复核入口', async () => {const requests: string[]=[];vi.stubGlobal('fetch',vi.fn(async (_url: string, init?: RequestInit) => {@@ -31,3 +31,33 @@ it('刷新接续已有任务时只查询,旧完成结果不冒充当前回执'expect(host.textContent).toContain('重试未完成项');expect(toast).not.toHaveBeenCalled();});+it('首页从空闲发现后台任务,完成后收起并在卸载后停止查询', async () => {+ vi.useFakeTimers();+ let status='running';+ const fetch=vi.fn(async (_url: string, _init?: RequestInit)=>({ok:true,json:async()=>({status,stage:'采集缺失资料',checked:2,total:5})}));+ vi.stubGlobal('fetch',fetch);+ host=document.createElement('div');document.body.append(host);+ const toast=vi.fn();+ await act(async()=>render(h(LibraryProcessing,{data:{status:'idle'},error:'',toast,mode:'notice'}),host));+ await act(async()=>{await vi.advanceTimersByTimeAsync(1);});+ expect(host.textContent).toContain('采集缺失资料');+ expect(host.querySelector('a')?.getAttribute('href')).toBe('/configuration#libraryProcessing');+ status='complete';+ await act(async()=>{await vi.advanceTimersByTimeAsync(2000);});+ expect(host.textContent).toBe('');+ expect(toast).not.toHaveBeenCalled();+ render(null,host);+ const calls=fetch.mock.calls.length;+ await vi.advanceTimersByTimeAsync(4000);+ expect(fetch).toHaveBeenCalledTimes(calls);+ expect(fetch.mock.calls.every(call=>!call[1] || call[1].method!=='POST')).toBe(true);+});+it('设置持续查询已有任务,只在任务结束时提示一次', async () => {+ vi.useFakeTimers();+ vi.stubGlobal('fetch',vi.fn(async()=>({ok:true,json:async()=>({status:'complete'})})));+ host=document.createElement('div');document.body.append(host);+ const toast=vi.fn();+ await act(async()=>render(h(LibraryProcessing,{data:{status:'running'},error:'',toast,monitor:true}),host));+ await act(async()=>{await vi.advanceTimersByTimeAsync(4000);});+ expect(toast).toHaveBeenCalledTimes(1);+});diff --git a/src/peach/routes_pages.py b/src/peach/routes_pages.pyindex fc564e579..73c44a6cf 100644--- a/src/peach/routes_pages.py+++ b/src/peach/routes_pages.py@@ -522,11 +522,11 @@ def setup_page('name="access_confirm" type="password" maxlength="256" autocomplete="new-password"></div>')filled = [path for path in media_dirs if path]if not filled:- scan_text = "完成设置后扫描媒体文件夹"+ scan_text = "完成设置后扫描并补全资料"elif len(filled) == 1:- scan_text = f"完成设置后扫描 <code>{escape(filled[0])}</code>"+ scan_text = f"完成设置后扫描并补全资料:<code>{escape(filled[0])}</code>"else:- scan_text = f"完成设置后扫描这 {len(filled)} 个文件夹"+ scan_text = f"完成设置后扫描这 {len(filled)} 个文件夹并补全资料"body = ('<header><img class="mark" src="/peach-logo.png" alt="" width="40" height="40">'"<h1>欢迎使用 Peach</h1>"@@ -534,7 +534,7 @@ def setup_page('<form method="post" action="/setup">'+ "".join(fields)+ _check_html("scan_now", scan_text, checked=scan_now)- + '<p class="help">扫描只读取文件名、大小和修改时间,不改动任何媒体文件。</p>'+ + '<p class="help">读取已有 NFO 和封面,采集缺失资料。进度可在设置中查看,资料候选在复核后应用。</p>'+ '<section class="history-guide-choice"><h2>浏览器历史记录<span class="optional">可选</span></h2>'+ _check_html("history_guide", "接下来导入浏览器历史记录", checked=values.get("history_guide") == "y")+ '<p class="help">用于生成口味分析。完成设置后选择读取这台电脑,或导入其他设备的记录;也可稍后从「口味」进入。</p></section>'diff --git a/tests/test_metadata_library.py b/tests/test_metadata_library.pyindex f6ec12f34..ad66a3bf1 100644--- a/tests/test_metadata_library.py+++ b/tests/test_metadata_library.py@@ -159,3 +159,8 @@ class LibraryNfoTests(unittest.TestCase):self.assertIn('还没有内容标签', source)self.assertIn('还没有存储来源', source)self.assertIn("totalVideos?locationRows:catalogEmptyHtml", source)+ self.assertIn("unmountIsland($('#libraryProcessingNotice'))", source)+ self.assertIn("mode:'notice'", source)+ configuration = (root / 'frontend/src/islands/configuration.tsx').read_text(encoding='utf-8')+ self.assertIn("'/api/library-processing'", configuration)+ self.assertIn('toast={receipt} monitor', configuration)diff --git a/tests/test_onboarding.py b/tests/test_onboarding.pyindex b22a7c196..aef1a3219 100644--- a/tests/test_onboarding.py+++ b/tests/test_onboarding.py@@ -476,7 +476,7 @@ class SetupPageTests(_Case):self.assertIn("<span>.local</span>", body)# 勾选框用站内共用的自绘结构,路径在等宽框里。self.assertIn('<span class="pcheck"><input type="checkbox" name="scan_now" value="y" checked>', body)- self.assertIn("完成设置后扫描 <code>", body)+ self.assertIn("完成设置后扫描并补全资料:<code>", body)@unittest.skipIf(NATIVE_WINDOWS, "盘符本身就是挂载点,Windows 上没有这句话")def test_the_mounts_explanation_sits_under_the_media_field_on_posix(self):diff --git a/web/app.js b/web/app.jsindex 15983d894..fb4ec6c74 100644--- a/web/app.js+++ b/web/app.js@@ -5,6 +5,7 @@ import { javDisplayName, javTitleHtml } from './js/jav-title.js';import { matchRoute, routeLabel } from './js/routes.js';import { initMiddleTruncate } from './js/middle-truncate.js';import { tagLabel } from './js/tags.js';+import { mountIsland, unmountIsland } from './dist/peach-ui.js';import { catalogSuggestions, catalogEmptyHtml, emptyCatalogLayout, syncSidebarSurface, sidebarTagCounts, sidebarHasCatalogContent, cleanupSkeletonHtml, cloudLocations, cloudPreferenceLocations, tasteHistoryGuideHtml, wireTasteHistoryGuide, TASTE_GUIDE_KEY } from './dist/peach-ui.js';import { javImageKind, normalizeJavImage, normalizeJavLayout, normalizeJavPreferences, syncJavImages, nativeImageFit, matchesFaceSource, entitySkeletonHtml } from './dist/peach-ui.js';import {@@ -328,6 +329,7 @@ let surfaceRequests=null;const surfaceToken=path=>({epoch:surfaceEpoch,path,signal:surfaceRequests?.signal});const surfaceCurrent=token=>token.epoch===surfaceEpoch&&surfacePath()===token.path;const claimSurface=path=>{+ unmountIsland($('#libraryProcessingNotice'));surfaceRequests?.abort();surfaceRequests=new AbortController();surfaceEpoch++;return surfaceToken(path)};@@ -3865,7 +3867,10 @@ async function openConfiguration(push=true){const ui=await import('/dist/peach-ui.js');const props={receipt:message=>actionReceipt(message)};await ui.mountIsland('configuration',$('#stats'),props,{isCurrent:()=>surfaceCurrent(surface)});- if(surfaceCurrent(surface))window.scrollTo({top:0,behavior:'smooth'});+ if(surfaceCurrent(surface)){+ if(location.hash==='#libraryProcessing')$('#libraryProcessing').scrollIntoView({block:'start'});+ else window.scrollTo({top:0,behavior:'smooth'});+ }}async function openScraping(push=true){@@ -6993,6 +6998,7 @@ $('#scrim').onclick=()=>openDrawer(false);async function load(reset){const requestSeq=reset?++loadRequestSeq:loadRequestSeq;const surface=reset?claimSurface(surfacePath()):surfaceToken(surfacePath());+ if(reset&&isCatalogPath(location.pathname))void mountIsland('library-processing',$('#libraryProcessingNotice'),{toast,mode:'notice'},{isCurrent:()=>surfaceCurrent(surface)});if(!reset&&listLoading)return;if(!reset)listLoading=true;try{diff --git a/web/css/04-manage.css b/web/css/04-manage.cssindex 4b40cc375..1b0dbbc35 100644--- a/web/css/04-manage.css+++ b/web/css/04-manage.css@@ -117,3 +117,6 @@.scraping-source{min-width:0}.scraping-source .geist-fieldset-footer{flex-wrap:wrap}@media(max-width:600px){.scraping-page{--control-h:44px}.scraping-source button{min-height:44px}.scraping-cookie-method span{height:44px}}+.library-processing-banner{--control-h:32px;display:flex;align-items:center;justify-content:center;gap:12px;padding:16px;margin-bottom:16px;background:var(--hover);color:var(--ink);font-size:var(--fs-lg);flex-wrap:wrap}+.library-processing-banner .geist-button{border-radius:var(--pill-radius);font-size:var(--fs-md)}+#libraryProcessing{scroll-margin-top:80px}diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.jsindex 850b989d6..f004c3ba3 100644--- a/web/dist/peach-ui.js+++ b/web/dist/peach-ui.js@@ -1,21 +1,21 @@import { MEDIA_SOURCE_ICONS as e, emptyStateHtml as t, fieldsetTitle as n, loadingDotsHtml as r, noteHtml as i, progressHtml as a, selectFieldHtml as o, selectOptionIconHtml as s, setActionBusy as c, wireSelectField as l } from "/js/ui-components.js";import { LOC as u, fmtDur as d, fmtSize as f } from "/js/core.js";//#region node_modules/preact/dist/preact.module.js-var p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O = {}, k = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, A = Array.isArray;-function j(e, t) {+var p, m, h, g, _, v, y, b, x, S, C, w, T, E, D, O = {}, k = [], ee = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, te = Array.isArray;+function A(e, t) {for (var n in t) e[n] = t[n];return e;}-function M(e) {+function j(e) {e && e.parentNode && e.parentNode.removeChild(e);}-function te(e, t, n) {+function ne(e, t, n) {var r, i, a, o = {};for (a in t) a == "key" ? r = t[a] : a == "ref" ? i = t[a] : o[a] = t[a];if (arguments.length > 2 && (o.children = arguments.length > 3 ? p.call(arguments, 2) : n), typeof e == "function" && e.defaultProps != null) for (a in e.defaultProps) o[a] === void 0 && (o[a] = e.defaultProps[a]);- return ne(e, o, r, i, null);+ return re(e, o, r, i, null);}-function ne(e, t, n, r, i) {+function re(e, t, n, r, i) {var a = {type: e,props: t,@@ -33,62 +33,62 @@ function ne(e, t, n, r, i) {};return i == null && m.vnode != null && m.vnode(a), a;}-function N(e) {+function M(e) {return e.children;}-function P(e, t) {+function N(e, t) {this.props = e, this.context = t;}-function F(e, t) {- if (t == null) return e.__ ? F(e.__, e.__i + 1) : null;+function P(e, t) {+ if (t == null) return e.__ ? P(e.__, e.__i + 1) : null;for (var n; t < e.__k.length; t++) if ((n = e.__k[t]) != null && n.__e != null) return n.__e;- return typeof e.type == "function" ? F(e) : null;+ return typeof e.type == "function" ? P(e) : null;}-function re(e) {+function ie(e) {if (e.__P && e.__d) {- var t = e.__v, n = t.__e, r = [], i = [], a = j({}, t);- a.__v = t.__v + 1, m.vnode && m.vnode(a), me(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? F(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, ge(r, a, i), t.__e = t.__ = null, a.__e != n && ie(a);+ var t = e.__v, n = t.__e, r = [], i = [], a = A({}, t);+ a.__v = t.__v + 1, m.vnode && m.vnode(a), he(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? P(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, _e(r, a, i), t.__e = t.__ = null, a.__e != n && ae(a);}}-function ie(e) {+function ae(e) {if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;- }), ie(e);+ }), ae(e);}-function ae(e) {- (!e.__d && (e.__d = !0) && _.push(e) && !oe.__r++ || v != m.debounceRendering) && ((v = m.debounceRendering) || y)(oe);+function oe(e) {+ (!e.__d && (e.__d = !0) && _.push(e) && !se.__r++ || v != m.debounceRendering) && ((v = m.debounceRendering) || y)(se);}-function oe() {+function se() {try {- for (var e, t = 1; _.length;) _.length > t && _.sort(b), e = _.shift(), t = _.length, re(e);+ for (var e, t = 1; _.length;) _.length > t && _.sort(b), e = _.shift(), t = _.length, ie(e);} finally {- _.length = oe.__r = 0;+ _.length = se.__r = 0;}}-function se(e, t, n, r, i, a, o, s, c, l, u) {+function ce(e, t, n, r, i, a, o, s, c, l, u) {var d, f, p, m, h, g, _ = r && r.__k || k, v = t.length;- for (c = ce(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || O, p.__i = d, g = me(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && ye(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = le(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);+ for (c = le(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || O, p.__i = d, g = he(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && be(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = ue(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);return n.__e = h, c;}-function ce(e, t, n, r, i) {+function le(e, t, n, r, i) {var a, o, s, c, l, u = n.length, d = u, f = 0;- for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = ne(null, o, null, null, null) : A(o) ? o = e.__k[a] = ne(N, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = ne(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = ue(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;- if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = F(s)), be(s, s));+ for (e.__k = Array(i), a = 0; a < i; a++) (o = t[a]) != null && typeof o != "boolean" && typeof o != "function" ? (typeof o == "string" || typeof o == "number" || typeof o == "bigint" || o.constructor == String ? o = e.__k[a] = re(null, o, null, null, null) : te(o) ? o = e.__k[a] = re(M, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = re(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = de(o, n, c, d)) != -1 && (d--, (s = n[l]) && (s.__u |= 2)), s == null || s.__v == null ? (l == -1 && (i > u ? f-- : i < u && f++), typeof o.type != "function" && (o.__u |= 4)) : l != c && (l == c - 1 ? f-- : l == c + 1 ? f++ : (l > c ? f-- : f++, o.__u |= 4))) : e.__k[a] = null;+ if (d) for (a = 0; a < u; a++) (s = n[a]) != null && !(2 & s.__u) && (s.__e == r && (r = P(s)), xe(s, s));return r;}-function le(e, t, n) {+function ue(e, t, n) {var r, i;if (typeof e.type == "function") {- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = le(r[i], t, n));+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = ue(r[i], t, n));return t;}- e.__e != t && (t && e.type && !t.parentNode && (t = F(e)), t = n.insertBefore(e.__e, t || null));+ e.__e != t && (t && e.type && !t.parentNode && (t = P(e)), t = n.insertBefore(e.__e, t || null));dot &&= t.nextSibling;while (t != null && t.nodeType == 8);return t;}-function ue(e, t, n, r) {+function de(e, t, n, r) {var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);if (l === null && s == null || u && s == l.key && c == l.type) return n;if (r > +!!u) {@@ -96,16 +96,16 @@ function ue(e, t, n, r) {}return -1;}-function de(e, t, n) {+function fe(e, t, n) {t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ee.test(t) ? n : n + "px";}-function fe(e, t, n, r, i) {+function pe(e, t, n, r, i) {var a, o;n: if (t == "style") {if (typeof n == "string") e.style.cssText = n;else {- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || de(e.style, t, "");- if (n) for (t in n) r && n[t] == r[t] || de(e.style, t, n[t]);+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || fe(e.style, t, "");+ if (n) for (t in n) r && n[t] == r[t] || fe(e.style, t, n[t]);}} else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(w, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[C] = r[C] : (n[C] = T, e.addEventListener(t, a ? D : E, a)) : e.removeEventListener(t, a ? D : E, a);else {@@ -117,7 +117,7 @@ function fe(e, t, n, r, i) {typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));}}-function pe(e) {+function me(e) {return function(t) {if (this.l) {var n = this.l[t.type + e];@@ -127,19 +127,19 @@ function pe(e) {}};}-function me(e, t, n, r, i, a, o, s, c, l) {+function he(e, t, n, r, i, a, o, s, c, l) {var u, d, f, p, h, g, _, v, y, b, x, S, C, w, T, E, D = t.type;if (t.constructor !== void 0) return null;128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = m.__b) && u(t);n: if (typeof D == "function") {d = o.length;try {- if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new P(y, S), f.constructor = D, f.render = xe), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = j({}, f.__s)), j(f.__s, D.getDerivedStateFromProps(y, f.__s))), h = f.props, g = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);+ if (y = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? v = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(y, S) : (t.__c = f = new N(y, S), f.constructor = D, f.render = Se), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = A({}, f.__s)), A(f.__s, D.getDerivedStateFromProps(y, f.__s))), h = f.props, g = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);else {if (b && D.getDerivedStateFromProps == null && y !== h && f.componentWillReceiveProps != null && f.componentWillReceiveProps(y, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(y, f.__s, S)) {t.__v != n.__v && (f.props = y, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {e && (e.__ = t);- }), k.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = F(n);+ }), k.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = P(n);break n;}f.componentWillUpdate != null && f.componentWillUpdate(y, f.__s, S), b && f.componentDidUpdate != null && f.__h.push(function() {@@ -150,24 +150,24 @@ function me(e, t, n, r, i, a, o, s, c, l) {else dof.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), f.state = f.__s;while (f.__d && ++w < 25);- f.state = f.__s, f.getChildContext != null && (r = j(j({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (_ = f.getSnapshotBeforeUpdate(h, g)), T = u != null && u.type === N && u.key == null ? _e(u.props.children) : u, s = se(e, A(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), v && (f.__E = f.__ = null);+ f.state = f.__s, f.getChildContext != null && (r = A(A({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (_ = f.getSnapshotBeforeUpdate(h, g)), T = u != null && u.type === M && u.key == null ? ve(u.props.children) : u, s = ce(e, te(T) ? T : [T], t, n, r, i, a, o, s, c, l), f.base = t.__e, t.__u &= -161, f.__h.length && o.push(f), v && (f.__E = f.__ = null);} catch (e) {if (o.length = d, t.__v = null, c || a != null) {if (e.then) {for (t.__u |= c ? 160 : 128; s && s.nodeType == 8 && s.nextSibling;) s = s.nextSibling;a != null && (a[a.indexOf(s)] = null), t.__e = s;- } else if (a != null) for (E = a.length; E--;) M(a[E]);+ } else if (a != null) for (E = a.length; E--;) j(a[E]);} else t.__e = n.__e;- t.__k ??= n.__k || [], e.then || he(t), m.__e(e, t, n);+ t.__k ??= n.__k || [], e.then || ge(t), m.__e(e, t, n);}- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = ve(n.__e, t, n, r, i, a, o, c, l);+ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = ye(n.__e, t, n, r, i, a, o, c, l);return (u = m.diffed) && u(t), 128 & t.__u ? void 0 : s;}-function he(e) {- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(he));+function ge(e) {+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(ge));}-function ge(e, t, n) {- for (var r = 0; r < n.length; r++) ye(n[r], n[++r], n[++r]);+function _e(e, t, n) {+ for (var r = 0; r < n.length; r++) be(n[r], n[++r], n[++r]);m.__c && m.__c(t, e), e.some(function(t) {try {e = t.__h, t.__h = [], e.some(function(e) {@@ -178,10 +178,10 @@ function ge(e, t, n) {}});}-function _e(e) {- return typeof e != "object" || !e || e.__b > 0 ? e : A(e) ? e.map(_e) : e.constructor === void 0 ? j({}, e) : null;+function ve(e) {+ return typeof e != "object" || !e || e.__b > 0 ? e : te(e) ? e.map(ve) : e.constructor === void 0 ? A({}, e) : null;}-function ve(e, t, n, r, i, a, o, s, c) {+function ye(e, t, n, r, i, a, o, s, c) {var l, u, d, f, h, g, _, v = n.props || O, y = t.props, b = t.type;if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {for (l = 0; l < a.length; l++) if ((h = a[l]) && "setAttribute" in h == !!b && (b ? h.localName == b : h.nodeType == 3)) {@@ -196,15 +196,15 @@ function ve(e, t, n, r, i, a, o, s, c) {if (b == null) v === y || s && e.data == y || (e.data = y);else {if (a = b == "textarea" && y.defaultValue != null ? null : a && p.call(e.childNodes), !s && a != null) for (v = {}, l = 0; l < e.attributes.length; l++) v[(h = e.attributes[l]).name] = h.value;- for (l in v) h = v[l], l == "dangerouslySetInnerHTML" ? d = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || fe(e, l, null, h, i);- for (l in y) h = y[l], l == "children" ? f = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h || fe(e, l, h, v[l], i);+ for (l in v) h = v[l], l == "dangerouslySetInnerHTML" ? d = h : l == "children" || l in y || l == "value" && "defaultValue" in y || l == "checked" && "defaultChecked" in y || pe(e, l, null, h, i);+ for (l in y) h = y[l], l == "children" ? f = h : l == "dangerouslySetInnerHTML" ? u = h : l == "value" ? g = h : l == "checked" ? _ = h : s && typeof h != "function" || v[l] === h || pe(e, l, h, v[l], i);if (u) s || d && (u.__html == d.__html || u.__html == e.innerHTML) || (e.innerHTML = u.__html), t.__k = [];- else if (d && (e.innerHTML = ""), se(t.type == "template" ? e.content : e, A(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && F(n, 0), s, c), a != null) for (l = a.length; l--;) M(a[l]);- s && b != "textarea" || (l = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[l] || b == "progress" && !g || b == "option" && g != v[l]) && fe(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && fe(e, l, _, v[l], i));+ else if (d && (e.innerHTML = ""), ce(t.type == "template" ? e.content : e, te(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && P(n, 0), s, c), a != null) for (l = a.length; l--;) j(a[l]);+ s && b != "textarea" || (l = "value", b == "progress" && g == null ? e.removeAttribute("value") : g != null && (g !== e[l] || b == "progress" && !g || b == "option" && g != v[l]) && pe(e, l, g, v[l], i), l = "checked", _ != null && _ != e[l] && pe(e, l, _, v[l], i));}return e;}-function ye(e, t, n) {+function be(e, t, n) {try {if (typeof e == "function") {var r = typeof e.__u == "function";@@ -214,9 +214,9 @@ function ye(e, t, n) {m.__e(e, n);}}-function be(e, t, n) {+function xe(e, t, n) {var r, i;- if (m.unmount && m.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || ye(r, null, t)), (r = e.__c) != null) {+ if (m.unmount && m.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || be(r, null, t)), (r = e.__c) != null) {if (r.componentWillUnmount) try {r.componentWillUnmount();} catch (e) {@@ -224,15 +224,15 @@ function be(e, t, n) {}r.base = r.__P = r.__n = null;}- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && be(r[i], t, n || typeof e.type != "function");- n || M(e.__e), e.__c = e.__ = e.__e = void 0;+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && xe(r[i], t, n || typeof e.type != "function");+ n || j(e.__e), e.__c = e.__ = e.__e = void 0;}-function xe(e, t, n) {+function Se(e, t, n) {return this.constructor(e, n);}-function Se(e, t, n) {+function Ce(e, t, n) {var r, i, a, o;- t == document && (t = document.documentElement), m.__ && m.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], me(t, e = (!r && n || t).__k = te(N, null, [e]), i || O, O, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? p.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), ge(a, e, o), e.props.children = null;+ t == document && (t = document.documentElement), m.__ && m.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], he(t, e = (!r && n || t).__k = ne(M, null, [e]), i || O, O, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? p.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), _e(a, e, o), e.props.children = null;}p = k.slice, m = { __e: function(e, t, n, r) {for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {@@ -243,23 +243,23 @@ p = k.slice, m = { __e: function(e, t, n, r) {throw e;} }, h = 0, g = function(e) {return e != null && e.constructor === void 0;-}, P.prototype.setState = function(e, t) {- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = j({}, this.state);- typeof e == "function" && (e = e(j({}, n), this.props)), e && j(n, e), e != null && this.__v && (t && this._sb.push(t), ae(this));-}, P.prototype.forceUpdate = function(e) {- this.__v && (this.__e = !0, e && this.__h.push(e), ae(this));-}, P.prototype.render = N, _ = [], y = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, b = function(e, t) {+}, N.prototype.setState = function(e, t) {+ var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = A({}, this.state);+ typeof e == "function" && (e = e(A({}, n), this.props)), e && A(n, e), e != null && this.__v && (t && this._sb.push(t), oe(this));+}, N.prototype.forceUpdate = function(e) {+ this.__v && (this.__e = !0, e && this.__h.push(e), oe(this));+}, N.prototype.render = M, _ = [], y = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, b = function(e, t) {return e.__v.__b - t.__v.__b;-}, oe.__r = 0, x = Math.random().toString(8), S = "__d" + x, C = "__a" + x, w = /(PointerCapture)$|Capture$/i, T = 0, E = pe(!1), D = pe(!0);+}, se.__r = 0, x = Math.random().toString(8), S = "__d" + x, C = "__a" + x, w = /(PointerCapture)$|Capture$/i, T = 0, E = me(!1), D = me(!0);//#endregion//#region src/api.ts-var Ce = class extends Error {+var we = class extends Error {status;body;constructor(e, t, n = null) {super(e), this.name = "ApiError", this.status = t, this.body = n;}-}, we = (e) => {+}, Te = (e) => {if (!e || typeof e != "object") return "";let t = e;for (let e of [@@ -271,8 +271,8 @@ var Ce = class extends Error {if (typeof n == "string" && n) return n;}return "";-}, I = (e) => e instanceof Error ? e.message : String(e);-async function L(e, t) {+}, F = (e) => e instanceof Error ? e.message : String(e);+async function I(e, t) {let n = await fetch(e, {headers: { Accept: "application/json" },credentials: "same-origin",@@ -281,10 +281,10 @@ async function L(e, t) {try {r = await n.json();} catch {}- if (!n.ok) throw new Ce(we(r) || `请求失败(${n.status})`, n.status);+ if (!n.ok) throw new we(Te(r) || `请求失败(${n.status})`, n.status);return r;}-async function R(e, t, n = "POST", r) {+async function L(e, t, n = "POST", r) {let i = await fetch(e, {method: n,...r ? { signal: r } : {},@@ -298,29 +298,29 @@ async function R(e, t, n = "POST", r) {try {a = await i.json();} catch {}- if (!i.ok) throw new Ce(we(a) || `请求失败(${i.status})`, i.status, a);+ if (!i.ok) throw new we(Te(a) || `请求失败(${i.status})`, i.status, a);return a;}//#endregion//#region node_modules/preact/hooks/dist/hooks.module.js-var z, B, Te, Ee, De = 0, Oe = [], V = m, ke = V.__b, Ae = V.__r, je = V.diffed, Me = V.__c, Ne = V.unmount, Pe = V.__;-function Fe(e, t) {- V.__h && V.__h(B, e, De || t), De = 0;- var n = B.__H || (B.__H = {+var R, z, Ee, De, Oe = 0, ke = [], B = m, Ae = B.__b, je = B.__r, Me = B.diffed, Ne = B.__c, Pe = B.unmount, Fe = B.__;+function Ie(e, t) {+ B.__h && B.__h(z, e, Oe || t), Oe = 0;+ var n = z.__H || (z.__H = {__: [],__h: []});return e >= n.__.length && n.__.push({}), n.__[e];}-function H(e) {- return De = 1, Ie(Ge, e);+function V(e) {+ return Oe = 1, Le(Ke, e);}-function Ie(e, t, n) {- var r = Fe(z++, 2);- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ge(void 0, t), function(e) {+function Le(e, t, n) {+ var r = Ie(R++, 2);+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Ke(void 0, t), function(e) {var t = r.__N ? r.__N[0] : r.__[0], n = r.t(t, e);t !== n && (r.__N = [n, r.__[1]], r.__c.setState({}));- }], r.__c = B, !B.__f)) {+ }], r.__c = z, !z.__f)) {var i = function(e, t, n) {if (!r.__c.__H) return !0;var i = !1, o = r.__c.props !== e;@@ -336,112 +336,112 @@ function Ie(e, t, n) {}return !i || o;};- B.__f = !0;- var a = B.shouldComponentUpdate, o = B.componentWillUpdate;- B.componentWillUpdate = function(e, t, n) {+ z.__f = !0;+ var a = z.shouldComponentUpdate, o = z.componentWillUpdate;+ z.componentWillUpdate = function(e, t, n) {if (this.__e) {var r = a;a = void 0, i(e, t, n), a = r;}o && o.call(this, e, t, n);- }, B.shouldComponentUpdate = i;+ }, z.shouldComponentUpdate = i;}return r.__N || r.__;}-function Le(e, t) {- var n = Fe(z++, 3);- !V.__s && We(n.__H, t) && (n.__ = e, n.u = t, B.__H.__h.push(n));+function Re(e, t) {+ var n = Ie(R++, 3);+ !B.__s && Ge(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));}-function U(e, t) {- var n = Fe(z++, 4);- !V.__s && We(n.__H, t) && (n.__ = e, n.u = t, B.__h.push(n));+function H(e, t) {+ var n = Ie(R++, 4);+ !B.__s && Ge(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));}-function W(e) {- return De = 5, Re(function() {+function U(e) {+ return Oe = 5, ze(function() {return { current: e };}, []);}-function Re(e, t) {- var n = Fe(z++, 7);- return We(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;+function ze(e, t) {+ var n = Ie(R++, 7);+ return Ge(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;}-function ze() {- for (var e; e = Oe.shift();) {+function Be() {+ for (var e; e = ke.shift();) {var t = e.__H;if (e.__P && t) try {- t.__h.some(He), t.__h.some(Ue), t.__h = [];+ t.__h.some(Ue), t.__h.some(We), t.__h = [];} catch (n) {- t.__h = [], V.__e(n, e.__v);+ t.__h = [], B.__e(n, e.__v);}}}-V.__b = function(e) {- B = null, ke && ke(e);-}, V.__ = function(e, t) {- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Pe && Pe(e, t);-}, V.__r = function(e) {- Ae && Ae(e), z = 0;- var t = (B = e.__c).__H;- t && (Te === B ? (t.__h = [], B.__h = [], t.__.some(function(e) {+B.__b = function(e) {+ z = null, Ae && Ae(e);+}, B.__ = function(e, t) {+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Fe && Fe(e, t);+}, B.__r = function(e) {+ je && je(e), R = 0;+ var t = (z = e.__c).__H;+ t && (Ee === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {e.__N && (e.__ = e.__N), e.u = e.__N = void 0;- })) : (t.__h.some(He), t.__h.some(Ue), t.__h = [], z = 0)), Te = B;-}, V.diffed = function(e) {- je && je(e);+ })) : (t.__h.some(Ue), t.__h.some(We), t.__h = [], R = 0)), Ee = z;+}, B.diffed = function(e) {+ Me && Me(e);var t = e.__c;- t && t.__H && (t.__H.__h.length && (Oe.push(t) !== 1 && Ee === V.requestAnimationFrame || ((Ee = V.requestAnimationFrame) || Ve)(ze)), t.__H.__.some(function(e) {+ t && t.__H && (t.__H.__h.length && (ke.push(t) !== 1 && De === B.requestAnimationFrame || ((De = B.requestAnimationFrame) || He)(Be)), t.__H.__.some(function(e) {e.u &&= (e.__H = e.u, void 0);- })), Te = B = null;-}, V.__c = function(e, t) {+ })), Ee = z = null;+}, B.__c = function(e, t) {t.some(function(e) {try {- e.__h.some(He), e.__h = e.__h.filter(function(e) {- return !e.__ || Ue(e);+ e.__h.some(Ue), e.__h = e.__h.filter(function(e) {+ return !e.__ || We(e);});} catch (n) {t.some(function(e) {e.__h &&= [];- }), t = [], V.__e(n, e.__v);+ }), t = [], B.__e(n, e.__v);}- }), Me && Me(e, t);-}, V.unmount = function(e) {- Ne && Ne(e);+ }), Ne && Ne(e, t);+}, B.unmount = function(e) {+ Pe && Pe(e);var t, n = e.__c;n && n.__H && (n.__H.__.some(function(e) {try {- He(e);+ Ue(e);} catch (e) {t = e;}- }), n.__H = void 0, t && V.__e(t, n.__v));+ }), n.__H = void 0, t && B.__e(t, n.__v));};-var Be = typeof requestAnimationFrame == "function";-function Ve(e) {+var Ve = typeof requestAnimationFrame == "function";+function He(e) {var t, n = function() {- clearTimeout(r), Be && cancelAnimationFrame(t), setTimeout(e);+ clearTimeout(r), Ve && cancelAnimationFrame(t), setTimeout(e);}, r = setTimeout(n, 35);- Be && (t = requestAnimationFrame(n));-}-function He(e) {- var t = B, n = e.__c;- typeof n == "function" && (e.__c = void 0, n()), B = t;+ Ve && (t = requestAnimationFrame(n));}function Ue(e) {- var t = B;- e.__c = e.__(), B = t;+ var t = z, n = e.__c;+ typeof n == "function" && (e.__c = void 0, n()), z = t;}-function We(e, t) {+function We(e) {+ var t = z;+ e.__c = e.__(), z = t;+}+function Ge(e, t) {return !e || e.length !== t.length || t.some(function(t, n) {return t !== e[n];});}-function Ge(e, t) {+function Ke(e, t) {return typeof t == "function" ? t(e) : t;}//#endregion//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js-var Ke = 0;+var qe = 0;Array.isArray;-function G(e, t, n, r, i, a) {+function W(e, t, n, r, i, a) {t ||= {};var o, s, c = t;if ("ref" in c) for (s in c = {}, t) s == "ref" ? o = t[s] : c[s] = t[s];@@ -456,7 +456,7 @@ function G(e, t, n, r, i, a) {__e: null,__c: null,constructor: void 0,- __v: --Ke,+ __v: --qe,__i: -1,__u: 0,__source: i,@@ -467,15 +467,15 @@ function G(e, t, n, r, i, a) {}//#endregion//#region src/islands/access-settings.tsx-function qe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1 }) {- return /* @__PURE__ */ G("div", {+function Je({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1 }) {+ return /* @__PURE__ */ W("div", {class: "configfield",children: [- /* @__PURE__ */ G("label", {+ /* @__PURE__ */ W("label", {for: e,children: t}),- /* @__PURE__ */ G("input", {+ /* @__PURE__ */ W("input", {id: e,class: "geist-input",type: "password",@@ -487,7 +487,7 @@ function qe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:"aria-invalid": !!i,"aria-describedby": i || a ? `${e}-hint` : void 0}),- i || a ? /* @__PURE__ */ G("p", {+ i || a ? /* @__PURE__ */ W("p", {id: `${e}-hint`,class: i ? "configbad" : "confighelp",role: i ? "alert" : void 0,@@ -496,9 +496,9 @@ function qe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:]});}-function Je({ initial: e, receipt: t }) {- let [r, i] = H(e), [a, o] = H(""), [s, l] = H(""), [u, d] = H(""), [f, p] = H(!1), [m, h] = H(""), [g, _] = H({}), v = W(null), y = W(!1), b = W(null);- return /* @__PURE__ */ G("form", {+function Ye({ initial: e, receipt: t }) {+ let [r, i] = V(e), [a, o] = V(""), [s, l] = V(""), [u, d] = V(""), [f, p] = V(!1), [m, h] = V(""), [g, _] = V({}), v = U(null), y = U(!1), b = U(null);+ return /* @__PURE__ */ W("form", {class: "configfieldset",onSubmit: async (e) => {if (e.preventDefault(), y.current) return;@@ -510,7 +510,7 @@ function Je({ initial: e, receipt: t }) {}y.current = !0, c(b.current, !0);try {- let e = await R("/api/configuration/access", {+ let e = await L("/api/configuration/access", {revision: r.revision,action: f ? "disable" : "set",confirm_disable: f,@@ -520,8 +520,8 @@ function Je({ initial: e, receipt: t }) {});i(e), o(""), l(""), d(""), p(!1), _({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");} catch (e) {- let t = e instanceof Ce ? e.body : null, n = t?.errors || t?.detail?.errors;- n ? _(n) : h(I(e));+ let t = e instanceof we ? e.body : null, n = t?.errors || t?.detail?.errors;+ n ? _(n) : h(F(e));} finally {y.current = !1, c(b.current, !1);}@@ -529,17 +529,17 @@ function Je({ initial: e, receipt: t }) {"aria-labelledby": "accessTitle",noValidate: !0,ref: v,- children: [/* @__PURE__ */ G("div", {+ children: [/* @__PURE__ */ W("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ G("div", {+ /* @__PURE__ */ W("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("accessTitle", "访问密码") } }), /* @__PURE__ */ G("p", {+ children: [/* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: n("accessTitle", "访问密码") } }), /* @__PURE__ */ W("p", {class: "confighelp",children: r.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : r.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : r.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"})]}),- r.mode === "password" ? /* @__PURE__ */ G(qe, {+ r.mode === "password" ? /* @__PURE__ */ W(Je, {id: "access-current",label: "当前访问密码",value: a,@@ -547,46 +547,46 @@ function Je({ initial: e, receipt: t }) {error: g.current_password,current: !0}) : null,- !f && r.mode !== "locked" ? /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G(qe, {+ !f && r.mode !== "locked" ? /* @__PURE__ */ W(M, { children: [/* @__PURE__ */ W(Je, {id: "access-password",label: r.mode === "password" ? "新访问密码" : "设置访问密码",value: s,onInput: l,error: g.password,help: "至少 8 个字符。保存后其他设备需要重新登录。"- }), /* @__PURE__ */ G(qe, {+ }), /* @__PURE__ */ W(Je, {id: "access-confirm",label: "确认访问密码",value: u,onInput: d,error: g.confirmation})] }) : null,- r.mode === "password" || r.mode === "legacy" ? /* @__PURE__ */ G("label", {+ r.mode === "password" || r.mode === "legacy" ? /* @__PURE__ */ W("label", {class: "configcheck",- children: [/* @__PURE__ */ G("span", {+ children: [/* @__PURE__ */ W("span", {class: "pcheck",- children: [/* @__PURE__ */ G("input", {+ children: [/* @__PURE__ */ W("input", {type: "checkbox",checked: f,onChange: (e) => p(e.currentTarget.checked)- }), /* @__PURE__ */ G("span", {+ }), /* @__PURE__ */ W("span", {"aria-hidden": "true",- children: /* @__PURE__ */ G("svg", {+ children: /* @__PURE__ */ W("svg", {viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-check" })+ children: /* @__PURE__ */ W("use", { href: "#i-check" })})})]- }), /* @__PURE__ */ G("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]+ }), /* @__PURE__ */ W("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]}) : null,- m ? /* @__PURE__ */ G("p", {+ m ? /* @__PURE__ */ W("p", {class: "configbad",role: "alert",children: m}) : null]- }), r.mode === "locked" ? null : /* @__PURE__ */ G("div", {+ }), r.mode === "locked" ? null : /* @__PURE__ */ W("div", {class: "geist-fieldset-footer",- children: [/* @__PURE__ */ G("p", { children: "保存后立即生效。" }), /* @__PURE__ */ G("button", {+ children: [/* @__PURE__ */ W("p", { children: "保存后立即生效。" }), /* @__PURE__ */ W("button", {class: "geist-button primary",type: "submit",ref: b,@@ -596,30 +596,177 @@ function Je({ initial: e, receipt: t }) {});}//#endregion+//#region src/jobs.ts+async function Xe(e) {+ let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;+ for (; e.active();) {+ let r;+ try {+ r = await e.read(AbortSignal.timeout(15e3));+ } catch (r) {+ if (!e.active()) return;+ n++, e.disconnected(r), await t(Math.min(2e3 * 2 ** Math.min(n, 4), 3e4));+ continue;+ }+ if (!e.active() || (n = 0, e.render(r), e.once) || !e.keepWatching && r.status !== "running") return;+ await t(2e3);+ }+}+function Ze(e) {+ let t = document.createElement("div");+ e.host.hidden = !0, t.dataset.followJob = "", t.setAttribute("aria-live", "polite"), e.host.prepend(t);+ let n = e.storageKey || "peach-follow-job", r = sessionStorage.getItem(n) || void 0, i = !1;+ Xe({+ read: e.read,+ active: () => !i && e.active() && t.isConnected,+ keepWatching: e.watchIdle !== !1,+ render: (a) => {+ let o = a.status === "running";+ if (e.host.hidden = !o, e.busy(o), o) {+ r = a.job_id, r && sessionStorage.setItem(n, r);+ let i = a.current, o = (i?.attempt || 1) > 1 ? ` · 第 ${i?.attempt}/${i?.max_attempts} 次尝试${i?.retry_in ? `,${i.retry_in} 秒后重试` : ""}` : "", s = (e.title || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = e.loading(s) + ((a.total || 0) > 0 ? e.progress(a.checked || 0, a.total) : "");+ t.innerHTML = e.container ? e.container(c) : c;+ } else if (r && r === a.job_id) r = void 0, i = !0, e.host.hidden = a.status !== "failed", sessionStorage.removeItem(n), t.innerHTML = a.status === "failed" ? e.note(a.error || "检查失败") : "", e.complete(a);+ else {+ if (r && a.status === "idle") {+ e.host.hidden = !1, t.innerHTML = e.note("任务状态已失效,请重新发起任务"), sessionStorage.removeItem(n), i = !0;+ return;+ }+ t.innerHTML = "";+ }+ },+ disconnected: () => {+ e.host.hidden = !1, t.innerHTML = e.note("暂时无法读取进度,正在重新连接…");+ }+ });+}+//#endregion+//#region src/islands/library-processing.tsx+var Qe = (e, t) => I("/api/library-processing", t);+function $e({ data: e, error: t, toast: o, onComplete: s, mode: l, monitor: u }) {+ let [d, f] = V(e || { status: "idle" }), [p, m] = V(t), [h, g] = V(!1), [_, v] = V(!1), y = U(new AbortController()), b = U(0), x = U(d.status), S = U(null), C = h || d.status === "running";+ H(() => c(S.current, C), [C]);+ async function w() {+ let e = ++b.current;+ await Xe({+ read: (e) => I("/api/library-processing", e),+ active: () => !y.current.signal.aborted && b.current === e,+ keepWatching: l === "notice" || !!u,+ render: (e) => {+ f(e), m(""), e.status === "complete" && x.current === "running" && l !== "notice" && (v(!0), o("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && s?.(), x.current = e.status;+ },+ disconnected: () => m("连接中断,正在重新读取处理进度")+ });+ }+ Re(() => ((d.status === "running" || l === "notice" || u) && w(), () => y.current.abort()), []);+ async function T() {+ if (!C) {+ g(!0), m(""), v(!1);+ try {+ let e = await L("/api/library-processing", {}, "POST", y.current.signal);+ if (y.current.signal.aborted) return;+ x.current = e.status, f(e), g(!1), await w();+ } catch (e) {+ y.current.signal.aborted || (m(F(e)), g(!1));+ }+ }+ }+ return l === "notice" ? !p && d.status !== "running" && d.status !== "failed" ? null : /* @__PURE__ */ W("div", {+ class: "library-processing-banner",+ role: "status",+ children: [/* @__PURE__ */ W("span", { children: p || (d.status === "failed" ? "扫描与资料采集未完成" : `${d.stage || "正在整理馆藏"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) }), /* @__PURE__ */ W("a", {+ class: "geist-button",+ href: "/configuration#libraryProcessing",+ children: p || d.status === "failed" ? "查看并处理" : "查看进度"+ })]+ }) : /* @__PURE__ */ W(M, { children: [/* @__PURE__ */ W("div", {+ class: "geist-fieldset-content library-processing",+ children: [+ /* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: n("cleanupScrapingTitle", "扫描与采集") } }),+ /* @__PURE__ */ W("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),+ /* @__PURE__ */ W("div", {+ "aria-live": "polite",+ children: [+ d.status === "running" && /* @__PURE__ */ W(M, { children: [/* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: r(`${d.stage || "正在处理"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) } }), !!d.total && /* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: a(`已处理 ${d.checked || 0} / ${d.total} 个视频`, d.checked || 0, d.total) } })] }),+ (p || d.status === "failed") && /* @__PURE__ */ W("div", {+ role: "alert",+ dangerouslySetInnerHTML: { __html: i(p || d.error || "处理未完成,请重试", { variant: "error" }) }+ }),+ d.status === "failed" && !!d.issues?.length && /* @__PURE__ */ W("ul", { children: d.issues.slice(0, 20).map((e) => /* @__PURE__ */ W("li", { children: [+ e.asset_id ? /* @__PURE__ */ W("a", {+ href: `/item/${e.asset_id}`,+ children: "查看视频"+ }) : null,+ e.asset_id ? ":" : "",+ e.message+ ] })) }),+ _ && /* @__PURE__ */ W("p", { children: [+ "已扫描 ",+ d.scanned || 0,+ " 个文件,识别 ",+ d.identified || 0,+ " 个番号,整理 ",+ d.candidates || 0,+ " 组资料候选。"+ ] })+ ]+ })+ ]+ }), /* @__PURE__ */ W("footer", {+ class: "geist-fieldset-footer",+ "data-geist-fieldset-footer": !0,+ children: [+ /* @__PURE__ */ W("a", {+ class: "geist-button",+ href: "/scraping",+ children: "采集来源"+ }),+ !!d.candidates && /* @__PURE__ */ W("a", {+ class: "geist-button",+ href: "/review",+ children: "复核资料"+ }),+ /* @__PURE__ */ W("button", {+ ref: S,+ type: "button",+ class: "geist-button primary",+ onClick: () => void T(),+ children: d.status === "failed" ? "重试未完成项" : "扫描并补全资料"+ })+ ]+ })] });+}+//#endregion//#region src/islands/configuration.tsx-var Ye = "/api/configuration", Xe = "/api/pick-folder", Ze = 8e3, Qe = (e, t) => L(Ye, t), K = ({ html: e, class: t }) => /* @__PURE__ */ G("div", {+var et = "/api/configuration", tt = "/api/pick-folder", nt = 8e3, rt = (e, t) => Promise.all([I(et, t), I("/api/library-processing", t).catch((e) => ({+ status: "failed",+ error: F(e)+}))]).then(([e, t]) => ({+ ...e,+ processing: t+})), G = ({ html: e, class: t }) => /* @__PURE__ */ W("div", {class: t,dangerouslySetInnerHTML: { __html: e }-}), $e = (e) => !(e instanceof Ce) || e.status !== 400 ? null : e.body?.errors ?? null;-function et({ facts: e }) {- return /* @__PURE__ */ G("section", {+}), it = (e) => !(e instanceof we) || e.status !== 400 ? null : e.body?.errors ?? null;+function at({ facts: e }) {+ return /* @__PURE__ */ W("section", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configFactsTitle",- children: /* @__PURE__ */ G("div", {+ children: /* @__PURE__ */ W("div", {class: "geist-fieldset-content",- children: [/* @__PURE__ */ G(K, { html: n("configFactsTitle", "运行信息") }), /* @__PURE__ */ G("dl", {+ children: [/* @__PURE__ */ W(G, { html: n("configFactsTitle", "运行信息") }), /* @__PURE__ */ W("dl", {class: "configfacts",- children: e.map((e) => /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("dt", { children: e.term }), /* @__PURE__ */ G("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ G("span", {+ children: e.map((e) => /* @__PURE__ */ W(M, { children: [/* @__PURE__ */ W("dt", { children: e.term }), /* @__PURE__ */ W("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ W("span", {class: "confighelp",- children: [" ", /* @__PURE__ */ G("a", {+ children: [" ", /* @__PURE__ */ W("a", {href: e.download_url,target: "_blank",rel: "noreferrer",- children: [e.download_label, /* @__PURE__ */ G("svg", {+ children: [e.download_label, /* @__PURE__ */ W("svg", {"aria-hidden": "true",viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ W("use", { href: "#i-external-link" })})]})]}) : null] })] }))@@ -627,57 +774,57 @@ function et({ facts: e }) {})});}-function tt({ data: t }) {- let [r, i] = H(t.media_sources), [a, o] = H(""), l = W(null);- Le(() => () => l.current?.abort(), []);+function ot({ data: t }) {+ let [r, i] = V(t.media_sources), [a, o] = V(""), l = U(null);+ Re(() => () => l.current?.abort(), []);let u = async (e) => {if (l.current) return;let t = new AbortController();l.current = t, c(e, !0), o("");try {- let e = await L(Ye, t.signal);+ let e = await I(et, t.signal);t.signal.aborted || i(e.media_sources);} catch (e) {- t.signal.aborted || o(I(e));+ t.signal.aborted || o(F(e));} finally {l.current = null, c(e, !1);}};- return r ? /* @__PURE__ */ G("section", {+ return r ? /* @__PURE__ */ W("section", {class: "configfieldset","aria-labelledby": "configMountsTitle",- children: [/* @__PURE__ */ G("div", {+ children: [/* @__PURE__ */ W("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ G(K, { html: n("configMountsTitle", "挂载状态") }),- /* @__PURE__ */ G("dl", {+ /* @__PURE__ */ W(G, { html: n("configMountsTitle", "挂载状态") }),+ /* @__PURE__ */ W("dl", {class: "configfacts",- children: r.map((t) => /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("dt", { children: [/* @__PURE__ */ G("span", {+ children: r.map((t) => /* @__PURE__ */ W(M, { children: [/* @__PURE__ */ W("dt", { children: [/* @__PURE__ */ W("span", {"aria-hidden": "true",dangerouslySetInnerHTML: { __html: s(e[t.location]) }}), {local: "本地磁盘",115: "CloudDrive · 115",pikpak: "CloudDrive · PikPak"- }[t.location] || t.location] }), /* @__PURE__ */ G("dd", { children: [+ }[t.location] || t.location] }), /* @__PURE__ */ W("dd", { children: [t.path || "未配置挂载点"," ",- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {class: `configstatus ${t.online === !0 ? "online" : t.online === !1 ? "offline" : "unknown"}`,children: t.online === !0 ? "在线" : t.online === !1 ? "离线" : "未检测"})] })] }))}),- a ? /* @__PURE__ */ G("p", {+ a ? /* @__PURE__ */ W("p", {class: "configbad",role: "alert",children: a}) : null]- }), /* @__PURE__ */ G("div", {+ }), /* @__PURE__ */ W("div", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: /* @__PURE__ */ G("button", {+ children: /* @__PURE__ */ W("button", {type: "button",class: "geist-button",onClick: (e) => u(e.currentTarget),@@ -686,9 +833,9 @@ function tt({ data: t }) {})]}) : null;}-function nt({ value: t, label: n, onChange: r }) {- let i = W(null), a = W(null), s = W(r);- return s.current = r, U(() => {+function st({ value: t, label: n, onChange: r }) {+ let i = U(null), a = U(null), s = U(r);+ return s.current = r, H(() => {let r = i.current;r.innerHTML = o([["local", "本地磁盘"],@@ -705,71 +852,71 @@ function nt({ value: t, label: n, onChange: r }) {return c.addEventListener("change", u), () => {a.current = null, c.disabled = !0, c.removeEventListener("change", u), r.replaceChildren();};- }, [n]), U(() => {+ }, [n]), H(() => {a.current && (a.current.value = t);- }, [t]), /* @__PURE__ */ G("div", {+ }, [t]), /* @__PURE__ */ W("div", {ref: i,class: "configsourcecontrol"});}-function rt({ data: e, receipt: t }) {+function ct({ data: e, receipt: t }) {let r = e.media_sources?.filter((e) => ["local","115","pikpak"- ].includes(e.location)), [a, o] = H(r?.length ? r.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, l] = H(r?.map((e) => e.location) ?? []), [u, d] = H(r?.map((e) => e.root) ?? []), [f, p] = H(String(e.port)), [m, h] = H(!1), [g, _] = H([]), [v, y] = H(""), [b, x] = H(""), [S, C] = H(null), [w, T] = H(null), E = W(!1), D = W(e.revision), O = W([]), k = W(null);- U(() => {+ ].includes(e.location)), [a, o] = V(r?.length ? r.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, l] = V(r?.map((e) => e.location) ?? []), [u, d] = V(r?.map((e) => e.root) ?? []), [f, p] = V(String(e.port)), [m, h] = V(!1), [g, _] = V([]), [v, y] = V(""), [b, x] = V(""), [S, C] = V(null), [w, T] = V(null), E = U(!1), D = U(e.revision), O = U([]), k = U(null);+ H(() => {w !== null && (O.current[w]?.focus(), T(null));- }, [w]), Le(() => {+ }, [w]), Re(() => {if (!S) return;- let e = setTimeout(() => location.assign(S.url), Ze);+ let e = setTimeout(() => location.assign(S.url), nt);return () => clearTimeout(e);}, [S]);let ee = (e, t) => {o((n) => n.map((n, r) => r === e ? t : n));- }, A = () => {+ }, te = () => {T(a.length), o((e) => [...e, ""]);- }, j = (e) => {+ }, A = (e) => {l((t) => t.filter((t, n) => n !== e)), d((t) => t.filter((t, n) => n !== e)), o((t) => t.filter((t, n) => n !== e)), _((t) => t.filter((t, n) => n !== e));- }, M = (e, t) => {+ }, j = (e, t) => {_((n) => {let r = [...n];for (; r.length <= e;) r.push("");return r[e] = t, r;});- }, te = async (e, t) => {+ }, ne = async (e, t) => {if (t.getAttribute("aria-busy") !== "true") {c(t, !0);try {- let { path: t } = await R(Xe, { initial: a[e] ?? "" });- t && (ee(e, t), M(e, ""));+ let { path: t } = await L(tt, { initial: a[e] ?? "" });+ t && (ee(e, t), j(e, ""));} catch (t) {- M(e, I(t));+ j(e, F(t));} finally {c(t, !1);}}};- return S ? /* @__PURE__ */ G("div", {+ return S ? /* @__PURE__ */ W("div", {class: "configsaved",role: "status",- children: /* @__PURE__ */ G("div", {+ children: /* @__PURE__ */ W("div", {class: "geist-note geist-note-success",role: "note",- children: [/* @__PURE__ */ G("svg", {+ children: [/* @__PURE__ */ W("svg", {"aria-hidden": "true",viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-check" })- }), /* @__PURE__ */ G("p", { children: /* @__PURE__ */ G("span", { children: [+ children: /* @__PURE__ */ W("use", { href: "#i-check" })+ }), /* @__PURE__ */ W("p", { children: /* @__PURE__ */ W("span", { children: ["配置已保存,Peach 正在重新启动。稍后自动跳转,或点击",- /* @__PURE__ */ G("a", {+ /* @__PURE__ */ W("a", {href: S.url,children: "进入馆藏"}),"。"] }) })]})- }) : /* @__PURE__ */ G("form", {+ }) : /* @__PURE__ */ W("form", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configTitle",@@ -777,7 +924,7 @@ function rt({ data: e, receipt: t }) {if (n.preventDefault(), !E.current) {E.current = !0, c(k.current, !0), x("");try {- let n = await R(Ye, {+ let n = await L(et, {revision: D.current,media_dirs: a,...e.media_sources ? { media_sources: a.map((e, t) => ({@@ -790,38 +937,38 @@ function rt({ data: e, receipt: t }) {});D.current = n.revision, _([]), y(""), t("已保存配置"), C(n);} catch (e) {- let t = $e(e);- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(I(e)));+ let t = it(e);+ t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(F(e)));} finally {E.current = !1, c(k.current, !1);}}},noValidate: !0,- children: [/* @__PURE__ */ G("div", {+ children: [/* @__PURE__ */ W("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ G(K, { html: n("configTitle", "这台电脑") }),- /* @__PURE__ */ G("div", {+ /* @__PURE__ */ W(G, { html: n("configTitle", "这台电脑") }),+ /* @__PURE__ */ W("div", {class: "configfield",children: [- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {class: "configlabel",id: "configDirsLabel",children: "媒体文件夹"}),- /* @__PURE__ */ G("div", {+ /* @__PURE__ */ W("div", {class: "configdirs",role: "group","aria-labelledby": "configDirsLabel",- children: a.map((t, n) => /* @__PURE__ */ G("div", {+ children: a.map((t, n) => /* @__PURE__ */ W("div", {class: "configdir",children: [- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {class: "configpathlabel",children: ["本机文件夹 ", n + 1]}),- /* @__PURE__ */ G("input", {+ /* @__PURE__ */ W("input", {class: "geist-input",type: "text",value: t,@@ -832,33 +979,33 @@ function rt({ data: e, receipt: t }) {O.current[n] = e;}}),- /* @__PURE__ */ G("button", {+ /* @__PURE__ */ W("button", {type: "button",class: "geist-button configpick","aria-label": "选择文件夹",- onClick: (e) => te(n, e.currentTarget),- children: /* @__PURE__ */ G("svg", {+ onClick: (e) => ne(n, e.currentTarget),+ children: /* @__PURE__ */ W("svg", {viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ G("use", { href: "#i-folder-search" })+ children: /* @__PURE__ */ W("use", { href: "#i-folder-search" })})}),- a.length > 1 ? /* @__PURE__ */ G("button", {+ a.length > 1 ? /* @__PURE__ */ W("button", {type: "button",class: "geist-button configrm","aria-label": "移除这个文件夹",- onClick: () => j(n),- children: /* @__PURE__ */ G("svg", {+ onClick: () => A(n),+ children: /* @__PURE__ */ W("svg", {viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ G("use", { href: "#i-x" })+ children: /* @__PURE__ */ W("use", { href: "#i-x" })})}) : null,- /* @__PURE__ */ G("div", {+ /* @__PURE__ */ W("div", {class: "configsource",- children: [/* @__PURE__ */ G("div", {+ children: [/* @__PURE__ */ W("div", {class: "configsourcelabel",- children: ["媒体来源", /* @__PURE__ */ G(nt, {+ children: ["媒体来源", /* @__PURE__ */ W(st, {label: `媒体来源 ${n + 1}`,value: s[n] || "local",onChange: (e) => {@@ -866,7 +1013,7 @@ function rt({ data: e, receipt: t }) {t[n] = e, l(t);}})]- }), e.windows === !1 ? /* @__PURE__ */ G("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ G("input", {+ }), e.windows === !1 ? /* @__PURE__ */ W("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ W("input", {class: "geist-input","aria-label": `Windows 中的对应路径 ${n + 1}`,value: u[n] || "",@@ -877,7 +1024,7 @@ function rt({ data: e, receipt: t }) {}})] }) : null]}),- g[n] ? /* @__PURE__ */ G("p", {+ g[n] ? /* @__PURE__ */ W("p", {class: "configbad",role: "alert",children: g[n]@@ -885,61 +1032,61 @@ function rt({ data: e, receipt: t }) {]}, n))}),- /* @__PURE__ */ G("button", {+ /* @__PURE__ */ W("button", {type: "button",class: "geist-button configadd",- onClick: A,+ onClick: te,children: "添加文件夹"}),- s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ G("p", {+ s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ W("p", {class: "confighelp",- children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ G("a", {+ children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ W("a", {href: "https://www.clouddrive2.com/help.html",target: "_blank",rel: "noreferrer",- children: ["挂载帮助", /* @__PURE__ */ G("svg", {+ children: ["挂载帮助", /* @__PURE__ */ W("svg", {"aria-hidden": "true",viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ W("use", { href: "#i-external-link" })})]})]}) : null,- s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ G("p", {+ s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ W("p", {class: "confighelp",children: ["未检测到 ",e.name,"。",- /* @__PURE__ */ G("a", {+ /* @__PURE__ */ W("a", {href: e.download_url,target: "_blank",rel: "noreferrer",children: ["下载 ",e.name,- /* @__PURE__ */ G("svg", {+ /* @__PURE__ */ W("svg", {"aria-hidden": "true",viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ W("use", { href: "#i-external-link" })})]})]})) : null,- e.windows === !1 ? /* @__PURE__ */ G("p", {+ e.windows === !1 ? /* @__PURE__ */ W("p", {class: "confighelp",children: "本机文件夹是这台电脑读取媒体的位置。Windows 中的对应路径用于匹配馆藏中已有的路径,例如 B:\\ 对应本机挂载文件夹。"}) : null]}),- e.port_editable === !1 ? null : /* @__PURE__ */ G("div", {+ e.port_editable === !1 ? null : /* @__PURE__ */ W("div", {class: "configfield",children: [- /* @__PURE__ */ G("label", {+ /* @__PURE__ */ W("label", {for: "configPort",children: "本机访问端口"}),- /* @__PURE__ */ G("input", {+ /* @__PURE__ */ W("input", {id: "configPort",class: "geist-input",type: "text",@@ -948,43 +1095,43 @@ function rt({ data: e, receipt: t }) {"aria-invalid": v ? "true" : void 0,onInput: (e) => p(e.currentTarget.value)}),- v ? /* @__PURE__ */ G("p", {+ v ? /* @__PURE__ */ W("p", {class: "configbad",role: "alert",children: v}) : null,- /* @__PURE__ */ G("p", {+ /* @__PURE__ */ W("p", {class: "confighelp",children: "浏览器地址里冒号后面的数字,一般不用改。"})]}),- /* @__PURE__ */ G("label", {+ /* @__PURE__ */ W("label", {class: "configcheck",- children: [/* @__PURE__ */ G("span", {+ children: [/* @__PURE__ */ W("span", {class: "pcheck",- children: [/* @__PURE__ */ G("input", {+ children: [/* @__PURE__ */ W("input", {type: "checkbox",checked: m,onChange: (e) => h(e.currentTarget.checked)- }), /* @__PURE__ */ G("span", {+ }), /* @__PURE__ */ W("span", {"aria-hidden": "true",- children: /* @__PURE__ */ G("svg", {+ children: /* @__PURE__ */ W("svg", {viewBox: "0 0 24 24",- children: /* @__PURE__ */ G("use", { href: "#i-check" })+ children: /* @__PURE__ */ W("use", { href: "#i-check" })})})]- }), /* @__PURE__ */ G("span", { children: "保存后扫描媒体文件夹" })]+ }), /* @__PURE__ */ W("span", { children: "保存后扫描并补全资料" })]}),- b ? /* @__PURE__ */ G(K, { html: i(b, {+ b ? /* @__PURE__ */ W(G, { html: i(b, {variant: "error",label: "没有保存"}) }) : null]- }), /* @__PURE__ */ G("div", {+ }), /* @__PURE__ */ W("div", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: [/* @__PURE__ */ G("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ G("button", {+ children: [/* @__PURE__ */ W("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ W("button", {type: "submit",class: "geist-button primary",ref: k,@@ -993,51 +1140,63 @@ function rt({ data: e, receipt: t }) {})]});}-function it({ receipt: e, data: t, error: n }) {- return n || !t ? /* @__PURE__ */ G(K, {+function lt({ receipt: e, data: t, error: n }) {+ return n || !t ? /* @__PURE__ */ W(G, {class: "configpage",html: i(n || "没有读到配置", {variant: "error",label: "打不开配置"})- }) : /* @__PURE__ */ G("div", {+ }) : /* @__PURE__ */ W("div", {class: "configpage",children: [- t.editable ? /* @__PURE__ */ G(rt, {+ t.editable ? /* @__PURE__ */ W(ct, {data: t,receipt: e- }) : /* @__PURE__ */ G(K, { html: i(t.notice, {+ }) : /* @__PURE__ */ W(G, { html: i(t.notice, {variant: "secondary",label: "只读"}) }),- t.access ? /* @__PURE__ */ G(Je, {+ t.access ? /* @__PURE__ */ W(Ye, {initial: t.access,receipt: e}) : null,- /* @__PURE__ */ G(et, { facts: t.facts }),- /* @__PURE__ */ G(tt, { data: t })+ /* @__PURE__ */ W("section", {+ id: "libraryProcessing",+ class: "configfieldset",+ "data-geist-fieldset": !0,+ "aria-labelledby": "cleanupScrapingTitle",+ children: /* @__PURE__ */ W($e, {+ data: t.processing || { status: "idle" },+ error: "",+ toast: e,+ monitor: !0+ })+ }),+ /* @__PURE__ */ W(at, { facts: t.facts }),+ /* @__PURE__ */ W(ot, { data: t })]});}//#endregion//#region node_modules/@preact/signals-core/dist/signals-core.module.js-var at = Symbol.for("preact-signals");-function ot() {- if (J > 1) J--;+var ut = Symbol.for("preact-signals");+function dt() {+ if (Y > 1) Y--;else {var e, t = !1;for ((function() {- var e = mt;- for (mt = void 0; e !== void 0;) {+ var e = _t;+ for (_t = void 0; e !== void 0;) {var t = e.S;if (t.v === e.v) for (var n = t.t; n !== void 0; n = n.x) n.i === e.i && (n.i = t.i);e = e.o;}- })(); ut !== void 0;) {- var n = ut;- for (ut = void 0, dt++; n !== void 0;) {+ })(); J !== void 0;) {+ var n = J;+ for (J = void 0, mt++; n !== void 0;) {var r = n.u;- if (n.u = void 0, n.f &= -3, !(8 & n.f) && vt(n)) try {+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && xt(n)) try {n.c();} catch (n) {t ||= (e = n, !0);@@ -1045,30 +1204,30 @@ function ot() {n = r;}}- if (dt = 0, J--, t) throw e;+ if (mt = 0, Y--, t) throw e;}}-function st(e) {- if (J > 0) return e();- pt = ++ft, J++;+function ft(e) {+ if (Y > 0) return e();+ gt = ++ht, Y++;try {return e();} finally {- ot();+ dt();}}-var ct, q = void 0;-function lt(e) {- var t = q, n = ct;- q = void 0, ct = void 0;+var K, q = void 0;+function pt(e) {+ var t = q, n = K;+ q = void 0, K = void 0;try {return e();} finally {- q = t, ct = n;+ q = t, K = n;}}-var ut = void 0, J = 0, dt = 0, ft = 0, pt = 0, mt = void 0, ht = 0;-function gt(e) {+var J = void 0, Y = 0, mt = 0, ht = 0, gt = 0, _t = void 0, vt = 0;+function yt(e) {if (q !== void 0) {var t = e.n;if (t === void 0 || t.t !== q) return t = {@@ -1084,77 +1243,77 @@ function gt(e) {if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = q.s, t.n = void 0, q.s.n = t, q.s = t), t;}}-function Y(e, t) {+function X(e, t) {this.v = e, this.i = 0, this.n = void 0, this.t = void 0, this.l = 0, this.W = t?.watched, this.Z = t?.unwatched, this.name = t?.name;}-Y.prototype.brand = at, Y.prototype.h = function() {+X.prototype.brand = ut, X.prototype.h = function() {return !0;-}, Y.prototype.S = function(e) {+}, X.prototype.S = function(e) {var t = this, n = this.t;- n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? lt(function() {+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? pt(function() {var e;(e = t.W) == null || e.call(t);}) : n.e = e);-}, Y.prototype.U = function(e) {+}, X.prototype.U = function(e) {var t = this;if (this.t !== void 0) {var n = e.e, r = e.x;- n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && lt(function() {+ n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && pt(function() {var e;(e = t.Z) == null || e.call(t);}));}-}, Y.prototype.subscribe = function(e) {+}, X.prototype.subscribe = function(e) {var t = this;- return Tt(function() {+ return Ot(function() {var n = t.value;- lt(function() {+ pt(function() {return e(n);});}, { name: "sub" });-}, Y.prototype.valueOf = function() {+}, X.prototype.valueOf = function() {return this.value;-}, Y.prototype.toString = function() {+}, X.prototype.toString = function() {return this.value + "";-}, Y.prototype.toJSON = function() {+}, X.prototype.toJSON = function() {return this.value;-}, Y.prototype.peek = function() {+}, X.prototype.peek = function() {var e = this;- return lt(function() {+ return pt(function() {return e.value;});-}, Object.defineProperty(Y.prototype, "value", {+}, Object.defineProperty(X.prototype, "value", {get: function() {- var e = gt(this);+ var e = yt(this);return e !== void 0 && (e.i = this.i), this.v;},set: function(e) {if (e !== this.v) {- if (dt > 100) throw Error("Cycle detected");+ if (mt > 100) throw Error("Cycle detected");(function(e) {- J !== 0 && dt === 0 && e.l !== pt && (e.l = pt, mt = {+ Y !== 0 && mt === 0 && e.l !== gt && (e.l = gt, _t = {S: e,v: e.v,i: e.i,- o: mt+ o: _t});- })(this), this.v = e, this.i++, ht++, J++;+ })(this), this.v = e, this.i++, vt++, Y++;try {for (var t = this.t; t !== void 0; t = t.x) t.t.N();} finally {- ot();+ dt();}}}});-function _t(e, t) {- return new Y(e, t);+function bt(e, t) {+ return new X(e, t);}-function vt(e) {+function xt(e) {for (var t = e.s; t !== void 0; t = t.n) if (t.S.i !== t.i || !t.S.h() || t.S.i !== t.i) return !0;return !1;}-function yt(e) {+function St(e) {for (var t = e.s; t !== void 0; t = t.n) {var n = t.S.n;if (n !== void 0 && (t.r = n), t.S.n = t, t.i = -1, t.n === void 0) {@@ -1163,81 +1322,81 @@ function yt(e) {}}}-function bt(e) {+function Ct(e) {for (var t = e.s, n = void 0; t !== void 0;) {var r = t.p;t.i === -1 ? (t.S.U(t), r !== void 0 && (r.n = t.n), t.n !== void 0 && (t.n.p = r)) : n = t, t.S.n = t.r, t.r !== void 0 && (t.r = void 0), t = r;}e.s = n;}-function X(e, t) {- Y.call(this, void 0, t), this.x = e, this.s = void 0, this.g = ht - 1, this.f = 4;+function Z(e, t) {+ X.call(this, void 0, t), this.x = e, this.s = void 0, this.g = vt - 1, this.f = 4;}-X.prototype = new Y(), X.prototype.h = function() {+Z.prototype = new X(), Z.prototype.h = function() {if (this.f &= -3, 1 & this.f) return !1;- if ((36 & this.f) == 32 || (this.f &= -5, this.g === ht)) return !0;- if (this.g = ht, this.f |= 1, this.i > 0 && !vt(this)) return this.f &= -2, !0;+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === vt)) return !0;+ if (this.g = vt, this.f |= 1, this.i > 0 && !xt(this)) return this.f &= -2, !0;var e = q;try {- yt(this), q = this;+ St(this), q = this;var t = this.x();(16 & this.f || this.v !== t || this.i === 0) && (this.v = t, this.f &= -17, this.i++);} catch (e) {this.v = e, this.f |= 16, this.i++;}- return q = e, bt(this), this.f &= -2, !0;-}, X.prototype.S = function(e) {+ return q = e, Ct(this), this.f &= -2, !0;+}, Z.prototype.S = function(e) {if (this.t === void 0) {this.f |= 36;for (var t = this.s; t !== void 0; t = t.n) t.S.S(t);}- Y.prototype.S.call(this, e);-}, X.prototype.U = function(e) {- if (this.t !== void 0 && (Y.prototype.U.call(this, e), this.t === void 0)) {+ X.prototype.S.call(this, e);+}, Z.prototype.U = function(e) {+ if (this.t !== void 0 && (X.prototype.U.call(this, e), this.t === void 0)) {this.f &= -33;for (var t = this.s; t !== void 0; t = t.n) t.S.U(t);}-}, X.prototype.N = function() {+}, Z.prototype.N = function() {if (!(2 & this.f)) {this.f |= 6;for (var e = this.t; e !== void 0; e = e.x) e.t.N();}-}, Object.defineProperty(X.prototype, "value", { get: function() {+}, Object.defineProperty(Z.prototype, "value", { get: function() {if (1 & this.f) throw Error("Cycle detected");- var e = gt(this);+ var e = yt(this);if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;return this.v;} });-function xt(e, t) {- return new X(e, t);+function wt(e, t) {+ return new Z(e, t);}-function St(e) {+function Tt(e) {var t = e.m;if (e.m = void 0, typeof t == "function") {- J++;+ Y++;var n = q;q = void 0;try {t();} catch (t) {- throw e.f &= -2, e.f |= 8, Ct(e), t;+ throw e.f &= -2, e.f |= 8, Et(e), t;} finally {- q = n, ot();+ q = n, dt();}}}-function Ct(e) {+function Et(e) {for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);- e.x = void 0, e.s = void 0, St(e);+ e.x = void 0, e.s = void 0, Tt(e);}-function wt(e) {+function Dt(e) {if (q !== this) throw Error("Out-of-order effect");- bt(this), q = e, this.f &= -2, 8 & this.f && Ct(this), ot();+ Ct(this), q = e, this.f &= -2, 8 & this.f && Et(this), dt();}-function Z(e, t) {- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, ct && ct.push(this);+function Q(e, t) {+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, K && K.push(this);}-Z.prototype.c = function() {+Q.prototype.c = function() {var e = this.S();try {if (8 & this.f || this.x === void 0) return;@@ -1246,20 +1405,20 @@ Z.prototype.c = function() {} finally {e();}-}, Z.prototype.S = function() {+}, Q.prototype.S = function() {if (1 & this.f) throw Error("Cycle detected");- this.f |= 1, this.f &= -9, St(this), yt(this), J++;+ this.f |= 1, this.f &= -9, Tt(this), St(this), Y++;var e = q;- return q = this, wt.bind(this, e);-}, Z.prototype.N = function() {- 2 & this.f || (this.f |= 2, this.u = ut, ut = this);-}, Z.prototype.d = function() {- this.f |= 8, 1 & this.f || Ct(this);-}, Z.prototype.dispose = function() {+ return q = this, Dt.bind(this, e);+}, Q.prototype.N = function() {+ 2 & this.f || (this.f |= 2, this.u = J, J = this);+}, Q.prototype.d = function() {+ this.f |= 8, 1 & this.f || Et(this);+}, Q.prototype.dispose = function() {this.d();};-function Tt(e, t) {- var n = new Z(e, t);+function Ot(e, t) {+ var n = new Q(e, t);try {n.c();} catch (e) {@@ -1270,35 +1429,35 @@ function Tt(e, t) {}//#endregion//#region node_modules/@preact/signals/dist/signals.module.js-var Et, Dt, Ot = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, kt = [];-Tt(function() {- Et = this.N;+var kt, At, jt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Mt = [];+Ot(function() {+ kt = this.N;})();-function Q(e, t) {+function $(e, t) {m[e] = t.bind(null, m[e] || function() {});}-function At(e) {- if (Dt) {- var t = Dt;- Dt = void 0, t();+function Nt(e) {+ if (At) {+ var t = At;+ At = void 0, t();}- Dt = e && e.S();+ At = e && e.S();}-function jt(e) {- var t = this, n = e.data, r = Nt(n);+function Pt(e) {+ var t = this, n = e.data, r = It(n);r.name = "ReactiveDom", r.value = n;- var i = Re(function() {+ var i = ze(function() {for (var e = t, n = t.__v; n = n.__;) if (n.__c) {n.__c.__$f |= 4;break;}- var i = xt(function() {+ var i = wt(function() {var e = r.value.value;return e === 0 ? 0 : !0 === e ? "" : e || "";- }), a = xt(function() {+ }), a = wt(function() {return !Array.isArray(i.value) && !g(i.value);- }), o = Tt(function() {- if (this.N = It, a.value) {+ }), o = Ot(function() {+ if (this.N = zt, a.value) {var t = i.value;e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);}@@ -1309,14 +1468,14 @@ function jt(e) {}, []), a = i[0], o = i[1];return a.value ? o.peek() : o.value;}-jt.displayName = "ReactiveTextNode", Object.defineProperties(Y.prototype, {+Pt.displayName = "ReactiveTextNode", Object.defineProperties(X.prototype, {constructor: {configurable: !0,value: void 0},type: {configurable: !0,- value: jt+ value: Pt},props: {configurable: !0,@@ -1331,35 +1490,35 @@ jt.displayName = "ReactiveTextNode", Object.defineProperties(Y.prototype, {configurable: !0,value: 1}-}), Q("__b", function(e, t) {+}), $("__b", function(e, t) {if (typeof t.type == "string") {var n, r = t.props;for (var i in r) if (i !== "children") {var a = r[i];- a instanceof Y && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());+ a instanceof X && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());}}e(t);-}), Q("__r", function(e, t) {- if (e(t), t.type !== N) {- At();+}), $("__r", function(e, t) {+ if (e(t), t.type !== M) {+ Nt();var n, r = t.__c;r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {var n;- return Tt(function() {+ return Ot(function() {n = this;}, { name: t }), n.c = e, n;}(function(e) {return function() {var t;- Ot && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});+ jt && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});};- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), At(n);+ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Nt(n);}-}), Q("__e", function(e, t, n, r) {- At(), e(t, n, r);-}), Q("diffed", function(e, t) {- At();+}), $("__e", function(e, t, n, r) {+ Nt(), e(t, n, r);+}), $("diffed", function(e, t) {+ Nt();var n;if (typeof t.type == "string" && (n = t.__e)) {var r = t.__np, i = t.props, a = n.U;@@ -1369,25 +1528,25 @@ jt.displayName = "ReactiveTextNode", Object.defineProperties(Y.prototype, {}if (r) for (var c in a || (a = {}, n.U = a), r) {var l = a[c], u = r[c];- l === void 0 ? (l = Mt(n, c, u, i), a[c] = l) : l.o(u, i);+ l === void 0 ? (l = Ft(n, c, u, i), a[c] = l) : l.o(u, i);}}e(t);});-function Mt(e, t, n, r) {- var i = t in e && e.ownerSVGElement === void 0, a = _t(n);+function Ft(e, t, n, r) {+ var i = t in e && e.ownerSVGElement === void 0, a = bt(n);return {o: function(e, t) {a.value = e, r = t;},- d: Tt(function() {- this.N = It;+ d: Ot(function() {+ this.N = zt;var n = a.value.value;r[t] !== n && (r[t] = n, i ? e[t] = n : n != null && (!1 !== n || t[4] === "-") ? e.setAttribute(t, n) : e.removeAttribute(t));})};}-Q("unmount", function(e, t) {+$("unmount", function(e, t) {if (typeof t.type == "string") {var n = t.__e;if (n) {@@ -1411,9 +1570,9 @@ Q("unmount", function(e, t) {}}e(t);-}), Q("__h", function(e, t, n, r) {+}), $("__h", function(e, t, n, r) {r < 3 && (t.__$f |= 2), e(t, n, r);-}), P.prototype.shouldComponentUpdate = function(e, t) {+}), N.prototype.shouldComponentUpdate = function(e, t) {if (this.__R) return !0;var n = this.__$u, r = n && n.s !== void 0;for (var i in t) return !0;@@ -1425,55 +1584,55 @@ Q("unmount", function(e, t) {for (var s in this.props) if (!(s in e)) return !0;return !1;};-function Nt(e, t) {- return Re(function() {- return _t(e, t);+function It(e, t) {+ return ze(function() {+ return bt(e, t);}, []);}-var Pt = function(e) {+var Lt = function(e) {queueMicrotask(function() {queueMicrotask(e);});};-function Ft() {- st(function() {- for (var e; e = kt.shift();) Et.call(e);+function Rt() {+ ft(function() {+ for (var e; e = Mt.shift();) kt.call(e);});}-function It() {- kt.push(this) === 1 && (m.requestAnimationFrame || Pt)(Ft);+function zt() {+ Mt.push(this) === 1 && (m.requestAnimationFrame || Lt)(Rt);}//#endregion//#region src/state/quality-goals.ts-var Lt = "/api/quality-goals?limit=200", Rt = {+var Bt = "/api/quality-goals?limit=200", Vt = {data: null,error: ""-}, zt = _t(Rt), Bt = 0, Vt = xt(() => zt.value);-xt(() => zt.value.data?.total ?? null);-function Ht() {- Bt += 1, zt.value = Rt;+}, Ht = bt(Vt), Ut = 0, Wt = wt(() => Ht.value);+wt(() => Ht.value.data?.total ?? null);+function Gt() {+ Ut += 1, Ht.value = Vt;}-async function Ut(e) {- let t = Bt += 1;+async function Kt(e) {+ let t = Ut += 1;try {- let n = await L(Lt, e);- return t === Bt && (zt.value = {+ let n = await I(Bt, e);+ return t === Ut && (Ht.value = {data: n,error: ""}), n;} catch (n) {- throw !e?.aborted && t === Bt && (zt.value = {+ throw !e?.aborted && t === Ut && (Ht.value = {data: null,- error: I(n)+ error: F(n)}), n;}}//#endregion//#region src/islands/quality-goals.tsx-var Wt = (e, t) => Ut(t), Gt = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;-function Kt({ openItem: e, javTitleHtml: n, javDisplayName: r, srcBadge: a }) {- let { data: o, error: s } = Vt.value;- if (s) return /* @__PURE__ */ G("div", {+var qt = (e, t) => Kt(t), Jt = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;+function Yt({ openItem: e, javTitleHtml: n, javDisplayName: r, srcBadge: a }) {+ let { data: o, error: s } = Wt.value;+ if (s) return /* @__PURE__ */ W("div", {class: "qualitylist",dangerouslySetInnerHTML: { __html: i(s, {variant: "error",@@ -1481,99 +1640,54 @@ function Kt({ openItem: e, javTitleHtml: n, javDisplayName: r, srcBadge: a }) {}) }});let c = o?.items ?? [];- return c.length ? /* @__PURE__ */ G("div", {+ return c.length ? /* @__PURE__ */ W("div", {class: "qualitylist",- children: c.map((t) => /* @__PURE__ */ G("article", {+ children: c.map((t) => /* @__PURE__ */ W("article", {class: "qualityitem",- children: [/* @__PURE__ */ G("button", {+ children: [/* @__PURE__ */ W("button", {class: "qualitycover",type: "button","aria-label": `打开 ${r(t)}`,onClick: () => e(t.id),- children: /* @__PURE__ */ G("img", {- src: Gt(t),+ children: /* @__PURE__ */ W("img", {+ src: Jt(t),alt: "",loading: "lazy",onError: (e) => e.currentTarget.remove()})- }), /* @__PURE__ */ G("div", { children: [- /* @__PURE__ */ G("h3", { children: /* @__PURE__ */ G("button", {+ }), /* @__PURE__ */ W("div", { children: [+ /* @__PURE__ */ W("h3", { children: /* @__PURE__ */ W("button", {type: "button","data-middle-truncate": !0,onClick: () => e(t.id),dangerouslySetInnerHTML: { __html: n(t) }}) }),- /* @__PURE__ */ G("p", {+ /* @__PURE__ */ W("p", {class: "mono",children: [- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {style: "display:contents",dangerouslySetInnerHTML: { __html: a(t.location, t.cost) }}),- /* @__PURE__ */ G("span", { children: u[t.location] ?? t.location }),- /* @__PURE__ */ G("span", { children: d(t.duration) }),- /* @__PURE__ */ G("span", { children: f(t.size ?? 0) })+ /* @__PURE__ */ W("span", { children: u[t.location] ?? t.location }),+ /* @__PURE__ */ W("span", { children: d(t.duration) }),+ /* @__PURE__ */ W("span", { children: f(t.size ?? 0) })]}),- t.reason ? /* @__PURE__ */ G("p", { children: t.reason }) : null+ t.reason ? /* @__PURE__ */ W("p", { children: t.reason }) : null] })]}, t.id))- }) : /* @__PURE__ */ G("div", {+ }) : /* @__PURE__ */ W("div", {class: "qualitylist",dangerouslySetInnerHTML: { __html: t("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }});}//#endregion-//#region src/jobs.ts-async function qt(e) {- let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;- for (; e.active();) {- let r;- try {- r = await e.read(AbortSignal.timeout(15e3));- } catch (r) {- if (!e.active()) return;- n++, e.disconnected(r), await t(Math.min(2e3 * 2 ** Math.min(n, 4), 3e4));- continue;- }- if (!e.active() || (n = 0, e.render(r), e.once) || !e.keepWatching && r.status !== "running") return;- await t(2e3);- }-}-function Jt(e) {- let t = document.createElement("div");- e.host.hidden = !0, t.dataset.followJob = "", t.setAttribute("aria-live", "polite"), e.host.prepend(t);- let n = e.storageKey || "peach-follow-job", r = sessionStorage.getItem(n) || void 0, i = !1;- qt({- read: e.read,- active: () => !i && e.active() && t.isConnected,- keepWatching: e.watchIdle !== !1,- render: (a) => {- let o = a.status === "running";- if (e.host.hidden = !o, e.busy(o), o) {- r = a.job_id, r && sessionStorage.setItem(n, r);- let i = a.current, o = (i?.attempt || 1) > 1 ? ` · 第 ${i?.attempt}/${i?.max_attempts} 次尝试${i?.retry_in ? `,${i.retry_in} 秒后重试` : ""}` : "", s = (e.title || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = e.loading(s) + ((a.total || 0) > 0 ? e.progress(a.checked || 0, a.total) : "");- t.innerHTML = e.container ? e.container(c) : c;- } else if (r && r === a.job_id) r = void 0, i = !0, e.host.hidden = a.status !== "failed", sessionStorage.removeItem(n), t.innerHTML = a.status === "failed" ? e.note(a.error || "检查失败") : "", e.complete(a);- else {- if (r && a.status === "idle") {- e.host.hidden = !1, t.innerHTML = e.note("任务状态已失效,请重新发起任务"), sessionStorage.removeItem(n), i = !0;- return;- }- t.innerHTML = "";- }- },- disconnected: () => {- e.host.hidden = !1, t.innerHTML = e.note("暂时无法读取进度,正在重新连接…");- }- });-}-//#endregion//#region src/islands/scraping.tsx-var Yt = (e, t) => L("/api/scraping", t);-function Xt({ value: e, onChange: t }) {- let n = W(null), r = W(t);- return r.current = t, U(() => {+var Xt = (e, t) => I("/api/scraping", t);+function Zt({ value: e, onChange: t }) {+ let n = U(null), r = U(t);+ return r.current = t, H(() => {let t = n.current;t.innerHTML = o([["environment", "系统代理"],@@ -1584,27 +1698,27 @@ function Xt({ value: e, onChange: t }) {return i.addEventListener("change", a), () => {i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();};- }, []), /* @__PURE__ */ G("div", {+ }, []), /* @__PURE__ */ W("div", {ref: n,class: "scraping-network"});}-function Zt({ source: e, toast: t }) {- let [r, a] = H(e), [o, s] = H(e.network), [l, u] = H(""), [d, f] = H(""), [p, m] = H(""), [h, g] = H("paste"), [_, v] = H(""), [y, b] = H(!1), [x, S] = H(""), [C, w] = H([]), T = W(null), E = W(null);- U(() => {+function Qt({ source: e, toast: t }) {+ let [r, a] = V(e), [o, s] = V(e.network), [l, u] = V(""), [d, f] = V(""), [p, m] = V(""), [h, g] = V("paste"), [_, v] = V(""), [y, b] = V(!1), [x, S] = V(""), [C, w] = V([]), T = U(null), E = U(null);+ H(() => {E.current?.querySelectorAll("footer button").forEach((e) => c(e, y));}, [y]);- let D = W(new AbortController());- Le(() => () => D.current.abort(), []);+ let D = U(new AbortController());+ Re(() => () => D.current.abort(), []);async function O(n) {if (!y) {b(!0), S(""), w([]);try {if (n === "check") {- let t = await R("/api/scraping/check", { source: e.source }, "POST", D.current.signal);+ let t = await L("/api/scraping/check", { source: e.source }, "POST", D.current.signal);D.current.signal.aborted || w(t.results);} else {- let r = await R("/api/scraping/settings", {+ let r = await L("/api/scraping/settings", {source: e.source,network: o,proxy: l,@@ -1615,40 +1729,40 @@ function Zt({ source: e, toast: t }) {D.current.signal.aborted || (a(r.saved), u(""), f(""), m(""), v(""), T.current && (T.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));}} catch (e) {- D.current.signal.aborted || S(I(e));+ D.current.signal.aborted || S(F(e));} finally {D.current.signal.aborted || b(!1);}}}- return /* @__PURE__ */ G("section", {+ return /* @__PURE__ */ W("section", {class: "scraping-source",- children: /* @__PURE__ */ G("form", {+ children: /* @__PURE__ */ W("form", {ref: E,class: "cleanupfieldset","data-geist-fieldset": !0,onSubmit: (e) => {e.preventDefault(), O("save");},- children: [/* @__PURE__ */ G("div", {+ children: [/* @__PURE__ */ W("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n(`scraping-${e.source}`, e.label) } }),- /* @__PURE__ */ G("a", {+ /* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: n(`scraping-${e.source}`, e.label) } }),+ /* @__PURE__ */ W("a", {class: "scraping-url",href: e.login,target: "_blank",rel: "noopener noreferrer",children: e.login}),- /* @__PURE__ */ G("div", {+ /* @__PURE__ */ W("div", {class: "scraping-label",- children: ["连接方式", /* @__PURE__ */ G(Xt, {+ children: ["连接方式", /* @__PURE__ */ W(Zt, {value: o,onChange: s})]}),- o === "proxy" && /* @__PURE__ */ G("label", { children: ["代理地址", /* @__PURE__ */ G("input", {+ o === "proxy" && /* @__PURE__ */ W("label", { children: ["代理地址", /* @__PURE__ */ W("input", {class: "geist-input",type: "password",autoComplete: "off",@@ -1657,13 +1771,13 @@ function Zt({ source: e, toast: t }) {disabled: y,onInput: (e) => u(e.currentTarget.value)})] }),- e.accepts_cookie && /* @__PURE__ */ G(N, { children: [- /* @__PURE__ */ G("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),- /* @__PURE__ */ G("div", {+ e.accepts_cookie && /* @__PURE__ */ W(M, { children: [+ /* @__PURE__ */ W("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),+ /* @__PURE__ */ W("div", {class: "insightswitch scraping-cookie-method",role: "radiogroup","aria-label": "提供 Cookie 的方式(二选一)",- children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ G("label", { children: [/* @__PURE__ */ G("input", {+ children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ W("label", { children: [/* @__PURE__ */ W("input", {type: "radio",name: `cookie-method-${e.source}`,value: t,@@ -1671,29 +1785,29 @@ function Zt({ source: e, toast: t }) {onChange: () => {g(t), f(""), m(""), v("");}- }), /* @__PURE__ */ G("span", { children: n })] }, t))+ }), /* @__PURE__ */ W("span", { children: n })] }, t))}),- h === "paste" ? /* @__PURE__ */ G("label", { children: ["Cookie", /* @__PURE__ */ G("input", {+ h === "paste" ? /* @__PURE__ */ W("label", { children: ["Cookie", /* @__PURE__ */ W("input", {class: "geist-input",type: "password",autoComplete: "off",value: d,disabled: y,onInput: (e) => f(e.currentTarget.value)- })] }) : /* @__PURE__ */ G("label", {+ })] }) : /* @__PURE__ */ W("label", {class: "scraping-file",- children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ G("span", {+ children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ W("span", {class: "scraping-file-control",children: [- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {class: "geist-button",children: "选择文件"}),- /* @__PURE__ */ G("span", {+ /* @__PURE__ */ W("span", {class: "scraping-file-name",children: _ || "未选择文件"}),- /* @__PURE__ */ G("input", {+ /* @__PURE__ */ W("input", {ref: T,type: "file",accept: ".txt",@@ -1723,31 +1837,31 @@ function Zt({ source: e, toast: t }) {})]})] }),- x && /* @__PURE__ */ G("div", {+ x && /* @__PURE__ */ W("div", {role: "alert",dangerouslySetInnerHTML: { __html: i(x, { variant: "error" }) }}),- C.map((t) => /* @__PURE__ */ G("div", {+ C.map((t) => /* @__PURE__ */ W("div", {role: "status",dangerouslySetInnerHTML: { __html: i(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }}, t.label))]- }), /* @__PURE__ */ G("footer", {+ }), /* @__PURE__ */ W("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: [- /* @__PURE__ */ G("button", {+ /* @__PURE__ */ W("button", {class: "geist-button primary",type: "submit",children: "保存"}),- /* @__PURE__ */ G("button", {+ /* @__PURE__ */ W("button", {class: "geist-button",type: "button",onClick: () => void O("check"),children: "检查连接"}),- e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ G("button", {+ e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ W("button", {class: "geist-button",type: "button",onClick: () => void O("revoke"),@@ -1758,14 +1872,14 @@ function Zt({ source: e, toast: t }) {})});}-function Qt({ data: e, error: t, toast: r }) {- let [a, o] = H(""), [s, l] = H(!1), [u, d] = H(""), f = W(null);- U(() => c(f.current, s), [s]);- let p = W(new AbortController()), m = W(0);+function $t({ data: e, error: t, toast: r }) {+ let [a, o] = V(""), [s, l] = V(!1), [u, d] = V(""), f = U(null);+ H(() => c(f.current, s), [s]);+ let p = U(new AbortController()), m = U(0);async function h(e = !1) {let t = ++m.current;- await qt({- read: (e) => L("/api/scraping/cover", e),+ await Xe({+ read: (e) => I("/api/scraping/cover", e),active: () => !p.current.signal.aborted && t === m.current,render: (t) => {l(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && d(t.error || "采集未取得"), t.status === "complete" && !e && r(t.result || "封面采集完成");@@ -1773,37 +1887,37 @@ function Qt({ data: e, error: t, toast: r }) {disconnected: () => d("连接中断,正在重新读取后台进度")});}- Le(() => (h(!0), () => p.current.abort()), []);+ Re(() => (h(!0), () => p.current.abort()), []);async function g() {if (!s) {m.current++, l(!0), d("");try {- await R("/api/scraping/cover", { code: a }, "POST", p.current.signal), await h();+ await L("/api/scraping/cover", { code: a }, "POST", p.current.signal), await h();} catch (e) {- p.current.signal.aborted || (l(!1), d(I(e)));+ p.current.signal.aborted || (l(!1), d(F(e)));}}}- return t ? /* @__PURE__ */ G("div", {+ return t ? /* @__PURE__ */ W("div", {role: "alert",dangerouslySetInnerHTML: { __html: i(t, { variant: "error" }) }- }) : /* @__PURE__ */ G("div", {+ }) : /* @__PURE__ */ W("div", {class: "scraping-page",children: [- /* @__PURE__ */ G("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),- /* @__PURE__ */ G("section", {+ /* @__PURE__ */ W("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),+ /* @__PURE__ */ W("section", {class: "cleanupfieldset scraping-source","data-geist-fieldset": !0,- children: /* @__PURE__ */ G("div", {+ children: /* @__PURE__ */ W("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("scraping-cover", "高清封面") } }),- /* @__PURE__ */ G("form", {+ /* @__PURE__ */ W("div", { dangerouslySetInnerHTML: { __html: n("scraping-cover", "高清封面") } }),+ /* @__PURE__ */ W("form", {class: "scraping-cover-form",onSubmit: (e) => {e.preventDefault(), g();},- children: [/* @__PURE__ */ G("input", {+ children: [/* @__PURE__ */ W("input", {class: "geist-input","aria-label": "馆藏番号",required: !0,@@ -1811,21 +1925,21 @@ function Qt({ data: e, error: t, toast: r }) {disabled: s,placeholder: "输入馆藏番号,如 ABW-232",onInput: (e) => o(e.currentTarget.value)- }), /* @__PURE__ */ G("button", {+ }), /* @__PURE__ */ W("button", {ref: f,class: "geist-button primary",type: "submit",children: "抓取封面"})]}),- u && /* @__PURE__ */ G("div", {+ u && /* @__PURE__ */ W("div", {role: "alert",dangerouslySetInnerHTML: { __html: i(u, { variant: "error" }) }})]})}),- e?.sources.map((e) => /* @__PURE__ */ G(Zt, {+ e?.sources.map((e) => /* @__PURE__ */ W(Qt, {source: e,toast: r}, e.source))@@ -1833,100 +1947,13 @@ function Qt({ data: e, error: t, toast: r }) {});}//#endregion-//#region src/islands/library-processing.tsx-var $t = (e, t) => L("/api/library-processing", t);-function en({ data: e, error: t, toast: o, onComplete: s }) {- let [l, u] = H(e || { status: "idle" }), [d, f] = H(t), [p, m] = H(!1), [h, g] = H(!1), _ = W(new AbortController()), v = W(0), y = W(null), b = p || l.status === "running";- U(() => c(y.current, b), [b]);- async function x() {- let e = ++v.current;- await qt({- read: (e) => L("/api/library-processing", e),- active: () => !_.current.signal.aborted && v.current === e,- render: (e) => {- u(e), f(""), e.status === "complete" && (g(!0), o("已完成扫描与资料采集")), (e.status === "complete" || e.status === "failed") && s?.();- },- disconnected: () => f("连接中断,正在重新读取处理进度")- });- }- Le(() => (l.status === "running" && x(), () => _.current.abort()), []);- async function S() {- if (!b) {- m(!0), f(""), g(!1);- try {- let e = await R("/api/library-processing", {}, "POST", _.current.signal);- if (_.current.signal.aborted) return;- u(e), m(!1), await x();- } catch (e) {- _.current.signal.aborted || (f(I(e)), m(!1));- }- }- }- return /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", {- class: "geist-fieldset-content library-processing",- children: [- /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: n("cleanupScrapingTitle", "扫描与采集") } }),- /* @__PURE__ */ G("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),- /* @__PURE__ */ G("div", {- "aria-live": "polite",- children: [- l.status === "running" && /* @__PURE__ */ G(N, { children: [/* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: r(l.stage || "正在处理") } }), !!l.total && /* @__PURE__ */ G("div", { dangerouslySetInnerHTML: { __html: a(`已处理 ${l.checked || 0} / ${l.total} 个视频`, l.checked || 0, l.total) } })] }),- (d || l.status === "failed") && /* @__PURE__ */ G("div", {- role: "alert",- dangerouslySetInnerHTML: { __html: i(d || l.error || "处理未完成,请重试", { variant: "error" }) }- }),- l.status === "failed" && !!l.issues?.length && /* @__PURE__ */ G("ul", { children: l.issues.slice(0, 20).map((e) => /* @__PURE__ */ G("li", { children: [- e.asset_id ? /* @__PURE__ */ G("a", {- href: `/item/${e.asset_id}`,- children: "查看视频"- }) : null,- e.asset_id ? ":" : "",- e.message- ] })) }),- h && /* @__PURE__ */ G("p", { children: [- "已扫描 ",- l.scanned || 0,- " 个文件,识别 ",- l.identified || 0,- " 个番号,整理 ",- l.candidates || 0,- " 组资料候选。"- ] })- ]- })- ]- }), /* @__PURE__ */ G("footer", {- class: "geist-fieldset-footer",- "data-geist-fieldset-footer": !0,- children: [- /* @__PURE__ */ G("a", {- class: "geist-button",- href: "/scraping",- children: "采集来源"- }),- !!l.candidates && /* @__PURE__ */ G("a", {- class: "geist-button",- href: "/review",- children: "复核资料"- }),- /* @__PURE__ */ G("button", {- ref: y,- type: "button",- class: "geist-button primary",- onClick: () => void S(),- children: l.status === "failed" ? "重试未完成项" : "扫描并补全资料"- })- ]- })] });-}-//#endregion//#region src/state/index.ts-var tn = { "quality-goals": {- refresh: Ut,- reset: Ht-} }, nn = () => Object.keys(tn);-async function rn(e) {- let t = tn[e];+var en = { "quality-goals": {+ refresh: Kt,+ reset: Gt+} }, tn = () => Object.keys(en);+async function nn(e) {+ let t = en[e];if (!t) throw Error(`未登记的共享 store:${String(e)}`);try {return await t.refresh(), !0;@@ -1936,10 +1963,10 @@ async function rn(e) {}//#endregion//#region src/native-image.ts-function an(e, t, n, r) {+function rn(e, t, n, r) {return e > 0 && t > 0 && e === n && t === r;}-function on(e, t, n, r, i = 1) {+function an(e, t, n, r, i = 1) {let a = Number.isFinite(i) && i > 0 ? i : 1;e /= a, t /= a;let o = [@@ -1956,7 +1983,7 @@ function on(e, t, n, r, i = 1) {}//#endregion//#region src/entity-skeleton.ts-function sn(e, t) {+function on(e, t) {return `<section data-skeleton="entity/${e}" role="status" aria-label="正在读取资料"><span class="sr-only">正在读取资料</span><div aria-hidden="true"><div class="entityhero"><div class="entityportrait ${e === "studio" || e === "agency" ? "square " : ""}skeleton"></div>@@ -1968,7 +1995,7 @@ function sn(e, t) {}//#endregion//#region src/catalog-onboarding.ts-var cn = [+var sn = ["loc","creator","performer",@@ -1985,7 +2012,7 @@ var cn = ["jav","thumb"];-function ln() {+function cn() {let e = (e) => [,,@@ -1996,9 +2023,9 @@ function ln() {tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\"> </span>") + "</span>"};}-async function un(e, t) {+async function ln(e, t) {let n = new URLSearchParams();- for (let t of cn) e[t] && n.set(t, e[t]);+ for (let t of sn) e[t] && n.set(t, e[t]);let [r, i] = await Promise.all([t("/api/facets?" + n), t("/api/items?" + n + "&limit=5")]), a = [...new Set([...r.creators || [],...r.tagperformers || [],@@ -2009,7 +2036,7 @@ async function un(e, t) {return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";}))).filter(Boolean);}-function dn({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable: i = !1, online: a = !1 } = {}) {+function un({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable: i = !1, online: a = !1 } = {}) {let o = i ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", s = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";return n || r ? t("search", r ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", r ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? t("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: o + s }) : t(e === "tags" ? "tags" : "user-round", "还没有" + ({tags: "标签",@@ -2022,7 +2049,7 @@ function dn({ kind: e = "catalog", filtered: n = !1, jav: r = !1, configurable:}//#endregion//#region src/sidebar.ts-function fn(e) {+function dn(e) {return ["/","/unseen",@@ -2032,23 +2059,23 @@ function fn(e) {"/junk-files"].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);}-function pn(e, t) {+function fn(e, t) {return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);}-function mn(e) {+function pn(e) {let t = /* @__PURE__ */ new Map();for (let n of e) for (let e of new Set(n.tags || [])) t.set(e, (t.get(e) || 0) + 1);return [...t].sort((e, t) => t[1] - e[1]).slice(0, 30);}//#endregion//#region src/management.ts-function hn(e) {+function mn(e) {return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);}-function gn(e, t) {+function hn(e, t) {return t.filter((t) => e.some((e) => e.location === t));}-function _n() {+function gn() {return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态"><div class="cleanupgrid">${[[@@ -2094,7 +2121,7 @@ function _n() {<footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button"${r === 3 ? " class=\"danger\"" : ""} disabled>${r === 3 ? "<svg aria-hidden=\"true\"><use href=\"#i-trash\"></use></svg><span>" + t + "</span>" : t}</button></footer></section>`).join("")}</div></div>`;}-function vn(e, t = !1, n = !1) {+function _n(e, t = !1, n = !1) {if (t || n) return "";let r = "<svg aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";return `<details class="taste-history-guide"${e ? " open" : ""}>@@ -2108,69 +2135,69 @@ function vn(e, t = !1, n = !1) {<button type="button" class="geist-button taste-guide-skip">跳过</button></div></details>`;}-var yn = "peach-taste-guide-dismissed";-function bn(e, t) {+var vn = "peach-taste-guide-dismissed";+function yn(e, t) {let n = e.querySelector(".taste-history-guide");n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {- t.setItem(yn, "1"), n.remove();+ t.setItem(vn, "1"), n.remove();});}//#endregion//#region src/jav-artwork.ts-function xn(e) {+function bn(e) {return ["small","sleeve","preview"].includes(String(e)) ? "small" : "big";}-function Sn(e) {+function xn(e) {return {- javLayout: xn(e.javLayout),- javImage: Cn(e.javLayout === "preview" ? "thumbnail" : e.javImage)+ javLayout: bn(e.javLayout),+ javImage: Sn(e.javLayout === "preview" ? "thumbnail" : e.javImage)};}-function Cn(e) {+function Sn(e) {return e === "thumbnail" ? "thumbnail" : "cover";}-function wn(e, t) {- return e.is_jav && e.code && e.has_cover && (Cn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";+function Cn(e, t) {+ return e.is_jav && e.code && e.has_cover && (Sn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";}-function Tn(e, t) {+function wn(e, t) {e.querySelectorAll("img[data-jav-image]").forEach((e) => {- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Cn(t) === "cover" || !r)), a = i ? n : r;+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Sn(t) === "cover" || !r)), a = i ? n : r;e.classList.toggle("cover", i), e.classList.toggle("whole", i && e.dataset.javImageLayout !== "big"), e.classList.toggle("front", i && e.dataset.javImageLayout === "big"), e.removeAttribute("style"), a && e.getAttribute("src") !== a && (e.src = a);});}//#endregion//#region src/islands.ts-var En = {+var Tn = {"library-processing": {- load: $t,- component: en+ load: Qe,+ component: $e},scraping: {- load: Yt,- component: Qt+ load: Xt,+ component: $t},"quality-goals": {- load: Wt,- component: Kt+ load: qt,+ component: Yt},configuration: {- load: Qe,- component: it+ load: rt,+ component: lt}-}, Dn = () => Object.keys(En), $ = /* @__PURE__ */ new Map();+}, En = () => Object.keys(Tn), Dn = /* @__PURE__ */ new Map();async function On(e, t, n, r = {}) {- let i = En[e];+ let i = Tn[e];if (!i) throw Error(`未注册的 island:${String(e)}`);kn(t);let a = {controller: new AbortController(),painted: !1};- $.set(t, a);+ Dn.set(t, a);let o;try {o = {@@ -2181,12 +2208,12 @@ async function On(e, t, n, r = {}) {if (a.controller.signal.aborted) return;o = {data: null,- error: I(e)+ error: F(e)};}- if ($.get(t) !== a) return;+ if (Dn.get(t) !== a) return;if (r.isCurrent && !r.isCurrent()) {- $.delete(t);+ Dn.delete(t);return;}t.textContent = "", a.painted = !0;@@ -2194,11 +2221,11 @@ async function On(e, t, n, r = {}) {...n,...o};- Se(te(i.component, s), t);+ Ce(ne(i.component, s), t);}function kn(e) {- let t = $.get(e);- t && (t.controller.abort(), $.delete(e), t.painted && Se(null, e));+ let t = Dn.get(e);+ t && (t.controller.abort(), Dn.delete(e), t.painted && Ce(null, e));}//#endregion-export { yn as TASTE_GUIDE_KEY, dn as catalogEmptyHtml, un as catalogSuggestions, _n as cleanupSkeletonHtml, hn as cloudLocations, gn as cloudPreferenceLocations, ln as emptyCatalogLayout, sn as entitySkeletonHtml, Jt as followJobProgress, Dn as islandNames, wn as javImageKind, an as matchesFaceSource, On as mountIsland, on as nativeImageFit, Cn as normalizeJavImage, xn as normalizeJavLayout, Sn as normalizeJavPreferences, rn as refreshStore, fn as sidebarHasCatalogContent, mn as sidebarTagCounts, nn as storeNames, Tn as syncJavImages, pn as syncSidebarSurface, vn as tasteHistoryGuideHtml, kn as unmountIsland, qt as watchJob, bn as wireTasteHistoryGuide };+export { vn as TASTE_GUIDE_KEY, un as catalogEmptyHtml, ln as catalogSuggestions, gn as cleanupSkeletonHtml, mn as cloudLocations, hn as cloudPreferenceLocations, cn as emptyCatalogLayout, on as entitySkeletonHtml, Ze as followJobProgress, En as islandNames, Cn as javImageKind, rn as matchesFaceSource, On as mountIsland, an as nativeImageFit, Sn as normalizeJavImage, bn as normalizeJavLayout, xn as normalizeJavPreferences, nn as refreshStore, dn as sidebarHasCatalogContent, pn as sidebarTagCounts, tn as storeNames, wn as syncJavImages, fn as syncSidebarSurface, _n as tasteHistoryGuideHtml, kn as unmountIsland, Xe as watchJob, yn as wireTasteHistoryGuide };diff --git a/web/index.html b/web/index.htmlindex 74883c393..f13100e0c 100644--- a/web/index.html+++ b/web/index.html@@ -159,6 +159,7 @@<nav class="edge" id="edge"></nav><main id="main" tabindex="-1">+ <div id="libraryProcessingNotice"></div><section class="stage" id="stage" hidden></section><div class="combo" id="combo"></div><section class="index" id="index" hidden></section>