JAV Helper Suite:为 JavDB / JavBus 提供浏览、收藏、筛选、资源检索、数据备份与统计增强。
// ==UserScript== // @name JHS // @namespace https://sleazyfork.org/zh-CN/scripts/578503-jhs-ya // @version 6.1.0 // @author JHS Contributors // @description JAV Helper Suite:为 JavDB / JavBus 提供浏览、收藏、筛选、资源检索、数据备份与统计增强。 // @license MIT // @icon https://www.google.com/s2/favicons?sz=64&domain=javdb.com // @homepageURL https://github.com/Teamper/JHS // @supportURL https://github.com/Teamper/JHS/issues // @match https://javdb.com/* // @match https://www.javbus.com/* // @match *://*.123pan.com/* // @include https://javdb*.com/* // @include https://*javbus*/* // @include https://*javsee*/* // @include https://*seejav*/* // @include https://javtrailers.com/* // @include https://subtitlecat.com/* // @exclude https://*javbus*/forum/* // @exclude https://*javbus*/*actresses // @exclude https://*javsee*/forum/* // @exclude https://*javsee*/*actresses // @exclude https://*seejav*/forum/* // @exclude https://*seejav*/*actresses // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/jquery.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/js/tabulator.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/layer.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/js/md5.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/src/toastify.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/localforage.min.js // @require https://cdn.jsdelivr.net/npm/[email protected]/dist/viewer.min.js // @connect xunlei.com // @connect ja.wikipedia.org // @connect jdforrepam.com // @connect cc3001.dmm.co.jp // @connect cc3001.dmm.com // @connect www.dmm.co.jp // @connect www.dmm.com // @connect api.dmm.com // @connect special.dmm.co.jp // @connect adult.contents.fc2.com // @connect fc2ppvdb.com // @connect 123av.com // @connect u3c3.com // @connect u9a9.com // @connect sukebei.nyaa.si // @connect javstore.net // @connect missav.live // @connect jable.tv // @connect jav.rs // @connect javtrailers.com // @connect javdb.com // @connect javbus.com // @connect www.123pan.com // @connect yun.123pan.com // @connect supjav.com // @connect translate-pa.googleapis.com // @connect * // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @grant GM_openInTab // @grant unsafeWindow // @run-at document-idle // ==/UserScript== var ta=Object.defineProperty;var ea=(Ct,mt,bt)=>mt in Ct?ta(Ct,mt,{enumerable:!0,configurable:!0,writable:!0,value:bt}):Ct[mt]=bt;var Ke=(Ct,mt,bt)=>ea(Ct,typeof mt!="symbol"?mt+"":mt,bt);var e,t,n=Object.defineProperty,a=Ct=>{throw TypeError(Ct)},i=(Ct,mt,bt)=>((wt,yt,jt)=>yt in wt?n(wt,yt,{enumerable:!0,configurable:!0,writable:!0,value:jt}):wt[yt]=jt)(Ct,typeof mt!="symbol"?mt+"":mt,bt),s=(Ct,mt,bt)=>(((wt,yt,jt)=>{yt.has(wt)||a("Cannot "+jt)})(Ct,mt,"access private method"),bt);const o=window.location.href,r=o.includes("javdb"),l=o.includes("javbus")||o.includes("seejav")||o.includes("bus")||o.includes("javsee")||$("title").text().trim().startsWith("JavBus - AV"),c=o.includes("/search?q")||o.includes("/search/")||o.includes("/users/"),d="filter",h="favorite",g="hasDown",p="hasWatch",m="屏蔽",u="已屏蔽",f="var(--jhs-status-filter-text)",v="收藏",b="已收藏",w="var(--jhs-status-fav-text)",y="已下载",x="var(--jhs-status-down-text)",k="已观看",S="var(--jhs-status-watch-text)",C="no",_="yes",T="javdb",I="javbus",B="actor",P="actress",D="censored",A="uncensored",L=[{id:"video-mhb",quality:"dmb_w",text:"旧视频源-中画质宽版 (404p)",canSelect:!1},{id:"video-mhb",quality:"sm_s",text:"旧视频源-低画质 (240p)",canSelect:!1},{id:"video-mhb",quality:"dm_s",text:"旧视频源-中画质 (360p)",canSelect:!1},{id:"video-mhb",quality:"dmb_s",text:"旧视频源-中画质 (480p)",canSelect:!1},{id:"video-mhb",quality:"mhb_w",text:"旧视频源-高画质宽版 (404p)",canSelect:!1},{id:"video-mmb",quality:"mmb",text:"中画质 (432p)",canSelect:!0},{id:"video-mhb",quality:"mhb",text:"高画质 (576p)",canSelect:!0},{id:"video-hmb",quality:"hmb",text:"HD (720p)",canSelect:!0},{id:"video-hhb",quality:"hhb",text:"FullHD (1080p)",canSelect:!0},{id:"video-hhbs",quality:"hhbs",text:"FullHD (1080p60fps)",canSelect:!0},{id:"video-4k",quality:"4k",text:"4K (2160p)",canSelect:!0},{id:"video-4ks",quality:"4ks",text:"4K (2160p60fps)",canSelect:!0}];function escapeHtml(Ct){const mt=document.createElement("span");return mt.textContent=Ct,mt.innerHTML}const CURRENT_DATA_VERSION=1;function normalizeCarNum(Ct){if(typeof Ct!="string")return null;const mt=Ct.trim();return mt&&!["undefined","null"].includes(mt.toLowerCase())?mt:null}function firstValidCarNum(...Ct){for(const mt of Ct){const bt=normalizeCarNum(mt);if(bt)return bt}return null}function assertPageInfoContract(Ct){if(!Ct||typeof Ct!="object"||Array.isArray(Ct))throw new TypeError("getPageInfo() contract broken: expected object");return Ct}let M="";window.location.href.includes("hideNav=1")&&(M=` .navbar-default { display: none !important; } body { padding-top:0px!important; } `);let j="";window.location.href.includes("hideNav=1")&&(j=` .main-nav,#search-bar-container { display: none !important; } html { padding-top:0px!important; } `);function H(Ct){if(Ct)if(Ct.includes("<style>"))document.head.insertAdjacentHTML("beforeend",Ct);else{const mt=document.createElement("style");mt.textContent=Ct,document.head.appendChild(mt)}}function buildThemeCss(){return` <style> :root { /* 字体 */ --jhs-font: system-ui, -apple-system, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif; /* 中性色 */ --jhs-bg: #f4f6f9; --jhs-surface: #ffffff; --jhs-surface-2: #f2f4f8; --jhs-border: #e3e7ee; --jhs-border-strong: #8a94a6; --jhs-text: #1f2733; --jhs-text-muted: #5b6b7c; --jhs-text-faint: #637183; --jhs-input-bg: #f2f4f8; --jhs-placeholder: #637183; --jhs-disabled-bg: #f2f4f8; --jhs-disabled-text: #637183; /* 间距 / 排版 / 控件尺寸 */ --jhs-space-1: 4px; --jhs-space-2: 8px; --jhs-space-3: 12px; --jhs-space-4: 16px; --jhs-space-5: 24px; --jhs-space-6: 32px; --jhs-font-size-xs: 12px; --jhs-font-size-sm: 13px; --jhs-font-size-md: 14px; --jhs-font-size-lg: 16px; --jhs-font-size-xl: 18px; --jhs-control-height-sm: 32px; --jhs-control-height: 36px; --jhs-touch-target: 44px; --jhs-motion-fast: 120ms; --jhs-motion-base: 180ms; --jhs-ease: cubic-bezier(.2, 0, 0, 1); /* 主操作色 (中性蓝灰; 状态色仅表达数据语义) */ --jhs-accent: #3b6ea5; --jhs-accent-hover: #2f5b8a; --jhs-accent-tint: #e7eef6; --jhs-accent-text-on: #ffffff; /* 通用反馈语义(不得代替影片状态色) */ --jhs-danger: #c02b2b; --jhs-danger-tint: #fde8e8; --jhs-danger-text-on: #ffffff; --jhs-warning: #826207; --jhs-warning-tint: #faf3df; --jhs-warning-text-on: #ffffff; /* 状态语义色 (品牌, 保持可辨识): red=屏蔽 cyan=收藏 green=下载 amber=观看 * -on 实色背景上的文字 (filter 用白字, 其余深字) * -text tint 背景上的文字 / 彩色文字落 surface 的正文色 */ --jhs-status-filter: #de3333; --jhs-status-filter-tint: #fde8e8; --jhs-status-filter-hover: #c02b2b; --jhs-status-filter-text: #c02b2b; --jhs-status-filter-on: #ffffff; --jhs-status-fav: #25b1dc; --jhs-status-fav-tint: #e5f6fc; --jhs-status-fav-hover: #1e93b8; --jhs-status-fav-text: #15728b; --jhs-status-fav-on: #14181d; --jhs-status-down: #7bc73b; --jhs-status-down-tint: #eff8e6; --jhs-status-down-hover: #66ac2d; --jhs-status-down-text: #387213; --jhs-status-down-on: #14181d; --jhs-status-watch: #d7a80c; --jhs-status-watch-tint: #faf3df; --jhs-status-watch-hover: #b58b09; --jhs-status-watch-text: #826207; --jhs-status-watch-on: #14181d; /* 品牌色 (第三方站点来源标识, 保持可辨识) */ --jhs-brand-javdb: #c23a85; --jhs-brand-javbus: #967004; /* 代码查看器 (终端语义, 亮暗一致, 不随主题) */ --jhs-code-bg: #1e1e1e; --jhs-code-text: #ffffff; --jhs-code-line: #aaaaaa; /* 圆角: 唯一一套 */ --jhs-radius-xs: 6px; --jhs-radius-sm: 8px; --jhs-radius-md: 12px; --jhs-radius-lg: 14px; --jhs-radius-pill: 999px; /* 阴影: 与背景同色相 */ --jhs-shadow-xs: 0 1px 2px rgba(31, 39, 51, .06); --jhs-shadow-sm: 0 1px 3px rgba(31, 39, 51, .08), 0 1px 2px rgba(31, 39, 51, .04); --jhs-shadow-md: 0 4px 14px rgba(31, 39, 51, .10); --jhs-shadow-lg: 0 12px 32px rgba(31, 39, 51, .16); /* 图标 */ --jhs-icon-color: #5b6b7c; } :root[data-jhs-theme="dark"] { --jhs-bg: #14181d; --jhs-surface: #1d232b; --jhs-surface-2: #262d37; --jhs-border: #333c47; --jhs-border-strong: #64728a; --jhs-text: #e6ebf1; --jhs-text-muted: #9aa7b6; --jhs-text-faint: #9cacbd; --jhs-input-bg: #262d37; --jhs-placeholder: #9cacbd; --jhs-disabled-bg: #262d37; --jhs-disabled-text: #9cacbd; --jhs-accent: #7ca6d4; --jhs-accent-hover: #8db3de; --jhs-accent-tint: #25354a; --jhs-accent-text-on: #14181d; --jhs-danger: #e87171; --jhs-danger-tint: #3a2323; --jhs-danger-text-on: #14181d; --jhs-warning: #e0b32e; --jhs-warning-tint: #362f18; --jhs-warning-text-on: #14181d; --jhs-status-filter: #e05a5a; --jhs-status-filter-tint: #3a2323; --jhs-status-filter-hover: #f07171; --jhs-status-filter-text: #e87171; --jhs-status-filter-on: #14181d; --jhs-status-fav: #4dbbe0; --jhs-status-fav-tint: #1f3340; --jhs-status-fav-hover: #6fcbe8; --jhs-status-fav-text: #4dbbe0; --jhs-status-fav-on: #14181d; --jhs-status-down: #93d357; --jhs-status-down-tint: #25341a; --jhs-status-down-hover: #a8de73; --jhs-status-down-text: #93d357; --jhs-status-down-on: #14181d; --jhs-status-watch: #e0b32e; --jhs-status-watch-tint: #362f18; --jhs-status-watch-hover: #ecc347; --jhs-status-watch-text: #e0b32e; --jhs-status-watch-on: #14181d; /* 品牌色 */ --jhs-brand-javdb: #e37ab6; --jhs-brand-javbus: #f0c040; /* 代码查看器 (终端语义, 亮暗一致, 不随主题) */ --jhs-code-bg: #1e1e1e; --jhs-code-text: #ffffff; --jhs-code-line: #aaaaaa; --jhs-shadow-xs: 0 1px 2px rgba(0, 0, 0, .40); --jhs-shadow-sm: 0 1px 3px rgba(0, 0, 0, .50); --jhs-shadow-md: 0 4px 14px rgba(0, 0, 0, .55); --jhs-shadow-lg: 0 12px 36px rgba(0, 0, 0, .60); --jhs-icon-color: #9aa7b6; } /* JHS 表面输入框基座 + placeholder + 禁用态 (亮暗一致, 作用域限定 JHS 表面) */ .jhs-ui input[type="text"], .jhs-ui input[type="number"], .jhs-ui textarea, .jhs-ui select, .layui-layer-content input[type="text"], .layui-layer-content input[type="number"], .layui-layer-content textarea, .layui-layer-content select { background-color: var(--jhs-input-bg); color: var(--jhs-text); border: 1px solid var(--jhs-border); } .jhs-ui ::placeholder, .layui-layer-content ::placeholder { color: var(--jhs-placeholder); opacity: 1; } .jhs-ui button:disabled, .jhs-ui input:disabled, .jhs-ui select:disabled, .layui-layer-content button:disabled, .layui-layer-content input:disabled, .layui-layer-content select:disabled { background-color: var(--jhs-disabled-bg); color: var(--jhs-disabled-text); border-color: var(--jhs-border); cursor: not-allowed; opacity: 1; } /* JHS 表面基础字体 */ .jhs-ui, .layui-layer-content, .tabulator, .toastify, .jhs-fab, .menu-box { font-family: var(--jhs-font); } /* 焦点环 */ :where(.jhs-ui) :focus-visible, :where(.layui-layer-content) :focus-visible, :where(.tabulator) :focus-visible { outline: 2px solid var(--jhs-accent); outline-offset: 2px; } /* 滚动条 (JHS 表面) */ .jhs-scrollbar::-webkit-scrollbar, .content-panel::-webkit-scrollbar, .tabulator-tableholder::-webkit-scrollbar, .layui-layer-content::-webkit-scrollbar { width: 6px; height: 6px; } .jhs-scrollbar::-webkit-scrollbar-track, .content-panel::-webkit-scrollbar-track, .tabulator-tableholder::-webkit-scrollbar-track, .layui-layer-content::-webkit-scrollbar-track { background: var(--jhs-surface-2); border-radius: 10px; } .jhs-scrollbar::-webkit-scrollbar-thumb, .content-panel::-webkit-scrollbar-thumb, .tabulator-tableholder::-webkit-scrollbar-thumb, .layui-layer-content::-webkit-scrollbar-thumb { background: var(--jhs-border-strong); border-radius: 10px; } .jhs-scrollbar::-webkit-scrollbar-thumb:hover, .content-panel::-webkit-scrollbar-thumb:hover, .tabulator-tableholder::-webkit-scrollbar-thumb:hover, .layui-layer-content::-webkit-scrollbar-thumb:hover { background: var(--jhs-text-faint); } @media (prefers-reduced-motion: reduce) { .jhs-ui, .layui-layer-content, .tabulator, .toastify, .jhs-fab, .menu-box, .jhs-ui *, .layui-layer-content *, .tabulator *, .toastify *, .jhs-fab *, .menu-box * { transition: none !important; animation: none !important; } } /* 暗色下覆盖 layui-layer 弹层 chrome (外部 layui.css 为亮色主题) */ :root[data-jhs-theme="dark"] .layui-layer { background-color: var(--jhs-surface); color: var(--jhs-text); box-shadow: var(--jhs-shadow-lg); } :root[data-jhs-theme="dark"] .layui-layer-title { background-color: var(--jhs-surface-2); color: var(--jhs-text); border-bottom: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .layui-layer-content { color: var(--jhs-text); } :root[data-jhs-theme="dark"] .layui-layer-btn a { background-color: var(--jhs-surface-2); border: 1px solid var(--jhs-border); color: var(--jhs-text); } :root[data-jhs-theme="dark"] .layui-layer-btn .layui-layer-btn0 { background-color: var(--jhs-accent); border-color: transparent; color: var(--jhs-accent-text-on); } .layui-layer-setwin .layui-layer-close { width: 36px!important; height: 36px!important; background: none!important; color: var(--jhs-text-muted)!important; font-size: 0!important; opacity: 1!important; } .layui-layer-setwin .layui-layer-close::before, .layui-layer-setwin .layui-layer-close::after { content: ""; position: absolute; top: 17px; left: 9px; width: 18px; height: 2px; border-radius: 1px; background: currentColor; } .layui-layer-setwin .layui-layer-close::before { transform: rotate(45deg); } .layui-layer-setwin .layui-layer-close::after { transform: rotate(-45deg); } .layui-layer-setwin .layui-layer-close:hover, .layui-layer-setwin .layui-layer-close:focus-visible { color: var(--jhs-text)!important; } :root[data-jhs-theme="dark"] .layui-input, :root[data-jhs-theme="dark"] .layui-layer-content input[type="text"], :root[data-jhs-theme="dark"] .layui-layer-content input[type="number"], :root[data-jhs-theme="dark"] .layui-layer-content textarea, :root[data-jhs-theme="dark"] .layui-layer-content select { background-color: var(--jhs-input-bg); color: var(--jhs-text); border: 1px solid var(--jhs-border); } /* 暗色下覆盖 Tabulator 表格 chrome (semanticui 主题为亮色) */ :root[data-jhs-theme="dark"] .tabulator { background-color: var(--jhs-surface); color: var(--jhs-text); border: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-header { background-color: var(--jhs-surface-2); color: var(--jhs-text); border-bottom: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-header .tabulator-col { background-color: var(--jhs-surface-2); color: var(--jhs-text); border-right: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-row { background-color: var(--jhs-surface); color: var(--jhs-text); border-bottom: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-row.tabulator-row-even { background-color: var(--jhs-surface-2); } :root[data-jhs-theme="dark"] .tabulator .tabulator-cell { color: var(--jhs-text); border-right: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-footer { background-color: var(--jhs-surface-2); color: var(--jhs-text); border-top: 1px solid var(--jhs-border); } :root[data-jhs-theme="dark"] .tabulator .tabulator-responsive-collapse { background-color: var(--jhs-surface-2); color: var(--jhs-text); border-top: 1px solid var(--jhs-border); } /* 暗色下图标翻转为单色, 避免深色 path 在暗表面上不可见 */ :root[data-jhs-theme="dark"] .jhs-icon path { fill: var(--jhs-icon-color); } </style> `}async function applyTheme(){const Ct=await storageManager.getSetting("themeMode","light");let mt="light";Ct==="dark"?mt="dark":Ct==="auto"&&(mt=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),document.documentElement.setAttribute("data-jhs-theme",mt)}window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(()=>{storageManager.getSetting("themeMode","light").then((Ct=>{Ct==="auto"&&applyTheme()}))}));function buildUiPrimitivesCss(){return` <style id="jhs-ui-primitives"> :where(.jhs-ui, .layui-layer-content, .menu-box, .jhs-fab-menu) { color: var(--jhs-text); font-family: var(--jhs-font); font-size: var(--jhs-font-size-md); line-height: 1.5; } :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn) { box-sizing: border-box; display: inline-flex; min-height: var(--jhs-control-height); align-items: center; justify-content: center; gap: var(--jhs-space-2); padding: 0 var(--jhs-space-3); margin: 0; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-sm); background: var(--jhs-surface); color: var(--jhs-text); box-shadow: none; font: inherit; font-size: var(--jhs-font-size-sm); font-weight: 600; line-height: 1; text-align: center; text-decoration: none; text-shadow: none; white-space: nowrap; cursor: pointer; transition: background-color var(--jhs-motion-fast) var(--jhs-ease), border-color var(--jhs-motion-fast) var(--jhs-ease), color var(--jhs-motion-fast) var(--jhs-ease), transform var(--jhs-motion-fast) var(--jhs-ease); } :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn):hover { border-color: var(--jhs-accent); background: var(--jhs-surface-2); color: var(--jhs-accent); box-shadow: none; filter: none; transform: none; } :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn):active { transform: translateY(1px); } :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn):disabled, :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn)[aria-disabled="true"] { border-color: var(--jhs-border); background: var(--jhs-disabled-bg); color: var(--jhs-disabled-text); cursor: not-allowed; opacity: 1; transform: none; } :is(.jhs-btn--primary, .jhs-btn--accent) { border-color: var(--jhs-accent); background: var(--jhs-accent); color: var(--jhs-accent-text-on); } :is(.jhs-btn--primary, .jhs-btn--accent):hover { border-color: var(--jhs-accent-hover); background: var(--jhs-accent-hover); color: var(--jhs-accent-text-on); } :is(.jhs-btn--secondary, .jhs-btn--muted, .site-btn) { border-color: var(--jhs-border); background: var(--jhs-surface); color: var(--jhs-text); } .jhs-btn--danger { border-color: var(--jhs-danger); background: var(--jhs-danger); color: var(--jhs-danger-text-on); } .jhs-btn--danger:hover { border-color: var(--jhs-danger); background: var(--jhs-danger); color: var(--jhs-danger-text-on); filter: brightness(.92); } .jhs-btn--ghost { border-color: transparent; background: transparent; color: var(--jhs-text-muted); } .jhs-btn--ghost:hover { border-color: transparent; background: var(--jhs-surface-2); color: var(--jhs-text); } .jhs-btn--soft { border-color: transparent; background: var(--jhs-accent-tint); color: var(--jhs-accent); } .jhs-btn--filter { border-color: transparent; background: var(--jhs-status-filter-tint); color: var(--jhs-status-filter-text); } .jhs-btn--fav { border-color: transparent; background: var(--jhs-status-fav-tint); color: var(--jhs-status-fav-text); } .jhs-btn--down { border-color: transparent; background: var(--jhs-status-down-tint); color: var(--jhs-status-down-text); } .jhs-btn--watch { border-color: transparent; background: var(--jhs-status-watch-tint); color: var(--jhs-status-watch-text); } :is(.jhs-btn--filter, .jhs-btn--fav, .jhs-btn--down, .jhs-btn--watch):hover { border-color: var(--jhs-border-strong); background: var(--jhs-surface-2); color: var(--jhs-text); } .jhs-btn--sm { min-height: var(--jhs-control-height-sm); padding-inline: var(--jhs-space-2); font-size: var(--jhs-font-size-xs); } .jhs-icon-btn, .card-btn { width: var(--jhs-control-height); min-width: var(--jhs-control-height); height: var(--jhs-control-height); min-height: var(--jhs-control-height); padding: 0; border: 1px solid transparent; border-radius: var(--jhs-radius-sm); background: transparent; color: var(--jhs-icon-color); box-shadow: none; } :where(.jhs-icon-btn, .card-btn):hover { border-color: var(--jhs-border); background: var(--jhs-surface-2); color: var(--jhs-text); box-shadow: none; transform: none; } :where(.jhs-icon-btn, .card-btn) svg { width: 18px; height: 18px; } :where(.jhs-field, .jhs-select, .jhs-textarea, .jhs-ui input:not([type]), .jhs-ui input[type="text"], .jhs-ui input[type="number"], .jhs-ui input[type="url"], .jhs-ui input[type="password"], .jhs-ui select, .jhs-ui textarea, .layui-layer-content input:not([type]), .layui-layer-content input[type="text"], .layui-layer-content input[type="number"], .layui-layer-content input[type="url"], .layui-layer-content input[type="password"], .layui-layer-content select, .layui-layer-content textarea) { box-sizing: border-box; min-height: var(--jhs-control-height); padding: var(--jhs-space-2) var(--jhs-space-3); border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-sm); background: var(--jhs-input-bg); color: var(--jhs-text); font: inherit; font-size: var(--jhs-font-size-sm); line-height: 1.35; transition: background-color var(--jhs-motion-fast) var(--jhs-ease), border-color var(--jhs-motion-fast) var(--jhs-ease), box-shadow var(--jhs-motion-fast) var(--jhs-ease); } :where(.jhs-field, .jhs-select, .jhs-textarea, .jhs-ui input, .jhs-ui select, .jhs-ui textarea, .layui-layer-content input, .layui-layer-content select, .layui-layer-content textarea):hover:not(:disabled) { border-color: var(--jhs-accent); } :where(.jhs-field, .jhs-select, .jhs-textarea, .jhs-ui input, .jhs-ui select, .jhs-ui textarea, .layui-layer-content input, .layui-layer-content select, .layui-layer-content textarea):focus-visible { border-color: var(--jhs-accent); outline: 2px solid var(--jhs-accent-tint); outline-offset: 1px; box-shadow: 0 0 0 1px var(--jhs-accent); } :where(.jhs-field, .jhs-select, .jhs-textarea, .jhs-ui input[type="text"], .jhs-ui input[type="number"], .jhs-ui input[type="url"], .jhs-ui select, .jhs-ui textarea, .layui-layer-content input[type="text"], .layui-layer-content input[type="number"], .layui-layer-content input[type="url"], .layui-layer-content select, .layui-layer-content textarea):hover:not(:focus) { border-color: var(--jhs-border-strong); } :where(.jhs-textarea, .jhs-ui textarea, .layui-layer-content textarea) { min-height: 76px; resize: vertical; } .jhs-switch, .mini-switch { appearance: none; box-sizing: border-box; width: 40px; min-width: 40px; height: 22px; min-height: 22px; padding: 2px; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-pill); background: var(--jhs-surface-2); cursor: pointer; transition: background-color var(--jhs-motion-fast) var(--jhs-ease), border-color var(--jhs-motion-fast) var(--jhs-ease); } :where(.jhs-switch, .mini-switch)::before { display: block; width: 16px; height: 16px; border-radius: 50%; background: var(--jhs-surface); box-shadow: var(--jhs-shadow-xs); content: ""; transition: transform var(--jhs-motion-fast) var(--jhs-ease); } :where(.jhs-switch, .mini-switch):checked { border-color: var(--jhs-accent); background: var(--jhs-accent); } :where(.jhs-switch, .mini-switch):checked::before { transform: translateX(18px); } :where(.jhs-range, .jhs-ui input[type="range"], .layui-layer-content input[type="range"]) { appearance: none; width: 100%; height: 22px; margin: 0; padding: 0; border: 0; background: transparent; cursor: pointer; } :where(.jhs-range, .jhs-ui input[type="range"], .layui-layer-content input[type="range"])::-webkit-slider-runnable-track { height: 4px; border-radius: var(--jhs-radius-pill); background: var(--jhs-border); } :where(.jhs-range, .jhs-ui input[type="range"], .layui-layer-content input[type="range"])::-webkit-slider-thumb { appearance: none; width: 18px; height: 18px; margin-top: -7px; border: 2px solid var(--jhs-surface); border-radius: 50%; background: var(--jhs-accent); box-shadow: 0 0 0 1px var(--jhs-accent), var(--jhs-shadow-xs); } :where(.jhs-range, .jhs-ui input[type="range"], .layui-layer-content input[type="range"]):disabled { cursor: not-allowed; opacity: .55; } .jhs-toolbar { display: flex; align-items: center; gap: var(--jhs-space-2); flex-wrap: wrap; min-width: 0; } .jhs-toolbar--between { justify-content: space-between; } .jhs-toolbar__group { display: flex; align-items: center; gap: var(--jhs-space-2); flex-wrap: wrap; min-width: 0; } .jhs-section { display: grid; gap: var(--jhs-space-3); margin-block: 0 var(--jhs-space-4); } .jhs-section__heading { margin: 0; color: var(--jhs-text); font-size: var(--jhs-font-size-lg); font-weight: 700; line-height: 1.3; } .jhs-section__description, .jhs-helper-text { margin: 0; color: var(--jhs-text-muted); font-size: var(--jhs-font-size-xs); line-height: 1.5; } .jhs-card, .jhs-setting-group { box-sizing: border-box; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-md); background: var(--jhs-surface); box-shadow: none; } .jhs-card { padding: var(--jhs-space-4); } .jhs-setting-group { overflow: hidden; } .jhs-setting-row { box-sizing: border-box; display: grid; grid-template-columns: minmax(180px, 1fr) minmax(180px, 280px); gap: var(--jhs-space-4); align-items: center; min-height: 52px; margin: 0; padding: var(--jhs-space-3) var(--jhs-space-4); border-bottom: 1px solid var(--jhs-border); } :where(.jhs-setting-group, .content-panel) > .jhs-setting-row:last-child { border-bottom: 0; } .jhs-setting-row__label, .setting-label { min-width: 0; margin: 0; color: var(--jhs-text); font-size: var(--jhs-font-size-sm); font-weight: 600; line-height: 1.4; } .jhs-setting-row__description { display: block; margin-top: var(--jhs-space-1); color: var(--jhs-text-muted); font-size: var(--jhs-font-size-xs); font-weight: 400; } .jhs-setting-row__control, .form-content { display: flex; min-width: 0; max-width: none; align-items: center; justify-content: flex-end; gap: var(--jhs-space-2); } :where(.jhs-setting-row__control, .form-content) > :where(input, select, textarea) { width: min(100%, 280px); margin: 0; } .jhs-segmented, .magnet-tabs__options { display: inline-flex; align-items: center; gap: var(--jhs-space-1); padding: var(--jhs-space-1); border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-md); background: var(--jhs-surface-2); } .jhs-segmented__item, .magnet-tab { display: inline-flex; align-items: center; justify-content: center; min-height: var(--jhs-control-height-sm); padding: 0 var(--jhs-space-3); border: 0; border-radius: var(--jhs-radius-xs); background: transparent; color: var(--jhs-text-muted); font-size: var(--jhs-font-size-sm); font-weight: 600; line-height: 1; cursor: pointer; } :where(.jhs-segmented__item, .magnet-tab):hover { background: var(--jhs-surface); color: var(--jhs-text); } :where(.jhs-segmented__item, .magnet-tab).active, :where(.jhs-segmented__item, .magnet-tab)[aria-selected="true"] { background: var(--jhs-surface); color: var(--jhs-text); box-shadow: var(--jhs-shadow-xs); } .jhs-popover { position: absolute; top: calc(100% + var(--jhs-space-2)); right: 0; z-index: 30; display: none; min-width: 152px; padding: var(--jhs-space-2); border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-md); background: var(--jhs-surface); box-shadow: var(--jhs-shadow-md); } .jhs-popover.is-open { display: grid; gap: var(--jhs-space-1); } .jhs-popover [role="menuitem"], .jhs-popover [role="menuitemradio"] { width: 100%; justify-content: flex-start; } .jhs-select-control { position:relative; display:inline-flex; min-width:140px; max-width:100%; } .jhs-select-source-native { display:none!important; } .jhs-select-trigger { width:100%; justify-content:space-between; } .jhs-select-trigger::after { content:"▾"; margin-left:var(--jhs-space-2); color:var(--jhs-text-muted); font-size:11px; } .jhs-select-control.is-open .jhs-select-trigger::after { content:"▴"; } .jhs-select-menu { left:0; right:auto; min-width:100%; max-height:320px; overflow-y:auto; } .jhs-select-group { display:grid; gap:var(--jhs-space-1); } .jhs-select-group__label { padding:var(--jhs-space-1) var(--jhs-space-2); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-xs); font-weight:600; } .jhs-select-option[aria-checked="true"] { background:var(--jhs-accent-tint); color:var(--jhs-accent); } .jhs-task-emphasis { color:var(--jhs-status-filter-text); } .jhs-code-viewer { height:100%; overflow:auto; padding:15px 5px; background:var(--jhs-code-bg); color:var(--jhs-code-text); font-family:Consolas,Monaco,monospace; white-space:pre-wrap; } .jhs-code-line-number { color:var(--jhs-code-line); } .jhs-count-table__cell { padding:3px; border:1px solid var(--jhs-border); } .jhs-count-table__head { padding:3px; border:1px solid var(--jhs-border); font-weight:700; } .jhs-play-overlay { position:absolute; inset:50% auto auto 50%; transform:translate(-50%,-50%); color:#fff; font-size:40px; text-shadow:0 0 10px rgba(0,0,0,.5); } .jhs-image-preview { max-width:100%; max-height:300px; border-radius:var(--jhs-radius-xs); box-shadow:var(--jhs-shadow-xs); } .jhs-badge, .jhs-chip, .card-tag, .card-new-count-tag, .magnet-score { box-sizing: border-box; display: inline-flex; min-height: 24px; align-items: center; justify-content: center; gap: var(--jhs-space-1); padding: 2px var(--jhs-space-2); border: 1px solid transparent; border-radius: var(--jhs-radius-pill); background: var(--jhs-surface-2); color: var(--jhs-text-muted); font-size: var(--jhs-font-size-xs); font-weight: 600; line-height: 1.2; white-space: nowrap; } .jhs-badge--accent, .card-new-count-tag { background: var(--jhs-accent-tint); color: var(--jhs-accent); } .jhs-badge--danger, .card-tag { background: var(--jhs-status-filter-tint); color: var(--jhs-status-filter-text); } .jhs-badge--success { background: var(--jhs-status-down-tint); color: var(--jhs-status-down-text); } .jhs-badge--neutral { border-color: var(--jhs-border); background: var(--jhs-surface-2); color: var(--jhs-text-muted); } .jhs-badge--filter { background: var(--jhs-status-filter-tint); color: var(--jhs-status-filter-text); } .jhs-badge--fav { background: var(--jhs-status-fav-tint); color: var(--jhs-status-fav-text); } .jhs-badge--down { background: var(--jhs-status-down-tint); color: var(--jhs-status-down-text); } .jhs-badge--watch { background: var(--jhs-status-watch-tint); color: var(--jhs-status-watch-text); } .jhs-pagination, #actress-pagination, #nv-pagination-bar { display: flex; align-items: center; justify-content: center; gap: var(--jhs-space-1); flex-wrap: wrap; padding-top: var(--jhs-space-3); border-top: 1px solid var(--jhs-border); } :where(.jhs-pagination, #actress-pagination, #nv-pagination-bar) .pagination-btn { min-width: var(--jhs-control-height-sm); min-height: var(--jhs-control-height-sm); padding-inline: var(--jhs-space-2); } :where(.jhs-pagination, #actress-pagination, #nv-pagination-bar) .pagination-btn.active, :where(.jhs-pagination, #actress-pagination, #nv-pagination-bar) .pagination-btn[aria-current="page"] { border-color: var(--jhs-accent); background: var(--jhs-accent); color: var(--jhs-accent-text-on); } .jhs-state, .magnet-loading, .magnet-error { box-sizing: border-box; display: grid; min-height: 120px; place-items: center; gap: var(--jhs-space-2); padding: var(--jhs-space-5); border: 1px dashed var(--jhs-border-strong); border-radius: var(--jhs-radius-md); background: var(--jhs-surface-2); color: var(--jhs-text-muted); text-align: center; } .jhs-state--error, .magnet-error { border-color: var(--jhs-status-filter-text); background: var(--jhs-status-filter-tint); color: var(--jhs-status-filter-text); } .jhs-is-hidden { display: none !important; } .jhs-dialog-title { padding: 0 var(--jhs-space-2); } .jhs-pagination__summary { margin-left: var(--jhs-space-3); color: var(--jhs-text-muted); font-size: var(--jhs-font-size-sm); } .jhs-skeleton { overflow: hidden; border-radius: var(--jhs-radius-xs); background: var(--jhs-surface-2); } @media (prefers-reduced-motion: no-preference) { .jhs-skeleton { background: linear-gradient(90deg, var(--jhs-surface-2) 25%, var(--jhs-border) 50%, var(--jhs-surface-2) 75%); background-size: 200% 100%; animation: jhs-skeleton-shimmer 1.4s ease-in-out infinite; } @keyframes jhs-skeleton-shimmer { to { background-position-x: -200%; } } } .layui-layer { overflow: hidden; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-lg) !important; background: var(--jhs-surface); color: var(--jhs-text); box-shadow: var(--jhs-shadow-lg) !important; } .layui-layer-title { min-height: 48px; padding: 0 52px 0 var(--jhs-space-4); border-bottom: 1px solid var(--jhs-border); background: var(--jhs-surface); color: var(--jhs-text); font-size: var(--jhs-font-size-lg); font-weight: 700; line-height: 48px; } .layui-layer-btn { display: flex; justify-content: flex-end; gap: var(--jhs-space-2); padding: var(--jhs-space-3) var(--jhs-space-4) !important; border-top: 1px solid var(--jhs-border); background: var(--jhs-surface); } .layui-layer-btn a { min-height: var(--jhs-control-height); margin: 0 !important; padding: 0 var(--jhs-space-3) !important; border: 1px solid var(--jhs-border-strong) !important; border-radius: var(--jhs-radius-sm) !important; background: var(--jhs-surface) !important; color: var(--jhs-text) !important; line-height: var(--jhs-control-height) !important; } .layui-layer-btn .layui-layer-btn0 { border-color: var(--jhs-accent) !important; background: var(--jhs-accent) !important; color: var(--jhs-accent-text-on) !important; } .tabulator { overflow: hidden; border: 1px solid var(--jhs-border) !important; border-radius: var(--jhs-radius-md); background: var(--jhs-surface) !important; color: var(--jhs-text) !important; font-family: var(--jhs-font); font-size: var(--jhs-font-size-sm); } .tabulator .tabulator-header, .tabulator .tabulator-header .tabulator-col { min-height: 40px; border-color: var(--jhs-border) !important; background: var(--jhs-surface-2) !important; color: var(--jhs-text) !important; } .tabulator .tabulator-row { min-height: 44px; border-color: var(--jhs-border) !important; background: var(--jhs-surface) !important; color: var(--jhs-text) !important; } .tabulator .tabulator-row:hover { background: var(--jhs-surface-2) !important; } .tabulator .tabulator-cell { display: inline-flex; min-height: 44px; align-items: center; border-right: 0 !important; color: var(--jhs-text) !important; } .tabulator .tabulator-row { border-bottom: 1px solid var(--jhs-border) !important; } .tabulator .tabulator-header .tabulator-col { border-right-color: color-mix(in srgb, var(--jhs-border) 55%, transparent) !important; } .tabulator .tabulator-footer { border-color: var(--jhs-border) !important; background: var(--jhs-surface-2) !important; color: var(--jhs-text) !important; } /* 新作品列表卡保留轻边框,结构布局由插件自身样式负责。 */ .nv-card { border: 1px solid var(--jhs-border) !important; border-radius: var(--jhs-radius-md) !important; background: var(--jhs-surface) !important; box-shadow: none !important; transform: none !important; transition: border-color var(--jhs-motion-fast) var(--jhs-ease) !important; } .nv-card:hover { border-color: var(--jhs-accent) !important; box-shadow: none !important; transform: none !important; } /* 磁力搜索:分段控件、紧凑结果行和明确反馈状态。 */ .magnet-container { width: 100%; margin: var(--jhs-space-3) auto !important; color: var(--jhs-text); font-family: var(--jhs-font) !important; } .magnet-tabs { display: flex; align-items: center; justify-content: space-between !important; gap: var(--jhs-space-3); margin-bottom: var(--jhs-space-3) !important; padding: 0 !important; border-bottom: 0 !important; } .magnet-tabs > div { display: inline-flex !important; gap: var(--jhs-space-1); padding: var(--jhs-space-1); border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-md); background: var(--jhs-surface-2); } .magnet-tab { min-height: var(--jhs-control-height-sm); margin: 0 !important; padding: 0 var(--jhs-space-3) !important; border: 0 !important; border-radius: var(--jhs-radius-xs) !important; background: transparent !important; color: var(--jhs-text-muted); line-height: var(--jhs-control-height-sm); } .magnet-tab.active { margin: 0 !important; border: 0 !important; background: var(--jhs-surface) !important; color: var(--jhs-text); box-shadow: var(--jhs-shadow-xs); } .magnet-results { min-height: 200px; overflow: hidden; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-md); background: var(--jhs-surface); } .magnet-result { min-height: 68px; padding: var(--jhs-space-3) 190px var(--jhs-space-3) var(--jhs-space-4) !important; border-bottom: 1px solid var(--jhs-border) !important; background: var(--jhs-surface); } .magnet-result:last-child { border-bottom: 0 !important; } .magnet-result:hover { background: var(--jhs-surface-2) !important; } .magnet-title { margin-bottom: var(--jhs-space-1) !important; padding-right: 0 !important; font-weight: 600 !important; } .magnet-title a { display: inline-block; max-width: calc(100% - 52px); overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; white-space: nowrap; } .magnet-score { margin-right: var(--jhs-space-1); font-size: var(--jhs-font-size-sm); cursor: help; } .magnet-info { justify-content: flex-start !important; gap: var(--jhs-space-4); margin: 0 !important; color: var(--jhs-text-muted) !important; } .magnet-copy { top: 50% !important; right: var(--jhs-space-3) !important; display: flex; flex: 0 0 auto; flex-wrap: nowrap; gap: var(--jhs-space-2); transform: translateY(-50%); } .magnet-hub-btn { flex: 0 0 auto; min-height: var(--jhs-control-height-sm) !important; margin: 0 !important; padding: 0 var(--jhs-space-2) !important; border-radius: var(--jhs-radius-sm) !important; font-size: var(--jhs-font-size-xs) !important; white-space: nowrap; } .magnet-hub-btn.copied { border-color: transparent !important; background: var(--jhs-status-down-tint) !important; color: var(--jhs-status-down-text) !important; } @media (max-width: 768px) { :is(.jhs-btn, .jhs-filter-btn, .site-btn, .magnet-hub-btn, .pagination-btn, .jhs-icon-btn, .card-btn) { min-height: var(--jhs-touch-target); } :where(.jhs-icon-btn, .card-btn) { width: var(--jhs-touch-target); min-width: var(--jhs-touch-target); height: var(--jhs-touch-target); } .jhs-setting-row { grid-template-columns: 1fr; gap: var(--jhs-space-2); padding: var(--jhs-space-3); } .jhs-setting-row__control, .form-content { justify-content: stretch; } :where(.jhs-setting-row__control, .form-content) > :where(input, select, textarea, button, a) { width: 100%; max-width: none; } .jhs-toolbar--between { align-items: stretch; flex-direction: column; } .magnet-tabs { align-items: stretch; flex-direction: column; } .magnet-tabs > div { max-width: 100%; overflow-x: auto; } .magnet-result { padding-right: var(--jhs-space-4) !important; } .magnet-copy { position: static !important; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: var(--jhs-space-2); transform: none; } .magnet-copy .magnet-hub-btn { width: 100%; min-height: var(--jhs-touch-target) !important; } .jhs-segmented { max-width: 100%; overflow-x: auto; } } /* migrated template layout utilities */ .jhs-layout-06cf30c0 { margin-top:15px;display:flex;justify-content:center;gap:10px; } .jhs-layout-186f17ef { padding:18px 18px !important; } .jhs-layout-1b3790ef { display:flex;margin-bottom:10px; } .jhs-layout-1e90930a { display:flex;gap:10px;flex-wrap:wrap; } .jhs-layout-2100e73d { margin-left:20px; } .jhs-layout-21a4fe43 { margin-left:0 } .jhs-layout-2335597e { padding:18px 18px !important;margin-left:50px } .jhs-layout-27f87d75 { display:block;margin-bottom:5px; } .jhs-layout-294497f1 { top:-15px } .jhs-layout-2afc43dc { min-width:120px; } .jhs-layout-2e003268 { margin-bottom:5px } .jhs-layout-31a824a2 { display:flex;gap:5px } .jhs-layout-3536a853 { margin-top:30px;cursor:auto } .jhs-layout-3b6a3a65 { cursor:pointer } .jhs-layout-3f0d74e1 { min-width:120px; } .jhs-layout-3fed2a7e { margin-left:5px; } .jhs-layout-3fefafab { overflow-y:auto;height:calc(100% - 40px); } .jhs-layout-44293084 { width:120px;text-align:center;padding:8px 0; } .jhs-layout-481ed7e7 { padding:10px; } .jhs-layout-53809f1e { display:flex;gap:5px; } .jhs-layout-583c2485 { height:100%;padding-bottom:20px } .jhs-layout-598afa5a { margin-bottom:25px; } .jhs-layout-5c319329 { min-width:120px; } .jhs-layout-5f3e3549 { width:140px;text-align:center;padding:8px 0; } .jhs-layout-66253c00 { margin-top:8px;display:none } .jhs-layout-6b99de8b { display:none } .jhs-layout-6d489fc7 { margin:0 0.75rem } .jhs-layout-701bf0f9 { margin-bottom:0!important; } .jhs-layout-761d3add { margin-bottom:10px } .jhs-layout-769fed37 { padding:20px } .jhs-layout-78fa54ea { margin-left:10px } .jhs-layout-7cb3f981 { padding:10px 20px;height:100%;overflow:hidden; } .jhs-layout-7daea5fa { margin-bottom:5px; } .jhs-layout-81eaab28 { height:calc(100% - 50px);overflow-x:hidden; } .jhs-layout-8453d189 { display:flex;align-items:center;flex-grow:1;justify-content:flex-end; } .jhs-layout-8896c95d { margin-right:5px } .jhs-layout-8cddc29a { padding:20px; } .jhs-layout-8cf76fd7 { width:150px;height:auto; } .jhs-layout-9813a0dd { margin-left:5px } .jhs-layout-9db87399 { margin-top:50px;cursor:auto } .jhs-layout-9e3c853e { margin-bottom:15px; } .jhs-layout-9ea2322d { margin:20px auto } .jhs-layout-9fe45cd8 { width:120px; } .jhs-layout-a38a0e50 { max-height:100%;max-width:100%;object-fit:contain } .jhs-layout-b12542a5 { width:100% } .jhs-layout-b5c4e4f7 { overflow:hidden;height:110px;text-align:center; } .jhs-layout-ba4750c8 { margin:30px 0 } .jhs-layout-bd59a2e1 { text-align:center;margin-bottom:15px; } .jhs-layout-c0d4a511 { margin-top:5px; } .jhs-layout-c4eb15bf { width:100%;padding:12px; cursor:pointer; } .jhs-layout-cad980f4 { width:100%; } .jhs-layout-cd9d5db1 { overflow:hidden;max-height:215px;text-align:center; } .jhs-layout-d10a577d { margin-bottom:20px;text-align:center;display:none; } .jhs-layout-d2c171b1 { margin-top:10px } .jhs-layout-d44e70c7 { height:calc(100% - 50px); } .jhs-layout-d4a09a0d { width:200px; } .jhs-layout-d4a575e8 { height:inherit;width:100%; } .jhs-layout-d50e4f09 { margin-top:15px;display:none; } .jhs-layout-d543acf8 { display:flex;justify-content:center;align-items:center;position:absolute;top:0;left:0;height:100%;width:100%;z-index:10;overflow:hidden } .jhs-layout-d9caa2c0 { display:flex;align-items:center;gap:5px; } .jhs-layout-da303dcf { margin-bottom:15px; } .jhs-layout-da5a4919 { display:flex;justify-content:space-between; } .jhs-layout-dd5a75f6 { width:300px; } .jhs-layout-e2965a97 { margin:10px auto;display:flex;justify-content:space-between;align-items:center;flex-wrap:wrap;gap:20px; } .jhs-layout-e32cff7f { padding:30px; } .jhs-layout-e5d57abb { overflow:hidden;max-height:150px;max-width:150px;text-align:center; } .jhs-layout-f43f0d6d { width:160px;text-align:center;padding:8px 0; } .jhs-layout-f4e719ae { margin:10px 0 } .jhs-layout-f5f47b30 { margin-left:100px;width:400px; } @media (prefers-reduced-motion: reduce) { :where(.jhs-ui, .layui-layer-content, .menu-box, .jhs-fab-menu) *, :where(.jhs-ui, .layui-layer-content, .menu-box, .jhs-fab-menu) *::before, :where(.jhs-ui, .layui-layer-content, .menu-box, .jhs-fab-menu) *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; } } </style>`}function initializeUiAccessibility(){const Ct=mt=>{const bt=mt.nodeType===Node.ELEMENT_NODE?[mt]:[],wt=mt.querySelectorAll?[...mt.querySelectorAll("button, a[role='button'], .card-btn, .jhs-icon-btn")]:[];[...bt,...wt].forEach((yt=>{if(!yt.matches?.("button, a[role='button'], .card-btn, .jhs-icon-btn")||yt.hasAttribute("aria-label")||yt.hasAttribute("aria-labelledby")||yt.textContent.trim())return;const jt=yt.getAttribute("title")||yt.getAttribute("data-tip");jt&&yt.setAttribute("aria-label",jt)}))};Ct(document),new MutationObserver((mt=>mt.forEach((bt=>bt.addedNodes.forEach(Ct))))).observe(document.documentElement,{childList:!0,subtree:!0})}const Wt=class Wt{constructor(mt){if(this.source=$(mt),!this.source.length||Wt.instances.has(this.source[0]))return Wt.instances.get(this.source[0]);const bt=this.source.hasClass("jhs-is-hidden")||this.source[0].style.display==="none";this.control=$('<div class="jhs-select-control"></div>'),this.trigger=$('<button type="button" class="jhs-btn jhs-btn--secondary jhs-select-trigger" aria-haspopup="menu" aria-expanded="false"><span class="jhs-select-value"></span></button>'),this.menu=$('<div class="jhs-popover jhs-select-menu" role="menu"></div>'),this.source.wrap(this.control),this.control=this.source.parent(),this.control.append(this.trigger,this.menu),this.source.addClass("jhs-select-source-native").attr({"aria-hidden":"true",tabindex:"-1"}),bt&&this.control.addClass("jhs-is-hidden"),Wt.instances.set(this.source[0],this),this.render(),this.bind(),this.refresh()}static enhance(mt=document){const bt=$(mt),wt=bt.is("select.jhs-select-source")?bt:bt.find("select.jhs-select-source");return wt.each(((yt,jt)=>new Wt(jt))),wt}static get(mt){const bt=$(mt)[0];return bt?Wt.instances.get(bt)||new Wt(bt):null}static setValue(mt,bt,wt=!1){const yt=Wt.get(mt);yt&&(yt.source.val(bt),yt.refresh(),wt&&yt.source.trigger("change"))}static refresh(mt){Wt.get(mt)?.refresh()}static refreshAll(mt=document){Wt.enhance(mt),$(mt).find("select.jhs-select-source").each(((bt,wt)=>Wt.refresh(wt)))}static setVisible(mt,bt){Wt.get(mt)?.control.toggleClass("jhs-is-hidden",!bt)}static closeAll(mt=null){$(".jhs-select-control.is-open").each(((bt,wt)=>{const yt=$(wt).children("select.jhs-select-source")[0],jt=yt&&Wt.instances.get(yt);jt&&jt!==mt&&jt.close()}))}render(){this.menu.empty();const mt=(bt,wt)=>{const yt=$('<button type="button" class="jhs-btn jhs-btn--ghost jhs-select-option" role="menuitemradio" tabindex="-1"></button>');yt.attr({"data-value":bt.value,"aria-checked":bt.selected?"true":"false"}).prop("disabled",bt.disabled).text(bt.text),wt.append(yt)};this.source.children().each(((bt,wt)=>{if(wt.tagName==="OPTGROUP"){const yt=$('<div class="jhs-select-group" role="group"></div>').attr("aria-label",wt.label),jt=$('<div class="jhs-select-group__label"></div>').text(wt.label);yt.append(jt),$(wt).children("option").each(((xt,$t)=>mt($t,yt))),this.menu.append(yt)}else wt.tagName==="OPTION"&&mt(wt,this.menu)}))}bind(){this.trigger.on("click",(mt=>{mt.preventDefault(),mt.stopPropagation(),this.source.prop("disabled")||(this.control.hasClass("is-open")?this.close():this.open())})).on("keydown",(mt=>{["ArrowDown","ArrowUp","Home","End"].includes(mt.key)&&(mt.preventDefault(),this.open(mt.key==="ArrowUp"||mt.key==="End"?"last":"selected"))})),this.menu.on("click",".jhs-select-option",(mt=>{mt.preventDefault(),this.choose($(mt.currentTarget))})).on("keydown",".jhs-select-option",(mt=>{const bt=this.options(),wt=bt.index(mt.currentTarget);if(mt.key==="Escape")return mt.preventDefault(),this.close(!0);if(mt.key==="Tab")return void this.close();if(["Enter"," "].includes(mt.key))return mt.preventDefault(),this.choose($(mt.currentTarget));if(!["ArrowDown","ArrowUp","Home","End"].includes(mt.key))return;mt.preventDefault();const yt=mt.key==="Home"?0:mt.key==="End"?bt.length-1:mt.key==="ArrowDown"?(wt+1)%bt.length:(wt-1+bt.length)%bt.length;bt.eq(yt).trigger("focus")})),this.source.on("change.jhsSelect",(()=>this.refresh())),$(document).on("click.jhsSelect",(mt=>{$(mt.target).closest(this.control).length||this.close()}))}options(){return this.menu.find(".jhs-select-option:not(:disabled)")}open(mt="selected"){Wt.closeAll(this),this.control.addClass("is-open"),this.menu.addClass("is-open"),this.trigger.attr("aria-expanded","true");const bt=this.options(),wt=bt.filter('[aria-checked="true"]');(mt==="last"?bt.last():wt.length?wt.first():bt.first()).trigger("focus")}close(mt=!1){this.control.removeClass("is-open"),this.menu.removeClass("is-open"),this.trigger.attr("aria-expanded","false"),mt&&this.trigger.trigger("focus")}choose(mt){mt.prop("disabled")||(this.source.val(mt.attr("data-value")).trigger("change"),this.close(!0))}refresh(){const mt=this.source.find("option:selected").first(),bt=this.source.val();this.trigger.find(".jhs-select-value").text(mt.text()),this.trigger.prop("disabled",this.source.prop("disabled")),this.menu.find(".jhs-select-option").attr("aria-checked","false").filter(((wt,yt)=>$(yt).attr("data-value")===String(bt??""))).attr("aria-checked","true")}};Ke(Wt,"instances",new WeakMap);let JhsSelect=Wt;const N=` <style> .top-bar { z-index:12345689!important; } ${M} .masonry { display:grid; width:100%!important; height:100%!important; padding:0 15px!important; column-gap:10px; row-gap:10px; grid-template-columns:repeat(4,minmax(0,1fr)); align-items:start; } .masonry .item { top:initial!important; left:initial!important; float:none!important; position:relative!important; background-color:var(--jhs-surface-2); } .masonry .movie-box { width:100%!important; height:100%!important; margin:0!important; overflow:inherit!important; } .masonry .movie-box .photo-frame { height:auto!important; margin:0!important; position:relative; } .masonry .movie-box img { max-height:500px; height:100%!important; object-fit:contain; object-position:top; transform:none!important; transition:none!important; } .masonry .photo-info span { display:inline-block; max-width:100%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .photo-frame .mheyzo, .photo-frame .mcaribbeancom2 { margin-left:0!important; } .avatar-box { display:flex!important; width:100%!important; margin:0!important; } .avatar-box .photo-info { display:flex; align-items:center; justify-content:center; gap:30px; flex-direction:row; background-color:#fff!important; } footer { display:none!important; } .video-title { display:-webkit-box!important; height:75px; white-space:normal!important; -webkit-box-orient:vertical; -webkit-line-clamp:3; } </style>`,E=` <style> ${j} .navbar { z-index:12345679!important; padding:0; } .navbar-link:not(.is-arrowless) { padding-right:33px; } .sub-header, #footer, .app-desktop-banner, div[data-controller="movie-tab"] .tabs, h3.main-title, div.video-detail > div:nth-child(4) > div > div.tabs.no-bottom > ul > li:nth-child(3), div.video-detail > div:nth-child(4) > div > div.tabs.no-bottom > ul > li:nth-child(2), div.video-detail > div:nth-child(4) > div > div.tabs.no-bottom > ul > li:nth-child(1), .top-meta, .float-buttons { display:none!important; } div.tabs.no-bottom, .tabs ul { border-bottom:none!important; } .movie-list .item { position:relative!important; } .movie-list .item .cover img { transform:none!important; transition:none!important; } .video-title { display:-webkit-box; height:80px; white-space:normal!important; -webkit-box-orient:vertical; -webkit-line-clamp:3; } .main-tabs, .tabs { overflow-x:hidden; flex-wrap:wrap; justify-content:flex-start; } .main-tabs ul, .tabs ul { flex-wrap:wrap; flex-grow:0; } .toolbar { display:flex; } </style>`,F=` <style> .fr-btn { float:right; margin-left:4px!important; } .menu-box { position:fixed; right:10px; top:50%; display:flex; flex-direction:column; gap:6px; z-index:1000; transform:translateY(-50%); } .do-hide { display:none!important; } .jhs-icon { width:16px; height:16px; } .tool-box .jhs-icon { width:1.5rem; height:1.5rem; } .jhs-nav-btn { color:var(--jhs-accent)!important; font-weight:600; } .jhs-nav-btn:hover { color:var(--jhs-accent-hover)!important; } .tabulator .tabulator-row .action-cell-dropdown { overflow:visible!important; } .tabulator .tabulator-row.tabulator-selectable:hover { cursor:default!important; } .tabulator .tabulator-col.tabulator-sortable[aria-sort="ascending"] .tabulator-arrow { border-bottom-color:var(--jhs-accent)!important; } .tabulator .tabulator-col.tabulator-sortable[aria-sort="descending"] .tabulator-arrow { border-top-color:var(--jhs-accent)!important; } .tabulator-responsive-collapse { border-top:none!important; } .tabulator-responsive-collapse table { margin-left:50px!important; } .tabulator-cell { height:auto!important; } .tabulator .tabulator-cell { white-space:normal!important; text-overflow:clip!important; } .tabulator-tableholder { overflow-x:hidden!important; } ${(function(){const Ct=[".jhs-scrollbar",".content-panel",".tabulator-tableholder",".has-navbar-fixed-top",".layui-layer-content"],mt=(jt,xt)=>jt.map(($t=>`${$t}${xt}`)).join(",");return`${mt(Ct,"::-webkit-scrollbar")}{width:6px;height:6px}${mt(Ct,"::-webkit-scrollbar-track")}{background:var(--jhs-surface-2);border-radius:10px}${mt(Ct,"::-webkit-scrollbar-thumb")}{background:var(--jhs-border-strong);border-radius:10px}${mt(Ct,"::-webkit-scrollbar-thumb:hover")}{background:var(--jhs-text-faint)}`})()} </style>`;H(buildThemeCss()),l&&H(N),r&&H(E),H(F),H(buildUiPrimitivesCss()),initializeUiAccessibility();function createIndexedMap(Ct,mt){return new Map(Ct.filter((bt=>bt&&bt[mt])).map((bt=>[bt[mt],bt])))}function createStatusMap(Ct){const mt={[d]:new Set,[h]:new Set,[g]:new Set,[p]:new Set};return Ct.forEach((bt=>{bt&&Object.prototype.hasOwnProperty.call(mt,bt.status)&&mt[bt.status].add(bt.carNum)})),mt}function groupDuplicateItems(Ct,mt){const bt=new Map;return Ct.forEach((wt=>{const yt=wt&&wt[mt];yt&&bt.set(yt,(bt.get(yt)||0)+1)})),Array.from(bt.entries()).filter((wt=>wt[1]>1))}function dedupeByKey(Ct,mt){const bt=new Map,wt=[];let yt=!1;for(const jt of Ct){const xt=jt&&jt[mt];if(!xt){wt.push(jt);continue}bt.has(xt)?(Object.assign(bt.get(xt),jt),yt=!0):(bt.set(xt,jt),wt.push(jt))}return{list:wt,changed:yt}}e=new WeakSet,t=async function(Ct,mt,bt){let wt;if(Array.isArray(Ct))wt=[...Ct];else{if(wt=await this.forage.getItem(mt)||[],wt.includes(Ct)){const yt=`${Ct} ${bt}已存在`;throw show.error(yt),new Error(yt)}wt.push(Ct)}return await this._setItemAndInvalidate(mt,wt),wt};let z=class Pe{constructor(){var mt,bt,wt;if(mt=this,(bt=e).has(mt)?a("Cannot add the same private member more than once"):bt instanceof WeakSet?bt.add(mt):bt.set(mt,wt),i(this,"car_list_key","car_list"),i(this,"filter_keyword_title_key","filter_keyword_title"),i(this,"filter_keyword_review_key","filter_keyword_review"),i(this,"setting_key","setting"),i(this,"blacklist_key","blacklist"),i(this,"blacklist_car_list_key","blacklist_car_list"),i(this,"third_party_cache_key","third_party_ttl_cache"),i(this,"favorite_actresses_key","favorite_actresses"),i(this,"highlighted_tags_key","highlighted_tags"),i(this,"_actressLock",Promise.resolve()),i(this,"forage",localforage.createInstance({driver:localforage.INDEXEDDB,name:"JAV-JHS",version:1,storeName:"appData"})),i(this,"cacheCarList",null),i(this,"cacheBlacklist",null),i(this,"cacheTitleFilterKeyword",null),i(this,"cacheFavoriteActresses",null),i(this,"cache_filter_actor_actress_car_list",null),i(this,"cacheSettingObj",null),i(this,"cacheCarMap",null),i(this,"cacheStatusMap",null),i(this,"cacheBlacklistMap",null),i(this,"_pendingReads",new Map),i(this,"_cacheGenerations",new Map),i(this,"_cacheStats",{hits:0,misses:0}),Pe.instance)throw new Error("StorageManager已被实例化过了!");Pe.instance=this}async getDataVersion(){return await this.forage.getItem("data_version")||0}async setDataVersion(mt){await this.forage.setItem("data_version",mt)}_getCacheGeneration(mt){return this._cacheGenerations.get(mt)||0}_invalidateRead(mt){this._cacheGenerations.set(mt,this._getCacheGeneration(mt)+1),this._pendingReads.delete(mt)}async _readCached(mt,bt,wt){if(this[mt]!==null)return this[mt];const yt=this._pendingReads.get(bt);if(yt)return yt;const jt=this._getCacheGeneration(bt),xt=this.forage.getItem(bt).then($t=>{const kt=$t||wt;return jt===this._getCacheGeneration(bt)&&this[mt]===null&&(this[mt]=kt),kt}).finally(()=>{this._pendingReads.get(bt)===xt&&this._pendingReads.delete(bt)});return this._pendingReads.set(bt,xt),xt}_invalidateCache(mt=null){const bt=[this.car_list_key,this.blacklist_key,this.filter_keyword_title_key,this.favorite_actresses_key,this.blacklist_car_list_key,this.setting_key];(mt===null?bt:bt.includes(mt)?[mt]:[]).forEach((wt=>this._invalidateRead(wt))),(!mt||mt===this.car_list_key)&&(this.cacheCarList=null,this.cacheCarMap=null,this.cacheStatusMap=null),(!mt||mt===this.blacklist_key)&&(this.cacheBlacklist=null,this.cacheBlacklistMap=null),(!mt||mt===this.filter_keyword_title_key)&&(this.cacheTitleFilterKeyword=null),(!mt||mt===this.favorite_actresses_key)&&(this.cacheFavoriteActresses=null),(!mt||mt===this.blacklist_car_list_key)&&(this.cache_filter_actor_actress_car_list=null),(!mt||mt===this.setting_key)&&(this.cacheSettingObj=null)}async _setItemAndInvalidate(mt,bt){await this.forage.setItem(mt,bt),this._invalidateCache(mt)}async withActressLock(mt){let bt;const wt=new Promise(jt=>bt=jt),yt=this._actressLock;this._actressLock=this._actressLock.then(()=>wt),await yt;try{return await mt()}finally{bt()}}async _rawUpdateFavoriteActress(mt){const bt=await this.getFavoriteActressList(),{starId:wt,name:yt,allName:jt,avatar:xt,lastCheckTime:$t,newVideoList:kt,lastPublishTime:_t,actressType:St,remark:Tt}=mt;if(!wt)throw new Error("缺失starId");let It=bt.find((Bt=>Bt.starId===wt));return It?(yt&&(It.name=yt),jt&&(It.allName=jt),xt&&(It.avatar=xt),St!=null&&(It.actressType=St),$t&&(It.lastCheckTime=$t),kt&&(It.newVideoList=kt),_t&&(It.lastPublishTime=_t),Tt&&(It.remark=Tt),It.updateDate=utils.getNowStr(),await this._setItemAndInvalidate(this.favorite_actresses_key,bt),!0):(clog.error("未找到演员信息",wt,yt),!1)}async getCarList(){return this._readCached("cacheCarList",this.car_list_key,[])}async getCarMap(){if(this.cacheCarMap===null){const mt=await this.getCarList();this.cacheCarMap=createIndexedMap(mt,"carNum")}return this.cacheCarMap}async getStatusMap(){if(this.cacheStatusMap===null){const mt=await this.getCarList();this.cacheStatusMap=createStatusMap(mt)}return this.cacheStatusMap}async getCar(mt){return(await this.getCarMap()).get(mt)}_saveSingleCar(mt,bt){let{carNum:wt,url:yt,names:jt,actionType:xt,publishTime:$t,starId:kt}=mt;if(!wt)throw show.error("番号为空!"),new Error("番号为空!");if(!yt)throw show.error("url为空!"),new Error("url为空!");yt.includes("http")||(yt=window.location.origin+yt),jt&&(jt=jt.trim());let _t=bt.find((St=>St.carNum===wt));if(_t)jt&&(_t.names=jt),yt&&(_t.url=yt),$t&&(_t.publishTime=$t),_t.updateDate=utils.getNowStr();else{let St=utils.getNowStr();_t={carNum:wt,url:yt,names:jt,status:"",createDate:St,updateDate:St,publishTime:$t},kt&&(_t.starId=kt),bt.push(_t)}switch(xt){case d:if(_t.status===d){const Tt=`${wt} 已在屏蔽列表中`;throw show.error(Tt),new Error(Tt)}_t.status=d;break;case h:if(_t.status===h){const Tt=`${wt} 已在收藏列表中`;throw show.error(Tt),new Error(Tt)}_t.status=h;break;case g:if(_t.status===g){const Tt=`${wt} 已标记为已下载`;throw show.error(Tt),new Error(Tt)}_t.status=g;break;case p:if(_t.status===p){const Tt=`${wt} 已标记为已观看`;throw show.error(Tt),new Error(Tt)}_t.status=p;break;default:const St="actionType错误, 请联系作者更正: "+xt;throw show.error(St),new Error(St)}}async saveCar(mt){const bt=await this.getCarList();this._saveSingleCar(mt,bt),await this._setItemAndInvalidate(this.car_list_key,bt),await this.removeNewVideoList([mt.carNum])}async updateCarInfo(mt){let{carNum:bt,url:wt,names:yt,actionType:jt,publishTime:xt,remark:$t}=mt;if(!bt)throw show.error("番号为空!"),new Error("番号为空!");if(!wt)throw show.error("url为空!"),new Error("url为空!");yt&&(yt=yt.trim());const kt=await this.getCarList();let _t=kt.find((St=>St.carNum===bt));if(!_t){const St="数据不存在: "+bt;throw show.error(St),new Error(St)}switch(_t.names=yt,_t.url=wt,_t.remark=$t,_t.updateDate=utils.getNowStr(),jt){case d:_t.status=d;break;case h:_t.status=h;break;case g:_t.status=g;break;case p:_t.status=p;break;default:const St="actionType错误, 请联系作者更正: "+jt;throw show.error(St),new Error(St)}await this._setItemAndInvalidate(this.car_list_key,kt),await this.removeNewVideoList([bt])}async saveCarList(mt){if(!mt||!Array.isArray(mt)||mt.length===0)throw show.error("记录列表为空!"),new Error("记录列表为空!");const bt=await this.getCarList();for(const wt of mt)try{this._saveSingleCar(wt,bt)}catch(yt){throw yt}await this._setItemAndInvalidate(this.car_list_key,bt),await this.removeNewVideoList(mt.map((wt=>wt.carNum)))}async removeNewVideoList(mt){return this.withActressLock(async()=>{const bt=await this.getFavoriteActressList();let wt=!1;const yt=bt.map((jt=>{if(!jt.newVideoList||!Array.isArray(jt.newVideoList))return jt;const xt=jt.newVideoList.filter((kt=>{const _t=typeof kt=="string"?kt:kt.carNum,St=mt.includes(_t);return St&&(clog.log("移除关联女优新作品",kt.name,_t),wt=!0),!St})),$t={...jt,newVideoList:xt};return xt.length===0&&jt.lastPublishTime&&($t.lastPublishTime=null),$t}));wt&&await this._setItemAndInvalidate(this.favorite_actresses_key,yt)})}async removeCar(mt){const bt=await this.getCarList(),wt=bt.length,yt=bt.filter((jt=>jt.carNum!==mt));return yt.length===wt?(show.error(`${mt} 不存在`),!1):(await this._setItemAndInvalidate(this.car_list_key,yt),!0)}async batchRemoveCars(mt){const bt=await this.getCarList(),wt=bt.length,yt=new Set(mt),jt=bt.filter(($t=>!yt.has($t.carNum))),xt=wt-jt.length;return xt!==0&&(await this._setItemAndInvalidate(this.car_list_key,jt),xt)}async getBlacklist(){return this._readCached("cacheBlacklist",this.blacklist_key,[])}async getBlacklistMap(){if(this.cacheBlacklistMap===null){const mt=await this.getBlacklist();this.cacheBlacklistMap=createIndexedMap(mt,"starId")}return this.cacheBlacklistMap}async addBlacklistItem(mt){let{starId:bt,name:wt,allName:yt,role:jt,movieType:xt,url:$t}=mt;if(!bt)throw new Error("缺失starId");if(!wt)throw new Error("缺失name");if(!jt)throw new Error("缺失role");const kt=await this.getBlacklist(),_t=kt.find((St=>St.starId===bt));if(_t)_t.url=$t,_t.role=jt,_t.movieType=xt,clog.log("更新黑名单演员信息",_t);else{const St={starId:bt,name:wt,allName:yt||[wt],createTime:utils.getNowStr(),role:jt,movieType:xt,url:$t};kt.push(St),clog.log("增加黑名单演员信息",St)}await this._setItemAndInvalidate(this.blacklist_key,kt)}async updateBlacklistItem(mt){if(!mt||!mt.starId)throw new Error("参数不全");const bt=await this.getBlacklist(),wt=bt.find((yt=>yt.starId===mt.starId));if(!wt)throw new Error(`未找到黑名单演员信息:${mt.name} ${mt.starId}`);mt.checkTime&&(wt.checkTime=mt.checkTime),mt.lastPublishTime&&(wt.lastPublishTime=mt.lastPublishTime),await this._setItemAndInvalidate(this.blacklist_key,bt)}async deleteBlacklistItem(mt){const bt=await this.getBlacklist(),wt=bt.filter((yt=>yt.starId!==mt));bt.length!==wt.length&&await this._setItemAndInvalidate(this.blacklist_key,wt)}async getBlacklistCarList(){return this._readCached("cache_filter_actor_actress_car_list",this.blacklist_car_list_key,[])}async batchSaveBlacklistCarList(mt){const bt=await this.getBlacklistCarList(),wt=JSON.parse(JSON.stringify(bt));let yt=!1,jt=[];for(const xt of mt)wt.find(($t=>$t.carNum===xt.carNum))||(this._saveSingleCar(xt,wt),clog.log(`屏蔽演员番号: <span class="jhs-layout-eeefd8c8">${escapeHtml(xt.names)} ${escapeHtml(xt.carNum)}</span>`),yt=!0,jt.push(xt.carNum));yt&&(await this._setItemAndInvalidate(this.blacklist_car_list_key,wt),await this.removeNewVideoList(jt),window.cleanCache_filter_actor_actress_car_list())}async removeBlacklistCarList(mt){const bt=await this.getBlacklistCarList(),wt=bt.filter((yt=>yt.starId!==mt));wt.length!==bt.length&&(await this._setItemAndInvalidate(this.blacklist_car_list_key,wt),window.cleanCache_filter_actor_actress_car_list())}async getFavoriteActressList(){return this._readCached("cacheFavoriteActresses",this.favorite_actresses_key,[])}async addFavoriteActressList(mt){return this.withActressLock(async()=>{const bt=await this.getFavoriteActressList();let wt=0;for(const yt of mt){let{starId:jt,name:xt,allName:$t,avatar:kt,lastCheckTime:_t,lastPublishTime:St,actressType:Tt}=yt;if(!jt)throw new Error("缺失starId");if(!xt)throw new Error("缺失name");$t||($t=[xt]);const It="(無碼)";Tt||(Tt=xt.includes(It)||$t.some((Mt=>Mt.includes(It)))?A:D),xt=xt.replace(It,""),$t=$t.map((Mt=>Mt.replace(It,"")));let Bt=bt.find((Mt=>Mt.starId===jt));if(Bt){Bt.avatar&&Bt.avatar.includes("https")||kt&&(clog.log(kt),Bt.avatar=kt,clog.log(`<span class="jhs-layout-eeefd8c8">补全女优头像: ${escapeHtml(xt)}</span>`),wt++),!Bt.actressType&&Tt&&(Bt.actressType=Tt,clog.log(`<span class="jhs-layout-eeefd8c8">补全女优类别: ${escapeHtml(xt)} ${escapeHtml(Tt)}</span>`),wt++),Bt.name.includes(It)&&(Bt.name=xt,Bt.allName=$t,clog.log(`<span class="jhs-layout-eeefd8c8">更正女优名字: ${escapeHtml(xt)} ${escapeHtml($t)}</span>`),wt++);continue}const Pt=utils.getNowStr();bt.push({starId:jt,name:xt,allName:$t,avatar:kt,lastCheckTime:_t,lastPublishTime:St,createDate:Pt,updateDate:Pt,actressType:Tt}),clog.log(`<span class="jhs-layout-eeefd8c8">同步JavDB已收藏的演员: ${escapeHtml(xt)}</span>`),wt++}return wt>0?await this._setItemAndInvalidate(this.favorite_actresses_key,bt):clog.log("信息已记录, 无需要进行同步收藏的演员"),wt})}async removeFavoriteActress(mt){return this.withActressLock(async()=>{const bt=await this.getFavoriteActressList(),wt=bt.length,yt=bt.filter((jt=>jt.starId!==mt));return yt.length===wt?(clog.error(`移除演员失败, ${mt} 不存在`),!1):(await this._setItemAndInvalidate(this.favorite_actresses_key,yt),!0)})}async updateFavoriteActress(mt){return this.withActressLock(()=>this._rawUpdateFavoriteActress(mt))}async getHighlightedTags(){return await this.forage.getItem(this.highlighted_tags_key)||[]}async setHighlightedTags(mt){return await this.forage.setItem(this.highlighted_tags_key,mt)}async saveTitleFilterKeyword(mt){return await s(this,e,t).call(this,mt,this.filter_keyword_title_key,"标题关键词"),Array.isArray(mt)?null:this.withActressLock(async()=>{const bt=await this.getFavoriteActressList();let wt=!1;const yt=bt.map((jt=>{if(!jt.newVideoList||!Array.isArray(jt.newVideoList))return jt;const xt=jt.newVideoList.filter(($t=>{const kt=typeof $t=="string"?$t:$t.carNum,_t=kt.startsWith(mt);return _t&&(clog.log("移除关联女优新作品",jt.name,kt),wt=!0),!_t}));return{...jt,newVideoList:xt}}));wt&&await this._setItemAndInvalidate(this.favorite_actresses_key,yt)})}async getTitleFilterKeyword(){return this._readCached("cacheTitleFilterKeyword",this.filter_keyword_title_key,[])}async getReviewFilterKeywordList(){return await this.forage.getItem(this.filter_keyword_review_key)||[]}async saveReviewFilterKeyword(mt){return s(this,e,t).call(this,mt,this.filter_keyword_review_key,"评论关键词")}async getSetting(mt=null,bt){let wt=await this._readCached("cacheSettingObj",this.setting_key,{});if(mt===null)return wt;const yt=wt[mt];return yt?yt==="true"||yt==="false"?yt.toLowerCase()==="true":typeof yt!="string"||yt.trim()===""||isNaN(Number(yt))?yt:Number(yt):bt}getSettingSync(mt,bt){if(!this.cacheSettingObj)return bt;const wt=this.cacheSettingObj[mt];return wt?wt==="true"||wt==="false"?wt.toLowerCase()==="true":typeof wt!="string"||wt.trim()===""||isNaN(Number(wt))?wt:Number(wt):bt}async saveSetting(mt){mt?(await this._setItemAndInvalidate(this.setting_key,mt),window.clean_cacheSettingObj()):show.error("设置对象为空")}async saveSettingItem(mt,bt){if(!mt)return void show.error("key 不能为空");await navigator.locks.request("jhs_setting_lock",async()=>{let wt=await this.getSetting();wt[mt]=bt,await this.saveSetting(wt)}),window.clean_cacheSettingObj()}async importData(mt){const bt=new Set(["car_list","filter_keyword_title","filter_keyword_review","setting","blacklist","blacklist_car_list","third_party_ttl_cache","favorite_actresses","highlighted_tags"]),wt=[];for(const jt in mt){if(!bt.has(jt)){clog.warn(`[导入] 跳过未知数据键: ${jt}`);continue}wt.push(this._setItemAndInvalidate(jt,mt[jt]))}await Promise.all(wt);const yt=[];await this.forage.iterate(((jt,xt)=>{xt in mt||yt.push(this.forage.removeItem(xt))})),await Promise.all(yt),this._invalidateCache()}async exportData(){const mt={};if(await this.forage.iterate(((bt,wt)=>{mt[wt]=bt})),Object.keys(mt).length===0)throw new Error("没有可导出的数据");return mt}async getThirdPartyCache(){return await this.forage.getItem(this.third_party_cache_key)||{}}async setThirdPartyCache(mt){await this.forage.setItem(this.third_party_cache_key,mt||{})}async clearThirdPartyCache(){await this.forage.removeItem(this.third_party_cache_key)}async cachedRequest(mt,bt,wt){const yt=Date.now(),jt=await this.getThirdPartyCache(),xt=jt[mt];if(xt&&xt.time&&yt-xt.time<(xt.ttl||bt))return this._cacheStats.hits++,xt.data;this._cacheStats.misses++;const $t=await wt();return $t==null||(jt[mt]={time:yt,ttl:bt,data:$t},await this.setThirdPartyCache(jt)),$t}getCacheHitStats(){const mt=this._cacheStats.hits+this._cacheStats.misses;return{hits:this._cacheStats.hits,misses:this._cacheStats.misses,total:mt,rate:mt>0?(this._cacheStats.hits/mt*100).toFixed(1)+"%":"N/A"}}_groupDuplicateItems(mt,bt){return groupDuplicateItems(mt,bt)}_dedupeByKey(mt,bt){return dedupeByKey(mt,bt)}async inspectDataHealth(){const[mt,bt,wt,yt]=await Promise.all([this.getCarList(),this.getFavoriteActressList(),this.getBlacklist(),this.getBlacklistCarList()]),jt=await this.getCarMap(),xt={checkedAt:utils.getNowStr(),totals:{carList:mt.length,favoriteActresses:bt.length,blacklist:wt.length,blacklistCarList:yt.length},fixable:[],readonly:[]},$t=(Ft,zt,Ot)=>xt.fixable.push({type:Ft,message:zt,count:Ot}),kt=(Ft,zt,Ot)=>xt.readonly.push({type:Ft,message:zt,count:Ot}),_t=this._groupDuplicateItems(mt,"carNum"),St=this._groupDuplicateItems(bt,"starId"),Tt=this._groupDuplicateItems(wt,"starId");_t.length&&$t("duplicate-car","重复番号记录",_t.length),St.length&&$t("duplicate-actress","重复收藏演员",St.length),Tt.length&&$t("duplicate-blacklist","重复黑名单演员",Tt.length);const It=mt.filter((Ft=>Ft&&Ft.actress)).length,Bt=yt.filter((Ft=>Ft&&Ft.actress)).length,Pt=bt.filter((Ft=>Ft&&Object.prototype.hasOwnProperty.call(Ft,"dbId"))).length,Mt=wt.filter((Ft=>Ft&&("key"in Ft||"recordTime"in Ft||"isActor"in Ft))).length;It+Bt+Pt+Mt>0&&$t("legacy-fields","旧字段残留",It+Bt+Pt+Mt);const At=bt.filter((Ft=>Ft&&Ft.name&&!Array.isArray(Ft.allName))).length+wt.filter((Ft=>Ft&&Ft.name&&!Array.isArray(Ft.allName))).length;At&&$t("invalid-all-name","演员别名不是数组",At);let Nt=0;bt.forEach((Ft=>{Array.isArray(Ft?.newVideoList)&&(Nt+=Ft.newVideoList.filter((zt=>{const Ot=typeof zt=="string"?zt:zt.carNum;return jt.has(Ot)})).length)})),Nt&&$t("stored-new-video","新作品列表中已有鉴定记录",Nt);const Dt=mt.filter((Ft=>Ft&&Ft.carNum&&!Ft.url)).length;Dt&&kt("missing-url","番号记录缺失 url,需要人工确认来源",Dt);const Lt=bt.filter((Ft=>Ft&&!Ft.starId)).length+wt.filter((Ft=>Ft&&!Ft.starId)).length;Lt&&kt("missing-star-id","演员缺失 starId,需要人工确认身份",Lt);const Et=new Set(wt.map((Ft=>Ft&&Ft.starId)).filter(Boolean)),Ht=yt.filter((Ft=>Ft&&Ft.starId&&!Et.has(Ft.starId))).length;return Ht&&kt("orphan-blacklist-car","黑名单作品找不到关联演员",Ht),xt}async repairDataHealth(){let mt=0,bt=await this.getCarList(),wt=await this.getFavoriteActressList(),yt=await this.getBlacklist(),jt=await this.getBlacklistCarList();const xt=this._dedupeByKey(bt,"carNum");xt.changed&&(bt=xt.list,mt++);const $t=this._dedupeByKey(wt,"starId");$t.changed&&(wt=$t.list,mt++);const kt=this._dedupeByKey(yt,"starId");kt.changed&&(yt=kt.list,mt++),bt=bt.map((St=>{if(!St)return St;let Tt=!1;return St.actress!==void 0&&(St.names=St.actress,delete St.actress,Tt=!0),Tt&&mt++,St})),jt=jt.map((St=>{if(!St)return St;let Tt=!1;return St.actress!==void 0&&(St.names=St.actress,delete St.actress,Tt=!0),Object.prototype.hasOwnProperty.call(St,"type")&&(delete St.type,Tt=!0),Tt&&mt++,St})),wt=wt.map((St=>{if(!St)return St;let Tt=!1;return Object.prototype.hasOwnProperty.call(St,"dbId")&&(St.starId||(St.starId=St.dbId),delete St.dbId,Tt=!0),St.name&&!Array.isArray(St.allName)&&(St.allName=St.allName?[St.allName]:[St.name],Tt=!0),Tt&&mt++,St})),yt=yt.map((St=>{if(!St)return St;let Tt=!1;return Object.prototype.hasOwnProperty.call(St,"isActor")&&(St.role||(St.role=St.isActor?B:P),delete St.isActor,Tt=!0),Object.prototype.hasOwnProperty.call(St,"recordTime")&&(St.createTime||(St.createTime=St.recordTime),delete St.recordTime,Tt=!0),Object.prototype.hasOwnProperty.call(St,"key")&&(delete St.key,Tt=!0),St.name&&!Array.isArray(St.allName)&&(St.allName=St.allName?[St.allName]:[St.name],Tt=!0),Tt&&mt++,St}));const _t=new Set(bt.filter((St=>St&&St.carNum)).map((St=>St.carNum)));return wt=wt.map((St=>{if(!Array.isArray(St?.newVideoList))return St;const Tt=St.newVideoList.filter((It=>{const Bt=typeof It=="string"?It:It.carNum;return!_t.has(Bt)}));return Tt.length!==St.newVideoList.length&&(St={...St,newVideoList:Tt},Tt.length===0&&St.lastPublishTime&&(St.lastPublishTime=null),mt++),St})),await this._setItemAndInvalidate(this.car_list_key,bt),await this._setItemAndInvalidate(this.favorite_actresses_key,wt),await this._setItemAndInvalidate(this.blacklist_key,yt),await this._setItemAndInvalidate(this.blacklist_car_list_key,jt),{fixedGroups:mt,report:await this.inspectDataHealth()}}async merge_table_name(){let mt="filter_actor_actress_info_list",bt=await this.forage.getItem(mt)||[];bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.blacklist_key,bt)),await this.forage.removeItem(mt),mt="favorite_actresses_info_list",bt=await this.forage.getItem(mt)||[],bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.favorite_actresses_key,bt)),await this.forage.removeItem(mt),mt="car_list_filter_actor_actress",bt=await this.forage.getItem(mt)||[],bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.blacklist_car_list_key,bt)),await this.forage.removeItem(mt),mt="title_filter_keyword",bt=await this.forage.getItem(mt)||[],bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.filter_keyword_title_key,bt)),await this.forage.removeItem(mt),mt="review_filter_keyword",bt=await this.forage.getItem(mt)||[],bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.filter_keyword_review_key,bt)),await this.forage.removeItem(mt),mt="highlightedTags",bt=await this.forage.getItem(mt)||[],bt&&bt.length>0&&(clog.debug("更正",mt),await this._setItemAndInvalidate(this.highlighted_tags_key,bt)),await this.forage.removeItem(mt)}async clean_no_url_blacklist(){const[mt,bt]=await Promise.all([this.getBlacklistCarList(),this.getBlacklist()]);if(mt.length&&!mt[0].actress)return;const wt=new Set(bt.map(($t=>$t.name))),yt=mt.filter(($t=>!$t.actress||wt.has($t.actress)));mt.length!==yt.length&&(clog.debug("清理 blacklistCarList 前",mt.length),clog.debug("清理 blacklistCarList 后",yt.length),await this._setItemAndInvalidate(this.blacklist_car_list_key,yt));const jt=new Set(yt.map(($t=>$t.actress)));let xt=bt.filter(($t=>jt.has($t.name)));xt=xt.map(($t=>{const{key:kt,recordTime:_t,...St}=$t,Tt=St;return _t!==void 0&&(Tt.createTime=_t),Tt})),(bt.length!==xt.length||bt.some(($t=>"key"in $t||"recordTime"in $t)))&&(clog.debug("清理 Blacklist 前",bt.length),clog.debug("清理 Blacklist 后",xt.length),await this._setItemAndInvalidate(this.blacklist_key,xt))}async async_merge_other(){const mt=await this.getSetting();let bt=!1;const wt={enableCheckFilterActorActress:"enableCheckBlacklist",checkIntervalTime_filterActorActress:"checkBlacklist_intervalTime",checkIntervalTime_ruleTime:"checkNewVideo_ruleTime",checkIntervalTime_newVideo:"checkNewVideo_intervalTime",checkIntervalTime_favoriteActress:"checkFavoriteActress_IntervalTime"};for(const yt in wt){const jt=wt[yt];Object.prototype.hasOwnProperty.call(mt,yt)&&(mt[jt]=mt[yt],delete mt[yt],bt=!0)}mt.checkFilterTime&&(delete mt.checkFilterTime,bt=!0),mt.checkFilterConcurrencyCount&&(delete mt.checkFilterConcurrencyCount,bt=!0),mt.checkFilterSleep&&(delete mt.checkFilterSleep,bt=!0),bt&&(await this.saveSetting(mt),clog.debug("配置数据已更正"))}async merge_blacklist(){const mt=await this.getBlacklist();if(!mt||mt.length===0)return;let bt=!1;const wt=mt.map((xt=>{let $t=!1;if(Object.prototype.hasOwnProperty.call(xt,"isActor")&&!xt.role&&(xt.role=xt.isActor?B:P,delete xt.isActor,$t=!0),!xt.starId&&xt.url)try{const kt=new URL(xt.url).pathname,_t=kt.split("/").filter((St=>St.trim()!=="")).pop();xt.starId!==_t&&(xt.starId=_t,$t=!0)}catch(kt){clog.error("提取url-starId发生错误",xt.url,kt)}if(xt.allName||(xt.allName=xt.name?[xt.name]:[],$t=!0),xt.movieType||(xt.movieType=D,$t=!0),xt.url&&xt.url.includes("sort_type")){const kt=new URL(xt.url);kt.searchParams.delete("sort_type"),xt.url=kt.toString(),clog.debug("去除黑名单地址sort_type参数")}return $t&&(bt=!0),xt}));bt&&(clog.debug("更正 Blacklist 数据结构"),await this._setItemAndInvalidate(this.blacklist_key,wt));const yt=await this.getBlacklistCarList();bt=!1;const jt=yt.map((xt=>{if(!xt.starId){let $t=mt.find((kt=>kt.name===xt.actress));$t&&(xt.starId=$t.starId),bt=!0}return xt.type&&(delete xt.type,bt=!0),xt}));bt&&(clog.debug("更正 blacklistCarList 数据结构"),await this._setItemAndInvalidate(this.blacklist_car_list_key,jt))}async merge_favoriteActress(){const mt=await this.getFavoriteActressList();if(!mt||mt.length===0)return;let bt=!1;const wt=mt.map((yt=>{let jt=!1;return yt.dbId&&(yt.starId=yt.dbId,delete yt.dbId,jt=!0),jt&&(bt=!0),yt}));bt&&(clog.debug("更正 favoriteActressesInfoList 数据结构"),await this._setItemAndInvalidate(this.favorite_actresses_key,wt))}async merge_tow_car_list_table(){const mt=await this.getBlacklistCarList(),bt=await this.getCarList();let wt=!1;const yt=mt.map((xt=>{let $t=!1;return xt.actress!==void 0&&(xt.names=xt.actress,delete xt.actress,$t=!0),$t&&(wt=!0),xt}));wt&&(clog.debug("更正 blacklistCarList 数据结构 actress->names"),await this._setItemAndInvalidate(this.blacklist_car_list_key,yt)),wt=!1;const jt=bt.map((xt=>{let $t=!1;return xt.actress!==void 0&&(xt.names=xt.actress,delete xt.actress,$t=!0),$t&&(wt=!0),xt}));wt&&(clog.debug("更正 carList 数据结构 actress->names"),await this._setItemAndInvalidate(this.car_list_key,jt))}_snapshotKey(){return"snapshots"}_snapshotMetaKeys(){return["snapshots","data_version"]}async _getSnapshots(){return await this.forage.getItem(this._snapshotKey())||[]}async _saveSnapshots(mt){await this._setItemAndInvalidate(this._snapshotKey(),mt)}async _withSnapshotLock(mt){return await navigator.locks.request("jhs_snapshot_lock",async()=>await mt())}async createSnapshot(mt="",bt="manual"){return this._withSnapshotLock(async()=>{const wt=await this._getSnapshots(),yt=await this.exportData();for(const $t of this._snapshotMetaKeys())delete yt[$t];let jt=0;for(const $t of Object.values(yt))Array.isArray($t)?jt+=$t.length:typeof $t=="object"&&$t&&jt++;const xt={id:"snap_"+Date.now()+"_"+Math.random().toString(36).slice(2,8),name:mt||utils.getNowStr(),source:bt,time:utils.getNowStr(),itemCount:jt,data:yt};return wt.push(xt),wt.length>10&&wt.splice(0,wt.length-10),await this._saveSnapshots(wt),clog.log(`创建快照: ${xt.name} (${bt})`),xt})}async getSnapshotList(){return(await this._getSnapshots()).map((mt=>({id:mt.id,name:mt.name,source:mt.source,time:mt.time,itemCount:mt.itemCount})))}async getSnapshot(mt){return(await this._getSnapshots()).find((bt=>bt.id===mt))||null}async deleteSnapshot(mt){return this._withSnapshotLock(async()=>{const bt=await this._getSnapshots(),wt=bt.filter((yt=>yt.id!==mt));if(wt.length===bt.length)return void clog.warn("删除快照失败, ID不存在: "+mt);await this._saveSnapshots(wt),clog.log("删除快照: "+mt)})}async restoreSnapshot(mt){const bt=await this.getSnapshot(mt);if(!bt)throw new Error("快照不存在: "+mt);if(!bt.data||typeof bt.data!="object")throw new Error("快照数据损坏");await this.createSnapshot("恢复前自动备份","auto-restore");const wt={...bt.data};for(const yt of this._snapshotMetaKeys())delete wt[yt];return await this.importData(wt),clog.log("已恢复快照: "+bt.name),bt}_stableStringify(mt){return mt===null||typeof mt!="object"?JSON.stringify(mt):Array.isArray(mt)?"["+mt.map((bt=>this._stableStringify(bt))).join(",")+"]":"{"+Object.keys(mt).sort().map((bt=>JSON.stringify(bt)+":"+this._stableStringify(mt[bt]))).join(",")+"}"}diffData(mt,bt){const wt=new Set([...Object.keys(mt),...Object.keys(bt)]),yt={},jt={added:0,removed:0,modified:0,unchanged:0};for(const xt of wt){const $t=mt[xt],kt=bt[xt];if(!($t===void 0&&kt===void 0))if($t===void 0){const _t=Array.isArray(kt)?kt.length:1;yt[xt]={status:"added",oldCount:0,newCount:_t,added:Array.isArray(kt)?kt:[],removed:[],modified:[]},jt.added++}else if(kt===void 0){const _t=Array.isArray($t)?$t.length:1;yt[xt]={status:"removed",oldCount:_t,newCount:0,added:[],removed:Array.isArray($t)?$t:[],modified:[]},jt.removed++}else if(Array.isArray($t)&&Array.isArray(kt)){const _t=this._diffArrays($t,kt,xt);yt[xt]={status:_t.status,oldCount:$t.length,newCount:kt.length,..._t},jt[_t.status]++}else if(typeof $t=="object"&&typeof kt=="object"&&!Array.isArray($t)&&!Array.isArray(kt)){const _t=this._diffObjects($t,kt);yt[xt]={status:_t.status,oldCount:Object.keys($t).length,newCount:Object.keys(kt).length,added:[],removed:[],modified:_t.changes},jt[_t.status]++}else $t===kt?(yt[xt]={status:"unchanged",oldCount:1,newCount:1,added:[],removed:[],modified:[]},jt.unchanged++):(yt[xt]={status:"modified",oldCount:1,newCount:1,added:[],removed:[],modified:[{key:xt,changes:{_value:[$t,kt]}}]},jt.modified++)}return{summary:jt,stores:yt}}_getArrayKey(mt){return mt==="car_list"||mt==="blacklist_car_list"?"carNum":mt==="blacklist"||mt==="favorite_actresses"?"starId":null}_diffArrays(mt,bt,wt){const yt=this._getArrayKey(wt);if(!yt){const Tt=this._stableStringify(mt),It=this._stableStringify(bt);if(Tt===It)return{status:"unchanged",added:[],removed:[],modified:[]};const Bt=new Set(mt.map((Mt=>this._stableStringify(Mt)))),Pt=new Set(bt.map((Mt=>this._stableStringify(Mt))));return{status:"modified",added:bt.filter((Mt=>!Bt.has(this._stableStringify(Mt)))),removed:mt.filter((Mt=>!Pt.has(this._stableStringify(Mt)))),modified:[]}}const jt=new Map(mt.map((Tt=>[Tt[yt],Tt]))),xt=new Map(bt.map((Tt=>[Tt[yt],Tt]))),$t=[],kt=[],_t=[];for(const[Tt,It]of xt){const Bt=jt.get(Tt);if(!Bt)$t.push(It);else{const Pt=this._diffObjects(Bt,It);Pt.status!=="unchanged"&&_t.push({key:Tt,changes:Pt.changes})}}for(const[Tt]of jt)xt.has(Tt)||kt.push(jt.get(Tt));return{status:$t.length+kt.length+_t.length===0?"unchanged":"modified",added:$t,removed:kt,modified:_t}}_diffObjects(mt,bt){const wt=new Set([...Object.keys(mt),...Object.keys(bt)]),yt={};let jt=0;for(const xt of wt){const $t=mt[xt],kt=bt[xt];this._stableStringify($t)!==this._stableStringify(kt)&&(yt[xt]=[$t,kt],jt++)}return{status:jt===0?"unchanged":"modified",changes:yt}}};const U="https://jdforrepam.com/api";function O(){const Ct="jhs_review_ts",mt="jhs_review_sign",bt=Math.floor(Date.now()/1e3);if(bt-(localStorage.getItem(Ct)||0)<=20)return localStorage.getItem(mt);const wt=`${bt}.lpw6vgqzsp.${md5(`${bt}71cf27bb3c0bcdf207b64abecddc970098c7421ee7203b9cdae54478478a199e7d5a6e1a57691123c1a931c057842fb73ba3b3c83bcd69c17ccf174081e3d8aa`)}`;return localStorage.setItem(Ct,bt),localStorage.setItem(mt,wt),wt}const R=async(Ct,mt=1,bt=20)=>{let wt=`${U}/v1/movies/${Ct}/reviews`,yt={jdSignature:await O()};return await storageManager.cachedRequest(`reviews:${Ct}:${mt}:${bt}`,864e5,(async()=>{const jt=await gmHttp.get(wt,{page:mt,sort_by:"hotly",limit:bt},yt);if(!jt?.data?.reviews)throw new Error(jt?.message||"获取评论失败");return jt.data.reviews}))},V=async Ct=>{let mt=`${U}/v4/movies/${Ct}`,bt={jdSignature:await O()};const wt=await storageManager.cachedRequest(`movie-detail:${Ct}`,6048e5,(async()=>{const $t=await gmHttp.get(mt,null,bt);if(!$t.data)throw new Error($t.message||"获取视频详情失败");return $t}));if(!wt.data)throw show.error("获取视频详情失败: "+wt.message),new Error(wt.message);const yt=wt.data.movie,jt=yt.preview_images,xt=[];return jt.forEach(($t=>{xt.push($t.large_url.replace(/https:\/\/[^/]+\/rhe951l4q/,"https://c0.jdbstatic.com"))})),{movieId:yt.id,actors:yt.actors,duration:yt.duration,title:yt.origin_title,carNum:yt.number,score:yt.score,releaseDate:yt.release_date,watchedCount:yt.watched_count,imgList:xt}},K=async(Ct,mt=1,bt=20)=>{let wt=`${U}/v1/lists/related?movie_id=${Ct}&page=${mt}&limit=${bt}`,yt={jdSignature:await O()};const jt=await storageManager.cachedRequest(`related:${Ct}:${mt}:${bt}`,864e5,(async()=>{const $t=await gmHttp.get(wt,null,yt);if(!$t?.data?.lists)throw new Error($t?.message||"获取相关清单失败");return $t})),xt=[];return jt.data.lists.forEach(($t=>{xt.push({relatedId:$t.id,name:$t.name,movieCount:$t.movies_count,collectionCount:$t.collections_count,viewCount:$t.views_count,createTime:utils.formatDate($t.created_at)})})),xt},W=async(Ct="daily",mt="high_score")=>{let bt=`${U}/v1/rankings/playback?period=${Ct}&filter_by=${mt}`,wt={jdSignature:await O()};return(await gmHttp.get(bt,null,wt)).data.movies},q=async(Ct="all",mt="",bt=1,wt=40)=>{let yt=`${U}/v1/movies/top?start_rank=1&type=${Ct}&type_value=${mt}&ignore_watched=false&page=${bt}&limit=${wt}`;const jt=localStorage.getItem("jhs_appAuthorization");let $t={"user-agent":"Dart/3.5 (dart:io)","accept-language":"zh-TW",host:"jdforrepam.com",authorization:"Bearer "+(jt?await decryptData(jt):""),jdsignature:await O()};return await gmHttp.get(yt,null,$t)};class J{constructor(){return i(this,"intervalContainer",{}),i(this,"mimeTypes",{txt:"text/plain",html:"text/html",css:"text/css",csv:"text/csv",json:"application/json",xml:"application/xml",jpg:"image/jpeg",jpeg:"image/jpeg",png:"image/png",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf",doc:"application/msword",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",xls:"application/vnd.ms-excel",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",ppt:"application/vnd.ms-powerpoint",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",zip:"application/zip",rar:"application/x-rar-compressed","7z":"application/x-7z-compressed",mp3:"audio/mpeg",wav:"audio/wav",mp4:"video/mp4",webm:"video/webm",ogg:"audio/ogg"}),i(this,"timers",new Map),i(this,"insertStyle",(mt=>{const bt=(Array.isArray(mt)?mt:[mt]).filter(Boolean);if(bt.length===0)return;const wt=document.createDocumentFragment();for(const yt of bt){const jt=document.createElement("style");jt.textContent=yt.replace(/^\s*<style[^>]*>/i,"").replace(/<\/style>?\s*$/i,""),wt.append(jt)}document.head.append(wt)})),i(this,"layerIndexStack",[]),J.instance||(J.instance=this),J.instance}importResource(mt){let bt;mt.indexOf("css")>=0?(bt=document.createElement("link"),bt.setAttribute("rel","stylesheet"),bt.href=mt):(bt=document.createElement("script"),bt.setAttribute("type","text/javascript"),bt.src=mt),document.documentElement.appendChild(bt)}openPage(mt,bt,wt,yt){wt=wt??!0;const jt=new URL(mt,window.location.origin),xt=normalizeCarNum(bt);if(/^\/v\/[^/]+/.test(jt.pathname)&&xt&&jt.searchParams.set("jhsCarNum",xt),yt&&(yt.ctrlKey||yt.metaKey))return void GM_openInTab(jt.href,{insert:0});jt.pathname.includes("/actors/")||jt.pathname.includes("/star/")||jt.searchParams.set("hideNav","1"),layer.open({type:2,title:bt,content:jt.href,scrollbar:!1,shadeClose:wt,area:this.getDialogArea("workspace"),isOutAnim:!1,anim:-1,success:(kt,_t)=>{this.setupEscClose(_t)}})}_handleGlobalEscKey(mt){if(mt.key!=="Escape"&&mt.keyCode!==27||this.layerIndexStack.length===0)return;const bt=this.layerIndexStack[this.layerIndexStack.length-1],wt=$(`#layui-layer${bt}`);let yt=!1;if(wt.find(".viewer-container").length>0)yt=!0;else{const jt=wt.find(`#layui-layer-iframe${bt}`)[0];if(jt&&jt.contentDocument)try{$(jt.contentDocument).find(".viewer-container").length>0&&(yt=!0)}catch{clog.warn("无法检查跨域 iframe 内的 .viewer-container")}}yt||(this.layerIndexStack.pop(),layer.close(bt))}setupEscClose(mt){var bt;this._boundHandler||(this._boundHandler=this._handleGlobalEscKey.bind(this),$(document).off("keydown.globalLayerEsc"),$(document).on("keydown.globalLayerEsc",this._boundHandler)),this.layerIndexStack.indexOf(mt)===-1&&this.layerIndexStack.push(mt);const wt=$(`#layui-layer-iframe${mt}`),yt=`keydown.layerEsc${mt}`;try{const jt=(bt=wt[0])==null?void 0:bt.contentDocument;if(jt){if(wt.attr("data-esc-bound")==="yes")return;$(jt).off(yt),$(jt).on(yt,this._boundHandler),wt.attr("data-esc-bound","yes")}}catch(jt){clog.error("iframe监听失败 (跨域或未加载完毕):",jt)}}closePage(){storageManager.getSetting("needClosePage","yes").then((mt=>{mt==="yes"&&(parent.document.documentElement.style.overflow="auto",[".layui-layer-shade",".layui-layer-move",".layui-layer"].forEach((function(bt){const wt=parent.document.querySelectorAll(bt);if(wt.length>0){const yt=wt.length>1?wt[wt.length-1]:wt[0];yt.parentNode.removeChild(yt)}})),window.close())}))}loopDetector(mt,bt,wt=20,yt=1e4,jt=!0){const xt=Math.random(),$t=new Date().getTime(),kt=_t=>{clearInterval(this.intervalContainer[xt]),_t&&bt&&bt(),delete this.intervalContainer[xt]};this.intervalContainer[xt]=setInterval((()=>{const _t=new Date().getTime()-$t;mt()?kt(!0):_t>=yt&&kt(jt)}),wt)}rightClick(mt,bt,wt){let yt;typeof mt=="string"?yt=document.querySelector(mt):mt instanceof HTMLElement&&(yt=mt),yt||(console.warn("rightClick(), 容器无效或未提供,将使用 document.body 进行全局委托。"),yt=document.body),typeof bt=="string"&&bt.trim()!==""?yt.addEventListener("contextmenu",(jt=>{const xt=jt.target.closest(bt);xt&&wt(jt,xt)})):console.error("rightClick(), 必须提供有效的 targetSelector。")}q(mt,bt,wt,yt){let jt;if(this.isMobileMode())jt=layer.confirm(bt,{title:"提示",btn:["确定","取消"],shade:0,zIndex:999999991},(function(){wt&&wt(),layer.close(jt)}),(function(){yt&&yt()}));else{let xt,$t;mt?(xt=mt.clientX-130,$t=mt.clientY-120):(xt=window.innerWidth/2-120,$t=window.innerHeight/2-120),jt=layer.confirm(bt,{offset:[$t,xt],title:"提示",btn:["确定","取消"],shade:0,zIndex:999999991},(function(){wt&&wt(),layer.close(jt)}),(function(){yt&&yt()}))}}getNowStr(mt="-",bt=":",wt=null){let yt;yt=wt?new Date(wt):new Date;const jt=yt.getFullYear(),xt=String(yt.getMonth()+1).padStart(2,"0"),$t=String(yt.getDate()).padStart(2,"0"),kt=String(yt.getHours()).padStart(2,"0"),_t=String(yt.getMinutes()).padStart(2,"0"),St=String(yt.getSeconds()).padStart(2,"0");return`${[jt,xt,$t].join(mt)} ${[kt,_t,St].join(bt)}`}formatDate(mt,bt="-",wt=":"){let yt;if(mt instanceof Date)yt=mt;else{if(typeof mt!="string")throw new Error("Invalid date input: must be Date object or date string");if(yt=new Date(mt),isNaN(yt.getTime()))throw new Error("Invalid date string")}const jt=yt.getFullYear(),xt=String(yt.getMonth()+1).padStart(2,"0"),$t=String(yt.getDate()).padStart(2,"0"),kt=String(yt.getHours()).padStart(2,"0"),_t=String(yt.getMinutes()).padStart(2,"0"),St=String(yt.getSeconds()).padStart(2,"0");return`${[jt,xt,$t].join(bt)} ${[kt,_t,St].join(wt)}`}getHourDifference(mt,bt){const wt=mt.getTime(),yt=bt.getTime(),jt=Math.abs(yt-wt)/36e5;return Math.floor(jt)}download(mt,bt){show.info("开始请求下载...");const wt=bt.split(".").pop().toLowerCase();let yt,jt=this.mimeTypes[wt]||"application/octet-stream";if(mt instanceof Blob)yt=mt;else if(mt instanceof ArrayBuffer||ArrayBuffer.isView(mt))yt=new Blob([mt],{type:jt});else if(typeof mt=="string"&&mt.startsWith("data:")){const kt=atob(mt.split(",")[1]),_t=new ArrayBuffer(kt.length),St=new Uint8Array(_t);for(let Tt=0;Tt<kt.length;Tt++)St[Tt]=kt.charCodeAt(Tt);yt=new Blob([St],{type:jt})}else yt=new Blob([mt],{type:jt});const xt=URL.createObjectURL(yt),$t=document.createElement("a");$t.href=xt,$t.download=bt,document.body.appendChild($t),$t.click(),setTimeout((()=>{document.body.removeChild($t),URL.revokeObjectURL(xt)}),100)}smoothScrollToTop(mt=500){return new Promise((bt=>{const wt=performance.now(),yt=window.pageYOffset;window.requestAnimationFrame((function jt(xt){const $t=xt-wt,kt=Math.min($t/mt,1),_t=kt<.5?4*kt*kt*kt:1-Math.pow(-2*kt+2,3)/2;window.scrollTo(0,yt*(1-_t)),kt<1?window.requestAnimationFrame(jt):bt()}))}))}isUrl(mt){try{return new URL(mt),!0}catch{return!1}}setHrefParam(mt,bt){const wt=new URL(window.location.href);wt.searchParams.set(mt,bt),window.history.pushState({},"",wt.toString())}getUrlParam(mt,bt){const wt=mt.split("?")[1];if(!wt)return null;const yt=new RegExp(`(?:^|&)${bt}=([^&]*)`),jt=wt.match(yt);let xt="";return jt&&jt[1]&&(xt=decodeURIComponent(jt[1].replace(/\+/g," "))),xt&&(xt==="true"||xt==="false"?xt.toLowerCase()==="true":typeof xt!="string"||xt.trim()===""||isNaN(Number(xt))?xt:Number(xt))}getResponsiveArea(mt){const bt=window.innerWidth;return this.isMobileMode()?["100%","90%"]:bt>=1200?mt||this.getDefaultArea():["70%","90%"]}getDialogArea(mt="md"){const bt={sm:[480,640],md:[720,700],lg:[1040,760],xl:[1320,860],workspace:[1440,960]},wt=bt[mt]||bt.md,yt=window.innerWidth<=768?16:mt==="workspace"?32:64,jt=Math.max(320,Math.min(wt[0],window.innerWidth-yt)),xt=Math.max(320,Math.min(wt[1],window.innerHeight-yt));return[`${jt}px`,`${xt}px`]}getDefaultArea(){return["85%","90%"]}isMobile(){const mt=navigator.userAgent.toLowerCase();return["iphone","ipod","ipad","android","blackberry","windows phone","nokia","webos","opera mini","mobile","mobi","tablet"].some((bt=>mt.includes(bt)))}isMobileMode(){const mt=storageManager.getSettingSync("mobileMode","auto");return mt==="on"||mt!=="off"&&(this.isMobile()||window.innerWidth<768)}copyToClipboard(mt,bt){navigator.clipboard.writeText(bt).then((()=>show.info(`${mt}已复制到剪切板, ${bt}`))).catch((wt=>console.error("复制失败: ",wt)))}htmlTo$dom(mt){const bt=new DOMParser;return $(bt.parseFromString(mt,"text/html"))}isHidden(mt){const bt=mt.jquery?mt[0]:mt;return!bt||bt.offsetWidth<=0&&bt.offsetHeight<=0||window.getComputedStyle(bt).display==="none"}time(mt="default",bt="s",wt=2){if(this.timers.has(mt)){const yt=this.timers.get(mt),jt=performance.now()-yt.startTime;let xt,$t;return yt.unit==="s"?(xt=(jt/1e3).toFixed(yt.precision),$t="秒"):(xt=jt.toFixed(yt.precision),$t="毫秒"),this.timers.delete(mt),`${mt}: ${xt}${$t}`}this.timers.set(mt,{startTime:performance.now(),unit:bt,precision:wt})}sleep(mt=1e3){return new Promise((bt=>setTimeout(bt,mt)))}genericSort(mt,bt,wt=!0){if(!Array.isArray(mt)||mt.length===0)return[];if(!Array.isArray(bt)||bt.length===0)return[...mt];const yt=kt=>{if(kt instanceof Date)return kt;if(typeof kt=="string"){const _t=new Date(kt);if(!isNaN(_t.getTime()))return _t}return kt},jt=(kt,_t)=>_t!=null?typeof _t=="function"?_t(kt):kt&&typeof kt=="object"?kt[_t]:void 0:kt,xt=[],$t=[];for(const kt of mt){let _t=!1;for(const St of bt){const Tt=jt(kt,St.key);if(Tt==null||Tt===void 0){_t=!0;break}}_t?xt.push(kt):$t.push(kt)}return $t.sort(((kt,_t)=>{for(const St of bt){const{key:Tt,order:It="asc"}=St;let Bt=jt(kt,Tt),Pt=jt(_t,Tt);const Mt=yt(Bt),At=yt(Pt);let Nt=Mt instanceof Date&&At instanceof Date?Mt.getTime()-At.getTime():typeof Bt=="number"&&typeof Pt=="number"?Bt-Pt:typeof Bt=="string"&&typeof Pt=="string"?Bt.localeCompare(Pt):String(Bt).localeCompare(String(Pt));if(It==="desc"&&(Nt*=-1),Nt!==0)return Nt}return 0})),wt?[...$t,...xt]:[...xt,...$t]}async retry(mt,bt=3){let wt=0;for(;wt<bt;)try{const yt=await mt();return wt>0&&clog.debug(`[重试] 请求成功,共发起 ${wt+1} 次。`),yt}catch(yt){const jt=yt instanceof Error?yt.message:typeof yt=="object"?JSON.stringify(yt):String(yt);if(yt?._cfBlocked||yt?._circuitBroken||jt.includes("Just a moment")||jt.includes("重定向")||jt.toLowerCase().includes("404 not found"))throw yt;if(wt++,wt===bt)throw clog.debug(`[重试] 达到最大重试次数 (${bt}),最终失败:`,yt),yt;await this.sleep(500*wt),clog.debug(`[重试] 请求失败,准备第 ${wt+1} 次重试, 错误信息: ${jt}`)}}}unsafeWindow.utils=window.utils=new J,unsafeWindow.gmHttp=window.gmHttp=new class{constructor(){this._circuitBreakers=new Map,this._domainStats=new Map}_getDomain(Ct){try{return new URL(Ct).hostname}catch{return"unknown"}}_isCloudflareChallenge(Ct){if(typeof Ct!="string"||!Ct)return!1;const mt=Ct.toLowerCase();return mt.includes("just a moment")||mt.includes("cf-chl-")||mt.includes("challenge-platform")}_checkCircuitBreaker(Ct){const mt=this._circuitBreakers.get(Ct);if(!mt)return null;if(mt.state==="open"){const bt=Date.now()-mt.openTime;return bt<mt.cooldownMs?{state:"open",remaining:Math.ceil((mt.cooldownMs-bt)/1e3)}:(mt.state="half-open",mt.failCount=0,mt.probing=!1,null)}return mt.state==="half-open"&&mt.probing?{state:"half-open",remaining:0}:null}isDomainCircuitBroken(Ct){return this._checkCircuitBreaker(this._getDomain(Ct))}_recordSuccess(Ct){let mt=this._circuitBreakers.get(Ct);mt&&(mt.state="closed",mt.failCount=0,mt.probing=!1);let bt=this._domainStats.get(Ct);bt||(bt={count:0,errors:0,lastUsed:0},this._domainStats.set(Ct,bt)),bt.count++,bt.lastUsed=Date.now()}_recordFailure(Ct){let mt=this._circuitBreakers.get(Ct);mt||(mt={state:"closed",failCount:0,openTime:0,cooldownMs:6e4,threshold:3},this._circuitBreakers.set(Ct,mt)),mt.failCount++,(mt.state==="half-open"||mt.failCount>=(mt.threshold||3))&&(mt.state="open",mt.openTime=Date.now(),mt.probing=!1,clog.warn(`[熔断] ${Ct} 连续失败 ${mt.failCount} 次,已熔断 ${mt.cooldownMs/1e3} 秒`));let bt=this._domainStats.get(Ct);bt||(bt={count:0,errors:0,lastUsed:0},this._domainStats.set(Ct,bt)),bt.count++,bt.errors++,bt.lastUsed=Date.now()}getCircuitBreakerStatus(){const Ct={};return this._circuitBreakers.forEach(((mt,bt)=>{Ct[bt]={...mt}})),Ct}resetCircuitBreaker(Ct){this._circuitBreakers.delete(Ct)}resetAllCircuitBreakers(){this._circuitBreakers.clear()}getDomainStats(){const Ct={};return this._domainStats.forEach(((mt,bt)=>{Ct[bt]={...mt}})),Ct}clearDomainStats(){this._domainStats.clear()}async get(Ct,mt={},bt={},wt,yt={}){return this.gmRequest("GET",Ct,null,mt,bt,wt,yt)}post(Ct,mt={},bt={}){bt={"Content-Type":"application/json",...bt};let wt=JSON.stringify(mt);return this.gmRequest("POST",Ct,wt,null,bt)}async gmRequest(Ct,mt,bt={},wt={},yt={},jt=!1,xt={}){if(wt&&Object.keys(wt).length){const Pt=new URLSearchParams(wt).toString();mt+=(mt.includes("?")?"&":"?")+Pt}const $t=this._getDomain(mt),[kt,_t,St,Tt]=await Promise.all([storageManager.getSetting("httpTimeout",5e3),storageManager.getSetting("httpRetryCount",3),storageManager.getSetting("circuitBreakerThreshold",3),storageManager.getSetting("circuitBreakerCooldown",6e4)]);let It=this._circuitBreakers.get($t);It||(It={state:"closed",failCount:0,openTime:0,cooldownMs:Tt,threshold:St,probing:!1},this._circuitBreakers.set($t,It));const Bt=this._checkCircuitBreaker($t);if(Bt){const Pt=new Error(`站点 ${$t} 已熔断,${Bt.remaining}秒后重试`);throw Pt._circuitBroken=!0,Pt}return bt||(bt=void 0),await utils.retry(()=>{const Pt=this._checkCircuitBreaker($t);if(Pt){const Mt=new Error(`站点 ${$t} 已熔断,${Pt.remaining}秒后重试`);return Mt._circuitBroken=!0,Promise.reject(Mt)}return It.state==="half-open"&&(It.probing=!0),new Promise(((Mt,At)=>{GM_xmlhttpRequest({method:Ct,url:mt,headers:yt,timeout:kt,data:bt,onload:Nt=>{try{if(Nt.status===404&&xt.ignoreNotFound)return void Mt(null);if(this._isCloudflareChallenge(Nt.responseText)){this._recordFailure($t);const Dt=new Error(`Cloudflare challenge blocked: ${$t}`);return Dt._cfBlocked=!0,Dt.status=Nt.status,void At(Dt)}if(jt&&Nt.finalUrl!==mt&&At("请求被重定向了,URL是:"+Nt.finalUrl),Nt.status>=200&&Nt.status<300)if(this._recordSuccess($t),Nt.responseText)try{Mt(JSON.parse(Nt.responseText))}catch{Mt(Nt.responseText)}else Mt(Nt.responseText||Nt);else if(clog.error("请求失败,状态码:",Nt.status,mt),this._recordFailure($t),Nt.responseText)try{const Dt=JSON.parse(Nt.responseText);Dt.status=Nt.status,At(Dt)}catch{const Dt=new Error(Nt.responseText||`请求发生错误 ${Nt.status}`);Dt.status=Nt.status,At(Dt)}else{const Dt=new Error(`请求发生错误 ${Nt.status}`);Dt.status=Nt.status,At(Dt)}}catch(Dt){this._recordFailure($t),At(Dt)}},onerror:Nt=>{clog.error("网络错误:",mt),this._recordFailure($t),At(new Error(Nt.error||"网络错误"))},ontimeout:()=>{this._recordFailure($t),At(new Error("请求超时: "+mt))}})}))},_t)}},unsafeWindow.storageManager=window.storageManager=new z;const G=new BroadcastChannel("channel-refresh");window.refresh=function(){G.postMessage({type:"refresh"})},window.cleanCache_filter_actor_actress_car_list=function(){G.postMessage({type:"cleanCache_filter_actor_actress_car_list"})},window.clean_cacheSettingObj=function(){G.postMessage({type:"clean_cacheSettingObj"})},document.head.insertAdjacentHTML("beforeend",` <style> .loading-container { position: fixed; top: 0; left: 0; width: 100%; height: 100%; display: flex; justify-content: center; align-items: center; background-color: rgba(0, 0, 0, 0.1); z-index: 99999999; } .loading-animation { position: relative; width: 60px; height: 12px; background: linear-gradient(90deg, #4facfe 0%, #00f2fe 100%); border-radius: 6px; animation: loading-animate 1.8s ease-in-out infinite; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .loading-animation:before, .loading-animation:after { position: absolute; display: block; content: ""; animation: loading-animate 1.8s ease-in-out infinite; height: 12px; border-radius: 6px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); } .loading-animation:before { top: -20px; left: 10px; width: 40px; background: linear-gradient(90deg, #ff758c 0%, #ff7eb3 100%); } .loading-animation:after { bottom: -20px; width: 35px; background: linear-gradient(90deg, #ff9a9e 0%, #fad0c4 100%); } @keyframes loading-animate { 0% { transform: translateX(40px); } 50% { transform: translateX(-30px); } 100% { transform: translateX(40px); } } </style> `),unsafeWindow.loading=window.loading=function(){const Ct=document.createElement("div");Ct.className="loading-container";const mt=document.createElement("div");return mt.className="loading-animation",Ct.appendChild(mt),document.body.appendChild(Ct),{close:()=>{Ct&&Ct.parentNode&&Ct.parentNode.removeChild(Ct)}}},(function(){const Ct=(mt,bt,wt,yt,jt)=>{let xt;typeof wt=="object"?xt=wt:(xt=typeof yt=="object"?yt:jt||{},xt.gravity=wt||"top",xt.position=typeof yt=="string"?yt:"center"),xt.gravity&&xt.gravity!=="center"||(xt.offset={y:"calc(50vh - 150px)"});const $t="var(--jhs-status-fav)",kt="var(--jhs-status-fav-tint)",_t="var(--jhs-status-down)",St="var(--jhs-status-down-tint)",Tt="var(--jhs-status-filter)",It="var(--jhs-status-filter-tint)",Bt={borderRadius:"12px",padding:"12px 16px",boxShadow:"0 4px 6px rgba(0,0,0,0.1)",minWidth:"150px",textAlign:"center",zIndex:999999999},Pt={text:mt,duration:2500,close:!1,gravity:"top",position:"center",style:{info:{...Bt,background:`${$t}`,color:"var(--jhs-status-fav-on)"},success:{...Bt,background:`${_t}`,color:"var(--jhs-status-down-on)"},error:{...Bt,background:`${Tt}`,color:"var(--jhs-status-filter-on)"}}[bt],stopOnFocus:!0,oldestFirst:!1,...xt};Pt.duration===-1&&(Pt.close=!0);const Mt=Toastify(Pt);return Mt.showToast(),Mt.closeShow=()=>{Mt.toastElement.remove()},Mt};unsafeWindow.show=window.show={ok:(mt,bt="center",wt,yt)=>Ct(mt,"success",bt,wt,yt),error:(mt,bt="center",wt,yt)=>Ct(mt,"error",bt,wt,yt),info:(mt,bt="center",wt,yt)=>Ct(mt,"info",bt,wt,yt)}})(),(function(){function Ct(mt=10){setTimeout((()=>{const bt=document.querySelectorAll(".layui-layer-shade").length;document.documentElement.style.overflow=bt>0?"hidden":""}),mt)}document.head.insertAdjacentHTML("beforeend",` <style> .viewer-canvas { overflow: auto !important; } .viewer-close { background: rgba(222, 51, 51, 0.6) !important; /* 状态红 --jhs-status-filter 半透明弱化 */ } .viewer-close:hover { background: rgba(222, 51, 51, 0.8) !important; } </style> `),window.showImageViewer=function(mt,bt=""){let wt=null,yt=!1;typeof mt=="string"||mt instanceof String?(wt=$('<div class="temporary-container jhs-layout-c8be1ccb">').append(`<img src="${mt}" alt="${bt}">`).appendTo("body"),yt=!0):wt=$(mt);const jt={zIndex:999999990,navbar:!1,zoomOnWheel:!1,zoomRatio:.1,toggleOnDblclick:!1,toolbar:{zoomIn:1,zoomOut:1,reset:1,rotateLeft:0,rotateRight:0,flipHorizontal:0,flipVertical:0},title:!1,keyboard:!1,viewed(){xt.zoomTo(1.4);let $t=(xt.viewerData.width-xt.imageData.width)/2;xt.moveTo($t,0)},shown(){yt&&wt.remove(),document.documentElement.style.overflow="hidden",document.body.style.overflow="hidden",xt.handleKeydown=function($t){$t.key!=="Escape"&&$t.key!==" "||($t.preventDefault(),$t.stopPropagation(),xt.destroy(),document.removeEventListener("keydown",xt.handleKeydown),document.documentElement.style.overflow="",document.body.style.overflow="",Ct())},document.addEventListener("keydown",xt.handleKeydown)},hidden(){xt&&xt.handleKeydown&&document.removeEventListener("keydown",xt.handleKeydown),xt.destroy(),document.documentElement.style.overflow="",document.body.style.overflow="",Ct()}},xt=new Viewer(wt[0],jt);xt.show()}})(),window.ImageHoverPreview=class{constructor(Ct={}){this.config={selector:".hover-preview",dataAttribute:"data-full",maxWidth:1e3,maxHeight:1e3,offsetX:20,offsetY:20,zIndex:9999999999,transition:.2,hideDelay:100,autoAdjustPosition:!0,...Ct},this.preview=null,this.currentTarget=null,this.timer=null,this.imgElement=null,this.pendingImage=null,this.placement=null,this.pointer=null,this.animationFrame=null,this.loadGeneration=0,this.destroyed=!1,this.currentUrl=null,this.pendingUrl=null,this.loadedUrls=new Map,this.eventsBound=!1,this.onMouseEnter=mt=>this.handleMouseEnter(mt),this.onMouseLeave=mt=>this.handleMouseLeave(mt),this.onMouseMove=mt=>this.handleMouseMove(mt),this.onDocumentOver=mt=>this.handleDocumentOver(mt),this.onDocumentOut=mt=>this.handleDocumentOut(mt),this.onDocumentMove=mt=>this.handleDocumentMove(mt),this.init()}init(){utils.isMobileMode()||(this.injectStyles(),this.createPreviewElement(),this.bindEvents())}injectStyles(){if(document.getElementById("jhs-image-hover-preview-style"))return;const Ct=document.createElement("style");Ct.id="jhs-image-hover-preview-style",Ct.textContent=` .image-hover-preview { position: fixed; display: block; visibility: hidden; overflow: hidden; pointer-events: none; opacity: 0; border-radius: var(--jhs-radius-xs); background-color: var(--jhs-surface); box-shadow: var(--jhs-shadow-lg); transition: opacity var(--jhs-hover-transition, .2s) ease; } .image-hover-preview.active { visibility: visible; opacity: 1; } .image-hover-preview img { display: block; width: 100%; height: 100%; object-fit: contain; } .image-hover-preview::after { position: absolute; inset: 0; pointer-events: none; background: rgba(0, 0, 0, .03); content: ""; } .image-hover-preview.loading { min-width: 120px; min-height: 72px; } .image-hover-preview.loading::before { position: absolute; top: 50%; left: 50%; color: var(--jhs-text-muted); font-size: var(--jhs-font-size-md); content: "加载中..."; transform: translate(-50%, -50%); } .image-hover-preview__error { padding: var(--jhs-space-3); color: var(--jhs-danger); } `,document.head.appendChild(Ct)}createPreviewElement(){this.preview=document.createElement("div"),this.preview.className="image-hover-preview",this.preview.style.zIndex=String(this.config.zIndex),this.preview.style.setProperty("--jhs-hover-transition",`${this.config.transition}s`),document.body.appendChild(this.preview)}bindEvents(){this.eventsBound||this.destroyed||(document.addEventListener("mouseover",this.onDocumentOver),document.addEventListener("mouseout",this.onDocumentOut),document.addEventListener("mousemove",this.onDocumentMove),this.eventsBound=!0)}findTarget(Ct){const mt=Ct.target;return mt?.closest?mt.closest(this.config.selector):null}handleDocumentOver(Ct){const mt=this.findTarget(Ct);mt&&(!Ct.relatedTarget||!mt.contains(Ct.relatedTarget))&&this.handleMouseEnter(Ct,mt)}handleDocumentOut(Ct){const mt=this.findTarget(Ct);mt&&(!Ct.relatedTarget||!mt.contains(Ct.relatedTarget))&&this.handleMouseLeave()}handleDocumentMove(Ct){this.findTarget(Ct)===this.currentTarget&&this.handleMouseMove(Ct)}handleMouseEnter(Ct,mt=Ct.currentTarget){if(this.destroyed||!this.preview)return;clearTimeout(this.timer),this.timer=null,this.currentTarget=mt,this.pointer={x:Ct.clientX,y:Ct.clientY},this.placement=null;const bt=this.currentTarget.getAttribute(this.config.dataAttribute)||this.currentTarget.src;if(!bt)return;if(bt===this.currentUrl&&this.imgElement)return this.showCurrentPreview();if(bt===this.pendingUrl)return void this.preview.classList.add("active");const wt=this.loadedUrls.get(bt);if(wt)return void this.commitPreview(bt,wt);const yt=++this.loadGeneration;this.pendingImage&&(this.pendingImage.onload=null,this.pendingImage.onerror=null),this.pendingUrl=bt,this.currentUrl?this.showCurrentPreview():(this.preview.replaceChildren(),this.preview.classList.add("loading","active"));const jt=new Image;this.pendingImage=jt,jt.onload=()=>{if(this.destroyed||yt!==this.loadGeneration||!this.preview)return;const{width:xt,height:$t}=this.calculateImageSize(jt),kt={width:xt,height:$t};this.loadedUrls.set(bt,kt),this.pendingImage=null,this.pendingUrl=null,this.commitPreview(bt,kt)},jt.onerror=()=>{if(this.destroyed||yt!==this.loadGeneration||!this.preview)return;if(this.pendingImage=null,this.pendingUrl=null,this.currentUrl)return void this.preview.classList.add("active");const xt=document.createElement("div");xt.className="image-hover-preview__error",xt.textContent="图片加载失败",this.preview.replaceChildren(xt),this.preview.classList.remove("loading"),this.preview.classList.add("active")},jt.src=bt}commitPreview(Ct,mt){if(!this.preview)return;const bt=document.createElement("img");bt.src=Ct,bt.alt="预览图",this.preview.replaceChildren(bt),this.imgElement=bt,this.currentUrl=Ct,this.preview.style.width=`${mt.width}px`,this.preview.style.height=`${mt.height}px`,this.preview.classList.remove("loading"),this.showCurrentPreview()}showCurrentPreview(){if(!this.preview||!this.pointer||!this.imgElement)return;const Ct=this.preview.offsetWidth,mt=this.preview.offsetHeight;this.placement=this.choosePlacement(this.pointer.x,this.pointer.y,Ct,mt),this.preview.classList.add("active"),this.schedulePosition()}calculateImageSize(Ct){const bt=Math.max(1,window.innerWidth-2*(8+this.config.offsetX)),wt=Math.max(1,window.innerHeight-2*(8+this.config.offsetY)),yt=Math.min(this.config.maxWidth,bt),jt=Math.min(this.config.maxHeight,wt),xt=Math.min(1,yt/Ct.naturalWidth,jt/Ct.naturalHeight);return{width:Math.max(1,Math.round(Ct.naturalWidth*xt)),height:Math.max(1,Math.round(Ct.naturalHeight*xt))}}choosePlacement(Ct,mt,bt,wt){if(!this.config.autoAdjustPosition)return{horizontal:"right",vertical:"bottom"};const yt=window.innerWidth-Ct-this.config.offsetX,jt=Ct-this.config.offsetX,xt=window.innerHeight-mt-this.config.offsetY,$t=mt-this.config.offsetY;return{horizontal:yt>=bt||yt>=jt?"right":"left",vertical:xt>=wt||xt>=$t?"bottom":"top"}}handleMouseMove(Ct){!this.currentTarget||!this.preview?.classList.contains("active")||(this.pointer={x:Ct.clientX,y:Ct.clientY},this.schedulePosition())}schedulePosition(){this.animationFrame||!this.pointer||!this.placement||(this.animationFrame=requestAnimationFrame((()=>{this.animationFrame=null,this.applyPosition()})))}applyPosition(){if(!this.preview||!this.pointer||!this.placement)return;const Ct=8,mt=this.preview.offsetWidth,bt=this.preview.offsetHeight;let wt=this.placement.horizontal==="right"?this.pointer.x+this.config.offsetX:this.pointer.x-mt-this.config.offsetX,yt=this.placement.vertical==="bottom"?this.pointer.y+this.config.offsetY:this.pointer.y-bt-this.config.offsetY;wt=Math.min(Math.max(Ct,wt),Math.max(Ct,window.innerWidth-mt-Ct)),yt=Math.min(Math.max(Ct,yt),Math.max(Ct,window.innerHeight-bt-Ct)),this.preview.style.left=`${wt}px`,this.preview.style.top=`${yt}px`}handleMouseLeave(){this.preview&&(clearTimeout(this.timer),this.timer=setTimeout((()=>this.hidePreview()),this.config.hideDelay))}hidePreview(){this.preview&&(++this.loadGeneration,this.pendingImage&&(this.pendingImage.onload=null,this.pendingImage.onerror=null),this.pendingImage=null,this.pendingUrl=null,this.preview.classList.remove("active","loading"),this.currentTarget=null,this.pointer=null,this.placement=null,this.timer=null)}destroy(){this.destroyed||(this.destroyed=!0,++this.loadGeneration,clearTimeout(this.timer),this.animationFrame&&cancelAnimationFrame(this.animationFrame),this.animationFrame=null,this.pendingImage&&(this.pendingImage.onload=null,this.pendingImage.onerror=null),this.pendingImage=null,this.eventsBound&&(document.removeEventListener("mouseover",this.onDocumentOver),document.removeEventListener("mouseout",this.onDocumentOut),document.removeEventListener("mousemove",this.onDocumentMove),this.eventsBound=!1),this.loadedUrls.clear(),this.preview?.remove(),this.preview=null,this.currentTarget=null)}},(async function(){document.head.insertAdjacentHTML("beforeend",` <style> .console-logger-container { position: fixed; bottom: 0; right: 0; z-index: 99999999; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; display: flex; flex-direction: column; align-items: flex-end; width: fit-content; } .console-logger-toggle { width: 40px; height: 30px; background: var(--jhs-accent); border-radius: 120px 10px 0 0; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: -2px 0 5px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; color: var(--jhs-accent-text-on); font-size: 16px; } .console-logger-toggle:hover { background: var(--jhs-accent-hover); } .console-logger-toggle::after { content: '▼'; transition: transform 0.3s ease; } .console-logger-toggle.collapsed::after { content: '▲'; } .console-logger-window { width: 400px; height: 400px; background: var(--jhs-surface); border-radius: 10px 0 10px 10px; box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1); display: flex; flex-direction: column; overflow: hidden; transform: translateY(0); opacity: 1; /* 简化过渡属性 */ transition: width 0.3s ease, height 0.3s ease, opacity 0.3s ease, transform 0.3s ease; } .console-logger-window.maximized { width: 600px !important; height: 85vh !important; border-radius: 10px 0 0 10px; /* 调整圆角以匹配右下角 */ } .console-logger-window.collapsed { height: 0 !important; min-height: 0 !important; opacity: 0; } .console-logger-header { background: var(--jhs-accent); color: var(--jhs-accent-text-on); padding: 12px 15px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; } .console-logger-title { font-weight: 600; font-size: 16px; } .console-logger-controls { display: flex; gap: 10px; } .console-logger-controls button { background: transparent; border: 1px solid rgba(255, 255, 255, 0.3); padding: 5px 10px; font-size: 12px; color: var(--jhs-accent-text-on); border-radius: 4px; cursor: pointer; transition: background 0.3s; } .console-logger-controls button:hover { background: rgba(255, 255, 255, 0.1); } /* 新增的按钮样式 */ .console-logger-maximize-toggle { line-height: 1; font-size: 14px !important; /* 使箭头看起来更大 */ padding: 5px 8px !important; } .console-logger-maximize-toggle::before { content: '⇱'; /* Unicode symbol for maximized */ } .console-logger-maximize-toggle.active::before { content: '⇲'; /* Unicode symbol for minimized */ } .console-logger-filters { display: flex; align-items: center; gap: 5px; padding: 10px; background: var(--jhs-surface-2); border-bottom: 1px solid var(--jhs-border); flex-shrink: 0; overflow-x: hidden; } /* 新增: 过滤器按钮组的容器,负责滚动 */ .console-logger-filter-group { display: flex; gap: 5px; overflow-x: auto; /* 允许过滤器按钮滚动 */ flex-grow: 1; /* 占据剩余空间 */ padding-right: 10px; /* 避免滚动条影响按钮 */ } .console-logger-filter { padding: 5px 10px; font-size: 12px; border-radius: 15px; background: var(--jhs-input-bg); color: var(--jhs-text-muted); border: 1px solid var(--jhs-border); cursor: pointer; transition: all 0.3s; white-space: nowrap; flex-shrink: 0; /* 确保不被压缩 */ } .console-logger-filter.active { background: var(--jhs-accent); color: var(--jhs-accent-text-on); border-color: var(--jhs-accent); } /* 新增: 滚动到底部按钮的样式 (位于 filtersContainer 内部右侧) */ .console-logger-scroll-to-bottom { background: var(--jhs-accent); border: none; padding: 5px 10px; font-size: 12px; color: var(--jhs-accent-text-on); border-radius: 4px; cursor: pointer; transition: background 0.3s; line-height: 1; height: fit-content; white-space: nowrap; margin-left: auto; /* 将按钮推到最右侧 */ flex-shrink: 0; /* 确保不被压缩 */ } .console-logger-scroll-to-bottom:hover { background: var(--jhs-accent-hover); } .console-logger-content { flex: 1; overflow-y: auto; padding: 10px; background: var(--jhs-surface); word-wrap: break-word; text-align: left; } .console-logger-entry { padding: 8px 10px; margin-bottom: 3px; border-radius: 4px; font-size: 12px; line-height: 1.4; /*animation: consoleFadeIn 0.3s ease;*/ border-left: 3px solid transparent; } @keyframes consoleFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: translateY(0); } } .console-logger-timestamp { color: var(--jhs-text-muted); font-size: 11px; margin-right: 2px; } @media (max-width: 768px) { .console-logger-container { right: 10px; bottom: 10px; } .console-logger-window { width: calc(100vw - 20px); height: 300px; } } .console-logger-message[data-type="json"] { white-space: pre-wrap; } </style> `);const Ct={base:{label:"信息",background:"var(--jhs-status-fav-tint)",borderLeftColor:"var(--jhs-accent)"},warn:{label:"警告",background:"var(--jhs-status-watch-tint)",borderLeftColor:"var(--jhs-status-watch)"},error:{label:"错误",background:"var(--jhs-status-filter-tint)",borderLeftColor:"var(--jhs-status-filter)"},debug:{label:"调试",background:"var(--jhs-surface-2)",borderLeftColor:"var(--jhs-border-strong)"}},mt={base:["base","warn","error"],warn:["warn"],error:["error"],debug:["base","warn","error","debug"]},bt=await storageManager.getSetting("clogMsgCount",2e3),wt="jhs_clog_maximize",yt="jhs_clog_expand",jt="jhs_clog_filter";class xt{constructor(){const kt=localStorage.getItem(jt);this.currentFilter=kt&&Ct[kt]?kt:"base",this.logs=[],this.isInitialized=!1,this.userScrolledUp=!1}tryInitialize(){return document.readyState!=="loading"&&(this.isInitialized||(this.init(),this.isInitialized=!0),!0)}init(){this.createContainer(),this.bindEvents(),this.checkInitialMaximizeState(),this.checkInitialCollapseState()}createContainer(){this.container=document.createElement("div"),this.container.className="console-logger-container",this.container.style.display="none",this.toggleBtn=document.createElement("div"),this.toggleBtn.className="console-logger-toggle collapsed",this.container.appendChild(this.toggleBtn),this.window=document.createElement("div"),this.window.className="console-logger-window collapsed";const kt=document.createElement("div");kt.className="console-logger-header";const _t=document.createElement("div");_t.className="console-logger-title",_t.textContent="JHS Console";const St=document.createElement("div");St.className="console-logger-controls",this.maximizeBtn=document.createElement("button"),this.maximizeBtn.textContent="",this.maximizeBtn.classList.add("console-logger-maximize-toggle"),St.appendChild(this.maximizeBtn);const Tt=document.createElement("button");Tt.textContent="清空",Tt.addEventListener("click",(()=>this.clear())),St.appendChild(Tt),kt.appendChild(_t),kt.appendChild(St),this.filtersContainer=document.createElement("div"),this.filtersContainer.className="console-logger-filters",this.filterButtonGroup=document.createElement("div"),this.filterButtonGroup.className="console-logger-filter-group",this.filtersContainer.appendChild(this.filterButtonGroup),this.scrollToBottomBtn=document.createElement("button"),this.scrollToBottomBtn.className="console-logger-scroll-to-bottom",this.scrollToBottomBtn.textContent="到底部",this.filtersContainer.appendChild(this.scrollToBottomBtn),this.content=document.createElement("div"),this.content.className="console-logger-content jhs-scrollbar",this.window.appendChild(kt),this.window.appendChild(this.filtersContainer),this.window.appendChild(this.content),this.container.appendChild(this.window),document.body.appendChild(this.container),Object.keys(Ct).forEach((It=>{const Bt=document.createElement("div");Bt.className="console-logger-filter",It===this.currentFilter&&Bt.classList.add("active"),Bt.textContent=Ct[It].label,Bt.dataset.type=It,Bt.addEventListener("click",(()=>this.setFilter(It))),this.filterButtonGroup.appendChild(Bt)}))}bindEvents(){this.toggleBtn.addEventListener("click",(()=>{this.toggleExpandCollapsed()})),this.maximizeBtn.addEventListener("click",(()=>this.toggleMaximize())),this.scrollToBottomBtn.addEventListener("click",(()=>{this.content.scrollTop=this.content.scrollHeight,this.userScrolledUp=!1})),this.content.addEventListener("scroll",(()=>{const kt=this.content.scrollHeight-this.content.clientHeight<=this.content.scrollTop+5;this.userScrolledUp=!kt})),this.content.addEventListener("wheel",(kt=>{const _t=this.content.scrollTop===0,St=this.content.scrollHeight-this.content.clientHeight<=this.content.scrollTop+1;(_t&&kt.deltaY<0||St&&kt.deltaY>0)&&(kt.preventDefault(),kt.stopPropagation())}),{passive:!1})}toggleExpandCollapsed(){const kt=this.window.classList.toggle("collapsed");this.toggleBtn.classList.toggle("collapsed"),kt?localStorage.setItem(yt,"no"):(localStorage.setItem(yt,"yes"),this.reRenderAllLogs())}checkInitialCollapseState(){const kt=localStorage.getItem(yt);kt&&kt!=="no"?(this.window.classList.toggle("collapsed"),this.toggleBtn.classList.toggle("collapsed"),setTimeout((()=>{this.content.scrollTop=this.content.scrollHeight}),0)):(this.window.classList.add("collapsed"),this.toggleBtn.classList.add("collapsed"))}checkInitialMaximizeState(){localStorage.getItem(wt)==="maximized"&&(this.window.classList.add("maximized"),this.maximizeBtn.classList.add("active"))}toggleMaximize(){const kt=this.window.classList.toggle("maximized");this.maximizeBtn.classList.toggle("active",kt),kt?localStorage.setItem(wt,"maximized"):localStorage.setItem(wt,"minimized"),this.window.classList.contains("collapsed")||(this.content.scrollTop=this.content.scrollHeight)}addLog(kt,_t="base",...St){const Tt=this.tryInitialize();let It,Bt=[];Ct[_t]?(It=_t,Bt=St):(It="base",Bt=[_t,...St]),It=Ct[It]?It:"base";const Pt=[kt,...Bt];let Mt="msg";const At=[];Pt.forEach((Lt=>{if(Object.prototype.toString.call(Lt)==="[object Error]")At.push(String(Lt));else if(typeof Lt=="object"&&Lt!==null)try{At.push("<br/>"+JSON.stringify(Lt,null,2)),Mt="json"}catch{At.push(String(Lt)),Mt="msg"}else At.push(String(Lt))}));let Nt=At.join(" ");Nt=Nt.replace(/(?:(?:https?|ftp):\/\/|www\.|(?:\/\/))[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]/gi,(Lt=>{const Et=Lt.startsWith("http")||Lt.startsWith("ftp"),Ht=Lt.startsWith("//"),Ft=Lt.startsWith("www.");let zt=Lt;return Ht?zt=`http:${Lt}`:!Et&&Ft&&(zt=`http://${Lt}`),`<a href="${escapeHtml(zt)}" target="_blank">${escapeHtml(Lt)}</a>`}));const Dt={message:Nt,messageType:Mt,type:It,timestamp:new Date,id:Date.now()+Math.random()};if(this.logs.push(Dt),this.logs.length>bt){const Lt=this.logs[0];if(Tt){const Et=this.content.querySelector(`.console-logger-entry[data-id="${Lt.id}"]`);Et&&(this.logs.shift(),this.content.removeChild(Et))}}Tt&&this.renderLog(Dt)}log(...kt){const[_t,...St]=kt;setTimeout((()=>{this.addLog(_t,"base",...St)}),0)}error(...kt){const[_t,...St]=kt;console.error(...kt),setTimeout((()=>{this.addLog(_t,"error",...St)}),0)}warn(...kt){const[_t,...St]=kt;setTimeout((()=>{this.addLog(_t,"warn",...St)}),0)}debug(...kt){const[_t,...St]=kt;setTimeout((()=>{this.addLog(_t,"debug",...St)}),0)}renderLog(kt){if(this.container.style.display==="none"||this.window.classList.contains("collapsed")||!(mt[this.currentFilter]||[]).includes(kt.type))return;const _t=this._createLogElement(kt);this.content.appendChild(_t),this.window.classList.contains("collapsed")||this.userScrolledUp||(this.content.scrollTop=this.content.scrollHeight)}reRenderAllLogs(){this.container.style.display!=="none"&&(this.window.classList.contains("collapsed")||setTimeout((()=>{if(this.content.innerHTML="",this.logs.length===0)return;const kt=mt[this.currentFilter]||[],_t=document.createDocumentFragment();this.logs.forEach((St=>{if(kt.includes(St.type)){const Tt=this._createLogElement(St);_t.appendChild(Tt)}})),this.content.appendChild(_t),this.content.scrollTop=this.content.scrollHeight}),0))}_createLogElement(kt){const _t=document.createElement("div");_t.className="console-logger-entry",_t.dataset.type=kt.type,_t.dataset.id=kt.id;const St=Ct[kt.type]||Ct.base;_t.style.borderLeft="3px solid "+St.borderLeftColor,_t.style.background=St.background;const Tt=(kt.timestamp instanceof Date?kt.timestamp:new Date(kt.timestamp)).toTimeString().split(" ")[0];return _t.innerHTML=` <span class="console-logger-timestamp">[${Tt}]</span> <span class="console-logger-message" data-type="${kt.messageType}">${kt.message}</span> `,_t}setFilter(kt){this.currentFilter!==kt&&(this.currentFilter=kt,localStorage.setItem(jt,kt),this.filterButtonGroup.querySelectorAll(".console-logger-filter").forEach((_t=>{_t.dataset.type===kt?_t.classList.add("active"):_t.classList.remove("active")})),this.reRenderAllLogs())}clear(){this.logs=[],this.content.innerHTML=""}show(){(this.isInitialized&&this.container||this.tryInitialize()&&this.container)&&(this.container.style.display="",this.reRenderAllLogs())}hide(){this.isInitialized&&this.container&&(this.container.style.display="none")}lowZIndex(){this.isInitialized&&this.container&&(this.container.style.zIndex="12345678")}highZIndex(){this.isInitialized&&this.container&&(this.container.style.zIndex="999999999")}}try{unsafeWindow.parent.clog&&typeof unsafeWindow.parent.clog.log=="function"?window.clog=unsafeWindow.clog=unsafeWindow.parent.clog:window.clog=unsafeWindow.clog=new xt}catch($t){console.error("创建日志控制台出现异常",$t),window.clog=unsafeWindow.clog=new xt}(function(){const $t=window.clog||console;window.addEventListener("error",(function(kt){const _t=kt.filename,St=kt.message;_t.includes("javdb")||_t.includes("javbus")||$t.error(`[全局 Error 异常捕获] ${St} 来源: ${_t}`)})),window.addEventListener("unhandledrejection",(function(kt){const _t=kt.reason,St=_t?.message??"";if(St.includes("play()"))return;if(St.includes("The element has no supported sources"))return show.error("播放失败, 请检查是否已对节点分流?"),void $t.error("播放失败, 请检查是否已对节点分流?");if(St.includes("<span>1005</span>")&&St.includes("fc2ppvdb"))return;const Tt=`[全局 Promise 异常捕获] ${_t.message||_t}`;$t.error(Tt,_t),kt.preventDefault()}))})(),document.addEventListener("mousedown",($t=>{const kt=window.clog;if(!kt.isInitialized||!kt.container)return;const _t=$t.target,St=[".console-logger-container",".layui-layer-shade",".loading-container"].join(",");_t.closest(St)?kt.highZIndex():kt.lowZIndex()}))})(),(function(){function Ct(bt,wt,yt){const jt=(function(Dt){const Lt=document.createElement("div");Lt.classList.add("js-tooltip");const Et=document.createElement("div");return Et.innerHTML=escapeHtml(Dt),Lt.appendChild(Et),document.body.appendChild(Lt),Lt})(wt);jt.style.display="block";const xt=bt.getBoundingClientRect(),$t=jt.getBoundingClientRect();jt.style.display="none";const kt=window.innerWidth,_t=window.innerHeight;let St,Tt,It=yt;const Bt=Dt=>Dt>=8&&Dt+$t.height<=_t-8,Pt=Dt=>Dt>=8&&Dt+$t.width<=kt-8,Mt=xt.left+xt.width/2-$t.width/2,At=xt.top+xt.height/2-$t.height/2;switch(yt){case"top":Tt=xt.top-$t.height-0,Tt<8&&Bt(xt.bottom+0)&&(Tt=xt.bottom+0,It="bottom");break;case"bottom":Tt=xt.bottom+0,Tt+$t.height>_t-8&&Bt(xt.top-$t.height-0)&&(Tt=xt.top-$t.height-0,It="top");break;case"left":St=xt.left-$t.width-0,St<8&&Pt(xt.right+0)&&(St=xt.right+0,It="right");break;case"right":St=xt.right+0,St+$t.width>kt-8&&Pt(xt.left-$t.width-0)&&(St=xt.left-$t.width-0,It="left")}It==="top"||It==="bottom"?(St=Mt,St<8?St=8:St+$t.width>kt-8&&(St=kt-$t.width-8)):(It==="left"||It==="right")&&(Tt=At,Tt<8?Tt=8:Tt+$t.height>_t-8&&(Tt=_t-$t.height-8)),jt.style.left=`${St}px`,jt.style.top=`${Tt}px`,jt.classList.add("is-active"),bt.tooltipElement=jt}document.head.insertAdjacentHTML("beforeend",` <style> .js-tooltip { position: fixed; padding: 8px 12px; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-sm); white-space: normal; max-width: 600px; pointer-events: none; font-size: 14px; line-height: 1.5; z-index: 9999999999; background: var(--jhs-surface-2); color: var(--jhs-text); box-shadow: var(--jhs-shadow-md); display: none; } .js-tooltip.is-active { display: block !important; } </style> `);const mt="[data-tip-top], [data-tip-bottom], [data-tip-left], [data-tip-right], [data-tip]";document.addEventListener("mouseover",(bt=>{const wt=bt.target.closest(mt);if(wt&&!wt.tooltipElement){let yt,jt="top";if(wt.hasAttribute("data-tip-bottom")?(yt=wt.getAttribute("data-tip-bottom"),jt="bottom"):wt.hasAttribute("data-tip-left")?(yt=wt.getAttribute("data-tip-left"),jt="left"):wt.hasAttribute("data-tip-right")?(yt=wt.getAttribute("data-tip-right"),jt="right"):wt.hasAttribute("data-tip-top")?(yt=wt.getAttribute("data-tip-top"),jt="top"):wt.hasAttribute("data-tip")&&(yt=wt.getAttribute("data-tip"),jt="top"),!yt)return;wt.hoverTimeout=setTimeout((()=>{wt.matches(":hover")&&!wt.tooltipElement&&Ct(wt,yt,jt)}),50)}})),document.addEventListener("mouseout",(bt=>{const wt=bt.target.closest(mt);var yt;wt&&(wt.hoverTimeout&&(clearTimeout(wt.hoverTimeout),wt.hoverTimeout=null),wt.contains(bt.relatedTarget)||wt.tooltipElement&&((yt=wt.tooltipElement)&&yt.parentNode&&yt.remove(),wt.tooltipElement=null))}))})();class Y{constructor(){this.plugins=new Map,this._errorLog=[],this._lastTimings=[],this._startedAt=performance.now(),this._registrationMs=0,this._cssMs=0,this._immediateMs=0,this._readyMs=0,this._idlePending=0,this._idleCompleted=0}register(mt){if(typeof mt!="function")throw new Error("插件必须是一个类");const bt=performance.now(),wt=new mt;wt.pluginManager=this;const yt=wt.getName();if(this.plugins.has(yt))throw new Error(`插件"${yt}"已注册`);this.plugins.set(yt,wt),this._registrationMs+=performance.now()-bt}getBean(mt){return this.plugins.get(mt)}_addError(mt,bt,wt){this._errorLog.push({time:new Date().toISOString(),plugin:mt,phase:bt,message:wt?.message||String(wt),stack:wt?.stack||""}),this._errorLog.length>200&&this._errorLog.shift()}getErrorLog(){return[...this._errorLog]}clearErrorLog(){this._errorLog=[]}getTimings(){return[...this._lastTimings]}getPluginNames(){return Array.from(this.plugins.keys())}getStartupReport(){return{registeredPlugins:this.plugins.size,registrationMs:this._registrationMs,cssMs:this._cssMs,immediateMs:this._immediateMs,readyMs:this._readyMs,idlePending:this._idlePending,idleCompleted:this._idleCompleted}}async _getDisabledPlugins(){try{const mt=await storageManager.getSetting("disabledPlugins","[]");return JSON.parse(mt)}catch{return[]}}async processCss(){const mt=performance.now(),bt=await this._getDisabledPlugins(),wt=utils.isMobileMode(),jt=(await Promise.all(Array.from(this.plugins).map((async([xt,$t])=>{try{if(bt.includes(xt))return{name:xt,status:"disabled"};if(wt&&typeof $t.shouldSkipOnMobile=="function"&&$t.shouldSkipOnMobile())return{name:xt,status:"skipped"};if(typeof $t.initCss=="function"){const kt=await $t.initCss();return{name:xt,status:"fulfilled",css:kt}}return{name:xt,status:"skipped"}}catch(kt){return console.error(`插件 ${xt} 加载 CSS 失败`,kt),this._addError(xt,"initCss",kt),{name:xt,status:"rejected",error:kt}}})))).map((xt=>xt.css)).filter(Boolean);jt.length>0&&utils.insertStyle(jt),this._cssMs=performance.now()-mt}async _runPlugin(mt){const bt=performance.now();try{typeof mt.plugin.handle=="function"&&await mt.plugin.handle(),mt.timing.elapsed=performance.now()-bt,mt.timing.status="ok"}catch(wt){mt.timing.elapsed=performance.now()-bt,mt.timing.status="error",mt.timing.error=wt?.message||String(wt),clog.error(`插件 ${mt.name} 执行失败`,wt),this._addError(mt.name,mt.mode==="idle"?"handle-idle":"handle",wt)}}_scheduleIdle(mt){const bt=()=>mt().catch((wt=>{console.error("[JHS] 空闲插件执行失败:",wt)}));typeof requestIdleCallback=="function"?requestIdleCallback(bt,{timeout:1500}):setTimeout(bt,100)}async _runIdlePlugins(mt){for(const bt of mt)bt.startedAt=performance.now(),await this._runPlugin(bt),this._idlePending--,this._idleCompleted++}async processPlugins(){const mt=await this._getDisabledPlugins(),bt=utils.isMobileMode(),wt=[],yt=[],jt=[];for(const[$t,kt]of this.plugins){const _t=typeof kt.getStartupMode=="function"&&kt.getStartupMode()==="idle"?"idle":"immediate",St={name:$t,elapsed:0,status:"pending",startupMode:_t};if(mt.includes($t))St.status="disabled",jt.push(St);else if(bt&&typeof kt.shouldSkipOnMobile=="function"&&kt.shouldSkipOnMobile())St.status="skipped-mobile",jt.push(St);else{const Tt={name:$t,plugin:kt,mode:_t,timing:St,startedAt:0};_t==="idle"?(St.status="pending-idle",yt.push(Tt)):wt.push(Tt),jt.push(St)}}this._lastTimings=jt;const xt=performance.now();await Promise.all(wt.map(($t=>($t.startedAt=performance.now(),this._runPlugin($t))))),this._immediateMs=performance.now()-xt;for(const $t of wt)if(typeof $t.plugin.afterPluginsReady=="function")try{await $t.plugin.afterPluginsReady()}catch(kt){clog.error(`插件 ${$t.name} 完成初始化后执行失败`,kt),this._addError($t.name,"after-ready",kt)}this._readyMs=performance.now()-this._startedAt,this._idlePending=yt.length,yt.length&&this._scheduleIdle((()=>this._runIdlePlugins(yt)))}}class X{constructor(){if(!X._sharedIcons){i(this,"pluginManager",null),i(this,"settingSvg",'<svg t="1760926954860" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4947" width="200" height="200"><path d="M511.099222 365.825763c-80.7786 0-146.26579 65.482515-146.26579 146.259556 0 80.7786 65.48719 146.259556 146.26579 146.259556 80.777041 0 146.259556-65.480957 146.259556-146.259556C657.358779 431.308278 591.876263 365.825763 511.099222 365.825763L511.099222 365.825763zM511.099222 585.215097c-40.391637 0-73.136012-32.742816-73.136012-73.129778 0-40.391637 32.742816-73.129778 73.136012-73.129778 40.386962 0 73.129778 32.738141 73.129778 73.129778C584.229 552.472281 551.486184 585.215097 511.099222 585.215097L511.099222 585.215097zM511.099222 585.215097M900.893017 568.24369l-26.451395-15.268032c3.065451-27.021784 3.138697-54.472139 0.077922-81.822754l26.373473-15.225955c69.953678-40.391637 93.920921-129.844512 53.533959-199.799749-40.390079-69.95212-129.839837-93.925596-199.799749-53.533959l-26.373473 15.225955c-22.153219-16.330888-45.963059-29.99217-70.896534-40.843585l0-30.545416c0-80.777041-65.48719-146.259556-146.26579-146.259556-80.7786 0-146.259556 65.482515-146.259556 146.259556l0 30.515806c-12.377127 5.421811-24.587501 11.55583-36.562551 18.473743-11.97505 6.917913-23.396854 14.420242-34.277879 22.432179l-26.431136-15.258682c-69.958353-40.391637-159.406553-16.424395-199.79819 53.533959C27.378272 326.082437 51.343956 415.535311 121.299193 455.922273l26.449837 15.275825c-3.063892 27.020226-3.137139 54.465905-0.077922 81.822754l-26.373473 15.224397c-69.953678 40.391637-93.920921 129.841395-53.533959 199.799749 40.391637 69.95212 129.839837 93.920921 199.79819 53.533959l26.375032-15.224397c22.153219 16.32933 45.963059 29.984378 70.896534 40.843585l0 30.537624c0 80.7786 65.48719 146.26579 146.26579 146.26579 80.777041 0 146.259556-65.48719 146.259556-146.26579l0-30.515806c12.377127-5.415577 24.587501-11.55583 36.567226-18.467509 11.97505-6.917913 23.398412-14.420242 34.277879-22.432179l26.423343 15.258682c69.959912 40.391637 159.408111 16.418162 199.799749-53.533959C994.813938 698.085085 970.848254 608.635327 900.893017 568.24369L900.893017 568.24369zM891.096666 731.474653c-20.198936 34.982294-64.923035 46.962019-99.900654 26.770875l-63.331869-36.567226 0 0 0 0-7.988562-4.611422c-18.134004 18.450366-39.024886 34.787489-62.516805 48.353705-23.49971 13.559983-48.091888 23.482568-73.129778 29.964118l0 9.222846 0 0 0 65.828489 0 7.301289c0 40.391637-32.742816 73.136012-73.136012 73.136012-40.386962 0-73.129778-32.742816-73.129778-73.136012l0-7.402588 0-65.72719 0 0 0-9.300768c-50.682014-13.090892-97.855981-39.682547-135.652816-78.232109l-7.983886 4.606747 0 0-63.331869 36.567226c-34.977618 20.191144-79.706394 8.206743-99.900654-26.770875-20.192702-34.977618-8.206743-79.701718 26.770875-99.899095l6.341291-3.657657 0 0 64.972905-37.516316c-14.487254-52.005129-13.929333-106.151555 0.073247-156.593569l-8.057133-4.650384 0 0-63.331869-36.567226c-34.982294-20.192702-46.963578-64.923035-26.770875-99.900654 20.192702-34.97606 64.923035-46.962019 99.900654-26.763083l6.324148 3.649866 0 0 64.996282 37.528784c18.132445-18.450366 39.024886-34.790606 62.516805-48.353705 23.493477-13.559983 48.085654-23.485685 73.129778-29.964118l0-9.229079L437.960093 153.739276l0-7.309082c0-40.385404 32.742816-73.129778 73.129778-73.129778 40.391637 0 73.129778 32.744375 73.129778 73.129778l0 7.404147 0 65.72719 0 9.307001c50.686689 13.086217 97.862215 39.684106 135.657491 78.232109l48.487732-27.997368 22.828023-13.176607c34.977618-20.192702 79.701718-8.212977 99.89442 26.763083 20.198936 34.982294 8.212977 79.706394-26.764641 99.900654l-30.822819 17.79738-32.50905 18.769847 0 0 0 0-7.983886 4.605189c14.488813 52.009805 13.929333 106.159347-0.077922 156.599803l64.979139 37.511641 0 0 6.414537 3.701294C899.303409 651.772936 911.289368 696.498594 891.096666 731.474653L891.096666 731.474653zM891.096666 731.474653M197.330785 324.240361c-1.932465 3.232203-3.824411 6.497135-5.649343 9.785442L197.330785 324.240361 197.330785 324.240361zM197.330785 324.240361M830.515443 690.133926l-5.655577 9.804144C826.793889 696.699632 828.685835 693.433143 830.515443 690.133926L830.515443 690.133926zM830.515443 690.133926M505.297151 146.430195l11.304921 0C512.835324 146.369416 509.067017 146.374091 505.297151 146.430195L505.297151 146.430195zM505.297151 146.430195M516.898176 877.740444l-11.31583 0C509.350653 877.796547 513.125193 877.796547 516.898176 877.740444L516.898176 877.740444zM516.898176 877.740444" fill="#272636" p-id="4948"></path></svg>'),i(this,"editSvg",'<svg t="1760920692801" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3545" width="200" height="200"><path d="M1013.929675 128.26571a143.759824 143.759824 0 0 1 10.44409 53.858738 84.576649 84.576649 0 0 1-5.836403 30.308339 92.870485 92.870485 0 0 1-18.635533 29.284408 1314.726599 1314.726599 0 0 1-24.983901 24.574329c-7.372299 7.06512-13.82306 13.311095-19.249891 18.737926-6.143582 6.143582-12.082378 11.672806-17.406817 16.382886L720.266444 82.598415c9.317766-8.601015 20.478607-18.942712 33.277737-31.02509s23.448006-21.604931 31.946628-28.67005a102.085858 102.085858 0 0 1 68.193763-22.731255c11.263234 0.307179 22.116896 2.047861 32.560985 5.222045 10.546483 3.071791 19.659463 6.655547 27.441334 10.546483 16.280493 8.601015 34.301667 23.550399 54.063524 45.052936 19.864249 21.502538 35.120812 43.82422 46.076867 67.272226z m-907.20231 570.943576l32.560986-33.38013c17.099637-17.509209 38.397389-39.216533 64.098041-64.917186l84.986221-85.395793 94.303987-94.815953 250.350976-251.477299L850.817567 389.163169 600.46659 640.640468l-93.177663 94.815953c-31.02509 30.410732-58.978389 58.364031-83.859898 83.655111-24.779115 25.29108-45.360116 46.17926-61.743001 62.562146a504.797674 504.797674 0 0 1-55.804206 50.274981c-10.239304 7.884264-20.581 14.130239-31.537055 18.737926a507.152714 507.152714 0 0 1-47.715156 19.86425 1609.311367 1609.311367 0 0 1-131.063087 42.185931c-20.478607 5.426831-35.837563 8.908194-45.974474 10.546483-20.88818 2.35504-34.813633-0.819144-41.981145-9.42016-6.860333-8.601015-8.805801-22.93604-5.73401-43.312254a396.261054 396.261054 0 0 1 11.058448-47.305584c5.836403-20.683394 12.082378-42.185931 18.635532-64.40522 6.553154-22.219289 13.003916-42.697897 19.249891-61.435822 6.143582-18.635533 11.263234-31.537055 15.15417-38.602176 4.607687-10.853662 9.829732-20.785787 15.666135-29.796373a192.49891 192.49891 0 0 1 25.086294-29.796374z" fill="#FF9500" p-id="3546"></path></svg>'),i(this,"deleteSvg",'<svg t="1760921450746" class="jhs-icon icon" viewBox="0 0 1194 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4530" width="200" height="200"><path d="M761.086847 36.028779s309.754321-147.538628 424.952209 231.50509c2.047962 6.570546 71.337359 253.862013-220.838618 415.139055-12.970429 7.167869-267.515096 145.746661-370.339877 341.327076 0 0-90.963666-205.649563-393.379455-351.566888-6.399883-3.071944-304.549083-156.583796-163.751664-487.2444 3.669266-8.533177 163.666333-336.20717 466.423449-99.411511l24.575549 27.391498L387.931021 324.279495l237.648977 159.570408-109.139333 145.746661L625.579998 849.069874l-30.719437-205.820227 166.226286-169.81022-216.486698-168.103585L761.086847 36.028779z" fill="#F4382E" p-id="4531"></path></svg>'),i(this,"checkSvg",'<svg t="1760921633527" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5603" width="200" height="200"><path d="M924.928 544A413.76 413.76 0 0 1 544 924.736v3.264h-64v-3.2A413.696 413.696 0 0 1 99.072 544H96v-64h3.072A413.696 413.696 0 0 1 480 99.2V96h64v3.2a413.76 413.76 0 0 1 380.928 380.8h3.072v64h-3.072z m-64-64A350.016 350.016 0 0 0 544 163.2V288h-64V163.2A350.016 350.016 0 0 0 163.072 480H288v64H163.072A350.016 350.016 0 0 0 480 860.8V736h64v124.8a350.016 350.016 0 0 0 316.928-316.8H736v-64h124.928zM512 544a32 32 0 1 1 32-32 32 32 0 0 1-32 32z" fill="#333333" p-id="5604"></path></svg>'),i(this,"actressSvg",'<svg t="1760926744637" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1948" width="200" height="200"><path d="M265.950168 668.467036V209.809493A209.809493 209.809493 0 0 1 475.759661 0h40.949536A209.809493 209.809493 0 0 1 726.564189 209.809493v440.435" p-id="1949"></path><path d="M916.558657 825.861124a193.463804 193.463804 0 0 0-137.442564-155.83573l-186.001889-45.795231-10.487631-124.293214H424.106373L412.231008 624.025416l-170.623063 44.44162a193.452429 193.452429 0 0 0-133.666108 154.698244L76.410695 1023.192384h871.189985z" fill="#FFE7D9" p-id="1950"></path><path d="M668.472724 265.682859c68.431223-29.187919 96.140409 100.349111 5.20969 151.774902z" fill="#FFCFB5" p-id="1951"></path><path d="M676.378259 334.421203c1.137487-99.814492-38.674561-172.158671-38.674561-172.15867l-59.740822 11.920865a493.805894 493.805894 0 0 1-80.761583 9.099896 493.669396 493.669396 0 0 1-80.761583-9.099896l-59.683948-11.88674s-39.812048 72.344179-38.776934 172.15867l-1.080613 92.05683c5.209691 56.271486 92.4777 121.381247 195.022161 119.163147 61.196805 0.034125 165.59537-51.573665 165.59537-119.197272z" fill="#FFE7D9" p-id="1952"></path><path d="M322.198905 274.703131c-68.419848-29.187919-96.140409 100.349111-5.209691 151.774902z" fill="#FFCFB5" p-id="1953"></path><path d="M297.390311 812.461526H742.034014a38.458438 38.458438 0 0 1 38.458438 38.458439V1020.325917H258.931873V850.90859a38.458438 38.458438 0 0 1 38.458438-38.447064z" fill="#FFD527" p-id="1954"></path><path d="M690.539973 92.284327c-20.645391 84.287793-275.613121 235.323328-424.589805 117.525166l104.955934-95.548915 139.399042-64.529643z" p-id="1955"></path><path d="M285.321573 383.708519h33.624119v177.118114h-33.624119zM675.855015 383.708519h33.624118v177.118114h-33.624118z" fill="#FFD527" p-id="1956"></path></svg>'),i(this,"newSvg",'<svg t="1760926857487" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3954" width="200" height="200"><path d="M508.330667 733.994667c-11.008-7.338667-13.44-17.109333-7.338667-29.333334 28.117333-37.888 41.557333-98.986667 40.341333-183.317333v-165.013333c0-14.656 7.338667-23.210667 21.994667-25.664 37.888-1.216 82.496-5.504 133.845333-12.842667 13.44-2.432 21.376 3.072 23.829334 16.512 1.216 12.224-4.266667 19.562667-16.512 21.994667a1787.093333 1787.093333 0 0 1-113.664 11.008c-6.101333 0-9.173333 3.669333-9.173334 10.986666v84.330667h135.68c12.224 1.237333 18.944 7.957333 20.16 20.181333-1.216 10.986667-7.936 17.109333-20.16 18.346667h-36.672v223.658667c-1.216 12.202667-7.936 18.944-20.16 20.16-11.008-1.216-17.109333-7.957333-18.346666-20.16V501.162667h-60.48v18.346666c1.216 92.885333-13.44 161.92-44.010667 207.146667-6.101333 12.224-15.893333 14.677333-29.333333 7.338667z m-131.989334-282.325334c-1.237333 0-2.453333 0.618667-3.669333 1.834667h45.824a522.666667 522.666667 0 0 0 16.512-31.168c7.317333-12.224 12.224-20.778667 14.656-25.664 6.122667-11.008 15.274667-14.677333 27.52-11.008 9.770667 6.122667 12.202667 14.058667 7.317333 23.829333-4.906667 9.792-13.44 24.448-25.664 44.010667h49.493334c9.770667 1.216 15.274667 6.72 16.512 16.490667-1.237333 11.008-6.741333 17.109333-16.512 18.346666h-82.496a12.437333 12.437333 0 0 1 3.669333 9.173334v38.485333h69.653333c9.792 1.216 15.296 6.72 16.512 16.490667-1.216 11.008-6.72 17.130667-16.512 18.346666h-69.653333v108.16c0 34.218667-15.274667 51.946667-45.845333 53.162667h-16.490667a195.157333 195.157333 0 0 1-20.16 1.834667c-12.224 0-19.562667-6.72-22.016-20.16 1.237333-12.224 7.338667-18.944 18.346667-20.16 2.432 0 6.101333 0.597333 10.986666 1.834666h11.008c15.893333 0 23.829333-8.554667 23.829334-25.685333v-98.986667H314.026667c-11.008-1.216-17.109333-7.338667-18.346667-18.346666 1.237333-9.770667 7.338667-15.274667 18.346667-16.490667h75.157333V497.493333c0-3.669333 1.216-6.72 3.669333-9.173333h-89.813333c-11.029333-1.216-17.130667-7.317333-18.346667-18.325333 1.216-9.770667 7.317333-15.274667 18.346667-16.490667h56.810667c-3.669333-1.216-6.72-4.266667-9.173334-9.173333-1.216-1.216-3.050667-4.266667-5.482666-9.173334a758.336 758.336 0 0 0-14.677334-23.829333c-4.885333-9.770667-3.050667-17.706667 5.504-23.829333 11.008-3.669333 19.562667-1.216 25.664 7.338666 2.453333 2.432 6.122667 7.338667 11.008 14.656 6.101333 8.554667 9.770667 14.08 10.986667 16.512 4.906667 9.770667 2.453333 18.346667-7.317333 25.664z m-60.501333-71.509333c-9.792-1.216-15.274667-7.317333-16.512-18.346667 1.237333-9.749333 6.72-15.253333 16.512-16.490666h75.157333c-3.669333-12.202667-7.338667-21.973333-10.986666-29.333334-1.237333-12.202667 3.648-19.541333 14.656-21.973333 12.224-2.453333 21.397333 1.216 27.52 10.986667 0 1.216 0.597333 3.669333 1.813333 7.338666 4.906667 15.872 9.173333 26.88 12.842667 32.981334h60.48c11.008 1.237333 17.130667 6.741333 18.346666 16.512-1.216 11.008-7.338667 17.109333-18.346666 18.346666h-181.482667z m-14.677333 311.68c-8.533333-6.122667-10.986667-14.08-7.338667-23.829333a1659.648 1659.648 0 0 0 33.002667-66.005334c4.906667-9.792 12.224-12.842667 22.016-9.173333 9.770667 4.906667 13.44 12.224 10.986666 21.994667-3.669333 6.122667-9.173333 17.728-16.490666 34.837333-8.554667 15.893333-14.677333 27.52-18.346667 34.837333-4.885333 8.554667-12.821333 11.008-23.829333 7.338667z m201.664-25.664c-9.770667 4.885333-18.346667 2.432-25.664-7.338667a1138.56 1138.56 0 0 1-27.498667-44.010666c-4.885333-8.533333-3.050667-16.490667 5.504-23.829334 9.770667-3.669333 18.346667-1.216 25.664 7.338667l14.677333 21.994667c6.101333 9.770667 10.389333 17.109333 12.821334 21.994666 4.906667 8.554667 3.050667 16.512-5.504 23.850667z" fill="#333333" p-id="3955"></path><path d="M675.328 117.717333A425.429333 425.429333 0 0 0 512 85.333333C276.352 85.333333 85.333333 276.352 85.333333 512s191.018667 426.666667 426.666667 426.666667 426.666667-191.018667 426.666667-426.666667c0-56.746667-11.093333-112-32.384-163.328a21.333333 21.333333 0 0 0-39.402667 16.341333A382.762667 382.762667 0 0 1 896 512c0 212.074667-171.925333 384-384 384S128 724.074667 128 512 299.925333 128 512 128c51.114667 0 100.8 9.984 146.986667 29.12a21.333333 21.333333 0 0 0 16.341333-39.402667z" fill="#333333" p-id="3956"></path></svg>'),i(this,"refreshSvg",'<svg t="1760926993643" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5942" width="200" height="200"><path d="M511.966722 0a511.966722 511.966722 0 1 0 179.828311 32.445891l-22.46254 59.964102A447.970882 447.970882 0 1 1 511.966722 63.99584a31.99792 31.99792 0 0 0 0-63.99584z" fill="#333333" p-id="5943"></path><path d="M649.2378 9.151405A30.909991 30.909991 0 0 1 671.316364 0h193.267438a31.99792 31.99792 0 0 1 31.357962 31.99792c0 17.662852-13.759106 31.99792-31.357962 31.99792H703.954243v160.629559a31.99792 31.99792 0 0 1-31.99792 31.357962 31.485953 31.485953 0 0 1-31.99792-31.357962V31.357962c0-8.511447 3.647763-16.318939 9.343392-21.950573z" fill="#333333" p-id="5944"></path></svg>'),i(this,"blacklistSvg",'<svg t="1761386375897" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1936" width="200" height="200"><path d="M513.199827 65.667605c-246.537999 0-446.399933 199.861934-446.399933 446.399933 0 246.553349 199.861934 446.399933 446.399933 446.399933 246.553349 0 446.399933-199.846584 446.399933-446.399933C959.599759 265.529539 759.753175 65.667605 513.199827 65.667605zM513.199827 894.697075c-211.320916 0-382.629537-171.322947-382.629537-382.628514 0-94.183056 34.029024-180.417069 90.461291-247.080352l165.389818 165.389818c4.320399 39.651069 26.816762 73.840752 58.981323 94.068446-72.189136 27.369348-123.517151 97.156784-123.517151 178.936345l337.541643 0 100.846826 100.846826C693.608709 860.664981 607.375719 894.697075 513.199827 894.697075zM805.362956 759.14175 697.264982 651.0448c-16.556071-58.332547-60.10082-105.306394-116.275213-126.601396 35.888372-22.570042 59.752896-62.511729 59.752896-108.032482 0-70.436212-57.108672-127.542838-127.542838-127.542838-48.218188 0-90.184999 26.765597-111.865787 66.245773L266.120498 219.900316c66.663282-56.432267 152.897296-90.461291 247.079328-90.461291 211.304544 0 382.628514 171.308621 382.628514 382.629537C895.82834 606.244454 861.796246 692.476421 805.362956 759.14175z" fill="#272636" p-id="1937"></path></svg>'),i(this,"copySvg",'<svg t="1749017229420" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9184" width="200" height="200"><path d="M512 74.666667C270.933333 74.666667 74.666667 270.933333 74.666667 512S270.933333 949.333333 512 949.333333 949.333333 753.066667 949.333333 512 753.066667 74.666667 512 74.666667z m0 810.666666c-204.8 0-373.333333-168.533333-373.333333-373.333333S307.2 138.666667 512 138.666667 885.333333 307.2 885.333333 512 716.8 885.333333 512 885.333333z" fill="#666666" p-id="9185"></path><path d="M512 512m-42.666667 0a42.666667 42.666667 0 1 0 85.333334 0 42.666667 42.666667 0 1 0-85.333334 0Z" fill="#666666" p-id="9186"></path><path d="M341.333333 512m-42.666666 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z" fill="#666666" p-id="9187"></path><path d="M682.666667 512m-42.666667 0a42.666667 42.666667 0 1 0 85.333333 0 42.666667 42.666667 0 1 0-85.333333 0Z" fill="#666666" p-id="9188"></path></svg>'),i(this,"titleSvg",'<svg t="1747553289744" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7507" width="200" height="200"><path d="M959.8 150.8c0-2.3-1.9-4.2-4.2-4.2H253.3c-2.3 0-4.2 1.9-4.2 4.2v115.9c0 2.3 1.9 4.2 4.2 4.2h702.3c2.3 0 4.2-1.9 4.2-4.2V150.8z" fill="" p-id="7508"></path><path d="M126.4 208.8m-62.2 0a62.2 62.2 0 1 0 124.4 0 62.2 62.2 0 1 0-124.4 0Z" fill="" p-id="7509"></path><path d="M851.5 453.7c0-2.1-1.8-3.9-3.9-3.9H252.9c-2.1 0-3.9 1.7-3.9 3.9v116.6c0 2.1 1.7 3.9 3.9 3.9h594.7c2.1 0 3.9-1.7 3.9-3.9V453.7z" fill="" p-id="7510"></path><path d="M126.4 512m-62.2 0a62.2 62.2 0 1 0 124.4 0 62.2 62.2 0 1 0-124.4 0Z" fill="" p-id="7511"></path><path d="M851.5 756.9c0-2.1-1.8-3.9-3.9-3.9H252.9c-2.1 0-3.9 1.8-3.9 3.9v116.6c0 2.1 1.7 3.9 3.9 3.9h594.7c2.1 0 3.9-1.7 3.9-3.9V756.9z" fill="" p-id="7512"></path><path d="M126.4 815.2m-62.2 0a62.2 62.2 0 1 0 124.4 0 62.2 62.2 0 1 0-124.4 0Z" fill="" p-id="7513"></path></svg>'),i(this,"carNumSvg",'<svg t="1747552574854" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="3539" width="200" height="200"><path d="M920.337035 447.804932c-6.067182-6.067182-10.918677-11.643178-16.985859-17.71036l48.536436-30.334889-42.469254-109.207238-121.340579 12.134365c-6.067182-6.067182-6.067182-12.134365-12.134365-18.201547-12.134365-12.134365-18.201547-24.267706-24.267706-30.334889-24.26873-36.402071-30.334889-42.469254-54.603619-42.469254H339.116511c-18.201547 0-24.267706 6.067182-54.603619 42.469254-6.067182 6.067182-12.134365 18.201547-24.267706 30.334889 0 0-6.067182 6.067182-12.134365 18.201547l-115.27442-12.134365-48.536436 109.207238 51.090608 24.378223c-6.067182 6.067182-30.334889 34.660404-30.334889 34.660405l-15.542998 22.280446-12.282744 17.018605c-6.067182 12.134365-5.064342 10.868535-5.064342 29.070082v224.480635c0 36.402071 18.201547 60.670801 54.603618 60.670801h115.273397c36.402071 0 54.603619-24.267706 54.603619-54.603619v-18.201547h424.693562v18.201547c0 30.334889 18.201547 54.603619 54.603618 54.603619h115.273397c36.402071 0 60.670801-24.267706 60.670801-60.670801V539.300786c0-42.469254 0.685615-46.662763-11.44875-64.863287-4.731768-6.744611-11.94403-16.196891-20.101827-26.632567z m-35.186383-78.381161l-30.334889 18.201547-12.134365-12.134365c-6.067182-8.899694-12.134365-12.134365-12.134365-18.201547l42.469254-6.067183 12.134365 18.201548z m-533.899776-97.072873h339.755054l78.871325 103.140055H272.378527l78.872349-103.140055zM175.305655 357.290429h36.402071c-6.067182 6.067182-6.067182 12.134365-12.134365 18.201547l-18.201547 6.067183-18.201547-12.134365 12.135388-12.134365z m667.375743 394.35765h-54.603619V678.843936H242.043638v72.804143H132.837424V527.167444c0-12.134365-0.041956-20.662599 1.216711-23.556508 1.258667-2.89391 9.955746-16.924461 21.193695-29.173437l35.722596-38.276768h639.576607l21.917172 20.938891c6.067182 6.067182 21.847587 21.366633 25.712615 28.732392 7.621585 9.996678 6.973832 10.999518 13.041014 23.133883v242.682182h-48.536436zM242.043638 533.234627h133.474944v60.670801H242.043638v-60.670801z m412.559197 0h133.474944v60.670801H654.602835v-60.670801z" p-id="3540"></path></svg>'),i(this,"downSvg",'<svg t="1747552626242" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="4551" width="200" height="200"><path d="M641.6 660l-8.64-64 32-4.32a211.2 211.2 0 0 0-26.72-420.32 215.36 215.36 0 0 0-213.12 192 94.56 94.56 0 0 0 0 11.52v41.28h-64V384v-7.04a153.12 153.12 0 0 1 0-19.52A279.84 279.84 0 0 1 636.16 108H640A275.2 275.2 0 0 1 673.28 656z" fill="#333333" p-id="4552"></path><path d="M490.4 446.24l-7.52-39.84a182.4 182.4 0 0 1 107.52-162.88l29.12-13.28L646.08 288l-29.12 13.28a117.92 117.92 0 0 0-70.08 101.28l6.24 30.4zM392.96 652.32h-78.72A202.24 202.24 0 0 1 256 256l30.72-9.12 18.24 61.28-30.72 9.12a138.24 138.24 0 0 0 39.68 270.72h78.72zM479.2 512h64v320h-64z" fill="#333333" p-id="4553"></path><path d="M510.4 908l-156.32-147.68 43.84-46.4 112.48 106.08 112.8-106.08 43.84 46.56-156.64 147.52z" fill="#333333" p-id="4554"></path></svg>'),i(this,"handleSvg",'<svg t="1749106236917" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2628" width="200" height="200"><path d="M838 989.48a32 32 0 0 1-22.5-9.22L519.3 687.6 207.48 980.8a32 32 0 0 1-54-23.32V136.52A98.54 98.54 0 0 1 252 38.1h519.6A98.52 98.52 0 0 1 870 136.52v820.96a32 32 0 0 1-32 32zM252 102.1a34.46 34.46 0 0 0-34.42 34.42v746.96L498 619.84a32 32 0 0 1 44.42 0.56L806 880.88V136.52a34.46 34.46 0 0 0-34.4-34.42z" p-id="2629"></path><path d="M648 604.92a28 28 0 0 1-16.46-5.34l-112.84-82-112.84 82a28 28 0 0 1-43.08-31.32l43.1-132.64-112.84-82a28 28 0 0 1 16.46-50.66h139.48L492 170.34a28 28 0 0 1 53.26 0l43.1 132.64h139.48a28 28 0 0 1 16.46 50.66l-112.84 82 43.1 132.64A28 28 0 0 1 648 604.92z m-129.3-150a27.86 27.86 0 0 1 16.46 5.36l59.58 43.28-22.76-70a28 28 0 0 1 10.02-31.28l59.58-43.3H568a28 28 0 0 1-26.64-19.34l-22.76-70-22.76 70a28 28 0 0 1-26.62 19.34h-73.64l59.58 43.3a28 28 0 0 1 10.16 31.3l-22.76 70 59.58-43.28a28 28 0 0 1 16.46-5.32z" p-id="2630"></path></svg>'),i(this,"siteSvg",'<svg t="1749107903569" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="12439" width="200" height="200"><path d="M882.758621 133.674884C882.758621 59.84828 822.91034 0 749.083736 0 675.25715 0 615.40887 59.84828 615.40887 133.674884 615.40887 163.358402 625.152318 191.656395 642.813352 214.773283L670.872117 193.336726 648.314739 166.170836 253.911693 493.666092 276.469054 520.831982 302.371681 496.834595C277.256669 469.725608 241.995388 453.990153 204.295574 453.990153 130.46897 453.990153 70.62069 513.838433 70.62069 587.66502 70.62069 661.491624 130.46897 721.339904 204.295574 721.339904 255.555319 721.339904 301.619094 692.208675 324.036714 647.136344L276.646223 663.002394 706.082022 877.440106 721.856794 845.849335 690.37312 829.861888C680.932829 848.452414 675.940882 869.068818 675.940882 890.325116 675.940882 964.15172 735.789162 1024 809.615766 1024 883.442353 1024 943.290633 964.15172 943.290633 890.325116 943.290633 874.050807 940.36533 858.125365 934.723584 843.16446L868.645076 868.0826C871.294817 875.109252 872.669943 882.595452 872.669943 890.325116 872.669943 925.14899 844.439623 953.37931 809.615766 953.37931 774.791892 953.37931 746.561571 925.14899 746.561571 890.325116 746.561571 880.245089 748.902894 870.575616 753.340487 861.836782L769.436089 830.140063 737.631567 814.258564 308.195769 599.820853 276.554929 584.02108 260.805279 615.686903C250.212352 636.984797 228.494795 650.719214 204.295574 650.719214 169.4717 650.719214 141.241379 622.488894 141.241379 587.66502 141.241379 552.841163 169.4717 524.610842 204.295574 524.610842 222.12269 524.610842 238.680594 531.99985 250.566444 544.829369L273.29589 569.363385 299.026432 547.997855 693.429478 220.502616 719.514606 198.84265 698.930882 171.900169C690.596687 160.991373 686.029559 147.727007 686.029559 133.674884 686.029559 98.85101 714.25988 70.62069 749.083736 70.62069 783.90761 70.62069 812.137931 98.85101 812.137931 133.674884 812.137931 148.208022 807.249885 161.899255 798.379608 172.996785L853.543883 217.089695C872.331935 193.584128 882.758621 164.379366 882.758621 133.674884ZM749.083736 196.729062C729.149334 196.729062 710.818745 187.460449 698.930882 171.900169L642.813352 214.773283C667.922573 247.639305 706.904064 267.349751 749.083736 267.349751 790.225902 267.349751 828.357809 248.599782 853.543883 217.089695L798.379608 172.996785C786.455411 187.915034 768.530291 196.729062 749.083736 196.729062ZM337.970441 587.66502C337.970441 553.551854 325.093782 521.360666 302.371681 496.834595L250.566444 544.829369C261.309069 556.424898 267.349751 571.526356 267.349751 587.66502 267.349751 597.565263 265.091478 607.069184 260.805279 615.686903L324.036714 647.136344C333.156105 628.801148 337.970441 608.540036 337.970441 587.66502ZM809.615766 756.650249C758.753986 756.650249 712.986006 785.330865 690.37312 829.861888L753.340487 861.836782C764.027215 840.791658 785.603302 827.270938 809.615766 827.270938 836.08553 827.270938 859.461862 843.730308 868.645076 868.0826L934.723584 843.16446C915.252259 791.529949 865.714547 756.650249 809.615766 756.650249Z" fill="#389BFF" p-id="12440"></path></svg>'),i(this,"videoSvg",'<svg t="1749003664455" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1952" width="200" height="200"><path d="M825.6 153.6H198.4C124.5 153.6 64 214.1 64 288v448c0 73.9 60.5 134.4 134.4 134.4h627.2c73.9 0 134.4-60.5 134.4-134.4V288c0-73.9-60.5-134.4-134.4-134.4z m-138.2 44.8l112 112H706l-112-112h93.4z m-156.8 0l112 112H526.7l-112-112h115.9z m-179.2 0l112 112H347.5l-112-112h115.9zM108.8 288c0-41.4 28.4-76.1 66.7-86.3l108.7 108.7H108.8V288z m806.4 448c0 49.4-40.2 89.6-89.6 89.6H198.4c-49.4 0-89.6-40.2-89.6-89.6V355.2h806.4V736z m0-425.6h-52.5l-112-112h74.9c49.4 0 89.6 40.2 89.6 89.6v22.4z" p-id="1953"></path><path d="M454 687.2l149.3-77.6c27.5-13.8 27.5-53 0-66.8L468 472.2c-31.2-15.6-68 7.1-68 42v139.6c0 27.8 29.2 45.8 54 33.4zM444.8 512l134.4 67.2-134.4 67.2V512z" p-id="1954"></path></svg>'),i(this,"screenSvg",'<svg t="1750691468062" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2693" width="200" height="200"><path d="M288 160a64 64 0 0 0-64 64v576a64 64 0 0 0 64 64h448a64 64 0 0 0 64-64v-576a64 64 0 0 0-64-64h-448m0-64h448a128 128 0 0 1 128 128v576a128 128 0 0 1-128 128h-448a128 128 0 0 1-128-128v-576a128 128 0 0 1 128-128z" fill="#4078FD" p-id="2694"></path><path d="M416 352m-64 0a64 64 0 1 0 128 0 64 64 0 1 0-128 0Z" fill="#FE9C23" p-id="2695"></path><path d="M352 732.448a32 32 0 0 1-32-32v-160a32 32 0 0 1 44.224-29.568l130.112 53.632 153.952-169.984a32 32 0 0 1 55.712 21.472v284.448a32 32 0 0 1-32 32z m0-32h320z" fill="#4078FD" opacity=".2" p-id="2696"></path><path d="M672 416l-169.088 186.656-150.912-62.208v160h320V416m0-32a32 32 0 0 1 32 32v284.448a32 32 0 0 1-32 32h-320a32 32 0 0 1-32-32v-160a32 32 0 0 1 44.192-29.6l130.112 53.632 153.984-169.984a32 32 0 0 1 23.712-10.496z" fill="#4078FD" p-id="2697"></path></svg>'),i(this,"recoveryVideoSvg",'<svg t="1749003779161" class="jhs-icon icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="8204" width="200" height="200"><path d="M938.666667 553.92V768c0 64.8-52.533333 117.333333-117.333334 117.333333H202.666667c-64.8 0-117.333333-52.533333-117.333334-117.333333V256c0-64.8 52.533333-117.333333 117.333334-117.333333h618.666666c64.8 0 117.333333 52.533333 117.333334 117.333333v297.92z m-64-74.624V256a53.333333 53.333333 0 0 0-53.333334-53.333333H202.666667a53.333333 53.333333 0 0 0-53.333334 53.333333v344.48A290.090667 290.090667 0 0 1 192 597.333333a286.88 286.88 0 0 1 183.296 65.845334C427.029333 528.384 556.906667 437.333333 704 437.333333c65.706667 0 126.997333 16.778667 170.666667 41.962667z m0 82.24c-5.333333-8.32-21.130667-21.653333-43.648-32.917333C796.768 511.488 753.045333 501.333333 704 501.333333c-121.770667 0-229.130667 76.266667-270.432 188.693334-2.730667 7.445333-7.402667 20.32-13.994667 38.581333-7.68 21.301333-34.453333 28.106667-51.370666 13.056-16.437333-14.634667-28.554667-25.066667-36.138667-31.146667A222.890667 222.890667 0 0 0 192 661.333333c-14.464 0-28.725333 1.365333-42.666667 4.053334V768a53.333333 53.333333 0 0 0 53.333334 53.333333h618.666666a53.333333 53.333333 0 0 0 53.333334-53.333333V561.525333zM320 480a96 96 0 1 1 0-192 96 96 0 0 1 0 192z m0-64a32 32 0 1 0 0-64 32 32 0 0 0 0 64z" fill="#000000" p-id="8205"></path></svg>');const mt=["settingSvg","editSvg","deleteSvg","checkSvg","actressSvg","newSvg","refreshSvg","blacklistSvg","copySvg","titleSvg","carNumSvg","downSvg","handleSvg","siteSvg","videoSvg","screenSvg","recoveryVideoSvg"];X._sharedIcons=Object.fromEntries(mt.map((bt=>[bt,this[bt]]))),Object.assign(X.prototype,X._sharedIcons),mt.forEach((bt=>delete this[bt]))}i(this,"pluginManager",null)}getName(){throw new Error(`${this.constructor.name} 未显示getName()`)}getBean(mt){return this.pluginManager.getBean(mt)}async initCss(){return""}async handle(){}getStartupMode(){return"immediate"}shouldSkipOnMobile(){return!1}getPageInfo(){let mt=null,bt,wt,yt,jt,xt=window.location.href;if(r){const $t=new URL(xt).searchParams,kt=normalizeCarNum($t.get("jhsCarNum")),_t=normalizeCarNum($('.column-video-info a[data-clipboard-text][title*="番"], .video-detail a[data-clipboard-text][title*="番"]').first().attr("data-clipboard-text"))||normalizeCarNum($('a[title="複製番號"]').attr("data-clipboard-text"));let St=null;$(".column-video-info .panel-block, .video-detail .panel-block").each((function(){const It=$(this).find("strong, .label").first().text().trim();St||!/(?:番号|番號|^ID)\s*[::]?/i.test(It)||(St=normalizeCarNum($(this).find("[data-clipboard-text]").first().attr("data-clipboard-text"))||normalizeCarNum($(this).find(".value").first().text()))}));const Tt=normalizeCarNum($("#video_id, .video-id, .video-title strong").first().text());mt=firstValidCarNum(kt,_t,St,Tt),bt=xt.split("?")[0].split("#")[0],wt=$(".female").prev().map(((It,Bt)=>$(Bt).text())).get().join(" "),yt=$(".male").prev().map(((It,Bt)=>$(Bt).text())).get().join(" "),jt=$('strong:contains("日期:")').parent(".panel-block").find(".value").text().trim()}return l&&(bt=xt.split("?")[0],mt=normalizeCarNum(bt.split("/").filter(Boolean).pop().replace(/_\d{4}-\d{2}-\d{2}$/,"")),wt=$('span[onmouseover*="star_"] a').map((($t,kt)=>$(kt).text())).get().join(" "),yt="",jt=$('span.header:contains("發行日期:")').parent("p").text().trim().replace("發行日期:","").trim()),assertPageInfoContract({carNum:mt,url:bt,actress:wt,actors:yt,publishTime:jt})}getActressId(){const mt=o.match(/\/actors\/([^/?]+)/);return mt&&mt.length>1?mt[1]:null}getActressPageInfo(){let mt=window.location.href;if(!mt.includes("/actors/")&&!mt.includes("/star/"))throw new Error("接口调用错误, 非演员详情页");let bt=[],wt=r?$(".actor-section-name"):$(".avatar-box .photo-info .pb10");wt.length&&wt.text().trim().split(",").forEach((St=>{bt.push(St.trim())}));let yt=$(".section-meta:not(:contains('影片'))");yt.length&&yt.text().trim().split(",").forEach((St=>{bt.push(St.trim())}));let jt=$(".section-meta:contains('男優')").length>0?B:P,xt=D;bt.some((St=>St.includes("無碼")))&&(xt=A),mt.includes("uncensored")&&(xt=A);let $t=null,kt=null;const _t=new URL(mt);if(r){kt=_t.pathname.split("/").filter((Tt=>Tt.trim()!=="")).pop();const St=_t.searchParams;St.delete("sort_type"),St.delete("page"),$t=_t.toString()}else if(l){const St="/star/",Tt=mt.split(St);if(Tt.length<2)throw new Error("提取演员url失败");const It=Tt[0];kt=Tt[1].split("/")[0],$t=It+St+kt}return{starId:kt,name:bt[0],allName:bt,role:jt,movieType:xt,blacklistUrl:$t}}getSelector(mt){const bt=mt||(r?T:l?I:null),wt={javdb:{boxSelector:".movie-list",itemSelector:".movie-list .item",coverImgSelector:".cover img",requestDomItemSelector:".movie-list .item",nextPageSelector:".pagination-next"},javbus:{boxSelector:".masonry",itemSelector:".masonry .item",coverImgSelector:".masonry .movie-box .photo-frame img",requestDomItemSelector:"#waterfall .item",nextPageSelector:"#next"}};if(!bt||!wt[bt])throw new Error("类型错误: 无法确定选择器类型 (JavDb 或 JavBus)");return wt[bt]}parseMovieId(mt){return mt.split("/").pop().split(/[?#]/)[0]}getBoxCarInfo(mt){var bt,wt,yt;const jt=mt.find("a"),xt=jt.attr("href");let $t=null,kt=null,_t=null;const St=mt.find(".video-title");if(St.length>0){const Tt=St.find("strong");if(Tt.length>0&&($t=Tt.text().trim()),kt=(bt=jt.attr("title"))==null?void 0:bt.trim(),!kt){const It=St.text().trim();kt=$t&&It.includes($t)?It.replace($t,"").trim():It}_t=mt.find(".meta").text().trim()}if(!$t){const Tt=mt.find("img");Tt.length>0&&(kt=((wt=Tt.attr("title"))==null?void 0:wt.trim())||((yt=Tt.attr("data-title"))==null?void 0:yt.trim()));const It=mt.find("date").map(((Pt,Mt)=>$(Mt).text().trim())).get(),Bt=Pt=>/^\d{4}-\d{1,2}-\d{1,2}$/.test(Pt);_t=It.find(Bt)||null,$t=It.find((Pt=>!Bt(Pt)))||null}if(!$t){const Tt="提取番号信息失败: carNum 为空";throw console.error("Error in getBoxCarInfo:",Tt,"Box Element:",mt.get(0)),show.error(Tt),new Error(Tt)}return{carNum:$t,url:xt||"",title:kt||"",publishTime:_t||""}}getBoxCarInfoList(mt=null){if(mt||(mt=$(this.getSelector().itemSelector)),mt.length===0)return clog.error("获取当前列表页所有item的番号信息失败!"),[];const bt=[];return mt.each(((wt,yt)=>{const jt=$(yt);try{const xt=this.getBoxCarInfo(jt);bt.push(xt)}catch(xt){clog.error("[getBoxCarInfoList] 提取单个 boxCar 信息失败:",xt.message,"元素索引:",wt)}})),bt}checkDuplicateCarNumbers(mt,bt){if(!mt||mt.length===0||!bt||bt.length===0)return!1;const wt=new Set(mt.map((jt=>jt.carNum)).filter((jt=>jt)));if(wt.size===0)return!1;let yt=0;for(let jt=0;jt<bt.length;jt++){const xt=bt[jt]?bt[jt].carNum:null;if(xt&&wt.has(xt)){if(yt++,yt>=2)return clog.warn("警告: 检测到连续番号信息重复, 该类别可能已被限制页码。"),!0}else yt=0}return!1}}class Q extends X{getName(){return"DetailPagePlugin"}constructor(){super()}handle(){window.isDetailPage&&$(".video-meta-panel a").each((function(){const mt=$(this).attr("href");mt&&(mt.startsWith("http://")||mt.startsWith("https://")||mt.startsWith("/"))&&$(this).attr("target","_blank")}))}}const Z=(Ct,mt)=>{if(!Ct||Ct.length===0)return null;const bt=new Set(Ct);if(bt.has(mt))return mt;const wt=L.map((yt=>yt.quality)).reverse();for(const yt of wt)if(bt.has(yt))return yt;return Ct[0]},ee="jhs_dmm_video";class te{constructor(mt,bt=!0){this.carNum=mt,this.showErrorMessages=bt}_checkCache(){const mt=localStorage.getItem(ee)?JSON.parse(localStorage.getItem(ee)):{};return mt[this.carNum]?(clog.debug("缓存中存在预览视频信息",mt[this.carNum]),mt[this.carNum]):null}_updateCache(mt){const bt=localStorage.getItem(ee)?JSON.parse(localStorage.getItem(ee)):{};bt[this.carNum]=mt,clog.debug("成功解析出预览视频并已缓存:",mt),localStorage.setItem(ee,JSON.stringify(bt))}async _searchContentIds(){const mt=this.carNum,bt=mt.replace(/-/g,""),wt=[{keyword:mt.replace("-","00"),name:"00-替换关键词"},{keyword:mt,name:"原始番号关键词"},{keyword:bt,name:"无连字符关键词"}],yt=mt.toLowerCase();for(const xt of wt){const{keyword:$t,name:kt}=xt,_t=$t.toLowerCase();clog.debug(`--- 尝试使用 ${kt} (${$t}) 进行 API 搜索 ---`);const St=`https://api.dmm.com/affiliate/v3/ItemList?${new URLSearchParams({api_id:"UrwskPfkqQ0DuVry2gYL",affiliate_id:"10278-996",output:"json",site:"FANZA",sort:"match",keyword:$t}).toString()}`;let Tt;try{Tt=await gmHttp.get(St)}catch(Bt){clog.error(`API 请求失败,跳过 ${kt}:`,Bt);continue}if(!Tt||!Tt.result||!Tt.result.result_count){clog.debug("API 返回无结果,尝试下一个关键词。");continue}const It=[];for(const Bt of Tt.result.items){if(It.length>=2)break;const Pt=Bt.content_id||"",Mt=Bt.maker_product||"";(Pt.includes(_t.replace("-",""))||yt===Mt.toLowerCase()||Pt.includes(bt.toLowerCase()))&&(It.push({serviceCode:Bt.service_code,floorCode:Bt.floor_code,contentId:Pt,pageUrl:Bt.URL}),clog.debug(`[${kt}] cid|makerProduct 匹配成功:`,Pt,Mt))}if(It.length>0){clog.debug(`--- 成功通过 ${kt} 找到 Content IDs ---`);const Bt=$("#fanzaBtn");let Pt=`https://www.dmm.co.jp/search/=/searchstr=${$t}`,Mt="single";It.length>1?(Bt.attr("href",Pt),Bt.append('<span class="site-tag jhs-layout-294497f1">多结果</span>'),Bt.css("backgroundColor","var(--jhs-status-down)"),Mt="multiple"):(Pt=It[0].pageUrl,Bt.attr("href",Pt),Bt.css("backgroundColor","var(--jhs-status-down)"));const At="jhs_other_site_dmm",Nt=localStorage.getItem(At)?JSON.parse(localStorage.getItem(At)):{};return Nt[this.carNum]={type:Mt,url:Pt},localStorage.setItem(At,JSON.stringify(Nt)),It}clog.debug(`[${kt}] API 返回结果数 ${Tt.result.result_count},但无精确匹配的 Content ID。`)}clog.warn("所有关键词尝试均未找到匹配的Content ID, 解析Dmm视频失败");const jt=$("#fanzaBtn");return jt.attr("href",`https://www.dmm.co.jp/search/=/searchstr=${this.carNum}`),jt.attr("title","未查询到, 点击前往搜索页"),jt.css("backgroundColor","var(--jhs-status-filter)"),null}async _extractTrailerLinks({contentId:mt,serviceCode:bt,floorCode:wt}){const yt=`https://www.dmm.co.jp/service/digitalapi/-/html5_player/=/cid=${mt}/mtype=AhRVShI_/service=${bt}/floor=${wt}/mode=/`,jt=await gmHttp.get(yt,null,{"accept-language":"ja-JP,ja;q=0.9",Cookie:"age_check_done=1"});if(typeof jt!="string")throw clog.error(jt),new Error("解析播放页内容失败, 非文本内容");if(jt.includes("このサービスはお住まいの地域からは"))throw new Error("节点不可用,请将DMM域名分流到日本ip");const xt=jt.match(/const\s+args\s+=\s+(.*);/);if(!xt)throw new Error("未在脚本中找到 const args = ... 变量");let $t;try{({bitrates:$t}=JSON.parse(xt[1]))}catch(Tt){throw new Error(`解析播放器脚本 JSON 失败: ${Tt.message}`)}const kt={},_t=L.map((Tt=>Tt.quality)).join("|"),St=new RegExp(`(${_t})\\.mp4$`);if(!Array.isArray($t))throw clog.error("解析画质链接失败: bitrates 字段不是一个数组或不存在"),new Error("解析画质链接失败: bitrates 字段不是一个数组或不存在");clog.debug("原始数据返回:",$t);for(const Tt of $t){const It=Tt?.src;if(!It||typeof It!="string"||!It.endsWith(".mp4"))continue;const Bt=It.match(St);let Pt="";Bt&&Bt[1]&&(Pt=Bt[1]),Pt&&!kt[Pt]&&(kt[Pt]=It)}if(Object.keys(kt).length===0)throw new Error("未找到匹配要求的预览画质视频");return kt}async fetchVideo(){const mt=normalizeCarNum(this.carNum);if(!mt)return clog.warn("跳过 DMM 解析:番号不可用"),null;this.carNum=mt;const bt=this._checkCache();if(bt)return bt;let wt;try{const yt=this.carNum.toLowerCase();if(yt.startsWith("heyzo")||/^(n\d+|\d+(-\d+)*)$/.test(yt)||/^n\d+$/.test(yt))throw new Error("无码番号类型, 取消dmm解析");if(this.carNum.includes("VR-"))throw new Error("VR类型, 取消dmm解析");wt=await this._searchContentIds()}catch(yt){clog.error("DMM API 搜索失败:",yt);const jt=$("#fanzaBtn");return jt.attr("href",`https://www.dmm.co.jp/search/=/searchstr=${this.carNum}`),jt.attr("title","未查询到, 点击前往搜索页"),jt.css("backgroundColor","var(--jhs-status-filter)"),null}if(!wt||wt.length===0)return null;try{const yt=await Promise.any(wt.map((jt=>this._extractTrailerLinks(jt))));return this._updateCache(yt),yt}catch(yt){const jt=yt.errors||[yt];if(jt.some(($t=>$t.message.includes("节点不可用"))))this.showErrorMessages&&show.error("节点不可用,请将DMM域名分流到日本ip");else{const $t=jt[0].message||jt[0];clog.error(`解析失败: ${$t}`,jt),this.showErrorMessages&&show.error(`解析失败: ${$t}`)}const xt=$("#fanzaBtn");return xt.attr("href",`https://www.dmm.co.jp/search/=/searchstr=${this.carNum}`),xt.attr("title","未查询到, 点击前往搜索页"),xt.css("backgroundColor","var(--jhs-status-filter)"),null}}}const ne=async(Ct,mt=!0)=>new te(Ct,mt).fetchVideo();class ae extends X{getName(){return"PreviewVideoPlugin"}async initCss(){return` .video-control-btn { min-width:120px; padding: 7px 12px; font-size: 12px; background: rgba(0,0,0,0.7); color: white; border: none; border-radius: 4px; cursor: pointer; } .video-control-btn.active { background-color: var(--jhs-accent); color: var(--jhs-accent-text-on); font-weight: bold; border: 2px solid var(--jhs-accent); } `}async handle(){if(!isDetailPage)return;let mt=await storageManager.getSetting(),bt=$(".preview-video-container");bt.on("click",(yt=>{utils.loopDetector((()=>$(".fancybox-content #preview-video").length>0),(()=>{this.handleVideo().then()}))})),await storageManager.getSetting("enableLoadPreviewVideo",_)!==_||o.includes("autoPlay=1")||this.initDmm().then();let wt=window.location.href;(wt.includes("gallery-1")||wt.includes("gallery-2"))&&utils.loopDetector((()=>$(".fancybox-content #preview-video").length>0),(()=>{$(".fancybox-content #preview-video").length>0&&this.handleVideo().then()})),wt.includes("autoPlay=1")&&bt.length>0&&bt[0].click()}async initDmm(){try{const mt=await ne(this.getPageInfo().carNum,!1);if(!mt)return;let bt=await storageManager.getSetting("videoQuality");clog.debug("解析其它画质预览视频","设置-期望画质",bt);const wt=mt[Z(Object.keys(mt),bt)];clog.log("切换其它画质预览视频: ",wt);const yt=$("#preview-video"),jt=yt.length?yt[0]:null,xt=!jt||utils.isHidden(yt);if(yt.length){if(jt){const $t=jt.currentTime;yt.attr("src",wt),xt||(clog.debug("播放器已手动打开, 变更进度条"),jt.currentTime=$t,jt.play())}}else{clog.debug("JavDB没有视频播放元素, 开始创建...");const $t=$(".column-video-cover img").attr("src");$(".preview-images").prepend(` <a class="preview-video-container" data-fancybox="gallery" href="#preview-video"> <span>預告片</span> <img src="${$t}" class="video-cover jhs-layout-8cf76fd7" alt=""> </a> `),$(".preview-video-container").on("click",(kt=>{utils.loopDetector((()=>$(".fancybox-content #preview-video").length>0),(async()=>{await this.handleVideo()}))}))}}catch(mt){clog.error("预加载dmm失败:",mt)}}async handleVideo(){if(await storageManager.getSetting("enableLoadPreviewVideo",_)===C)return;const mt=$("#preview-video");if(!mt.length)return;const bt=mt.parent();bt.css("position","relative");const wt=mt[0],yt=localStorage.getItem("jhs_videoMuted");yt&&(wt.muted=yt==="yes"),wt.addEventListener("volumechange",(function(){localStorage.setItem("jhs_videoMuted",wt.muted?"yes":"no")})),wt.play();let jt=this.getPageInfo().carNum;const xt=await ne(jt);let $t=$("<div></div>").attr("id","video-bottom-toolbar").css({display:"flex",gap:"5px","align-items":"center","flex-wrap":"wrap"}),kt=$("<div></div>").css({display:"flex",gap:"5px","align-items":"center"}),_t=null;if(xt){let Pt=await storageManager.getSetting("videoQuality");_t=Z(Object.keys(xt),Pt);let Mt=xt[_t];mt.attr("src")!==Mt&&(mt.attr("src",Mt),wt.load(),wt.play()),L.forEach((At=>{let Nt=xt[At.quality];if(Nt){const Dt=_t===At.quality;let Lt=$(` <button class="jhs-btn video-control-btn${Dt?" active":""}" id="${At.id}" data-quality="${At.quality}" data-video-src="${Nt}"> ${At.text} </button> `);kt.append(Lt)}}))}$t.append(kt);let St=$("<div></div>").css({display:"flex",gap:"5px","align-items":"center","margin-left":"auto"}),Tt=$('<button type="button" class="jhs-btn jhs-btn--filter jhs-layout-3f0d74e1" id="video-filterBtn">屏蔽</button>');St.append(Tt);let It=$('<button type="button" class="jhs-btn jhs-btn--fav jhs-layout-2afc43dc" id="video-favoriteBtn">收藏</button>');St.append(It);let Bt=$('<button type="button" class="jhs-btn jhs-btn--down jhs-layout-5c319329" id="speed-btn">快进</button>');St.append(Bt),$t.append(St),bt.append($t),$t.on("click",".video-control-btn",(async Pt=>{const Mt=$(Pt.currentTarget),At=Mt.data("video-src");if(!Mt.hasClass("active"))try{const Nt=wt.currentTime;mt.attr("src",At),wt.load(),wt.currentTime=Nt,await wt.play(),$t.find(".video-control-btn").removeClass("active").css({"background-color":"var(--jhs-surface)",color:"var(--jhs-text)"}),Mt.addClass("active").css({"background-color":"var(--jhs-accent)",color:"var(--jhs-accent-text-on)"})}catch(Nt){console.error("切换画质失败:",Nt)}})),$("#speed-btn").on("click",(()=>{this.getBean("DetailPageButtonPlugin").speedVideo()})),utils.rightClick(document.body,"#speed-btn",(Pt=>{this.getBean("DetailPageButtonPlugin").filterOne(Pt)})),$("#video-filterBtn").on("click",(Pt=>{this.getBean("DetailPageButtonPlugin").filterOne(Pt)})),$("#video-favoriteBtn").on("click",(Pt=>{this.getBean("DetailPageButtonPlugin").favoriteOne(Pt)}))}}class oe extends X{getName(){return"JavTrailersPlugin"}constructor(){super(),this.hasBand=!1}handle(){let mt=window.location.href;if(!mt.includes("handle=1"))return;if($("h1:contains('Page not found')").length){clog.log("番号无法匹配, 跳搜索");let wt=mt.split("?")[0].split("video/")[1].toLowerCase().replace("00","-");return void(window.location.href="/search/"+encodeURIComponent(wt)+window.location.search)}let bt=$(".videos-list .video-link").toArray();if(bt.length){const wt=mt.split("?")[0].split("search/")[1].toLowerCase(),yt=bt.find((jt=>$(jt).find(".vid-title").text().toLowerCase().includes(wt)));if(yt)return void(window.location.href=$(yt).attr("href")+window.location.search)}this.handlePlayJavTrailers(),$("#videoPlayerContainer").on("click",(()=>{this.handlePlayJavTrailers()})),window.addEventListener("message",(wt=>{let yt=document.getElementById("vjs_video_3_html5_api");yt&&(yt.currentTime+=5)}))}handlePlayJavTrailers(){this.hasBand||(utils.loopDetector((()=>$("#vjs_video_3_html5_api").length!==0),(()=>{setTimeout((()=>{this.hasBand=!0;let mt=document.getElementById("vjs_video_3_html5_api");clog.debug(mt),mt.play(),mt.currentTime=5,mt.addEventListener("timeupdate",(function(){mt.currentTime>=14&&mt.currentTime<16&&(mt.currentTime+=2)})),$("#vjs_video_3_html5_api").css({position:"fixed",width:"100vw",height:"100vh",objectFit:"cover",zIndex:"999999999"}),$(".vjs-control-bar").css({position:"fixed",bottom:"20px",zIndex:"999999999"})}),100)})),utils.loopDetector((()=>$("#vjs_video_3 canvas").length>0),(()=>{$("#vjs_video_3 canvas").length!==0&&$("#vjs_video_3 canvas").css({position:"fixed",width:"100vw",height:"100vh",objectFit:"cover",top:"0",right:"0",zIndex:"999999998"})})))}}class re extends X{getName(){return"SubTitleCatPlugin"}handle(){$(".t-banner-inner").hide(),$("#navbar").hide();let mt=new URLSearchParams(window.location.search).get("search").toLowerCase(),bt=$(".sub-table tr td a").toArray(),wt=0;bt.forEach((xt=>{let $t=$(xt);$t.text().toLowerCase().includes(mt)?wt++:$t.parent().parent().hide()})),wt===0&&show.error("该番号无字幕!");const yt=$(".sec-title"),jt=yt.html().replace(/^\d+/,wt);yt.html(jt)}}class le extends X{getName(){return"Fc2Plugin"}async initCss(){return` <style> /* 弹层样式 */ .movie-detail-layer .layui-layer-title { font-size: 18px; color: var(--jhs-text); background: var(--jhs-surface-2); } /* 容器样式 */ .movie-detail-container { margin: 40px; height: 100%; background: var(--jhs-surface); } .movie-poster-container { flex: 0 0 60%; padding: 15px; } .right-box { flex: 1; padding: 20px; overflow-y: auto; } /* 预告片iframe */ .movie-trailer { width: 100%; height: 100%; min-height: 400px; background: #000; border-radius: 4px; } /* 电影信息样式 */ .movie-title { font-size: 24px; margin-bottom: 15px; color: var(--jhs-text); } .movie-meta { margin-bottom: 20px; color: var(--jhs-text-muted); } .movie-meta span { margin-right: 15px; } /* 演员列表 */ .actor-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; } .actor-tag { padding: 4px 12px; background: var(--jhs-surface-2); border-radius: 15px; font-size: 12px; color: var(--jhs-text-muted); } /* 图片列表 */ .image-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; } .movie-image-thumb { width: 120px; height: 80px; object-fit: cover; border-radius: 4px; cursor: pointer; transition: transform 0.3s; } .movie-image-thumb:hover { transform: scale(1.05); } /* 加载中和错误状态 */ .search-loading, .movie-error { padding: 40px; text-align: center; color: var(--jhs-text-faint); } .movie-error { color: var(--jhs-status-filter); } .fancybox-container{ z-index:99999999 } /* 错误提示样式 */ .movie-not-found, .movie-error { text-align: center; padding: 30px; color: var(--jhs-text-muted); } .movie-not-found h3, .movie-error h3 { color: var(--jhs-status-filter); margin: 15px 0; } .icon-warning, .icon-error { font-size: 50px; color: var(--jhs-status-watch); } .icon-error { color: var(--jhs-status-filter); } .fc2-movie-panel-info .panel-block { padding: 0 !important; } </style> `}handle(){let mt="/advanced_search?type=3&score_min=0&d=1";if($('.navbar-item:contains("FC2")').attr("href",mt),$('.tabs a:contains("FC2")').attr("href",mt),o.includes("advanced_search?type=3")&&($("h2.section-title").contents().first().replaceWith("Fc2PPV"),$(".section .container > .box").remove()),o.includes("collection_codes?movieId")){$("section").html("");const bt=new URLSearchParams(window.location.search);let wt=bt.get("movieId"),yt=bt.get("carNum"),jt=bt.get("url");wt&&yt&&jt&&this.openFc2Dialog(wt,yt,jt)}}openFc2Dialog(mt,bt,wt){let yt=bt.replace("FC2-","");if(wt.includes("123av"))return void this.getBean("Fc2By123AvPlugin").open123AvFc2Dialog(bt,wt);let jt=` <div class="movie-detail-container"> <!--<div class="movie-poster-container"> <iframe class="movie-trailer" frameborder="0" allowfullscreen scrolling="no"></iframe> </div>--> <!-- <div class="right-box">--> <div class="movie-info-container"> <div class="search-loading">加载中...</div> </div> <div class="movie-panel-info fc2-movie-panel-info jhs-layout-a26bda7d"><strong>第三方资源: </strong></div> <div class="jhs-layout-ba4750c8"> <button type="button" id="filterBtn" class="jhs-btn jhs-btn--filter"><span>${m}</span></button> <button type="button" id="favoriteBtn" class="jhs-btn jhs-btn--fav"><span>${v}</span></button> <button type="button" id="hasDownBtn" class="jhs-btn jhs-btn--down"><span>${y}</span></button> <button type="button" id="hasWatchBtn" class="jhs-btn jhs-btn--watch"><span>${k}</span></button> <button type="button" id="search-subtitle-btn" class="jhs-btn jhs-btn--accent"> <span>字幕 (SubTitleCat)</span> </button> <button type="button" id="xunLeiSubtitleBtn" class="jhs-btn jhs-btn--accent"> <span>字幕 (迅雷)</span> </button> <button type="button" id="magnetSearchBtn" class="jhs-btn jhs-btn--accent jhs-layout-9fe45cd8"> <span>磁力搜索</span> </button> </div> <div class="message video-panel jhs-layout-a26bda7d"> <div id="magnets-content" class="magnet-links jhs-layout-6d489fc7"> <div class="search-loading">加载中...</div> </div> </div> <div id="reviews-content"> </div> <div id="related-content"> </div> <span id="data-actress" class="jhs-layout-6b99de8b"></span> <!--</div>--> </div> `;layer.open({type:1,title:bt,content:jt,area:utils.getDialogArea("workspace"),skin:"movie-detail-layer",scrollbar:!1,success:(xt,$t)=>{organizeJhsOwnedDetailWorkspace($(xt).find(".movie-detail-container")),this.loadData(mt,bt),$("#favoriteBtn").on("click",(async kt=>{const _t=$("#data-actress").text(),St=$("#data-releaseDate").text();await storageManager.saveCar({carNum:bt,url:wt,names:_t,actionType:h,publishTime:St}),window.refresh(),layer.closeAll()})),$("#filterBtn").on("click",(kt=>{utils.q(kt,`是否屏蔽${bt}?`,(async()=>{const _t=$("#data-actress").text(),St=$("#data-releaseDate").text();await storageManager.saveCar({carNum:bt,url:wt,names:_t,actionType:d,publishTime:St}),window.refresh(),layer.closeAll(),window.location.href.includes("collection_codes?movieId")&&utils.closePage()}))})),$("#hasDownBtn").on("click",(async kt=>{const _t=$("#data-actress").text(),St=$("#data-releaseDate").text();await storageManager.saveCar({carNum:bt,url:wt,names:_t,actionType:g,publishTime:St}),window.refresh(),layer.closeAll()})),$("#hasWatchBtn").on("click",(async kt=>{const _t=$("#data-actress").text(),St=$("#data-releaseDate").text();await storageManager.saveCar({carNum:bt,url:wt,names:_t,actionType:p,publishTime:St}),window.refresh(),layer.closeAll()})),$("#search-subtitle-btn").on("click",(kt=>utils.openPage(`https://subtitlecat.com/index.php?search=${bt}`,bt,!1,kt))),$("#xunLeiSubtitleBtn").on("click",(()=>this.getBean("DetailPageButtonPlugin").searchXunLeiSubtitle(bt))),$("#magnetSearchBtn").on("click",(()=>{let kt=this.getBean("MagnetHubPlugin").createMagnetHub(bt);layer.open({type:1,title:"磁力搜索",content:'<div id="magnetHubBox"></div>',area:utils.getResponsiveArea(["60%","80%"]),scrollbar:!1,success:()=>{$("#magnetHubBox").append(kt)}})})),this.getBean("OtherSitePlugin").loadOtherSite(yt,bt).then(),utils.setupEscClose($t)},end(){window.location.href.includes("collection_codes?movieId")&&utils.closePage()}})}loadData(mt,bt){let wt=bt.replace("FC2-","");this.handleMovieDetail(mt),this.handleLongImg(wt),this.handleMagnets(mt),this.getBean("ReviewPlugin").showReview(mt,$("#reviews-content")).then(),this.getBean("RelatedPlugin").showRelated($("#related-content"),mt).then()}handleMovieDetail(mt){V(mt).then((bt=>{const wt=bt.actors||[],yt=bt.imgList||[];let jt="";if(wt.length>0){let $t="";for(let kt=0;kt<wt.length;kt++){let _t=wt[kt];jt+=`<span class="actor-tag"><a href="/actors/${escapeHtml(_t.id)}" target="_blank">${escapeHtml(_t.name)}</a></span>`,_t.gender===0&&($t+=_t.name+" ")}$("#data-actress").text($t)}else jt='<span class="no-data">暂无演员信息</span>';let xt="";xt=Array.isArray(yt)&&yt.length>0?yt.map((($t,kt)=>` <a href="${$t}" data-fancybox="movie-gallery" data-caption="剧照 ${kt+1}"> <img src="${$t}" class="movie-image-thumb" loading="lazy" alt=""/> </a> `)).join(""):'<div class="no-data">暂无剧照</div>',$(".movie-info-container").html(` <h3 class="movie-title"><strong class="current-title">${bt.title||"无标题"}</strong></h3> <div class="movie-meta"> <span><strong>番号: </strong>${bt.carNum||"未知"}</span> <span><strong>年份: </strong>${bt.releaseDate||"未知"}</span> <span><strong>评分: </strong>${bt.score||"无"}</span> <span><strong>时长: </strong>${bt.duration+" m"||"无"}</span> </div> <div class="movie-meta"> <span> <strong>站点: </strong> <a href="https://fc2ppvdb.com/articles/${bt.carNum.replace("FC2-","")}" target="_blank">fc2ppvdb</a> <a href="https://adult.contents.fc2.com/article/${bt.carNum.replace("FC2-","")}/" target="_blank" class="jhs-layout-3fed2a7e">fc2电子市场</a> </span> </div> <div class="movie-actors"> <div class="actor-list"><strong>主演: </strong>${jt}</div> </div> <div class="movie-gallery jhs-layout-d2c171b1"> <strong>剧照: </strong> <div class="image-list">${xt}</div> </div> <div id="data-releaseDate" class="jhs-layout-6b99de8b">${bt.releaseDate||""}</div> `),this.getBean("TranslatePlugin").translate(bt.carNum,!1).then()})).catch((bt=>{console.error(bt),$(".movie-info-container").html(` <div class="movie-error">加载失败: ${escapeHtml(bt.message)}</div> `)}))}handleLongImg(mt){utils.loopDetector((()=>$(".movie-gallery .image-list").length>0),(async()=>{$(".movie-gallery .image-list").prepend(' <a class="tile-item screen-container jhs-layout-e5d57abb"><div class="jhs-layout-9db87399">正在加载缩略图</div></a> ');const bt=this.getBean("ScreenShotPlugin"),wt=await bt.getScreenshot(mt);wt&&await bt.addImg("缩略图",wt)}))}handleMagnets(mt){(async bt=>{let wt=`${U}/v1/movies/${bt}/magnets`,yt={jdSignature:await O()};return(await gmHttp.get(wt,null,yt)).data.magnets})(mt).then((bt=>{let wt="";if(bt.length>0)for(let yt=0;yt<bt.length;yt++){let jt=bt[yt],xt="";yt%2==0&&(xt="odd"),wt+=` <div class="item columns is-desktop ${xt}"> <div class="magnet-name column is-four-fifths"> <a href="magnet:?xt=urn:btih:${jt.hash}" title="右鍵點擊並選擇「複製鏈接地址」"> <span class="name">${jt.name}</span> <br> <span class="meta"> ${(jt.size/1024).toFixed(2)}GB, ${jt.files_count}個文件 </span> <br> <div class="tags"> ${jt.hd?'<span class="tag is-primary is-small is-light">高清</span>':""} ${jt.cnsub?'<span class="tag is-warning is-small is-light">字幕</span>':""} </div> </a> </div> <div class="buttons column"> <button class="jhs-btn button is-info is-small copy-to-clipboard" data-clipboard-text="magnet:?xt=urn:btih:${jt.hash}" type="button"> 複製 </button> </div> <div class="date column"><span class="time">${jt.created_at}</span></div> </div> `}else wt='<span class="no-data">暂无磁力信息</span>';$("#magnets-content").html(wt)})).catch((bt=>{console.error(bt),$("#magnets-content").html(` <div class="movie-error">加载失败: ${escapeHtml(bt.message)}</div> `)}))}async openFc2Page(mt,bt,wt){let jt=await this.getBean("OtherSitePlugin").getJavDbUrl();window.open(`${jt}/users/collection_codes?movieId=${mt}&carNum=${bt}&url=${wt}`)}}class ce extends X{async initCss(){return"<style>.jhs-magnet-score{display:inline-flex;align-items:center;gap:3px;margin-left:6px;padding:1px 6px;border-radius:10px;font-size:11px;font-weight:600;vertical-align:middle;cursor:help}</style>"}getName(){return"HighlightMagnetPlugin"}doFilterMagnet(){this.handleDb(),this.handleBus()}injectScoreBadge(mt,bt){try{if(mt.find(".jhs-magnet-score").length>0)return;const wt=calcMagnetScore({title:bt||"",seeders:0}),yt=wt.total,jt=yt>=70?"高":yt>=40?"中":"低",xt=yt>=70?"var(--jhs-status-down)":yt>=40?"var(--jhs-status-watch)":"var(--jhs-surface-2)",$t=yt>=70?"var(--jhs-status-down-on)":yt>=40?"var(--jhs-status-watch-on)":"var(--jhs-text-muted)",kt=`分辨率:${wt.resolution}/25 字幕:${wt.subtitle}/20 做种:${wt.seeders}/35 新鲜度:${wt.freshness}/15`,_t=$(`<span class="jhs-magnet-score" title="${kt}">${jt} ${yt}</span>`).css({color:$t,backgroundColor:xt});mt.append(_t)}catch{}}getQualitySignals(mt,bt=!1){const wt=String(mt||"").toLowerCase(),yt=/(?:4k|2160p|1080p|720p)/.exec(wt)?.[0]||"",jt=bt||/(?:-c\b|-u(?:c)?\b|chinese|中字|字幕)/.test(wt);return{resolution:yt,subtitle:jt,recognized:!!yt||jt,highQuality:yt==="4k"||yt==="2160p"||jt}}updateFilterHint(mt){$("#enable-magnets-filter").removeClass("do-hide").attr("data-tip",mt?"仅显示识别到的高质量或字幕磁力":"未识别到可过滤项,当前未隐藏磁力")}handleDb(){if(!r)return;let mt=$("#magnets-content .name");if(mt.length===0)return void this.updateFilterHint(!1);let bt=!1;mt.each(((wt,yt)=>{const jt=$(yt),xt=jt.text().toLowerCase(),$t=this.getQualitySignals(xt),kt=jt.parent().parent().parent();kt.removeClass("high-quality").show(),kt.addClass("magnet-row"),xt.includes("4k")&&jt.css("color","var(--jhs-status-filter-text)"),$t.highQuality&&(bt=!0,kt.addClass("high-quality")),this.injectScoreBadge(jt,jt.text())})),bt&&$("#magnets-content .magnet-row").not(".high-quality").hide(),this.updateFilterHint(bt)}handleBus(){l&&isDetailPage&&utils.loopDetector((()=>$("#magnet-table td a").length>0),(()=>{const mt=$("#magnet-table tr");let bt=!1;mt.each(((wt,yt)=>{const jt=$(yt),xt=jt.find("td:first-child"),$t=xt.find("a:first-child"),kt=xt.find("a:nth-child(2)"),_t=$t.text().toLowerCase();jt.removeClass("high-quality").show(),_t.includes("4k")&&$t.css("color","var(--jhs-status-filter-text)"),this.getQualitySignals(_t,kt.length>0&&kt.text().includes("字幕")).highQuality&&(bt=!0,jt.addClass("high-quality")),this.injectScoreBadge($t,$t.text())})),bt&&mt.each(((wt,yt)=>{const jt=$(yt);jt.hasClass("high-quality")||jt.hide()})),this.updateFilterHint(bt)}))}showAll(){$("#enable-magnets-filter").removeClass("do-hide").removeAttr("data-tip"),r&&$("#magnets-content .item").toArray().forEach((mt=>$(mt).show())),l&&$("#magnet-table tr").toArray().forEach((mt=>$(mt).show()))}}class de extends X{getName(){return"FoldCategoryPlugin"}async initCss(){const mt=await storageManager.getSetting();return` <style> #tags a.tag, .tags a.tag { position:relative; } .highlight-btn { position: absolute; top: -10px; right: -10px; background-color: var(--jhs-status-down); color: var(--jhs-status-down-on); border: none; border-radius: 50%; width: 24px; height: 24px; font-size: 14px; line-height: 24px; text-align: center; cursor: pointer; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2); display: none; z-index: 999; } /* 当父元素被高亮时,按钮变为其他颜色 */ .highlighted .highlight-btn { background-color: var(--jhs-status-watch); } /* 高亮状态下的标签样式 */ .highlighted { /* 浅黄色 */ border: ${mt.highlightedTagNumber||1}px solid ${mt.highlightedTagColor||"var(--jhs-status-filter)"}; } </style> `}async handle(){window.isListPage&&(o.includes("advanced_search")||(this.highlightTag(),utils.loopDetector((()=>$("#waitCheckBtn").length),(()=>{this.createFoldBtn()}),1,1e4,!0),$("#tags .tag-category .tag-expand").each(((mt,bt)=>{$(bt).parent().hasClass("collapse")&&bt.click()}))))}highlightTag(){(async()=>{const mt=await storageManager.getHighlightedTags();mt&&mt.forEach((bt=>{$(`#tags a.tag:contains(${bt})`).addClass("highlighted"),$(`.tags a.tag:contains(${bt})`).addClass("highlighted")}))})().then(),$("#tags a.tag, .tags a.tag").hover((function(){const mt=$(this),bt=$('<button class="jhs-btn highlight-btn" title="高亮显示">★</button>');mt.append(bt),bt.fadeIn(0)}),(function(){$(this).find(".highlight-btn").fadeOut(0,(function(){$(this).remove()}))})),$(document).on("click",".highlight-btn",(async function(mt){mt.stopPropagation(),mt.preventDefault();const bt=$(this).closest("a.tag"),wt=bt.clone();wt.find(".highlight-btn").remove();const yt=wt.text().trim().replace(/\s*\(\d+\)$/,"");let jt=await storageManager.getHighlightedTags();jt.includes(yt)?(jt=jt.filter((xt=>xt!==yt)),bt.removeClass("highlighted")):(jt.push(yt),bt.addClass("highlighted")),await storageManager.setHighlightedTags(jt)}))}async createFoldBtn(){let mt=$("#tags"),bt=$("#tags dl div.tag.is-info").map((function(){return $(this).text().replaceAll(` `,"").replaceAll(" ","")})).get().join(" ");if(!bt)return;$(".tabs").append(` <div class="jhs-layout-8453d189"> <div>已选分类: <span id="jhs-check-tag">${bt}</span></div> <button type="button" class="jhs-btn jhs-btn--ghost jhs-layout-3a1fc324" id="foldCategoryBtn"> <span></span> <i class="jhs-layout-78fa54ea"></i> </button> </div> `);let wt=$("h2.section-title");if(wt.length>0&&(wt.append(` <div id="foldCategoryBtn"> <button type="button" class="jhs-btn jhs-btn--ghost jhs-layout-2100e73d"> <span></span> <i class="jhs-layout-78fa54ea"></i> </button> </div> `),mt=$("section > div > div.box")),!mt)return;let yt=$("#foldCategoryBtn"),jt=localStorage.getItem("jhs_foldCategory")===_,[xt,$t]=jt?["展开","icon-angle-double-down"]:["折叠","icon-angle-double-up"];yt.find("span").text(xt).end().find("i").attr("class",$t),window.location.href.includes("noFold=1")||mt[jt?"hide":"show"](),yt.on("click",(async kt=>{kt.preventDefault(),jt=!jt,localStorage.setItem("jhs_foldCategory",jt?_:C);const[_t,St]=jt?["展开","icon-angle-double-down"]:["折叠","icon-angle-double-up"];yt.find("span").text(_t).end().find("i").attr("class",St),mt[jt?"hide":"show"]()}))}}class he extends X{constructor(){super(...arguments),i(this,"apiUrl","https://ja.wikipedia.org/wiki/")}getName(){return"ActressInfoPlugin"}async handle(){await storageManager.getSetting("enableLoadActressInfo","yes")==="yes"&&this.loadActressInfo()}loadActressInfo(){this.handleDetailPage().then(),this.handleStarPage().then()}async initCss(){return` <style> .info-tag { background-color: var(--jhs-status-fav-tint); display: inline-block; height: 32px; padding: 0 10px; line-height: 30px; font-size: 12px; color: var(--jhs-status-fav); border: 1px solid var(--jhs-status-fav-tint); border-radius: 4px; box-sizing: border-box; white-space: nowrap; } </style> `}async handleDetailPage(){if($(".actress-info").length>0)return;let mt=$(".female").prev().map(((xt,$t)=>$($t).text().trim())).get();if(!mt.length)return;const bt="jhs_actress_info",wt=localStorage.getItem(bt)?JSON.parse(localStorage.getItem(bt)):{};let yt=null,jt="";for(let xt=0;xt<mt.length;xt++){let $t=mt[xt];if(yt=wt[$t],!yt)try{yt=await this.searchInfo($t),yt&&(wt[$t]=yt)}catch{console.error("该名称查询失败,尝试其它名称")}let kt="";kt=yt?` <div class="panel-block actress-info"> <strong>${$t}:</strong> <a href="${yt.url}" target="_blank" class="jhs-layout-9813a0dd"> <span class="info-tag">${yt.birthday} ${yt.age}</span> <span class="info-tag">${yt.height} ${yt.weight}</span> <span class="info-tag">${yt.threeSizeText} ${yt.braSize}</span> </a> </div> `:`<div class="panel-block actress-info"><a href="${this.apiUrl+$t}" target="_blank"><strong>${$t}:</strong></a></div> `,jt+=kt}$('strong:contains("演員")').parent().after(jt),localStorage.setItem(bt,JSON.stringify(wt))}async handleStarPage(){if($(".actress-info").length>0)return;let mt=[],bt=$(".actor-section-name");bt.length&&bt.text().trim().split(",").forEach((kt=>{mt.push(kt.trim())}));let wt=$(".section-meta:not(:contains('影片'))");if(wt.length&&wt.text().trim().split(",").forEach((kt=>{mt.push(kt.trim())})),!mt.length)return;const yt="jhs_actress_info",jt=localStorage.getItem(yt)?JSON.parse(localStorage.getItem(yt)):{};let xt=null;for(let kt=0;kt<mt.length;kt++){let _t=mt[kt];if(xt=jt[_t],xt)break;try{xt=await this.searchInfo(_t)}catch{console.error("该名称查询失败,尝试其它名称")}if(xt)break}xt&&mt.forEach((kt=>{jt[kt]=xt}));let $t='<div class="actress-info jhs-layout-c0d4a511">无此相关演员信息</div>';xt&&($t=` <a class="actress-info" href="${xt.url}" target="_blank"> <div class="jhs-layout-c0d4a511"> <div class="jhs-layout-1b3790ef"> <span class="jhs-layout-dd5a75f6">出生日期: ${xt.birthday}</span> <span class="jhs-layout-d4a09a0d">年龄: ${xt.age}</span> <span class="jhs-layout-d4a09a0d">身高: ${xt.height}</span> </div> <div class="jhs-layout-1b3790ef"> <span class="jhs-layout-dd5a75f6">体重: ${xt.weight}</span> <span class="jhs-layout-d4a09a0d">三围: ${xt.threeSizeText}</span> <span class="jhs-layout-d4a09a0d">罩杯: ${xt.braSize}</span> </div> </div> </a> `),bt.parent().append($t),localStorage.setItem(yt,JSON.stringify(jt))}async searchInfo(mt){mt==="三上悠亞"&&(mt="三上悠亜");let bt=this.apiUrl+mt;const wt=await gmHttp.get(bt),yt=new DOMParser,jt=$(yt.parseFromString(wt,"text/html"));let xt=jt.find('a[title="誕生日"]').parent().parent().find("td").text().trim(),$t=jt.find("th:contains('現年齢')").parent().find("td").text().trim()?parseInt(jt.find("th:contains('現年齢')").parent().find("td").text().trim())+"岁":"",kt=jt.find('tr:has(a[title="身長"]) td').text().trim().split(" ")[0]+"cm",_t=jt.find('tr:has(a[title="体重"]) td').text().trim().split("/")[1].trim();return _t==="― kg"&&(_t=""),{birthday:xt,age:$t,height:kt,weight:_t,threeSizeText:jt.find('a[title="スリーサイズ"]').closest("tr").find("td").text().replace("cm","").trim(),braSize:jt.find('th:contains("ブラサイズ")').next("td").contents().first().text().trim(),url:bt}}}class pe extends X{constructor(){super(),i(this,"$contentBox",$(".section .container"))}getName(){return"HitShowPlugin"}async initCss(){return"<style>.jhs-hitshow-heading{display:flex;align-items:center;justify-content:space-between;gap:var(--jhs-space-3);flex-wrap:wrap}.jhs-hitshow-title{margin:0!important}.jhs-hitshow-list{margin-top:var(--jhs-space-3)}</style>"}async handle(){$('a[href*="rankings/playback"]').on("click",(mt=>{mt.preventDefault(),mt.stopPropagation(),window.location.href="/advanced_search?handlePlayback=1&period=daily"})),await this.handlePlayback()}hookPage(){let mt=$("h2.section-title");mt.contents().first().replaceWith("热播"),mt.addClass("jhs-hitshow-title"),mt.parent(".jhs-hitshow-heading").length||mt.wrap('<header class="jhs-hitshow-heading"></header>'),$(".empty-message").remove(),$(".section .container .box").remove(),this.$contentBox.append('<div class="movie-list h cols-4 vcols-8 jhs-hitshow-list"></div>')}async handlePlayback(){if(!window.location.href.includes("handlePlayback=1"))return;let mt=new URLSearchParams(window.location.search).get("period");this.hookPage(),this.toolBar(mt);let bt=$(".movie-list");bt.html("");let wt=loading(),yt=!1;for(let jt=1;jt<=3&&!yt;jt++)try{const xt=await W(mt);let $t=this.markDataListHtml(xt);bt.html($t),await this.loadScore(xt),await this.getBean("ListPageButtonPlugin").sortItems(),yt=!0}catch(xt){jt<3?(clog.error(`获取热播数据失败 (第 ${jt} 次重试)`,xt),await new Promise(($t=>setTimeout($t,1e3)))):clog.error("所有重试尝试均失败,无法获取数据。",xt)}finally{(yt||jt===3)&&wt.close()}}toolBar(mt){let bt=` <nav id="jhs-hitshow-period" class="jhs-segmented" role="tablist" aria-label="热播周期"> <a role="tab" class="jhs-segmented__item ${mt==="daily"?"active":""}" aria-selected="${mt==="daily"?"true":"false"}" tabindex="${mt==="daily"?"0":"-1"}" href="/advanced_search?handlePlayback=1&period=daily">日榜</a> <a role="tab" class="jhs-segmented__item ${mt==="weekly"?"active":""}" aria-selected="${mt==="weekly"?"true":"false"}" tabindex="${mt==="weekly"?"0":"-1"}" href="/advanced_search?handlePlayback=1&period=weekly">周榜</a> <a role="tab" class="jhs-segmented__item ${mt==="monthly"?"active":""}" aria-selected="${mt==="monthly"?"true":"false"}" tabindex="${mt==="monthly"?"0":"-1"}" href="/advanced_search?handlePlayback=1&period=monthly">月榜</a> </nav> `;$(".jhs-hitshow-heading").append(bt)}getStarRating(mt){let bt="";const wt=Math.floor(mt);for(let yt=0;yt<wt;yt++)bt+='<i class="icon-star"></i>';for(let yt=0;yt<5-wt;yt++)bt+='<i class="icon-star gray"></i>';return bt}async loadScore(mt){if(mt.length===0)return;let bt="jhs_score_info";for(const wt of mt)try{const yt=wt.id;if(!$(`#score_${yt}`).length||$(`#${yt}`).is(":hidden"))continue;const jt=localStorage.getItem(bt)?JSON.parse(localStorage.getItem(bt)):{},xt=jt[yt];if(xt){const Tt=typeof xt=="string"?(xt.match(/由(\d+)人/)||[0,0])[1]:xt.watchedCount||0;this.appendScoreHtml(yt,typeof xt=="string"?xt:xt.html,Number(Tt));continue}for(;!document.hasFocus();)await new Promise((Tt=>setTimeout(Tt,500)));const $t=await V(yt);let kt=$t.score,_t=$t.watchedCount,St=` <span class="value"> <span class="score-stars">${this.getStarRating(kt)}</span> ${kt}分,由${_t}人評價 </span> `;this.appendScoreHtml(yt,St,_t),jt[yt]={html:St,watchedCount:_t},localStorage.setItem(bt,JSON.stringify(jt)),await new Promise((Tt=>setTimeout(Tt,500)))}catch(yt){$(`#${wt.id}`).attr("data-jhs-rate-count","0"),clog.error(`解析评分数据失败 | 编号: ${wt.number} `,`错误详情: ${yt.message} `,yt.stack?`调用栈: ${yt.stack}`:"")}}appendScoreHtml(mt,bt,wt=0){$(`#${mt}`).attr("data-jhs-rate-count",String(Number(wt)||0));let yt=$(`#score_${mt}`);yt.length&&yt.html().trim()===""&&yt.slideUp(0,(function(){$(this).html(bt).slideDown(500)}))}markDataListHtml(mt){let bt="";return mt.forEach(((wt,yt)=>{bt+=` <div class="item" id="${escapeHtml(wt.id)}" data-jhs-publish-time="${escapeHtml(wt.release_date)}" data-jhs-rate-count="0" data-original-index="${yt}"> <a href="/v/${escapeHtml(wt.id)}" class="box" title="${escapeHtml(wt.origin_title)}"> <div class="cover "> <img loading="lazy" src="${wt.cover_url.replace(/https:\/\/[^/]+\/rhe951l4q/,"https://c0.jdbstatic.com")}" alt=""> </div> <div class="video-title"><strong>${escapeHtml(wt.number)}</strong> ${escapeHtml(wt.origin_title)}</div> <div class="score" id="score_${escapeHtml(wt.id)}"></div> <div class="meta">${escapeHtml(wt.release_date)}</div> <div class="tags has-addons"> ${wt.has_cnsub?'<span class="tag is-warning">含中字磁鏈</span>':wt.magnets_count>0?'<span class="tag is-success">含磁鏈</span>':'<span class="tag is-info">无磁鏈</span>'} ${wt.new_magnets?'<span class="tag is-info">今日新種</span>':""} </div> </a> </div> `})),bt}}const me="jhs_appAuthorization";class ue extends X{constructor(){super(),i(this,"has_cnsub",""),i(this,"$contentBox",$(".section .container")),i(this,"movies",[])}getName(){return"TOP250Plugin"}handle(){$('.main-tabs ul li:contains("猜你喜歡")').html('<a href="/rankings/top"><span>Top250</span></a>'),$('a[href*="rankings/top"]').on("click",(mt=>{mt.preventDefault(),mt.stopPropagation();const bt=$(mt.target),wt=(bt.is("a")?bt:bt.closest("a")).attr("href");let yt=wt.includes("?")?wt.split("?")[1]:wt;const jt=new URLSearchParams(yt);this.checkLogin(mt,jt)})),this.handleTop().then()}hookPage(){$("h2.section-title").contents().first().replaceWith("Top250"),$(".empty-message").remove(),$(".section .container .box").remove(),$("#sort-toggle-btn").remove(),this.$contentBox.append('<div class="tool-box jhs-layout-d2c171b1"></div>'),this.$contentBox.append('<div class="movie-list h cols-4 vcols-8 jhs-layout-d2c171b1"></div>'),this.renderPagination()}renderPagination(){const mt=new URLSearchParams(window.location.search);let bt=parseInt(mt.get("page"))||1;this.$contentBox.append((wt=>{const yt=wt>=5;let jt="";for(let xt=1;xt<=5;xt++)jt+=`<li><button type="button" class="jhs-btn pagination-link ${wt===xt?"is-current":""}" data-page="${xt}">${xt}</button></li>`;return` <nav class="pagination"> <button type="button" class="jhs-btn pagination-previous ${wt<=1?"do-hide":""}" data-page="${wt-1}">上一頁</button> <button type="button" class="jhs-btn pagination-next ${yt?"do-hide":""}" data-page="${wt+1}">下一頁</button> <ul class="pagination-list"> ${jt} </ul> </nav> `})(bt)),this.$contentBox.on("click",".pagination-link, .pagination-previous, .pagination-next",(wt=>{wt.preventDefault();const yt=parseInt($(wt.currentTarget).data("page"));!isNaN(yt)&&yt>0&&(jt=>{mt.set("page",jt),window.history.pushState({},"","?"+mt.toString()),window.location.reload()})(yt)}))}async handleTop(){if(!window.location.href.includes("handleTop=1"))return;const mt=new URLSearchParams(window.location.search);let bt=mt.get("handleType")||"all",wt=mt.get("type_value")||"";this.has_cnsub=mt.get("has_cnsub")||"";let yt=mt.get("page")||1;this.toolBar(bt,wt,yt),this.hookPage();let jt=$(".movie-list");jt.html("");let xt=loading(),$t=!1;for(let kt=1;kt<=3&&!$t;kt++)try{const _t=await q(bt,wt,yt,50);let St=_t.success,Tt=_t.message,It=_t.action;if(St===1){let Bt=_t.data.movies;if(Bt.length===0)return show.error("无数据"),void xt.close();this.movies=Bt;const Pt=Bt.filter((Nt=>this.has_cnsub==="1"?Nt.has_cnsub:this.has_cnsub!=="0"||!Nt.has_cnsub)),Mt=this.getBean("HitShowPlugin");let At=Mt.markDataListHtml(Pt);jt.html(At),Mt.loadScore(Pt),$t=!0}else console.error(_t),jt.html(`<h3>${escapeHtml(Tt)}</h3>`),show.error(Tt),It==="JWTVerificationError"&&(await localStorage.removeItem(me),await this.checkLogin(null,new URLSearchParams(window.location.search))),$t=!0}catch(_t){kt<3?(clog.error(`获取Top数据失败 (第 ${kt} 次重试):`,_t),await new Promise((St=>setTimeout(St,1e3)))):(clog.error("所有重试尝试均失败,无法获取Top数据。",_t),jt.html("<h3>无法加载数据,请稍后再试。</h3>"))}finally{($t||kt===3)&&xt.close()}}toolBar(mt,bt,wt){wt.toString()==="5"&&$(".pagination-next").remove(),$(".pagination-ellipsis").closest("li").remove(),$(".pagination-list li .pagination-link").each((function(){parseInt($(this).text())>5&&$(this).closest("li").remove()}));let yt="";for(let xt=new Date().getFullYear();xt>=2008;xt--)yt+=` <a class="button is-small jhs-layout-186f17ef ${bt===xt.toString()?"is-info":""}" href="/advanced_search?handleTop=1&handleType=year&type_value=${xt}&has_cnsub=${this.has_cnsub}"> ${xt} </a> `;let jt=` <div class="button-group"> <div class="buttons has-addons jhs-layout-701bf0f9" id="conditionBox"> <a class="button is-small jhs-layout-186f17ef ${mt==="all"?"is-info":""}" href="/advanced_search?handleTop=1&handleType=all&type_value=&has_cnsub=${this.has_cnsub}">全部</a> <a class="button is-small jhs-layout-186f17ef ${bt==="0"?"is-info":""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=0&has_cnsub=${this.has_cnsub}">有码</a> <a class="button is-small jhs-layout-186f17ef ${bt==="1"?"is-info":""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=1&has_cnsub=${this.has_cnsub}">无码</a> <a class="button is-small jhs-layout-186f17ef ${bt==="2"?"is-info":""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=2&has_cnsub=${this.has_cnsub}">欧美</a> <a class="button is-small jhs-layout-186f17ef ${bt==="3"?"is-info":""}" href="/advanced_search?handleTop=1&handleType=video_type&type_value=3&has_cnsub=${this.has_cnsub}">Fc2</a> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-2335597e ${this.has_cnsub==="1"?"is-info":""}" data-cnsub-value="1">含中字磁鏈</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef ${this.has_cnsub==="0"?"is-info":""}" data-cnsub-value="0">无字幕</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-cnsub-value="">重置</button> </div> <div class="buttons has-addons" id="conditionBox"> ${yt} </div> </div> `;this.$contentBox.append(jt),$("button[data-cnsub-value]").on("click",(xt=>{const $t=$(xt.currentTarget).data("cnsub-value");this.has_cnsub=$t.toString(),$("button[data-cnsub-value]").removeClass("is-info"),$(xt.currentTarget).addClass("is-info"),$(".toolbar a.button").not("[data-cnsub-value]").each(((Tt,It)=>{const Bt=$(It),Pt=new URL(Bt.attr("href"),window.location.origin);Pt.searchParams.set("has_cnsub",$t),Bt.attr("href",Pt.toString())}));const kt=this.movies.filter((Tt=>this.has_cnsub==="1"?Tt.has_cnsub:this.has_cnsub!=="0"||!Tt.has_cnsub)),_t=this.getBean("HitShowPlugin");let St=_t.markDataListHtml(kt);$(".movie-list").html(St),_t.loadScore(kt)}))}async checkLogin(mt,bt){if(!localStorage.getItem(me))return show.error("该类别依赖移动端接口,请先完成登录"),void this.openLoginDialog();let wt="all",yt="",jt=bt.get("t")||"";/^y\d+$/.test(jt)?(wt="year",yt=jt.substring(1)):jt!==""&&(wt="video_type",yt=jt);let xt=`/advanced_search?handleTop=1&handleType=${wt}&type_value=${yt}`;mt&&(mt.ctrlKey||mt.metaKey)?GM_openInTab(window.location.origin+xt,{insert:0}):window.location.href=xt}openLoginDialog(){layer.open({type:1,title:"JavDB",closeBtn:1,area:utils.getResponsiveArea(["360px","auto"]),shadeClose:!1,content:` <style>#loginBtn:hover{background:var(--jhs-accent-hover)}</style> <div class="jhs-layout-e32cff7f"> <div class="jhs-layout-598afa5a"> <input type="text" id="username" name="username" placeholder="用户名 | 邮箱" onfocus="this.style.borderColor='var(--jhs-accent)'; this.style.background='var(--jhs-surface)'" onblur="this.style.borderColor='var(--jhs-border-strong)'; this.style.background='var(--jhs-surface-2)'" class="jhs-field"> </div> <div class="jhs-layout-da303dcf"> <input type="password" id="password" name="password" placeholder="密码" onfocus="this.style.borderColor='var(--jhs-accent)'; this.style.background='var(--jhs-surface)'" onblur="this.style.borderColor='var(--jhs-border-strong)'; this.style.background='var(--jhs-surface-2)'" class="jhs-field"> </div> <button id="loginBtn" class="jhs-btn jhs-layout-c4eb15bf"> 登录 </button> </div> `,success:(mt,bt)=>{$("#loginBtn").click((function(){const wt=$("#username").val(),yt=$("#password").val();if(!wt||!yt)return void show.error("请输入用户名和密码");let jt=loading();(async(xt,$t)=>{let kt=`${U}/v1/sessions?username=${encodeURIComponent(xt)}&password=${encodeURIComponent($t)}&device_uuid=04b9534d-5118-53de-9f87-2ddded77111e&device_name=iPhone&device_model=iPhone&platform=ios&system_version=17.4&app_version=official&app_version_number=1.9.29&app_channel=official`,_t={"user-agent":"Dart/3.5 (dart:io)","accept-language":"zh-TW","content-type":"multipart/form-data; boundary=--dio-boundary-2210433284",jdsignature:await O()};return await gmHttp.post(kt,null,_t)})(wt,yt).then((async xt=>{let $t=xt.success;if($t===0)show.error(xt.message);else{if($t!==1)throw clog.error("登录失败",xt),new Error(xt.message);{let kt=xt.data.token;await localStorage.setItem(me,await encryptData(kt)),show.ok("登录成功"),layer.close(bt),window.location.href="/advanced_search?handleTop=1&period=daily"}}})).catch((xt=>{clog.error("登录异常:",xt),show.error(xt.message)})).finally((()=>{jt.close()}))}))}})}}class fe extends X{getName(){return"NavBarPlugin"}async initCss(){return` .highlight-red { /* 核心要求:高亮红色文本 */ color: var(--jhs-status-filter) !important; /* 建议:增加字体加粗,效果更明显 */ font-weight: bold; /* 建议:增加背景色,效果更突出 */ /* background-color: yellow; */ } `}handle(){if(this.margeNav(),this.hookSearch(),this.hookOldSearch(),this.toggleOtherNavItem(),$(window).resize(this.toggleOtherNavItem),JhsSelect.enhance("#search-box"),window.location.href.includes("/search")){const mt=new URLSearchParams(window.location.search);let bt=mt.get("q"),wt=mt.get("f");$("#search-keyword").val(bt),wt&&JhsSelect.setValue("#search-type",wt),bt&&this.highlightKeyword(bt)}}highlightKeyword(mt){const bt=mt.trim();if(!bt)return;const wt=bt.toLowerCase();$(".video-title strong, .actor-box strong").each((function(){const yt=$(this);yt.text().toLowerCase().includes(wt)&&yt.addClass("highlight-red")}))}hookSearch(){$("#navbar-menu-hero").after(` <div class="navbar-menu jhs-ui" id="search-box"> <div class="navbar-start jhs-layout-d9caa2c0"> <select id="search-type" class="jhs-select-source"> <option value="all">影片</option> <option value="actor">演員</option> <option value="series">系列</option> <option value="maker">片商</option> <option value="director">導演</option> <option value="code">番號</option> <option value="list">清單</option> </select> <input id="search-keyword" type="text" placeholder="輸入影片番號,演員名等關鍵字進行檢索" class="jhs-field"> <a href="/advanced_search?noFold=1" title="進階檢索" class="jhs-btn jhs-btn--secondary"><span>...</span></a> <button type="button" id="search-img-btn" class="jhs-btn jhs-btn--secondary">识图</button> <button type="button" id="search-btn" class="jhs-btn jhs-btn--primary">檢索</button> </div> </div> `),$("#search-keyword").on("paste",(mt=>{const bt=mt.originalEvent.clipboardData.items;for(let wt=0;wt<bt.length;wt++)if(bt[wt].type.indexOf("image")!==-1){const yt=bt[wt].getAsFile();$("#search-keyword").blur();const jt=this.getBean("SearchByImagePlugin");return void jt.open((()=>{jt.handleImageFile(yt),jt.resetSearchUI()}))}setTimeout((()=>{$("#search-btn").click()}),0)})).on("keypress",(mt=>{mt.key==="Enter"&&setTimeout((()=>{$("#search-btn").click()}),0)})),$("#search-btn").on("click",(mt=>{let bt=$("#search-keyword").val(),wt=$("#search-type").val();bt!==""&&(window.location.href.includes("/search")?window.location.href="/search?q="+bt+"&f="+wt:window.open("/search?q="+bt+"&f="+wt))})),$("#search-img-btn").on("click",(()=>{this.getBean("SearchByImagePlugin").open()}))}hookOldSearch(){const mt=document.querySelector(".search-image");if(!mt)return;const bt=mt.cloneNode(!0);mt.parentNode.replaceChild(bt,mt),$("#button-search-image").attr("data-tooltip","以图识图"),$(".search-image").on("click",(wt=>{this.getBean("SearchByImagePlugin").open()}))}margeNav(){$('a[href*="/feedbacks/new"]').remove(),$('a[href*="theporndude.com"]').remove(),$('a.navbar-link[href="/makers"]').parent().after(` <div class="navbar-item has-dropdown is-hoverable"> <a class="navbar-link">其它</a> <div class="navbar-dropdown is-boxed"> <a class="navbar-item" href="/feedbacks/new" target="_blank" >反饋</a> <a class="navbar-item" rel="nofollow noopener" target="_blank" href="https://theporndude.com/zh">ThePornDude</a> </div> </div> `)}toggleOtherNavItem(){let mt=$("#search-box"),bt=$("#search-bar-container");$(window).width()<1600&&$(window).width()>1023&&(mt.hide(),bt.show()),$(window).width()>1600&&(mt.show(),bt.hide())}}class ve{constructor(){this.queue=Promise.resolve()}addTask(mt){const bt=this.queue.then((()=>mt()));return this.queue=bt.catch((wt=>{clog.error("执行异步队列任务失败:",wt)})),bt}async waitAllFinished(){return this.queue}}class be extends X{constructor(){super(...arguments),i(this,"siteConfigs",[{id:"javTrailersBtn",getBaseUrl:async()=>await this.getJavTrailersUrl(),itemSelector:".videos-list .video-link",searchPath:(mt,bt)=>`${mt}/search/${bt}`,getDetailPageHref:mt=>mt.attr("href"),findCarNumOrTitle:mt=>mt.find("p.card-text").text()},{id:"123AvBtn",getBaseUrl:async()=>await this.getAv123Url()+"/ja",itemSelector:".box-item",searchPath:(mt,bt)=>`${mt}/search?keyword=${bt}`,getDetailPageHref:mt=>mt.find(".detail a").attr("href"),findCarNumOrTitle:mt=>mt.find("img").attr("title")},{id:"jableBtn",getBaseUrl:async()=>await this.getjableUrl(),itemSelector:"#list_videos_videos_list_search_result .detail .title a",searchPath:(mt,bt)=>`${mt}/search/${bt}/`,getDetailPageHref:mt=>mt.attr("href"),findCarNumOrTitle:mt=>mt.text()},{id:"avgleBtn",getBaseUrl:async()=>await this.getAvgleUrl(),itemSelector:".text-secondary",searchPath:(mt,bt)=>`${mt}/vod/search.html?wd=${bt}`,getDetailPageHref:mt=>mt.attr("href"),findCarNumOrTitle:mt=>mt.text()},{id:"missAvBtn",getBaseUrl:async()=>await this.getMissAvUrl(),itemSelector:".text-secondary",searchPath:(mt,bt)=>`${mt}/search/${bt}`,getDetailPageHref:mt=>mt.attr("href"),findCarNumOrTitle:mt=>mt.text()},{id:"supJavBtn",getBaseUrl:async()=>await this.getSupJavUrl(),itemSelector:".posts post",searchPath:(mt,bt)=>`${mt}/?s=${bt}`,getDetailPageHref:(mt,bt,wt)=>mt.attr("href"),findCarNumOrTitle:mt=>mt.attr("title")},{id:"javDbBtn",getBaseUrl:async()=>await this.getJavDbUrl(),itemSelector:".movie-list .item",searchPath:(mt,bt)=>`${mt}/search?q=${bt}`,getDetailPageHref:mt=>mt.find("a").attr("href"),findCarNumOrTitle:mt=>mt.find(".video-title").text(),condition:mt=>l},{id:"javBusBtn",getBaseUrl:async()=>await this.getJavBusUrl(),itemSelector:".container h3",searchPath:(mt,bt)=>`${mt}/${bt}`,getDetailPageHref:(mt,bt,wt)=>`${bt}/${wt}`,findCarNumOrTitle:mt=>mt.text(),condition:mt=>r&&mt&&!mt.includes("FC2")},{id:"fanzaBtn",noHandle:!0,initUrl:mt=>`https://www.dmm.co.jp/search/=/searchstr=${mt}`,condition:mt=>mt&&!mt.includes("FC2")}]),i(this,"settingCache",null),i(this,"lastFetchTime",0),i(this,"CACHE_DURATION",1e4)}getName(){return"OtherSitePlugin"}async initCss(){return` <style> #otherSiteBox, #settingsArea { margin-top:var(--jhs-space-2); user-select:none; } .jhs-site-list, #siteCheckboxes { display:flex; flex-wrap:wrap; gap:var(--jhs-space-2); } .site-btn { position:relative; } .site-btn::before { width:7px; height:7px; border-radius:50%; background:var(--jhs-brand-color,var(--jhs-text-faint)); content:""; } #javTrailersBtn { --jhs-brand-color:#d4a72c; } #123AvBtn { --jhs-brand-color:#e05d44; } #jableBtn { --jhs-brand-color:#c94556; } #avgleBtn { --jhs-brand-color:#4677c8; } #missAvBtn { --jhs-brand-color:#8b5cf6; } #supJavBtn { --jhs-brand-color:#ef6c35; } #javDbBtn { --jhs-brand-color:#2684ff; } #javBusBtn { --jhs-brand-color:#cc3d3d; } #fanzaBtn { --jhs-brand-color:#ea4c89; } .site-btn.is-checking { opacity:.65; pointer-events:none; } .site-btn.is-available { border-color:var(--jhs-status-down-text); background:var(--jhs-status-down-tint); } .site-btn.is-unavailable { border-color:var(--jhs-status-filter-text); background:var(--jhs-status-filter-tint); } .site-btn.is-domain-error { border-color:var(--jhs-status-watch-text); background:var(--jhs-status-watch-tint); } .site-tag { margin-left:var(--jhs-space-1); padding:1px var(--jhs-space-1); border-radius:var(--jhs-radius-pill); background:var(--jhs-surface-2); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-xs); } .jhs-site-option { display:flex; align-items:center; gap:var(--jhs-space-2); } </style>`}async handle(){isDetailPage&&await this.loadOtherSite(null,null,{autoDetect:!1})}async loadOtherSite(mt,bt,wt={}){if(await storageManager.getSetting("enableLoadOtherSite","yes")!=="yes")return;$("#otherSiteBox,#settingsArea").remove(),mt=normalizeCarNum(mt)||this.getPageInfo().carNum;const yt=this.getEnabledSites(),jt=` <div id="otherSiteBox" class="panel-block"> <div class="jhs-site-list"> ${this.siteConfigs.map((xt=>(xt.sourceCarNum=bt,xt.condition&&xt.condition(xt.sourceCarNum)===!1?"":`<a target="_blank" class="site-btn jhs-btn jhs-btn--secondary ${yt.includes(xt.id)?"":"jhs-is-hidden"}" id="${xt.id}"><span>${xt.id.replace("Btn","")}</span></a>`))).join("")} <button type="button" id="detectOtherSiteBtn" class="site-btn jhs-btn jhs-btn--primary"><span>检测外部站点</span></button> <button type="button" id="settingSiteBtn" class="site-btn jhs-btn jhs-btn--secondary"><span>设置</span></button> </div> </div> <div id="settingsArea" class="panel-block jhs-is-hidden"><div id="siteCheckboxes"></div></div> `;if($(".movie-panel-info").append(jt),$(".container .info").append(jt),!mt)return $("#otherSiteBox .site-btn").removeAttr("href").attr({"aria-disabled":"true",title:"番号不可用"}),$("#detectOtherSiteBtn").prop("disabled",!0),this.renderSettingsArea(),this.setupEventListeners(),void clog.warn("跳过第三方站点解析:番号不可用");$("#javTrailersBtn").on("click",(async xt=>{xt.preventDefault();let $t=$("#javTrailersBtn").attr("href"),kt=$t+"?handle=1";xt&&(xt.ctrlKey||xt.metaKey)&&(kt=$t),utils.openPage(kt,mt,!1,xt)})),await Promise.all(this.siteConfigs.map((async xt=>{xt.condition&&xt.condition(xt.sourceCarNum)===!1||await this.prepareSiteLink(mt,xt)}))),this.renderSettingsArea(),this.setupEventListeners(),$("#detectOtherSiteBtn").off("click").on("click",(xt=>{xt.preventDefault(),this.detectOtherSites(mt)})),wt.autoDetect&&await this.detectOtherSites(mt)}async prepareSiteLink(mt,bt){const wt=$(`#${bt.id}`);if(!(mt=normalizeCarNum(mt)))return wt.removeAttr("href").attr({"aria-disabled":"true",title:"番号不可用"}),void this.setSiteState(wt,"idle");if(bt.initUrl)return wt.attr("href",bt.initUrl(mt)),this.setSiteState(wt,"idle"),void wt.attr("title","点击前往外部搜索页");try{const yt=await bt.getBaseUrl(),jt=bt.searchPath(yt,mt);wt.attr("href",jt),wt.attr("title","点击前往外部搜索页;点击检测按钮后才自动检测"),this.setSiteState(wt,"idle")}catch{wt.attr("title","外部站点地址未配置或不可用"),this.setSiteState(wt,"domain-error")}}async detectOtherSites(mt){const bt=$("#detectOtherSiteBtn"),wt=bt.text();return(mt=normalizeCarNum(mt))?(bt.text("检测中").prop("disabled",!0).addClass("is-checking"),await Promise.all(this.siteConfigs.map((async yt=>{yt.condition&&yt.condition(yt.sourceCarNum)===!1||await this.handleSite(mt,yt)}))),bt.text(wt).prop("disabled",!1).removeClass("is-checking")):(bt.prop("disabled",!0),void clog.warn("跳过第三方站点检测:番号不可用"))}setSiteState(mt,bt){mt.removeClass("is-checking is-available is-unavailable is-domain-error"),bt!=="idle"&&mt.addClass(`is-${bt}`)}async handleSite(mt,bt){const wt=$(`#${bt.id}`);if(wt.removeAttr("href").find(".site-tag").remove(),this.setSiteState(wt,"checking"),bt.initUrl&&wt.attr("href",bt.initUrl(mt)),bt.noHandle&&bt.noHandle===!0){const yt="jhs_other_site_dmm",jt=(localStorage.getItem(yt)?JSON.parse(localStorage.getItem(yt)):{})[mt];jt?(wt.attr("href",jt.url),jt.type==="multiple"&&wt.append('<span class="site-tag">多结果</span>'),this.setSiteState(wt,"available")):this.setSiteState(wt,"idle")}else try{if(wt.attr("href"))return void this.setSiteState(wt,"idle");if(utils.isHidden(wt))return;const yt="jhs_other_site",jt=localStorage.getItem(yt)?JSON.parse(localStorage.getItem(yt)):{},xt=mt+"_"+bt.id.replace("Btn",""),$t=jt[xt],kt=Date.now();if($t&&$t.time&&kt-$t.time<864e5)return wt.attr("href",$t.url),$t.type==="multiple"&&wt.append('<span class="site-tag">多结果</span>'),void this.setSiteState(wt,"available");const _t=await bt.getBaseUrl(),St=bt.searchPath(_t,mt);wt.attr("href",St);const Tt=gmHttp.isDomainCircuitBroken(St);if(Tt){wt.attr("title",`站点已熔断,${Tt.remaining}秒后重试`),this.setSiteState(wt,"domain-error");return}const It=await storageManager.cachedRequest(`other-site:${bt.id}:${mt}`,864e5,(()=>gmHttp.get(St,null,bt.headers,!0))),Bt=utils.htmlTo$dom(It),Pt=[];Bt.find(bt.itemSelector).each(((Nt,Dt)=>{const Lt=$(Dt);if(!bt.findCarNumOrTitle(Lt).toLowerCase().includes(mt.toLowerCase()))return;let Et=bt.getDetailPageHref(Lt,_t,mt);if(!Et)throw new Error("解析href失败");Et.includes("http")||(Et=_t+(Et.startsWith("/")?Et:"/"+Et)),Pt.push(Et)}));let Mt="",At=null;if(Pt.length===1){let Nt=Pt[0];wt.attr("href",Nt),this.setSiteState(wt,"available"),At={type:"single",url:Nt,time:kt}}else Pt.length>1?(wt.attr("href",St),Mt+='<span class="site-tag">多结果</span>',this.setSiteState(wt,"available"),At={type:"multiple",url:St,time:kt}):(wt.attr("href",St),wt.attr("title","未查询到, 点击前往搜索页"),this.setSiteState(wt,"unavailable"));if(At){const Nt=localStorage.getItem(yt)?JSON.parse(localStorage.getItem(yt)):{};Nt[xt]=At,localStorage.setItem(yt,JSON.stringify(Nt))}Mt&&wt.append(Mt)}catch(yt){const jt=String(yt),xt=bt.id.replace("Btn","");yt._circuitBroken?(wt.attr("title",jt),this.setSiteState(wt,"domain-error"),clog.warn(`检测第三方资源跳过, ${xt} 已熔断`)):jt.includes("Just a moment")?(wt.attr("title","请求失败:Cloudflare 安全检查。"),this.setSiteState(wt,"domain-error"),clog.warn(`检测第三方资源失败, ${xt} 需Cloudflare安全检查`)):jt.includes("重定向")?(wt.attr("title","域名失效"),this.setSiteState(wt,"domain-error"),clog.warn(`检测第三方资源失败, ${xt} 域名被重定向`)):jt.includes("404 Page Not Found")?(wt.attr("title","未查询到, 点击前往搜索页"),this.setSiteState(wt,"unavailable")):(console.error(yt),wt.attr("title","请求失败。"),this.setSiteState(wt,"unavailable"),clog.warn(`检测第三方资源失败, ${xt}`))}}async getSettingCache(){const mt=Date.now();return(!this.settingCache||mt-this.lastFetchTime>this.CACHE_DURATION)&&(this.settingCache=await storageManager.getSetting(),this.lastFetchTime=mt),this.settingCache}async getMissAvUrl(){return(await this.getSettingCache()).missAvUrl||"https://missav.live"}async getjableUrl(){return(await this.getSettingCache()).jableUrl||"https://jable.tv"}async getAvgleUrl(){return(await this.getSettingCache()).avgleUrl||"https://jav.rs"}async getJavTrailersUrl(){return(await this.getSettingCache()).javTrailersUrl||"https://javtrailers.com"}async getAv123Url(){return(await this.getSettingCache()).av123Url||"https://123av.com"}async getJavDbUrl(){return(await this.getSettingCache()).javDbUrl||"https://javdb.com"}async getJavBusUrl(){return(await this.getSettingCache()).javBusUrl||"https://www.javbus.com"}async getSupJavUrl(){return(await this.getSettingCache()).supJavUrl||"https://supjav.com"}getEnabledSites(){const mt=localStorage.getItem("jhs_enabled_sites");return mt?JSON.parse(mt):this.siteConfigs.map((bt=>bt.id))}saveEnabledSites(mt){localStorage.setItem("jhs_enabled_sites",JSON.stringify(mt))}renderSettingsArea(){const mt=this.getEnabledSites(),bt=document.getElementById("siteCheckboxes");bt&&(bt.innerHTML=this.siteConfigs.map((wt=>{const yt=mt.includes(wt.id);return` <label class="jhs-site-option" for="checkbox-${wt.id}"> <input type="checkbox" id="checkbox-${wt.id}" data-site-id="${wt.id}" ${yt?"checked":""}> <span>${wt.id.replace("Btn","")}</span> </label> `})).join(""))}setupEventListeners(){const mt=document.getElementById("settingsArea");document.addEventListener("click",(bt=>{(bt.target.id==="settingSiteBtn"||bt.target.closest("#settingSiteBtn"))&&mt.classList.toggle("jhs-is-hidden")})),mt.addEventListener("change",(bt=>{if(bt.target.type==="checkbox"){const wt=bt.target.getAttribute("data-site-id");if(bt.target.checked){$(`#${wt}`).removeClass("jhs-is-hidden");const jt=this.getPageInfo().carNum,xt=this.siteConfigs.find(($t=>$t.id===wt));this.prepareSiteLink(jt,xt).then()}else $(`#${wt}`).addClass("jhs-is-hidden");const yt=Array.from(mt.querySelectorAll('input[type="checkbox"]:checked')).map((jt=>jt.getAttribute("data-site-id")));this.saveEnabledSites(yt)}}))}}class we extends X{getName(){return"BusDetailPagePlugin"}async initCss(){if(!window.isDetailPage)return"";$("h4:contains('推薦')").hide()}async handle(){if(window.location.href.includes("/star/")){const mt=$(".avatar-box");if(mt.length>0){let bt=mt.parent();bt.css("position","initial"),bt.insertBefore(bt.parent())}}$(".genre a").each((function(){const mt=$(this).attr("href");mt&&(mt.startsWith("http://")||mt.startsWith("https://")||mt.startsWith("/"))&&$(this).attr("target","_blank")})),this.addCopyCarNumBtn()}addCopyCarNumBtn(){let mt=null;const bt=document.querySelectorAll("span.header");for(const wt of bt)if(wt.textContent.trim()==="識別碼:"){mt=wt;break}if(mt){const wt=mt.nextElementSibling;if(wt&&wt.tagName==="SPAN"){const yt=wt.textContent.trim(),jt=document.createElement("button");jt.textContent="复制",jt.style.marginLeft="10px",jt.style.padding="0 10px",jt.style.cursor="pointer",jt.style.border="1px solid var(--jhs-border)",jt.style.borderRadius="5px",jt.style.backgroundColor="var(--jhs-surface-2)",jt.style.fontSize="12px",jt.addEventListener("click",(function(xt){xt.preventDefault();const $t=kt=>{this.textContent="已复制",setTimeout((()=>{this.textContent="复制"}),1500)};navigator.clipboard&&navigator.clipboard.writeText&&navigator.clipboard.writeText(yt).then((()=>$t())).catch((kt=>{console.error("无法通过标准API复制:",kt),alert("复制失败,请手动复制: "+yt)}))})),wt.parentNode.insertBefore(jt,wt.nextSibling)}}}}class ye extends X{getName(){return"DetailPageButtonPlugin"}constructor(){super(),this.answerCount=1}async handle(){this.hideVideoControls(),window.isDetailPage&&this.createMenuBtn()}async createMenuBtn(){const mt=this.getPageInfo(),bt=mt.carNum,wt=` <div class="jhs-detail-btn-row jhs-layout-e2965a97"> <div class="jhs-layout-1e90930a"> <button type="button" id="filterBtn" class="jhs-btn jhs-btn--filter jhs-layout-44293084"> <span>${m}</span> </button> <button type="button" id="favoriteBtn" class="jhs-btn jhs-btn--fav jhs-layout-44293084"> <span>${v}</span> </button> <button type="button" id="hasDownBtn" class="jhs-btn jhs-btn--down jhs-layout-44293084"> <span>${y}</span> </button> <button type="button" id="hasWatchBtn" class="jhs-btn jhs-btn--watch jhs-layout-44293084"> <span>${k}</span> </button> </div> <div class="jhs-layout-1e90930a"> <button type="button" id="enable-magnets-filter" class="jhs-btn jhs-btn--watch jhs-layout-5f3e3549"> <span id="magnets-span">关闭磁力过滤</span> </button> <button type="button" id="magnetSearchBtn" class="jhs-btn jhs-btn--accent jhs-layout-44293084"> <span>磁力搜索</span> </button> <button type="button" id="xunLeiSubtitleBtn" class="jhs-btn jhs-btn--accent jhs-layout-44293084"> <span>字幕 (迅雷)</span> </button> <button type="button" id="search-subtitle-btn" class="jhs-btn jhs-btn--accent jhs-layout-f43f0d6d"> <span>字幕 (SubTitleCat)</span> </button> </div> </div> `;r&&$(".tabs").after(wt),l&&$("#mag-submit-show").before(wt),$("#favoriteBtn").on("click",(()=>this.favoriteOne())),$("#filterBtn").on("click",(xt=>this.filterOne(xt))),$("#hasDownBtn").on("click",(async()=>this.hasDownOne())),$("#hasWatchBtn").on("click",(async()=>this.hasWatchOne())),$("#magnetSearchBtn").on("click",(()=>{let xt=this.getBean("MagnetHubPlugin").createMagnetHub(mt.carNum);layer.open({type:1,title:"磁力搜索 "+mt.carNum,content:'<div id="magnetHubBox"></div>',area:utils.getResponsiveArea(["60%","80%"]),scrollbar:!1,success:()=>{$("#magnetHubBox").append(xt)}})}));const yt=this.getBean("HighlightMagnetPlugin"),jt=await storageManager.getSetting("enableMagnetsFilter",_);if($("#magnets-span").text(jt===_?"关闭磁力过滤":"开启磁力过滤"),jt===_&&yt.doFilterMagnet(),$("#enable-magnets-filter").on("click",(xt=>{let $t=$("#magnets-span");$t.text()==="关闭磁力过滤"?(yt.showAll(),$t.text("开启磁力过滤"),storageManager.saveSettingItem("enableMagnetsFilter",C)):(yt.doFilterMagnet(),$t.text("关闭磁力过滤"),storageManager.saveSettingItem("enableMagnetsFilter",_))})),$("#search-subtitle-btn").on("click",(xt=>utils.openPage(`https://subtitlecat.com/index.php?search=${bt}`,bt,!1,xt))),$("#xunLeiSubtitleBtn").on("click",(()=>this.searchXunLeiSubtitle(bt))),!bt)return $("#filterBtn, #favoriteBtn, #hasDownBtn, #hasWatchBtn, #magnetSearchBtn, #xunLeiSubtitleBtn, #search-subtitle-btn").prop("disabled",!0).attr("title","番号不可用"),void clog.warn("详情操作不可用:番号不可用");this.showStatus(bt).then()}async showStatus(mt){const bt=$("#filterBtn span"),wt=$("#favoriteBtn span"),yt=$("#hasDownBtn span"),jt=$("#hasWatchBtn span");bt.text(m),wt.text(v),yt.text(y),jt.text(k);const xt=await storageManager.getCar(mt);if(xt)switch(xt.status){case d:bt.text(u);break;case h:wt.text(b);break;case g:yt.text("已标记下载");break;case p:jt.text("已标记观看")}}async favoriteOne(){try{let mt=this.getPageInfo();if(!mt.carNum)return void show.error("番号不可用,无法收藏");await storageManager.saveCar({carNum:mt.carNum,url:mt.url,names:mt.actress,actionType:h,publishTime:mt.publishTime}),this.showStatus(mt.carNum).then(),window.refresh(),utils.closePage()}catch(mt){console.error("收藏操作失败:",mt),show.error("操作失败")}}async hasDownOne(){try{let mt=this.getPageInfo();if(!mt.carNum)return void show.error("番号不可用,无法标记下载");await storageManager.saveCar({carNum:mt.carNum,url:mt.url,names:mt.actress,actionType:g,publishTime:mt.publishTime}),this.showStatus(mt.carNum).then(),window.refresh(),utils.closePage()}catch(mt){console.error("标记已下载失败:",mt),show.error("操作失败")}}async hasWatchOne(){try{let mt=this.getPageInfo();if(!mt.carNum)return void show.error("番号不可用,无法标记观看");await storageManager.saveCar({carNum:mt.carNum,url:mt.url,names:mt.actress,actionType:p,publishTime:mt.publishTime}),this.showStatus(mt.carNum).then(),window.refresh(),utils.closePage()}catch(mt){console.error("标记已观看失败:",mt),show.error("操作失败")}}searchXunLeiSubtitle(mt){let bt=loading();gmHttp.get(`https://api-shoulei-ssl.xunlei.com/oracle/subtitle?gcid=&cid=&name=${mt}`).then((wt=>{let yt=wt.data;yt&&yt.length!==0?layer.open({type:1,title:"迅雷字幕",content:` <div class="jhs-layout-8ddc7c91"> <div id="xunlei-table-container" class="jhs-layout-583c2485"></div> </div> `,scrollbar:!1,area:utils.getResponsiveArea(["60%","70%"]),anim:-1,success:(jt,xt)=>{new Tabulator("#xunlei-table-container",{layout:"fitColumns",placeholder:"暂无数据",virtualDom:!0,data:yt,responsiveLayout:"collapse",responsiveLayoutCollapse:!0,columnDefaults:{headerHozAlign:"center",hozAlign:"center"},columns:[{title:"文件名",field:"name",headerSort:!1,responsive:0},{title:"类型",field:"ext",headerSort:!1,responsive:0},{title:"操作",responsive:0,headerSort:!1,formatter:($t,kt,_t)=>{const St=$t.getData();return _t((()=>{const Tt=$t.getElement().querySelector(".subtitle-preview-btn"),It=$t.getElement().querySelector(".subtitle-download-btn");Tt&&Tt.addEventListener("click",(async Bt=>{let Pt=St.url,Mt=mt+"."+St.ext;this.previewSubtitle(Pt,Mt)})),It&&It.addEventListener("click",(async Bt=>{let Pt=St.url,Mt=mt+"."+St.ext,At=await gmHttp.get(Pt);utils.download(At,Mt)}))})),` <button type="button" class="jhs-btn jhs-btn--secondary subtitle-preview-btn">预览</button> <button type="button" class="jhs-btn jhs-btn--primary subtitle-download-btn">下载</button> `}}],locale:"zh-cn",langs:{"zh-cn":{pagination:{first:"首页",first_title:"首页",last:"尾页",last_title:"尾页",prev:"上一页",prev_title:"上一页",next:"下一页",next_title:"下一页",all:"所有",page_size:"每页行数"}}}}),utils.setupEscClose(xt)}}):show.error("迅雷中找不到相关字幕!")})).catch((wt=>{console.error(wt),show.error(wt)})).finally((()=>{bt.close()}))}async filterOne(mt,bt){mt&&mt.preventDefault();let wt=this.getPageInfo();if(!wt.carNum)return void show.error("番号不可用,无法屏蔽");bt?(await storageManager.saveCar({carNum:wt.carNum,url:wt.url,names:wt.actress,actionType:d,publishTime:wt.publishTime}),this.showStatus(wt.carNum).then(),window.refresh(),utils.closePage(),layer.closeAll(),this.answerCount=1):utils.q(mt,`是否屏蔽${wt.carNum}?`,(async()=>{await storageManager.saveCar({carNum:wt.carNum,url:wt.url,names:wt.actress,actionType:d,publishTime:wt.publishTime}),this.showStatus(wt.carNum).then(),window.refresh(),utils.closePage()}),(()=>{this.answerCount=1}))}hideVideoControls(){$(document).on("mouseenter","#preview-video",(function(){$(this).prop("controls",!0)}))}async previewSubtitle(mt,bt){if(!mt)return void console.error("未提供文件URL");const wt=mt.split(".").pop().toLowerCase();if(wt==="ass"||wt==="srt")try{let yt=await gmHttp.get(mt),jt="字幕预览";wt==="ass"?jt="ASS字幕预览 - "+bt:wt==="srt"&&(jt="SRT字幕预览 - "+bt);const xt=yt.split(` `);let $t="";const kt=String(xt.length).length;xt.forEach(((St,Tt)=>{const It=String(Tt+1).padStart(kt," ");$t+=`<span class="jhs-code-line-number">${It}. </span>${St} `}));const _t=$t;layer.open({type:1,title:jt,area:utils.getResponsiveArea(["80%","80%"]),scrollbar:!1,content:`<div class="jhs-code-viewer">${_t}</div>`,btn:["下载","关闭"],btn1:function(St,Tt,It){return utils.download(yt,bt),!1}})}catch(yt){show.error(`预览失败: ${yt.message}`),console.error("预览字幕文件出错:",yt)}else show.error("仅支持预览ASS和SRT字幕文件")}}class xe extends X{constructor(){super(...arguments),i(this,"tableObj",null)}getName(){return"HistoryPlugin"}async initCss(){return` <style> .jhs-history-layout { display:flex; flex-direction:column; height:100%; min-height:0; padding:var(--jhs-space-3) var(--jhs-space-4); overflow:hidden; } #filterBox, #allSelectBox { display:flex; align-items:center; flex-wrap:wrap; gap:var(--jhs-space-2); margin-bottom:var(--jhs-space-2); } #table-container { flex:1; min-height:0; overflow-x:hidden; } .sub-btns { position:relative; display:inline-block; } .sub-btns-menu { position:absolute; top:calc(100% + var(--jhs-space-1)); right:0; z-index:100; display:none; min-width:156px; padding:var(--jhs-space-1); overflow:hidden; border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-md); background:var(--jhs-surface); box-shadow:var(--jhs-shadow-md); } .sub-btns-menu.show { display:grid !important; gap:var(--jhs-space-1); } .sub-btns-menu .jhs-btn { width:100%; justify-content:flex-start; } .table-link-param { cursor:pointer; } .action-btns { display:flex; justify-content:center; gap:var(--jhs-space-2); } .jhs-history-edit-field { width:100%; padding:8px; border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-sm); } .jhs-history-edit-field[readonly] { background:var(--jhs-input-bg); } textarea.jhs-history-edit-field { min-height:60px; overflow-y:hidden; } </style>`}handleResize(){$(".navbar-search").is(":hidden")?($(".historyBtnBox").show(),$(".miniHistoryBtnBox").hide()):($(".historyBtnBox").hide(),$(".miniHistoryBtnBox").show())}async handle(){r&&($(".navbar-end").prepend(`<div class="navbar-item has-sub-btns is-hoverable historyBtnBox"> <button type="button" id="historyBtn" class="jhs-btn navbar-link nav-btn jhs-nav-btn">鉴定记录</button> </div>`),$(".navbar-search").css("margin-left","0").before(` <div class="navbar-item miniHistoryBtnBox"> <button type="button" id="miniHistoryBtn" class="jhs-btn navbar-link nav-btn jhs-nav-btn">鉴定记录</button> </div> `),this.handleResize(),$(window).resize((()=>{this.handleResize()})),$("#historyBtn,#miniHistoryBtn").on("click",(mt=>this.openHistory()))),l&&await this.createBusButton(),this.bindClick()}async createBusButton(){if(!await new Promise((bt=>{const wt=Date.now(),yt=setInterval((()=>{if($("#setting-btn").length&&$("#top-right-box").length)return clearInterval(yt),bt(!0);Date.now()-wt>=2500&&(clearInterval(yt),bt(!1))}),25)})))return void clog.warn("鉴定记录入口未创建:JavBus 顶部工具区未就绪");$("#top-right-box").append('<button type="button" id="historyBtn" class="jhs-btn jhs-btn--secondary">鉴定记录</button>'),$("#historyBtn,#miniHistoryBtn").on("click",(bt=>this.openHistory()))}openHistory(){let mt=` <div class="jhs-layout-7cb3f981"> <div id="filterBox" class="jhs-layout-53809f1e"> <select id="dataType" class="jhs-select-source"> <option value="all" selected>所有</option> <option value="filter">${u}</option> <option value="favorite">${b}</option> <option value="hasDown">${y}</option> <option value="hasWatch">${k}</option> </select> <input id="searchCarNum" type="text" placeholder="搜索番号|演员" class="jhs-field"> <button type="button" id="clearSearchbtn" class="jhs-btn jhs-btn--secondary jhs-layout-21a4fe43">重置</button> </div> <div id="allSelectBox" class="jhs-layout-66253c00"> <button type="button" class="jhs-btn jhs-btn--dark multiple-history-deleteBtn jhs-layout-7daea5fa"> <span>移除</span> </button> <button type="button" class="jhs-btn jhs-btn--watch multiple-history-hasWatchBtn jhs-layout-2e003268">${k}</button> <button type="button" class="jhs-btn jhs-btn--down multiple-history-hasDownBtn jhs-layout-2e003268">${y}</button> <button type="button" class="jhs-btn jhs-btn--fav multiple-history-favoriteBtn jhs-layout-2e003268">${v}</button> <button type="button" class="jhs-btn jhs-btn--filter multiple-history-filterBtn jhs-layout-2e003268">${m}</button> </div> <div id="table-container" class="jhs-layout-81eaab28"></div> </div> `;layer.open({type:1,title:"鉴定记录",content:mt,scrollbar:!1,shadeClose:!0,area:utils.getDialogArea("xl"),anim:-1,success:async bt=>{JhsSelect.enhance(bt),await this.loadTableData(),$(".layui-layer-content").on("click","#clearSearchbtn",(async wt=>{$("#searchCarNum").val(""),JhsSelect.setValue("#dataType","all"),await this.reloadTable(),$("#allSelectBox").hide()})).on("focusout keydown","#searchCarNum",(async wt=>{if(wt.type==="focusout"||wt.key==="Enter"){if(wt.key==="Enter"&&wt.preventDefault(),wt.type==="keydown"&&wt.key!=="Enter")return;await this.reloadTable()}})).on("click",".table-link-param",(async wt=>{let yt=$(wt.currentTarget);$("#searchCarNum").val(yt.text()),await this.reloadTable()})).on("change","#dataType",(async()=>{await this.reloadTable()}))},end:()=>{this.tableObj&&(this.tableObj.destroy(),this.tableObj=null),window.refresh()}})}async reloadTable(){this.tableObj.deselectRow(),this.tableObj.setPage(1)}bindClick(){document.addEventListener("click",(function(mt){if(mt.target.closest(".sub-btns-toggle")){const bt=mt.target.closest(".sub-btns-toggle"),wt=bt.closest(".sub-btns").querySelector(".sub-btns-menu");document.querySelectorAll(".sub-btns-menu.show").forEach((yt=>{yt!==wt&&(yt.classList.remove("show"),yt.previousElementSibling?.setAttribute("aria-expanded","false"))})),wt.classList.toggle("show"),bt.setAttribute("aria-expanded",String(wt.classList.contains("show")))}else document.querySelectorAll(".sub-btns-menu.show").forEach((bt=>{bt.classList.remove("show"),bt.previousElementSibling?.setAttribute("aria-expanded","false")}))})),$(document).on("keydown",".sub-btns",(mt=>{const bt=$(mt.currentTarget).find(".sub-btns-menu"),wt=bt.find('[role="menuitem"]'),yt=wt.index(document.activeElement);if(mt.key==="Escape")return mt.preventDefault(),bt.removeClass("show"),$(mt.currentTarget).find(".sub-btns-toggle").attr("aria-expanded","false").trigger("focus");if(!["ArrowDown","ArrowUp","Home","End"].includes(mt.key)||!bt.hasClass("show"))return;mt.preventDefault();const jt=mt.key==="Home"?0:mt.key==="End"?wt.length-1:mt.key==="ArrowDown"?(yt+1+wt.length)%wt.length:(yt-1+wt.length)%wt.length;wt.eq(jt).trigger("focus")})),$(document).on("click",".history-deleteBtn, .history-filterBtn, .history-favoriteBtn, .history-hasDownBtn, .history-hasWatchBtn, .history-detailBtn",(mt=>{mt.preventDefault(),mt.stopPropagation();const bt=$(mt.currentTarget),wt=bt.closest(".action-btns"),yt=wt.attr("data-car-num"),jt=wt.attr("data-href"),xt=async $t=>{try{await storageManager.saveCar({carNum:yt,url:jt,names:null,actionType:$t}),window.refresh(),await this.reloadTable()}catch(kt){console.error("历史记录操作失败:",kt),show.error("操作失败")}};bt.hasClass("history-filterBtn")?utils.q(mt,`是否屏蔽${yt}?`,(()=>xt(d))):bt.hasClass("history-favoriteBtn")?xt(h).then():bt.hasClass("history-hasDownBtn")?xt(g).then():bt.hasClass("history-hasWatchBtn")?xt(p).then():bt.hasClass("history-deleteBtn")?this.handleDelete(mt,yt):bt.hasClass("history-detailBtn")&&this.handleClickDetail(mt,{carNum:yt,url:jt}).then()})),$(document).on("click",".multiple-history-deleteBtn, .multiple-history-filterBtn, .multiple-history-favoriteBtn, .multiple-history-hasDownBtn, .multiple-history-hasWatchBtn",(mt=>{mt.preventDefault(),mt.stopPropagation();const bt=$(mt.currentTarget);let wt=this.tableObj.getSelectedData(),yt="",jt="";bt.hasClass("multiple-history-filterBtn")?(yt="屏蔽",jt=d):bt.hasClass("multiple-history-favoriteBtn")?(yt="收藏",jt=h):bt.hasClass("multiple-history-hasDownBtn")?(yt="已下载",jt=g):bt.hasClass("multiple-history-hasWatchBtn")?(yt="已观看",jt=p):bt.hasClass("multiple-history-deleteBtn")&&(yt="移除",jt="delete"),utils.q(mt,`当前已勾选${wt.length}条数据, 是否全标记为 ${yt}?`,(async()=>{let xt=loading();try{if(jt==="delete"){const $t=wt.map((_t=>_t.carNum)),kt=await storageManager.batchRemoveCars($t);kt>0?show.ok(`已成功删除 ${kt} 个番号`):kt===!1&&show.error("提供的番号中没有一个存在于列表中。")}else{const $t=JSON.parse(JSON.stringify(wt));$t.forEach((kt=>{kt.actionType=jt})),await storageManager.saveCarList($t),show.ok("操作成功")}this.tableObj.deselectRow(),this.reloadTable().then()}catch($t){console.error($t)}finally{xt.close()}}))}))}async getDataList(mt,bt,wt){let yt=await storageManager.getCarList();this.allCount=yt.length,this.filterCount=0,this.favoriteCount=0,this.hasDownCount=0,this.hasWatchCount=0,this.waitCheckCount=0,yt.forEach((It=>{switch(It.status){case d:this.filterCount++;break;case h:this.favoriteCount++;break;case g:this.hasDownCount++;break;case p:this.hasWatchCount++;break;default:this.waitCheckCount++}})),$('#dataType option[value="all"]').text(`所有 (${this.allCount})`),$('#dataType option[value="waitCheck"]').text(`待鉴定 (${this.waitCheckCount})`),$('#dataType option[value="filter"]').text(`${u} (${this.filterCount})`),$('#dataType option[value="favorite"]').text(`${b} (${this.favoriteCount})`),$('#dataType option[value="hasDown"]').text(`${y} (${this.hasDownCount})`),$('#dataType option[value="hasWatch"]').text(`${k} (${this.hasWatchCount})`);const jt=$("#dataType").val();let xt=jt==="all"?yt:jt==="waitCheck"?yt.filter((It=>It.status===""||!It.status)):yt.filter((It=>It.status===jt));const $t=$("#searchCarNum").val().trim();if($t){let It=$t.toLowerCase().replace("-c","").replace("-uc","").replace("-4k","");xt=xt.filter((Bt=>{const Pt=Bt.carNum.toLowerCase().includes(It),Mt=(Bt.names?Bt.names:"").toLowerCase().includes(It);return Pt||Mt}))}if(wt&&wt.length>0){const It=wt[0],Bt=It.field,Pt=It.dir;xt.sort(((Mt,At)=>{const Nt=Mt[Bt],Dt=At[Bt],Lt=Nt==null||Nt==="",Et=Dt==null||Dt==="";return Lt&&!Et?1:!Lt&&Et?-1:Lt&&Et?0:Nt<Dt?Pt==="asc"?-1:1:Nt>Dt?Pt==="asc"?1:-1:0}))}const kt=xt.length,_t=Math.ceil(kt/bt),St=(mt-1)*bt,Tt=St+bt;return xt=xt.slice(St,Tt),{maxPage:_t,dataList:xt,totalCount:kt}}async loadTableData(){this.tableObj=new Tabulator("#table-container",{layout:"fitColumns",placeholder:"暂无数据",virtualDom:!0,pagination:!0,paginationMode:"remote",sortMode:"remote",ajaxURL:"queryRealm",dataLoader:!1,ajaxRequestFunc:async(mt,bt,wt)=>{const yt=wt.page,jt=wt.size,xt=wt.sort;return await this.getDataList(yt,jt,xt)},dataReceiveParams:{last_page:"maxPage",last_row:"totalCount",data:"dataList"},paginationSize:50,paginationSizeSelector:[50,100,1e3,99999],paginationCounter:(mt,bt,wt,yt,jt)=>`共 ${yt} 条记录`,responsiveLayout:"collapse",responsiveLayoutCollapse:!0,columnDefaults:{headerHozAlign:"center",hozAlign:"center"},selectableRowsPersistence:!1,index:"carNum",columns:[{formatter:"rowSelection",titleFormatter:"rowSelection",hozAlign:"center",headerSort:!1,responsive:0,width:40,titleFormatterParams:{rowRange:"active"},cellClick:(mt,bt)=>{bt.getRow().toggleSelect()}},{title:"番号",field:"carNum",width:120,sorter:"string",responsive:0,formatter:(mt,bt,wt)=>{const yt=mt.getData().carNum,jt=yt.indexOf("-");return jt===-1?yt:`<button type="button" class="jhs-btn jhs-btn--ghost jhs-btn--sm table-link-param">${yt.substring(0,jt+1)}</button>${yt.substring(jt+1)}`}},{title:"演员",field:"names",minWidth:200,sorter:"string",responsive:5,headerSort:!0,formatter:(mt,bt,wt)=>(mt.getData().names||"").split(" ").filter((yt=>yt.trim()!=="")).map((yt=>`<button type="button" class="jhs-btn jhs-btn--ghost jhs-btn--sm table-link-param">${yt}</button>`)).join(" ")},{title:"创建时间",field:"createDate",width:170,sorter:"string",responsive:4},{title:"修改时间",field:"updateDate",width:170,sorter:"string",responsive:4},{title:"发行时间",field:"publishTime",width:170,sorter:"string",responsive:4},{title:"来源",field:"url",width:80,sorter:"string",responsive:5,hozAlign:"left",formatter:(mt,bt,wt)=>{let yt=mt.getData().url;return yt?`<span class="jhs-badge jhs-badge--neutral">${yt.includes("javdb")?"JavDB":yt.includes("javbus")?"JavBus":yt.includes("123av")?"123AV":"其他"}</span>`:""}},{title:"状态",field:"status",width:100,sorter:"string",responsive:1,headerSort:!1,formatter:(mt,bt,wt)=>{const yt=mt.getData().status;let jt="neutral",xt="";switch(yt){case"filter":jt="filter",xt=m;break;case"favorite":jt="fav",xt=v;break;case"hasDown":jt="down",xt=y;break;case"hasWatch":jt="watch",xt=k;break;default:xt=yt}return`<span class="jhs-badge jhs-badge--soft jhs-badge--${jt}">${xt||"待鉴定"}</span>`}},{title:"备注",field:"remark",width:100,sorter:"string",responsive:6},{title:"操作",sorter:"string",minWidth:150,cssClass:"action-cell-dropdown",responsive:0,headerSort:!1,formatter:(mt,bt,wt)=>{const yt=mt.getData();return wt((()=>{var jt;(jt=mt.getElement().querySelector(".history-editBtn"))==null||jt.addEventListener("click",(xt=>{this.editRecord(yt)}))})),` <div class="action-btns" data-car-num="${yt.carNum}" data-href="${yt.url?yt.url:""}"> <button type="button" class="jhs-btn jhs-btn--secondary history-detailBtn"><span>查看</span></button> <div class="sub-btns"> <button type="button" class="jhs-btn jhs-btn--ghost sub-btns-toggle" aria-haspopup="menu" aria-expanded="false"><span>更多操作</span></button> <div class="sub-btns-menu" role="menu"> <button type="button" class="jhs-btn jhs-btn--ghost history-editBtn" role="menuitem"><span>编辑</span></button> <button type="button" class="jhs-btn jhs-btn--danger history-deleteBtn" role="menuitem"><span>移除</span></button> <button type="button" class="jhs-btn jhs-btn--ghost history-hasWatchBtn" role="menuitem">${k}</button> <button type="button" class="jhs-btn jhs-btn--ghost history-hasDownBtn" role="menuitem">${y}</button> <button type="button" class="jhs-btn jhs-btn--ghost history-favoriteBtn" role="menuitem">${v}</button> <button type="button" class="jhs-btn jhs-btn--ghost history-filterBtn" role="menuitem">${m}</button> </div> </div> </div>`}}],initialSort:[{column:"updateDate",dir:"desc"}],locale:"zh-cn",langs:{"zh-cn":{pagination:{first:"首页",first_title:"首页",last:"尾页",last_title:"尾页",prev:"上一页",prev_title:"上一页",next:"下一页",next_title:"下一页",all:"所有",page_size:"每页行数"}}}}),this.tableObj.on("rowSelectionChanged",((mt,bt,wt,yt)=>{const jt=$("#allSelectBox"),xt=$("#filterBox");mt&&mt.length>0?(xt.hide(),jt.show()):(xt.show(),jt.hide())})),this.tableObj.on("rowDblClick",(function(mt,bt){bt.toggleSelect()})),this.tableObj.on("tableBuilt",(async()=>{}))}handleDelete(mt,bt){utils.q(mt,`是否移除${bt}?`,(async()=>{await storageManager.removeCar(bt),this.getBean("ListPagePlugin").showCarNumBox(bt),this.reloadTable(null).then()}))}async handleClickDetail(mt,bt){if(r)if(bt.carNum.includes("FC2-")){const wt=this.parseMovieId(bt.url);this.getBean("Fc2Plugin").openFc2Dialog(wt,bt.carNum,bt.url)}else{if(!bt.url)return void window.open("/search?q="+bt.carNum,"_blank");utils.openPage(bt.url,bt.carNum,!1,mt)}if(l){let wt=bt.url;if(wt.includes("javdb"))if(bt.carNum.includes("FC2-")){const yt=this.parseMovieId(wt);await this.getBean("Fc2Plugin").openFc2Page(yt,bt.carNum,wt)}else window.open(wt,"_blank");else utils.openPage(bt.url,bt.carNum,!1,mt)}}async editRecord(mt){const bt=mt.carNum,wt=mt.names||"",yt=mt.url||"",jt=mt.status,xt=mt.remark||"",$t=[{value:d,text:m},{value:h,text:v},{value:g,text:y},{value:p,text:k}];clog.debug($t);const kt=` <div class="jhs-layout-8cddc29a"> <div class="jhs-layout-da303dcf"> <label class="jhs-layout-27f87d75">番号:</label> <input type="text" id="edit-carNum" value="${bt}" class="jhs-field jhs-history-edit-field" readonly> </div> <div class="jhs-layout-da303dcf"> <label class="jhs-layout-27f87d75">演员 (用空格隔开):</label> <textarea id="edit-names" class="jhs-textarea jhs-history-edit-field">${wt}</textarea> </div> <div class="jhs-layout-da303dcf"> <label class="jhs-layout-27f87d75">状态:</label> <select id="edit-status" class="jhs-select-source"> <option value="" ${jt===""?"selected":""}>-- 请选择 --</option> ${$t.map((_t=>` <option value="${_t.value}" ${jt===_t.value?"selected":""}>${_t.text}</option> `)).join("")} </select> </div> <div class="jhs-layout-da303dcf"> <label class="jhs-layout-27f87d75">链接:</label> <input type="text" id="edit-url" value="${yt}" class="jhs-field jhs-history-edit-field"> </div> <div class="jhs-layout-da303dcf"> <label class="jhs-layout-27f87d75">备注:</label> <textarea id="edit-remark" class="jhs-textarea jhs-history-edit-field">${xt}</textarea> </div> </div> `;layer.open({type:1,title:`编辑记录: ${bt}`,area:utils.getDialogArea("sm"),content:kt,btn:["保存","取消"],success:(_t,St)=>{JhsSelect.enhance(_t);const Tt=Pt=>{Pt.css("height","auto"),Pt.css("height",Pt[0].scrollHeight+15+"px")},It=$("#edit-names");It.on("input",(function(){Tt($(this))})),Tt(It);const Bt=$("#edit-remark");Bt.on("input",(function(){Tt($(this))})),Tt(Bt)},yes:async _t=>{const St=$("#edit-names").val().trim(),Tt=$("#edit-status").val(),It=$("#edit-url").val().trim(),Bt=$("#edit-remark").val().trim();if(!Tt)return show.error("请选择状态"),!1;const Pt={...mt,names:St,actionType:Tt,url:It,remark:Bt};await storageManager.updateCarInfo(Pt),this.tableObj.setData(),layer.close(_t)}})}}class $e extends X{constructor(){super(...arguments),i(this,"floorIndex",1),i(this,"isInit",!1),i(this,"$panel",null)}getName(){return"ReviewPlugin"}async initCss(){return` <style> .jhs-review-panel { min-width:0; } .jhs-panel-header { display:flex; min-height:var(--jhs-control-height); align-items:center; justify-content:space-between; gap:var(--jhs-space-3); margin-bottom:var(--jhs-space-3); } .jhs-panel-header h3 { margin:0; color:var(--jhs-text); font-size:var(--jhs-font-size-xl); } .jhs-panel-toggle { flex:none; } .jhs-review-list { display:grid; } .jhs-review-item { min-width:0; padding:var(--jhs-space-4) 0; border-bottom:1px solid color-mix(in srgb,var(--jhs-border) 55%,transparent); } .jhs-review-item:last-child { border-bottom:0; } .jhs-review-meta { display:flex; flex-wrap:wrap; align-items:center; gap:var(--jhs-space-1) var(--jhs-space-3); color:var(--jhs-text-muted); font-size:14px; } .jhs-review-author { color:var(--jhs-text); font-size:15px; font-weight:600; } .jhs-review-floor { margin-left:auto; color:var(--jhs-text-faint); } .jhs-review-content { margin:var(--jhs-space-3) 0 0; color:var(--jhs-text); font-size:16px; line-height:1.7; overflow-wrap:anywhere; white-space:pre-wrap; } .jhs-review-link { display:inline-flex; align-items:center; gap:var(--jhs-space-1); margin:0 var(--jhs-space-1); padding:2px var(--jhs-space-2); border:0; border-radius:var(--jhs-radius-pill); background:var(--jhs-accent-tint); color:var(--jhs-accent); font:inherit; font-size:var(--jhs-font-size-sm); line-height:1.5; text-decoration:none; vertical-align:baseline; cursor:pointer; } .jhs-review-link-copy { color:var(--jhs-text-muted); } .jhs-panel-state { padding:var(--jhs-space-4) 0; color:var(--jhs-text-muted); text-align:center; } .jhs-panel-footer { display:flex; justify-content:center; padding-top:var(--jhs-space-3); } .jhs-panel-end { color:var(--jhs-text-faint); font-size:var(--jhs-font-size-sm); } @media (max-width:767px) { .jhs-review-floor { width:100%; margin-left:0; } } </style>`}async handle(){if(window.isDetailPage){if(r){const mt=this.parseMovieId(window.location.href);await this.showReview(mt),await this.getBean("RelatedPlugin").showRelated($("#magnets-content"),mt)}if(l){const mt=this.getPageInfo().carNum;if(!mt)return void clog.warn("跳过 JavBus 评论解析:番号不可用");const wt=(await(async yt=>{const jt=`${U}/v2/search`,xt={"user-agent":"Dart/3.5 (dart:io)","accept-language":"zh-TW",host:"jdforrepam.com",jdsignature:await O()},$t={q:yt,page:1,type:"movie",limit:1,movie_type:"all",from_recent:"false",movie_filter_by:"all",movie_sort_by:"relevance"};return(await gmHttp.get(jt,$t,xt)).data.movies})(mt)).find((yt=>yt.number.toLowerCase()===mt.toLowerCase()));wt&&this.showReview(wt.id,$("#sample-waterfall")).then()}}}async showReview(mt,bt){const wt=await storageManager.getSetting("enableLoadReview",_),yt=bt||$("#magnets-content"),jt=$('<section class="jhs-review-panel" data-jhs-panel="reviews"></section>'),xt=$('<header class="jhs-panel-header"><h3>评论</h3></header>'),$t=$('<button type="button" id="reviewsFold" class="jhs-btn jhs-btn--secondary jhs-panel-toggle"><span class="toggle-text"></span><span class="toggle-icon" aria-hidden="true"></span></button>');xt.append($t),jt.append(xt,'<div id="reviewsContainer" class="jhs-review-list"></div>','<div id="reviewsFooter" class="jhs-panel-footer"></div>'),yt.append(jt),this.$panel=jt,this.updateToggle($t,wt===_),$t.on("click",(kt=>{kt.preventDefault(),kt.stopPropagation();const _t=$t.find(".toggle-text").text()==="展开";this.updateToggle($t,_t),jt.find("#reviewsContainer, #reviewsFooter").toggle(_t),_t&&!this.isInit&&(this.fetchAndDisplayReviews(mt),this.isInit=!0),storageManager.saveSettingItem("enableLoadReview",_t?_:C)})),wt===_?(await this.fetchAndDisplayReviews(mt),this.isInit=!0):jt.find("#reviewsContainer, #reviewsFooter").hide()}updateToggle(mt,bt){mt.attr("aria-expanded",String(bt)),mt.find(".toggle-text").text(bt?"折叠":"展开"),mt.find(".toggle-icon").text(bt?"▲":"▼")}async fetchAndDisplayReviews(mt){const bt=this.$panel.find("#reviewsContainer"),wt=this.$panel.find("#reviewsFooter");bt.empty().append($('<div class="jhs-panel-state"></div>').text("获取评论中...")),wt.empty();const yt=await storageManager.getSetting("reviewCount",20);let jt;try{jt=await R(mt,1,yt)}catch($t){return $t.toString().includes("簽名已過期")&&show.error("生成签名失败, 请检查系统时间及时区是否正确!"),clog.error("获取评论失败:",$t),console.error("获取评论失败:",$t),void this.renderRetry(bt,"获取评论失败",(()=>this.fetchAndDisplayReviews(mt)))}if(bt.empty(),!jt.length)return void bt.append($('<div class="jhs-panel-state"></div>').text("无评论"));const xt=await storageManager.getReviewFilterKeywordList();this.displayReviews(jt,bt,xt),jt.length===yt&&R(mt,2,yt).catch((()=>{})),jt.length===yt?this.bindLoadMore(mt,yt,xt,bt,wt):wt.append($('<div class="jhs-panel-end"></div>').text("已加载全部评论"))}renderRetry(mt,bt,wt){mt.empty();const yt=$('<div class="jhs-panel-state"></div>').append(document.createTextNode(`${bt} `)),jt=$('<button type="button" class="jhs-btn jhs-btn--secondary jhs-btn--sm">重试</button>').on("click",wt);yt.append(jt),mt.append(yt)}bindLoadMore(mt,bt,wt,yt,jt){const xt=$('<button type="button" id="loadMoreReviews" class="jhs-btn jhs-btn--secondary">加载更多评论</button>'),$t=$('<div id="reviewsEnd" class="jhs-panel-end">已加载全部评论</div>').hide();jt.empty().append(xt,$t);let kt=1;xt.on("click",(async()=>{xt.text("加载中...").prop("disabled",!0),kt++;try{const _t=await R(mt,kt,bt);this.displayReviews(_t,yt,wt),_t.length<bt?(xt.remove(),$t.show()):xt.text("加载更多评论").prop("disabled",!1)}catch(_t){console.error("加载更多评论失败:",_t),xt.text("加载失败,请重试").prop("disabled",!1)}}))}displayReviews(mt,bt,wt){if(!mt.length)return;const yt=wt.length>0?new RegExp(wt.map((jt=>jt.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"))).join("|")):null;mt.forEach((jt=>{const xt=String(jt.content||"");if(yt?.test(xt))return;const $t=$('<article class="jhs-review-item"></article>'),kt=$('<div class="jhs-review-meta"></div>'),_t=$('<p class="review-content jhs-review-content"></p>');kt.append($("<span></span>").addClass("jhs-review-author").text(jt.username||"匿名用户"));const St=$('<span class="score-stars" aria-label="评分"></span>'),Tt=Math.max(0,Math.min(5,Number(jt.score)||0));for(let It=0;It<Tt;It++)St.append('<i class="icon-star"></i>');kt.append(St,$("<time></time>").text(utils.formatDate(jt.created_at)),$("<span></span>").text(`点赞:${Number(jt.likes_count)||0}`),$("<span></span>").addClass("jhs-review-floor").text(`#${this.floorIndex++}楼`)),this.appendReviewContent(_t,xt),$t.append(kt,_t),bt.append($t)})),this.rightClickFilter()}appendReviewContent(mt,bt){const wt=/ed2k:\/\/\|file\|[^|]+\|\d+\|[a-fA-F0-9]{32}\|\/|magnet:\?[^\s"'<>`\u4e00-\u9fa5,。?!()【】]+|https?:\/\/[^\s"'<>`\u4e00-\u9fa5,。?!()【】]+/g;let yt=0,jt;for(;jt=wt.exec(bt);)jt.index>yt&&mt.append(document.createTextNode(bt.slice(yt,jt.index))),this.appendLinkControls(mt,jt[0]),yt=jt.index+jt[0].length;yt<bt.length&&mt.append(document.createTextNode(bt.slice(yt)))}appendLinkControls(mt,bt){const wt=bt.startsWith("ed2k://"),yt=bt.startsWith("magnet:"),jt=wt?"ED2K 链接":yt?"Magnet 链接":"打开链接",xt=wt?$('<button type="button" class="jhs-btn jhs-review-link"></button>').text(jt).on("click",(()=>utils.copyToClipboard(jt,bt))):$("<a></a>").addClass("jhs-review-link").attr({href:bt,target:"_blank",rel:"noopener noreferrer"}).text(jt),$t=$('<button type="button" class="jhs-btn jhs-review-link jhs-review-link-copy">复制</button>').on("click",(()=>utils.copyToClipboard(jt,bt)));mt.append(xt,$t)}async rightClickFilter(){await storageManager.getSetting("enableTitleSelectFilter",_)===_&&utils.rightClick(document.body,".review-content",(async mt=>{const bt=window.getSelection().toString();bt&&(mt.preventDefault(),await utils.q(mt,`是否将 '${bt}' 加入评论区关键词?`,(async()=>{await storageManager.saveReviewFilterKeyword(bt),show.ok("操作成功, 刷新页面后生效")})))}))}}class ke extends X{getName(){return"FilterTitleKeywordPlugin"}async handle(){if(!isDetailPage&&!isFc2Page||await storageManager.getSetting("enableTitleSelectFilter",_)!==_)return;let mt;r?mt=".title strong, .current-title":l&&(mt="h3"),utils.rightClick(document.body,mt,(bt=>{const wt=window.getSelection().toString();if(wt){bt.preventDefault();let yt={clientX:bt.clientX,clientY:bt.clientY+80};utils.q(yt,`是否屏蔽标题关键词 ${wt}?`,(async()=>{await storageManager.saveTitleFilterKeyword(wt),window.refresh(),utils.closePage()}))}}))}}class Se extends X{getName(){return"BlacklistPlugin"}async initCss(){return`<style> .jhs-blacklist-layout { display:flex; flex-direction:column; height:100%; min-height:0; padding:var(--jhs-space-3) var(--jhs-space-4); overflow:hidden; } .jhs-blacklist-toolbar { display:flex; align-items:center; justify-content:space-between; flex-wrap:wrap; gap:var(--jhs-space-2); margin-bottom:var(--jhs-space-2); } .jhs-blacklist-toolbar__group { display:flex; align-items:center; flex-wrap:wrap; gap:var(--jhs-space-2); } .jhs-blacklist-layout #table-container { flex:1; min-height:0; } .jhs-table-counter-note { margin-left:var(--jhs-space-2); } </style>`}async addBlacklist(mt){let bt={clientX:mt.clientX,clientY:mt.clientY+80};const wt=$("#addBlacklistBtn span").text().includes("已加入");let yt,jt;if(o.includes("/tags")){const It=new URL(o);It.searchParams.delete("page");const Bt=$("#jhs-check-tag").text().trim();yt={starId:"no-"+Bt,name:"虚拟演员-"+Bt,allName:["虚拟演员"],role:"虚拟演员",movieType:Bt,blacklistUrl:It.toString()},jt=`是否将分类 <span class="jhs-task-emphasis">${Bt}</span> 加入到黑名单中?`,wt&&(jt=`分类 <span class="jhs-task-emphasis">${Bt}</span> 已在黑名单中, 是否从当前页开始追加屏蔽?`)}else yt=this.getActressPageInfo(),jt=`是否将该演员 <span class="jhs-task-emphasis">${yt.name}</span> 加入到黑名单中?`,wt&&(jt=`演员 <span class="jhs-task-emphasis">${yt.name}</span> 已在黑名单中, 是否从当前页开始追加屏蔽?`);const{starId:xt,name:$t,allName:kt,role:_t,movieType:St,blacklistUrl:Tt}=yt;if(o.includes("page")&&!o.includes("page=1")&&(jt+="<br/> 注意: 当前页面非第一页, 屏蔽数据将从此页面开始"),l){const It=o.split("/star/")[1].split("/");It.length>1&&parseInt(It[1])>1&&(jt+="<br/> 注意: 当前页面非第一页, 屏蔽数据将从此页面开始")}utils.q(bt,jt,(async()=>{const It=this.getBean("TaskPlugin");navigator.locks.request(It.singleTaskKey,{ifAvailable:!0},(async Bt=>{if(clog.debug("获取锁",Bt),Bt){this.loadObj=loading();try{await storageManager.addBlacklistItem({starId:xt,name:$t,allName:kt,role:_t,movieType:St,url:Tt}),await this.filterActorVideo($t,xt);const Pt=show.ok(`屏蔽结束,是否跳转到最后一页: ${this.lastPageLink}`,{duration:-1,close:!0,onClick:()=>{Pt.closeShow(),window.location.href=this.lastPageLink}})}catch(Pt){clog.error(Pt);const Mt=show.error("发生错误, 是否填转到解析失败的那一页? (点击并跳转)",{duration:-1,close:!0,onClick:()=>{Mt.closeShow(),window.location.href=this.nextPageLink}})}finally{this.loadObj.close()}}else show.error("当前有定时任务在后台执行中, 无法发起此操作")})).catch((Bt=>{console.error("锁任务出现错误:",Bt),clog.error("锁任务出现错误:",Bt)}))}))}async resetBtnTip(){const mt=this.getBean("TaskPlugin"),bt=localStorage.getItem(mt.lastCheckBlacklistTimeKey)||"无",wt=await storageManager.getSetting("checkBlacklist_intervalTime",12);this.checkBlacklist_ruleTime=await storageManager.getSetting("checkBlacklist_ruleTime",8760),$("#checkBlacklistBtn").attr("data-tip",`上次检测时间: ${bt}; 检测间隔时间: ${wt}小时`)}async openBlacklistDialog(){const mt=this.getBean("TaskPlugin"),bt=await storageManager.getSetting();let wt=` <div class="jhs-layout-7cb3f981"> <div class="jhs-layout-da5a4919"> <div class="jhs-layout-31a824a2"> <button type="button" id="checkBlacklistBtn" class="jhs-btn jhs-btn--danger" data-tip="上次检测时间: ${localStorage.getItem(mt.lastCheckBlacklistTimeKey)||"无"}; 检测间隔时间: ${bt.checkBlacklist_intervalTime}小时">${this.blacklistSvg} 手动检测黑名单</button> <button type="button" class="jhs-btn jhs-btn--secondary" id="toSetting">${this.settingSvg} 配置</button> </div> <div class="jhs-layout-31a824a2"> <select id="dataType" class="jhs-select-source"> <option value="" selected>所有</option> <option value="actor">男演员</option> <option value="actress">女演员</option> </select> <select id="statusType" class="jhs-select-source"> <option value="" selected>--检测状态--</option> <option value="normal">正常检测</option> <option value="stop">停止检测</option> </select> <select id="urlType" data-tip="在演员页屏蔽时,是否选择了分类" class="jhs-select-source${r?"":" jhs-is-hidden"}"> <option value="" selected>--屏蔽类型--</option> <option value="hasT">按所选分类屏蔽</option> <option value="noT">未筛选分类</option> </select> <input id="searchValue" type="text" placeholder="搜索演员" class="jhs-field"> <button type="button" id="cleanQueryBtn" class="jhs-btn jhs-btn--secondary jhs-layout-21a4fe43">重置</button> </div> </div> <div id="table-container" class="jhs-layout-d44e70c7"></div> </div> `;layer.open({type:1,title:"演员黑名单",content:wt,scrollbar:!1,area:utils.getDialogArea("xl"),anim:-1,success:async yt=>{const jt=$(yt).find(".layui-layer-content > div").first().addClass("jhs-blacklist-layout").removeAttr("style"),xt=jt.children("div").first().addClass("jhs-blacklist-toolbar").removeAttr("style");xt.children("div").addClass("jhs-blacklist-toolbar__group").removeAttr("style"),xt.find("select,input,a").removeAttr("style"),jt.find("#table-container").removeAttr("style"),JhsSelect.enhance(yt),await this.loadTableData(),$(".layui-layer-content").on("click","#cleanQueryBtn",(async $t=>{$("#searchValue").val(""),JhsSelect.setValue("#dataType",""),JhsSelect.setValue("#statusType",""),await this.reloadTable()})).on("focusout keydown","#searchValue",(async $t=>{if($t.type==="focusout"||$t.key==="Enter"){if($t.key==="Enter"&&$t.preventDefault(),$t.type==="keydown"&&$t.key!=="Enter")return;JhsSelect.setValue("#dataType",""),await this.reloadTable()}})).on("change","#dataType",(async()=>{$("#searchValue").val(""),await this.reloadTable()})).on("change","#statusType",(async()=>{await this.reloadTable()})).on("change","#urlType",(async()=>{await this.reloadTable()})).on("click","#toSetting",(()=>{this.getBean("SettingPlugin").openSettingDialog("task-panel",(()=>{$("#setting-blacklist").css({border:"1px solid var(--jhs-status-filter)"})}))})).on("click",".open-url",($t=>{$t.preventDefault();const kt=$($t.currentTarget),_t=kt.attr("data-url"),St=kt.attr("data-name");utils.openPage(_t,St,!0,$t)})).on("click","#checkBlacklistBtn",($t=>{utils.q({clientX:$t.clientX,clientY:$t.clientY+20},"是否手动检测黑名单?",(()=>{navigator.locks.request(mt.singleTaskKey,{ifAvailable:!0},(async kt=>{kt?(await mt.loadConfig(),await mt.checkBlacklist(!0)):show.error("当前有定时任务在后台执行中, 无法发起手动任务")})).catch((kt=>{console.error("锁任务出现错误:",kt),clog.error("锁任务出现错误:",kt)}))}))}))},end:()=>{this.tableObj&&(this.tableObj.destroy(),this.tableObj=null),window.refresh()}})}async reloadTable(){if(!this.tableObj)return;const mt=await this.getTableData();this.tableObj.setData(mt)}async getTableData(){const mt=this.getBean("TaskPlugin"),bt=await storageManager.getBlacklist(),wt=await storageManager.getBlacklistCarList(),yt=$("#searchValue").val(),jt=$("#statusType").val(),xt=$("#dataType"),$t=xt.val(),kt=$("#urlType").val(),_t=bt.length;let St=0,Tt=0;const It=bt.map((Mt=>{Mt.role===B?St++:Mt.role===P&&Tt++;let At=!1;return Mt.lastPublishTime&&(At=!mt.isUnnecessaryCheck(Mt.lastPublishTime,this.checkBlacklist_ruleTime)),{...Mt,isUnCheck:At}})).filter((Mt=>!(yt&&!Mt.name.includes(yt))&&(jt!=="normal"||!Mt.isUnCheck)&&!(jt==="stop"&&!Mt.isUnCheck)&&($t?Mt.role===$t:!(kt==="hasT"&&!Mt.url.includes("t="))&&(kt!=="noT"||!Mt.url.includes("t=")))));xt.html(` <option value="">所有 (${_t})</option> <option value="actor">男演员 (${St})</option> <option value="actress">女演员 (${Tt})</option> `),JhsSelect.setValue(xt,$t);const Bt=new Map;for(const Mt of wt){const At=Mt.starId;Bt.has(At)||Bt.set(At,[]),Bt.get(At).push(Mt)}const Pt=It.map((Mt=>{const At=Mt.starId,Nt=Bt.get(At)||[];return{...Mt,carList:Nt,count:Nt.length}}));return this.currentCarCount=Pt.reduce(((Mt,At)=>Mt+(At.count||0)),0),Pt}async loadTableData(){this.checkBlacklist_ruleTime=await storageManager.getSetting("checkBlacklist_ruleTime")||8760;const mt=await this.getTableData();this.tableObj=new Tabulator("#table-container",{layout:"fitColumns",placeholder:"暂无数据",virtualDom:!0,data:mt,pagination:!0,paginationMode:"local",paginationSize:20,paginationSizeSelector:[20,50,100,1e3,99999],paginationCounter:(bt,wt,yt,jt,xt)=>`演员: ${jt} 番号总数: ${this.currentCarCount} <span id="checkBlacklistMsg" class="jhs-table-counter-note"></span>`,responsiveLayout:"collapse",responsiveLayoutCollapse:!0,columnDefaults:{headerHozAlign:"center",hozAlign:"center"},index:"starId",columns:[{title:"演员",field:"name",sorter:"string",minWidth:100,responsive:0,headerSort:!1,formatter:(bt,wt,yt)=>{const jt=bt.getData();return`<a class="open-url" data-url="${jt.url}" href="${jt.url}" data-name="${jt.name}" target="_blank">${jt.name}</a>`}},{title:"性别角色",field:"role",sorter:"string",width:120,responsive:5,formatter:(bt,wt,yt)=>{const jt=bt.getData().role;let xt=jt;return jt===B?xt="男演员":jt===P&&(xt="女演员"),xt}},{title:"影视类别",field:"movieType",sorter:"string",width:120,responsive:5,formatter:(bt,wt,yt)=>{const jt=bt.getData().movieType;let xt=jt;return jt===D?xt="有码":jt===A&&(xt="无码"),xt}},{title:"屏蔽类型",field:"url",sorter:"string",minWidth:120,responsive:4,visible:r,formatter:(bt,wt,yt)=>{let jt=bt.getData().url.includes("t=");return`<span class="jhs-badge ${jt?"jhs-badge--filter":"jhs-badge--neutral"}">${jt?"按所选分类屏蔽":"未筛选分类"}</span>`}},{title:"番号数量",field:"count",sorter:"number",width:170,responsive:1},{title:"创建时间",field:"createTime",sorter:"string",width:170,responsive:5},{title:"最后发行时间",field:"lastPublishTime",sorter:"string",width:170,responsive:1},{title:"状态",field:"isUnCheck",sorter:"string",width:120,responsive:1,formatter:(bt,wt,yt)=>{let jt="",xt="正常检测";return bt.getData().isUnCheck&&(jt=`停更${this.checkBlacklist_ruleTime/24/365}年以上, 下轮任务不再进行检测`,xt="停止检测"),`<span class="jhs-badge ${jt?"jhs-badge--filter":"jhs-badge--neutral"}" data-tip="${jt}">${xt}</span>`}},{title:"操作",sorter:"string",cssClass:"action-cell-dropdown",minWidth:150,responsive:0,headerSort:!1,formatter:(bt,wt,yt)=>{const jt=bt.getData();return yt((()=>{var xt,$t;(xt=bt.getElement().querySelector(".delete-btn"))==null||xt.addEventListener("click",(kt=>{const _t=jt.name,St=jt.starId;_t?St?utils.q(kt,`是否移除对 ${_t} 的屏蔽?`,(async()=>{await storageManager.removeBlacklistCarList(St),await storageManager.deleteBlacklistItem(St),show.info("操作成功"),this.reloadTable().then()})):show.error("获取starId失败"):show.error("获取名称失败")})),($t=bt.getElement().querySelector(".keyword-btn"))==null||$t.addEventListener("click",(kt=>{const _t=jt.carList.reduce(((Tt,It)=>{const Bt=It.carNum.split("-")[0]+"-";return Tt[Bt]=(Tt[Bt]||0)+1,Tt}),{}),St=Object.entries(_t).map((([Tt,It])=>({prefix:Tt,count:It}))).sort(((Tt,It)=>It.count-Tt.count));clog.debug(St)}))})),'<button type="button" class="jhs-btn jhs-btn--danger delete-btn"><span>删除</span></button>'}}],initialSort:[{column:"createTime",dir:"desc"}],locale:"zh-cn",langs:{"zh-cn":{pagination:{first:"首页",first_title:"首页",last:"尾页",last_title:"尾页",prev:"上一页",prev_title:"上一页",next:"下一页",next_title:"下一页",all:"所有",page_size:"每页行数"}}}})}async filterAllVideo(mt,bt){let wt,yt;if(bt?(l&&bt.find(".avatar-box").length>0&&bt.find(".avatar-box").parent().remove(),wt=bt.find(this.getSelector().requestDomItemSelector),yt=bt.find(this.getSelector().nextPageSelector).attr("href")):(wt=$(this.getSelector().itemSelector),yt=$(this.getSelector().nextPageSelector).attr("href")),yt&&wt.length===0)throw show.error("解析列表失败"),new Error("解析列表失败");for(const jt of wt){const xt=$(jt),{carNum:$t,url:kt,publishTime:_t}=this.getBean("ListPagePlugin").findCarNumAndHref(xt);if(kt&&$t)try{if(await storageManager.getCar($t))continue;await storageManager.saveCar({carNum:$t,url:kt,names:mt,actionType:d,publishTime:_t}),clog.log("屏蔽演员番号",mt,$t)}catch(St){console.error(`保存失败 [${$t}]:`,St)}}if(yt){show.info("请不要关闭窗口, 正在解析下一页:"+yt),await new Promise((kt=>setTimeout(kt,500)));const jt=await gmHttp.get(yt),xt=new DOMParser,$t=$(xt.parseFromString(jt,"text/html"));await this.filterAllVideo(mt,$t)}else show.ok("执行结束!"),window.refresh()}async batchSaveAllVideos(mt,bt){let wt,yt;if(wt=$(this.getSelector().itemSelector),yt=$(this.getSelector().nextPageSelector).attr("href"),yt&&wt.length===0)throw show.error("解析列表失败"),new Error("解析列表失败");for(const jt of wt){const xt=$(jt),{carNum:$t,url:kt,publishTime:_t}=this.getBean("ListPagePlugin").findCarNumAndHref(xt);if(kt&&$t)try{if(await storageManager.getCar($t))continue;await storageManager.saveCar({carNum:$t,url:kt,names:mt,actionType:bt,publishTime:_t}),clog.log("批量操作",mt,$t,bt)}catch(St){console.error(`保存失败 [${$t}]:`,St)}}if(yt){show.info("请不要关闭窗口, 正在解析下一页:"+yt),await new Promise((kt=>setTimeout(kt,500)));const jt=await gmHttp.get(yt),xt=new DOMParser,$t=$(xt.parseFromString(jt,"text/html"));await this.batchSaveAllVideos(mt,bt)}else show.ok("执行结束!"),window.refresh()}async filterActorVideo(mt,bt,wt){let{nextPageLink:yt}=await this.parseAndSaveFilterInfo(wt,mt,bt);if(this.nextPageLink=yt,yt){let jt;this.lastPageLink=yt,show.info("请不要关闭窗口, 正在解析下一页:"+yt),clog.log("正在请求下一页内容:",yt);const xt=await gmHttp.get(yt);jt=utils.htmlTo$dom(xt),await this.filterActorVideo(mt,bt,jt)}else show.ok("执行结束!"),window.refresh()}async parseAndSaveFilterInfo(mt,bt,wt){let yt,jt;if(mt){let kt=!1,_t=T;mt.text().includes(I)&&(kt=!0,_t=I),kt&&mt.find(".avatar-box").length>0&&mt.find(".avatar-box").parent().remove(),yt=mt.find(this.getSelector(_t).requestDomItemSelector),jt=mt.find(this.getSelector(_t).nextPageSelector).attr("href")}else yt=$(this.getSelector().itemSelector),jt=$(this.getSelector().nextPageSelector).attr("href");if(jt&&yt.length===0)return{nextPageLink:null,lastPublishTime:null};let xt=[],$t=null;for(const kt of yt){const _t=$(kt),{carNum:St,url:Tt,publishTime:It}=this.getBean("ListPagePlugin").findCarNumAndHref(_t);$t||($t=It),Tt&&St&&xt.push({carNum:St,url:Tt,names:bt,actionType:d,starId:wt,publishTime:It})}try{await storageManager.batchSaveBlacklistCarList(xt)}catch(kt){clog.error("保存失败:",kt),console.error("保存失败:",kt)}return{nextPageLink:jt,lastPublishTime:$t}}}class Ce extends X{getName(){return"ListPageButtonPlugin"}async handle(){if(!window.isListPage)return;await this.createMenuBtn(),this.bindEvent();const mt=await storageManager.getSetting("autoPage"),bt=this.isHitShowPage();$("#sort-toggle-btn").prop("disabled",mt===_&&!bt).attr("title",mt===_&&!bt?"瀑布流模式仅支持默认排序":"选择列表排序方式"),(mt!==_||bt)&&await this.sortItems()}async createMenuBtn(){if(r){const mt=o.includes("/actors/");let bt=$(".main-tabs, .tabs"),wt="加入黑名单",yt="jhs-btn--filter",jt=null;if(mt){bt=$(".toolbar, .section-addition").filter(":last");const _t=await storageManager.getBlacklist(),St=this.getActressPageInfo();_t.find((Tt=>Tt.starId===St.starId))&&(wt="已加入黑名单",yt="jhs-btn--muted")}else o.includes("/tags")&&utils.loopDetector((()=>$("#jhs-check-tag").text().trim()),(async()=>{const _t=$("#addBlacklistBtn");_t.attr("data-tip","将当前分类标签加入到黑名单, 后续有作品更新也会纳入屏蔽中");const St=$("#jhs-check-tag").text().trim();if(!St)return;const Tt="no-"+St;jt=(await storageManager.getBlacklist()).find((Bt=>Bt.starId===Tt)),jt&&(_t.addClass("jhs-btn--muted").removeClass("jhs-btn--filter"),$("#addBlacklistBtn span").text("已加入黑名单"))}));o.includes("advanced_search")&&(bt=$("h2.section-title"));const $t=localStorage.getItem("jhs_sortMethod"),kt="当前排序方式: "+($t==="rateCount"?"评价人数":$t==="date"?"时间":"默认");bt.append(` <div class="jhs-list-btn-row"> <button type="button" id="waitCheckBtn" class="jhs-btn jhs-btn--secondary"><span>打开待鉴定</span></button> ${mt?` <button type="button" id="addBlacklistBtn" class="jhs-btn ${yt}" data-tip="将演员加入黑名单, 后续有作品更新也会纳入屏蔽中"><span>${wt}</span></button> <button type="button" id="filterAllVideo" class="jhs-btn jhs-btn--watch" data-tip="一键屏蔽已选分类的视频列表至鉴定记录中"><span>一键屏蔽所有作品</span></button> <button type="button" id="favoriteAllVideo" class="jhs-btn jhs-btn--fav" data-tip="一键收藏当前页面所有作品"><span>一键收藏所有作品</span></button> <button type="button" id="hasDownAllVideo" class="jhs-btn jhs-btn--down" data-tip="一键标记当前页面所有作品为已下载"><span>一键已下载所有作品</span></button> `:""} ${o.includes("/tags")?` <button type="button" id="addBlacklistBtn" class="jhs-btn ${yt}" data-tip="将演员加入黑名单, 后续有作品更新也会纳入屏蔽中"><span>${wt}</span></button> `:""} </div> <div class="jhs-list-btn-row"> <button type="button" id="newVideoBtn" class="jhs-btn jhs-btn--secondary"><span>新作品检测 (<span id="newVideoCount">0</span>)</span></button> <button type="button" id="blacklistBtn" class="jhs-btn jhs-btn--secondary"><span>演员黑名单</span></button> ${c?"":this.sortMenuHtml($t||"default",kt)} </div> `)}if(l){const mt=o.includes("/star/");let bt="加入黑名单",wt="jhs-btn--filter";if(mt){const jt=await storageManager.getBlacklist(),xt=this.getActressPageInfo();jt.find(($t=>$t.starId===xt.starId))&&(bt="已加入黑名单",wt="jhs-btn--muted")}const yt=localStorage.getItem("jhs_sortMethod")||"default";$(".masonry").parent().prepend(` <div class="jhs-list-btn-row"> <button type="button" id="waitCheckBtn" class="jhs-btn jhs-btn--secondary"><span>打开待鉴定</span></button> ${mt?` <button type="button" id="addBlacklistBtn" class="jhs-btn ${wt}" data-tip="将演员加入黑名单, 后续有作品更新也会纳入屏蔽中"><span>${bt}</span></button> <button type="button" id="filterAllVideo" class="jhs-btn jhs-btn--watch" data-tip="一键屏蔽已选分类的视频列表至鉴定记录中"><span>一键屏蔽所有作品</span></button> <button type="button" id="favoriteAllVideo" class="jhs-btn jhs-btn--fav" data-tip="一键收藏当前页面所有作品"><span>一键收藏所有作品</span></button> <button type="button" id="hasDownAllVideo" class="jhs-btn jhs-btn--down" data-tip="一键标记当前页面所有作品为已下载"><span>一键已下载所有作品</span></button> `:'<button type="button" id="blacklistBtn" class="jhs-btn jhs-btn--secondary"><span>演员黑名单</span></button>'} ${this.sortMenuHtml(yt)} </div> `)}}sortMenuHtml(mt,bt="选择列表排序方式"){const wt={default:"默认",rateCount:"评价人数",date:"时间"},yt=wt[mt]||wt.default;return`<div class="jhs-sort-control"><button type="button" id="sort-toggle-btn" class="jhs-btn jhs-btn--secondary" aria-haspopup="menu" aria-expanded="false" title="${bt}"><span id="jhs-sort-current">${yt}</span></button><div class="jhs-popover jhs-sort-menu" role="menu" aria-label="排序方式">${Object.entries(wt).map((([jt,xt])=>`<button type="button" class="jhs-btn jhs-btn--ghost jhs-sort-option" role="menuitemradio" aria-checked="${jt===mt?"true":"false"}" data-sort-method="${jt}" tabindex="-1">${xt}</button>`)).join("")}</div></div>`}bindEvent(){$("#waitCheckBtn").on("click",(bt=>{this.openWaitCheck(bt).then()})),$("#newVideoBtn").on("click",(bt=>{this.getBean("NewVideoPlugin").openDialog()})),$("#blacklistBtn").on("click",(bt=>{this.getBean("BlacklistPlugin").openBlacklistDialog()})),this.bindSortMenu();const mt=this.getBean("BlacklistPlugin");$("#addBlacklistBtn").on("click",(async bt=>{await mt.addBlacklist(bt)})),$("#filterAllVideo").on("click",(async bt=>{let wt={clientX:bt.clientX,clientY:bt.clientY+80},yt=r?$(".actor-section-name"):$(".avatar-box .photo-info .pb10");if(yt.length===0)return void show.error("获取演员名称失败");let jt=yt.text().trim().split(",")[0];utils.q(wt,"一键屏蔽视频列表?",(async()=>{this.loadObj=loading();try{await mt.filterAllVideo(jt),window.refresh()}catch(xt){console.error(xt)}finally{this.loadObj.close()}}))})),$("#favoriteAllVideo").on("click",(async bt=>{let wt={clientX:bt.clientX,clientY:bt.clientY+80},yt=r?$(".actor-section-name"):$(".avatar-box .photo-info .pb10");if(yt.length===0)return void show.error("获取演员名称失败");let jt=yt.text().trim().split(",")[0];utils.q(wt,"一键收藏所有可见作品?",(async()=>{this.loadObj=loading();try{await mt.batchSaveAllVideos(jt,h),window.refresh()}catch(xt){console.error(xt)}finally{this.loadObj.close()}}))})),$("#hasDownAllVideo").on("click",(async bt=>{let wt={clientX:bt.clientX,clientY:bt.clientY+80},yt=r?$(".actor-section-name"):$(".avatar-box .photo-info .pb10");if(yt.length===0)return void show.error("获取演员名称失败");let jt=yt.text().trim().split(",")[0];utils.q(wt,"一键已下载所有可见作品?",(async()=>{this.loadObj=loading();try{await mt.batchSaveAllVideos(jt,g),window.refresh()}catch(xt){console.error(xt)}finally{this.loadObj.close()}}))}))}bindSortMenu(){const mt=$(".jhs-sort-control"),bt=mt.find("#sort-toggle-btn"),wt=mt.find(".jhs-sort-menu"),yt=(jt=!1)=>{wt.removeClass("is-open"),bt.attr("aria-expanded","false"),jt&&bt.trigger("focus")};bt.on("click",(jt=>{jt.preventDefault(),jt.stopPropagation();const xt=!wt.hasClass("is-open");wt.toggleClass("is-open",xt),bt.attr("aria-expanded",String(xt)),xt&&wt.find('[aria-checked="true"]').trigger("focus")})),wt.on("click",".jhs-sort-option",(jt=>{const xt=$(jt.currentTarget),$t=xt.data("sort-method");localStorage.setItem("jhs_sortMethod",$t),wt.find(".jhs-sort-option").attr("aria-checked","false"),xt.attr("aria-checked","true"),$("#jhs-sort-current").text(xt.text()),yt(!0),this.sortItems().then()})).on("keydown",".jhs-sort-option",(jt=>{const xt=wt.find(".jhs-sort-option"),$t=xt.index(jt.currentTarget);if(jt.key==="Escape")return jt.preventDefault(),yt(!0);if(!["ArrowDown","ArrowUp","Home","End"].includes(jt.key))return;jt.preventDefault();const kt=jt.key==="Home"?0:jt.key==="End"?xt.length-1:jt.key==="ArrowDown"?($t+1)%xt.length:($t-1+xt.length)%xt.length;xt.eq(kt).trigger("focus")})),$(document).off("click.jhsSortMenu").on("click.jhsSortMenu",(jt=>{$(jt.target).closest(mt).length||yt()}))}async sortItems(){const mt=this.isHitShowPage();if(!mt&&(o.includes("handle")||o.includes("advanced_search")))return;const bt=await storageManager.getSetting("autoPage");if(c||bt===_&&!mt)return;const wt=localStorage.getItem("jhs_sortMethod");if(!wt)return;const yt=this.getSelector(),jt=$(yt.boxSelector),xt=$(yt.itemSelector);xt.each((function(_t){$(this).attr("data-original-index")||$(this).attr("data-original-index",_t)}));const $t=jt,kt=xt;if(wt==="default")kt.sort((function(_t,St){return $(_t).data("original-index")-$(St).data("original-index")})).appendTo($t);else{const _t=kt.get();_t.sort((function(St,Tt){if(wt==="rateCount"){const It=Bt=>{const Pt=Number($(Bt).attr("data-jhs-rate-count"));if(Number.isFinite(Pt))return Pt;const Mt=$(Bt).find(".score .value").text().match(/由(\d+)人/);return Mt?parseFloat(Mt[1]):0};return It(Tt)-It(St)}{const It=Bt=>{const Pt=$(Bt).attr("data-jhs-publish-time")||$(Bt).find(".meta").text().trim()||$(Bt).find("date").filter((function(){return/^\d{4}-\d{1,2}-\d{1,2}$/.test($(this).text().trim())})).first().text().trim();return new Date(Pt)};return It(Tt)-It(St)}})),$t.empty().append(_t)}}isHitShowPage(){return o.includes("/advanced_search")&&new URLSearchParams(window.location.search).get("handlePlayback")==="1"}async openWaitCheck(){let mt=this.getSelector();const bt=await storageManager.getSetting("waitCheckCount",5),wt=[u,b,y,k];let yt=0;$(`${mt.itemSelector}:visible`).each(((jt,xt)=>{if(yt>=bt)return!1;const $t=$(xt);if(wt.some((St=>$t.find(`span.tag:contains('${St}')`).length>0)))return;const{carNum:kt,aHref:_t}=this.getBean("ListPagePlugin").findCarNumAndHref($t);if(kt.includes("FC2-")){const St=this.parseMovieId(_t);this.getBean("Fc2Plugin").openFc2Page(St,kt,_t)}else{let St=_t+(_t.includes("?")?"&autoPlay=1":"?autoPlay=1");window.open(St)}yt++})),yt===0&&show.info("没有需鉴定的视频")}}const _e=async(Ct,mt="ja",bt="zh-CN")=>{if(!Ct)throw new Error("翻译文本不能为空");const wt="https://translate-pa.googleapis.com/v1/translate?"+new URLSearchParams({"params.client":"gtx",dataTypes:"TRANSLATION",key:"AIzaSyDLEeFI5OtFBwYBIoK_jj5m32rZK5CkCXA","query.sourceLanguage":mt,"query.targetLanguage":bt,"query.text":Ct}),yt=await fetch(wt);if(!yt.ok)throw new Error(`${yt.status} ${yt.statusText}`);return(await yt.json()).translation},Te={IS_FILTERED:{text:u,color:"var(--jhs-status-filter)",on:"var(--jhs-status-filter-on)",reasonType:"单番号屏蔽",isCounted:!0,countKey:"currentPageFilterCount"},IS_FAVORITE:{text:b,color:"var(--jhs-status-fav)",on:"var(--jhs-status-fav-on)",reasonType:"",isCounted:!0,countKey:"currentPageFavoriteCount"},IS_HAS_DOWN:{text:y,color:"var(--jhs-status-down)",on:"var(--jhs-status-down-on)",reasonType:"",isCounted:!0,countKey:"currentPageHasDownCount"},IS_HAS_WATCH:{text:k,color:"var(--jhs-status-watch)",on:"var(--jhs-status-watch-on)",reasonType:"",isCounted:!0,countKey:"currentPageHasWatchCount"},IS_KEYWORD_FILTER:{text:"关键词屏蔽",color:"var(--jhs-status-filter)",on:"var(--jhs-status-filter-on)",reasonType:"",isCounted:!0,countKey:"currentPageKeywordFilterCount"},IS_ACTOR_FILTER:{text:"男演员屏蔽",color:"var(--jhs-status-filter)",on:"var(--jhs-status-filter-on)",reasonType:"",isCounted:!0,countKey:"currentPageActorFilterCount"},IS_ACTRESS_FILTER:{text:"女演员屏蔽",color:"var(--jhs-status-filter)",on:"var(--jhs-status-filter-on)",reasonType:"",isCounted:!0,countKey:"currentPageActorFilterCount"},IS_WAIT_CHECK:{text:"",color:"",on:"",reasonType:"",isCounted:!0,countKey:"currentPageWaitCheckCount"}};class Ie extends X{async initCss(){return"<style>.status-tag{position:absolute;z-index:10;margin-right:5px;padding:0 5px;border-radius:10px}.status-tag .tag{color:inherit!important}.jhs-jump-page-input{width:60px;margin-left:10px}.jhs-jump-page-btn{margin-left:5px}</style>"}constructor(){super(...arguments),i(this,"currentPageFilterCount",0),i(this,"currentPageFavoriteCount",0),i(this,"currentPageHasDownCount",0),i(this,"currentPageHasWatchCount",0),i(this,"currentPageKeywordFilterCount",0),i(this,"currentPageActorFilterCount",0),i(this,"currentPageWaitCheckCount",0),i(this,"currentPageTotalCount",0),i(this,"cache",localStorage.getItem("jhs_translate")?JSON.parse(localStorage.getItem("jhs_translate")):{}),i(this,"writeQueue",Promise.resolve()),i(this,"_debouncedTranslateWrite",null)}getName(){return"ListPagePlugin"}async handle(){new BroadcastChannel("channel-refresh").addEventListener("message",(async mt=>{let bt=mt.data.type;if(bt==="refresh"){await this.doFilter(),this.applyVisibility();const wt=this.getBean("HistoryPlugin");wt.tableObj&&wt.tableObj.setData();const yt=this.getBean("NewVideoPlugin");yt&&(yt.showNewVideoCount().then(),yt.loadData())}else bt==="cleanCache_filter_actor_actress_car_list"?storageManager._invalidateCache(storageManager.blacklist_car_list_key):bt==="clean_cacheSettingObj"&&storageManager._invalidateCache(storageManager.setting_key)})),this.cleanRepeatId(),this.replaceHdImg(),this.addJumpPageControl(),this.fixBusTitleBox(),await this.doFilter(),this.createQuickFilter(),this.applyVisibility(),this.bindClick().then(),this.rememberTagExpand(),$(this.getSelector().itemSelector+" a").attr("target","_blank"),this.checkDom()}createQuickFilter(){if($("#jhs-quick-filter").length)return;const mt=this.getSelector(),bt=` <div id="jhs-quick-filter" class="jhs-segmented" role="tablist" aria-label="状态筛选"> <button type="button" role="tab" class="jhs-btn jhs-segmented__item" aria-selected="false" data-jhs-filter="all">全部</button> <button type="button" role="tab" class="jhs-btn jhs-segmented__item active" aria-selected="true" data-jhs-filter="waitCheck">待鉴定</button> <button type="button" role="tab" class="jhs-btn jhs-segmented__item" aria-selected="false" data-jhs-filter="favorite">已收藏</button> <button type="button" role="tab" class="jhs-btn jhs-segmented__item" aria-selected="false" data-jhs-filter="hasDown">已下载</button> <button type="button" role="tab" class="jhs-btn jhs-segmented__item" aria-selected="false" data-jhs-filter="hasWatch">已观看</button> <button type="button" role="tab" class="jhs-btn jhs-segmented__item" aria-selected="false" data-jhs-filter="filter">已屏蔽</button> </div>`;r?$(mt.boxSelector).before(bt):l&&$(".masonry").before(bt);const wt=this;this.activeQuickFilter="waitCheck",this.applyQuickFilter("waitCheck"),$("#jhs-quick-filter").on("click",".jhs-segmented__item",(function(){const yt=$(this).data("jhs-filter");$("#jhs-quick-filter .jhs-segmented__item").removeClass("active").attr("aria-selected","false"),$(this).addClass("active").attr("aria-selected","true"),wt.activeQuickFilter=yt,wt.applyQuickFilter(yt)}))}applyVisibility(){const mt=this.activeQuickFilter||"waitCheck",bt=this.getSelector().itemSelector,wt=["filter","keywordFilter","actorFilter"];$(bt).each((function(){const yt=$(this),jt=yt.attr("data-hide")==="yes",xt=yt.attr("data-jhs-status")||"waitCheck";if(mt==="all"){wt.includes(xt)?yt.hide():yt.show();return}if(xt===mt){yt.show();return}jt||xt!==mt?yt.hide():yt.show()}))}applyQuickFilter(mt){this.activeQuickFilter=mt,this.applyVisibility()}rememberTagExpand(){if(!window.location.href.includes("actors"))return;const mt=$(".tag-expand");if(mt.length===0)return;const bt="jhs_tag_expand",wt=localStorage.getItem(bt)==="true",yt=$(".actor-tags .content");wt&&yt.hasClass("collapse")&&mt[0].click(),mt.on("click",(function(){const jt=!$(".actor-tags .content").hasClass("collapse");clog.debug("触发"),localStorage.setItem(bt,jt.toString())}))}checkDom(){if(!window.isListPage)return;const mt=this.getSelector(),bt=document.querySelector(mt.boxSelector);if(!bt)return void console.error("没有找到容器节点!");let wt=null;new MutationObserver((()=>{wt&&clearTimeout(wt),wt=setTimeout((async()=>{this.replaceHdImg(),this.addJumpPageControl(),this.fixBusTitleBox(),await this.doFilter(),this.applyVisibility(),await this.getBean("ListPageButtonPlugin").sortItems(),this.getBean("CoverButtonPlugin").addSvgBtn(),$(this.getSelector().itemSelector+" a").attr("target","_blank"),this.getBean("AutoPagePlugin").checkLoad()}),100)})).observe(bt,{childList:!0,subtree:!1})}fixBusTitleBox(){l&&$(this.getSelector().itemSelector).toArray().forEach((mt=>{var bt;let wt=$(mt);if(wt.find(".avatar-box").length>0)return;const yt=((bt=wt.find("img").attr("title"))==null?void 0:bt.trim())||"";wt.find(".photo-info span:first").contents().first().wrap(`<span class="video-title" title="${yt}">${yt}</span>`),wt.find("br").remove()}))}cleanRepeatId(){if(!l)return;$("#waterfall_h").removeAttr("id").attr("id","no-page");const mt=$('[id="waterfall"]');mt.length!==0&&mt.each((function(){const bt=$(this);bt.hasClass("masonry")||(bt.children().insertAfter(bt),bt.remove())}))}async doFilter(){if(!window.isListPage)return;let mt=$(this.getSelector().itemSelector).toArray();mt.length&&(await this.filterMovieList(mt),l&&setTimeout((()=>{this.getBean("BusImgPlugin").logImageHeightsByRow().catch((bt=>clog.error("JavBus图片高度修正失败",bt)))})))}async yieldListFrame(){await new Promise((mt=>{window.requestAnimationFrame?window.requestAnimationFrame((()=>setTimeout(mt))):setTimeout(mt)}))}findMatchedTitleKeyword(mt,bt,wt){for(const yt of mt)if(bt.includes(yt)||wt.startsWith(yt))return yt;return null}getStatusKey(mt){return mt===Te.IS_FILTERED?"filter":mt===Te.IS_FAVORITE?"favorite":mt===Te.IS_HAS_DOWN?"hasDown":mt===Te.IS_HAS_WATCH?"hasWatch":mt===Te.IS_KEYWORD_FILTER?"keywordFilter":mt===Te.IS_ACTOR_FILTER||mt===Te.IS_ACTRESS_FILTER?"actorFilter":"waitCheck"}async translateListItems(mt){for(let bt=0;bt<mt.length;bt++)bt>0&&bt%8==0&&await this.yieldListFrame(),await this.translate(mt[bt])}async filterMovieList(mt){utils.time("累计耗费时间"),utils.time("读取数据耗时");const[bt,wt,yt,jt,xt]=await Promise.all([storageManager.getTitleFilterKeyword(),storageManager.getBlacklistMap(),storageManager.getBlacklistCarList(),storageManager.getSetting(),storageManager.getStatusMap()]),$t=utils.time("读取数据耗时");utils.time("组装数据耗时");const kt=wt,{actorCarNumToNameMap:_t,actressCarNumToNameMap:St}=yt.reduce(((Ot,Vt)=>{const Ut=kt.get(Vt.starId)?.role;if(!Ut)return clog.error("黑名单数据源丢失演员信息",Vt),Ot;const Jt=Ut===B?Ot.actorCarNumToNameMap:Ot.actressCarNumToNameMap;return Jt.has(Vt.carNum)||Jt.set(Vt.carNum,Vt.names),Ot}),{actorCarNumToNameMap:new Map,actressCarNumToNameMap:new Map}),Tt=utils.time("组装数据耗时"),It=jt?.showFilterItem??C,Bt=jt?.showFilterActorItem??C,Pt=jt?.showFilterKeywordItem??C,Mt=jt?.showFavoriteItem??_,At=jt?.showHasDownItem??_,Nt=jt?.showHasWatchItem??_,Dt=jt?.showAllItem??C,Lt=jt?.tagPosition||"rightTop",Et=bt.filter((Ot=>Ot));this.currentPageFilterCount=0,this.currentPageFavoriteCount=0,this.currentPageHasDownCount=0,this.currentPageHasWatchCount=0,this.currentPageKeywordFilterCount=0,this.currentPageActorFilterCount=0,this.currentPageWaitCheckCount=0,this.currentPageTotalCount=0,utils.time("处理页面耗时");const Ht=[];for(let Ot=0;Ot<mt.length;Ot++){Ot>0&&Ot%12==0&&await this.yieldListFrame();let Vt=$(mt[Ot]);if(l&&Vt.find(".avatar-box").length>0)continue;const{carNum:Ut,title:Jt}=this.findCarNumAndHref(Vt),{filter:qt,favorite:Yt,hasDown:Xt,hasWatch:se}=xt,Qt=Yt.has(Ut),ie=Xt.has(Ut),ge=se.has(Ut),Me=qt.has(Ut),Ne=_t.has(Ut),Le=St.has(Ut),Ge=Ne||Le,We=this.findMatchedTitleKeyword(Et,Jt,Ut),qe=!!We;if(!c){let Gt=Mt===C&&Qt||At===C&&ie||Nt===C&&ge||It===C&&Me&&!(Qt||ie||ge)||Bt===C&&Ge||Pt===C&&qe;const Zt=Vt.attr("data-hide")===_;Dt===_&&(Gt=!1),Gt&&!Zt?Vt.hide().attr("data-hide",_):!Gt&&Zt&&Vt.show().removeAttr("data-hide")}let Rt=Te.IS_WAIT_CHECK,Kt=null;Me?Rt=Te.IS_FILTERED:Qt?Rt=Te.IS_FAVORITE:ie?Rt=Te.IS_HAS_DOWN:ge?Rt=Te.IS_HAS_WATCH:qe?(Rt=Te.IS_KEYWORD_FILTER,Kt=We||"未知"):Ne?(Rt=Te.IS_ACTOR_FILTER,Kt=_t.get(Ut)||""):Le&&(Rt=Te.IS_ACTRESS_FILTER,Kt=St.get(Ut)||""),Kt||(Kt=Rt.reasonType),Rt.isCounted&&this[Rt.countKey]++,this.currentPageTotalCount++;const Je=this.getStatusKey(Rt),Ye=Vt.attr("data-jhs-status")!==Je||Vt.attr("data-jhs-tip")!==Kt||Vt.attr("data-jhs-tag-position")!==Lt;Vt.attr("data-jhs-status",Je).attr("data-jhs-tip",Kt).attr("data-jhs-tag-position",Lt);const aa=Lt==="rightTop"?"right: 0; top:5px;":"left: 0; top:5px;";if(Ye&&(Vt.find(".status-tag").remove(),Rt.text)){const Gt=$(r?`<span class="tag is-success status-tag" data-tip="${Kt}" title="">${Rt.text}</span>`:`<span class="jhs-badge status-tag" data-tip="${Kt}" title=""><span class="tag">${Rt.text}</span></span>`);if(Gt.css({color:Rt.on,backgroundColor:Rt.color,right:Lt==="rightTop"?0:"auto",left:Lt==="rightTop"?"auto":0,top:"5px"}),Gt.find(".tag").css("color",Rt.on),r&&Vt.find(".tags").append(Gt),l){const Zt=Vt.find(".item-tag");Zt.length?Zt.append(Gt):Vt.find(".photo-info > span > div").append(Gt)}}Ht.push(Vt)}this.translateListItems(Ht).catch((Ot=>clog.error("列表页翻译任务失败",Ot)));const Ft=utils.time("处理页面耗时"),zt=utils.time("累计耗费时间");clog.log(` <table class="countTable jhs-layout-b12542a5"> <tr> <td colspan="2" class="jhs-count-table__cell">${$t}</td> <td colspan="2" class="jhs-count-table__cell">${Tt}</td> </tr> <tr> <td colspan="2" class="jhs-count-table__cell">${Ft}</td> <td colspan="2" class="jhs-count-table__cell">${zt}</td> </tr> <tr> <td class="jhs-count-table__head">项目</td> <td class="jhs-count-table__head">数量</td> <td class="jhs-count-table__head">项目</td> <td class="jhs-count-table__head">数量</td> </tr> <tr> <td class="jhs-count-table__cell">屏蔽单番号</td> <td class="jhs-count-table__cell"><strong>${this.currentPageFilterCount}</strong></td> <td class="jhs-count-table__cell">收藏</td> <td class="jhs-count-table__cell"><strong>${this.currentPageFavoriteCount}</strong></td> </tr> <tr> <td class="jhs-count-table__cell">屏蔽演员</td> <td class="jhs-count-table__cell"><strong>${this.currentPageActorFilterCount}</strong></td> <td class="jhs-count-table__cell">已下载</td> <td class="jhs-count-table__cell"><strong>${this.currentPageHasDownCount}</strong></td> </tr> <tr> <td class="jhs-count-table__cell">屏蔽关键词</td> <td class="jhs-count-table__cell"><strong>${this.currentPageKeywordFilterCount}</strong></td> <td class="jhs-count-table__cell">已观看</td> <td class="jhs-count-table__cell"><strong>${this.currentPageHasWatchCount}</strong></td> </tr> <tr> <td class="jhs-count-table__cell">待鉴定</td> <td class="jhs-count-table__cell"><strong>${this.currentPageWaitCheckCount}</strong></td> <td class="jhs-count-table__cell"></td> <td class="jhs-count-table__cell"></td> </tr> <tr> <td class="jhs-count-table__cell"><strong>总数</strong></td> <td class="jhs-count-table__cell"><strong>${this.currentPageTotalCount}</strong></td> </tr> </table> `)}async bindClick(){let mt=this.getSelector();$(mt.boxSelector).on("click",".item img",(async bt=>{try{if(bt.preventDefault(),bt.stopPropagation(),$(bt.target).closest("div.meta-buttons").length)return;const wt=$(bt.target).closest(".item"),{carNum:yt,aHref:jt}=this.findCarNumAndHref(wt);if(yt.includes("FC2-")){let xt=this.parseMovieId(jt);this.getBean("Fc2Plugin").openFc2Dialog(xt,yt,jt),this.$currentImage=null}else utils.openPage(jt,yt,!0,bt),this.$currentImage=null}catch(wt){console.error("点击图片处理失败:",wt)}})),$(mt.boxSelector).on("click",".item video",(async bt=>{const wt=bt.currentTarget;wt.paused?wt.play().catch((yt=>console.error("播放失败:",yt))):wt.pause(),bt.preventDefault(),bt.stopPropagation()})),$(mt.boxSelector).on("click",".item .video-title",(async bt=>{if($(bt.target).closest('[class^="jhs-match-"]').length)return;const wt=$(bt.currentTarget).closest(".item"),{carNum:yt,aHref:jt}=this.findCarNumAndHref(wt);if(yt.includes("FC2-")){bt.preventDefault();let xt=this.parseMovieId(jt);this.getBean("Fc2Plugin").openFc2Dialog(xt,yt,jt)}})),$(mt.boxSelector).on("contextmenu",".item img, .item video",(async bt=>{try{bt.preventDefault();const wt=$(bt.target).closest(".item"),{carNum:yt,url:jt,publishTime:xt}=this.findCarNumAndHref(wt);let $t=r?$(".actor-section-name"):$(".avatar-box .photo-info .pb10"),kt="";$t.length&&(kt=$t.text().trim().split(",")[0].replace("(無碼)","")),utils.q(bt,`是否屏蔽番号 ${yt}?`,(async()=>{try{kt||(kt=await this.parseActressName(jt)),await storageManager.saveCar({carNum:yt,url:jt,names:kt,actionType:d,publishTime:xt}),window.refresh(),show.ok("操作成功")}catch(_t){console.error("屏蔽操作失败:",_t),show.error("操作失败")}}))}catch(wt){console.error("右键菜单处理失败:",wt)}}))}async parseActressName(mt){let bt=null;if(await storageManager.getSetting("enableSaveActressCarInfo",C)===_){clog.debug("鉴定补录演员信息-已启用, 开始解析详情页"),clog.debug("开始解析演员详情页",mt);const wt=await gmHttp.get(mt),yt=utils.htmlTo$dom(wt);r?bt=yt.find(".female").prev().map(((jt,xt)=>$(xt).text())).get().join(" "):l&&(bt=yt.find('span[onmouseover*="star_"] a').map(((jt,xt)=>$(xt).text())).get().join(" ")),clog.debug("解析到名称:",bt)}return bt}findCarNumAndHref(mt){var bt,wt;let yt,jt,xt,$t=mt.find("a"),kt=$t.attr("href"),_t=mt.find(".video-title");if(_t.length>0){let St=_t.find("strong");St.length>0&&(yt=St.text().trim()),jt=$t.attr("title")?$t.attr("title").trim():yt?_t.text().replace(yt,"").trim():_t.text().trim(),xt=mt.find(".meta").text().trim()}if(!yt){let St=mt.find("img");kt&&St.length>0&&(jt=((bt=St.attr("title"))==null?void 0:bt.trim())||((wt=St.attr("data-title"))==null?void 0:wt.trim()));const Tt=It=>/^\d{4}-\d{1,2}-\d{1,2}$/.test(It);xt=mt.find("date").map(((It,Bt)=>$(Bt).text().trim())).get().find(Tt),yt=mt.find("date").map(((It,Bt)=>$(Bt).text().trim())).get().find((It=>!Tt(It)))}if(!yt){const St="提取番号信息失败";throw show.error(St),new Error(St)}return{carNum:yt,aHref:kt,url:kt,title:jt,publishTime:xt}}showCarNumBox(mt){const bt=$(".movie-list .item").toArray().find((wt=>$(wt).find(".video-title strong").text()===mt));if(bt){const wt=$(bt);wt.attr("data-hide")==="yes"&&(wt.show(),wt.removeAttr("data-hide"))}}_replaceSingleHdImg(mt){if(mt.dataset.hdReplaced!=="true"){if(r){if(/jdbstatic\.com|javdb\.com/i.test(mt.src)){const wt=mt.src;mt.src=mt.src.replace("thumbs","covers"),mt.dataset.hdReplaced="true",mt.title="",mt.onerror=function(){this.src!==wt&&(this.src=wt,this.onerror=null)}}}else if(l){const bt=/\/(imgs|pics)\/(thumb|thumbs)\//,wt=/(\.jpg|\.jpeg|\.png)$/i;bt.test(mt.src)?(mt.src=mt.src.replace(bt,"/$1/cover/").replace(wt,"_b$1"),mt.dataset.hdReplaced="true",mt.dataset.title=mt.title,mt.title=""):/ps(\.jpg|\.jpeg|\.png)$/i.test(mt.src)&&(mt.src=mt.src.replace(/ps(\.jpg|\.jpeg|\.png)$/i,"pl$1"),mt.dataset.hdReplaced="true",mt.dataset.title=mt.title,mt.title="")}}}replaceHdImg(mt){if(mt&&typeof mt.jquery=="string"&&(mt=mt.toArray()),mt||(mt=document.querySelectorAll(this.getSelector().coverImgSelector)),!mt.length)return;const bt=Array.from(mt),wt=bt.slice(0,12),yt=bt.slice(12);if(wt.forEach((jt=>this._replaceSingleHdImg(jt))),yt.length&&"IntersectionObserver"in window){const jt=new IntersectionObserver((xt=>{xt.forEach(($t=>{$t.isIntersecting&&(this._replaceSingleHdImg($t.target),jt.unobserve($t.target))}))}),{rootMargin:"200px"});yt.forEach((xt=>jt.observe(xt)))}else yt.forEach((jt=>this._replaceSingleHdImg(jt)));storageManager.getSetting("hoverBigImg",C).then((jt=>{jt===_&&(window.imageHoverPreviewObj?window.imageHoverPreviewObj.bindEvents():window.imageHoverPreviewObj=new ImageHoverPreview({selector:this.getSelector().coverImgSelector}))}))}async translate(mt){if(await storageManager.getSetting("translateTitle",_)!==_)return;let bt,wt,yt=mt.find(".video-title");if(r?(bt=yt.contents().filter(((jt,xt)=>xt.nodeType===3&&xt.textContent.trim()!=="")).text().trim(),wt=mt.find(".video-title strong").text().trim()):(bt=mt.find("img").attr("data-title").trim(),wt=mt.find("a").attr("href").split("/").filter(Boolean).pop().trim()),this.cache[wt]){let jt=this;return yt.contents().each((function(){this.nodeType===3&&this.textContent.trim()!==""&&(this.textContent=" "+jt.cache[wt]+" ")})),void yt.attr("title",jt.cache[wt])}_e(bt).then((jt=>{r?(yt.contents().each((function(){this.nodeType!==3||this.textContent.trim()===""||this.textContent.includes(wt)||(this.textContent=" "+jt+" ")})),yt.attr("title",jt)):yt.text(jt),this.cache[wt]=jt,this._debouncedTranslateWrite&&clearTimeout(this._debouncedTranslateWrite),this._debouncedTranslateWrite=setTimeout((()=>{localStorage.setItem("jhs_translate",JSON.stringify(this.cache))}),500)})).catch((jt=>{console.error("翻译失败:",jt)}))}async revertTranslation(){$(this.getSelector().itemSelector).toArray().forEach((mt=>{let bt=$(mt);const wt=bt.find(".box").attr("title")||bt.find(".video-title").attr("title")||bt.find("img").attr("data-title");let yt;r&&(yt=bt.find(".video-title strong").text().trim());const jt=bt.find(".video-title");jt.contents().each((function(){this.nodeType!==3||this.textContent.trim()===""||this.textContent.includes(yt)||(this.textContent=" "+wt+" ")})),jt.removeAttr("title")}))}addJumpPageControl(){const mt="gemini-jump-page-control";if($("#"+mt).length>0||$(".pagination-link.is-current").length===0)return;const bt=utils.getUrlParam(o,"page")||1,wt=$('<input type="number" class="jhs-field jhs-jump-page-input">',{id:"jumpPageInput",placeholder:"页码",min:"1",value:bt+1}),yt=$('<button type="button" class="jhs-btn jhs-btn--secondary jhs-jump-page-btn">',{text:"跳转"}),jt=$("<li>",{id:mt}).append(wt).append(yt);$(".pagination-list").append(jt);const xt=()=>{const $t=parseInt(wt.val(),10);if(isNaN($t)||$t<1)return void wt.focus();const kt=new URL(window.location.href);kt.searchParams.set("page",$t.toString()),window.location.href=kt.toString()};yt.on("click",xt),wt.on("keypress",(function($t){$t.which===13&&(xt(),$t.preventDefault())}))}}class Be extends X{constructor(){super(...arguments),i(this,"preloadDistance",500),i(this,"currentPage",this.getInitialPageNumber()),i(this,"pageItems",[])}getName(){return"AutoPagePlugin"}async initCss(){return` <style> .jhs-scroll { text-align: center; padding-top: 20px; font-size: 14px; } .jhs-scroll.waterfall-loading { color: var(--jhs-text); } .jhs-scroll.waterfall-error { color: var(--jhs-status-filter); cursor: pointer; } .jhs-scroll.waterfall-no-more { color: var(--jhs-status-down); } </style> `}async handle(){this.waterfall().then()}getInitialPageNumber(){if(l){const mt=o.match(/\/(page|star\/[^/]+)\/(\d+)/);return mt?parseInt(mt[2],10):1}if(r){const mt=o.match(/[?&]page=(\d+)/);return mt?parseInt(mt[1],10):1}return 1}async waterfall(){if(await this.shouldDisablePaging())return;const mt=this.getSelector();if(this.container=document.querySelector(mt.boxSelector),!this.container)return void console.error("没有找到容器节点,停止瀑布流!");this.loader=document.createElement("div"),this.loader.className="jhs-scroll",this.container.parentNode.insertBefore(this.loader,this.container.nextSibling),this.pageItems.push({page:this.currentPage,top:0,url:window.location.href}),this.loader.addEventListener("click",(()=>{this.loader.classList.contains("waterfall-error")&&this.loadNextPage().then()})),(()=>{let wt=!1;window.addEventListener("scroll",(()=>{wt||(wt=!0,requestAnimationFrame((()=>{this.checkLoad(),this.checkScrollPosition(),wt=!1})))}))})();const bt=document.querySelector(mt.nextPageSelector);this.nextUrl=bt?.href,this.hasMore=!!this.nextUrl,setTimeout((()=>{this.checkLoad()}),1e3),this.hasMore||this.setState("waterfall-no-more","已经到底了")}async loadNextPage(){var mt;if(await storageManager.getSetting("autoPage",_)===C)return void this.setState("waterfall-loading","");if(this.isLoading||!this.nextUrl)return;this.isLoading=!0,this.setState("waterfall-loading","加载中...");const bt=this.getSelector();try{const wt=await gmHttp.get(this.nextUrl);clog.log("请求下一页内容:",this.nextUrl);const yt=utils.htmlTo$dom(wt);l&&yt.find(".avatar-box").length>0&&yt.find(".avatar-box").parent().remove();let jt=yt.find(this.getSelector().requestDomItemSelector);const xt=this.getBoxCarInfoList(),$t=this.getBoxCarInfoList(jt);if(this.checkDuplicateCarNumbers(xt,$t))return this.nextUrl=null,this.hasMore=!1,void this.setState("waterfall-error","翻页内容出现重复数据, 页码受JavDB限制, 已停止瀑布流");const kt=this.container.scrollHeight;this.pageItems.push({page:this.currentPage+1,top:kt,url:this.nextUrl});const _t=this.getBean("ListPagePlugin");let St=yt.find(this.getSelector().coverImgSelector);_t.replaceHdImg(St),$(this.getSelector().boxSelector).append(jt),this.nextUrl=(mt=yt.find(bt.nextPageSelector))==null?void 0:mt.attr("href"),this.hasMore=!!this.nextUrl;let Tt=yt.find(".pagination");$(".pagination").replaceWith(Tt),this.setState("waterfall-loading",""),this.hasMore||this.setState("waterfall-no-more","已经到底了")}catch(wt){clog.error("加载失败:",wt),this.setState("waterfall-error","加载失败,点击重试")}finally{this.isLoading=!1}}checkScrollPosition(){const mt=window.scrollY;for(let bt=this.pageItems.length-1;bt>=0;bt--){const wt=this.pageItems[bt];if(mt>=wt.top){this.currentPage!==wt.page&&(this.currentPage=wt.page,this.updatePageUrl(wt.url));break}}}checkLoad(){this.loader&&this.loader.getBoundingClientRect().top<window.innerHeight+this.preloadDistance&&this.loadNextPage().then()}async shouldDisablePaging(){return window.isListPage?(await storageManager.getSetting("autoPage",_),["search?q","handlePlayback=1","handleTop=1","/want_watch_videos","/watched_videos","/advanced_search?type=100"].some((mt=>o.includes(mt)))):!0}updatePageUrl(mt){window.history.replaceState({},"",mt),l&&(document.title=document.title.replace(/第\d+頁/,`第${this.currentPage}頁`))}setState(mt,bt){this.loader.className=`jhs-scroll ${mt}`,this.loader.textContent=bt}}class De{constructor(mt,bt,wt){this.davUrl=mt.endsWith("/")?mt:mt+"/",this.username=bt,this.password=wt,this.folderName=null}_getAuthHeaders(){return{Authorization:`Basic ${btoa(`${this.username}:${this.password}`)}`,Depth:"1"}}_sendRequest(mt,bt,wt={},yt){return new Promise(((jt,xt)=>{const $t=this.davUrl+bt,kt={...this._getAuthHeaders(),...wt};GM_xmlhttpRequest({method:mt,url:$t,headers:kt,data:yt,onload:_t=>{_t.status>=200&&_t.status<300?jt(_t):(console.error(_t),xt(new Error(`请求失败 ${_t.status}: ${_t.statusText}`)))},onerror:_t=>{console.error("请求WebDav发生错误:",_t),xt(new Error("请求WebDav失败, 请检查服务是否启动, 凭证是否正确"))}})}))}async _ensureFolder(mt){try{await this._sendRequest("MKCOL",mt)}catch(bt){if(!/请求失败 (405|409):/.test(bt.message))throw bt}}async backup(mt,bt,wt){await this._ensureFolder(mt);const yt=mt+"/"+bt;await this._sendRequest("PUT",yt,{"Content-Type":"text/plain"},wt)}async getFileList(mt){var bt,wt,yt;const jt=(await this._sendRequest("PROPFIND",mt,{"Content-Type":"application/xml"},`<?xml version="1.0"?> <d:propfind xmlns:d="DAV:"> <d:prop> <d:displayname /> <d:getcontentlength /> <d:creationdate /> <d:getlastmodified /> <d:iscollection /> </d:prop> </d:propfind> `)).responseText,xt=new DOMParser().parseFromString(jt,"text/xml").getElementsByTagNameNS("DAV:","response"),$t=[];for(let kt=0;kt<xt.length;kt++){if(kt===0)continue;let _t=xt[kt];const St=_t.getElementsByTagNameNS("DAV:","displayname")[0].textContent,Tt=((bt=_t.getElementsByTagNameNS("DAV:","getcontentlength")[0])==null?void 0:bt.textContent)||"0",It=((wt=_t.getElementsByTagNameNS("DAV:","creationdate")[0])==null?void 0:wt.textContent)||((yt=_t.getElementsByTagNameNS("DAV:","getlastmodified")[0])==null?void 0:yt.textContent)||"";Tt!=="0"&&$t.push({fileId:St,name:St,size:Number(Tt),createTime:It})}return $t.reverse(),$t}async deleteFile(mt){let bt=this.folderName+"/"+encodeURI(mt);await this._sendRequest("DELETE",bt,{"Cache-Control":"no-cache"})}async getBackupList(mt){return this.folderName=mt,await this._ensureFolder(mt),this.getFileList(mt)}async getFileContent(mt){let bt=this.folderName+"/"+mt;return(await this._sendRequest("GET",bt,{Accept:"application/octet-stream"})).responseText}}function buildSettingCss(Ct,mt,bt,wt){let yt;return bt?yt=` .container-fluid .row{ max-width: 1000px !important; min-width: ${Ct}%; margin: auto auto; } .container { max-width: 1000px !important; min-width: 80%; margin: auto auto; } .masonry { grid-template-columns: repeat(${mt}, minmax(0, 1fr)); } `:yt=` section .container{ max-width: 1000px !important; min-width: ${Ct}%; } .movie-list, .movie-list.v{ grid-template-columns: repeat(${mt}, minmax(0, 1fr)); } `,` <style> ${yt} .nav-btn::after { content:none !important; } #cache-data-display pre { font-family: Consolas, Monaco, 'Andale Mono', monospace; white-space: pre-wrap; word-wrap: break-word; line-height: 1.5; color: var(--jhs-text); border: 1px solid var(--jhs-border); } .cache-item { transition: all 0.2s ease; } .cache-item:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.1); transform: translateY(-2px); } .cache-item { padding:var(--jhs-space-3); border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-md); } .cache-item__title { margin-bottom:var(--jhs-space-2); color:var(--jhs-text); font-weight:700; } .cache-item__actions, .jhs-inline-fields { display:flex; gap:var(--jhs-space-2); } .cache-item__actions > * { flex:1; text-align:center; } .jhs-setting-label-inline { display:flex; align-items:center; gap:var(--jhs-space-1); } .jhs-setting-toggle-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--jhs-space-2); } .jhs-setting-toggle-grid label { display:flex; align-items:center; gap:var(--jhs-space-2); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-xs); } .jhs-cache-preview { max-height:400px; padding:var(--jhs-space-3); overflow:auto; border-radius:var(--jhs-radius-sm); background:var(--jhs-surface-2); } .keyword-label { display: inline-flex; align-items: center; padding: 4px 8px; border-radius: var(--jhs-radius-sm); font-size: 14px; position: relative; margin-left: 8px; margin-bottom: 5px; } .keyword-remove { margin-left: 6px; cursor: pointer; font-size: 12px; line-height: 1; } .keyword-input { padding: 6px 12px; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-sm); font-size: 14px; float:right; } .add-tag-btn { padding: 6px 12px; background-color: var(--jhs-surface-2); color: var(--jhs-text); border: none; border-radius: var(--jhs-radius-sm); cursor: pointer; font-size: 14px; margin-left: 8px; float:right; } .add-tag-btn:hover { background-color: var(--jhs-border-strong); } .tag-box { margin-top:15px; } .simple-setting, .mini-simple-setting { display: none; background: var(--jhs-surface); position: absolute; top: ${wt?"35px":"25px"}; right: 0; z-index: 1000; border: 1px solid var(--jhs-border); border-radius: var(--jhs-radius-sm); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); padding: 0; margin-top: 5px; color: var(--jhs-text); width: min(360px, calc(100vw - 16px)); max-height: min(720px, calc(100vh - 16px)); } .simple-setting__panel { display:flex; max-height:inherit; flex-direction:column; } .simple-setting__scroll { min-height:0; padding:var(--jhs-space-2) var(--jhs-space-3); overflow-y:auto; } .simple-setting__footer { display:flex; justify-content:flex-end; gap:var(--jhs-space-2); padding:var(--jhs-space-3); border-top:1px solid var(--jhs-border); } .simple-setting__list { display:grid; } .simple-setting .jhs-setting-row { grid-template-columns:minmax(0,1fr) auto; gap:var(--jhs-space-3); min-height:48px; padding:var(--jhs-space-2) 0; border-bottom:1px solid var(--jhs-border); } .simple-setting .jhs-setting-row:last-child { border-bottom:0; } .simple-setting .jhs-setting-row__control { width:auto; justify-self:end; } .simple-setting .jhs-setting-row__description { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .jhs-setting-nav-item { position:relative; } .jhs-nav-button { padding-right:15px !important; } .jhs-mini-setting-box { position:relative; margin-left:auto; } .jhs-mini-setting-trigger { padding-left:0 !important; padding-right:0 !important; } .jhs-setting-anchor { position:relative; display:flex; flex-grow:1; justify-content:flex-end; z-index:12345679 !important; } .jhs-setting-detail-anchor { margin-top:var(--jhs-space-5); } .jhs-more-tools-panel { display:none; } .jhs-backup-cards { padding:0 var(--jhs-space-1); } .jhs-table-dialog { height:100%; overflow:hidden; } .jhs-table-dialog__content { margin:auto !important; } .jhs-help-title { margin:0 0 var(--jhs-space-5); padding-bottom:var(--jhs-space-3); border-bottom:1px solid var(--jhs-border); color:var(--jhs-accent); font-size:22px; } .jhs-list-btn-row { display:flex; align-items:center; gap:var(--jhs-space-2); margin:var(--jhs-space-2) 0; } .jhs-setting-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); height: 100%; min-height: 0; background: var(--jhs-surface); } .jhs-mobile-sidebar { display: flex; min-width: 0; flex-direction: column; gap: 2px; padding: var(--jhs-space-3) var(--jhs-space-2); border-right: 1px solid var(--jhs-border); background: var(--jhs-surface-2); overflow-y: auto; } .side-menu-item { width: 100%; min-height: 36px; padding: 0 var(--jhs-space-3); border: 0; border-radius: var(--jhs-radius-sm); background: transparent; cursor: pointer; color: var(--jhs-text); display: flex; align-items: center; gap: 5px; font: inherit; font-size: var(--jhs-font-size-sm); text-align: left; transition: background-color var(--jhs-motion-fast) var(--jhs-ease), color var(--jhs-motion-fast) var(--jhs-ease); } .side-menu-item .icon { height: 24px; width: 24px; } .side-menu-item:hover { background-color: var(--jhs-surface); } .side-menu-item.active { background-color: var(--jhs-accent-tint); color: var(--jhs-accent); font-weight: 700; } .jhs-setting-main { display: flex; min-width: 0; min-height: 0; flex-direction: column; height: 100%; } .jhs-setting-body { flex: 1; min-height: 0; padding: 0 var(--jhs-space-4); overflow: hidden; } .jhs-setting-body-inner { width: min(100%, 880px); height: 100%; margin-inline: auto; } .content-panel { display: none; box-sizing: border-box; margin: 0; padding: var(--jhs-space-4) 0; height: 100%; overflow-x: hidden; overflow-y: auto; } .content-panel.active { display: block; } .jhs-setting-section + .jhs-setting-section { margin-top: var(--jhs-space-5); } .jhs-setting-section > .jhs-setting-group { overflow:visible; border:0; border-radius:0; } .jhs-setting-section__header { margin-bottom: var(--jhs-space-2); } .jhs-setting-section__header h3 { margin: 0; color: var(--jhs-text); font-size: var(--jhs-font-size-lg); } .jhs-setting-section__header p { margin: var(--jhs-space-1) 0 0; color: var(--jhs-text-muted); font-size: var(--jhs-font-size-sm); } .jhs-setting-row__copy { min-width: 0; } .jhs-setting-row__description { display: block; margin-top: var(--jhs-space-1); color: var(--jhs-text-muted); font-size: var(--jhs-font-size-sm); font-weight: 400; line-height: 1.45; } .jhs-setting-row__control { width: min(100%, 360px); justify-self: end; } .keyword-label { background:var(--jhs-surface-2); color:var(--jhs-text); } .keyword-label--link { color:var(--jhs-accent); } .jhs-setting-output { max-height: 360px; padding: var(--jhs-space-3); overflow: auto; border: 0; border-radius: var(--jhs-radius-sm); background: var(--jhs-surface-2); } .jhs-setting-output:empty { display:none; } .jhs-setting-output--compact { max-height:250px; } .jhs-setting-help { margin: 0 0 var(--jhs-space-3); color: var(--jhs-text-muted); font-size: var(--jhs-font-size-sm); } .jhs-setting-subheading { margin:var(--jhs-space-5) 0 var(--jhs-space-2); color:var(--jhs-text); font-size:var(--jhs-font-size-md); } .jhs-setting-rows { border:0; padding:0; } .jhs-setting-subtitle { margin:0; padding:var(--jhs-space-2) var(--jhs-space-4); border-bottom:1px solid var(--jhs-border); background:var(--jhs-surface-2); color:var(--jhs-text); font-size:var(--jhs-font-size-sm); } .jhs-setting-metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); margin-bottom:var(--jhs-space-3); } .jhs-setting-metric { display:grid; gap:var(--jhs-space-1); padding:var(--jhs-space-2) var(--jhs-space-3); border-right:1px solid var(--jhs-border); text-align:center; } .jhs-setting-metric:last-child { border-right:0; } .jhs-setting-metric strong { color: var(--jhs-text); font-size: var(--jhs-font-size-xl); } .jhs-setting-metric span { color: var(--jhs-text-muted); font-size: var(--jhs-font-size-xs); } .jhs-plugin-group { margin-bottom:var(--jhs-space-4); } .jhs-plugin-group__title { margin:0; padding:var(--jhs-space-2) 0; border-bottom:1px solid var(--jhs-border); color:var(--jhs-text); font-size:var(--jhs-font-size-sm); } .jhs-plugin-row { display:flex; min-height:48px; align-items:center; justify-content:space-between; gap:var(--jhs-space-3); padding:var(--jhs-space-2) 0; border-bottom:1px solid var(--jhs-border); } .jhs-plugin-row:last-child { border-bottom:0; } .jhs-plugin-copy { display:grid; min-width:0; gap:2px; } .jhs-plugin-copy strong { color:var(--jhs-text); font-size:var(--jhs-font-size-sm); } .jhs-data-table { width:100%; border-collapse:collapse; color:var(--jhs-text); font-size:var(--jhs-font-size-sm); } .jhs-data-table th { padding:var(--jhs-space-2); border-bottom:1px solid var(--jhs-border); background:var(--jhs-surface-2); text-align:left; } .jhs-data-table td { padding:var(--jhs-space-1) var(--jhs-space-2); border-bottom:1px solid var(--jhs-border); } .jhs-data-table .is-center { text-align:center; } .jhs-data-table .is-right { text-align:right; } .jhs-data-table .is-danger { color:var(--jhs-danger); } .jhs-data-table .is-warning { color:var(--jhs-warning); } .jhs-data-table .is-success { color:var(--jhs-status-down); } .jhs-data-table .is-muted { color:var(--jhs-text-faint); } .jhs-data-table .is-slow { color:var(--jhs-danger); font-weight:700; } .jhs-diagnostics { margin-top:var(--jhs-space-5); border-top:1px solid var(--jhs-border); } .jhs-diagnostics > summary { display:flex; min-height:var(--jhs-control-height); align-items:center; justify-content:space-between; padding:var(--jhs-space-3) 0; color:var(--jhs-text); font-size:var(--jhs-font-size-md); font-weight:600; cursor:pointer; } .jhs-diagnostics > summary::after { color:var(--jhs-text-muted); content:"展开"; font-size:var(--jhs-font-size-sm); font-weight:400; } .jhs-diagnostics[open] > summary::after { content:"收起"; } .jhs-diagnostics__content { padding-bottom:var(--jhs-space-3); } .jhs-empty-note { padding:var(--jhs-space-5); color:var(--jhs-text-faint); font-size:var(--jhs-font-size-sm); text-align:center; } .jhs-caption { margin:var(--jhs-space-2) 0 0; color:var(--jhs-text-faint); font-size:var(--jhs-font-size-xs); } .jhs-inline-metrics { display:flex; flex-wrap:wrap; gap:var(--jhs-space-3); margin-bottom:var(--jhs-space-2); font-size:var(--jhs-font-size-sm); } .jhs-summary-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:var(--jhs-space-2); margin-bottom:var(--jhs-space-3); } .jhs-summary-card { padding:var(--jhs-space-3); border-radius:var(--jhs-radius-md); background:var(--jhs-surface-2); text-align:center; } .jhs-summary-card strong { display:block; font-size:var(--jhs-font-size-xl); } .jhs-summary-card--success { background:var(--jhs-status-down-tint); color:var(--jhs-status-down); } .jhs-summary-card--danger { background:var(--jhs-status-filter-tint); color:var(--jhs-status-filter); } .jhs-summary-card--warning { background:var(--jhs-status-watch-tint); color:var(--jhs-status-watch); } .jhs-scroll-frame { max-height:350px; overflow:auto; border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-md); } .jhs-dialog-content { padding:var(--jhs-space-4); } .jhs-warning-note { margin-top:var(--jhs-space-3); color:var(--jhs-status-filter); font-size:var(--jhs-font-size-xs); } .jhs-health-summary { margin-bottom:var(--jhs-space-2); } .jhs-health-columns { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:var(--jhs-space-3); } .jhs-health-columns h4 { margin:0 0 var(--jhs-space-1); } .jhs-setting-footer { display: flex; flex-shrink: 0; justify-content: flex-end; gap: var(--jhs-space-2); padding: var(--jhs-space-3) var(--jhs-space-4); border-top: 1px solid var(--jhs-border); background: var(--jhs-surface); } .jhs-cache-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--jhs-space-3); margin-top: var(--jhs-space-4); } @media (max-width: 768px) { .jhs-setting-layout { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); } .jhs-mobile-sidebar { flex-direction: row; padding: var(--jhs-space-2); border-right: 0; border-bottom: 1px solid var(--jhs-border); overflow-x: auto; overflow-y: hidden; } .side-menu-item { width: auto; min-width: max-content; min-height: var(--jhs-touch-target); } .jhs-setting-body { padding-inline: var(--jhs-space-3); } .jhs-cache-grid { grid-template-columns: minmax(0, 1fr); } .jhs-summary-grid, .jhs-health-columns { grid-template-columns:minmax(0,1fr); } } input[type="checkbox"]:disabled { opacity: 0.6; cursor: default !important; } </style> `}async function applyImageMode(){if($("#verticalImgStyle").remove(),await storageManager.getSetting("enableVerticalModel",C)===_){let Ct="100% 50% !important";window.location.href.includes("/advanced_search?type=100")&&(Ct="50% 50% !important");const mt=` .cover { min-height: 350px !important; overflow: hidden !important; padding-top: 142% !important; } .cover img { object-fit: cover !important; object-position: ${Ct}; } /* bus的 */ .masonry .movie-box img { min-height: 500px !important; object-fit: cover !important; object-position: top right; } `;$("<style>").attr("id","verticalImgStyle").text(mt).appendTo("head")}else $("<style>").attr("id","verticalImgStyle").text(` .cover { min-height:auto !important; padding-top: 67% !important; } .cover img { object-fit: contain !important; object-position: 50% 50% !important } /* bus的 */ .masonry .movie-box img { min-height:auto !important; object-fit: contain !important; object-position: top; } `).appendTo("head");l&&window.getBeanForSetting("BusImgPlugin").logImageHeightsByRow()}function getPluginCategories(){const Ct={SettingPlugin:["设置中心","core"],StatsPlugin:["统计中心","core"],MobileBottomBarPlugin:["工具栏与移动操作","core"],ListPagePlugin:["列表状态处理","list"],NavBarPlugin:["JavDB 导航","list"],BusNavBarPlugin:["JavBus 导航","list"],ListPageButtonPlugin:["列表操作","list"],HighlightMagnetPlugin:["磁力标记","list"],FoldCategoryPlugin:["分类折叠","list"],AutoPagePlugin:["自动翻页","list"],HitShowPlugin:["热播榜单","list"],TOP250Plugin:["TOP 250","list"],DetailPagePlugin:["JavDB 详情页","detail"],BusDetailPagePlugin:["JavBus 详情页","detail"],DetailPageButtonPlugin:["详情操作","detail"],ReviewPlugin:["评论","detail"],RelatedPlugin:["相关影片","detail"],TranslatePlugin:["标题翻译","detail"],WantAndWatchedVideosPlugin:["想看与看过","detail"],CoverButtonPlugin:["封面快捷操作","media"],PreviewVideoPlugin:["JavDB 预览视频","media"],BusPreviewVideoPlugin:["JavBus 预览视频","media"],ScreenShotPlugin:["剧照","media"],BusImgPlugin:["JavBus 图片适配","media"],ActressInfoPlugin:["演员资料","media"],SearchByImagePlugin:["以图搜图","media"],HistoryPlugin:["鉴定记录","data"],BlacklistPlugin:["黑名单","data"],FilterTitleKeywordPlugin:["关键词筛选","data"],FavoriteActressesPlugin:["演员收藏","data"],NewVideoPlugin:["新作品检测","data"],TaskPlugin:["定时任务","data"],OtherSitePlugin:["外部站点","network"],Fc2Plugin:["FC2 详情","network"],Fc2By123AvPlugin:["FC2 123AV","network"],MagnetHubPlugin:["磁力聚合","network"],JavTrailersPlugin:["预告片","network"],SubTitleCatPlugin:["字幕搜索","network"],OneTwoThreeOfflinePlugin:["123 云盘离线","network"]},mt=(bt,wt)=>({label:wt,plugins:Object.entries(Ct).filter((yt=>yt[1][1]===bt)).map((yt=>yt[0]))});return{categories:{core:mt("core","基础核心"),list:mt("list","列表页"),detail:mt("detail","详情页"),media:mt("media","媒体"),data:mt("data","数据"),network:mt("network","网络")},corePlugins:["SettingPlugin","StatsPlugin"],pluginMeta:Ct}}function buildCacheItemsHtml(Ct){return Ct.map(mt=>` <div class="cache-item"> <div class="cache-item__title">${mt.text}</div> <div class="cache-item__actions"> <button type="button" class="jhs-btn jhs-btn--secondary clean-btn" data-key="${mt.key}" title="${mt.title}"> <span>清理</span> </button> <button type="button" class="jhs-btn jhs-btn--secondary view-btn" data-key="${mt.key}" > <span>查看</span> </button> </div> </div> `).join("")}function buildVideoQualityOptions(){let Ct="";return L.forEach(mt=>{mt.canSelect&&(Ct+=`<option value="${mt.quality}">${mt.text}</option>`)}),Ct}function buildSettingDialogHtml(Ct,mt,bt){const wt=buildCacheItemsHtml(mt),yt=buildVideoQualityOptions();return` <div class="jhs-setting-layout jhs-ui"> <nav class="jhs-mobile-sidebar" aria-label="设置分类"> <button type="button" class="jhs-btn side-menu-item ${Ct==="backup-panel"?"active":""}" data-panel="backup-panel" aria-controls="backup-panel">数据备份</button> <button type="button" class="jhs-btn side-menu-item ${Ct==="base-panel"?"active":""}" data-panel="base-panel" aria-controls="base-panel">基础配置</button> <button type="button" class="jhs-btn side-menu-item ${Ct==="filter-panel"?"active":""}" data-panel="filter-panel" aria-controls="filter-panel">屏蔽配置</button> <button type="button" class="jhs-btn side-menu-item ${Ct==="task-panel"?"active":""}" data-panel="task-panel" aria-controls="task-panel">定时任务</button> <button type="button" class="jhs-btn side-menu-item ${Ct==="domain-panel"?"active":""}" data-panel="domain-panel" aria-controls="domain-panel" title="第三方视频资源域名配置">外部网站</button> <button type="button" class="jhs-btn side-menu-item ${Ct==="cache-panel"?"active":""}" data-panel="cache-panel" aria-controls="cache-panel">清理缓存</button> </nav> <div class="jhs-setting-main"> <div class="jhs-setting-body"> <div id="backup-panel" class="content-panel ${Ct==="backup-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>数据备份</h3><p>导入、导出和远程备份 JHS 数据。</p></header><div class="jhs-setting-group"> <div class="jhs-toolbar"> <button type="button" id="importBtn" class="jhs-btn jhs-btn--secondary"><span>导入数据</span></button> <button type="button" id="exportBtn" class="jhs-btn jhs-btn--primary"><span>导出数据</span></button> </div> <div class="jhs-setting-row"> <span class="setting-label">WebDav备份</span> <div> <button type="button" id="webdavBackupListBtn" class="jhs-btn jhs-btn--secondary"><span>查看备份</span></button> <button type="button" id="webdavBackupBtn" class="jhs-btn jhs-btn--primary"><span>备份数据</span></button> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">服务地址:</span> <div class="form-content"> <input type="url" id="webDavUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">用户名:</span> <div class="form-content"> <input type="text" id="webDavUsername" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">密码:</span> <div class="form-content"> <input type="password" id="webDavPassword" class="jhs-field"> </div> </div> </div></section> </div> <div id="base-panel" class="content-panel ${Ct==="base-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>基础配置</h3><p>配置列表显示、媒体加载、网络和主题。</p></header><div class="jhs-setting-group"> <div class="jhs-setting-row"> <span class="setting-label">打开待鉴定窗口数:</span> <div class="form-content"> <input type="number" id="waitCheckCount" class="jhs-field" min="1" max="20"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">已鉴定标签展示位置:</span> <div class="form-content"> <select id="tagPosition" class="jhs-select-source"> <option value="rightTop">右上</option> <option value="leftTop">左上</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> 鉴定补录演员信息 </span> <div class="form-content"> <input type="checkbox" id="enableSaveActressCarInfo" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label"> 封面快捷按钮 </span> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> ${bt.screenSvg}长缩略图: </span> <div class="form-content"> <input type="checkbox" id="enableScreenSvg" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> ${bt.videoSvg}预览视频: </span> <div class="form-content"> <input type="checkbox" id="enableVideoSvg" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> ${bt.handleSvg}鉴定按钮: </span> <div class="form-content"> <input type="checkbox" id="enableHandleSvg" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> ${bt.siteSvg}第三方跳转: </span> <div class="form-content"> <input type="checkbox" id="enableSiteSvg" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label jhs-setting-label-inline"> ${bt.copySvg}复制按钮: </span> <div class="form-content"> <input type="checkbox" id="enableCopySvg" class="mini-switch"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">预览视频默认画质:</span> <div class="form-content"> <select id="videoQuality" class="jhs-select-source"> ${yt} </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">评论区条数:</span> <div class="form-content"> <select id="reviewCount" class="jhs-select-source"> <option value="10">10条</option> <option value="20">20条</option> <option value="30">30条</option> <option value="40">40条</option> <option value="50">50条</option> </select> </div> </div> <div class="jhs-setting-row ${r?"":"do-hide"}"> <span class="setting-label"> 高亮已收藏演员 </span> <div class="form-content"> <input type="checkbox" id="enableFavoriteActresses" class="mini-switch"> </div> </div> <div class="jhs-setting-row ${r?"":"do-hide"}"> <span id="highlightedTagLabel" class="setting-label"> 分类标签|高亮演员-边框样式: </span> <div class="form-content"> <input type="number" id="highlightedTagNumber" class="jhs-field" min="0" max="20"> <input type="color" id="highlightedTagColor"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">请求超时时间(毫秒):</span> <div class="form-content"> <input type="number" id="httpTimeout" class="jhs-field" min="1000" max="10000"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">请求失败重试次数:</span> <div class="form-content"> <input type="number" id="httpRetryCount" class="jhs-field" min="0" max="10"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label"> 启用控制台日志: </span> <div class="form-content"> <select id="enableClog" class="jhs-select-source"> <option value="no">禁用</option> <option value="yes">开启</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">日志最大行数:</span> <div class="form-content"> <input type="number" id="clogMsgCount" class="jhs-field" min="100" max="3000"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label"> 移动端模式 </span> <div class="form-content"> <select id="mobileMode" class="jhs-select-source"> <option value="auto">自动检测</option> <option value="on">强制开启</option> <option value="off">强制关闭</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label"> 外观主题 </span> <div class="form-content"> <select id="themeMode" class="jhs-select-source"> <option value="light">浅色</option> <option value="dark">深色</option> <option value="auto">跟随系统</option> </select> </div> </div> <div class="jhs-setting-row" data-description="分别控制各类已鉴定内容是否继续显示。"> <span class="setting-label">列表状态显示</span> <div class="form-content jhs-setting-toggle-grid"> <label><input type="checkbox" id="showFilterItem" class="mini-switch"><span>屏蔽单番号</span></label> <label><input type="checkbox" id="showFilterActorItem" class="mini-switch"><span>屏蔽演员</span></label> <label><input type="checkbox" id="showFilterKeywordItem" class="mini-switch"><span>屏蔽关键词</span></label> <label><input type="checkbox" id="showFavoriteItem" class="mini-switch"><span>收藏</span></label> <label><input type="checkbox" id="showHasDownItem" class="mini-switch"><span>已下载</span></label> <label><input type="checkbox" id="showHasWatchItem" class="mini-switch"><span>已观看</span></label> </div> </div> <div class="jhs-setting-row ${r?"":"do-hide"}"><span class="setting-label">加载女优信息</span><div class="form-content"><input type="checkbox" id="enableLoadActressInfo" class="mini-switch"></div></div> <div class="jhs-setting-row"><span class="setting-label">竖图模式</span><div class="form-content"><input type="checkbox" id="enableVerticalModel" class="mini-switch"></div></div> <div class="jhs-setting-row"><span class="setting-label">页面列数:<span id="showContainerColumns"></span></span><div class="form-content"><input type="range" class="jhs-range" id="containerColumns" min="2" max="10" step="1"></div></div> <div class="jhs-setting-row"><span class="setting-label">页面宽度:<span id="showContainerWidth"></span></span><div class="form-content"><input type="range" class="jhs-range" id="containerWidth" min="0" max="30" step="1"></div></div> </div></section> </div> <div id="task-panel" class="content-panel ${Ct==="task-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>定时任务</h3><p>配置黑名单、演员同步和新作品检测。</p></header><div class="jhs-setting-group"> <div class="jhs-setting-row"> <span class="setting-label">请求并发数量:</span> <div class="form-content"> <input type="number" id="checkConcurrencyCount" class="jhs-field" min="2" max="5"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">请求间隔时间(毫秒):</span> <div class="form-content"> <input type="number" id="checkRequestSleep" class="jhs-field" min="0" max="3000"> </div> </div> <div id="setting-blacklist" class="jhs-setting-rows"> <h4 class="jhs-setting-subtitle">自动检测屏蔽黑名单演员</h4> <div class="jhs-setting-row"> <span class="setting-label"> 任务开关: </span> <div class="form-content"> <select id="enableCheckBlacklist" class="jhs-select-source"> <option value="no">禁用</option> <option value="yes">开启</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">任务间隔时间:</span> <div class="form-content"> <select id="checkBlacklist_intervalTime" class="jhs-select-source"> <option value="2">每2小时</option> <option value="3">每3小时</option> <option value="6">每6小时</option> <option value="12">每12小时</option> <option value="24">每24小时</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">检测规则:</span> <div class="form-content"> <select id="checkBlacklist_ruleTime" class="jhs-select-source"> <option value="0">全部检测</option> <option value="8760">不检测停更1年以上</option> <option value="17520">不检测停更2年以上</option> <option value="26280">不检测停更3年以上</option> </select> </div> </div> </div> <div id="setting-checkFavoriteActress" class="jhs-setting-rows ${r?"":"do-hide"}"> <h4 class="jhs-setting-subtitle">自动同步已收藏的演员</h4> <div class="jhs-setting-row"> <span class="setting-label"> 任务开关: </span> <div class="form-content"> <select id="enableCheckFavoriteActress" class="jhs-select-source"> <option value="no">禁用</option> <option value="yes">开启</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">任务间隔时间:</span> <div class="form-content"> <select id="checkFavoriteActress_IntervalTime" class="jhs-select-source"> <option value="12">每12小时</option> <option value="24">每24小时</option> </select> </div> </div> </div> <div id="setting-checkNewVideo" class="jhs-setting-rows ${r?"":"do-hide"}"> <h4 class="jhs-setting-subtitle">自动检测已收藏演员的最新作品</h4> <div class="jhs-setting-row"> <span class="setting-label"> 任务开关: </span> <div class="form-content"> <select id="enableCheckNewVideo" class="jhs-select-source"> <option value="no">禁用</option> <option value="yes">开启</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">任务间隔时间:</span> <div class="form-content"> <select id="checkNewVideo_intervalTime" class="jhs-select-source"> <option value="2">每2小时</option> <option value="3">每3小时</option> <option value="6">每6小时</option> <option value="12">每12小时</option> <option value="24">每24小时</option> </select> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">检测规则:</span> <div class="form-content"> <select id="checkNewVideo_ruleTime" class="jhs-select-source"> <option value="0">全部检测</option> <option value="8760">不检测停更1年以上</option> <option value="17520">不检测停更2年以上</option> <option value="26280">不检测停更3年以上</option> </select> </div> </div> </div> </div></section> </div> <div id="domain-panel" class="content-panel ${Ct==="domain-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>外部网站</h3><p>配置外部资源来源、域名与网络。</p></header><div class="jhs-setting-group"> <div class="jhs-setting-row"> <span class="setting-label">域名 - MissAv:</span> <div class="form-content"> <input type="url" id="missAvUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - Jable:</span> <div class="form-content"> <input type="url" id="jableUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - Avgle:</span> <div class="form-content"> <input type="url" id="avgleUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - JavTrailer:</span> <div class="form-content"> <input type="url" id="javTrailersUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - 123Av:</span> <div class="form-content"> <input type="url" id="av123Url" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - JavDb:</span> <div class="form-content"> <input type="url" id="javDbUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - JavBus:</span> <div class="form-content"> <input type="url" id="javBusUrl" class="jhs-field"> </div> </div> <div class="jhs-setting-row"> <span class="setting-label">域名 - SupJav:</span> <div class="form-content"> <input type="url" id="supJavUrl" class="jhs-field"> </div> </div> </div></section> </div> <div id="filter-panel" class="content-panel ${Ct==="filter-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>屏蔽配置</h3><p>配置文本、演员和类别筛选规则。</p></header><div class="jhs-setting-group"> <div class="jhs-setting-row"> <span class="setting-label"> 启用划词屏蔽 </span> <div class="jhs-inline-fields"> <input type="checkbox" id="enableTitleSelectFilter" class="mini-switch"> </div> </div> <div id="reviewKeywordContainer"> <div class="jhs-setting-row"> <span class="setting-label">评论区屏蔽词:</span> <div class="jhs-inline-fields"> <input type="text" class="keyword-input jhs-field" placeholder="添加屏蔽词"> <button class="jhs-btn add-tag-btn">添加</button> </div> </div> <div class="tag-box"> </div> </div> <div id="filterKeywordContainer"> <div class="jhs-setting-row"> <span class="setting-label">视频标题屏蔽词:</span> <div class="jhs-inline-fields"> <input type="text" class="keyword-input jhs-field" placeholder="添加屏蔽词"> <button class="jhs-btn add-tag-btn">添加</button> </div> </div> <div class="tag-box"> </div> </div> </div></section> </div> <div id="cache-panel" class="content-panel ${Ct==="cache-panel"?"active":""}" role="region"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>缓存管理</h3><p>查看并清理非核心缓存数据。</p></header><div class="jhs-setting-group"> <h2 class="jhs-section__heading">以下操作不会影响核心数据</h2> <br/> <div class="jhs-cache-grid"> ${wt} </div> <div id="cache-data-display" class="jhs-is-hidden"> <pre class="jhs-cache-preview"></pre> </div> </div></section> </div> </div> <div class="jhs-setting-footer"> <button type="button" id="saveBtn" class="jhs-btn jhs-btn--primary">保存设置</button> <button id="clean-all" class="jhs-btn jhs-btn--danger jhs-is-hidden">清理全部缓存</button> </div> </div> </div> `}function injectHealthPanel(){const Ct=$(".side-menu-item").parent();Ct.length&&!Ct.find('[data-panel="health-panel"]').length&&Ct.append('<button type="button" class="jhs-btn side-menu-item" data-panel="health-panel" aria-controls="health-panel">数据体检</button>');const mt=$(".content-panel").parent();mt.length&&!$("#health-panel").length&&mt.append(` <div id="health-panel" class="content-panel"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>数据体检</h3><p>检查本地数据并在备份后修复异常。</p></header> <div class="jhs-toolbar jhs-health-actions"> <button type="button" id="runHealthCheckBtn" class="jhs-btn jhs-btn--primary"><span>重新体检</span></button> <button type="button" id="repairHealthBtn" class="jhs-btn jhs-btn--secondary"><span>备份并修复</span></button> </div> <div id="health-data-display" class="jhs-setting-output">点击重新体检查看结果</div> </section> </div> `)}function injectPluginMgmtPanel(){const Ct=$(".side-menu-item").parent();Ct.length&&!Ct.find('[data-panel="plugin-mgmt-panel"]').length&&Ct.append('<button type="button" class="jhs-btn side-menu-item" data-panel="plugin-mgmt-panel" aria-controls="plugin-mgmt-panel">插件管理</button>');const mt=$(".content-panel").parent();if(!mt.length||$("#plugin-mgmt-panel").length)return;mt.append(`<div id="plugin-mgmt-panel" class="content-panel"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>插件管理</h3><p>按功能查看插件状态、耗时和错误记录。</p></header> <div class="jhs-setting-metrics"> <div class="jhs-setting-metric"><strong id="pm-total">0</strong><span>总插件数</span></div> <div class="jhs-setting-metric"><strong id="pm-enabled">0</strong><span>已启用</span></div> <div class="jhs-setting-metric"><strong id="pm-disabled">0</strong><span>已禁用</span></div> </div> <p class="jhs-setting-help">禁用插件后需刷新页面生效。核心插件不可禁用。</p> <div id="plugin-mgmt-list"></div> <details class="jhs-diagnostics"><summary>诊断信息</summary><div class="jhs-diagnostics__content"> <h3 class="jhs-setting-subheading">插件执行耗时</h3><p class="jhs-setting-help">页面加载时各插件 handle() 的执行时间。</p><div id="plugin-timing-table"></div> <h3 class="jhs-setting-subheading">错误日志</h3><div class="jhs-toolbar"><button type="button" id="pm-clear-log" class="jhs-btn jhs-btn--danger"><span>清空日志</span></button></div><div id="plugin-error-log" class="jhs-setting-output jhs-setting-output--compact">无错误记录</div> <h3 class="jhs-setting-subheading">缓存命中率</h3><div id="cache-hit-stats" class="jhs-setting-output"></div> </div></details></section> </div>`)}function injectSnapshotPanel(){const Ct=$(".side-menu-item").parent();Ct.length&&!Ct.find('[data-panel="snapshot-panel"]').length&&Ct.append('<button type="button" class="jhs-btn side-menu-item" data-panel="snapshot-panel" aria-controls="snapshot-panel">恢复点</button>');const mt=$(".content-panel").parent();if(!mt.length||$("#snapshot-panel").length)return;mt.append('<div id="snapshot-panel" class="content-panel"><section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>恢复点</h3><p>创建、下载或恢复本地数据快照。</p></header><div class="jhs-toolbar"><button type="button" id="createSnapshotBtn" class="jhs-btn jhs-btn--primary"><span>创建快照</span></button></div><p class="jhs-setting-help">快照保存当前全部数据状态,可用于恢复。最多保留 10 个,超出自动清理最旧的。</p><div id="snapshot-list"></div></section></div>')}function injectNetworkPanel(){const Ct=$(".side-menu-item").parent();Ct.length&&!Ct.find('[data-panel="network-panel"]').length&&Ct.append('<button type="button" class="jhs-btn side-menu-item" data-panel="network-panel" aria-controls="network-panel">外部请求</button>');const mt=$(".content-panel").parent();if(!mt.length||$("#network-panel").length)return;mt.append(`<div id="network-panel" class="content-panel"> <section class="jhs-setting-section"><header class="jhs-setting-section__header"><h3>外部请求</h3><p>配置熔断规则并查看站点健康状态。</p></header> <h3 class="jhs-setting-subheading">熔断器配置</h3><p class="jhs-setting-help">连续请求失败达到阈值后,自动停止对该站点的请求,避免拖慢整体体验。</p> <div class="jhs-setting-row"><span class="setting-label">熔断阈值(次):</span><div class="form-content"><input type="number" id="circuitBreakerThreshold" class="jhs-field" min="2" max="10"></div></div> <div class="jhs-setting-row"><span class="setting-label">冷却时间(秒):</span><div class="form-content"><input type="number" id="circuitBreakerCooldownSec" class="jhs-field" min="10" max="300"></div></div> <div class="jhs-toolbar"><button type="button" id="resetAllBreakersBtn" class="jhs-btn jhs-btn--danger"><span>重置全部熔断</span></button></div> <h3 class="jhs-setting-subheading">站点健康状态</h3><p class="jhs-setting-help">各外部站点的熔断状态和请求统计。</p><div id="site-health-table"></div> <h3 class="jhs-setting-subheading">域名使用统计</h3><p class="jhs-setting-help">脚本实际请求过的域名及次数。</p><div class="jhs-toolbar"><button type="button" id="clearDomainStatsBtn" class="jhs-btn jhs-btn--danger"><span>清空统计</span></button></div><div id="domain-stats-table"></div></section> </div>`)}function buildSimpleSettingHtml(){return` <div class="simple-setting__panel jhs-ui"> <div class="simple-setting__scroll jhs-scrollbar"> <div class="simple-setting__list"> ${[["显示全部已鉴定内容","showAllItem","快速显示全部已鉴定状态。"],["鉴定后立即关闭","needClosePage","完成鉴定后关闭当前详情窗口。"],["瀑布流","autoPage","连续加载列表;启用后普通列表只支持默认排序。"],["标题翻译","translateTitle","翻译列表和详情页标题。"],["悬浮大图","hoverBigImg","鼠标悬停封面时显示大图。"],["外部站点","enableLoadOtherSite","在详情页提供第三方站点入口。"],["长缩略图","enableLoadScreenShot","在详情页图片区加载长缩略图。"],["高画质预览","enableLoadPreviewVideo","解析更高画质的预览视频。"]].map((mt=>`<label class="jhs-setting-row" for="${mt[1]}"><span class="jhs-setting-row__copy"><span class="jhs-setting-row__label">${mt[0]}</span><span class="jhs-setting-row__description">${mt[2]}</span></span><span class="jhs-setting-row__control"><input type="checkbox" id="${mt[1]}" class="mini-switch"></span></label>`)).join("")} </div> </div> <footer class="simple-setting__footer"> <button type="button" id="moreBtn" class="jhs-btn jhs-btn--ghost">更多设置</button> </footer> </div>`}async function renderNetworkPanel(){const Ct=gmHttp.getCircuitBreakerStatus(),mt=gmHttp.getDomainStats(),bt=await storageManager.getSetting("circuitBreakerThreshold",3),wt=await storageManager.getSetting("circuitBreakerCooldown",6e4);$("#circuitBreakerThreshold").val(bt),$("#circuitBreakerCooldownSec").val(Math.round(wt/1e3));const yt=Object.entries(Ct);if(yt.length){let xt='<table class="jhs-data-table"><tr><th>域名</th><th class="is-center">状态</th><th class="is-center">失败次数</th><th class="is-center">操作</th></tr>';for(const[$t,kt]of yt){const _t=kt.state==="open"?"熔断":kt.state==="half-open"?"半开":"正常",St=kt.state==="open"?`剩余${Math.ceil((kt.cooldownMs-(Date.now()-kt.openTime))/1e3)}秒`:"";xt+=`<tr><td>${escapeHtml($t)}</td><td class="is-center">${_t} ${St}</td><td class="is-center">${Number(kt.failCount)||0}</td><td class="is-center"><button type="button" class="jhs-btn jhs-btn--danger reset-breaker" data-domain="${escapeHtml($t)}">重置</button></td></tr>`}xt+="</table>",$("#site-health-table").html(xt)}else $("#site-health-table").html('<p class="jhs-empty-note">暂无熔断记录</p>');const jt=Object.entries(mt).sort(((xt,$t)=>$t[1].count-xt[1].count));if(jt.length){let xt='<table class="jhs-data-table"><tr><th>域名</th><th class="is-right">请求数</th><th class="is-right">错误数</th><th class="is-center">最后使用</th></tr>';for(const[$t,kt]of jt){const _t=kt.lastUsed?new Date(kt.lastUsed).toLocaleTimeString():"-";xt+=`<tr><td>${escapeHtml($t)}</td><td class="is-right">${kt.count}</td><td class="is-right ${kt.errors>0?"is-danger":""}">${kt.errors}</td><td class="is-center">${_t}</td></tr>`}xt+="</table>",xt+=`<p class="jhs-caption">共 ${jt.length} 个域名</p>`,$("#domain-stats-table").html(xt)}else $("#domain-stats-table").html('<p class="jhs-empty-note">暂无统计数据</p>');$(".reset-breaker").off("click").on("click",(xt=>{const $t=$(xt.target).data("domain");gmHttp.resetCircuitBreaker($t),show.ok(`已重置 ${$t} 的熔断状态`),renderNetworkPanel()})),$("#resetAllBreakersBtn").off("click").on("click",(()=>{gmHttp.resetAllCircuitBreakers(),show.ok("已重置全部熔断状态"),renderNetworkPanel()})),$("#clearDomainStatsBtn").off("click").on("click",(()=>{gmHttp.clearDomainStats(),show.ok("已清空域名统计"),renderNetworkPanel()}))}async function renderSnapshotPanel(){const Ct=await storageManager.getSnapshotList(),mt={manual:"手动创建","auto-import":"导入前自动","auto-repair":"修复前自动","auto-restore":"恢复前自动"};if(Ct.length===0)return void $("#snapshot-list").html('<div class="jhs-empty-note">暂无快照,点击上方按钮创建</div>');$("#snapshot-list").find(".tabulator").length&&$("#snapshot-list").empty();const bt=new Tabulator("#snapshot-list",{layout:"fitColumns",placeholder:"暂无数据",data:Ct,columnDefaults:{headerHozAlign:"center",hozAlign:"center"},columns:[{title:"名称",field:"name",width:200,headerSort:!1},{title:"来源",field:"source",width:100,headerSort:!1,formatter:wt=>mt[wt.getValue()]||wt.getValue()},{title:"时间",field:"time",width:170,headerSort:!1},{title:"数据量",field:"itemCount",width:80,headerSort:!1},{title:"操作",minWidth:220,headerSort:!1,formatter:(wt,yt,jt)=>{const xt=wt.getData();return jt((()=>{const $t=wt.getElement().querySelector(".snap-restore"),kt=wt.getElement().querySelector(".snap-download"),_t=wt.getElement().querySelector(".snap-delete");$t&&$t.addEventListener("click",(async St=>{utils.q(St,`恢复到快照「${escapeHtml(xt.name)}」? 当前数据会自动备份。`,(async()=>{let Tt=loading();try{await storageManager.restoreSnapshot(xt.id),show.ok("恢复成功, 页面将刷新"),setTimeout(()=>location.reload(),1e3)}catch(It){console.error(It),show.error("恢复失败: "+It.message)}finally{Tt.close()}}))})),kt&&kt.addEventListener("click",(async St=>{let Tt=loading();try{const It=await storageManager.getSnapshot(xt.id);if(!It)throw new Error("快照不存在");utils.download(JSON.stringify(It.data),`snapshot_${escapeHtml(xt.name)}.json`),show.ok("下载成功")}catch(It){show.error("下载失败: "+It.message)}finally{Tt.close()}})),_t&&_t.addEventListener("click",(async St=>{utils.q(St,`删除快照「${escapeHtml(xt.name)}」?`,(async()=>{try{await storageManager.deleteSnapshot(xt.id),show.ok("已删除"),renderSnapshotPanel()}catch(Tt){console.error(Tt),show.error("删除失败: "+Tt.message)}}))}))})),'<button type="button" class="jhs-btn jhs-btn--primary snap-restore">恢复</button> <button type="button" class="jhs-btn jhs-btn--secondary snap-download">下载</button> <button type="button" class="jhs-btn jhs-btn--danger snap-delete">删除</button>'}}],locale:"zh-cn"})}function showDiffPreview(Ct,mt,bt=null){const wt=Ct.summary,yt=[];for(const[$t,kt]of Object.entries(Ct.stores)){if(kt.status==="unchanged")continue;const _t={store:$t,status:kt.status,oldCount:kt.oldCount,newCount:kt.newCount,added:kt.added.length,removed:kt.removed.length,modified:kt.modified.length};yt.push(_t)}let jt='<div class="jhs-dialog-content">';if(jt+='<div class="jhs-summary-grid">',jt+=`<div class="jhs-summary-card jhs-summary-card--success"><strong>${wt.added}</strong><span>新增数据源</span></div>`,jt+=`<div class="jhs-summary-card jhs-summary-card--danger"><strong>${wt.removed}</strong><span>缺失数据源</span></div>`,jt+=`<div class="jhs-summary-card jhs-summary-card--warning"><strong>${wt.modified}</strong><span>有变更</span></div>`,jt+=`<div class="jhs-summary-card"><strong>${wt.unchanged}</strong><span>无变化</span></div>`,jt+="</div>",yt.length>0){jt+='<div class="jhs-scroll-frame"><table class="jhs-data-table"><thead><tr><th>数据源</th><th>状态</th><th class="is-center">当前</th><th class="is-center">导入</th><th class="is-center">新增</th><th class="is-center">删除</th><th class="is-center">修改</th></tr></thead><tbody>';const $t={added:"新增",removed:"缺失",modified:"变更",unchanged:"无变化"};for(const kt of yt)jt+=`<tr><td>${escapeHtml(kt.store)}</td><td>${$t[kt.status]||kt.status}</td><td class="is-center">${kt.oldCount}</td><td class="is-center">${kt.newCount}</td><td class="is-center is-success">${kt.added||"-"}</td><td class="is-center is-danger">${kt.removed||"-"}</td><td class="is-center is-warning">${kt.modified||"-"}</td></tr>`;jt+="</tbody></table></div>"}else jt+='<div class="jhs-empty-note">数据完全一致,无需导入</div>';jt+='<div class="jhs-warning-note">导入将覆盖当前数据,建议先创建快照备份</div>',jt+="</div>";const xt=layer.open({type:1,title:"数据差异预览",content:jt,area:utils.getResponsiveArea(["700px","auto"]),btn:["确认导入","取消"],anim:-1,yes:async $t=>{layer.close($t);let kt=loading();try{await storageManager.createSnapshot("导入前自动备份","auto-import"),bt?(await storageManager.importData(bt),show.ok("导入成功!"),setTimeout(()=>location.reload(),1e3)):mt&&(await storageManager.importData(mt),show.ok("导入成功!"),setTimeout(()=>location.reload(),1e3))}catch(_t){console.error(_t),show.error("导入失败: "+_t.message)}finally{kt.close()}}})}async function renderPluginMgmtPanel(){const Ct=JSON.parse(await storageManager.getSetting("disabledPlugins","[]")),mt=unsafeWindow.pluginManager.getPluginNames(),{categories:bt,corePlugins:wt,pluginMeta:yt}=getPluginCategories(),jt=new Set(mt);let xt="";for(const[Pt,Mt]of Object.entries(bt)){const At=Mt.plugins.filter(Nt=>jt.has(Nt));if(At.length){xt+='<section class="jhs-plugin-group">',xt+=`<h4 class="jhs-plugin-group__title">${escapeHtml(Mt.label)}</h4>`;for(const Nt of At){const Dt=wt.includes(Nt),Lt=Ct.includes(Nt),Et=yt[Nt]?.[0]||Nt;xt+='<div class="jhs-plugin-row">',xt+=`<span class="jhs-plugin-copy" title="内部插件名:${escapeHtml(Nt)}"><strong>${escapeHtml(Et)}</strong></span>`,Dt?xt+='<span class="jhs-badge jhs-badge--neutral">核心</span>':xt+=`<input type="checkbox" class="mini-switch pm-toggle" data-plugin="${escapeHtml(Nt)}" ${Lt?"":"checked"}>`,xt+="</div>"}xt+="</section>"}}$("#plugin-mgmt-list").html(xt);const $t=mt.length-Ct.length;$("#pm-total").text(mt.length),$("#pm-enabled").text($t),$("#pm-disabled").text(Ct.length),$(".pm-toggle").off("change").on("change",async Pt=>{const Mt=$(Pt.target).data("plugin");let At=JSON.parse(await storageManager.getSetting("disabledPlugins","[]"));$(Pt.target).is(":checked")?At=At.filter(Dt=>Dt!==Mt):At.includes(Mt)||At.push(Mt),await storageManager.saveSettingItem("disabledPlugins",JSON.stringify(At));const Nt=unsafeWindow.pluginManager.getPluginNames();$("#pm-total").text(Nt.length),$("#pm-enabled").text(Nt.length-At.length),$("#pm-disabled").text(At.length),show.ok(`插件 "${Mt}" 已${$(Pt.target).is(":checked")?"启用":"禁用"},刷新后生效`)});const kt=unsafeWindow.pluginManager.getStartupReport?.(),_t=unsafeWindow.pluginManager.getTimings(),St=Pt=>Number.isFinite(Pt)?Pt.toFixed(1):"0.0";let Tt=kt?`<div class="jhs-inline-metrics"><span>就绪: <strong>${St(kt.readyMs)} ms</strong></span><span>注册: ${St(kt.registrationMs)} ms</span><span>样式: ${St(kt.cssMs)} ms</span><span>即时插件: ${St(kt.immediateMs)} ms</span><span>空闲任务: ${kt.idleCompleted}/${kt.idleCompleted+kt.idlePending}</span></div><p class="jhs-caption">就绪耗时不包含 @require 下载及浏览器脚本解析时间。</p>`:"";if(_t.length){const Pt=[..._t].sort((At,Nt)=>Nt.elapsed-At.elapsed);let Mt='<table class="jhs-data-table"><tr><th>插件</th><th class="is-center">阶段</th><th class="is-right">耗时(ms)</th><th class="is-center">状态</th></tr>';for(const At of Pt){const Nt=At.status==="disabled"?"is-muted":At.elapsed>500?"is-slow":At.elapsed>200?"is-warning":"",Dt=At.status==="disabled"?"已禁用":At.status==="error"?"错误":At.status==="pending-idle"?"等待空闲":At.status==="skipped-mobile"?"移动端跳过":"正常";Mt+=`<tr><td class="${Nt}">${escapeHtml(At.name)}</td><td class="is-center">${At.startupMode==="idle"?"空闲":"即时"}</td><td class="is-right ${Nt}">${At.elapsed.toFixed(1)}</td><td class="is-center">${Dt}</td></tr>`}Mt+="</table>",$("#plugin-timing-table").html(Tt+Mt)}else $("#plugin-timing-table").html(Tt+'<p class="jhs-empty-note">暂无数据,刷新页面后自动采集。</p>');const It=unsafeWindow.pluginManager.getErrorLog();if(It.length){let Pt='<table class="jhs-data-table"><tr><th>时间</th><th>插件</th><th>阶段</th><th>错误信息</th></tr>';for(const Mt of[...It].reverse())Pt+=`<tr><td class="is-muted">${escapeHtml(Mt.time.substring(11,19))}</td><td>${escapeHtml(Mt.plugin)}</td><td>${escapeHtml(Mt.phase)}</td><td class="is-danger">${escapeHtml(Mt.message)}</td></tr>`;Pt+="</table>",$("#plugin-error-log").html(Pt)}else $("#plugin-error-log").text("无错误记录");const Bt=storageManager.getCacheHitStats();$("#cache-hit-stats").html(`<div class="jhs-inline-metrics"><span>命中: <strong>${Bt.hits}</strong></span><span>未命中: <strong>${Bt.misses}</strong></span><span>总计: <strong>${Bt.total}</strong></span><span>命中率: <strong>${Bt.rate}</strong></span></div>`)}async function renderDataHealthPanel(){const Ct=$("#health-data-display");if(Ct.length){Ct.text("体检中...");try{const mt=await storageManager.inspectDataHealth(),bt=mt.fixable.reduce(((jt,xt)=>jt+xt.count),0),wt=mt.readonly.reduce(((jt,xt)=>jt+xt.count),0),yt=jt=>jt.length?jt.map((xt=>`<li><strong>${escapeHtml(xt.message)}</strong>:${xt.count}</li>`)).join(""):"<li>无</li>";Ct.html(` <div class="jhs-summary-grid"> <div>番号记录:<strong>${mt.totals.carList}</strong></div> <div>收藏演员:<strong>${mt.totals.favoriteActresses}</strong></div> <div>黑名单演员:<strong>${mt.totals.blacklist}</strong></div> <div>黑名单作品:<strong>${mt.totals.blacklistCarList}</strong></div> </div> <div class="jhs-health-summary">体检时间:${escapeHtml(mt.checkedAt)};可修复问题 <strong>${bt}</strong> 项,只读问题 <strong>${wt}</strong> 项。</div> <div class="jhs-health-columns"> <div><h4>可安全修复</h4><ul>${yt(mt.fixable)}</ul></div> <div><h4>仅报告</h4><ul>${yt(mt.readonly)}</ul></div> </div> `)}catch(mt){console.error(mt),Ct.text("体检失败: "+mt)}}}async function repairDataHealthWithBackup(){const Ct=JSON.stringify(await storageManager.exportData()),mt=`health-backup-${utils.getNowStr("_","_")}.json`;utils.download(Ct,mt);const bt=await storageManager.repairDataHealth();show.ok(`已修复 ${bt.fixedGroups} 组数据问题,修复前备份已下载`),await renderDataHealthPanel()}async function loadSettingForm(Ct){let mt=await storageManager.getSetting();$("#videoQuality").val(mt.videoQuality),$("#reviewCount").val(mt.reviewCount||20),$("#tagPosition").val(mt.tagPosition||"rightTop"),$("#waitCheckCount").val(mt.waitCheckCount||5),$("#checkConcurrencyCount").val(mt.checkConcurrencyCount||2),$("#checkRequestSleep").val(mt.checkRequestSleep||100),$("#enableCheckBlacklist").val(mt.enableCheckBlacklist||_),$("#checkBlacklist_intervalTime").val(mt.checkBlacklist_intervalTime||12),$("#checkBlacklist_ruleTime").val(mt.checkBlacklist_ruleTime||8760),$("#enableCheckFavoriteActress").val(mt.enableCheckFavoriteActress||_),$("#checkFavoriteActress_IntervalTime").val(mt.checkFavoriteActress_IntervalTime||24),$("#enableCheckNewVideo").val(mt.enableCheckNewVideo||_),$("#checkNewVideo_intervalTime").val(mt.checkNewVideo_intervalTime||12),$("#checkNewVideo_ruleTime").val(mt.checkNewVideo_ruleTime||8760);const bt=mt.highlightedTagNumber||1,wt=mt.highlightedTagColor||"#ce2222";$("#highlightedTagNumber").val(mt.highlightedTagNumber||1),$("#highlightedTagColor").val(mt.highlightedTagColor||"#ce2222"),$("#highlightedTagLabel").css("border",`${bt}px solid ${wt}`),$("#enableClog").val(mt.enableClog||_),$("#clogMsgCount").val(mt.clogMsgCount||2e3),$("#mobileMode").val(mt.mobileMode||"auto"),$("#themeMode").val(mt.themeMode||"light"),$("#httpTimeout").val(mt.httpTimeout||5e3),$("#httpRetryCount").val(mt.httpRetryCount||3),$("#webDavUrl").val(mt.webDavUrl||""),$("#webDavUsername").val(mt.webDavUsername||""),$("#webDavPassword").val(await decryptCredential(mt.webDavPassword)||""),$("#enableTitleSelectFilter").prop("checked",!mt.enableTitleSelectFilter||mt.enableTitleSelectFilter===_),$("#enableFavoriteActresses").prop("checked",!mt.enableFavoriteActresses||mt.enableFavoriteActresses===_),$("#enableSaveActressCarInfo").prop("checked",!!mt.enableSaveActressCarInfo&&mt.enableSaveActressCarInfo===_),$("#enableScreenSvg").prop("checked",!mt.enableScreenSvg||mt.enableScreenSvg===_),$("#enableVideoSvg").prop("checked",!mt.enableVideoSvg||mt.enableVideoSvg===_),$("#enableHandleSvg").prop("checked",!mt.enableHandleSvg||mt.enableHandleSvg===_),$("#enableSiteSvg").prop("checked",!mt.enableSiteSvg||mt.enableSiteSvg===_),$("#enableCopySvg").prop("checked",!mt.enableCopySvg||mt.enableCopySvg===_),$("#showFilterItem").prop("checked",!!mt.showFilterItem&&mt.showFilterItem===_),$("#showFilterActorItem").prop("checked",!!mt.showFilterActorItem&&mt.showFilterActorItem===_),$("#showFilterKeywordItem").prop("checked",!!mt.showFilterKeywordItem&&mt.showFilterKeywordItem===_),$("#showFavoriteItem").prop("checked",!mt.showFavoriteItem||mt.showFavoriteItem===_),$("#showHasDownItem").prop("checked",!mt.showHasDownItem||mt.showHasDownItem===_),$("#showHasWatchItem").prop("checked",!mt.showHasWatchItem||mt.showHasWatchItem===_),$("#enableLoadActressInfo").prop("checked",!mt.enableLoadActressInfo||mt.enableLoadActressInfo===_),$("#enableVerticalModel").prop("checked",!!mt.enableVerticalModel&&mt.enableVerticalModel===_),$("#containerColumns").val(mt.containerColumns||5),$("#showContainerColumns").text(mt.containerColumns||5),$("#containerWidth").val((mt.containerWidth||100)-70),$("#showContainerWidth").text((mt.containerWidth||100)+"%");const yt=Ct("OtherSitePlugin"),jt=await yt.getMissAvUrl(),xt=await yt.getjableUrl(),$t=await yt.getAvgleUrl(),kt=await yt.getJavTrailersUrl(),_t=await yt.getAv123Url(),St=await yt.getJavDbUrl(),Tt=await yt.getJavBusUrl(),It=await yt.getSupJavUrl();$("#missAvUrl").val(jt),$("#jableUrl").val(xt),$("#avgleUrl").val($t),$("#javTrailersUrl").val(kt),$("#av123Url").val(_t),$("#javDbUrl").val(St),$("#javBusUrl").val(Tt),$("#supJavUrl").val(It);let Bt=await storageManager.getReviewFilterKeywordList(),Pt=await storageManager.getTitleFilterKeyword();Bt&&Bt.forEach((Mt=>{addLabelTag("#reviewKeywordContainer",Mt)})),Pt&&Pt.forEach((Mt=>{addLabelTag("#filterKeywordContainer",Mt)})),["#reviewKeywordContainer","#filterKeywordContainer"].forEach((Mt=>{$(`${Mt} .add-tag-btn`).on("click",(At=>addKeyword(At,Mt))),$(`${Mt} .keyword-input`).on("keypress",(At=>{At.key==="Enter"&&addKeyword(At,Mt)}))}))}async function initSimpleSettingForm(Ct,mt,bt){let wt=await storageManager.getSetting();$("#containerColumns").val(wt.containerColumns||5),$("#showContainerColumns").text(wt.containerColumns||5),$("#containerWidth").val((wt.containerWidth||100)-70),$("#showContainerWidth").text((wt.containerWidth||100)+"%"),$("#needClosePage").prop("checked",!wt.needClosePage||wt.needClosePage===_),$("#autoPage").prop("checked",!wt.autoPage||wt.autoPage===_),$("#translateTitle").prop("checked",!wt.translateTitle||wt.translateTitle===_),$("#enableLoadActressInfo").prop("checked",!wt.enableLoadActressInfo||wt.enableLoadActressInfo===_),$("#enableLoadOtherSite").prop("checked",!wt.enableLoadOtherSite||wt.enableLoadOtherSite===_),$("#containerColumns").on("input",(async xt=>{let $t=$("#containerColumns").val();$("#showContainerColumns").text($t),r&&(document.querySelector(".movie-list").style.gridTemplateColumns=`repeat(${$t}, minmax(0, 1fr))`),l&&(document.querySelector(".masonry").style.gridTemplateColumns=`repeat(${$t}, minmax(0, 1fr))`),await storageManager.saveSettingItem("containerColumns",$t),applyImageMode()})),$("#containerWidth").on("input",(async xt=>{let $t=parseInt($(xt.target).val());const kt=$t+70+"%";$("#showContainerWidth").text(kt),r&&(document.querySelector("section .container").style.minWidth=kt),l&&(document.querySelector(".container-fluid .row").style.minWidth=kt),storageManager.saveSettingItem("containerWidth",$t+70)})),$("#showFilterItem").prop("checked",!!wt.showFilterItem&&wt.showFilterItem===_),$("#showFilterActorItem").prop("checked",!!wt.showFilterActorItem&&wt.showFilterActorItem===_),$("#showFilterKeywordItem").prop("checked",!!wt.showFilterKeywordItem&&wt.showFilterKeywordItem===_),$("#showFavoriteItem").prop("checked",!wt.showFavoriteItem||wt.showFavoriteItem===_),$("#showHasDownItem").prop("checked",!wt.showHasDownItem||wt.showHasDownItem===_),$("#showHasWatchItem").prop("checked",!wt.showHasWatchItem||wt.showHasWatchItem===_),$("#showFilterItem").on("change",(async xt=>{let $t=$("#showFilterItem").is(":checked")?_:C;await storageManager.saveSettingItem("showFilterItem",$t),window.refresh()})),$("#showFilterActorItem").on("change",(async xt=>{let $t=$("#showFilterActorItem").is(":checked")?_:C;await storageManager.saveSettingItem("showFilterActorItem",$t),window.refresh()})),$("#showFilterKeywordItem").on("change",(async xt=>{let $t=$("#showFilterKeywordItem").is(":checked")?_:C;await storageManager.saveSettingItem("showFilterKeywordItem",$t),window.refresh()})),$("#showFavoriteItem").on("change",(async xt=>{let $t=$("#showFavoriteItem").is(":checked")?_:C;await storageManager.saveSettingItem("showFavoriteItem",$t),window.refresh()})),$("#showHasDownItem").on("change",(async xt=>{let $t=$("#showHasDownItem").is(":checked")?_:C;await storageManager.saveSettingItem("showHasDownItem",$t),window.refresh()})),$("#showHasWatchItem").on("change",(async xt=>{let $t=$("#showHasWatchItem").is(":checked")?_:C;await storageManager.saveSettingItem("showHasWatchItem",$t),window.refresh()}));const yt=$("#showFilterItem, #showFilterActorItem, #showFilterKeywordItem, #showFavoriteItem, #showHasDownItem, #showHasWatchItem"),jt=()=>{const xt=$("#showAllItem").is(":checked");yt.prop("disabled",xt),xt?yt.attr("data-tip","请先关闭显示所有才可点击"):yt.removeAttr("data-tip")};$("#showAllItem").prop("checked",!!wt.showAllItem&&wt.showAllItem===_),$("#showAllItem").on("change",(async xt=>{let $t=$("#showAllItem").is(":checked")?_:C;await storageManager.saveSettingItem("showAllItem",$t),jt(),window.refresh()})),jt(),$("#needClosePage").on("change",(async xt=>{await storageManager.saveSettingItem("needClosePage",$("#needClosePage").is(":checked")?_:C),window.refresh()})),$("#autoPage").on("change",(async xt=>{const $t=$("#autoPage").is(":checked")?_:C;await storageManager.saveSettingItem("autoPage",$t),$("#sort-toggle-btn").prop("disabled",$t===_).attr("title",$t===_?"瀑布流模式仅支持默认排序":"选择列表排序方式")})),$("#translateTitle").on("change",(async xt=>{const $t=$("#translateTitle").is(":checked")?_:C;await storageManager.saveSettingItem("translateTitle",$t),$t===_?(await Ct("ListPagePlugin").doFilter(),isDetailPage&&await Ct("TranslatePlugin").translate()):(await Ct("ListPagePlugin").revertTranslation(),$(".translated-title").remove())})),$("#hoverBigImg").prop("checked",!!wt.hoverBigImg&&wt.hoverBigImg===_),$("#hoverBigImg").on("change",(async xt=>{const $t=$("#hoverBigImg").is(":checked")?_:C;await storageManager.saveSettingItem("hoverBigImg",$t),window.imageHoverPreviewObj&&(window.imageHoverPreviewObj.destroy(),window.imageHoverPreviewObj=null),$t===_&&(window.imageHoverPreviewObj=new ImageHoverPreview({selector:mt().coverImgSelector}))})),$("#enableLoadActressInfo").on("change",(async xt=>{const $t=$("#enableLoadActressInfo").is(":checked")?_:C;await storageManager.saveSettingItem("enableLoadActressInfo",$t),$t===_?Ct("ActressInfoPlugin").loadActressInfo():$(".actress-info").remove()})),$("#enableLoadOtherSite").on("change",(async xt=>{const $t=$("#enableLoadOtherSite").is(":checked")?_:C;await storageManager.saveSettingItem("enableLoadOtherSite",$t),$t===_?Ct("OtherSitePlugin").loadOtherSite().then():$("#otherSiteBox").remove()})),$("#enableLoadScreenShot").prop("checked",!wt.enableLoadScreenShot||wt.enableLoadScreenShot===_),$("#enableLoadScreenShot").on("change",(async xt=>{const $t=$("#enableLoadScreenShot").is(":checked")?_:C;await storageManager.saveSettingItem("enableLoadScreenShot",$t),$t===_?Ct("ScreenShotPlugin").loadScreenShot().then():$(".screen-container").remove()})),$("#enableLoadPreviewVideo").prop("checked",!wt.enableLoadPreviewVideo||wt.enableLoadPreviewVideo===_),$("#enableLoadPreviewVideo").on("change",(async xt=>{const $t=$("#enableLoadPreviewVideo").is(":checked")?_:C;await storageManager.saveSettingItem("enableLoadPreviewVideo",$t)})),$("#enableVerticalModel").prop("checked",!!wt.enableVerticalModel&&wt.enableVerticalModel===_),$("#enableVerticalModel").on("change",(async xt=>{const $t=$("#enableVerticalModel").is(":checked")?_:C;await storageManager.saveSettingItem("enableVerticalModel",$t),applyImageMode()})),$("#moreBtn").on("click",(()=>{$(".simple-setting").html("").hide(),bt("base-panel")}))}async function saveSettingForm(Ct){let mt=await storageManager.getSetting();mt.videoQuality=$("#videoQuality").val(),mt.reviewCount=$("#reviewCount").val(),mt.tagPosition=$("#tagPosition").val(),mt.waitCheckCount=$("#waitCheckCount").val(),mt.highlightedTagNumber=$("#highlightedTagNumber").val(),mt.highlightedTagColor=$("#highlightedTagColor").val(),mt.checkConcurrencyCount=$("#checkConcurrencyCount").val(),mt.checkRequestSleep=$("#checkRequestSleep").val(),mt.enableCheckBlacklist=$("#enableCheckBlacklist").val(),mt.checkBlacklist_intervalTime=$("#checkBlacklist_intervalTime").val(),mt.checkBlacklist_ruleTime=$("#checkBlacklist_ruleTime").val(),mt.enableCheckFavoriteActress=$("#enableCheckFavoriteActress").val(),mt.checkFavoriteActress_IntervalTime=$("#checkFavoriteActress_IntervalTime").val(),mt.enableCheckNewVideo=$("#enableCheckNewVideo").val(),mt.checkNewVideo_intervalTime=$("#checkNewVideo_intervalTime").val(),mt.checkNewVideo_ruleTime=$("#checkNewVideo_ruleTime").val(),mt.httpTimeout=Number($("#httpTimeout").val())||5e3,mt.httpRetryCount=Number($("#httpRetryCount").val())||3,mt.circuitBreakerThreshold=Number($("#circuitBreakerThreshold").val())||3,mt.circuitBreakerCooldown=Number($("#circuitBreakerCooldownSec").val())*1e3,mt.enableClog=$("#enableClog").val(),mt.enableClog===_?clog.show():clog.hide(),mt.clogMsgCount=$("#clogMsgCount").val(),mt.mobileMode=$("#mobileMode").val(),mt.themeMode=$("#themeMode").val(),mt.webDavUrl=$("#webDavUrl").val(),mt.webDavUsername=$("#webDavUsername").val(),mt.webDavPassword=await encryptCredential($("#webDavPassword").val()),mt.missAvUrl=$("#missAvUrl").val().replace(/\/$/,""),mt.jableUrl=$("#jableUrl").val().replace(/\/$/,""),mt.avgleUrl=$("#avgleUrl").val().replace(/\/$/,""),mt.javTrailersUrl=$("#javTrailersUrl").val().replace(/\/$/,""),mt.av123Url=$("#av123Url").val().replace(/\/$/,""),mt.javDbUrl=$("#javDbUrl").val().replace(/\/$/,""),mt.javBusUrl=$("#javBusUrl").val().replace(/\/$/,""),mt.supJavUrl=$("#supJavUrl").val().replace(/\/$/,""),mt.enableTitleSelectFilter=$("#enableTitleSelectFilter").is(":checked")?_:C,mt.enableFavoriteActresses=$("#enableFavoriteActresses").is(":checked")?_:C,mt.enableSaveActressCarInfo=$("#enableSaveActressCarInfo").is(":checked")?_:C,mt.enableScreenSvg=$("#enableScreenSvg").is(":checked")?_:C,mt.enableVideoSvg=$("#enableVideoSvg").is(":checked")?_:C,mt.enableHandleSvg=$("#enableHandleSvg").is(":checked")?_:C,mt.enableSiteSvg=$("#enableSiteSvg").is(":checked")?_:C,mt.enableCopySvg=$("#enableCopySvg").is(":checked")?_:C,mt.showFilterItem=$("#showFilterItem").is(":checked")?_:C,mt.showFilterActorItem=$("#showFilterActorItem").is(":checked")?_:C,mt.showFilterKeywordItem=$("#showFilterKeywordItem").is(":checked")?_:C,mt.showFavoriteItem=$("#showFavoriteItem").is(":checked")?_:C,mt.showHasDownItem=$("#showHasDownItem").is(":checked")?_:C,mt.showHasWatchItem=$("#showHasWatchItem").is(":checked")?_:C,mt.enableLoadActressInfo=$("#enableLoadActressInfo").is(":checked")?_:C,mt.enableVerticalModel=$("#enableVerticalModel").is(":checked")?_:C,mt.containerColumns=Number($("#containerColumns").val())||5,mt.containerWidth=Number($("#containerWidth").val())+70||100,await storageManager.saveSetting(mt);let bt=[];$("#reviewKeywordContainer .keyword-label").toArray().forEach((jt=>{let xt=$(jt).text().replace("×","").replace(/[\r\n]+/g," ").replace(/\s{2,}/g," ").trim();bt.push(xt)})),await storageManager.saveReviewFilterKeyword(bt);let wt=[];$("#filterKeywordContainer .keyword-label").toArray().forEach((jt=>{let xt=$(jt).text().replace("×","").replace(/[\r\n]+/g," ").replace(/\s{2,}/g," ").trim();wt.push(xt)})),await storageManager.saveTitleFilterKeyword(wt),show.ok("保存成功"),window.refresh();const yt=Ct("NewVideoPlugin");yt&&yt.resetBtnTip(),Ct("BlacklistPlugin").resetBtnTip(),Ct("BlacklistPlugin").reloadTable()}function addLabelTag(Ct,mt){const bt=$(`${Ct} .tag-box`);let wt;/^[a-z]{2,}-/i.test(mt)&&r?wt=$(` <a class="keyword-label keyword-label--link" data-keyword="${mt}" href="/video_codes/${mt.replace("-","")}" target="_blank"> ${mt} <span class="keyword-remove">×</span> </a> `):wt=$(` <div class="keyword-label" data-keyword="${mt}"> ${mt} <span class="keyword-remove">×</span> </div> `),wt.find(".keyword-remove").click((yt=>{yt.stopPropagation(),yt.preventDefault();const jt=$(yt.currentTarget),xt=jt.closest(".keyword-label").attr("data-keyword").split(" ")[0];utils.q(yt,`是否移除屏蔽词 ${xt}?`,(async()=>{jt.parent().remove()}))})),bt.append(wt)}function addKeyword(Ct,mt){let bt=$(`${mt} .keyword-input`);const wt=bt.val().trim();wt&&(addLabelTag(mt,wt),bt.val(""))}async function importSettingData(Ct){try{const mt=document.createElement("input");mt.type="file",mt.accept=".json";const bt=()=>{try{document.body.removeChild(mt)}catch{}};mt.onchange=async wt=>{const yt=wt.target.files[0];if(!yt)return void bt();const jt=new FileReader;jt.onload=async xt=>{bt();try{const $t=xt.target.result.toString(),kt=JSON.parse($t);if(!kt||typeof kt!="object"||Array.isArray(kt))throw new Error("文件内容不是有效的数据对象");const _t=loading();try{const St=await storageManager.exportData(),Tt=await storageManager.diffData(St,kt);_t.close(),Ct(Tt,kt,null)}catch(St){_t.close(),console.error(St),show.error("差异分析失败: "+St.message)}}catch($t){console.error($t),show.error("导入失败:文件内容不是有效的JSON格式 "+$t.message)}},jt.onerror=()=>{bt(),show.error("读取文件时出错")},jt.readAsText(yt)},document.body.appendChild(mt),mt.click(),setTimeout(bt,3e5)}catch(mt){console.error(mt),show.error("导入数据时出错: "+mt.message)}}async function backupDataByWebDav(Ct){const mt=await storageManager.getSetting(),bt=mt.webDavUrl;if(!bt)return void show.error("请填写webDav服务地址并保存后, 再试此功能");const wt=mt.webDavUsername;if(!wt)return void show.error("请填写webDav用户名并保存后, 再试此功能");const yt=await decryptCredential(mt.webDavPassword);if(!yt)return void show.error("请填写webDav密码并保存后, 再试此功能");let jt=utils.getNowStr("_","_")+".json",xt=JSON.stringify(await storageManager.exportData());xt=await encryptData(xt);let $t=loading();try{await new De(bt,wt,yt).backup(Ct,jt,xt),show.ok("备份完成")}catch(kt){console.error(kt),show.error(kt.toString())}finally{$t.close()}}async function backupListBtnByWebDav(Ct,mt){const bt=await storageManager.getSetting(),wt=bt.webDavUrl;if(!wt)return void show.error("请填写webDav服务地址并保存后, 再试此功能");const yt=bt.webDavUsername;if(!yt)return void show.error("请填写webDav用户名并保存后, 再试此功能");const jt=await decryptCredential(bt.webDavPassword);if(!jt)return void show.error("请填写webDav密码并保存后, 再试此功能");let xt=loading();try{const $t=new De(wt,yt,jt),kt=await $t.getBackupList(Ct);mt(kt,$t,"WebDav")}catch($t){console.error($t),show.error(`发生错误: ${$t&&$t.message}`)}finally{xt.close()}}function openFileListDialogMobile(Ct,mt,bt,wt,yt){const jt=kt=>{const _t=["B","KB","MB","GB","TB","PB"];let St=0,Tt=kt;for(;Tt>=1024&&St<_t.length-1;)Tt/=1024,St++;return`${Tt%1==0?Tt.toFixed(0):Tt.toFixed(2)} ${_t[St]}`},xt=kt=>!kt||kt.length===0?'<div class="jhs-backup-empty">暂无数据</div>':kt.map((_t,St)=>` <div class="jhs-backup-card" data-idx="${St}"> <div class="jhs-backup-card-name">${escapeHtml(_t.name)}</div> <div class="jhs-backup-card-meta">${jt(_t.size)} · ${utils.getNowStr("-",":",_t.createTime)}</div> <div class="jhs-backup-card-actions"> <button class="jhs-btn jhs-backup-btn jhs-backup-btn-danger" data-action="delete" data-idx="${St}">删除</button> <button class="jhs-btn jhs-backup-btn jhs-backup-btn-primary" data-action="download" data-idx="${St}">下载</button> <button class="jhs-btn jhs-backup-btn jhs-backup-btn-success" data-action="import" data-idx="${St}">导入</button> </div> </div> `).join(""),$t="jhs-backup-card-list";layer.open({type:1,title:bt+"备份文件",content:`<div id="${$t}" class="jhs-backup-cards">${xt(Ct)}</div>`,area:utils.getResponsiveArea(["800px","70%"]),anim:-1,success:kt=>{const _t=$(kt).find(`#${$t}`);_t.on("click",".jhs-backup-btn",async St=>{const Tt=$(St.currentTarget),It=Tt.data("action"),Bt=Tt.data("idx"),Pt=Ct[Bt];if(Pt){if(It==="delete")layer.confirm(`是否删除 ${Pt.name} ?`,{icon:3,title:"提示",btn:["确定","取消"]},async Mt=>{layer.close(Mt);let At=loading();try{await mt.deleteFile(Pt.fileId),Ct=await mt.getBackupList(wt),_t.html(xt(Ct)),layer.alert("删除成功")}catch(Nt){console.error(Nt),show.error(`发生错误: ${Nt&&Nt.message}`)}finally{At.close()}});else if(It==="download"){let Mt=loading();try{const At=await decryptData(await mt.getFileContent(Pt.fileId));utils.download(At,Pt.name)}catch(At){clog.error(At),show.error("下载失败: "+At)}finally{Mt.close()}}else if(It==="import"){let Mt=loading();try{let At=await mt.getFileContent(Pt.fileId);At=await decryptData(At);const Nt=JSON.parse(At),Dt=await storageManager.exportData(),Lt=await storageManager.diffData(Dt,Nt);Mt.close(),yt(Lt,null,Nt)}catch(At){Mt.close(),console.error(At),show.error("预览失败: "+(At&&At.message))}}}})}})}function openFileListDialog(Ct,mt,bt,wt,yt){if(utils.isMobileMode()){openFileListDialogMobile(Ct,mt,bt,wt,yt);return}layer.open({type:1,title:bt+"备份文件",content:` <div class="jhs-table-dialog"> <div id="table-container" class="jhs-table-dialog__content"></div> </div> `,area:utils.getResponsiveArea(["800px","70%"]),anim:-1,success:jt=>{const xt=new Tabulator("#table-container",{layout:"fitColumns",placeholder:"暂无数据",virtualDom:!0,data:Ct,responsiveLayout:"collapse",responsiveLayoutCollapse:!0,columnDefaults:{headerHozAlign:"center",hozAlign:"center"},columns:[{title:"文件名",field:"name",width:200,headerSort:!1,responsive:0},{title:"文件大小",field:"size",responsive:1,headerSort:!1,formatter:($t,kt,_t)=>{const St=["B","KB","MB","GB","TB","PB"];let Tt=0,It=$t.getData().size;for(;It>=1024&&Tt<St.length-1;)It/=1024,Tt++;return`${It%1==0?It.toFixed(0):It.toFixed(2)} ${St[Tt]}`}},{title:"备份日期",field:"createTime",responsive:2,headerSort:!1,formatter:($t,kt,_t)=>{const St=$t.getData();return`${utils.getNowStr("-",":",St.createTime)}`}},{title:"操作",minWidth:250,responsive:0,headerSort:!1,formatter:($t,kt,_t)=>{const St=$t.getData();return _t((()=>{const Tt=$t.getElement().querySelector(".backup-delete"),It=$t.getElement().querySelector(".backup-download"),Bt=$t.getElement().querySelector(".backup-import");Tt&&Tt.addEventListener("click",(Pt=>{layer.confirm(`是否删除 ${St.name} ?`,{icon:3,title:"提示",btn:["确定","取消"]},(async Mt=>{layer.close(Mt);let At=loading();try{await mt.deleteFile(St.fileId);let Nt=await mt.getBackupList(wt);xt.replaceData(Nt),layer.alert("删除成功")}catch(Nt){console.error(Nt),show.error(`发生错误: ${Nt&&Nt.message}`)}finally{At.close()}}))})),It&&It.addEventListener("click",(async Pt=>{let Mt=loading();try{const At=await decryptData(await mt.getFileContent(St.fileId));utils.download(At,St.name)}catch(At){clog.error(At),show.error("下载失败: "+At)}finally{Mt.close()}})),Bt&&Bt.addEventListener("click",(async Pt=>{let Mt=loading();try{let At=await mt.getFileContent(St.fileId);At=await decryptData(At);const Nt=JSON.parse(At),Dt=await storageManager.exportData(),Lt=await storageManager.diffData(Dt,Nt);Mt.close(),yt(Lt,null,Nt)}catch(At){Mt.close(),console.error(At),show.error("预览失败: "+(At&&At.message))}}))})),` <button type="button" class="jhs-btn jhs-btn--danger backup-delete">删除</button> <button type="button" class="jhs-btn jhs-btn--secondary backup-download">下载</button> <button type="button" class="jhs-btn jhs-btn--primary backup-import">导入</button> `}}],locale:"zh-cn",langs:{"zh-cn":{pagination:{first:"首页",first_title:"首页",last:"尾页",last_title:"尾页",prev:"上一页",prev_title:"上一页",next:"下一页",next_title:"下一页",all:"所有",page_size:"每页行数"}}}})}})}async function exportSettingData(){try{const Ct=JSON.stringify(await storageManager.exportData()),mt=`${utils.getNowStr("_","_")}.json`;utils.download(Ct,mt),show.ok("数据导出成功")}catch(Ct){console.error(Ct),show.error("导出数据时出错: "+Ct.message)}}class Ae extends X{constructor(){super(...arguments),i(this,"folderName","JHS-数据备份"),i(this,"cacheItems",[{key:"jhs_dmm_video",text:"预览视频缓存",title:"预览视频缓存"},{key:"jhs_other_site",text:"第三方站点缓存",title:"第三方站点资源检测结果, 如missav,123Av等"},{key:"jhs_screenShot",text:"缩略图缓存",title:"缩略图缓存"},{key:"jhs_translate",text:"标题翻译",title:"标题翻译"},{key:"jhs_actress_info",text:"演员信息",title:"演员的年龄三围等数据信息"},{key:"jhs_score_info",text:"Top250|热播 评分数据",title:"Top250及热播的评分数据"},{key:"third_party_ttl_cache",text:"第三方TTL缓存",title:"评论、相关清单、磁力搜索、缩略图等请求缓存"},{key:"_circuitBreaker",text:"熔断状态",title:"各站点的熔断计数和状态"},{key:"_domainStats",text:"域名请求统计",title:"各域名的请求次数和错误统计"}])}getName(){return"SettingPlugin"}async initCss(){const mt=await storageManager.getSetting();let bt=mt?.containerWidth??"100";utils.isMobileMode()&&(bt="100");let wt=utils.isMobile()&&window.innerWidth<1e3?1:mt?.containerColumns??5;return window.getBeanForSetting=this.getBean.bind(this),applyImageMode().catch((yt=>console.error("[JHS] applyImageMode failed:",yt))),buildSettingCss(bt,wt,l,r)}async handle(){if(await storageManager.getSetting("enableClog",_)===_&&clog.show(),r){let mt=function(){$(".navbar-search").is(":hidden")?($(".mini-setting-box").hide(),$(".setting-box").show()):($(".mini-setting-box").show(),$(".setting-box").hide())};$("#navbar-menu-user .navbar-end").prepend(`<div class="navbar-item has-dropdown is-hoverable setting-box jhs-setting-nav-item"> <button type="button" id="setting-btn" class="jhs-btn navbar-link nav-btn jhs-nav-btn jhs-nav-button"> 设置 </button> <div class="simple-setting"></div> </div>`),utils.loopDetector((()=>$("#miniHistoryBtn").length>0),(()=>{$(".miniHistoryBtnBox").before(` <div class="navbar-item mini-setting-box jhs-mini-setting-box"> <button type="button" id="mini-setting-btn" class="jhs-btn navbar-link nav-btn jhs-nav-btn jhs-mini-setting-trigger"> 设置 </button> <div class="mini-simple-setting"></div> </div> `),mt()})),$(window).resize(mt)}l&&(utils.loopDetector((()=>$("#waitCheckBtn").length),(()=>{$("#waitCheckBtn").parent().append(` <div id="top-right-box" class="jhs-setting-anchor"> <div class="setting-box"> <button type="button" id="setting-btn" class="jhs-btn jhs-btn--dark"> <span>设置</span> </button> <div class="simple-setting"></div> </div> </div> `)}),1,1e4,!1),isDetailPage&&$("h3").before(` <div class="container-fluid jhs-setting-detail-anchor"> <div id="top-right-box" class="jhs-setting-anchor"> <div class="setting-box"> <button type="button" id="setting-btn" class="jhs-btn jhs-btn--dark"> <span>设置</span> </button> <div class="simple-setting"></div> </div> </div> </div> `)),$(".main-nav, .container-fluid").on("click","#setting-btn, #mini-setting-btn",(()=>{clog.lowZIndex(),this.openSettingDialog()})),$(".main-nav, .container-fluid").on("mouseenter",".setting-box",(()=>{$(".simple-setting").html(buildSimpleSettingHtml()).show(),initSimpleSettingForm(this.getBean.bind(this),this.getSelector.bind(this),this.openSettingDialog.bind(this)).then(),clog.lowZIndex()})).on("mouseleave",".setting-box",(()=>{$(".simple-setting").html("").hide()})),$(".main-nav, .container-fluid").on("mouseenter",".mini-setting-box",(()=>{$(".mini-simple-setting").html(buildSimpleSettingHtml()).show(),initSimpleSettingForm(this.getBean.bind(this),this.getSelector.bind(this),this.openSettingDialog.bind(this)).then(),clog.lowZIndex()})).on("mouseleave",".mini-setting-box",(()=>{$(".mini-simple-setting").html("").hide()}))}async openSettingDialog(mt="backup-panel",bt){const wt=this.getBean("CoverButtonPlugin"),yt=buildSettingDialogHtml(mt,this.cacheItems,wt);layer.open({type:1,title:"设置",content:yt,area:utils.getDialogArea("lg"),scrollbar:!1,success:async(jt,xt)=>{$(jt).find(".layui-layer-content").css("position","relative"),injectHealthPanel(),injectPluginMgmtPanel(),injectSnapshotPanel(),injectNetworkPanel(),await loadSettingForm(this.getBean.bind(this)),JhsSelect.enhance(jt),this.bindClick(),$(".side-menu-item.active").attr("aria-current","page"),utils.setupEscClose(xt),bt&&bt(),utils.isMobileMode()&&this.collapseAdvancedTabs()},end:()=>{this.getBean("CoverButtonPlugin").enableSvgBtn()}})}collapseAdvancedTabs(){const mt=[{id:"health-panel",label:"数据体检",render:renderDataHealthPanel},{id:"plugin-mgmt-panel",label:"插件管理",render:renderPluginMgmtPanel},{id:"snapshot-panel",label:"恢复点",render:renderSnapshotPanel},{id:"network-panel",label:"外部请求",render:renderNetworkPanel}],bt=$(".jhs-mobile-sidebar"),wt=$(".content-panel").parent();if(!bt.length||!wt.length||(mt.forEach($t=>{bt.find(`[data-panel="${$t.id}"]`).remove()}),bt.find('[data-panel="more-tools-panel"]').length||bt.append('<button type="button" class="jhs-btn side-menu-item" data-panel="more-tools-panel" aria-controls="more-tools-panel">更多工具</button>'),$("#more-tools-panel").length))return;let yt=mt.map(($t,kt)=>`<button type="button" role="tab" aria-selected="${kt===0}" tabindex="${kt===0?"0":"-1"}" class="jhs-btn jhs-sub-tab${kt===0?" active":""}" data-sub-panel="${$t.id}">${$t.label}</button>`).join(""),jt=mt.map(($t,kt)=>`<div id="sub-${$t.id}" class="jhs-sub-panel${kt===0?" active":""}" data-rendered="false"></div>`).join("");const xt=` <div id="more-tools-panel" class="content-panel jhs-more-tools-panel"> <div class="jhs-sub-tabs" role="tablist" aria-label="更多工具">${yt}</div> <div class="jhs-sub-panels">${jt}</div> </div> `;wt.append(xt),mt.forEach($t=>{const kt=$(`#${$t.id}`);kt.length&&(kt.children().appendTo(`#sub-${$t.id}`),kt.remove(),$(`#sub-${$t.id}`).attr("data-rendered","true"))}),bt.on("click",'[data-panel="more-tools-panel"]',function(){$(".side-menu-item").removeClass("active").attr("aria-current","false"),$(this).addClass("active").attr("aria-current","page"),$(".content-panel").hide(),$("#more-tools-panel").show(),$("#saveBtn").show(),$("#clean-all").addClass("jhs-is-hidden")}),$("#more-tools-panel").on("click",".jhs-sub-tab",function(){const $t=$(this).data("sub-panel");$("#more-tools-panel .jhs-sub-tab").removeClass("active").attr({"aria-selected":"false",tabindex:"-1"}),$(this).addClass("active").attr({"aria-selected":"true",tabindex:"0"}),$("#more-tools-panel .jhs-sub-panel").removeClass("active"),$(`#sub-${$t}`).addClass("active"),$(`#sub-${$t}`).attr("data-rendered")!=="true"&&$(`#sub-${$t}`).attr("data-rendered","true");const kt=mt.find(_t=>_t.id===$t);kt&&kt.render&&kt.render()}).on("keydown",".jhs-sub-tab",function($t){if(!["ArrowLeft","ArrowRight","Home","End"].includes($t.key))return;$t.preventDefault();const kt=$("#more-tools-panel .jhs-sub-tab"),_t=kt.index(this),St=$t.key==="Home"?0:$t.key==="End"?kt.length-1:$t.key==="ArrowRight"?(_t+1)%kt.length:(_t-1+kt.length)%kt.length;kt.eq(St).trigger("click").trigger("focus")})}bindClick(){const mt=this;$(".side-menu-item").on("click",(function(){$(".side-menu-item").removeClass("active").attr("aria-current","false"),$(this).addClass("active").attr("aria-current","page"),$(".content-panel").hide();const xt=$(this).data("panel");$("#"+xt).show(),xt==="cache-panel"?($("#saveBtn").hide(),$("#clean-all").removeClass("jhs-is-hidden")):($("#saveBtn").show(),$("#clean-all").addClass("jhs-is-hidden")),xt==="health-panel"&&($("#saveBtn").hide(),$("#clean-all").addClass("jhs-is-hidden"),renderDataHealthPanel()),xt==="plugin-mgmt-panel"&&($("#saveBtn").hide(),$("#clean-all").addClass("jhs-is-hidden"),renderPluginMgmtPanel()),xt==="snapshot-panel"&&($("#saveBtn").hide(),$("#clean-all").addClass("jhs-is-hidden"),renderSnapshotPanel()),xt==="network-panel"&&($("#saveBtn").hide(),$("#clean-all").addClass("jhs-is-hidden"),renderNetworkPanel())})),$("#importBtn").on("click",(xt=>importSettingData(showDiffPreview))),$("#exportBtn").on("click",(xt=>exportSettingData())),$("#webdavBackupBtn").on("click",(xt=>backupDataByWebDav(this.folderName))),$("#webdavBackupListBtn").on("click",(xt=>backupListBtnByWebDav(this.folderName,($t,kt,_t)=>openFileListDialog($t,kt,_t,this.folderName,showDiffPreview)))),$("#saveBtn").on("click",(()=>saveSettingForm(this.getBean.bind(this)))),$("#runHealthCheckBtn").on("click",(()=>renderDataHealthPanel())),$("#repairHealthBtn").on("click",(xt=>{utils.q(xt,"修复前会自动下载备份,是否继续?",(()=>repairDataHealthWithBackup()))})),$("#pm-clear-log").on("click",(()=>{unsafeWindow.pluginManager.clearErrorLog(),$("#plugin-error-log").text("无错误记录"),show.ok("错误日志已清空")})),$("#createSnapshotBtn").on("click",(async()=>{let xt=loading();try{await storageManager.createSnapshot("手动快照","manual"),show.ok("快照创建成功"),renderSnapshotPanel()}catch($t){console.error($t),show.error("创建快照失败: "+$t.message)}finally{xt.close()}})),$(".clean-btn").on("click",(async xt=>{const $t=$(xt.currentTarget).data("key"),kt=this.cacheItems.find((_t=>_t.key===$t));$t===storageManager.third_party_cache_key?await storageManager.clearThirdPartyCache():$t==="_circuitBreaker"?gmHttp.resetAllCircuitBreakers():$t==="_domainStats"?gmHttp.clearDomainStats():localStorage.removeItem($t),show.ok(`${kt.text} 清理成功`),$("#cache-data-display").addClass("jhs-is-hidden"),$t==="jhs_dmm_video"&&localStorage.removeItem("jhs_other_site_dmm")})),$("#clean-all").on("click",(async()=>{this.cacheItems.forEach((xt=>localStorage.removeItem(xt.key))),show.ok("全部缓存已清理"),$("#cache-data-display").addClass("jhs-is-hidden"),localStorage.removeItem("jhs_other_site_dmm"),await storageManager.clearThirdPartyCache()})),$(".view-btn").on("click",(async xt=>{const $t=$(xt.currentTarget).data("key");let kt;$t===storageManager.third_party_cache_key?kt=JSON.stringify(await storageManager.getThirdPartyCache()):$t==="_circuitBreaker"?kt=JSON.stringify(gmHttp.getCircuitBreakerStatus()):$t==="_domainStats"?kt=JSON.stringify(gmHttp.getDomainStats()):kt=localStorage.getItem($t);const _t=$("#cache-data-display"),St=_t.find("pre");if(_t.removeClass("jhs-is-hidden"),kt)try{const Tt=JSON.parse(kt);St.text(JSON.stringify(Tt,null,2))}catch{St.text(kt)}else St.text("无数据")}));const bt=$("#highlightedTagNumber"),wt=$("#highlightedTagColor"),yt=$("#highlightedTagLabel");function jt(){const xt=bt.val(),$t=wt.val();yt.css("border",`${xt}px solid ${$t}`)}bt.on("input",jt),wt.on("input",jt),$("#themeMode").on("change",(async function(){await storageManager.saveSettingItem("themeMode",$(this).val()),applyTheme()}))}}const ENCRYPTION_SALT="x7k9p3";async function getEncryptionKey(){const Ct=new TextEncoder,mt=await crypto.subtle.importKey("raw",Ct.encode(ENCRYPTION_SALT+".jhs.v1"),{name:"PBKDF2"},!1,["deriveKey"]);return crypto.subtle.deriveKey({name:"PBKDF2",salt:Ct.encode("jhs-backup"),iterations:1e5,hash:"SHA-256"},mt,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}function arrayBufferToBase64(Ct){const mt=new Uint8Array(Ct),bt=32768;let wt="";for(let yt=0;yt<mt.length;yt+=bt)wt+=String.fromCharCode.apply(null,mt.subarray(yt,yt+bt));return btoa(wt)}function base64ToArrayBuffer(Ct){const mt=atob(Ct),bt=new Uint8Array(mt.length);for(let wt=0;wt<mt.length;wt++)bt[wt]=mt.charCodeAt(wt);return bt}async function encryptData(Ct){const mt=await getEncryptionKey(),bt=crypto.getRandomValues(new Uint8Array(12)),wt=new TextEncoder,yt=await crypto.subtle.encrypt({name:"AES-GCM",iv:bt},mt,wt.encode(Ct)),jt=new Uint8Array(bt.length+yt.byteLength);return jt.set(bt),jt.set(new Uint8Array(yt),bt.length),arrayBufferToBase64(jt)}async function decryptData(Ct){const mt=await getEncryptionKey(),bt=base64ToArrayBuffer(Ct),wt=bt.slice(0,12),yt=bt.slice(12),jt=await crypto.subtle.decrypt({name:"AES-GCM",iv:wt},mt,yt);return new TextDecoder().decode(jt)}const CREDENTIAL_PREFIX="AES:";async function encryptCredential(Ct){return Ct&&!Ct.startsWith(CREDENTIAL_PREFIX)?CREDENTIAL_PREFIX+await encryptData(Ct):Ct}async function decryptCredential(Ct){return Ct&&Ct.startsWith(CREDENTIAL_PREFIX)?await decryptData(Ct.slice(CREDENTIAL_PREFIX.length)):Ct}class je extends X{getName(){return"BusPreviewVideoPlugin"}async initCss(){return` /* 弹窗/Modal 样式 */ .bus-preview-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.95); /* 关键修改:更新 z-index */ z-index: 12345699; display: flex; justify-content: center; align-items: center; opacity: 0; visibility: hidden; transition: opacity 0.2s ease; } .bus-preview-modal.is-open { opacity: 1; visibility: visible; } /* 垂直排列视频和按钮,并居中 */ .bus-preview-modal-content { position: relative; max-width: 95%; max-height: 95%; display: flex; flex-direction: column; align-items: center; gap: 15px; } /* 移除 .bus-preview-close-btn 的样式 */ /* 视频播放器容器 */ .video-player-wrapper { /* 关键修改:更新 width 和 max-height */ width: 80vw; max-height: 85vh; aspect-ratio: 16 / 9; position: relative; background-color: black; max-width: 100%; } /* 视频元素 */ .video-player-wrapper #preview-video { position: absolute; top: 0; left: 0; width: 100%; height: 100%; display: block; } /* 画质控制盒 (底部按钮) */ .video-control-box { display: flex; flex-direction: row; justify-content: center; flex-wrap: wrap; gap: 10px; padding: 10px 0; } /* 按钮样式 (保留) */ .video-control-btn { min-width:80px; padding: 6px 12px; background: rgba(255,255,255,0.2); color: white; border: 1px solid rgba(255,255,255,0.5); border-radius: 4px; cursor: pointer; text-align: center; font-size: 14px; transition: background-color 0.2s, border-color 0.2s; } .video-control-btn:hover { background: rgba(255,255,255,0.4); } .video-control-btn.active { background-color: var(--jhs-accent); color: var(--jhs-accent-text-on); font-weight: bold; border: 1px solid var(--jhs-accent); } `}initModal(){if($("#bus-preview-modal").length===0){$("body").append(` <div id="bus-preview-modal" class="bus-preview-modal"> <div class="bus-preview-modal-content"> </div> </div> `);const mt=$("#bus-preview-modal");mt.on("click",(bt=>{bt.target.id==="bus-preview-modal"&&this.closeVideoModal()})),$(document).on("keydown",(bt=>{bt.key==="Escape"&&mt.hasClass("is-open")&&this.closeVideoModal()}))}}closeVideoModal(){const mt=$("#preview-video");mt.length>0&&mt[0].pause(),$("#bus-preview-modal").removeClass("is-open")}async handle(){if(!isDetailPage)return;this.initModal();const mt=$("#sample-waterfall .sample-box .photo-frame img:first").attr("src"),bt=$(` <button type="button" class="jhs-btn preview-video-container sample-box jhs-layout-3b6a3a65"> <div class="photo-frame jhs-layout-87db2275"> <img src="${mt}" class="video-cover" alt=""> <div class="play-icon jhs-play-overlay"> ▶ </div> </div> </button>`);$("#sample-waterfall").prepend(bt),await storageManager.getSetting("enableLoadPreviewVideo","yes")==="yes"&&ne(this.getPageInfo().carNum,!1).then();let wt=!1,yt=$(".preview-video-container");yt.on("click",(async jt=>{if(jt.preventDefault(),jt.stopPropagation(),wt)show.info("正在加载中, 勿重复点击");else{wt=!0;try{await this.handleVideo()}finally{wt=!1}}})),window.location.href.includes("autoPlay=1")&&yt.trigger("click")}async handleVideo(){const mt=$("#bus-preview-modal"),bt=mt.find(".bus-preview-modal-content");let wt=$("#preview-video");if(wt.length>0)return mt.addClass("is-open"),void wt[0].play().catch((xt=>console.warn("尝试播放失败 (可能被浏览器阻止):",xt)));let yt=this.getPageInfo().carNum;const jt=await ne(yt);jt&&Object.keys(jt).length!==0?(await this.createVideoPlayerAndControls(jt,bt),wt=$("#preview-video"),wt.length>0?(mt.addClass("is-open"),wt[0].play().catch((xt=>console.warn("尝试播放失败 (可能被浏览器阻止):",xt)))):show.error("视频播放器创建失败。")):show.error("未找到可用的视频源。")}async createVideoPlayerAndControls(mt,bt){let wt=await storageManager.getSetting("videoQuality");wt=Z(Object.keys(mt),wt);let yt=mt[wt];bt.html(` <div class="video-player-wrapper"> <video id="preview-video" controls playsinline> <source src="${yt}" /> </video> </div> <div class="video-control-box"> </div> `);const jt=$("#preview-video"),xt=jt.find("source"),$t=bt.find(".video-control-box");if(!jt.length||!xt.length)return;const kt=jt[0],_t=localStorage.getItem("jhs_videoMuted");kt.muted=!_t||_t==="yes",kt.addEventListener("volumechange",(function(){localStorage.setItem("jhs_videoMuted",kt.muted?"yes":"no")}));let St="";L.forEach((It=>{let Bt=mt[It.quality];if(Bt){const Pt=wt===It.quality;St+=` <button class="jhs-btn video-control-btn${Pt?" active":""}" data-quality="${It.quality}" data-video-src="${Bt}"> ${It.text} </button> `}})),$t.html(St);const Tt=$t.find(".video-control-btn");$t.off("click").on("click",".video-control-btn",(async It=>{try{const Bt=$(It.currentTarget);if(Bt.hasClass("active"))return;let Pt=Bt.attr("data-video-src");xt.attr("src",Pt);const Mt=kt.currentTime;kt.load(),kt.currentTime=Mt,await kt.play(),Tt.removeClass("active"),Bt.addClass("active")}catch(Bt){console.error("切换画质失败:",Bt)}}))}}class Ee extends X{constructor(){super(...arguments),i(this,"siteList",[{name:"Google旧版",url:"https://www.google.com/searchbyimage?image_url={占位符}&client=firefox-b-d",ico:"https://www.google.com/favicon.ico"},{name:"Google",url:"https://lens.google.com/uploadbyurl?url={占位符}",ico:"https://www.google.com/favicon.ico"},{name:"Yandex",url:"https://yandex.ru/images/search?rpt=imageview&url={占位符}",ico:"https://yandex.ru/favicon.ico"}]),i(this,"isUploading",!1)}getName(){return"SearchByImagePlugin"}async initCss(){return` <style> #upload-area { border: 2px dashed var(--jhs-status-down); border-radius: 8px; padding: 40px; text-align: center; margin-bottom: 20px; transition: all 0.3s; background-color: var(--jhs-surface-2); } #upload-area:hover { border-color: var(--jhs-status-down-hover); background-color: var(--jhs-surface-2); } /* 拖拽进入 */ #upload-area.highlight { border-color: var(--jhs-status-fav); background-color: var(--jhs-status-fav-tint); } #select-image-btn { background-color: var(--jhs-status-down); color: var(--jhs-status-down-on); border: none; padding: 10px 20px; border-radius: var(--jhs-radius-sm); cursor: pointer; font-size: 16px; transition: background-color 0.3s; } #select-image-btn:hover { background-color: var(--jhs-status-down-hover); } #handle-btn, #cancel-btn { padding: 8px 16px; border-radius: var(--jhs-radius-sm); cursor: pointer; font-size: 14px; border: none; transition: opacity 0.3s; } #handle-btn { background-color: var(--jhs-status-fav); color: var(--jhs-status-fav-on); } #handle-btn:hover { filter: brightness(0.94); } #cancel-btn { background-color: var(--jhs-status-filter); color: var(--jhs-status-filter-on); } #cancel-btn:hover { filter: brightness(0.94); } .search-img-site-btns-container { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 15px; } .search-img-site-btn { display: flex; align-items: center; padding: 8px 12px; background-color: var(--jhs-surface-2); border-radius: var(--jhs-radius-sm); text-decoration: none; color: var(--jhs-text); transition: all 0.2s; font-size: 14px; border: 1px solid var(--jhs-border); } .search-img-site-btn:hover { background-color: var(--jhs-border); transform: translateY(-2px); box-shadow: 0 2px 5px rgba(0,0,0,0.1); } .search-img-site-btn img { width: 16px; height: 16px; margin-right: 6px; } .search-img-site-btn span { white-space: nowrap; } </style> `}open(mt){layer.open({type:1,title:"以图识图",content:` <div class="jhs-layout-769fed37"> <div id="upload-area"> <div class="jhs-layout-9e3c853e"> <p>拖拽图片到此处 或 点击按钮选择图片</p> <p>也可以直接 Ctrl+V 粘贴图片或 图片URL</p> </div> <button class="jhs-btn" id="select-image-btn">选择图片</button> <input type="file" id="image-file" accept="image/*" class="jhs-layout-6b99de8b"> </div> <div id="url-input-container" class="jhs-layout-d50e4f09"> <input type="text" id="image-url" placeholder="粘贴图片URL地址..." class="jhs-field"> </div> <div id="preview-area" class="jhs-layout-d10a577d"> <img id="preview-image" alt="" src="" class="jhs-image-preview"> <div id="action-btns" class="jhs-layout-06cf30c0"> <button class="jhs-btn" id="handle-btn">搜索图片</button> <button class="jhs-btn" id="cancel-btn">取消</button> </div> <div id="search-results" class="jhs-layout-c8be1ccb"> <p class="jhs-layout-9ea2322d">请选择识图网站:<button type="button" id="openAll" class="jhs-btn jhs-btn--ghost">全部打开</button></p> <div class="search-img-site-btns-container" id="search-img-site-btns-container"></div> </div> </div> </div> `,area:utils.isMobile()?utils.getResponsiveArea():["40%","80%"],success:async bt=>{this.initEventListeners(),mt&&mt()},end:()=>{$(document).off("paste.searchImg")}})}initEventListeners(){const mt=$("#upload-area"),bt=$("#image-file"),wt=$("#select-image-btn"),yt=$("#preview-area"),jt=$("#preview-image"),xt=$("#action-btns"),$t=$("#handle-btn"),kt=$("#cancel-btn"),_t=$("#url-input-container"),St=$("#image-url"),Tt=$("#search-results"),It=$("#search-img-site-btns-container");mt.on("dragover",(Bt=>{Bt.preventDefault(),mt.addClass("highlight")})).on("dragleave",(()=>{mt.removeClass("highlight")})).on("drop",(Bt=>{Bt.preventDefault(),mt.removeClass("highlight"),Bt.originalEvent.dataTransfer.files&&Bt.originalEvent.dataTransfer.files[0]&&(this.handleImageFile(Bt.originalEvent.dataTransfer.files[0]),this.resetSearchUI())})),wt.on("click",(()=>{bt.trigger("click")})),bt.on("change",(Bt=>{Bt.target.files&&Bt.target.files[0]&&(this.handleImageFile(Bt.target.files[0]),this.resetSearchUI())})),$(document).on("paste.searchImg",(async Bt=>{const Pt=Bt.originalEvent.clipboardData.items;for(let At=0;At<Pt.length;At++)if(Pt[At].type.indexOf("image")!==-1){const Nt=Pt[At].getAsFile();return this.handleImageFile(Nt),void this.resetSearchUI()}const Mt=Bt.originalEvent.clipboardData.getData("text");Mt&&utils.isUrl(Mt)&&(_t.show(),St.val(Mt),jt.attr("src",Mt),yt.show(),this.resetSearchUI())})),$t.on("click",(async()=>{const Bt=jt.attr("src");if(Bt){if(!this.isUploading){this.isUploading=!0;try{const Pt=await this.searchByImage(Bt);xt.hide(),Tt.show(),It.empty();const Mt="jhs_selectedSites",At=JSON.parse(localStorage.getItem(Mt)||"{}");this.siteList.forEach((Nt=>{const Dt=Nt.url.replace("{占位符}",encodeURIComponent(Pt)),Lt=At[Nt.name]!==!1;It.append(` <a href="${Dt}" class="search-img-site-btn" target="_blank" title="${Nt.name}"> <input type="checkbox" class="site-checkbox jhs-layout-8896c95d" data-site-name="${Nt.name}" ${Lt?"checked":""}> <img src="${Nt.ico}" alt="${Nt.name}"> <span>${Nt.name}</span> </a> `)})),It.on("change",".site-checkbox",(function(){const Nt=$(this).data("site-name");At[Nt]=$(this).is(":checked"),localStorage.setItem(Mt,JSON.stringify(At))})),It.show()}finally{this.isUploading=!1}}}else show.info("请粘贴或上传图片")})),kt.on("click",(()=>{yt.hide(),_t.hide(),bt.val(""),St.val("")})),St.on("change",(()=>{utils.isUrl(St.val())&&(jt.attr("src",St.val()),yt.show())})),$("#openAll").on("click",(()=>{$(".search-img-site-btn").each((function(){$(this).find(".site-checkbox").is(":checked")&&window.open($(this).attr("href"))}))}))}resetSearchUI(){$("#action-btns").show(),$("#search-results").hide(),$("#search-img-site-btns-container").hide().empty()}handleImageFile(mt){const bt=document.getElementById("preview-image"),wt=document.getElementById("preview-area"),yt=document.getElementById("url-input-container");if(!mt.type.match("image.*"))return void show.info("请选择图片文件");const jt=new FileReader;jt.onload=xt=>{bt.src=xt.target.result,wt.style.display="block",yt.style.display="none",$("#handle-btn")[0].click()},jt.readAsDataURL(mt)}async searchByImage(mt){let bt=loading();try{let wt=mt;if(mt.startsWith("data:")){show.info("开始上传图片...");const yt=await(async function(jt){var xt;const $t=jt.match(/^data:(.+);base64,(.+)$/);if(!$t||$t.length<3)throw new Error("无效的Base64图片数据");const kt=$t[1],_t=$t[2],St=atob(_t),Tt=new Array(St.length);for(let Nt=0;Nt<St.length;Nt++)Tt[Nt]=St.charCodeAt(Nt);const It=new Uint8Array(Tt),Bt=new Blob([It],{type:kt}),Pt=new FormData;Pt.append("image",Bt);const Mt=await fetch("https://api.imgur.com/3/image",{method:"POST",headers:{Authorization:"Client-ID d70305e7c3ac5c6"},body:Pt}),At=await Mt.json();if(At.success&&At.data&&At.data.link)return At.data.link;throw new Error(((xt=At.data)==null?void 0:xt.error)||"上传到Imgur失败")})(mt);if(!yt)return void show.error("上传失败");wt=yt}return wt}catch(wt){show.error(`搜索失败: ${wt.message}`),console.error("搜索失败:",wt)}finally{bt.close()}}}class Fe extends X{getName(){return"BusNavBarPlugin"}handle(){$("#navbar > div > div > span").append(` <button class="jhs-btn btn btn-default jhs-layout-638cb2c9" id="search-img-btn">识图</button> `),$("#search-img-btn").on("click",(()=>{this.getBean("SearchByImagePlugin").open()}))}}class He extends X{constructor(){super(...arguments),i(this,"floorIndex",1),i(this,"isInit",!1),i(this,"$panel",null)}getName(){return"RelatedPlugin"}async initCss(){return` <style> .jhs-related-panel { min-width:0; } .jhs-related-list { display:grid; } .jhs-related-item { display:grid; gap:var(--jhs-space-2); padding:var(--jhs-space-3) 0; border-bottom:1px solid color-mix(in srgb,var(--jhs-border) 55%,transparent); } .jhs-related-item:last-child { border-bottom:0; } .jhs-related-heading { display:flex; min-width:0; align-items:baseline; gap:var(--jhs-space-2); } .jhs-related-index { flex:none; color:var(--jhs-text-faint); font-size:14px; } .jhs-related-title { min-width:0; overflow:hidden; color:var(--jhs-accent); font-size:16px; font-weight:600; text-overflow:ellipsis; text-decoration:none; white-space:nowrap; } .jhs-related-meta { display:flex; flex-wrap:wrap; gap:var(--jhs-space-2) var(--jhs-space-4); color:var(--jhs-text-muted); font-size:14px; } .jhs-related-time { color:var(--jhs-text-faint); font-size:14px; white-space:nowrap; } </style>`}async showRelated(mt,bt){const wt=await storageManager.getSetting("enableLoadRelated",C),yt=mt;if(!bt)return void show.error("未传入movieId");const jt=$('<section class="jhs-related-panel" data-jhs-panel="related"></section>'),xt=$('<header class="jhs-panel-header"><h3>相关清单</h3></header>'),$t=$('<button type="button" id="relatedFold" class="jhs-btn jhs-btn--secondary jhs-panel-toggle"><span class="toggle-text"></span><span class="toggle-icon" aria-hidden="true"></span></button>');xt.append($t),jt.append(xt,'<div id="relatedContainer" class="jhs-related-list"></div>','<div id="relatedFooter" class="jhs-panel-footer"></div>'),yt.append(jt),this.$panel=jt,this.updateToggle($t,wt===_),$t.on("click",(kt=>{kt.preventDefault(),kt.stopPropagation();const _t=$t.find(".toggle-text").text()==="展开";this.updateToggle($t,_t),jt.find("#relatedContainer, #relatedFooter").toggle(_t),_t&&!this.isInit&&(this.fetchAndDisplayRelateds(bt),this.isInit=!0),storageManager.saveSettingItem("enableLoadRelated",_t?_:C)})),wt===_?(await this.fetchAndDisplayRelateds(bt),this.isInit=!0):jt.find("#relatedContainer, #relatedFooter").hide()}updateToggle(mt,bt){mt.attr("aria-expanded",String(bt)),mt.find(".toggle-text").text(bt?"折叠":"展开"),mt.find(".toggle-icon").text(bt?"▲":"▼")}async fetchAndDisplayRelateds(mt){const bt=this.$panel.find("#relatedContainer"),wt=this.$panel.find("#relatedFooter");bt.empty().append($('<div class="jhs-panel-state"></div>').text("获取清单中...")),wt.empty();let yt;try{yt=await K(mt,1,20)}catch(jt){return console.error("获取清单失败:",jt),void this.renderRetry(bt,(()=>this.fetchAndDisplayRelateds(mt)))}if(bt.empty(),!yt.length)return void bt.append($('<div class="jhs-panel-state"></div>').text("无清单"));this.displayRelateds(yt,bt),yt.length===20?this.bindLoadMore(mt,bt,wt):wt.append($('<div class="jhs-panel-end"></div>').text("已加载全部清单"))}renderRetry(mt,bt){mt.empty();const wt=$('<div class="jhs-panel-state"></div>').append(document.createTextNode("获取清单失败 "));wt.append($('<button type="button" class="jhs-btn jhs-btn--secondary jhs-btn--sm">重试</button>').on("click",bt)),mt.append(wt)}bindLoadMore(mt,bt,wt){const yt=$('<button type="button" id="loadMoreRelateds" class="jhs-btn jhs-btn--secondary">加载更多清单</button>'),jt=$('<div id="relatedEnd" class="jhs-panel-end">已加载全部清单</div>').hide();wt.empty().append(yt,jt);let xt=1;yt.on("click",(async()=>{yt.text("加载中...").prop("disabled",!0),xt++;try{const $t=await K(mt,xt,20);this.displayRelateds($t,bt),$t.length<20?(yt.remove(),jt.show()):yt.text("加载更多清单").prop("disabled",!1)}catch($t){console.error("加载更多清单失败:",$t),yt.text("加载失败,请重试").prop("disabled",!1)}}))}displayRelateds(mt,bt){mt.forEach((wt=>{const yt=$('<article class="jhs-related-item"></article>'),jt=$("<a></a>").addClass("jhs-related-title").attr({href:`/lists/${encodeURIComponent(wt.relatedId)}`,target:"_blank",rel:"noopener noreferrer"}).text(wt.name||"未命名清单"),xt=$('<div class="jhs-related-heading"></div>').append($("<span></span>").addClass("jhs-related-index").text(`#${this.floorIndex++}`),jt),$t=$('<div class="jhs-related-meta"></div>'),kt=$('<time class="jhs-related-time"></time>').text(`创建时间:${wt.createTime||"未知"}`);$t.append($("<span></span>").text(`视频:${Number(wt.movieCount)||0}`),$("<span></span>").text(`收藏:${Number(wt.collectionCount)||0}`),$("<span></span>").text(`查看:${Number(wt.viewCount)||0}`),kt),yt.append(xt,$t),bt.append(yt)}))}}class ze extends X{constructor(){super(...arguments),i(this,"type",null)}getName(){return"WantAndWatchedVideosPlugin"}async handle(){window.location.href.includes("/want_watch_videos")&&($("h3").append('<button type="button" class="jhs-btn jhs-btn--primary jhs-layout-481ed7e7" id="wantWatchBtn">导入至 JHS</button>'),$("#wantWatchBtn").on("click",(mt=>{this.type=h,this.importWantWatchVideos(mt,"是否将 想看的影片 导入到 JHS-收藏?")}))),window.location.href.includes("/watched_videos")&&($("h3").append('<button type="button" class="jhs-btn jhs-btn--primary jhs-layout-481ed7e7" id="wantWatchBtn">导入至 JHS</button>'),$("#wantWatchBtn").on("click",(mt=>{this.type=g,this.importWantWatchVideos(mt,"是否将 看过的影片 导入到 JHS-已下载?")})))}importWantWatchVideos(mt,bt){utils.q(null,`${bt} <br/> <span class="jhs-task-emphasis">执行此功能前请记得备份数据</span>`,(async()=>{let wt=loading();try{await this.parseMovieList()}catch(yt){console.error(yt)}finally{wt.close()}}))}async parseMovieList(mt){let bt,wt;mt?(bt=mt.find(this.getSelector().itemSelector),wt=mt.find(".pagination-next").attr("href")):(bt=$(this.getSelector().itemSelector),wt=$(".pagination-next").attr("href"));for(const yt of bt){const jt=$(yt),xt=jt.find("a").attr("href"),$t=jt.find(".video-title strong").text().trim(),kt=jt.find(".meta").text().trim();if(xt&&$t)try{if(await storageManager.getCar($t)){show.info(`${$t} 已存在, 跳过`);continue}await storageManager.saveCar({carNum:$t,url:xt,names:null,actionType:this.type,publishTime:kt})}catch(_t){console.error(`保存失败 [${$t}]:`,_t)}}wt?(show.info("发现下一页,正在解析:",wt),await new Promise((yt=>setTimeout(yt,1e3))),$.ajax({url:wt,method:"GET",success:yt=>{const jt=new DOMParser,xt=$(jt.parseFromString(yt,"text/html"));this.parseMovieList(xt)},error:function(yt){console.error(yt),show.error("加载下一页失败:"+yt.message)}})):(show.ok("导入结束!"),window.refresh())}}class Ue extends X{getName(){return"CoverButtonPlugin"}async initCss(){return` <style> .box .tags { justify-content:space-between; } .jhs-cover-tools { display:flex; align-items:center; justify-content:flex-end; gap:var(--jhs-space-2); margin-left:auto; } .jhs-cover-tools svg path { fill:var(--jhs-icon-color); } .jhs-cover-tools .screenSvg, .jhs-cover-tools .videoSvg { opacity:.65; } .jhs-cover-tools .screenSvg:hover, .jhs-cover-tools .videoSvg:hover { opacity:1; } ${l?".jhs-cover-tools .icon, .setting-label .icon{height:24px;width:24px}":""} .more-tools-container { position:relative; } .jhs-card-menu { top:auto; right:0; bottom:calc(100% + var(--jhs-space-2)); width:152px; } .jhs-card-menu .jhs-btn, .jhs-card-menu .site-btn { width:100%; min-height:var(--jhs-control-height); justify-content:flex-start; margin:0; } .jhs-card-menu__dot { width:8px; height:8px; flex:none; border-radius:50%; background:var(--jhs-border-strong); } .jhs-card-menu__dot--watch { background:var(--jhs-status-watch); } .jhs-card-menu__dot--down { background:var(--jhs-status-down); } .jhs-card-menu__dot--fav { background:var(--jhs-status-fav); } .jhs-card-menu__dot--filter { background:var(--jhs-status-filter); } .loading { opacity:.7; filter:blur(1px); } .loading-spinner { position:absolute; top:50%; left:50%; width:40px; height:40px; border:3px solid rgba(255,255,255,.3); border-top-color:#fff; border-radius:50%; transform:translate(-50%,-50%); animation:spin 1s ease-in-out infinite; z-index:20; } @keyframes spin { to { transform:translate(-50%,-50%) rotate(360deg); } } </style>`}handle(){window.isListPage&&(this.addSvgBtn(),this.bindClick().then())}buildToolBox(){return` <div class="tool-box jhs-cover-tools"> <button type="button" class="jhs-btn jhs-icon-btn screenSvg" title="长缩略图" aria-label="长缩略图">${this.screenSvg}</button> <button type="button" class="jhs-btn jhs-icon-btn videoSvg" title="播放视频" aria-label="播放视频">${this.videoSvg}</button> <div class="more-tools-container handleSvg"> <button type="button" title="鉴定处理" aria-label="鉴定处理" aria-haspopup="menu" aria-expanded="false" class="jhs-btn jhs-icon-btn jhs-card-menu-trigger">${this.handleSvg}</button> <div class="jhs-popover jhs-card-menu" role="menu"> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost jhs-card-status-item hasWatchBtn"><span class="jhs-card-menu__dot jhs-card-menu__dot--watch"></span><span>${k}</span></button> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost jhs-card-status-item hasDownBtn"><span class="jhs-card-menu__dot jhs-card-menu__dot--down"></span><span>${y}</span></button> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost jhs-card-status-item favoriteBtn"><span class="jhs-card-menu__dot jhs-card-menu__dot--fav"></span><span>${v}</span></button> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost jhs-card-status-item filterBtn"><span class="jhs-card-menu__dot jhs-card-menu__dot--filter"></span><span>${m}</span></button> </div> </div> <div class="more-tools-container siteSvg"> <button type="button" title="第三方网站" aria-label="第三方网站" aria-haspopup="menu" aria-expanded="false" class="jhs-btn jhs-icon-btn jhs-card-menu-trigger">${this.siteSvg}</button> <div class="jhs-popover jhs-card-menu" role="menu"> <a role="menuitem" class="site-btn site-jable"><span>Jable</span></a> <a role="menuitem" class="site-btn site-avgle"><span>Avgle</span></a> <a role="menuitem" class="site-btn site-miss-av"><span>MissAv</span></a> <a role="menuitem" class="site-btn site-123-av"><span>123Av</span></a> </div> </div> <div class="more-tools-container copySvg"> <button type="button" title="复制" aria-label="复制" aria-haspopup="menu" aria-expanded="false" class="jhs-btn jhs-icon-btn jhs-card-menu-trigger">${this.copySvg}</button> <div class="jhs-popover jhs-card-menu" role="menu"> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost carNumSvg">${this.carNumSvg}<span>复制番号</span></button> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost titleSvg">${this.titleSvg}<span>复制标题</span></button> <button type="button" role="menuitem" class="jhs-btn jhs-btn--ghost downSvg">${this.downSvg}<span>下载封面</span></button> </div> </div> </div>`}async addSvgBtn(){$(this.getSelector().itemSelector).toArray().forEach((mt=>{const bt=$(mt);if(bt.find(".tool-box").length||l&&bt.find(".avatar-box").length)return;const wt=r?bt.find(".tags").first():bt.find(".photo-info").first();wt.length&&wt.append(this.buildToolBox())})),this.enableSvgBtn()}async enableSvgBtn(){const mt=await storageManager.getSetting(),{enableScreenSvg:bt=_,enableVideoSvg:wt=_,enableHandleSvg:yt=_,enableSiteSvg:jt=_,enableCopySvg:xt=_}=mt;[{selector:".screenSvg",enabled:bt},{selector:".videoSvg",enabled:wt},{selector:".handleSvg",enabled:yt},{selector:".siteSvg",enabled:jt},{selector:".copySvg",enabled:xt}].forEach((({selector:$t,enabled:kt})=>{$($t).toggle(kt===_)}))}closeCardMenus(mt=!1){const bt=$(".jhs-card-menu.is-open"),wt=bt.siblings(".jhs-card-menu-trigger");bt.removeClass("is-open"),wt.attr("aria-expanded","false"),mt&&wt.first().trigger("focus")}async bindClick(){this.getSelector();const mt=this.getBean("ListPagePlugin");$(document).on("click",".jhs-card-menu-trigger",($t=>{$t.preventDefault(),$t.stopPropagation();const kt=$($t.currentTarget),_t=kt.siblings(".jhs-card-menu"),St=!_t.hasClass("is-open");this.closeCardMenus(),_t.toggleClass("is-open",St),kt.attr("aria-expanded",String(St)),St&&_t.children().first().trigger("focus")})).on("keydown",".jhs-card-menu [role='menuitem']",($t=>{const kt=$($t.currentTarget).closest(".jhs-card-menu"),_t=kt.find("[role='menuitem']"),St=_t.index($t.currentTarget);if($t.key==="Escape")return $t.preventDefault(),this.closeCardMenus(!0);if(!["ArrowDown","ArrowUp","Home","End"].includes($t.key))return;$t.preventDefault();const Tt=$t.key==="Home"?0:$t.key==="End"?_t.length-1:$t.key==="ArrowDown"?(St+1)%_t.length:(St-1+_t.length)%_t.length;_t.eq(Tt).trigger("focus")})).on("click",($t=>{$($t.target).closest(".more-tools-container").length||this.closeCardMenus()})),$(document).on("click",".videoSvg",($t=>{$t.preventDefault(),$('.videoSvg[title!="播放视频"]').each(((St,Tt)=>{const It=$(Tt);let Bt=It.closest(".item"),Pt=Bt.find("img"),{carNum:Mt}=mt.findCarNumAndHref(Bt);this.showImg(It,Pt,Mt),It.html(this.videoSvg).attr({title:"播放视频","aria-label":"播放视频"})}));const kt=$($t.target).closest(".item"),_t=kt.find(".videoSvg");if(_t.attr("title")==="播放视频"){_t.html(this.recoveryVideoSvg).attr({title:"切回封面","aria-label":"切回封面"});const{carNum:St}=mt.findCarNumAndHref(kt);let Tt=kt.find("img");if(!Tt.length)return void show.error("没有找到图片");this.showVideo(_t,Tt,St).then()}})),$(document).on("click",".screenSvg",(async $t=>{$t.preventDefault();let kt=loading();try{const _t=$($t.currentTarget).closest(".item");let{carNum:St}=mt.findCarNumAndHref(_t);St=St.replace("FC2-","");const Tt=await this.getBean("ScreenShotPlugin").getScreenshot(St);kt.close(),showImageViewer(Tt)}catch(_t){console.error("图片预览出错:",_t),show.error("图片预览出错:"+_t)}finally{kt.close()}})),$(document).on("click",".filterBtn, .favoriteBtn, .hasDownBtn, .hasWatchBtn",($t=>{$t.preventDefault(),$t.stopPropagation();try{const kt=$($t.currentTarget),_t=kt.closest(".item"),{carNum:St,url:Tt,publishTime:It}=mt.findCarNumAndHref(_t),Bt=async Pt=>{try{let Mt=await mt.parseActressName(Tt);await storageManager.saveCar({carNum:St,url:Tt,names:Mt,actionType:Pt,publishTime:It}),window.refresh(),show.ok("操作成功")}catch(Mt){console.error("保存操作失败:",Mt),show.error("操作失败")}};kt.hasClass("filterBtn")?utils.q($t,`是否屏蔽${St}?`,(()=>Bt(d))):kt.hasClass("favoriteBtn")?Bt(h).then():kt.hasClass("hasDownBtn")?Bt(g).then():kt.hasClass("hasWatchBtn")&&Bt(p).then(),this.closeCardMenus()}catch(kt){console.error("按钮点击处理失败:",kt)}}));const bt=this.getBean("OtherSitePlugin"),wt=await bt.getMissAvUrl(),yt=await bt.getjableUrl(),jt=await bt.getAvgleUrl(),xt=await bt.getAv123Url();$(this.getSelector().itemSelector).each((($t,kt)=>{const _t=$(kt),{carNum:St}=mt.findCarNumAndHref(_t);_t.find(".site-jable").attr({href:`${yt}/search/${St}/`,target:"_blank",rel:"noopener noreferrer"}),_t.find(".site-avgle").attr({href:`${jt}/vod/search.html?wd=${St}`,target:"_blank",rel:"noopener noreferrer"}),_t.find(".site-miss-av").attr({href:`${wt}/search/${St}`,target:"_blank",rel:"noopener noreferrer"}),_t.find(".site-123-av").attr({href:`${xt}/ja/search?keyword=${St}`,target:"_blank",rel:"noopener noreferrer"})})),$(document).on("click",".site-jable, .site-avgle, .site-miss-av, .site-123-av",($t=>{try{$t.preventDefault(),$t.stopPropagation();const kt=$($t.currentTarget),_t=kt.closest(".item"),{carNum:St}=mt.findCarNumAndHref(_t);let Tt=null;kt.hasClass("site-jable")?Tt=`${yt}/search/${St}/`:kt.hasClass("site-avgle")?Tt=`${jt}/vod/search.html?wd=${St}`:kt.hasClass("site-miss-av")?Tt=`${wt}/search/${St}`:kt.hasClass("site-123-av")&&(Tt=`${xt}/ja/search?keyword=${St}`),$t&&($t.ctrlKey||$t.metaKey)?GM_openInTab(Tt,{insert:0}):window.open(Tt),this.closeCardMenus()}catch(kt){console.error("站点按钮处理失败:",kt)}})),$(document).on("click",".titleSvg, .carNumSvg, .downSvg",($t=>{$t.preventDefault(),$t.stopPropagation();const kt=$($t.currentTarget).closest(".item"),{carNum:_t,title:St}=mt.findCarNumAndHref(kt),Tt=kt.find(l?".photo-frame img":".cover img");$($t.currentTarget).hasClass("titleSvg")?utils.copyToClipboard("标题",St):$($t.currentTarget).hasClass("carNumSvg")?utils.copyToClipboard("番号",_t):$($t.currentTarget).hasClass("downSvg")&&fetch(Tt.attr("src")).then((It=>It.blob())).then((It=>utils.download(It,_t+" "+St+".jpg"))),this.closeCardMenus()}))}showImg(mt,bt,wt){mt.html(this.videoSvg).attr({title:"播放视频","aria-label":"播放视频"});let yt=$(`#${`${wt}_preview_video`}`);yt.length>0&&(yt[0].pause(),yt.parent().hide()),bt.show(),bt.removeClass("loading"),bt.next(".loading-spinner").remove()}async showVideo(mt,bt,wt){const yt=`${wt}_preview_video`;let jt=$(`#${yt}`);if(jt.length>0)return jt.parent().show(),jt[0].play(),void bt.hide();bt.addClass("loading"),bt.after('<div class="loading-spinner"></div>');const xt=bt.attr("src"),$t=await ne(wt);if(!$t)return show.error("未解析到视频"),void this.showImg(mt,bt,wt);let kt=await storageManager.getSetting("videoQuality");kt=Z(Object.keys($t),kt);let _t=$t[kt],St=` <div class="jhs-layout-d543acf8"> <video src="${_t}" poster="${xt}" id="${yt}" controls loop muted playsinline class="jhs-layout-a38a0e50"></video> </div>`;l&&(St=`<div><video src="${_t}" poster="${xt}" id="${yt}" controls loop muted playsinline class="jhs-layout-a38a0e50"></video></div>`),bt.parent().append(St),bt.hide(),bt.removeClass("loading"),bt.next(".loading-spinner").remove(),jt=$(`#${yt}`);let Tt=jt[0];Tt.load(),Tt.muted=!1,Tt.play(),jt.trigger("focus")}}class Oe extends X{constructor(){super(...arguments),i(this,"$contentBox",$(".section .container")),i(this,"urlParams",new URLSearchParams(window.location.search)),i(this,"sortVal",this.urlParams.get("sort")||"release_date"),i(this,"currentPage",this.urlParams.get("page")?parseInt(this.urlParams.get("page")):1),i(this,"maxPage",null),i(this,"keyword",this.urlParams.get("keyword")||null)}getName(){return"Fc2By123AvPlugin"}async getBaseUrl(){return await this.getBean("OtherSitePlugin").getAv123Url()+"/ja"}handle(){$("#navbar-menu-hero > div > div:nth-child(1) > div > a:nth-child(4)").after('<a class="navbar-item" href="/advanced_search?type=100&released_start=2099-09">123Av-Fc2</a>'),$('.tabs li:contains("FC2")').after('<li><a href="/advanced_search?type=100&released_start=2099-09"><span>123Av-Fc2</span></a></li>'),o.includes("/advanced_search?type=100")&&(this.hookPage(),this.handleQuery().then())}hookPage(){let mt=$("h2.section-title");mt.contents().first().replaceWith("123Av"),mt.css("marginBottom","0"),mt.append(` <div class="jhs-layout-f5f47b30"> <input id="search-123av-keyword" type="text" placeholder="搜索123Av Fc2ppv内容" class="jhs-field"> <button type="button" id="search-123av-btn" class="jhs-btn jhs-btn--primary jhs-layout-21a4fe43">搜索</button> <button type="button" id="clear-123av-btn" class="jhs-btn jhs-btn--secondary jhs-layout-21a4fe43">重置</button> </div> `),$("#search-123av-keyword").val(this.keyword),$("#search-123av-btn").on("click",(async()=>{let bt=$("#search-123av-keyword").val().trim();bt&&(this.keyword=bt,utils.setHrefParam("keyword",bt),await this.handleQuery())})),$("#clear-123av-btn").on("click",(async()=>{$("#search-123av-keyword").val(""),this.keyword="",utils.setHrefParam("keyword",""),$(".page-box").show(),$(".tool-box").show(),await this.handleQuery()})),$(".empty-message").remove(),$("#foldCategoryBtn").remove(),$(".section .container .box").remove(),$("#sort-toggle-btn").remove(),this.$contentBox.append('<div class="tool-box jhs-layout-d2c171b1"></div>'),this.$contentBox.append('<div class="movie-list h cols-4 vcols-8 jhs-layout-d2c171b1"></div>'),this.$contentBox.append('<div class="page-box"></div>'),$(".tool-box").append(` <div class="button-group"> <div class="buttons has-addons" id="conditionBox"> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="release_date">发布日期</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="recent_update">最近更新</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="trending">热门</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="most_viewed_today">今天最多观看</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="most_viewed_week">本周最多观看</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="most_viewed_month">本月最多观看</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="most_viewed">最多观看</button> <button type="button" class="jhs-btn jhs-btn--secondary jhs-layout-186f17ef" data-sort="most_favourited">最受欢迎</button> </div> </div> `),$(`#conditionBox button[data-sort="${this.sortVal}"]`).addClass("is-info"),utils.setHrefParam("sort",this.sortVal),utils.setHrefParam("page",this.currentPage),$("#conditionBox").on("click","button[data-sort]",(bt=>{let wt=$(bt.target);this.sortVal=wt.data("sort"),utils.setHrefParam("sort",this.sortVal),wt.siblings().removeClass("is-info"),wt.addClass("is-info"),this.handleQuery()})),$(".page-box").append(` <nav class="pagination"> <button type="button" class="jhs-btn pagination-previous">上一页</button> <ul class="pagination-list"></ul> <button type="button" class="jhs-btn pagination-next">下一页</button> </nav> `),$(document).on("click",".pagination-link",(bt=>{bt.preventDefault(),this.currentPage=parseInt($(bt.target).data("page")),utils.setHrefParam("page",this.currentPage),this.renderPagination(),this.handleQuery()})),$(".pagination-previous").on("click",(bt=>{bt.preventDefault(),this.currentPage>1&&(this.currentPage--,utils.setHrefParam("page",this.currentPage),this.renderPagination(),this.handleQuery())})),$(".pagination-next").on("click",(bt=>{bt.preventDefault(),this.currentPage<this.maxPage&&(this.currentPage++,utils.setHrefParam("page",this.currentPage),this.renderPagination(),this.handleQuery())}))}renderPagination(){const mt=$(".pagination-list");mt.empty();let bt=Math.max(1,this.currentPage-2),wt=Math.min(this.maxPage,this.currentPage+2);this.currentPage<=3?wt=Math.min(6,this.maxPage):this.currentPage>=this.maxPage-2&&(bt=Math.max(this.maxPage-5,1)),bt>1&&(mt.append('<li><button type="button" class="jhs-btn pagination-link" data-page="1">1</button></li>'),bt>2&&mt.append('<li><span class="pagination-ellipsis">…</span></li>'));for(let yt=bt;yt<=wt;yt++){const jt=yt===this.currentPage?" is-current":"";mt.append(`<li><button type="button" class="jhs-btn pagination-link${jt}" data-page="${yt}">${yt}</button></li>`)}wt<this.maxPage&&(wt<this.maxPage-1&&mt.append('<li><span class="pagination-ellipsis">…</span></li>'),mt.append(`<li><button type="button" class="jhs-btn pagination-link" data-page="${this.maxPage}">${this.maxPage}</button></li>`))}async handleQuery(){let mt=loading();try{let bt=[];bt=this.currentPage===1?[1,2]:[2*this.currentPage-1,2*this.currentPage],this.keyword&&(bt=[1],$(".page-box").hide(),$(".tool-box").hide());const wt=await this.getBaseUrl(),yt=bt.map((kt=>{let _t=`${wt}/tags/fc2?sort=${this.sortVal}&page=${kt}`;return this.keyword&&(_t=`${wt}/search?keyword=${this.keyword}`),gmHttp.get(_t)})),jt=await Promise.all(yt);let xt=[];for(const kt of jt){let _t=$(kt);if(_t.find(".box-item").each(((St,Tt)=>{const It=$(Tt),Bt=It.find("img").attr("data-src");let Pt=It.find("img").attr("title");const Mt=It.find(".detail a"),At=Mt.attr("href"),Nt=wt+(At.startsWith("/")?At:"/"+At),Dt=Mt.text().trim().replace(Pt+" - ","");Pt=Pt.replace("FC2-PPV","FC2"),xt.push({imgSrc:Bt,carNum:Pt,href:Nt,title:Dt})})),!this.maxPage){let St,Tt=_t.find(".page-item:not(.disabled)").last();if(Tt.find("a.page-link").length){let It=Tt.find("a.page-link").attr("href");St=parseInt(It.split("page=")[1])}else St=parseInt(Tt.find("span.page-link").text());this.maxPage=Math.ceil(St/2),this.renderPagination()}}if(xt.length===0){clog.log(xt),show.error("无结果");let kt=`${wt}/dm4/tags/fc2?sort=${this.sortVal}`;this.keyword&&(kt=`${wt}/search?keyword=${this.keyword}`),console.error("获取数据失败!",kt)}let $t=this.markDataListHtml(xt);$(".movie-list").html($t),await utils.smoothScrollToTop()}catch(bt){console.error(bt)}finally{mt.close()}}async open123AvFc2Dialog(mt,bt){let wt="";await storageManager.getSetting("enableLoadOtherSite",_)===_&&(wt='<div class="movie-panel-info fc2-movie-panel-info jhs-layout-a26bda7d"><strong>第三方站点: </strong></div>');let yt=` <div class="movie-detail-container"> <!-- <div class="movie-poster-container"> <iframe class="movie-trailer" frameborder="0" allowfullscreen scrolling="no"></iframe> </div> <div class="right-box">--> <div class="movie-info-container"> <div class="search-loading">加载中...</div> </div> ${wt} <div class="jhs-layout-f4e719ae"> <button type="button" id="filterBtn" class="jhs-btn jhs-btn--filter"><span>${m}</span></button> <button type="button" id="favoriteBtn" class="jhs-btn jhs-btn--fav"><span>${v}</span></button> <button type="button" id="hasDownBtn" class="jhs-btn jhs-btn--down"><span>${y}</span></button> <button type="button" id="hasWatchBtn" class="jhs-btn jhs-btn--watch"><span>${k}</span></button> <button type="button" id="search-subtitle-btn" class="jhs-btn jhs-btn--accent"> <span>字幕 (SubTitleCat)</span> </button> <button type="button" id="xunLeiSubtitleBtn" class="jhs-btn jhs-btn--accent"> <span>字幕 (迅雷)</span> </button> </div> <div class="message video-panel jhs-layout-a26bda7d"> <div id="magnets-content" class="magnet-links"> </div> </div> <div id="reviews-content"> </div> <div id="related-content"> </div> <span id="data-actress" class="jhs-layout-6b99de8b"></span> <!-- </div>--> </div> `;layer.open({type:1,title:mt,content:yt,area:utils.getDialogArea("workspace"),skin:"movie-detail-layer",scrollbar:!1,success:(jt,xt)=>{organizeJhsOwnedDetailWorkspace($(jt).find(".movie-detail-container")),utils.setupEscClose(xt),this.loadData(mt,bt);let $t=mt.replace("FC2-","");$("#magnets-content").append(this.getBean("MagnetHubPlugin").createMagnetHub($t)),$("#favoriteBtn").on("click",(async _t=>{const St=$("#data-actress").text(),Tt=$("#data-publishTime").text();await storageManager.saveCar({carNum:mt,url:bt,names:St,actionType:h,publishTime:Tt}),window.refresh(),layer.closeAll()})),$("#filterBtn").on("click",(_t=>{utils.q(_t,`是否屏蔽${mt}?`,(async()=>{const St=$("#data-actress").text(),Tt=$("#data-publishTime").text();await storageManager.saveCar({carNum:mt,url:bt,names:St,actionType:d,publishTime:Tt}),window.refresh(),layer.closeAll(),window.location.href.includes("collection_codes?movieId")&&utils.closePage()}))})),$("#hasDownBtn").on("click",(async _t=>{const St=$("#data-actress").text(),Tt=$("#data-publishTime").text();await storageManager.saveCar({carNum:mt,url:bt,names:St,actionType:g,publishTime:Tt}),window.refresh(),layer.closeAll()})),$("#hasWatchBtn").on("click",(async _t=>{const St=$("#data-actress").text(),Tt=$("#data-publishTime").text();await storageManager.saveCar({carNum:mt,url:bt,names:St,actionType:p,publishTime:Tt}),window.refresh(),layer.closeAll()})),$("#search-subtitle-btn").on("click",(_t=>utils.openPage(`https://subtitlecat.com/index.php?search=${mt}`,mt,!1,_t))),$("#xunLeiSubtitleBtn").on("click",(()=>this.getBean("DetailPageButtonPlugin").searchXunLeiSubtitle(mt)));let kt=mt.replace("FC2-","");this.getBean("OtherSitePlugin").loadOtherSite(kt,mt).then()}})}async loadData(mt,bt){let wt=loading();try{const{id:yt,publishDate:jt,title:xt,moviePoster:$t}=await this.get123AvVideoInfo(bt);$(".movie-info-container").html(` <h3 class="movie-title jhs-layout-761d3add"><strong class="current-title">${escapeHtml(xt||"无标题")}</strong></h3> <div class="movie-meta jhs-layout-761d3add"> <span><strong>番号: </strong>${mt||"未知"}</span> <span><strong>年份: </strong>${jt||"未知"}</span> <span> <strong>站点: </strong> <a href="https://fc2ppvdb.com/articles/${mt.replace("FC2-","")}" target="_blank">fc2ppvdb</a> <a href="https://adult.contents.fc2.com/article/${mt.replace("FC2-","")}/" target="_blank" class="jhs-layout-3fed2a7e">fc2电子市场</a> </span> </div> <div class="movie-actors jhs-layout-761d3add"> <div class="actor-list"><strong>主演: </strong></div> </div> <div class="movie-seller jhs-layout-761d3add"> <span><strong>販売者: </strong></span> </div> <div class="movie-gallery jhs-layout-761d3add"> <strong>剧照: </strong> <div class="image-list"></div> </div> <div id="data-publishTime" class="jhs-layout-6b99de8b">${jt||""}</div> `),this.getImgList(mt).then(),this.getActressInfo(mt).then(),this.getBean("TranslatePlugin").translate(mt,!1).then()}catch(yt){console.error(yt)}finally{wt.close()}}handleLongImg(mt){utils.loopDetector((()=>$(".movie-gallery .image-list").length>0),(async()=>{$(".movie-gallery .image-list").prepend(' <a class="tile-item screen-container jhs-layout-e5d57abb"><div class="jhs-layout-9db87399">正在加载缩略图</div></a> ');const bt=await this.getBean("ScreenShotPlugin").getScreenshot(mt);bt&&($(".screen-container").html(`<img src="${bt}" alt="" loading="lazy" class="jhs-layout-cad980f4">`),$(".screen-container").on("click",(wt=>{wt.stopPropagation(),wt.preventDefault(),showImageViewer(wt.currentTarget)})))}))}async get123AvVideoInfo(mt){const bt=await gmHttp.get(mt),wt=bt.match(/v-scope="Movie\({id:\s*(\d+),/),yt=wt?wt[1]:null,jt=utils.htmlTo$dom(bt);return{id:yt,publishDate:jt.find('span:contains("リリース日:")').next("span").text(),title:jt.find("h1").text().trim(),moviePoster:jt.find("#player").attr("data-poster")}}async getActressInfo(mt){let bt=`https://fc2ppvdb.com/articles/${mt.replace("FC2-","")}`;const wt=await gmHttp.get(bt),yt=$(wt),jt=yt.find("div").filter((function(){return $(this).text().trim().indexOf("女優:")===0}));if(jt.length===0||jt.length>1)return void show.error("解析女优信息失败");const xt=$(jt[0]).find("a");let $t="<strong>主演: </strong>";if(xt.length>0){let _t="";xt.each(((St,Tt)=>{let It=$(Tt),Bt=It.text(),Pt=It.attr("href");$t+=`<span class="actor-tag"><a href="https://fc2ppvdb.com${escapeHtml(Pt)}" target="_blank">${escapeHtml(Bt)}</a></span>`,_t+=Bt+" "})),$("#data-actress").text(_t)}else $t+="<span>暂无演员信息</span>";$(".actor-list").html($t);const kt=yt.find("div").filter((function(){return $(this).text().trim().indexOf("販売者:")===0}));if(kt.length>0){const _t=$(kt[0]).find("a");if(_t.length>0){const St=$(_t[0]);let Tt=St.text(),It=St.attr("href");$(".movie-seller").html(`<span><strong>販売者: </strong><a href="https://fc2ppvdb.com${escapeHtml(It)}" target="_blank">${escapeHtml(Tt)}</a></span>`)}}}async getImgList(mt){let bt=mt.replace("FC2-",""),wt=`https://adult.contents.fc2.com/article/${mt.replace("FC2-","")}/`;const yt=await gmHttp.get(wt,null,{referer:wt});let jt=$(yt).find(".items_article_SampleImagesArea img").map((function(){return $(this).attr("src")})).get(),xt="";Array.isArray(jt)&&jt.length>0?xt=jt.map((($t,kt)=>` <a href="${$t}" data-fancybox="movie-gallery" data-caption="剧照 ${kt+1}"> <img src="${$t}" class="movie-image-thumb" loading="lazy" alt=""/> </a> `)).join(""):$(".movie-gallery").html("<h4>剧照: 暂无剧照</h4>"),$(".image-list").html(xt),this.handleLongImg(bt)}markDataListHtml(mt){let bt="";return mt.forEach((wt=>{bt+=` <div class="item"> <a href="${wt.href}" class="box" title="${wt.title}"> <div class="cover "> <img loading="lazy" src="${wt.imgSrc.replace("/s360","")}" alt=""> </div> <div class="video-title"><strong>${wt.carNum}</strong> ${wt.title}</div> <div class="score"> </div> <div class="meta"> </div> <div class="tags has-addons"> </div> </button> </div> `})),bt}}function calcMagnetScore(Ct){let mt=0;const bt=Ct.seeders||0,wt=bt>=50?35:bt>=10?25:bt>=1?15:3;mt+=wt;const yt=(Ct.title||"").toLowerCase(),jt=/4k|2160p/.test(yt)?25:/1080p/.test(yt)?20:/720p/.test(yt)?15:5;mt+=jt;const xt=/-c\b|-uc\b|chinese|中字|字幕/.test(yt)?20:0;mt+=xt;const $t=Ct.date?_daysSince(Ct.date):999,kt=$t<=7?15:$t<=30?12:$t<=90?8:3;mt+=kt;const _t=/sample|预告|trailer/.test(yt)?-15:0;return mt+=_t,{total:Math.max(0,Math.min(100,mt)),seeders:wt,resolution:jt,subtitle:xt,freshness:kt,completeness:_t}}function _daysSince(Ct){try{const mt=new Date(Ct);return isNaN(mt.getTime())?999:Math.max(0,Math.floor((Date.now()-mt.getTime())/864e5))}catch{return 999}}class Re extends X{constructor(){super(...arguments),i(this,"currentEngine",null),i(this,"searchEngines",[{name:"U9A9",id:"u9a9",url:"https://u9a9.com/?type=2&search={keyword}",targetPage:"https://u9a9.com/?type=2&search={keyword}",parseHtml:this.parseTorrentList},{name:"U3C3",id:"u3c3",url:"https://u3c3.com/?search2=a8lr16lo&search={keyword}",targetPage:"https://u3c3.com/?search2=a8lr16lo&search={keyword}",parseHtml:this.parseTorrentList},{name:"Sukebei",id:"Sukebei",url:"https://sukebei.nyaa.si/?f=0&c=0_0&q={keyword}",targetPage:"https://sukebei.nyaa.si/?f=0&c=0_0&q={keyword}",parseHtml:this.parseTorrentList}])}getName(){return"MagnetHubPlugin"}async initCss(){return` <style> .magnet-container { margin: 20px auto; width: 100%; font-family: Arial, sans-serif; } .magnet-tabs { display: flex; border-bottom: 1px solid var(--jhs-border); margin-bottom: 15px; justify-content: space-between; } .magnet-tab { padding: 5px 12px; cursor: pointer; border: 1px solid transparent; border-bottom: none; margin-right: 5px; background: var(--jhs-surface-2); border-radius: 5px 5px 0 0; } .magnet-tab.active { background: var(--jhs-surface); border-color: var(--jhs-border); border-bottom: 1px solid var(--jhs-surface); margin-bottom: -1px; font-weight: bold; } .magnet-tab:hover:not(.active) { background: var(--jhs-border); } .magnet-results { min-height: 200px; } .magnet-result { padding: 15px; border-bottom: 1px solid var(--jhs-surface-2); position: relative; } .magnet-result:hover { background-color: var(--jhs-surface-2); } .magnet-title { font-weight: bold; margin-bottom: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding-right: 80px; } .magnet-info { display: flex; justify-content: space-between; font-size: 12px; color: var(--jhs-text-muted); margin-bottom: 5px; } .magnet-loading { text-align: center; padding: 20px; } .magnet-error { color: var(--jhs-status-filter-text); padding: 10px; } .magnet-copy { position: absolute; right: 15px; top: 12px; } .magnet-hub-btn { background-color: var(--jhs-surface-2); color: var(--jhs-text-muted); border: 1px solid var(--jhs-border-strong); padding: 3px 8px; border-radius: 3px; cursor: pointer; font-size: 12px; transition: all 0.2s; margin-left: 10px; } .magnet-hub-btn:hover { background-color: var(--jhs-border); border-color: var(--jhs-border); } .magnet-hub-btn.copied { background-color: var(--jhs-status-down); color: var(--jhs-status-down-on); border-color: var(--jhs-status-down); } </style> `}createMagnetHub(mt){mt=mt.replace("FC2-","");const bt=$('<div class="magnet-container jhs-ui"></div>'),wt=$('<div class="magnet-tabs"></div>'),yt="jhs_magnetHub_selectedEngine",jt=localStorage.getItem(yt);let xt=0;const $t=$('<div class="magnet-tabs__options" role="tablist" aria-label="磁力来源"></div>');this.searchEngines.forEach(((_t,St)=>{const Tt=$(`<button type="button" class="jhs-btn magnet-tab" role="tab" aria-selected="false" tabindex="-1" data-engine="${_t.id}">${_t.name}</button>`);jt&&_t.id===jt?(Tt.addClass("active"),this.currentEngine=_t,xt=St):St!==0||jt||(Tt.addClass("active"),this.currentEngine=_t),$t.append(Tt)})),wt.append($t),wt.append(`<a class="jhs-btn jhs-btn--ghost" id="targetBox" href="${this.currentEngine.targetPage.replace("{keyword}",encodeURIComponent(mt))}" target="_blank" rel="noopener noreferrer">原网页</a>`),$t.find(".magnet-tab.active").attr({"aria-selected":"true",tabindex:"0"}),bt.append(wt);const kt=$('<div class="magnet-results"></div>');return bt.append(kt),bt.on("click",".magnet-tab",(_t=>{const St=$(_t.target).data("engine");this.currentEngine=this.searchEngines.find((Tt=>Tt.id===St)),$("#targetBox").attr("href",this.currentEngine.targetPage.replace("{keyword}",encodeURIComponent(mt))),localStorage.setItem(yt,St),bt.find(".magnet-tab").removeClass("active").attr({"aria-selected":"false",tabindex:"-1"}),$(_t.target).addClass("active").attr({"aria-selected":"true",tabindex:"0"}),this.searchEngine(kt,this.currentEngine,mt)})),bt.on("keydown",".magnet-tab",(_t=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(_t.key))return;_t.preventDefault();const St=bt.find(".magnet-tab"),Tt=St.index(_t.currentTarget);let It=_t.key==="Home"?0:_t.key==="End"?St.length-1:_t.key==="ArrowRight"?(Tt+1)%St.length:(Tt-1+St.length)%St.length;St.eq(It).trigger("click").trigger("focus")})),this.searchEngine(kt,this.currentEngine||this.searchEngines[xt],mt),bt}async searchEngine(mt,bt,wt){mt.html(`<div class="magnet-loading">正在从 ${escapeHtml(bt.name)} 搜索 "${escapeHtml(wt)}"...</div>`);const yt=`${bt.name}_${wt}`;if(bt.parseHtml)try{const jt=bt.url.replace("{keyword}",encodeURIComponent(wt)),xt=await storageManager.cachedRequest(`magnet:${bt.id}:${wt}`,216e5,(()=>gmHttp.get(jt).then(($t=>bt.parseHtml.call(this,$t,wt)))));return void this.displayResults(mt,xt,bt.name)}catch(jt){return void mt.html(`<div class="magnet-error">解析 ${escapeHtml(bt.name)} 结果失败: ${escapeHtml(jt.message)}</div>`)}bt.parseJson&&await bt.parseJson.call(this,mt,bt,wt,yt)}displayResults(mt,bt,wt){function yt(xt){const $t=xt.text();xt.addClass("copied").text("已复制"),setTimeout((()=>{xt.removeClass("copied").text($t)}),2e3)}function jt(xt,$t){const kt=document.createElement("textarea");kt.value=xt,kt.style.position="fixed",document.body.appendChild(kt),kt.select();try{document.execCommand("copy"),yt($t)}catch(_t){console.error("复制失败:",_t),alert("复制失败,请手动复制链接")}document.body.removeChild(kt)}mt.empty(),bt.length!==0?(bt.forEach((xt=>{xt._score=this.calcMagnetScore(xt)})),bt.sort(((xt,$t)=>$t._score.total-xt._score.total)),bt.forEach((xt=>{const $t=xt._score?xt._score.total:0,kt=$t>=80?"高":$t>=60?"中":"低",_t=xt._score?`做种:${xt._score.seeders}/35 分辨率:${xt._score.resolution}/25 字幕:${xt._score.subtitle}/20 新鲜度:${xt._score.freshness}/15 完整性:${xt._score.completeness}/5`:"",St=escapeHtml(xt.title),Tt=escapeHtml(xt.magnet);$(` <div class="magnet-result"> <div class="magnet-title"> <span class="magnet-score" title="${_t}">${kt} ${$t}</span> <a href="${Tt}">${St}</a> </div> <div class="magnet-info"> <span>大小: ${xt.size||"未知"}</span> <span>做种: ${xt.seeders||"—"}</span> <span>日期: ${xt.date||"未知"}</span> </div> <div class="magnet-copy"> <button type="button" class="jhs-btn magnet-hub-btn copy-btn" data-magnet="${Tt}">复制链接</button> </div> </div> `).find(".magnet-copy").append(`<button type="button" class="jhs-btn magnet-hub-btn one23-offline-btn" data-magnet="${Tt}">123离线</button>`).end().appendTo(mt)})),mt.on("click",".copy-btn",(function(){const xt=$(this),$t=xt.data("magnet");navigator.clipboard?navigator.clipboard.writeText($t).then((()=>{yt(xt)})).catch((kt=>{jt($t,xt)})):jt($t,xt)}))):mt.append('<div class="magnet-error">没有找到相关结果</div>')}parseTorrentList(mt,bt){const wt=utils.htmlTo$dom(mt),yt=[];return wt.find(".torrent-list tbody tr").each(((jt,xt)=>{const $t=$(xt);if($t.text().includes("置顶"))return;const kt=$t.find("td:nth-child(2) a").attr("title")||$t.find("td:nth-child(2) a").text().trim();if(!kt.toLowerCase().includes(bt.toLowerCase()))return;const _t=$t.find("td:nth-child(3) a[href^='magnet:']").attr("href"),St=$t.find("td:nth-child(4)").text().trim(),Tt=$t.find("td:nth-child(5)").text().trim(),It=parseInt($t.find("td:nth-child(6)").text().trim())||0,Bt=parseInt($t.find("td:nth-child(7)").text().trim())||0;_t&&yt.push({title:kt,magnet:_t,size:St,date:Tt,seeders:It,leechers:Bt})})),yt}calcMagnetScore(mt){return calcMagnetScore(mt)}}class Ve extends X{getName(){return"ScreenShotPlugin"}async initCss(){return"<style>.jhs-screenshot-message{margin-top:50px;color:var(--jhs-text-muted);cursor:auto}.jhs-screenshot-message--bus{margin-top:30px}</style>"}async handle(){this.loadScreenShot().then()}async loadScreenShot(){if(!isDetailPage||await storageManager.getSetting("enableLoadScreenShot","yes")!=="yes")return;let mt=this.getPageInfo().carNum;r&&$(".preview-images .tile-item").first().before(' <a class="tile-item screen-container jhs-layout-cd9d5db1"><div class="jhs-layout-9db87399">正在加载缩略图</div></a> '),l&&$("#sample-waterfall .sample-box:first").after(' <a class="sample-box screen-container jhs-layout-b5c4e4f7"><div class="jhs-layout-3536a853">正在加载缩略图</div></a> ');try{const bt=await this.getScreenshot(mt);this.addImg("缩略图",bt),clog.log("加载缩略图:",bt)}catch(bt){this.showErrorFallback(mt,bt)}}async getScreenshot(mt){if(mt=normalizeCarNum(mt),!mt)throw clog.warn("跳过缩略图解析:番号不可用"),new Error("缩略图番号不可用");const bt=localStorage.getItem("jhs_screenShot")?JSON.parse(localStorage.getItem("jhs_screenShot")):{};if(bt[mt])return clog.debug("缓存中存在缩略图:",mt,bt[mt]),bt[mt];let wt;try{wt=await storageManager.cachedRequest(`screenshot:${mt}`,6048e5,(()=>Promise.any([this.getJavStoreScreenShot(mt)])))}catch(jt){throw clog.error("获取缩略图资源失败:",wt,jt),jt}if(!wt)return this.showErrorFallback(mt,null),null;const yt=wt.indexOf("https://");return yt!==-1&&(wt=wt.substring(yt)),bt[mt]=wt,clog.log("缩略图获取成功:",wt),localStorage.setItem("jhs_screenShot",JSON.stringify(bt)),wt}async getJavStoreScreenShot(mt){const bt=`https://javstore.net/search?q=${encodeURIComponent(mt)}`;clog.debug("JavStore 搜索地址:",bt);let wt=await gmHttp.get(bt,{},{},!1,{ignoreNotFound:!0});if(!wt)return clog.debug("JavStore 搜索页未获取:",bt),null;const jt=utils.htmlTo$dom(wt).find('a[href$="-pn.html"]').filter(((xt,$t)=>$($t).text().trim().toUpperCase().includes(mt.toUpperCase()))).map(((xt,$t)=>$($t).attr("href"))).get();if(!jt.length)return clog.error("JavStore, 查询番号失败:",bt),null;for(const xt of jt){const $t=new URL(xt,"https://javstore.net").href;clog.debug("JavStore 候选详情:",$t);const kt=await gmHttp.get($t,{},{},!1,{ignoreNotFound:!0});if(!kt){clog.debug("JavStore 详情页未获取:",$t);continue}let _t=utils.htmlTo$dom(kt).find("a").filter(((St,Tt)=>$(Tt).text().trim()==="CLICK HERE!")).first().attr("href");if(!_t){clog.debug("JavStore 详情页没有 CLICK HERE!:",$t);continue}return _t=new URL(_t,$t).href,_t=_t.replace(".th",""),clog.debug("JavStore 预览图:",_t),_t}return clog.error("JavStore, 所有候选均无有效预览图:",bt),null}addImg(mt,bt){bt&&(r&&$(".screen-container").html(`<img src="${bt}" alt="${mt}" loading="lazy" class="jhs-layout-cad980f4">`),l&&$(".screen-container").html(`<div class="photo-frame"><img src="${bt}" title="${mt}" alt="${mt}" class="jhs-layout-d4a575e8"></div>`),$(".screen-container").on("click",(wt=>{wt.stopPropagation(),wt.preventDefault(),showImageViewer(wt.currentTarget)})))}showErrorFallback(mt,bt){var wt;console.error("获取缩略图失败:",(wt=bt?.message)==null?void 0:wt.substring(0,100));const yt=`jhs-screenshot-message${l?" jhs-screenshot-message--bus":""}`;if(!(mt=normalizeCarNum(mt)))return void $(".screen-container").empty().append($("<div></div>").addClass(yt).text("无法获取番号,缩略图未加载"));const jt=`https://javstore.net/search?q=${encodeURIComponent(mt)}`;$(".screen-container").html(`<div class="${yt}">获取缩略图失败</div><br/><a href='#' class='retry-link'>点击重试</a> 或 <a class="check-link" href='${jt}' target='_blank'>前往确认</a>`).off("click",".retry-link").off("click",".check-link").on("click",".retry-link",(async xt=>{xt.stopPropagation(),xt.preventDefault(),$(".screen-container").html(`<div class="${yt}">正在重新加载...</div>`);try{const $t=await this.getScreenshot(mt);this.addImg("缩略图",$t)}catch($t){this.showErrorFallback(mt,$t)}})).on("click",".check-link",(async xt=>{xt.stopPropagation(),xt.preventDefault(),window.open(jt,"_blank")}))}}class Xe extends X{getName(){return"FavoriteActressesPlugin"}async handle(){this.bindEvent(),await this.highlightActress(),this.replaceActressAvatar()}async highlightActress(){if(!isDetailPage||await storageManager.getSetting("enableFavoriteActresses",_)!==_)return;const mt=await storageManager.getFavoriteActressList();if(!mt||mt.length===0)return;const bt=new Set;mt.forEach((wt=>{wt.starId&&bt.add(String(wt.starId).trim())})),bt.size!==0&&$(".female").prev().each(((wt,yt)=>{const jt=$(yt),xt=jt.attr("href");let $t=null;if(xt){const _t=(xt.endsWith("/")?xt.slice(0,-1):xt).split("/"),St=_t[_t.length-1];St&&($t=St.trim())}let kt=!1;$t&&(kt=bt.has($t)),kt&&(jt.addClass("highlighted"),jt.attr("title","高亮已收藏演员, 可在设置-基础配置中关闭"))}))}async removeActorFromStorage(mt){await storageManager.removeFavoriteActress(mt)&&clog.log("移除演员成功")}bindEvent(){const mt=/\/actors\/(\w+)\/(collect|uncollect)/;$(document).on("confirm:complete",'a[href*="/actors/"][href*="/uncollect"]',(async bt=>{const[wt]=bt.detail;if(!wt)return;const yt=$(bt.currentTarget).attr("href").match(mt),jt=yt?yt[1]:null;jt&&await this.removeActorFromStorage(jt)})),$("#button-collect-actor").click((async bt=>{const wt=$("#button-collect-actor").attr("href").match(mt),yt=wt?wt[1]:null;let jt=[],xt=$(".actor-section-name");xt.length&&xt.text().trim().split(",").forEach((Tt=>{jt.push(Tt.trim())}));let $t=$(".section-meta:not(:contains('影片'))");if($t.length&&$t.text().trim().split(",").forEach((Tt=>{jt.push(Tt.trim())})),!jt.length)return void clog.error("获取演员名称失败");const kt=jt[0];if(!yt)return void clog.error("无法获取演员ID进行收藏操作。");const _t=($(".avatar").first().css("background-image")||"").replace(/^url\(["']?|["']?\)$/g,""),St={starId:yt,name:kt,allName:jt,avatar:_t};await storageManager.addFavoriteActressList([St])===1?clog.log(`收藏演员成功: ${kt} (ID: ${yt})`):clog.log(`收藏演员失败: ${kt} (ID: ${yt})`)})),$("#button-uncollect-actor").click((async bt=>{const wt=$("#button-uncollect-actor").attr("href").match(mt),yt=wt?wt[1]:null;yt?await this.removeActorFromStorage(yt):clog.error("无法获取演员ID进行取消收藏操作。")}))}async replaceActressAvatar(){const mt=this.getActressId();if(!mt)return;const bt=(await storageManager.getFavoriteActressList()).find((wt=>wt.starId===mt));if(bt&&bt.avatar){const wt=`url('${bt.avatar}')`;let yt=$(".avatar").first();if(yt.length===0&&($(".section-columns").prepend('<div class="column actor-avatar"> <div class="image"> <span class="avatar"></span> </div> </div>'),yt=$(".avatar").first()),yt.length===0)return;yt.css("background-image").trim().toLowerCase()!==wt.trim().toLowerCase()&&(yt.css("background-image",wt),yt.css("background-size","cover"),yt.css("background-position","top center"),yt.css("background-repeat","no-repeat"))}}}class Qe extends X{getName(){return"BusImgPlugin"}handle(){}async getVisibleImageItems(mt,bt){let wt=[];const yt=document.querySelectorAll(mt);for(const jt of yt)if(!utils.isHidden(jt)){const xt=jt.querySelector(bt);if(!(xt instanceof HTMLImageElement))continue;xt.style.removeProperty("height");let $t=xt.offsetHeight;$t>0&&wt.push({element:jt,imgElement:xt,height:$t})}return wt}async logImageHeightsByRow(){if(await storageManager.getSetting("enableVerticalModel",C)===_)return;const mt=this.getSelector().itemSelector,bt=await storageManager.getSetting("containerColumns",5),wt=await this.getVisibleImageItems(mt,"img");if(wt.length===0)return;const yt=[];for(let jt=0;jt<wt.length;jt++){const xt=Math.floor(jt/bt);yt[xt]||(yt[xt]=[]),yt[xt].push(wt[jt])}yt.forEach(((jt,xt)=>{const $t=jt.map((Tt=>Tt.height));if($t.length<2)return;const kt=Math.min(...$t),_t=Math.max(...$t);let St=0;_t-kt>50&&(St=kt,jt.forEach((Tt=>{if(Tt.height!==St){const It=`${St}px`;Tt.imgElement.style.setProperty("height",It,"important")}})))}))}}class Ze extends X{getName(){return"TranslatePlugin"}async initCss(){return` <style> .translated-title { margin-top:var(--jhs-space-2); color:var(--jhs-text); font-size:clamp(16px,1.5vw,18px); font-weight:500; line-height:1.5; } .translated-title.is-error { color:var(--jhs-danger); } </style>`}handle(){isDetailPage&&this.translate()}async translate(mt,bt=!0){if(await storageManager.getSetting("translateTitle",_)!==_)return;l&&(bt=!1);let wt=$(".origin-title");if(wt.length||(wt=$(".current-title")),wt.length||(wt=$("h3")),!wt.length)return;const yt=wt.text().trim();if(!yt)return void show.error("获取标题失败, 无法进行翻译");let jt=wt.nextAll(".translated-title").first();jt.length||(jt=$('<div class="translated-title"></div>').insertAfter(wt)),jt.removeClass("is-error").text("翻译中..."),mt||(mt=this.getPageInfo().carNum);const xt=typeof mt=="string"?mt.trim():"",$t=xt&&xt!=="undefined"?xt:yt;let kt={};try{const _t=localStorage.getItem("jhs_translate");_t&&(kt=JSON.parse(_t)||{})}catch(_t){clog.warn("翻译缓存无法解析,已忽略旧缓存",_t)}if(kt[$t])return void jt.text(kt[$t]);try{const _t=await _e(yt,"ja","zh-CN");jt.text(_t),kt[$t]=_t,localStorage.setItem("jhs_translate",JSON.stringify(kt))}catch(_t){console.error("翻译失败:",_t),jt.addClass("is-error").text(`翻译失败: ${_t.message||String(_t)}`)}}}class et extends X{constructor(){super(...arguments),i(this,"singleTaskKey","checkNewActressActorFilterCar"),i(this,"taskConfig",null),i(this,"storageQueue",new ve),i(this,"lastCheckFavoriteActressTimeKey","jhs_time_checkFavoriteActress"),i(this,"lastCheckBlacklistTimeKey","jhs_time_checkBlacklist"),i(this,"lastCheckNewVideoTimeKey","jhs_time_checkNewVideo")}getName(){return"TaskPlugin"}getStartupMode(){return"idle"}async limitConcurrency(mt,bt,wt,yt){this.showIsRun();let jt=0,xt=!1;const $t=Math.max(1,Math.min(bt,mt.length)),kt=Array.from({length:$t},(async()=>{for(;!xt;){const Tt=jt++;if(Tt>=mt.length)return;try{await yt(mt[Tt])}catch(Bt){throw this.isNetworkBlocked(Bt)&&(xt=!0),Bt}const It=mt.length-jt;It>0&&(clog.debug(`剩余任务数: <span class="jhs-task-emphasis">${It}</span>`),await utils.sleep(wt))}})),_t=await Promise.allSettled(kt),St=_t.find((Tt=>Tt.status==="rejected"));if(St)throw St.reason}isNetworkBlocked(mt){return mt?._cfBlocked===!0||mt?._circuitBroken===!0}isUnnecessaryCheck(mt,bt){if(!bt)throw new Error("未传入checkIntervalTime");return bt=parseInt(bt),utils.getHourDifference(new Date(mt),new Date)<bt}handle(){return this.doTask()}showIsRun(){show.info("正在执行检测任务中, 请勿关闭当前窗口",{duration:3e3})}async doTask(){if(isListPage)return await this.loadConfig(),this.javDbUrl=await this.getBean("OtherSitePlugin").getJavDbUrl(),navigator.locks.request(this.singleTaskKey,{ifAvailable:!0},(async mt=>{if(mt){if(isListPage&&(this.taskConfig.enableCheckBlacklist===_?await this.checkBlacklist():clog.warn("自动检测屏蔽黑名单-禁用"),!l)){if(this.taskConfig.enableCheckFavoriteActress===_){const bt=localStorage.getItem(this.lastCheckFavoriteActressTimeKey),wt=this.taskConfig.checkFavoriteActress_IntervalTime,yt=bt&&this.isUnnecessaryCheck(bt,wt),jt=$('a[href*="/users/profile"]').length>0;yt&&clog.debug(`检测同步演员, 上次检测时间: ${bt} 检测间隔时间: ${wt}小时 未到时间`),!yt&&jt&&await this.checkFavoriteActress()}else clog.warn("自动同步已收藏的演员-禁用");this.taskConfig.enableCheckNewVideo===_?await this.checkNewVideo():clog.warn("自动检测已收藏演员的最新作品-禁用")}}else clog.debug("争夺任务锁失败, 跳过执行")})).catch((mt=>{this.isNetworkBlocked(mt)?clog.warn(`后台检测已停止: ${mt.message}`):(console.error("锁任务出现错误:",mt),clog.error("锁任务出现错误:",mt))})).finally((()=>{setTimeout((()=>{this.doTask()}),3e5)}))}async loadConfig(){const mt=await storageManager.getSetting();this.taskConfig={checkConcurrencyCount:mt.checkConcurrencyCount?Number(mt.checkConcurrencyCount):2,checkRequestSleep:mt.checkRequestSleep?Number(mt.checkRequestSleep):100,enableCheckBlacklist:mt.enableCheckBlacklist||_,checkBlacklist_intervalTime:mt.checkBlacklist_intervalTime?Number(mt.checkBlacklist_intervalTime):12,checkBlacklist_ruleTime:mt.checkBlacklist_ruleTime?Number(mt.checkBlacklist_ruleTime):8760,enableCheckFavoriteActress:mt.enableCheckFavoriteActress||_,checkFavoriteActress_IntervalTime:mt.checkFavoriteActress_IntervalTime?Number(mt.checkFavoriteActress_IntervalTime):24,enableCheckNewVideo:mt.enableCheckNewVideo||_,checkNewVideo_intervalTime:mt.checkNewVideo_intervalTime?Number(mt.checkNewVideo_intervalTime):12,checkNewVideo_ruleTime:mt.checkNewVideo_ruleTime?Number(mt.checkNewVideo_ruleTime):8760}}async ensureReady(){if(this.taskConfig||await this.loadConfig(),this.javDbUrl||(this.javDbUrl=await this.getBean("OtherSitePlugin").getJavDbUrl()),!this.javDbUrl)throw new Error("JavDB 地址未配置")}async checkBlacklist(mt){await this.ensureReady();let bt=await storageManager.getBlacklist();if(bt.length===0)return;bt=bt.sort(((It,Bt)=>It.createTime<Bt.createTime?1:It.createTime>Bt.createTime?-1:0));const wt=this.taskConfig.checkConcurrencyCount,yt=this.taskConfig.checkRequestSleep,jt=this.taskConfig.checkBlacklist_intervalTime,xt=this.taskConfig.checkBlacklist_ruleTime,$t=localStorage.getItem(this.lastCheckBlacklistTimeKey);if(!mt&&$t&&this.isUnnecessaryCheck($t,jt))return void clog.debug(`检测黑名单, 上次检测时间: ${$t} 检测间隔时间: ${jt}小时 未到时间`);const kt=[],_t=[];for(const It of bt){let Bt=It.name,Pt=It.checkTime,Mt=It.lastPublishTime,At=It.url;if(new URL(window.location.href).hostname===new URL(At).hostname){if(mt||!Pt||!this.isUnnecessaryCheck(Pt,jt))if(!Mt||xt===0||this.isUnnecessaryCheck(Mt,xt))kt.push(It);else{let Nt=`检测黑名单: ${Bt} ${Mt} 停更超过${xt/24/365}年,跳过检测`;_t.push(Nt),$("#checkBlacklistMsg").text(Nt)}}else clog.log("黑名单地址非同域名,跳过",At)}if(kt.length===0)return;_t.forEach((It=>{clog.log(It)})),clog.log(`<span class="jhs-task-emphasis">检测屏蔽黑名单, 总任务数: ${kt.length}, 并发限制:${wt}, 请求间隔时间:${yt}ms</span>`);const St=this.getBean("BlacklistPlugin");await this.limitConcurrency(kt,wt,yt,(async It=>{let{starId:Bt,name:Pt,url:Mt}=It;try{clog.log("正在检屏黑名单演员:",Pt,Mt),$("#checkBlacklistMsg").text(`正在检屏黑名单演员: ${Pt} ${Mt}`);const At=await gmHttp.get(Mt),Nt=utils.htmlTo$dom(At);await this.storageQueue.addTask((async()=>{let{lastPublishTime:Dt}=await St.parseAndSaveFilterInfo(Nt,Pt,Bt);await storageManager.updateBlacklistItem({starId:Bt,name:Pt,checkTime:utils.getNowStr(),lastPublishTime:Dt})}))}catch(At){if(this.isNetworkBlocked(At))throw At;$("#checkBlacklistMsg").text(`检测屏蔽演员信息, 发生错误: ${Mt}`),clog.error("检测屏蔽演员信息, 发生错误:",Mt,At),show.error("检测屏蔽演员信息, 发生错误:"+At,"bottom","right")}})),await this.storageQueue.waitAllFinished();const Tt=utils.getNowStr();localStorage.setItem(this.lastCheckBlacklistTimeKey,Tt),clog.log('<span class="jhs-task-emphasis">-------- END 检测屏蔽黑名单 END --------</span>'),$("#checkBlacklistMsg").text("检测屏蔽黑名单, 结束"),this.getBean("BlacklistPlugin").resetBtnTip().then()}async checkFavoriteActress(){await this.ensureReady();const mt=`${this.javDbUrl}/users/collection_actors`,bt=[];await this.scrapeActorInfo(mt,bt),clog.log("所有演员信息已收集, 总计数量:",bt.length),$("#checkNewVideoMsg").text("同步完成"),bt.length>0&&(await storageManager.addFavoriteActressList(bt),localStorage.setItem(this.lastCheckFavoriteActressTimeKey,utils.getNowStr()),this.getBean("NewVideoPlugin").resetBtnTip().then())}async scrapeActorInfo(mt,bt){clog.log(`正在抓取页面: ${mt}`),$("#checkNewVideoMsg").text(`正在解析已收藏的演员: ${mt}`);let wt=null;try{const yt=await gmHttp.get(mt),jt=utils.htmlTo$dom(yt);jt.find("#actors .actor-box a").each((($t,kt)=>{const _t=$(kt),St=_t.attr("title"),Tt=_t.attr("href");if(St&&Tt){const It=St.split(",").map((Lt=>Lt.trim())).filter((Lt=>Lt.length>0)),Bt=It[0]||"",Pt=new URL(Tt,this.javDbUrl).pathname.split("/").filter((Lt=>Lt.length>0));let Mt="";Pt.length>0&&(Mt=Pt[Pt.length-1]);let At=D;const Nt=_t.find("img").attr("src"),Dt=_t.find(".info");Dt.length&&Dt.text().trim().includes("無碼")&&(At=A),bt.push({starId:Mt,name:Bt,allName:It,avatar:Nt,actressType:At,lastCheckTime:null,lastUpdateTime:null})}}));const xt=jt.find(".pagination-next").attr("href");xt&&(wt=new URL(xt,this.javDbUrl).href)}catch(yt){throw clog.error(`抓取 ${mt} 时发生错误,停止本轮同步:`,yt),yt}wt&&await this.scrapeActorInfo(wt,bt)}async checkNewVideo(mt){await this.ensureReady();const bt={success:0,parseFailed:0,networkFailed:0,skippedStopped:0,skippedInterval:0,aborted:0},wt=await storageManager.getFavoriteActressList();if(!wt.length)return this.renderCheckResult(bt,"没有需要检测的演员(当前收藏为空)"),bt;const yt=utils.genericSort(wt,[{key:At=>{var Nt;return((Nt=At.newVideoList)==null?void 0:Nt.length)??0},order:"desc"},{key:"lastPublishTime",order:"desc"}]),jt=this.taskConfig.checkConcurrencyCount,xt=this.taskConfig.checkRequestSleep,$t=this.taskConfig.checkNewVideo_intervalTime,kt=this.taskConfig.checkNewVideo_ruleTime,_t=localStorage.getItem(this.lastCheckNewVideoTimeKey);if(!mt&&_t&&this.isUnnecessaryCheck(_t,$t))return bt.skippedInterval=wt.length,clog.debug(`检测新作品, 上次检测时间: ${_t} 检测间隔时间: ${$t}小时 未到时间`),this.renderCheckResult(bt,"检测间隔未到"),bt;const St=[],Tt=[];for(const At of yt){const{lastCheckTime:Nt,lastPublishTime:Dt,name:Lt}=At;!mt&&Nt&&this.isUnnecessaryCheck(Nt,$t)?bt.skippedInterval++:!Dt||kt===0||this.isUnnecessaryCheck(Dt,kt)?St.push(At):(bt.skippedStopped++,Tt.push(`检测新作品: ${Lt} ${Dt} 停更超过${kt/24/365}年,跳过检测`))}if(St.length===0)return this.renderCheckResult(bt,"没有需要检测的演员"),bt;Tt.forEach((At=>{clog.log(At)})),clog.log(`<span class="jhs-task-emphasis">检测最新作品, 总任务数: ${St.length}, 并发限制:${jt}, 请求间隔时间:${xt}ms</span>`);const It=await storageManager.getTitleFilterKeyword(),Bt=await storageManager.getBlacklistCarList(),Pt=new Set(Bt.map((At=>At.carNum)));try{await this.limitConcurrency(St,jt,xt,(async At=>{const{lastCheckTime:Nt,name:Dt,starId:Lt}=At;let Et=`${this.javDbUrl}/actors/${Lt}?t=d`;try{clog.log("正在检测最新作品, 演员:",Dt,Et),$("#checkNewVideoMsg").text(`正在检测最新作品, 演员: ${Dt}`);const Ht=await gmHttp.get(Et),Ft=utils.htmlTo$dom(Ht);try{await this.storageQueue.addTask((async()=>this.parsePage(Ft,T,Lt,Dt,It,Pt))),bt.success++}catch(zt){bt.parseFailed++,clog.error("解析或保存演员作品失败:",Et,zt)}}catch(Ht){if(this.isNetworkBlocked(Ht))throw bt.networkFailed++,Ht;bt.networkFailed++,clog.error("检测演员信息发生网络错误:",Et,Ht),console.error("检测演员信息发生网络错误:",Et,Ht)}})),await this.storageQueue.waitAllFinished()}catch(At){if(!this.isNetworkBlocked(At))throw At;bt.aborted=Math.max(0,St.length-bt.success-bt.parseFailed-bt.networkFailed),clog.warn(`网络阻断,本轮停止,未执行 ${bt.aborted}`)}bt.success>0&&bt.parseFailed+bt.networkFailed+bt.aborted===0&&localStorage.setItem(this.lastCheckNewVideoTimeKey,utils.getNowStr()),clog.log('<span class="jhs-task-emphasis">检测最新作品---结束</span>'),this.renderCheckResult(bt);const Mt=this.getBean("NewVideoPlugin");return Mt.loadData(),Mt.resetBtnTip().then(),bt}renderCheckResult(mt,bt="检测结束"){const wt=`${bt}:成功 ${mt.success},解析失败 ${mt.parseFailed},网络失败 ${mt.networkFailed},停更跳过 ${mt.skippedStopped},间隔跳过 ${mt.skippedInterval}${mt.aborted?`,未执行 ${mt.aborted}`:""}`;$("#checkNewVideoMsg").text(wt),clog.log(wt)}async parsePage(mt,bt,wt,yt,jt,xt){const $t=this.getSelector(bt);bt===I&&mt.find(".avatar-box").length>0&&mt.find(".avatar-box").parent().remove();const kt=mt.find("title").text(),_t=/Just a moment|Attention Required|Cloudflare/i.test(kt)||mt.find("[class*='cf-chl'], #challenge-form").length>0,St=mt.find(bt===I?`${$t.boxSelector}, #waterfall`:$t.boxSelector).first();if(_t||!St.length)throw clog.error("新作品检测-解析列表失败"),new Error("新作品检测-解析列表失败");const Tt=mt.find($t.requestDomItemSelector),It=mt.find($t.nextPageSelector).attr("href");if(Tt.length===0)return await storageManager.updateFavoriteActress({starId:wt,lastCheckTime:utils.getNowStr(),newVideoList:[]}),0;let Bt=[],Pt=null;for(const Nt of Tt){const Dt=$(Nt),{carNum:Lt,url:Et,title:Ht,publishTime:Ft}=this.getBean("ListPagePlugin").findCarNumAndHref(Dt);Lt&&(jt.find((zt=>Ht.includes(zt)||Lt.includes(zt)))||xt.has(Lt)||(Pt||(Pt=Ft),(()=>{let zt=Dt.find("img").attr("src")||"";zt&&!zt.startsWith("http")&&(zt=zt.startsWith("/")?this.javDbUrl+zt:this.javDbUrl+"/"+zt);let Ot=Et||"";Ot&&!Ot.startsWith("http")&&(Ot=Ot.startsWith("/")?this.javDbUrl+Ot:this.javDbUrl+"/"+Ot);const Vt=Dt.find(".score .value, .score").text().trim(),Ut=parseFloat(Vt)||0,Jt=Vt.match(/由(\d+)人/);let qt=0;if(Jt)qt=parseInt(Jt[1]);else{const Yt=Dt.find(".score .count, .meta .count").text().trim();qt=parseInt(Yt.replace(/[^\d]/g,""))||0}Bt.push({carNum:Lt,coverUrl:zt,title:Ht||"",publishTime:Ft||"",score:Ut,voteCount:qt,url:Ot})})()))}const Mt=await storageManager.getCarMap(),At=Bt.filter((Nt=>!Mt.has(Nt.carNum)));return At.length>0&&clog.log(`<span class="jhs-task-emphasis">检测出新作品, ${yt}, 共${At.length}部</span>`),await storageManager.updateFavoriteActress({starId:wt,lastCheckTime:utils.getNowStr(),newVideoList:At,lastPublishTime:Pt}),At.length}async checkOneNewVideo(mt){await this.ensureReady();const bt=await storageManager.getTitleFilterKeyword(),wt=await storageManager.getBlacklistCarList(),yt=new Set(wt.map((St=>St.carNum))),{lastCheckTime:jt,name:xt,starId:$t}=mt;let kt=`${this.javDbUrl}/actors/${$t}?t=d`;const _t=$("#checkNewVideoMsg");try{clog.log("正在检测最新作品, 演员:",xt,kt),_t.text(`正在检测最新作品, 演员: ${xt}`);const St=await gmHttp.get(kt),Tt=utils.htmlTo$dom(St);await this.parsePage(Tt,T,$t,xt,bt,yt),clog.log('<span class="jhs-task-emphasis">检测最新作品---结束</span>'),_t.text("检测完毕"),this.getBean("NewVideoPlugin").loadData()}catch(St){clog.error("检测屏蔽演员信息, 发生错误:",kt,St),show.error("检测屏蔽演员信息, 发生错误:"+St,"bottom","right"),_t.text(`检测屏蔽演员信息, 发生错误: ${kt}`)}}}const tt=[{name:"jsDelivr (全球CDN)",json:"https://cdn.jsdelivr.net/gh/gfriends/gfriends/Filetree.json",base:"https://cdn.jsdelivr.net/gh/gfriends/gfriends/Content/"},{name:"GitHub Raw (备用)",json:"https://raw.githubusercontent.com/gfriends/gfriends/master/Filetree.json",base:"https://raw.githubusercontent.com/gfriends/gfriends/master/Content/"}],nt="jhs_img_cdn_index";let at=parseInt(localStorage.getItem(nt)||"0",10);(at>=tt.length||at<0)&&(at=0);let it=tt[at].json,st=tt[at].base;const ot="filetreeStore",rt="filetree_data",lt={db:null,async open(){return this.db?this.db:new Promise(((Ct,mt)=>{const bt=indexedDB.open("GfriendsAvatarDB",1);bt.onupgradeneeded=wt=>{this.db=wt.target.result,this.db.objectStoreNames.contains(ot)||this.db.createObjectStore(ot)},bt.onsuccess=wt=>{this.db=wt.target.result,Ct(this.db)},bt.onerror=wt=>{console.error("IndexedDB open error:",wt.target.errorCode),mt(new Error("Failed to open IndexedDB"))}}))},async get(Ct){return await this.open(),new Promise((mt=>{const bt=this.db.transaction([ot],"readonly").objectStore(ot).get(Ct);bt.onsuccess=()=>mt(bt.result),bt.onerror=()=>mt(null)}))},async set(Ct,mt){return await this.open(),new Promise(((bt,wt)=>{const yt=this.db.transaction([ot],"readwrite").objectStore(ot).put(mt,Ct);yt.onsuccess=()=>bt(),yt.onerror=jt=>{console.error("IndexedDB set error:",jt.target.errorCode),wt(new Error("Failed to write to IndexedDB"))}}))}};let ct=null,dt=null;function ht(Ct){if(!Ct||!Ct.Content)return null;const mt={},bt=Ct.Content;for(const wt in bt){const yt=encodeURIComponent(wt);for(const jt in bt[wt]){let xt=jt.replace(/\.jpg$/i,"").split("-")[0];xt.startsWith("AI-Fix-")&&(xt=xt.substring(7));const $t=xt.toLowerCase().trim();if($t.length>0){const kt=bt[wt][jt],_t=kt.indexOf("?");let St,Tt="";_t>-1?(St=encodeURIComponent(kt.substring(0,_t)),Tt=kt.substring(_t)):St=encodeURIComponent(kt);const It=`${st}${yt}/${St}${Tt}`;mt[$t]||(mt[$t]=[]),mt[$t].includes(It)||mt[$t].push(It)}}}return mt}async function gt(Ct){let mt=loading();try{await(async function(){if(ct&&dt)return ct;let yt=null;try{yt=await lt.get(rt)}catch($t){console.error("读取 IndexedDB 失败:",$t)}if(yt&&yt.Content&&(ct=yt,dt=ht(yt),dt))return ct;show.info("正在载入头像数据源...");const jt=await fetch(it);if(!jt.ok)throw new Error(`请求头像源失败: ${jt.status}`);const xt=await jt.json();if(xt&&xt.Content){ct=xt,dt=ht(xt);try{await lt.set(rt,xt),clog.debug("载入头像数据源并写入缓存成功!")}catch($t){clog.error($t),show.error("头像数据源写入缓存失败,可能磁盘已满或其他权限问题。")}return ct}throw clog.error(xt),new Error("解析头像数据源失败")})()}catch(yt){return show.error(yt),[]}finally{mt.close()}if(!dt)return[];const bt=new Set,wt=Ct.map((yt=>yt.toLowerCase().trim())).filter((yt=>yt.length>0));if(wt.length===0)return[];for(const yt of wt){const jt=dt[yt];jt&&jt.forEach((xt=>bt.add(xt)))}return Array.from(bt)}class pt extends X{constructor(){super(...arguments),i(this,"currentPage",1),i(this,"pageSize",30),i(this,"nvCurrentPage",1),i(this,"nvPageSize",60),i(this,"nvFlatListCache",null),i(this,"nvSortBy","publishTime_desc")}getName(){return"NewVideoPlugin"}getStartupMode(){return"idle"}async initCss(){return` <style> .newVideoToolBox { display:flex; flex-direction:column; height:100%; min-height:0; overflow:hidden; padding:var(--jhs-space-3); } .jhs-new-video-toolbar { display:flex; align-items:center; justify-content:space-between; gap:var(--jhs-space-3); margin-bottom:var(--jhs-space-3); } .jhs-new-video-toolbar__actions, .jhs-new-video-toolbar__filters { display:flex; align-items:center; flex-wrap:wrap; gap:var(--jhs-space-2); } .jhs-new-video-toolbar select { min-width:150px; } #actress-card-container { display:grid; grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr)); gap:var(--jhs-space-3); width:100%; max-width:1680px; margin:0 auto; padding:var(--jhs-space-1); overflow-y:auto; } .actress-card { position:relative; display:flex; flex-direction:column; min-width:0; padding:var(--jhs-space-4); border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-md); background:var(--jhs-surface); } .actress-card.is-paused { background:var(--jhs-surface-2); } .actress-card__badges { display:flex; align-items:center; gap:var(--jhs-space-1); margin-bottom:var(--jhs-space-3); } .actress-card__profile { display:grid; grid-template-columns:64px minmax(0,1fr); align-items:center; gap:var(--jhs-space-3); color:inherit; text-decoration:none; } .actress-card-avatar { width:64px; height:64px; border-radius:50%; object-fit:cover; background:var(--jhs-surface-2); } .actress-card-name { overflow:hidden; color:var(--jhs-text); font-size:var(--jhs-font-size-lg); font-weight:700; text-overflow:ellipsis; white-space:nowrap; } .actress-card-allname { overflow:hidden; margin-top:var(--jhs-space-1); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); text-overflow:ellipsis; white-space:nowrap; } .actress-card__meta { display:grid; gap:var(--jhs-space-2); margin:var(--jhs-space-3) 0; } .actress-card__meta-row { display:grid; grid-template-columns:76px minmax(0,1fr); gap:var(--jhs-space-2); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); } .actress-card__meta-row dt { color:var(--jhs-text-faint); } .actress-card__meta-row dd { overflow:hidden; margin:0; color:var(--jhs-text); text-overflow:ellipsis; white-space:nowrap; } .actress-card__note { min-height:20px; margin-bottom:var(--jhs-space-3); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); } .actress-card__actions { display:flex; align-items:center; gap:var(--jhs-space-2); margin-top:auto; } .actress-card__actions .btn-check-actress { flex:1; } .actress-card__menu { position:relative; } .actress-card__menu summary { list-style:none; } .actress-card__menu summary::-webkit-details-marker { display:none; } .actress-card__menu-popover { position:absolute; right:0; bottom:calc(100% + var(--jhs-space-1)); z-index:20; min-width:128px; padding:var(--jhs-space-1); border:1px solid var(--jhs-border); border-radius:var(--jhs-radius-md); background:var(--jhs-surface); box-shadow:var(--jhs-shadow-md); } .actress-card__menu-popover button { width:100%; justify-content:flex-start; } .card-tag.is-uncensored { color:var(--jhs-status-down); background:var(--jhs-status-down-tint); } .card-tag.is-censored { color:var(--jhs-status-watch); background:var(--jhs-status-watch-tint); } .card-tag.is-unknown { color:var(--jhs-text-muted); background:var(--jhs-surface-2); } #new-video-list-container { display:none; flex:1; min-height:0; overflow-y:auto; } #new-video-list-footer { display:none; padding:var(--jhs-space-2) 0; border-top:1px solid var(--jhs-border); color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); } .jhs-new-video-grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:var(--jhs-space-3); padding:var(--jhs-space-1); } .nv-card__link { display:block; color:inherit; text-decoration:none; } .nv-card__cover { position:relative; width:100%; overflow:hidden; aspect-ratio:3/2; border-radius:var(--jhs-radius-sm); background:var(--jhs-surface-2); } .nv-cover-img { width:100%; height:100%; object-fit:cover; cursor:zoom-in; } .nv-card__empty { display:flex; align-items:center; justify-content:center; height:100%; color:var(--jhs-text-faint); font-size:var(--jhs-font-size-xs); } .nv-card__rating { position:absolute; top:var(--jhs-space-1); right:var(--jhs-space-1); } .nv-card__body { padding:var(--jhs-space-2) var(--jhs-space-1); } .nv-card__title, .nv-card__actress { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; } .nv-card__title { color:var(--jhs-text); font-size:var(--jhs-font-size-sm); font-weight:700; } .nv-card__actress, .nv-card__date { color:var(--jhs-text-muted); font-size:var(--jhs-font-size-xs); } .jhs-new-video-pagination { padding:var(--jhs-space-3) 0; border-top:1px solid var(--jhs-border); text-align:center; } .jhs-form-dialog { display:grid; gap:var(--jhs-space-3); padding:var(--jhs-space-4); } .jhs-avatar-editor { display:grid; grid-template-columns:100px minmax(0,1fr); gap:var(--jhs-space-3); align-items:start; } .jhs-avatar-editor__preview { width:100px; height:100px; border:2px solid var(--jhs-border); border-radius:50%; object-fit:cover; } .jhs-avatar-editor__actions { margin-top:var(--jhs-space-2); } .jhs-form-dialog__body, .jhs-form-field { display:grid; gap:var(--jhs-space-1); } .jhs-form-label, .jhs-form-dialog__title { color:var(--jhs-text); font-size:var(--jhs-font-size-sm); font-weight:600; } .jhs-form-dialog :where(.jhs-field,.jhs-select,.jhs-textarea) { width:100%; } .jhs-form-dialog .jhs-textarea { min-height:60px; overflow-y:hidden; } .jhs-option-row { display:flex; align-items:center; gap:var(--jhs-space-2); min-height:36px; } #actress-pagination { display:flex; align-items:center; justify-content:center; flex-wrap:wrap; gap:var(--jhs-space-1); } @media (max-width:767px) { .jhs-new-video-toolbar { align-items:stretch; flex-direction:column; } .jhs-new-video-toolbar select, .jhs-new-video-toolbar .jhs-btn { min-height:44px; } .page-number-btn { display:none !important; } } </style> `}async handle(){await this.showNewVideoCount()}getPendingNewVideoCount(mt,bt){return Array.isArray(mt?.newVideoList)?mt.newVideoList.filter((wt=>{const yt=typeof wt=="string"?wt:wt.carNum;return!bt.has(yt)})).length:0}async getPendingNewVideoTotal(){const mt=await storageManager.getCarMap();return(await storageManager.getFavoriteActressList()).reduce(((bt,wt)=>bt+this.getPendingNewVideoCount(wt,mt)),0)}async showNewVideoCount(){const mt=await this.getPendingNewVideoTotal();$("#newVideoCount").text(`${mt}`)}async resetBtnTip(){const mt=this.getBean("TaskPlugin"),bt=await storageManager.getSetting(),wt=localStorage.getItem(mt.lastCheckFavoriteActressTimeKey)||"无",yt=bt.checkFavoriteActress_IntervalTime,jt=localStorage.getItem(mt.lastCheckNewVideoTimeKey)||"无",xt=bt.checkNewVideo_intervalTime;$("#checkFavoriteActress").attr("data-tip",`上次自动同步时间: ${wt}; 检测间隔时间: ${yt}小时`),$("#checkNewVideo").attr("data-tip",`上次检测时间: ${jt}; 检测间隔时间: ${xt}小时`)}async openDialog(){const mt=this.getBean("TaskPlugin"),bt=await storageManager.getSetting(),wt=localStorage.getItem(mt.lastCheckFavoriteActressTimeKey)||"无",yt=bt.checkFavoriteActress_IntervalTime,jt=localStorage.getItem(mt.lastCheckNewVideoTimeKey)||"无",xt=bt.checkNewVideo_intervalTime;let $t=` <div class="newVideoToolBox jhs-ui"> <div class="jhs-new-video-toolbar" role="toolbar" aria-label="新作品工作区工具"> <div class="jhs-new-video-toolbar__actions"> <button type="button" class="jhs-btn jhs-btn--secondary" id="checkFavoriteActress" data-tip="上次自动同步时间: ${wt}; 检测间隔时间: ${yt}小时">${this.actressSvg}<span>手动同步演员</span></button> <button type="button" class="jhs-btn jhs-btn--secondary" id="checkNewVideo" data-tip="上次检测时间: ${jt}; 检测间隔时间: ${xt}小时">${this.newSvg}<span>手动检测最新作品</span></button> <button type="button" class="jhs-btn jhs-btn--ghost" id="toSetting">${this.settingSvg}<span>配置</span></button> <span id="checkNewVideoMsg" role="status" aria-live="polite"></span> </div> <div class="jhs-new-video-toolbar__filters"> <select id="paramActressType" class="jhs-select-source" aria-label="演员类型"><option value="all" selected>所有</option><option value="uncensored">无码</option><option value="censored">有码</option><option value="">未知</option></select> <select id="paramSortBy" class="jhs-select-source" aria-label="演员排序"> <option value="default" selected>默认排序</option><optgroup label="发行时间"><option value="lastPublishTime_desc">发行时间 新→旧</option><option value="lastPublishTime_asc">发行时间 旧→新</option></optgroup><optgroup label="检测时间"><option value="lastCheckTime_desc">检测时间 新→旧</option><option value="lastCheckTime_asc">检测时间 旧→新</option></optgroup><optgroup label="新作品数"><option value="newVideoCount_desc">新作品数 多→少</option><option value="newVideoCount_asc">新作品数 少→多</option></optgroup> </select> <select id="nvSortBy" class="jhs-select-source jhs-is-hidden" aria-label="新作品排序"><option value="publishTime_desc" selected>发行时间 新→旧</option><option value="publishTime_asc">发行时间 旧→新</option><option value="voteCount_desc">评价人数 多→少</option><option value="voteCount_asc">评价人数 少→多</option><option value="actress_asc">演员名 A→Z</option><option value="actress_desc">演员名 Z→A</option><option value="carNum_asc">番号 A→Z</option><option value="carNum_desc">番号 Z→A</option></select> <button type="button" class="jhs-btn jhs-btn--secondary" id="toggleViewMode">新作品列表</button> <button type="button" class="jhs-btn jhs-btn--ghost" id="reLoad">${this.refreshSvg}<span>刷新</span></button> </div> </div> <div id="actress-card-container" class="jhs-scrollbar"></div> <div id="new-video-list-container"></div> <div id="new-video-list-footer"></div> <div id="actress-pagination"></div> </div>`;layer.open({type:1,title:'<span class="jhs-dialog-title" data-tip="数据来源: 女优页面首页,含磁链分类">新作品检测</span>',content:$t,scrollbar:!1,area:utils.getDialogArea("workspace"),anim:-1,success:async(kt,_t)=>{JhsSelect.enhance(kt),this.loadData(),this.bindClick(),utils.setupEscClose(_t)}})}bindClick(){const mt=this.getBean("TaskPlugin");$("#reLoad").on("click",(bt=>{this.loadData(),$("#checkNewVideoMsg").text("")})),$("#toSetting").on("click",(bt=>{this.getBean("SettingPlugin").openSettingDialog("task-panel",(()=>{$("#setting-checkFavoriteActress").css({border:"1px solid var(--jhs-status-filter)"}),$("#setting-checkNewVideo").css({border:"1px solid var(--jhs-status-filter)"})}))})),$("#checkFavoriteActress").on("click",(bt=>{utils.q({clientX:bt.clientX,clientY:bt.clientY+20},"是否手动同步演员?",(()=>{navigator.locks.request(mt.singleTaskKey,{ifAvailable:!0},(async wt=>{if(!wt)return void show.error("当前有定时任务在后台执行中, 无法发起手动任务");$('a[href*="/users/profile"]').length>0?(await mt.checkFavoriteActress(),this.loadData()):show.error("未登录JavDb, 同步失败")})).catch((wt=>{console.error("锁任务出现错误:",wt),clog.error("锁任务出现错误:",wt)}))}))})),$("#checkNewVideo").on("click",(bt=>{utils.q({clientX:bt.clientX,clientY:bt.clientY+20},"是否手动检测最新作品?",(()=>{navigator.locks.request(mt.singleTaskKey,{ifAvailable:!0},(async wt=>{wt?await mt.checkNewVideo(!0):show.error("当前有定时任务在后台执行中, 无法发起手动任务")})).catch((wt=>{console.error("锁任务出现错误:",wt),clog.error("锁任务出现错误:",wt)}))}))})),$("#paramActressType").on("change",(bt=>{this._viewMode==="list"?this.renderNewVideoList():this.loadData()})),$("#paramSortBy").on("change",(bt=>{this.loadData()})),$("#nvSortBy").on("change",(bt=>{this.nvSortBy=$("#nvSortBy").val(),this.nvCurrentPage=1,this.nvRenderPage()})),$("#toggleViewMode").on("click",(bt=>{this._viewMode=this._viewMode==="list"?"card":"list";const wt=this._viewMode==="list";$("#actress-card-container").toggle(!wt),$("#actress-pagination").toggle(!wt),$("#new-video-list-container").toggle(wt),$("#new-video-list-footer").toggle(wt),JhsSelect.setVisible("#paramSortBy",!wt),JhsSelect.setVisible("#nvSortBy",wt),$("#toggleViewMode").text(wt?"演员视图":"新作品列表"),wt?this.renderNewVideoList():this.loadData()}))}loadData(){this.currentPage=1,this.renderActressCards().catch(mt=>{clog.error("加载演员卡片失败:",mt),show.error("加载数据失败"),$("#actress-card-container").empty().append($('<div class="jhs-state jhs-state--error"></div>').append(document.createTextNode("加载数据失败 "),$('<button type="button" class="jhs-btn jhs-btn--secondary">重试</button>').on("click",(()=>this.loadData()))))})}async renderActressCards(){const mt=$("#actress-card-container");if(!mt.length)return;mt.html('<div class="jhs-state jhs-state--loading" role="status">加载中...</div>');let bt=await storageManager.getFavoriteActressList();const wt=$("#paramActressType").val();wt!=="all"&&(bt=bt.filter((Et=>Et.actressType===wt)));const yt=await storageManager.getCarMap(),jt=Et=>this.getPendingNewVideoCount(Et,yt),xt=$("#paramSortBy").val(),$t={lastPublishTime_desc:[{key:"lastPublishTime",order:"desc"}],lastPublishTime_asc:[{key:"lastPublishTime",order:"asc"}],lastCheckTime_desc:[{key:"lastCheckTime",order:"desc"}],lastCheckTime_asc:[{key:"lastCheckTime",order:"asc"}],newVideoCount_desc:[{key:jt,order:"desc"}],newVideoCount_asc:[{key:jt,order:"asc"}]},kt=[{key:jt,order:"desc"},{key:"lastPublishTime",order:"desc"}],_t=utils.genericSort(bt,$t[xt]||kt),St=_t.length,Tt=Math.ceil(St/this.pageSize),It=(this.currentPage-1)*this.pageSize,Bt=It+this.pageSize,Pt=_t.slice(It,Bt),Mt=await this.getBean("OtherSitePlugin").getJavDbUrl(),At=this.getBean("TaskPlugin"),Nt=await storageManager.getSetting("checkNewVideo_ruleTime")||8760;if(Pt.length===0)return mt.html('<div class="jhs-state jhs-state--empty">暂无数据</div>'),void this.renderPagination(St,Tt);const Dt=Et=>String(Et).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,"""),Lt=Pt.map((Et=>{const Ht=Array.isArray(Et.allName)?Et.allName.join(","):"",Ft=Dt(Ht),zt=Dt(Et.name||""),Ot=Dt(Et.remark||""),Vt=this.getPendingNewVideoCount(Et,yt),Ut=Vt>0&&Et.lastPublishTime||"",Jt=`${Mt}/actors/${Et.starId}?t=d`;let qt=!1;Ut&&(qt=!At.isUnnecessaryCheck(Ut,Nt));let Yt="未知",Xt="is-unknown";Et.actressType===A?(Yt="无码",Xt="is-uncensored"):Et.actressType===D&&(Yt="有码",Xt="is-censored");const se=Ut||(Vt===0&&Et.lastPublishTime?"已全部标记":"暂无记录"),Qt=qt?`停更 ${Nt/24/365} 年以上,下轮任务不再检测`:Ot||"暂无备注";return` <article class="actress-card ${qt?"is-paused":""}" data-starId="${Et.starId}"> <div class="actress-card__badges"> <span class="jhs-badge jhs-badge--soft card-new-count-tag" data-tip="最新作品数量: ${Vt}">${Vt} 新</span> <span class="jhs-badge card-tag ${Xt}">${Yt}</span> ${qt?'<span class="jhs-badge jhs-badge--neutral">停更</span>':""} </div> <a class="actress-card__profile" href="${Jt}" target="_blank" rel="noopener noreferrer"> <img src="${Et.avatar||"https://c0.jdbstatic.com/images/actor_unknow.jpg"}" alt="${Ft}" class="actress-card-avatar" loading="lazy"> <span><span class="actress-card-name">${zt}</span><span class="actress-card-allname" title="${Ft}">${Ft||"暂无别名"}</span></span> </a> <dl class="actress-card__meta"> <div class="actress-card__meta-row"><dt>最近作品</dt><dd title="${se}">${se}</dd></div> <div class="actress-card__meta-row"><dt>上次检测</dt><dd>${Et.lastCheckTime||"暂无记录"}</dd></div> </dl> <p class="actress-card__note" title="${Qt}">${Qt}</p> <div class="actress-card__actions"> <button type="button" class="jhs-btn jhs-btn--primary btn-check-actress" data-starId="${Et.starId}">${this.checkSvg}<span>重新检测</span></button> <button type="button" class="jhs-btn jhs-btn--icon jhs-btn--ghost btn-delete-actress" aria-label="取消收藏 ${zt}" title="取消收藏" data-starId="${Et.starId}">${this.deleteSvg}</button> <details class="actress-card__menu"> <summary class="jhs-btn jhs-btn--icon jhs-btn--ghost" aria-label="更多操作" title="更多操作">•••</summary> <div class="actress-card__menu-popover" role="menu"> <button type="button" class="jhs-btn jhs-btn--ghost btn-edit-actress" role="menuitem" data-starId="${Et.starId}">${this.editSvg}<span>编辑资料</span></button> </div> </details> </div> </article>`})).join("");mt.html(Lt),$(".btn-delete-actress").off("click").on("click",(Et=>{Et.preventDefault();const Ht=$(Et.currentTarget).attr("data-starId"),Ft=_t.find((zt=>zt.starId===Ht));utils.q(Et,`是否取消收藏 ${Ft.name}?`,(async()=>{let zt=`${await this.getBean("OtherSitePlugin").getJavDbUrl()}/actors/${Ht}/uncollect`;const Ot=document.querySelector("meta[name=csrf-token]").content,Vt=await gmHttp.post(zt,null,{"x-csrf-token":Ot});Vt.includes("removeClass")?(await storageManager.removeFavoriteActress(Ht),this.loadData(),this.showNewVideoCount()):(show.error("移除失败"),clog.error("移除失败,返回值:",Vt))}))})),$(".btn-edit-actress").off("click").on("click",(Et=>{Et.preventDefault();const Ht=$(Et.currentTarget).attr("data-starId"),Ft=_t.find((zt=>zt.starId===Ht));Ft?this.editActress(Ft):show.error(`未找到 starId 为 ${Ht} 的女优记录。`)})),$(".btn-check-actress").off("click").on("click",(Et=>{Et.preventDefault(),navigator.locks.request(At.singleTaskKey,{ifAvailable:!0},(async Ht=>{if(!Ht)return void show.error("当前有定时任务在后台执行中, 无法发起手动任务");const Ft=$(Et.currentTarget).attr("data-starId"),zt=_t.find((Ot=>Ot.starId===Ft));await At.checkOneNewVideo(zt)})).catch((Ht=>{console.error("锁任务出现错误:",Ht),clog.error("锁任务出现错误:",Ht)}))})),$(".actress-card__menu").on("keydown",(Et=>{if(Et.key!=="Escape")return;Et.preventDefault(),$(Et.currentTarget).prop("open",!1).find("summary").trigger("focus")})).on("click","[role='menuitem']",(Et=>{$(Et.currentTarget).closest("details").prop("open",!1)})),this.renderPagination(St,Tt),show.ok("加载完成")}async getNewVideoFlatList(){const mt=await storageManager.getFavoriteActressList(),bt=await storageManager.getCarMap(),wt=$("#paramActressType").val(),yt=[];for(const jt of mt)if(!(wt!=="all"&&jt.actressType!==wt)&&Array.isArray(jt.newVideoList))for(const xt of jt.newVideoList){const $t=typeof xt=="string"?xt:xt.carNum;if(bt.has($t))continue;const kt=typeof xt=="object"?xt:{};yt.push({carNum:$t,coverUrl:kt.coverUrl||"",title:kt.title||"",publishTime:kt.publishTime||"",actressName:jt.name||"",starId:jt.starId||"",score:kt.score||0,voteCount:kt.voteCount||0,url:kt.url||""})}return yt.sort(((jt,xt)=>(xt.publishTime||"").localeCompare(jt.publishTime||""))),yt}async loadCoverForItems(mt){const bt=await this.getBean("OtherSitePlugin").getJavDbUrl(),wt={};for(const yt of mt)if(!wt[yt.starId]&&!mt.every((jt=>jt.starId!==yt.starId||jt.coverUrl))){wt[yt.starId]=!0;try{const jt=await gmHttp.get(`${bt}/actors/${yt.starId}?t=d`);utils.htmlTo$dom(jt).find(".movie-list .item").each((($t,kt)=>{const _t=$(kt),St=_t.find(".video-title strong").text().trim(),Tt=_t.find("img").attr("src")||"";if(!St||!Tt)return;let It=Tt;It.startsWith("http")||(It=It.startsWith("/")?bt+It:bt+"/"+It);const Bt=It.replace("thumbs","covers"),Pt=_t.find(".video-title").text().replace(St,"").trim();$(`.nv-card[data-car="${St}"]`).each(((Mt,At)=>{const Nt=$(At),Dt=Nt.find("img");if(Dt.length)Dt.attr("src",Bt).on("error",(function(){$(this).hide().next().show()}));else{const Lt=Nt.find(".nv-placeholder");Lt.length&&Lt.replaceWith(`<img class="nv-cover-img" src="${Bt}" loading="lazy" onerror="this.classList.add('jhs-is-hidden');this.nextElementSibling.classList.remove('jhs-is-hidden');"><div class="nv-card__empty jhs-is-hidden">无封面</div>`)}Pt&&Nt.attr("title",Pt)}))}))}catch(jt){clog.warn("获取演员封面失败:",yt.actressName,jt)}}}async renderNewVideoList(){const mt=$("#new-video-list-container");if(!mt.length)return;mt.html('<div class="jhs-state jhs-state--loading" role="status">加载中...</div>');let bt;try{bt=await this.getNewVideoFlatList()}catch(yt){return console.error(yt),void mt.html(`<div class="jhs-state jhs-state--error" role="alert">加载失败: ${escapeHtml(yt.message)}</div>`)}if(bt.length===0)return mt.html('<div class="jhs-state jhs-state--empty">暂无待鉴定的新作品</div>'),void $("#new-video-list-footer").html("");this.nvFlatListCache=bt,this.nvCurrentPage=1,this.nvSortBy=$("#nvSortBy").val()||"publishTime_desc";const wt=new Set;for(const yt of bt)wt.add(yt.actressName);$("#new-video-list-footer").html(`<span>共 <b>${bt.length}</b> 个待鉴定番号,涉及 <b>${wt.size}</b> 位演员</span> <button type="button" class="jhs-btn jhs-btn--soft" id="batchMarkWatched">全部标记已看</button> <button type="button" class="jhs-btn jhs-btn--soft" id="batchMarkDownloaded">全部标记已下载</button>`),this.nvRenderPage(),this.loadCoverForItems(bt).catch((yt=>clog.warn("封面加载异常:",yt))),$("#batchMarkWatched").off("click").on("click",(async()=>{!this.nvFlatListCache||this.nvFlatListCache.length===0||utils.q({clientX:0,clientY:0},`确认将 ${this.nvFlatListCache.length} 个番号全部标记为已看?`,(async()=>{const yt=this.nvFlatListCache.map((jt=>({carNum:jt.carNum,url:`/search?q=${encodeURIComponent(jt.carNum)}`,names:jt.actressName,actionType:p})));try{await storageManager.saveCarList(yt),show.ok(`已标记 ${yt.length} 个`),this.renderNewVideoList(),this.showNewVideoCount()}catch(jt){show.error("标记失败: "+jt.message)}}))})),$("#batchMarkDownloaded").off("click").on("click",(async()=>{!this.nvFlatListCache||this.nvFlatListCache.length===0||utils.q({clientX:0,clientY:0},`确认将 ${this.nvFlatListCache.length} 个番号全部标记为已下载?`,(async()=>{const yt=this.nvFlatListCache.map((jt=>({carNum:jt.carNum,url:`/search?q=${encodeURIComponent(jt.carNum)}`,names:jt.actressName,actionType:g})));try{await storageManager.saveCarList(yt),show.ok(`已标记 ${yt.length} 个`),this.renderNewVideoList(),this.showNewVideoCount()}catch(jt){show.error("标记失败: "+jt.message)}}))}))}nvSortList(mt){const bt=this.nvSortBy||"publishTime_desc",[wt,yt]=bt.split("_");return mt.slice().sort(((jt,xt)=>{let $t=0;switch(wt){case"publishTime":$t=(jt.publishTime||"").localeCompare(xt.publishTime||"");break;case"actress":$t=(jt.actressName||"").localeCompare(xt.actressName||"");break;case"carNum":$t=(jt.carNum||"").localeCompare(xt.carNum||"");break;case"voteCount":$t=(jt.voteCount||0)-(xt.voteCount||0);break}return yt==="desc"?-$t:$t}))}nvRenderPage(){const mt=this.nvFlatListCache;if(!mt||mt.length===0)return;const bt=this.nvSortList(mt),wt=this.nvPageSize,yt=(this.nvCurrentPage-1)*wt,jt=yt+wt,xt=bt.slice(yt,jt),$t=Math.ceil(bt.length/wt),kt=this.getBean("OtherSitePlugin").getJavDbUrl().then((_t=>{const St=$("#new-video-list-container");let Tt="";Tt+='<div id="nv-grid" class="jhs-new-video-grid">';for(const It of xt){const Bt=escapeHtml(It.carNum),Pt=escapeHtml(It.title||It.carNum),Mt=It.coverUrl?It.coverUrl.replace("thumbs","covers"):"",At=It.url||`${_t}/search?q=${encodeURIComponent(It.carNum)}`;let Nt=`番号: ${Bt}\\n演员: ${escapeHtml(It.actressName)}\\n发行: ${It.publishTime||"未知"}`;It.voteCount&&(Nt+=`\\n评价人数: ${It.voteCount}`);const Dt=It.voteCount?`<span class="jhs-badge jhs-badge--neutral nv-card__rating">${It.voteCount}人评价</span>`:"";Tt+=`<div class="nv-card" data-car="${Bt}" title="${Nt}">`,Tt+=`<a class="nv-card__link" href="${At}" target="_blank" rel="noopener noreferrer">`,Tt+='<div class="nv-card__cover">',Mt?Tt+=`<img class="nv-cover-img" src="${Mt}" data-full="${Mt}" loading="lazy" onerror="this.classList.add('jhs-is-hidden');this.nextElementSibling.classList.remove('jhs-is-hidden');">${Dt}<div class="nv-card__empty jhs-is-hidden">无封面</div>`:Tt+='<div class="nv-placeholder nv-card__empty">加载中...</div>',Tt+="</div>",Tt+='<div class="nv-card__body">',Tt+=`<div class="nv-card__title" title="${Bt}">${Bt}</div>`,Tt+=`<div class="nv-card__actress" title="${escapeHtml(It.actressName)}">${escapeHtml(It.actressName)}</div>`,It.publishTime&&(Tt+=`<div class="nv-card__date">${It.publishTime}</div>`),Tt+="</div></a></div>"}if(Tt+="</div>",$t>1){Tt+='<div id="nv-pagination-bar" class="jhs-new-video-pagination">',this.nvCurrentPage>1&&(Tt+=`<button type="button" class="jhs-btn jhs-btn--secondary pagination-btn" data-nvpage="${this.nvCurrentPage-1}">上一页</button>`);let It=Math.max(1,this.nvCurrentPage-2),Bt=Math.min($t,It+4);Bt-It<4&&(It=Math.max(1,Bt-4));for(let Pt=It;Pt<=Bt;Pt++)Tt+=`<button type="button" class="jhs-btn ${Pt===this.nvCurrentPage?"jhs-btn--primary is-current":"jhs-btn--secondary"} pagination-btn" data-nvpage="${Pt}" ${Pt===this.nvCurrentPage?'aria-current="page"':""}>${Pt}</button>`;this.nvCurrentPage<$t&&(Tt+=`<button type="button" class="jhs-btn jhs-btn--secondary pagination-btn" data-nvpage="${this.nvCurrentPage+1}">下一页</button>`),Tt+=`<span class="jhs-pagination__summary">第 ${this.nvCurrentPage}/${$t} 页,共 ${bt.length} 条</span>`,Tt+="</div>"}St.html(Tt),St.find(".pagination-btn").off("click").on("click",(It=>{const Bt=parseInt($(It.currentTarget).data("nvpage"));Bt>=1&&Bt<=$t&&Bt!==this.nvCurrentPage&&(this.nvCurrentPage=Bt,this.nvRenderPage(),St.scrollTop(0))})),window.imageHoverPreviewObj?window.imageHoverPreviewObj.bindEvents():window.imageHoverPreviewObj=new ImageHoverPreview({selector:".nv-cover-img",dataAttribute:"data-full"})}))}async editActress(mt){const bt=mt.name,wt=mt.avatar,yt=mt.remark||"",jt=Array.isArray(mt.allName)?mt.allName.join(","):"",xt=Array.isArray(mt.newVideoList)?mt.newVideoList.map((St=>typeof St=="string"?St:St.carNum)).join(","):"",$t=mt.starId,kt=mt.actressType||"",_t=` <div class="jhs-form-dialog"> <div class="jhs-avatar-editor"> <img id="edit-avatar-preview" src="${wt}" alt="Avatar Preview" class="jhs-avatar-editor__preview"> <div class="jhs-form-dialog__body"> <label class="jhs-form-label">头像链接:</label> <input type="text" id="edit-actress-avatar" value="${wt}" class="jhs-field"> <div class="jhs-toolbar jhs-avatar-editor__actions"> <button type="button" id="search-avatar-btn" class="jhs-btn jhs-btn--primary"> 搜索头像 </button> <button type="button" id="select-cdn-btn" class="jhs-btn jhs-btn--secondary"> 选择 CDN 源 </button> </div> </div> </div> <div class="jhs-form-field"> <label class="jhs-form-label">主名称:</label> <input type="text" id="edit-actress-name" value="${bt}" class="jhs-field"> </div> <div class="jhs-form-field"> <label class="jhs-form-label">所有别名(用逗号隔开):</label> <textarea id="edit-actress-allname" class="jhs-textarea">${jt}</textarea> </div> <div class="jhs-form-field"> <label class="jhs-form-label">演员类别:</label> <select id="actressType" class="jhs-select-source"> <option value="" ${kt===""?"selected":""}>未知</option> <option value="censored" ${kt==="censored"?"selected":""}>有码</option> <option value="uncensored" ${kt==="uncensored"?"selected":""}>无码</option> </select> </div> <div class="jhs-form-field"> <label class="jhs-form-label">最新作品(用逗号隔开):</label> <textarea id="edit-actress-newvideolist" class="jhs-textarea">${xt}</textarea> </div> <div class="jhs-form-field"> <label class="jhs-form-label">备注:</label> <textarea id="edit-remark" class="jhs-textarea">${yt}</textarea> </div> </div> `;layer.open({type:1,title:`编辑女优: ${bt} (${$t})`,area:utils.getDialogArea("sm"),content:_t,btn:["保存","取消"],success:(St,Tt)=>{JhsSelect.enhance(St);const It=Mt=>{Mt.css("height","auto"),Mt.css("height",Mt[0].scrollHeight+15+"px")};$("#edit-actress-avatar").on("input",(function(){const Mt=$(this).val();$("#edit-avatar-preview").attr("src",Mt)}));const Bt=$("#edit-actress-allname");Bt.on("input",(function(){It($(this))})),It(Bt);const Pt=$("#edit-actress-newvideolist");Pt.on("input",(function(){It($(this))})),It(Pt),$("#search-avatar-btn").on("click",(async()=>{await this.searchAvatar()})),$("#select-cdn-btn").on("click",(async()=>{await(async function(){const Mt=at,At=tt.map(((Dt,Lt)=>` <label class="jhs-option-row" for="cdn-${Lt}"> <input type="radio" id="cdn-${Lt}" name="cdn-source" value="${Lt}" ${Lt===Mt?"checked":""}> <span>${Dt.name} ${Dt.json.includes("jsdelivr")?"(推荐)":""}</span> </label> `)).join(""),Nt=` <div class="jhs-form-dialog"> <p class="jhs-form-dialog__title">请选择头像数据源 (当前: ${tt[Mt].name}):</p> ${At} <p class="jhs-helper-text">切换源会清除本地缓存的数据,并在下次搜索时重新加载。</p> </div> `;layer.open({type:1,title:"选择 CDN 源",area:utils.getResponsiveArea(["400px","auto"]),content:Nt,btn:["确定","取消"],success:(Dt,Lt)=>{utils.setupEscClose(Lt)},yes:async Dt=>{const Lt=$('input[name="cdn-source"]:checked').val(),Et=parseInt(Lt,10);if(Et!==at){at=Et,localStorage.setItem(nt,Et.toString()),it=tt[Et].json,st=tt[Et].base,ct=null,dt=null;try{await lt.set(rt,null)}catch(Ht){clog.error("清除 IndexedDB 缓存失败:",Ht)}show.ok(`CDN 源已切换为: ${tt[Et].name}`),layer.close(Dt)}else layer.close(Dt)}})})()})),utils.setupEscClose(Tt)},yes:async St=>{const Tt=$("#edit-actress-avatar").val().trim(),It=$("#edit-actress-name").val().trim(),Bt=$("#edit-actress-allname").val().trim(),Pt=$("#edit-actress-newvideolist").val().trim(),Mt=$("#edit-remark").val().trim(),At=$("#actressType").val();if(!It)return show.error("主名称不能为空"),!1;const Nt=Bt.split(/[\uff0c,]/).map((Lt=>Lt.trim())).filter((Lt=>Lt.length>0)),Dt=Pt.split(/[\uff0c,]/).map((Lt=>Lt.trim())).filter((Lt=>Lt.length>0));mt.avatar=Tt,mt.name=It,mt.allName=Nt,mt.newVideoList=Dt,mt.actressType=At,mt.remark=Mt;try{await storageManager.updateFavoriteActress(mt),this.renderActressCards().then(),this.showNewVideoCount(),show.ok(`女优 ${It} 信息已更新`),layer.close(St)}catch(Lt){show.error("修改失败: "+(Lt.message||Lt))}}})}renderPagination(mt,bt){const wt=this.currentPage;let yt="";const jt=$("#actress-pagination");if(bt===0)return yt='<span class="jhs-pagination__summary">共 0 条记录</span>',void jt.html(yt);wt>1&&bt>5&&(yt+='<button class="jhs-btn pagination-btn" data-page="1">首页</button>'),wt>1&&(yt+=`<button class="jhs-btn pagination-btn" data-page="${wt-1}">上一页</button>`);let xt=Math.max(1,wt-Math.floor(2.5)),$t=Math.min(bt,xt+5-1);$t-xt<4&&(xt=Math.max(1,$t-5+1));for(let kt=xt;kt<=$t;kt++)yt+=`<button class="jhs-btn pagination-btn page-number-btn ${kt===wt?"active":""}" data-page="${kt}">${kt}</button>`;wt<bt&&(yt+=`<button class="jhs-btn pagination-btn" data-page="${wt+1}">下一页</button>`),wt<bt&&bt>5&&(yt+=`<button class="jhs-btn pagination-btn" data-page="${bt}">尾页</button>`),yt+=`<span class="jhs-pagination__summary">共 ${mt} 条记录 (第 ${wt}/${bt} 页)</span>`,jt.html(yt),jt.find(".pagination-btn").off("click").on("click",(kt=>{if($(kt.currentTarget).is("[disabled]"))return;const _t=parseInt($(kt.currentTarget).data("page"));_t>=1&&_t<=bt&&_t!==this.currentPage&&(this.currentPage=_t,this.renderActressCards())}))}async searchAvatar(){const mt=$("#edit-actress-name"),bt=$("#edit-actress-allname"),wt=mt.val().trim(),yt=bt.val().trim().split(/[\uff0c,]/).map((St=>St.trim())).filter((St=>St.length>0));if(wt&&yt.unshift(wt),yt.length===0)return void show.error("请先填写女优主名称或别名进行搜索。");const jt=loading("正在搜索头像...");let xt=[];try{xt=await gt(yt)}catch(St){return void show.error(`头像数据加载或搜索失败: ${St.message||St}`)}finally{jt.close()}if(xt.length===0)return void show.error(`未找到与 '${yt.join("、")}' 相关的头像。请检查名称。`);const $t=xt.map(((St,Tt)=>` <div id="wrapper-${Tt}" class="gfriends-image-item-wrapper"> <img alt="" src="${St}" data-url="${St}" class="gfriends-selectable-img" data-wrapper-id="wrapper-${Tt}" > <div class="gfriends-size-tag" data-size-for="wrapper-${Tt}">...</div> </div> `)).join(""),kt=` <style> /* 保持上一个回答的美化样式 */ #gfriends-image-list-container { padding: 15px; height: 100%; box-sizing: border-box; background-color: var(--jhs-surface-2); } #gfriends-prompt { color: var(--jhs-text-muted); font-weight: 500; border-bottom: 1px solid var(--jhs-surface-2); padding-bottom: 10px; } #gfriends-image-list { display: flex; flex-wrap: wrap; gap: 15px; justify-content: center; } .gfriends-image-item-wrapper { width: 160px; height: 225px; /* 增加高度以容纳尺寸标签 */ overflow: hidden; border-radius: 6px; box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); transition: transform 0.2s ease, box-shadow 0.2s ease; cursor: pointer; position: relative; padding-bottom: 25px; /* 为尺寸标签留出空间 */ } .gfriends-selectable-img { width: 100%; height: 200px; /* 固定图片高度 */ object-fit: cover; border: 3px solid transparent; border-radius: 6px; transition: border 0.2s ease; } .gfriends-image-item-wrapper:hover { transform: translateY(-4px) scale(1.02); box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2); } .gfriends-selectable-img.is-selected { border-color: var(--jhs-accent); box-shadow: 0 0 0 3px var(--jhs-accent); } /* 新增:尺寸标签样式 */ .gfriends-size-tag { position: absolute; bottom: 0; /* 定位到图片容器底部 */ left: 0; right: 0; height: 25px; line-height: 25px; text-align: center; background-color: rgba(0, 0, 0, 0.7); /* 半透明背景 */ color: #fff; font-size: 11px; font-weight: bold; border-bottom-left-radius: 6px; border-bottom-right-radius: 6px; user-select: none; } </style> <div id="gfriends-image-list-container"> <p id="gfriends-prompt" class="jhs-layout-bd59a2e1"> 点击图片即可选择(初始共 ${xt.length} 张) </p> <div class="jhs-layout-3fefafab"> <div id="gfriends-image-list"> ${$t} </div> </div> </div> `;let _t=0;layer.open({type:1,title:`选择女优头像 (${xt.length} 张)`,area:utils.getResponsiveArea(["900px","85%"]),content:kt,btn:["关闭"],success:(St,Tt)=>{const It=$(St),Bt=It.find(".gfriends-selectable-img"),Pt=It.find("#gfriends-prompt");Bt.each((function(){const Mt=$(this),At=Mt.data("wrapper-id"),Nt=It.find(`#${At}`),Dt=It.find(`.gfriends-size-tag[data-size-for="${At}"]`);Mt.on("load",(function(){const Lt=this.naturalWidth,Et=this.naturalHeight;Dt.text(`${Lt} x ${Et}`)})),Mt.on("error",(function(){Nt.remove(),_t++;const Lt=xt.length-_t;Pt.text(`点击图片即可选择(已移除 ${_t} 张错误图片,剩余 ${Lt} 张)`),Lt===0&&(show.error("所有搜索到的头像链接均已失效,无法选择。"),layer.close(Tt))})),this.complete&&(this.naturalWidth>0?Mt.trigger("load"):Mt.trigger("error"))})),Bt.on("click",(function(){const Mt=$(this),At=Mt.data("url");$("#edit-actress-avatar").val(At),$("#edit-avatar-preview").attr("src",At),Bt.removeClass("is-selected"),Mt.addClass("is-selected"),setTimeout((()=>{layer.close(Tt)}),150)})),utils.setupEscClose(Tt)}})}}class OneTwoThreeOfflinePlugin extends X{constructor(){super(...arguments),this.tokenKey="jhs_123pan_author_token",this.tokenMetaKey="jhs_123pan_author_token_meta",this.syncTimer=null,this.syncFallbackMs=3e5,this.BUTTON_COOLDOWN_MS=1800}getName(){return"OneTwoThreeOfflinePlugin"}async initCss(){return` <style> .one23-offline-btn { background-color: var(--jhs-accent) !important; color: var(--jhs-accent-text-on) !important; border-color: var(--jhs-accent) !important; } .one23-offline-btn.loading { opacity: 0.65; cursor: wait; } .one23-native-btn { margin-left: 6px; padding: 3px 8px; border-radius: 3px; border: 1px solid var(--jhs-accent); background: var(--jhs-accent); color: var(--jhs-accent-text-on) !important; cursor: pointer; font-size: 12px; line-height: 1.2; } </style> `}async handle(){window.location.hostname==="yun.123pan.com"?this.startTokenSync():(r||l)&&(this.bindSubmit(),this.injectNativeButtons())}startTokenSync(){this.syncTokenOnce(),this.syncTimer&&clearInterval(this.syncTimer),this.syncTimer=setInterval((()=>this.syncTokenOnce()),this.syncFallbackMs);const mt=()=>this.syncTokenOnce();window.addEventListener("storage",mt),window.addEventListener("focus",mt),document.addEventListener("visibilitychange",(()=>{document.hidden||this.syncTokenOnce()}))}getTokenFrom123Pan(){let mt=(localStorage.getItem("authorToken")||"").trim();if(mt)return{token:mt,source:"authorToken"};try{const wt=JSON.parse(localStorage.getItem("userInfo")||"{}");if(wt.authorToken||wt.token)return{token:(wt.authorToken||wt.token||"").trim(),source:wt.authorToken?"userInfo.authorToken":"userInfo.token"}}catch{}const bt=document.cookie.split(";");for(const wt of bt){const yt=wt.indexOf("=");if(yt<0)continue;const jt=wt.substring(0,yt).trim(),xt=wt.substring(yt+1);if(jt&&/token/i.test(jt)&&xt)return{token:decodeURIComponent(xt).trim(),source:`cookie.${jt}`}}return{token:"",source:""}}syncTokenOnce(){const mt=this.getTokenFrom123Pan();if(!mt.token)return;const bt=GM_getValue(this.tokenKey,""),wt=GM_getValue(this.tokenMetaKey,null);bt===mt.token&&wt&&wt.source===mt.source||(GM_setValue(this.tokenKey,mt.token),GM_setValue(this.tokenMetaKey,{source:mt.source,updatedAt:new Date().toISOString()}),bt!==mt.token&&show.info(`123 云盘授权已更新:${mt.source}`))}getStoredToken(){return GM_getValue(this.tokenKey,"")}clearStoredToken(mt){GM_setValue(this.tokenKey,""),GM_setValue(this.tokenMetaKey,{source:"cleared",reason:mt,updatedAt:new Date().toISOString()})}isTokenExpiredError(mt){const bt=mt instanceof Error?mt.message:typeof mt=="object"&&mt?mt.message||"":String(mt||"");return mt==="TOKEN_EXPIRED"||bt==="TOKEN_EXPIRED"||bt.toLowerCase().includes("token is expired")}getTokenMetaText(){const mt=GM_getValue(this.tokenMetaKey,null);return mt&&mt.source&&mt.updatedAt?`(来源:${mt.source},更新:${new Date(mt.updatedAt).toLocaleString()})`:""}assertApiResult(mt,bt){if(mt.code===0)return;const wt=mt.message||mt.msg||bt||"请求失败";throw/token is expired/i.test(wt)?"TOKEN_EXPIRED":wt}handleTokenExpired(){this.clearStoredToken("expired"),show.error("123 云盘授权已过期,请登录或刷新 yun.123pan.com 后再提交")}bindSubmit(){$(document).off("click.one23",".one23-offline-btn").on("click.one23",".one23-offline-btn",(mt=>{mt.preventDefault(),mt.stopPropagation();const bt=$(mt.currentTarget),wt=bt.attr("data-magnet");wt&&this.submitMagnet(wt,bt)}))}injectNativeButtons(){r&&utils.loopDetector((()=>$("#magnets-content .item").length>0),(()=>this.injectJavDbButtons())),l&&utils.loopDetector((()=>$("#magnet-table td a[href^='magnet:']").length>0),(()=>this.injectJavBusButtons()))}injectJavDbButtons(){$("#magnets-content .item").each(((mt,bt)=>{const wt=$(bt),yt=wt.find("a[href^='magnet:']").first().attr("href")||wt.find(".copy-to-clipboard").attr("data-clipboard-text");yt&&wt.find(".one23-offline-btn").length===0&&wt.find(".buttons").first().append(`<button class="jhs-btn button is-info is-small one23-offline-btn" data-magnet="${escapeHtml(yt)}" type="button"> 123离线 </button>`)}))}injectJavBusButtons(){$("#magnet-table td a[href^='magnet:']").each(((mt,bt)=>{const wt=$(bt),yt=wt.attr("href");yt&&wt.siblings(".one23-offline-btn").length===0&&wt.after(`<button class="jhs-btn one23-native-btn one23-offline-btn" data-magnet="${escapeHtml(yt)}" type="button">123离线</button>`)}))}async submitMagnet(mt,bt){const wt=this.getStoredToken();if(!wt)return void show.error("请先登录或刷新 yun.123pan.com,等待授权自动同步后再提交离线任务");if(bt.hasClass("loading"))return;const yt=bt.text();try{bt.addClass("loading").prop("disabled",!0).text("提交中");const jt=await this.resolveMagnet(mt,wt),xt=await this.submitTask(jt,wt),$t=await this.markCurrentVideoAsHasDown(bt);show.info(`已提交 123 离线:${xt.fileCount} 个文件 / ${this.formatSize(xt.totalSize)}${$t?",已标记为已下载":""}`),bt.text("已提交")}catch(jt){this.isTokenExpiredError(jt)?this.handleTokenExpired():show.error("123 离线提交失败:"+jt+this.getTokenMetaText()),bt.text(yt)}finally{setTimeout((()=>bt.removeClass("loading").prop("disabled",!1).text(yt)),this.BUTTON_COOLDOWN_MS)}}async markCurrentVideoAsHasDown(mt){try{const bt=this.getOfflineVideoInfo(mt);if(!bt||!bt.carNum||!bt.url)return!1;const wt=await storageManager.getCar(bt.carNum);if(wt&&wt.status===g)return!1;await storageManager.saveCar({carNum:bt.carNum,url:bt.url,names:bt.actress||bt.names||"",actionType:g,publishTime:bt.publishTime});const yt=this.getBean("DetailPageButtonPlugin");return yt&&yt.showStatus&&yt.showStatus(bt.carNum).then(),window.refresh(),!0}catch(bt){return console.error("123 离线成功后标记已下载失败:",bt),show.error("123 离线已提交,但自动标记已下载失败:"+bt),!1}}getOfflineVideoInfo(mt){if(window.isDetailPage)return this.getPageInfo();const bt=mt&&mt.closest?mt.closest(".item"):$();return bt&&bt.length?this.getBean("ListPagePlugin").findCarNumAndHref(bt):this.getPageInfo()}async resolveMagnet(mt,bt){try{const wt=await gmHttp.post(this._signUrl("https://yun.123pan.com/b/api/v2/offline_download/task/resolve"),{urls:mt},{Authorization:"Bearer "+bt,"App-Version":"3",platform:"web",Origin:"https://yun.123pan.com",Referer:"https://yun.123pan.com/"});return this.assertApiResult(wt,"解析失败"),wt.data&&wt.data.list&&wt.data.list.length>0?wt.data.list[0]:Promise.reject(wt.message||`解析失败 (${wt.code})`)}catch(wt){throw wt&&wt.status===401||this.isTokenExpiredError(wt)?"TOKEN_EXPIRED":wt.message?"响应解析失败: "+wt.message:String(wt)}}async submitTask(mt,bt){if(!mt.files||mt.files.length===0)throw"没有可建立离线的文件";const wt=mt.files.map((jt=>jt.id)),yt=mt.files.reduce(((jt,xt)=>jt+(xt.size||0)),0);try{const jt=await gmHttp.post(this._signUrl("https://yun.123pan.com/b/api/v2/offline_download/task/submit"),{resource_list:[{resource_id:mt.id,select_file_id:wt}]},{Authorization:"Bearer "+bt,"App-Version":"3",platform:"web"});return this.assertApiResult(jt,"提交失败"),{fileCount:wt.length,totalSize:yt}}catch(jt){throw jt&&jt.status===401||this.isTokenExpiredError(jt)?"TOKEN_EXPIRED":jt.message?"响应解析失败: "+jt.message:String(jt)}}formatSize(mt){if(!mt)return"0B";const bt=["B","KB","MB","GB","TB"];let wt=0,yt=mt;for(;yt>=1024&&wt<bt.length-1;)yt/=1024,wt++;return`${yt.toFixed(wt?2:0)}${bt[wt]}`}_crc32(mt){const bt=new Array(256);for(let yt=0;yt<256;yt++){let jt=yt;for(let xt=0;xt<8;xt++)jt=1&jt?3988292384^jt>>>1:jt>>>1;bt[yt]=jt}let wt=4294967295;for(let yt=0;yt<mt.length;yt++)wt=bt[(wt^mt.charCodeAt(yt))&255]^wt>>>8;return(wt^4294967295)>>>0}_signUrl(mt){const bt=["a","d","e","f","g","h","l","m","y","i","j","n","o","p","k","q","r","s","t","u","b","c","v","w","s","z"],wt=Math.round(1e7*Math.random()),yt=new Date,jt=new Date(yt.getTime()+6e4*yt.getTimezoneOffset()+288e5),xt=`${jt.getFullYear()}${String(jt.getMonth()+1).padStart(2,"0")}${String(jt.getDate()).padStart(2,"0")}${String(jt.getHours()).padStart(2,"0")}${String(jt.getMinutes()).padStart(2,"0")}`;let $t="";for(let Bt=0;Bt<xt.length;Bt++)$t+=bt[parseInt(xt[Bt])];const kt=this._crc32($t),_t=Math.floor(jt.getTime()/1e3),St=`${_t}|${wt}|${new URL(mt).pathname}|web|3|${kt}`,Tt=this._crc32(St),It=new URL(mt);return It.searchParams.set(String(kt),`${_t}-${wt}-${Tt}`),It.toString()}}class StatsPlugin extends X{getName(){return"StatsPlugin"}async initCss(){return` <style> .jhs-stats { height:100%; padding:var(--jhs-space-4); overflow:auto; } .jhs-stats__metrics { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); border-top:1px solid var(--jhs-border); border-left:1px solid var(--jhs-border); } .jhs-stats__metric { display:grid; gap:var(--jhs-space-1); padding:var(--jhs-space-4); border-right:1px solid var(--jhs-border); border-bottom:1px solid var(--jhs-border); background:var(--jhs-surface); } .jhs-stats__metric strong { color:var(--jhs-text); font-size:28px; line-height:1; } .jhs-stats__metric span { color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); } .jhs-stats__group { margin-top:var(--jhs-space-5); } .jhs-stats__group h3 { margin:0 0 var(--jhs-space-3); color:var(--jhs-text); font-size:var(--jhs-font-size-md); } .jhs-stats__rows { display:grid; gap:var(--jhs-space-2); } .jhs-stats__row { display:grid; grid-template-columns:90px minmax(0,1fr) 76px; align-items:center; gap:var(--jhs-space-3); min-height:32px; } .jhs-stats__label { overflow:hidden; color:var(--jhs-text-muted); font-size:var(--jhs-font-size-sm); text-align:right; text-overflow:ellipsis; white-space:nowrap; } .jhs-stats__track { height:10px; overflow:hidden; border-radius:var(--jhs-radius-pill); background:var(--jhs-surface-2); } .jhs-stats__bar { display:block; width:var(--jhs-value,0%); height:100%; border-radius:inherit; background:var(--jhs-bar,var(--jhs-accent)); } .jhs-stats__value { color:var(--jhs-text-faint); font-size:var(--jhs-font-size-xs); } @media (max-width:767px) { .jhs-stats__metrics { grid-template-columns:repeat(2,minmax(0,1fr)); } .jhs-stats__row { grid-template-columns:72px minmax(0,1fr) 58px; gap:var(--jhs-space-2); } } </style>`}async handle(){window.isListPage&&this.createBtn()}createBtn(){$("#newVideoBtn").after('<button type="button" id="statsBtn" class="jhs-btn jhs-btn--secondary"><span>统计</span></button>'),$("#statsBtn").on("click",(()=>this.openDialog()))}async openDialog(){const mt=await storageManager.getCarList(),bt=await storageManager.getFavoriteActressList(),wt=await storageManager.getBlacklist(),yt=mt.length,jt=await storageManager.getStatusMap(),xt={filter:jt[d].size,favorite:jt[h].size,hasDown:jt[g].size,hasWatch:jt[p].size},$t={};mt.forEach((Dt=>{Dt.names&&Dt.names.split(" ").forEach((Lt=>{Lt&&($t[Lt]=($t[Lt]||0)+1)}))}));const kt=Object.entries($t).sort(((Dt,Lt)=>Lt[1]-Dt[1])).slice(0,10),_t=kt[0]?.[1]||1,St=yt-xt.filter-xt.favorite-xt.hasDown-xt.hasWatch,Tt=await storageManager.getCarMap(),It=this.getBean("NewVideoPlugin");let Bt=0;bt.forEach((Dt=>{It&&(Bt+=It.getPendingNewVideoCount(Dt,Tt))}));const Pt=[["总记录",yt],["已收藏",xt.favorite],["已下载",xt.hasDown],["已观看",xt.hasWatch],["已屏蔽",xt.filter],["待鉴定",St],["收藏演员",bt.length],["黑名单演员",wt.length],["新作品待看",Bt]],Mt=[["已收藏",xt.favorite,"var(--jhs-status-fav)"],["已下载",xt.hasDown,"var(--jhs-status-down)"],["已观看",xt.hasWatch,"var(--jhs-status-watch)"],["已屏蔽",xt.filter,"var(--jhs-status-filter)"],["待鉴定",St,"var(--jhs-border-strong)"]],At=(Dt,Lt,Et,Ht)=>`<div class="jhs-stats__row"><span class="jhs-stats__label" title="${escapeHtml(Dt)}">${escapeHtml(Dt)}</span><span class="jhs-stats__track"><span class="jhs-stats__bar" data-width="${Et?Math.round(Lt/Et*100):0}" data-color="${Ht}"></span></span><span class="jhs-stats__value">${Lt}${Et===yt&&yt?` (${Math.round(Lt/yt*100)}%)`:""}</span></div>`,Nt=`<div class="jhs-stats jhs-scrollbar jhs-ui"> <div class="jhs-stats__metrics">${Pt.map((Dt=>`<div class="jhs-stats__metric"><strong>${Dt[1]}</strong><span>${Dt[0]}</span></div>`)).join("")}</div> <section class="jhs-stats__group"><h3>状态分布</h3><div class="jhs-stats__rows">${Mt.map((Dt=>At(Dt[0],Dt[1],yt,Dt[2]))).join("")}</div></section> ${kt.length?`<section class="jhs-stats__group"><h3>Top 10 演员</h3><div class="jhs-stats__rows">${kt.map((Dt=>At(Dt[0],Dt[1],_t,"var(--jhs-accent)"))).join("")}</div></section>`:""} </div>`;layer.open({type:1,title:"收藏统计",content:Nt,scrollbar:!1,area:utils.getDialogArea("lg"),anim:-1,success:(Dt,Lt)=>{$(Dt).find(".jhs-stats__bar").each((function(){$(this).css({"--jhs-value":`${$(this).data("width")}%`,"--jhs-bar":$(this).data("color")})})),utils.setupEscClose(Lt)}})}}class MobileBottomBarPlugin extends X{constructor(){super(...arguments),this._fabGeneration=0}getName(){return"MobileBottomBarPlugin"}shouldSkipOnMobile(){return!1}async initCss(){return` /* FAB 浮动操作按钮 */ #jhs-fab { position: fixed; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); right: 20px; width: 56px; height: 56px; border-radius: 50%; background: var(--jhs-status-fav); color: var(--jhs-status-fav-on); font-size: 26px; display: flex; align-items: center; justify-content: center; cursor: pointer; z-index: 10002; box-shadow: var(--jhs-shadow-md); transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1), box-shadow 0.3s; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; } #jhs-fab:active { transform: scale(0.9); } #jhs-fab.jhs-fab-open { transform: rotate(135deg); background: var(--jhs-status-filter); color: var(--jhs-status-filter-on); box-shadow: var(--jhs-shadow-md); } /* FAB 遮罩 */ .jhs-fab-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,0.25); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.3s; } .jhs-fab-backdrop.jhs-fab-backdrop-visible { opacity: 1; pointer-events: auto; } /* FAB 菜单 */ .jhs-fab-menu { position: fixed; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); right: 16px; z-index: 10001; display: flex; flex-direction: column; gap: 10px; align-items: flex-end; opacity: 0; transform: translateY(16px) scale(0.92); pointer-events: none; transition: opacity 0.25s, transform 0.25s cubic-bezier(0.32, 0.72, 0, 1); } .jhs-fab-menu.jhs-fab-menu-open { opacity: 1; transform: translateY(0) scale(1); pointer-events: auto; } /* FAB 菜单分组 */ .jhs-fab-group { display: flex; flex-direction: column; gap: 10px; align-items: flex-end; } .jhs-fab-divider { width: 32px; height: 2px; background: var(--jhs-border); border-radius: 1px; align-self: flex-end; margin: 2px 0; } /* FAB 菜单项 */ .jhs-fab-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: var(--jhs-surface); border-radius: 24px; box-shadow: var(--jhs-shadow-md); cursor: pointer; white-space: nowrap; min-height: 44px; font-size: 14px; font-weight: 500; color: var(--jhs-text); opacity: 0; transform: translateY(8px) scale(0.92); transition: opacity 0.2s, transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), background 0.15s; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; } .jhs-fab-menu-item.jhs-fab-item-visible { opacity: 1; transform: translateY(0) scale(1); transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.32, 0.72, 0, 1), background 0.15s; } .jhs-fab-menu-item:active { transform: scale(0.95); background: var(--jhs-surface-2); } /* FAB 状态色块 */ .jhs-fab-status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; background: var(--jhs-border-strong); } @media (min-width: 769px) { #jhs-fab, .jhs-fab-menu, .jhs-fab-backdrop { display: none !important; } } .jhs-page-commandbar { display: flex; align-items: center; justify-content: space-between; gap: var(--jhs-space-3); width: 100%; margin: var(--jhs-space-3) 0; } .jhs-commandbar__left, .jhs-commandbar__right, .jhs-commandbar__primary, .jhs-commandbar__filters, .jhs-commandbar__context, .jhs-commandbar__view { display: flex; align-items: center; gap: var(--jhs-space-1); min-width: 0; white-space: nowrap; } .jhs-commandbar__left { flex: 1 1 auto; } .jhs-commandbar__right { flex: 0 0 auto; } .jhs-commandbar__filters { overflow-x: auto; } .jhs-commandbar__batch, .jhs-commandbar__more, .jhs-sort-control { position:relative; } .jhs-commandbar__menu { min-width:220px; } .jhs-commandbar__menu .jhs-btn, .jhs-sort-menu .jhs-btn { width:100%; justify-content:flex-start; } .jhs-commandbar__sort-label { color:var(--jhs-text-muted); font-size:14px; } @media (max-width: 1023px) { .jhs-page-commandbar { overflow-x: auto; } } @media (max-width: 768px) { .jhs-page-commandbar { display: none; } } `}async handle(){const mt=new DetailWorkspacePlugin;if(mt.pluginManager=this.pluginManager,H(await mt.initCss()),await mt.handle(),!utils.isMobileMode())return;const bt=$('<div class="jhs-fab-backdrop"></div>').appendTo("body"),wt=this.createMenu();$("body").append(wt);const yt=$('<div id="jhs-fab">+</div>').appendTo("body");this.bindEvents(yt,bt)}async afterPluginsReady(){this.buildCommandBar()}buildCommandBar(){if(!window.isListPage||$("#jhs-page-commandbar").length)return;const mt=$(` <div id="jhs-page-commandbar" class="jhs-page-commandbar jhs-ui" role="toolbar" aria-label="JHS 页面工具"> <div class="jhs-commandbar__left"></div> <div class="jhs-commandbar__right"></div> </div>`),bt=r?$(this.getSelector().boxSelector).first():$(".masonry").first();if(!bt.length)return void clog.warn("JHS 页面工具栏未创建:列表容器尚未就绪");bt.before(mt);const wt=mt.find(".jhs-commandbar__left"),yt=mt.find(".jhs-commandbar__right"),jt=$('<div class="jhs-commandbar__primary"></div>');["#waitCheckBtn","#newVideoBtn","#historyBtn"].forEach((It=>{const Bt=$(It).first();Bt.length&&Bt.attr("class","jhs-btn jhs-btn--secondary").removeAttr("role tabindex").detach().appendTo(jt)})),jt.children().length&&wt.append(jt);const xt=$('<div class="jhs-commandbar__more"><button type="button" class="jhs-btn jhs-btn--secondary jhs-commandbar__menu-toggle" aria-haspopup="menu" aria-expanded="false">更多</button><div class="jhs-popover jhs-commandbar__menu" role="menu"></div></div>');["#statsBtn","#blacklistBtn"].forEach((It=>{const Bt=$(It).first();Bt.length&&Bt.attr({class:"jhs-btn jhs-btn--ghost",role:"menuitem",tabindex:"-1"}).detach().appendTo(xt.find(".jhs-commandbar__menu"))})),xt.find(".jhs-commandbar__menu").children().length&&wt.append(xt);const $t=$("#jhs-quick-filter .jhs-segmented__item");if($t.length){const It=$('<div class="jhs-commandbar__filters jhs-segmented" role="tablist" aria-label="状态筛选"></div>');$t.each((function(){$(this).attr({class:`jhs-segmented__item${$(this).hasClass("active")?" active":""}`,role:"tab","aria-selected":$(this).hasClass("active")?"true":"false",tabindex:$(this).hasClass("active")?"0":"-1"}).detach().appendTo(It)})),wt.append(It)}$("#jhs-quick-filter").remove();const kt=$("#addBlacklistBtn").first();kt.length&&kt.attr("class","jhs-btn jhs-btn--secondary").removeAttr("role tabindex").detach().appendTo($('<div class="jhs-commandbar__context"></div>').appendTo(yt));const _t=$(".jhs-sort-control").first();if(_t.length){const It=$('<label class="jhs-commandbar__view"><span class="jhs-commandbar__sort-label">排序</span></label>');_t.detach().appendTo(It),yt.append(It)}const St=$('<div class="jhs-commandbar__batch"><button type="button" class="jhs-btn jhs-btn--secondary jhs-commandbar__menu-toggle" aria-haspopup="menu" aria-expanded="false">批量操作</button><div class="jhs-popover jhs-commandbar__menu" role="menu"></div></div>');["#filterAllVideo","#favoriteAllVideo","#hasDownAllVideo"].forEach((It=>{const Bt=$(It).first();Bt.length&&Bt.attr({class:"jhs-btn jhs-btn--ghost",role:"menuitem",tabindex:"-1"}).detach().appendTo(St.find(".jhs-commandbar__menu"))})),St.find(".jhs-commandbar__menu").children().length&&yt.append(St),$(".jhs-list-btn-row").filter((function(){return!$(this).children().length})).remove(),mt.find(".jhs-commandbar__more, .jhs-commandbar__batch").each((function(){const It=$(this),Bt=It.find(".jhs-commandbar__menu-toggle"),Pt=It.find(".jhs-commandbar__menu");Bt.on("click",(Mt=>{Mt.stopPropagation();const At=!Pt.hasClass("is-open");mt.find(".jhs-commandbar__menu").removeClass("is-open"),mt.find(".jhs-commandbar__menu-toggle").attr("aria-expanded","false"),Pt.toggleClass("is-open",At),Bt.attr("aria-expanded",String(At)),At&&Pt.children().first().trigger("focus")})),Pt.on("keydown","[role='menuitem']",(Mt=>{const At=Pt.find("[role='menuitem']"),Nt=At.index(Mt.currentTarget);if(Mt.key==="Escape")return Mt.preventDefault(),Pt.removeClass("is-open"),Bt.attr("aria-expanded","false").trigger("focus");if(!["ArrowDown","ArrowUp","Home","End"].includes(Mt.key))return;Mt.preventDefault();const Dt=Mt.key==="Home"?0:Mt.key==="End"?At.length-1:Mt.key==="ArrowDown"?(Nt+1)%At.length:(Nt-1+At.length)%At.length;At.eq(Dt).trigger("focus")})).on("click","[role='menuitem']",(()=>{Pt.removeClass("is-open"),Bt.attr("aria-expanded","false")}))})),$(document).off("click.jhsCommandbar").on("click.jhsCommandbar",(It=>{$(It.target).closest(".jhs-commandbar__more, .jhs-commandbar__batch").length||(mt.find(".jhs-commandbar__menu").removeClass("is-open"),mt.find(".jhs-commandbar__menu-toggle").attr("aria-expanded","false"))}));const Tt=this.getBean("ListPagePlugin");mt.find(".jhs-commandbar__filters").on("click","[role='tab']",(function(){$(this).siblings().removeClass("active").attr({"aria-selected":"false",tabindex:"-1"}),$(this).addClass("active").attr({"aria-selected":"true",tabindex:"0"});const It=$(this).data("jhs-filter");Tt.activeQuickFilter=It,Tt.applyQuickFilter(It)})).on("keydown","[role='tab']",(It=>{if(!["ArrowLeft","ArrowRight","Home","End"].includes(It.key))return;It.preventDefault();const Bt=mt.find("[role='tab']"),Pt=Bt.index(It.currentTarget),Mt=It.key==="Home"?0:It.key==="End"?Bt.length-1:It.key==="ArrowRight"?(Pt+1)%Bt.length:(Pt-1+Bt.length)%Bt.length;Bt.eq(Mt).trigger("click").trigger("focus")}))}getCarNum(){try{const mt=this.getBean("DetailPageButtonPlugin");if(mt?.parseMovieId)return mt.parseMovieId(location.href);const bt=document.querySelector(".header, #video_id, .video-id");if(bt)return bt.textContent.trim()}catch{}return null}createMenu(){const mt=window.isListPage,bt=window.isDetailPage;let wt="";if(mt){const yt=localStorage.getItem("jhs_sortMethod")||"default";wt=` <div class="jhs-fab-group"> <div class="jhs-fab-menu-item" data-action="check">待鉴定</div> <div class="jhs-fab-menu-item" data-action="newVideo">新作品</div> <div class="jhs-fab-menu-item" data-action="blacklist">黑名单</div> <div class="jhs-fab-menu-item" data-action="sort">排序: ${{default:"默认",rateCount:"评价人数",date:"时间"}[yt]}</div> </div> <div class="jhs-fab-divider"></div> <div class="jhs-fab-group"> <div class="jhs-fab-menu-item" data-action="setting">设置</div> </div> `}else bt?wt=` <div class="jhs-fab-group"> ${[{action:"filter",icon:m,label:"屏蔽",key:"filter"},{action:"fav",icon:v,label:"收藏",key:"fav"},{action:"down",icon:y,label:"已下载",key:"down"},{action:"watch",icon:k,label:"已观看",key:"watch"}].map(jt=>`<div class="jhs-fab-menu-item" data-action="${jt.action}" data-label="${jt.label}"><span class="jhs-fab-status-dot" data-status-key="${jt.key}"></span>${jt.icon}</div>`).join("")} </div> <div class="jhs-fab-divider"></div> <div class="jhs-fab-group"> <div class="jhs-fab-menu-item" data-action="magnetFilter">磁力过滤</div> <div class="jhs-fab-menu-item" data-action="magnet">磁力搜索</div> <div class="jhs-fab-menu-item" data-action="subtitle">字幕</div> </div> <div class="jhs-fab-divider"></div> <div class="jhs-fab-group"> <div class="jhs-fab-menu-item" data-action="setting">设置</div> </div> `:wt=` <div class="jhs-fab-group"> <div class="jhs-fab-menu-item" data-action="setting">设置</div> </div> `;return $(`<div class="jhs-fab-menu">${wt}</div>`)}async refreshDetailStatus(){try{const mt=this.getCarNum();if(!mt)return;const bt=await storageManager.getCar(mt),wt=$(".jhs-fab-menu"),yt={filter:"var(--jhs-status-filter)",fav:"var(--jhs-status-fav)",down:"var(--jhs-status-down)",watch:"var(--jhs-status-watch)"},jt={[d]:"filter",[h]:"fav",[g]:"down",[p]:"watch"};let xt=null;bt?.status&&jt[bt.status]&&(xt=jt[bt.status]),wt.find(".jhs-fab-status-dot").each(function(){const $t=$(this).data("status-key"),kt=$(this).closest(".jhs-fab-menu-item");$t===xt?$(this).css({background:yt[$t]||"var(--jhs-border-strong)"}):$(this).css({background:"var(--jhs-border-strong)"})})}catch{}}bindEvents(mt,bt){const wt=$(".jhs-fab-menu"),yt=()=>{this._fabGeneration++,mt.removeClass("jhs-fab-open"),wt.removeClass("jhs-fab-menu-open"),bt.removeClass("jhs-fab-backdrop-visible"),wt.find(".jhs-fab-menu-item").removeClass("jhs-fab-item-visible")},jt=()=>{if(mt.hasClass("jhs-fab-open"))yt();else{if(mt.addClass("jhs-fab-open"),wt.addClass("jhs-fab-menu-open"),bt.addClass("jhs-fab-backdrop-visible"),window.isListPage){const St=localStorage.getItem("jhs_sortMethod")||"default",Tt={default:"默认",rateCount:"评价人数",date:"时间"}[St];wt.find('[data-action="sort"]').html(`排序: ${Tt}`)}window.isDetailPage&&this.refreshDetailStatus();const $t=++this._fabGeneration,kt=this;wt.find(".jhs-fab-menu-item").each(function(St){const Tt=$(this);setTimeout(()=>{$t===kt._fabGeneration&&Tt.addClass("jhs-fab-item-visible")},30+St*35)})}};mt.on("click",jt),bt.on("click",yt),wt.on("click",".jhs-fab-menu-item",xt=>{const $t=$(xt.currentTarget).data("action");this.handleAction($t),yt()})}handleAction(mt){switch(mt){case"check":$("#waitCheckBtn").length&&$("#waitCheckBtn").click();break;case"newVideo":this.getBean("NewVideoPlugin")?.openDialog();break;case"blacklist":this.getBean("BlacklistPlugin")?.openBlacklistDialog();break;case"sort":{const bt=localStorage.getItem("jhs_sortMethod")||"default",wt=bt==="default"?"rateCount":bt==="rateCount"?"date":"default";localStorage.setItem("jhs_sortMethod",wt),this.getBean("ListPageButtonPlugin")?.sortItems?.();const jt={default:"默认",rateCount:"评价人数",date:"时间"}[wt];show.info(`排序: ${jt}`);break}case"filter":$("#filterBtn").length&&$("#filterBtn").click();break;case"fav":$("#favoriteBtn").length&&$("#favoriteBtn").click();break;case"down":$("#hasDownBtn").length&&$("#hasDownBtn").click();break;case"watch":$("#hasWatchBtn").length&&$("#hasWatchBtn").click();break;case"magnetFilter":$("#enable-magnets-filter").length&&$("#enable-magnets-filter").click();break;case"magnet":$("#magnetSearchBtn").length&&$("#magnetSearchBtn").click();break;case"subtitle":$("#search-subtitle-btn").length&&$("#search-subtitle-btn").click();break;case"setting":this.getBean("SettingPlugin")?.openSettingDialog();break}}}class DetailWorkspacePlugin extends X{getName(){return"DetailWorkspacePlugin"}async initCss(){return` <style> .jhs-detail-workspace { display:grid; width:min(100%,1440px); margin:0 auto; padding:var(--jhs-space-4); color:var(--jhs-text); background:var(--jhs-surface); } .jhs-detail-workspace.movie-detail-container { height:100%; margin:0; overflow-y:auto; } .jhs-detail-workspace__section { min-width:0; padding:var(--jhs-space-5) 0; border-top:1px solid var(--jhs-border); } .jhs-detail-workspace__section:first-child { padding-top:0; border-top:0; } .jhs-detail-workspace__section:not(.has-content) { display:none; } .jhs-detail-workspace__header { display:flex; min-height:var(--jhs-control-height); align-items:center; justify-content:space-between; gap:var(--jhs-space-3); margin-bottom:var(--jhs-space-3); } .jhs-detail-workspace__header h2 { margin:0; color:var(--jhs-text); font-size:var(--jhs-font-size-xl); font-weight:700; } .jhs-detail-workspace__actions { display:flex; align-items:center; gap:var(--jhs-space-2); } .jhs-detail-workspace__content { min-width:0; } .jhs-detail-summary { display:grid; grid-template-columns:minmax(220px,280px) minmax(0,1fr); align-items:start; gap:var(--jhs-space-5); } .jhs-detail-summary__media, .jhs-detail-summary__info { min-width:0; } .jhs-detail-summary__media img { width:100%; height:auto; border-radius:var(--jhs-radius-md); } .jhs-detail-title { display:-webkit-box; overflow:hidden; margin:0 0 var(--jhs-space-2); color:var(--jhs-text); font-size:clamp(20px,2vw,24px); line-height:1.3; -webkit-box-orient:vertical; -webkit-line-clamp:2; } .jhs-detail-summary__info .translated-title { margin:0 0 var(--jhs-space-3); color:var(--jhs-text); font-size:clamp(16px,1.5vw,18px); font-weight:500; line-height:1.5; } .jhs-detail-summary__actions { grid-column:1/-1; } .jhs-detail-host-action { display:inline-flex!important; min-height:var(--jhs-control-height)!important; align-items:center!important; justify-content:center!important; padding:0 var(--jhs-space-3)!important; border:1px solid var(--jhs-border)!important; border-radius:var(--jhs-radius-sm)!important; background:var(--jhs-surface)!important; color:var(--jhs-text)!important; box-shadow:none!important; font:inherit!important; font-size:var(--jhs-font-size-sm)!important; font-weight:600!important; line-height:1!important; text-decoration:none!important; } .jhs-detail-host-action:hover { border-color:var(--jhs-accent)!important; background:var(--jhs-surface-2)!important; color:var(--jhs-accent)!important; } .jhs-detail-workspace .jhs-detail-btn-row { margin:0 !important; } .jhs-detail-workspace [data-jhs-section-content="gallery"] .tile-images, .jhs-detail-workspace [data-jhs-section-content="gallery"] #sample-waterfall, .jhs-detail-workspace [data-jhs-section-content="gallery"] .movie-gallery, .jhs-detail-workspace [data-jhs-section-content="resources"] #magnets-content, .jhs-detail-workspace [data-jhs-section-content="resources"] #magnet-table { margin:0; } .jhs-detail-workspace [data-jhs-section-content="resources"] :is(#magnets-content,#magnet-table,.video-panel) { border-radius:var(--jhs-radius-sm); } .jhs-detail-source--reflowed { display:none !important; } @media (max-width:767px) { .jhs-detail-workspace { padding:var(--jhs-space-3); } .jhs-detail-workspace__section { padding:var(--jhs-space-4) 0; } .jhs-detail-summary { grid-template-columns:1fr; } .jhs-detail-summary__media { width:min(100%,360px); margin:0 auto; } .jhs-detail-summary__actions { grid-column:auto; } } </style>`}async handle(){!window.isDetailPage||new URLSearchParams(window.location.search).get("hideNav")!=="1"||utils.loopDetector((()=>!!this.getAdapter()),(()=>this.buildWorkspace()),40,2500,!0)}getAdapter(){if(r){const mt=$(".video-detail").first(),bt=mt.find(".column-video-cover").first(),wt=mt.find(".column-video-info").first();return mt.length&&bt.length&&wt.length?{site:"javdb",root:mt,cover:bt,info:wt,title:$()}:null}if(l){const mt=$(".screencap").first(),bt=$(".info").first(),wt=mt.closest(".container"),yt=wt.find("h3").first();return wt.length&&mt.length&&bt.length?{site:"javbus",root:wt,cover:mt,info:bt,title:yt}:null}return null}buildWorkspace(){if($("#jhs-detail-workspace").length)return;const mt=this.getAdapter();if(!mt){clog.warn("详情工作区未启用:关键宿主节点缺失,已保留原页面布局");return}const bt=$(` <main id="jhs-detail-workspace" class="jhs-detail-workspace jhs-ui" data-site="${mt.site}"> ${this.section("summary","影片概览")} ${this.section("gallery","预览与剧照")} ${this.section("resources","资源")} ${this.section("related","相关清单")} ${this.section("reviews","评论")} </main>`),wt=bt.find('[data-jhs-section-content="summary"]'),yt=$('<div class="jhs-detail-summary"><div class="jhs-detail-summary__media"></div><div class="jhs-detail-summary__info"></div><div class="jhs-detail-summary__actions"></div></div>');wt.append(yt),mt.title.length&&yt.find(".jhs-detail-summary__info").append(mt.title),yt.find(".jhs-detail-summary__media").append(mt.cover),yt.find(".jhs-detail-summary__info").append(mt.info),this.normalizeHostActions(mt.info),(mt.title.length?mt.title:yt.find(".origin-title, .current-title, h3").first()).addClass("jhs-detail-title"),bt.find('[data-jhs-section="summary"]').addClass("has-content"),mt.site==="javdb"?bt.insertBefore(mt.root):mt.root.prepend(bt),this.routeSections(bt,mt.root),mt.site==="javdb"&&mt.root.addClass("jhs-detail-source--reflowed");let xt=null;const $t=new MutationObserver((()=>{xt||(xt=requestAnimationFrame((()=>{if(xt=null,!bt[0]?.isConnected)return void $t.disconnect();this.routeSections(bt,mt.root)})))}));mt.root[0]&&$t.observe(mt.root[0],{childList:!0,subtree:!0})}normalizeHostActions(mt){const bt=new Set(["想看","看过","看過","存入清单","存入清單","下载","下載","订正","訂正"]);mt.find("a, button").filter((function(){return!$(this).is(".jhs-btn, [id^='jhs-']")&&bt.has($(this).text().replace(/\s+/g," ").trim())})).addClass("jhs-detail-host-action")}section(mt,bt){return`<section class="jhs-detail-workspace__section" data-jhs-section="${mt}" aria-labelledby="jhs-detail-${mt}-title"><header class="jhs-detail-workspace__header"><h2 id="jhs-detail-${mt}-title">${bt}</h2><div class="jhs-detail-workspace__actions" data-jhs-section-actions="${mt}"></div></header><div class="jhs-detail-workspace__content" data-jhs-section-content="${mt}"></div></section>`}routeSections(mt,bt){this.moveToSection(mt,"gallery",[".tile-images",".preview-images","#sample-waterfall",".movie-gallery"]),this.moveToSection(mt,"resources",[".jhs-detail-btn-row","#magnets-content","#magnet-table","#mag-submit-show",".movie-panel-info"]),this.movePanelToSection(mt,"related",".jhs-related-panel"),this.movePanelToSection(mt,"reviews",".jhs-review-panel"),this.moveToSection(mt,"related",["#related-content"]),this.moveToSection(mt,"reviews",["#reviews-content"]);const wt=mt.find(".jhs-detail-summary__actions"),yt=mt.find('[data-jhs-section-content="resources"] > .jhs-detail-btn-row').first();yt.length&&wt.append(yt),wt.children().length&&mt.find('[data-jhs-section="summary"]').addClass("has-content"),bt.find(".jhs-detail-source--reflowed").removeClass("jhs-detail-source--reflowed")}movePanelToSection(mt,bt,wt){const yt=mt.find(`[data-jhs-section-content="${bt}"]`),jt=mt.find(`[data-jhs-section-actions="${bt}"]`),xt=mt.find(`[data-jhs-section="${bt}"]`);$(wt).each((function(){const $t=$(this);if($t.closest(".layui-layer").length||$t.closest(yt).length)return;const kt=$t.find(".jhs-panel-toggle").first().detach();kt.length&&jt.empty().append(kt),$t.find(".jhs-panel-header").remove(),yt.append($t)})),yt.children().length&&xt.addClass("has-content")}moveToSection(mt,bt,wt){const yt=mt.find(`[data-jhs-section-content="${bt}"]`),jt=mt.find(`[data-jhs-section="${bt}"]`);wt.forEach((xt=>{$(xt).each((function(){const $t=$(this);$t.closest(".layui-layer").length||$t.closest(mt).length||yt.append($t)}))})),yt.children().length&&jt.addClass("has-content")}}function adoptOwnedDetailPanels(Ct,mt){let bt=null;const wt=()=>{for(const[jt,xt]of Object.entries(mt)){const $t=Ct.find(`[data-jhs-section="${jt}"]`),kt=$t.find(`[data-jhs-section-content="${jt}"]`),_t=$t.find(`[data-jhs-section-actions="${jt}"]`),St=kt.find(xt).first();if(!St.length)continue;const Tt=St.find(".jhs-panel-toggle").first().detach();Tt.length&&_t.empty().append(Tt),St.find(".jhs-panel-header").remove(),$t.addClass("has-content")}};wt();const yt=new MutationObserver((()=>{bt||(bt=requestAnimationFrame((()=>{if(bt=null,!Ct[0]?.isConnected)return void yt.disconnect();wt()})))}));Ct[0]&&yt.observe(Ct[0],{childList:!0,subtree:!0})}function organizeJhsOwnedDetailWorkspace(Ct){if(!Ct?.length||Ct.attr("data-jhs-organized"))return;const mt=Ct.children().detach();Ct.attr("data-jhs-organized","true").addClass("jhs-detail-workspace jhs-ui").attr("data-site","fc2").empty();const bt=(Pt,Mt,At=!1)=>$(`<section class="jhs-detail-workspace__section ${At?"has-content":""}" data-jhs-section="${Pt}"><header class="jhs-detail-workspace__header"><h2>${Mt}</h2><div class="jhs-detail-workspace__actions" data-jhs-section-actions="${Pt}"></div></header><div class="jhs-detail-workspace__content" data-jhs-section-content="${Pt}"></div></section>`),wt=bt("summary","影片概览",!0),yt=bt("gallery","预览与剧照"),jt=bt("resources","资源",!0),xt=bt("related","相关清单",!0),$t=bt("reviews","评论",!0);Ct.append(wt,yt,jt,xt,$t);const kt=wt.find('[data-jhs-section-content="summary"]'),_t=jt.find('[data-jhs-section-content="resources"]'),St=mt.filter(".movie-info-container"),Tt="#filterBtn, #favoriteBtn, #hasDownBtn, #hasWatchBtn, #enable-magnets-filter, #search-subtitle-btn, #xunLeiSubtitleBtn, #magnetSearchBtn",It=mt.find(Tt).addBack(Tt);if(kt.append(St),St.find(".origin-title, .current-title, .movie-title, h3").first().addClass("jhs-detail-title"),It.length){const Pt=$('<div class="jhs-detail-btn-row" role="toolbar" aria-label="影片状态操作"></div>');It.each((function(){Pt.append($(this).removeAttr("style").addClass("jhs-btn"))})),kt.append(Pt)}_t.append(mt.filter(".movie-panel-info, .video-panel")),_t.find("#magnets-content").length||_t.append(mt.filter("#magnets-content")),xt.find('[data-jhs-section-content="related"]').append(mt.filter("#related-content")),$t.find('[data-jhs-section-content="reviews"]').append(mt.filter("#reviews-content")),Ct.append(mt.filter("#data-actress").removeAttr("style").addClass("jhs-is-hidden"));const Bt=()=>{const Pt=St.find(".movie-gallery").first();return Pt.length?(yt.find('[data-jhs-section-content="gallery"]').append(Pt),yt.addClass("has-content"),!0):!1};if(!Bt()&&St[0]){const Pt=new MutationObserver((()=>{Bt()&&Pt.disconnect()}));Pt.observe(St[0],{childList:!0,subtree:!0})}adoptOwnedDetailPanels(Ct,{related:".jhs-related-panel",reviews:".jhs-review-panel"})}const DEFAULT_JAVDB_PLUGINS=[Ie,Be,le,de,Ce,xe,Ae,fe,pe,ue,Ee,Ue,Oe,Q,$e,He,ye,ce,ae,ke,he,be,Ze,ze,Re,Ve,Se,Xe,pt,et,StatsPlugin,MobileBottomBarPlugin],DEFAULT_JAVBUS_PLUGINS=[Ie,Ce,Ae,xe,Be,Ee,Fe,Ue,Qe,we,ye,$e,ke,ce,je,Re,Ve,be,Ze,Se,et,StatsPlugin,MobileBottomBarPlugin],DEFAULT_SHARED_PLUGIN_RULES=[{shouldRegister:Ct=>r||l||Ct.includes("123pan.com"),plugins:[OneTwoThreeOfflinePlugin]},{shouldRegister:Ct=>Ct.includes("javtrailers"),plugins:[oe]},{shouldRegister:Ct=>Ct.includes("subtitlecat"),plugins:[re]}];function registerPluginGroup(Ct,mt){mt.forEach((bt=>Ct.register(bt)))}function registerSitePlugins(Ct,mt=window.location.hostname){DEFAULT_SHARED_PLUGIN_RULES.forEach((bt=>{bt.shouldRegister(mt)&®isterPluginGroup(Ct,bt.plugins)})),r&®isterPluginGroup(Ct,DEFAULT_JAVDB_PLUGINS),l&®isterPluginGroup(Ct,DEFAULT_JAVBUS_PLUGINS)}const ut=layer.close;layer.close=function(Ct){const mt=ut.call(this,Ct);return(function(bt=10){setTimeout((()=>{const wt=document.querySelectorAll(".layui-layer-shade").length;document.documentElement.style.overflow=wt>0?"hidden":""}),bt)})(),mt};const ft=layer.open;layer.open=function(Ct){const mt=(Ct=Ct||{}).success;return Ct.success=function(bt,wt){typeof mt=="function"&&mt.call(this,bt,wt),utils.setupEscClose(wt)},ft.call(this,Ct)},utils.importResource("https://cdn.jsdelivr.net/npm/[email protected]/layer.min.css"),utils.importResource("https://cdn.jsdelivr.net/npm/[email protected]/src/toastify.min.css"),utils.importResource("https://cdn.jsdelivr.net/npm/[email protected]/dist/viewer.min.css"),utils.importResource("https://cdn.jsdelivr.net/npm/[email protected]/dist/css/tabulator_semanticui.min.css");const vt=(function(){const Ct=new Y;return unsafeWindow.pluginManager=Ct,registerSitePlugins(Ct),Ct})();(async function(){window.isDetailPage=(function(){let mt=window.location.href;return r?mt.split("?")[0].includes("/v/"):!!l&&$("#magnet-table").length>0})(),window.isListPage=(function(){let mt=window.location.href;return r?$(".movie-list").length>0||mt.includes("advanced_search"):!!l&&$(".masonry > div .item").length>0})(),window.isFc2Page=(function(){let mt=window.location.href;return mt.includes("advanced_search?type=3")||mt.includes("advanced_search?type=100")})();const Ct=(async()=>{await storageManager.getDataVersion()<CURRENT_DATA_VERSION&&(await storageManager.merge_table_name(),await storageManager.clean_no_url_blacklist(),await storageManager.async_merge_other(),await storageManager.merge_blacklist(),await storageManager.merge_favoriteActress(),await storageManager.merge_tow_car_list_table(),await storageManager.setDataVersion(CURRENT_DATA_VERSION))})();await Promise.all([vt.processCss(),Ct,applyTheme()]),r&&/(^|;)\s*locale\s*=\s*en\s*($|;)/i.test(document.cookie)&&show.error("请切换到中文语言下才可正常使用本脚本",{duration:-1}),await vt.processPlugins()})().catch((Ct=>console.error("[JHS] bootstrap failed:",Ct)));