Peach: Local-first video metadata scraper and media manager.
fix(ui): 统一 Board 控件与任务状态反馈
longmeidaoe8fbe02d3713
diff --git a/docs/BOARD_UI.md b/docs/BOARD_UI.mdindex 34ea1df44..9357c976e 100644--- a/docs/BOARD_UI.md+++ b/docs/BOARD_UI.md@@ -97,8 +97,25 @@ Radial Chart Card、Bar List Card、Heatmap 与 Sankey 的 Pro 源码**未取得详情使用并列观看进度卡与独立动作按钮;Esc 先退出详情、再收起侧栏。首页与实体页排序保持横向滚动,换批按钮沿用动画 SVG,采用中性 Board 按钮。-- 175 项前端测试通过,包含非法值不保存、关闭恢复、异步读取值恢复、图表数值、库名及图标提交、分组展开记忆、页面骨架、排名展开与流向聚焦;构建与类型检查通过。+- 178 项前端测试通过,包含非法值不保存、关闭恢复、异步读取值恢复、图表数值、库名及图标提交、分组展开记忆、页面骨架、排名展开与流向聚焦、图标草稿取消、分段切换及演示状态不请求任务接口;构建与类型检查通过。- 18984 服务工作树的完整构建快照,避免编辑期间混用源码和产物。桌面已检查设置、首页、详情、统计、口味、数据管理、关注管理、配置与复核;390×844 已检查统计、口味、首页、设置、详情、标签与事务所索引,没有页面横向溢出。- 设置关闭图标中心偏差为 0;纯图标控件不覆盖工具栏业务显隐。旧版模式关闭 Board 样式,增加对比度时导航 `backdrop-filter` 为 `none`,退出两种状态均已核对。- 预览只读,未写真实 ledger、配置或凭据;脱盘状态下真实播放未验证。生产入口与版本号未改。- 390×844 实测索引页无横向溢出、输入 16px;设置数值控件 40px 高。侧栏收起后容器与内容均为 60px,横向滚动轨道隐藏。手机展开按钮位于抽屉内部,抽屉距顶部 12px。++## 控件与状态预览++2026-09-08 通过严格证书校验取得公开 `checkbox-card.json`、`date-picker.json` 与+`segmented-control.json`,保存于本机 `attic/evidence/20260908-boardui-preview/board-reference/`。+分段切换复用原生 radio,选中底板按实际位置与尺寸作 200ms 位移,设置主题保留系统选项。+Checkbox Card 的整卡选择与独立操作按钮分离;暂停使用黄色 Chip。媒体库图标弹层采用+DatePicker 的内面板、候选草稿及取消/应用结构,候选不包含网盘品牌图标。+统计圆环进入可见区域后从零增长,持续 1.2 秒;减少动态效果时直接显示读数。+圆弧关键帧统一使用长度单位,浏览器逐帧采样确认圆弧与数字连续增长。+空文件夹先只读扫描,发现候选后显示删除入口,删除仍通过共享确认框。++只读预览的 `/state-preview` 提供加载、准备、执行、等待重试、连接中断、恢复连接、失败、+完成、状态失效及暂停等演示状态,复用 LibraryProcessing、Note、Project Banner 和进度组件。+演示入口不调用任务接口,不写真实账本。390px 断线演示已验证页面宽度为 390px,卡片宽 358px。+已知总量的任务只显示一套进度与处理数量,未知总量才显示加载圆点。扫描、关注检查、链接检查和资源扫描共用这一规则。+复核卡片在接近视口时初始化滚动条,屏幕外卡片暂缓布局;819 条记录的页面滚动至 2400px 时只初始化 6 张卡片。diff --git a/docs/STATUS.md b/docs/STATUS.mdindex 7947c7c34..dd57dbd39 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -6,7 +6,7 @@## 运行态-- BoardUI:只读验收 18984,使用完整构建快照,统计与关注正常加载。生产未切换,见 `BOARD_UI.md`。+- BoardUI:只读预览 18984,状态演示 `/state-preview`;生产未切换。验收见 `BOARD_UI.md`。- 设置与反馈已部署;预览 18976。骨架桌面及 390px 验收通过,生产浏览器超时。diff --git a/frontend/src/board-analytics.ts b/frontend/src/board-analytics.tsindex 3b4434411..8d6bd072d 100644--- a/frontend/src/board-analytics.ts+++ b/frontend/src/board-analytics.ts@@ -21,13 +21,13 @@ export function wireRadialCards(root:ParentNode) {const tiles=[...card.querySelectorAll<HTMLButtonElement>('[data-radial-tile]')],rings=[...card.querySelectorAll<SVGCircleElement>('[data-radial-ring]')];const headline=card.querySelector<HTMLElement>('[data-radial-number]')!,label=card.querySelector<HTMLElement>('[data-radial-label]')!;let selected=-1,current=0,animation=0;- const paint=(index:number)=>{+ const paint=(index:number,duration=300)=>{card.dataset.radialFocus=String(index);tiles.forEach((tile,i)=>{tile.dataset.active=String(i===index);tile.setAttribute('aria-pressed',String(i===selected));rings[i]?.setAttribute('aria-pressed',String(i===selected));if(rings[i])rings[i]!.dataset.active=String(i===index)});const value=index<0?Number(card.dataset.radialTotal):Number(tiles[index]?.dataset.radialValue);label.textContent=index<0?card.dataset.radialTitle!:tiles[index]!.dataset.radialName!;cancelAnimationFrame(animation);const start=current,time=performance.now();- const frame=(now:number)=>{const progress=matchMedia('(prefers-reduced-motion: reduce)').matches?1:Math.min(1,(now-time)/300);current=start+(value-start)*(1-(1-progress)**3);headline.textContent=Math.round(current).toLocaleString();if(progress<1)animation=requestAnimationFrame(frame)};+ const frame=(now:number)=>{if(!card.isConnected)return;const progress=matchMedia('(prefers-reduced-motion: reduce)').matches?1:Math.min(1,(now-time)/duration);current=start+(value-start)*(1-(1-progress)**3);headline.textContent=Math.round(current).toLocaleString();if(progress<1)animation=requestAnimationFrame(frame)};animation=requestAnimationFrame(frame);};const toggle=(index:number)=>{selected=selected===index?-1:index;paint(selected)};@@ -37,7 +37,10 @@ export function wireRadialCards(root:ParentNode) {control.addEventListener('focus',()=>paint(index));control.addEventListener('blur',()=>paint(selected));control.addEventListener('click',()=>toggle(index));if(control instanceof SVGElement)control.addEventListener('keydown',event=>{if(event.key==='Enter'||event.key===' '){event.preventDefault();toggle(index)}});});- paint(-1);+ card.dataset.radialFocus='-1';headline.textContent='0';+ const reveal=()=>{requestAnimationFrame(()=>{if(!card.isConnected)return;card.classList.add('board-chart-visible');paint(-1,1200)})};+ if(typeof IntersectionObserver==='undefined'||matchMedia('(prefers-reduced-motion: reduce)').matches)reveal();+ else {const observer=new IntersectionObserver(entries=>{if(entries.some(entry=>entry.isIntersecting)){observer.disconnect();reveal()}},{threshold:.15});observer.observe(card)}});}diff --git a/frontend/src/board-controls.ts b/frontend/src/board-controls.tsindex bbb9cf57b..12fda88df 100644--- a/frontend/src/board-controls.ts+++ b/frontend/src/board-controls.ts@@ -13,7 +13,7 @@ export function syncBoardRange(input: HTMLInputElement) {}export function initBoardControls() {- const scan=(root:ParentNode)=>root.querySelectorAll<HTMLInputElement>('input[type=range]').forEach(syncBoardRange);+ const scan=(root:ParentNode)=>{root.querySelectorAll<HTMLInputElement>('input[type=range]').forEach(syncBoardRange);wireBoardSegments(root);wireBoardTabs(root)};scan(document);const observer=new MutationObserver(records=>{for(const record of records)for(const node of record.addedNodes)if(node instanceof Element){if(node.matches('input[type=range]'))syncBoardRange(node as HTMLInputElement);scan(node)}});observer.observe(document.body,{subtree:true,childList:true});@@ -40,6 +40,42 @@ export function initBoardControls() {document.addEventListener('scroll',hide,true);window.addEventListener('resize',hide);}+const tabPositions=new Map<string,{left:number;width:number}>();+function wireBoardTabs(root:ParentNode){+ const selector='.managebar-menu,.board-local-nav:not(.settingscard>.board-local-nav),.insighttabs';+ const groups=[...root.querySelectorAll<HTMLElement>(selector)];+ if(root instanceof HTMLElement&&root.matches(selector))groups.push(root);+ groups.forEach(group=>{+ if(group.hasAttribute('data-board-tabs'))return;group.dataset.boardTabs='true';+ const key=group.className+group.getAttribute('aria-label');+ const paint=(position:{left:number;width:number})=>{group.style.setProperty('--tab-x',`${position.left}px`);group.style.setProperty('--tab-width',`${position.width}px`)};+ const measure=()=>{const selected=group.querySelector<HTMLElement>('button[aria-selected=true],button[aria-pressed=true]');if(!selected||!selected.offsetWidth)return;const position={left:selected.offsetLeft,width:selected.offsetWidth};paint(position);tabPositions.set(key,position)};+ const previous=tabPositions.get(key);if(previous)paint(previous);else measure();+ requestAnimationFrame(()=>{group.classList.add('board-tabs-ready');requestAnimationFrame(measure)});+ const mutation=new MutationObserver(measure);mutation.observe(group,{subtree:true,attributes:true,attributeFilter:['aria-selected','aria-pressed']});+ const resize=new ResizeObserver(()=>{if(!group.isConnected){resize.disconnect();mutation.disconnect();return}measure()});resize.observe(group);+ });+}++/** 原生 radio 保留方向键语义,选中底板按实际尺寸滑动。 */+export function wireBoardSegments(root:ParentNode) {+ const groups=[...root.querySelectorAll<HTMLElement>('.iconswitch')];+ if(root instanceof HTMLElement&&root.matches('.iconswitch'))groups.push(root);+ groups.forEach(group=>{+ if(group.hasAttribute('data-board-segments'))return;+ group.dataset.boardSegments='true';+ const thumb=document.createElement('span');thumb.className='board-segment-thumb';thumb.setAttribute('aria-hidden','true');group.prepend(thumb);+ const measure=()=>{+ const selected=group.querySelector<HTMLElement>('label:has(input:checked)');if(!selected)return;+ thumb.style.transform=`translate(${selected.offsetLeft}px,${selected.offsetTop}px)`;+ thumb.style.width=`${selected.offsetWidth}px`;thumb.style.height=`${selected.offsetHeight}px`;+ };+ group.addEventListener('change',measure);+ const resize=new ResizeObserver(()=>{if(!group.isConnected){resize.disconnect();return}measure()});resize.observe(group);+ measure();requestAnimationFrame(()=>group.classList.add('board-segments-ready'));+ });+}+export function wireExpandableRanks(root:ParentNode) {root.querySelectorAll<HTMLElement>('.tasteranks,.insightranking').forEach((list,index)=>{if(list.children.length<=5||list.parentElement?.hasAttribute('data-expandable-ranks'))return;diff --git a/frontend/src/board-state-preview.tsx b/frontend/src/board-state-preview.tsxnew file mode 100644index 000000000..4d57d469a--- /dev/null+++ b/frontend/src/board-state-preview.tsx@@ -0,0 +1,56 @@+import { h, render } from 'preact';+import { useState } from 'preact/hooks';+import { LibraryProcessing } from './islands/library-processing';+import type { LibraryProcessingData } from './islands/library-processing';+import { jobProgressHtml } from './board-metrics';+import { cleanupSkeletonHtml } from './management';+import { noteHtml, loadingDotsHtml, projectBannerHtml } from '@peach/legacy/ui';++const states = [+ ['idle','待开始'],['loading','页面加载'],['preparing','准备任务'],['running','任务进行中'],+ ['retrying','等待重试'],['disconnected','失去连接'],['reconnected','恢复连接'],+ ['failed','任务失败'],['complete','任务完成'],['expired','状态已失效'],['paused','来源已暂停'],+] as const;+type State = typeof states[number][0];+const Html=({html}:{html:string})=><div dangerouslySetInnerHTML={{__html:html}}/>;++function StatePreview() {+ const [state,setState]=useState<State>('running');+ const [revision,setRevision]=useState(0);+ const [dark,setDark]=useState(document.documentElement.dataset.theme==='dark');+ const [value,setValue]=useState(38);+ const data:LibraryProcessingData={status:state==='failed'?'failed':['running','preparing','disconnected','retrying','reconnected'].includes(state)?'running':'idle',+ stage:state==='preparing'?'正在准备扫描':state==='retrying'?'等待来源响应 · 8 秒后重试':'正在整理资料',+ checked:value,...(state==='preparing'?{}:{total:100}),error:state==='failed'?'来源暂时不可用,请重试未完成项':'',+ issues:state==='failed'?[{asset_id:null,message:'来源连接超时'}]:[]};+ const problem=state==='disconnected'?'连接中断,正在重新读取处理进度':'';+ return <main class="board-state-preview">+ <header><div><h1>运行状态预览</h1><p>演示数据 · 不连接任务接口,不执行扫描或写入。</p></div>+ <button class="geist-button" onClick={()=>{document.documentElement.dataset.theme=dark?'light':'dark';setDark(!dark)}}>{dark?'浅色':'深色'}</button></header>+ <nav aria-label="演示状态">{states.map(([key,label])=><button class="geist-button" aria-pressed={state===key} onClick={()=>{setState(key);setRevision(revision+1)}}>{label}</button>)}</nav>+ <div class="board-preview-tools"><label>任务进度 <input type="range" min="0" max="100" value={value} onInput={event=>setValue(Number(event.currentTarget.value))}/><output>{value}%</output></label><button class="geist-button" onClick={()=>setRevision(revision+1)}>重播状态</button></div>+ <section aria-label="页面横幅"><h2>全局任务横幅</h2>+ <LibraryProcessing key={`banner-${state}-${revision}-${value}`} data={data} error={problem} mode="notice" preview toast={()=>{}}/>+ {!['running','preparing','disconnected','retrying','reconnected','failed'].includes(state)&&<p>此状态不常驻全局横幅。</p>}+ </section>+ <section><h2>数据管理 · 扫描与采集</h2>+ {state==='loading'?<Html html={cleanupSkeletonHtml()}/>:<div class="cleanupgrid"><section id="libraryProcessing" class="cleanupfieldset"><LibraryProcessing key={`${state}-${revision}-${value}`} data={data} error={problem} preview toast={()=>{}}/></section></div>}+ {state==='complete'&&<Html html={noteHtml('已完成扫描与资料采集',{variant:'success',label:'任务完成'})}/>}+ {state==='expired'&&<Html html={noteHtml('任务状态已失效,请重新发起任务',{variant:'warning'})}/>}+ {state==='paused'&&<span class="sbadge paused">已暂停</span>}+ </section>+ <section><h2>关注检查与资源同步</h2><div class="board-preview-grid">+ <article><h3>检查更新</h3><Html html={state==='disconnected'?noteHtml('暂时无法读取进度,正在重新连接…',{label:'任务状态'}):state==='failed'?noteHtml('检查失败:来源连接超时',{variant:'error',actionLabel:'重试'}):state==='running'||state==='retrying'||state==='reconnected'?jobProgressHtml(`${state==='retrying'?'第 2/3 次尝试,8 秒后重试 · ':''}已完成 ${value}/100 个来源`,value,100):state==='preparing'?loadingDotsHtml('正在准备检查任务…'):noteHtml(state==='complete'?'已完成检查':state==='paused'?'已暂停自动检查':state==='expired'?'任务状态已失效,请重新发起任务':'等待开始',{variant:state==='complete'?'success':'secondary'})}/></article>+ <article><h3>连接与恢复</h3><Html html={projectBannerHtml(state==='disconnected'?'暂时无法连接服务器,正在重连':state==='reconnected'?'连接已恢复,继续读取任务进度':'连接正常',{variant:state==='disconnected'?'warning':'gray',href:'#',label:'查看状态'})}/><p>失去连接只影响进度读取;恢复连接后继续展示任务状态。</p></article>+ </div></section>+ <section><h2>错误与加载状态一览</h2><div class="board-preview-grid">+ <article><h3>读取失败</h3><Html html={noteHtml('无法读取状态,请重试',{variant:'error',actionLabel:'重试'})}/></article>+ <article><h3>来源离线</h3><Html html={noteHtml('媒体来源离线,请检查挂载状态',{variant:'warning'})}/></article>+ <article><h3>没有待处理内容</h3><Html html={noteHtml('没有待处理内容',{variant:'secondary'})}/></article>+ <article><h3>等待响应</h3><Html html={loadingDotsHtml('正在读取来源状态')}/></article>+ </div></section>+ </main>;+}++/** 只由开发预览入口调用;演示组件禁止发起任务请求。 */+export function mountBoardStatePreview(root:HTMLElement){render(h(StatePreview,{}),root)}diff --git a/frontend/src/islands.ts b/frontend/src/islands.tsindex 413c87d40..a3c82361d 100644--- a/frontend/src/islands.ts+++ b/frontend/src/islands.ts@@ -16,6 +16,7 @@ import { h, render } from 'preact';export { preferredDirection } from './sort-preferences';export { boundedPreference, mountNumberSetting, syncNumberSetting } from './number-setting';export { statCardBody, rankedChart, radarChart, distributionChart, jobProgressHtml } from './board-metrics';+export { mountBoardStatePreview } from './board-state-preview';export { initBoardControls, syncBoardRange, wireExpandableRanks } from './board-controls';export { creatorSankeyHtml, wireCreatorSankey } from './board-sankey';export { radialCardHtml, wireRadialCards, activityChartsHtml, wireActivityCharts } from './board-analytics';diff --git a/frontend/src/islands/configuration.tsx b/frontend/src/islands/configuration.tsxindex 4312f5b7d..0dd0971d3 100644--- a/frontend/src/islands/configuration.tsx+++ b/frontend/src/islands/configuration.tsx@@ -17,6 +17,7 @@ import { ReleaseUpdates, type ReleaseState, type UpdateJob } from './release-updimport { PeachProxy, type PeachProxyState } from './peach-proxy';import { StartupSettings, UninstallSettings, type StartupState, type UninstallState } from './desktop-settings';import { CloudDriveGuide } from './clouddrive-guide';+import { LibraryIconPicker } from '../library-icon-picker';export interface ConfigurationProps {/** 保存成功后的过去时回执(遗留层的 Toast)。 */@@ -130,21 +131,21 @@ function MountStatus({ data }: { data: ConfigurationData }) {</div></section>;}-function MediaSourceSelect({ value, label, onChange, libraryIcon=false }: { value: string; label: string; onChange(value: string): void; libraryIcon?: boolean }) {+function MediaSourceSelect({ value, label, onChange }: { value: string; label: string; onChange(value: string): void }) {const mount = useRef<HTMLDivElement>(null);const control = useRef<HTMLElement & { value: string; disabled: boolean } | null>(null);const callback = useRef(onChange);callback.current = onChange;useLayoutEffect(() => {const root = mount.current!;- const options=libraryIcon ? [['','自动识别'],['hard-drive','磁盘'],['database','资料库'],['heart','心形'],['star','星标'],['tags','标签'],['115','115'],['pikpak','PikPak']] : [['local', '本地磁盘'], ['115', 'CloudDrive · 115'], ['pikpak', 'CloudDrive · PikPak']];+ const options=[['local', '本地磁盘'], ['115', 'CloudDrive · 115'], ['pikpak', 'CloudDrive · PikPak']];root.innerHTML = selectFieldHtml(options.map(([kind, text]) => [kind!, text!, MEDIA_SOURCE_ICONS[kind!] || kind || 'database']), value, { label });const field = wireSelectField(root.firstElementChild!);control.current = field;const change = () => callback.current(field.value);field.addEventListener('change', change);return () => { control.current = null; field.disabled = true; field.removeEventListener('change', change); root.replaceChildren(); };- }, [label,libraryIcon]);+ }, [label]);useLayoutEffect(() => { if (control.current) control.current.value = value; }, [value]);return <div ref={mount} class="configsourcecontrol" />;}@@ -295,12 +296,12 @@ function ConfigurationForm({ data, receipt }: { data: ConfigurationData; receipt</button>) : null}<div class="configsource">- <label>媒体库+ <label>媒体库名称<input class="geist-input" aria-label={`媒体库 ${index + 1}`} maxLength={80} value={libraries[index] || ''} placeholder="同名文件夹归入同一个媒体库"onInput={(event) => { const next = [...libraries]; next[index] = event.currentTarget.value; setLibraries(next); }} /></label><div class="configsourcelabel">媒体库图标- <MediaSourceSelect libraryIcon label={`媒体库图标 ${index + 1}`} value={libraryIcons[index] || ''}+ <LibraryIconPicker label={`媒体库图标 ${index + 1}`} value={libraryIcons[index] || ''}onChange={(value) => { const next = [...libraryIcons]; next[index] = value; setLibraryIcons(next); }} /></div><div class="configsourcelabel">媒体来源diff --git a/frontend/src/islands/library-processing.tsx b/frontend/src/islands/library-processing.tsxindex f0b72e5c7..bfa900ba3 100644--- a/frontend/src/islands/library-processing.tsx+++ b/frontend/src/islands/library-processing.tsx@@ -10,11 +10,11 @@ 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; mode?: 'notice'; monitor?: boolean }+export interface LibraryProcessingProps { toast(message: string): void; onComplete?(): void; mode?: 'notice'; monitor?: boolean; preview?: boolean }export const loadLibraryProcessing = (_props: LibraryProcessingProps, signal: AbortSignal) =>apiGet<LibraryProcessingData>('/api/library-processing', signal);-export function LibraryProcessing({ data, error, toast, onComplete, mode, monitor }: LibraryProcessingProps & IslandState<LibraryProcessingData>) {+export function LibraryProcessing({ data, error, toast, onComplete, mode, monitor, preview }: LibraryProcessingProps & IslandState<LibraryProcessingData>) {const [state, setState] = useState<LibraryProcessingData>(data || { status: 'idle' });const [problem, setProblem] = useState(error);const [submitting, setSubmitting] = useState(false);@@ -41,11 +41,11 @@ export function LibraryProcessing({ data, error, toast, onComplete, mode, monito});}useEffect(() => {- if (state.status === 'running' || mode === 'notice' || monitor) void follow();+ if (!preview && (state.status === 'running' || mode === 'notice' || monitor)) void follow();return () => lifetime.current.abort();}, []);async function start() {- if (busy) return;+ if (busy || preview) return;setSubmitting(true); setProblem(''); setReceipt(false);try {const next = await apiSend<LibraryProcessingData>('/api/library-processing', {}, 'POST', lifetime.current.signal);@@ -71,8 +71,9 @@ export function LibraryProcessing({ data, error, toast, onComplete, mode, monito<p>扫描媒体文件夹,导入已有资料,采集缺失信息。</p><div aria-live="polite">{state.status === 'running' && <>- <div dangerouslySetInnerHTML={{ __html: loadingDotsHtml(`${state.stage || '正在处理'}${state.total ? ` · ${state.checked || 0} / ${state.total}` : ''}`) }} />- {!!state.total && <div dangerouslySetInnerHTML={{ __html: jobProgressHtml(`已处理 ${state.checked || 0} / ${state.total} 个视频`, state.checked || 0, state.total) }} />}+ <div dangerouslySetInnerHTML={{ __html: state.total+ ? jobProgressHtml(`${state.stage || '正在处理'} · ${state.checked || 0} / ${state.total} 个视频`, state.checked || 0, state.total)+ : loadingDotsHtml(state.stage || '正在处理') }} /></>}{(problem || state.status === 'failed') && <div role="alert" onClick={event=>{if((event.target as HTMLElement).closest('[data-note-action]'))void start();}} dangerouslySetInnerHTML={{ __html: noteHtml(problem || state.error || '处理未完成,请重试', { variant: 'error',filled:true,actionLabel:state.status==='failed'?'重试未完成项':'' }) }} />}{state.status === 'failed' && !!state.issues?.length && <ul>{state.issues.slice(0, 20).map(issue =>diff --git a/frontend/src/jobs.ts b/frontend/src/jobs.tsindex 2e32469f7..d9610ed09 100644--- a/frontend/src/jobs.ts+++ b/frontend/src/jobs.ts@@ -50,7 +50,7 @@ export function followJobProgress(options: {complete: (state: JobState) => void;note: (text: string) => string;loading: (text: string) => string;- progress: (value: number, max: number) => string;+ progress: (value: number, max: number, label?: string) => string;container?: (content: string) => string;storageKey?: string;title?: string;@@ -82,8 +82,8 @@ export function followJobProgress(options: {? `${state.older ? '抓取历史' : '检查更新'}:已完成 ${state.checked || 0}/${state.total} 个来源`: '正在准备检查任务…'))+ (current ? ` · ${current.label || current.provider || ''}${attempt}` : '');- const content = options.loading(text)- + ((state.total || 0) > 0 ? options.progress(state.checked || 0, state.total!) : '');+ const content = (state.total || 0) > 0+ ? options.progress(state.checked || 0, state.total!, text) : options.loading(text);panel.innerHTML = options.container ? options.container(content) : content;} else if (tracked && tracked === state.job_id) {tracked = undefined;diff --git a/frontend/src/library-icon-picker.tsx b/frontend/src/library-icon-picker.tsxnew file mode 100644index 000000000..e621f5467--- /dev/null+++ b/frontend/src/library-icon-picker.tsx@@ -0,0 +1,28 @@+import { useRef, useState } from 'preact/hooks';+import { selectOptionIconHtml } from '@peach/legacy/ui';++export const LIBRARY_ICON_CHOICES = [+ ['', '自动识别'], ['hard-drive','磁盘'], ['database','资料库'], ['heart','心动'], ['heart-hand','亲密'],+ ['flame','热情'], ['cherry','樱桃'], ['gem','精选'], ['crown','女王'], ['shirt','制服'],+ ['footprints','足迹'], ['flower','花朵'], ['venetian-mask','角色扮演'], ['hand','手部'], ['bed-double','卧室'],+ ['moon','夜色'], ['sparkles','幻想'], ['camera','写真'], ['video','影片'], ['star','收藏'], ['tags','主题'],+] as const;++export function LibraryIconPicker({value,label,onChange}:{value:string;label:string;onChange(value:string):void}) {+ const [draft,setDraft]=useState(value);+ const popup=useRef<HTMLDialogElement>(null),trigger=useRef<HTMLButtonElement>(null);+ const glyph=(name:string)=><span aria-hidden="true" dangerouslySetInnerHTML={{__html:selectOptionIconHtml(name||'database')}}/>;+ const open=()=>{setDraft(value);const dialog=popup.current!,rect=trigger.current!.getBoundingClientRect();dialog.showModal();+ const box=dialog.getBoundingClientRect();dialog.style.left=`${Math.max(8,Math.min(innerWidth-box.width-8,rect.left))}px`;+ dialog.style.top=`${rect.bottom+box.height+8<=innerHeight?rect.bottom+4:Math.max(8,rect.top-box.height-4)}px`;+ };+ return <div class="board-icon-picker">+ <button ref={trigger} type="button" class="geist-button board-icon-trigger" aria-label={label} aria-haspopup="dialog" onClick={open}>{glyph(value)}<span>{LIBRARY_ICON_CHOICES.find(([key])=>key===value)?.[1]||'自动识别'}</span></button>+ <dialog ref={popup} class="board-icon-popover" aria-label={`${label}候选`} onCancel={()=>setDraft(value)} onClick={event=>{if(event.target===popup.current){popup.current?.close();setDraft(value)}}}>+ <div class="board-icon-panel"><h3>选择媒体库图标</h3><div role="radiogroup" aria-label="候选图标" class="board-icon-grid">+ {LIBRARY_ICON_CHOICES.map(([key,name])=><label title={name} class={draft===key?'selected':''}><input type="radio" name={`${label}-icon`} aria-label={name} value={key} checked={draft===key} onChange={()=>setDraft(key)}/>{glyph(key)}<small>{name}</small></label>)}+ </div></div>+ <footer><button type="button" class="geist-button" onClick={()=>{setDraft(value);popup.current!.close()}}>取消</button><button type="button" class="geist-button primary" disabled={draft===value} onClick={()=>{onChange(draft);popup.current!.close()}}>应用</button></footer>+ </dialog>+ </div>;+}diff --git a/frontend/src/management.ts b/frontend/src/management.tsindex 17e0be3ec..c819f7fec 100644--- a/frontend/src/management.ts+++ b/frontend/src/management.ts@@ -16,17 +16,17 @@ export function cloudPreferenceLocations(files: readonly { location: string }[],export function cleanupSkeletonHtml(): string {const cards = [['扫描与采集', '扫描并补全资料', '扫描媒体文件夹,导入已有资料,采集缺失信息。'],- ['垃圾文件', '查看垃圾文件', ''], ['重复文件', '查看重复文件', ''],- ['空文件夹', '删除空文件夹', ''], ['人工复核', '查看候选', ''],- ['回收站', '查看回收站', ''], ['高清版', '查看高清版', ''],+ ['人工复核', '查看候选', ''], ['高清版', '查看高清版', ''],+ ['重复文件', '查看重复文件', ''], ['垃圾文件', '查看垃圾文件', ''],+ ['空文件夹', '扫描空文件夹', ''], ['回收站', '查看回收站', ''],];return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态"><div class="cleanupgrid">${cards.map(([title, action, description], index) => `- <section class="cleanupfieldset" data-geist-fieldset aria-labelledby="cleanup-loading-${index}">+ <section class="cleanupfieldset${index===0?' board-processing-skeleton':''}" data-geist-fieldset aria-labelledby="cleanup-loading-${index}"><div class="geist-fieldset-content"><h3 class="geist-fieldset-title" id="cleanup-loading-${index}">${title}</h3>${description ? `<p>${description}</p>` : '<strong><span class="skeleton cleanup-count-skeleton" aria-hidden="true"></span></strong>'}- ${index === 3 ? '<p class="cleanupmeta"><span class="skeleton cleanup-count-skeleton" aria-hidden="true"></span></p>' : ''}</div>- <footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button"${index === 3 ? ' class="danger"' : ''} disabled>${index === 3 ? '<svg aria-hidden="true"><use href="#i-trash"></use></svg><span>' + action + '</span>' : action}</button></footer>+ ${index === 5 ? '<p class="cleanupmeta"><span class="skeleton cleanup-count-skeleton" aria-hidden="true"></span></p>' : ''}</div>+ <footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" disabled>${index === 5 ? '<svg aria-hidden="true"><use href="#i-scan-search"></use></svg><span>' + action + '</span>' : action}</button></footer></section>`).join('')}</div></div>`;}diff --git a/frontend/test/board-controls.test.ts b/frontend/test/board-controls.test.tsindex 6e3868d66..6ad66f2f4 100644--- a/frontend/test/board-controls.test.ts+++ b/frontend/test/board-controls.test.ts@@ -1,7 +1,16 @@import { describe,it,expect } from 'vitest';-import { syncBoardRange, wireExpandableRanks } from '../src/board-controls';+import { syncBoardRange, wireExpandableRanks, wireBoardSegments } from '../src/board-controls';describe('范围控件',()=>{+ it('视图切换保留原生 radio 且重复接线只创建一个滑块',()=>{+ document.body.innerHTML='<div class="iconswitch"><label><input type="radio" name="view" value="large" checked>大图</label><label><input type="radio" name="view" value="small">小图</label></div>';+ wireBoardSegments(document);wireBoardSegments(document);+ expect(document.querySelectorAll('.board-segment-thumb')).toHaveLength(1);+ const inputs=[...document.querySelectorAll<HTMLInputElement>('input')];+ inputs[1]!.click();+ expect(inputs[0]!.checked).toBe(false);expect(inputs[1]!.checked).toBe(true);+ expect(document.querySelector('.board-segment-thumb')?.getAttribute('aria-hidden')).toBe('true');+ });it('折叠排名退出键盘导航,展开后恢复,重复接线不重复按钮',()=>{document.body.innerHTML='<div class="tasteranks">'+Array.from({length:7},()=>'<button>排名</button>').join('')+'</div>';wireExpandableRanks(document);wireExpandableRanks(document);diff --git a/frontend/test/jobs.test.ts b/frontend/test/jobs.test.tsindex ae1f70f01..865bdaf38 100644--- a/frontend/test/jobs.test.ts+++ b/frontend/test/jobs.test.ts@@ -9,7 +9,7 @@ describe('后台任务状态恢复', () => {const host=document.createElement('div');document.body.append(host);let state={status:'running',job_id:'taste',checked:0,total:3,message:'分析浏览记录:已处理 0 / 3 条'};followJobProgress({host,active:()=>true,read:async()=>state,busy:()=>{},complete:()=>{},- title:'读取浏览记录',note:text=>text,loading:text=>text,progress:(value,max)=>`${value}/${max}`});+ title:'读取浏览记录',note:text=>text,loading:text=>text,progress:(value,max,label)=>`${label} ${value}/${max}`});await vi.advanceTimersByTimeAsync(0);expect(host.textContent).toContain(state.message);state={...state,checked:2,message:'分析浏览记录:已处理 2 / 3 条'};@@ -25,7 +25,7 @@ describe('后台任务状态恢复', () => {current: {label: '演示来源', attempt: 3, max_attempts: 5, retry_in: 2}};const mount = (element: HTMLElement) => followJobProgress({host: element,active: () => true, read: async () => state, busy: () => {}, complete,- note: text => text, loading: text => text, progress: () => '',+ note: text => text, loading: text => text, progress: (_value,_max,label) => label||'',container: content => `<section data-geist-fieldset>${content}</section>`});mount(host); await vi.advanceTimersByTimeAsync(0);expect(host.textContent).toContain('1/3');diff --git a/frontend/test/library-icon-picker.test.tsx b/frontend/test/library-icon-picker.test.tsxnew file mode 100644index 000000000..c6b6d8b0b--- /dev/null+++ b/frontend/test/library-icon-picker.test.tsx@@ -0,0 +1,21 @@+import { afterEach, expect, it, vi } from 'vitest';+import { h, render } from 'preact';+import { act } from 'preact/test-utils';+import { LibraryIconPicker, LIBRARY_ICON_CHOICES } from '../src/library-icon-picker';+let root:HTMLDivElement;+afterEach(()=>{render(null,root);document.body.innerHTML=''});+it('候选图标不包含网盘,取消保持原值,应用才提交草稿',async()=>{+ expect(LIBRARY_ICON_CHOICES.some(([value])=>['115','pikpak'].includes(value))).toBe(false);+ root=document.createElement('div');document.body.append(root);const change=vi.fn();+ await act(async()=>render(h(LibraryIconPicker,{label:'媒体库图标',value:'heart',onChange:change}),root));+ const dialog=root.querySelector('dialog')!;dialog.showModal=()=>dialog.setAttribute('open','');dialog.close=()=>dialog.removeAttribute('open');+ await act(async()=>root.querySelector<HTMLButtonElement>('.board-icon-trigger')!.click());+ await act(async()=>root.querySelector<HTMLInputElement>('input[value=cherry]')!.click());+ expect(change).not.toHaveBeenCalled();+ await act(async()=>root.querySelector<HTMLButtonElement>('footer button')!.click());+ await act(async()=>root.querySelector<HTMLButtonElement>('.board-icon-trigger')!.click());+ expect(root.querySelector<HTMLInputElement>('input[value=heart]')!.checked).toBe(true);+ await act(async()=>root.querySelector<HTMLInputElement>('input[value=cherry]')!.click());+ await act(async()=>root.querySelector<HTMLButtonElement>('footer button.primary')!.click());+ expect(change).toHaveBeenCalledWith('cherry');+});diff --git a/frontend/test/library-processing.test.tsx b/frontend/test/library-processing.test.tsxindex 58e4a53b9..ec60bdee8 100644--- a/frontend/test/library-processing.test.tsx+++ b/frontend/test/library-processing.test.tsx@@ -4,6 +4,17 @@ import { act } from 'preact/test-utils';import { LibraryProcessing } from '../src/islands/library-processing';let host: HTMLDivElement;+it('演示运行态与失败重试都不请求真实任务', async()=>{+ const fetch=vi.fn();vi.stubGlobal('fetch',fetch);+ host=document.createElement('div');document.body.append(host);+ await act(async()=>render(h(LibraryProcessing,{data:{status:'running',checked:2,total:10},error:'',toast:vi.fn(),preview:true,monitor:true}),host));+ expect(host.querySelector('[role=progressbar]')?.getAttribute('aria-valuenow')).toBe('2');+ expect(host.querySelectorAll('[role=progressbar]')).toHaveLength(1);+ expect(host.querySelector('.geist-loading-dots')).toBeNull();+ await act(async()=>{render(h(LibraryProcessing,{key:'failed',data:{status:'failed'},error:'',toast:vi.fn(),preview:true}),host)});+ await act(async()=>{host.querySelector<HTMLButtonElement>('[data-note-action]')?.click()});+ expect(fetch).not.toHaveBeenCalled();+});afterEach(() => { if(host)render(null, host); document.body.innerHTML=''; vi.useRealTimers(); vi.unstubAllGlobals(); });it('启动只提交一次,进度用 GET 读取并提供复核入口', async () => {const requests: string[]=[];diff --git a/scripts/vendor_web_dependencies.mjs b/scripts/vendor_web_dependencies.mjsindex 6530c536d..8a88fd989 100644--- a/scripts/vendor_web_dependencies.mjs+++ b/scripts/vendor_web_dependencies.mjs@@ -69,6 +69,10 @@ copyPackageFiles({});const lucideIcons = new Map([+ ["heart-hand","hand-heart"], ["flame","flame"], ["cherry","cherry"], ["gem","gem"],+ ["crown","crown"], ["shirt","shirt"], ["footprints","footprints"], ["flower","flower"],+ ["venetian-mask","venetian-mask"], ["hand","hand"], ["bed-double","bed-double"],+ ["camera","camera"], ["video","video"], ["scan-search","scan-search"],["clapperboard", "clapperboard"], ["briefcase", "briefcase"],["home", "home"], ["panel-left", "panel-left"], ["search", "search"],["layout-grid", "layout-grid"], ["square-check-big", "square-check-big"],diff --git a/src/peach/media_libraries.py b/src/peach/media_libraries.pyindex b99207a71..f1d0b51ae 100644--- a/src/peach/media_libraries.py+++ b/src/peach/media_libraries.py@@ -1,7 +1,9 @@"""媒体库按声明路径分组,来源与挂载仍由媒体配置管理。"""from pathlib import PureWindowsPath-LIBRARY_ICONS = frozenset({"hard-drive", "database", "heart", "star", "tags", "115", "pikpak"})+LIBRARY_ICONS = frozenset({"hard-drive", "database", "heart", "star", "tags", "115", "pikpak",+ "heart-hand", "flame", "cherry", "gem", "crown", "shirt", "footprints",+ "flower", "venetian-mask", "hand", "bed-double", "moon", "sparkles", "camera", "video"})def libraries(config):diff --git a/src/peach/web_batch.py b/src/peach/web_batch.pyindex d7df98802..4ba868659 100644--- a/src/peach/web_batch.py+++ b/src/peach/web_batch.py@@ -359,7 +359,7 @@ def _remove_empty_ancestors(parent: Path, source_roots: Sequence[Path]) -> list[return removed-def cleanup_empty_source_directories() -> dict[str, object]:+def cleanup_empty_source_directories(*, dry_run: bool = False) -> dict[str, object]:"""Delete empty directories below each online physical source.The declared source roots themselves are permanent boundaries and are never removed.@@ -367,7 +367,7 @@ def cleanup_empty_source_directories() -> dict[str, object]:directory links are not followed or removed."""results: list[dict[str, object]] = []- total_scanned = total_removed = total_errors = 0+ total_scanned = total_removed = total_errors = total_empty = 0for location, declarations in LOCATION_ROOT_DECLARATIONS.items():roots = [translate_ledger_path(declaration) for declaration in declarations]mapped = all(not is_unmapped(root) for root in roots)@@ -378,6 +378,7 @@ def cleanup_empty_source_directories() -> dict[str, object]:"online": online,"scanned": 0,"removed": 0,+ "empty": 0,"errors": 0,}if not online:@@ -385,6 +386,7 @@ def cleanup_empty_source_directories() -> dict[str, object]:continuewalk_errors: list[OSError] = []+ empty_paths: set[Path] = set()for root in roots:for directory, _subdirectories, _files in os.walk(root, topdown=False, onerror=walk_errors.append, followlinks=False):@@ -393,6 +395,11 @@ def cleanup_empty_source_directories() -> dict[str, object]:continuerow["scanned"] = int(row["scanned"]) + 1try:+ if dry_run:+ if all(child in empty_paths and not child.is_symlink() for child in candidate.iterdir()):+ empty_paths.add(candidate)+ row["empty"] = int(row["empty"]) + 1+ continuecandidate.rmdir()except FileNotFoundError:# CloudDrive can remove the same empty directory concurrently.@@ -405,12 +412,15 @@ def cleanup_empty_source_directories() -> dict[str, object]:row["errors"] = int(row["errors"]) + len(walk_errors)total_scanned += int(row["scanned"])total_removed += int(row["removed"])+ total_empty += int(row["empty"])total_errors += int(row["errors"])results.append(row)return {"ok": total_errors == 0,"scanned": total_scanned,"removed": total_removed,+ "empty": total_empty,+ "dry_run": dry_run,"errors": total_errors,"sources": results,}@@ -515,7 +525,7 @@ def w_empty_trash(contract: WebContract):def w_cleanup_empty_directories(_contract: WebContract, _body):"""Remove empty folders from online physical sources without touching the ledger."""- return cleanup_empty_source_directories()+ return cleanup_empty_source_directories(dry_run=True) if _body.get('dry_run') is True else cleanup_empty_source_directories()diff --git a/tests/test_desktop_settings.py b/tests/test_desktop_settings.pyindex b4a47b670..80c14dee8 100644--- a/tests/test_desktop_settings.py+++ b/tests/test_desktop_settings.py@@ -39,7 +39,11 @@ class DesktopSettingsTests(unittest.TestCase):self.assertIn("{label: '清理内容'}", renderer)self.assertIn('class="geist-button primary" type="button" id="resourceApply"', renderer)self.assertIn("danger:false,onConfirm", sync)- self.assertIn('cleanupemptyfolders" data-geist-fieldset data-fieldset-type="error"', app)+ empty = app[app.index('empty:`<section'):app.index("review:entryCard('review')")]+ self.assertNotIn('data-fieldset-type="error"', empty)+ self.assertIn('data-cleanup-empty-scan', empty)+ self.assertIn('class="danger" data-cleanup-empty hidden', empty)+ self.assertIn("{dry_run:true}", app)def setUp(self):temporary = tempfile.TemporaryDirectory()diff --git a/tests/test_rm_web.py b/tests/test_rm_web.pyindex 829b111fb..abdae7cfa 100644--- a/tests/test_rm_web.py+++ b/tests/test_rm_web.py@@ -1137,6 +1137,20 @@ class WebDataTests(unittest.TestCase):"清理服务端物理目录不写 ledger,不该被 reader 的账本闸门误拦",)+ def test_empty_folder_scan_counts_nested_candidates_without_removing_anything(self):+ source_root = Path(self.tmp.name) / "scan-source"+ leaf = source_root / "empty" / "nested"+ leaf.mkdir(parents=True)+ kept = source_root / "kept"+ kept.mkdir()+ (kept / "media.mp4").write_bytes(b"keep")+ with mock.patch.object(web_batch, "LOCATION_ROOT_DECLARATIONS", {"local": (str(source_root),)}):+ result = web_batch.w_cleanup_empty_directories(self.contract, {"dry_run": True})+ self.assertEqual(result["empty"], 2)+ self.assertEqual(result["removed"], 0)+ self.assertTrue(leaf.is_dir())+ self.assertEqual((kept / "media.mp4").read_bytes(), b"keep")+def test_failed_database_commit_restores_quarantined_media(self):path = self.stage_media(1, "commit-failure.mp4")rm_web.w_feedback(self.contract, {"id": 1, "kind": "dispose"})diff --git a/tests/test_web_ui.py b/tests/test_web_ui.pyindex 68aa74b98..80d66e174 100644--- a/tests/test_web_ui.py+++ b/tests/test_web_ui.py@@ -1871,7 +1871,8 @@ class WebUiSourceTests(unittest.TestCase):"${framed?' data-framed=\"\"':''}>${preview}${")self.assertPageContains("!metadata&&evidence?`<p class=\"reviewevidence\">""${esc(evidence)}</p>`:''}</div>`;")- self.assertPageContains('${tags?`<div class="reviewtags">${tags}</div>`:\'\'}${stage}`;')+ self.assertPageContains("tags||reviewCategory==='creator_tags'")+ self.assertPageContains('暂无候选标签</small>')# 高度从卡身一路传到框:滚动壳不给 height,中间就断在内容高度上,框只到# 内容为止,卡的下半截空着。框只长不缩,内容超出时由滚动壳接手。self.assertPageContains(".reviewcontent .geist-scroller{height:100%}")@@ -7162,8 +7163,8 @@ class WebUiSourceTests(unittest.TestCase):self.assertIn("button._observer?.disconnect();", body, "重画后必须先断开旧观察器")self.assertIn("if(button.hidden)return;", body, "藏起来的按钮不该被观察")self.assertIn("rootMargin:'320px'", body)- self.assertEqual(self.page.count("new IntersectionObserver"), 2,- "观察器只允许存在两处:wireLoadMore 与首页自己的 loadObserver")+ self.assertEqual(self.page.count("new IntersectionObserver"), 3,+ "观察器用于 wireLoadMore、首页 loadObserver 与复核滚动容器延迟初始化")self.assertEqual(self.page.count("wireLoadMore("), 4,"1 处定义加 3 处调用;对不上就是又有人自己写了一套")diff --git a/web/app.js b/web/app.jsindex f03e5b6a2..687033a49 100644--- a/web/app.js+++ b/web/app.js@@ -3508,8 +3508,7 @@ async function wireLinkManager(){setActionBusy(button,running);if(payload.status==='idle'){result.innerHTML='';return}if(payload.status==='failed'){result.innerHTML=noteHtml(payload.error||'检查失败',{variant:'error',label:'检查失败'});return}- const progress=running?loadingDotsHtml(`已检查 ${payload.checked.toLocaleString()} / ${(payload.total||0).toLocaleString()} 条`)- +(payload.total?jobProgressHtml('已检查链接',payload.checked,payload.total):''):'';+ const progress=running?(payload.total?jobProgressHtml(`已检查 ${payload.checked.toLocaleString()} / ${payload.total.toLocaleString()} 条链接`,payload.checked,payload.total):loadingDotsHtml('正在检查链接')):'';/* gone 和 unclear 必须分开摆:`linktr.ee` 回 403 是挡爬虫、`x.com` 回 500 是临时错误,链接本身好好的。混成一张表会让人顺手把好链接一起删掉。 */const gone=table('已失效',payload.gone||[],'上游明确回 404/410,页面确实没了。');@@ -3599,8 +3598,7 @@ async function wireResourceSync(){await ui.watchJob({active,read:signal=>api('/api/resource-sync/scan',{signal,method:'POST',body:JSON.stringify({background:true,status_only:true})}),render:state=>{payload=state;if(state.status==='running'){- result.innerHTML=loadingDotsHtml(`后台扫描中:已完成 ${state.completed_sources||0}/${state.total_sources||0} 个来源`)- +(state.total_sources?jobProgressHtml('已扫描来源',state.completed_sources||0,state.total_sources):'')}},+ result.innerHTML=state.total_sources?jobProgressHtml(`已扫描 ${state.completed_sources||0}/${state.total_sources} 个来源`,state.completed_sources||0,state.total_sources):loadingDotsHtml('正在扫描来源')}},disconnected:()=>{result.innerHTML=noteHtml('暂时无法读取进度,正在重新连接…',{label:'任务状态'})}});if(payload.status==='failed')throw new Error(payload.error||'后台扫描失败');if(payload.status==='idle')throw new Error('任务尚未启动,请重试扫描');@@ -4136,11 +4134,11 @@ async function openDataCleanup(push=true){<p class="cleanupmeta">${Number(duplicates.total||0)?`可回收 ${fmtSize(duplicates.reclaimable||0)}`:''}</p></div><footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" data-cleanup-open="duplicates">查看重复文件</button></footer></section>`,- empty:`<section class="cleanupfieldset cleanupemptyfolders" data-geist-fieldset data-fieldset-type="error" aria-labelledby="cleanupEmptyTitle">+ empty:`<section class="cleanupfieldset cleanupemptyfolders" data-geist-fieldset aria-labelledby="cleanupEmptyTitle"><div class="geist-fieldset-content">${fieldsetTitle('cleanupEmptyTitle','空文件夹')}<strong>${online.length.toLocaleString()} 个来源可扫描</strong><p class="cleanupmeta">${sourceLine}</p><p class="cleanupstate" aria-live="polite"></p></div>- <footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" class="danger" data-cleanup-empty>${icon('trash')}<span>删除空文件夹</span></button></footer>+ <footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" data-cleanup-empty-scan ${online.length?'':'disabled'}>${icon('scan-search')}<span>扫描空文件夹</span></button><button type="button" class="danger" data-cleanup-empty hidden>${icon('trash')}<span>删除空文件夹</span></button></footer></section>`,review:entryCard('review'),quality:entryCard('quality'),trash:entryCard('trash'),};@@ -4160,6 +4158,16 @@ async function openDataCleanup(push=true){button.onclick=()=>openManage(button.dataset.cleanupGo));paintDataManagementCounts();const emptyButton=$('#stats').querySelector('[data-cleanup-empty]');+ const emptyScan=$('#stats').querySelector('[data-cleanup-empty-scan]');+ emptyScan.onclick=async()=>{+ const status=$('#stats').querySelector('.cleanupstate');setActionBusy(emptyScan);emptyButton.hidden=true;+ status.textContent='正在检查空文件夹…';+ try{const result=await api('/api/data-cleanup/empty-folders',{method:'POST',body:JSON.stringify({dry_run:true})});+ if(!surfaceCurrent(surface))return;+ status.textContent=`已检查 ${Number(result.scanned||0).toLocaleString()} 个目录,发现 ${Number(result.empty||0).toLocaleString()} 个空文件夹${result.errors?`,${result.errors} 个目录读取失败`:''}。`;+ emptyButton.hidden=!(result.empty>0);+ }catch(error){status.textContent=`扫描失败:${error.message}`}finally{setActionBusy(emptyScan,false)}+ };emptyButton.onclick=async()=>{return confirmModal({title:'删除空文件夹',body:'将删除已连接磁盘和网盘中的空文件夹,保留来源根目录。',confirmLabel:'删除空文件夹',danger:true,onConfirm:async()=>{const status=$('#stats').querySelector('.cleanupstate'),original=emptyButton.innerHTML;@@ -4170,7 +4178,7 @@ async function openDataCleanup(push=true){status.textContent=`已检查 ${Number(result.scanned||0).toLocaleString()} 个目录,删除 ${Number(result.removed||0).toLocaleString()} 个${result.errors?`,${Number(result.errors).toLocaleString()} 个读取或删除失败`:''}。`;if(result.errors)actionFailure('空文件夹清理',new Error(`${result.errors} 个目录处理失败`));else actionReceipt(`已删除 ${Number(result.removed||0).toLocaleString()} 个空文件夹`);- }finally{setActionBusy(emptyButton,false);emptyButton.innerHTML=original}+ }finally{setActionBusy(emptyButton,false);emptyButton.innerHTML=original;emptyButton.hidden=true}}});};await wireLinkManager();@@ -4416,7 +4424,7 @@ async function openReview(push=true){// 账本规范名当标题,抓取来源给的写法(多为罗马音)留作副标题。row.source_name?`<p class="reviewalias">来源写法:${esc(row.source_name)}</p>`:''}${// 实体类卡片的作品数已经写在创作者入口里,这里再写一遍就是同一个数字两处。- subjectKind&&subjectName?'':`<p>${esc(row.board||row.assets?`样本/资产:${row.video_count||row.assets||''}`:'')}</p>`}${subjectKind&&subjectName?'':origin}${tags?`<div class="reviewtags">${tags}</div>`:''}${stage}`;+ subjectKind&&subjectName?'':`<p>${esc(row.board||row.assets?`样本/资产:${row.video_count||row.assets||''}`:'')}</p>`}${subjectKind&&subjectName?'':origin}${tags||reviewCategory==='creator_tags'?`<div class="reviewtags">${tags||'<small>暂无候选标签</small>'}</div>`:''}${stage}`;/* 主体动作在最右:一行里从左到右是「拒绝、跳过、通过」,读到最后一枚才是这张卡真正要人做的判断。Geist 的弹层与 Fieldset 操作条都是这个方向——取消在左,主动作靠 margin-left:auto 推到最右(vercel-geist-fieldset-scroller-empty-state.md)。 */@@ -5329,7 +5337,7 @@ async function wireFollowProgress(){if(surfaceCurrent(surface))void refreshFollowSurface(surface)},note:text=>noteHtml(text,{label:'任务状态'}),loading:text=>loadingDotsHtml(text),container:content=>`<section class="followtask" data-geist-fieldset aria-label="检查更新进度"><div class="geist-fieldset-content">${content}</div></section>`,- progress:(value,max)=>jobProgressHtml(`已完成 ${value}/${max} 个来源`,value,max)});+ progress:(value,max,label)=>jobProgressHtml(label||`已完成 ${value}/${max} 个来源`,value,max)});}async function refreshFollowSurface(surface){try{@@ -5354,7 +5362,7 @@ async function wireOperationProgress({host,path,key,title,busy,complete}){complete(report)},note:text=>noteHtml(text,{label:'任务状态'}),loading:text=>loadingDotsHtml(text),container:content=>`<section class="followtask" data-geist-fieldset aria-label="任务进度"><div class="geist-fieldset-content">${content}</div></section>`,- progress:(value,max)=>jobProgressHtml(`已处理 ${value} / ${max}`,value,max)});+ progress:(value,max,label)=>jobProgressHtml(label||`已处理 ${value} / ${max}`,value,max)});}function wireTasteProgress(){const button=$('#stats').querySelector('[data-taste-refresh]');@@ -5534,7 +5542,7 @@ const followSourceSelection=new Set();function followSourceRow(source,selectable=false){const state=source.last_status||'未检查';const bad=state==='error'||state==='unauthorized';- const badge=!source.enabled?'none':state==='ok'?'ok':bad?'error':'none';+ const badge=!source.enabled?'paused':state==='ok'?'ok':bad?'error':'none';const stateTitle=source.history_exhausted?'没有更多':!source.enabled?'已暂停':state==='ok'?'正常':bad?'检查失败':'未检查';const statusChip=`<span class="sbadge ${badge}" title="${esc(stateTitle)}"><i aria-hidden="true"></i><span>${esc(stateTitle)}</span></span>`;return `<div class="frow fsource${bad?' bad':''}${source.enabled?'':' disabled'}">@@ -5827,6 +5835,10 @@ function wireFollowManage(creds=[]){});};selectable.forEach(field=>field.onchange=()=>{const id=Number(field.dataset.followSelect);if(field.checked)followSourceSelection.add(id);else followSourceSelection.delete(id);syncSelection()});+ selectable.forEach(field=>field.closest('.fsource').addEventListener('click',event=>{+ if(event.target.closest('a,button,label,input'))return;+ field.click();+ }));root.querySelectorAll('[data-follow-author-select]').forEach(button=>button.onclick=event=>{event.preventDefault();event.stopPropagation();const fields=[...button.closest('.fauthor').querySelectorAll('[data-follow-select]')],checked=!fields.every(field=>field.checked);@@ -9298,7 +9310,7 @@ if(!legacyUI && /Chrome|Chromium|Edg\//.test(navigator.userAgent)){};new ResizeObserver(draw).observe(node);draw();}- const sync=()=>document.querySelectorAll('.board-filter-frame,.top .search,.top>.ib,.edge,.drawer').forEach(attach);+ const sync=()=>document.querySelectorAll('.board-filter-frame,.top .search,.top>.ib,.edge,.drawer,.selectiondock,.reviewcontrols,.reviewgroupbar').forEach(attach);new MutationObserver(sync).observe(document.querySelector('#main'),{childList:true,subtree:true});sync();}diff --git a/web/board.css b/web/board.cssindex 833a7272c..1ac9052e0 100644--- a/web/board.css+++ b/web/board.css@@ -157,6 +157,12 @@ body #manageTitle,body.cleanup-layout #manageCrumb,body.cleanup-layout #manageLe@media(max-width:600px){.settingsscroll .settingrow{grid-template-columns:1fr;gap:12px}.settingsscroll .settingrow:has(input[type=checkbox]){grid-template-columns:minmax(0,1fr) auto}.board-number-control input{width:110px}}.pselect,.popmenu{border-radius:12px;border-color:var(--line);box-shadow:0 8px 24px #00000012}.geist-switch,.switchgroup{background:var(--surface);border-radius:10px}+.iconswitch[data-board-segments]{position:relative;display:inline-flex;align-items:center;gap:2px;padding:4px;border:0;border-radius:10px;background:var(--color-background-tertiary-default)}+.iconswitch[data-board-segments]>label{position:relative;z-index:1;border:0;border-radius:6px}+.iconswitch[data-board-segments]>label:has(input:checked){background:transparent;box-shadow:none}+.board-segment-thumb{position:absolute;left:0;top:0;pointer-events:none;border-radius:6px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}+.board-segments-ready>.board-segment-thumb{transition:transform 200ms ease,width 200ms ease,height 200ms ease}+@media(prefers-reduced-motion:reduce){.board-segments-ready>.board-segment-thumb{transition:none}}.reviewitem,.followtask{border-color:var(--line);border-radius:16px}:root[data-theme="dark"]{--page:#111;--ground:#1c1c1c;--surface:#232323;--sunk:#171717;--ink:#fafafa;--ink-2:#d4d4d4;--muted:#a3a3a3;--line:#383838;--line-soft:#303030;--inset:#303030;--picked:#303030;--hover:rgba(255,255,255,.07);--tungsten:#60a5fa}body::before{display:none}@@ -188,7 +194,7 @@ body::before{display:none}#applyUISetting{padding:8px 12px;border:1px solid var(--line);border-radius:8px;cursor:pointer}#applyUISetting[hidden]{display:none}-@media(max-width:1000px){.cleanupgrid>#libraryProcessing{display:flex}.cleanupgrid>#libraryProcessing>.geist-fieldset-footer{padding:12px 20px;border-top:1px solid var(--line-soft)}.settingscard{width:calc(100vw - 32px)}}+@media(max-width:1000px){.cleanupgrid>#libraryProcessing{display:grid;grid-template-columns:minmax(0,1fr);align-items:stretch;text-align:left}.cleanupgrid>#libraryProcessing>.geist-fieldset-content{width:100%;box-sizing:border-box}.cleanupgrid>#libraryProcessing>.geist-fieldset-footer{padding:0 24px 24px;border:0;justify-content:flex-start;min-width:0}.settingscard{width:calc(100vw - 32px)}}@media(max-width:760px){:root,body.drawer-open{--railW:0px}.drawer{top:64px;bottom:12px;width:min(320px,calc(100vw - 24px));border-radius:20px;z-index:97}@@ -452,6 +458,7 @@ button,input,select,textarea{font-family:inherit}/* Board 的语义色与复合字阶;图表和业务状态独立于交互强调色。 */:root,:root[data-theme="light"]{--color-text-primary:#0a0a0a;--color-text-secondary:#737373;--color-text-tertiary:#a3a3a3;--color-background-full:#fff;--color-background-primary-default:#fff;--color-background-primary-hover:#f5f5f5;--color-background-secondary-default:#f5f5f5;--color-background-tertiary-default:#e5e5e5;--color-border-button-default:#e5e5e5;--color-border-button-hover:#d4d4d4;--color-separator-border:#e5e5e5;--color-border-focus-ring:#3b82f6;--color-text-white:#fff;--color-text-disabled:#d4d4d4;--board-blue:linear-gradient(180deg,#3b82f6,#155dfc);--board-blue-hover:linear-gradient(180deg,#60a5fa,#2563eb)}:root[data-theme="dark"]{--color-text-primary:#fafafa;--color-text-secondary:#737373;--color-text-tertiary:#525252;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-separator-border:#262626;--color-text-disabled:#262626}+@media(prefers-color-scheme:dark){:root:not([data-theme]){--color-text-primary:#fafafa;--color-text-secondary:#a3a3a3;--color-text-tertiary:#737373;--color-background-full:#121212;--color-background-primary-default:#262626;--color-background-primary-hover:#40404099;--color-background-secondary-default:#171717;--color-background-tertiary-default:#262626;--color-border-button-default:#404040;--color-border-button-hover:#737373;--color-separator-border:#262626;--color-text-disabled:#525252}}:root{--page:var(--color-background-full);--ground:var(--color-background-secondary-default);--surface:var(--color-background-primary-default);--sunk:var(--color-background-secondary-default);--ink:var(--color-text-primary);--ink-2:var(--color-text-secondary);--muted:var(--color-text-secondary);--line:var(--color-border-button-default);--line-soft:var(--color-separator-border);--picked:var(--color-background-tertiary-default);--inset:var(--color-background-tertiary-default);--hover:var(--color-background-primary-hover);--tungsten:var(--color-border-focus-ring);--chart-0:#2dd4bf;--chart-1:#a3e635;--chart-2:#f472b6;--chart-3:#38bdf8;--board-font:'Inter Variable','Inter','Segoe UI','Microsoft YaHei UI','PingFang SC',sans-serif;--board-body:400 14px/20px var(--board-font);--board-body-medium:500 14px/20px var(--board-font);--board-compact:400 13px/18px var(--board-font);--board-caption:400 12px/16px var(--board-font);--board-heading:500 20px/26px var(--board-font);--board-title:500 32px/44px var(--board-font);--board-figure:500 24px/34px var(--board-font)}:root[data-theme]{--page:var(--color-background-full);--ground:var(--color-background-secondary-default);--surface:var(--color-background-primary-default);--sunk:var(--color-background-secondary-default);--ink:var(--color-text-primary);--ink-2:var(--color-text-secondary);--muted:var(--color-text-secondary);--line:var(--color-border-button-default);--line-soft:var(--color-separator-border);--picked:var(--color-background-tertiary-default);--inset:var(--color-background-tertiary-default);--hover:var(--color-background-primary-hover);--tungsten:var(--color-border-focus-ring)}body,.disp{font-family:var(--board-font);letter-spacing:0}body{font:var(--board-body)}button,input,textarea,select{font-family:var(--board-font)}@@ -475,7 +482,7 @@ body :is(.geist-button,.fbtn,.resourceaction,.fcredactions button,.fpickactionsbody :is(.geist-button,.fbtn,.resourceaction,.tagselection button).primary:not(:disabled){background:var(--board-blue);border:1px solid transparent;color:#fff;box-shadow:0 1px 2px #0000000d;transition:filter .15s ease}body :is(.geist-button,.fbtn,.resourceaction,.tagselection button).primary:hover:not(:disabled){background:var(--board-blue);color:#fff;filter:brightness(1.08)}body button.danger:not(.frowicon):not(:disabled){background:linear-gradient(180deg,#ff3347,#e60012);border:1px solid transparent;color:#fff;box-shadow:0 1px 2px #0000000d;transition:filter .15s ease}-body button.danger:not(.frowicon):hover:not(:disabled){filter:brightness(.95)}+body button.danger:not(.frowicon):hover:not(:disabled){background:linear-gradient(180deg,#ff6471,#ff3347);filter:none;color:#fff}.followmanage .fbtn.fmanagedir{width:36px;padding:0}.followmanage .faliasform :is(input,.fbtn){height:36px;min-height:36px}.followmanage .frowicon{width:32px;height:32px;border:1px solid var(--line);border-radius:8px;background:var(--surface);box-shadow:0 1px 2px #0000000d}:root{--board-card-foot:color-mix(in srgb,var(--ground) 98%,var(--ink))}.board-sidebar-head #brandHome .mark{color:var(--glass-text)}@@ -540,19 +547,61 @@ body :is(.sbadge.ok,.board-chip.success){background:color-mix(in srgb,#84cc16 16@media(prefers-reduced-motion:reduce){.board-tooltip,.board-carousel-pagination .swiper-pagination-bullet{transition:none}}:root{--board-chart-0:#94e000;--board-chart-1:#3493ff;--board-chart-2:#bc74f9;--board-chart-3:#f657bd;--board-chart-4:#ffc600;--board-chart-5:#2dcbb8}.fauthorhead{list-style:none}.fauthorhead::-webkit-details-marker{display:none}.board-author-actions{display:flex;align-items:center;gap:8px;margin-left:auto;flex:none}.board-author-actions .board-author-toggle{margin:0}.followmanage details.fauthor>.fcollapse>.fcollapsebody{padding:0}.followmanage details.fauthor:not([open]) .fauthorhead{margin-bottom:0}-.followmanage .fsource.selected{background:color-mix(in srgb,#3986ff 9%,var(--color-background-primary-default));box-shadow:inset 3px 0 #3986ff}.followmanage .fsource.selected.disabled{opacity:1}+.followmanage .fsource.selected{background:var(--color-background-primary-default);box-shadow:none;border-color:var(--color-border-focus-ring)}.followmanage .fsource.selected.disabled{opacity:1}+.followmanage .fsource:has([data-follow-select]){border:1px solid var(--color-border-button-default);border-radius:10px;padding:12px 20px 12px 16px;margin:8px 0;cursor:pointer;transition:background-color 150ms ease,border-color 150ms ease}+.followmanage .fsource:has([data-follow-select]):hover{background:var(--color-background-primary-hover)}+.followmanage .fsec:has(.board-follow-selection){padding:20px;border-radius:20px;background:var(--color-background-secondary-default);overflow:visible}+.followmanage .fsourceactions{padding:2px;overflow:visible}+body .sbadge.paused{background:color-mix(in srgb,#ffc600 18%,var(--color-background-primary-default));color:#a87600}+:root[data-theme=dark] .sbadge.paused{color:#ffd54a}+.cleanupgrid>.board-processing-skeleton{grid-column:1/-1;display:grid;grid-template-columns:1fr auto;align-items:center;min-height:140px}+.board-processing-skeleton>.geist-fieldset-footer{border:0;background:none}+@media(max-width:1000px){.cleanupgrid>.board-processing-skeleton{grid-template-columns:1fr}.board-processing-skeleton>.geist-fieldset-footer{justify-content:flex-start}}.metricstrip>button[aria-selected=true]{background:var(--color-background-primary-default);box-shadow:none}.metricstrip>button[aria-selected=true]::after{box-sizing:border-box}.metricstrip>button[aria-selected=true] .board-stat-footer{background:var(--board-card-foot)}body .gselectmenu [role=option][aria-selected=true],body .popmenu [aria-checked=true]{background:color-mix(in srgb,var(--color-text-primary) 10%,var(--color-background-primary-default));color:var(--color-text-primary)}.insightswitch{display:inline-flex;align-items:center;gap:2px;padding:3px;border:1px solid var(--line);border-radius:10px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}.insightswitch label>span{display:flex;align-items:center;min-height:28px;padding:4px 10px;border-radius:7px;color:var(--color-text-secondary);font:var(--board-body-medium)}.insightswitch label:has(input:checked)>span{background:var(--color-background-primary-hover);color:var(--color-text-primary);box-shadow:0 1px 2px #0000001a}.board-inventory-charts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;width:100%;grid-column:1/-1}.board-radial-card{min-width:0;padding:20px;border-radius:20px;background:var(--color-background-primary-default);overflow:hidden}.board-radial-card>header{display:grid;grid-template-columns:1fr auto;gap:4px;color:var(--color-text-secondary)}.board-radial-card>header>b{grid-row:2;font:var(--board-title);color:var(--color-text-primary);font-variant-numeric:tabular-nums}.board-radial-card>header>small{align-self:end;grid-column:2;grid-row:2;font:var(--board-caption)}.board-rings{display:block;width:100%;height:300px;overflow:visible}.board-rings circle{fill:none;stroke-linecap:round}.board-ring-track{stroke:var(--color-background-secondary-default)}.board-ring-value{stroke:var(--ring-color);cursor:pointer;transition:filter .18s,opacity .18s,stroke-width .18s;animation:board-ring-enter .9s cubic-bezier(.16,1,.3,1) var(--ring-delay) backwards;outline:none}.board-ring-value[data-active=true]{filter:brightness(.88);stroke-width:18}.board-ring-value:focus-visible{filter:drop-shadow(0 0 2px var(--color-border-focus-ring))}.board-radial-card:not([data-radial-focus="-1"]) .board-ring-value:not([data-active=true]){opacity:.4}-@keyframes board-ring-enter{from{stroke-dasharray:0 100;opacity:0}to{stroke-dasharray:var(--ring-length) calc(100 - var(--ring-length));opacity:1}}+@keyframes board-ring-enter{from{stroke-dasharray:0px 100px;opacity:0}to{stroke-dasharray:calc(var(--ring-length) * 1px) calc((100 - var(--ring-length)) * 1px);opacity:1}}+.board-radial-card:not(.board-chart-visible) .board-ring-value{animation:none;stroke-dasharray:0 100;opacity:0}+.board-radial-card.board-chart-visible .board-ring-value{animation-duration:1.2s;animation-timing-function:cubic-bezier(.22,.61,.36,1)}.board-radial-tiles{display:flex;flex-wrap:wrap;gap:8px;padding:8px;border-radius:16px;background:var(--color-background-secondary-default)}.board-radial-tiles>button{display:flex;flex:1 1 calc(33.333% - 8px);min-width:0;flex-direction:column;align-items:flex-start;gap:4px;padding:10px;border:0;border-radius:12px;background:var(--color-background-primary-default);text-align:left;color:var(--color-text-primary);font:var(--board-body);transition:background .18s,box-shadow .18s}.board-radial-tiles>button>span{display:flex;align-items:center;gap:6px;min-width:0;color:var(--color-text-secondary);overflow-wrap:anywhere}.board-radial-tiles i{width:12px;height:12px;flex:none;border-radius:4px;background:var(--ring-color)}.board-radial-tiles b{font:var(--board-heading);font-variant-numeric:tabular-nums}.board-radial-tiles small{font:var(--board-caption);color:var(--color-text-secondary)}.board-radial-tiles>button:is([data-active=true],[aria-pressed=true]){background:color-mix(in srgb,var(--ring-color) 10%,var(--color-background-primary-default));box-shadow:inset 0 0 0 1px var(--ring-color)}.board-activity-charts{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:20px;margin:20px 0}.board-heat-card,.board-activity-empty{min-width:0;padding:20px;border-radius:20px;background:var(--color-background-secondary-default)}.board-heat-card header{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:24px}.board-heat-card h3{margin:0;font:var(--board-heading)}.board-heat-card header b{grid-row:2;font:var(--board-title);font-variant-numeric:tabular-nums}.board-heat-card header span{grid-column:2;grid-row:2;align-self:end;color:var(--muted);font:var(--board-caption)}.board-heat-scroll{overflow-x:auto;padding:3px}.board-hour-grid{display:grid;grid-template-columns:32px repeat(24,minmax(10px,1fr));gap:4px;min-width:360px}.board-heat-axis{font:var(--board-caption);color:var(--muted);align-self:center}.board-day-grid{display:grid;grid-auto-flow:column;grid-template-rows:repeat(7,1fr);grid-template-columns:repeat(13,1fr);gap:5px;padding:3px}.board-heat-card [data-heat-value]{display:block;aspect-ratio:1;min-width:0;padding:0;border:0;border-radius:3px;background:color-mix(in srgb,#3493ff var(--heat),var(--color-background-tertiary-default));animation:board-heat-enter .4s ease-out both}.board-heat-card [data-heat-value]:is(:hover,:focus-visible){outline:2px solid var(--color-border-focus-ring);outline-offset:1px;filter:brightness(.9)}.board-heat-card footer{display:flex;justify-content:space-between;gap:8px;margin-top:16px;font:var(--board-caption);color:var(--muted)}@keyframes board-heat-enter{from{opacity:0;transform:scale(.8)}to{opacity:1;transform:none}}@media(max-width:1000px){.board-inventory-charts,.board-activity-charts{grid-template-columns:1fr}.board-rings{height:260px}}@media(max-width:600px){.board-author-actions{width:100%;justify-content:flex-end}.followmanage .fauthorhead{flex-wrap:wrap}.board-radial-card,.board-heat-card{padding:16px}.board-radial-tiles>button{flex-basis:calc(50% - 8px)}}@media(prefers-reduced-motion:reduce){.board-ring-value,.board-heat-card [data-heat-value]{animation:none;transition:none}.board-radial-tiles>button{transition:none}}+.board-state-preview{max-width:1180px;margin:0 auto;padding:28px 20px;color:var(--ink)}+.drawer .board-sidebar-head{margin-bottom:0!important}.drawer .dnav{margin-top:4px;gap:4px}.drawer #brandHome{height:36px;min-height:36px;box-sizing:border-box}.drawer .dnav button{height:36px;min-height:36px}+[data-board-tabs]{position:relative!important}[data-board-tabs]::before{content:'';position:absolute;bottom:0;left:0;width:var(--tab-width,0px);height:2px;background:var(--tungsten);transform:translateX(var(--tab-x,0px));pointer-events:none;z-index:1}[data-board-tabs].board-tabs-ready::before{transition:transform 200ms ease,width 200ms ease}+body [data-board-tabs] button[aria-selected=true],body .managebar [data-board-tabs] button[aria-pressed=true]{border-bottom-color:transparent}+@media(prefers-reduced-motion:reduce){[data-board-tabs].board-tabs-ready::before{transition:none}}+.followmanage .fsource:has([data-follow-select]){background:var(--color-background-primary-default)}+.followmanage .fsource.selected:has([data-follow-select]){border-color:var(--color-border-focus-ring)}+.board-icon-trigger{width:100%;justify-content:flex-start!important;min-height:var(--control-h);height:var(--control-h)!important}.board-icon-trigger svg{width:20px;height:20px}+.splitbutton.board-button-group>.splitmain,.splitbutton.board-button-group>.splittoggle{border:0;border-radius:0;box-shadow:none}+.splitbutton.board-button-group>.splittoggle::before{width:1px;left:0;top:6px;bottom:6px;background:var(--color-border-button-default)}+body [data-cleanup-empty][hidden]{display:none}+dialog.board-icon-popover{position:fixed;inset:auto;margin:0;width:min(360px,calc(100vw - 16px));max-height:calc(100dvh - 16px);box-sizing:border-box;padding:8px;border:0;border-radius:24px;background:var(--color-background-secondary-default);color:var(--ink);box-shadow:0 12px 40px #00000024;overflow:auto}+.board-icon-popover::backdrop{background:transparent}.board-icon-panel{padding:16px;border-radius:20px;background:var(--color-background-primary-default);box-shadow:0 1px 2px #0000000d}.board-icon-panel h3{font:var(--board-body-medium);margin:0 0 16px}.board-icon-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px}.board-icon-grid label{position:relative;display:grid;justify-items:center;gap:4px;padding:8px 2px;border-radius:8px;cursor:pointer}.board-icon-grid label:hover{background:var(--color-background-primary-hover)}.board-icon-grid label.selected{background:var(--picked);color:var(--tungsten)}.board-icon-grid input{position:absolute;opacity:0;width:1px;height:1px}.board-icon-grid label:focus-within{outline:2px solid var(--tungsten)}.board-icon-grid svg{width:24px;height:24px}.board-icon-grid small{font-size:10px;white-space:nowrap}.board-icon-popover footer{display:flex;justify-content:flex-end;gap:8px;padding:12px 8px 4px}+.reviewitem .reviewstage[data-framed]{padding:0;border:0;background:transparent;box-shadow:none}.reviewitem .reviewtags{min-height:28px;align-content:start}.reviewitem .reviewempty{min-height:160px;max-height:190px;border-radius:12px;background:var(--color-background-secondary-default)}.reviewitem .reviewstage{flex:0 0 auto}.reviewitem .reviewevidence{border:0;padding:12px 0 0}.reviewitem .reviewactions{border:0;border-radius:0 0 16px 16px;background:var(--color-background-secondary-default);margin-top:auto}+.reviewitem{content-visibility:auto;contain-intrinsic-size:auto var(--review-fieldset-height)}+body .reviewactions button,body .junkactions button:not(.danger){height:36px;border:1px solid var(--color-border-button-default);border-radius:10px;padding:8px 12px;background:var(--color-background-primary-default);color:var(--ink);box-shadow:0 1px 2px #0000000d;font:var(--board-body-medium)}+body .reviewactions button.warning,body [data-follow-bulk],body [data-follow-status=seen],body [data-follow-status=ignored]{background:color-mix(in srgb,#3986ff 16%,var(--color-background-primary-default));color:#1760ef;border-color:transparent}+.reviewcontrols,.reviewgroupbar{margin-inline:0;border:0;border-radius:20px}.reviewcontrols.is-stuck,.reviewgroupbar.is-stuck,.batchbar,.tagselection{background:linear-gradient(125deg,var(--glass-sheen),transparent 42%,var(--glass-low)),var(--glass-fill);backdrop-filter:var(--glass-optic,blur(22px)) saturate(145%);border:0;box-shadow:inset 0 1px 0 var(--glass-rim),var(--glass-shadow);border-radius:20px}+.reviewtabs{overflow-x:auto!important;overflow-y:hidden;scrollbar-width:none!important;touch-action:pan-x pan-y;overscroll-behavior-x:contain}.reviewtabs::-webkit-scrollbar{display:none!important}.reviewtabs .os-scrollbar{display:none!important}+.settingsscroll .settingrow{margin-right:16px}.settingsscroll .settinggroup{border-bottom:0}+.iconswitch.themeswitch[data-board-segments]{padding:4px;border:0;border-radius:24px;background:var(--picked);gap:4px}.iconswitch.themeswitch[data-board-segments]>label{width:32px;height:32px;border-radius:50%}.themeswitch .board-segment-thumb{border-radius:50%;background:var(--ground)}+.configsource{align-items:start}.configsource input.geist-input,.configsource .gselectfield{height:var(--control-h);min-height:var(--control-h);box-sizing:border-box}.configpage .configcheck{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 20px 12px 16px;border:1px solid var(--color-border-button-default);border-radius:10px;background:var(--color-background-primary-default);cursor:pointer}.configpage .configcheck>.pcheck{order:2}.configpage .configcheck:hover{background:var(--color-background-primary-hover)}+body .reviewactions button.primary:not(:disabled){background:var(--board-blue);color:#fff;border-color:transparent}body .reviewactions button.error:not(:disabled){background:linear-gradient(180deg,#ff3347,#e60012);color:#fff;border-color:transparent}body .reviewactions button.error:hover:not(:disabled){background:linear-gradient(180deg,#ff6471,#ff3347)}+.card .pic>.badge{padding:4px;border-radius:10px;background:var(--glass-fill);box-shadow:inset 0 1px 0 var(--glass-rim),var(--glass-shadow);backdrop-filter:blur(16px) saturate(145%)}.card .pic>.badge .src{background:transparent;padding:0;width:20px;height:20px}+body .selectiondock{border:0;border-radius:22px;background:linear-gradient(125deg,var(--glass-sheen),transparent 42%,var(--glass-low)),var(--glass-fill);backdrop-filter:var(--glass-optic,blur(22px)) saturate(145%);box-shadow:inset 0 1px 0 var(--glass-rim),inset 1px 0 0 var(--glass-low),inset -1px 0 0 var(--glass-low),inset 0 -1px 0 var(--glass-low),var(--glass-shadow)}+html.board-high-contrast :is(.selectiondock,.reviewcontrols.is-stuck,.reviewgroupbar.is-stuck,.batchbar,.tagselection,.card .badge){background:var(--ground);backdrop-filter:none;-webkit-backdrop-filter:none}+@media(prefers-reduced-transparency:reduce){body :is(.selectiondock,.reviewcontrols.is-stuck,.reviewgroupbar.is-stuck,.batchbar,.tagselection,.card .badge){background:var(--ground);backdrop-filter:none}}+.board-state-preview>header{display:flex;align-items:center;justify-content:space-between;gap:16px}.board-state-preview h1{font-size:28px}.board-state-preview h2{font-size:18px;margin:20px 0 12px}.board-state-preview h3{font-size:15px}.board-state-preview p{color:var(--muted);line-height:1.6}+.board-state-preview>nav{display:flex;flex-wrap:wrap;gap:8px;margin:20px 0}.board-state-preview>nav [aria-pressed=true]{outline:2px solid var(--tungsten);outline-offset:1px}+.board-preview-tools{display:flex;align-items:center;gap:20px;flex-wrap:wrap}.board-preview-tools label{display:flex;align-items:center;gap:12px}.board-preview-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}.board-preview-grid article{padding:20px;border-radius:16px;background:var(--ground);min-width:0}.board-state-preview .cleanupgrid{padding-bottom:0}+@media(max-width:600px){.board-preview-grid{grid-template-columns:1fr}.board-state-preview>header{align-items:flex-start}.board-state-preview{padding:16px}}.board-expand-ranks{position:relative;padding-bottom:36px}.board-rank-list{position:relative;display:grid;grid-template-columns:1fr;max-height:var(--rank-collapsed-height,300px);overflow:hidden;transition:max-height .24s ease}.board-expand-ranks:not(.expanded)::after{content:'';position:absolute;bottom:30px;left:0;right:0;height:48px;background:linear-gradient(transparent,var(--color-background-primary-default));pointer-events:none}.board-expand-ranks.expanded>.board-rank-list{max-height:var(--rank-expanded-height)}.board-rank-expand{position:absolute;z-index:1;bottom:4px;left:50%;transform:translateX(-50%);display:grid;place-items:center;width:40px;height:24px;padding:0;border:1px solid var(--line);border-radius:999px;background:var(--surface);box-shadow:0 1px 3px #0000001a;color:var(--muted)}.board-rank-expand svg{width:16px;height:16px;transition:transform .2s}.board-rank-expand[aria-expanded=true] svg{transform:rotate(180deg)}.board-rank-list .tasterank{position:relative;isolation:isolate;border:0;border-radius:10px;background:transparent;overflow:hidden;min-height:44px}.board-rank-list .taste-rank-track{position:absolute;inset:0;height:100%;margin:0;z-index:-1;background:none;opacity:.16}.board-rank-list .taste-rank-track i{height:100%;border-radius:10px}.board-rank-list .tasterank:hover{background:var(--color-background-primary-hover)}.board-sankey-card{padding:20px;border-radius:20px;margin-bottom:20px;background:var(--color-background-secondary-default);min-width:0}.board-sankey-card header{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:20px}.board-sankey-card h3{margin:0;font:var(--board-heading)}.board-sankey-card header b{grid-row:2;font:var(--board-title);font-variant-numeric:tabular-nums}.board-sankey-card header span{grid-column:2;grid-row:2;color:var(--muted);align-self:end;font:var(--board-caption)}.board-sankey-scroll{overflow-x:auto}.board-sankey-scroll svg{display:block;width:100%;min-width:640px;max-height:520px}.board-sankey-links path{fill:none;stroke:var(--flow-color);opacity:.3;transition:opacity .2s;animation:board-heat-enter .6s ease-out}.board-sankey-nodes g{transition:opacity .2s}.board-sankey-nodes text{fill:var(--color-text-primary);font:var(--board-caption)}.board-sankey-nodes tspan{fill:var(--muted);font-size:11px}.board-sankey-card footer{display:flex;justify-content:space-between;color:var(--muted);font:var(--board-caption);margin-top:12px}diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.jsindex aeacacbef..1f0c7ed72 100644--- a/web/dist/peach-ui.js+++ b/web/dist/peach-ui.js@@ -1,21 +1,21 @@import { LOC as e, esc as t, faviconUrl as n, fmtDur as r, fmtSize as i, icon as a, requestErrorMessage as o } from "/js/core.js";import { MEDIA_SOURCE_ICONS as s, checkboxHtml as c, confirmModal as l, emptyStateHtml as u, fieldsetTitle as d, loadingDotsHtml as f, noteHtml as p, progressHtml as m, projectBannerHtml as h, selectFieldHtml as g, selectOptionIconHtml as _, setActionBusy as v, wireCollapse as y, wireSelectField as b } from "/js/ui-components.js";//#region node_modules/preact/dist/preact.module.js-var x, S, C, w, T, E, D, O, k, A, j, ee, M, N, P, te = {}, ne = [], re = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, ie = Array.isArray;-function F(e, t) {+var x, S, C, w, T, E, D, O, k, A, j, ee, M, N, P, F = {}, te = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;+function I(e, t) {for (var n in t) e[n] = t[n];return e;}-function ae(e) {+function ie(e) {e && e.parentNode && e.parentNode.removeChild(e);}-function oe(e, t, n) {+function ae(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 ? x.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 se(e, o, r, i, null);+ return oe(e, o, r, i, null);}-function se(e, t, n, r, i) {+function oe(e, t, n, r, i) {var a = {type: e,props: t,@@ -33,21 +33,21 @@ function se(e, t, n, r, i) {};return i == null && S.vnode != null && S.vnode(a), a;}-function I(e) {+function L(e) {return e.children;}-function ce(e, t) {+function se(e, t) {this.props = e, this.context = t;}-function L(e, t) {- if (t == null) return e.__ ? L(e.__, e.__i + 1) : null;+function ce(e, t) {+ if (t == null) return e.__ ? ce(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" ? L(e) : null;+ return typeof e.type == "function" ? ce(e) : null;}function le(e) {if (e.__P && e.__d) {- var t = e.__v, n = t.__e, r = [], i = [], a = F({}, t);- a.__v = t.__v + 1, S.vnode && S.vnode(a), be(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? L(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Se(r, a, i), t.__e = t.__ = null, a.__e != n && ue(a);+ var t = e.__v, n = t.__e, r = [], i = [], a = I({}, t);+ a.__v = t.__v + 1, S.vnode && S.vnode(a), be(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? ce(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, Se(r, a, i), t.__e = t.__ = null, a.__e != n && ue(a);}}function ue(e) {@@ -66,14 +66,14 @@ function fe() {}}function pe(e, t, n, r, i, a, o, s, c, l, u) {- var d, f, p, m, h, g, _ = r && r.__k || ne, v = t.length;- for (c = me(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || te, p.__i = d, g = be(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Te(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = he(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);+ var d, f, p, m, h, g, _ = r && r.__k || te, v = t.length;+ for (c = me(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || F, p.__i = d, g = be(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && Te(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = he(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 me(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] = se(null, o, null, null, null) : ie(o) ? o = e.__k[a] = se(I, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = se(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 = ge(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 = L(s)), Ee(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] = oe(null, o, null, null, null) : re(o) ? o = e.__k[a] = oe(L, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = oe(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 = ge(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 = ce(s)), Ee(s, s));return r;}function he(e, t, n) {@@ -82,7 +82,7 @@ function he(e, t, n) {for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = he(r[i], t, n));return t;}- e.__e != t && (t && e.type && !t.parentNode && (t = L(e)), t = n.insertBefore(e.__e, t || null));+ e.__e != t && (t && e.type && !t.parentNode && (t = ce(e)), t = n.insertBefore(e.__e, t || null));dot &&= t.nextSibling;while (t != null && t.nodeType == 8);@@ -97,7 +97,7 @@ function ge(e, t, n, r) {return -1;}function _e(e, t, n) {- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || re.test(t) ? n : n + "px";+ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";}function ve(e, t, n, r, i) {var a, o;@@ -134,29 +134,29 @@ function be(e, t, n, r, i, a, o, s, c, l) {n: if (typeof D == "function") {d = o.length;try {- if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], x = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, x) : (t.__c = f = new ce(v, x), f.constructor = D, f.render = De), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = F({}, f.__s)), F(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);+ if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], x = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, x) : (t.__c = f = new se(v, x), f.constructor = D, f.render = De), b && b.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), y && f.__s == null && (f.__s = f.state), y && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = I({}, f.__s)), I(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) y && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), y && f.componentDidMount != null && f.__h.push(f.componentDidMount);else {if (y && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, x), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, x)) {t.__v != n.__v && (f.props = v, f.state = f.__s, f.__d = !1), t.__e = n.__e, t.__k = n.__k, t.__k.some(function(e) {e && (e.__ = t);- }), ne.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = L(n);+ }), te.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = ce(n);break n;}f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, x), y && f.componentDidUpdate != null && f.__h.push(function() {f.componentDidUpdate(m, h, g);});}- if (f.context = x, f.props = v, f.__P = e, f.__e = !1, C = S.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), ne.push.apply(f.__h, f._sb), f._sb = [];+ if (f.context = x, f.props = v, f.__P = e, f.__e = !1, C = S.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), te.push.apply(f.__h, f._sb), f._sb = [];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 = F(F({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === I && u.key == null ? Ce(u.props.children) : u, s = pe(e, ie(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), _ && (f.__E = f.__ = null);+ f.state = f.__s, f.getChildContext != null && (r = I(I({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === L && u.key == null ? Ce(u.props.children) : u, s = pe(e, re(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), _ && (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--;) ae(a[E]);+ } else if (a != null) for (E = a.length; E--;) ie(a[E]);} else t.__e = n.__e;t.__k ??= n.__k || [], e.then || xe(t), S.__e(e, t, n);}@@ -179,10 +179,10 @@ function Se(e, t, n) {});}function Ce(e) {- return typeof e != "object" || !e || e.__b > 0 ? e : ie(e) ? e.map(Ce) : e.constructor === void 0 ? F({}, e) : null;+ return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Ce) : e.constructor === void 0 ? I({}, e) : null;}function we(e, t, n, r, i, a, o, s, c) {- var l, u, d, f, p, m, h, g = n.props || te, _ = t.props, v = t.type;+ var l, u, d, f, p, m, h, g = n.props || F, _ = t.props, v = t.type;if (v == "svg" ? i = "http://www.w3.org/2000/svg" : v == "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 ((p = a[l]) && "setAttribute" in p == !!v && (v ? p.localName == v : p.nodeType == 3)) {e = p, a[l] = null;@@ -199,7 +199,7 @@ function we(e, t, n, r, i, a, o, s, c) {for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || ve(e, l, null, p, i);for (l in _) p = _[l], l == "children" ? f = p : l == "dangerouslySetInnerHTML" ? u = p : l == "value" ? m = p : l == "checked" ? h = p : s && typeof p != "function" || g[l] === p || ve(e, l, p, g[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 = ""), pe(t.type == "template" ? e.content : e, ie(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && L(n, 0), s, c), a != null) for (l = a.length; l--;) ae(a[l]);+ else if (d && (e.innerHTML = ""), pe(t.type == "template" ? e.content : e, re(f) ? f : [f], t, n, r, v == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && ce(n, 0), s, c), a != null) for (l = a.length; l--;) ie(a[l]);s && v != "textarea" || (l = "value", v == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || v == "progress" && !m || v == "option" && m != g[l]) && ve(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && ve(e, l, h, g[l], i));}return e;@@ -225,16 +225,16 @@ function Ee(e, t, n) {r.base = r.__P = r.__n = null;}if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Ee(r[i], t, n || typeof e.type != "function");- n || ae(e.__e), e.__c = e.__ = e.__e = void 0;+ n || ie(e.__e), e.__c = e.__ = e.__e = void 0;}function De(e, t, n) {return this.constructor(e, n);}function Oe(e, t, n) {var r, i, a, o;- t == document && (t = document.documentElement), S.__ && S.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], be(t, e = (!r && n || t).__k = oe(I, null, [e]), i || te, te, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? x.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Se(a, e, o), e.props.children = null;+ t == document && (t = document.documentElement), S.__ && S.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], be(t, e = (!r && n || t).__k = ae(L, null, [e]), i || F, F, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? x.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), Se(a, e, o), e.props.children = null;}-x = ne.slice, S = { __e: function(e, t, n, r) {+x = te.slice, S = { __e: function(e, t, n, r) {for (var i, a, o; t = t.__;) if ((i = t.__c) && !i.__) try {if ((a = i.constructor) && a.getDerivedStateFromError != null && (i.setState(a.getDerivedStateFromError(e)), o = i.__d), i.componentDidCatch != null && (i.componentDidCatch(e, r || {}), o = i.__d), o) return i.__E = i;} catch (t) {@@ -243,12 +243,12 @@ x = ne.slice, S = { __e: function(e, t, n, r) {throw e;} }, C = 0, w = function(e) {return e != null && e.constructor === void 0;-}, ce.prototype.setState = function(e, t) {- var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = F({}, this.state);- typeof e == "function" && (e = e(F({}, n), this.props)), e && F(n, e), e != null && this.__v && (t && this._sb.push(t), de(this));-}, ce.prototype.forceUpdate = function(e) {+}, se.prototype.setState = function(e, t) {+ var n = this.__s != null && this.__s != this.state ? this.__s : this.__s = I({}, this.state);+ typeof e == "function" && (e = e(I({}, n), this.props)), e && I(n, e), e != null && this.__v && (t && this._sb.push(t), de(this));+}, se.prototype.forceUpdate = function(e) {this.__v && (this.__e = !0, e && this.__h.push(e), de(this));-}, ce.prototype.render = I, T = [], D = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(e, t) {+}, se.prototype.render = L, T = [], D = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, O = function(e, t) {return e.__v.__b - t.__v.__b;}, fe.__r = 0, k = Math.random().toString(8), A = "__d" + k, j = "__a" + k, ee = /(PointerCapture)$|Capture$/i, M = 0, N = ye(!1), P = ye(!0);//#endregion@@ -361,46 +361,636 @@ var R = (e) => String(e ?? "").replace(/[&<>"']/g, (e) => ({function Pe(e, t, n, r = "chart-no-axes-combined") {return `<span class="board-stat-label"><span class="board-stat-icon" aria-hidden="true"><svg viewBox="0 0 24 24"><use href="#i-${/^[a-z0-9-]+$/.test(r) ? r : "database"}"/></svg></span>${R(e)}</span><b class="board-stat-value">${R(t)}</b><small class="board-stat-footer">${R(n || "当前记录")}</small>`;}-function Fe(e, t, n) {- if (!Number.isFinite(n) || n <= 0) return "";- let r = Math.max(0, Math.min(n, Number.isFinite(t) ? t : 0)), i = r / n * 100;- return `<div class="board-job-progress" role="progressbar" aria-label="${R(e)}" aria-valuemin="0" aria-valuemax="${n}" aria-valuenow="${r}"><svg width="36" height="36" viewBox="0 0 36 36" aria-hidden="true"><circle class="board-job-track" cx="18" cy="18" r="15"/><circle class="board-job-fill" cx="18" cy="18" r="15" pathLength="100" stroke-dasharray="${i} ${100 - i}" transform="rotate(-90 18 18)"/></svg><span>${R(e)}<small>${Math.round(i)}%</small></span></div>`;+function Fe(e, t, n) {+ if (!Number.isFinite(n) || n <= 0) return "";+ let r = Math.max(0, Math.min(n, Number.isFinite(t) ? t : 0)), i = r / n * 100;+ return `<div class="board-job-progress" role="progressbar" aria-label="${R(e)}" aria-valuemin="0" aria-valuemax="${n}" aria-valuenow="${r}"><svg width="36" height="36" viewBox="0 0 36 36" aria-hidden="true"><circle class="board-job-track" cx="18" cy="18" r="15"/><circle class="board-job-fill" cx="18" cy="18" r="15" pathLength="100" stroke-dasharray="${i} ${100 - i}" transform="rotate(-90 18 18)"/></svg><span>${R(e)}<small>${Math.round(i)}%</small></span></div>`;+}+function Ie(e, t) {+ let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0), r = n.reduce((e, t) => e + t.score, 0);+ if (!r) return "";+ let i = 0, a = n.map((e, t) => {+ let n = e.score / r * 100, a = `<circle cx="100" cy="100" r="72" pathLength="100" fill="none" stroke="var(--chart-${t % 4})" stroke-width="22" stroke-dasharray="${n} ${100 - n}" stroke-dashoffset="${-i}"><title>${R(e.name)}:${e.score.toLocaleString()}</title></circle>`;+ return i += n, a;+ }).join("");+ return `<svg class="board-distribution" viewBox="0 0 200 200" role="img" aria-label="${R(t)}"><g transform="rotate(-90 100 100)">${a}</g><text x="100" y="100" text-anchor="middle" dominant-baseline="middle">${R(t)}</text></svg>`;+}+function Le(e, t) {+ let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 8);+ if (!n.length) return "";+ let r = n[0].score, i = n.map((e) => `<li><span class="board-rank-fill" style="width:${(e.score / r * 100).toFixed(2)}%"></span><span>${R(e.name)}</span><b>${e.score.toLocaleString()}</b></li>`).join("");+ return `<ol class="board-ranked-chart" aria-label="${R(t)}">${i}</ol>`;+}+function Re(e, t) {+ let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 6);+ if (n.length < 3) return "";+ let r = Math.max(...n.map((e) => e.score)), i = n.length, a = (e, t) => {+ let n = e / i * Math.PI * 2 - Math.PI / 2;+ return [160 + Math.cos(n) * t, 140 + Math.sin(n) * t];+ }, o = (e) => n.map((t, n) => a(n, e(n)).map((e) => e.toFixed(2)).join(",")).join(" "), s = [+ 25,+ 50,+ 75,+ 100+ ].map((e) => `<polygon points="${o(() => e)}" class="board-radar-grid"/>`).join(""), c = n.map((e, t) => {+ let [n, r] = a(t, 116);+ return `<text x="${n}" y="${r}" text-anchor="${n < 145 ? "end" : n > 175 ? "start" : "middle"}">${R(e.name)}</text>`;+ }).join("");+ return `<svg class="board-radar" viewBox="0 0 320 280" role="img" aria-label="${R(t)}"><title>${R(n.map((e) => `${e.name} ${e.score}`).join(","))}</title>${s}<polygon points="${o((e) => n[e].score / r * 100)}" class="board-radar-value"/>${c}</svg>`;+}+//#endregion+//#region node_modules/preact/hooks/dist/hooks.module.js+var ze, z, Be, Ve, He = 0, Ue = [], B = S, We = B.__b, Ge = B.__r, Ke = B.diffed, qe = B.__c, Je = B.unmount, Ye = B.__;+function Xe(e, t) {+ B.__h && B.__h(z, e, He || t), He = 0;+ var n = z.__H || (z.__H = {+ __: [],+ __h: []+ });+ return e >= n.__.length && n.__.push({}), n.__[e];+}+function V(e) {+ return He = 1, Ze(at, e);+}+function Ze(e, t, n) {+ var r = Xe(ze++, 2);+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : at(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 = z, !z.__f)) {+ var i = function(e, t, n) {+ if (!r.__c.__H) return !0;+ var i = !1, o = r.__c.props !== e;+ if (r.__c.__H.__.some(function(e) {+ if (e.__N) {+ i = !0;+ var t = e.__[0];+ e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);+ }+ }), a) {+ var s = a.call(this, e, t, n);+ return i ? s || o : s;+ }+ return !i || o;+ };+ 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);+ }, z.shouldComponentUpdate = i;+ }+ return r.__N || r.__;+}+function H(e, t) {+ var n = Xe(ze++, 3);+ !B.__s && it(n.__H, t) && (n.__ = e, n.u = t, z.__H.__h.push(n));+}+function U(e, t) {+ var n = Xe(ze++, 4);+ !B.__s && it(n.__H, t) && (n.__ = e, n.u = t, z.__h.push(n));+}+function W(e) {+ return He = 5, Qe(function() {+ return { current: e };+ }, []);+}+function Qe(e, t) {+ var n = Xe(ze++, 7);+ return it(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;+}+function $e() {+ for (var e; e = Ue.shift();) {+ var t = e.__H;+ if (e.__P && t) try {+ t.__h.some(nt), t.__h.some(rt), t.__h = [];+ } catch (n) {+ t.__h = [], B.__e(n, e.__v);+ }+ }+}+B.__b = function(e) {+ z = null, We && We(e);+}, B.__ = function(e, t) {+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Ye && Ye(e, t);+}, B.__r = function(e) {+ Ge && Ge(e), ze = 0;+ var t = (z = e.__c).__H;+ t && (Be === z ? (t.__h = [], z.__h = [], t.__.some(function(e) {+ e.__N && (e.__ = e.__N), e.u = e.__N = void 0;+ })) : (t.__h.some(nt), t.__h.some(rt), t.__h = [], ze = 0)), Be = z;+}, B.diffed = function(e) {+ Ke && Ke(e);+ var t = e.__c;+ t && t.__H && (t.__H.__h.length && (Ue.push(t) !== 1 && Ve === B.requestAnimationFrame || ((Ve = B.requestAnimationFrame) || tt)($e)), t.__H.__.some(function(e) {+ e.u &&= (e.__H = e.u, void 0);+ })), Be = z = null;+}, B.__c = function(e, t) {+ t.some(function(e) {+ try {+ e.__h.some(nt), e.__h = e.__h.filter(function(e) {+ return !e.__ || rt(e);+ });+ } catch (n) {+ t.some(function(e) {+ e.__h &&= [];+ }), t = [], B.__e(n, e.__v);+ }+ }), qe && qe(e, t);+}, B.unmount = function(e) {+ Je && Je(e);+ var t, n = e.__c;+ n && n.__H && (n.__H.__.some(function(e) {+ try {+ nt(e);+ } catch (e) {+ t = e;+ }+ }), n.__H = void 0, t && B.__e(t, n.__v));+};+var et = typeof requestAnimationFrame == "function";+function tt(e) {+ var t, n = function() {+ clearTimeout(r), et && cancelAnimationFrame(t), setTimeout(e);+ }, r = setTimeout(n, 35);+ et && (t = requestAnimationFrame(n));+}+function nt(e) {+ var t = z, n = e.__c;+ typeof n == "function" && (e.__c = void 0, n()), z = t;+}+function rt(e) {+ var t = z;+ e.__c = e.__(), z = t;+}+function it(e, t) {+ return !e || e.length !== t.length || t.some(function(t, n) {+ return t !== e[n];+ });+}+function at(e, t) {+ return typeof t == "function" ? t(e) : t;+}+//#endregion+//#region src/api.ts+var ot = class extends Error {+ status;+ body;+ constructor(e, t, n = null) {+ super(o(e, t)), this.name = "ApiError", this.status = t, this.body = n;+ }+}, st = (e) => {+ if (!e || typeof e != "object") return "";+ let t = e;+ for (let e of [+ "message",+ "detail",+ "error"+ ]) {+ let n = t[e];+ if (typeof n == "string" && n) return n;+ }+ return "";+}, G = (e) => o(e);+async function K(e, t) {+ let n = await fetch(e, {+ headers: { Accept: "application/json" },+ credentials: "same-origin",+ ...t ? { signal: t } : {}+ }), r = null;+ try {+ r = await n.json();+ } catch {}+ if (!n.ok) throw new ot(st(r) || `请求失败(${n.status})`, n.status);+ return r;+}+async function q(e, t, n = "POST", r) {+ let i = await fetch(e, {+ method: n,+ ...r ? { signal: r } : {},+ headers: {+ Accept: "application/json",+ "Content-Type": "application/json"+ },+ credentials: "same-origin",+ body: JSON.stringify(t)+ }), a = null;+ try {+ a = await i.json();+ } catch {}+ if (!i.ok) throw new ot(st(a) || `请求失败(${i.status})`, i.status, a);+ return a;+}+//#endregion+//#region src/jobs.ts+async function ct(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 lt(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;+ ct({+ 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 = (a.message || (e.title ? e.title + (a.total ? `:已完成 ${a.checked || 0}/${a.total}` : "") : "") || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = (a.total || 0) > 0 ? e.progress(a.checked || 0, a.total, s) : e.loading(s);+ 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 node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js+var ut = 0;+Array.isArray;+function J(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];+ var l = {+ type: e,+ props: c,+ key: n,+ ref: o,+ __k: null,+ __: null,+ __b: 0,+ __e: null,+ __c: null,+ constructor: void 0,+ __v: --ut,+ __i: -1,+ __u: 0,+ __source: i,+ __self: a+ };+ if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);+ return S.vnode && S.vnode(l), l;+}+//#endregion+//#region src/islands/library-processing.tsx+var dt = (e, t) => K("/api/library-processing", t);+function ft({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a, preview: o }) {+ let [s, c] = V(e || { status: "idle" }), [l, u] = V(t), [m, g] = V(!1), [_, y] = V(!1), b = W(new AbortController()), x = W(0), S = W(s.status), C = W(null), w = m || s.status === "running";+ U(() => v(C.current, w), [w]);+ async function T() {+ let e = ++x.current;+ await ct({+ read: (e) => K("/api/library-processing", e),+ active: () => !b.current.signal.aborted && x.current === e,+ keepWatching: i === "notice" || !!a,+ render: (e) => {+ c(e), u(""), e.status === "complete" && S.current === "running" && i !== "notice" && (y(!0), n("已完成扫描与资料采集")), S.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), S.current = e.status;+ },+ disconnected: () => u("连接中断,正在重新读取处理进度")+ });+ }+ H(() => (!o && (s.status === "running" || i === "notice" || a) && T(), () => b.current.abort()), []);+ async function E() {+ if (!(w || o)) {+ g(!0), u(""), y(!1);+ try {+ let e = await q("/api/library-processing", {}, "POST", b.current.signal);+ if (b.current.signal.aborted) return;+ S.current = e.status, c(e), g(!1), await T();+ } catch (e) {+ b.current.signal.aborted || (u(G(e)), g(!1));+ }+ }+ }+ if (i === "notice") {+ if (!l && s.status !== "running" && s.status !== "failed") return null;+ let e = l || (s.status === "failed" ? "扫描与资料采集未完成" : `${s.stage || "正在整理馆藏"}${s.total ? ` · ${s.checked || 0} / ${s.total}` : ""}`);+ return /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: h(e, {+ variant: s.status === "failed" ? "error" : l ? "warning" : "gray",+ href: "/data-cleanup#libraryProcessing",+ label: l || s.status === "failed" ? "查看并处理" : "查看进度",+ value: s.checked || 0,+ ...s.status === "running" && s.total !== void 0 ? { max: s.total } : {}+ }) } });+ }+ return /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", {+ class: "geist-fieldset-content library-processing",+ children: [+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("cleanupScrapingTitle", "扫描与采集") } }),+ /* @__PURE__ */ J("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),+ /* @__PURE__ */ J("div", {+ "aria-live": "polite",+ children: [+ s.status === "running" && /* @__PURE__ */ J(L, { children: /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: s.total ? Fe(`${s.stage || "正在处理"} · ${s.checked || 0} / ${s.total} 个视频`, s.checked || 0, s.total) : f(s.stage || "正在处理") } }) }),+ (l || s.status === "failed") && /* @__PURE__ */ J("div", {+ role: "alert",+ onClick: (e) => {+ e.target.closest("[data-note-action]") && E();+ },+ dangerouslySetInnerHTML: { __html: p(l || s.error || "处理未完成,请重试", {+ variant: "error",+ filled: !0,+ actionLabel: s.status === "failed" ? "重试未完成项" : ""+ }) }+ }),+ s.status === "failed" && !!s.issues?.length && /* @__PURE__ */ J("ul", { children: s.issues.slice(0, 20).map((e) => /* @__PURE__ */ J("li", { children: [+ e.asset_id ? /* @__PURE__ */ J("a", {+ href: `/item/${e.asset_id}`,+ children: "查看视频"+ }) : null,+ e.asset_id ? ":" : "",+ e.message+ ] })) }),+ _ && /* @__PURE__ */ J("div", {+ class: "library-processing-result",+ dangerouslySetInnerHTML: { __html: p(`已扫描 ${s.scanned || 0} 个文件,识别 ${s.identified || 0} 个番号,整理 ${s.candidates || 0} 组资料候选。`, {+ variant: "success",+ label: "处理完成"+ }) }+ })+ ]+ })+ ]+ }), /* @__PURE__ */ J("footer", {+ class: "geist-fieldset-footer",+ "data-geist-fieldset-footer": !0,+ children: [+ /* @__PURE__ */ J("a", {+ class: "geist-button",+ href: "/scraping",+ children: "采集来源"+ }),+ !!s.candidates && /* @__PURE__ */ J("a", {+ class: "geist-button",+ href: "/review",+ children: "复核资料"+ }),+ s.status !== "failed" && /* @__PURE__ */ J("button", {+ ref: C,+ type: "button",+ class: "geist-button primary",+ onClick: () => void E(),+ children: "扫描并补全资料"+ })+ ]+ })] });+}+//#endregion+//#region src/management.ts+function pt(e) {+ return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);+}+function mt(e, t) {+ return t.filter((t) => e.some((e) => e.location === t));+}+function ht() {+ return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态">+ <div class="cleanupgrid">${[+ [+ "扫描与采集",+ "扫描并补全资料",+ "扫描媒体文件夹,导入已有资料,采集缺失信息。"+ ],+ [+ "人工复核",+ "查看候选",+ ""+ ],+ [+ "高清版",+ "查看高清版",+ ""+ ],+ [+ "重复文件",+ "查看重复文件",+ ""+ ],+ [+ "垃圾文件",+ "查看垃圾文件",+ ""+ ],+ [+ "空文件夹",+ "扫描空文件夹",+ ""+ ],+ [+ "回收站",+ "查看回收站",+ ""+ ]+ ].map(([e, t, n], r) => `+ <section class="cleanupfieldset${r === 0 ? " board-processing-skeleton" : ""}" data-geist-fieldset aria-labelledby="cleanup-loading-${r}">+ <div class="geist-fieldset-content"><h3 class="geist-fieldset-title" id="cleanup-loading-${r}">${e}</h3>+ ${n ? `<p>${n}</p>` : "<strong><span class=\"skeleton cleanup-count-skeleton\" aria-hidden=\"true\"></span></strong>"}+ ${r === 5 ? "<p class=\"cleanupmeta\"><span class=\"skeleton cleanup-count-skeleton\" aria-hidden=\"true\"></span></p>" : ""}</div>+ <footer class="geist-fieldset-footer" data-geist-fieldset-footer><button type="button" disabled>${r === 5 ? "<svg aria-hidden=\"true\"><use href=\"#i-scan-search\"></use></svg><span>" + t + "</span>" : t}</button></footer>+ </section>`).join("")}</div></div>`;+}+function gt(e, t = !1, n = !1) {+ if (t || n) return "";+ let r = "<svg class=\"externalmark\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";+ return `<details class="taste-history-guide"${e ? " open" : ""}>+ <summary><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"></use></svg>浏览器历史记录导入指南</summary>+ <div class="taste-history-guide-content">+ <p>在运行 Peach 的电脑上使用浏览器:点击上方「读取 Peach 主机」。</p>+ <p>记录在其他设备上:导出文件后,点击上方「导入历史」。多台设备的文件分别导入。</p>+ <ul><li>Chrome:在 <a class="externallink" href="https://takeout.google.com/" target="_blank" rel="noreferrer">Google Takeout${r}</a> 选择 Chrome 历史记录,下载 ZIP 后直接导入。</li>+ <li>其他浏览器:使用 <a class="externallink" href="https://github.com/purarue/browserexport" target="_blank" rel="noreferrer">browserexport${r}</a> 导出历史记录,再导入导出文件。</li></ul>+ <p>需要刷新时再次读取或导入;数据源可在页面底部移除。</p>+ <button type="button" class="geist-button taste-guide-skip">跳过</button>+ </div></details>`;}-function Ie(e, t) {- let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0), r = n.reduce((e, t) => e + t.score, 0);- if (!r) return "";- let i = 0, a = n.map((e, t) => {- let n = e.score / r * 100, a = `<circle cx="100" cy="100" r="72" pathLength="100" fill="none" stroke="var(--chart-${t % 4})" stroke-width="22" stroke-dasharray="${n} ${100 - n}" stroke-dashoffset="${-i}"><title>${R(e.name)}:${e.score.toLocaleString()}</title></circle>`;- return i += n, a;- }).join("");- return `<svg class="board-distribution" viewBox="0 0 200 200" role="img" aria-label="${R(t)}"><g transform="rotate(-90 100 100)">${a}</g><text x="100" y="100" text-anchor="middle" dominant-baseline="middle">${R(t)}</text></svg>`;+var _t = "peach-taste-guide-dismissed";+function vt(e, t) {+ y(e, ".taste-history-guide", "taste-guide-collapse");+ let n = e.querySelector(".taste-history-guide");+ n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {+ t.setItem(_t, "1"), n.remove();+ });}-function Le(e, t) {- let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 8);- if (!n.length) return "";- let r = n[0].score, i = n.map((e) => `<li><span class="board-rank-fill" style="width:${(e.score / r * 100).toFixed(2)}%"></span><span>${R(e.name)}</span><b>${e.score.toLocaleString()}</b></li>`).join("");- return `<ol class="board-ranked-chart" aria-label="${R(t)}">${i}</ol>`;+//#endregion+//#region src/board-state-preview.tsx+var yt = [+ ["idle", "待开始"],+ ["loading", "页面加载"],+ ["preparing", "准备任务"],+ ["running", "任务进行中"],+ ["retrying", "等待重试"],+ ["disconnected", "失去连接"],+ ["reconnected", "恢复连接"],+ ["failed", "任务失败"],+ ["complete", "任务完成"],+ ["expired", "状态已失效"],+ ["paused", "来源已暂停"]+], Y = ({ html: e }) => /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: e } });+function bt() {+ let [e, t] = V("running"), [n, r] = V(0), [i, a] = V(document.documentElement.dataset.theme === "dark"), [o, s] = V(38), c = {+ status: e === "failed" ? "failed" : [+ "running",+ "preparing",+ "disconnected",+ "retrying",+ "reconnected"+ ].includes(e) ? "running" : "idle",+ stage: e === "preparing" ? "正在准备扫描" : e === "retrying" ? "等待来源响应 · 8 秒后重试" : "正在整理资料",+ checked: o,+ ...e === "preparing" ? {} : { total: 100 },+ error: e === "failed" ? "来源暂时不可用,请重试未完成项" : "",+ issues: e === "failed" ? [{+ asset_id: null,+ message: "来源连接超时"+ }] : []+ }, l = e === "disconnected" ? "连接中断,正在重新读取处理进度" : "";+ return /* @__PURE__ */ J("main", {+ class: "board-state-preview",+ children: [+ /* @__PURE__ */ J("header", { children: [/* @__PURE__ */ J("div", { children: [/* @__PURE__ */ J("h1", { children: "运行状态预览" }), /* @__PURE__ */ J("p", { children: "演示数据 · 不连接任务接口,不执行扫描或写入。" })] }), /* @__PURE__ */ J("button", {+ class: "geist-button",+ onClick: () => {+ document.documentElement.dataset.theme = i ? "light" : "dark", a(!i);+ },+ children: i ? "浅色" : "深色"+ })] }),+ /* @__PURE__ */ J("nav", {+ "aria-label": "演示状态",+ children: yt.map(([i, a]) => /* @__PURE__ */ J("button", {+ class: "geist-button",+ "aria-pressed": e === i,+ onClick: () => {+ t(i), r(n + 1);+ },+ children: a+ }))+ }),+ /* @__PURE__ */ J("div", {+ class: "board-preview-tools",+ children: [/* @__PURE__ */ J("label", { children: [+ "任务进度 ",+ /* @__PURE__ */ J("input", {+ type: "range",+ min: "0",+ max: "100",+ value: o,+ onInput: (e) => s(Number(e.currentTarget.value))+ }),+ /* @__PURE__ */ J("output", { children: [o, "%"] })+ ] }), /* @__PURE__ */ J("button", {+ class: "geist-button",+ onClick: () => r(n + 1),+ children: "重播状态"+ })]+ }),+ /* @__PURE__ */ J("section", {+ "aria-label": "页面横幅",+ children: [+ /* @__PURE__ */ J("h2", { children: "全局任务横幅" }),+ /* @__PURE__ */ J(ft, {+ data: c,+ error: l,+ mode: "notice",+ preview: !0,+ toast: () => {}+ }, `banner-${e}-${n}-${o}`),+ ![+ "running",+ "preparing",+ "disconnected",+ "retrying",+ "reconnected",+ "failed"+ ].includes(e) && /* @__PURE__ */ J("p", { children: "此状态不常驻全局横幅。" })+ ]+ }),+ /* @__PURE__ */ J("section", { children: [+ /* @__PURE__ */ J("h2", { children: "数据管理 · 扫描与采集" }),+ e === "loading" ? /* @__PURE__ */ J(Y, { html: ht() }) : /* @__PURE__ */ J("div", {+ class: "cleanupgrid",+ children: /* @__PURE__ */ J("section", {+ id: "libraryProcessing",+ class: "cleanupfieldset",+ children: /* @__PURE__ */ J(ft, {+ data: c,+ error: l,+ preview: !0,+ toast: () => {}+ }, `${e}-${n}-${o}`)+ })+ }),+ e === "complete" && /* @__PURE__ */ J(Y, { html: p("已完成扫描与资料采集", {+ variant: "success",+ label: "任务完成"+ }) }),+ e === "expired" && /* @__PURE__ */ J(Y, { html: p("任务状态已失效,请重新发起任务", { variant: "warning" }) }),+ e === "paused" && /* @__PURE__ */ J("span", {+ class: "sbadge paused",+ children: "已暂停"+ })+ ] }),+ /* @__PURE__ */ J("section", { children: [/* @__PURE__ */ J("h2", { children: "关注检查与资源同步" }), /* @__PURE__ */ J("div", {+ class: "board-preview-grid",+ children: [/* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "检查更新" }), /* @__PURE__ */ J(Y, { html: e === "disconnected" ? p("暂时无法读取进度,正在重新连接…", { label: "任务状态" }) : e === "failed" ? p("检查失败:来源连接超时", {+ variant: "error",+ actionLabel: "重试"+ }) : e === "running" || e === "retrying" || e === "reconnected" ? Fe(`${e === "retrying" ? "第 2/3 次尝试,8 秒后重试 · " : ""}已完成 ${o}/100 个来源`, o, 100) : e === "preparing" ? f("正在准备检查任务…") : p(e === "complete" ? "已完成检查" : e === "paused" ? "已暂停自动检查" : e === "expired" ? "任务状态已失效,请重新发起任务" : "等待开始", { variant: e === "complete" ? "success" : "secondary" }) })] }), /* @__PURE__ */ J("article", { children: [+ /* @__PURE__ */ J("h3", { children: "连接与恢复" }),+ /* @__PURE__ */ J(Y, { html: h(e === "disconnected" ? "暂时无法连接服务器,正在重连" : e === "reconnected" ? "连接已恢复,继续读取任务进度" : "连接正常", {+ variant: e === "disconnected" ? "warning" : "gray",+ href: "#",+ label: "查看状态"+ }) }),+ /* @__PURE__ */ J("p", { children: "失去连接只影响进度读取;恢复连接后继续展示任务状态。" })+ ] })]+ })] }),+ /* @__PURE__ */ J("section", { children: [/* @__PURE__ */ J("h2", { children: "错误与加载状态一览" }), /* @__PURE__ */ J("div", {+ class: "board-preview-grid",+ children: [+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "读取失败" }), /* @__PURE__ */ J(Y, { html: p("无法读取状态,请重试", {+ variant: "error",+ actionLabel: "重试"+ }) })] }),+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "来源离线" }), /* @__PURE__ */ J(Y, { html: p("媒体来源离线,请检查挂载状态", { variant: "warning" }) })] }),+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "没有待处理内容" }), /* @__PURE__ */ J(Y, { html: p("没有待处理内容", { variant: "secondary" }) })] }),+ /* @__PURE__ */ J("article", { children: [/* @__PURE__ */ J("h3", { children: "等待响应" }), /* @__PURE__ */ J(Y, { html: f("正在读取来源状态") })] })+ ]+ })] })+ ]+ });}-function Re(e, t) {- let n = e.filter((e) => Number.isFinite(e.score) && e.score > 0).slice().sort((e, t) => t.score - e.score).slice(0, 6);- if (n.length < 3) return "";- let r = Math.max(...n.map((e) => e.score)), i = n.length, a = (e, t) => {- let n = e / i * Math.PI * 2 - Math.PI / 2;- return [160 + Math.cos(n) * t, 140 + Math.sin(n) * t];- }, o = (e) => n.map((t, n) => a(n, e(n)).map((e) => e.toFixed(2)).join(",")).join(" "), s = [- 25,- 50,- 75,- 100- ].map((e) => `<polygon points="${o(() => e)}" class="board-radar-grid"/>`).join(""), c = n.map((e, t) => {- let [n, r] = a(t, 116);- return `<text x="${n}" y="${r}" text-anchor="${n < 145 ? "end" : n > 175 ? "start" : "middle"}">${R(e.name)}</text>`;- }).join("");- return `<svg class="board-radar" viewBox="0 0 320 280" role="img" aria-label="${R(t)}"><title>${R(n.map((e) => `${e.name} ${e.score}`).join(","))}</title>${s}<polygon points="${o((e) => n[e].score / r * 100)}" class="board-radar-value"/>${c}</svg>`;+function xt(e) {+ Oe(ae(bt, {}), e);}//#endregion//#region src/board-controls.ts-function ze(e) {+function St(e) {let t = Number(e.min) || 0, n = Number(e.max) || 100, r = Number(e.value), i = n > t ? Math.max(0, Math.min(100, (r - t) / (n - t) * 100)) : 0;e.style.setProperty("--board-range-value", `${i}%`);let a = e.closest(".dual-range");@@ -408,15 +998,17 @@ function ze(e) {let o = e.id === "durMax" ? "max" : "min", s = a.querySelector(`[data-range-end="${o}"]`);s || (s = document.createElement("output"), s.className = "board-range-tip", s.dataset.rangeEnd = o, s.setAttribute("aria-hidden", "true"), a.append(s)), s.textContent = r >= n && o === "max" ? "不限" : `${r} 分钟`, s.style.left = `${i}%`;}-function Be() {- let e = (e) => e.querySelectorAll("input[type=range]").forEach(ze);+function Ct() {+ let e = (e) => {+ e.querySelectorAll("input[type=range]").forEach(St), Et(e), Tt(e);+ };e(document), new MutationObserver((t) => {- for (let n of t) for (let t of n.addedNodes) t instanceof Element && (t.matches("input[type=range]") && ze(t), e(t));+ for (let n of t) for (let t of n.addedNodes) t instanceof Element && (t.matches("input[type=range]") && St(t), e(t));}).observe(document.body, {subtree: !0,childList: !0}), document.addEventListener("input", (e) => {- e.target instanceof HTMLInputElement && e.target.type === "range" && ze(e.target);+ e.target instanceof HTMLInputElement && e.target.type === "range" && St(e.target);});let t = document.createElement("div");t.className = "board-tooltip", t.id = "board-control-tooltip", t.role = "tooltip", t.hidden = !0, document.body.append(t);@@ -437,7 +1029,65 @@ function Be() {e.key === "Escape" && o();}), document.addEventListener("scroll", o, !0), window.addEventListener("resize", o);}-function Ve(e) {+var wt = /* @__PURE__ */ new Map();+function Tt(e) {+ let t = ".managebar-menu,.board-local-nav:not(.settingscard>.board-local-nav),.insighttabs", n = [...e.querySelectorAll(t)];+ e instanceof HTMLElement && e.matches(t) && n.push(e), n.forEach((e) => {+ if (e.hasAttribute("data-board-tabs")) return;+ e.dataset.boardTabs = "true";+ let t = e.className + e.getAttribute("aria-label"), n = (t) => {+ e.style.setProperty("--tab-x", `${t.left}px`), e.style.setProperty("--tab-width", `${t.width}px`);+ }, r = () => {+ let r = e.querySelector("button[aria-selected=true],button[aria-pressed=true]");+ if (!r || !r.offsetWidth) return;+ let i = {+ left: r.offsetLeft,+ width: r.offsetWidth+ };+ n(i), wt.set(t, i);+ }, i = wt.get(t);+ i ? n(i) : r(), requestAnimationFrame(() => {+ e.classList.add("board-tabs-ready"), requestAnimationFrame(r);+ });+ let a = new MutationObserver(r);+ a.observe(e, {+ subtree: !0,+ attributes: !0,+ attributeFilter: ["aria-selected", "aria-pressed"]+ });+ let o = new ResizeObserver(() => {+ if (!e.isConnected) {+ o.disconnect(), a.disconnect();+ return;+ }+ r();+ });+ o.observe(e);+ });+}+function Et(e) {+ let t = [...e.querySelectorAll(".iconswitch")];+ e instanceof HTMLElement && e.matches(".iconswitch") && t.push(e), t.forEach((e) => {+ if (e.hasAttribute("data-board-segments")) return;+ e.dataset.boardSegments = "true";+ let t = document.createElement("span");+ t.className = "board-segment-thumb", t.setAttribute("aria-hidden", "true"), e.prepend(t);+ let n = () => {+ let n = e.querySelector("label:has(input:checked)");+ n && (t.style.transform = `translate(${n.offsetLeft}px,${n.offsetTop}px)`, t.style.width = `${n.offsetWidth}px`, t.style.height = `${n.offsetHeight}px`);+ };+ e.addEventListener("change", n);+ let r = new ResizeObserver(() => {+ if (!e.isConnected) {+ r.disconnect();+ return;+ }+ n();+ });+ r.observe(e), n(), requestAnimationFrame(() => e.classList.add("board-segments-ready"));+ });+}+function Dt(e) {e.querySelectorAll(".tasteranks,.insightranking").forEach((e, t) => {if (e.children.length <= 5 || e.parentElement?.hasAttribute("data-expandable-ranks")) return;let n = document.createElement("div");@@ -459,7 +1109,7 @@ function Ve(e) {}//#endregion//#region node_modules/d3-array/src/max.js-function He(e, t) {+function Ot(e, t) {let n;if (t === void 0) for (let t of e) t != null && (n < t || n === void 0 && t >= t) && (n = t);else {@@ -470,7 +1120,7 @@ function He(e, t) {}//#endregion//#region node_modules/d3-array/src/min.js-function Ue(e, t) {+function kt(e, t) {let n;if (t === void 0) for (let t of e) t != null && (n > t || n === void 0 && t >= t) && (n = t);else {@@ -481,7 +1131,7 @@ function Ue(e, t) {}//#endregion//#region node_modules/d3-array/src/sum.js-function We(e, t) {+function At(e, t) {let n = 0;if (t === void 0) for (let t of e) (t = +t) && (n += t);else {@@ -492,66 +1142,66 @@ function We(e, t) {}//#endregion//#region node_modules/d3-sankey/src/align.js-function Ge(e, t) {+function jt(e, t) {return e.sourceLinks.length ? e.depth : t - 1;}//#endregion//#region node_modules/d3-sankey/src/constant.js-function Ke(e) {+function Mt(e) {return function() {return e;};}//#endregion//#region node_modules/d3-sankey/src/sankey.js-function qe(e, t) {- return Ye(e.source, t.source) || e.index - t.index;+function Nt(e, t) {+ return Ft(e.source, t.source) || e.index - t.index;}-function Je(e, t) {- return Ye(e.target, t.target) || e.index - t.index;+function Pt(e, t) {+ return Ft(e.target, t.target) || e.index - t.index;}-function Ye(e, t) {+function Ft(e, t) {return e.y0 - t.y0;}-function Xe(e) {+function It(e) {return e.value;}-function Ze(e) {+function Lt(e) {return e.index;}-function Qe(e) {+function Rt(e) {return e.nodes;}-function $e(e) {+function zt(e) {return e.links;}-function et(e, t) {+function Bt(e, t) {let n = e.get(t);if (!n) throw Error("missing: " + t);return n;}-function tt({ nodes: e }) {+function Vt({ nodes: e }) {for (let t of e) {let e = t.y0, n = e;for (let n of t.sourceLinks) n.y0 = e + n.width / 2, e += n.width;for (let e of t.targetLinks) e.y1 = n + e.width / 2, n += e.width;}}-function nt() {- let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = Ze, c = Ge, l, u, d = Qe, f = $e, p = 6;+function Ht() {+ let e = 0, t = 0, n = 1, r = 1, i = 24, a = 8, o, s = Lt, c = jt, l, u, d = Rt, f = zt, p = 6;function m() {let e = {nodes: d.apply(null, arguments),links: f.apply(null, arguments)};- return h(e), g(e), _(e), v(e), x(e), tt(e), e;+ return h(e), g(e), _(e), v(e), x(e), Vt(e), e;}m.update = function(e) {- return tt(e), e;+ return Vt(e), e;}, m.nodeId = function(e) {- return arguments.length ? (s = typeof e == "function" ? e : Ke(e), m) : s;+ return arguments.length ? (s = typeof e == "function" ? e : Mt(e), m) : s;}, m.nodeAlign = function(e) {- return arguments.length ? (c = typeof e == "function" ? e : Ke(e), m) : c;+ return arguments.length ? (c = typeof e == "function" ? e : Mt(e), m) : c;}, m.nodeSort = function(e) {return arguments.length ? (l = e, m) : l;}, m.nodeWidth = function(e) {@@ -559,9 +1209,9 @@ function nt() {}, m.nodePadding = function(e) {return arguments.length ? (a = o = +e, m) : a;}, m.nodes = function(e) {- return arguments.length ? (d = typeof e == "function" ? e : Ke(e), m) : d;+ return arguments.length ? (d = typeof e == "function" ? e : Mt(e), m) : d;}, m.links = function(e) {- return arguments.length ? (f = typeof e == "function" ? e : Ke(e), m) : f;+ return arguments.length ? (f = typeof e == "function" ? e : Mt(e), m) : f;}, m.linkSort = function(e) {return arguments.length ? (u = e, m) : u;}, m.size = function(i) {@@ -577,12 +1227,12 @@ function nt() {for (let [e, r] of t.entries()) {r.index = e;let { source: t, target: i } = r;- typeof t != "object" && (t = r.source = et(n, t)), typeof i != "object" && (i = r.target = et(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);+ typeof t != "object" && (t = r.source = Bt(n, t)), typeof i != "object" && (i = r.target = Bt(n, i)), t.sourceLinks.push(r), i.targetLinks.push(r);}if (u != null) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(u), n.sort(u);}function g({ nodes: e }) {- for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(We(t.sourceLinks, Xe), We(t.targetLinks, Xe)) : t.fixedValue;+ for (let t of e) t.value = t.fixedValue === void 0 ? Math.max(At(t.sourceLinks, It), At(t.targetLinks, It)) : t.fixedValue;}function _({ nodes: e }) {let t = e.length, n = new Set(e), r = /* @__PURE__ */ new Set(), i = 0;@@ -607,7 +1257,7 @@ function nt() {}}function y({ nodes: t }) {- let r = He(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);+ let r = Ot(t, (e) => e.depth) + 1, a = (n - e - i) / (r - 1), o = Array(r);for (let n of t) {let t = Math.max(0, Math.min(r - 1, Math.floor(c.call(null, n, r))));n.layer = t, n.x0 = e + t * a, n.x1 = n.x0 + i, o[t] ? o[t].push(n) : o[t] = [n];@@ -616,7 +1266,7 @@ function nt() {return o;}function b(e) {- let n = Ue(e, (e) => (r - t - (e.length - 1) * o) / We(e, Xe));+ let n = kt(e, (e) => (r - t - (e.length - 1) * o) / At(e, It));for (let i of e) {let e = t;for (let t of i) {@@ -633,7 +1283,7 @@ function nt() {}function x(e) {let n = y(e);- o = Math.min(a, (r - t) / (He(n, (e) => e.length) - 1)), b(n);+ o = Math.min(a, (r - t) / (Ot(n, (e) => e.length) - 1)), b(n);for (let e = 0; e < p; ++e) {let t = .99 ** e, r = Math.max(1 - t, (e + 1) / p);C(n, t, r), S(n, t, r);@@ -652,7 +1302,7 @@ function nt() {let i = (n / r - e.y0) * t;e.y0 += i, e.y1 += i, D(e);}- l === void 0 && i.sort(Ye), w(i, n);+ l === void 0 && i.sort(Ft), w(i, n);}}function C(e, t, n) {@@ -668,7 +1318,7 @@ function nt() {let i = (n / r - e.y0) * t;e.y0 += i, e.y1 += i, D(e);}- l === void 0 && i.sort(Ye), w(i, n);+ l === void 0 && i.sort(Ft), w(i, n);}}function w(e, n) {@@ -689,12 +1339,12 @@ function nt() {}function D({ sourceLinks: e, targetLinks: t }) {if (u === void 0) {- for (let { source: { sourceLinks: e } } of t) e.sort(Je);- for (let { target: { targetLinks: t } } of e) t.sort(qe);+ for (let { source: { sourceLinks: e } } of t) e.sort(Pt);+ for (let { target: { targetLinks: t } } of e) t.sort(Nt);}}function O(e) {- if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Je), n.sort(qe);+ if (u === void 0) for (let { sourceLinks: t, targetLinks: n } of e) t.sort(Pt), n.sort(Nt);}function k(e, t) {let n = e.y0 - (e.sourceLinks.length - 1) * o / 2;@@ -724,15 +1374,15 @@ function nt() {}//#endregion//#region node_modules/d3-path/src/path.js-var rt = Math.PI, it = 2 * rt, z = 1e-6, at = it - z;-function ot() {+var Ut = Math.PI, Wt = 2 * Ut, Gt = 1e-6, Kt = Wt - Gt;+function qt() {this._x0 = this._y0 = this._x1 = this._y1 = null, this._ = "";}-function st() {- return new ot();+function Jt() {+ return new qt();}-ot.prototype = st.prototype = {- constructor: ot,+qt.prototype = Jt.prototype = {+ constructor: qt,moveTo: function(e, t) {this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t);},@@ -753,11 +1403,11 @@ ot.prototype = st.prototype = {var a = this._x1, o = this._y1, s = n - e, c = r - t, l = a - e, u = o - t, d = l * l + u * u;if (i < 0) throw Error("negative radius: " + i);if (this._x1 === null) this._ += "M" + (this._x1 = e) + "," + (this._y1 = t);- else if (d > z) {- if (!(Math.abs(u * s - c * l) > z) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);+ else if (d > Gt) {+ if (!(Math.abs(u * s - c * l) > Gt) || !i) this._ += "L" + (this._x1 = e) + "," + (this._y1 = t);else {- var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((rt - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;- Math.abs(y - 1) > z && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);+ var f = n - a, p = r - o, m = s * s + c * c, h = f * f + p * p, g = Math.sqrt(m), _ = Math.sqrt(d), v = i * Math.tan((Ut - Math.acos((m + d - h) / (2 * g * _))) / 2), y = v / _, b = v / g;+ Math.abs(y - 1) > Gt && (this._ += "L" + (e + y * l) + "," + (t + y * u)), this._ += "A" + i + "," + i + ",0,0," + +(u * f > l * p) + "," + (this._x1 = e + b * s) + "," + (this._y1 = t + b * c);}}},@@ -765,7 +1415,7 @@ ot.prototype = st.prototype = {e = +e, t = +t, n = +n, a = !!a;var o = n * Math.cos(r), s = n * Math.sin(r), c = e + o, l = t + s, u = 1 ^ a, d = a ? r - i : i - r;if (n < 0) throw Error("negative radius: " + n);- this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > z || Math.abs(this._y1 - l) > z) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % it + it), d > at ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > z && (this._ += "A" + n + "," + n + ",0," + +(d >= rt) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));+ this._x1 === null ? this._ += "M" + c + "," + l : (Math.abs(this._x1 - c) > Gt || Math.abs(this._y1 - l) > Gt) && (this._ += "L" + c + "," + l), n && (d < 0 && (d = d % Wt + Wt), d > Kt ? this._ += "A" + n + "," + n + ",0,1," + u + "," + (e - o) + "," + (t - s) + "A" + n + "," + n + ",0,1," + u + "," + (this._x1 = c) + "," + (this._y1 = l) : d > Gt && (this._ += "A" + n + "," + n + ",0," + +(d >= Ut) + "," + u + "," + (this._x1 = e + n * Math.cos(i)) + "," + (this._y1 = t + n * Math.sin(i))));},rect: function(e, t, n, r) {this._ += "M" + (this._x0 = this._x1 = +e) + "," + (this._y0 = this._y1 = +t) + "h" + +n + "v" + +r + "h" + -n + "Z";@@ -776,71 +1426,71 @@ ot.prototype = st.prototype = {};//#endregion//#region node_modules/d3-shape/src/constant.js-function ct(e) {+function Yt(e) {return function() {return e;};}//#endregion//#region node_modules/d3-shape/src/point.js-function lt(e) {+function Xt(e) {return e[0];}-function ut(e) {+function Zt(e) {return e[1];}//#endregion//#region node_modules/d3-shape/src/array.js-var dt = Array.prototype.slice;+var Qt = Array.prototype.slice;//#endregion//#region node_modules/d3-shape/src/link/index.js-function ft(e) {+function $t(e) {return e.source;}-function pt(e) {+function en(e) {return e.target;}-function mt(e) {- var t = ft, n = pt, r = lt, i = ut, a = null;+function tn(e) {+ var t = $t, n = en, r = Xt, i = Zt, a = null;function o() {- var o, s = dt.call(arguments), c = t.apply(this, s), l = n.apply(this, s);- if (a ||= o = st(), e(a, +r.apply(this, (s[0] = c, s)), +i.apply(this, s), +r.apply(this, (s[0] = l, s)), +i.apply(this, s)), o) return a = null, o + "" || null;+ var o, s = Qt.call(arguments), c = t.apply(this, s), l = n.apply(this, s);+ if (a ||= o = Jt(), e(a, +r.apply(this, (s[0] = c, s)), +i.apply(this, s), +r.apply(this, (s[0] = l, s)), +i.apply(this, s)), o) return a = null, o + "" || null;}return o.source = function(e) {return arguments.length ? (t = e, o) : t;}, o.target = function(e) {return arguments.length ? (n = e, o) : n;}, o.x = function(e) {- return arguments.length ? (r = typeof e == "function" ? e : ct(+e), o) : r;+ return arguments.length ? (r = typeof e == "function" ? e : Yt(+e), o) : r;}, o.y = function(e) {- return arguments.length ? (i = typeof e == "function" ? e : ct(+e), o) : i;+ return arguments.length ? (i = typeof e == "function" ? e : Yt(+e), o) : i;}, o.context = function(e) {return arguments.length ? (a = e ?? null, o) : a;}, o;}-function ht(e, t, n, r, i) {+function nn(e, t, n, r, i) {e.moveTo(t, n), e.bezierCurveTo(t = (t + r) / 2, n, t, i, r, i);}-function gt() {- return mt(ht);+function rn() {+ return tn(nn);}//#endregion//#region node_modules/d3-sankey/src/sankeyLinkHorizontal.js-function _t(e) {+function an(e) {return [e.source.x1, e.y0];}-function vt(e) {+function on(e) {return [e.target.x0, e.y1];}-function yt() {- return gt().source(_t).target(vt);+function sn() {+ return rn().source(an).target(on);}//#endregion//#region src/board-sankey.ts-function bt(e = []) {+function cn(e = []) {let n = e.filter((e) => e.source && e.target && Number.isFinite(e.value) && e.value > 0);if (!n.length) return "";- let r = [...new Set(n.map((e) => e.source))], i = [...new Set(n.map((e) => e.target))], a = nt().nodeId((e) => e.id).nodeWidth(10).nodePadding(22).extent([[155, 16], [535, 404]])({+ let r = [...new Set(n.map((e) => e.source))], i = [...new Set(n.map((e) => e.target))], a = Ht().nodeId((e) => e.id).nodeWidth(10).nodePadding(22).extent([[155, 16], [535, 404]])({nodes: [...r.map((e) => ({id: `source:${e}`,name: e,@@ -855,13 +1505,13 @@ function bt(e = []) {target: `target:${e.target}`,value: e.value}))- }), o = n.reduce((e, t) => e + t.value, 0), s = yt(), c = a.links.map((e) => {+ }), o = n.reduce((e, t) => e + t.value, 0), s = sn(), c = a.links.map((e) => {let n = e.source, i = e.target;return `<path d="${s(e)}" stroke-width="${Math.max(.5, e.width || 0)}" style="--flow-color:var(--board-chart-${r.indexOf(n.name) % 6})" data-flow-source="${n.index}" data-flow-target="${i.index}" data-flow-value="${e.value}" data-flow-label="${t(n.name)} → ${t(i.name)}" tabindex="0" role="img" aria-label="${t(n.name)} → ${t(i.name)}:${e.value} 条线索"/>`;}).join(""), l = a.nodes.map((e) => `<g data-flow-node="${e.index}" data-flow-value="${e.value}" data-flow-label="${t(e.name)}" tabindex="0" role="img" aria-label="${t(e.name)}:${e.value} 条线索"><rect x="${e.x0}" y="${e.y0}" width="10" height="${Math.max(1, (e.y1 || 0) - (e.y0 || 0))}" rx="5" fill="${e.side === "source" ? `var(--board-chart-${r.indexOf(e.name) % 6})` : "var(--color-text-secondary)"}"/><text x="${e.side === "source" ? 145 : 545}" y="${((e.y0 || 0) + (e.y1 || 0)) / 2}" text-anchor="${e.side === "source" ? "end" : "start"}" dominant-baseline="middle">${t(e.name.length > 18 ? e.name.slice(0, 16) + "…" : e.name)}<tspan x="${e.side === "source" ? 145 : 545}" dy="15">${e.side === "source" ? e.value?.toLocaleString() : ((e.value || 0) / o * 100).toFixed(1) + "%"}</tspan></text></g>`).join("");return `<section class="board-sankey-card" data-sankey-card><header><h3>创作者线索来源</h3><b data-sankey-number>${o.toLocaleString()}</b><span data-sankey-label>条线索</span></header><div class="board-sankey-scroll"><svg viewBox="0 0 720 435" aria-label="来源网站与创作者线索"><g class="board-sankey-links">${c}</g><g class="board-sankey-nodes">${l}</g></svg></div><footer><span>来源网站</span><span>创作者 · 线索占比</span></footer></section>`;}-function xt(e) {+function ln(e) {e.querySelectorAll("[data-sankey-card]").forEach((e) => {let t = [...e.querySelectorAll("[data-flow-source]")], n = [...e.querySelectorAll("[data-flow-node]")], r = e.querySelector("[data-sankey-number]"), i = e.querySelector("[data-sankey-label]"), a = r.textContent, o = () => {t.forEach((e) => e.style.opacity = ""), n.forEach((e) => e.style.opacity = ""), r.textContent = a, i.textContent = "条线索";@@ -877,9 +1527,9 @@ function xt(e) {}//#endregion//#region src/board-analytics.ts-var St = (e) => Number.isFinite(e) && e >= 0;-function Ct(e, n, r = "个视频") {- let i = e.filter((e) => St(e.value));+var un = (e) => Number.isFinite(e) && e >= 0;+function dn(e, n, r = "个视频") {+ let i = e.filter((e) => un(e.value));if (!i.length) return "";let a = i.reduce((e, t) => e + t.value, 0), o = Math.max(1, ...i.map((e) => e.value)) * 1.1, s = Math.min(22, 110 / Math.max(1, i.length)), c = Math.min(15, s * .68), l = i.map((e, n) => {let i = 32 + n * s, a = e.value / o * 100;@@ -887,19 +1537,20 @@ function Ct(e, n, r = "个视频") {}).join("");return `<section class="board-radial-card" data-radial-card data-radial-total="${a}" data-radial-title="${t(n)}"><header><span data-radial-label>${t(n)}</span><b data-radial-number>${a.toLocaleString()}</b><small>${t(r)}</small></header><svg class="board-rings" viewBox="0 0 320 320" aria-label="${t(n)}">${l}</svg><div class="board-radial-tiles">${i.map((e, n) => `<button type="button" data-radial-tile="${n}" data-radial-value="${e.value}" data-radial-name="${t(e.name)}" aria-pressed="false" style="--ring-color:var(--board-chart-${n % 6})"><span><i aria-hidden="true"></i>${t(e.name)}</span><b>${e.value.toLocaleString()}</b>${e.detail ? `<small>${t(e.detail)}</small>` : ""}</button>`).join("")}</div></section>`;}-function wt(e) {+function fn(e) {e.querySelectorAll("[data-radial-card]").forEach((e) => {- let t = [...e.querySelectorAll("[data-radial-tile]")], n = [...e.querySelectorAll("[data-radial-ring]")], r = e.querySelector("[data-radial-number]"), i = e.querySelector("[data-radial-label]"), a = -1, o = 0, s = 0, c = (c) => {+ let t = [...e.querySelectorAll("[data-radial-tile]")], n = [...e.querySelectorAll("[data-radial-ring]")], r = e.querySelector("[data-radial-number]"), i = e.querySelector("[data-radial-label]"), a = -1, o = 0, s = 0, c = (c, l = 300) => {e.dataset.radialFocus = String(c), t.forEach((e, t) => {e.dataset.active = String(t === c), e.setAttribute("aria-pressed", String(t === a)), n[t]?.setAttribute("aria-pressed", String(t === a)), n[t] && (n[t].dataset.active = String(t === c));});- let l = Number(c < 0 ? e.dataset.radialTotal : t[c]?.dataset.radialValue);+ let u = Number(c < 0 ? e.dataset.radialTotal : t[c]?.dataset.radialValue);i.textContent = c < 0 ? e.dataset.radialTitle : t[c].dataset.radialName, cancelAnimationFrame(s);- let u = o, d = performance.now(), f = (e) => {- let t = matchMedia("(prefers-reduced-motion: reduce)").matches ? 1 : Math.min(1, (e - d) / 300);- o = u + (l - u) * (1 - (1 - t) ** 3), r.textContent = Math.round(o).toLocaleString(), t < 1 && (s = requestAnimationFrame(f));+ let d = o, f = performance.now(), p = (t) => {+ if (!e.isConnected) return;+ let n = matchMedia("(prefers-reduced-motion: reduce)").matches ? 1 : Math.min(1, (t - f) / l);+ o = d + (u - d) * (1 - (1 - n) ** 3), r.textContent = Math.round(o).toLocaleString(), n < 1 && (s = requestAnimationFrame(p));};- s = requestAnimationFrame(f);+ s = requestAnimationFrame(p);}, l = (e) => {a = a === e ? -1 : e, c(a);};@@ -908,10 +1559,22 @@ function wt(e) {e.addEventListener("pointerenter", () => c(t)), e.addEventListener("pointerleave", () => c(a)), e.addEventListener("focus", () => c(t)), e.addEventListener("blur", () => c(a)), e.addEventListener("click", () => l(t)), e instanceof SVGElement && e.addEventListener("keydown", (e) => {(e.key === "Enter" || e.key === " ") && (e.preventDefault(), l(t));});- }), c(-1);+ }), e.dataset.radialFocus = "-1", r.textContent = "0";+ let u = () => {+ requestAnimationFrame(() => {+ e.isConnected && (e.classList.add("board-chart-visible"), c(-1, 1200));+ });+ };+ if (typeof IntersectionObserver > "u" || matchMedia("(prefers-reduced-motion: reduce)").matches) u();+ else {+ let t = new IntersectionObserver((e) => {+ e.some((e) => e.isIntersecting) && (t.disconnect(), u());+ }, { threshold: .15 });+ t.observe(e);+ }});}-var Tt = [+var pn = ["周一","周二","周三",@@ -920,11 +1583,11 @@ var Tt = ["周六","周日"];-function Et(e) {+function mn(e) {if (!e?.days?.length) return "<section class=\"board-activity-empty\"><h3>浏览活跃时间</h3><p>还没有可用于分析的口味网站访问记录。</p></section>";let n = Array.from({ length: 7 }, () => Array(24).fill(0));- for (let t of e.hours || []) Number.isInteger(t.weekday) && t.weekday >= 0 && t.weekday < 7 && Number.isInteger(t.hour) && t.hour >= 0 && t.hour < 24 && St(t.count) && (n[t.weekday][t.hour] = (n[t.weekday][t.hour] || 0) + t.count);- let r = Math.max(1, ...n.flat()), i = n.flat().reduce((e, t) => e + t, 0), a = n.map((e, t) => `<span class="board-heat-axis">${Tt[t]}</span>${e.map((e, n) => `<button type="button" data-heat-value="${e}" data-heat-label="${Tt[t]} ${n}:00" aria-label="${Tt[t]} ${n}:00,${e} 次访问" style="--heat:${e ? Math.max(12, e / r * 100) : 0}%"></button>`).join("")}`).join(""), o = e.days.filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e.date) && St(e.count)).sort((e, t) => e.date.localeCompare(t.date));+ for (let t of e.hours || []) Number.isInteger(t.weekday) && t.weekday >= 0 && t.weekday < 7 && Number.isInteger(t.hour) && t.hour >= 0 && t.hour < 24 && un(t.count) && (n[t.weekday][t.hour] = (n[t.weekday][t.hour] || 0) + t.count);+ let r = Math.max(1, ...n.flat()), i = n.flat().reduce((e, t) => e + t, 0), a = n.map((e, t) => `<span class="board-heat-axis">${pn[t]}</span>${e.map((e, n) => `<button type="button" data-heat-value="${e}" data-heat-label="${pn[t]} ${n}:00" aria-label="${pn[t]} ${n}:00,${e} 次访问" style="--heat:${e ? Math.max(12, e / r * 100) : 0}%"></button>`).join("")}`).join(""), o = e.days.filter((e) => /^\d{4}-\d{2}-\d{2}$/.test(e.date) && un(e.count)).sort((e, t) => e.date.localeCompare(t.date));if (!o.length) return "";let s = /* @__PURE__ */ new Date(`${o.at(-1).date}T00:00:00Z`), c = new Date(s);c.setUTCDate(c.getUTCDate() - 90);@@ -936,7 +1599,7 @@ function Et(e) {}).join("");return `<div class="board-activity-charts"><section class="board-heat-card" data-heat-card><header><h3>浏览活跃时间</h3><b data-heat-number>${i.toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-heat-scroll"><div class="board-hour-grid"><span></span>${Array.from({ length: 24 }, (e, t) => `<span class="board-heat-axis">${t % 2 ? "" : t}</span>`).join("")}${a}</div></div><footer>星期 × 小时<span>${t(e.timezone || "UTC+08:00")}</span></footer></section><section class="board-heat-card" data-heat-card><header><h3>每日活跃</h3><b data-heat-number>${o.filter((e) => e.date >= c.toISOString().slice(0, 10)).reduce((e, t) => e + t.count, 0).toLocaleString()}</b><span data-heat-title data-heat-default="口味网站访问">口味网站访问</span></header><div class="board-day-grid">${d}</div><footer>${c.toISOString().slice(0, 10)}<span>${o.at(-1).date}</span></footer></section></div>`;}-function Dt(e) {+function hn(e) {e.querySelectorAll("[data-heat-card]").forEach((e) => {let t = e.querySelector("[data-heat-number]"), n = e.querySelector("[data-heat-title]"), r = t.textContent;e.querySelectorAll("[data-heat-value]").forEach((e) => {@@ -947,283 +1610,69 @@ function Dt(e) {};e.addEventListener("pointerenter", i), e.addEventListener("pointerleave", a), e.addEventListener("focus", i), e.addEventListener("blur", a);});- });-}-//#endregion-//#region src/sidebar-groups.ts-var Ot = (e) => e.replace(/[&<>"']/g, (e) => ({- "&": "&",- "<": "<",- ">": ">",- "\"": """,- "'": "'"-})[e]);-function kt(e, t, n = "", r = "") {- if (!t) return "";- let i = `sidebar-group-${encodeURIComponent(e)}`;- return `<details class="sec${r ? " cat-" + Ot(r) : ""}" data-sidebar-group="${Ot(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${Ot(e)}</span>${n}</summary><div class="board-sidebar-body" id="${i}">${t}</div></details>`;-}-function At(e) {- e.querySelectorAll("[data-sidebar-group]").forEach((e) => {- if (e.dataset.sidebarWired) return;- e.dataset.sidebarWired = "true";- let t = e.querySelector(".board-section-toggle"), n = e.querySelector(".board-sidebar-body"), r = `peach.sidebar.group.${e.dataset.sidebarGroup}`, i = null;- try {- i = sessionStorage.getItem(r);- } catch {}- let a = !!n.querySelector("[aria-pressed=true]");- e.open = i === null ? a || e.classList.contains("cat-src") || e.dataset.sidebarGroup === "时长" : i === "open", t.querySelectorAll("button").forEach((e) => e.addEventListener("click", (e) => e.stopPropagation()));- }), y(e, "details[data-sidebar-group]", "sidebar-collapse"), e.querySelectorAll(".board-section-toggle").forEach((e) => {- e.dataset.persistWired || (e.dataset.persistWired = "true", e.addEventListener("click", () => {- let t = `peach.sidebar.group.${e.closest("[data-sidebar-group]").dataset.sidebarGroup}`;- try {- sessionStorage.setItem(t, e.getAttribute("aria-expanded") === "true" ? "open" : "closed");- } catch {}- }));- });-}-var jt = !1;-async function Mt(e, t) {- if (jt) return;- if (!document.startViewTransition || matchMedia("(prefers-reduced-motion: reduce)").matches) {- t();- return;- }- let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = Math.hypot(Math.max(r, innerWidth - r), Math.max(i, innerHeight - i)) * 2.5, o = document.createElement("style");- o.textContent = `::view-transition-old(root){animation:none}::view-transition-new(root){mix-blend-mode:normal;mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22b%22%20x%3D%22-50%25%22%20y%3D%22-50%25%22%20width%3D%22200%25%22%20height%3D%22200%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2242%22%20fill%3D%22white%22%20filter%3D%22url(%23b)%22%2F%3E%3C%2Fsvg%3E");mask-repeat:no-repeat;animation:peach-theme-reveal 820ms cubic-bezier(.16,1,.3,1) both}@keyframes peach-theme-reveal{from{mask-position:${r}px ${i}px;mask-size:0px 0px}to{mask-position:${r - a / 2}px ${i - a / 2}px;mask-size:${a}px ${a}px}}`, jt = !0, document.head.append(o);- try {- await document.startViewTransition(t).finished;- } catch {- t();- } finally {- o.remove(), jt = !1;- }-}-//#endregion-//#region src/api.ts-var Nt = class extends Error {- status;- body;- constructor(e, t, n = null) {- super(o(e, t)), this.name = "ApiError", this.status = t, this.body = n;- }-}, Pt = (e) => {- if (!e || typeof e != "object") return "";- let t = e;- for (let e of [- "message",- "detail",- "error"- ]) {- let n = t[e];- if (typeof n == "string" && n) return n;- }- return "";-}, B = (e) => o(e);-async function V(e, t) {- let n = await fetch(e, {- headers: { Accept: "application/json" },- credentials: "same-origin",- ...t ? { signal: t } : {}- }), r = null;- try {- r = await n.json();- } catch {}- if (!n.ok) throw new Nt(Pt(r) || `请求失败(${n.status})`, n.status);- return r;-}-async function H(e, t, n = "POST", r) {- let i = await fetch(e, {- method: n,- ...r ? { signal: r } : {},- headers: {- Accept: "application/json",- "Content-Type": "application/json"- },- credentials: "same-origin",- body: JSON.stringify(t)- }), a = null;- try {- a = await i.json();- } catch {}- if (!i.ok) throw new Nt(Pt(a) || `请求失败(${i.status})`, i.status, a);- return a;-}-//#endregion-//#region node_modules/preact/hooks/dist/hooks.module.js-var Ft, U, It, Lt, Rt = 0, zt = [], W = S, Bt = W.__b, Vt = W.__r, Ht = W.diffed, Ut = W.__c, Wt = W.unmount, Gt = W.__;-function Kt(e, t) {- W.__h && W.__h(U, e, Rt || t), Rt = 0;- var n = U.__H || (U.__H = {- __: [],- __h: []- });- return e >= n.__.length && n.__.push({}), n.__[e];-}-function G(e) {- return Rt = 1, qt(tn, e);-}-function qt(e, t, n) {- var r = Kt(Ft++, 2);- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : tn(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 = U, !U.__f)) {- var i = function(e, t, n) {- if (!r.__c.__H) return !0;- var i = !1, o = r.__c.props !== e;- if (r.__c.__H.__.some(function(e) {- if (e.__N) {- i = !0;- var t = e.__[0];- e.__ = e.__N, e.__N = void 0, t !== e.__[0] && (o = !0);- }- }), a) {- var s = a.call(this, e, t, n);- return i ? s || o : s;- }- return !i || o;- };- U.__f = !0;- var a = U.shouldComponentUpdate, o = U.componentWillUpdate;- U.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);- }, U.shouldComponentUpdate = i;- }- return r.__N || r.__;-}-function K(e, t) {- var n = Kt(Ft++, 3);- !W.__s && en(n.__H, t) && (n.__ = e, n.u = t, U.__H.__h.push(n));-}-function q(e, t) {- var n = Kt(Ft++, 4);- !W.__s && en(n.__H, t) && (n.__ = e, n.u = t, U.__h.push(n));-}-function J(e) {- return Rt = 5, Jt(function() {- return { current: e };- }, []);-}-function Jt(e, t) {- var n = Kt(Ft++, 7);- return en(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;-}-function Yt() {- for (var e; e = zt.shift();) {- var t = e.__H;- if (e.__P && t) try {- t.__h.some(Qt), t.__h.some($t), t.__h = [];- } catch (n) {- t.__h = [], W.__e(n, e.__v);- }- }-}-W.__b = function(e) {- U = null, Bt && Bt(e);-}, W.__ = function(e, t) {- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Gt && Gt(e, t);-}, W.__r = function(e) {- Vt && Vt(e), Ft = 0;- var t = (U = e.__c).__H;- t && (It === U ? (t.__h = [], U.__h = [], t.__.some(function(e) {- e.__N && (e.__ = e.__N), e.u = e.__N = void 0;- })) : (t.__h.some(Qt), t.__h.some($t), t.__h = [], Ft = 0)), It = U;-}, W.diffed = function(e) {- Ht && Ht(e);- var t = e.__c;- t && t.__H && (t.__H.__h.length && (zt.push(t) !== 1 && Lt === W.requestAnimationFrame || ((Lt = W.requestAnimationFrame) || Zt)(Yt)), t.__H.__.some(function(e) {- e.u &&= (e.__H = e.u, void 0);- })), It = U = null;-}, W.__c = function(e, t) {- t.some(function(e) {- try {- e.__h.some(Qt), e.__h = e.__h.filter(function(e) {- return !e.__ || $t(e);- });- } catch (n) {- t.some(function(e) {- e.__h &&= [];- }), t = [], W.__e(n, e.__v);- }- }), Ut && Ut(e, t);-}, W.unmount = function(e) {- Wt && Wt(e);- var t, n = e.__c;- n && n.__H && (n.__H.__.some(function(e) {- try {- Qt(e);- } catch (e) {- t = e;- }- }), n.__H = void 0, t && W.__e(t, n.__v));-};-var Xt = typeof requestAnimationFrame == "function";-function Zt(e) {- var t, n = function() {- clearTimeout(r), Xt && cancelAnimationFrame(t), setTimeout(e);- }, r = setTimeout(n, 35);- Xt && (t = requestAnimationFrame(n));-}-function Qt(e) {- var t = U, n = e.__c;- typeof n == "function" && (e.__c = void 0, n()), U = t;+ });}-function $t(e) {- var t = U;- e.__c = e.__(), U = t;+//#endregion+//#region src/sidebar-groups.ts+var gn = (e) => e.replace(/[&<>"']/g, (e) => ({+ "&": "&",+ "<": "<",+ ">": ">",+ "\"": """,+ "'": "'"+})[e]);+function _n(e, t, n = "", r = "") {+ if (!t) return "";+ let i = `sidebar-group-${encodeURIComponent(e)}`;+ return `<details class="sec${r ? " cat-" + gn(r) : ""}" data-sidebar-group="${gn(e)}"><summary role="button" class="board-section-toggle"><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"/></svg><span>${gn(e)}</span>${n}</summary><div class="board-sidebar-body" id="${i}">${t}</div></details>`;}-function en(e, t) {- return !e || e.length !== t.length || t.some(function(t, n) {- return t !== e[n];+function vn(e) {+ e.querySelectorAll("[data-sidebar-group]").forEach((e) => {+ if (e.dataset.sidebarWired) return;+ e.dataset.sidebarWired = "true";+ let t = e.querySelector(".board-section-toggle"), n = e.querySelector(".board-sidebar-body"), r = `peach.sidebar.group.${e.dataset.sidebarGroup}`, i = null;+ try {+ i = sessionStorage.getItem(r);+ } catch {}+ let a = !!n.querySelector("[aria-pressed=true]");+ e.open = i === null ? a || e.classList.contains("cat-src") || e.dataset.sidebarGroup === "时长" : i === "open", t.querySelectorAll("button").forEach((e) => e.addEventListener("click", (e) => e.stopPropagation()));+ }), y(e, "details[data-sidebar-group]", "sidebar-collapse"), e.querySelectorAll(".board-section-toggle").forEach((e) => {+ e.dataset.persistWired || (e.dataset.persistWired = "true", e.addEventListener("click", () => {+ let t = `peach.sidebar.group.${e.closest("[data-sidebar-group]").dataset.sidebarGroup}`;+ try {+ sessionStorage.setItem(t, e.getAttribute("aria-expanded") === "true" ? "open" : "closed");+ } catch {}+ }));});}-function tn(e, t) {- return typeof t == "function" ? t(e) : t;-}-//#endregion-//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js-var nn = 0;-Array.isArray;-function Y(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];- var l = {- type: e,- props: c,- key: n,- ref: o,- __k: null,- __: null,- __b: 0,- __e: null,- __c: null,- constructor: void 0,- __v: --nn,- __i: -1,- __u: 0,- __source: i,- __self: a- };- if (typeof e == "function" && (o = e.defaultProps)) for (s in o) c[s] === void 0 && (c[s] = o[s]);- return S.vnode && S.vnode(l), l;+var yn = !1;+async function bn(e, t) {+ if (yn) return;+ if (!document.startViewTransition || matchMedia("(prefers-reduced-motion: reduce)").matches) {+ t();+ return;+ }+ let n = e.getBoundingClientRect(), r = n.left + n.width / 2, i = n.top + n.height / 2, a = Math.hypot(Math.max(r, innerWidth - r), Math.max(i, innerHeight - i)) * 2.5, o = document.createElement("style");+ o.textContent = `::view-transition-old(root){animation:none}::view-transition-new(root){mix-blend-mode:normal;mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%20100%20100%22%3E%3Cdefs%3E%3Cfilter%20id%3D%22b%22%20x%3D%22-50%25%22%20y%3D%22-50%25%22%20width%3D%22200%25%22%20height%3D%22200%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%222%22%2F%3E%3C%2Ffilter%3E%3C%2Fdefs%3E%3Ccircle%20cx%3D%2250%22%20cy%3D%2250%22%20r%3D%2242%22%20fill%3D%22white%22%20filter%3D%22url(%23b)%22%2F%3E%3C%2Fsvg%3E");mask-repeat:no-repeat;animation:peach-theme-reveal 820ms cubic-bezier(.16,1,.3,1) both}@keyframes peach-theme-reveal{from{mask-position:${r}px ${i}px;mask-size:0px 0px}to{mask-position:${r - a / 2}px ${i - a / 2}px;mask-size:${a}px ${a}px}}`, yn = !0, document.head.append(o);+ try {+ await document.startViewTransition(t).finished;+ } catch {+ t();+ } finally {+ o.remove(), yn = !1;+ }}//#endregion//#region src/islands/access-settings.tsx-function rn({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {- return /* @__PURE__ */ Y("div", {+function xn({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {+ return /* @__PURE__ */ J("div", {class: "configfield",children: [- /* @__PURE__ */ Y("label", {+ /* @__PURE__ */ J("label", {for: e,children: t}),- /* @__PURE__ */ Y("input", {+ /* @__PURE__ */ J("input", {id: e,class: "geist-input",type: "password",@@ -1236,7 +1685,7 @@ function rn({ 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__ */ Y("p", {+ i || a ? /* @__PURE__ */ J("p", {id: `${e}-hint`,class: i ? "configbad" : "confighelp",role: i ? "alert" : void 0,@@ -1245,9 +1694,9 @@ function rn({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:]});}-function an({ initial: e, receipt: t }) {- let [n, r] = G(e), [i, a] = G(""), [o, s] = G(""), [c, l] = G(""), [u, f] = G(!1), [m, h] = G(""), [g, _] = G({}), y = J(null), b = J(!1), x = J(null);- return /* @__PURE__ */ Y("form", {+function Sn({ initial: e, receipt: t }) {+ let [n, r] = V(e), [i, a] = V(""), [o, s] = V(""), [c, l] = V(""), [u, f] = V(!1), [m, h] = V(""), [g, _] = V({}), y = W(null), b = W(!1), x = W(null);+ return /* @__PURE__ */ J("form", {class: "configfieldset","data-fieldset-type": u ? "warning" : void 0,onSubmit: async (e) => {@@ -1260,7 +1709,7 @@ function an({ initial: e, receipt: t }) {}b.current = !0, v(x.current, !0);try {- let e = await H("/api/configuration/access", {+ let e = await q("/api/configuration/access", {revision: n.revision,action: u ? "disable" : "set",confirm_disable: u,@@ -1270,8 +1719,8 @@ function an({ initial: e, receipt: t }) {});r(e), a(""), s(""), l(""), f(!1), _({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");} catch (e) {- let t = e instanceof Nt ? e.body : null, n = t?.errors || t?.detail?.errors;- n ? _(n) : h(B(e));+ let t = e instanceof ot ? e.body : null, n = t?.errors || t?.detail?.errors;+ n ? _(n) : h(G(e));} finally {b.current = !1, v(x.current, !1);}@@ -1279,34 +1728,34 @@ function an({ initial: e, receipt: t }) {"aria-labelledby": "accessTitle",noValidate: !0,ref: y,- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("accessTitle", "访问密码") } }), /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("accessTitle", "访问密码") } }), /* @__PURE__ */ J("p", {class: "confighelp",children: n.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : n.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : n.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"})]}),- n.mode === "password" || n.mode === "legacy" ? /* @__PURE__ */ Y("label", {+ n.mode === "password" || n.mode === "legacy" ? /* @__PURE__ */ J("label", {class: "configcheck",- children: [/* @__PURE__ */ Y("span", {+ children: [/* @__PURE__ */ J("span", {class: "pcheck",- children: [/* @__PURE__ */ Y("input", {+ children: [/* @__PURE__ */ J("input", {type: "checkbox",checked: u,onChange: (e) => f(e.currentTarget.checked)- }), /* @__PURE__ */ Y("span", {+ }), /* @__PURE__ */ J("span", {"aria-hidden": "true",- children: /* @__PURE__ */ Y("svg", {+ children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24",- children: /* @__PURE__ */ Y("use", { href: "#i-check" })+ children: /* @__PURE__ */ J("use", { href: "#i-check" })})})]- }), /* @__PURE__ */ Y("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]+ }), /* @__PURE__ */ J("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]}) : null,- n.mode === "password" ? /* @__PURE__ */ Y(rn, {+ n.mode === "password" ? /* @__PURE__ */ J(xn, {id: "access-current",label: "当前访问密码",value: i,@@ -1314,7 +1763,7 @@ function an({ initial: e, receipt: t }) {error: g.current_password,current: !0}) : null,- n.mode === "locked" ? null : /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y(rn, {+ n.mode === "locked" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J(xn, {id: "access-password",label: n.mode === "password" ? "新访问密码" : "设置访问密码",value: o,@@ -1322,7 +1771,7 @@ function an({ initial: e, receipt: t }) {disabled: u,error: u ? void 0 : g.password,help: u ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"- }), /* @__PURE__ */ Y(rn, {+ }), /* @__PURE__ */ J(xn, {id: "access-confirm",label: "确认访问密码",value: c,@@ -1330,19 +1779,19 @@ function an({ initial: e, receipt: t }) {disabled: u,error: u ? void 0 : g.confirmation})] }),- u && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: p("保存后,能连接到 Peach 的设备将直接访问馆藏。", {+ u && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: p("保存后,能连接到 Peach 的设备将直接访问馆藏。", {variant: "warning",label: "访问范围"}) } }),- m ? /* @__PURE__ */ Y("p", {+ m ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: m}) : null]- }), n.mode === "locked" ? null : /* @__PURE__ */ Y("div", {+ }), n.mode === "locked" ? null : /* @__PURE__ */ J("div", {class: "geist-fieldset-footer",- children: [/* @__PURE__ */ Y("p", { children: "保存后立即生效。" }), /* @__PURE__ */ Y("button", {+ children: [/* @__PURE__ */ J("p", { children: "保存后立即生效。" }), /* @__PURE__ */ J("button", {class: "geist-button primary",type: "submit",ref: x,@@ -1353,7 +1802,7 @@ function an({ initial: e, receipt: t }) {}//#endregion//#region src/islands/release-updates.tsx-var on = /* @__PURE__ */ new Set([+var Cn = /* @__PURE__ */ new Set(["downloading","verifying","extracting",@@ -1361,21 +1810,21 @@ var on = /* @__PURE__ */ new Set(["restarting","installing"]);-function sn({ initial: e, initialJob: t }) {- let [n, r] = G(e), [i, a] = G(t || {+function wn({ initial: e, initialJob: t }) {+ let [n, r] = V(e), [i, a] = V(t || {state: "idle",progress: 0- }), [o, s] = G(""), c = J(null), u = J(!0), f = J(!1), h = J(null);- K(() => {- v(h.current, on.has(i.state));- }, [i.state]), K(() => () => {+ }), [o, s] = V(""), c = W(null), u = W(!0), f = W(!1), h = W(null);+ H(() => {+ v(h.current, Cn.has(i.state));+ }, [i.state]), H(() => () => {u.current = !1, c.current?.abort();}, []);let g = async () => {- let e = await H("/api/configuration/update-restart", {});+ let e = await q("/api/configuration/update-restart", {});u.current && a(e);};- K(() => {+ H(() => {i.state !== "ready" || f.current || (f.current = !0, l({title: "更新已准备好",body: `Peach ${i.version || ""} 将在重启后安装。`,@@ -1383,11 +1832,11 @@ function sn({ initial: e, initialJob: t }) {cancelLabel: "稍后",onConfirm: g}));- }, [i.state]), K(() => {- if (!on.has(i.state)) return;+ }, [i.state]), H(() => {+ if (!Cn.has(i.state)) return;let e = new AbortController(), t, n = 0, o = async () => {try {- let t = await V("/api/configuration/update-status", e.signal);+ let t = await K("/api/configuration/update-status", e.signal);e.signal.aborted || (a(t), n = 0, t.state === "complete" && r((e) => ({...e,current_version: t.version || e.current_version,@@ -1404,14 +1853,14 @@ function sn({ initial: e, initialJob: t }) {};}, [i.state]);let _ = async (e) => {- if (c.current || on.has(i.state)) return;+ if (c.current || Cn.has(i.state)) return;let t = new AbortController();c.current = t, f.current = !1, s(""), v(e, !0);try {- let e = await H("/api/configuration/update", {}, "POST", t.signal);+ let e = await q("/api/configuration/update", {}, "POST", t.signal);t.signal.aborted || a(e);} catch (e) {- t.signal.aborted || s(B(e));+ t.signal.aborted || s(G(e));} finally {c.current = null, v(e, !1);}@@ -1420,53 +1869,53 @@ function sn({ initial: e, initialJob: t }) {let n = new AbortController();c.current = n, v(t, !0), s("");try {- let e = await V("/api/configuration/updates", n.signal);+ let e = await K("/api/configuration/updates", n.signal);n.signal.aborted || r(e);} catch (t) {n.signal.aborted || (r({...e,state: "error"- }), s(B(t)));+ }), s(G(t)));} finally {c.current = null, v(t, !1);}};- return /* @__PURE__ */ Y("section", {+ return /* @__PURE__ */ J("section", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configUpdatesTitle",- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("configUpdatesTitle", "检查更新") } }),- /* @__PURE__ */ Y("dl", {+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("configUpdatesTitle", "检查更新") } }),+ /* @__PURE__ */ J("dl", {class: "configfacts",children: [- /* @__PURE__ */ Y("dt", { children: "当前版本" }),- /* @__PURE__ */ Y("dd", { children: n.current_version }),- /* @__PURE__ */ Y("dt", { children: "安装方式" }),- /* @__PURE__ */ Y("dd", { children: n.installation }),- /* @__PURE__ */ Y("dt", { children: "更新通道" }),- /* @__PURE__ */ Y("dd", { children: n.channel }),- /* @__PURE__ */ Y("dt", { children: "最新版本" }),- /* @__PURE__ */ Y("dd", { children: n.latest_version || (n.state === "unchecked" ? "尚未检查" : "未取得") })+ /* @__PURE__ */ J("dt", { children: "当前版本" }),+ /* @__PURE__ */ J("dd", { children: n.current_version }),+ /* @__PURE__ */ J("dt", { children: "安装方式" }),+ /* @__PURE__ */ J("dd", { children: n.installation }),+ /* @__PURE__ */ J("dt", { children: "更新通道" }),+ /* @__PURE__ */ J("dd", { children: n.channel }),+ /* @__PURE__ */ J("dt", { children: "最新版本" }),+ /* @__PURE__ */ J("dd", { children: n.latest_version || (n.state === "unchecked" ? "尚未检查" : "未取得") })]}),- n.state === "available" && !o ? /* @__PURE__ */ Y("div", {+ n.state === "available" && !o ? /* @__PURE__ */ J("div", {role: "status",dangerouslySetInnerHTML: { __html: p(n.message, { label: "有可用更新" }) }- }) : /* @__PURE__ */ Y("p", {+ }) : /* @__PURE__ */ J("p", {class: o || n.state === "error" ? "configbad" : "confighelp",role: o || n.state === "error" ? "alert" : "status",children: o || n.message}),- i.state === "idle" ? null : /* @__PURE__ */ Y("div", {+ i.state === "idle" ? null : /* @__PURE__ */ J("div", {"aria-live": "polite",- children: [/* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ J("p", {class: i.state === "error" ? "configbad" : "confighelp",children: i.message- }), i.state === "error" ? null : /* @__PURE__ */ Y(I, { children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: m("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [+ }), i.state === "error" ? null : /* @__PURE__ */ J(L, { children: [+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: m("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [{value: 65,label: "下载结束"@@ -1480,34 +1929,34 @@ function sn({ initial: e, initialJob: t }) {label: "准备安装"}] }) } }),- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "confighelp",children: ["下载 → 校验 → 解压 → 准备安装 · ", i.message]}),- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "confighelp",children: i.state === "downloading" && i.total ? `${((i.downloaded || 0) / 1048576).toFixed(1)} / ${(i.total / 1048576).toFixed(1)} MB` : `${i.progress}%`})] })]})]- }), /* @__PURE__ */ Y("div", {+ }), /* @__PURE__ */ J("div", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: [- /* @__PURE__ */ Y("a", {+ /* @__PURE__ */ J("a", {class: "geist-button externallink",href: n.release_url,target: "_blank",rel: "noreferrer",- children: ["查看发布页", /* @__PURE__ */ Y("svg", {+ children: ["查看发布页", /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]}),- i.state === "ready" ? /* @__PURE__ */ Y("button", {+ i.state === "ready" ? /* @__PURE__ */ J("button", {type: "button",class: "geist-button primary",onClick: () => {@@ -1521,17 +1970,17 @@ function sn({ initial: e, initialJob: t }) {},children: "重启安装"}) : null,- n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ Y("button", {+ n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ J("button", {ref: h,type: "button",class: "geist-button primary",onClick: (e) => _(e.currentTarget),children: "下载并安装"}) : null,- /* @__PURE__ */ Y("button", {+ /* @__PURE__ */ J("button", {type: "button",class: "geist-button",- disabled: on.has(i.state),+ disabled: Cn.has(i.state),onClick: (e) => y(e.currentTarget),children: "检查更新"})@@ -1541,9 +1990,9 @@ function sn({ initial: e, initialJob: t }) {}//#endregion//#region src/islands/peach-proxy.tsx-function cn({ initial: e, receipt: t }) {- let [n, r] = G(e), [i, a] = G(e.mode), [o, s] = G(""), [c, l] = G(""), u = J(!1), f = J(null), p = J(null), m = J(new AbortController());- K(() => () => m.current.abort(), []), q(() => {+function Tn({ initial: e, receipt: t }) {+ let [n, r] = V(e), [i, a] = V(e.mode), [o, s] = V(""), [c, l] = V(""), u = W(!1), f = W(null), p = W(null), m = W(new AbortController());+ H(() => () => m.current.abort(), []), U(() => {let t = f.current;t.innerHTML = g([["environment", "系统代理"],@@ -1563,42 +2012,42 @@ function cn({ initial: e, receipt: t }) {if (!u.current) {u.current = !0, v(p.current, !0), l("");try {- let e = await H("/api/configuration/peach-proxy", {+ let e = await q("/api/configuration/peach-proxy", {mode: i,proxy: o}, "POST", m.current.signal);m.current.signal.aborted || (r(e), s(""), t("已保存 Peach 代理"));} catch (e) {- m.current.signal.aborted || l(B(e));+ m.current.signal.aborted || l(G(e));} finally {u.current = !1, v(p.current, !1);}}}- return /* @__PURE__ */ Y("form", {+ return /* @__PURE__ */ J("form", {id: "peachProxy",class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {e.preventDefault(), h();},- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ J("p", {class: "confighelp",children: "采集来源选择“Peach 代理”时共用此设置。"})]}),- /* @__PURE__ */ Y("div", { ref: f }),- i === "proxy" && /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", { ref: f }),+ i === "proxy" && /* @__PURE__ */ J("div", {class: "configfield",- children: [/* @__PURE__ */ Y("label", {+ children: [/* @__PURE__ */ J("label", {htmlFor: "peachProxyAddress",children: "代理地址"- }), /* @__PURE__ */ Y("input", {+ }), /* @__PURE__ */ J("input", {id: "peachProxyAddress",class: "geist-input",type: "password",@@ -1608,20 +2057,20 @@ function cn({ initial: e, receipt: t }) {onInput: (e) => s(e.currentTarget.value)})]}),- n.needs_selection && /* @__PURE__ */ Y("p", {+ n.needs_selection && /* @__PURE__ */ J("p", {class: "configbad",children: "已有来源的代理地址不同,请选择公共连接方式。"}),- c && /* @__PURE__ */ Y("p", {+ c && /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: c})]- }), /* @__PURE__ */ Y("footer", {+ }), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: /* @__PURE__ */ Y("button", {+ children: /* @__PURE__ */ J("button", {ref: p,class: "geist-button primary",type: "submit",@@ -1632,30 +2081,30 @@ function cn({ initial: e, receipt: t }) {}//#endregion//#region src/islands/desktop-settings.tsx-function ln({ label: e, checked: t, disabled: n, change: r }) {- return /* @__PURE__ */ Y("label", {+function En({ label: e, checked: t, disabled: n, change: r }) {+ return /* @__PURE__ */ J("label", {class: "configcheck",- children: [/* @__PURE__ */ Y("span", {+ children: [/* @__PURE__ */ J("span", {class: "pcheck",- children: [/* @__PURE__ */ Y("input", {+ children: [/* @__PURE__ */ J("input", {type: "checkbox",checked: t,disabled: n,onChange: (e) => r(e.currentTarget.checked)- }), /* @__PURE__ */ Y("span", {+ }), /* @__PURE__ */ J("span", {"aria-hidden": "true",- children: /* @__PURE__ */ Y("svg", {+ children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24",- children: /* @__PURE__ */ Y("use", { href: "#i-check" })+ children: /* @__PURE__ */ J("use", { href: "#i-check" })})})]- }), /* @__PURE__ */ Y("span", { children: e })]+ }), /* @__PURE__ */ J("span", { children: e })]});}-function un({ label: e, checked: t, disabled: n, change: r }) {- return /* @__PURE__ */ Y("label", {+function Dn({ label: e, checked: t, disabled: n, change: r }) {+ return /* @__PURE__ */ J("label", {class: "configtoggle",- children: [/* @__PURE__ */ Y("span", { children: e }), /* @__PURE__ */ Y("input", {+ children: [/* @__PURE__ */ J("span", { children: e }), /* @__PURE__ */ J("input", {class: "ptoggle",type: "checkbox",role: "switch",@@ -1665,85 +2114,85 @@ function un({ label: e, checked: t, disabled: n, change: r }) {})]});}-function dn({ startup: e, receipt: t }) {- let [n, r] = G(e.enabled), [i, a] = G(e.silent), [o, s] = G(e.desktop), [c, l] = G(""), u = J(!1), f = J(null), p = e.available && !e.desktop_message;+function On({ startup: e, receipt: t }) {+ let [n, r] = V(e.enabled), [i, a] = V(e.silent), [o, s] = V(e.desktop), [c, l] = V(""), u = W(!1), f = W(null), p = e.available && !e.desktop_message;async function m() {if (!u.current) {u.current = !0, v(f.current, !0), l("");try {- await H("/api/configuration/startup", {+ await q("/api/configuration/startup", {enabled: n,silent: i,desktop: o}), t("已保存开机自启");} catch (e) {- l(B(e));+ l(G(e));} finally {u.current = !1, v(f.current, !1);}}}- return /* @__PURE__ */ Y("form", {+ return /* @__PURE__ */ J("form", {class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {e.preventDefault(), m();},- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("startupTitle", "开机自启") } }),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("startupTitle", "开机自启") } }),+ /* @__PURE__ */ J("div", {class: "configoptions",role: "group","aria-labelledby": "startupTitle",children: [- /* @__PURE__ */ Y(un, {+ /* @__PURE__ */ J(Dn, {label: "开机后启动 Peach",checked: n,disabled: !e.available,change: r}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configoption",- children: [/* @__PURE__ */ Y(un, {+ children: [/* @__PURE__ */ J(Dn, {label: "静默启动",checked: i,disabled: !e.available || !n,change: a- }), /* @__PURE__ */ Y("p", {+ }), /* @__PURE__ */ J("p", {class: "confighelp",children: "静默启动仅显示托盘,开机后启动 Peach 打开时生效。"})]}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configoption",- children: [/* @__PURE__ */ Y(un, {+ children: [/* @__PURE__ */ J(Dn, {label: "在桌面创建快捷方式",checked: o,disabled: !p,change: s- }), /* @__PURE__ */ Y("p", {+ }), /* @__PURE__ */ J("p", {class: "confighelp",children: e.desktop_message || "双击图标打开 Peach 网页;卸载时一并移除。"})]})]}),- e.message && /* @__PURE__ */ Y("p", {+ e.message && /* @__PURE__ */ J("p", {class: "confighelp",children: e.message}),- c && /* @__PURE__ */ Y("p", {+ c && /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: c})]- }), /* @__PURE__ */ Y("footer", {+ }), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: /* @__PURE__ */ Y("button", {+ children: /* @__PURE__ */ J("button", {ref: f,type: "submit",class: "geist-button primary",@@ -1753,9 +2202,9 @@ function dn({ startup: e, receipt: t }) {})]});}-function fn({ data: e }) {- let t = J(null);- return q(() => {+function kn({ data: e }) {+ let t = W(null);+ return U(() => {let n = t.current, r = document.createElement("details");r.className = "configdirectories";let i = document.createElement("summary");@@ -1765,10 +2214,10 @@ function fn({ data: e }) {e.className = "confighelp", e.textContent = t, r.append(e);}return n.replaceChildren(r), y(n, "details", "uninstall-data"), () => n.replaceChildren();- }, [e]), /* @__PURE__ */ Y("div", { ref: t });+ }, [e]), /* @__PURE__ */ J("div", { ref: t });}-function pn({ uninstall: e }) {- let [t, n] = G(!1), [r, i] = G("");+function An({ uninstall: e }) {+ let [t, n] = V(!1), [r, i] = V("");async function a() {await l({title: "卸载 Peach",@@ -1776,7 +2225,7 @@ function pn({ uninstall: e }) {body: t ? "将退出 Peach,移除程序、开机自启、桌面图标、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序、开机自启和桌面图标。设置、本地数据库、观看记录与缓存保留。",confirmLabel: "卸载 Peach",onConfirm: async () => {- let e = await H("/api/configuration/uninstall", {+ let e = await q("/api/configuration/uninstall", {delete_data: t,confirmation: "卸载 Peach"});@@ -1784,42 +2233,42 @@ function pn({ uninstall: e }) {}});}- return /* @__PURE__ */ Y("section", {+ return /* @__PURE__ */ J("section", {id: "uninstallPeach",class: "configfieldset configdanger","data-geist-fieldset": !0,"data-fieldset-type": "error",- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ J("p", {class: "confighelp",children: "卸载会退出 Peach、移除程序、开机自启和桌面图标。原始媒体文件保留。"})]}),- /* @__PURE__ */ Y(ln, {+ /* @__PURE__ */ J(En, {label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",checked: t,disabled: !e.full_available || !!r,change: n}),- /* @__PURE__ */ Y(fn, { data: e }),- e.message && /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J(kn, { data: e }),+ e.message && /* @__PURE__ */ J("p", {class: "confighelp",children: e.message}),- r && /* @__PURE__ */ Y("p", {+ r && /* @__PURE__ */ J("p", {class: "confighelp",role: "status",children: r})]- }), /* @__PURE__ */ Y("footer", {+ }), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: /* @__PURE__ */ Y("button", {+ children: /* @__PURE__ */ J("button", {type: "button",class: "geist-button danger",disabled: !e.available || !!r,@@ -1831,7 +2280,7 @@ function pn({ uninstall: e }) {}//#endregion//#region src/islands/clouddrive-guide.tsx-var mn = [+var jn = [{name: "机械硬盘,或内存 8 GB 以内",cache: "10–20 GiB",@@ -1851,92 +2300,92 @@ var mn = [task: "2 个起步"}];-function hn() {- let e = J(null);- return q(() => {+function Mn() {+ let e = W(null);+ return U(() => {e.current && y(e.current, "details", "clouddrive-guide");- }, []), /* @__PURE__ */ Y("div", {+ }, []), /* @__PURE__ */ J("div", {ref: e,class: "cloudguide",- children: [/* @__PURE__ */ Y("p", {+ children: [/* @__PURE__ */ J("p", {class: "confighelp",- children: ["先在 CloudDrive 登录网盘并挂载,开启「启动时自动挂载」。", /* @__PURE__ */ Y("a", {+ children: ["先在 CloudDrive 登录网盘并挂载,开启「启动时自动挂载」。", /* @__PURE__ */ J("a", {class: "externallink",href: "https://www.clouddrive2.com/help.html",target: "_blank",rel: "noreferrer",- children: ["挂载帮助", /* @__PURE__ */ Y("svg", {+ children: ["挂载帮助", /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]})]- }), /* @__PURE__ */ Y("details", { children: [- /* @__PURE__ */ Y("summary", { children: [/* @__PURE__ */ Y("svg", {+ }), /* @__PURE__ */ J("details", { children: [+ /* @__PURE__ */ J("summary", { children: [/* @__PURE__ */ J("svg", {viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-chevron-right" })+ children: /* @__PURE__ */ J("use", { href: "#i-chevron-right" })}), "CloudDrive 速度与缓存建议"] }),- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "confighelp",children: "看缓存放在哪块硬盘上,照那一行填。表里是起步值,先保证播放不卡,再拿同一个视频比较打开速度、拖动和流量;填得越大不一定越快。"}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "cloudguide-tablewrap",- children: /* @__PURE__ */ Y("table", {+ children: /* @__PURE__ */ J("table", {class: "cloudguide-table",- children: [/* @__PURE__ */ Y("thead", { children: /* @__PURE__ */ Y("tr", { children: [- /* @__PURE__ */ Y("th", {+ children: [/* @__PURE__ */ J("thead", { children: /* @__PURE__ */ J("tr", { children: [+ /* @__PURE__ */ J("th", {scope: "col",children: "缓存所在硬盘"}),- /* @__PURE__ */ Y("th", {+ /* @__PURE__ */ J("th", {scope: "col",children: "缓存上限"}),- /* @__PURE__ */ Y("th", {+ /* @__PURE__ */ J("th", {scope: "col",children: "读取长度(默认 / 最小)"}),- /* @__PURE__ */ Y("th", {+ /* @__PURE__ */ J("th", {scope: "col",children: "同时处理视频"})- ] }) }), /* @__PURE__ */ Y("tbody", { children: mn.map((e) => /* @__PURE__ */ Y("tr", { children: [- /* @__PURE__ */ Y("th", {+ ] }) }), /* @__PURE__ */ J("tbody", { children: jn.map((e) => /* @__PURE__ */ J("tr", { children: [+ /* @__PURE__ */ J("th", {scope: "row",children: e.name}),- /* @__PURE__ */ Y("td", { children: e.cache }),- /* @__PURE__ */ Y("td", { children: e.read }),- /* @__PURE__ */ Y("td", { children: e.task })+ /* @__PURE__ */ J("td", { children: e.cache }),+ /* @__PURE__ */ J("td", { children: e.read }),+ /* @__PURE__ */ J("td", { children: e.task })] }, e.name)) })]})}),- /* @__PURE__ */ Y("ul", {+ /* @__PURE__ */ J("ul", {class: "cloudguide-notes",children: [- /* @__PURE__ */ Y("li", { children: "缓存上限和清理方式填在 CloudDrive「设置」里,清理方式选 LRU。上限不要填 0,系统盘至少留 40 GiB。" }),- /* @__PURE__ */ Y("li", { children: "读取长度和下载线程填在每个网盘各自的下载设置里,线程都从 2 开始。看高码率视频还是缓冲就试 512 / 256 KB,打开速度、拖动和流量都没改善就调回去。" }),- /* @__PURE__ */ Y("li", { children: "Buffer Cache 占内存,磁盘缓存和文件夹缓存占硬盘,三处是分开的设置,改一个管不住另外两个。" }),- /* @__PURE__ */ Y("li", { children: "填完重新打开 CloudDrive 的设置页确认存住了,再看硬盘实际少了多少。播放期间先暂停批量抽帧、关掉不用的播放页。" })+ /* @__PURE__ */ J("li", { children: "缓存上限和清理方式填在 CloudDrive「设置」里,清理方式选 LRU。上限不要填 0,系统盘至少留 40 GiB。" }),+ /* @__PURE__ */ J("li", { children: "读取长度和下载线程填在每个网盘各自的下载设置里,线程都从 2 开始。看高码率视频还是缓冲就试 512 / 256 KB,打开速度、拖动和流量都没改善就调回去。" }),+ /* @__PURE__ */ J("li", { children: "Buffer Cache 占内存,磁盘缓存和文件夹缓存占硬盘,三处是分开的设置,改一个管不住另外两个。" }),+ /* @__PURE__ */ J("li", { children: "填完重新打开 CloudDrive 的设置页确认存住了,再看硬盘实际少了多少。播放期间先暂停批量抽帧、关掉不用的播放页。" })]}),- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "confighelp",children: ["三处缓存分别管什么、码率和速度怎么换算、线程上限与直链代理怎么取舍,以及这些起步值的来源,都在",- /* @__PURE__ */ Y("a", {+ /* @__PURE__ */ J("a", {class: "externallink",href: "https://github.com/longmeidao/peach/blob/master/docs/CLOUDDRIVE.md",target: "_blank",rel: "noreferrer",- children: ["CloudDrive 配置与调优", /* @__PURE__ */ Y("svg", {+ children: ["CloudDrive 配置与调优", /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]}),"。"@@ -1946,32 +2395,128 @@ function hn() {});}//#endregion+//#region src/library-icon-picker.tsx+var Nn = [+ ["", "自动识别"],+ ["hard-drive", "磁盘"],+ ["database", "资料库"],+ ["heart", "心动"],+ ["heart-hand", "亲密"],+ ["flame", "热情"],+ ["cherry", "樱桃"],+ ["gem", "精选"],+ ["crown", "女王"],+ ["shirt", "制服"],+ ["footprints", "足迹"],+ ["flower", "花朵"],+ ["venetian-mask", "角色扮演"],+ ["hand", "手部"],+ ["bed-double", "卧室"],+ ["moon", "夜色"],+ ["sparkles", "幻想"],+ ["camera", "写真"],+ ["video", "影片"],+ ["star", "收藏"],+ ["tags", "主题"]+];+function Pn({ value: e, label: t, onChange: n }) {+ let [r, i] = V(e), a = W(null), o = W(null), s = (e) => /* @__PURE__ */ J("span", {+ "aria-hidden": "true",+ dangerouslySetInnerHTML: { __html: _(e || "database") }+ });+ return /* @__PURE__ */ J("div", {+ class: "board-icon-picker",+ children: [/* @__PURE__ */ J("button", {+ ref: o,+ type: "button",+ class: "geist-button board-icon-trigger",+ "aria-label": t,+ "aria-haspopup": "dialog",+ onClick: () => {+ i(e);+ let t = a.current, n = o.current.getBoundingClientRect();+ t.showModal();+ let r = t.getBoundingClientRect();+ t.style.left = `${Math.max(8, Math.min(innerWidth - r.width - 8, n.left))}px`, t.style.top = `${n.bottom + r.height + 8 <= innerHeight ? n.bottom + 4 : Math.max(8, n.top - r.height - 4)}px`;+ },+ children: [s(e), /* @__PURE__ */ J("span", { children: Nn.find(([t]) => t === e)?.[1] || "自动识别" })]+ }), /* @__PURE__ */ J("dialog", {+ ref: a,+ class: "board-icon-popover",+ "aria-label": `${t}候选`,+ onCancel: () => i(e),+ onClick: (t) => {+ t.target === a.current && (a.current?.close(), i(e));+ },+ children: [/* @__PURE__ */ J("div", {+ class: "board-icon-panel",+ children: [/* @__PURE__ */ J("h3", { children: "选择媒体库图标" }), /* @__PURE__ */ J("div", {+ role: "radiogroup",+ "aria-label": "候选图标",+ class: "board-icon-grid",+ children: Nn.map(([e, n]) => /* @__PURE__ */ J("label", {+ title: n,+ class: r === e ? "selected" : "",+ children: [+ /* @__PURE__ */ J("input", {+ type: "radio",+ name: `${t}-icon`,+ "aria-label": n,+ value: e,+ checked: r === e,+ onChange: () => i(e)+ }),+ s(e),+ /* @__PURE__ */ J("small", { children: n })+ ]+ }))+ })]+ }), /* @__PURE__ */ J("footer", { children: [/* @__PURE__ */ J("button", {+ type: "button",+ class: "geist-button",+ onClick: () => {+ i(e), a.current.close();+ },+ children: "取消"+ }), /* @__PURE__ */ J("button", {+ type: "button",+ class: "geist-button primary",+ disabled: r === e,+ onClick: () => {+ n(r), a.current.close();+ },+ children: "应用"+ })] })]+ })]+ });+}+//#endregion//#region src/islands/configuration.tsx-var gn = "/api/configuration", _n = "/api/pick-folder", vn = 8e3, yn = (e, t) => V(gn, t), bn = ({ html: e, class: t }) => /* @__PURE__ */ Y("div", {+var Fn = "/api/configuration", In = "/api/pick-folder", Ln = 8e3, Rn = (e, t) => K(Fn, t), zn = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {class: t,dangerouslySetInnerHTML: { __html: e }-}), xn = (e) => !(e instanceof Nt) || e.status !== 400 ? null : e.body?.errors ?? null;-function Sn({ facts: e }) {- return /* @__PURE__ */ Y("section", {+}), Bn = (e) => !(e instanceof ot) || e.status !== 400 ? null : e.body?.errors ?? null;+function Vn({ facts: e }) {+ return /* @__PURE__ */ J("section", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configFactsTitle",- children: /* @__PURE__ */ Y("div", {+ children: /* @__PURE__ */ J("div", {class: "geist-fieldset-content",- children: [/* @__PURE__ */ Y(bn, { html: d("configFactsTitle", "运行信息") }), /* @__PURE__ */ Y("dl", {+ children: [/* @__PURE__ */ J(zn, { html: d("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {class: "configfacts",- children: e.map((e) => /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("dt", { children: e.term }), /* @__PURE__ */ Y("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ Y("span", {+ children: e.map((e) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: e.term }), /* @__PURE__ */ J("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ J("span", {class: "confighelp",- children: [" ", /* @__PURE__ */ Y("a", {+ children: [" ", /* @__PURE__ */ J("a", {class: "externallink",href: e.download_url,target: "_blank",rel: "noreferrer",- children: [e.download_label, /* @__PURE__ */ Y("svg", {+ children: [e.download_label, /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]})]}) : null] })] }))@@ -1979,57 +2524,57 @@ function Sn({ facts: e }) {})});}-function Cn({ data: e }) {- let [t, n] = G(e.media_sources), [r, i] = G(""), a = J(null);- K(() => () => a.current?.abort(), []);+function Hn({ data: e }) {+ let [t, n] = V(e.media_sources), [r, i] = V(""), a = W(null);+ H(() => () => a.current?.abort(), []);let o = async (e) => {if (a.current) return;let t = new AbortController();a.current = t, v(e, !0), i("");try {- let e = await V(gn, t.signal);+ let e = await K(Fn, t.signal);t.signal.aborted || n(e.media_sources);} catch (e) {- t.signal.aborted || i(B(e));+ t.signal.aborted || i(G(e));} finally {a.current = null, v(e, !1);}};- return t ? /* @__PURE__ */ Y("section", {+ return t ? /* @__PURE__ */ J("section", {class: "configfieldset","aria-labelledby": "configMountsTitle",- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y(bn, { html: d("configMountsTitle", "挂载状态") }),- /* @__PURE__ */ Y("dl", {+ /* @__PURE__ */ J(zn, { html: d("configMountsTitle", "挂载状态") }),+ /* @__PURE__ */ J("dl", {class: "configfacts",- children: t.map((e) => /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("dt", { children: [/* @__PURE__ */ Y("span", {+ children: t.map((e) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {"aria-hidden": "true",dangerouslySetInnerHTML: { __html: _(s[e.location]) }}), {local: "本地磁盘",115: "CloudDrive · 115",pikpak: "CloudDrive · PikPak"- }[e.location] || e.location] }), /* @__PURE__ */ Y("dd", { children: [+ }[e.location] || e.location] }), /* @__PURE__ */ J("dd", { children: [e.path || "未配置挂载点"," ",- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {class: `configstatus ${e.online === !0 ? "online" : e.online === !1 ? "offline" : "unknown"}`,children: e.online === !0 ? "在线" : e.online === !1 ? "离线" : "未检测"})] })] }))}),- r ? /* @__PURE__ */ Y("p", {+ r ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: r}) : null]- }), /* @__PURE__ */ Y("div", {+ }), /* @__PURE__ */ J("div", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: /* @__PURE__ */ Y("button", {+ children: /* @__PURE__ */ J("button", {type: "button",class: "geist-button",onClick: (e) => o(e.currentTarget),@@ -2038,99 +2583,90 @@ function Cn({ data: e }) {})]}) : null;}-function wn({ value: e, label: t, onChange: n, libraryIcon: r = !1 }) {- let i = J(null), a = J(null), o = J(n);- return o.current = n, q(() => {- let n = i.current;- n.innerHTML = g((r ? [- ["", "自动识别"],- ["hard-drive", "磁盘"],- ["database", "资料库"],- ["heart", "心形"],- ["star", "星标"],- ["tags", "标签"],- ["115", "115"],- ["pikpak", "PikPak"]- ] : [+function Un({ value: e, label: t, onChange: n }) {+ let r = W(null), i = W(null), a = W(n);+ return a.current = n, U(() => {+ let n = r.current;+ n.innerHTML = g([["local", "本地磁盘"],["115", "CloudDrive · 115"],["pikpak", "CloudDrive · PikPak"]- ]).map(([e, t]) => [+ ].map(([e, t]) => [e,t,s[e] || e || "database"]), e, { label: t });- let c = b(n.firstElementChild);- a.current = c;- let l = () => o.current(c.value);- return c.addEventListener("change", l), () => {- a.current = null, c.disabled = !0, c.removeEventListener("change", l), n.replaceChildren();+ let o = b(n.firstElementChild);+ i.current = o;+ let c = () => a.current(o.value);+ return o.addEventListener("change", c), () => {+ i.current = null, o.disabled = !0, o.removeEventListener("change", c), n.replaceChildren();};- }, [t, r]), q(() => {- a.current && (a.current.value = e);- }, [e]), /* @__PURE__ */ Y("div", {- ref: i,+ }, [t]), U(() => {+ i.current && (i.current.value = e);+ }, [e]), /* @__PURE__ */ J("div", {+ ref: r,class: "configsourcecontrol"});}-function Tn({ data: e, receipt: t }) {+function Wn({ data: e, receipt: t }) {let n = e.media_sources?.filter((e) => ["local","115","pikpak"- ].includes(e.location)), [r, i] = G(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = G(n?.map((e) => e.location) ?? []), [s, c] = G(n?.map((e) => e.root) ?? []), [l, u] = G(n?.map((e) => e.library || "") ?? []), [f, m] = G(n?.map((e) => e.library_icon || "") ?? []), [h, g] = G(String(e.port)), [_, y] = G(!1), [b, x] = G([]), [S, C] = G(""), [w, T] = G(""), [E, D] = G(null), [O, k] = G(null), A = J(!1), j = J(e.revision), ee = J([]), M = J(null);- q(() => {+ ].includes(e.location)), [r, i] = V(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = V(n?.map((e) => e.location) ?? []), [s, c] = V(n?.map((e) => e.root) ?? []), [l, u] = V(n?.map((e) => e.library || "") ?? []), [f, m] = V(n?.map((e) => e.library_icon || "") ?? []), [h, g] = V(String(e.port)), [_, y] = V(!1), [b, x] = V([]), [S, C] = V(""), [w, T] = V(""), [E, D] = V(null), [O, k] = V(null), A = W(!1), j = W(e.revision), ee = W([]), M = W(null);+ U(() => {O !== null && (ee.current[O]?.focus(), k(null));- }, [O]), K(() => {+ }, [O]), H(() => {if (!E) return;- let e = setTimeout(() => location.assign(E.url), vn);+ let e = setTimeout(() => location.assign(E.url), Ln);return () => clearTimeout(e);}, [E]);let N = (e, t) => {i((n) => n.map((n, r) => r === e ? t : n));}, P = () => {k(r.length), i((e) => [...e, ""]);- }, te = (e) => {+ }, F = (e) => {o((t) => t.filter((t, n) => n !== e)), c((t) => t.filter((t, n) => n !== e)), u((t) => t.filter((t, n) => n !== e)), m((t) => t.filter((t, n) => n !== e)), i((t) => t.filter((t, n) => n !== e)), x((t) => t.filter((t, n) => n !== e));- }, ne = (e, t) => {+ }, te = (e, t) => {x((n) => {let r = [...n];for (; r.length <= e;) r.push("");return r[e] = t, r;});- }, re = async (e, t) => {+ }, ne = async (e, t) => {if (t.getAttribute("aria-busy") !== "true") {v(t, !0);try {- let { path: t } = await H(_n, { initial: r[e] ?? "" });- t && (N(e, t), ne(e, ""));+ let { path: t } = await q(In, { initial: r[e] ?? "" });+ t && (N(e, t), te(e, ""));} catch (t) {- ne(e, B(t));+ te(e, G(t));} finally {v(t, !1);}}};- return E ? /* @__PURE__ */ Y("div", {+ return E ? /* @__PURE__ */ J("div", {class: "configsaved",role: "status",- children: /* @__PURE__ */ Y("div", {+ children: /* @__PURE__ */ J("div", {class: "geist-note geist-note-success",role: "note",- children: [/* @__PURE__ */ Y("svg", {+ children: [/* @__PURE__ */ J("svg", {"aria-hidden": "true",viewBox: "0 0 24 24",- children: /* @__PURE__ */ Y("use", { href: "#i-check" })- }), /* @__PURE__ */ Y("p", { children: /* @__PURE__ */ Y("span", { children: [+ children: /* @__PURE__ */ J("use", { href: "#i-check" })+ }), /* @__PURE__ */ J("p", { children: /* @__PURE__ */ J("span", { children: ["配置已保存,Peach 正在重新启动。稍后自动跳转,或点击",- /* @__PURE__ */ Y("a", {+ /* @__PURE__ */ J("a", {href: E.url,children: "进入馆藏"}),"。"] }) })]})- }) : /* @__PURE__ */ Y("form", {+ }) : /* @__PURE__ */ J("form", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configTitle",@@ -2138,7 +2674,7 @@ function Tn({ data: e, receipt: t }) {if (n.preventDefault(), !A.current) {A.current = !0, v(M.current, !0), T("");try {- let n = await H(gn, {+ let n = await q(Fn, {revision: j.current,media_dirs: r,...e.media_sources ? { media_sources: r.map((e, t) => ({@@ -2153,38 +2689,38 @@ function Tn({ data: e, receipt: t }) {});j.current = n.revision, x([]), C(""), t("已保存配置"), D(n);} catch (e) {- let t = xn(e);- t ? (x(t.media_dirs ?? []), C(t.port ?? "")) : (x([]), C(""), T(B(e)));+ let t = Bn(e);+ t ? (x(t.media_dirs ?? []), C(t.port ?? "")) : (x([]), C(""), T(G(e)));} finally {A.current = !1, v(M.current, !1);}}},noValidate: !0,- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ Y(bn, { html: d("configTitle", "这台电脑") }),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J(zn, { html: d("configTitle", "这台电脑") }),+ /* @__PURE__ */ J("div", {class: "configfield",children: [- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {class: "configlabel",id: "configDirsLabel",children: "媒体文件夹"}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configdirs",role: "group","aria-labelledby": "configDirsLabel",- children: r.map((t, n) => /* @__PURE__ */ Y("div", {+ children: r.map((t, n) => /* @__PURE__ */ J("div", {class: "configdir",children: [- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {class: "configpathlabel",children: ["本机文件夹 ", n + 1]}),- /* @__PURE__ */ Y("input", {+ /* @__PURE__ */ J("input", {class: "geist-input",type: "text",value: t,@@ -2195,32 +2731,32 @@ function Tn({ data: e, receipt: t }) {ee.current[n] = e;}}),- /* @__PURE__ */ Y("button", {+ /* @__PURE__ */ J("button", {type: "button",class: "geist-button configpick","aria-label": "选择文件夹",- onClick: (e) => re(n, e.currentTarget),- children: /* @__PURE__ */ Y("svg", {+ onClick: (e) => ne(n, e.currentTarget),+ children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-folder-search" })+ children: /* @__PURE__ */ J("use", { href: "#i-folder-search" })})}),- r.length > 1 ? /* @__PURE__ */ Y("button", {+ r.length > 1 ? /* @__PURE__ */ J("button", {type: "button",class: "geist-button configrm danger","aria-label": "移除这个文件夹",- onClick: () => te(n),- children: /* @__PURE__ */ Y("svg", {+ onClick: () => F(n),+ children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-x" })+ children: /* @__PURE__ */ J("use", { href: "#i-x" })})}) : null,- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configsource",children: [- /* @__PURE__ */ Y("label", { children: ["媒体库", /* @__PURE__ */ Y("input", {+ /* @__PURE__ */ J("label", { children: ["媒体库名称", /* @__PURE__ */ J("input", {class: "geist-input","aria-label": `媒体库 ${n + 1}`,maxLength: 80,@@ -2231,10 +2767,9 @@ function Tn({ data: e, receipt: t }) {t[n] = e.currentTarget.value, u(t);}})] }),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configsourcelabel",- children: ["媒体库图标", /* @__PURE__ */ Y(wn, {- libraryIcon: !0,+ children: ["媒体库图标", /* @__PURE__ */ J(Pn, {label: `媒体库图标 ${n + 1}`,value: f[n] || "",onChange: (e) => {@@ -2243,9 +2778,9 @@ function Tn({ data: e, receipt: t }) {}})]}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "configsourcelabel",- children: ["媒体来源", /* @__PURE__ */ Y(wn, {+ children: ["媒体来源", /* @__PURE__ */ J(Un, {label: `媒体来源 ${n + 1}`,value: a[n] || "local",onChange: (e) => {@@ -2254,7 +2789,7 @@ function Tn({ data: e, receipt: t }) {}})]}),- e.windows === !1 ? /* @__PURE__ */ Y("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ Y("input", {+ e.windows === !1 ? /* @__PURE__ */ J("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ J("input", {class: "geist-input","aria-label": `Windows 中的对应路径 ${n + 1}`,value: s[n] || "",@@ -2266,7 +2801,7 @@ function Tn({ data: e, receipt: t }) {})] }) : null]}),- b[n] ? /* @__PURE__ */ Y("p", {+ b[n] ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: b[n]@@ -2274,20 +2809,20 @@ function Tn({ data: e, receipt: t }) {]}, n))}),- /* @__PURE__ */ Y("button", {+ /* @__PURE__ */ J("button", {type: "button",class: "geist-button configadd",onClick: P,children: "添加文件夹"}),- a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ Y(hn, {}) : null,- a.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ Y("p", {+ a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J(Mn, {}) : null,+ a.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ J("p", {class: "confighelp",children: ["未检测到 ",e.name,"。",- /* @__PURE__ */ Y("a", {+ /* @__PURE__ */ J("a", {class: "externallink",href: e.download_url,target: "_blank",@@ -2295,30 +2830,30 @@ function Tn({ data: e, receipt: t }) {children: ["下载 ",e.name,- /* @__PURE__ */ Y("svg", {+ /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]})]})) : null,- e.windows === !1 ? /* @__PURE__ */ Y("p", {+ e.windows === !1 ? /* @__PURE__ */ J("p", {class: "confighelp",children: "本机文件夹是这台电脑读取媒体的位置。Windows 中的对应路径用于匹配馆藏中已有的路径,例如 B:\\ 对应本机挂载文件夹。"}) : null]}),- e.port_editable === !1 ? null : /* @__PURE__ */ Y("div", {+ e.port_editable === !1 ? null : /* @__PURE__ */ J("div", {class: "configfield",children: [- /* @__PURE__ */ Y("label", {+ /* @__PURE__ */ J("label", {for: "configPort",children: "本机访问端口"}),- /* @__PURE__ */ Y("input", {+ /* @__PURE__ */ J("input", {id: "configPort",class: "geist-input",type: "text",@@ -2327,43 +2862,43 @@ function Tn({ data: e, receipt: t }) {"aria-invalid": S ? "true" : void 0,onInput: (e) => g(e.currentTarget.value)}),- S ? /* @__PURE__ */ Y("p", {+ S ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",children: S}) : null,- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "confighelp",children: "浏览器地址里冒号后面的数字,一般不用改。"})]}),- /* @__PURE__ */ Y("label", {+ /* @__PURE__ */ J("label", {class: "configcheck",- children: [/* @__PURE__ */ Y("span", {+ children: [/* @__PURE__ */ J("span", {class: "pcheck",- children: [/* @__PURE__ */ Y("input", {+ children: [/* @__PURE__ */ J("input", {type: "checkbox",checked: _,onChange: (e) => y(e.currentTarget.checked)- }), /* @__PURE__ */ Y("span", {+ }), /* @__PURE__ */ J("span", {"aria-hidden": "true",- children: /* @__PURE__ */ Y("svg", {+ children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24",- children: /* @__PURE__ */ Y("use", { href: "#i-check" })+ children: /* @__PURE__ */ J("use", { href: "#i-check" })})})]- }), /* @__PURE__ */ Y("span", { children: "保存后扫描并补全资料" })]+ }), /* @__PURE__ */ J("span", { children: "保存后扫描并补全资料" })]}),- w ? /* @__PURE__ */ Y(bn, { html: p(w, {+ w ? /* @__PURE__ */ J(zn, { html: p(w, {variant: "error",label: "没有保存"}) }) : null]- }), /* @__PURE__ */ Y("div", {+ }), /* @__PURE__ */ J("div", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,- children: [/* @__PURE__ */ Y("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ Y("button", {+ children: [/* @__PURE__ */ J("p", { children: e.port_editable === !1 ? "保存后 Peach 会重新载入配置。" : "保存后 Peach 会重新启动,端口改了就用新地址打开。" }), /* @__PURE__ */ J("button", {type: "submit",class: "geist-button primary",ref: M,@@ -2372,80 +2907,80 @@ function Tn({ data: e, receipt: t }) {})]});}-function En({ receipt: e, data: t, error: n }) {- return n || !t ? /* @__PURE__ */ Y(bn, {+function Gn({ receipt: e, data: t, error: n }) {+ return n || !t ? /* @__PURE__ */ J(zn, {class: "configpage",html: p(n || "没有读到配置", {variant: "error",label: "打不开配置"})- }) : /* @__PURE__ */ Y("div", {+ }) : /* @__PURE__ */ J("div", {class: "configpage",children: [- t.startup ? /* @__PURE__ */ Y("h2", {+ t.startup ? /* @__PURE__ */ J("h2", {class: "configgroup",children: "通用"}) : null,- t.startup ? /* @__PURE__ */ Y(dn, {+ t.startup ? /* @__PURE__ */ J(On, {startup: t.startup,receipt: e}) : null,- /* @__PURE__ */ Y("h2", {+ /* @__PURE__ */ J("h2", {class: "configgroup",children: "媒体"}),- t.editable ? /* @__PURE__ */ Y(Tn, {+ t.editable ? /* @__PURE__ */ J(Wn, {data: t,receipt: e- }) : /* @__PURE__ */ Y(bn, { html: p(t.notice, {+ }) : /* @__PURE__ */ J(zn, { html: p(t.notice, {variant: "secondary",label: "只读"}) }),- /* @__PURE__ */ Y(Cn, { data: t }),- t.peach_proxy || t.access ? /* @__PURE__ */ Y("h2", {+ /* @__PURE__ */ J(Hn, { data: t }),+ t.peach_proxy || t.access ? /* @__PURE__ */ J("h2", {class: "configgroup",children: "网络与访问"}) : null,- t.peach_proxy ? /* @__PURE__ */ Y(cn, {+ t.peach_proxy ? /* @__PURE__ */ J(Tn, {initial: t.peach_proxy,receipt: e}) : null,- t.access ? /* @__PURE__ */ Y(an, {+ t.access ? /* @__PURE__ */ J(Sn, {initial: t.access,receipt: e}) : null,- /* @__PURE__ */ Y("h2", {+ /* @__PURE__ */ J("h2", {class: "configgroup",children: "更新与维护"}),- t.updates ? /* @__PURE__ */ Y(sn, {+ t.updates ? /* @__PURE__ */ J(wn, {initial: t.updates,initialJob: t.update_job}) : null,- /* @__PURE__ */ Y(Sn, { facts: t.facts }),- t.uninstall ? /* @__PURE__ */ Y(pn, { uninstall: t.uninstall }) : null+ /* @__PURE__ */ J(Vn, { facts: t.facts }),+ t.uninstall ? /* @__PURE__ */ J(An, { uninstall: t.uninstall }) : null]});}//#endregion//#region node_modules/@preact/signals-core/dist/signals-core.module.js-var Dn = Symbol.for("preact-signals");-function On() {+var Kn = Symbol.for("preact-signals");+function qn() {if (Z > 1) Z--;else {var e, t = !1;for ((function() {- var e = In;- for (In = void 0; e !== void 0;) {+ var e = tr;+ for (tr = 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;}- })(); Mn !== void 0;) {- var n = Mn;- for (Mn = void 0, Nn++; n !== void 0;) {+ })(); Zn !== void 0;) {+ var n = Zn;+ for (Zn = void 0, Qn++; n !== void 0;) {var r = n.u;- if (n.u = void 0, n.f &= -3, !(8 & n.f) && Bn(n)) try {+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && ar(n)) try {n.c();} catch (n) {t ||= (e = n, !0);@@ -2453,30 +2988,30 @@ function On() {n = r;}}- if (Nn = 0, Z--, t) throw e;+ if (Qn = 0, Z--, t) throw e;}}-function kn(e) {+function Jn(e) {if (Z > 0) return e();- Fn = ++Pn, Z++;+ er = ++$n, Z++;try {return e();} finally {- On();+ qn();}}-var An, X = void 0;-function jn(e) {- var t = X, n = An;- X = void 0, An = void 0;+var Yn, X = void 0;+function Xn(e) {+ var t = X, n = Yn;+ X = void 0, Yn = void 0;try {return e();} finally {- X = t, An = n;+ X = t, Yn = n;}}-var Mn = void 0, Z = 0, Nn = 0, Pn = 0, Fn = 0, In = void 0, Ln = 0;-function Rn(e) {+var Zn = void 0, Z = 0, Qn = 0, $n = 0, er = 0, tr = void 0, nr = 0;+function rr(e) {if (X !== void 0) {var t = e.n;if (t === void 0 || t.t !== X) return t = {@@ -2495,11 +3030,11 @@ function Rn(e) {function Q(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;}-Q.prototype.brand = Dn, Q.prototype.h = function() {+Q.prototype.brand = Kn, Q.prototype.h = function() {return !0;}, Q.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 ? jn(function() {+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? Xn(function() {var e;(e = t.W) == null || e.call(t);}) : n.e = e);@@ -2507,16 +3042,16 @@ Q.prototype.brand = Dn, Q.prototype.h = function() {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 && jn(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 && Xn(function() {var e;(e = t.Z) == null || e.call(t);}));}}, Q.prototype.subscribe = function(e) {var t = this;- return Yn(function() {+ return mr(function() {var n = t.value;- jn(function() {+ Xn(function() {return e(n);});}, { name: "sub" });@@ -2528,41 +3063,41 @@ Q.prototype.brand = Dn, Q.prototype.h = function() {return this.value;}, Q.prototype.peek = function() {var e = this;- return jn(function() {+ return Xn(function() {return e.value;});}, Object.defineProperty(Q.prototype, "value", {get: function() {- var e = Rn(this);+ var e = rr(this);return e !== void 0 && (e.i = this.i), this.v;},set: function(e) {if (e !== this.v) {- if (Nn > 100) throw Error("Cycle detected");+ if (Qn > 100) throw Error("Cycle detected");(function(e) {- Z !== 0 && Nn === 0 && e.l !== Fn && (e.l = Fn, In = {+ Z !== 0 && Qn === 0 && e.l !== er && (e.l = er, tr = {S: e,v: e.v,i: e.i,- o: In+ o: tr});- })(this), this.v = e, this.i++, Ln++, Z++;+ })(this), this.v = e, this.i++, nr++, Z++;try {for (var t = this.t; t !== void 0; t = t.x) t.t.N();} finally {- On();+ qn();}}}});-function zn(e, t) {+function ir(e, t) {return new Q(e, t);}-function Bn(e) {+function ar(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 Vn(e) {+function or(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) {@@ -2571,55 +3106,55 @@ function Vn(e) {}}}-function Hn(e) {+function sr(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 Un(e, t) {- Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Ln - 1, this.f = 4;+function cr(e, t) {+ Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = nr - 1, this.f = 4;}-Un.prototype = new Q(), Un.prototype.h = function() {+cr.prototype = new Q(), cr.prototype.h = function() {if (this.f &= -3, 1 & this.f) return !1;- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Ln)) return !0;- if (this.g = Ln, this.f |= 1, this.i > 0 && !Bn(this)) return this.f &= -2, !0;+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === nr)) return !0;+ if (this.g = nr, this.f |= 1, this.i > 0 && !ar(this)) return this.f &= -2, !0;var e = X;try {- Vn(this), X = this;+ or(this), X = 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 X = e, Hn(this), this.f &= -2, !0;-}, Un.prototype.S = function(e) {+ return X = e, sr(this), this.f &= -2, !0;+}, cr.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);}Q.prototype.S.call(this, e);-}, Un.prototype.U = function(e) {+}, cr.prototype.U = function(e) {if (this.t !== void 0 && (Q.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);}-}, Un.prototype.N = function() {+}, cr.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(Un.prototype, "value", { get: function() {+}, Object.defineProperty(cr.prototype, "value", { get: function() {if (1 & this.f) throw Error("Cycle detected");- var e = Rn(this);+ var e = rr(this);if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;return this.v;} });-function Wn(e, t) {- return new Un(e, t);+function lr(e, t) {+ return new cr(e, t);}-function Gn(e) {+function ur(e) {var t = e.m;if (e.m = void 0, typeof t == "function") {Z++;@@ -2628,24 +3163,24 @@ function Gn(e) {try {t();} catch (t) {- throw e.f &= -2, e.f |= 8, Kn(e), t;+ throw e.f &= -2, e.f |= 8, dr(e), t;} finally {- X = n, On();+ X = n, qn();}}}-function Kn(e) {+function dr(e) {for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);- e.x = void 0, e.s = void 0, Gn(e);+ e.x = void 0, e.s = void 0, ur(e);}-function qn(e) {+function fr(e) {if (X !== this) throw Error("Out-of-order effect");- Hn(this), X = e, this.f &= -2, 8 & this.f && Kn(this), On();+ sr(this), X = e, this.f &= -2, 8 & this.f && dr(this), qn();}-function Jn(e, t) {- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, An && An.push(this);+function pr(e, t) {+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, Yn && Yn.push(this);}-Jn.prototype.c = function() {+pr.prototype.c = function() {var e = this.S();try {if (8 & this.f || this.x === void 0) return;@@ -2654,20 +3189,20 @@ Jn.prototype.c = function() {} finally {e();}-}, Jn.prototype.S = function() {+}, pr.prototype.S = function() {if (1 & this.f) throw Error("Cycle detected");- this.f |= 1, this.f &= -9, Gn(this), Vn(this), Z++;+ this.f |= 1, this.f &= -9, ur(this), or(this), Z++;var e = X;- return X = this, qn.bind(this, e);-}, Jn.prototype.N = function() {- 2 & this.f || (this.f |= 2, this.u = Mn, Mn = this);-}, Jn.prototype.d = function() {- this.f |= 8, 1 & this.f || Kn(this);-}, Jn.prototype.dispose = function() {+ return X = this, fr.bind(this, e);+}, pr.prototype.N = function() {+ 2 & this.f || (this.f |= 2, this.u = Zn, Zn = this);+}, pr.prototype.d = function() {+ this.f |= 8, 1 & this.f || dr(this);+}, pr.prototype.dispose = function() {this.d();};-function Yn(e, t) {- var n = new Jn(e, t);+function mr(e, t) {+ var n = new pr(e, t);try {n.c();} catch (e) {@@ -2678,35 +3213,35 @@ function Yn(e, t) {}//#endregion//#region node_modules/@preact/signals/dist/signals.module.js-var Xn, Zn, Qn = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, $n = [];-Yn(function() {- Xn = this.N;+var hr, gr, _r = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, vr = [];+mr(function() {+ hr = this.N;})();-function er(e, t) {+function yr(e, t) {S[e] = t.bind(null, S[e] || function() {});}-function tr(e) {- if (Zn) {- var t = Zn;- Zn = void 0, t();+function br(e) {+ if (gr) {+ var t = gr;+ gr = void 0, t();}- Zn = e && e.S();+ gr = e && e.S();}-function nr(e) {- var t = this, n = e.data, r = ir(n);+function xr(e) {+ var t = this, n = e.data, r = Cr(n);r.name = "ReactiveDom", r.value = n;- var i = Jt(function() {+ var i = Qe(function() {for (var e = t, n = t.__v; n = n.__;) if (n.__c) {n.__c.__$f |= 4;break;}- var i = Wn(function() {+ var i = lr(function() {var e = r.value.value;return e === 0 ? 0 : !0 === e ? "" : e || "";- }), a = Wn(function() {+ }), a = lr(function() {return !Array.isArray(i.value) && !w(i.value);- }), o = Yn(function() {- if (this.N = sr, a.value) {+ }), o = mr(function() {+ if (this.N = Er, a.value) {var t = i.value;e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);}@@ -2717,14 +3252,14 @@ function nr(e) {}, []), a = i[0], o = i[1];return a.value ? o.peek() : o.value;}-nr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {+xr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {constructor: {configurable: !0,value: void 0},type: {configurable: !0,- value: nr+ value: xr},props: {configurable: !0,@@ -2739,7 +3274,7 @@ nr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {configurable: !0,value: 1}-}), er("__b", function(e, t) {+}), yr("__b", function(e, t) {if (typeof t.type == "string") {var n, r = t.props;for (var i in r) if (i !== "children") {@@ -2748,26 +3283,26 @@ nr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {}}e(t);-}), er("__r", function(e, t) {- if (e(t), t.type !== I) {- tr();+}), yr("__r", function(e, t) {+ if (e(t), t.type !== L) {+ br();var n, r = t.__c;r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {var n;- return Yn(function() {+ return mr(function() {n = this;}, { name: t }), n.c = e, n;}(function(e) {return function() {var t;- Qn && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});+ _r && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});};- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), tr(n);+ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), br(n);}-}), er("__e", function(e, t, n, r) {- tr(), e(t, n, r);-}), er("diffed", function(e, t) {- tr();+}), yr("__e", function(e, t, n, r) {+ br(), e(t, n, r);+}), yr("diffed", function(e, t) {+ br();var n;if (typeof t.type == "string" && (n = t.__e)) {var r = t.__np, i = t.props, a = n.U;@@ -2777,25 +3312,25 @@ nr.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {}if (r) for (var c in a || (a = {}, n.U = a), r) {var l = a[c], u = r[c];- l === void 0 ? (l = rr(n, c, u, i), a[c] = l) : l.o(u, i);+ l === void 0 ? (l = Sr(n, c, u, i), a[c] = l) : l.o(u, i);}}e(t);});-function rr(e, t, n, r) {- var i = t in e && e.ownerSVGElement === void 0, a = zn(n);+function Sr(e, t, n, r) {+ var i = t in e && e.ownerSVGElement === void 0, a = ir(n);return {o: function(e, t) {a.value = e, r = t;},- d: Yn(function() {- this.N = sr;+ d: mr(function() {+ this.N = Er;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));})};}-er("unmount", function(e, t) {+yr("unmount", function(e, t) {if (typeof t.type == "string") {var n = t.__e;if (n) {@@ -2819,9 +3354,9 @@ er("unmount", function(e, t) {}}e(t);-}), er("__h", function(e, t, n, r) {+}), yr("__h", function(e, t, n, r) {r < 3 && (t.__$f |= 2), e(t, n, r);-}), ce.prototype.shouldComponentUpdate = function(e, t) {+}), se.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;@@ -2833,55 +3368,55 @@ er("unmount", function(e, t) {for (var s in this.props) if (!(s in e)) return !0;return !1;};-function ir(e, t) {- return Jt(function() {- return zn(e, t);+function Cr(e, t) {+ return Qe(function() {+ return ir(e, t);}, []);}-var ar = function(e) {+var wr = function(e) {queueMicrotask(function() {queueMicrotask(e);});};-function or() {- kn(function() {- for (var e; e = $n.shift();) Xn.call(e);+function Tr() {+ Jn(function() {+ for (var e; e = vr.shift();) hr.call(e);});}-function sr() {- $n.push(this) === 1 && (S.requestAnimationFrame || ar)(or);+function Er() {+ vr.push(this) === 1 && (S.requestAnimationFrame || wr)(Tr);}//#endregion//#region src/state/quality-goals.ts-var cr = "/api/quality-goals?limit=200", lr = {+var Dr = "/api/quality-goals?limit=200", Or = {data: null,error: ""-}, ur = zn(lr), dr = 0, fr = Wn(() => ur.value);-Wn(() => ur.value.data?.total ?? null);-function pr() {- dr += 1, ur.value = lr;+}, kr = ir(Or), Ar = 0, jr = lr(() => kr.value);+lr(() => kr.value.data?.total ?? null);+function Mr() {+ Ar += 1, kr.value = Or;}-async function mr(e) {- let t = dr += 1;+async function Nr(e) {+ let t = Ar += 1;try {- let n = await V(cr, e);- return t === dr && (ur.value = {+ let n = await K(Dr, e);+ return t === Ar && (kr.value = {data: n,error: ""}), n;} catch (n) {- throw !e?.aborted && t === dr && (ur.value = {+ throw !e?.aborted && t === Ar && (kr.value = {data: null,- error: B(n)+ error: G(n)}), n;}}//#endregion//#region src/islands/quality-goals.tsx-var hr = (e, t) => mr(t), gr = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;-function _r({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {- let { data: s, error: c } = fr.value;- if (c) return /* @__PURE__ */ Y("div", {+var Pr = (e, t) => Nr(t), Fr = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;+function Ir({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {+ let { data: s, error: c } = jr.value;+ if (c) return /* @__PURE__ */ J("div", {class: "qualitylist",dangerouslySetInnerHTML: { __html: p(c, {variant: "error",@@ -2889,126 +3424,81 @@ function _r({ openItem: t, javTitleHtml: n, javDisplayName: a, srcBadge: o }) {}) }});let l = s?.items ?? [];- return l.length ? /* @__PURE__ */ Y("div", {+ return l.length ? /* @__PURE__ */ J("div", {class: "qualitylist",- children: l.map((s) => /* @__PURE__ */ Y("article", {+ children: l.map((s) => /* @__PURE__ */ J("article", {class: "qualityitem",- children: [/* @__PURE__ */ Y("button", {+ children: [/* @__PURE__ */ J("button", {class: "qualitycover",type: "button","aria-label": `打开 ${a(s)}`,onClick: () => t(s.id),- children: /* @__PURE__ */ Y("img", {- src: gr(s),+ children: /* @__PURE__ */ J("img", {+ src: Fr(s),alt: "",loading: "lazy",onError: (e) => e.currentTarget.remove()})- }), /* @__PURE__ */ Y("div", { children: [- /* @__PURE__ */ Y("h3", { children: /* @__PURE__ */ Y("button", {+ }), /* @__PURE__ */ J("div", { children: [+ /* @__PURE__ */ J("h3", { children: /* @__PURE__ */ J("button", {type: "button","data-middle-truncate": !0,onClick: () => t(s.id),dangerouslySetInnerHTML: { __html: n(s) }}) }),- /* @__PURE__ */ Y("p", {+ /* @__PURE__ */ J("p", {class: "mono",children: [- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {style: "display:contents",dangerouslySetInnerHTML: { __html: o(s.location, s.cost) }}),- /* @__PURE__ */ Y("span", { children: e[s.location] ?? s.location }),- /* @__PURE__ */ Y("span", { children: r(s.duration) }),- /* @__PURE__ */ Y("span", { children: i(s.size ?? 0) })+ /* @__PURE__ */ J("span", { children: e[s.location] ?? s.location }),+ /* @__PURE__ */ J("span", { children: r(s.duration) }),+ /* @__PURE__ */ J("span", { children: i(s.size ?? 0) })]}),- s.reason ? /* @__PURE__ */ Y("p", { children: s.reason }) : null+ s.reason ? /* @__PURE__ */ J("p", { children: s.reason }) : null] })]}, s.id))- }) : /* @__PURE__ */ Y("div", {+ }) : /* @__PURE__ */ J("div", {class: "qualitylist",dangerouslySetInnerHTML: { __html: u("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }});}//#endregion-//#region src/jobs.ts-async function vr(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 yr(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;- vr({- 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 = (a.message || (e.title ? e.title + (a.total ? `:已完成 ${a.checked || 0}/${a.total}` : "") : "") || (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 br = (e, t) => V("/api/scraping", t);-function xr({ value: e, onChange: t }) {- let n = J(null), r = J(t);- return r.current = t, q(() => {+var Lr = (e, t) => K("/api/scraping", t);+function Rr({ value: e, onChange: t }) {+ let n = W(null), r = W(t);+ return r.current = t, U(() => {let t = n.current;t.innerHTML = g([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });let i = b(t.firstElementChild), a = () => r.current(i.value);return i.addEventListener("change", a), () => {i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();};- }, []), /* @__PURE__ */ Y("div", {+ }, []), /* @__PURE__ */ J("div", {ref: n,class: "scraping-network"});}-function Sr({ source: e, toast: t }) {- let [r, i] = G(e), [a, o] = G(e.network), [s, c] = G(""), [l, u] = G(""), [f, m] = G("paste"), [h, g] = G(""), [_, y] = G(!1), [b, x] = G(""), [S, C] = G([]), w = J(null), T = J(null);- q(() => {+function zr({ source: e, toast: t }) {+ let [r, i] = V(e), [a, o] = V(e.network), [s, c] = V(""), [l, u] = V(""), [f, m] = V("paste"), [h, g] = V(""), [_, y] = V(!1), [b, x] = V(""), [S, C] = V([]), w = W(null), T = W(null);+ U(() => {T.current?.querySelectorAll("footer button").forEach((e) => v(e, _));}, [_]);- let E = J(new AbortController());- K(() => () => E.current.abort(), []);+ let E = W(new AbortController());+ H(() => () => E.current.abort(), []);async function D(n) {if (!_) {y(!0), x(""), C([]);try {if (n === "check") {- let t = await H("/api/scraping/check", { source: e.source }, "POST", E.current.signal);+ let t = await q("/api/scraping/check", { source: e.source }, "POST", E.current.signal);E.current.signal.aborted || C(t.results);} else {- let r = await H("/api/scraping/settings", {+ let r = await q("/api/scraping/settings", {source: e.source,network: a,cookie: s,@@ -3018,33 +3508,33 @@ function Sr({ source: e, toast: t }) {E.current.signal.aborted || (i(r.saved), c(""), u(""), g(""), w.current && (w.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));}} catch (e) {- E.current.signal.aborted || x(B(e));+ E.current.signal.aborted || x(G(e));} finally {E.current.signal.aborted || y(!1);}}}- return /* @__PURE__ */ Y("section", {+ return /* @__PURE__ */ J("section", {class: "scraping-source",- children: /* @__PURE__ */ Y("form", {+ children: /* @__PURE__ */ J("form", {ref: T,class: "cleanupfieldset","data-geist-fieldset": !0,onSubmit: (e) => {e.preventDefault(), D("save");},- children: [/* @__PURE__ */ Y("div", {+ children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "geist-fieldset-heading",- children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ Y("a", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {class: "scraping-url externallink",href: e.login,target: "_blank",rel: "noopener noreferrer",children: [- /* @__PURE__ */ Y("img", {+ /* @__PURE__ */ J("img", {src: n(e.login),alt: "",width: "16",@@ -3052,35 +3542,35 @@ function Sr({ source: e, toast: t }) {loading: "lazy",onError: (e) => e.currentTarget.remove()}),- /* @__PURE__ */ Y("span", { children: e.login }),- /* @__PURE__ */ Y("svg", {+ /* @__PURE__ */ J("span", { children: e.login }),+ /* @__PURE__ */ J("svg", {class: "externalmark",viewBox: "0 0 24 24","aria-hidden": "true",- children: /* @__PURE__ */ Y("use", { href: "#i-external-link" })+ children: /* @__PURE__ */ J("use", { href: "#i-external-link" })})]})]}),- /* @__PURE__ */ Y("div", {+ /* @__PURE__ */ J("div", {class: "scraping-label",- children: ["连接方式", /* @__PURE__ */ Y(xr, {+ children: ["连接方式", /* @__PURE__ */ J(Rr, {value: a,onChange: o})]}),- a === "peach" && /* @__PURE__ */ Y("a", {+ a === "peach" && /* @__PURE__ */ J("a", {class: "geist-text-link",href: "/configuration#peachProxy",children: "配置 Peach 代理"}),- e.accepts_cookie && /* @__PURE__ */ Y(I, { children: [- /* @__PURE__ */ Y("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),- /* @__PURE__ */ Y("div", {+ e.accepts_cookie && /* @__PURE__ */ J(L, { children: [+ /* @__PURE__ */ J("p", { children: r.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),+ /* @__PURE__ */ J("div", {class: "insightswitch scraping-cookie-method",role: "radiogroup","aria-label": "提供 Cookie 的方式(二选一)",- children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ Y("label", { children: [/* @__PURE__ */ Y("input", {+ children: [["paste", "粘贴 Cookie"], ["file", "导入文件"]].map(([t, n]) => /* @__PURE__ */ J("label", { children: [/* @__PURE__ */ J("input", {type: "radio",name: `cookie-method-${e.source}`,value: t,@@ -3088,29 +3578,29 @@ function Sr({ source: e, toast: t }) {onChange: () => {m(t), c(""), u(""), g("");}- }), /* @__PURE__ */ Y("span", { children: n })] }, t))+ }), /* @__PURE__ */ J("span", { children: n })] }, t))}),- f === "paste" ? /* @__PURE__ */ Y("label", { children: ["Cookie", /* @__PURE__ */ Y("input", {+ f === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {class: "geist-input",type: "password",autoComplete: "off",value: s,disabled: _,onInput: (e) => c(e.currentTarget.value)- })] }) : /* @__PURE__ */ Y("label", {+ })] }) : /* @__PURE__ */ J("label", {class: "scraping-file",- children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ Y("span", {+ children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ J("span", {class: "scraping-file-control",children: [- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {class: "geist-button",children: "选择文件"}),- /* @__PURE__ */ Y("span", {+ /* @__PURE__ */ J("span", {class: "scraping-file-name",children: h || "未选择文件"}),- /* @__PURE__ */ Y("input", {+ /* @__PURE__ */ J("input", {ref: w,type: "file",accept: ".txt",@@ -3140,32 +3630,32 @@ function Sr({ source: e, toast: t }) {})]})] }),- b && /* @__PURE__ */ Y("div", {+ b && /* @__PURE__ */ J("div", {role: "alert",dangerouslySetInnerHTML: { __html: p(b, { variant: "error" }) }}),- S.map((t) => /* @__PURE__ */ Y("div", {+ S.map((t) => /* @__PURE__ */ J("div", {role: "status",dangerouslySetInnerHTML: { __html: p(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }}, t.label))]- }), /* @__PURE__ */ Y("footer", {+ }), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: [- e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ Y("button", {+ e.accepts_cookie && r.cookie_saved && /* @__PURE__ */ J("button", {class: "geist-button",type: "button",onClick: () => void D("revoke"),children: "撤销 Cookie"}),- /* @__PURE__ */ Y("button", {+ /* @__PURE__ */ J("button", {class: "geist-button",type: "button",onClick: () => void D("check"),children: "检查连接"}),- /* @__PURE__ */ Y("button", {+ /* @__PURE__ */ J("button", {class: "geist-button primary",type: "submit",children: "保存"@@ -3175,14 +3665,14 @@ function Sr({ source: e, toast: t }) {})});}-function Cr({ data: e, error: t, toast: n }) {- let [r, i] = G(""), [a, o] = G(!1), [s, c] = G(""), l = J(null);- q(() => v(l.current, a), [a]);- let u = J(new AbortController()), f = J(0);+function Br({ data: e, error: t, toast: n }) {+ let [r, i] = V(""), [a, o] = V(!1), [s, c] = V(""), l = W(null);+ U(() => v(l.current, a), [a]);+ let u = W(new AbortController()), f = W(0);async function m(e = !1) {let t = ++f.current;- await vr({- read: (e) => V("/api/scraping/cover", e),+ await ct({+ read: (e) => K("/api/scraping/cover", e),active: () => !u.current.signal.aborted && t === f.current,render: (t) => {o(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && c(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");@@ -3190,37 +3680,37 @@ function Cr({ data: e, error: t, toast: n }) {disconnected: () => c("连接中断,正在重新读取后台进度")});}- K(() => (m(!0), () => u.current.abort()), []);+ H(() => (m(!0), () => u.current.abort()), []);async function h() {if (!a) {f.current++, o(!0), c("");try {- await H("/api/scraping/cover", { code: r }, "POST", u.current.signal), await m();+ await q("/api/scraping/cover", { code: r }, "POST", u.current.signal), await m();} catch (e) {- u.current.signal.aborted || (o(!1), c(B(e)));+ u.current.signal.aborted || (o(!1), c(G(e)));}}}- return t ? /* @__PURE__ */ Y("div", {+ return t ? /* @__PURE__ */ J("div", {role: "alert",dangerouslySetInnerHTML: { __html: p(t, { variant: "error" }) }- }) : /* @__PURE__ */ Y("div", {+ }) : /* @__PURE__ */ J("div", {class: "scraping-page",children: [- /* @__PURE__ */ Y("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),- /* @__PURE__ */ Y("section", {+ /* @__PURE__ */ J("p", { children: "高清图片可能需要代理才能下载,请先检查连接。" }),+ /* @__PURE__ */ J("section", {class: "cleanupfieldset scraping-source","data-geist-fieldset": !0,- children: /* @__PURE__ */ Y("div", {+ children: /* @__PURE__ */ J("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("scraping-cover", "高清封面") } }),- /* @__PURE__ */ Y("form", {+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d("scraping-cover", "高清封面") } }),+ /* @__PURE__ */ J("form", {class: "scraping-cover-form",onSubmit: (e) => {e.preventDefault(), h();},- children: [/* @__PURE__ */ Y("input", {+ children: [/* @__PURE__ */ J("input", {class: "geist-input","aria-label": "馆藏番号",required: !0,@@ -3228,21 +3718,21 @@ function Cr({ data: e, error: t, toast: n }) {disabled: a,placeholder: "输入馆藏番号,如 ABW-232",onInput: (e) => i(e.currentTarget.value)- }), /* @__PURE__ */ Y("button", {+ }), /* @__PURE__ */ J("button", {ref: l,class: "geist-button primary",type: "submit",children: "抓取封面"})]}),- s && /* @__PURE__ */ Y("div", {+ s && /* @__PURE__ */ J("div", {role: "alert",dangerouslySetInnerHTML: { __html: p(s, { variant: "error" }) }})]})}),- e?.sources.map((e) => /* @__PURE__ */ Y(Sr, {+ e?.sources.map((e) => /* @__PURE__ */ J(zr, {source: e,toast: n}, e.source))@@ -3250,117 +3740,13 @@ function Cr({ data: e, error: t, toast: n }) {});}//#endregion-//#region src/islands/library-processing.tsx-var wr = (e, t) => V("/api/library-processing", t);-function Tr({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a }) {- let [o, s] = G(e || { status: "idle" }), [c, l] = G(t), [u, m] = G(!1), [g, _] = G(!1), y = J(new AbortController()), b = J(0), x = J(o.status), S = J(null), C = u || o.status === "running";- q(() => v(S.current, C), [C]);- async function w() {- let e = ++b.current;- await vr({- read: (e) => V("/api/library-processing", e),- active: () => !y.current.signal.aborted && b.current === e,- keepWatching: i === "notice" || !!a,- render: (e) => {- s(e), l(""), e.status === "complete" && x.current === "running" && i !== "notice" && (_(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;- },- disconnected: () => l("连接中断,正在重新读取处理进度")- });- }- K(() => ((o.status === "running" || i === "notice" || a) && w(), () => y.current.abort()), []);- async function T() {- if (!C) {- m(!0), l(""), _(!1);- try {- let e = await H("/api/library-processing", {}, "POST", y.current.signal);- if (y.current.signal.aborted) return;- x.current = e.status, s(e), m(!1), await w();- } catch (e) {- y.current.signal.aborted || (l(B(e)), m(!1));- }- }- }- if (i === "notice") {- if (!c && o.status !== "running" && o.status !== "failed") return null;- let e = c || (o.status === "failed" ? "扫描与资料采集未完成" : `${o.stage || "正在整理馆藏"}${o.total ? ` · ${o.checked || 0} / ${o.total}` : ""}`);- return /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: h(e, {- variant: o.status === "failed" ? "error" : c ? "warning" : "gray",- href: "/data-cleanup#libraryProcessing",- label: c || o.status === "failed" ? "查看并处理" : "查看进度",- value: o.checked || 0,- ...o.status === "running" && o.total !== void 0 ? { max: o.total } : {}- }) } });- }- return /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("div", {- class: "geist-fieldset-content library-processing",- children: [- /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: d("cleanupScrapingTitle", "扫描与采集") } }),- /* @__PURE__ */ Y("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),- /* @__PURE__ */ Y("div", {- "aria-live": "polite",- children: [- o.status === "running" && /* @__PURE__ */ Y(I, { children: [/* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: f(`${o.stage || "正在处理"}${o.total ? ` · ${o.checked || 0} / ${o.total}` : ""}`) } }), !!o.total && /* @__PURE__ */ Y("div", { dangerouslySetInnerHTML: { __html: Fe(`已处理 ${o.checked || 0} / ${o.total} 个视频`, o.checked || 0, o.total) } })] }),- (c || o.status === "failed") && /* @__PURE__ */ Y("div", {- role: "alert",- onClick: (e) => {- e.target.closest("[data-note-action]") && T();- },- dangerouslySetInnerHTML: { __html: p(c || o.error || "处理未完成,请重试", {- variant: "error",- filled: !0,- actionLabel: o.status === "failed" ? "重试未完成项" : ""- }) }- }),- o.status === "failed" && !!o.issues?.length && /* @__PURE__ */ Y("ul", { children: o.issues.slice(0, 20).map((e) => /* @__PURE__ */ Y("li", { children: [- e.asset_id ? /* @__PURE__ */ Y("a", {- href: `/item/${e.asset_id}`,- children: "查看视频"- }) : null,- e.asset_id ? ":" : "",- e.message- ] })) }),- g && /* @__PURE__ */ Y("div", {- class: "library-processing-result",- dangerouslySetInnerHTML: { __html: p(`已扫描 ${o.scanned || 0} 个文件,识别 ${o.identified || 0} 个番号,整理 ${o.candidates || 0} 组资料候选。`, {- variant: "success",- label: "处理完成"- }) }- })- ]- })- ]- }), /* @__PURE__ */ Y("footer", {- class: "geist-fieldset-footer",- "data-geist-fieldset-footer": !0,- children: [- /* @__PURE__ */ Y("a", {- class: "geist-button",- href: "/scraping",- children: "采集来源"- }),- !!o.candidates && /* @__PURE__ */ Y("a", {- class: "geist-button",- href: "/review",- children: "复核资料"- }),- o.status !== "failed" && /* @__PURE__ */ Y("button", {- ref: S,- type: "button",- class: "geist-button primary",- onClick: () => void T(),- children: "扫描并补全资料"- })- ]- })] });-}-//#endregion//#region src/state/index.ts-var Er = { "quality-goals": {- refresh: mr,- reset: pr-} }, Dr = () => Object.keys(Er);-async function Or(e) {- let t = Er[e];+var Vr = { "quality-goals": {+ refresh: Nr,+ reset: Mr+} }, Hr = () => Object.keys(Vr);+async function Ur(e) {+ let t = Vr[e];if (!t) throw Error(`未登记的共享 store:${String(e)}`);try {return await t.refresh(), !0;@@ -3370,24 +3756,24 @@ async function Or(e) {}//#endregion//#region src/review-evidence.ts-var kr = (e = "") => /^https?:\/\//i.test(e) ? e : "";-function Ar(e = "") {- let n = kr(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");+var Wr = (e = "") => /^https?:\/\//i.test(e) ? e : "";+function Gr(e = "") {+ let n = Wr(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");return `<div class="reviewimage" data-review-picture><span class="reviewimageempty"${n ? " hidden" : ""}>未取得来源图片</span>${n ? `<img src="${t(n)}" alt="来源候选图片" loading="lazy">` : ""}</div>`;}-function jr(e) {- let n = kr(e.profile_url), r = (e.preview_assets || []).slice(0, 6), i = Math.max(0, Number(e.video_count || e.videos || 0));+function Kr(e) {+ let n = Wr(e.profile_url), r = (e.preview_assets || []).slice(0, 6), i = Math.max(0, Number(e.video_count || e.videos || 0));return `<section class="reviewidentityevidence"><h5>候选身份:${t(e.babepedia_name || "未标注")}</h5><div class="reviewevidenceactions">${n ? `<a class="geist-button externallink" href="${t(n)}" target="_blank" rel="noopener noreferrer">来源资料<svg class="externalmark" viewBox="0 0 24 24" aria-hidden="true"><use href="#i-external-link" /></svg></a>` : ""}<button type="button" class="geist-button" data-entity-kind="creator" data-entity-name="${t(e.creator || "")}">查看全部 ${i.toLocaleString()} 部作品</button></div>- ${Ar(e.preview_url)}+ ${Gr(e.preview_url)}<p>通过后记录身份判断。</p>${r.length ? `<h5>本地作品样本</h5><div class="reviewevidencesamples">${r.map((e) => `<div class="reviewevidencesample"><button class="geist-button" type="button" data-review-open-item="${e.id}"><span data-middle-truncate title="${t(e.name)}">${t(e.name)}</span></button><button class="geist-button" type="button" data-review-reveal="${e.id}" aria-label="打开 ${t(e.name)} 的文件位置">文件位置</button></div>`).join("")}</div>` : "<p>暂无本地作品样本,打开全部作品核对。</p>"}</section>`;}-function Mr(e) {+function qr(e) {for (let t of e.querySelectorAll("[data-review-picture] img")) {let e = () => {t.hidden = !0;@@ -3399,7 +3785,7 @@ function Mr(e) {}//#endregion//#region src/review-bulk.ts-var Nr = () => ({+var Jr = () => ({busy: !1,category: "",filter: "",@@ -3410,7 +3796,7 @@ var Nr = () => ({assets: /* @__PURE__ */ new Map(),errors: /* @__PURE__ */ new Map()});-function Pr(e) {+function Yr(e) {let t = e?.querySelector(".reviewcontrols");if (!e || !t || t.offsetParent === null) return;let n = e.closest("main");@@ -3420,7 +3806,7 @@ function Pr(e) {n.classList.toggle("is-stuck", n.offsetParent !== null && window.scrollY > 0 && Number.isFinite(e) && Math.abs(n.getBoundingClientRect().top - e) <= 1);}}-function Fr(e, t) {+function Xr(e, t) {let n = [["candidates",t ? "按候选数量" : "全部待复核",@@ -3436,7 +3822,7 @@ function Fr(e, t) {"list-filter"]), n;}-function Ir(e, t) {+function Zr(e, t) {let n = /* @__PURE__ */ new Map();for (let r of e) {let e, i;@@ -3453,11 +3839,11 @@ function Ir(e, t) {}return [...n.values()];}-function Lr(e, t, n, r, i) {+function Qr(e, t, n, r, i) {let a = e.anchor === null ? -1 : t.indexOf(e.anchor), o = t.indexOf(n);r && a >= 0 && o >= 0 ? t.slice(Math.min(a, o), Math.max(a, o) + 1).forEach((t) => e.selected.add(t)) : i ? e.selected.add(n) : e.selected.delete(n), e.anchor = n;}-async function Rr(e, t, n, r) {+async function $r(e, t, n, r) {let i = [], a = 0;for (let o of e) {if (!r()) break;@@ -3468,7 +3854,7 @@ async function Rr(e, t, n, r) {} catch (e) {i.push({key: o.key,- message: B(e)+ message: G(e)});}}@@ -3477,17 +3863,17 @@ async function Rr(e, t, n, r) {failures: i};}-function zr(e) {+function ei(e) {return e.length ? [...new Set(e.flatMap((e) => e.candidates?.map((e) => e.source || "") || []))].filter((t) => t && e.every((e) => e.candidates?.filter((e) => e.source === t).length === 1)) : [];}-function Br(e, t) {+function ti(e, t) {let n = e.querySelector(".reviewlist");if (!n || !t.rows.length || t.locked) return;let r = t.state, i = [...n.querySelectorAll("[data-review-key]")];t.category !== void 0 && r.category !== t.category && (r.category = t.category, r.filter = "", r.groupBy = "candidates", r.anchor = null);- let a = Fr(t.rows, t.metadata);+ let a = Xr(t.rows, t.metadata);a.some((e) => e[0] === r.groupBy) || (r.groupBy = "candidates", r.filter = "");- let o = Ir(t.rows, r.groupBy);+ let o = Zr(t.rows, r.groupBy);o.some((e) => e.key === r.filter) || (r.filter = "");let s = () => [...n.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), l = () => s().filter((e) => r.selected.has(e.dataset.reviewKey)), u = () => t.rows.filter((e) => l().some((t) => t.dataset.reviewKey === e.item_key)), d = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, f = (e, t = "") => {let n = document.createElement("button");@@ -3550,7 +3936,7 @@ function Br(e, t) {if (r.busy) return;let e = s(), t = l().length === e.length;e.forEach((e) => t ? r.selected.delete(e.dataset.reviewKey) : r.selected.add(e.dataset.reviewKey)), P();- }, C.onclick = () => te("approved", C), w.onclick = () => te("rejected", w);+ }, C.onclick = () => F("approved", C), w.onclick = () => F("rejected", w);let M = [];for (let e of o) {let t = e.rows.map((e) => i.find((t) => t.dataset.reviewKey === e.item_key)).filter((e) => !!e), a = document.createElement("section");@@ -3579,7 +3965,7 @@ function Br(e, t) {e.className = "reviewpickname", e.append(...n.childNodes), n.classList.add("reviewpickheading"), n.append(i, e);} else e.prepend(i);let o = (e, n) => {- Lr(r, s().map((e) => e.dataset.reviewKey), t, e, n), P();+ Qr(r, s().map((e) => e.dataset.reviewKey), t, e, n), P();};if (i.addEventListener("mousedown", (e) => {e.shiftKey && e.preventDefault();@@ -3593,7 +3979,7 @@ function Br(e, t) {else if (n.key === "ArrowDown" || n.key === "ArrowUp") {n.preventDefault();let i = s(), a = i[i.indexOf(e) + (n.key === "ArrowDown" ? 1 : -1)];- a && (r.anchor === null && (r.anchor = t), Lr(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());+ a && (r.anchor === null && (r.anchor = t), Qr(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());}}}), M.push(() => {@@ -3622,14 +4008,14 @@ function Br(e, t) {function P() {let e = l();S.textContent = e.length === s().length ? "清空当前选择" : r.filter ? "全选当前分类" : "全选本页", k.hidden = !e.length, T.textContent = `已选 ${e.length} 项`, C.disabled = !e.length || e.some((e) => !d(e)), w.disabled = !e.length;- let n = zr(u());+ let n = ei(u());E.hidden = !t.metadata || !u().some((e) => (e.candidates?.length || 0) > 1);let i = e.length && !n.length ? "所选项目无共同来源" : "统一选择来源", a = JSON.stringify([i, n]);if (a !== N) {N = a, E.innerHTML = g([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });let e = b(E.firstElementChild);e.disabled = !n.length, e.addEventListener("change", () => {- if (!(r.busy || !zr(u()).includes(e.value))) {+ if (!(r.busy || !ei(u()).includes(e.value))) {for (let n of l()) {let i = t.rows.find((e) => e.item_key === n.dataset.reviewKey).candidates.find((t) => t.source === e.value);n.querySelectorAll("input[type=\"radio\"]").forEach((e) => {@@ -3642,7 +4028,7 @@ function Br(e, t) {}M.forEach((e) => e());}- async function te(n, i) {+ async function F(n, i) {if (r.busy || !l().length) return;let a = l().map((e) => ({key: e.dataset.reviewKey,@@ -3662,7 +4048,7 @@ function Br(e, t) {e instanceof KeyboardEvent && e.key === "Tab" || (e.preventDefault(), e.stopImmediatePropagation());};e.addEventListener("click", c, !0), e.addEventListener("keydown", c, !0);- let u = 0, d = await Rr(a, async (e) => {+ let u = 0, d = await $r(a, async (e) => {try {return await t.submit(e);} finally {@@ -3679,14 +4065,14 @@ function Br(e, t) {let f = e.parentElement;t.refresh(), f?.querySelector(".reviewbulktoolbar button")?.focus({ preventScroll: !0 });}- P(), Pr(e);+ P(), Yr(e);}//#endregion//#region src/native-image.ts-function Vr(e, t, n, r) {+function ni(e, t, n, r) {return e > 0 && t > 0 && e === n && t === r;}-function Hr(e, t, n, r, i = 1) {+function ri(e, t, n, r, i = 1) {let a = Number.isFinite(i) && i > 0 ? i : 1;e /= a, t /= a;let o = [@@ -3703,7 +4089,7 @@ function Hr(e, t, n, r, i = 1) {}//#endregion//#region src/entity-skeleton.ts-function Ur(e, t) {+function ii(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>@@ -3715,7 +4101,7 @@ function Ur(e, t) {}//#endregion//#region src/board-skeleton.ts-function Wr(e) {+function ai(e) {let t = (e = "60%") => `<i class="skeleton" style="width:${e}"></i>`, n = () => `<div class="board-skeleton-row">${t("36%")}${t("24%")}</div>`, r = "";if (e === "/stats" || e === "/taste") r = `${e === "/taste" ? `<div class="board-skeleton-row">${t("26%")}${t("32%")}</div>` : ""}<div class="metricstrip board-skeleton-metrics">${Array.from({ length: 4 }, () => `<div class="tastesummary">${t()}<b class="skeleton"></b><small class="board-stat-footer">${t("48%")}</small></div>`).join("")}</div><div class="board-skeleton-chart"><div class="board-skeleton-ring skeleton"></div><div>${n().repeat(4)}</div></div><div class="board-skeleton-section">${t("32%")}${n().repeat(5)}</div>`;else if (e === "/follow-manage") r = `<div class="board-skeleton-section">${t("20%")}<div class="skeleton board-skeleton-input"></div>${t("72%")}</div><div class="board-skeleton-row">${t("24%")}${t("40%")}</div><div class="board-skeleton-section">${n().repeat(6)}</div><div class="board-skeleton-row">${t("30%")}${t("30%")}</div>`;@@ -3725,7 +4111,7 @@ function Wr(e) {}//#endregion//#region src/catalog-onboarding.ts-var Gr = [+var oi = ["loc","creator","performer",@@ -3742,16 +4128,16 @@ var Gr = ["jav","thumb"];-function Kr() {+function si() {let e = (e) => Array(64).fill(e).join("");return {tiers: "<div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"av\"><span class=\"ring\"></span><span class=\"nm\"> </span></span>") + "</div><div class=\"tier catalog-placeholder\" aria-hidden=\"true\">" + e("<span class=\"brandpill\"><span class=\"mk\"></span><span class=\"placeholder-name\"> </span></span>") + "</div>",tags: "<span class=\"catalog-placeholder placeholder-tags\" aria-hidden=\"true\">" + e("<span class=\"pill\"> </span>") + "</span>"};}-async function qr(e, t) {+async function ci(e, t) {let n = new URLSearchParams();- for (let t of Gr) e[t] && n.set(t, e[t]);+ for (let t of oi) 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 || [],@@ -3762,7 +4148,7 @@ async function qr(e, t) {return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";}))).filter(Boolean);}-function Jr({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {+function li({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: r = !1, online: i = !1 } = {}) {let a = r ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", o = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";return t || n ? u("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? u("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: a + o }) : u(e === "tags" ? "tags" : "user-round", "还没有" + ({tags: "标签",@@ -3775,7 +4161,7 @@ function Jr({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable:}//#endregion//#region src/sidebar.ts-function Yr(e) {+function ui(e) {return ["/","/unseen",@@ -3785,104 +4171,28 @@ function Yr(e) {"/junk-files"].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);}-function Xr(e, t) {+function di(e, t) {return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);}-function Zr(e) {+function fi(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 Qr(e) {- return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);-}-function $r(e, t) {- return t.filter((t) => e.some((e) => e.location === t));-}-function ei() {- return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态">- <div class="cleanupgrid">${[- [- "扫描与采集",- "扫描并补全资料",- "扫描媒体文件夹,导入已有资料,采集缺失信息。"- ],- [- "垃圾文件",- "查看垃圾文件",- ""- ],- [- "重复文件",- "查看重复文件",- ""- ],- [- "空文件夹",- "删除空文件夹",- ""- ],- [- "人工复核",- "查看候选",- ""- ],- [- "回收站",- "查看回收站",- ""- ],- [- "高清版",- "查看高清版",- ""- ]- ].map(([e, t, n], r) => `- <section class="cleanupfieldset" data-geist-fieldset aria-labelledby="cleanup-loading-${r}">- <div class="geist-fieldset-content"><h3 class="geist-fieldset-title" id="cleanup-loading-${r}">${e}</h3>- ${n ? `<p>${n}</p>` : "<strong><span class=\"skeleton cleanup-count-skeleton\" aria-hidden=\"true\"></span></strong>"}- ${r === 3 ? "<p class=\"cleanupmeta\"><span class=\"skeleton cleanup-count-skeleton\" aria-hidden=\"true\"></span></p>" : ""}</div>- <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 ti(e, t = !1, n = !1) {- if (t || n) return "";- let r = "<svg class=\"externalmark\" viewBox=\"0 0 24 24\" aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";- return `<details class="taste-history-guide"${e ? " open" : ""}>- <summary><svg viewBox="0 0 24 24" aria-hidden="true"><use href="#i-chevron-right"></use></svg>浏览器历史记录导入指南</summary>- <div class="taste-history-guide-content">- <p>在运行 Peach 的电脑上使用浏览器:点击上方「读取 Peach 主机」。</p>- <p>记录在其他设备上:导出文件后,点击上方「导入历史」。多台设备的文件分别导入。</p>- <ul><li>Chrome:在 <a class="externallink" href="https://takeout.google.com/" target="_blank" rel="noreferrer">Google Takeout${r}</a> 选择 Chrome 历史记录,下载 ZIP 后直接导入。</li>- <li>其他浏览器:使用 <a class="externallink" href="https://github.com/purarue/browserexport" target="_blank" rel="noreferrer">browserexport${r}</a> 导出历史记录,再导入导出文件。</li></ul>- <p>需要刷新时再次读取或导入;数据源可在页面底部移除。</p>- <button type="button" class="geist-button taste-guide-skip">跳过</button>- </div></details>`;-}-var ni = "peach-taste-guide-dismissed";-function ri(e, t) {- y(e, ".taste-history-guide", "taste-guide-collapse");- let n = e.querySelector(".taste-history-guide");- n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {- t.setItem(ni, "1"), n.remove();- });-}-//#endregion//#region src/resource-sync.ts-var $ = (e = 0) => Number(e).toLocaleString(), ii = {+var $ = (e = 0) => Number(e).toLocaleString(), pi = {local: "本地磁盘",115: "115",pikpak: "PikPak"};-function ai(e, t) {+function mi(e, t) {let n = e.cache || {files: 0,bytes: 0}, r = !!(e.missing || n.files);return `<div class="resourcepanel" data-geist-fieldset><div class="resourcesources">${(e.sources || []).map((e) => `<article>- <div class="resourcesourcetitle"><b>${ii[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div>+ <div class="resourcesourcetitle"><b>${pi[e.location] || "媒体来源"}</b><span class="${e.online ? "online" : "offline"}">${e.online ? "可访问" : "离线,已跳过"}</span></div><strong>${e.online ? `${$(e.missing)} 项` : "—"}</strong><small>${e.online ? `找不到文件 · 已检查 ${$(e.checked)} 项` : `馆藏中有 ${$(e.total)} 项`}</small>${e.unreadable ? `<small>${$(e.unreadable)} 项读取失败,已跳过</small>` : ""}</article>`).join("")}</div>@@ -3893,60 +4203,60 @@ function ai(e, t) {}//#endregion//#region src/jav-artwork.ts-function oi(e) {+function hi(e) {return ["small","sleeve","preview"].includes(String(e)) ? "small" : "big";}-function si(e) {+function gi(e) {return {- javLayout: oi(e.javLayout),- javImage: ci(e.javLayout === "preview" ? "thumbnail" : e.javImage)+ javLayout: hi(e.javLayout),+ javImage: _i(e.javLayout === "preview" ? "thumbnail" : e.javImage)};}-function ci(e) {+function _i(e) {return e === "thumbnail" ? "thumbnail" : "cover";}-function li(e, t) {- return e.is_jav && e.code && e.has_cover && (ci(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";+function vi(e, t) {+ return e.is_jav && e.code && e.has_cover && (_i(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";}-function ui(e, t) {+function yi(e, t) {e.querySelectorAll("img[data-jav-image]").forEach((e) => {- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (ci(t) === "cover" || !r)), a = i ? n : r;+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (_i(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 di = {+var bi = {"library-processing": {- load: wr,- component: Tr+ load: dt,+ component: ft},scraping: {- load: br,- component: Cr+ load: Lr,+ component: Br},"quality-goals": {- load: hr,- component: _r+ load: Pr,+ component: Ir},configuration: {- load: yn,- component: En+ load: Rn,+ component: Gn}-}, fi = () => Object.keys(di), pi = /* @__PURE__ */ new Map();-async function mi(e, t, n, r = {}) {- let i = di[e];+}, xi = () => Object.keys(bi), Si = /* @__PURE__ */ new Map();+async function Ci(e, t, n, r = {}) {+ let i = bi[e];if (!i) throw Error(`未注册的 island:${String(e)}`);- hi(t);+ wi(t);let a = {controller: new AbortController(),painted: !1};- pi.set(t, a);+ Si.set(t, a);let o;try {o = {@@ -3957,12 +4267,12 @@ async function mi(e, t, n, r = {}) {if (a.controller.signal.aborted) return;o = {data: null,- error: B(e)+ error: G(e)};}- if (pi.get(t) !== a) return;+ if (Si.get(t) !== a) return;if (r.isCurrent && !r.isCurrent()) {- pi.delete(t);+ Si.delete(t);return;}t.textContent = "", a.painted = !0;@@ -3970,11 +4280,11 @@ async function mi(e, t, n, r = {}) {...n,...o};- Oe(oe(i.component, s), t);+ Oe(ae(i.component, s), t);}-function hi(e) {- let t = pi.get(e);- t && (t.controller.abort(), pi.delete(e), t.painted && Oe(null, e));+function wi(e) {+ let t = Si.get(e);+ t && (t.controller.abort(), Si.delete(e), t.painted && Oe(null, e));}//#endregion-export { ni as TASTE_GUIDE_KEY, Et as activityChartsHtml, Wr as boardPageSkeleton, je as boundedPreference, Jr as catalogEmptyHtml, qr as catalogSuggestions, ei as cleanupSkeletonHtml, Qr as cloudLocations, $r as cloudPreferenceLocations, Nr as createReviewSelection, bt as creatorSankeyHtml, Ie as distributionChart, Kr as emptyCatalogLayout, Ur as entitySkeletonHtml, yr as followJobProgress, jr as identityEvidenceHtml, Be as initBoardControls, fi as islandNames, li as javImageKind, Fe as jobProgressHtml, Vr as matchesFaceSource, mi as mountIsland, Ne as mountNumberSetting, Hr as nativeImageFit, ci as normalizeJavImage, oi as normalizeJavLayout, si as normalizeJavPreferences, ke as preferredDirection, Re as radarChart, Ct as radialCardHtml, Le as rankedChart, Or as refreshStore, ai as resourceScanHtml, Ar as reviewImageHtml, Yr as sidebarHasCatalogContent, kt as sidebarSectionHtml, Zr as sidebarTagCounts, Pe as statCardBody, Dr as storeNames, ze as syncBoardRange, ui as syncJavImages, Me as syncNumberSetting, Xr as syncSidebarSurface, ti as tasteHistoryGuideHtml, Mt as transitionTheme, hi as unmountIsland, Pr as updateReviewSticky, vr as watchJob, Dt as wireActivityCharts, xt as wireCreatorSankey, Ve as wireExpandableRanks, wt as wireRadialCards, Mr as wireReviewPictures, Br as wireReviewSelection, At as wireSidebarGroups, ri as wireTasteHistoryGuide };+export { _t as TASTE_GUIDE_KEY, mn as activityChartsHtml, ai as boardPageSkeleton, je as boundedPreference, li as catalogEmptyHtml, ci as catalogSuggestions, ht as cleanupSkeletonHtml, pt as cloudLocations, mt as cloudPreferenceLocations, Jr as createReviewSelection, cn as creatorSankeyHtml, Ie as distributionChart, si as emptyCatalogLayout, ii as entitySkeletonHtml, lt as followJobProgress, Kr as identityEvidenceHtml, Ct as initBoardControls, xi as islandNames, vi as javImageKind, Fe as jobProgressHtml, ni as matchesFaceSource, xt as mountBoardStatePreview, Ci as mountIsland, Ne as mountNumberSetting, ri as nativeImageFit, _i as normalizeJavImage, hi as normalizeJavLayout, gi as normalizeJavPreferences, ke as preferredDirection, Re as radarChart, dn as radialCardHtml, Le as rankedChart, Ur as refreshStore, mi as resourceScanHtml, Gr as reviewImageHtml, ui as sidebarHasCatalogContent, _n as sidebarSectionHtml, fi as sidebarTagCounts, Pe as statCardBody, Hr as storeNames, St as syncBoardRange, yi as syncJavImages, Me as syncNumberSetting, di as syncSidebarSurface, gt as tasteHistoryGuideHtml, bn as transitionTheme, wi as unmountIsland, Yr as updateReviewSticky, ct as watchJob, hn as wireActivityCharts, ln as wireCreatorSankey, Dt as wireExpandableRanks, fn as wireRadialCards, qr as wireReviewPictures, ti as wireReviewSelection, vn as wireSidebarGroups, vt as wireTasteHistoryGuide };diff --git a/web/index.html b/web/index.htmlindex 7582137f6..49d12c664 100644--- a/web/index.html+++ b/web/index.html@@ -35,6 +35,20 @@Climax uses Health Icons 2.0.0 sperm outline-24px, CC0/public domain.Phosphor 2.1.1 regular, MIT: filled glyphs where a stroked icon cannot say it. --><svg aria-hidden="true" width="0" height="0" style="position:absolute;overflow:hidden">+<symbol id="i-heart-hand" viewBox="0 0 24 24"><path d="M11 14h2a2 2 0 0 0 0-4h-3c-.6 0-1.1.2-1.4.6L3 16" /><path d="m14.45 13.39 5.05-4.694C20.196 8 21 6.85 21 5.75a2.75 2.75 0 0 0-4.797-1.837.276.276 0 0 1-.406 0A2.75 2.75 0 0 0 11 5.75c0 1.2.802 2.248 1.5 2.946L16 11.95" /><path d="m2 15 6 6" /><path d="m7 20 1.6-1.4c.3-.4.8-.6 1.4-.6h4c1.1 0 2.1-.4 2.8-1.2l4.6-4.4a1 1 0 0 0-2.75-2.91" /></symbol>+<symbol id="i-flame" viewBox="0 0 24 24"><path d="M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4" /></symbol>+<symbol id="i-cherry" viewBox="0 0 24 24"><path d="M2 17a5 5 0 0 0 10 0c0-2.76-2.5-5-5-3-2.5-2-5 .24-5 3Z" /><path d="M12 17a5 5 0 0 0 10 0c0-2.76-2.5-5-5-3-2.5-2-5 .24-5 3Z" /><path d="M7 14c3.22-2.91 4.29-8.75 5-12 1.66 2.38 4.94 9 5 12" /><path d="M22 9c-4.29 0-7.14-2.33-10-7 5.71 0 10 4.67 10 7Z" /></symbol>+<symbol id="i-gem" viewBox="0 0 24 24"><path d="M10.5 3 8 9l4 13 4-13-2.5-6" /><path d="M17 3a2 2 0 0 1 1.6.8l3 4a2 2 0 0 1 .013 2.382l-7.99 10.986a2 2 0 0 1-3.247 0l-7.99-10.986A2 2 0 0 1 2.4 7.8l2.998-3.997A2 2 0 0 1 7 3z" /><path d="M2 9h20" /></symbol>+<symbol id="i-crown" viewBox="0 0 24 24"><path d="M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z" /><path d="M5 21h14" /></symbol>+<symbol id="i-shirt" viewBox="0 0 24 24"><path d="M20.38 3.46 16 2a4 4 0 0 1-8 0L3.62 3.46a2 2 0 0 0-1.34 2.23l.58 3.47a1 1 0 0 0 .99.84H6v10c0 1.1.9 2 2 2h8a2 2 0 0 0 2-2V10h2.15a1 1 0 0 0 .99-.84l.58-3.47a2 2 0 0 0-1.34-2.23z" /></symbol>+<symbol id="i-footprints" viewBox="0 0 24 24"><path d="M4 16v-2.38C4 11.5 2.97 10.5 3 8c.03-2.72 1.49-6 4.5-6C9.37 2 10 3.8 10 5.5c0 3.11-2 5.66-2 8.68V16a2 2 0 1 1-4 0Z" /><path d="M20 20v-2.38c0-2.12 1.03-3.12 1-5.62-.03-2.72-1.49-6-4.5-6C14.63 6 14 7.8 14 9.5c0 3.11 2 5.66 2 8.68V20a2 2 0 1 0 4 0Z" /><path d="M16 17h4" /><path d="M4 13h4" /></symbol>+<symbol id="i-flower" viewBox="0 0 24 24"><circle cx="12" cy="12" r="3" /><path d="M12 16.5A4.5 4.5 0 1 1 7.5 12 4.5 4.5 0 1 1 12 7.5a4.5 4.5 0 1 1 4.5 4.5 4.5 4.5 0 1 1-4.5 4.5" /><path d="M12 7.5V9" /><path d="M7.5 12H9" /><path d="M16.5 12H15" /><path d="M12 16.5V15" /><path d="m8 8 1.88 1.88" /><path d="M14.12 9.88 16 8" /><path d="m8 16 1.88-1.88" /><path d="M14.12 14.12 16 16" /></symbol>+<symbol id="i-venetian-mask" viewBox="0 0 24 24"><path d="M18 11c-1.5 0-2.5.5-3 2" /><path d="M4 6a2 2 0 0 0-2 2v4a5 5 0 0 0 5 5 8 8 0 0 1 5 2 8 8 0 0 1 5-2 5 5 0 0 0 5-5V8a2 2 0 0 0-2-2h-3a8 8 0 0 0-5 2 8 8 0 0 0-5-2z" /><path d="M6 11c1.5 0 2.5.5 3 2" /></symbol>+<symbol id="i-hand" viewBox="0 0 24 24"><path d="M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2" /><path d="M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2" /><path d="M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8" /><path d="M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15" /></symbol>+<symbol id="i-bed-double" viewBox="0 0 24 24"><path d="M2 20v-8a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v8" /><path d="M4 10V6a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v4" /><path d="M12 4v6" /><path d="M2 18h20" /></symbol>+<symbol id="i-camera" viewBox="0 0 24 24"><path d="M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z" /><circle cx="12" cy="13" r="3" /></symbol>+<symbol id="i-video" viewBox="0 0 24 24"><path d="m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5" /><rect x="2" y="6" width="14" height="12" rx="2" /></symbol>+<symbol id="i-scan-search" viewBox="0 0 24 24"><path d="M3 7V5a2 2 0 0 1 2-2h2" /><path d="M17 3h2a2 2 0 0 1 2 2v2" /><path d="M21 17v2a2 2 0 0 1-2 2h-2" /><path d="M7 21H5a2 2 0 0 1-2-2v-2" /><circle cx="12" cy="12" r="3" /><path d="m16 16-1.9-1.9" /></symbol><symbol id="i-home" viewBox="0 0 24 24"><path d="M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8" /><path d="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z" /></symbol><symbol id="i-panel-left" viewBox="0 0 24 24"><rect width="18" height="18" x="3" y="3" rx="2" /><path d="M9 3v18" /></symbol><symbol id="i-search" viewBox="0 0 24 24"><path d="m21 21-4.34-4.34" /><circle cx="11" cy="11" r="8" /></symbol>diff --git a/web/js/ui-components.js b/web/js/ui-components.jsindex c5cfbbd93..e56cda075 100644--- a/web/js/ui-components.js+++ b/web/js/ui-components.js@@ -297,11 +297,24 @@ export function wireScrollers(root=document){container.addEventListener('scroll',()=>updateScroller(wrapper),{passive:true});container.addEventListener('load',()=>updateScroller(wrapper),true);}- requestAnimationFrame(()=>updateScroller(wrapper));+ if(!deferReviewScroller(container))requestAnimationFrame(()=>updateScroller(wrapper));});}/** 挂覆盖式滚动条的滚动容器。列表只写在这一处,样式那边认的是挂上之后的属性。 */+const deferredReviewScrollers=new WeakSet();+let reviewScrollerObserver;+function deferReviewScroller(container){+ if(typeof IntersectionObserver==='undefined'||!container.closest('.reviewitem'))return false;+ if(!deferredReviewScrollers.has(container)){+ deferredReviewScrollers.add(container);+ reviewScrollerObserver ||= new IntersectionObserver(entries=>{+ for(const entry of entries)if(entry.isIntersecting){reviewScrollerObserver.unobserve(entry.target);const wrapper=entry.target.closest('[data-geist-scroller]');if(wrapper)updateScroller(wrapper);attachOverlayScrollbar(entry.target)}+ },{rootMargin:'200px'});+ reviewScrollerObserver.observe(container);+ }+ return true;+}const OVERLAY_SCROLLERS=['.settingsscroll','.sidecontent','.tagpickbody','.mixlist','.playlistpicklist','.playerstats','.vjs-peach-settings-menu','.geist-scroller-container','.metricstrip','.tastesummaries',@@ -419,7 +432,15 @@ export function attachOverlayScrollbar(container,{variant=''}={}){/** 把这一批 DOM 里所有该有覆盖式滚动条的容器接上;重复调用只接新出现的那些。 */export function wireOverlayScrollbars(root=document){- root.querySelectorAll(OVERLAY_SCROLLERS).forEach(el=>attachOverlayScrollbar(el));+ root.querySelectorAll(OVERLAY_SCROLLERS).forEach(el=>{+ if(deferReviewScroller(el))return;+ if(el.matches('.reviewtabs')&&localStorage.getItem('peach.legacy-ui')!=='true'){+ const edges=()=>{el.dataset.overflowLeft=String(el.scrollLeft>1);el.dataset.overflowRight=String(el.scrollLeft+el.clientWidth<el.scrollWidth-1)};+ if(!el.dataset.boardScroll){el.dataset.boardScroll='true';el.addEventListener('scroll',edges,{passive:true});el.addEventListener('wheel',event=>{if(Math.abs(event.deltaY)>Math.abs(event.deltaX)&&el.scrollWidth>el.clientWidth){const before=el.scrollLeft;el.scrollLeft+=event.deltaY;if(before!==el.scrollLeft)event.preventDefault()}},{passive:false});new ResizeObserver(edges).observe(el)}+ edges();return;+ }+ attachOverlayScrollbar(el);+ });}/**diff --git a/web/vendor/lucide-ORIGIN.md b/web/vendor/lucide-ORIGIN.mdindex b4469a537..3205bd9f8 100644--- a/web/vendor/lucide-ORIGIN.md+++ b/web/vendor/lucide-ORIGIN.md@@ -3,7 +3,7 @@- npm 包:`[email protected]`- npm lock integrity:`sha512-ln37Ng6A709exLQH4pBxrbl6FAUk/ZBLTJnLrj02HN/Bb84eUGzlA2JjMglScI0TEab6vH2UVs0hm4vGgLzTrQ==`- 许可证:ISC;原文见 `lucide-LICENSE.txt`-- 消费者:`web/index.html` 内联的 77 个 symbol+- 消费者:`web/index.html` 内联的 91 个 symbol雪碧图里另有 7 枚自绘 symbol(shuffle、alert、pics、jav、theater-enter、theater-exit、brand-x)与 16 枚 player-* 前缀的播放器图标,都没有上游可对。RSS 与拖动点保留填充修正,避免小圆点在全局描边样式下消失。