Peach: Local-first video metadata scraper and media manager.
fix(web): 集成管理界面构建与骨架对齐
longmeidaodbd32bb24924
diff --git a/docs/STATUS.md b/docs/STATUS.mdindex aa765fdc2..1924ecc2b 100644--- a/docs/STATUS.md+++ b/docs/STATUS.md@@ -4,7 +4,7 @@索引:`PRODUCT_BACKLOG.md`、`REUSE.md`、`HANDOFF.md`。-- 自启、代理、卸载设置已上线;桌面与手机预览通过,生产浏览器取证超时。见 `REUSE.md`。+- 自启、代理、卸载设置已上线,见 `REUSE.md`。## 运行态diff --git a/web/css/09-skeleton.css b/web/css/09-skeleton.cssindex c928e7b26..48aae705c 100644--- a/web/css/09-skeleton.css+++ b/web/css/09-skeleton.css@@ -167,4 +167,4 @@ body.refreshing #tiers .brandpill{border-color:transparent}.config-skeleton-card .skeleton{display:block;height:20px;width:60%}.config-skeleton-card .geist-fieldset-content>.skeleton:first-child{height:24px;width:35%}.config-skeleton-card .geist-fieldset-content>.skeleton:last-child{height:var(--control-h);width:100%}-.config-skeleton-card .geist-fieldset-footer>.skeleton{width:100px;height:var(--control-h)}+.config-skeleton-card .geist-fieldset-footer>.skeleton{width:100px;height:var(--control-h);margin:0}diff --git a/web/dist/peach-ui.js b/web/dist/peach-ui.jsindex 087cea669..3038e9bd7 100644--- a/web/dist/peach-ui.js+++ b/web/dist/peach-ui.js@@ -1,21 +1,21 @@-import { MEDIA_SOURCE_ICONS as e, checkboxHtml as t, confirmModal as n, emptyStateHtml as r, fieldsetTitle as i, loadingDotsHtml as a, noteHtml as o, progressHtml as s, selectFieldHtml as c, selectOptionIconHtml as l, setActionBusy as u, wireCollapse as d, wireSelectField as f } from "/js/ui-components.js";-import { LOC as p, esc as m, fmtDur as h, fmtSize as g, icon as _ } from "/js/core.js";+import { LOC as e, esc as t, fmtDur as n, fmtSize as r, icon as i, requestErrorMessage as a } from "/js/core.js";+import { MEDIA_SOURCE_ICONS as o, checkboxHtml as s, confirmModal as c, emptyStateHtml as l, fieldsetTitle as u, loadingDotsHtml as d, noteHtml as f, progressHtml as p, projectBannerHtml as m, selectFieldHtml as h, selectOptionIconHtml as g, setActionBusy as _, wireCollapse as v, wireSelectField as y } from "/js/ui-components.js";//#region node_modules/preact/dist/preact.module.js-var v, y, b, x, S, C, w, T, E, D, O, k, A, j, ee, M = {}, N = [], P = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, F = Array.isArray;-function I(e, t) {+var b, x, S, C, w, T, E, D, O, k, A, ee, te, j, M, N = {}, P = [], ne = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i, re = Array.isArray;+function F(e, t) {for (var n in t) e[n] = t[n];return e;}-function te(e) {+function ie(e) {e && e.parentNode && e.parentNode.removeChild(e);}-function ne(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 ? v.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 re(e, o, r, i, null);+ if (arguments.length > 2 && (o.children = arguments.length > 3 ? b.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 oe(e, o, r, i, null);}-function re(e, t, n, r, i) {+function oe(e, t, n, r, i) {var a = {type: e,props: t,@@ -27,68 +27,68 @@ function re(e, t, n, r, i) {__e: null,__c: null,constructor: void 0,- __v: i ?? ++b,+ __v: i ?? ++S,__i: -1,__u: 0};- return i == null && y.vnode != null && y.vnode(a), a;+ return i == null && x.vnode != null && x.vnode(a), a;}-function L(e) {+function I(e) {return e.children;}-function ie(e, t) {+function se(e, t) {this.props = e, this.context = t;}-function R(e, t) {- if (t == null) return e.__ ? R(e.__, e.__i + 1) : null;+function L(e, t) {+ if (t == null) return e.__ ? L(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" ? R(e) : null;+ return typeof e.type == "function" ? L(e) : null;}-function ae(e) {+function ce(e) {if (e.__P && e.__d) {- var t = e.__v, n = t.__e, r = [], i = [], a = I({}, t);- a.__v = t.__v + 1, y.vnode && y.vnode(a), ge(e.__P, a, t, e.__n, e.__P.namespaceURI, 32 & t.__u ? [n] : null, r, n ?? R(t), !!(32 & t.__u), i), a.__v = t.__v, a.__.__k[a.__i] = a, ve(r, a, i), t.__e = t.__ = null, a.__e != n && oe(a);+ var t = e.__v, n = t.__e, r = [], i = [], a = F({}, t);+ a.__v = t.__v + 1, x.vnode && x.vnode(a), ye(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, xe(r, a, i), t.__e = t.__ = null, a.__e != n && le(a);}}-function oe(e) {+function le(e) {if ((e = e.__) != null && e.__c != null) return e.__e = e.__c.base = null, e.__k.some(function(t) {if (t != null && t.__e != null) return e.__e = e.__c.base = t.__e;- }), oe(e);+ }), le(e);}-function se(e) {- (!e.__d && (e.__d = !0) && S.push(e) && !ce.__r++ || C != y.debounceRendering) && ((C = y.debounceRendering) || w)(ce);+function ue(e) {+ (!e.__d && (e.__d = !0) && w.push(e) && !de.__r++ || T != x.debounceRendering) && ((T = x.debounceRendering) || E)(de);}-function ce() {+function de() {try {- for (var e, t = 1; S.length;) S.length > t && S.sort(T), e = S.shift(), t = S.length, ae(e);+ for (var e, t = 1; w.length;) w.length > t && w.sort(D), e = w.shift(), t = w.length, ce(e);} finally {- S.length = ce.__r = 0;+ w.length = de.__r = 0;}}-function le(e, t, n, r, i, a, o, s, c, l, u) {- var d, f, p, m, h, g, _ = r && r.__k || N, v = t.length;- for (c = ue(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || M, p.__i = d, g = ge(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && xe(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = de(p, c, e), f.__e && (f.__e = null)) : typeof p.type == "function" && g !== void 0 ? c = g : m && (c = m.nextSibling), p.__u &= -7);+function fe(e, t, n, r, i, a, o, s, c, l, u) {+ var d, f, p, m, h, g, _ = r && r.__k || P, v = t.length;+ for (c = pe(n, t, _, c, v), d = 0; d < v; d++) (p = n.__k[d]) != null && (f = p.__i != -1 && _[p.__i] || N, p.__i = d, g = ye(e, p, f, i, a, o, s, c, l, u), m = p.__e, p.ref && f.ref != p.ref && (f.ref && we(f.ref, null, p), u.push(p.ref, p.__c || m, p)), h == null && m != null && (h = m), 4 & p.__u ? (c = me(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 ue(e, t, n, r, i) {+function pe(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] = re(null, o, null, null, null) : F(o) ? o = e.__k[a] = re(L, { children: o }, null, null, null) : o.constructor === void 0 && o.__b > 0 ? o = e.__k[a] = re(o.type, o.props, o.key, o.ref ? o.ref : null, o.__v) : e.__k[a] = o, c = a + f, o.__ = e, o.__b = e.__b + 1, s = null, (l = o.__i = fe(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 = R(s)), Se(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(I, { 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 = he(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)), Te(s, s));return r;}-function de(e, t, n) {+function me(e, t, n) {var r, i;if (typeof e.type == "function") {- for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = de(r[i], t, n));+ for (r = e.__k, i = 0; r && i < r.length; i++) r[i] && (r[i].__ = e, t = me(r[i], t, n));return t;}- e.__e != t && (t && e.type && !t.parentNode && (t = R(e)), t = n.insertBefore(e.__e, t || null));+ e.__e != t && (t && e.type && !t.parentNode && (t = L(e)), t = n.insertBefore(e.__e, t || null));dot &&= t.nextSibling;while (t != null && t.nodeType == 8);return t;}-function fe(e, t, n, r) {+function he(e, t, n, r) {var i, a, o, s = e.key, c = e.type, l = t[n], u = l != null && !(2 & l.__u);if (l === null && s == null || u && s == l.key && c == l.type) return n;if (r > +!!u) {@@ -96,18 +96,18 @@ function fe(e, t, n, r) {}return -1;}-function pe(e, t, n) {- t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || P.test(t) ? n : n + "px";+function ge(e, t, n) {+ t[0] == "-" ? e.setProperty(t, n ?? "") : e[t] = n == null ? "" : typeof n != "number" || ne.test(t) ? n : n + "px";}-function me(e, t, n, r, i) {+function _e(e, t, n, r, i) {var a, o;n: if (t == "style") {if (typeof n == "string") e.style.cssText = n;else {- if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || pe(e.style, t, "");- if (n) for (t in n) r && n[t] == r[t] || pe(e.style, t, n[t]);+ if (typeof r == "string" && (e.style.cssText = r = ""), r) for (t in r) n && t in n || ge(e.style, t, "");+ if (n) for (t in n) r && n[t] == r[t] || ge(e.style, t, n[t]);}- } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(k, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[O] = r[O] : (n[O] = A, e.addEventListener(t, a ? ee : j, a)) : e.removeEventListener(t, a ? ee : j, a);+ } else if (t[0] == "o" && t[1] == "n") a = t != (t = t.replace(ee, "$1")), o = t.toLowerCase(), t = o in e || t == "onFocusOut" || t == "onFocusIn" ? o.slice(2) : t.slice(2), e.l ||= {}, e.l[t + a] = n, n ? r ? n[A] = r[A] : (n[A] = te, e.addEventListener(t, a ? M : j, a)) : e.removeEventListener(t, a ? M : j, a);else {if (i == "http://www.w3.org/2000/svg") t = t.replace(/xlink(H|:h)/, "h").replace(/sName$/, "s");else if (t != "width" && t != "height" && t != "href" && t != "list" && t != "form" && t != "tabIndex" && t != "download" && t != "rowSpan" && t != "colSpan" && t != "role" && t != "popover" && t in e) try {@@ -117,154 +117,154 @@ function me(e, t, n, r, i) {typeof n == "function" || (n == null || !1 === n && t[4] != "-" ? e.removeAttribute(t) : e.setAttribute(t, t == "popover" && n == 1 ? "" : n));}}-function he(e) {+function ve(e) {return function(t) {if (this.l) {var n = this.l[t.type + e];- if (t[D] == null) t[D] = A++;- else if (t[D] < n[O]) return;- return n(y.event ? y.event(t) : t);+ if (t[k] == null) t[k] = te++;+ else if (t[k] < n[A]) return;+ return n(x.event ? x.event(t) : t);}};}-function ge(e, t, n, r, i, a, o, s, c, l) {- var u, d, f, p, m, h, g, _, v, b, x, S, C, w, T, E, D = t.type;+function ye(e, t, n, r, i, a, o, s, c, l) {+ var u, d, f, p, m, h, g, _, v, y, b, S, C, w, T, E, D = t.type;if (t.constructor !== void 0) return null;- 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = y.__b) && u(t);+ 128 & n.__u && (c = !!(32 & n.__u), a = [s = t.__e = n.__e]), (u = x.__b) && u(t);n: if (typeof D == "function") {d = o.length;try {- if (v = t.props, b = D.prototype && D.prototype.render, x = (u = D.contextType) && r[u.__c], S = u ? x ? x.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (b ? t.__c = f = new D(v, S) : (t.__c = f = new ie(v, S), f.constructor = D, f.render = Ce), x && x.sub(f), f.state || (f.state = {}), f.__n = r, p = f.__d = !0, f.__h = [], f._sb = []), b && f.__s == null && (f.__s = f.state), b && D.getDerivedStateFromProps != null && (f.__s == f.state && (f.__s = I({}, f.__s)), I(f.__s, D.getDerivedStateFromProps(v, f.__s))), m = f.props, h = f.state, f.__v = t, p) b && D.getDerivedStateFromProps == null && f.componentWillMount != null && f.componentWillMount(), b && f.componentDidMount != null && f.__h.push(f.componentDidMount);+ if (v = t.props, y = D.prototype && D.prototype.render, b = (u = D.contextType) && r[u.__c], S = u ? b ? b.props.value : u.__ : r, n.__c ? _ = (f = t.__c = n.__c).__ = f.__E : (y ? t.__c = f = new D(v, S) : (t.__c = f = new se(v, S), f.constructor = D, f.render = Ee), 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);else {- if (b && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, S)) {+ if (y && D.getDerivedStateFromProps == null && v !== m && f.componentWillReceiveProps != null && f.componentWillReceiveProps(v, S), t.__v == n.__v || !f.__e && f.shouldComponentUpdate != null && !1 === f.shouldComponentUpdate(v, f.__s, S)) {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);- }), N.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = R(n);+ }), P.push.apply(f.__h, f._sb), f._sb = [], f.__h.length && o.push(f), s = L(n);break n;}- f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, S), b && f.componentDidUpdate != null && f.__h.push(function() {+ f.componentWillUpdate != null && f.componentWillUpdate(v, f.__s, S), y && f.componentDidUpdate != null && f.__h.push(function() {f.componentDidUpdate(m, h, g);});}- if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = y.__r, w = 0, b) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), N.push.apply(f.__h, f._sb), f._sb = [];+ if (f.context = S, f.props = v, f.__P = e, f.__e = !1, C = x.__r, w = 0, y) f.state = f.__s, f.__d = !1, C && C(t), u = f.render(f.props, f.state, f.context), P.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 = I(I({}, r), f.getChildContext())), b && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === L && u.key == null ? ye(u.props.children) : u, s = le(e, F(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 = F(F({}, r), f.getChildContext())), y && !p && f.getSnapshotBeforeUpdate != null && (g = f.getSnapshotBeforeUpdate(m, h)), T = u != null && u.type === I && u.key == null ? Se(u.props.children) : u, s = fe(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--;) te(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 || _e(t), y.__e(e, t, n);+ t.__k ??= n.__k || [], e.then || be(t), x.__e(e, t, n);}- } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = be(n.__e, t, n, r, i, a, o, c, l);- return (u = y.diffed) && u(t), 128 & t.__u ? void 0 : s;+ } else a == null && t.__v == n.__v ? (t.__k = n.__k, t.__e = n.__e) : s = t.__e = Ce(n.__e, t, n, r, i, a, o, c, l);+ return (u = x.diffed) && u(t), 128 & t.__u ? void 0 : s;}-function _e(e) {- e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(_e));+function be(e) {+ e && (e.__c && (e.__c.__e = !0), e.__k && e.__k.some(be));}-function ve(e, t, n) {- for (var r = 0; r < n.length; r++) xe(n[r], n[++r], n[++r]);- y.__c && y.__c(t, e), e.some(function(t) {+function xe(e, t, n) {+ for (var r = 0; r < n.length; r++) we(n[r], n[++r], n[++r]);+ x.__c && x.__c(t, e), e.some(function(t) {try {e = t.__h, t.__h = [], e.some(function(e) {e.call(t);});} catch (e) {- y.__e(e, t.__v);+ x.__e(e, t.__v);}});}-function ye(e) {- return typeof e != "object" || !e || e.__b > 0 ? e : F(e) ? e.map(ye) : e.constructor === void 0 ? I({}, e) : null;+function Se(e) {+ return typeof e != "object" || !e || e.__b > 0 ? e : re(e) ? e.map(Se) : e.constructor === void 0 ? F({}, e) : null;}-function be(e, t, n, r, i, a, o, s, c) {- var l, u, d, f, p, m, h, g = n.props || M, _ = t.props, b = t.type;- if (b == "svg" ? i = "http://www.w3.org/2000/svg" : b == "math" ? i = "http://www.w3.org/1998/Math/MathML" : i ||= "http://www.w3.org/1999/xhtml", a != null) {- for (l = 0; l < a.length; l++) if ((p = a[l]) && "setAttribute" in p == !!b && (b ? p.localName == b : p.nodeType == 3)) {+function Ce(e, t, n, r, i, a, o, s, c) {+ var l, u, d, f, p, m, h, g = n.props || N, _ = 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;break;}}if (e == null) {- if (b == null) return document.createTextNode(_);- e = document.createElementNS(i, b, _.is && _), s &&= (y.__m && y.__m(t, a), !1), a = null;+ if (v == null) return document.createTextNode(_);+ e = document.createElementNS(i, v, _.is && _), s &&= (x.__m && x.__m(t, a), !1), a = null;}- if (b == null) g === _ || s && e.data == _ || (e.data = _);+ if (v == null) g === _ || s && e.data == _ || (e.data = _);else {- if (a = b == "textarea" && _.defaultValue != null ? null : a && v.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;- for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || me(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 || me(e, l, p, g[l], i);+ if (a = v == "textarea" && _.defaultValue != null ? null : a && b.call(e.childNodes), !s && a != null) for (g = {}, l = 0; l < e.attributes.length; l++) g[(p = e.attributes[l]).name] = p.value;+ for (l in g) p = g[l], l == "dangerouslySetInnerHTML" ? d = p : l == "children" || l in _ || l == "value" && "defaultValue" in _ || l == "checked" && "defaultChecked" in _ || _e(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 || _e(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 = ""), le(t.type == "template" ? e.content : e, F(f) ? f : [f], t, n, r, b == "foreignObject" ? "http://www.w3.org/1999/xhtml" : i, a, o, a ? a[0] : n.__k && R(n, 0), s, c), a != null) for (l = a.length; l--;) te(a[l]);- s && b != "textarea" || (l = "value", b == "progress" && m == null ? e.removeAttribute("value") : m != null && (m !== e[l] || b == "progress" && !m || b == "option" && m != g[l]) && me(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && me(e, l, h, g[l], i));+ else if (d && (e.innerHTML = ""), fe(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 && L(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]) && _e(e, l, m, g[l], i), l = "checked", h != null && h != e[l] && _e(e, l, h, g[l], i));}return e;}-function xe(e, t, n) {+function we(e, t, n) {try {if (typeof e == "function") {var r = typeof e.__u == "function";r && e.__u(), r && t == null || (e.__u = e(t));} else e.current = t;} catch (e) {- y.__e(e, n);+ x.__e(e, n);}}-function Se(e, t, n) {+function Te(e, t, n) {var r, i;- if (y.unmount && y.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || xe(r, null, t)), (r = e.__c) != null) {+ if (x.unmount && x.unmount(e), (r = e.ref) && (r.current && r.current != e.__e || we(r, null, t)), (r = e.__c) != null) {if (r.componentWillUnmount) try {r.componentWillUnmount();} catch (e) {- y.__e(e, t);+ x.__e(e, t);}r.base = r.__P = r.__n = null;}- if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Se(r[i], t, n || typeof e.type != "function");- n || te(e.__e), e.__c = e.__ = e.__e = void 0;+ if (r = e.__k) for (i = 0; i < r.length; i++) r[i] && Te(r[i], t, n || typeof e.type != "function");+ n || ie(e.__e), e.__c = e.__ = e.__e = void 0;}-function Ce(e, t, n) {+function Ee(e, t, n) {return this.constructor(e, n);}-function we(e, t, n) {+function De(e, t, n) {var r, i, a, o;- t == document && (t = document.documentElement), y.__ && y.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ge(t, e = (!r && n || t).__k = ne(L, null, [e]), i || M, M, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? v.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), ve(a, e, o), e.props.children = null;+ t == document && (t = document.documentElement), x.__ && x.__(e, t), i = (r = typeof n == "function") ? null : n && n.__k || t.__k, a = [], o = [], ye(t, e = (!r && n || t).__k = ae(I, null, [e]), i || N, N, t.namespaceURI, !r && n ? [n] : i ? null : t.firstChild ? b.call(t.childNodes) : null, a, !r && n ? n : i ? i.__e : t.firstChild, r, o), xe(a, e, o), e.props.children = null;}-v = N.slice, y = { __e: function(e, t, n, r) {+b = P.slice, x = { __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) {e = t;}throw e;-} }, b = 0, x = function(e) {+} }, S = 0, C = function(e) {return e != null && e.constructor === void 0;-}, ie.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), se(this));-}, ie.prototype.forceUpdate = function(e) {- this.__v && (this.__e = !0, e && this.__h.push(e), se(this));-}, ie.prototype.render = L, S = [], w = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, T = function(e, t) {+}, se.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), ue(this));+}, se.prototype.forceUpdate = function(e) {+ this.__v && (this.__e = !0, e && this.__h.push(e), ue(this));+}, se.prototype.render = I, w = [], E = typeof Promise == "function" ? Promise.prototype.then.bind(Promise.resolve()) : setTimeout, D = function(e, t) {return e.__v.__b - t.__v.__b;-}, ce.__r = 0, E = Math.random().toString(8), D = "__d" + E, O = "__a" + E, k = /(PointerCapture)$|Capture$/i, A = 0, j = he(!1), ee = he(!0);+}, de.__r = 0, O = Math.random().toString(8), k = "__d" + O, A = "__a" + O, ee = /(PointerCapture)$|Capture$/i, te = 0, j = ve(!1), M = ve(!0);//#endregion//#region src/sort-preferences.ts-function Te(e, t, n) {+function Oe(e, t, n) {return e === "seed" ? "" : e === t && n === "asc" ? "asc" : "desc";}//#endregion//#region src/api.ts-var Ee = class extends Error {+var ke = class extends Error {status;body;constructor(e, t, n = null) {- super(e), this.name = "ApiError", this.status = t, this.body = n;+ super(a(e, t)), this.name = "ApiError", this.status = t, this.body = n;}-}, De = (e) => {+}, Ae = (e) => {if (!e || typeof e != "object") return "";let t = e;for (let e of [@@ -276,8 +276,8 @@ var Ee = class extends Error {if (typeof n == "string" && n) return n;}return "";-}, z = (e) => e instanceof Error ? e.message : String(e);-async function B(e, t) {+}, R = (e) => a(e);+async function z(e, t) {let n = await fetch(e, {headers: { Accept: "application/json" },credentials: "same-origin",@@ -286,10 +286,10 @@ async function B(e, t) {try {r = await n.json();} catch {}- if (!n.ok) throw new Ee(De(r) || `请求失败(${n.status})`, n.status);+ if (!n.ok) throw new ke(Ae(r) || `请求失败(${n.status})`, n.status);return r;}-async function V(e, t, n = "POST", r) {+async function B(e, t, n = "POST", r) {let i = await fetch(e, {method: n,...r ? { signal: r } : {},@@ -303,14 +303,14 @@ async function V(e, t, n = "POST", r) {try {a = await i.json();} catch {}- if (!i.ok) throw new Ee(De(a) || `请求失败(${i.status})`, i.status, a);+ if (!i.ok) throw new ke(Ae(a) || `请求失败(${i.status})`, i.status, a);return a;}//#endregion//#region node_modules/preact/hooks/dist/hooks.module.js-var Oe, H, ke, Ae, je = 0, Me = [], U = y, Ne = U.__b, Pe = U.__r, Fe = U.diffed, Ie = U.__c, Le = U.unmount, Re = U.__;-function ze(e, t) {- U.__h && U.__h(H, e, je || t), je = 0;+var V, H, je, Me, Ne = 0, Pe = [], U = x, Fe = U.__b, Ie = U.__r, Le = U.diffed, Re = U.__c, ze = U.unmount, Be = U.__;+function Ve(e, t) {+ U.__h && U.__h(H, e, Ne || t), Ne = 0;var n = H.__H || (H.__H = {__: [],__h: []@@ -318,11 +318,11 @@ function ze(e, t) {return e >= n.__.length && n.__.push({}), n.__[e];}function W(e) {- return je = 1, Be(Je, e);+ return Ne = 1, He(Xe, e);}-function Be(e, t, n) {- var r = ze(Oe++, 2);- if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Je(void 0, t), function(e) {+function He(e, t, n) {+ var r = Ve(V++, 2);+ if (r.t = e, !r.__c && (r.__ = [n ? n(t) : Xe(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 = H, !H.__f)) {@@ -354,97 +354,97 @@ function Be(e, t, n) {return r.__N || r.__;}function G(e, t) {- var n = ze(Oe++, 3);- !U.__s && qe(n.__H, t) && (n.__ = e, n.u = t, H.__H.__h.push(n));+ var n = Ve(V++, 3);+ !U.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, H.__H.__h.push(n));}function K(e, t) {- var n = ze(Oe++, 4);- !U.__s && qe(n.__H, t) && (n.__ = e, n.u = t, H.__h.push(n));+ var n = Ve(V++, 4);+ !U.__s && Ye(n.__H, t) && (n.__ = e, n.u = t, H.__h.push(n));}function q(e) {- return je = 5, Ve(function() {+ return Ne = 5, Ue(function() {return { current: e };}, []);}-function Ve(e, t) {- var n = ze(Oe++, 7);- return qe(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;+function Ue(e, t) {+ var n = Ve(V++, 7);+ return Ye(n.__H, t) && (n.__ = e(), n.__H = t, n.__h = e), n.__;}-function He() {- for (var e; e = Me.shift();) {+function We() {+ for (var e; e = Pe.shift();) {var t = e.__H;if (e.__P && t) try {- t.__h.some(Ge), t.__h.some(Ke), t.__h = [];+ t.__h.some(qe), t.__h.some(Je), t.__h = [];} catch (n) {t.__h = [], U.__e(n, e.__v);}}}U.__b = function(e) {- H = null, Ne && Ne(e);+ H = null, Fe && Fe(e);}, U.__ = function(e, t) {- e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Re && Re(e, t);+ e && t.__k && t.__k.__m && (e.__m = t.__k.__m), Be && Be(e, t);}, U.__r = function(e) {- Pe && Pe(e), Oe = 0;+ Ie && Ie(e), V = 0;var t = (H = e.__c).__H;- t && (ke === H ? (t.__h = [], H.__h = [], t.__.some(function(e) {+ t && (je === H ? (t.__h = [], H.__h = [], t.__.some(function(e) {e.__N && (e.__ = e.__N), e.u = e.__N = void 0;- })) : (t.__h.some(Ge), t.__h.some(Ke), t.__h = [], Oe = 0)), ke = H;+ })) : (t.__h.some(qe), t.__h.some(Je), t.__h = [], V = 0)), je = H;}, U.diffed = function(e) {- Fe && Fe(e);+ Le && Le(e);var t = e.__c;- t && t.__H && (t.__H.__h.length && (Me.push(t) !== 1 && Ae === U.requestAnimationFrame || ((Ae = U.requestAnimationFrame) || We)(He)), t.__H.__.some(function(e) {+ t && t.__H && (t.__H.__h.length && (Pe.push(t) !== 1 && Me === U.requestAnimationFrame || ((Me = U.requestAnimationFrame) || Ke)(We)), t.__H.__.some(function(e) {e.u &&= (e.__H = e.u, void 0);- })), ke = H = null;+ })), je = H = null;}, U.__c = function(e, t) {t.some(function(e) {try {- e.__h.some(Ge), e.__h = e.__h.filter(function(e) {- return !e.__ || Ke(e);+ e.__h.some(qe), e.__h = e.__h.filter(function(e) {+ return !e.__ || Je(e);});} catch (n) {t.some(function(e) {e.__h &&= [];}), t = [], U.__e(n, e.__v);}- }), Ie && Ie(e, t);+ }), Re && Re(e, t);}, U.unmount = function(e) {- Le && Le(e);+ ze && ze(e);var t, n = e.__c;n && n.__H && (n.__H.__.some(function(e) {try {- Ge(e);+ qe(e);} catch (e) {t = e;}}), n.__H = void 0, t && U.__e(t, n.__v));};-var Ue = typeof requestAnimationFrame == "function";-function We(e) {+var Ge = typeof requestAnimationFrame == "function";+function Ke(e) {var t, n = function() {- clearTimeout(r), Ue && cancelAnimationFrame(t), setTimeout(e);+ clearTimeout(r), Ge && cancelAnimationFrame(t), setTimeout(e);}, r = setTimeout(n, 35);- Ue && (t = requestAnimationFrame(n));+ Ge && (t = requestAnimationFrame(n));}-function Ge(e) {+function qe(e) {var t = H, n = e.__c;typeof n == "function" && (e.__c = void 0, n()), H = t;}-function Ke(e) {+function Je(e) {var t = H;e.__c = e.__(), H = t;}-function qe(e, t) {+function Ye(e, t) {return !e || e.length !== t.length || t.some(function(t, n) {return t !== e[n];});}-function Je(e, t) {+function Xe(e, t) {return typeof t == "function" ? t(e) : t;}//#endregion//#region node_modules/preact/jsx-runtime/dist/jsxRuntime.module.js-var Ye = 0;+var Ze = 0;Array.isArray;function J(e, t, n, r, i, a) {t ||= {};@@ -461,18 +461,18 @@ function J(e, t, n, r, i, a) {__e: null,__c: null,constructor: void 0,- __v: --Ye,+ __v: --Ze,__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 y.vnode && y.vnode(l), l;+ return x.vnode && x.vnode(l), l;}//#endregion//#region src/islands/access-settings.tsx-function Xe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current: o = !1, disabled: s = !1 }) {+function Qe({ 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: [@@ -502,35 +502,35 @@ function Xe({ id: e, label: t, value: n, onInput: r, error: i, help: a, current:]});}-function Ze({ initial: e, receipt: t }) {- let [n, r] = W(e), [a, s] = W(""), [c, l] = W(""), [d, f] = W(""), [p, m] = W(!1), [h, g] = W(""), [_, v] = W({}), y = q(null), b = q(!1), x = q(null);+function $e({ initial: e, receipt: t }) {+ let [n, r] = W(e), [i, a] = W(""), [o, s] = W(""), [c, l] = W(""), [d, p] = W(!1), [m, h] = W(""), [g, v] = W({}), y = q(null), b = q(!1), x = q(null);return /* @__PURE__ */ J("form", {class: "configfieldset",- "data-fieldset-type": p ? "warning" : void 0,+ "data-fieldset-type": d ? "warning" : void 0,onSubmit: async (e) => {if (e.preventDefault(), b.current) return;- g("");- let i = {};- if (n.mode === "password" && !a && (i.current_password = "请输入当前访问密码"), p || ((c.length < 8 || c.length > 256) && (i.password = "访问密码需为 8–256 个字符"), c !== d && (i.confirmation = "两次输入的密码不一致")), v(i), Object.keys(i).length) {+ h("");+ let u = {};+ if (n.mode === "password" && !i && (u.current_password = "请输入当前访问密码"), d || ((o.length < 8 || o.length > 256) && (u.password = "访问密码需为 8–256 个字符"), o !== c && (u.confirmation = "两次输入的密码不一致")), v(u), Object.keys(u).length) {requestAnimationFrame(() => y.current?.querySelector("[aria-invalid=\"true\"]")?.focus());return;}- b.current = !0, u(x.current, !0);+ b.current = !0, _(x.current, !0);try {- let e = await V("/api/configuration/access", {+ let e = await B("/api/configuration/access", {revision: n.revision,- action: p ? "disable" : "set",- confirm_disable: p,- current_password: a,- password: p ? "" : c,- confirmation: p ? "" : d+ action: d ? "disable" : "set",+ confirm_disable: d,+ current_password: i,+ password: d ? "" : o,+ confirmation: d ? "" : c});- r(e), s(""), l(""), f(""), m(!1), v({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");+ r(e), a(""), s(""), l(""), p(!1), v({}), t(e.mode === "open" ? "已关闭访问密码" : "已保存访问密码");} catch (e) {- let t = e instanceof Ee ? e.body : null, n = t?.errors || t?.detail?.errors;- n ? v(n) : g(z(e));+ let t = e instanceof ke ? e.body : null, n = t?.errors || t?.detail?.errors;+ n ? v(n) : h(R(e));} finally {- b.current = !1, u(x.current, !1);+ b.current = !1, _(x.current, !1);}},"aria-labelledby": "accessTitle",@@ -541,7 +541,7 @@ function Ze({ initial: e, receipt: t }) {children: [/* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("accessTitle", "访问密码") } }), /* @__PURE__ */ J("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("accessTitle", "访问密码") } }), /* @__PURE__ */ J("p", {class: "confighelp",children: n.mode === "open" ? "未设置密码,能连接到 Peach 的设备可直接访问。" : n.mode === "legacy" ? "当前使用系统生成的访问口令。你可以设置自己的密码,或关闭登录要求。" : n.mode === "locked" ? "访问设置无法读取,请在本机检查配置文件。" : "已设置密码。新设备需要登录,保持登录时间在登录页选择。"})]@@ -552,8 +552,8 @@ function Ze({ initial: e, receipt: t }) {class: "pcheck",children: [/* @__PURE__ */ J("input", {type: "checkbox",- checked: p,- onChange: (e) => m(e.currentTarget.checked)+ checked: d,+ onChange: (e) => p(e.currentTarget.checked)}), /* @__PURE__ */ J("span", {"aria-hidden": "true",children: /* @__PURE__ */ J("svg", {@@ -563,38 +563,38 @@ function Ze({ initial: e, receipt: t }) {})]}), /* @__PURE__ */ J("span", { children: "关闭访问密码,允许能连接到 Peach 的设备直接访问" })]}) : null,- n.mode === "password" ? /* @__PURE__ */ J(Xe, {+ n.mode === "password" ? /* @__PURE__ */ J(Qe, {id: "access-current",label: "当前访问密码",- value: a,- onInput: s,- error: _.current_password,+ value: i,+ onInput: a,+ error: g.current_password,current: !0}) : null,- n.mode === "locked" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J(Xe, {+ n.mode === "locked" ? null : /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J(Qe, {id: "access-password",label: n.mode === "password" ? "新访问密码" : "设置访问密码",- value: c,- onInput: l,- disabled: p,- error: p ? void 0 : _.password,- help: p ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"- }), /* @__PURE__ */ J(Xe, {+ value: o,+ onInput: s,+ disabled: d,+ error: d ? void 0 : g.password,+ help: d ? "关闭访问密码时无需填写。" : "至少 8 个字符。保存后其他设备需要重新登录。"+ }), /* @__PURE__ */ J(Qe, {id: "access-confirm",label: "确认访问密码",- value: d,- onInput: f,- disabled: p,- error: p ? void 0 : _.confirmation+ value: c,+ onInput: l,+ disabled: d,+ error: d ? void 0 : g.confirmation})] }),- p && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: o("保存后,能连接到 Peach 的设备将直接访问馆藏。", {+ d && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: f("保存后,能连接到 Peach 的设备将直接访问馆藏。", {variant: "warning",label: "访问范围"}) } }),- h ? /* @__PURE__ */ J("p", {+ m ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",- children: h+ children: m}) : null]}), n.mode === "locked" ? null : /* @__PURE__ */ J("div", {@@ -610,7 +610,7 @@ function Ze({ initial: e, receipt: t }) {}//#endregion//#region src/islands/release-updates.tsx-var Qe = /* @__PURE__ */ new Set([+var et = /* @__PURE__ */ new Set(["downloading","verifying","extracting",@@ -618,74 +618,74 @@ var Qe = /* @__PURE__ */ new Set(["restarting","installing"]);-function $e({ initial: e, initialJob: t }) {- let [r, a] = W(e), [o, c] = W(t || {+function tt({ initial: e, initialJob: t }) {+ let [n, r] = W(e), [i, a] = W(t || {state: "idle",progress: 0- }), [l, d] = W(""), f = q(null), p = q(!0), m = q(!1), h = q(null);+ }), [o, s] = W(""), l = q(null), d = q(!0), m = q(!1), h = q(null);G(() => {- u(h.current, Qe.has(o.state));- }, [o.state]), G(() => () => {- p.current = !1, f.current?.abort();+ _(h.current, et.has(i.state));+ }, [i.state]), G(() => () => {+ d.current = !1, l.current?.abort();}, []);let g = async () => {- let e = await V("/api/configuration/update-restart", {});- p.current && c(e);+ let e = await B("/api/configuration/update-restart", {});+ d.current && a(e);};G(() => {- o.state !== "ready" || m.current || (m.current = !0, n({+ i.state !== "ready" || m.current || (m.current = !0, c({title: "更新已准备好",- body: `Peach ${o.version || ""} 将在重启后安装。`,+ body: `Peach ${i.version || ""} 将在重启后安装。`,confirmLabel: "立即重启",cancelLabel: "稍后",onConfirm: g}));- }, [o.state]), G(() => {- if (!Qe.has(o.state)) return;- let e = new AbortController(), t, n = 0, r = async () => {+ }, [i.state]), G(() => {+ if (!et.has(i.state)) return;+ let e = new AbortController(), t, n = 0, o = async () => {try {- let t = await B("/api/configuration/update-status", e.signal);- e.signal.aborted || (c(t), n = 0, t.state === "complete" && a((e) => ({+ let t = await z("/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,state: "current",message: "已是最新测试版。"})));} catch {- ++n >= 120 && !e.signal.aborted && d("尚未连接到 Peach,请检查托盘后刷新页面。");+ ++n >= 120 && !e.signal.aborted && s("尚未连接到 Peach,请检查托盘后刷新页面。");}- !e.signal.aborted && n < 120 && (t = setTimeout(r, 1e3));+ !e.signal.aborted && n < 120 && (t = setTimeout(o, 1e3));};- return t = setTimeout(r, 1e3), () => {+ return t = setTimeout(o, 1e3), () => {e.abort(), clearTimeout(t);};- }, [o.state]);- let _ = async (e) => {- if (f.current || Qe.has(o.state)) return;+ }, [i.state]);+ let v = async (e) => {+ if (l.current || et.has(i.state)) return;let t = new AbortController();- f.current = t, m.current = !1, d(""), u(e, !0);+ l.current = t, m.current = !1, s(""), _(e, !0);try {- let e = await V("/api/configuration/update", {}, "POST", t.signal);- t.signal.aborted || c(e);+ let e = await B("/api/configuration/update", {}, "POST", t.signal);+ t.signal.aborted || a(e);} catch (e) {- t.signal.aborted || d(z(e));+ t.signal.aborted || s(R(e));} finally {- f.current = null, u(e, !1);+ l.current = null, _(e, !1);}- }, v = async (t) => {- if (f.current) return;+ }, y = async (t) => {+ if (l.current) return;let n = new AbortController();- f.current = n, u(t, !0), d("");+ l.current = n, _(t, !0), s("");try {- let e = await B("/api/configuration/updates", n.signal);- n.signal.aborted || a(e);+ let e = await z("/api/configuration/updates", n.signal);+ n.signal.aborted || r(e);} catch (t) {- n.signal.aborted || (a({+ n.signal.aborted || (r({...e,state: "error"- }), d(z(t)));+ }), s(R(t)));} finally {- f.current = null, u(t, !1);+ l.current = null, _(t, !1);}};return /* @__PURE__ */ J("section", {@@ -695,34 +695,57 @@ function $e({ initial: e, initialJob: t }) {children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("configUpdatesTitle", "检查更新") } }),+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("configUpdatesTitle", "检查更新") } }),/* @__PURE__ */ J("dl", {class: "configfacts",children: [/* @__PURE__ */ J("dt", { children: "当前版本" }),- /* @__PURE__ */ J("dd", { children: r.current_version }),+ /* @__PURE__ */ J("dd", { children: n.current_version }),/* @__PURE__ */ J("dt", { children: "安装方式" }),- /* @__PURE__ */ J("dd", { children: r.installation }),+ /* @__PURE__ */ J("dd", { children: n.installation }),/* @__PURE__ */ J("dt", { children: "更新通道" }),- /* @__PURE__ */ J("dd", { children: r.channel }),+ /* @__PURE__ */ J("dd", { children: n.channel }),/* @__PURE__ */ J("dt", { children: "最新版本" }),- /* @__PURE__ */ J("dd", { children: r.latest_version || (r.state === "unchecked" ? "尚未检查" : "未取得") })+ /* @__PURE__ */ J("dd", { children: n.latest_version || (n.state === "unchecked" ? "尚未检查" : "未取得") })]}),- /* @__PURE__ */ J("p", {- class: l || r.state === "error" ? "configbad" : "confighelp",- role: l || r.state === "error" ? "alert" : "status",- children: l || r.message+ n.state === "available" && !o ? /* @__PURE__ */ J("div", {+ role: "status",+ dangerouslySetInnerHTML: { __html: f(n.message, { label: "有可用更新" }) }+ }) : /* @__PURE__ */ J("p", {+ class: o || n.state === "error" ? "configbad" : "confighelp",+ role: o || n.state === "error" ? "alert" : "status",+ children: o || n.message}),- o.state === "idle" ? null : /* @__PURE__ */ J("div", {+ i.state === "idle" ? null : /* @__PURE__ */ J("div", {"aria-live": "polite",children: [/* @__PURE__ */ J("p", {- class: o.state === "error" ? "configbad" : "confighelp",- children: o.message- }), o.state === "error" ? null : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: s(o.state === "downloading" ? "下载进度" : "安装进度", o.state === "downloading" ? o.downloaded || 0 : o.progress, o.state === "downloading" ? o.total || 1 : 100) } }), /* @__PURE__ */ J("p", {- class: "confighelp",- children: o.state === "downloading" && o.total ? `${((o.downloaded || 0) / 1048576).toFixed(1)} / ${(o.total / 1048576).toFixed(1)} MB` : `${o.progress}%`- })] })]+ class: i.state === "error" ? "configbad" : "confighelp",+ children: i.message+ }), i.state === "error" ? null : /* @__PURE__ */ J(I, { children: [+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: p("更新准备进度:下载、校验、解压、准备安装", i.progress, 100, { stops: [+ {+ value: 65,+ label: "下载结束"+ },+ {+ value: 67,+ label: "校验结束"+ },+ {+ value: 90,+ label: "准备安装"+ }+ ] }) } }),+ /* @__PURE__ */ J("p", {+ class: "confighelp",+ children: ["下载 → 校验 → 解压 → 准备安装 · ", i.message]+ }),+ /* @__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__ */ J("div", {@@ -731,18 +754,18 @@ function $e({ initial: e, initialJob: t }) {children: [/* @__PURE__ */ J("a", {class: "geist-button",- href: r.release_url,+ href: n.release_url,target: "_blank",rel: "noreferrer",children: "查看发布页"}),- o.state === "ready" ? /* @__PURE__ */ J("button", {+ i.state === "ready" ? /* @__PURE__ */ J("button", {type: "button",class: "geist-button primary",onClick: () => {- n({+ c({title: "更新已准备好",- body: `Peach ${o.version || ""} 将在重启后安装。`,+ body: `Peach ${i.version || ""} 将在重启后安装。`,confirmLabel: "立即重启",cancelLabel: "稍后",onConfirm: g@@ -750,18 +773,18 @@ function $e({ initial: e, initialJob: t }) {},children: "重启安装"}) : null,- r.state === "available" && r.installation === "独立测试包" && o.state !== "ready" ? /* @__PURE__ */ J("button", {+ n.state === "available" && n.installation === "独立测试包" && i.state !== "ready" ? /* @__PURE__ */ J("button", {ref: h,type: "button",class: "geist-button primary",- onClick: (e) => _(e.currentTarget),+ onClick: (e) => v(e.currentTarget),children: "下载并安装"}) : null,/* @__PURE__ */ J("button", {type: "button",class: "geist-button",- disabled: Qe.has(o.state),- onClick: (e) => v(e.currentTarget),+ disabled: et.has(i.state),+ onClick: (e) => y(e.currentTarget),children: "检查更新"})]@@ -770,11 +793,11 @@ function $e({ initial: e, initialJob: t }) {}//#endregion//#region src/islands/peach-proxy.tsx-function et({ initial: e, receipt: t }) {- let [n, r] = W(e), [a, o] = W(e.mode), [s, l] = W(""), [d, p] = W(""), m = q(!1), h = q(null), g = q(null), _ = q(new AbortController());- G(() => () => _.current.abort(), []), K(() => {- let t = h.current;- t.innerHTML = c([+function nt({ initial: e, receipt: t }) {+ let [n, r] = W(e), [i, a] = W(e.mode), [o, s] = W(""), [c, l] = W(""), d = q(!1), f = q(null), p = q(null), m = q(new AbortController());+ G(() => () => m.current.abort(), []), K(() => {+ let t = f.current;+ t.innerHTML = h([["environment", "系统代理"],["direct", "直连"],["proxy", "自定义"]@@ -783,24 +806,24 @@ function et({ initial: e, receipt: t }) {className: "configselect",attr: "data-fixed-width"});- let n = f(t.firstElementChild), r = () => o(n.value);+ let n = y(t.firstElementChild), r = () => a(n.value);return n.addEventListener("change", r), () => {n.removeEventListener("change", r), t.replaceChildren();};}, []);- async function v() {- if (!m.current) {- m.current = !0, u(g.current, !0), p("");+ async function g() {+ if (!d.current) {+ d.current = !0, _(p.current, !0), l("");try {- let e = await V("/api/configuration/peach-proxy", {- mode: a,- proxy: s- }, "POST", _.current.signal);- _.current.signal.aborted || (r(e), l(""), t("已保存 Peach 代理"));+ let e = await B("/api/configuration/peach-proxy", {+ mode: i,+ proxy: o+ }, "POST", m.current.signal);+ m.current.signal.aborted || (r(e), s(""), t("已保存 Peach 代理"));} catch (e) {- _.current.signal.aborted || p(z(e));+ m.current.signal.aborted || l(R(e));} finally {- m.current = !1, u(g.current, !1);+ d.current = !1, _(p.current, !1);}}}@@ -809,20 +832,20 @@ function et({ initial: e, receipt: t }) {class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {- e.preventDefault(), v();+ e.preventDefault(), g();},children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [/* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ J("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("peachProxyTitle", "Peach 代理") } }), /* @__PURE__ */ J("p", {class: "confighelp",children: "采集来源选择“Peach 代理”时共用此设置。"})]}),- /* @__PURE__ */ J("div", { ref: h }),- a === "proxy" && /* @__PURE__ */ J("div", {+ /* @__PURE__ */ J("div", { ref: f }),+ i === "proxy" && /* @__PURE__ */ J("div", {class: "configfield",children: [/* @__PURE__ */ J("label", {htmlFor: "peachProxyAddress",@@ -832,26 +855,26 @@ function et({ initial: e, receipt: t }) {class: "geist-input",type: "password",autoComplete: "off",- value: s,+ value: o,placeholder: n.proxy_saved ? "已保存,留空保留" : "http://127.0.0.1:7890",- onInput: (e) => l(e.currentTarget.value)+ onInput: (e) => s(e.currentTarget.value)})]}),n.needs_selection && /* @__PURE__ */ J("p", {class: "configbad",children: "已有来源的代理地址不同,请选择公共连接方式。"}),- d && /* @__PURE__ */ J("p", {+ c && /* @__PURE__ */ J("p", {class: "configbad",role: "alert",- children: d+ children: c})]}), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: /* @__PURE__ */ J("button", {- ref: g,+ ref: p,class: "geist-button primary",type: "submit",children: "保存代理"@@ -861,7 +884,7 @@ function et({ initial: e, receipt: t }) {}//#endregion//#region src/islands/desktop-settings.tsx-function tt({ label: e, checked: t, disabled: n, change: r }) {+function rt({ label: e, checked: t, disabled: n, change: r }) {return /* @__PURE__ */ J("label", {class: "configcheck",children: [/* @__PURE__ */ J("span", {@@ -881,7 +904,7 @@ function tt({ label: e, checked: t, disabled: n, change: r }) {}), /* @__PURE__ */ J("span", { children: e })]});}-function nt({ label: e, checked: t, disabled: n, change: r }) {+function it({ label: e, checked: t, disabled: n, change: r }) {return /* @__PURE__ */ J("label", {class: "configtoggle",children: [/* @__PURE__ */ J("span", { children: e }), /* @__PURE__ */ J("input", {@@ -894,20 +917,20 @@ function nt({ label: e, checked: t, disabled: n, change: r }) {})]});}-function rt({ startup: e, receipt: t }) {- let [n, r] = W(e.enabled), [a, o] = W(e.silent), [s, c] = W(""), l = q(!1), d = q(null);- async function f() {- if (!l.current) {- l.current = !0, u(d.current, !0), c("");+function at({ startup: e, receipt: t }) {+ let [n, r] = W(e.enabled), [i, a] = W(e.silent), [o, s] = W(""), c = q(!1), l = q(null);+ async function d() {+ if (!c.current) {+ c.current = !0, _(l.current, !0), s("");try {- await V("/api/configuration/startup", {+ await B("/api/configuration/startup", {enabled: n,- silent: a+ silent: i}), t("已保存开机自启");} catch (e) {- c(z(e));+ s(R(e));} finally {- l.current = !1, u(d.current, !1);+ c.current = !1, _(l.current, !1);}}}@@ -915,28 +938,28 @@ function rt({ startup: e, receipt: t }) {class: "configfieldset","data-geist-fieldset": !0,onSubmit: (e) => {- e.preventDefault(), f();+ e.preventDefault(), d();},children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("startupTitle", "开机自启") } }),+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("startupTitle", "开机自启") } }),/* @__PURE__ */ J("div", {class: "configoptions",role: "group","aria-labelledby": "startupTitle",- children: [/* @__PURE__ */ J(nt, {+ children: [/* @__PURE__ */ J(it, {label: "开机后启动 Peach",checked: n,disabled: !e.available,change: r}), /* @__PURE__ */ J("div", {class: "configoption",- children: [/* @__PURE__ */ J(nt, {+ children: [/* @__PURE__ */ J(it, {label: "静默启动",- checked: a,+ checked: i,disabled: !e.available,- change: o+ change: a}), /* @__PURE__ */ J("p", {class: "confighelp",children: "静默启动仅显示托盘。"@@ -947,17 +970,17 @@ function rt({ startup: e, receipt: t }) {class: "confighelp",children: e.message}),- s && /* @__PURE__ */ J("p", {+ o && /* @__PURE__ */ J("p", {class: "configbad",role: "alert",- children: s+ children: o})]}), /* @__PURE__ */ J("footer", {class: "geist-fieldset-footer","data-geist-fieldset-footer": !0,children: /* @__PURE__ */ J("button", {- ref: d,+ ref: l,type: "submit",class: "geist-button primary",disabled: !e.available,@@ -966,34 +989,34 @@ function rt({ startup: e, receipt: t }) {})]});}-function it({ data: e }) {+function ot({ data: e }) {let t = q(null);return K(() => {let n = t.current, r = document.createElement("details");r.className = "configdirectories";- let i = document.createElement("summary");- i.innerHTML = _("chevron-right") + "<span>数据目录</span>", r.append(i);+ let a = document.createElement("summary");+ a.innerHTML = i("chevron-right") + "<span>数据目录</span>", r.append(a);for (let t of [.../* @__PURE__ */ new Set([e.data_root, ...e.directories])]) {let e = document.createElement("p");e.className = "confighelp", e.textContent = t, r.append(e);}- return n.replaceChildren(r), d(n, "details", "uninstall-data"), () => n.replaceChildren();+ return n.replaceChildren(r), v(n, "details", "uninstall-data"), () => n.replaceChildren();}, [e]), /* @__PURE__ */ J("div", { ref: t });}-function at({ uninstall: e }) {- let [t, r] = W(!1), [a, o] = W("");- async function s() {- await n({+function st({ uninstall: e }) {+ let [t, n] = W(!1), [r, i] = W("");+ async function a() {+ await c({title: "卸载 Peach",danger: !0,body: t ? "将退出 Peach,移除程序、开机自启、设置、本地数据库、观看记录、凭据和缓存。原始媒体文件保留。" : "将退出 Peach 并移除程序和开机自启。设置、本地数据库、观看记录与缓存保留。",confirmLabel: "卸载 Peach",onConfirm: async () => {- let e = await V("/api/configuration/uninstall", {+ let e = await B("/api/configuration/uninstall", {delete_data: t,confirmation: "卸载 Peach"});- o(e.message);+ i(e.message);}});}@@ -1007,26 +1030,26 @@ function at({ uninstall: e }) {children: [/* @__PURE__ */ J("div", {class: "configfieldset-heading",- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ J("p", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("uninstallTitle", "卸载 Peach") } }), e.available && /* @__PURE__ */ J("p", {class: "confighelp",children: "卸载会退出 Peach、移除程序和开机自启。原始媒体文件保留。"})]}),- /* @__PURE__ */ J(tt, {+ /* @__PURE__ */ J(rt, {label: "完全卸载:同时删除设置、本地数据库、观看记录、凭据和缓存",checked: t,- disabled: !e.full_available || !!a,- change: r+ disabled: !e.full_available || !!r,+ change: n}),- /* @__PURE__ */ J(it, { data: e }),+ /* @__PURE__ */ J(ot, { data: e }),e.message && /* @__PURE__ */ J("p", {class: "confighelp",children: e.message}),- a && /* @__PURE__ */ J("p", {+ r && /* @__PURE__ */ J("p", {class: "confighelp",role: "status",- children: a+ children: r})]}), /* @__PURE__ */ J("footer", {@@ -1035,8 +1058,8 @@ function at({ uninstall: e }) {children: /* @__PURE__ */ J("button", {type: "button",class: "geist-button danger",- disabled: !e.available || !!a,- onClick: () => void s(),+ disabled: !e.available || !!r,+ onClick: () => void a(),children: "卸载 Peach"})})]@@ -1044,20 +1067,20 @@ function at({ uninstall: e }) {}//#endregion//#region src/islands/configuration.tsx-var ot = "/api/configuration", st = "/api/pick-folder", ct = 8e3, lt = (e, t) => B(ot, t), Y = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {+var ct = "/api/configuration", lt = "/api/pick-folder", ut = 8e3, dt = (e, t) => z(ct, t), ft = ({ html: e, class: t }) => /* @__PURE__ */ J("div", {class: t,dangerouslySetInnerHTML: { __html: e }-}), ut = (e) => !(e instanceof Ee) || e.status !== 400 ? null : e.body?.errors ?? null;-function dt({ facts: e }) {+}), pt = (e) => !(e instanceof ke) || e.status !== 400 ? null : e.body?.errors ?? null;+function mt({ facts: e }) {return /* @__PURE__ */ J("section", {class: "configfieldset","data-geist-fieldset": !0,"aria-labelledby": "configFactsTitle",children: /* @__PURE__ */ J("div", {class: "geist-fieldset-content",- children: [/* @__PURE__ */ J(Y, { html: i("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {+ children: [/* @__PURE__ */ J(ft, { html: u("configFactsTitle", "运行信息") }), /* @__PURE__ */ J("dl", {class: "configfacts",- 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", {+ children: e.map((e) => /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("dt", { children: e.term }), /* @__PURE__ */ J("dd", { children: [e.value, e.download_url ? /* @__PURE__ */ J("span", {class: "confighelp",children: [" ", /* @__PURE__ */ J("a", {href: e.download_url,@@ -1074,51 +1097,51 @@ function dt({ facts: e }) {})});}-function ft({ data: t }) {- let [n, r] = W(t.media_sources), [a, o] = W(""), s = q(null);- G(() => () => s.current?.abort(), []);- let c = async (e) => {- if (s.current) return;+function ht({ data: e }) {+ let [t, n] = W(e.media_sources), [r, i] = W(""), a = q(null);+ G(() => () => a.current?.abort(), []);+ let s = async (e) => {+ if (a.current) return;let t = new AbortController();- s.current = t, u(e, !0), o("");+ a.current = t, _(e, !0), i("");try {- let e = await B(ot, t.signal);- t.signal.aborted || r(e.media_sources);+ let e = await z(ct, t.signal);+ t.signal.aborted || n(e.media_sources);} catch (e) {- t.signal.aborted || o(z(e));+ t.signal.aborted || i(R(e));} finally {- s.current = null, u(e, !1);+ a.current = null, _(e, !1);}};- return n ? /* @__PURE__ */ J("section", {+ return t ? /* @__PURE__ */ J("section", {class: "configfieldset","aria-labelledby": "configMountsTitle",children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ J(Y, { html: i("configMountsTitle", "挂载状态") }),+ /* @__PURE__ */ J(ft, { html: u("configMountsTitle", "挂载状态") }),/* @__PURE__ */ J("dl", {class: "configfacts",- children: n.map((t) => /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {+ children: t.map((e) => /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("dt", { children: [/* @__PURE__ */ J("span", {"aria-hidden": "true",- dangerouslySetInnerHTML: { __html: l(e[t.location]) }+ dangerouslySetInnerHTML: { __html: g(o[e.location]) }}), {local: "本地磁盘",115: "CloudDrive · 115",pikpak: "CloudDrive · PikPak"- }[t.location] || t.location] }), /* @__PURE__ */ J("dd", { children: [- t.path || "未配置挂载点",+ }[e.location] || e.location] }), /* @__PURE__ */ J("dd", { children: [+ e.path || "未配置挂载点"," ",/* @__PURE__ */ J("span", {- class: `configstatus ${t.online === !0 ? "online" : t.online === !1 ? "offline" : "unknown"}`,- children: t.online === !0 ? "在线" : t.online === !1 ? "离线" : "未检测"+ class: `configstatus ${e.online === !0 ? "online" : e.online === !1 ? "offline" : "unknown"}`,+ children: e.online === !0 ? "在线" : e.online === !1 ? "离线" : "未检测"})] })] }))}),- a ? /* @__PURE__ */ J("p", {+ r ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",- children: a+ children: r}) : null]}), /* @__PURE__ */ J("div", {@@ -1127,73 +1150,73 @@ function ft({ data: t }) {children: /* @__PURE__ */ J("button", {type: "button",class: "geist-button",- onClick: (e) => c(e.currentTarget),+ onClick: (e) => s(e.currentTarget),children: "刷新挂载状态"})})]}) : null;}-function pt({ value: t, label: n, onChange: r }) {- let i = q(null), a = q(null), o = q(r);- return o.current = r, K(() => {- let r = i.current;- r.innerHTML = c([+function gt({ value: e, label: t, onChange: n }) {+ let r = q(null), i = q(null), a = q(n);+ return a.current = n, K(() => {+ let n = r.current;+ n.innerHTML = h([["local", "本地磁盘"],["115", "CloudDrive · 115"],["pikpak", "CloudDrive · PikPak"]- ].map(([t, n]) => [+ ].map(([e, t]) => [+ e,t,- n,- e[t]- ]), t, { label: n });- let s = f(r.firstElementChild);- a.current = s;- let l = () => o.current(s.value);- return s.addEventListener("change", l), () => {- a.current = null, s.disabled = !0, s.removeEventListener("change", l), r.replaceChildren();+ o[e]+ ]), e, { label: t });+ let s = y(n.firstElementChild);+ i.current = s;+ let c = () => a.current(s.value);+ return s.addEventListener("change", c), () => {+ i.current = null, s.disabled = !0, s.removeEventListener("change", c), n.replaceChildren();};- }, [n]), K(() => {- a.current && (a.current.value = t);- }, [t]), /* @__PURE__ */ J("div", {- ref: i,+ }, [t]), K(() => {+ i.current && (i.current.value = e);+ }, [e]), /* @__PURE__ */ J("div", {+ ref: r,class: "configsourcecontrol"});}-function mt({ data: e, receipt: t }) {+function _t({ data: e, receipt: t }) {let n = e.media_sources?.filter((e) => ["local","115","pikpak"- ].includes(e.location)), [r, a] = W(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [s, c] = W(n?.map((e) => e.location) ?? []), [l, d] = W(n?.map((e) => e.root) ?? []), [f, p] = W(String(e.port)), [m, h] = W(!1), [g, _] = W([]), [v, y] = W(""), [b, x] = W(""), [S, C] = W(null), [w, T] = W(null), E = q(!1), D = q(e.revision), O = q([]), k = q(null);+ ].includes(e.location)), [r, i] = W(n?.length ? n.map((e) => e.path) : e.media_dirs.length ? e.media_dirs : [""]), [a, o] = W(n?.map((e) => e.location) ?? []), [s, c] = W(n?.map((e) => e.root) ?? []), [l, d] = W(String(e.port)), [p, m] = W(!1), [h, g] = W([]), [v, y] = W(""), [b, x] = W(""), [S, C] = W(null), [w, T] = W(null), E = q(!1), D = q(e.revision), O = q([]), k = q(null);K(() => {w !== null && (O.current[w]?.focus(), T(null));}, [w]), G(() => {if (!S) return;- let e = setTimeout(() => location.assign(S.url), ct);+ let e = setTimeout(() => location.assign(S.url), ut);return () => clearTimeout(e);}, [S]);let A = (e, t) => {- a((n) => n.map((n, r) => r === e ? t : n));- }, j = () => {- T(r.length), a((e) => [...e, ""]);- }, ee = (e) => {- c((t) => t.filter((t, n) => n !== e)), d((t) => t.filter((t, n) => n !== e)), a((t) => t.filter((t, n) => n !== e)), _((t) => t.filter((t, n) => n !== e));- }, M = (e, t) => {- _((n) => {+ i((n) => n.map((n, r) => r === e ? t : n));+ }, ee = () => {+ T(r.length), i((e) => [...e, ""]);+ }, te = (e) => {+ o((t) => t.filter((t, n) => n !== e)), c((t) => t.filter((t, n) => n !== e)), i((t) => t.filter((t, n) => n !== e)), g((t) => t.filter((t, n) => n !== e));+ }, j = (e, t) => {+ g((n) => {let r = [...n];for (; r.length <= e;) r.push("");return r[e] = t, r;});- }, N = async (e, t) => {+ }, M = async (e, t) => {if (t.getAttribute("aria-busy") !== "true") {- u(t, !0);+ _(t, !0);try {- let { path: t } = await V(st, { initial: r[e] ?? "" });- t && (A(e, t), M(e, ""));+ let { path: t } = await B(lt, { initial: r[e] ?? "" });+ t && (A(e, t), j(e, ""));} catch (t) {- M(e, z(t));+ j(e, R(t));} finally {- u(t, !1);+ _(t, !1);}}};@@ -1222,25 +1245,25 @@ function mt({ data: e, receipt: t }) {"aria-labelledby": "configTitle",onSubmit: async (n) => {if (n.preventDefault(), !E.current) {- E.current = !0, u(k.current, !0), x("");+ E.current = !0, _(k.current, !0), x("");try {- let n = await V(ot, {+ let n = await B(ct, {revision: D.current,media_dirs: r,...e.media_sources ? { media_sources: r.map((e, t) => ({path: e,- location: s[t] || "local",- root: l[t] || ""+ location: a[t] || "local",+ root: s[t] || ""})) } : {},- port: f,- scan_now: m+ port: l,+ scan_now: p});- D.current = n.revision, _([]), y(""), t("已保存配置"), C(n);+ D.current = n.revision, g([]), y(""), t("已保存配置"), C(n);} catch (e) {- let t = ut(e);- t ? (_(t.media_dirs ?? []), y(t.port ?? "")) : (_([]), y(""), x(z(e)));+ let t = pt(e);+ t ? (g(t.media_dirs ?? []), y(t.port ?? "")) : (g([]), y(""), x(R(e)));} finally {- E.current = !1, u(k.current, !1);+ E.current = !1, _(k.current, !1);}}},@@ -1248,7 +1271,7 @@ function mt({ data: e, receipt: t }) {children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content",children: [- /* @__PURE__ */ J(Y, { html: i("configTitle", "这台电脑") }),+ /* @__PURE__ */ J(ft, { html: u("configTitle", "这台电脑") }),/* @__PURE__ */ J("div", {class: "configfield",children: [@@ -1273,7 +1296,7 @@ function mt({ data: e, receipt: t }) {type: "text",value: t,"aria-label": `媒体文件夹 ${n + 1}`,- "aria-invalid": g[n] ? "true" : void 0,+ "aria-invalid": h[n] ? "true" : void 0,onInput: (e) => A(n, e.currentTarget.value),ref: (e) => {O.current[n] = e;@@ -1283,7 +1306,7 @@ function mt({ data: e, receipt: t }) {type: "button",class: "geist-button configpick","aria-label": "选择文件夹",- onClick: (e) => N(n, e.currentTarget),+ onClick: (e) => M(n, e.currentTarget),children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24","aria-hidden": "true",@@ -1294,7 +1317,7 @@ function mt({ data: e, receipt: t }) {type: "button",class: "geist-button configrm","aria-label": "移除这个文件夹",- onClick: () => ee(n),+ onClick: () => te(n),children: /* @__PURE__ */ J("svg", {viewBox: "0 0 24 24","aria-hidden": "true",@@ -1305,29 +1328,29 @@ function mt({ data: e, receipt: t }) {class: "configsource",children: [/* @__PURE__ */ J("div", {class: "configsourcelabel",- children: ["媒体来源", /* @__PURE__ */ J(pt, {+ children: ["媒体来源", /* @__PURE__ */ J(gt, {label: `媒体来源 ${n + 1}`,- value: s[n] || "local",+ value: a[n] || "local",onChange: (e) => {- let t = [...s];- t[n] = e, c(t);+ let t = [...a];+ t[n] = e, o(t);}})]}), e.windows === !1 ? /* @__PURE__ */ J("label", { children: ["Windows 中的对应路径", /* @__PURE__ */ J("input", {class: "geist-input","aria-label": `Windows 中的对应路径 ${n + 1}`,- value: l[n] || "",+ value: s[n] || "",placeholder: "例如 B:\\\\",onInput: (e) => {- let t = [...l];- t[n] = e.currentTarget.value, d(t);+ let t = [...s];+ t[n] = e.currentTarget.value, c(t);}})] }) : null]}),- g[n] ? /* @__PURE__ */ J("p", {+ h[n] ? /* @__PURE__ */ J("p", {class: "configbad",role: "alert",- children: g[n]+ children: h[n]}) : null]}, n))@@ -1335,10 +1358,10 @@ function mt({ data: e, receipt: t }) {/* @__PURE__ */ J("button", {type: "button",class: "geist-button configadd",- onClick: j,+ onClick: ee,children: "添加文件夹"}),- s.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J("p", {+ a.some((e) => e === "115" || e === "pikpak") ? /* @__PURE__ */ J("p", {class: "confighelp",children: ["先在 CloudDrive 登录网盘并完成挂载。", /* @__PURE__ */ J("a", {href: "https://www.clouddrive2.com/help.html",@@ -1351,7 +1374,7 @@ function mt({ data: e, receipt: t }) {})]})]}) : null,- s.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ J("p", {+ a.some((e) => e === "115" || e === "pikpak") ? e.mount_dependencies?.filter((e) => !e.available).map((e) => /* @__PURE__ */ J("p", {class: "confighelp",children: ["未检测到 ",@@ -1391,9 +1414,9 @@ function mt({ data: e, receipt: t }) {class: "geist-input",type: "text",inputMode: "numeric",- value: f,+ value: l,"aria-invalid": v ? "true" : void 0,- onInput: (e) => p(e.currentTarget.value)+ onInput: (e) => d(e.currentTarget.value)}),v ? /* @__PURE__ */ J("p", {class: "configbad",@@ -1412,8 +1435,8 @@ function mt({ data: e, receipt: t }) {class: "pcheck",children: [/* @__PURE__ */ J("input", {type: "checkbox",- checked: m,- onChange: (e) => h(e.currentTarget.checked)+ checked: p,+ onChange: (e) => m(e.currentTarget.checked)}), /* @__PURE__ */ J("span", {"aria-hidden": "true",children: /* @__PURE__ */ J("svg", {@@ -1423,7 +1446,7 @@ function mt({ data: e, receipt: t }) {})]}), /* @__PURE__ */ J("span", { children: "保存后扫描并补全资料" })]}),- b ? /* @__PURE__ */ J(Y, { html: o(b, {+ b ? /* @__PURE__ */ J(ft, { html: f(b, {variant: "error",label: "没有保存"}) }) : null@@ -1440,10 +1463,10 @@ function mt({ data: e, receipt: t }) {})]});}-function ht({ receipt: e, data: t, error: n }) {- return n || !t ? /* @__PURE__ */ J(Y, {+function vt({ receipt: e, data: t, error: n }) {+ return n || !t ? /* @__PURE__ */ J(ft, {class: "configpage",- html: o(n || "没有读到配置", {+ html: f(n || "没有读到配置", {variant: "error",label: "打不开配置"})@@ -1454,7 +1477,7 @@ function ht({ receipt: e, data: t, error: n }) {class: "configgroup",children: "通用"}) : null,- t.startup ? /* @__PURE__ */ J(rt, {+ t.startup ? /* @__PURE__ */ J(at, {startup: t.startup,receipt: e}) : null,@@ -1462,23 +1485,23 @@ function ht({ receipt: e, data: t, error: n }) {class: "configgroup",children: "媒体"}),- t.editable ? /* @__PURE__ */ J(mt, {+ t.editable ? /* @__PURE__ */ J(_t, {data: t,receipt: e- }) : /* @__PURE__ */ J(Y, { html: o(t.notice, {+ }) : /* @__PURE__ */ J(ft, { html: f(t.notice, {variant: "secondary",label: "只读"}) }),- /* @__PURE__ */ J(ft, { data: t }),+ /* @__PURE__ */ J(ht, { data: t }),t.peach_proxy || t.access ? /* @__PURE__ */ J("h2", {class: "configgroup",children: "网络与访问"}) : null,- t.peach_proxy ? /* @__PURE__ */ J(et, {+ t.peach_proxy ? /* @__PURE__ */ J(nt, {initial: t.peach_proxy,receipt: e}) : null,- t.access ? /* @__PURE__ */ J(Ze, {+ t.access ? /* @__PURE__ */ J($e, {initial: t.access,receipt: e}) : null,@@ -1486,34 +1509,34 @@ function ht({ receipt: e, data: t, error: n }) {class: "configgroup",children: "更新与维护"}),- t.updates ? /* @__PURE__ */ J($e, {+ t.updates ? /* @__PURE__ */ J(tt, {initial: t.updates,initialJob: t.update_job}) : null,- /* @__PURE__ */ J(dt, { facts: t.facts }),- t.uninstall ? /* @__PURE__ */ J(at, { uninstall: t.uninstall }) : null+ /* @__PURE__ */ J(mt, { facts: t.facts }),+ t.uninstall ? /* @__PURE__ */ J(st, { uninstall: t.uninstall }) : null]});}//#endregion//#region node_modules/@preact/signals-core/dist/signals-core.module.js-var gt = Symbol.for("preact-signals");-function _t() {- if (Z > 1) Z--;+var yt = Symbol.for("preact-signals");+function bt() {+ if (X > 1) X--;else {var e, t = !1;for ((function() {- var e = Tt;- for (Tt = void 0; e !== void 0;) {+ var e = Ot;+ for (Ot = 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;}- })(); xt !== void 0;) {- var n = xt;- for (xt = void 0, St++; n !== void 0;) {+ })(); wt !== void 0;) {+ var n = wt;+ for (wt = void 0, Tt++; n !== void 0;) {var r = n.u;- if (n.u = void 0, n.f &= -3, !(8 & n.f) && kt(n)) try {+ if (n.u = void 0, n.f &= -3, !(8 & n.f) && Mt(n)) try {n.c();} catch (n) {t ||= (e = n, !0);@@ -1521,116 +1544,116 @@ function _t() {n = r;}}- if (St = 0, Z--, t) throw e;+ if (Tt = 0, X--, t) throw e;}}-function vt(e) {- if (Z > 0) return e();- wt = ++Ct, Z++;+function xt(e) {+ if (X > 0) return e();+ Dt = ++Et, X++;try {return e();} finally {- _t();+ bt();}}-var yt, X = void 0;-function bt(e) {- var t = X, n = yt;- X = void 0, yt = void 0;+var St, Y = void 0;+function Ct(e) {+ var t = Y, n = St;+ Y = void 0, St = void 0;try {return e();} finally {- X = t, yt = n;+ Y = t, St = n;}}-var xt = void 0, Z = 0, St = 0, Ct = 0, wt = 0, Tt = void 0, Et = 0;-function Dt(e) {- if (X !== void 0) {+var wt = void 0, X = 0, Tt = 0, Et = 0, Dt = 0, Ot = void 0, kt = 0;+function At(e) {+ if (Y !== void 0) {var t = e.n;- if (t === void 0 || t.t !== X) return t = {+ if (t === void 0 || t.t !== Y) return t = {i: 0,S: e,- p: X.s,+ p: Y.s,n: void 0,- t: X,+ t: Y,e: void 0,x: void 0,r: t- }, X.s !== void 0 && (X.s.n = t), X.s = t, e.n = t, 32 & X.f && e.S(t), t;- if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = X.s, t.n = void 0, X.s.n = t, X.s = t), t;+ }, Y.s !== void 0 && (Y.s.n = t), Y.s = t, e.n = t, 32 & Y.f && e.S(t), t;+ if (t.i === -1) return t.i = 0, t.n !== void 0 && (t.n.p = t.p, t.p !== void 0 && (t.p.n = t.n), t.p = Y.s, t.n = void 0, Y.s.n = t, Y.s = t), t;}}-function Q(e, t) {+function Z(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 = gt, Q.prototype.h = function() {+Z.prototype.brand = yt, Z.prototype.h = function() {return !0;-}, Q.prototype.S = function(e) {+}, Z.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 ? bt(function() {+ n !== e && e.e === void 0 && (e.x = n, this.t = e, n === void 0 ? Ct(function() {var e;(e = t.W) == null || e.call(t);}) : n.e = e);-}, Q.prototype.U = function(e) {+}, Z.prototype.U = function(e) {var t = this;if (this.t !== void 0) {var n = e.e, r = e.x;- n !== void 0 && (n.x = r, e.e = void 0), r !== void 0 && (r.e = n, e.x = void 0), e === this.t && (this.t = r, r === void 0 && bt(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 && Ct(function() {var e;(e = t.Z) == null || e.call(t);}));}-}, Q.prototype.subscribe = function(e) {+}, Z.prototype.subscribe = function(e) {var t = this;- return Lt(function() {+ return Bt(function() {var n = t.value;- bt(function() {+ Ct(function() {return e(n);});}, { name: "sub" });-}, Q.prototype.valueOf = function() {+}, Z.prototype.valueOf = function() {return this.value;-}, Q.prototype.toString = function() {+}, Z.prototype.toString = function() {return this.value + "";-}, Q.prototype.toJSON = function() {+}, Z.prototype.toJSON = function() {return this.value;-}, Q.prototype.peek = function() {+}, Z.prototype.peek = function() {var e = this;- return bt(function() {+ return Ct(function() {return e.value;});-}, Object.defineProperty(Q.prototype, "value", {+}, Object.defineProperty(Z.prototype, "value", {get: function() {- var e = Dt(this);+ var e = At(this);return e !== void 0 && (e.i = this.i), this.v;},set: function(e) {if (e !== this.v) {- if (St > 100) throw Error("Cycle detected");+ if (Tt > 100) throw Error("Cycle detected");(function(e) {- Z !== 0 && St === 0 && e.l !== wt && (e.l = wt, Tt = {+ X !== 0 && Tt === 0 && e.l !== Dt && (e.l = Dt, Ot = {S: e,v: e.v,i: e.i,- o: Tt+ o: Ot});- })(this), this.v = e, this.i++, Et++, Z++;+ })(this), this.v = e, this.i++, kt++, X++;try {for (var t = this.t; t !== void 0; t = t.x) t.t.N();} finally {- _t();+ bt();}}}});-function Ot(e, t) {- return new Q(e, t);+function jt(e, t) {+ return new Z(e, t);}-function kt(e) {+function Mt(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 At(e) {+function Nt(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) {@@ -1639,81 +1662,81 @@ function At(e) {}}}-function jt(e) {+function Pt(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 $(e, t) {- Q.call(this, void 0, t), this.x = e, this.s = void 0, this.g = Et - 1, this.f = 4;+function Q(e, t) {+ Z.call(this, void 0, t), this.x = e, this.s = void 0, this.g = kt - 1, this.f = 4;}-$.prototype = new Q(), $.prototype.h = function() {+Q.prototype = new Z(), Q.prototype.h = function() {if (this.f &= -3, 1 & this.f) return !1;- if ((36 & this.f) == 32 || (this.f &= -5, this.g === Et)) return !0;- if (this.g = Et, this.f |= 1, this.i > 0 && !kt(this)) return this.f &= -2, !0;- var e = X;+ if ((36 & this.f) == 32 || (this.f &= -5, this.g === kt)) return !0;+ if (this.g = kt, this.f |= 1, this.i > 0 && !Mt(this)) return this.f &= -2, !0;+ var e = Y;try {- At(this), X = this;+ Nt(this), Y = 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, jt(this), this.f &= -2, !0;-}, $.prototype.S = function(e) {+ return Y = e, Pt(this), this.f &= -2, !0;+}, Q.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);-}, $.prototype.U = function(e) {- if (this.t !== void 0 && (Q.prototype.U.call(this, e), this.t === void 0)) {+ Z.prototype.S.call(this, e);+}, Q.prototype.U = function(e) {+ if (this.t !== void 0 && (Z.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);}-}, $.prototype.N = function() {+}, Q.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($.prototype, "value", { get: function() {+}, Object.defineProperty(Q.prototype, "value", { get: function() {if (1 & this.f) throw Error("Cycle detected");- var e = Dt(this);+ var e = At(this);if (this.h(), e !== void 0 && (e.i = this.i), 16 & this.f) throw this.v;return this.v;} });-function Mt(e, t) {- return new $(e, t);+function Ft(e, t) {+ return new Q(e, t);}-function Nt(e) {+function It(e) {var t = e.m;if (e.m = void 0, typeof t == "function") {- Z++;- var n = X;- X = void 0;+ X++;+ var n = Y;+ Y = void 0;try {t();} catch (t) {- throw e.f &= -2, e.f |= 8, Pt(e), t;+ throw e.f &= -2, e.f |= 8, Lt(e), t;} finally {- X = n, _t();+ Y = n, bt();}}}-function Pt(e) {+function Lt(e) {for (var t = e.s; t !== void 0; t = t.n) t.S.U(t);- e.x = void 0, e.s = void 0, Nt(e);+ e.x = void 0, e.s = void 0, It(e);}-function Ft(e) {- if (X !== this) throw Error("Out-of-order effect");- jt(this), X = e, this.f &= -2, 8 & this.f && Pt(this), _t();+function Rt(e) {+ if (Y !== this) throw Error("Out-of-order effect");+ Pt(this), Y = e, this.f &= -2, 8 & this.f && Lt(this), bt();}-function It(e, t) {- this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, yt && yt.push(this);+function zt(e, t) {+ this.x = e, this.m = void 0, this.s = void 0, this.u = void 0, this.f = 32, this.name = t?.name, St && St.push(this);}-It.prototype.c = function() {+zt.prototype.c = function() {var e = this.S();try {if (8 & this.f || this.x === void 0) return;@@ -1722,20 +1745,20 @@ It.prototype.c = function() {} finally {e();}-}, It.prototype.S = function() {+}, zt.prototype.S = function() {if (1 & this.f) throw Error("Cycle detected");- this.f |= 1, this.f &= -9, Nt(this), At(this), Z++;- var e = X;- return X = this, Ft.bind(this, e);-}, It.prototype.N = function() {- 2 & this.f || (this.f |= 2, this.u = xt, xt = this);-}, It.prototype.d = function() {- this.f |= 8, 1 & this.f || Pt(this);-}, It.prototype.dispose = function() {+ this.f |= 1, this.f &= -9, It(this), Nt(this), X++;+ var e = Y;+ return Y = this, Rt.bind(this, e);+}, zt.prototype.N = function() {+ 2 & this.f || (this.f |= 2, this.u = wt, wt = this);+}, zt.prototype.d = function() {+ this.f |= 8, 1 & this.f || Lt(this);+}, zt.prototype.dispose = function() {this.d();};-function Lt(e, t) {- var n = new It(e, t);+function Bt(e, t) {+ var n = new zt(e, t);try {n.c();} catch (e) {@@ -1746,35 +1769,35 @@ function Lt(e, t) {}//#endregion//#region node_modules/@preact/signals/dist/signals.module.js-var Rt, zt, Bt = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Vt = [];-Lt(function() {- Rt = this.N;+var Vt, Ht, Ut = typeof window < "u" && !!window.__PREACT_SIGNALS_DEVTOOLS__, Wt = [];+Bt(function() {+ Vt = this.N;})();-function Ht(e, t) {- y[e] = t.bind(null, y[e] || function() {});+function $(e, t) {+ x[e] = t.bind(null, x[e] || function() {});}-function Ut(e) {- if (zt) {- var t = zt;- zt = void 0, t();+function Gt(e) {+ if (Ht) {+ var t = Ht;+ Ht = void 0, t();}- zt = e && e.S();+ Ht = e && e.S();}-function Wt(e) {- var t = this, n = e.data, r = Kt(n);+function Kt(e) {+ var t = this, n = e.data, r = Jt(n);r.name = "ReactiveDom", r.value = n;- var i = Ve(function() {+ var i = Ue(function() {for (var e = t, n = t.__v; n = n.__;) if (n.__c) {n.__c.__$f |= 4;break;}- var i = Mt(function() {+ var i = Ft(function() {var e = r.value.value;return e === 0 ? 0 : !0 === e ? "" : e || "";- }), a = Mt(function() {- return !Array.isArray(i.value) && !x(i.value);- }), o = Lt(function() {- if (this.N = Yt, a.value) {+ }), a = Ft(function() {+ return !Array.isArray(i.value) && !C(i.value);+ }), o = Bt(function() {+ if (this.N = Zt, a.value) {var t = i.value;e.__v && e.__v.__e && e.__v.__e.nodeType === 3 && (e.__v.__e.data = t);}@@ -1785,14 +1808,14 @@ function Wt(e) {}, []), a = i[0], o = i[1];return a.value ? o.peek() : o.value;}-Wt.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {+Kt.displayName = "ReactiveTextNode", Object.defineProperties(Z.prototype, {constructor: {configurable: !0,value: void 0},type: {configurable: !0,- value: Wt+ value: Kt},props: {configurable: !0,@@ -1807,35 +1830,35 @@ Wt.displayName = "ReactiveTextNode", Object.defineProperties(Q.prototype, {configurable: !0,value: 1}-}), Ht("__b", function(e, t) {+}), $("__b", function(e, t) {if (typeof t.type == "string") {var n, r = t.props;for (var i in r) if (i !== "children") {var a = r[i];- a instanceof Q && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());+ a instanceof Z && (n || (t.__np = n = {}), n[i] = a, r[i] = a.peek());}}e(t);-}), Ht("__r", function(e, t) {- if (e(t), t.type !== L) {- Ut();+}), $("__r", function(e, t) {+ if (e(t), t.type !== I) {+ Gt();var n, r = t.__c;r && (r.__$f &= -2, (n = r.__$u) === void 0 && (r.__$u = n = function(e, t) {var n;- return Lt(function() {+ return Bt(function() {n = this;}, { name: t }), n.c = e, n;}(function(e) {return function() {var t;- Bt && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});+ Ut && ((t = this.y) == null || t.call(this)), e.__$f |= 1, e.setState({});};- }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Ut(n);+ }(r), typeof t.type == "function" ? t.type.displayName || t.type.name : ""))), Gt(n);}-}), Ht("__e", function(e, t, n, r) {- Ut(), e(t, n, r);-}), Ht("diffed", function(e, t) {- Ut();+}), $("__e", function(e, t, n, r) {+ Gt(), e(t, n, r);+}), $("diffed", function(e, t) {+ Gt();var n;if (typeof t.type == "string" && (n = t.__e)) {var r = t.__np, i = t.props, a = n.U;@@ -1845,25 +1868,25 @@ Wt.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 = Gt(n, c, u, i), a[c] = l) : l.o(u, i);+ l === void 0 ? (l = qt(n, c, u, i), a[c] = l) : l.o(u, i);}}e(t);});-function Gt(e, t, n, r) {- var i = t in e && e.ownerSVGElement === void 0, a = Ot(n);+function qt(e, t, n, r) {+ var i = t in e && e.ownerSVGElement === void 0, a = jt(n);return {o: function(e, t) {a.value = e, r = t;},- d: Lt(function() {- this.N = Yt;+ d: Bt(function() {+ this.N = Zt;var n = a.value.value;r[t] !== n && (r[t] = n, i ? e[t] = n : n != null && (!1 !== n || t[4] === "-") ? e.setAttribute(t, n) : e.removeAttribute(t));})};}-Ht("unmount", function(e, t) {+$("unmount", function(e, t) {if (typeof t.type == "string") {var n = t.__e;if (n) {@@ -1887,9 +1910,9 @@ Ht("unmount", function(e, t) {}}e(t);-}), Ht("__h", function(e, t, n, r) {+}), $("__h", function(e, t, n, r) {r < 3 && (t.__$f |= 2), e(t, n, r);-}), ie.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;@@ -1901,73 +1924,73 @@ Ht("unmount", function(e, t) {for (var s in this.props) if (!(s in e)) return !0;return !1;};-function Kt(e, t) {- return Ve(function() {- return Ot(e, t);+function Jt(e, t) {+ return Ue(function() {+ return jt(e, t);}, []);}-var qt = function(e) {+var Yt = function(e) {queueMicrotask(function() {queueMicrotask(e);});};-function Jt() {- vt(function() {- for (var e; e = Vt.shift();) Rt.call(e);+function Xt() {+ xt(function() {+ for (var e; e = Wt.shift();) Vt.call(e);});}-function Yt() {- Vt.push(this) === 1 && (y.requestAnimationFrame || qt)(Jt);+function Zt() {+ Wt.push(this) === 1 && (x.requestAnimationFrame || Yt)(Xt);}//#endregion//#region src/state/quality-goals.ts-var Xt = "/api/quality-goals?limit=200", Zt = {+var Qt = "/api/quality-goals?limit=200", $t = {data: null,error: ""-}, Qt = Ot(Zt), $t = 0, en = Mt(() => Qt.value);-Mt(() => Qt.value.data?.total ?? null);-function tn() {- $t += 1, Qt.value = Zt;+}, en = jt($t), tn = 0, nn = Ft(() => en.value);+Ft(() => en.value.data?.total ?? null);+function rn() {+ tn += 1, en.value = $t;}-async function nn(e) {- let t = $t += 1;+async function an(e) {+ let t = tn += 1;try {- let n = await B(Xt, e);- return t === $t && (Qt.value = {+ let n = await z(Qt, e);+ return t === tn && (en.value = {data: n,error: ""}), n;} catch (n) {- throw !e?.aborted && t === $t && (Qt.value = {+ throw !e?.aborted && t === tn && (en.value = {data: null,- error: z(n)+ error: R(n)}), n;}}//#endregion//#region src/islands/quality-goals.tsx-var rn = (e, t) => nn(t), an = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;-function on({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {- let { data: a, error: s } = en.value;- if (s) return /* @__PURE__ */ J("div", {+var on = (e, t) => an(t), sn = (e) => e.has_cover ? `/cover?code=${encodeURIComponent(e.code ?? "")}` : `/poster?id=${e.id}&c=4`;+function cn({ openItem: t, javTitleHtml: i, javDisplayName: a, srcBadge: o }) {+ let { data: s, error: c } = nn.value;+ if (c) return /* @__PURE__ */ J("div", {class: "qualitylist",- dangerouslySetInnerHTML: { __html: o(s, {+ dangerouslySetInnerHTML: { __html: f(c, {variant: "error",label: "读取失败"}) }});- let c = a?.items ?? [];- return c.length ? /* @__PURE__ */ J("div", {+ let u = s?.items ?? [];+ return u.length ? /* @__PURE__ */ J("div", {class: "qualitylist",- children: c.map((r) => /* @__PURE__ */ J("article", {+ children: u.map((s) => /* @__PURE__ */ J("article", {class: "qualityitem",children: [/* @__PURE__ */ J("button", {class: "qualitycover",type: "button",- "aria-label": `打开 ${n(r)}`,- onClick: () => e(r.id),+ "aria-label": `打开 ${a(s)}`,+ onClick: () => t(s.id),children: /* @__PURE__ */ J("img", {- src: an(r),+ src: sn(s),alt: "",loading: "lazy",onError: (e) => e.currentTarget.remove()@@ -1976,32 +1999,32 @@ function on({ openItem: e, javTitleHtml: t, javDisplayName: n, srcBadge: i }) {/* @__PURE__ */ J("h3", { children: /* @__PURE__ */ J("button", {type: "button","data-middle-truncate": !0,- onClick: () => e(r.id),- dangerouslySetInnerHTML: { __html: t(r) }+ onClick: () => t(s.id),+ dangerouslySetInnerHTML: { __html: i(s) }}) }),/* @__PURE__ */ J("p", {class: "mono",children: [/* @__PURE__ */ J("span", {style: "display:contents",- dangerouslySetInnerHTML: { __html: i(r.location, r.cost) }+ dangerouslySetInnerHTML: { __html: o(s.location, s.cost) }}),- /* @__PURE__ */ J("span", { children: p[r.location] ?? r.location }),- /* @__PURE__ */ J("span", { children: h(r.duration) }),- /* @__PURE__ */ J("span", { children: g(r.size ?? 0) })+ /* @__PURE__ */ J("span", { children: e[s.location] ?? s.location }),+ /* @__PURE__ */ J("span", { children: n(s.duration) }),+ /* @__PURE__ */ J("span", { children: r(s.size ?? 0) })]}),- r.reason ? /* @__PURE__ */ J("p", { children: r.reason }) : null+ s.reason ? /* @__PURE__ */ J("p", { children: s.reason }) : null] })]- }, r.id))+ }, s.id))}) : /* @__PURE__ */ J("div", {class: "qualitylist",- dangerouslySetInnerHTML: { __html: r("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }+ dangerouslySetInnerHTML: { __html: l("sparkles", "没有标记中的高清版目标", "现有版本都已满足条件,或还没有加入追踪。") }});}//#endregion//#region src/jobs.ts-async function sn(e) {+async function ln(e) {let t = e.pause || ((e) => new Promise((t) => setTimeout(t, e))), n = 0;for (; e.active();) {let r;@@ -2016,11 +2039,11 @@ async function sn(e) {await t(2e3);}}-function cn(e) {+function un(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;- sn({+ ln({read: e.read,active: () => !i && e.active() && t.isConnected,keepWatching: e.watchIdle !== !1,@@ -2028,7 +2051,7 @@ function cn(e) {let o = a.status === "running";if (e.host.hidden = !o, e.busy(o), o) {r = a.job_id, r && sessionStorage.setItem(n, r);- let i = a.current, o = (i?.attempt || 1) > 1 ? ` · 第 ${i?.attempt}/${i?.max_attempts} 次尝试${i?.retry_in ? `,${i.retry_in} 秒后重试` : ""}` : "", s = (e.title || (a.total ? `${a.older ? "抓取历史" : "检查更新"}:已完成 ${a.checked || 0}/${a.total} 个来源` : "正在准备检查任务…")) + (i ? ` · ${i.label || i.provider || ""}${o}` : ""), c = e.loading(s) + ((a.total || 0) > 0 ? e.progress(a.checked || 0, a.total) : "");+ 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 {@@ -2046,13 +2069,13 @@ function cn(e) {}//#endregion//#region src/islands/scraping.tsx-var ln = (e, t) => B("/api/scraping", t);-function un({ value: e, onChange: t }) {+var dn = (e, t) => z("/api/scraping", t);+function fn({ value: e, onChange: t }) {let n = q(null), r = q(t);return r.current = t, K(() => {let t = n.current;- t.innerHTML = c([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });- let i = f(t.firstElementChild), a = () => r.current(i.value);+ t.innerHTML = h([["peach", "Peach 代理"], ["direct", "直接连接"]], e, { label: "连接方式" });+ let i = y(t.firstElementChild), a = () => r.current(i.value);return i.addEventListener("change", a), () => {i.disabled = !0, i.removeEventListener("change", a), t.replaceChildren();};@@ -2061,32 +2084,32 @@ function un({ value: e, onChange: t }) {class: "scraping-network"});}-function dn({ source: e, toast: t }) {- let [n, r] = W(e), [a, s] = W(e.network), [c, l] = W(""), [d, f] = W(""), [p, m] = W("paste"), [h, g] = W(""), [_, v] = W(!1), [y, b] = W(""), [x, S] = W([]), C = q(null), w = q(null);+function pn({ source: e, toast: t }) {+ let [n, r] = W(e), [i, a] = W(e.network), [o, s] = W(""), [c, l] = W(""), [d, p] = W("paste"), [m, h] = W(""), [g, v] = W(!1), [y, b] = W(""), [x, S] = W([]), C = q(null), w = q(null);K(() => {- w.current?.querySelectorAll("footer button").forEach((e) => u(e, _));- }, [_]);+ w.current?.querySelectorAll("footer button").forEach((e) => _(e, g));+ }, [g]);let T = q(new AbortController());G(() => () => T.current.abort(), []);async function E(n) {- if (!_) {+ if (!g) {v(!0), b(""), S([]);try {if (n === "check") {- let t = await V("/api/scraping/check", { source: e.source }, "POST", T.current.signal);+ let t = await B("/api/scraping/check", { source: e.source }, "POST", T.current.signal);T.current.signal.aborted || S(t.results);} else {- let i = await V("/api/scraping/settings", {+ let a = await B("/api/scraping/settings", {source: e.source,- network: a,- cookie: c,- cookies_text: d,+ network: i,+ cookie: o,+ cookies_text: c,revoke: n === "revoke"}, "POST", T.current.signal);- T.current.signal.aborted || (r(i.saved), l(""), f(""), g(""), C.current && (C.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));+ T.current.signal.aborted || (r(a.saved), s(""), l(""), h(""), C.current && (C.current.value = ""), t(n === "revoke" ? "Cookie 已撤销" : "来源设置已保存"));}} catch (e) {- T.current.signal.aborted || b(z(e));+ T.current.signal.aborted || b(R(e));} finally {T.current.signal.aborted || v(!1);}@@ -2106,7 +2129,7 @@ function dn({ source: e, toast: t }) {children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-heading",- children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {+ children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u(`scraping-${e.source}`, e.label) } }), /* @__PURE__ */ J("a", {class: "scraping-url",href: e.login,target: "_blank",@@ -2116,17 +2139,17 @@ function dn({ source: e, toast: t }) {}),/* @__PURE__ */ J("div", {class: "scraping-label",- children: ["连接方式", /* @__PURE__ */ J(un, {- value: a,- onChange: s+ children: ["连接方式", /* @__PURE__ */ J(fn, {+ value: i,+ onChange: a})]}),- a === "peach" && /* @__PURE__ */ J("a", {+ i === "peach" && /* @__PURE__ */ J("a", {class: "geist-text-link",href: "/configuration#peachProxy",children: "配置 Peach 代理"}),- e.accepts_cookie && /* @__PURE__ */ J(L, { children: [+ e.accepts_cookie && /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("p", { children: n.cookie_saved ? "Cookie 已保存,登录是否有效请在抓取时确认。" : "需要登录时,任选一种方式提供 Cookie。" }),/* @__PURE__ */ J("div", {class: "insightswitch scraping-cookie-method",@@ -2136,19 +2159,19 @@ function dn({ source: e, toast: t }) {type: "radio",name: `cookie-method-${e.source}`,value: t,- checked: p === t,+ checked: d === t,onChange: () => {- m(t), l(""), f(""), g("");+ p(t), s(""), l(""), h("");}}), /* @__PURE__ */ J("span", { children: n })] }, t))}),- p === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {+ d === "paste" ? /* @__PURE__ */ J("label", { children: ["Cookie", /* @__PURE__ */ J("input", {class: "geist-input",type: "password",autoComplete: "off",- value: c,- disabled: _,- onInput: (e) => l(e.currentTarget.value)+ value: o,+ disabled: g,+ onInput: (e) => s(e.currentTarget.value)})] }) : /* @__PURE__ */ J("label", {class: "scraping-file",children: ["Netscape Cookie 文件(.txt)", /* @__PURE__ */ J("span", {@@ -2160,27 +2183,27 @@ function dn({ source: e, toast: t }) {}),/* @__PURE__ */ J("span", {class: "scraping-file-name",- children: h || "未选择文件"+ children: m || "未选择文件"}),/* @__PURE__ */ J("input", {ref: C,type: "file",accept: ".txt",- disabled: _,+ disabled: g,onChange: async (e) => {let t = e.currentTarget.files?.[0];if (!t) {- f(""), g("");+ l(""), h("");return;}- if (f(""), t.size > 262144) {+ if (l(""), t.size > 262144) {b("Cookie 文本超过 256 KiB"), e.currentTarget.value = "";return;}v(!0);try {let e = await t.text();- T.current.signal.aborted || (f(e), g(t.name));+ T.current.signal.aborted || (l(e), h(t.name));} catch {T.current.signal.aborted || b("Cookie 文件未读取,请重新选择");} finally {@@ -2194,11 +2217,11 @@ function dn({ source: e, toast: t }) {] }),y && /* @__PURE__ */ J("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(y, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: f(y, { variant: "error" }) }}),x.map((t) => /* @__PURE__ */ J("div", {role: "status",- dangerouslySetInnerHTML: { __html: o(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }+ dangerouslySetInnerHTML: { __html: f(`${e.label}${t.label === "来源页面" ? "" : " 高清图片"}:${t.ok ? "可连接" : "不能连接"}` + (t.width ? ` · ${t.width} × ${t.height}` : "") + (t.message ? `。${t.message}` : ""), { variant: t.ok ? "success" : "error" }) }}, t.label))]}), /* @__PURE__ */ J("footer", {@@ -2227,35 +2250,35 @@ function dn({ source: e, toast: t }) {})});}-function fn({ data: e, error: t, toast: n }) {- let [r, a] = W(""), [s, c] = W(!1), [l, d] = W(""), f = q(null);- K(() => u(f.current, s), [s]);- let p = q(new AbortController()), m = q(0);- async function h(e = !1) {- let t = ++m.current;- await sn({- read: (e) => B("/api/scraping/cover", e),- active: () => !p.current.signal.aborted && t === m.current,+function mn({ data: e, error: t, toast: n }) {+ let [r, i] = W(""), [a, o] = W(!1), [s, c] = W(""), l = q(null);+ K(() => _(l.current, a), [a]);+ let d = q(new AbortController()), p = q(0);+ async function m(e = !1) {+ let t = ++p.current;+ await ln({+ read: (e) => z("/api/scraping/cover", e),+ active: () => !d.current.signal.aborted && t === p.current,render: (t) => {- c(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && d(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");+ o(t.status === "running"), t.status === "running" && (e = !1), t.status === "failed" && !e && c(t.error || "采集未取得"), t.status === "complete" && !e && n(t.result || "封面采集完成");},- disconnected: () => d("连接中断,正在重新读取后台进度")+ disconnected: () => c("连接中断,正在重新读取后台进度")});}- G(() => (h(!0), () => p.current.abort()), []);- async function g() {- if (!s) {- m.current++, c(!0), d("");+ G(() => (m(!0), () => d.current.abort()), []);+ async function h() {+ if (!a) {+ p.current++, o(!0), c("");try {- await V("/api/scraping/cover", { code: r }, "POST", p.current.signal), await h();+ await B("/api/scraping/cover", { code: r }, "POST", d.current.signal), await m();} catch (e) {- p.current.signal.aborted || (c(!1), d(z(e)));+ d.current.signal.aborted || (o(!1), c(R(e)));}}}return t ? /* @__PURE__ */ J("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(t, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: f(t, { variant: "error" }) }}) : /* @__PURE__ */ J("div", {class: "scraping-page",children: [@@ -2266,35 +2289,35 @@ function fn({ data: e, error: t, toast: n }) {children: /* @__PURE__ */ J("div", {class: "geist-fieldset-content scraping-fields",children: [- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("scraping-cover", "高清封面") } }),+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("scraping-cover", "高清封面") } }),/* @__PURE__ */ J("form", {class: "scraping-cover-form",onSubmit: (e) => {- e.preventDefault(), g();+ e.preventDefault(), h();},children: [/* @__PURE__ */ J("input", {class: "geist-input","aria-label": "馆藏番号",required: !0,value: r,- disabled: s,+ disabled: a,placeholder: "输入馆藏番号,如 ABW-232",- onInput: (e) => a(e.currentTarget.value)+ onInput: (e) => i(e.currentTarget.value)}), /* @__PURE__ */ J("button", {- ref: f,+ ref: l,class: "geist-button primary",type: "submit",children: "抓取封面"})]}),- l && /* @__PURE__ */ J("div", {+ s && /* @__PURE__ */ J("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(l, { variant: "error" }) }+ dangerouslySetInnerHTML: { __html: f(s, { variant: "error" }) }})]})}),- e?.sources.map((e) => /* @__PURE__ */ J(dn, {+ e?.sources.map((e) => /* @__PURE__ */ J(pn, {source: e,toast: n}, e.source))@@ -2303,57 +2326,67 @@ function fn({ data: e, error: t, toast: n }) {}//#endregion//#region src/islands/library-processing.tsx-var pn = (e, t) => B("/api/library-processing", t);-function mn({ data: e, error: t, toast: n, onComplete: r, mode: c, monitor: l }) {- let [d, f] = W(e || { status: "idle" }), [p, m] = W(t), [h, g] = W(!1), [_, v] = W(!1), y = q(new AbortController()), b = q(0), x = q(d.status), S = q(null), C = h || d.status === "running";- K(() => u(S.current, C), [C]);- async function w() {- let e = ++b.current;- await sn({- read: (e) => B("/api/library-processing", e),- active: () => !y.current.signal.aborted && b.current === e,- keepWatching: c === "notice" || !!l,+var hn = (e, t) => z("/api/library-processing", t);+function gn({ data: e, error: t, toast: n, onComplete: r, mode: i, monitor: a }) {+ let [o, s] = W(e || { status: "idle" }), [c, l] = W(t), [h, g] = W(!1), [v, y] = W(!1), b = q(new AbortController()), x = q(0), S = q(o.status), C = q(null), w = h || o.status === "running";+ K(() => _(C.current, w), [w]);+ async function T() {+ let e = ++x.current;+ await ln({+ read: (e) => z("/api/library-processing", e),+ active: () => !b.current.signal.aborted && x.current === e,+ keepWatching: i === "notice" || !!a,render: (e) => {- f(e), m(""), e.status === "complete" && x.current === "running" && c !== "notice" && (v(!0), n("已完成扫描与资料采集")), x.current === "running" && (e.status === "complete" || e.status === "failed") && r?.(), x.current = e.status;+ s(e), l(""), 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: () => m("连接中断,正在重新读取处理进度")+ disconnected: () => l("连接中断,正在重新读取处理进度")});}- G(() => ((d.status === "running" || c === "notice" || l) && w(), () => y.current.abort()), []);- async function T() {- if (!C) {- g(!0), m(""), v(!1);+ G(() => ((o.status === "running" || i === "notice" || a) && T(), () => b.current.abort()), []);+ async function E() {+ if (!w) {+ g(!0), l(""), y(!1);try {- let e = await V("/api/library-processing", {}, "POST", y.current.signal);- if (y.current.signal.aborted) return;- x.current = e.status, f(e), g(!1), await w();+ let e = await B("/api/library-processing", {}, "POST", b.current.signal);+ if (b.current.signal.aborted) return;+ S.current = e.status, s(e), g(!1), await T();} catch (e) {- y.current.signal.aborted || (m(z(e)), g(!1));+ b.current.signal.aborted || (l(R(e)), g(!1));}}}- return c === "notice" ? !p && d.status !== "running" && d.status !== "failed" ? null : /* @__PURE__ */ J("div", {- class: "library-processing-banner",- role: "status",- children: [/* @__PURE__ */ J("span", { children: p || (d.status === "failed" ? "扫描与资料采集未完成" : `${d.stage || "正在整理馆藏"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) }), /* @__PURE__ */ J("a", {- class: "geist-button",+ 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__ */ J("div", { dangerouslySetInnerHTML: { __html: m(e, {+ variant: o.status === "failed" ? "error" : c ? "warning" : "gray",href: "/data-cleanup#libraryProcessing",- children: p || d.status === "failed" ? "查看并处理" : "查看进度"- })]- }) : /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", {+ label: c || o.status === "failed" ? "查看并处理" : "查看进度",+ value: o.checked || 0,+ max: o.status === "running" ? o.total : void 0+ }) } });+ }+ return /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("div", {class: "geist-fieldset-content library-processing",children: [- /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: i("cleanupScrapingTitle", "扫描与采集") } }),+ /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: u("cleanupScrapingTitle", "扫描与采集") } }),/* @__PURE__ */ J("p", { children: "扫描媒体文件夹,导入已有资料,采集缺失信息。" }),/* @__PURE__ */ J("div", {"aria-live": "polite",children: [- d.status === "running" && /* @__PURE__ */ J(L, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: a(`${d.stage || "正在处理"}${d.total ? ` · ${d.checked || 0} / ${d.total}` : ""}`) } }), !!d.total && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: s(`已处理 ${d.checked || 0} / ${d.total} 个视频`, d.checked || 0, d.total) } })] }),- (p || d.status === "failed") && /* @__PURE__ */ J("div", {+ o.status === "running" && /* @__PURE__ */ J(I, { children: [/* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: d(`${o.stage || "正在处理"}${o.total ? ` · ${o.checked || 0} / ${o.total}` : ""}`) } }), !!o.total && /* @__PURE__ */ J("div", { dangerouslySetInnerHTML: { __html: p(`已处理 ${o.checked || 0} / ${o.total} 个视频`, o.checked || 0, o.total) } })] }),+ (c || o.status === "failed") && /* @__PURE__ */ J("div", {role: "alert",- dangerouslySetInnerHTML: { __html: o(p || d.error || "处理未完成,请重试", { variant: "error" }) }+ onClick: (e) => {+ e.target.closest("[data-note-action]") && E();+ },+ dangerouslySetInnerHTML: { __html: f(c || o.error || "处理未完成,请重试", {+ variant: "error",+ filled: !0,+ actionLabel: o.status === "failed" ? "重试未完成项" : ""+ }) }}),- d.status === "failed" && !!d.issues?.length && /* @__PURE__ */ J("ul", { children: d.issues.slice(0, 20).map((e) => /* @__PURE__ */ J("li", { children: [+ o.status === "failed" && !!o.issues?.length && /* @__PURE__ */ J("ul", { children: o.issues.slice(0, 20).map((e) => /* @__PURE__ */ J("li", { children: [e.asset_id ? /* @__PURE__ */ J("a", {href: `/item/${e.asset_id}`,children: "查看视频"@@ -2361,9 +2394,9 @@ function mn({ data: e, error: t, toast: n, onComplete: r, mode: c, monitor: l })e.asset_id ? ":" : "",e.message] })) }),- _ && /* @__PURE__ */ J("div", {+ v && /* @__PURE__ */ J("div", {class: "library-processing-result",- dangerouslySetInnerHTML: { __html: o(`已扫描 ${d.scanned || 0} 个文件,识别 ${d.identified || 0} 个番号,整理 ${d.candidates || 0} 组资料候选。`, {+ dangerouslySetInnerHTML: { __html: f(`已扫描 ${o.scanned || 0} 个文件,识别 ${o.identified || 0} 个番号,整理 ${o.candidates || 0} 组资料候选。`, {variant: "success",label: "处理完成"}) }@@ -2380,29 +2413,29 @@ function mn({ data: e, error: t, toast: n, onComplete: r, mode: c, monitor: l })href: "/scraping",children: "采集来源"}),- !!d.candidates && /* @__PURE__ */ J("a", {+ !!o.candidates && /* @__PURE__ */ J("a", {class: "geist-button",href: "/review",children: "复核资料"}),- /* @__PURE__ */ J("button", {- ref: S,+ o.status !== "failed" && /* @__PURE__ */ J("button", {+ ref: C,type: "button",class: "geist-button primary",- onClick: () => void T(),- children: d.status === "failed" ? "重试未完成项" : "扫描并补全资料"+ onClick: () => void E(),+ children: "扫描并补全资料"})]})] });}//#endregion//#region src/state/index.ts-var hn = { "quality-goals": {- refresh: nn,- reset: tn-} }, gn = () => Object.keys(hn);-async function _n(e) {- let t = hn[e];+var _n = { "quality-goals": {+ refresh: an,+ reset: rn+} }, vn = () => Object.keys(_n);+async function yn(e) {+ let t = _n[e];if (!t) throw Error(`未登记的共享 store:${String(e)}`);try {return await t.refresh(), !0;@@ -2412,24 +2445,24 @@ async function _n(e) {}//#endregion//#region src/review-evidence.ts-var vn = (e = "") => /^https?:\/\//i.test(e) ? e : "";-function yn(e = "") {- let t = vn(e) || (e.startsWith("/") && !e.startsWith("//") ? e : "");- return `<div class="reviewimage" data-review-picture><span class="reviewimageempty"${t ? " hidden" : ""}>未取得来源图片</span>${t ? `<img src="${m(t)}" alt="来源候选图片" loading="lazy">` : ""}</div>`;-}-function bn(e) {- let t = vn(e.profile_url), n = (e.preview_assets || []).slice(0, 6), r = Math.max(0, Number(e.video_count || e.videos || 0));- return `<section class="reviewidentityevidence"><h5>候选身份:${m(e.babepedia_name || "未标注")}</h5>- <div class="reviewevidenceactions">${t ? `<a class="geist-button" href="${m(t)}" target="_blank" rel="noopener noreferrer">来源资料 ↗</a>` : ""}- <button type="button" class="geist-button" data-entity-kind="creator" data-entity-name="${m(e.creator || "")}">查看全部 ${r.toLocaleString()} 部作品</button></div>- ${yn(e.preview_url)}+var bn = (e = "") => /^https?:\/\//i.test(e) ? e : "";+function xn(e = "") {+ let n = bn(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 Sn(e) {+ let n = bn(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" href="${t(n)}" target="_blank" rel="noopener noreferrer">来源资料 ↗</a>` : ""}+ <button type="button" class="geist-button" data-entity-kind="creator" data-entity-name="${t(e.creator || "")}">查看全部 ${i.toLocaleString()} 部作品</button></div>+ ${xn(e.preview_url)}<p>通过后记录身份判断。</p>- ${n.length ? `<h5>本地作品样本</h5><div class="reviewevidencesamples">${n.map((e) => `<div class="reviewevidencesample">- <button class="geist-button" type="button" data-review-open-item="${e.id}"><span data-middle-truncate title="${m(e.name)}">${m(e.name)}</span></button>- <button class="geist-button" type="button" data-review-reveal="${e.id}" aria-label="打开 ${m(e.name)} 的文件位置">文件位置</button>+ ${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 xn(e) {+function Cn(e) {for (let t of e.querySelectorAll("[data-review-picture] img")) {let e = () => {t.hidden = !0;@@ -2441,7 +2474,7 @@ function xn(e) {}//#endregion//#region src/review-bulk.ts-var Sn = () => ({+var wn = () => ({busy: !1,category: "",filter: "",@@ -2452,7 +2485,7 @@ var Sn = () => ({assets: /* @__PURE__ */ new Map(),errors: /* @__PURE__ */ new Map()});-function Cn(e, t) {+function Tn(e, t) {let n = [["candidates",t ? "按候选数量" : "全部待复核",@@ -2468,7 +2501,7 @@ function Cn(e, t) {"list-filter"]), n;}-function wn(e, t) {+function En(e, t) {let n = /* @__PURE__ */ new Map();for (let r of e) {let e, i;@@ -2485,11 +2518,11 @@ function wn(e, t) {}return [...n.values()];}-function Tn(e, t, n, r, i) {+function Dn(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 En(e, t, n, r) {+async function On(e, t, n, r) {let i = [], a = 0;for (let o of e) {if (!r()) break;@@ -2500,7 +2533,7 @@ async function En(e, t, n, r) {} catch (e) {i.push({key: o.key,- message: z(e)+ message: R(e)});}}@@ -2509,216 +2542,216 @@ async function En(e, t, n, r) {failures: i};}-function Dn(e) {+function kn(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 On(e, n) {- let r = e.querySelector(".reviewlist");- if (!r || !n.rows.length || n.locked) return;- let i = n.state, a = [...r.querySelectorAll("[data-review-key]")];- n.category !== void 0 && i.category !== n.category && (i.category = n.category, i.filter = "", i.groupBy = "candidates", i.anchor = null);- let o = Cn(n.rows, n.metadata);- o.some((e) => e[0] === i.groupBy) || (i.groupBy = "candidates", i.filter = "");- let s = wn(n.rows, i.groupBy);- s.some((e) => e.key === i.filter) || (i.filter = "");- let l = () => [...r.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), d = () => l().filter((e) => i.selected.has(e.dataset.reviewKey)), p = () => n.rows.filter((e) => d().some((t) => t.dataset.reviewKey === e.item_key)), m = (e) => !e.querySelector("[data-review-status=\"approved\"]")?.disabled, h = (e, t = "") => {+function An(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 = Tn(t.rows, t.metadata);+ a.some((e) => e[0] === r.groupBy) || (r.groupBy = "candidates", r.filter = "");+ let o = En(t.rows, r.groupBy);+ o.some((e) => e.key === r.filter) || (r.filter = "");+ let c = () => [...n.querySelectorAll("[data-review-key]")].filter((e) => !e.closest("[hidden]")), l = () => c().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");return n.type = "button", n.className = `geist-button ${t}`.trim(), n.textContent = e, n;- }, g = document.createElement("div");- g.className = "reviewbulkbar reviewbulktoolbar", g.setAttribute("role", "group"), g.setAttribute("aria-label", "复核批量操作");- let _ = document.createElement("div");- _.className = "reviewgroupby", _.innerHTML = c(o, i.groupBy, { label: "筛选分组方式" });- let v = f(_.firstElementChild);- _.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), v.addEventListener("change", () => {- if (i.busy || !o.some((e) => e[0] === v.value)) return;- i.groupBy = v.value, i.filter = "", i.anchor = null;- let t = e.parentElement;- n.refresh(), t?.querySelector(".reviewgroupby button")?.focus({ preventScroll: !0 });+ }, p = document.createElement("div");+ p.className = "reviewbulkbar reviewbulktoolbar", p.setAttribute("role", "group"), p.setAttribute("aria-label", "复核批量操作");+ let m = document.createElement("div");+ m.className = "reviewgroupby", m.innerHTML = h(a, r.groupBy, { label: "筛选分组方式" });+ let g = y(m.firstElementChild);+ m.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), g.addEventListener("change", () => {+ if (r.busy || !a.some((e) => e[0] === g.value)) return;+ r.groupBy = g.value, r.filter = "", r.anchor = null;+ let n = e.parentElement;+ t.refresh(), n?.querySelector(".reviewgroupby button")?.focus({ preventScroll: !0 });});- let y = document.createElement("div");- y.className = "reviewcategoryfilter", y.hidden = s.length < 2, y.innerHTML = c([[+ let v = document.createElement("div");+ v.className = "reviewcategoryfilter", v.hidden = o.length < 2, v.innerHTML = h([["","全部分类","list-filter"- ], ...s.map((e) => [+ ], ...o.map((e) => [e.key,`${e.title} · ${e.rows.length}`,"list-filter"- ])], i.filter, { label: i.groupBy === "field" ? "筛选字段分类" : "筛选当前分类" });- let b = y.querySelector("[data-select-menu]");+ ])], r.filter, { label: r.groupBy === "field" ? "筛选字段分类" : "筛选当前分类" });+ let b = v.querySelector("[data-select-menu]");if (b) {let e = document.createElement("div");- e.setAttribute("role", "group"), e.setAttribute("aria-label", i.groupBy === "field" ? "字段分类" : "当前分类");+ e.setAttribute("role", "group"), e.setAttribute("aria-label", r.groupBy === "field" ? "字段分类" : "当前分类");let t = document.createElement("div");t.className = "reviewfilterheading", t.textContent = e.getAttribute("aria-label"), t.setAttribute("aria-hidden", "true"), e.append(t, ...Array.from(b.children).slice(1)), b.append(e);}- let x = f(y.firstElementChild);- y.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), x.addEventListener("change", () => {- if (i.busy || x.value && !s.some((e) => e.key === x.value)) return;- i.filter = x.value, i.anchor = null;- let t = e.parentElement;- n.refresh(), t?.querySelector(".reviewcategoryfilter button")?.focus({ preventScroll: !0 });+ let x = y(v.firstElementChild);+ v.querySelectorAll("[data-select-option] .gselectmark").forEach((e) => e.remove()), x.addEventListener("change", () => {+ if (r.busy || x.value && !o.some((e) => e.key === x.value)) return;+ r.filter = x.value, r.anchor = null;+ let n = e.parentElement;+ t.refresh(), n?.querySelector(".reviewcategoryfilter button")?.focus({ preventScroll: !0 });});- let S = h("全选本页"), C = h("通过所选", "primary"), w = h("拒绝所选", "error"), T = document.createElement("span");+ let S = f("全选本页"), C = f("通过所选", "primary"), w = f("拒绝所选", "error"), T = document.createElement("span");T.className = "reviewselectedcount selectiondockcount", T.setAttribute("role", "status");let E = document.createElement("div");- E.className = "reviewbulksource", E.hidden = !n.metadata;+ E.className = "reviewbulksource", E.hidden = !t.metadata;let D = document.createElement("p");D.className = "reviewstate reviewbulkfeedback", D.setAttribute("role", "status");let O = document.createElement("div");O.className = "reviewbulkdecisions", O.append(C, w);let k = document.createElement("div");k.className = "selectiondock reviewdock", k.setAttribute("role", "group"), k.setAttribute("aria-label", "复核所选项目");- let A = h("取消选择");- k.append(T, E, O, A, D), g.append(_, y, S);- let j = e.querySelector(".reviewcontrols");- j ? j.append(g) : r.before(g), e.append(k), r.classList.add("reviewgroups");- let ee = () => {- i.selected.clear(), i.anchor = null, P();+ let A = f("取消选择");+ k.append(T, E, O, A, D), p.append(m, v, S);+ let ee = e.querySelector(".reviewcontrols");+ ee ? ee.append(p) : n.before(p), e.append(k), n.classList.add("reviewgroups");+ let te = () => {+ r.selected.clear(), r.anchor = null, N();};A.onclick = () => {- i.busy || (ee(), S.focus({ preventScroll: !0 }));+ r.busy || (te(), S.focus({ preventScroll: !0 }));}, S.onclick = () => {- if (i.busy) return;- let e = l(), t = d().length === e.length;- e.forEach((e) => t ? i.selected.delete(e.dataset.reviewKey) : i.selected.add(e.dataset.reviewKey)), P();- }, C.onclick = () => F("approved", C), w.onclick = () => F("rejected", w);- let M = [];- for (let e of s) {- let n = e.rows.map((e) => a.find((t) => t.dataset.reviewKey === e.item_key)).filter((e) => !!e), o = document.createElement("section");- o.className = "reviewgroup", o.hidden = !!i.filter && e.key !== i.filter;- let s = document.createElement("div");- s.className = "reviewbulkbar";- let c = document.createElement("h3");- c.textContent = `${e.title} · ${n.length}`;- let u = h("全选本组"), d = document.createElement("div");- d.className = "reviewlist", s.append(c, u), o.append(s, d), r.append(o), u.onclick = () => {- if (i.busy) return;- let e = n.every((e) => i.selected.has(e.dataset.reviewKey));- n.forEach((t) => e ? i.selected.delete(t.dataset.reviewKey) : i.selected.add(t.dataset.reviewKey)), P();- }, M.push(() => {- u.textContent = n.every((e) => i.selected.has(e.dataset.reviewKey)) ? "清空本组" : "全选本组";+ if (r.busy) return;+ let e = c(), t = l().length === e.length;+ e.forEach((e) => t ? r.selected.delete(e.dataset.reviewKey) : r.selected.add(e.dataset.reviewKey)), N();+ }, C.onclick = () => P("approved", C), w.onclick = () => P("rejected", w);+ let j = [];+ 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");+ a.className = "reviewgroup", a.hidden = !!r.filter && e.key !== r.filter;+ let o = document.createElement("div");+ o.className = "reviewbulkbar";+ let l = document.createElement("h3");+ l.textContent = `${e.title} · ${t.length}`;+ let u = f("全选本组"), d = document.createElement("div");+ d.className = "reviewlist", o.append(l, u), a.append(o, d), n.append(a), u.onclick = () => {+ if (r.busy) return;+ let e = t.every((e) => r.selected.has(e.dataset.reviewKey));+ t.forEach((t) => e ? r.selected.delete(t.dataset.reviewKey) : r.selected.add(t.dataset.reviewKey)), N();+ }, j.push(() => {+ u.textContent = t.every((e) => r.selected.has(e.dataset.reviewKey)) ? "清空本组" : "全选本组";});- for (let e of n) {+ for (let e of t) {d.append(e);- let n = e.dataset.reviewKey;- i.errors.has(n) && (e.querySelector(".reviewstate").textContent = i.errors.get(n));- let r = e.querySelector("h4,.reviewentity b") || e, a = document.createElement("label");- a.className = "reviewpickitem", a.innerHTML = t();- let o = a.querySelector("input");- if (o.setAttribute("aria-label", `选择 ${e.querySelector("legend")?.textContent || r.textContent || n}`), r !== e) {+ let t = e.dataset.reviewKey;+ r.errors.has(t) && (e.querySelector(".reviewstate").textContent = r.errors.get(t));+ let n = e.querySelector("h4,.reviewentity b") || e, i = document.createElement("label");+ i.className = "reviewpickitem", i.innerHTML = s();+ let a = i.querySelector("input");+ if (a.setAttribute("aria-label", `选择 ${e.querySelector("legend")?.textContent || n.textContent || t}`), n !== e) {let e = document.createElement("span");- e.className = "reviewpickname", e.append(...r.childNodes), r.classList.add("reviewpickheading"), r.append(a, e);- } else e.prepend(a);- let s = (e, t) => {- Tn(i, l().map((e) => e.dataset.reviewKey), n, e, t), P();+ e.className = "reviewpickname", e.append(...n.childNodes), n.classList.add("reviewpickheading"), n.append(i, e);+ } else e.prepend(i);+ let o = (e, n) => {+ Dn(r, c().map((e) => e.dataset.reviewKey), t, e, n), N();};- if (a.addEventListener("mousedown", (e) => {+ if (i.addEventListener("mousedown", (e) => {e.shiftKey && e.preventDefault();+ }), i.addEventListener("click", (e) => {+ e.target !== a && (e.preventDefault(), r.busy || (a.focus(), o(e.shiftKey, !a.checked)));}), a.addEventListener("click", (e) => {- e.target !== o && (e.preventDefault(), i.busy || (o.focus(), s(e.shiftKey, !o.checked)));- }), o.addEventListener("click", (e) => {- i.busy || s(e.shiftKey, o.checked);- }), o.addEventListener("keydown", (t) => {- if (!(i.busy || !t.shiftKey)) {- if (t.key === " ") t.preventDefault(), s(!0, !0);- else if (t.key === "ArrowDown" || t.key === "ArrowUp") {- t.preventDefault();- let r = l(), a = r[r.indexOf(e) + (t.key === "ArrowDown" ? 1 : -1)];- a && (i.anchor === null && (i.anchor = n), Tn(i, r.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), P(), a.querySelector(".reviewpickitem input")?.focus());+ r.busy || o(e.shiftKey, a.checked);+ }), a.addEventListener("keydown", (n) => {+ if (!(r.busy || !n.shiftKey)) {+ if (n.key === " ") n.preventDefault(), o(!0, !0);+ else if (n.key === "ArrowDown" || n.key === "ArrowUp") {+ n.preventDefault();+ let i = c(), a = i[i.indexOf(e) + (n.key === "ArrowDown" ? 1 : -1)];+ a && (r.anchor === null && (r.anchor = t), Dn(r, i.map((e) => e.dataset.reviewKey), a.dataset.reviewKey, !0, !0), N(), a.querySelector(".reviewpickitem input")?.focus());}}- }), M.push(() => {- o.checked = i.selected.has(n);- }), i.assets.has(n)) {- let t = i.assets.get(n), r = [...e.querySelectorAll("[data-review-asset]")];- r.forEach((e) => {- let n = t.includes(Number(e.dataset.reviewAsset));- e.setAttribute("aria-pressed", String(n)), e.classList.toggle("picked", n);+ }), j.push(() => {+ a.checked = r.selected.has(t);+ }), r.assets.has(t)) {+ let n = r.assets.get(t), i = [...e.querySelectorAll("[data-review-asset]")];+ i.forEach((e) => {+ let t = n.includes(Number(e.dataset.reviewAsset));+ e.setAttribute("aria-pressed", String(t)), e.classList.toggle("picked", t);});let a = e.querySelector("[data-picked-count]");- a && (a.textContent = `已选 ${t.length} / ${r.length}`);+ a && (a.textContent = `已选 ${n.length} / ${i.length}`);}- e.addEventListener("click", (t) => {- t.target.closest("[data-review-asset],[data-pick-all],[data-pick-none]") && i.assets.set(n, [...e.querySelectorAll("[data-review-asset][aria-pressed=\"true\"]")].map((e) => Number(e.dataset.reviewAsset)));+ e.addEventListener("click", (n) => {+ n.target.closest("[data-review-asset],[data-pick-all],[data-pick-none]") && r.assets.set(t, [...e.querySelectorAll("[data-review-asset][aria-pressed=\"true\"]")].map((e) => Number(e.dataset.reviewAsset)));});- for (let t of e.querySelectorAll("input[type=\"radio\"]")) i.choices.has(n) && (t.checked = i.choices.get(n) === t.value), t.addEventListener("change", () => {- t.checked && i.choices.set(n, t.value), P();+ for (let n of e.querySelectorAll("input[type=\"radio\"]")) r.choices.has(t) && (n.checked = r.choices.get(t) === n.value), n.addEventListener("change", () => {+ n.checked && r.choices.set(t, n.value), N();});}}e.addEventListener("keydown", (t) => {- i.busy || !e.contains(r) || (t.key === "Escape" && i.selected.size && (t.preventDefault(), t.stopPropagation(), ee()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), l().forEach((e) => i.selected.add(e.dataset.reviewKey)), P()));+ r.busy || !e.contains(n) || (t.key === "Escape" && r.selected.size && (t.preventDefault(), t.stopPropagation(), te()), (t.ctrlKey || t.metaKey) && t.key.toLowerCase() === "a" && !t.target.matches("textarea,input:not([type=\"checkbox\"]):not([type=\"radio\"])") && (t.preventDefault(), t.stopPropagation(), c().forEach((e) => r.selected.add(e.dataset.reviewKey)), N()));});- let N = "";- function P() {- let e = d();- S.textContent = e.length === l().length ? "清空当前选择" : i.filter ? "全选当前分类" : "全选本页", k.hidden = !e.length, T.textContent = `已选 ${e.length} 项`, C.disabled = !e.length || e.some((e) => !m(e)), w.disabled = !e.length;- let t = Dn(p());- E.hidden = !n.metadata || !p().some((e) => (e.candidates?.length || 0) > 1);- let r = e.length && !t.length ? "所选项目无共同来源" : "统一选择来源", a = JSON.stringify([r, t]);- if (a !== N) {- N = a, E.innerHTML = c([["", r], ...t.map((e) => [e, e])], "", { label: "统一选择来源" });- let e = f(E.firstElementChild);- e.disabled = !t.length, e.addEventListener("change", () => {- if (!(i.busy || !Dn(p()).includes(e.value))) {- for (let t of d()) {- let r = n.rows.find((e) => e.item_key === t.dataset.reviewKey).candidates.find((t) => t.source === e.value);- t.querySelectorAll("input[type=\"radio\"]").forEach((e) => {- e.checked = e.value === r.candidate_key;- }), i.choices.set(t.dataset.reviewKey, r.candidate_key);+ let M = "";+ function N() {+ let e = l();+ S.textContent = e.length === c().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 = kn(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 !== M) {+ M = a, E.innerHTML = h([["", i], ...n.map((e) => [e, e])], "", { label: "统一选择来源" });+ let e = y(E.firstElementChild);+ e.disabled = !n.length, e.addEventListener("change", () => {+ if (!(r.busy || !kn(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) => {+ e.checked = e.value === i.candidate_key;+ }), r.choices.set(n.dataset.reviewKey, i.candidate_key);}D.textContent = `已选择 ${e.value},点击通过所选采用。`;}});}- M.forEach((e) => e());+ j.forEach((e) => e());}- async function F(t, r) {- if (i.busy || !d().length) return;- let a = d().map((e) => ({+ async function P(n, i) {+ if (r.busy || !l().length) return;+ let a = l().map((e) => ({key: e.dataset.reviewKey,payload: {- ...n.payload(e),- status: t+ ...t.payload(e),+ status: n}}));- if (t === "approved" && n.metadata && a.some((e) => !e.payload.candidate_key)) {- D.textContent = "请先为所选的多来源候选选择来源。", d().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();+ if (n === "approved" && t.metadata && a.some((e) => !e.payload.candidate_key)) {+ D.textContent = "请先为所选的多来源候选选择来源。", l().find((e) => !e.querySelector("input[type=\"radio\"]:checked"))?.querySelector("input[type=\"radio\"]")?.focus();return;}- i.busy = !0, D.textContent = `正在处理 0 / ${a.length}`, u(r, !0);+ r.busy = !0, D.textContent = `正在处理 0 / ${a.length}`, _(i, !0);let o = [...e.querySelectorAll("button,input")], s = o.map((e) => e.getAttribute("aria-disabled"));o.forEach((e) => e.setAttribute("aria-disabled", "true"));let c = (e) => {e instanceof KeyboardEvent && e.key === "Tab" || (e.preventDefault(), e.stopImmediatePropagation());};e.addEventListener("click", c, !0), e.addEventListener("keydown", c, !0);- let l = 0, f = await En(a, async (e) => {+ let u = 0, d = await On(a, async (e) => {try {- return await n.submit(e);+ return await t.submit(e);} finally {- l++, n.active() && (D.textContent = `正在处理 ${l} / ${a.length}`);+ u++, t.active() && (D.textContent = `正在处理 ${u} / ${a.length}`);}}, (e) => {- i.selected.delete(e), i.errors.delete(e), n.applied(e);- }, n.active);- if (i.busy = !1, e.removeEventListener("click", c, !0), e.removeEventListener("keydown", c, !0), o.forEach((e, t) => {+ r.selected.delete(e), r.errors.delete(e), t.applied(e);+ }, t.active);+ if (r.busy = !1, e.removeEventListener("click", c, !0), e.removeEventListener("keydown", c, !0), o.forEach((e, t) => {let n = s[t];n === null ? e.removeAttribute("aria-disabled") : e.setAttribute("aria-disabled", n);- }), u(r, !1), !n.active()) return;- n.notify(`已${t === "approved" ? "通过" : "拒绝"} ${f.completed} 项${f.failures.length ? `,${f.failures.length} 项未完成` : ""}`), f.failures.forEach((e) => i.errors.set(e.key, e.message));- let p = e.parentElement;- n.refresh(), p?.querySelector(".reviewbulktoolbar button")?.focus({ preventScroll: !0 });+ }), _(i, !1), !t.active()) return;+ t.notify(`已${n === "approved" ? "通过" : "拒绝"} ${d.completed} 项${d.failures.length ? `,${d.failures.length} 项未完成` : ""}`), d.failures.forEach((e) => r.errors.set(e.key, e.message));+ let f = e.parentElement;+ t.refresh(), f?.querySelector(".reviewbulktoolbar button")?.focus({ preventScroll: !0 });}- P();+ N();}//#endregion//#region src/native-image.ts-function kn(e, t, n, r) {+function jn(e, t, n, r) {return e > 0 && t > 0 && e === n && t === r;}-function An(e, t, n, r, i = 1) {+function Mn(e, t, n, r, i = 1) {let a = Number.isFinite(i) && i > 0 ? i : 1;e /= a, t /= a;let o = [@@ -2735,7 +2768,7 @@ function An(e, t, n, r, i = 1) {}//#endregion//#region src/entity-skeleton.ts-function jn(e, t) {+function Nn(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>@@ -2747,7 +2780,7 @@ function jn(e, t) {}//#endregion//#region src/catalog-onboarding.ts-var Mn = [+var Pn = ["loc","creator","performer",@@ -2764,16 +2797,16 @@ var Mn = ["jav","thumb"];-function Nn() {+function Fn() {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 Pn(e, t) {+async function In(e, t) {let n = new URLSearchParams();- for (let t of Mn) e[t] && n.set(t, e[t]);+ for (let t of Pn) 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 || [],@@ -2784,20 +2817,20 @@ async function Pn(e, t) {return r.set("q", e), r.set("limit", "1"), (await t("/api/items?" + r)).total > 0 ? e : "";}))).filter(Boolean);}-function Fn({ kind: e = "catalog", filtered: t = !1, jav: n = !1, configurable: i = !1, online: a = !1 } = {}) {- let o = i ? "<a class=\"geist-button primary\" href=\"/configuration\">添加内容</a>" : "", s = "<a class=\"geist-button\" href=\"/follow-manage\">添加来源</a>";- return t || n ? r("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? r("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: o + s }) : r(e === "tags" ? "tags" : "user-round", "还没有" + ({+function Ln({ 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 ? l("search", n ? "还没有符合条件的 JAV 作品" : "没有符合条件的内容", n ? "已扫描但尚未补充发行资料的视频可在全部内容中查看。" : "清除筛选或搜索条件后查看全部内容。", { actions: "<a class=\"geist-button primary\" href=\"/?loc=&thumb=0\">查看全部内容</a>" }) : e === "catalog" ? l("play", "还没有视频", "添加媒体文件夹或关注来源,开始建立你的馆藏。", { actions: a + o }) : l(e === "tags" ? "tags" : "user-round", "还没有" + ({tags: "标签",performers: "艺人",creators: "创作者",studios: "厂牌",agencies: "事务所",series: "系列"- }[e] || "资料"), a ? "添加关注来源并获取内容后,这里会显示对应标签。" : "添加内容并补充资料后,这里会显示对应信息。", { actions: a ? s : o + s });+ }[e] || "资料"), i ? "添加关注来源并获取内容后,这里会显示对应标签。" : "添加内容并补充资料后,这里会显示对应信息。", { actions: i ? o : a + o });}//#endregion//#region src/sidebar.ts-function In(e) {+function Rn(e) {return ["/","/unseen",@@ -2807,23 +2840,23 @@ function In(e) {"/junk-files"].includes(e) || /^\/(item|mix|parts|editions)\//.test(e) || /^\/playlists\/\d+\/\d+$/.test(e) || /^\/(performers|studios|creators|series|agencies)\/.+/.test(e);}-function Ln(e, t) {+function zn(e, t) {return e.dataset.surface === t && e.querySelector(".dnav") ? !1 : (e.dataset.surface = t, e.replaceChildren(), !0);}-function Rn(e) {+function Bn(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 zn(e) {+function Vn(e) {return e.filter((e) => ["115", "pikpak"].includes(e.location) && (e.roots === void 0 || e.roots.length > 0)).map((e) => e.location);}-function Bn(e, t) {+function Hn(e, t) {return t.filter((t) => e.some((e) => e.location === t));}-function Vn() {+function Un() {return `<div class="cleanuppage" data-skeleton="cleanup" aria-busy="true" aria-label="正在读取数据管理状态"><div class="cleanupgrid">${[[@@ -2869,7 +2902,7 @@ function Vn() {<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 Hn(e, t = !1, n = !1) {+function Wn(e, t = !1, n = !1) {if (t || n) return "";let r = "<svg aria-hidden=\"true\"><use href=\"#i-external-link\"></use></svg>";return `<details class="taste-history-guide"${e ? " open" : ""}>@@ -2883,70 +2916,70 @@ function Hn(e, t = !1, n = !1) {<button type="button" class="geist-button taste-guide-skip">跳过</button></div></details>`;}-var Un = "peach-taste-guide-dismissed";-function Wn(e, t) {- d(e, ".taste-history-guide", "taste-guide-collapse");+var Gn = "peach-taste-guide-dismissed";+function Kn(e, t) {+ v(e, ".taste-history-guide", "taste-guide-collapse");let n = e.querySelector(".taste-history-guide");n?.querySelector(".taste-guide-skip")?.addEventListener("click", () => {- t.setItem(Un, "1"), n.remove();+ t.setItem(Gn, "1"), n.remove();});}//#endregion//#region src/jav-artwork.ts-function Gn(e) {+function qn(e) {return ["small","sleeve","preview"].includes(String(e)) ? "small" : "big";}-function Kn(e) {+function Jn(e) {return {- javLayout: Gn(e.javLayout),- javImage: qn(e.javLayout === "preview" ? "thumbnail" : e.javImage)+ javLayout: qn(e.javLayout),+ javImage: Yn(e.javLayout === "preview" ? "thumbnail" : e.javImage)};}-function qn(e) {+function Yn(e) {return e === "thumbnail" ? "thumbnail" : "cover";}-function Jn(e, t) {- return e.is_jav && e.code && e.has_cover && (qn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";+function Xn(e, t) {+ return e.is_jav && e.code && e.has_cover && (Yn(t) === "cover" || !e.has_thumb) ? "cover" : e.has_thumb ? "thumbnail" : "";}-function Yn(e, t) {+function Zn(e, t) {e.querySelectorAll("img[data-jav-image]").forEach((e) => {- let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (qn(t) === "cover" || !r)), a = i ? n : r;+ let n = e.dataset.javCover || "", r = e.dataset.javThumb || "", i = !!(n && (Yn(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 Xn = {+var Qn = {"library-processing": {- load: pn,- component: mn+ load: hn,+ component: gn},scraping: {- load: ln,- component: fn+ load: dn,+ component: mn},"quality-goals": {- load: rn,- component: on+ load: on,+ component: cn},configuration: {- load: lt,- component: ht+ load: dt,+ component: vt}-}, Zn = () => Object.keys(Xn), Qn = /* @__PURE__ */ new Map();-async function $n(e, t, n, r = {}) {- let i = Xn[e];+}, $n = () => Object.keys(Qn), er = /* @__PURE__ */ new Map();+async function tr(e, t, n, r = {}) {+ let i = Qn[e];if (!i) throw Error(`未注册的 island:${String(e)}`);- er(t);+ nr(t);let a = {controller: new AbortController(),painted: !1};- Qn.set(t, a);+ er.set(t, a);let o;try {o = {@@ -2957,12 +2990,12 @@ async function $n(e, t, n, r = {}) {if (a.controller.signal.aborted) return;o = {data: null,- error: z(e)+ error: R(e)};}- if (Qn.get(t) !== a) return;+ if (er.get(t) !== a) return;if (r.isCurrent && !r.isCurrent()) {- Qn.delete(t);+ er.delete(t);return;}t.textContent = "", a.painted = !0;@@ -2970,11 +3003,11 @@ async function $n(e, t, n, r = {}) {...n,...o};- we(ne(i.component, s), t);+ De(ae(i.component, s), t);}-function er(e) {- let t = Qn.get(e);- t && (t.controller.abort(), Qn.delete(e), t.painted && we(null, e));+function nr(e) {+ let t = er.get(e);+ t && (t.controller.abort(), er.delete(e), t.painted && De(null, e));}//#endregion-export { Un as TASTE_GUIDE_KEY, Fn as catalogEmptyHtml, Pn as catalogSuggestions, Vn as cleanupSkeletonHtml, zn as cloudLocations, Bn as cloudPreferenceLocations, Sn as createReviewSelection, Nn as emptyCatalogLayout, jn as entitySkeletonHtml, cn as followJobProgress, bn as identityEvidenceHtml, Zn as islandNames, Jn as javImageKind, kn as matchesFaceSource, $n as mountIsland, An as nativeImageFit, qn as normalizeJavImage, Gn as normalizeJavLayout, Kn as normalizeJavPreferences, Te as preferredDirection, _n as refreshStore, yn as reviewImageHtml, In as sidebarHasCatalogContent, Rn as sidebarTagCounts, gn as storeNames, Yn as syncJavImages, Ln as syncSidebarSurface, Hn as tasteHistoryGuideHtml, er as unmountIsland, sn as watchJob, xn as wireReviewPictures, On as wireReviewSelection, Wn as wireTasteHistoryGuide };+export { Gn as TASTE_GUIDE_KEY, Ln as catalogEmptyHtml, In as catalogSuggestions, Un as cleanupSkeletonHtml, Vn as cloudLocations, Hn as cloudPreferenceLocations, wn as createReviewSelection, Fn as emptyCatalogLayout, Nn as entitySkeletonHtml, un as followJobProgress, Sn as identityEvidenceHtml, $n as islandNames, Xn as javImageKind, jn as matchesFaceSource, tr as mountIsland, Mn as nativeImageFit, Yn as normalizeJavImage, qn as normalizeJavLayout, Jn as normalizeJavPreferences, Oe as preferredDirection, yn as refreshStore, xn as reviewImageHtml, Rn as sidebarHasCatalogContent, Bn as sidebarTagCounts, vn as storeNames, Zn as syncJavImages, zn as syncSidebarSurface, Wn as tasteHistoryGuideHtml, nr as unmountIsland, ln as watchJob, Cn as wireReviewPictures, An as wireReviewSelection, Kn as wireTasteHistoryGuide };