// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.3.4 // @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 https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png // @match *://www.bilibili.com/ // @require https://unpkg.com/jquery@3.6.0/dist/jquery.min.js // @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.1.0/umd/react.production.min.js // @require https://unpkg.com/react-dom@18.1.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_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant unsafeWindow // @downloadURL none // ==/UserScript== ;(({ cssTextList = [] }) => { cssTextList.forEach((s) => { const style = document.createElement("style"); style.innerText = s; style.dataset.source = "vite-plugin-monkey"; document.head.appendChild(style); }); })({ "cssTextList": [ "._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}._bili-video-card_14zjz_1{position:relative}._image-wrapper_14zjz_4{border-radius:6px;overflow:hidden}._preview-card-wrapper_14zjz_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}._watch-later_14zjz_21{z-index:3}._badge_14zjz_24{color:#fa6a9d;border-radius:2px;border:1px #fa6a9d solid;line-height:20px;padding:0 10px;transform:scale(.8)}._recommend-reason_14zjz_32{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_14zjz_47{color:default}._btn-dislike_14zjz_50{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_14zjz_50 ._btn-dislike-icon_14zjz_65{pointer-events:none;user-select:none;width:12px;height:12px;color:#fff}._btn-dislike_14zjz_50 ._btn-dislike-tip_14zjz_72{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_14zjz_87{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_14zjz_87{border:1px solid #333}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101{border-top-left-radius:6px;border-top-right-radius:6px;padding-top:56.25%;position:relative}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-icon_14zjz_118{color:inherit}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-reason_14zjz_121{font-size:20px;text-align:center}._disliked-wrapper_14zjz_87 ._dislike-content-cover_14zjz_101 ._dislike-content-cover-inner_14zjz_107 ._dislike-desc_14zjz_125{font-size:16px;text-align:center}._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129{flex:1;width:100%;border-top:1px solid #eee;display:flex;align-items:center;justify-content:center}body.dark ._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129{border-top:1px solid #333}._disliked-wrapper_14zjz_87 ._dislike-content-action_14zjz_129 button{font-size:18px;color:inherit}._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}._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_p5dvw_1{color:default}@media (min-width: 2200px){._video-card-list_p5dvw_5.is-full{grid-column:span 7!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2{grid-column:span 7!important;grid-template-columns:repeat(7,1fr)!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2>*{display:block!important}._video-card-list_p5dvw_5.is-full .video-card-body.more-class1.more-class2>*:nth-of-type(1n + 15){display:none!important}}._expand-btn_p5dvw_19{padding:0;width:31px;height:31px;border-radius:50%}._expand-btn_p5dvw_19 svg{width:13px;height:13px;transform:rotate(180deg)}._expand-btn_p5dvw_19 svg._expanded_p5dvw_30{transform:rotate(0)}\n" ] }); var Sd=Object.defineProperty,Td=Object.defineProperties;var xd=Object.getOwnPropertyDescriptors;var lt=Object.getOwnPropertySymbols;var es=Object.prototype.hasOwnProperty,ts=Object.prototype.propertyIsEnumerable;var hr=(p,W,U)=>W in p?Sd(p,W,{enumerable:!0,configurable:!0,writable:!0,value:U}):p[W]=U,be=(p,W)=>{for(var U in W||(W={}))es.call(W,U)&&hr(p,U,W[U]);if(lt)for(var U of lt(W))ts.call(W,U)&&hr(p,U,W[U]);return p},Ce=(p,W)=>Td(p,xd(W));var rs=(p,W)=>{var U={};for(var Z in p)es.call(p,Z)&&W.indexOf(Z)<0&&(U[Z]=p[Z]);if(p!=null&<)for(var Z of lt(p))W.indexOf(Z)<0&&ts.call(p,Z)&&(U[Z]=p[Z]);return U};var pr=(p,W,U)=>(hr(p,typeof W!="symbol"?W+"":W,U),U);(function(p,W,U,Z,ns){"use strict";function Oe(e){return e&&typeof e=="object"&&"default"in e?e:{default:e}}var ct=Oe(p),Ae=Oe(W),is=Oe(U),ut=Oe(Z),ss=Oe(ns);const ft=Symbol(),as=Symbol(),dt=Symbol(),ht=Object.getPrototypeOf,pt=new WeakMap,vr=e=>e&&(pt.has(e)?pt.get(e):ht(e)===Object.prototype||ht(e)===Array.prototype),vt=e=>typeof e=="object"&&e!==null,os=(e,t)=>{let r=!1;const n=(s,a,l)=>{if(!r){let c=s.a.get(e);c||(c=new Set,s.a.set(e,c)),l&&c.has(ft)||c.add(a)}},i={f:t,get(s,a){return a===dt?e:(n(this,a),mr(s[a],this.a,this.c))},has(s,a){return a===as?(r=!0,this.a.delete(e),!0):(n(this,a),a in s)},getOwnPropertyDescriptor(s,a){return n(this,a,!0),Object.getOwnPropertyDescriptor(s,a)},ownKeys(s){return n(this,ft),Reflect.ownKeys(s)}};return t&&(i.set=i.deleteProperty=()=>!1),i},mr=(e,t,r)=>{if(!vr(e))return e;const n=e[dt]||e,i=(a=>Object.isFrozen(a)||Object.values(Object.getOwnPropertyDescriptors(a)).some(l=>!l.writable))(n);let s=r&&r.get(n);return s&&s.f===i||(s=os(n,i),s.p=new Proxy(i?(a=>{if(Array.isArray(a))return Array.from(a);const l=Object.getOwnPropertyDescriptors(a);return Object.values(l).forEach(c=>{c.configurable=!0}),Object.create(ht(a),l)})(n):n,s),r&&r.set(n,s)),s.a=t,s.c=r,s.p},ls=(e,t)=>{const r=Reflect.ownKeys(e),n=Reflect.ownKeys(t);return r.length!==n.length||r.some((i,s)=>i!==n[s])},gr=(e,t,r,n)=>{if(Object.is(e,t))return!1;if(!vt(e)||!vt(t))return!0;const i=r.get(e);if(!i)return!0;if(n){const a=n.get(e);if(a&&a.n===t)return a.g;n.set(e,{n:t,g:!1})}let s=null;for(const a of i){const l=a===ft?ls(e,t):gr(e[a],t[a],r,n);if(l!==!0&&l!==!1||(s=l),s)break}return s===null&&(s=!0),n&&n.set(e,{n:t,g:s}),s},cs=e=>vr(e)&&e[dt]||null,yr=(e,t)=>{pt.set(e,t)},us=(e,t)=>{const r=[],n=new WeakSet,i=(s,a)=>{if(n.has(s))return;vt(s)&&n.add(s);const l=t.get(s);l?l.forEach(c=>{i(s[c],a?[...a,c]:[c])}):a&&r.push(a)};return i(e),r};var fs=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{},br={exports:{}},_r={};/** * @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 _e=ct.default;function ds(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hs=typeof Object.is=="function"?Object.is:ds,ps=_e.useState,vs=_e.useEffect,ms=_e.useLayoutEffect,gs=_e.useDebugValue;function ys(e,t){var r=t(),n=ps({inst:{value:r,getSnapshot:t}}),i=n[0].inst,s=n[1];return ms(function(){i.value=r,i.getSnapshot=t,mt(i)&&s({inst:i})},[e,r,t]),vs(function(){return mt(i)&&s({inst:i}),e(function(){mt(i)&&s({inst:i})})},[e]),gs(r),r}function mt(e){var t=e.getSnapshot;e=e.value;try{var r=t();return!hs(e,r)}catch{return!0}}function bs(e,t){return t()}var _s=typeof window=="undefined"||typeof window.document=="undefined"||typeof window.document.createElement=="undefined"?bs:ys;_r.useSyncExternalStore=_e.useSyncExternalStore!==void 0?_e.useSyncExternalStore:_s,br.exports=_r;var ws=br.exports;const Ss=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("VERSION"):Symbol(),ee=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("LISTENERS"):Symbol(),We=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("SNAPSHOT"):Symbol(),Ts=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("HANDLER"):Symbol(),Re=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("PROMISE_RESULT"):Symbol(),wr=({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"?Symbol("PROMISE_ERROR"):Symbol(),Sr=new WeakSet,gt=e=>typeof e=="object"&&e!==null,xs=e=>gt(e)&&!Sr.has(e)&&(Array.isArray(e)||!(Symbol.iterator in e))&&!(e instanceof WeakMap)&&!(e instanceof WeakSet)&&!(e instanceof Error)&&!(e instanceof Number)&&!(e instanceof Date)&&!(e instanceof String)&&!(e instanceof RegExp)&&!(e instanceof ArrayBuffer),Tr=new WeakMap;let xr=1;const Er=new WeakMap;function He(e={}){if(!gt(e))throw new Error("object required");const t=Tr.get(e);if(t)return t;let r=xr;const n=new Set,i=(h,v=++xr)=>{r!==v&&(r=v,n.forEach(d=>d(h,v)))},s=new Map,a=h=>{let v=s.get(h);return v||(v=(d,y)=>{const g=[...d];g[1]=[h,...g[1]],i(g,y)},s.set(h,v)),v},l=h=>{const v=s.get(h);return s.delete(h),v},c=(h,v)=>{const d=Er.get(v);if((d==null?void 0:d[0])===r)return d[1];const y=Array.isArray(h)?[]:Object.create(Object.getPrototypeOf(h));return yr(y,!0),Er.set(v,[r,y]),Reflect.ownKeys(h).forEach(g=>{const b=Reflect.get(h,g,v);if(Sr.has(b))yr(b,!1),y[g]=b;else if(b instanceof Promise)if(Re in b)y[g]=b[Re];else{const R=b[wr]||b;Object.defineProperty(y,g,{get(){if(Re in b)return b[Re];throw R}})}else b!=null&&b[ee]?y[g]=b[We]:y[g]=b}),Object.freeze(y),y},o=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e)),u={get(h,v,d){return v===Ss?r:v===ee?n:v===We?c(h,d):v===Ts?u:Reflect.get(h,v,d)},deleteProperty(h,v){const d=Reflect.get(h,v),y=d==null?void 0:d[ee];y&&y.delete(l(v));const g=Reflect.deleteProperty(h,v);return g&&i(["delete",[v],d]),g},is:Object.is,canProxy:xs,set(h,v,d,y){var g;const b=Reflect.has(h,v),R=Reflect.get(h,v,y);if(b&&this.is(R,d))return!0;const D=R==null?void 0:R[ee];D&&D.delete(l(v)),gt(d)&&(d=cs(d)||d);let T;return(g=Object.getOwnPropertyDescriptor(h,v))!=null&&g.set?T=d:d instanceof Promise?T=d.then(x=>(T[Re]=x,i(["resolve",[v],x]),x)).catch(x=>{T[wr]=x,i(["reject",[v],x])}):d!=null&&d[ee]?(T=d,T[ee].add(a(v))):this.canProxy(d)?(T=He(d),T[ee].add(a(v))):T=d,Reflect.set(h,v,T,y),i(["set",[v],d,R]),!0}},f=new Proxy(o,u);return Tr.set(e,f),Reflect.ownKeys(e).forEach(h=>{const v=Object.getOwnPropertyDescriptor(e,h);v.get||v.set?Object.defineProperty(o,h,v):f[h]=e[h]}),f}function Es(e,t,r){({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[ee])&&console.warn("Please use proxy object");let n;const i=[],s=a=>{if(i.push(a),r){t(i.splice(0));return}n||(n=Promise.resolve().then(()=>{n=void 0,t(i.splice(0))}))};return e[ee].add(s),()=>{e[ee].delete(s)}}function Cr(e){return({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&!(e!=null&&e[We])&&console.warn("Please use proxy object"),e[We]}const{useSyncExternalStore:Cs}=ws,Os=(e,t)=>{const r=p.useRef();p.useEffect(()=>{r.current=us(e,t)}),p.useDebugValue(r.current)};function yt(e,t){const r=t==null?void 0:t.sync,n=p.useRef(),i=p.useRef();let s=!0;const a=Cs(p.useCallback(o=>{const u=Es(e,o,r);return o(),u},[e,r]),()=>{const o=Cr(e);try{if(!s&&n.current&&i.current&&!gr(n.current,o,i.current,new WeakMap))return n.current}catch{}return o},()=>Cr(e));s=!1;const l=new WeakMap;p.useEffect(()=>{n.current=a,i.current=l}),({BASE_URL:"/",MODE:"production",DEV:!1,PROD:!0}&&"production")!=="production"&&Os(a,l);const c=p.useMemo(()=>new WeakMap,[]);return mr(a,l,c)}const le=He({accessKey:"",useNarrowMode:!1,initialShowMore:!1}),bt=function(){return yt(le)},Or="bilibili-app-recommend.config";function As(){const e=GM_getValue(Or);e&&typeof e=="object"&&Object.assign(le,e)}function Rs(){GM_setValue(Or,le)}function Ue(e){Object.assign(le,e),Rs()}As();var _t={exports:{}};const Ms=(e,t)=>Math.floor(Math.random()*(t-e+1)+e),Ar=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},Rr=({clearTimeout:e,setTimeout:t,willResolve:r})=>(n,{value:i,signal:s}={})=>{if(s&&s.aborted)return Promise.reject(Ar());let a,l,c;const o=e||clearTimeout,u=()=>{o(a),c(Ar())},f=()=>{s&&s.removeEventListener("abort",u)},h=new Promise((v,d)=>{l=()=>{f(),r?v(i):d(i)},c=d,a=(t||setTimeout)(l,n)});return s&&s.addEventListener("abort",u,{once:!0}),h.clear=()=>{o(a),a=null,l()},h},Mr=e=>{const t=Rr(Ce(be({},e),{willResolve:!0}));return t.reject=Rr(Ce(be({},e),{willResolve:!1})),t.range=(r,n,i)=>t(Ms(r,n),i),t},wt=Mr();wt.createWithTimers=Mr,_t.exports=wt,_t.exports.default=wt;var Pr=_t.exports,St,Ps=is.default;St=Ps.createRoot;var Ds=function(t){return function(r,n){var i=p.useRef(!1);t(function(){return function(){i.current=!1}},[]),t(function(){if(!i.current)i.current=!0;else return r()},n)}},Tt=function(t){return typeof t=="function"},Ls=function(t){return typeof t=="string"},Dr=function(t){return typeof t=="number"};function H(e){var t=p.useRef(e);t.current=p.useMemo(function(){return e},[e]);var r=p.useRef();return r.current||(r.current=function(){for(var n=[],i=0;i0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Lr=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t-1&&(s=setTimeout(function(){Ve.delete(t)},r)),Ve.set(t,Ye(Ye({},n),{timer:s}))},Is=function(t){return Ve.get(t)},Ge=new Map,zs=function(t){return Ge.get(t)},$s=function(t,r){Ge.set(t,r),r.then(function(n){return Ge.delete(t),n}).catch(function(){Ge.delete(t)})},ce={},Bs=function(t,r){ce[t]&&ce[t].forEach(function(n){return n(r)})},Ct=function(t,r){return ce[t]||(ce[t]=[]),ce[t].push(r),function(){var i=ce[t].indexOf(r);ce[t].splice(i,1)}},Ws=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Hs=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t=t||F<0||f&&z>=s}function b(){var C=Ot();if(g(C))return R(C);l=setTimeout(b,y(C))}function R(C){return l=void 0,h&&n?v(C):(n=i=void 0,a)}function D(){l!==void 0&&clearTimeout(l),o=0,n=c=i=l=void 0}function T(){return l===void 0?a:R(Ot())}function x(){var C=Ot(),F=g(C);if(n=arguments,i=this,c=C,F){if(l===void 0)return d(c);if(f)return clearTimeout(l),l=setTimeout(b,t),v(c)}return l===void 0&&(l=setTimeout(b,t)),a}return x.cancel=D,x.flush=T,x}var ga=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},ya=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Aa=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},za=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Ya=function(){var t=Ua(p.useState({}),2),r=t[1];return p.useCallback(function(){return r({})},[])},Va=Ya,ae=globalThis&&globalThis.__assign||function(){return ae=Object.assign||function(e){for(var t,r=1,n=arguments.length;r0&&s[s.length-1])&&(o[0]===6||o[0]===2)){r=0;continue}if(o[0]===3&&(!s||o[1]>s[0]&&o[1]0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},xe=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},Hr=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},no=globalThis&&globalThis.__spread||function(){for(var e=[],t=0;t0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function Ur(e,t){e===void 0&&(e=!1);var r=so(p.useState(e),2),n=r[0],i=r[1],s=p.useMemo(function(){var a=t===void 0?!e:t,l=function(){return i(function(h){return h===e?a:e})},c=function(h){return i(h)},o=function(){return i(e)},u=function(){return i(a)};return{toggle:l,set:c,setLeft:o,setRight:u}},[]);return[n,s]}var ao=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function oo(e){e===void 0&&(e=!1);var t=ao(Ur(e),2),r=t[0],n=t[1],i=n.toggle,s=n.set,a=p.useMemo(function(){var l=function(){return s(!0)},c=function(){return s(!1)};return{toggle:i,set:function(u){return s(!!u)},setTrue:l,setFalse:c}},[]);return[r,a]}var lo=!!(typeof window!="undefined"&&window.document&&window.document.createElement),co=lo;function Xe(e,t){if(!!co){if(!e)return t;var r;return Tt(e)?r=e():"current"in e?r=e.current:r=e,r}}var uo=function(t){var r=function(i,s,a){var l=p.useRef(!1),c=p.useRef([]),o=p.useRef([]),u=p.useRef();t(function(){var f,h=Array.isArray(a)?a:[a],v=h.map(function(d){return Xe(d)});if(!l.current){l.current=!0,c.current=v,o.current=s,u.current=i();return}(v.length!==c.current.length||!Et(v,c.current)||!Et(s,o.current))&&((f=u.current)===null||f===void 0||f.call(u),c.current=v,o.current=s,u.current=i())}),Pe(function(){var f;(f=u.current)===null||f===void 0||f.call(u),l.current=!1})};return r},fo=uo,ho=fo(p.useEffect),Yr=ho,Vr={exports:{}};(function(e,t){(function(r,n){e.exports=n()})(fs,function(){var r=1e3,n=6e4,i=36e5,s="millisecond",a="second",l="minute",c="hour",o="day",u="week",f="month",h="quarter",v="year",d="date",y="Invalid Date",g=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,b=/\[([^\]]+)]|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,R={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("_")},D=function(E,S,_){var O=String(E);return!O||O.length>=S?E:""+Array(S+1-O.length).join(_)+E},T={s:D,z:function(E){var S=-E.utcOffset(),_=Math.abs(S),O=Math.floor(_/60),w=_%60;return(S<=0?"+":"-")+D(O,2,"0")+":"+D(w,2,"0")},m:function E(S,_){if(S.date()<_.date())return-E(_,S);var O=12*(_.year()-S.year())+(_.month()-S.month()),w=S.clone().add(O,f),A=_-w<0,M=S.clone().add(O+(A?-1:1),f);return+(-(O+(_-w)/(A?w-M:M-w))||0)},a:function(E){return E<0?Math.ceil(E)||0:Math.floor(E)},p:function(E){return{M:f,y:v,w:u,d:o,D:d,h:c,m:l,s:a,ms:s,Q:h}[E]||String(E||"").toLowerCase().replace(/s$/,"")},u:function(E){return E===void 0}},x="en",C={};C[x]=R;var F=function(E){return E instanceof G},z=function E(S,_,O){var w;if(!S)return x;if(typeof S=="string"){var A=S.toLowerCase();C[A]&&(w=A),_&&(C[A]=_,w=A);var M=S.split("-");if(!w&&M.length>1)return E(M[0])}else{var N=S.name;C[N]=S,w=N}return!O&&w&&(x=w),w||!O&&x},k=function(E,S){if(F(E))return E.clone();var _=typeof S=="object"?S:{};return _.date=E,_.args=arguments,new G(_)},L=T;L.l=z,L.i=F,L.w=function(E,S){return k(E,{locale:S.$L,utc:S.$u,x:S.$x,$offset:S.$offset})};var G=function(){function E(_){this.$L=z(_.locale,null,!0),this.parse(_)}var S=E.prototype;return S.parse=function(_){this.$d=function(O){var w=O.date,A=O.utc;if(w===null)return new Date(NaN);if(L.u(w))return new Date;if(w instanceof Date)return new Date(w);if(typeof w=="string"&&!/Z$/i.test(w)){var M=w.match(g);if(M){var N=M[2]-1||0,B=(M[7]||"0").substring(0,3);return A?new Date(Date.UTC(M[1],N,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)):new Date(M[1],N,M[3]||1,M[4]||0,M[5]||0,M[6]||0,B)}}return new Date(w)}(_),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 L},S.isValid=function(){return this.$d.toString()!==y},S.isSame=function(_,O){var w=k(_);return this.startOf(O)<=w&&w<=this.endOf(O)},S.isAfter=function(_,O){return k(_)-1}function _o(e,t){var r=this.__data__,n=Je(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ne(e){var t=-1,r=e==null?0:e.length;for(this.clear();++tl))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=r&vl?new Qe:void 0;for(s.set(e,t),s.set(t,e);++f-1&&e%1==0&&e-1&&e%1==0&&e<=tc}var rc="[object Arguments]",nc="[object Array]",ic="[object Boolean]",sc="[object Date]",ac="[object Error]",oc="[object Function]",lc="[object Map]",cc="[object Number]",uc="[object Object]",fc="[object RegExp]",dc="[object Set]",hc="[object String]",pc="[object WeakMap]",vc="[object ArrayBuffer]",mc="[object DataView]",gc="[object Float32Array]",yc="[object Float64Array]",bc="[object Int8Array]",_c="[object Int16Array]",wc="[object Int32Array]",Sc="[object Uint8Array]",Tc="[object Uint8ClampedArray]",xc="[object Uint16Array]",Ec="[object Uint32Array]",j={};j[gc]=j[yc]=j[bc]=j[_c]=j[wc]=j[Sc]=j[Tc]=j[xc]=j[Ec]=!0,j[rc]=j[nc]=j[vc]=j[ic]=j[mc]=j[sc]=j[ac]=j[oc]=j[lc]=j[cc]=j[uc]=j[fc]=j[dc]=j[hc]=j[pc]=!1;function Cc(e){return Te(e)&&on(e.length)&&!!j[Se(e)]}function Oc(e){return function(t){return e(t)}}var ln=typeof exports=="object"&&exports&&!exports.nodeType&&exports,Ie=ln&&typeof module=="object"&&module&&!module.nodeType&&module,Ac=Ie&&Ie.exports===ln,Nt=Ac&&jr.process,Rc=function(){try{var e=Ie&&Ie.require&&Ie.require("util").types;return e||Nt&&Nt.binding&&Nt.binding("util")}catch{}}(),cn=Rc,un=cn&&cn.isTypedArray,Mc=un?Oc(un):Cc,fn=Mc,Pc=Object.prototype,Dc=Pc.hasOwnProperty;function Lc(e,t){var r=Fe(e),n=!r&&Gl(e),i=!r&&!n&&Lt(e),s=!r&&!n&&!i&&fn(e),a=r||n||i||s,l=a?Wl(e.length,String):[],c=l.length;for(var o in e)(t||Dc.call(e,o))&&!(a&&(o=="length"||i&&(o=="offset"||o=="parent")||s&&(o=="buffer"||o=="byteLength"||o=="byteOffset")||ec(o,c)))&&l.push(o);return l}var Nc=Object.prototype;function kc(e){var t=e&&e.constructor,r=typeof t=="function"&&t.prototype||Nc;return e===r}function jc(e,t){return function(r){return e(t(r))}}var Fc=jc(Object.keys,Object),Ic=Fc,zc=Object.prototype,$c=zc.hasOwnProperty;function Bc(e){if(!kc(e))return Ic(e);var t=[];for(var r in Object(e))$c.call(e,r)&&r!="constructor"&&t.push(r);return t}function Wc(e){return e!=null&&on(e.length)&&!Xr(e)}function Hc(e){return Wc(e)?Lc(e):Bc(e)}function dn(e){return kl(e,Hc,Bl)}var Uc=1,Yc=Object.prototype,Vc=Yc.hasOwnProperty;function Gc(e,t,r,n,i,s){var a=r&Uc,l=dn(e),c=l.length,o=dn(t),u=o.length;if(c!=u&&!a)return!1;for(var f=c;f--;){var h=l[f];if(!(a?h in t:Vc.call(t,h)))return!1}var v=s.get(e),d=s.get(t);if(v&&d)return v==t&&d==e;var y=!0;s.set(e,t),s.set(t,e);for(var g=a;++f0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},$t=function(e,t){var r=t||{},n=r.onEnter,i=r.onLeave,s=lu(oo(!1),2),a=s[0],l=s[1],c=l.setTrue,o=l.setFalse;return zt("mouseenter",function(){n==null||n(),c()},{target:e}),zt("mouseleave",function(){i==null||i(),o()},{target:e}),a},cu=function(t,r){return r===void 0&&(r=[]),ou(t,r)},uu=function(t,r,n){var i=p.useRef(),s=p.useRef(0);cu(r,i.current)||(i.current=r,s.current+=1),Yr(t,[s.current],n)},fu=uu,Bt=globalThis&&globalThis.__values||function(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")},du={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},Wt={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 hu(e){var t=Object.keys(Wt).reduce(function(r,n){return Wt[n](e)?r+1:r},0);return[16,17,18,91,92].includes(e.keyCode)?t:t+1}function Tn(e,t,r){var n,i;if(!e.key)return!1;if(Dr(t))return e.keyCode===t;var s=t.split("."),a=0;try{for(var l=Bt(s),c=l.next();!c.done;c=l.next()){var o=c.value,u=Wt[o],f=du[o.toLowerCase()];(u&&u(e)||f&&f===e.keyCode)&&a++}}catch(h){n={error:h}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(n)throw n.error}}return r?a===s.length&&hu(e)===s.length:a===s.length}function pu(e,t){return Tt(e)?e:Ls(e)||Dr(e)?function(r){return Tn(r,e,t)}:Array.isArray(e)?function(r){return e.some(function(n){return Tn(r,n,t)})}:e?function(){return!0}:function(){return!1}}var vu=["keydown"];function pe(e,t,r){var n=r||{},i=n.events,s=i===void 0?vu:i,a=n.target,l=n.exactMatch,c=l===void 0?!1:l,o=Me(t),u=Me(e);fu(function(){var f,h,v,d=Xe(a,window);if(!!d){var y=function(T){var x,C=pu(u.current,c);if(C(T))return(x=o.current)===null||x===void 0?void 0:x.call(o,T)};try{for(var g=Bt(s),b=g.next();!b.done;b=g.next()){var R=b.value;(v=d==null?void 0:d.addEventListener)===null||v===void 0||v.call(d,R,y)}}catch(D){f={error:D}}finally{try{b&&!b.done&&(h=g.return)&&h.call(g)}finally{if(f)throw f.error}}return function(){var D,T,x;try{for(var C=Bt(s),F=C.next();!F.done;F=C.next()){var z=F.value;(x=d==null?void 0:d.removeEventListener)===null||x===void 0||x.call(d,z,y)}}catch(k){D={error:k}}finally{try{F&&!F.done&&(T=C.return)&&T.call(C)}finally{if(D)throw D.error}}}}},[s],a)}var mu=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s};function gu(e){var t=p.useRef(0),r=mu(p.useState(e),2),n=r[0],i=r[1],s=p.useCallback(function(a){cancelAnimationFrame(t.current),t.current=requestAnimationFrame(function(){i(a)})},[]);return Pe(function(){cancelAnimationFrame(t.current)}),[n,s]}var yu=globalThis&&globalThis.__read||function(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,s=[],a;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)s.push(i.value)}catch(l){a={error:l}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return s},bu={screenX:NaN,screenY:NaN,clientX:NaN,clientY:NaN,pageX:NaN,pageY:NaN,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},_u=function(e){var t=yu(gu(bu),2),r=t[0],n=t[1];return zt("mousemove",function(i){var s=i.screenX,a=i.screenY,l=i.clientX,c=i.clientY,o=i.pageX,u=i.pageY,f={screenX:s,screenY:a,clientX:l,clientY:c,pageX:o,pageY:u,elementX:NaN,elementY:NaN,elementH:NaN,elementW:NaN,elementPosX:NaN,elementPosY:NaN},h=Xe(e);if(h){var v=h.getBoundingClientRect(),d=v.left,y=v.top,g=v.width,b=v.height;f.elementPosX=d+window.pageXOffset,f.elementPosY=y+window.pageYOffset,f.elementX=o-f.elementPosX,f.elementY=u-f.elementPosY,f.elementW=g,f.elementH=b}n(f)},{target:function(){return document}}),r},xn={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 r(){for(var n=[],i=0;i{if(e.config.responseType==="json"&&e.data&&e.data instanceof ArrayBuffer){const t=new TextDecoder,r=new Uint8Array(e.data),n=t.decode(r);e.data=n;try{e.data=JSON.parse(n)}catch{}}return e});async function Su(){return(await et.get(En+"/x/feed/index",{responseType:"json",params:{build:"1",mobi_app:"android",idx:(Date.now()/1e3).toFixed(0)}})).data.data}async function Tu(){return Ut(2)}async function Ut(e){const t=new Array(e).fill(0).map(i=>Su());let n=(await Promise.all(t)).reduce((i,s)=>i.concat(s),[]);return n=xu(n),n.map(i=>Ce(be({},i),{uniqId:i.param+"-"+crypto.randomUUID()}))}function xu(e){const t=new Set;return e=e.filter(r=>{const{param:n}=r;return t.has(n)?(console.log("[bilibili-app-recommend]: [uniqRecList]: duplicate",r),!1):(t.add(n),!0)}),e}const Cn="_toast-container_9119l_1";var Cd={toastContainer:Cn};function ie(e,t=2e3){const r=Ae.default(`
${e}
`);r.appendTo(document.body),setTimeout(()=>r.remove(),t)}const Eu="\u8BF7\u6C42\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!",Cu="\u64CD\u4F5C\u5931\u8D25, \u8BF7\u91CD\u8BD5 !!!";function On(){return ie(Eu)}function An(){return ie(Cu)}async function Ou(){var c,o;const t=(await ut.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(!((c=t==null?void 0:t.data)!=null&&c.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 r=t.data.confirm_uri;let n;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])}),n=setTimeout(()=>{u({errmsg:"\u83B7\u53D6\u6388\u6743\u8D85\u65F6"})},5e3)}),s=Ae.default(`