/*! Bilibili-Bangumi-JS v1.0.9 | Hans362 (https://hans362.cn) | https://bilibili-bangumi-js.vercel.app | MIT License */"use strict";var bangumiJson=(apiUrl||"https://bilibili-bangumi-js.vercel.app/api")+"?vmid="+userId+"&token="+(new Date).getTime()+Math.random();function getPage(n){$.getJSON(bangumiJson+"&pn="+n,function(t){1==n?$(".bgm-collection").empty():$(".bgm-navigator").remove(),$.each(t.data.list,function(t,n){var e=0;n.is_finish?e=n.total_count:n.is_started&&"即将开播"!=n.new_ep.index_show?(e=n.new_ep.title,$.isNumeric(e)||(e=n.total_count)):e=0,e<0&&(e=0);var i=0;n.is_started?0<=n.progress.indexOf("已看完")?i=e:void 0!==n.progress&&-1==n.progress.indexOf("PV")?(i=n.progress.substring(n.progress.indexOf("第")+1,n.progress.indexOf("话")),$.isNumeric(i)||(i=e)):i=0:i=0;var s=i/e*100,a=n.cover.replace("http","https");$(".bgm-collection").append('\n            <a class="bgm-item" href="'+n.url+'" target="_blank">\n                <img class="bgm-item-thumb" src="'+a+'" referrerpolicy="no-referrer"></img>\n                <div class="bgm-item-info">\n                    <span class="bgm-item-title main">'+n.title+'</span>\n                    <span class="bgm-item-title">'+n.evaluate+'</span>\n                    <div class="bgm-item-statusBar-container">\n                        <div class="bgm-item-statusBar" style="width:'+s+'%"></div>\n                        <span class="bgm-item-percentage">进度：'+i+" / "+e+"</span>\n                    </div>\n                </div>\n            </a>\n            ")}),n<Math.ceil(t.data.total/12)&&$(".bgm-container").append('\n            <div class="bgm-navigator">\n                <script>\n                $(".bgm-btn").click(function(){\n                    getPage('+(n+1)+');\n                    $(this).text("加载中");\n                    $(this).css("background-color","grey");\n                    $(this).unbind("click");\n                })\n                <\/script>\n                <a class="bgm-btn">加载更多</a>\n            </div>\n            ')})}getPage(1);