// ==UserScript== // @name bilibili-app-recommend // @namespace https://magicdawn.fun // @version 0.0.2 // @description Add app like recommend part to bilibili homepage // @description:zh-CN 为B站首页添加像App一样的推荐 // @author magicdawn // @supportURL https://github.com/magicdawn/bilibili-app-recommend/issues // @homepageURL https://github.com/magicdawn/bilibili-app-recommend // // @grant GM_registerMenuCommand // @grant GM_notification // @grant unsafeWindow // @grant GM_xmlhttpRequest // @grant GM_getValue // @grant GM_setValue // @grant GM_deleteValue // @grant GM_addElement // @grant GM.xmlHttpRequest // // @match *://www.bilibili.com/* // @include https://www.mcbbs.net/template/mcbbs/image/special_photo_bg.png?* // // @connect app.bilibili.com // @connect passport.bilibili.com // @connect link.acg.tv // @connect www.mcbbs.net // // @require https://cdn.jsdelivr.net/npm/axios@0.22.0/dist/axios.min.js // @require https://cdn.jsdelivr.net/npm/axios-userscript-adapter@0.1.11/dist/axiosGmxhrAdapter.min.js // @require https://cdn.jsdelivr.net/npm/jquery@3.4.1/dist/jquery.min.js // @require https://cdn.jsdelivr.net/npm/react@18/umd/react.production.min.js // @require https://cdn.jsdelivr.net/npm/react-dom@18/umd/react-dom.production.min.js // @require https://cdn.jsdelivr.net/npm/react-bootstrap@2.2.3/dist/react-bootstrap.min.js // // @license MIT // @downloadURL none // ==/UserScript== (()=>{var i={803:(e,t)=>{var i;!function(){"use strict";var o={}.hasOwnProperty;function a(){for(var e=[],t=0;t{"use strict";i.d(t,{K9:()=>s,Kh:()=>c,Tr:()=>o,X3:()=>a,YD:()=>d,ZP:()=>h,jm:()=>l,oC:()=>r,o_:()=>u});var t=i(117),t=i.n(t),n=i(488),i=i.n(n)()(t()),r=(i.push([e.id,".modal_VuPWb {\n z-index: 11000 !important;\n overflow: hidden;\n}\n.modal_VuPWb .modal-dialog_hC8CD {\n width: calc(100vw - 50px);\n max-width: none !important;\n margin-top: 25px;\n height: calc(100vh - 50px);\n}\n.modal_VuPWb .modal-dialog_hC8CD .modal-content_hTQbP {\n height: 100%;\n border: 1px solid #fa6a9d;\n border-radius: 10px;\n overflow: hidden;\n}\n.modal_VuPWb .modal-dialog_hC8CD .modal-header_LjV9S {\n padding-top: 10px;\n padding-bottom: 10px;\n border-bottom: none;\n}\nbody.dark .modal_VuPWb .modal-dialog_hC8CD .modal-header_LjV9S .btn-refresh_UAaHz,\nbody.dark .modal_VuPWb .modal-dialog_hC8CD .modal-header_LjV9S .btn-close_Sew_b {\n color: #eee !important;\n background-color: #333 !important;\n border-color: transparent !important;\n height: auto;\n padding: 8px 12px;\n line-height: 16px;\n font-size: 13px;\n}\n.modal_VuPWb .modal-dialog_hC8CD .modal-header_LjV9S .btn-close_Sew_b {\n margin-left: 10px;\n}\n.modal_VuPWb .modal-dialog_hC8CD .modal-body_cCBH_ {\n padding-top: 0;\n flex-grow: 1;\n overflow-y: scroll;\n}\n.list_ATnXW {\n color: inherit;\n}\n.card_j5epc {\n color: inherit;\n}\n.video-card-list_TnzRe.is-full .video-card-body.more-class1.more-class2 > * {\n display: block !important;\n}\n",""]),"modal_VuPWb"),s="modal-dialog_hC8CD",o="modal-content_hTQbP",a="modal-header_LjV9S",l="btn-refresh_UAaHz",c="btn-close_Sew_b",u="modal-body_cCBH_",d="video-card-list_TnzRe";const h=i},730:(e,t,i)=>{"use strict";i.d(t,{Nd:()=>a,R0:()=>o,Rs:()=>l,ZP:()=>c,Zl:()=>s,sN:()=>r});var t=i(117),t=i.n(t),n=i(488),i=i.n(n)()(t()),r=(i.push([e.id,".preview-card-wrapper_obs_2 {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n z-index: 2;\n border-radius: inherit;\n}\n.watch-later_QtZPa {\n z-index: 3;\n}\n.badge_oIZF5 {\n color: #fa6a9d;\n border-radius: 2px;\n border: 1px #fa6a9d solid;\n line-height: 20px;\n padding: 0 10px;\n transform: scale(0.8);\n}\n.recommend-reason__Cdvz {\n text-overflow: ellipsis;\n overflow: hidden;\n white-space: nowrap;\n display: inline-block;\n color: var(--Or5);\n background-color: var(--Or1);\n border-radius: 4px;\n margin-right: 4px;\n font-size: var(--follow-icon-font-size);\n line-height: var(--follow-icon-line-height);\n height: var(--follow-icon-line-height);\n padding: 0 4px;\n cursor: default;\n}\n.bangumi-desc_dFbZr {\n color: default;\n}\n",""]),"preview-card-wrapper_obs_2"),s="watch-later_QtZPa",o="badge_oIZF5",a="recommend-reason__Cdvz",l="bangumi-desc_dFbZr";const c=i},181:(e,t,i)=>{"use strict";i.d(t,{YD:()=>s,ZP:()=>o,eC:()=>r});var t=i(117),t=i.n(t),n=i(488),i=i.n(n)()(t()),r=(i.push([e.id,".grid_L8TTJ {\n color: default;\n}\n@media (min-width: 2200px) {\n .video-card-list_dUuWi.is-full {\n grid-column: span 7 !important;\n }\n .video-card-list_dUuWi.is-full .video-card-body.more-class1.more-class2 {\n grid-column: span 7 !important;\n grid-template-columns: repeat(7, 1fr) !important;\n }\n .video-card-list_dUuWi.is-full .video-card-body.more-class1.more-class2 > * {\n display: block !important;\n }\n .video-card-list_dUuWi.is-full .video-card-body.more-class1.more-class2 > *:nth-of-type(1n + 15) {\n display: none !important;\n }\n}\n",""]),"grid_L8TTJ"),s="video-card-list_dUuWi";const o=i},913:(e,t,i)=>{"use strict";i.d(t,{C:()=>r,Z:()=>s});var t=i(117),t=i.n(t),n=i(488),i=i.n(n)()(t()),r=(i.push([e.id,".toast-container_LjLRu {\n position: fixed;\n top: 50%;\n left: 50%;\n z-index: 999999;\n padding: 12px 24px;\n font-size: 14px;\n width: 240px;\n margin-left: -120px;\n background: #ffb243;\n color: #fff;\n border-radius: 6px;\n}\n",""]),"toast-container_LjLRu");const s=i},488:e=>{"use strict";e.exports=function(n){var u=[];return u.toString=function(){return this.map(function(e){var t="",i=void 0!==e[5];return e[4]&&(t+="@supports (".concat(e[4],") {")),e[2]&&(t+="@media ".concat(e[2]," {")),i&&(t+="@layer".concat(0{"use strict";e.exports=function(e){return e[1]}},624:function(e){e.exports=function(){"use strict";var c=1e3,u=6e4,d=36e5,l="millisecond",f="second",p="minute",m="hour",v="day",g="week",y="month",h="quarter",b="year",x="date",_="Invalid Date",o=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,w=/\[([^\]]+)]|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,e={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("_")},s=function(e,t,i){var n=String(e);return!n||n.length>=t?e:""+Array(t+1-n.length).join(i)+e},t={s:s,z:function(e){var t=-e.utcOffset(),i=Math.abs(t),n=Math.floor(i/60),r=i%60;return(t<=0?"+":"-")+s(n,2,"0")+":"+s(r,2,"0")},m:function e(t,i){if(t.date()1)return e(o[0])}else{var a=t.name;j[a]=t,r=a}return!n&&r&&(S=r),r||!n&&S},k=function(e,t){if(n(e))return e.clone();var i="object"==typeof t?t:{};return i.date=e,i.args=arguments,new a(i)},T=t,a=(T.l=r,T.i=n,T.w=function(e,t){return k(e,{locale:t.$L,utc:t.$u,x:t.$x,$offset:t.$offset})},function(){function e(e){this.$L=r(e.locale,null,!0),this.parse(e)}var t=e.prototype;return t.parse=function(e){this.$d=function(e){var t=e.date,i=e.utc;if(null===t)return new Date(NaN);if(T.u(t))return new Date;if(t instanceof Date)return new Date(t);if("string"==typeof t&&!/Z$/i.test(t)){var n=t.match(o);if(n){var r=n[2]-1||0,s=(n[7]||"0").substring(0,3);return i?new Date(Date.UTC(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)):new Date(n[1],r,n[3]||1,n[4]||0,n[5]||0,n[6]||0,s)}}return new Date(t)}(e),this.$x=e.x||{},this.init()},t.init=function(){var e=this.$d;this.$y=e.getFullYear(),this.$M=e.getMonth(),this.$D=e.getDate(),this.$W=e.getDay(),this.$H=e.getHours(),this.$m=e.getMinutes(),this.$s=e.getSeconds(),this.$ms=e.getMilliseconds()},t.$utils=function(){return T},t.isValid=function(){return!(this.$d.toString()===_)},t.isSame=function(e,t){var i=k(e);return this.startOf(t)<=i&&i<=this.endOf(t)},t.isAfter=function(e,t){return k(e){"use strict";const h=()=>{const e=new Error("Delay aborted");return e.name="AbortError",e},t=({clearTimeout:c,setTimeout:u,willResolve:d})=>(i,{value:n,signal:r}={})=>{if(r&&r.aborted)return Promise.reject(h());let s,o,a;const e=c||clearTimeout,l=()=>{e(s),a(h())},t=new Promise((e,t)=>{o=()=>{r&&r.removeEventListener("abort",l),(d?e:t)(n)},a=t,s=(u||setTimeout)(o,i)});return r&&r.addEventListener("abort",l,{once:!0}),t.clear=()=>{e(s),s=null,o()},t};var i=e=>{const n=t({...e,willResolve:!0});return n.reject=t({...e,willResolve:!1}),n.range=(e,t,i)=>n(((e,t)=>Math.floor(Math.random()*(t-e+1)+e))(e,t),i),n};const n=i();n.createWithTimers=i,e.exports=n,e.exports.default=n},555:e=>{const n="object"==typeof performance&&performance&&"function"==typeof performance.now?performance:Date;const a="undefined"!=typeof AbortController?AbortController:Object.assign(class{constructor(){this.signal=new a.AbortSignal}abort(){this.signal.aborted=!0}},{AbortSignal:class{constructor(){this.aborted=!1}}}),y=new Set,b=(e,t)=>{var i="LRU_CACHE_OPTION_"+e;_(i)&&r(i,e+" option","options."+t,k)},t=(e,t)=>{var i,n="LRU_CACHE_METHOD_"+e;_(n)&&(i=k["prototype"],i=Object.getOwnPropertyDescriptor(i,e)["get"],r(n,e+" method",`cache.${t}()`,i))},x=(...e)=>{"object"==typeof process&&process&&"function"==typeof process.emitWarning?process.emitWarning(...e):console.error(...e)},_=e=>!y.has(e),r=(e,t,i,n)=>{y.add(e);t=`The ${t} is deprecated. Please use ${i} instead.`;x(t,"DeprecationWarning",e,n)},w=e=>e&&e===Math.floor(e)&&0w(e)?e<=Math.pow(2,8)?Uint8Array:e<=Math.pow(2,16)?Uint16Array:e<=Math.pow(2,32)?Uint32Array:e<=Number.MAX_SAFE_INTEGER?s:null:null;class s extends Array{constructor(e){super(e),this.fill(0)}}class j{constructor(e){if(0===e)return[];const t=S(e);this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}}class k{constructor(e={}){var{max:t=0,ttl:i,ttlResolution:n=1,ttlAutopurge:r,updateAgeOnGet:s,updateAgeOnHas:o,allowStale:a,dispose:l,disposeAfter:c,noDisposeOnSet:u,noUpdateTTL:d,maxSize:h=0,sizeCalculation:f,fetchMethod:p}=e,{length:e,maxAge:m,stale:v}=e instanceof k?{}:e;if(0!==t&&!w(t))throw new TypeError("max option must be a nonnegative integer");const g=t?S(t):Array;if(!g)throw new Error("invalid max value: "+t);if(this.max=t,this.maxSize=h,this.sizeCalculation=f||e,this.sizeCalculation){if(!this.maxSize)throw new TypeError("cannot set sizeCalculation without setting maxSize");if("function"!=typeof this.sizeCalculation)throw new TypeError("sizeCalculation set to non-function")}if(this.fetchMethod=p||null,this.fetchMethod&&"function"!=typeof this.fetchMethod)throw new TypeError("fetchMethod must be a function if specified");if(this.keyMap=new Map,this.keyList=new Array(t).fill(null),this.valList=new Array(t).fill(null),this.next=new g(t),this.prev=new g(t),this.head=0,this.tail=0,this.free=new j(t),this.initialFill=1,this.size=0,"function"==typeof l&&(this.dispose=l),"function"==typeof c?(this.disposeAfter=c,this.disposed=[]):(this.disposeAfter=null,this.disposed=null),this.noDisposeOnSet=!!u,this.noUpdateTTL=!!d,0!==this.maxSize){if(!w(this.maxSize))throw new TypeError("maxSize must be a positive integer if specified");this.initializeSizeTracking()}if(this.allowStale=!!a||!!v,this.updateAgeOnGet=!!s,this.updateAgeOnHas=!!o,this.ttlResolution=w(n)||0===n?n:1,this.ttlAutopurge=!!r,this.ttl=i||m||0,this.ttl){if(!w(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.initializeTTLTracking()}if(0===this.max&&0===this.ttl&&0===this.maxSize)throw new TypeError("At least one of max, maxSize, or ttl is required");this.ttlAutopurge||this.max||this.maxSize||(h="LRU_CACHE_UNBOUNDED",_(h)&&(y.add(h),x("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",h,k))),v&&b("stale","allowStale"),m&&b("maxAge","ttl"),e&&b("length","sizeCalculation")}getRemainingTTL(e){return this.has(e,{updateAgeOnHas:!1})?1/0:0}initializeTTLTracking(){this.ttls=new s(this.max),this.starts=new s(this.max),this.setItemTTL=(e,t)=>{if(this.starts[e]=0!==t?n.now():0,0!==(this.ttls[e]=t)&&this.ttlAutopurge){const i=setTimeout(()=>{this.isStale(e)&&this.delete(this.keyList[e])},t+1);i.unref&&i.unref()}},this.updateItemAge=e=>{this.starts[e]=0!==this.ttls[e]?n.now():0};let i=0;const t=()=>{var e=n.now();if(0i=0,this.ttlResolution);t.unref&&t.unref()}return e};this.getRemainingTTL=e=>{e=this.keyMap.get(e);return void 0===e?0:0===this.ttls[e]||0===this.starts[e]?1/0:this.starts[e]+this.ttls[e]-(i||t())},this.isStale=e=>0!==this.ttls[e]&&0!==this.starts[e]&&(i||t())-this.starts[e]>this.ttls[e]}updateItemAge(e){}setItemTTL(e,t){}isStale(e){return!1}initializeSizeTracking(){this.calculatedSize=0,this.sizes=new s(this.max),this.removeItemSize=e=>this.calculatedSize-=this.sizes[e],this.requireSize=(e,t,i,n)=>{if(!w(i)){if(!n)throw new TypeError("invalid size value (must be positive integer)");if("function"!=typeof n)throw new TypeError("sizeCalculation must be a function");if(i=n(t,e),!w(i))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}return i},this.addItemSize=(e,t,i,n)=>{this.sizes[e]=n;for(var r=this.maxSize-this.sizes[e];this.calculatedSize>r;)this.evict(!0);this.calculatedSize+=this.sizes[e]},this.delete=e=>{var t;return 0!==this.size&&void 0!==(t=this.keyMap.get(e))&&(this.calculatedSize-=this.sizes[t]),k.prototype.delete.call(this,e)}}removeItemSize(e){}addItemSize(e,t,i,n){}requireSize(e,t,i,n){if(i||n)throw new TypeError("cannot set size without setting maxSize on cache")}*indexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.tail;;){1;{if(!this.isValidIndex(e))break;if(!t&&this.isStale(e)||(yield e),e===this.head)break;e=this.prev[e]}}}*rindexes({allowStale:t=this.allowStale}={}){if(this.size)for(let e=this.head;;){1;{if(!this.isValidIndex(e))break;if(!t&&this.isStale(e)||(yield e),e===this.tail)break;e=this.next[e]}}}isValidIndex(e){return this.keyMap.get(this.keyList[e])===e}*entries(){for(const e of this.indexes())yield[this.keyList[e],this.valList[e]]}*rentries(){for(const e of this.rindexes())yield[this.keyList[e],this.valList[e]]}*keys(){for(const e of this.indexes())yield this.keyList[e]}*rkeys(){for(const e of this.rindexes())yield this.keyList[e]}*values(){for(const e of this.indexes())yield this.valList[e]}*rvalues(){for(const e of this.rindexes())yield this.valList[e]}[Symbol.iterator](){return this.entries()}find(e,t={}){for(const i of this.indexes())if(e(this.valList[i],this.keyList[i],this))return this.get(this.keyList[i],t)}forEach(e,t=this){for(const i of this.indexes())e.call(t,this.valList[i],this.keyList[i],this)}rforEach(e,t=this){for(const i of this.rindexes())e.call(t,this.valList[i],this.keyList[i],this)}get prune(){return t("prune","purgeStale"),this.purgeStale}purgeStale(){let e=!1;for(const t of this.rindexes({allowStale:!0}))this.isStale(t)&&(this.delete(this.keyList[t]),e=!0);return e}dump(){const e=[];for(const i of this.indexes()){var t=this.keyList[i];const n={value:this.valList[i]};this.ttls&&(n.ttl=this.ttls[i]),this.sizes&&(n.size=this.sizes[i]),e.unshift([t,n])}return e}load(e){this.clear();for(var[t,i]of e)this.set(t,i.value,i)}dispose(e,t,i){}set(e,t,{ttl:i=this.ttl,noDisposeOnSet:n=this.noDisposeOnSet,size:r=0,sizeCalculation:s=this.sizeCalculation,noUpdateTTL:o=this.noUpdateTTL}={}){r=this.requireSize(e,t,r,s);let a=0===this.size?void 0:this.keyMap.get(e);if(void 0===a)a=this.newIndex(),this.keyList[a]=e,this.valList[a]=t,this.keyMap.set(e,a),this.next[this.tail]=a,this.prev[a]=this.tail,this.tail=a,this.size++,this.addItemSize(a,t,e,r),o=!1;else{const l=this.valList[a];t!==l&&(this.isBackgroundFetch(l)?l.__abortController.abort():n||(this.dispose(l,e,"set"),this.disposeAfter&&this.disposed.push([l,e,"set"])),this.removeItemSize(a),this.valList[a]=t,this.addItemSize(a,t,e,r)),this.moveToTail(a)}if(0===i||0!==this.ttl||this.ttls||this.initializeTTLTracking(),o||this.setItemTTL(a,i),this.disposeAfter)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return this}newIndex(){return 0===this.size?this.tail:this.size===this.max&&0!==this.max?this.evict(!1):0!==this.free.length?this.free.pop():this.initialFill++}pop(){var e;if(this.size)return e=this.valList[this.head],this.evict(!0),e}evict(e){var t=this.head,i=this.keyList[t];const n=this.valList[t];return this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,i,"evict"),this.disposeAfter&&this.disposed.push([n,i,"evict"])),this.removeItemSize(t),e&&(this.keyList[t]=null,this.valList[t]=null,this.free.push(t)),this.head=this.next[t],this.keyMap.delete(i),this.size--,t}has(e,{updateAgeOnHas:t=this.updateAgeOnHas}={}){e=this.keyMap.get(e);return void 0!==e&&!this.isStale(e)&&(t&&this.updateItemAge(e),!0)}peek(e,{allowStale:t=this.allowStale}={}){e=this.keyMap.get(e);if(void 0!==e&&(t||!this.isStale(e)))return this.valList[e]}backgroundFetch(t,e,i){var n=void 0===e?void 0:this.valList[e];if(this.isBackgroundFetch(n))return n;const r=new a,s={signal:r.signal,options:i},o=Promise.resolve(this.fetchMethod(t,n,s)).then(e=>(r.signal.aborted||this.set(t,e,s.options),e));return o.__abortController=r,o.__staleWhileFetching=n,void 0===e?(this.set(t,o,s.options),e=this.keyMap.get(t)):this.valList[e]=o,o}isBackgroundFetch(e){return e&&"object"==typeof e&&"function"==typeof e.then&&Object.prototype.hasOwnProperty.call(e,"__staleWhileFetching")}async fetch(e,{allowStale:t=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet,ttl:n=this.ttl,noDisposeOnSet:r=this.noDisposeOnSet,size:s=0,sizeCalculation:o=this.sizeCalculation,noUpdateTTL:a=this.noUpdateTTL}={}){if(!this.fetchMethod)return this.get(e,{allowStale:t,updateAgeOnGet:i});n={allowStale:t,updateAgeOnGet:i,ttl:n,noDisposeOnSet:r,size:s,sizeCalculation:o,noUpdateTTL:a},r=this.keyMap.get(e);if(void 0===r)return this.backgroundFetch(e,r,n);s=this.valList[r];if(this.isBackgroundFetch(s))return t&&void 0!==s.__staleWhileFetching?s.__staleWhileFetching:s;if(!this.isStale(r))return this.moveToTail(r),i&&this.updateItemAge(r),s;o=this.backgroundFetch(e,r,n);return t&&void 0!==o.__staleWhileFetching?o.__staleWhileFetching:o}get(e,{allowStale:t=this.allowStale,updateAgeOnGet:i=this.updateAgeOnGet}={}){var n,r,s=this.keyMap.get(e);if(void 0!==s)return n=this.valList[s],r=this.isBackgroundFetch(n),this.isStale(s)?r?t?n.__staleWhileFetching:void 0:(this.delete(e),t?n:void 0):r?void 0:(this.moveToTail(s),i&&this.updateItemAge(s),n)}connect(e,t){this.prev[t]=e,this.next[e]=t}moveToTail(e){e!==this.tail&&(e===this.head?this.head=this.next[e]:this.connect(this.prev[e],this.next[e]),this.connect(this.tail,e),this.tail=e)}get del(){return t("del","delete"),this.delete}delete(e){let t=!1;if(0!==this.size){var i=this.keyMap.get(e);if(void 0!==i)if(t=!0,1===this.size)this.clear();else{this.removeItemSize(i);const n=this.valList[i];this.isBackgroundFetch(n)?n.__abortController.abort():(this.dispose(n,e,"delete"),this.disposeAfter&&this.disposed.push([n,e,"delete"])),this.keyMap.delete(e),this.keyList[i]=null,this.valList[i]=null,i===this.tail?this.tail=this.prev[i]:i===this.head?this.head=this.next[i]:(this.next[this.prev[i]]=this.next[i],this.prev[this.next[i]]=this.prev[i]),this.size--,this.free.push(i)}}if(this.disposed)for(;this.disposed.length;)this.disposeAfter(...this.disposed.shift());return t}clear(){for(const t of this.rindexes({allowStale:!0})){const i=this.valList[t];var e;this.isBackgroundFetch(i)?i.__abortController.abort():(e=this.keyList[t],this.dispose(i,e,"delete"),this.disposeAfter&&this.disposed.push([i,e,"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 t("reset","clear"),this.clear}get length(){var e,t,i,n;return t="size",n="LRU_CACHE_PROPERTY_"+(e="length"),_(n)&&(i=k["prototype"],i=Object.getOwnPropertyDescriptor(i,e)["get"],r(n,e+" property","cache."+t,i)),this.size}}e.exports=k},49:(e,t,i)=>{"use strict";var o=i(257);function n(){}function r(){}r.resetWarningCache=n,e.exports=function(){function e(e,t,i,n,r,s){if(s!==o)throw s=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"),s.name="Invariant Violation",s}function t(){return e}var i={array:e.isRequired=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:r,resetWarningCache:n};return i.PropTypes=i}},507:(e,t,i)=>{e.exports=i(49)()},257:e=>{"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},529:(e,t,i)=>{"use strict";i=i(533);t.s=i.createRoot,i.hydrateRoot},103:(e,t,i)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=function(e,t,i){return t&&r(e.prototype,t),i&&r(e,i),e};function r(e,t){for(var i=0;i{e.exports=i(103)},768:(e,t,i)=>{"use strict";var i=i(363),a=Symbol.for("react.element"),n=Symbol.for("react.fragment"),l=Object.prototype.hasOwnProperty,c=i.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,u={key:!0,ref:!0,__self:!0,__source:!0};function r(e,t,i){var n,r={},s=null,o=null;for(n in void 0!==i&&(s=""+i),void 0!==t.key&&(s=""+t.key),void 0!==t.ref&&(o=t.ref),t)l.call(t,n)&&!u.hasOwnProperty(n)&&(r[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps)void 0===r[n]&&(r[n]=t[n]);return{$$typeof:a,type:e,key:s,ref:o,props:r,_owner:c.current}}t.Fragment=n,t.jsx=r,t.jsxs=r},10:(e,t,i)=>{"use strict";e.exports=i(768)},590:e=>{"use strict";var c=[];function u(e){for(var t=-1,i=0;i{"use strict";var i={};e.exports=function(e,t){if(!(e=function(e){if(void 0===i[e]){var t=document.querySelector(e);if(window.HTMLIFrameElement&&t instanceof window.HTMLIFrameElement)try{t=t.contentDocument.head}catch(e){t=null}i[e]=t}return i[e]}(e)))throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");e.appendChild(t)}},980:e=>{"use strict";e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},98:(e,t,i)=>{"use strict";e.exports=function(e){var t=i.nc;t&&e.setAttribute("nonce",t)}},937:e=>{"use strict";e.exports=function(s){var o=s.insertStyleElement(s);return{update:function(e){var t,i,n,r;t=o,i=s,n="",(e=e).supports&&(n+="@supports (".concat(e.supports,") {")),e.media&&(n+="@media ".concat(e.media," {")),(r=void 0!==e.layer)&&(n+="@layer".concat(0{"use strict";e.exports=function(e,t){if(t.styleSheet)t.styleSheet.cssText=e;else{for(;t.firstChild;)t.removeChild(t.firstChild);t.appendChild(document.createTextNode(e))}}},363:e=>{"use strict";e.exports=React},533:e=>{"use strict";e.exports=ReactDOM}},n={};function ct(e){var t=n[e];if(void 0!==t)return t.exports;t=n[e]={id:e,exports:{}};return i[e].call(t.exports,t,t.exports,ct),t.exports}ct.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return ct.d(t,{a:t}),t},ct.d=(e,t)=>{for(var i in t)ct.o(t,i)&&!ct.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},ct.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),ct.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};(()=>{"use strict";var e={},O=(ct.r(e),ct.d(e,{clean:()=>function(){GM_deleteValue(i)},config:()=>c,load:()=>Y,save:()=>F,updateConfig:()=>U}),ct(10)),M=ct(529),t=$,s=ct.n(t),t=ct(803),R=ct.n(t),C=ct(363);const W=function(){var e=(0,C.useRef)(!1);return(0,C.useEffect)(function(){return e.current=!1,function(){e.current=!0}},[]),e};var H=function(e,t){var i="function"==typeof Symbol&&e[Symbol.iterator];if(!i)return e;var n,r,s=i.call(e),o=[];try{for(;(void 0===t||0{let e=i.index.findIndex((e,t,i)=>{i=i[t+1];return e<=u&&ui.index[i.index.length-1]?e=(e=Math.floor(i.index.length*c)-1)<0?0:e:0},[i,u]),{img_x_len:t,img_y_len:d}=i,h=d*t,f=(o+=1,Math.floor(o/h)),o=o-f*h,h=i.image[f],f=Math.floor(o/t)+1;return(0,O.jsx)("div",{ref:n,className:e,style:{backgroundColor:"black",backgroundImage:`url(${h})`,backgroundPosition:`-${(o-(f-1)*t-1)*r}px -${(f-1)*s}px`,backgroundSize:r*t+`px ${s*d}px`}})};var t=ct(590),t=ct.n(t),o=ct(937),o=ct.n(o),a=ct(804),a=ct.n(a),l=ct(98),l=ct.n(l),u=ct(980),u=ct.n(u),d=ct(776),d=ct.n(d),A=ct(730),h={},ue=(h.styleTagTransform=d(),h.setAttributes=l(),h.insert=a().bind(null,"head"),h.domAPI=o(),h.insertStyleElement=u(),t()(A.ZP,h),A.ZP&&A.ZP.locals&&A.ZP.locals,Math.floor);const de=function(e,t){var i="";if(!e||t<1||9007199254740991>>0,t>>>=0,Array(r));++n${e}`);i.appendTo(document.body),setTimeout(()=>i.remove(),t)}const Ke=re()().format("YYYY"),et=e=>{if(!e)return"";const t=re().unix(e);return t.format("YYYY")===Ke?t.format("M-D"):t.format("YY-M-D")},tt=e=>e.replace(/^http:\/\//,"https://");function it({item:e,className:t}){var i=(0,C.useRef)(null);const n=te(i);var r=(0,C.useRef)(null),s=te(r);const{param:o,title:a,cover:l,goto:c,play:u,like:d,desc:h,ctime:f,duration:p,name:m,mid:v,favorite:g,badge:y,rcmd_reason:b}=e;var x=et(f),_=tt(l);const[w,S]=z(null);(0,C.useEffect)(()=>(n&&(async()=>{var e=await ne(o);S(e)})(),()=>{}),[n]);var j=P(e=>{e.preventDefault(),E("暂未实现!!!")}),k=(P(()=>{}),P(()=>{}),"av"===e.goto?"/video/av"+o:e.uri),T=(0,C.useMemo)(()=>{{var e;if(!(e=p))return"00:00";var t=Math.trunc(e/3600),i=(e-=3600*t,Math.trunc(e/60)),e=e-=60*i;const n=[t,i,e];return 0===n[0]&&n.shift(),n.map(e=>Qe(e.toString(),2,"0")).join(":")}},[p]),L=(0,C.useMemo)(()=>D(u),[u]),N=(0,C.useMemo)(()=>D(d),[d]),M=(0,C.useMemo)(()=>D(g),[g]);return(0,O.jsxs)("div",{className:"bili-video-card "+t||0,"data-report":"partition_recommend.content",children:[(0,O.jsxs)("div",{className:"bili-video-card__skeleton hide",children:[(0,O.jsx)("div",{className:"bili-video-card__skeleton--cover"}),(0,O.jsx)("div",{className:"bili-video-card__skeleton--info",children:(0,O.jsxs)("div",{className:"bili-video-card__skeleton--right",children:[(0,O.jsx)("p",{className:"bili-video-card__skeleton--text"}),(0,O.jsx)("p",{className:"bili-video-card__skeleton--text short"}),(0,O.jsx)("p",{className:"bili-video-card__skeleton--light"})]})})]}),(0,O.jsxs)("div",{className:"bili-video-card__wrap __scale-wrap",children:[(0,O.jsx)("a",{href:k,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:(0,O.jsxs)("div",{className:"bili-video-card__image __scale-player-wrap",ref:i,children:[(0,O.jsxs)("div",{className:"bili-video-card__image--wrap",style:{overflow:"hidden"},children:[(0,O.jsxs)("picture",{className:"v-img bili-video-card__cover",children:[(0,O.jsx)("source",{srcSet:_+"@672w_378h_1c.webp",type:"image/webp"}),(0,O.jsx)("img",{src:_+"@672w_378h_1c.webp",alt:a,loading:"lazy"})]}),n&&w?.pvideoData?(0,O.jsx)(ce,{className:A.sN,item:e,pvideo:w?.pvideoData}):null,(0,O.jsxs)("div",{className:"bili-watch-later "+A.Zl,style:{display:n?"flex":"none"},ref:r,onClick:j,children:[(0,O.jsx)("svg",{className:"bili-watch-later__icon",children:(0,O.jsx)("use",{xlinkHref:"#widget-watch-later"})}),(0,O.jsx)("span",{className:"bili-watch-later__tip",style:{display:s?"block":"none"},children:"稍后再看"})]})]}),(0,O.jsx)("div",{className:"bili-video-card__mask",children:(0,O.jsxs)("div",{className:"bili-video-card__stats",children:[(0,O.jsxs)("div",{className:"bili-video-card__stats--left",children:[(0,O.jsxs)("span",{className:"bili-video-card__stats--item",children:[(0,O.jsx)("svg",{className:"bili-video-card__stats--icon",children:(0,O.jsx)("use",{xlinkHref:"#widget-play-count"})}),(0,O.jsx)("span",{className:"bili-video-card__stats--text",children:L})]}),(0,O.jsx)("span",{className:"bili-video-card__stats--item",children:"av"===c?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("svg",{className:"bili-video-card__stats--icon",children:(0,O.jsx)("use",{xlinkHref:"#widget-agree"})}),(0,O.jsx)("span",{className:"bili-video-card__stats--text",children:N})]}):(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)("svg",{className:"bili-video-card__stats--icon",children:(0,O.jsx)("use",{xlinkHref:"#widget-agree"})}),(0,O.jsx)("span",{className:"bili-video-card__stats--text",children:M})]})})]}),(0,O.jsx)("span",{className:"bili-video-card__stats__duration",children:T})]})})]})}),(0,O.jsx)("div",{className:"bili-video-card__info __scale-disable",children:(0,O.jsxs)("div",{className:"bili-video-card__info--right",children:[(0,O.jsx)("a",{href:k,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:(0,O.jsx)("h3",{className:"bili-video-card__info--tit",title:a,children:a})}),(0,O.jsxs)("p",{className:"bili-video-card__info--bottom",children:["av"===c?(0,O.jsxs)("a",{className:"bili-video-card__info--owner",href:"//space.bilibili.com/"+v,target:"_blank","data-mod":"partition_recommend","data-idx":"content","data-ext":"click",children:[b?.content?(0,O.jsx)("span",{className:A.Nd,children:b.content}):(0,O.jsx)("svg",{className:"bili-video-card__info--owner__up",children:(0,O.jsx)("use",{xlinkHref:"#widget-up"})}),(0,O.jsx)("span",{className:"bili-video-card__info--author",children:m}),x?(0,O.jsxs)("span",{className:"bili-video-card__info--date",children:["· ",x]}):null]}):null,"bangumi"===c?(0,O.jsxs)("a",{className:"bili-video-card__info--owner",href:k,target:"_blank",children:[(0,O.jsx)("span",{className:A.R0,children:y}),(0,O.jsx)("span",{className:A.Rs,children:h})]}):null]})]})})]})]})}var k=ct(181),x={};x.styleTagTransform=d(),x.setAttributes=l(),x.insert=a().bind(null,"head"),x.domAPI=o(),x.insertStyleElement=u(),t()(k.ZP,x),k.ZP&&k.ZP.locals&&k.ZP.locals;async function nt(){var e=await async function(){var e=(await r().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(!e?.data?.has_login)return{errmsg:"你必须登录B站之后才能使用授权",json:e};if(!e?.data?.confirm_uri)return{errmsg:"无法获得授权网址",json:e};e=e.data.confirm_uri;let i;var t=new Promise(t=>{window.addEventListener("message",e=>{if("https://www.mcbbs.net"==e.origin&&e.data)return e=e.data.match(/access_key=([0-9a-z]{32})/),e&&e[1]?void t(e[1]):t({errmsg:"没有获得匹配的密钥"})}),i=setTimeout(()=>{t({errmsg:"获取授权超时"})},5e3)});const n=s()(`