!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports["utils/image-resolution"]=e():t["utils/image-resolution"]=e()}(self,(function(){return function(){var t,e,n={470:function(t,e,n){var o=n(645)((function(t){return t[1]}));o.push([t.id,".favInfo-box .collection-cover img,\n.favInfo-box .favInfo-cover img {\n width: 100% !important;\n -o-object-position: left !important;\n object-position: left !important;\n}\n\n.bb-comment .sailing .sailing-img,\n.comment-bilibili-fold .sailing .sailing-img {\n width: 288px;\n}",""]),t.exports=o},645:function(t){"use strict"; // eslint-disable-next-line func-names t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")}, // eslint-disable-next-line func-names e.i=function(t,n,o){"string"==typeof t&&( // eslint-disable-next-line no-param-reassign t=[[null,t,""]]);var r={};if(o)for(var i=0;i{const n=document.createNodeIterator(t,NodeFilter.SHOW_ELEMENT);let o=n.nextNode();for(;o;)e(o),o=n.nextNode()},a=async(t,o)=>{const{attributes:i}=await Promise.resolve().then(r.t.bind(r,156,23)),a=(r,i)=>{const a=r(o);if(null===a)return;if(n.some((t=>o.matches(t))))return;const s=a.match(e);if(!s)return;const[,c,u]=s,f=parseInt(o.getAttribute("data-resolution-width")||"0");if(parseInt(c)>=f&&0!==f)return;null===o.getAttribute("width")&&null===o.getAttribute("height")&&(o.classList.contains("bili-avatar-img")?o.setAttribute("height",u):o.setAttribute("width",c));const l=Math.round(t*parseInt(c)).toString(),d=Math.round(t*parseInt(u)).toString();o.setAttribute("data-resolution-width",l),i(o,a.replace(e,`@${l}w_${d}h`))};i(o,(()=>{a((t=>t.getAttribute("src")),((t,e)=>t.setAttribute("src",e))),a((t=>t.style.backgroundImage),((t,e)=>t.style.backgroundImage=e))}))},s=(0,t.styledComponentEntry)((()=>Promise.resolve().then(r.t.bind(r,121,23))),(async({settings:t})=>{const{allMutations:e}=await Promise.resolve().then(r.t.bind(r,156,23)),n="auto"===t.options.scale?window.devicePixelRatio:parseFloat(t.options.scale);o(document.body,(t=>a(n,t))),e((t=>{t.forEach((t=>t.addedNodes.forEach((t=>{t instanceof HTMLElement&&(a(n,t),"IMG"!==t.nodeName.toUpperCase()&&o(t,(t=>a(n,t))))}))))}))})),c={name:"imageResolution",displayName:"高分辨率图片",tags:[componentsTags.utils],enabledByDefault:window.devicePixelRatio>1,entry:s,description:{"zh-CN":"根据屏幕 DPI 请求更高分辨率的图片, 例如 DPI 缩放 200% 则请求 2 倍的分辨率, 加载时间也会相应变长一些."},options:{scale:{displayName:"缩放级别",defaultValue:"auto",hidden:!0}}}}(),i=i.component}()}));