// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.5.0 // @author magicdawn // @description 为B站首页添加像App一样的推荐 // @license MIT // @homepageURL https://github.com/magicdawn/bilibili-app-recommend // @supportURL https://github.com/magicdawn/bilibili-app-recommend/issues // @match *://www.bilibili.com/ // @match *://www.bilibili.com/?* // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png // @match https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?* // @require https://unpkg.com/axios@0.27.2/dist/axios.min.js // @require https://unpkg.com/axios-userscript-adapter@0.2.0/dist/axiosGmxhrAdapter.min.js // @require https://unpkg.com/react@18.2.0/umd/react.production.min.js // @require https://unpkg.com/react-dom@18.2.0/umd/react-dom.production.min.js // @connect app.bilibili.com // @connect passport.bilibili.com // @connect link.acg.tv // @connect www.mcbbs.net // @grant GM.xmlHttpRequest // @grant GM_deleteValue // @grant GM_getValue // @grant GM_setValue // @grant GM_xmlhttpRequest // @grant unsafeWindow // @downloadURL none // ==/UserScript== (o=>{const e=document.createElement("style");e.dataset.source="vite-plugin-monkey",e.innerText=o,document.head.appendChild(e)})(`._toast-container_9119l_1{position:fixed;top:50%;left:50%;z-index:999999;padding:12px 24px;font-size:14px;width:240px;margin-left:-120px;background:#ffb243;color:#fff;border-radius:6px}._expand-btn_wdzp9_1{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_wdzp9_1 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_wdzp9_1 svg._expanded_wdzp9_12{transform:rotate(0)}body.dark ._expand-btn_wdzp9_1{color:#eee!important;border-color:transparent!important;background-color:#333!important}body.dark ._expand-btn_wdzp9_1:hover{background-color:#555!important}._modal-mask_vh629_1{position:fixed;left:0;top:0;right:0;bottom:0;background-color:#00000080;z-index:11003;display:flex;align-items:center;justify-content:center}._modal_vh629_1{width:500px;max-height:calc(80vh - 50px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 15px 15px;display:flex;flex-direction:column}._modal_vh629_1 ._modal-header_vh629_23{padding-top:10px;padding-bottom:10px;border-bottom:none;display:flex;align-items:center}._modal_vh629_1 ._modal-header_vh629_23 ._modal-title_vh629_30{font-size:1.5rem;margin-bottom:0;line-height:1.5}._modal_vh629_1 ._modal-header_vh629_23 ._title-desc_vh629_35{margin-left:5px;font-size:40%}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{margin-left:10px}._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39 svg{width:10px;height:10px;margin-right:3px;margin-top:-1px}body.dark ._modal_vh629_1 ._modal-header_vh629_23 ._btn-close_vh629_39{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_vh629_1 ._modal-body_vh629_57{padding-top:0;flex-grow:1;overflow-y:scroll}._reason-list_vh629_62{display:flex;align-items:center;flex-wrap:wrap;justify-content:space-between}._reason_vh629_62{color:inherit;width:45%;text-align:center;line-height:20px;border:1px solid #eee;margin-top:8px;margin-bottom:8px;padding-top:5px;padding-bottom:5px}body.dark ._reason_vh629_62{border:1px solid #333}._bili-video-card_15xx7_1{position:relative}._image-wrapper_15xx7_4{border-radius:6px;overflow:hidden}._preview-card-wrapper_15xx7_8{position:absolute;top:0;left:0;right:0;bottom:0;z-index:2;overflow:hidden;border-top-left-radius:inherit;border-top-right-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0}._preview-card-wrapper_15xx7_8 ._preview-card-inner_15xx7_21{width:100%;height:100%}._watch-later_15xx7_25{z-index:3}._badge_15xx7_28{color:#fa6a9d;border-radius:2px;border:1px #fa6a9d solid;line-height:20px;padding:0 10px;transform:scale(.8)}._recommend-reason_15xx7_36{text-overflow:ellipsis;overflow:hidden;white-space:nowrap;display:inline-block;color:var(--Or5);background-color:var(--Or1);border-radius:4px;margin-right:4px;font-size:var(--follow-icon-font-size);line-height:var(--follow-icon-line-height);height:var(--follow-icon-line-height);padding:0 4px;cursor:default}._bangumi-desc_15xx7_51{color:default}._btn-dislike_15xx7_54{display:flex;align-items:center;justify-content:center;position:absolute;top:8px;left:8px;width:28px;height:28px;border-radius:6px;cursor:pointer;background-color:#212121cc;z-index:9;transform:translateZ(0)}._btn-dislike_15xx7_54 ._btn-dislike-icon_15xx7_69{pointer-events:none;user-select:none;width:12px;height:12px;color:#fff}._btn-dislike_15xx7_54 ._btn-dislike-tip_15xx7_76{pointer-events:none;user-select:none;position:absolute;bottom:-6px;left:-5px;transform:translateY(100%);font-size:12px;color:#fff;border-radius:4px;line-height:18px;padding:4px 8px;background-color:#000c;white-space:nowrap}._disliked-wrapper_15xx7_91{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;border-radius:6px;border:1px solid #eee}body.dark ._disliked-wrapper_15xx7_91{border:1px solid #333}._disliked-wrapper_15xx7_91 ._dislike-content-cover_15xx7_105{border-top-left-radius:6px;border-top-right-radius:6px;padding-top:56.25%;position:relative}._disliked-wrapper_15xx7_91 ._dislike-content-cover_15xx7_105 ._dislike-content-cover-inner_15xx7_111{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}._disliked-wrapper_15xx7_91 ._dislike-content-cover_15xx7_105 ._dislike-content-cover-inner_15xx7_111 ._dislike-icon_15xx7_122{color:inherit}._disliked-wrapper_15xx7_91 ._dislike-content-cover_15xx7_105 ._dislike-content-cover-inner_15xx7_111 ._dislike-reason_15xx7_125{font-size:20px;text-align:center}._disliked-wrapper_15xx7_91 ._dislike-content-cover_15xx7_105 ._dislike-content-cover-inner_15xx7_111 ._dislike-desc_15xx7_129{font-size:16px;text-align:center}._disliked-wrapper_15xx7_91 ._dislike-content-action_15xx7_133{flex:1;width:100%;border-top:1px solid #eee;display:flex;align-items:center;justify-content:center}body.dark ._disliked-wrapper_15xx7_91 ._dislike-content-action_15xx7_133{border-top:1px solid #333}._disliked-wrapper_15xx7_91 ._dislike-content-action_15xx7_133 button{font-size:18px;color:inherit}._modal-mask_1urmj_1{position:fixed;left:0;top:0;right:0;bottom:0;z-index:11000;background-color:#00000080;display:flex;align-items:center;justify-content:center}._modal-mask_1urmj_1._narrow-mode_1urmj_13{background-color:#000000e6}._modal_1urmj_1{width:calc(100vw - 30px);height:calc(100vh - 30px);border-radius:10px;overflow:hidden;background-color:#fff;padding:0 0 15px 15px;display:flex;flex-direction:column}body.dark ._modal_1urmj_1{border:1px solid #fb7299}._modal_1urmj_1._narrow-mode_1urmj_13{width:606px;height:calc(100vh - 10px);border:none}body.dark ._modal_1urmj_1._narrow-mode_1urmj_13{border:none}._modal_1urmj_1 ._modal-header_1urmj_38{padding-top:10px;padding-bottom:10px;border-bottom:none;padding-right:15px;display:flex;align-items:center}._modal_1urmj_1 ._modal-header_1urmj_38 ._modal-title_1urmj_46{font-size:1.5rem;margin-bottom:0;line-height:1.5}body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-refresh_1urmj_51,body.dark ._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{color:#eee!important;background-color:#333!important;border-color:transparent!important;height:auto;padding:8px 12px;line-height:16px;font-size:13px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52{margin-left:10px}._modal_1urmj_1 ._modal-header_1urmj_38 ._btn-close_1urmj_52 svg{width:10px;height:10px}._modal_1urmj_1 ._modal-body_1urmj_68{padding-top:0;flex-grow:1;overflow-y:scroll;padding-right:15px}._list_1urmj_74{color:inherit}._card_1urmj_77{border:2px solid transparent}._card_1urmj_77 .bili-video-card__info{padding-left:2px;padding-bottom:1px;margin-top:calc(var(--info-margin-top) - 1px)}._card_1urmj_77._active_1urmj_85{border-color:#fb7299;border-radius:6px;overflow:hidden}._video-card-list_1urmj_90{display:block!important}#_video-card-body_1urmj_1>*{display:block!important}#_video-card-body_1urmj_1._narrow-mode_1urmj_13{grid-template-columns:repeat(2,1fr)}._loader_1urmj_99{text-align:center;line-height:60px;font-size:120%}._checkbox_1urmj_104{margin-left:5px;margin-top:1px;cursor:pointer;outline:none}._checkbox_1urmj_104+label{margin-left:2px;user-select:none;cursor:pointer}._grid_svuzk_1{color:default;margin-bottom:20px}@media (min-width: 2200px){._video-card-list_svuzk_6.is-full{grid-column:span 7!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2{grid-column:span 7!important;grid-template-columns:repeat(7,1fr)!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2>*{display:block!important}._video-card-list_svuzk_6.is-full .video-card-body.more-class1.more-class2>*:nth-of-type(1n + 15){display:none!important}}._expand-btn_svuzk_20{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_svuzk_20 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_svuzk_20 svg._expanded_svuzk_31{transform:rotate(0)}.primary-btn[disabled]:active,.primary-btn[disabled]:hover{cursor:wait;background-color:inherit} `); var dh=Object.defineProperty;var hh=(g,J,pe)=>J in g?dh(g,J,{enumerable:!0,configurable:!0,writable:!0,value:pe}):g[J]=pe;var Sn=(g,J,pe)=>(hh(g,typeof J!="symbol"?J+"":J,pe),pe);(function(g,J,pe,ms){"use strict";const Be=e=>e&&typeof e=="object"&&"default"in e?e:{default:e},ze=Be(g),ys=Be(J),ft=Be(pe),bs=Be(ms);var _s=typeof global=="object"&&global&&global.Object===Object&&global;const Tn=_s;var ws=typeof self=="object"&&self&&self.Object===Object&&self,Ss=Tn||ws||Function("return this")();const Z=Ss;var Ts=Z.Symbol;const Q=Ts;var xn=Object.prototype,xs=xn.hasOwnProperty,Cs=xn.toString,Oe=Q?Q.toStringTag:void 0;function As(e){var t=xs.call(e,Oe),n=e[Oe];try{e[Oe]=void 0;var r=!0}catch{}var i=Cs.call(e);return r&&(t?e[Oe]=n:delete e[Oe]),i}var Es=Object.prototype,Os=Es.toString;function Ms(e){return Os.call(e)}var Ps="[object Null]",Rs="[object Undefined]",Cn=Q?Q.toStringTag:void 0;function Se(e){return e==null?e===void 0?Rs:Ps:Cn&&Cn in Object(e)?As(e):Ms(e)}function Te(e){return e!=null&&typeof e=="object"}var Ds="[object Symbol]";function We(e){return typeof e=="symbol"||Te(e)&&Se(e)==Ds}function Ls(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n0){if(++t>=ha)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function ma(e){return function(){return e}}var ya=function(){try{var e=ve(Object,"defineProperty");return e({},"",{}),e}catch{}}();const He=ya;var ba=He?function(e,t){return He(e,"toString",{configurable:!0,enumerable:!1,value:ma(t),writable:!0})}:Ks,_a=va(ba);const wa=_a;var Sa=9007199254740991,Ta=/^(?:0|[1-9]\d*)$/;function vt(e,t){var n=typeof e;return t=t==null?Sa:t,!!t&&(n=="number"||n!="symbol"&&Ta.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=Ma}function Pa(e){return e!=null&&yt(e.length)&&!Pn(e)}var Ra=Object.prototype;function Da(e){var t=e&&e.constructor,n=typeof t=="function"&&t.prototype||Ra;return e===n}function La(e,t){for(var n=-1,r=Array(e);++n-1}function Vo(e,t){var n=this.__data__,r=Ue(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function ie(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t0&&n(c)?t>1?Yn(c,t-1,n,r,i):Hn(i,c):r||(i[i.length]=c)}return i}function hc(e){var t=e==null?0:e.length;return t?Yn(e,1):[]}function pc(e){return wa(Oa(e,void 0,hc),e+"")}function gc(e,t,n){var r=-1,i=e.length;t<0&&(t=-t>i?0:i+t),n=n>i?i:n,n<0&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var s=Array(i);++r=r?e:gc(e,t,n)}var mc="\\ud800-\\udfff",yc="\\u0300-\\u036f",bc="\\ufe20-\\ufe2f",_c="\\u20d0-\\u20ff",wc=yc+bc+_c,Sc="\\ufe0e\\ufe0f",Tc="\\u200d",xc=RegExp("["+Tc+mc+wc+Sc+"]");function xt(e){return xc.test(e)}function Cc(e){return e.split("")}var Gn="\\ud800-\\udfff",Ac="\\u0300-\\u036f",Ec="\\ufe20-\\ufe2f",Oc="\\u20d0-\\u20ff",Mc=Ac+Ec+Oc,Pc="\\ufe0e\\ufe0f",Rc="["+Gn+"]",Ct="["+Mc+"]",At="\\ud83c[\\udffb-\\udfff]",Dc="(?:"+Ct+"|"+At+")",Kn="[^"+Gn+"]",Xn="(?:\\ud83c[\\udde6-\\uddff]){2}",Vn="[\\ud800-\\udbff][\\udc00-\\udfff]",Lc="\\u200d",Jn=Dc+"?",Zn="["+Pc+"]?",Nc="(?:"+Lc+"(?:"+[Kn,Xn,Vn].join("|")+")"+Zn+Jn+")*",kc=Zn+Jn+Nc,Fc="(?:"+[Kn+Ct+"?",Ct,Xn,Vn,Rc].join("|")+")",Ic=RegExp(At+"(?="+At+")|"+Fc+kc,"g");function jc(e){return e.match(Ic)||[]}function $c(e){return xt(e)?jc(e):Cc(e)}function Bc(){this.__data__=new ie,this.size=0}function zc(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function Wc(e){return this.__data__.get(e)}function Hc(e){return this.__data__.has(e)}var Uc=200;function Yc(e,t){var n=this.__data__;if(n instanceof ie){var r=n.__data__;if(!Re||r.lengthc))return!1;var o=s.get(e),u=s.get(t);if(o&&u)return o==t&&u==e;var f=-1,h=!0,v=n&gl?new Ke:void 0;for(s.set(e,t),s.set(t,e);++f=t||P<0||f&&R>=s}function T(){var b=Rt();if(m(b))return N(b);c=setTimeout(T,y(b))}function N(b){return c=void 0,h&&r?v(b):(r=i=void 0,a)}function L(){c!==void 0&&clearTimeout(c),o=0,r=l=i=c=void 0}function C(){return c===void 0?a:N(Rt())}function w(){var b=Rt(),P=m(b);if(r=arguments,i=this,l=b,P){if(c===void 0)return d(l);if(f)return clearTimeout(c),c=setTimeout(T,t),v(l)}return c===void 0&&(c=setTimeout(T,t)),a}return w.cancel=L,w.flush=C,w}function Kl(e,t){return dr(e,t)}function Xl(e,t,n,r){if(!le(e))return e;t=Ge(t,e);for(var i=-1,s=t.length,a=s-1,c=e;c!=null&&++iJl)return n;do t%2&&(n+=e),t=Zl(t/2),t&&(e+=e);while(t);return n}var Ql=Wl("length");const ql=Ql;var gr="\\ud800-\\udfff",eu="\\u0300-\\u036f",tu="\\ufe20-\\ufe2f",nu="\\u20d0-\\u20ff",ru=eu+tu+nu,iu="\\ufe0e\\ufe0f",su="["+gr+"]",Dt="["+ru+"]",Lt="\\ud83c[\\udffb-\\udfff]",au="(?:"+Dt+"|"+Lt+")",vr="[^"+gr+"]",mr="(?:\\ud83c[\\udde6-\\uddff]){2}",yr="[\\ud800-\\udbff][\\udc00-\\udfff]",ou="\\u200d",br=au+"?",_r="["+iu+"]?",cu="(?:"+ou+"(?:"+[vr,mr,yr].join("|")+")"+_r+br+")*",lu=_r+br+cu,uu="(?:"+[vr+Dt+"?",Dt,mr,yr,su].join("|")+")",wr=RegExp(Lt+"(?="+Lt+")|"+uu+lu,"g");function fu(e){for(var t=wr.lastIndex=0;wr.test(e);)++t;return t}function Sr(e){return xt(e)?fu(e):ql(e)}var du=Math.ceil;function hu(e,t){t=t===void 0?" ":dt(t);var n=t.length;if(n<2)return n?pr(t,e):t;var r=pr(t,du(e/Sr(t)));return xt(t)?vc($c(r),0,e).join(""):r.slice(0,e)}function pu(e,t,n){e=Wn(e),t=Gs(t);var r=t?Sr(e):0;return t&&rnew Proxy(e,t);const Ft=Object.getPrototypeOf,It=new WeakMap,xr=e=>e&&(It.has(e)?It.get(e):Ft(e)===Object.prototype||Ft(e)===Array.prototype),Cr=e=>typeof e=="object"&&e!==null,Ar=new WeakMap,Er=e=>e[kt]||e,Or=(e,t,n)=>{if(!xr(e))return e;const r=Er(e),i=(a=>Object.isFrozen(a)||Object.values(Object.getOwnPropertyDescriptors(a)).some(c=>!c.writable))(r);let s=n&&n.get(r);return s&&s[1].f===i||(s=((a,c)=>{const l={f:c};let o=!1;const u=(h,v)=>{if(!o){let d=l.a.get(a);d||(d=new Set,l.a.set(a,d)),v&&d.has(Nt)||d.add(h)}},f={get:(h,v)=>v===kt?a:(u(v),Or(h[v],l.a,l.c)),has:(h,v)=>v===bu?(o=!0,l.a.delete(a),!0):(u(v),v in h),getOwnPropertyDescriptor:(h,v)=>(u(v,!0),Object.getOwnPropertyDescriptor(h,v)),ownKeys:h=>(u(Nt),Reflect.ownKeys(h))};return c&&(f.set=f.deleteProperty=()=>!1),[f,l]})(r,i),s[1].p=_u(i?(a=>{let c=Ar.get(a);if(!c){if(Array.isArray(a))c=Array.from(a);else{const l=Object.getOwnPropertyDescriptors(a);Object.values(l).forEach(o=>{o.configurable=!0}),c=Object.create(Ft(a),l)}Ar.set(a,c)}return c})(r):r,s[0]),n&&n.set(r,s)),s[1].a=t,s[1].c=n,s[1].p},wu=(e,t)=>{const n=Reflect.ownKeys(e),r=Reflect.ownKeys(t);return n.length!==r.length||n.some((i,s)=>i!==r[s])},Mr=(e,t,n,r)=>{if(Object.is(e,t))return!1;if(!Cr(e)||!Cr(t))return!0;const i=n.get(Er(e));if(!i)return!0;if(r){const a=r.get(e);if(a&&a.n===t)return a.g;r.set(e,{n:t,g:!1})}let s=null;for(const a of i){const c=a===Nt?wu(e,t):Mr(e[a],t[a],n,r);if(c!==!0&&c!==!1||(s=c),s)break}return s===null&&(s=!0),r&&r.set(e,{n:t,g:s}),s},Pr=e=>xr(e)&&e[kt]||null,Rr=(e,t=!0)=>{It.set(e,t)};var Su=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Tu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dr={exports:{}},Lr={};/** * @license React * use-sync-external-store-shim.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var xe=ze.default;function xu(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Cu=typeof Object.is=="function"?Object.is:xu,Au=xe.useState,Eu=xe.useEffect,Ou=xe.useLayoutEffect,Mu=xe.useDebugValue;function Pu(e,t){var n=t(),r=Au({inst:{value:n,getSnapshot:t}}),i=r[0].inst,s=r[1];return Ou(function(){i.value=n,i.getSnapshot=t,jt(i)&&s({inst:i})},[e,n,t]),Eu(function(){return jt(i)&&s({inst:i}),e(function(){jt(i)&&s({inst:i})})},[e]),Mu(n),n}function jt(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Cu(e,n)}catch{return!0}}function Ru(e,t){return t()}var Du=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?Ru:Pu;Lr.useSyncExternalStore=xe.useSyncExternalStore!==void 0?xe.useSyncExternalStore:Du,function(e){e.exports=Lr}(Dr);const Lu=Tu(Dr.exports),$t=e=>typeof e=="object"&&e!==null,K=Symbol(),Bt=new WeakSet,Nu=(e=Object.is,t=(o,u)=>new Proxy(o,u),n=o=>$t(o)&&!Bt.has(o)&&(Array.isArray(o)||!(Symbol.iterator in o))&&!(o instanceof WeakMap)&&!(o instanceof WeakSet)&&!(o instanceof Error)&&!(o instanceof Number)&&!(o instanceof Date)&&!(o instanceof String)&&!(o instanceof RegExp)&&!(o instanceof ArrayBuffer),r=o=>{switch(o.status){case"fulfilled":return o.value;case"rejected":throw o.reason;default:throw o}},i=new WeakMap,s=(o,u,f,h=r)=>{const v=i.get(u);if((v==null?void 0:v[0])===f)return v[1];const d=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o));return Rr(d,!0),i.set(u,[f,d]),Reflect.ownKeys(o).forEach(y=>{const m=Reflect.get(o,y,u);Bt.has(m)?(Rr(m,!1),d[y]=m):m instanceof Promise?Object.defineProperty(d,y,{get(){return h(m)}}):m!=null&&m[K]?d[y]=zt(m,h):d[y]=m}),Object.freeze(d)},a=new WeakMap,c=[1],l=o=>{if(!$t(o))throw new Error("object required");const u=a.get(o);if(u)return u;let f=c[0];const h=new Set,v=(C,w=++c[0])=>{f!==w&&(f=w,h.forEach(b=>b(C,w)))},d=new Map,y=C=>{let w=d.get(C);return w||(w=(b,P)=>{const R=[...b];R[1]=[C,...R[1]],v(R,P)},d.set(C,w)),w},m=C=>{const w=d.get(C);return d.delete(C),w},T=Array.isArray(o)?[]:Object.create(Object.getPrototypeOf(o)),L=t(T,{get(C,w,b){return w===K?[C,b,f,s,h]:Reflect.get(C,w,b)},deleteProperty(C,w){var b;const P=Reflect.get(C,w),R=(b=P==null?void 0:P[K])==null?void 0:b[4];R&&R.delete(m(w));const k=Reflect.deleteProperty(C,w);return k&&v(["delete",[w],P]),k},set(C,w,b,P){var R,k;const F=Reflect.has(C,w),X=Reflect.get(C,w,P);if(F&&e(X,b))return!0;const ee=(R=X==null?void 0:X[K])==null?void 0:R[4];ee&&ee.delete(m(w)),$t(b)&&(b=Pr(b)||b);let A=b;return(k=Object.getOwnPropertyDescriptor(C,w))!=null&&k.set||(b instanceof Promise?b.then(S=>{b.status="fulfilled",b.value=S,v(["resolve",[w],S])}).catch(S=>{b.status="rejected",b.reason=S,v(["reject",[w],S])}):(!(b!=null&&b[K])&&n(b)&&(A=Ve(b)),A!=null&&A[K]&&A[K][4].add(y(w)))),Reflect.set(C,w,A,P),v(["set",[w],b,X]),!0}});return a.set(o,L),Reflect.ownKeys(o).forEach(C=>{const w=Object.getOwnPropertyDescriptor(o,C);w.get||w.set?Object.defineProperty(T,C,w):L[C]=o[C]}),L})=>[l,K,Bt,e,t,n,r,i,s,a,c],[ku]=Nu();function Ve(e={}){return ku(e)}function Nr(e,t,n){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[K])&&console.warn("Please use proxy object");let r;const i=[],s=e[K][4],a=c=>{if(i.push(c),n){t(i.splice(0));return}r||(r=Promise.resolve().then(()=>{r=void 0,s.has(a)&&t(i.splice(0))}))};return s.add(a),()=>s.delete(a)}function zt(e,t){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[K])&&console.warn("Please use proxy object");const[n,r,i,s]=e[K];return s(n,r,i,t)}const{use:kr}=ze.default,{useSyncExternalStore:Fu}=Lu,Iu=(e,t)=>{const n=[],r=new WeakSet,i=(s,a)=>{if(r.has(s))return;let c;typeof s=="object"&&s!==null&&(r.add(s),c=t.get(Pr(s)||s)),c?c.forEach(l=>{"value"in(Object.getOwnPropertyDescriptor(s,l)||{})&&i(s[l],a?[...a,l]:[l])}):a&&n.push(a)};return i(e),n},ju=(e,t)=>{const n=g.useRef();g.useEffect(()=>{n.current=Iu(e,t)}),g.useDebugValue(n.current)};function Wt(e,t){const n=t==null?void 0:t.sync,r=g.useRef(),i=g.useRef();let s=!0;const a=Fu(g.useCallback(o=>{const u=Nr(e,o,n);return o(),u},[e,n]),()=>{const o=zt(e,kr);try{if(!s&&r.current&&i.current&&!Mr(r.current,o,i.current,new WeakMap))return r.current}catch{}return o},()=>zt(e,kr));s=!1;const c=new WeakMap;g.useEffect(()=>{r.current=a,i.current=c}),({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&ju(a,c);const l=g.useMemo(()=>new WeakMap,[]);return Or(a,c,l)}const Fr={accessKey:"",useNarrowMode:!1,initialShowMore:!1},Ir=Object.keys(Fr),q=Ve(Fr),Ht=function(){return Wt(q)},jr="bilibili-app-recommend.config";function $u(){const e=GM_getValue(jr);e&&typeof e=="object"&&Object.assign(q,Tr(e,Ir)),Nr(q,()=>{Bu()})}function Bu(){GM_setValue(jr,Tr(q,Ir))}function $r(e){Object.assign(q,e)}$u();var Ut={exports:{}};const zu=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),Br=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},zr=({clearTimeout:e,setTimeout:t,willResolve:n})=>(r,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(Br());let a,c,l;const o=e||clearTimeout,u=()=>{o(a),l(Br())},f=()=>{s&&s.removeEventListener("abort",u)},h=new Promise((v,d)=>{c=()=>{f(),n?v(i):d(i)},l=d,a=(t||setTimeout)(c,r)});return s&&s.addEventListener("abort",u,{once:!0}),h.clear=()=>{o(a),a=null,c()},h},Wr=e=>{const t=zr({...e,willResolve:!0});return t.reject=zr({...e,willResolve:!1}),t.range=(n,r,i)=>t(zu(n,r),i),t},Yt=Wr();Yt.createWithTimers=Wr,Ut.exports=Yt,Ut.exports.default=Yt;var Gt,Hr=ys.default;Gt=Hr.createRoot,Hr.hydrateRoot;const Wu="https://api.bilibili.com",Ur="https://app.bilibili.com",Kt=ft.default.create({baseURL:Wu});Kt.interceptors.request.use(function(e){var t;return(t=e.params)!=null&&t._||(e.params={...e.params,_:Date.now()}),e},function(e){return Promise.reject(e)});const Je=ft.default.create({adapter:bs.default});Je.interceptors.request.use(function(e){return e.params={access_key:q.accessKey||"",...e.params},e},function(e){return Promise.reject(e)}),Je.interceptors.response.use(e=>{if(e.config.responseType==="json"&&e.data&&e.data instanceof ArrayBuffer){const t=new TextDecoder,n=new Uint8Array(e.data),r=t.decode(n);e.data=r;try{e.data=JSON.parse(r)}catch{}}return e});async function Hu(){return(await Je.get(Ur+"/x/feed/index",{responseType:"json",params:{build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)+"0"+(Math.random()*10).toFixed(0)}})).data.data}async function Uu(){return Xt(2)}async function Xt(e){const t=new Array(e).fill(0).map(i=>Hu());let r=(await Promise.all(t)).reduce((i,s)=>i.concat(s),[]);return r=Yu(r),r.map(i=>({...i,uniqId:i.param+"-"+crypto.randomUUID()}))}function Yu(e){const t=new Set;return e=e.filter(n=>{const{param:r}=n;return t.has(r)?(console.log("[bilibili-app-recommend]: [uniqRecList]: duplicate",n),!1):(t.add(r),!0)}),e}const Yr="_toast-container_9119l_1",vh={toastContainer:Yr};function ae(e,t=2e3){const n=document.createElement("div");n.className=Yr,n.innerText=e,document.body.appendChild(n),setTimeout(()=>n.remove(),t)}const Gu="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",Ku="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function Gr(){return ae(Gu)}function Kr(){return ae(Ku)}async function Xu(){var l,o;const t=(await ft.default.get("https://passport.bilibili.com/login/app/third",{params:{appkey:"27eb53fc9058f8c3",api:"https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png",sign:"04224646d1fea004e79606d3b038c84a"},withCredentials:!0})).data;if(!((l=t==null?void 0:t.data)!=null&&l.has_login))return{errmsg:"\u4F60\u5FC5\u987B\u767B\u5F55B\u7AD9\u4E4B\u540E\u624D\u80FD\u4F7F\u7528\u6388\u6743",json:t};if(!((o=t==null?void 0:t.data)!=null&&o.confirm_uri))return{errmsg:"\u65E0\u6CD5\u83B7\u5F97\u6388\u6743\u7F51\u5740",json:t};const n=t.data.confirm_uri;let r;const i=new Promise(u=>{window.addEventListener("message",f=>{if(f.origin!="https://www.mcbbs.net"||!f.data)return;const h=f.data.match(/access_key=([0-9a-z]{32})/);if(!h||!h[1])return u({errmsg:"\u6CA1\u6709\u83B7\u5F97\u5339\u914D\u7684\u5BC6\u94A5"});u(h[1])}),r=setTimeout(()=>{u({errmsg:"\u83B7\u53D6\u6388\u6743\u8D85\u65F6"})},10*1e3)}),s=document.createElement("iframe");s.src=n,s.style.display="none",document.body.appendChild(s);function a(){s.remove(),r&&(clearTimeout(r),r=null)}const c=await i;return a(),c}async function Vu(){const e=await Xu();if(typeof e=="object"&&"errmsg"in e){ae(e.errmsg);return}const t=e;return q.accessKey=t,ae("\u83B7\u53D6\u6210\u529F"),t}function Ju(){q.accessKey="",ae("\u5DF2\u5220\u9664 access_key")}var Zu=function(t){return function(n,r){var i=g.useRef(!1);t(function(){return function(){i.current=!1}},[]),t(function(){if(!i.current)i.current=!0;else return n()},r)}},Ce=function(t){return typeof t=="function"},Qu=function(t){return typeof t=="string"},Xr=function(t){return typeof t=="number"},qu=!1;const Vt=qu;function z(e){Vt&&(Ce(e)||console.error("useMemoizedFn expected parameter is a function, got ".concat(typeof e)));var t=g.useRef(e);t.current=g.useMemo(function(){return e},[e]);var n=g.useRef();return n.current||(n.current=function(){for(var r=[],i=0;i0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},Jr=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r-1&&(s=setTimeout(function(){Qe.delete(t)},n)),Qe.set(t,Ze(Ze({},r),{timer:s}))},rf=function(t){return Qe.get(t)},qe=new Map,sf=function(t){return qe.get(t)},af=function(t,n){qe.set(t,n),n.then(function(r){return qe.delete(t),r}).catch(function(){qe.delete(t)})},be={},of=function(t,n){be[t]&&be[t].forEach(function(r){return r(n)})},Qt=function(t,n){return be[t]||(be[t]=[]),be[t].push(n),function(){var i=be[t].indexOf(n);be[t].splice(i,1)}},cf=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},lf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},hf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},xf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r-1&&Fe.splice(n,1)}}if(Ne){var qr=function(){if(!(!qt()||!Af()))for(var t=0;t0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},Lf=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},$f=function(){var t=jf(g.useState({}),2),n=t[1];return g.useCallback(function(){return n({})},[])};const Bf=$f;var fe=globalThis&&globalThis.__assign||function(){return fe=Object.assign||function(e){for(var t,n=1,r=arguments.length;n0&&s[s.length-1])&&(o[0]===6||o[0]===2)){n=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},Ee=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},ti=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},ni=globalThis&&globalThis.__spreadArray||function(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,s;r0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s};function ii(e,t){e===void 0&&(e=!1);var n=Vf(g.useState(e),2),r=n[0],i=n[1],s=g.useMemo(function(){var a=t===void 0?!e:t,c=function(){return i(function(h){return h===e?a:e})},l=function(h){return i(h)},o=function(){return i(e)},u=function(){return i(a)};return{toggle:c,set:l,setLeft:o,setRight:u}},[]);return[r,s]}var Jf=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s};function Zf(e){e===void 0&&(e=!1);var t=Jf(ii(e),2),n=t[0],r=t[1],i=r.toggle,s=r.set,a=g.useMemo(function(){var c=function(){return s(!0)},l=function(){return s(!1)};return{toggle:i,set:function(u){return s(!!u)},setTrue:c,setFalse:l}},[]);return[n,a]}function et(e,t){if(!!Ne){if(!e)return t;var n;return Ce(e)?n=e():"current"in e?n=e.current:n=e,n}}var Qf=function(t){var n=function(i,s,a){var c=g.useRef(!1),l=g.useRef([]),o=g.useRef([]),u=g.useRef();t(function(){var f,h=Array.isArray(a)?a:[a],v=h.map(function(d){return et(d)});if(!c.current){c.current=!0,l.current=v,o.current=s,u.current=i();return}(v.length!==l.current.length||!Zt(v,l.current)||!Zt(s,o.current))&&((f=u.current)===null||f===void 0||f.call(u),l.current=v,o.current=s,u.current=i())}),Le(function(){var f;(f=u.current)===null||f===void 0||f.call(u),c.current=!1})};return n},qf=Qf(g.useEffect);const si=qf;var ai={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Su,function(){var n=1e3,r=6e4,i=36e5,s="millisecond",a="second",c="minute",l="hour",o="day",u="week",f="month",h="quarter",v="year",d="date",y="Invalid Date",m=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,T=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,N={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(A){var S=["th","st","nd","rd"],_=A%100;return"["+A+(S[(_-20)%10]||S[_]||S[0])+"]"}},L=function(A,S,_){var E=String(A);return!E||E.length>=S?A:""+Array(S+1-E.length).join(_)+A},C={s:L,z:function(A){var S=-A.utcOffset(),_=Math.abs(S),E=Math.floor(_/60),x=_%60;return(S<=0?"+":"-")+L(E,2,"0")+":"+L(x,2,"0")},m:function A(S,_){if(S.date()<_.date())return-A(_,S);var E=12*(_.year()-S.year())+(_.month()-S.month()),x=S.clone().add(E,f),O=_-x<0,M=S.clone().add(E+(O?-1:1),f);return+(-(E+(_-x)/(O?x-M:M-x))||0)},a:function(A){return A<0?Math.ceil(A)||0:Math.floor(A)},p:function(A){return{M:f,y:v,w:u,d:o,D:d,h:l,m:c,s:a,ms:s,Q:h}[A]||String(A||"").toLowerCase().replace(/s$/,"")},u:function(A){return A===void 0}},w="en",b={};b[w]=N;var P=function(A){return A instanceof X},R=function A(S,_,E){var x;if(!S)return w;if(typeof S=="string"){var O=S.toLowerCase();b[O]&&(x=O),_&&(b[O]=_,x=O);var M=S.split("-");if(!x&&M.length>1)return A(M[0])}else{var I=S.name;b[I]=S,x=I}return!E&&x&&(w=x),x||!E&&w},k=function(A,S){if(P(A))return A.clone();var _=typeof S=="object"?S:{};return _.date=A,_.args=arguments,new X(_)},F=C;F.l=R,F.i=P,F.w=function(A,S){return k(A,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var X=function(){function A(_){this.$L=R(_.locale,null,!0),this.parse(_)}var S=A.prototype;return S.parse=function(_){this.$d=function(E){var x=E.date,O=E.utc;if(x===null)return new Date(NaN);if(F.u(x))return new Date;if(x instanceof Date)return new Date(x);if(typeof x=="string"&&!/Z$/i.test(x)){var M=x.match(m);if(M){var I=M[2]-1||0,B=(M[7]||"0").substring(0,3);return O?new Date(Date.UTC(M[1],I,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)):new Date(M[1],I,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)}}return new Date(x)}(_),this.$x=_.x||{},this.init()},S.init=function(){var _=this.$d;this.$y=_.getFullYear(),this.$M=_.getMonth(),this.$D=_.getDate(),this.$W=_.getDay(),this.$H=_.getHours(),this.$m=_.getMinutes(),this.$s=_.getSeconds(),this.$ms=_.getMilliseconds()},S.$utils=function(){return F},S.isValid=function(){return this.$d.toString()!==y},S.isSame=function(_,E){var x=k(_);return this.startOf(E)<=x&&x<=this.endOf(E)},S.isAfter=function(_,E){return k(_)0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s};const tn=function(e,t){var n=t||{},r=n.onEnter,i=n.onLeave,s=n.onChange,a=ed(Zf(!1),2),c=a[0],l=a[1],o=l.setTrue,u=l.setFalse;return tt("mouseenter",function(){r==null||r(),o(),s==null||s(!0)},{target:e}),tt("mouseleave",function(){i==null||i(),u(),s==null||s(!1)},{target:e}),c};var td=function(t,n){return n===void 0&&(n=[]),Kl(t,n)},nd=function(t,n,r){var i=g.useRef(),s=g.useRef(0);td(n,i.current)||(i.current=n,s.current+=1),si(t,[s.current],r)};const rd=nd;var nn=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},id={0:48,1:49,2:50,3:51,4:52,5:53,6:54,7:55,8:56,9:57,backspace:8,tab:9,enter:13,shift:16,ctrl:17,alt:18,pausebreak:19,capslock:20,esc:27,space:32,pageup:33,pagedown:34,end:35,home:36,leftarrow:37,uparrow:38,rightarrow:39,downarrow:40,insert:45,delete:46,a:65,b:66,c:67,d:68,e:69,f:70,g:71,h:72,i:73,j:74,k:75,l:76,m:77,n:78,o:79,p:80,q:81,r:82,s:83,t:84,u:85,v:86,w:87,x:88,y:89,z:90,leftwindowkey:91,rightwindowkey:92,selectkey:93,numpad0:96,numpad1:97,numpad2:98,numpad3:99,numpad4:100,numpad5:101,numpad6:102,numpad7:103,numpad8:104,numpad9:105,multiply:106,add:107,subtract:109,decimalpoint:110,divide:111,f1:112,f2:113,f3:114,f4:115,f5:116,f6:117,f7:118,f8:119,f9:120,f10:121,f11:122,f12:123,numlock:144,scrolllock:145,semicolon:186,equalsign:187,comma:188,dash:189,period:190,forwardslash:191,graveaccent:192,openbracket:219,backslash:220,closebracket:221,singlequote:222},rn={ctrl:function(t){return t.ctrlKey},shift:function(t){return t.shiftKey},alt:function(t){return t.altKey},meta:function(t){return t.metaKey}};function sd(e){var t=Object.keys(rn).reduce(function(n,r){return rn[r](e)?n+1:n},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function ci(e,t,n){var r,i;if(!e.key)return!1;if(Xr(t))return e.keyCode===t;var s=t.split("."),a=0;try{for(var c=nn(s),l=c.next();!l.done;l=c.next()){var o=l.value,u=rn[o],f=id[o.toLowerCase()];(u&&u(e)||f&&f===e.keyCode)&&a++}}catch(h){r={error:h}}finally{try{l&&!l.done&&(i=c.return)&&i.call(c)}finally{if(r)throw r.error}}return n?a===s.length&&sd(e)===s.length:a===s.length}function ad(e,t){return Ce(e)?e:Qu(e)||Xr(e)?function(n){return ci(n,e,t)}:Array.isArray(e)?function(n){return e.some(function(r){return ci(n,r,t)})}:e?function(){return!0}:function(){return!1}}var od=["keydown"];function _e(e,t,n){var r=n||{},i=r.events,s=i===void 0?od:i,a=r.target,c=r.exactMatch,l=c===void 0?!1:c,o=De(t),u=De(e);rd(function(){var f,h,v,d=et(a,window);if(!!d){var y=function(C){var w,b=ad(u.current,l);if(b(C))return(w=o.current)===null||w===void 0?void 0:w.call(o,C)};try{for(var m=nn(s),T=m.next();!T.done;T=m.next()){var N=T.value;(v=d==null?void 0:d.addEventListener)===null||v===void 0||v.call(d,N,y)}}catch(L){f={error:L}}finally{try{T&&!T.done&&(h=m.return)&&h.call(m)}finally{if(f)throw f.error}}return function(){var L,C,w;try{for(var b=nn(s),P=b.next();!P.done;P=b.next()){var R=P.value;(w=d==null?void 0:d.removeEventListener)===null||w===void 0||w.call(d,R,y)}}catch(k){L={error:k}}finally{try{P&&!P.done&&(C=b.return)&&C.call(b)}finally{if(L)throw L.error}}}}},[s],a)}var cd=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s};function ld(e){var t=g.useRef(0),n=cd(g.useState(e),2),r=n[0],i=n[1],s=g.useCallback(function(a){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(a)})},[]);return Le(function(){cancelAnimationFrame(t.current)}),[r,s]}var ud=globalThis&&globalThis.__read||function(e,t){var n=typeof Symbol=="function"&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=r.next()).done;)s.push(i.value)}catch(c){a={error:c}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(a)throw a.error}}return s},fd={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN};const dd=function(e){var t=ud(ld(fd),2),n=t[0],r=t[1];return tt("mousemove",function(i){var s=i.screenX,a=i.screenY,c=i.clientX,l=i.clientY,o=i.pageX,u=i.pageY,f={screenX:s,screenY:a,clientX:c,clientY:l,pageX:o,pageY:u,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},h=et(e);if(h){var v=h.getBoundingClientRect(),d=v.left,y=v.top,m=v.width,T=v.height;f.elementPosX=d+window.pageXOffset,f.elementPosY=y+window.pageYOffset,f.elementX=o-f.elementPosX,f.elementY=u-f.elementPosY,f.elementW=m,f.elementH=T}r(f)},{target:function(){return document}}),n};var li={exports:{}};/*! Copyright (c) 2018 Jed Watson. Licensed under the MIT License (MIT), see http://jedwatson.github.io/classnames */(function(e){(function(){var t={}.hasOwnProperty;function n(){for(var r=[],i=0;ii,[i]);const s=p("button",{className:U("primary-btn",ui),onClick:i.toggle,children:p("svg",{className:U({[fi]:r}),children:p("use",{xlinkHref:"#widget-arrow"})})});return D(it,{children:[s,r&&t]})});var Y={exports:{}},bd="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",_d=bd,wd=_d;function pi(){}function gi(){}gi.resetWarningCache=pi;var Sd=function(){function e(r,i,s,a,c,l){if(l!==wd){var o=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw o.name="Invariant Violation",o}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:gi,resetWarningCache:pi};return n.PropTypes=n,n};Y.exports=Sd();class sn extends g.Component{constructor(t){super(t),this.scrollListener=this.scrollListener.bind(this),this.eventListenerOptions=this.eventListenerOptions.bind(this),this.mousewheelListener=this.mousewheelListener.bind(this)}componentDidMount(){this.pageLoaded=this.props.pageStart,this.options=this.eventListenerOptions(),this.attachScrollListener()}componentDidUpdate(){if(this.props.isReverse&&this.loadMore){const t=this.getParentElement(this.scrollComponent);t.scrollTop=t.scrollHeight-this.beforeScrollHeight+this.beforeScrollTop,this.loadMore=!1}this.attachScrollListener()}componentWillUnmount(){this.detachScrollListener(),this.detachMousewheelListener()}isPassiveSupported(){let t=!1;const n={get passive(){t=!0}};try{document.addEventListener("test",null,n),document.removeEventListener("test",null,n)}catch{}return t}eventListenerOptions(){let t=this.props.useCapture;return this.isPassiveSupported()?t={useCapture:this.props.useCapture,passive:!0}:t={passive:!1},t}setDefaultLoader(t){this.defaultLoader=t}detachMousewheelListener(){let t=window;this.props.useWindow===!1&&(t=this.scrollComponent.parentNode),t.removeEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture)}detachScrollListener(){let t=window;this.props.useWindow===!1&&(t=this.getParentElement(this.scrollComponent)),t.removeEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),t.removeEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture)}getParentElement(t){const n=this.props.getScrollParent&&this.props.getScrollParent();return n!=null?n:t&&t.parentNode}filterProps(t){return t}attachScrollListener(){const t=this.getParentElement(this.scrollComponent);if(!this.props.hasMore||!t)return;let n=window;this.props.useWindow===!1&&(n=t),n.addEventListener("mousewheel",this.mousewheelListener,this.options?this.options:this.props.useCapture),n.addEventListener("scroll",this.scrollListener,this.options?this.options:this.props.useCapture),n.addEventListener("resize",this.scrollListener,this.options?this.options:this.props.useCapture),this.props.initialLoad&&this.scrollListener()}mousewheelListener(t){t.deltaY===1&&!this.isPassiveSupported()&&t.preventDefault()}scrollListener(){const t=this.scrollComponent,n=window,r=this.getParentElement(t);let i;if(this.props.useWindow){const s=document.documentElement||document.body.parentNode||document.body,a=n.pageYOffset!==void 0?n.pageYOffset:s.scrollTop;this.props.isReverse?i=a:i=this.calculateOffset(t,a)}else this.props.isReverse?i=r.scrollTop:i=t.scrollHeight-r.scrollTop-r.clientHeight;i{this.scrollComponent=T,u&&u(T)};const m=[n];return i&&(c?a?m.unshift(c):m.push(c):this.defaultLoader&&(a?m.unshift(this.defaultLoader):m.push(this.defaultLoader))),ze.default.createElement(r,y,m)}}Sn(sn,"propTypes",{children:Y.exports.node.isRequired,element:Y.exports.node,hasMore:Y.exports.bool,initialLoad:Y.exports.bool,isReverse:Y.exports.bool,loader:Y.exports.node,loadMore:Y.exports.func.isRequired,pageStart:Y.exports.number,ref:Y.exports.func,getScrollParent:Y.exports.func,threshold:Y.exports.number,useCapture:Y.exports.bool,useWindow:Y.exports.bool}),Sn(sn,"defaultProps",{element:"div",hasMore:!1,initialLoad:!0,pageStart:0,ref:null,threshold:250,useWindow:!0,isReverse:!1,useCapture:!1,loader:null,getScrollParent:null});let Ie=0;const Td=()=>{Ie++,document.body.style.overflow="hidden"},xd=()=>{Ie--,Ie<0&&(Ie=0),Ie===0&&(document.body.style.overflow="overlay")},vi=()=>document.body.classList.contains("dark"),mi=Ve({value:vi()}),Cd=function(){return Wt(mi).value};new MutationObserver(function(){mi.value=vi()}).observe(document.body,{attributes:!0,attributeFilter:["class"]});function yi({show:e,onHide:t,children:n,clsModalMask:r,clsModal:i,hideWhenMaskOnClick:s=!1}){g.useLayoutEffect(()=>{e?Td():xd()},[e]);const a=g.useRef(null),c=Cd(),{bg:l,c:o}=g.useMemo(()=>{const d=window.getComputedStyle(document.body)["background-color"],y=window.getComputedStyle(document.body).color;return{bg:d,c:y}},[c]),u=g.useMemo(()=>c?{"--bg":l,"--c":o,backgroundColor:l,color:o}:{},[l,o,c]),f=g.useId(),h=g.useMemo(()=>{const d=document.createElement("div");return d.setAttribute("data-id","base-modal-"+f),document.body.appendChild(d),d},[]),v=z(d=>{var y;(y=a.current)!=null&&y.contains(d.target)||s&&t()});return e?J.createPortal(p("div",{className:U(r),onClick:v,children:p("div",{className:U(i),style:u,ref:a,children:n})}),h):null}function Ad(e){const t=Ve({data:Array.from(e||[]),has(n){return this.data.some(r=>r[0]===n)},set(n,r){const i=this.data.find(s=>s[0]===n);return i?i[1]=r:this.data.push([n,r]),this},get(n){var r;return(r=this.data.find(i=>i[0]===n))==null?void 0:r[1]},delete(n){const r=this.data.findIndex(i=>i[0]===n);return r===-1?!1:(this.data.splice(r,1),!0)},clear(){this.data.splice(0)},get size(){return this.data.length},toJSON(){return new Map(this.data)},forEach(n){this.data.forEach(r=>{n(r[1],r[0],this)})},keys(){return this.data.map(n=>n[0]).values()},values(){return this.data.map(n=>n[1]).values()},entries(){return new Map(this.data).entries()},get[Symbol.toStringTag](){return"Map"},[Symbol.iterator](){return this.entries()}});return Object.defineProperties(t,{data:{enumerable:!1},size:{enumerable:!1},toJSON:{enumerable:!1}}),Object.seal(t),t}function Ed(){var t;const e=(t=document.cookie.match(/bili_jct=([0-9a-fA-F]{32})/))==null?void 0:t[1];if(!e)throw ae("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55"),new Error("\u627E\u4E0D\u5230 csrf token, \u8BF7\u68C0\u67E5\u662F\u5426\u767B\u5F55");return e}const je=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,st=typeof AbortController=="function"?AbortController:class{constructor(){this.signal=new bi}abort(){this.signal.dispatchEvent("abort")}},Od=typeof AbortSignal=="function",Md=typeof st.AbortSignal=="function",bi=Od?AbortSignal:Md?st.AbortController:class{constructor(){this.aborted=!1,this._listeners=[]}dispatchEvent(t){if(t==="abort"){this.aborted=!0;const n={type:t,target:this};this.onabort(n),this._listeners.forEach(r=>r(n),this)}}onabort(){}addEventListener(t,n){t==="abort"&&this._listeners.push(n)}removeEventListener(t,n){t==="abort"&&(this._listeners=this._listeners.filter(r=>r!==n))}},an=new Set,on=(e,t)=>{const n=`LRU_CACHE_OPTION_${e}`;at(n)&&ln(n,`${e} option`,`options.${t}`,we)},cn=(e,t)=>{const n=`LRU_CACHE_METHOD_${e}`;if(at(n)){const{prototype:r}=we,{get:i}=Object.getOwnPropertyDescriptor(r,e);ln(n,`${e} method`,`cache.${t}()`,i)}},Pd=(e,t)=>{const n=`LRU_CACHE_PROPERTY_${e}`;if(at(n)){const{prototype:r}=we,{get:i}=Object.getOwnPropertyDescriptor(r,e);ln(n,`${e} property`,`cache.${t}`,i)}},_i=(...e)=>{typeof process=="object"&&process&&typeof process.emitWarning=="function"?process.emitWarning(...e):console.error(...e)},at=e=>!an.has(e),ln=(e,t,n,r)=>{an.add(e);const i=`The ${t} is deprecated. Please use ${n} instead.`;_i(i,"DeprecationWarning",e,r)},de=e=>e&&e===Math.floor(e)&&e>0&&isFinite(e),wi=e=>de(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?ot:null:null;class ot extends Array{constructor(t){super(t),this.fill(0)}}class Rd{constructor(t){if(t===0)return[];const n=wi(t);this.heap=new n(t),this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class we{constructor(t={}){const{max:n=0,ttl:r,ttlResolution:i=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:c,allowStale:l,dispose:o,disposeAfter:u,noDisposeOnSet:f,noUpdateTTL:h,maxSize:v=0,maxEntrySize:d=0,sizeCalculation:y,fetchMethod:m,fetchContext:T,noDeleteOnFetchRejection:N,noDeleteOnStaleGet:L}=t,{length:C,maxAge:w,stale:b}=t instanceof we?{}:t;if(n!==0&&!de(n))throw new TypeError("max option must be a nonnegative integer");const P=n?wi(n):Array;if(!P)throw new Error("invalid max value: "+n);if(this.max=n,this.maxSize=v,this.maxEntrySize=d||this.maxSize,this.sizeCalculation=y||C,this.sizeCalculation){if(!this.maxSize&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=m||null,this.fetchMethod&&typeof this.fetchMethod!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.fetchContext=T,!this.fetchMethod&&T!==void 0)throw new TypeError("cannot set fetchContext without fetchMethod");if(this.keyMap=new Map,this.keyList=new Array(n).fill(null),this.valList=new Array(n).fill(null),this.next=new P(n),this.prev=new P(n),this.head=0,this.tail=0,this.free=new Rd(n),this.initialFill=1,this.size=0,typeof o=="function"&&(this.dispose=o),typeof u=="function"?(this.disposeAfter=u,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!f,this.noUpdateTTL=!!h,this.noDeleteOnFetchRejection=!!N,this.maxEntrySize!==0){if(this.maxSize!==0&&!de(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");if(!de(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!l||!!b,this.noDeleteOnStaleGet=!!L,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!c,this.ttlResolution=de(i)||i===0?i:1,this.ttlAutopurge=!!s,this.ttl=r||w||0,this.ttl){if(!de(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(this.max===0&&this.ttl===0&&this.maxSize===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.max&&!this.maxSize){const R="LRU_CACHE_UNBOUNDED";at(R)&&(an.add(R),_i("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",R,we))}b&&on("stale","allowStale"),w&&on("maxAge","ttl"),C&&on("length","sizeCalculation")}getRemainingTTL(t){return this.has(t,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new ot(this.max),this.starts=new ot(this.max),this.setItemTTL=(r,i,s=je.now())=>{if(this.starts[r]=i!==0?s:0,this.ttls[r]=i,i!==0&&this.ttlAutopurge){const a=setTimeout(()=>{this.isStale(r)&&this.delete(this.keyList[r])},i+1);a.unref&&a.unref()}},this.updateItemAge=r=>{this.starts[r]=this.ttls[r]!==0?je.now():0};let t=0;const n=()=>{const r=je.now();if(this.ttlResolution>0){t=r;const i=setTimeout(()=>t=0,this.ttlResolution);i.unref&&i.unref()}return r};this.getRemainingTTL=r=>{const i=this.keyMap.get(r);return i===void 0?0:this.ttls[i]===0||this.starts[i]===0?1/0:this.starts[i]+this.ttls[i]-(t||n())},this.isStale=r=>this.ttls[r]!==0&&this.starts[r]!==0&&(t||n())-this.starts[r]>this.ttls[r]}updateItemAge(t){}setItemTTL(t,n,r){}isStale(t){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new ot(this.max),this.removeItemSize=t=>{this.calculatedSize-=this.sizes[t],this.sizes[t]=0},this.requireSize=(t,n,r,i)=>{if(!de(r))if(i){if(typeof i!="function")throw new TypeError("sizeCalculation must be a function");if(r=i(n,t),!de(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer)");return r},this.addItemSize=(t,n)=>{this.sizes[t]=n;const r=this.maxSize-this.sizes[t];for(;this.calculatedSize>r;)this.evict(!0);this.calculatedSize+=this.sizes[t]}}removeItemSize(t){}addItemSize(t,n){}requireSize(t,n,r,i){if(r||i)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let n=this.tail;!(!this.isValidIndex(n)||((t||!this.isStale(n))&&(yield n),n===this.head));)n=this.prev[n]}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let n=this.head;!(!this.isValidIndex(n)||((t||!this.isStale(n))&&(yield n),n===this.tail));)n=this.next[n]}isValidIndex(t){return this.keyMap.get(this.keyList[t])===t}*entries(){for(const t of this.indexes())yield[this.keyList[t],this.valList[t]]}*rentries(){for(const t of this.rindexes())yield[this.keyList[t],this.valList[t]]}*keys(){for(const t of this.indexes())yield this.keyList[t]}*rkeys(){for(const t of this.rindexes())yield this.keyList[t]}*values(){for(const t of this.indexes())yield this.valList[t]}*rvalues(){for(const t of this.rindexes())yield this.valList[t]}[Symbol.iterator](){return this.entries()}find(t,n={}){for(const r of this.indexes())if(t(this.valList[r],this.keyList[r],this))return this.get(this.keyList[r],n)}forEach(t,n=this){for(const r of this.indexes())t.call(n,this.valList[r],this.keyList[r],this)}rforEach(t,n=this){for(const r of this.rindexes())t.call(n,this.valList[r],this.keyList[r],this)}get prune(){return cn("prune","purgeStale"),this.purgeStale}purgeStale(){let t=!1;for(const n of this.rindexes({allowStale:!0}))this.isStale(n)&&(this.delete(this.keyList[n]),t=!0);return t}dump(){const t=[];for(const n of this.indexes({allowStale:!0})){const r=this.keyList[n],i=this.valList[n],a={value:this.isBackgroundFetch(i)?i.__staleWhileFetching:i};if(this.ttls){a.ttl=this.ttls[n];const c=je.now()-this.starts[n];a.start=Math.floor(Date.now()-c)}this.sizes&&(a.size=this.sizes[n]),t.unshift([r,a])}return t}load(t){this.clear();for(const[n,r]of t){if(r.start){const i=Date.now()-r.start;r.start=je.now()-i}this.set(n,r.value,r)}}dispose(t,n,r){}set(t,n,{ttl:r=this.ttl,start:i,noDisposeOnSet:s=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL}={}){if(a=this.requireSize(t,n,a,c),this.maxEntrySize&&a>this.maxEntrySize)return this;let o=this.size===0?void 0:this.keyMap.get(t);if(o===void 0)o=this.newIndex(),this.keyList[o]=t,this.valList[o]=n,this.keyMap.set(t,o),this.next[this.tail]=o,this.prev[o]=this.tail,this.tail=o,this.size++,this.addItemSize(o,a),l=!1;else{const u=this.valList[o];n!==u&&(this.isBackgroundFetch(u)?u.__abortController.abort():s||(this.dispose(u,t,"set"),this.disposeAfter&&this.disposed.push([u,t,"set"])),this.removeItemSize(o),this.valList[o]=n,this.addItemSize(o,a)),this.moveToTail(o)}if(r!==0&&this.ttl===0&&!this.ttls&&this.initializeTTLTracking(),l||this.setItemTTL(o,r,i),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return this.size===0?this.tail:this.size===this.max&&this.max!==0?this.evict(!1):this.free.length!==0?this.free.pop():this.initialFill++}pop(){if(this.size){const t=this.valList[this.head];return this.evict(!0),t}}evict(t){const n=this.head,r=this.keyList[n],i=this.valList[n];return this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,r,"evict"),this.disposeAfter&&this.disposed.push([i,r,"evict"])),this.removeItemSize(n),t&&(this.keyList[n]=null,this.valList[n]=null,this.free.push(n)),this.head=this.next[n],this.keyMap.delete(r),this.size--,n}has(t,{updateAgeOnHas:n=this.updateAgeOnHas}={}){const r=this.keyMap.get(t);return r!==void 0&&!this.isStale(r)?(n&&this.updateItemAge(r),!0):!1}peek(t,{allowStale:n=this.allowStale}={}){const r=this.keyMap.get(t);if(r!==void 0&&(n||!this.isStale(r))){const i=this.valList[r];return this.isBackgroundFetch(i)?i.__staleWhileFetching:i}}backgroundFetch(t,n,r,i){const s=n===void 0?void 0:this.valList[n];if(this.isBackgroundFetch(s))return s;const a=new st,c={signal:a.signal,options:r,context:i},l=h=>(a.signal.aborted||this.set(t,h,c.options),h),o=h=>{if(this.valList[n]===f&&(!r.noDeleteOnFetchRejection||f.__staleWhileFetching===void 0?this.delete(t):this.valList[n]=f.__staleWhileFetching),f.__returned===f)throw h},u=h=>h(this.fetchMethod(t,s,c)),f=new Promise(u).then(l,o);return f.__abortController=a,f.__staleWhileFetching=s,f.__returned=null,n===void 0?(this.set(t,f,c.options),n=this.keyMap.get(t)):this.valList[n]=f,f}isBackgroundFetch(t){return t&&typeof t=="object"&&typeof t.then=="function"&&Object.prototype.hasOwnProperty.call(t,"__staleWhileFetching")&&Object.prototype.hasOwnProperty.call(t,"__returned")&&(t.__returned===t||t.__returned===null)}async fetch(t,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet,ttl:s=this.ttl,noDisposeOnSet:a=this.noDisposeOnSet,size:c=0,sizeCalculation:l=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL,noDeleteOnFetchRejection:u=this.noDeleteOnFetchRejection,fetchContext:f=this.fetchContext,forceRefresh:h=!1}={}){if(!this.fetchMethod)return this.get(t,{allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i});const v={allowStale:n,updateAgeOnGet:r,noDeleteOnStaleGet:i,ttl:s,noDisposeOnSet:a,size:c,sizeCalculation:l,noUpdateTTL:o,noDeleteOnFetchRejection:u};let d=this.keyMap.get(t);if(d===void 0){const y=this.backgroundFetch(t,d,v,f);return y.__returned=y}else{const y=this.valList[d];if(this.isBackgroundFetch(y))return n&&y.__staleWhileFetching!==void 0?y.__staleWhileFetching:y.__returned=y;if(!h&&!this.isStale(d))return this.moveToTail(d),r&&this.updateItemAge(d),y;const m=this.backgroundFetch(t,d,v,f);return n&&m.__staleWhileFetching!==void 0?m.__staleWhileFetching:m.__returned=m}}get(t,{allowStale:n=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:i=this.noDeleteOnStaleGet}={}){const s=this.keyMap.get(t);if(s!==void 0){const a=this.valList[s],c=this.isBackgroundFetch(a);return this.isStale(s)?c?n?a.__staleWhileFetching:void 0:(i||this.delete(t),n?a:void 0):c?void 0:(this.moveToTail(s),r&&this.updateItemAge(s),a)}}connect(t,n){this.prev[n]=t,this.next[t]=n}moveToTail(t){t!==this.tail&&(t===this.head?this.head=this.next[t]:this.connect(this.prev[t],this.next[t]),this.connect(this.tail,t),this.tail=t)}get del(){return cn("del","delete"),this.delete}delete(t){let n=!1;if(this.size!==0){const r=this.keyMap.get(t);if(r!==void 0)if(n=!0,this.size===1)this.clear();else{this.removeItemSize(r);const i=this.valList[r];this.isBackgroundFetch(i)?i.__abortController.abort():(this.dispose(i,t,"delete"),this.disposeAfter&&this.disposed.push([i,t,"delete"])),this.keyMap.delete(t),this.keyList[r]=null,this.valList[r]=null,r===this.tail?this.tail=this.prev[r]:r===this.head?this.head=this.next[r]:(this.next[this.prev[r]]=this.next[r],this.prev[this.next[r]]=this.prev[r]),this.size--,this.free.push(r)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return n}clear(){for(const t of this.rindexes({allowStale:!0})){const n=this.valList[t];if(this.isBackgroundFetch(n))n.__abortController.abort();else{const r=this.keyList[t];this.dispose(n,r,"delete"),this.disposeAfter&&this.disposed.push([n,r,"delete"])}}if(this.keyMap.clear(),this.valList.fill(null),this.keyList.fill(null),this.ttls&&(this.ttls.fill(0),this.starts.fill(0)),this.sizes&&this.sizes.fill(0),this.head=0,this.tail=0,this.initialFill=1,this.free.length=0,this.calculatedSize=0,this.size=0,this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift())}get reset(){return cn("reset","clear"),this.clear}get length(){return Pd("length","size"),this.size}static get AbortController(){return st}static get AbortSignal(){return bi}}var Dd=we;const Ld=Dd;async function Nd(e){return(await Kt.get("/pvideo",{params:{aid:e}})).data.data}async function kd(e){return[]}const un=new Ld({max:200});async function Fd(e){if(un.has(e))return un.get(e);const[t,n]=await Promise.all([Nd(e),kd()]);return un.set(e,{pvideoData:t,dmData:n}),{pvideoData:t,dmData:n}}function Si(e){return async function(n){const r=new FormData;r.append("aid",n),r.append("csrf",Ed());const s=(await Kt.post("/x/v2/history/toview/"+e,r,{withCredentials:!0})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}}const Id=Si("add"),jd=Si("del"),Ti=e=>{const t={dislike:"/x/feed/dislike",cancel:"/x/feed/dislike/cancel"}[e];return async function(n,r){var c;const s=(await Je.get(Ur+t,{params:{goto:n.goto,id:n.param,mid:n.mid,rid:n.tid,tag_id:(c=n.tag)==null?void 0:c.tag_id,reason_id:r,build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)}})).data;return(s==null?void 0:s.code)===0&&(s==null?void 0:s.message)==="0"}},$d=Ti("dislike"),Bd=Ti("cancel"),xi="_modal-mask_vh629_1",Ci="_modal_vh629_1",Ai="_modal-header_vh629_23",Ei="_modal-title_vh629_30",Oi="_title-desc_vh629_35",Mi="_btn-close_vh629_39",Pi="_modal-body_vh629_57",Ri="_reason-list_vh629_62",Di="_reason_vh629_62",wh={modalMask:xi,modal:Ci,modalHeader:Ai,modalTitle:Ei,titleDesc:Oi,btnClose:Mi,modalBody:Pi,reasonList:Ri,reason:Di},fn=Ad();function zd(){return Wt(fn)}function Wd(e){const t=zd();if(!!e)return t.get(e)}function Hd({show:e,onHide:t,item:n}){const[r,i]=g.useState(!1),s=z(async(c,l)=>{if(!n)return;let o=!1,u=null;try{i(!0),o=await $d(n,c)}catch(f){u=f}finally{i(!1)}if(u)return console.error(u.stack||u),Gr();o?ae("\u5DF2\u6807\u8BB0\u4E0D\u60F3\u770B"):Kr(),o&&(fn.set(n.param,{id:c,name:l}),t())}),a=g.useMemo(()=>{var c;return[...(c=n==null?void 0:n.dislike_reasons)!=null?c:[],{reason_id:12,reason_name:"\u6B64\u7C7B\u5185\u5BB9\u8FC7\u591A"},{reason_id:13,reason_name:"\u63A8\u8350\u8FC7"}]},[n]);return D(yi,{show:e,onHide:t,clsModalMask:xi,clsModal:Ci,hideWhenMaskOnClick:!0,children:[D("div",{className:Ai,children:[D("div",{className:Ei,children:["\u6211\u4E0D\u60F3\u770B",p("span",{className:Oi,children:"(\u9009\u62E9\u540E\u5C06\u51CF\u5C11\u76F8\u4F3C\u5185\u5BB9\u63A8\u8350)"})]}),p("div",{className:"space",style:{flex:1}}),D("button",{className:`primary-btn roll-btn ${Mi}`,onClick:t,children:[p("svg",{style:{transform:"rotate(0deg)"},children:p("use",{xlinkHref:"#widget-close"})}),p("span",{children:"\u5173\u95ED"})]})]}),p("div",{className:Pi,children:p("div",{className:Ri,children:a.map(c=>p("button",{className:Di,"data-id":c.reason_id,onClick:()=>s(c.reason_id,c.reason_name),disabled:r,children:c.reason_name},c.reason_id))})})]})}const Li={show:!1,onHide:Ni,item:null};function Ni(){ki({show:!1,item:null})}function ki(e){Object.assign(Li,e),Ud().render(p(Hd,{...Li,onHide:Ni}))}let dn;function Ud(){if(!dn){const e=document.createElement("div");e.classList.add("show-dislike-container"),document.body.appendChild(e),dn=Gt(e)}return dn}function Yd(e){ki({show:!0,item:e})}function Gd(e){if(!e)return"00:00";const t=Math.trunc(e/3600);e-=t*3600;const n=Math.trunc(e/60);e-=n*60;const i=[t,n,e];return i[0]===0&&i.shift(),i.map(a=>pu(a.toString(),2,"0")).join(":")}function hn(e){if(!e)return"";if(e<=9999)return e.toString();let t=(e/1e4).toFixed(1);return t=t.replace(/\.0$/,""),`${t}\u4E07`}const Fi="_bili-video-card_15xx7_1",Ii="_image-wrapper_15xx7_4",ji="_preview-card-wrapper_15xx7_8",$i="_preview-card-inner_15xx7_21",Bi="_watch-later_15xx7_25",zi="_badge_15xx7_28",Wi="_recommend-reason_15xx7_36",Hi="_bangumi-desc_15xx7_51",Ui="_btn-dislike_15xx7_54",Yi="_btn-dislike-icon_15xx7_69",Gi="_btn-dislike-tip_15xx7_76",Ki="_disliked-wrapper_15xx7_91",Xi="_dislike-content-cover_15xx7_105",Vi="_dislike-content-cover-inner_15xx7_111",Kd="_dislike-icon_15xx7_122",Ji="_dislike-reason_15xx7_125",Zi="_dislike-desc_15xx7_129",Qi="_dislike-content-action_15xx7_133",Sh={biliVideoCard:Fi,imageWrapper:Ii,previewCardWrapper:ji,previewCardInner:$i,watchLater:Bi,badge:zi,recommendReason:Wi,bangumiDesc:Hi,btnDislike:Ui,btnDislikeIcon:Yi,btnDislikeTip:Gi,dislikedWrapper:Ki,dislikeContentCover:Xi,dislikeContentCoverInner:Vi,dislikeIcon:Kd,dislikeReason:Ji,dislikeDesc:Zi,dislikeContentAction:Qi};function pn(e,t){return isNaN(e)?t:e}function Xd({className:e,item:t,pvideo:n,enterCursorState:r}){const i=g.useRef(null),s=dd(i),a={item:t,pvideo:n,cursorState:s,elWidth:pn(s.elementW,r.width),elHeight:pn(s.elementH,r.height),relativeX:pn(s.elementX,r.relativeX)};return p("div",{ref:i,className:U(ji,e),children:n?p(Vd,{...a}):!1})}function Vd({item:e,pvideo:t,elWidth:n,elHeight:r,relativeX:i}){var b;let s=0,a=0;n&&i&&!isNaN(i)&&!isNaN(n)&&(s=i/n,s<0&&(s=0),s>1&&(s=1),a=Math.floor((e.duration||0)*s));let c=g.useMemo(()=>{const P=(t==null?void 0:t.index)||[];let R=Zd(P,a);return R!==-1?R:a>P[P.length-1]?(R=Math.floor(P.length*s)-1,R<0&&(R=0),R):0},[t,a]);const{img_x_len:l,img_y_len:o,img_x_size:u,img_y_size:f}=t,h=o*l;c=c+1;const v=Math.floor(c/h),d=c-v*h,y=((b=t.image)==null?void 0:b[v])||"",m=Math.floor(d/l)+1,T=d-(m-1)*l,N=n*l,L=r*o,C=(m-1)*r,w=(T-1)*n;return p("div",{className:$i,style:{backgroundColor:"black",backgroundImage:`url(${y})`,backgroundPosition:`-${w}px -${C}px`,backgroundSize:`${N}px ${L}px`},children:p(Jd,{progress:s})})}function Jd({progress:e}){return p("div",{className:"track",style:{position:"absolute",bottom:0,left:0,backgroundColor:"#eee",width:"100%",height:2},children:p("div",{className:"bar",style:{backgroundColor:"#fa6a9d",height:"100%",width:`${e*100}%`}})})}function Zd(e,t){var c;let n=0,r=e.length-1,i=-1;for(;n<=r;){const l=Math.floor((n+r)/2),o=e[l];if(t===o)return l;o{if(!e)return"";const t=oi.unix(e);return t.format("YYYY")===Qd?t.format("M-D"):t.format("YY-M-D")},eh=e=>e.replace(/^http:\/\//,"https://"),gn=g.memo(function({style:t,className:n,item:r,loading:i}){i=i!=null?i:!r;const s=D("div",{className:U("bili-video-card__skeleton",{hide:!i}),children:[p("div",{className:"bili-video-card__skeleton--cover"}),p("div",{className:"bili-video-card__skeleton--info",children:D("div",{className:"bili-video-card__skeleton--right",children:[p("p",{className:"bili-video-card__skeleton--text"}),p("p",{className:"bili-video-card__skeleton--text short"}),p("p",{className:"bili-video-card__skeleton--light"})]})})]}),a=Wd(r==null?void 0:r.param);return D("div",{style:t,className:U("bili-video-card",Fi,n),"data-report":"partition_recommend.content",children:[s,!i&&r&&(a?p(th,{item:r,dislikedReason:a}):p(nh,{item:r}))]})}),th=g.memo(function({dislikedReason:t,item:n}){const r=z(async()=>{if(!(t!=null&&t.id))return;let i=!1,s=null;try{i=await Bd(n,t.id)}catch(a){s=a}if(s)return console.error(s.stack||s),Gr();i?ae("\u5DF2\u64A4\u9500"):Kr(),i&&fn.delete(n.param)});return D("div",{className:U(Ki),children:[p("div",{className:Xi,children:D("div",{className:Vi,children:[p("div",{className:"icon"}),p("div",{className:Ji,children:t==null?void 0:t.name}),p("div",{className:Zi,children:"\u5C06\u51CF\u5C11\u6B64\u7C7B\u5185\u5BB9\u63A8\u8350"})]})}),p("div",{className:Qi,children:p("button",{onClick:r,children:"\u64A4\u9500"})})]})}),nh=g.memo(function({item:t}){const n=g.useRef(null),[r,i]=g.useState(()=>({width:0,height:0,relativeX:0}));tt("mouseenter",G=>{var vs;const lt=(vs=n.current)==null?void 0:vs.getBoundingClientRect();if(!lt)return;const{width:ut,height:wn,x:fh}=lt;i({width:ut,height:wn,relativeX:G.pageX-window.pageXOffset-fh})},{target:n});const s=tn(n),a=g.useRef(null),c=tn(a),[l,o]=g.useState(!1),{accessKey:u}=Ht(),f=Boolean(u),{param:h,title:v,cover:d,goto:y,play:m,like:T,coin:N,desc:L,danmaku:C,ctime:w,duration:b,name:P,face:R,mid:k,favorite:F,badge:X,rcmd_reason:ee}=t,A=g.useMemo(()=>qd(w),[w]),S=g.useMemo(()=>eh(d),[d]),[_,E]=g.useState(null),[x,O]=g.useState(!1),M=z(async()=>{if(!_&&!x)try{O(!0);const G=await Fd(h);E(G)}finally{O(!1)}});g.useEffect(()=>{s&&M()},[s]);let I=!1;const B=z(async G=>{if(G.preventDefault(),I)return;I=!0;const lt=l?jd:Id;let ut=!1;try{ut=await lt(h)}finally{I=!1}ut&&o(wn=>!wn)}),$=g.useRef(null),W=tn($),te=z(G=>{G.stopPropagation(),G.preventDefault(),Yd(t)}),V=t.goto==="bangumi",oe=t.goto==="av",ce=oe?`/video/av${h}`:t.uri,he=g.useMemo(()=>Gd(b),[b]),H=g.useMemo(()=>hn(m),[m]),ne=g.useMemo(()=>hn(T),[T]),$e=g.useMemo(()=>hn(F),[F]);return D("div",{className:"bili-video-card__wrap __scale-wrap",children:[p("a",{href:ce,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:D("div",{className:"bili-video-card__image __scale-player-wrap",ref:n,children:[D("div",{className:U("bili-video-card__image--wrap",Ii),children:[D("picture",{className:"v-img bili-video-card__cover",children:[p("source",{srcSet:`${S}@672w_378h_1c.webp`,type:"image/webp"}),p("img",{src:`${S}@672w_378h_1c.webp`,alt:v,loading:"lazy"})]}),s&&p(Xd,{item:t,pvideo:_==null?void 0:_.pvideoData,enterCursorState:r}),D("div",{className:`bili-watch-later ${Bi}`,style:{display:s?"flex":"none"},ref:a,onClick:B,children:[p("svg",{className:"bili-watch-later__icon",children:p("use",{xlinkHref:l?"#widget-watch-save":"#widget-watch-later"})}),p("span",{className:"bili-watch-later__tip",style:{display:c?"block":"none"},children:l?"\u79FB\u9664":"\u7A0D\u540E\u518D\u770B"})]}),f&&D("div",{ref:$,className:Ui,onClick:te,style:{display:s?"flex":"none"},children:[p("svg",{className:Yi,children:p("use",{xlinkHref:"#widget-close"})}),p("span",{className:Gi,style:{display:W?"block":"none"},children:"\u6211\u4E0D\u60F3\u770B"})]})]}),p("div",{className:"bili-video-card__mask",children:D("div",{className:"bili-video-card__stats",children:[D("div",{className:"bili-video-card__stats--left",children:[D("span",{className:"bili-video-card__stats--item",children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-play-count"})}),p("span",{className:"bili-video-card__stats--text",children:H})]}),p("span",{className:"bili-video-card__stats--item",children:y==="av"?D(it,{children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-agree"})}),p("span",{className:"bili-video-card__stats--text",children:ne})]}):D(it,{children:[p("svg",{className:"bili-video-card__stats--icon",children:p("use",{xlinkHref:"#widget-agree"})}),p("span",{className:"bili-video-card__stats--text",children:$e})]})})]}),p("span",{className:"bili-video-card__stats__duration",children:oe&&he})]})})]})}),p("div",{className:"bili-video-card__info __scale-disable",children:D("div",{className:"bili-video-card__info--right",children:[p("a",{href:ce,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:p("h3",{className:"bili-video-card__info--tit",title:v,children:v})}),D("p",{className:"bili-video-card__info--bottom",children:[oe&&D("a",{className:"bili-video-card__info--owner",href:`//space.bilibili.com/${k}`,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[ee!=null&&ee.content?p("span",{className:Wi,children:ee.content}):p("svg",{className:"bili-video-card__info--owner__up",children:p("use",{xlinkHref:"#widget-up"})}),p("span",{className:"bili-video-card__info--author",children:P}),A&&D("span",{className:"bili-video-card__info--date",children:["\xB7 ",A]})]}),V&&D("a",{className:"bili-video-card__info--owner",href:ce,target:"_blank",children:[p("span",{className:zi,children:X}),p("span",{className:Hi,children:L})]})]})]})})]})}),qi="_modal-mask_1urmj_1",es="_narrow-mode_1urmj_13",ts="_modal_1urmj_1",ns="_modal-header_1urmj_38",rs="_modal-title_1urmj_46",is="_btn-refresh_1urmj_51",ss="_btn-close_1urmj_52",ct="_modal-body_1urmj_68",rh="_list_1urmj_74",vn="_card_1urmj_77",mn="_active_1urmj_85",as="_video-card-list_1urmj_90",yn="_video-card-body_1urmj_1",os="_loader_1urmj_99",bn="_checkbox_1urmj_104",Th={modalMask:qi,narrowMode:es,modal:ts,modalHeader:ns,modalTitle:rs,btnRefresh:is,btnClose:ss,modalBody:ct,list:rh,card:vn,active:mn,videoCardList:as,videoCardBody:yn,loader:os,checkbox:bn};function ih({show:e,refresh:t,minIndex:n=0,maxIndex:r}){const[i,s]=g.useState(null),a=z(()=>{if(i===null)return!1;const y=document.querySelector(`${_n}.${mn}`),m=document.querySelector(`.${ct}`);if(!y||!m)return!1;const T=m.getBoundingClientRect(),N=y.getBoundingClientRect();return!(N.top-T.top<-(T.height+N.height)||N.top-T.top>T.height*2+N.height)}),c=z((y,m)=>{if(!e)return;m==null||m.preventDefault();const T=a()?i+y:sh();if(!(Tr){us(r);return}s(T),us(T)}}),l=g.useCallback(y=>{c(-1,y)},[]),o=g.useCallback(y=>{c(1,y)},[]);_e("leftarrow",l),_e("rightarrow",o);const u=g.useCallback(y=>{c(-ds(),y)},[]),f=g.useCallback(y=>{c(ds(),y)},[]);_e("uparrow",u),_e("downarrow",f);const h=z(()=>{!i||!e||ah(i)}),v=z(()=>{!e||s(null)});_e("enter",h),_e("esc",v);const d=z(()=>{!e||t()});return _e("r",d,{exactMatch:!0}),{activeIndex:i,clearActiveIndex:v}}function sh(){const e=document.querySelector(`.${ct}`);if(!e)return 0;const t=e.getBoundingClientRect(),n=cs();for(let r=0;r=t.top)return r;return 0}const _n=`#${yn} .${vn}`;function cs(){return[...document.querySelectorAll(_n)]}function ls(e){return cs()[e]}function us(e){var n;const t=ls(e);(n=t==null?void 0:t.scrollIntoViewIfNeeded)==null||n.call(t,!1)}function ah(e){const t=ls(e);if(!t)return;const n=t.querySelector(".bili-video-card__wrap > a");n==null||n.click()}const fs=new Map;function ds(){if(q.useNarrowMode)return 2;let e=fs.get(window.innerWidth);if(e)return e;const t=document.querySelector(_n);if(!t)throw new Error("expect found first card");e=1;const n=t.getBoundingClientRect().top;let r=t.nextElementSibling;for(;r&&r.getBoundingClientRect().top===n;)e++,r=r.nextElementSibling;return fs.set(window.innerWidth,e),e}function hs(){return g.useMemo(()=>crypto.randomUUID(),[])}const oh=g.memo(function({show:t,onHide:n}){const[r,i]=g.useState([]),[s,a]=g.useState(!1),c=g.useRef(null),l=z(async()=>{c.current&&(c.current.scrollTop=0);try{m(),a(!0),i(await Xt(2)),m()}finally{a(!1)}}),o=z(async L=>{const C=await Xt(2);i(w=>[...w,...C])}),{useNarrowMode:u,initialShowMore:f}=Ht(),h=g.useCallback(L=>{const C=L.target.checked;$r({useNarrowMode:C})},[]),v=g.useCallback(L=>{const C=L.target.checked;$r({initialShowMore:C}),C&&ae("\u5DF2\u5F00\u542F\u81EA\u52A8\u67E5\u770B\u66F4\u591A: \u4E0B\u6B21\u6253\u5F00\u9996\u9875\u65F6\u5C06\u76F4\u63A5\u5C55\u793A\u672C\u63A8\u8350\u5F39\u6846")},[]),d=g.useMemo(()=>({[es]:u}),[u]),{activeIndex:y,clearActiveIndex:m}=ih({show:t,refresh:l,maxIndex:r.length-1}),T=hs(),N=hs();return D(yi,{show:t,onHide:n,clsModalMask:U(qi,d),clsModal:U(ts,d),children:[D("div",{className:ns,children:[p("div",{className:rs,children:"\u63A8\u8350"}),p("div",{className:"space",style:{flex:1}}),D(hi,{children:[p("input",{type:"checkbox",className:bn,id:N,checked:f,onChange:v}),p("label",{htmlFor:N,children:"\u81EA\u52A8\u67E5\u770B\u66F4\u591A"}),p("input",{type:"checkbox",className:bn,id:T,checked:u,onChange:h}),p("label",{htmlFor:T,children:"\u542F\u7528\u7A84\u5C4F\u6A21\u5F0F"})]}),D("button",{className:`primary-btn roll-btn ${is}`,onClick:l,children:[p("svg",{children:p("use",{xlinkHref:"#widget-roll"})}),p("span",{children:"\u6362\u4E00\u6362"})]}),D("button",{className:`primary-btn roll-btn ${ss}`,onClick:n,children:[p("svg",{children:p("use",{xlinkHref:"#widget-close"})}),p("span",{children:"\u5173\u95ED"})]})]}),p("div",{className:ct,ref:c,children:p(sn,{pageStart:0,loadMore:o,hasMore:!0,useWindow:!1,threshold:360,style:{minHeight:"100%"},loader:p("div",{className:os,children:"\u52A0\u8F7D\u4E2D..."},0),children:p("div",{className:`video-card-list is-full ${as}`,children:p("div",{id:yn,className:U("video-card-body",d),children:r.map((L,C)=>p(gn,{loading:s,item:L,className:U(vn,{[mn]:C===y})},L.uniqId))})})})})]})}),ps="_grid_svuzk_1",gs="_video-card-list_svuzk_6",Ah={grid:ps,videoCardList:gs,expandBtn:"_expand-btn_svuzk_20",expanded:"_expanded_svuzk_31"};function ch({internalTesting:e=!1}){const t=g.useRef(null),{accessKey:n}=Ht(),r=ri(Vu,{manual:!0}),i=z(async()=>{var T;await r.runAsync()&&((T=t.current)==null||T.set(!1))}),s=Ju,a=z(()=>{const m="https://github.com/indefined/UserScripts/tree/master/bilibiliHome#%E6%8E%88%E6%9D%83%E8%AF%B4%E6%98%8E";window.open(m,"_blank")}),c=g.useMemo(()=>new Array(20).fill(0).map(()=>crypto.randomUUID()),[]),{data:l,loading:o,error:u,refresh:f}=ri(Uu);u&&console.error(u.stack||u);const[h,v]=g.useState(()=>q.initialShowMore),d=g.useCallback(()=>{v(!0)},[]),y=g.useCallback(()=>{v(!1)},[]);return p("section",{className:U("bili-grid",{"no-margin":!e},ps),"data-area":"\u63A8\u8350",children:D("div",{className:`video-card-list is-full ${gs}`,children:[D("div",{className:"area-header",children:[D("div",{className:"left",children:[p("a",{id:"\u5F71\u89C6",className:"the-world area-anchor","data-id":"25"}),p("svg",{className:"icon",children:p("use",{xlinkHref:"#channel-cinephile"})}),p("a",{className:"title",href:"#",children:p("span",{children:"\u63A8\u8350"})})]}),D("div",{className:"right",children:[n?D(hi,{ref:t,children:[p("button",{className:"primary-btn roll-btn",onClick:a,children:p("span",{children:"access_key \u8BF4\u660E"})}),p("button",{className:"primary-btn roll-btn",onClick:()=>i(),disabled:r.loading,children:p("span",{children:"\u91CD\u65B0\u83B7\u53D6 access_key"})}),p("button",{className:"primary-btn roll-btn",onClick:s,children:p("span",{children:"\u5220\u9664 access_key"})})]}):D(it,{children:[p("button",{className:"primary-btn roll-btn",onClick:a,children:p("span",{children:"access_key \u8BF4\u660E"})}),p("button",{className:"primary-btn roll-btn",onClick:i,disabled:r.loading,children:p("span",{children:"\u83B7\u53D6 access_key"})})]}),D("button",{className:"primary-btn roll-btn",onClick:f,children:[p("svg",{style:{transform:"rotate(0deg)"},children:p("use",{xlinkHref:"#widget-roll"})}),p("span",{children:"\u6362\u4E00\u6362"})]}),D("button",{className:"primary-btn see-more",onClick:d,children:[p("span",{children:"\u67E5\u770B\u66F4\u591A"}),p("svg",{children:p("use",{xlinkHref:"#widget-arrow"})})]})]})]}),p(oh,{show:h,onHide:y}),p("div",{className:"video-card-body more-class1 more-class2",children:o||u?c.map(m=>p(gn,{},m)):l.map(m=>p(gn,{item:m},m.uniqId))})]})})}(function(){var t;if(location.href.startsWith("https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?"))return window.stop(),(t=window.top)==null?void 0:t.postMessage(location.href,"https://www.bilibili.com");if(location.pathname==="/")return lh()})();async function lh(){const t=Date.now()+1e4;let n=null,r=!1;for(;;){if(document.querySelector(".bili-layout > section.bili-grid")){n=document.querySelector(".bili-layout > section.bili-grid");break}if(uh()&&document.querySelector(".recommended-container")){r=!0,n=document.querySelector(".recommended-container");break}if(Date.now()>t)break;await Ut.exports(100)}if(!n){console.error("[bilibili-app-recommend]: init fail");return}const i=document.createElement("section");n.insertAdjacentElement("afterend",i),Gt(i).render(p(ch,{internalTesting:r}))}function uh(){var e;return((e=document.querySelector("button.go-back"))==null?void 0:e.innerText.trim())==="\u9000\u51FA\u5185\u6D4B"}})(React,ReactDOM,axios,axiosGmxhrAdapter);