(()=>(i,e)=>{const n=["https://www.bilibili.com/video/","https://www.bilibili.com/bangumi/"].some((i=>document.URL.startsWith(i)));if(i.preferAvUrl&&document.URL.startsWith("https://www.bilibili.com/video/")){SpinQuery.select((()=>unsafeWindow.aid)).then((i=>{if(!i){return}if(document.URL.includes("videocard_series")){console.log("skip video series");return}const e=document.URL.replace(/\/(video|bangumi)\/(BV[\w]+)/i,((e,n)=>`/${n}/av${i}`));if(document.URL!==e){history.replaceState({},document.title,e)}}))}return{widget:{content:`
`,condition:async()=>{if(n){return Boolean(await SpinQuery.select((()=>unsafeWindow.aid||unsafeWindow.bvid)))}else{return false}},success:()=>{e.applyStyle("bvidConvertStyle");const i=(i,e)=>{if(!i||!e){return""}return`\n