text: (()=>(t,i)=>{function e(t,i,e){if(i in t){Object.defineProperty(t,i,{value:e,enumerable:true,configurable:true,writable:true})}else{t[i]=e}return t}const{NavbarComponent:s}=i.import("custom-navbar-component");class a extends s{constructor({mainUrl:t,name:i,apiUrl:s,listName:a,listMap:l}){super();e(this,"listName",void 0);this.href=t;this.listName=a;this.html=i;this.noPadding=true;this.requestedPopup=false;this.popupHtml=`\n<ol class="video-list ${a}">\n<li class="loading">加载中...</li>\n</ol>\n`;this.initialPopup=async()=>{if(!l){return}const e=await SpinQuery.select(`.video-list.${a}`);if(e===null){return}const r=await Ajax.getJsonWithCredentials(s);let n="";if(r.code!==0){logError(`加载${i}信息失败. 错误码: ${r.code} ${r.message}`)}else{n=l(r).join("")}e.insertAdjacentHTML("beforeend",n+`\n<li class="more"><a target="_blank" href="${t}">查看更多</a></li>\n`);e.classList.add("loaded")}}get name(){return this.listName+"List"}}class l extends a{constructor(){super({name:"收藏",mainUrl:`https://space.bilibili.com/${getUID()}/favlist`,apiUrl:"https://api.bilibili.com/medialist/gateway/coll/resource/recent",listName:"favorites",listMap:t=>{if(!t.data||t.data.length===0){return[`<li class="loading empty">空空如也哦 =￣ω￣=</li>`]}return t.data.map((t=>`\n<li>\n<a target="_blank" href="https://www.bilibili.com/video/av${t.id}">${t.title}</a>\n</li>`))}});this.active=document.URL.replace(/\?.*$/,"")===`https://space.bilibili.com/${getUID()}/favlist`}}class r extends a{constructor(){super({name:"历史",mainUrl:"https://www.bilibili.com/account/history",apiUrl:"https://api.bilibili.com/x/v2/history?pn=1&ps=6",listName:"history",listMap:t=>{if(!t.data||t.data.length===0){return[`<li class="loading empty">空空如也哦 =￣ω￣=</li>`]}return t.data.map((t=>{let i=[];let e="";const s=t.page?t.page.page:1;let a=t.progress>=0?t.progress/t.duration:1;if(isNaN(a)){a=0}if(s!==1){i.push(`p=${s}`);e+=`看到第${s}话`}if(t.progress>0&&t.progress<t.duration){i.push(`t=${t.progress}`);e+=` ${Math.floor(a*100)}%`}else if(t.progress===0){e+=` 刚开始看`}else{e+=" 100%"}return`\n<li class="history-item">\n<a target="_blank" href="https://www.bilibili.com/video/av${t.aid}?${i.join("&")}">\n<span class="title">${t.title}</span>\n<span class="description">${e}</span>\n<div class="progress background">\n<div class="progress foreground" style="--progress: ${a*100}%"></div>\n</div>\n</a>\n</li>`}))}});this.active=document.URL.replace(/\?.*$/,"")==="https://www.bilibili.com/account/history"}}return{export:{FavoritesList:l,HistoryList:r}}})();