-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDarkReader.js
1 lines (1 loc) · 64 KB
/
DarkReader.js
1
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).DarkReader={})}(this,(function(e){"use strict";var t=function(){return(t=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};function r(e,t,r,n){return new(r||(r=Promise))((function(o,a){function i(e){try{c(n.next(e))}catch(e){a(e)}}function u(e){try{c(n.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(i,u)}c((n=n.apply(e,t||[])).next())}))}function n(e,t){var r,n,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function u(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;i;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,n=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=i.trys,(o=o.length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function o(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function a(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,o,a=r.call(e),i=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(e){o={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(o)throw o.error}}return i}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(a(arguments[t]));return e}var u,c="undefined"==typeof navigator?"some useragent":navigator.userAgent.toLowerCase(),s="undefined"==typeof navigator?"some platform":navigator.platform.toLowerCase(),l=c.includes("chrome")||c.includes("chromium"),d=c.includes("thunderbird"),f=c.includes("firefox")||d,h=(c.includes("vivaldi"),c.includes("yabrowser"),c.includes("opr")||c.includes("opera"),c.includes("edg"),c.includes("safari")&&!l),p=s.startsWith("win"),v=s.startsWith("mac"),m=(c.includes("mobile"),"function"==typeof ShadowRoot),g="function"==typeof MediaQueryList&&"function"==typeof MediaQueryList.prototype.addEventListener,b=((u=c.match(/chrom[e|ium]\/([^ ]+)/))&&u[1]&&u[1],function(){try{return document.querySelector(":defined"),!0}catch(e){return!1}}()),y=function(){try{return new CSSStyleSheet,!0}catch(e){return!1}}();function S(e,t){return r(this,void 0,void 0,(function(){var r;return n(this,(function(n){switch(n.label){case 0:return[4,fetch(e,{cache:"force-cache",credentials:"omit"})];case 1:if(r=n.sent(),f&&"text/css"===t&&e.startsWith("moz-extension://")&&e.endsWith(".css"))return[2,r];if(t&&!r.headers.get("Content-Type").startsWith(t))throw new Error("Mime type mismatch when loading "+e);if(!r.ok)throw new Error("Unable to load "+e+" "+r.status+" "+r.statusText);return[2,r]}}))}))}function w(e,t){return r(this,void 0,void 0,(function(){return n(this,(function(r){switch(r.label){case 0:return[4,S(e,t)];case 1:return[4,k(r.sent())];case 2:return[2,r.sent()]}}))}))}function k(e){return r(this,void 0,void 0,(function(){var t;return n(this,(function(r){switch(r.label){case 0:return[4,e.blob()];case 1:return t=r.sent(),[4,new Promise((function(e){var r=new FileReader;r.onloadend=function(){return e(r.result)},r.readAsDataURL(t)}))];case 2:return[2,r.sent()]}}))}))}var _=function(e){return r(void 0,void 0,void 0,(function(){return n(this,(function(t){return[2,Promise.reject(new Error(["Embedded Dark Reader cannot access a cross-origin resource",e,"Overview your URLs and CORS policies or use","`DarkReader.setFetchMethod(fetch: (url) => Promise<Response>))`.","See if using `DarkReader.setFetchMethod(window.fetch)`","before `DarkReader.enable()` works."].join(" ")))]}))}))},E=_;function x(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return[4,E(e)];case 1:return[2,t.sent()]}}))}))}window.chrome||(window.chrome={}),chrome.runtime||(chrome.runtime={});var C=new Set;function M(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return r(this,void 0,void 0,(function(){var t,r,o,a,i,u,c;return n(this,(function(n){switch(n.label){case 0:if(!e[0]||"fetch"!==e[0].type)return[3,8];t=e[0].id,n.label=1;case 1:return n.trys.push([1,7,,8]),r=e[0].data,o=r.url,a=r.responseType,[4,x(o)];case 2:return i=n.sent(),"data-url"!==a?[3,4]:[4,k(i)];case 3:return u=n.sent(),[3,6];case 4:return[4,i.text()];case 5:u=n.sent(),n.label=6;case 6:return C.forEach((function(e){return e({type:"fetch-response",data:u,error:null,id:t})})),[3,8];case 7:return c=n.sent(),console.error(c),C.forEach((function(e){return e({type:"fetch-response",data:null,err:c,id:t})})),[3,8];case 8:return[2]}}))}))}function R(e){C.add(e)}if("function"==typeof chrome.runtime.sendMessage){var A=chrome.runtime.sendMessage;chrome.runtime.sendMessage=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];M.apply(void 0,i(e)),A.apply(chrome.runtime,e)}}else chrome.runtime.sendMessage=M;if(chrome.runtime.onMessage||(chrome.runtime.onMessage={}),"function"==typeof chrome.runtime.onMessage.addListener){var L=chrome.runtime.onMessage.addListener;chrome.runtime.onMessage.addListener=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];R.apply(void 0,i(e)),L.apply(chrome.runtime.onMessage,e)}}else chrome.runtime.onMessage.addListener=R;var P,T="dynamicTheme",j={background:"#181a1b",text:"#e8e6e3"},O={background:"#dcdad7",text:"#181a1b"},N={mode:1,brightness:100,contrast:100,grayscale:0,sepia:0,useFont:!1,fontFamily:v?"Helvetica Neue":p?"Segoe UI":"Open Sans",textStroke:0,engine:T,stylesheet:"",darkSchemeBackgroundColor:j.background,darkSchemeTextColor:j.text,lightSchemeBackgroundColor:O.background,lightSchemeTextColor:O.text,scrollbarColor:v?"":"auto",selectionColor:"auto",styleSystemControls:!0};function q(e,t){var r,n;if(function(e){return null!=e.length}(e))for(var a=0,i=e.length;a<i;a++)t(e[a]);else try{for(var u=o(e),c=u.next();!c.done;c=u.next()){t(c.value)}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}}function F(e,t){q(t,(function(t){return e.push(t)}))}var B=new Map;function U(e){return P||(P=document.createElement("a")),P.href=e,P.href}function I(e,t){void 0===t&&(t=null);var r=e+(t?";"+t:"");if(B.has(r))return B.get(r);if(t){var n=new URL(e,U(t));return B.set(r,n),n}var o=new URL(U(e));return B.set(e,o),o}function W(e,t){if(t.match(/^data\:/))return t;var r=I(e);return I(t,r.href).href}function D(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function z(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t]}function $(e,t){q(e,(function(e){if(e instanceof CSSMediaRule){var r=Array.from(e.media);(r.includes("screen")||r.includes("all")||!r.includes("print")&&!r.includes("speech"))&&$(e.cssRules,t)}else if(e instanceof CSSStyleRule)t(e);else if(e instanceof CSSImportRule)try{$(e.styleSheet.cssRules,t)}catch(e){z(e)}else e instanceof CSSSupportsRule?CSS.supports(e.conditionText)&&$(e.cssRules,t):z("CSSRule type not supported",e)}))}function H(e,t){q(e,(function(r){var n=e.getPropertyValue(r).trim();n&&t(r,n)}))}function V(e){return e.startsWith("--")&&!e.startsWith("--darkreader")}function G(e){var t=new Map;return e&&$(e,(function(e){e.style&&H(e.style,(function(e,r){V(e)&&t.set(e,r)}))})),t}function K(e){var t=new Map;return H(e.style,(function(e,r){V(e)&&t.set(e,r)})),t}var Q=/url\((('.+?')|(".+?")|([^\)]*?))\)/g,J=/@import\s*(url\()?(('.+?')|(".+?")|([^\)]*?))\)?;?/g;function X(e){return e.replace(/^url\((.*)\)$/,"$1").replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}function Y(e){var t=I(e);return""+t.origin+t.pathname.replace(/\?.*$/,"").replace(/(\/)([^\/]+)$/i,"$1")}var Z=/\/\*[\s\S]*?\*\//g;var ee=/@font-face\s*{[^}]*}/g;var te=/var\((--[^\s,\(\)]+),?\s*([^\(\)]*(\([^\(\)]*\)[^\(\)]*)*\s*)\)/g;function re(e,t,r){void 0===r&&(r=new Set);var n=!1,o=new Set,a=e.replace(te,(function(e,a,i){if(r.has(a))return z("Circular reference to variable "+a),i||(n=!0,e);if(t.has(a)){var u=t.get(a);return u.match(te)&&o.add(a),u}return i||(z("Variable "+a+" not found"),n=!0,e)}));return n?a:a.match(te)?(o.forEach((function(e){return r.add(e)})),re(a,t,r)):a}function ne(e){var t,r=!1,n=null;return Object.assign((function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];t=o,n?r=!0:(e.apply(void 0,i(t)),n=requestAnimationFrame((function(){n=null,r&&(e.apply(void 0,i(t)),r=!1)})))}),{cancel:function(){cancelAnimationFrame(n),r=!1,n=null}})}function oe(e){var t=0;return e.seconds&&(t+=1e3*e.seconds),e.minutes&&(t+=60*e.minutes*1e3),e.hours&&(t+=60*e.hours*60*1e3),e.days&&(t+=24*e.days*60*60*1e3),t}function ae(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ie(e,t,r){void 0===r&&(r=Function.prototype);var n=oe({seconds:2}),o=oe({seconds:10}),a=e.previousSibling,i=e.parentNode;if(!i)throw new Error("Unable to watch for node position: parent element not found");if("prev-sibling"===t&&!a)throw new Error("Unable to watch for node position: there is no previous sibling");var u=0,c=null,s=null,l=ne((function(){if(!s){u++;var f=Date.now();if(null==c)c=f;else if(u>=10){if(f-c<o)return z("Node position watcher paused: retry in "+n+"ms",e,a),void(s=setTimeout((function(){c=null,u=0,s=null,l()}),n));c=f,u=1}if("parent"===t&&a&&a.parentNode!==i)return z("Unable to restore node position: sibling parent changed",e,a,i),void h();if("prev-sibling"===t){if(null==a.parentNode)return z("Unable to restore node position: sibling was removed",e,a,i),void h();a.parentNode!==i&&(z("Style was moved to another parent",e,a,i),p(a.parentNode))}z("Restoring node position",e,a,i),i.insertBefore(e,a?a.nextSibling:i.firstChild),d.takeRecords(),r&&r()}})),d=new MutationObserver((function(){("parent"===t&&e.parentNode!==i||"prev-sibling"===t&&e.previousSibling!==a)&&l()})),f=function(){d.observe(i,{childList:!0})},h=function(){clearTimeout(s),d.disconnect(),l.cancel()},p=function(e){i=e,h(),f()};return f(),{run:f,stop:h,skip:function(){d.takeRecords()}}}function ue(e,t){if(null!=e)for(var r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:function(e){return null==e.shadowRoot?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT}}),n=e.shadowRoot?r.currentNode:r.nextNode();null!=n;n=r.nextNode())t(n),ue(n.shadowRoot,t)}function ce(){return"complete"===document.readyState||"interactive"===document.readyState}var se=new Set;function le(e){se.add(e)}function de(e){se.delete(e)}if(!ce()){var fe=function(){ce()&&(document.removeEventListener("readystatechange",fe),se.forEach((function(e){return e()})),se.clear())};document.addEventListener("readystatechange",fe)}var he=new Map,pe=new WeakMap;function ve(e,t){var r,n,o;if(he.has(e))r=he.get(e),n=pe.get(r);else{var a=!1,i=!1;(r=new MutationObserver((function(t){if(function(e){if(e.length>1e3)return!0;for(var t=0,r=0;r<e.length;r++)if((t+=e[r].addedNodes.length)>1e3)return!0;return!1}(t))!a||ce()?n.forEach((function(t){return(0,t.onHugeMutations)(e)})):i||(le(o=function(){return n.forEach((function(t){return(0,t.onHugeMutations)(e)}))}),i=!0),a=!0;else{var r=function(e){var t=new Set,r=new Set,n=new Set;e.forEach((function(e){q(e.addedNodes,(function(e){e instanceof Element&&e.isConnected&&t.add(e)})),q(e.removedNodes,(function(e){e instanceof Element&&(e.isConnected?n.add(e):r.add(e))}))})),n.forEach((function(e){return t.delete(e)}));var o=[],a=[];return t.forEach((function(e){t.has(e.parentElement)&&o.push(e)})),r.forEach((function(e){r.has(e.parentElement)&&a.push(e)})),o.forEach((function(e){return t.delete(e)})),a.forEach((function(e){return r.delete(e)})),{additions:t,moves:n,deletions:r}}(t);n.forEach((function(e){return(0,e.onMinorMutations)(r)}))}}))).observe(e,{childList:!0,subtree:!0}),he.set(e,r),n=new Set,pe.set(r,n)}return n.add(t),{disconnect:function(){n.delete(t),o&&de(o),0===n.size&&(r.disconnect(),pe.delete(r),he.delete(e))}}}var me=null;function ge(e){var t=e.h,r=e.s,n=e.l,o=e.a,i=void 0===o?1:o;if(0===r){var u=a([n,n,n].map((function(e){return Math.round(255*e)})),3),c=u[0],s=u[1];return{r:c,g:u[2],b:s,a:i}}var l=(1-Math.abs(2*n-1))*r,d=l*(1-Math.abs(t/60%2-1)),f=n-l/2,h=a((t<60?[l,d,0]:t<120?[d,l,0]:t<180?[0,l,d]:t<240?[0,d,l]:t<300?[d,0,l]:[l,0,d]).map((function(e){return Math.round(255*(e+f))})),3);return{r:h[0],g:h[1],b:h[2],a:i}}function be(e){var t=e.r,r=e.g,n=e.b,o=e.a,a=void 0===o?1:o,i=t/255,u=r/255,c=n/255,s=Math.max(i,u,c),l=Math.min(i,u,c),d=s-l,f=(s+l)/2;if(0===d)return{h:0,s:0,l:f,a:a};var h=60*(s===i?(u-c)/d%6:s===u?(c-i)/d+2:(i-u)/d+4);return h<0&&(h+=360),{h:h,s:d/(1-Math.abs(2*f-1)),l:f,a:a}}function ye(e,t){void 0===t&&(t=0);var r=e.toFixed(t);if(0===t)return r;var n=r.indexOf(".");if(n>=0){var o=r.match(/0+$/);if(o)return o.index===n+1?r.substring(0,n):r.substring(0,o.index)}return r}function Se(e){var t=e.h,r=e.s,n=e.l,o=e.a;return null!=o&&o<1?"hsla("+ye(t)+", "+ye(100*r)+"%, "+ye(100*n)+"%, "+ye(o,2)+")":"hsl("+ye(t)+", "+ye(100*r)+"%, "+ye(100*n)+"%)"}var we=/^rgba?\([^\(\)]+\)$/,ke=/^hsla?\([^\(\)]+\)$/,_e=/^#[0-9a-f]+$/i;function Ee(e){var t,r,n,o,i,u=e.trim().toLowerCase();if(u.match(we))return t=a(xe(u,Ce,Me,Re),4),r=t[0],n=t[1],o=t[2],i=t[3],{r:r,g:n,b:o,a:void 0===i?1:i};if(u.match(ke))return function(e){var t=a(xe(e,Ae,Le,Pe),4),r=t[0],n=t[1],o=t[2],i=t[3];return ge({h:r,s:n,l:o,a:void 0===i?1:i})}(u);if(u.match(_e))return function(e){var t=e.substring(1);switch(t.length){case 3:case 4:var r=a([0,1,2].map((function(e){return parseInt(""+t[e]+t[e],16)})),3);return{r:r[0],g:r[1],b:r[2],a:3===t.length?1:parseInt(""+t[3]+t[3],16)/255};case 6:case 8:var n=a([0,2,4].map((function(e){return parseInt(t.substring(e,e+2),16)})),3);return{r:n[0],g:n[1],b:n[2],a:6===t.length?1:parseInt(t.substring(6,8),16)/255}}throw new Error("Unable to parse "+e)}(u);if(Te.has(u))return function(e){var t=Te.get(e);return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}(u);if(je.has(u))return function(e){var t=je.get(e);return{r:t>>16&255,g:t>>8&255,b:t>>0&255,a:1}}(u);if("transparent"===e)return{r:0,g:0,b:0,a:0};throw new Error("Unable to parse "+e)}function xe(e,t,r,n){var o=e.split(t).filter((function(e){return e})),i=Object.entries(n);return o.map((function(e){return e.trim()})).map((function(e,t){var n,o=i.find((function(t){var r=a(t,1)[0];return e.endsWith(r)}));return n=o?parseFloat(e.substring(0,e.length-o[0].length))/o[1]*r[t]:parseFloat(e),r[t]>1?Math.round(n):n}))}var Ce=/rgba?|\(|\)|\/|,|\s/gi,Me=[255,255,255,1],Re={"%":100};var Ae=/hsla?|\(|\)|\/|,|\s/gi,Le=[360,1,1,1],Pe={"%":100,deg:360,rad:2*Math.PI,turn:1};var Te=new Map(Object.entries({aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgrey:11119017,darkgreen:25600,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,grey:8421504,green:32768,greenyellow:11403055,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgrey:13882323,lightgreen:9498256,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074})),je=new Map(Object.entries({ActiveBorder:3906044,ActiveCaption:0,AppWorkspace:11184810,Background:6513614,ButtonFace:16777215,ButtonHighlight:15329769,ButtonShadow:10461343,ButtonText:0,CaptionText:0,GrayText:8355711,Highlight:11720703,HighlightText:0,InactiveBorder:16777215,InactiveCaption:16777215,InactiveCaptionText:0,InfoBackground:16514245,InfoText:0,Menu:16185078,MenuText:16777215,Scrollbar:11184810,ThreeDDarkShadow:0,ThreeDFace:12632256,ThreeDHighlight:16777215,ThreeDLightShadow:16777215,ThreeDShadow:0,Window:15527148,WindowFrame:11184810,WindowText:0,"-webkit-focus-ring-color":15046400}).map((function(e){var t=a(e,2),r=t[0],n=t[1];return[r.toLowerCase(),n]})));function Oe(e,t,r,n,o){return(e-t)*(o-n)/(r-t)+n}function Ne(e,t,r){return Math.min(r,Math.max(t,e))}function qe(e,t){for(var r=[],n=0,o=e.length;n<o;n++){r[n]=[];for(var a=0,i=t[0].length;a<i;a++){for(var u=0,c=0,s=e[0].length;c<s;c++)u+=e[n][c]*t[c][a];r[n][a]=u}}return r}function Fe(e,t,r){void 0===r&&(r=0);for(var n,o=[];n=e.exec(t);)o.push(n[r]);return o}function Be(e){var t=Ue.identity();return 0!==e.sepia&&(t=qe(t,Ue.sepia(e.sepia/100))),0!==e.grayscale&&(t=qe(t,Ue.grayscale(e.grayscale/100))),100!==e.contrast&&(t=qe(t,Ue.contrast(e.contrast/100))),100!==e.brightness&&(t=qe(t,Ue.brightness(e.brightness/100))),1===e.mode&&(t=qe(t,Ue.invertNHue())),t}var Ue={identity:function(){return[[1,0,0,0,0],[0,1,0,0,0],[0,0,1,0,0],[0,0,0,1,0],[0,0,0,0,1]]},invertNHue:function(){return[[.333,-.667,-.667,0,1],[-.667,.333,-.667,0,1],[-.667,-.667,.333,0,1],[0,0,0,1,0],[0,0,0,0,1]]},brightness:function(e){return[[e,0,0,0,0],[0,e,0,0,0],[0,0,e,0,0],[0,0,0,1,0],[0,0,0,0,1]]},contrast:function(e){var t=(1-e)/2;return[[e,0,0,0,t],[0,e,0,0,t],[0,0,e,0,t],[0,0,0,1,0],[0,0,0,0,1]]},sepia:function(e){return[[.393+.607*(1-e),.769-.769*(1-e),.189-.189*(1-e),0,0],[.349-.349*(1-e),.686+.314*(1-e),.168-.168*(1-e),0,0],[.272-.272*(1-e),.534-.534*(1-e),.131+.869*(1-e),0,0],[0,0,0,1,0],[0,0,0,0,1]]},grayscale:function(e){return[[.2126+.7874*(1-e),.7152-.7152*(1-e),.0722-.0722*(1-e),0,0],[.2126-.2126*(1-e),.7152+.2848*(1-e),.0722-.0722*(1-e),0,0],[.2126-.2126*(1-e),.7152-.7152*(1-e),.0722+.9278*(1-e),0,0],[0,0,0,1,0],[0,0,0,0,1]]}};function Ie(e){return e[1===e.mode?"darkSchemeBackgroundColor":"lightSchemeBackgroundColor"]}function We(e){return e[1===e.mode?"darkSchemeTextColor":"lightSchemeTextColor"]}var De=new Map,ze=new Map;function $e(e){if(ze.has(e))return ze.get(e);var t=be(Ee(e));return ze.set(e,t),t}var He=["r","g","b","a"],Ve=["mode","brightness","contrast","grayscale","sepia","darkSchemeBackgroundColor","darkSchemeTextColor","lightSchemeBackgroundColor","lightSchemeTextColor"];function Ge(e,t,r,n,o){var i;De.has(r)?i=De.get(r):(i=new Map,De.set(r,i));var u=function(e,t){return He.map((function(t){return e[t]})).concat(Ve.map((function(e){return t[e]}))).join(";")}(e,t);if(i.has(u))return i.get(u);var c=ge(r(be(e),null==n?null:$e(n),null==o?null:$e(o))),s=c.r,l=c.g,d=c.b,f=c.a,h=a(function(e,t){var r=a(e,3),n=qe(t,[[r[0]/255],[r[1]/255],[r[2]/255],[1],[1]]);return[0,1,2].map((function(e){return Ne(Math.round(255*n[e][0]),0,255)}))}([s,l,d],Be(t)),3),p=h[0],v=h[1],m=h[2],g=1===f?function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return"#"+(null!=o&&o<1?[t,r,n,Math.round(255*o)]:[t,r,n]).map((function(e){return(e<16?"0":"")+e.toString(16)})).join("")}({r:p,g:v,b:m}):function(e){var t=e.r,r=e.g,n=e.b,o=e.a;return null!=o&&o<1?"rgba("+ye(t)+", "+ye(r)+", "+ye(n)+", "+ye(o,2)+")":"rgb("+ye(t)+", "+ye(r)+", "+ye(n)+")"}({r:p,g:v,b:m,a:f});return i.set(u,g),g}function Ke(e){return e}function Qe(e,t){var r=Ie(t);return Ge(e,t,Je,We(t),r)}function Je(e,t,r){var n,o=e.h,a=e.s,i=e.l,u=e.a,c=i<.5;c?n=i<.2||a<.12:n=a<.24||i>.8&&(o>200&&o<280);var s=o,l=i;return n&&(c?(s=t.h,l=t.s):(s=r.h,l=r.s)),{h:s,s:l,l:Oe(i,0,1,t.l,r.l),a:u}}function Xe(e,t){var r=e.h,n=e.s,o=e.l,a=e.a,i=n<.12||o>.8&&(r>200&&r<280);if(o<.5){var u=Oe(o,0,.5,0,.4);return i?{h:t.h,s:t.s,l:u,a:a}:{h:r,s:n,l:u,a:a}}var c=Oe(o,.5,1,.4,t.l);if(i)return{h:t.h,s:t.s,l:c,a:a};var s=r;r>60&&r<180&&(s=r>120?Oe(r,120,180,135,180):Oe(r,60,120,60,105));return{h:s,s:n,l:c,a:a}}function Ye(e,r){if(0===r.mode)return Qe(e,r);var n=Ie(r);return Ge(e,t(t({},r),{mode:0}),Xe,n)}var Ze,et=.55;function tt(e){return Oe(e,205,245,205,220)}function rt(e,t){var r=e.h,n=e.s,o=e.l,a=e.a,i=o<.2||n<.24,u=!i&&r>205&&r<245;if(o>.5){var c=Oe(o,.5,1,et,t.l);if(i)return{h:t.h,s:t.s,l:c,a:a};var s=r;return u&&(s=tt(r)),{h:s,s:n,l:c,a:a}}if(i)return{h:t.h,s:t.s,l:Oe(o,0,.5,t.l,et),a:a};var l,d=r;return u?(d=tt(r),l=Oe(o,0,.5,t.l,Math.min(1,.6000000000000001))):l=Oe(o,0,.5,t.l,et),{h:d,s:n,l:l,a:a}}function nt(e,r){if(0===r.mode)return Qe(e,r);var n=We(r);return Ge(e,t(t({},r),{mode:0}),rt,n)}function ot(e,t,r){var n=e.h,o=e.s,a=e.l,i=e.a,u=n,c=o;return(a<.2||o<.24)&&(a<.5?(u=t.h,c=t.s):(u=r.h,c=r.s)),{h:u,s:c,l:Oe(a,0,1,.5,.2),a:i}}function at(e,r){if(0===r.mode)return Qe(e,r);var n=We(r),o=Ie(r);return Ge(e,t(t({},r),{mode:0}),ot,n,o)}function it(e,t){return Ye(e,t)}function ut(e){var t=[];return e.mode===Ze.dark&&t.push("invert(100%) hue-rotate(180deg)"),100!==e.brightness&&t.push("brightness("+e.brightness+"%)"),100!==e.contrast&&t.push("contrast("+e.contrast+"%)"),0!==e.grayscale&&t.push("grayscale("+e.grayscale+"%)"),0!==e.sepia&&t.push("sepia("+e.sepia+"%)"),0===t.length?null:t.join(" ")}!function(e){e[e.light=0]="light",e[e.dark=1]="dark"}(Ze||(Ze={}));var ct=0,st=new Map,lt=new Map;function dt(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t,r){var n=++ct;st.set(n,t),lt.set(n,r),chrome.runtime.sendMessage({type:"fetch",data:e,id:n})}))]}))}))}function ft(e){return r(this,void 0,void 0,(function(){var r,o,a;return n(this,(function(n){switch(n.label){case 0:return e.startsWith("data:")?(r=e,[3,3]):[3,1];case 1:return[4,ht(e)];case 2:r=n.sent(),n.label=3;case 3:return[4,pt(r)];case 4:return o=n.sent(),a=function(e){vt||(t=gt,r=gt,(vt=document.createElement("canvas")).width=t,vt.height=r,(mt=vt.getContext("2d")).imageSmoothingEnabled=!1);var t,r;var n=e.naturalWidth,o=e.naturalHeight;if(0===o||0===n)return z("logWarn(Image is empty "+e.currentSrc+")"),null;var a=n*o,i=Math.min(1,Math.sqrt(gt/a)),u=Math.ceil(n*i),c=Math.ceil(o*i);mt.clearRect(0,0,u,c),mt.drawImage(e,0,0,n,o,0,0,u,c);var s,l,d,f,h,p,v,m=mt.getImageData(0,0,u,c).data,g=.05,b=.4,y=.7,S=0,w=0,k=0;for(d=0;d<c;d++)for(l=0;l<u;l++)f=m[(s=4*(d*u+l))+0]/255,h=m[s+1]/255,p=m[s+2]/255,m[s+3]/255<g?S++:((v=.2126*f+.7152*h+.0722*p)<b&&w++,v>y&&k++);var _=u*c,E=_-S;return{isDark:w/E>=.7,isLight:k/E>=.7,isTransparent:S/_>=.1,isLarge:a>=48e4}}(o),[2,t({src:e,dataURL:r,width:o.naturalWidth,height:o.naturalHeight},a)]}}))}))}function ht(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return function(e){var t=new URL(e);return t.host?t.host:t.protocol}(e)!==(location.host||location.protocol)?[3,2]:[4,w(e)];case 1:return[2,t.sent()];case 2:return[4,dt({url:e,responseType:"data-url"})];case 3:return[2,t.sent()]}}))}))}function pt(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t,r){var n=new Image;n.onload=function(){return t(n)},n.onerror=function(){return r("Unable to load image "+e)},n.src=e}))]}))}))}chrome.runtime.onMessage.addListener((function(e){var t=e.type,r=e.data,n=e.error,o=e.id;if("fetch-response"===t){var a=st.get(o),i=lt.get(o);st.delete(o),lt.delete(o),n?i&&i(n):a&&a(r)}}));var vt,mt,gt=1024;var bt=new Set;function yt(e,t){for(var r=e.dataURL,n=e.width,o=e.height,a=['<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="'+n+'" height="'+o+'">',"<defs>",'<filter id="darkreader-image-filter">','<feColorMatrix type="matrix" values="'+Be(t).slice(0,4).map((function(e){return e.map((function(e){return e.toFixed(3)})).join(" ")})).join(" ")+'" />',"</filter>","</defs>",'<image width="'+n+'" height="'+o+'" filter="url(#darkreader-image-filter)" xlink:href="'+r+'" />',"</svg>"].join(""),i=new Uint8Array(a.length),u=0;u<a.length;u++)i[u]=a.charCodeAt(u);var c=new Blob([i],{type:"image/svg+xml"}),s=URL.createObjectURL(c);return bt.add(s),s}function St(){vt=null,mt=null,bt.forEach((function(e){return URL.revokeObjectURL(e)})),bt.clear()}function wt(e,o,a,i,u){var c=Boolean(a&&a.style&&a.style.getPropertyPriority(e)),s=o;if(e.startsWith("--"))return null;if(e.indexOf("color")>=0&&"-webkit-print-color-adjust"!==e||"fill"===e||"stroke"===e||"stop-color"===e){if(l=function(e,t){if(xt.has(t.toLowerCase()))return t;try{var r=Mt(t);return e.indexOf("background")>=0?function(e){return Ye(r,e)}:e.indexOf("border")>=0||e.indexOf("outline")>=0?function(e){return at(r,e)}:function(e){return nt(r,e)}}catch(e){return z("Color parse error",e),null}}(e,o))return{property:e,value:l,important:c,sourceValue:s}}else if("background-image"===e||"list-style-image"===e){if(l=function(e,o,a,i){var u=this;try{var c=Fe(At,e),s=Fe(Q,e);if(0===s.length&&0===c.length)return e;var l=function(t){var r=0;return t.map((function(t){var n=e.indexOf(t,r);return r=n+t.length,{match:t,index:n}}))},d=l(s).map((function(e){return t({type:"url"},e)})).concat(l(c).map((function(e){return t({type:"gradient"},e)}))).sort((function(e,t){return e.index-t.index})),f=function(e){var t=e.match(/^(.*-gradient)\((.*)\)$/),r=t[1],n=t[2],o=/^(from|color-stop|to)\(([^\(\)]*?,\s*)?(.*?)\)$/,a=Fe(/([^\(\),]+(\([^\(\)]*(\([^\(\)]*\)*[^\(\)]*)?\))?[^\(\),]*),?/g,n,1).map((function(e){var t=Rt(e=e.trim());if(t)return function(e){return it(t,e)};var r=e.lastIndexOf(" ");if(t=Rt(e.substring(0,r)))return function(n){return it(t,n)+" "+e.substring(r+1)};var n=e.match(o);return n&&(t=Rt(n[3]))?function(e){return n[1]+"("+(n[2]?n[2]+", ":"")+it(t,e)+")"}:function(){return e}}));return function(e){return r+"("+a.map((function(t){return t(e)})).join(", ")+")"}},h=function(e){var t=X(e);if(o.parentStyleSheet.href){var c=Y(o.parentStyleSheet.href);t=W(c,t)}else t=o.parentStyleSheet.ownerNode&&o.parentStyleSheet.ownerNode.baseURI?W(o.parentStyleSheet.ownerNode.baseURI,t):W(location.origin,t);var s='url("'+t+'")';return function(e){return r(u,void 0,void 0,(function(){var r,u;return n(this,(function(n){switch(n.label){case 0:return Lt.has(t)?(r=Lt.get(t),[3,7]):[3,1];case 1:return n.trys.push([1,6,,7]),function(e,t){if(!e||0===t.length)return!1;if(t.some((function(e){return"*"===e})))return!0;for(var r=e.selectorText.split(/,\s*/g),n=function(e){var n=t[e];if(r.some((function(e){return e===n})))return{value:!0}},o=0;o<t.length;o++){var a=n(o);if("object"==typeof a)return a.value}return!1}(o,a)?[2,null]:Pt.has(t)?(u=Pt.get(t),[4,new Promise((function(e){return u.push(e)}))]):[3,3];case 2:return(r=n.sent())?[3,5]:[2,null];case 3:return Pt.set(t,[]),[4,ft(t)];case 4:r=n.sent(),Lt.set(t,r),Pt.get(t).forEach((function(e){return e(r)})),Pt.delete(t),n.label=5;case 5:return i()?[2,null]:[3,7];case 6:return z(n.sent()),Pt.has(t)&&(Pt.get(t).forEach((function(e){return e(null)})),Pt.delete(t)),[2,s];case 7:return[2,p(r,e)||s]}}))}))}},p=function(e,r){var n,o=e.isDark,a=e.isLight,i=e.isTransparent,u=e.isLarge,c=e.width;if(o&&i&&1===r.mode&&!u&&c>2)D("Inverting dark image "+e.src),n='url("'+yt(e,t(t({},r),{sepia:Ne(r.sepia+10,0,100)}))+'")';else if(a&&!i&&1===r.mode){if(u)n="none";else D("Dimming light image "+e.src),n='url("'+yt(e,r)+'")'}else if(0===r.mode&&a&&!u){D("Applying filter to image "+e.src),n='url("'+yt(e,t(t({},r),{brightness:Ne(r.brightness-10,5,200),sepia:Ne(r.sepia+10,0,100)}))+'")'}else n=null;return n},v=[],m=0;return d.forEach((function(t,r){var n=t.match,o=t.type,a=t.index,i=m,u=a+n.length;m=u,v.push((function(){return e.substring(i,a)})),v.push("url"===o?h(n):f(n)),r===d.length-1&&v.push((function(){return e.substring(u)}))})),function(e){var t=v.map((function(t){return t(e)}));return t.some((function(e){return e instanceof Promise}))?Promise.all(t).then((function(e){return e.join("")})):t.join("")}}catch(t){return z("Unable to parse gradient "+e,t),null}}(o,a,i,u))return{property:e,value:l,important:c,sourceValue:s}}else if(e.indexOf("shadow")>=0){var l;if(l=function(e){try{var t=0,r=Fe(/(^|\s)([a-z]+\(.+?\)|#[0-9a-f]+|[a-z]+)(.*?(inset|outset)?($|,))/gi,e,2),n=r.map((function(n,o){var a=t,i=e.indexOf(n,t),u=i+n.length;t=u;var c=Rt(n);return c?function(t){return""+e.substring(a,i)+function(e,t){return Ye(e,t)}(c,t)+(o===r.length-1?e.substring(u):"")}:function(){return e.substring(a,u)}}));return function(e){return n.map((function(t){return t(e)})).join("")}}catch(t){return z("Unable to parse shadow "+e,t),null}}(o))return{property:e,value:l,important:c,sourceValue:s}}return null}function kt(e,r,n){var o=[];return r||(o.push("html {"),o.push(" background-color: "+Ye({r:255,g:255,b:255},e)+" !important;"),o.push("}")),o.push((r?"":"html, body, ")+(n?"input, textarea, select, button":"")+" {"),o.push(" background-color: "+Ye({r:255,g:255,b:255},e)+";"),o.push("}"),o.push("html, body, "+(n?"input, textarea, select, button":"")+" {"),o.push(" border-color: "+at({r:76,g:76,b:76},e)+";"),o.push(" color: "+nt({r:0,g:0,b:0},e)+";"),o.push("}"),o.push("a {"),o.push(" color: "+nt({r:0,g:64,b:255},e)+";"),o.push("}"),o.push("table {"),o.push(" border-color: "+at({r:128,g:128,b:128},e)+";"),o.push("}"),o.push("::placeholder {"),o.push(" color: "+nt({r:169,g:169,b:169},e)+";"),o.push("}"),o.push("input:-webkit-autofill,"),o.push("textarea:-webkit-autofill,"),o.push("select:-webkit-autofill {"),o.push(" background-color: "+Ye({r:250,g:255,b:189},e)+" !important;"),o.push(" color: "+nt({r:0,g:0,b:0},e)+" !important;"),o.push("}"),e.scrollbarColor&&o.push(function(e){var r,n,o,a,i,u,c=[];if("auto"===e.scrollbarColor)r=Ye({r:241,g:241,b:241},e),n=nt({r:96,g:96,b:96},e),o=Ye({r:176,g:176,b:176},e),a=Ye({r:144,g:144,b:144},e),i=Ye({r:96,g:96,b:96},e),u=Ye({r:255,g:255,b:255},e);else{var s=be(Ee(e.scrollbarColor)),l=s.l>.5,d=function(e){return t(t({},s),{l:Ne(s.l+e,0,1)})},h=function(e){return t(t({},s),{l:Ne(s.l-e,0,1)})};r=Se(h(.4)),n=Se(l?h(.4):d(.4)),o=Se(s),a=Se(d(.1)),i=Se(d(.2))}c.push("::-webkit-scrollbar {"),c.push(" background-color: "+r+";"),c.push(" color: "+n+";"),c.push("}"),c.push("::-webkit-scrollbar-thumb {"),c.push(" background-color: "+o+";"),c.push("}"),c.push("::-webkit-scrollbar-thumb:hover {"),c.push(" background-color: "+a+";"),c.push("}"),c.push("::-webkit-scrollbar-thumb:active {"),c.push(" background-color: "+i+";"),c.push("}"),c.push("::-webkit-scrollbar-corner {"),c.push(" background-color: "+u+";"),c.push("}"),f&&(c.push("* {"),c.push(" scrollbar-color: "+o+" "+r+";"),c.push("}"));return c.join("\n")}(e)),e.selectionColor&&o.push(function(e){var t=[],r=_t(e),n=r.backgroundColorSelection,o=r.foregroundColorSelection;return["::selection","::-moz-selection"].forEach((function(e){t.push(e+" {"),t.push(" background-color: "+n+" !important;"),t.push(" color: "+o+" !important;"),t.push("}")})),t.join("\n")}(e)),o.join("\n")}function _t(e){var r,n;if("auto"===e.selectionColor)r=Ye({r:0,g:96,b:212},t(t({},e),{grayscale:0})),n=nt({r:255,g:255,b:255},t(t({},e),{grayscale:0}));else{var o=be(Ee(e.selectionColor));r=e.selectionColor,n=o.l<.5?"#FFF":"#000"}return{backgroundColorSelection:r,foregroundColorSelection:n}}function Et(e,t){var r=t.strict,n=[];return n.push("html, body, "+(r?"body :not(iframe)":"body > :not(iframe)")+" {"),n.push(" background-color: "+Ye({r:255,g:255,b:255},e)+" !important;"),n.push(" border-color: "+at({r:64,g:64,b:64},e)+" !important;"),n.push(" color: "+nt({r:0,g:0,b:0},e)+" !important;"),n.push("}"),n.join("\n")}var xt=new Set(["inherit","transparent","initial","currentcolor","none","unset"]),Ct=new Map;function Mt(e){if(e=e.trim(),Ct.has(e))return Ct.get(e);var t=Ee(e);return Ct.set(e,t),t}function Rt(e){try{return Mt(e)}catch(e){return null}}var At=/[\-a-z]+gradient\(([^\(\)]*(\(([^\(\)]*(\(.*?\)))*[^\(\)]*\))){0,15}[^\(\)]*\)/g,Lt=new Map,Pt=new Map;function Tt(){Ct.clear(),De.clear(),ze.clear(),Lt.clear(),St(),Pt.clear()}var jt={"background-color":{customProp:"--darkreader-inline-bgcolor",cssProp:"background-color",dataAttr:"data-darkreader-inline-bgcolor"},"background-image":{customProp:"--darkreader-inline-bgimage",cssProp:"background-image",dataAttr:"data-darkreader-inline-bgimage"},"border-color":{customProp:"--darkreader-inline-border",cssProp:"border-color",dataAttr:"data-darkreader-inline-border"},"border-bottom-color":{customProp:"--darkreader-inline-border-bottom",cssProp:"border-bottom-color",dataAttr:"data-darkreader-inline-border-bottom"},"border-left-color":{customProp:"--darkreader-inline-border-left",cssProp:"border-left-color",dataAttr:"data-darkreader-inline-border-left"},"border-right-color":{customProp:"--darkreader-inline-border-right",cssProp:"border-right-color",dataAttr:"data-darkreader-inline-border-right"},"border-top-color":{customProp:"--darkreader-inline-border-top",cssProp:"border-top-color",dataAttr:"data-darkreader-inline-border-top"},"box-shadow":{customProp:"--darkreader-inline-boxshadow",cssProp:"box-shadow",dataAttr:"data-darkreader-inline-boxshadow"},color:{customProp:"--darkreader-inline-color",cssProp:"color",dataAttr:"data-darkreader-inline-color"},fill:{customProp:"--darkreader-inline-fill",cssProp:"fill",dataAttr:"data-darkreader-inline-fill"},stroke:{customProp:"--darkreader-inline-stroke",cssProp:"stroke",dataAttr:"data-darkreader-inline-stroke"},"outline-color":{customProp:"--darkreader-inline-outline",cssProp:"outline-color",dataAttr:"data-darkreader-inline-outline"},"stop-color":{customProp:"--darkreader-inline-stopcolor",cssProp:"stop-color",dataAttr:"data-darkreader-inline-stopcolor"}},Ot=Object.values(jt),Nt=["style","fill","stop-color","stroke","bgcolor","color"],qt=Nt.map((function(e){return"["+e+"]"})).join(", ");function Ft(){return Ot.map((function(e){var t=e.dataAttr,r=e.customProp;return["["+t+"] {"," "+e.cssProp+": var("+r+") !important;","}"].join("\n")})).join("\n")}var Bt=new Map,Ut=new Map;function It(e,t,r){Bt.has(e)&&(Bt.get(e).disconnect(),Ut.get(e).disconnect());var n=new WeakSet;function o(e){(function(e){var t=[];return e instanceof Element&&e.matches(qt)&&t.push(e),(e instanceof Element||m&&e instanceof ShadowRoot||e instanceof Document)&&F(t,e.querySelectorAll(qt)),t})(e).forEach((function(e){n.has(e)||(n.add(e),t(e))})),ue(e,(function(o){n.has(e)||(n.add(e),r(o.shadowRoot),It(o.shadowRoot,t,r))}))}var a=ve(e,{onMinorMutations:function(e){e.additions.forEach((function(e){return o(e)}))},onHugeMutations:function(){o(e)}});Bt.set(e,a);var u=0,c=null,s=oe({seconds:10}),l=oe({seconds:2}),d=[],f=null,h=ne((function(e){e.forEach((function(e){Nt.includes(e.attributeName)&&t(e.target)}))})),p=new MutationObserver((function(e){if(f)d.push.apply(d,i(e));else{u++;var t=Date.now();if(null==c)c=t;else if(u>=50){if(t-c<s)return f=setTimeout((function(){c=null,u=0,f=null;var e=d;d=[],h(e)}),l),void d.push.apply(d,i(e));c=t,u=1}h(e)}}));p.observe(e,{attributes:!0,attributeFilter:Nt.concat(Ot.map((function(e){return e.dataAttr}))),subtree:!0}),Ut.set(e,p)}var Wt=new WeakMap,Dt=["brightness","contrast","grayscale","sepia","mode"];function zt(e,t){return Nt.map((function(t){return t+'="'+e.getAttribute(t)+'"'})).concat(Dt.map((function(e){return e+'="'+t[e]+'"'}))).join(" ")}function $t(e,t,r,n){if(zt(e,t)!==Wt.get(e)){var o=new Set(Object.keys(jt));if(r.length>0&&function(e,t){for(var r=0,n=t.length;r<n;r++){var o=t[r];if(e.matches(o))return!0}return!1}(e,r))o.forEach((function(t){e.removeAttribute(jt[t].dataAttr)}));else{if(e.hasAttribute("bgcolor"))((a=e.getAttribute("bgcolor")).match(/^[0-9a-f]{3}$/i)||a.match(/^[0-9a-f]{6}$/i))&&(a="#"+a),l("background-color","background-color",a);if(e.hasAttribute("color"))((a=e.getAttribute("color")).match(/^[0-9a-f]{3}$/i)||a.match(/^[0-9a-f]{6}$/i))&&(a="#"+a),l("color","color",a);if(e instanceof SVGElement){if(e.hasAttribute("fill")){var a=e.getAttribute("fill"),i=!1;if(!(e instanceof SVGTextElement)){var u=e.getBoundingClientRect(),c=u.width,s=u.height;i=c>32||s>32}l("fill",i?"background-color":"color",a)}e.hasAttribute("stop-color")&&l("stop-color","background-color",e.getAttribute("stop-color"))}if(e.hasAttribute("stroke")){a=e.getAttribute("stroke");l("stroke",e instanceof SVGLineElement||e instanceof SVGTextElement?"border-color":"color",a)}e.style&&H(e.style,(function(e,t){"background-image"===e&&t.indexOf("url")>=0||jt.hasOwnProperty(e)&&l(e,e,t)})),e.style&&e instanceof SVGTextElement&&e.style.fill&&l("fill","color",e.style.getPropertyValue("fill")),q(o,(function(t){e.removeAttribute(jt[t].dataAttr)})),Wt.set(e,zt(e,t))}}function l(r,a,i){var u=jt[r],c=u.customProp,s=u.dataAttr,l=wt(a,i,null,n,null);if(l){var d=l.value;"function"==typeof d&&(d=d(t)),e.style.setProperty(c,d),e.hasAttribute(s)||e.setAttribute(s,""),o.delete(r)}}}var Ht="theme-color",Vt='meta[name="theme-color"]',Gt=null,Kt=null;function Qt(e,t){Gt=Gt||e.content;try{var r=Ee(Gt);e.content=Ye(r,t)}catch(e){z(e)}}var Jt=["mode","brightness","contrast","grayscale","sepia","darkSchemeBackgroundColor","darkSchemeTextColor","lightSchemeBackgroundColor","lightSchemeTextColor"];var Xt=function(){var e=[],t=null;function r(){for(var r;r=e.shift();)r();t=null}return{add:function(n){e.push(n),t||(t=requestAnimationFrame(r))},cancel:function(){e.splice(0),cancelAnimationFrame(t),t=null}}}();function Yt(){var e=0,t=new Map,r=new Map,n=null;return{modifySheet:function(o){var a=o.sourceCSSRules,i=o.theme,u=o.variables,c=o.ignoreImageAnalysis,s=o.force,l=o.prepareSheet,d=o.isAsyncCancelled,f=0===r.size,h=new Set(r.keys()),p=function(e){return Jt.map((function(t){return t+":"+e[t]})).join(";")}(i),v=p!==n,m=[];if($(a,(function(e){var n,o=e.cssText,a=!1;h.delete(o),t.has(o)||(t.set(o,o),a=!0);var i=null;if(u.size>0||o.includes("var(")){var s=re(o,u);t.get(o)!==s&&(t.set(o,s),a=!0,(n=function(){if(me)return me;if(y)return me=new CSSStyleSheet;var e=document.createElement("style");return document.head.append(e),me=e.sheet,document.head.removeChild(e),me}()).insertRule(s),i=n.cssRules[0])}if(a){f=!0;var l=[],p=i||e;p&&p.style&&H(p.style,(function(t,r){var n=wt(t,r,e,c,d);n&&l.push(n)}));var v=null;if(l.length>0){var g=e.parentRule;v={selector:e.selectorText,declarations:l,parentRule:g},m.push(v)}r.set(o,v),n&&n.deleteRule(0)}else m.push(r.get(o))})),h.forEach((function(e){t.delete(e),r.delete(e)})),n=p,s||f||v){e++;var g=new Map,b=0,S={rule:null,rules:[],isGroup:!0},w=new WeakMap;m.filter((function(e){return e})).forEach((function(t){var r=t.selector,n=t.declarations,o=E(t.parentRule),a={selector:r,declarations:[],isGroup:!1},u=a.declarations;o.rules.push(a),n.forEach((function(t){var r=t.property,n=t.value,o=t.important,a=t.sourceValue;if("function"==typeof n){var c=n(i);if(c instanceof Promise){var s=b++,l={property:r,value:null,important:o,asyncKey:s,sourceValue:a};u.push(l);var f=e;c.then((function(t){t&&!d()&&f===e&&(l.value=t,Xt.add((function(){d()||f!==e||function(e){var t=g.get(e),r=t.rule,n=t.target,o=t.index;n.deleteRule(o),_(n,o,r),g.delete(e)}(s)})))}))}else u.push({property:r,value:c,important:o,sourceValue:a})}else u.push({property:r,value:n,important:o,sourceValue:a})}))}));var k=l();!function e(t,r,n){t.rules.forEach((function(t){t.isGroup?e(t,function(e,t){var r=e.rule;if(r instanceof CSSMediaRule){var n=r.media,o=t.cssRules.length;return t.insertRule("@media "+n.mediaText+" {}",o),t.cssRules[o]}return t}(t,r),n):n(t,r)}))}(S,k,(function(e,t){var r=t.cssRules.length;e.declarations.filter((function(e){return null==e.value})).forEach((function(n){var o=n.asyncKey;return g.set(o,{rule:e,target:t,index:r})})),_(t,r,e)}))}function _(e,t,r){var n=r.selector,o=r.declarations;e.insertRule(n+" {}",t);var a=e.cssRules[t].style;o.forEach((function(e){var t=e.property,r=e.value,n=e.important,o=e.sourceValue;a.setProperty(t,null==r?o:r,n?"important":"")}))}function E(e){if(null==e)return S;if(w.has(e))return w.get(e);var t={rule:e,rules:[],isGroup:!0};return w.set(e,t),E(e.parentRule).rules.push(t),t}}}}function Zt(e){return(e instanceof HTMLStyleElement||e instanceof SVGStyleElement||e instanceof HTMLLinkElement&&e.rel&&e.rel.toLowerCase().includes("stylesheet")&&!e.disabled)&&!e.classList.contains("darkreader")&&"print"!==e.media&&!e.classList.contains("stylus")}function er(e,t,r){return void 0===t&&(t=[]),void 0===r&&(r=!0),Zt(e)?t.push(e):(e instanceof Element||m&&e instanceof ShadowRoot||e===document)&&(q(e.querySelectorAll('style, link[rel*="stylesheet" i]:not([disabled])'),(function(e){return er(e,t,!1)})),r&&ue(e,(function(e){return er(e.shadowRoot,t,!1)}))),t}var tr=new WeakSet,rr=new WeakSet,nr=!1;function or(e,t){for(var o=t.update,i=t.loadingStart,u=t.loadingEnd,c=[],s=e;(s=s.nextElementSibling)&&s.matches(".darkreader");)c.push(s);var l=c.find((function(e){return e.matches(".darkreader--cors")&&!rr.has(e)}))||null,f=c.find((function(e){return e.matches(".darkreader--sync")&&!tr.has(e)}))||null,p=null,v=null,m=!1,g=Yt(),b=new MutationObserver((function(){o()})),y={attributes:!0,childList:!0,subtree:!0,characterData:!0};function S(){return e instanceof HTMLStyleElement&&e.textContent.trim().match(J)}function w(){return l?l.sheet.cssRules:S()?null:R()}function k(){l?(e.nextSibling!==l&&e.parentNode.insertBefore(l,e.nextSibling),l.nextSibling!==f&&e.parentNode.insertBefore(f,l.nextSibling)):e.nextSibling!==f&&e.parentNode.insertBefore(f,e.nextSibling)}var _=!1,E=!1;function x(){return r(this,void 0,void 0,(function(){var t,r,o,i,u,c,s;return n(this,(function(n){switch(n.label){case 0:if(!(e instanceof HTMLLinkElement))return[3,7];if(o=a(M(),2),i=o[0],(u=o[1])&&z(u),!(!i&&!u&&!h||h&&!e.sheet||(d=u,d&&d.message&&d.message.includes("loading"))))return[3,5];n.label=1;case 1:return n.trys.push([1,3,,4]),[4,ar(e)];case 2:return n.sent(),[3,4];case 3:return z(n.sent()),E=!0,[3,4];case 4:if(m)return[2,null];s=a(M(),2),i=s[0],(u=s[1])&&z(u),n.label=5;case 5:return null!=i?[2,i]:[4,ir(e.href)];case 6:return t=n.sent(),r=Y(e.href),m?[2,null]:[3,8];case 7:if(!S())return[2,null];t=e.textContent.trim(),r=Y(location.href),n.label=8;case 8:if(!t)return[3,13];n.label=9;case 9:return n.trys.push([9,11,,12]),[4,ur(t,r)];case 10:return c=n.sent(),l=function(e,t){if(!t)return null;var r=document.createElement("style");return r.classList.add("darkreader"),r.classList.add("darkreader--cors"),r.media="screen",r.textContent=t,e.parentNode.insertBefore(r,e.nextSibling),r.sheet.disabled=!0,rr.add(r),r}(e,c),[3,12];case 11:return z(n.sent()),[3,12];case 12:if(l)return p=ie(l,"prev-sibling"),[2,l.sheet.cssRules];n.label=13;case 13:return[2,null]}var d}))}))}var C=!1;function M(){try{return null==e.sheet?[null,null]:[e.sheet.cssRules,null]}catch(e){return[null,e]}}function R(){var e=a(M(),2),t=e[0],r=e[1];return r?(z(r),null):t}function A(){e.addEventListener("__darkreader__updateSheet",N),d||nr&&e.sheet||function(){L=T(),j();var t=function(){T()!==L&&(L=T(),o()),nr&&e.sheet?j():P=requestAnimationFrame(t)};t()}()}var L=null,P=null;function T(){var e=R();return e?e.length:null}function j(){cancelAnimationFrame(P)}var O=!1;function N(){function e(){O=!1,m||o()}nr=!0,j(),O||(O=!0,"function"==typeof queueMicrotask?queueMicrotask(e):requestAnimationFrame(e))}function q(){e.removeEventListener("__darkreader__updateSheet",N),j()}function F(){b.disconnect(),m=!0,p&&p.stop(),v&&v.stop(),q()}var B=0;return{details:function(){var e=w();return e?{variables:G(e)}:(_||E||(_=!0,i(),x().then((function(e){_=!1,u(),e&&o()})).catch((function(e){z(e),_=!1,u()}))),null)},render:function(t,r,n){var o=w();function a(){f||((f=e instanceof SVGStyleElement?document.createElementNS("http://www.w3.org/2000/svg","style"):document.createElement("style")).classList.add("darkreader"),f.classList.add("darkreader--sync"),f.media="screen",tr.add(f)),v&&v.stop(),k(),null==f.sheet&&(f.textContent="");for(var t=f.sheet,r=t.cssRules.length-1;r>=0;r--)t.deleteRule(r);return v?v.run():v=ie(f,"prev-sibling",(function(){C=!0,i()})),f.sheet}function i(){var e=C;C=!1,g.modifySheet({prepareSheet:a,sourceCSSRules:o,theme:t,variables:r,ignoreImageAnalysis:n,force:e,isAsyncCancelled:function(){return m}})}o&&(m=!1,i())},pause:F,destroy:function(){F(),ae(l),ae(f)},watch:function(){b.observe(e,y),e instanceof HTMLStyleElement&&A()},restore:function(){if(f)if(++B>10)z("Style sheet was moved multiple times",e);else{z("Restore style",f,e);var t=null==f.sheet||f.sheet.cssRules.length>0;k(),p&&p.skip(),v&&v.skip(),t&&(C=!0,o())}}}}function ar(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t,r){var n=function(){e.removeEventListener("load",o),e.removeEventListener("error",a)},o=function(){n(),t()},a=function(){n(),r("Link loading failed "+e.href)};e.addEventListener("load",o),e.addEventListener("error",a)}))]}))}))}function ir(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){switch(t.label){case 0:return e.startsWith("data:")?[4,fetch(e)]:[3,3];case 1:return[4,t.sent().text()];case 2:return[2,t.sent()];case 3:return[4,dt({url:e,responseType:"text",mimeType:"text/css"})];case 4:return[2,t.sent()]}}))}))}function ur(e,t,a){return void 0===a&&(a=new Map),r(this,void 0,void 0,(function(){var r,i,u,c,s,l,d,f,h,p;return n(this,(function(n){switch(n.label){case 0:e=function(e,t){return e.replace(Q,(function(e){var r=X(e);return'url("'+W(t,r)+'")'}))}(e=function(e){return e.replace(ee,"")}(e=e.replace(Z,"")),t),r=Fe(J,e),n.label=1;case 1:n.trys.push([1,10,11,12]),i=o(r),u=i.next(),n.label=2;case 2:return u.done?[3,9]:(c=u.value,s=X(c.substring(8).replace(/;$/,"")),l=W(t,s),d=void 0,a.has(l)?(d=a.get(l),[3,7]):[3,3]);case 3:return n.trys.push([3,6,,7]),[4,ir(l)];case 4:return d=n.sent(),a.set(l,d),[4,ur(d,Y(l),a)];case 5:return d=n.sent(),[3,7];case 6:return z(n.sent()),d="",[3,7];case 7:e=e.split(c).join(d),n.label=8;case 8:return u=i.next(),[3,2];case 9:return[3,12];case 10:return f=n.sent(),h={error:f},[3,12];case 11:try{u&&!u.done&&(p=i.return)&&p.call(i)}finally{if(h)throw h.error}return[7];case 12:return[2,e=e.trim()]}}))}))}document.addEventListener("__darkreader__inlineScriptsAllowed",(function(){nr=!0}));var cr,sr,lr=[],dr=new Map;function fr(e){b&&q(e.querySelectorAll(":not(:defined)"),(function(e){var t=e.tagName.toLowerCase();dr.has(t)||(dr.set(t,new Set),function(e){return r(this,void 0,void 0,(function(){return n(this,(function(t){return[2,new Promise((function(t){if(window.customElements&&"function"==typeof customElements.whenDefined)customElements.whenDefined(e).then(t);else if(hr)pr.set(e,t),document.dispatchEvent(new CustomEvent("__darkreader__addUndefinedResolver",{detail:{tag:e}}));else{var r=function(){var n=dr.get(e);n&&n.size>0&&(n.values().next().value.matches(":defined")?t():requestAnimationFrame(r))};requestAnimationFrame(r)}}))]}))}))}(t).then((function(){if(sr){var e=dr.get(t);dr.delete(t),sr(Array.from(e))}}))),dr.get(t).add(e)}))}var hr=!1;document.addEventListener("__darkreader__inlineScriptsAllowed",(function(){hr=!0}));var pr=new Map;function vr(e){(hr=!0,pr.has(e.detail.tag))&&pr.get(e.detail.tag)()}function mr(e,t,r){gr();var n=new Set(e),o=new WeakMap,a=new WeakMap;function i(e){o.set(e,e.previousElementSibling),a.set(e,e.nextElementSibling)}function u(e){var r=e.createdStyles,u=e.removedStyles,c=e.movedStyles;r.forEach((function(e){return i(e)})),c.forEach((function(e){return i(e)})),u.forEach((function(e){return t=e,o.delete(t),void a.delete(t);var t})),r.forEach((function(e){return n.add(e)})),u.forEach((function(e){return n.delete(e)})),r.size+u.size+c.size>0&&t({created:Array.from(r),removed:Array.from(u),moved:Array.from(c),updated:[]})}function c(e){var t=e.additions,r=e.moves,n=e.deletions,o=new Set,a=new Set,i=new Set;t.forEach((function(e){return er(e).forEach((function(e){return o.add(e)}))})),n.forEach((function(e){return er(e).forEach((function(e){return a.add(e)}))})),r.forEach((function(e){return er(e).forEach((function(e){return i.add(e)}))})),u({createdStyles:o,removedStyles:a,movedStyles:i}),t.forEach((function(e){ue(e,f),fr(e)}))}function s(e){var t=new Set(er(e)),r=new Set,i=new Set,c=new Set;t.forEach((function(e){n.has(e)||r.add(e)})),n.forEach((function(e){t.has(e)||i.add(e)})),t.forEach((function(e){var t;r.has(e)||i.has(e)||(t=e).previousElementSibling===o.get(t)&&t.nextElementSibling===a.get(t)||c.add(e)})),u({createdStyles:r,removedStyles:i,movedStyles:c}),ue(e,f),fr(e)}function l(e){var r=new Set,n=new Set;e.forEach((function(e){var t=e.target;t.isConnected&&(Zt(t)?r.add(t):t instanceof HTMLLinkElement&&t.disabled&&n.add(t))})),r.size+n.size>0&&t({updated:Array.from(r),created:[],removed:Array.from(n),moved:[]})}function d(e){var t=ve(e,{onMinorMutations:c,onHugeMutations:s}),r=new MutationObserver(l);r.observe(e,{attributes:!0,attributeFilter:["rel","disabled","media"],subtree:!0}),lr.push(t,r),cr.add(e)}function f(e){var t=e.shadowRoot;null==t||cr.has(t)||(d(t),r(t))}e.forEach(i),d(document),ue(document.documentElement,f),sr=function(e){var r=[];e.forEach((function(e){return F(r,er(e.shadowRoot))})),t({created:r,updated:[],removed:[],moved:[]}),e.forEach((function(e){var t=e.shadowRoot;null!=t&&(f(e),ue(t,f),fr(t))}))},document.addEventListener("__darkreader__isDefined",vr),fr(document)}function gr(){lr.forEach((function(e){return e.disconnect()})),lr.splice(0,lr.length),cr=new WeakSet,sr=null,dr.clear(),document.removeEventListener("__darkreader__isDefined",vr)}var br=new WeakMap,yr=new WeakSet;function Sr(e){var t=!1;return{render:function(r,n,o){e.adoptedStyleSheets.forEach((function(a){if(!yr.has(a)){var u=a.rules,c=new CSSStyleSheet,s=n;G(a.cssRules).forEach((function(e,t){return s.set(t,e)})),Yt().modifySheet({prepareSheet:function(){for(var t=c.cssRules.length-1;t>=0;t--)c.deleteRule(t);return function(t,r){var n=i(e.adoptedStyleSheets),o=n.indexOf(t),a=n.indexOf(r);o!==a-1&&(a>=0&&n.splice(a,1),n.splice(o+1,0,r),e.adoptedStyleSheets=n)}(a,c),br.set(a,c),yr.add(c),c},sourceCSSRules:u,theme:r,variables:s,ignoreImageAnalysis:o,force:!1,isAsyncCancelled:function(){return t}})}}))},destroy:function(){t=!0;var r=i(e.adoptedStyleSheets);e.adoptedStyleSheets.forEach((function(e){if(yr.has(e)){var t=r.indexOf(e);t>=0&&r.splice(t,1),br.delete(e),yr.delete(e)}})),e.adoptedStyleSheets=r}}}function wr(){document.dispatchEvent(new CustomEvent("__darkreader__inlineScriptsAllowed"));var e=Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype,"addRule"),t=Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype,"insertRule"),r=Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype,"deleteRule"),n=Object.getOwnPropertyDescriptor(CSSStyleSheet.prototype,"removeRule"),o=function(){Object.defineProperty(CSSStyleSheet.prototype,"addRule",e),Object.defineProperty(CSSStyleSheet.prototype,"insertRule",t),Object.defineProperty(CSSStyleSheet.prototype,"deleteRule",r),Object.defineProperty(CSSStyleSheet.prototype,"removeRule",n),document.removeEventListener("__darkreader__cleanUp",o),document.removeEventListener("__darkreader__addUndefinedResolver",a)},a=function(e){customElements.whenDefined(e.detail.tag).then((function(){document.dispatchEvent(new CustomEvent("__darkreader__isDefined",{detail:{tag:e.detail.tag}}))}))};document.addEventListener("__darkreader__cleanUp",o),document.addEventListener("__darkreader__addUndefinedResolver",a);var i=new Event("__darkreader__updateSheet");Object.defineProperty(CSSStyleSheet.prototype,"addRule",Object.assign({},e,{value:function(t,r,n){return e.value.call(this,t,r,n),this.ownerNode&&!this.ownerNode.classList.contains("darkreader")&&this.ownerNode.dispatchEvent(i),-1}})),Object.defineProperty(CSSStyleSheet.prototype,"insertRule",Object.assign({},t,{value:function(e,r){var n=t.value.call(this,e,r);return this.ownerNode&&!this.ownerNode.classList.contains("darkreader")&&this.ownerNode.dispatchEvent(i),n}})),Object.defineProperty(CSSStyleSheet.prototype,"deleteRule",Object.assign({},r,{value:function(e){r.value.call(this,e),this.ownerNode&&!this.ownerNode.classList.contains("darkreader")&&this.ownerNode.dispatchEvent(i)}})),Object.defineProperty(CSSStyleSheet.prototype,"removeRule",Object.assign({},n,{value:function(e){n.value.call(this,e),this.ownerNode&&!this.ownerNode.classList.contains("darkreader")&&this.ownerNode.dispatchEvent(i)}}))}var kr=new Map,_r=Array.from(crypto.getRandomValues(new Uint8Array(16))).map((function(e){return((t=e)<16?"0":"")+t.toString(16);var t})).join(""),Er=new Map,xr=[],Cr=null,Mr=null,Rr=null,Ar=null,Lr=null;function Pr(e,t){void 0===t&&(t=document.head||document);var r=t.querySelector("."+e);return r||((r=document.createElement("style")).classList.add("darkreader"),r.classList.add(e),r.media="screen"),r}var Tr=new Map;function jr(e,t){Tr.has(t)&&Tr.get(t).stop(),Tr.set(t,ie(e,"parent"))}function Or(){var e=Pr("darkreader--fallback",document);e.textContent=Et(Cr,{strict:!0}),document.head.insertBefore(e,document.head.firstChild),jr(e,"fallback");var r=Pr("darkreader--user-agent");r.textContent=kt(Cr,Rr,Cr.styleSystemControls),document.head.insertBefore(r,e.nextSibling),jr(r,"user-agent");var n,o,a=Pr("darkreader--text");Cr.useFont||Cr.textStroke>0?a.textContent=(n=Cr,(o=[]).push("*:not(pre) {"),n.useFont&&n.fontFamily&&o.push(" font-family: "+n.fontFamily+" !important;"),n.textStroke>0&&(o.push(" -webkit-text-stroke: "+n.textStroke+"px !important;"),o.push(" text-stroke: "+n.textStroke+"px !important;")),o.push("}"),o.join("\n")):a.textContent="",document.head.insertBefore(a,e.nextSibling),jr(a,"text");var i=Pr("darkreader--invert");Mr&&Array.isArray(Mr.invert)&&Mr.invert.length>0?i.textContent=[Mr.invert.join(", ")+" {"," filter: "+ut(t(t({},Cr),{contrast:0===Cr.mode?Cr.contrast:Ne(Cr.contrast-10,0,100)}))+" !important;","}"].join("\n"):i.textContent="",document.head.insertBefore(i,a.nextSibling),jr(i,"invert");var u=Pr("darkreader--inline");u.textContent=Ft(),document.head.insertBefore(u,i.nextSibling),jr(u,"inline");var c=Pr("darkreader--override");c.textContent=Mr&&Mr.css?Fr(Mr.css):"",document.head.appendChild(c),jr(c,"override");var s=Pr("darkreader--variables"),l=_t(Cr),d=Cr.darkSchemeBackgroundColor,f=Cr.darkSchemeTextColor,h=Cr.lightSchemeBackgroundColor,p=Cr.lightSchemeTextColor,v=Cr.mode,m=0===v?h:d,g=0===v?p:f;m=Ye(Ee(m),Cr),g=nt(Ee(g),Cr),s.textContent=[":root {"," --darkreader-neutral-background: "+m+";"," --darkreader-neutral-text: "+g+";"," --darkreader-selection-background: "+l.backgroundColorSelection+";"," --darkreader-selection-text: "+l.foregroundColorSelection+";","}"].join("\n"),document.head.insertBefore(s,u.nextSibling),jr(s,"variables");var b=function(e,t){void 0===t&&(t=document.head||document);var r=t.querySelector("."+e);return r||((r=document.createElement("script")).classList.add("darkreader"),r.classList.add(e)),r}("darkreader--proxy");b.textContent="("+wr+")()",document.head.insertBefore(b,s.nextSibling)}var Nr=new Set;function qr(e){var t=Pr("darkreader--inline",e);t.textContent=Ft(),e.insertBefore(t,e.firstChild);var r=Pr("darkreader--override",e);r.textContent=Mr&&Mr.css?Fr(Mr.css):"",e.insertBefore(r,t.nextSibling),Nr.add(e)}function Fr(e){return e.replace(/\${(.+?)}/g,(function(e,t){try{var r=Mt(t);return Ge(r,Cr,Ke)}catch(e){return z(e),t}}))}function Br(){var e=document.querySelector(".darkreader--fallback");e&&(e.textContent="")}var Ur=0,Ir=new Set;function Wr(e){var t=++Ur;var r=or(e,{update:function(){var e=r.details();e&&(0===e.variables.size?r.render(Cr,kr,Ar):(Dr(e.variables),$r()))},loadingStart:function(){if(!ce()||!Kr){Ir.add(t);var e=document.querySelector(".darkreader--fallback");e.textContent||(e.textContent=Et(Cr,{strict:!1}))}},loadingEnd:function(){Ir.delete(t),0===Ir.size&&ce()&&Br()}});return Er.set(e,r),r}function Dr(e){0!==e.size&&(e.forEach((function(e,t){kr.set(t,e)})),kr.forEach((function(e,t){kr.set(t,re(e,kr))})))}function zr(e){var t=Er.get(e);t&&(t.destroy(),Er.delete(e))}var $r=ne((function(e){Er.forEach((function(e){return e.render(Cr,kr,Ar)})),xr.forEach((function(e){return e.render(Cr,kr,Ar)})),e&&e()})),Hr=function(){$r.cancel()};function Vr(){0===Ir.size&&Br()}var Gr=null,Kr=!document.hidden;function Qr(){document.removeEventListener("visibilitychange",Gr),Gr=null}function Jr(){function e(){var e,t;!function(){Hr(),Dr(K(document.documentElement));var e=er(document).filter((function(e){return!Er.has(e)})).map((function(e){return Wr(e)})),t=e.map((function(e){return e.details()})).filter((function(e){return e&&e.variables.size>0})).map((function(e){return e.variables}));0===t.length?(Er.forEach((function(e){return e.render(Cr,kr,Ar)})),0===Ir.size&&Br()):(t.forEach((function(e){return Dr(e)})),$r((function(){0===Ir.size&&Br()}))),e.forEach((function(e){return e.watch()}));var r=function(e){for(var t=[],r=0,n=e.length;r<n;r++)t.push(e[r]);return t}(document.querySelectorAll(qt));ue(document.documentElement,(function(e){qr(e.shadowRoot);var t=e.shadowRoot.querySelectorAll(qt);t.length>0&&F(r,t)})),r.forEach((function(e){return $t(e,Cr,Lr,Ar)})),Xr(document)}(),mr(Array.from(Er.keys()),(function(e){var t=e.created,r=e.updated,n=e.removed,o=e.moved,a=n,i=t.concat(r).concat(o).filter((function(e){return!Er.has(e)})),u=o.filter((function(e){return Er.has(e)}));a.forEach((function(e){return zr(e)}));var c=i.map((function(e){return Wr(e)})),s=c.map((function(e){return e.details()})).filter((function(e){return e&&e.variables.size>0})).map((function(e){return e.variables}));0===s.length?c.forEach((function(e){return e.render(Cr,kr,Ar)})):(s.forEach((function(e){return Dr(e)})),$r()),c.forEach((function(e){return e.watch()})),u.forEach((function(e){return Er.get(e).restore()}))}),(function(e){qr(e),Xr(e)})),e=function(e){if($t(e,Cr,Lr,Ar),e===document.documentElement){var t=K(document.documentElement);t.size>0&&(Dr(t),$r())}},t=function(e){qr(e);var t=e.querySelectorAll(qt);t.length>0&&q(t,(function(e){return $t(e,Cr,Lr,Ar)}))},It(document,e,t),ue(document.documentElement,(function(r){It(r.shadowRoot,e,t)})),le(Vr)}var t,r,n,o;Or(),document.hidden?(t=e,r=Boolean(Gr),Gr=function(){document.hidden||(Qr(),t(),Kr=!0)},r||document.addEventListener("visibilitychange",Gr)):e(),n=Cr,(o=document.querySelector(Vt))?Qt(o,n):(Kt&&Kt.disconnect(),(Kt=new MutationObserver((function(e){e:for(var t=0;t<e.length;t++)for(var r=e[t].addedNodes,o=0;o<r.length;o++){var a=r[o];if(a instanceof HTMLMetaElement&&a.name===Ht){Kt.disconnect(),Kt=null,Qt(a,n);break e}}}))).observe(document.head,{childList:!0}))}function Xr(e){if(Array.isArray(e.adoptedStyleSheets)&&e.adoptedStyleSheets.length>0){var t=Sr(e);xr.push(t),t.render(Cr,kr,Ar)}}function Yr(){Er.forEach((function(e){return e.pause()})),q(Tr.values(),(function(e){return e.stop()})),Tr.clear(),gr(),Bt.forEach((function(e){return e.disconnect()})),Ut.forEach((function(e){return e.disconnect()})),Bt.clear(),Ut.clear(),de(Vr)}function Zr(){var e,t=document.querySelector('meta[name="darkreader"]');return t?t.content!==_r:((e=document.createElement("meta")).name="darkreader",e.content=_r,document.head.appendChild(e),!1)}function en(e,t,r){if(Cr=e,(Mr=t)?(Ar=Array.isArray(Mr.ignoreImageAnalysis)?Mr.ignoreImageAnalysis:[],Lr=Array.isArray(Mr.ignoreInlineStyle)?Mr.ignoreInlineStyle:[]):(Ar=[],Lr=[]),Rr=r,document.head){if(Zr())return;Jr()}else{if(!f){var n=Pr("darkreader--fallback");document.documentElement.appendChild(n),n.textContent=Et(Cr,{strict:!0})}var o=new MutationObserver((function(){if(document.head){if(o.disconnect(),Zr())return void tn();Jr()}}));o.observe(document,{childList:!0,subtree:!0})}}function tn(){kr.clear(),Qr(),Hr(),Yr(),Tt(),ae(document.querySelector(".darkreader--fallback")),document.head&&(!function(){Kt&&(Kt.disconnect(),Kt=null);var e=document.querySelector(Vt);e&&Gt&&(e.content=Gt)}(),ae(document.head.querySelector(".darkreader--user-agent")),ae(document.head.querySelector(".darkreader--text")),ae(document.head.querySelector(".darkreader--invert")),ae(document.head.querySelector(".darkreader--inline")),ae(document.head.querySelector(".darkreader--override")),ae(document.head.querySelector('meta[name="darkreader"]')),document.dispatchEvent(new CustomEvent("__darkreader__cleanUp")),ae(document.head.querySelector(".darkreader--proxy"))),Nr.forEach((function(e){ae(e.querySelector(".darkreader--inline")),ae(e.querySelector(".darkreader--override"))})),Nr.clear(),q(Er.keys(),(function(e){return zr(e)})),q(document.querySelectorAll(".darkreader"),ae),xr.forEach((function(e){e.destroy()})),xr.splice(0),B.clear()}var rn=/url\(\"(blob\:.*?)\"\)/g;function nn(e){return r(this,void 0,void 0,(function(){var t,r;return n(this,(function(n){switch(n.label){case 0:return t=[],Fe(rn,e,1).forEach((function(e){var r=w(e);t.push(r)})),[4,Promise.all(t)];case 1:return r=n.sent(),[2,e.replace(rn,(function(){return'url("'+r.shift()+'")'}))]}}))}))}function on(){return r(this,void 0,void 0,(function(){function e(e,r){var n=document.querySelector(e);n&&n.textContent&&(t.push("/* "+r+" */"),t.push(n.textContent),t.push(""))}var t,r,o,a,i;return n(this,(function(n){switch(n.label){case 0:return t=['官网:https://darkreader.org'],e(".darkreader--fallback","Fallback Style"),e(".darkreader--user-agent","User-Agent Style"),e(".darkreader--text","Text Style"),e(".darkreader--invert","Invert Style"),e(".darkreader--variables","Variables Style"),r=[],document.querySelectorAll(".darkreader--sync").forEach((function(e){q(e.sheet.cssRules,(function(e){e&&e.cssText&&r.push(e.cssText)}))})),0==r.length?[3,2]:(o=function(e){function t(e){return e.replace(/^\s+/,"")}function r(e){return 0===e?"":" ".repeat(4*e)}for(var n=/[^{}]+{\s*}/g;n.test(e);)e=e.replace(n,"");for(var o=e.replace(/\s{2,}/g," ").replace(/\{/g,"{\n").replace(/\}/g,"\n}\n").replace(/\;(?![^\(|\"]*(\)|\"))/g,";\n").replace(/\,(?![^\(|\"]*(\)|\"))/g,",\n").replace(/\n\s*\n/g,"\n").split("\n"),a=0,i=[],u=0,c=o.length;u<c;u++){var s=o[u]+"\n";s.match(/\{/)?i.push(r(a++)+t(s)):s.match(/\}/)?i.push(r(--a)+t(s)):i.push(r(a)+t(s))}return i.join("").trim()}(r.join("\n")),t.push("/* Modified CSS */"),i=(a=t).push,[4,nn(o)]);case 1:i.apply(a,[n.sent()]),t.push(""),n.label=2;case 2:return e(".darkreader--override","Override Style"),[2,t.join("\n")]}}))}))}var an=!1,un=function(){try{return window.self!==window.top}catch(e){return console.warn(e),!0}}();function cn(e,r){void 0===e&&(e={}),void 0===r&&(r=null);var n=t(t({},N),e);if(n.engine!==T)throw new Error("Theme engine is not supported.");en(n,r,un),an=!0}function sn(){tn(),an=!1}var ln=matchMedia("(prefers-color-scheme: dark)"),dn={themeOptions:null,fixes:null};function fn(){ln.matches?cn(dn.themeOptions,dn.fixes):sn()}var hn=function(e){E=e||_};e.auto=function(e,t){void 0===e&&(e={}),void 0===t&&(t=null),e?(dn={themeOptions:e,fixes:t},fn(),g?ln.addEventListener("change",fn):ln.addListener(fn)):(g?ln.removeEventListener("change",fn):ln.removeListener(fn),sn())},e.disable=sn,e.enable=cn,e.exportGeneratedCSS=function(){return r(this,void 0,void 0,(function(){return n(this,(function(e){switch(e.label){case 0:return[4,on()];case 1:return[2,e.sent()]}}))}))},e.isEnabled=function(){return an},e.setFetchMethod=hn,Object.defineProperty(e,"__esModule",{value:!0})}));if(!DarkReader.isEnabled()){DarkReader.setFetchMethod(window.fetch);DarkReader.enable({brightness:window.DR_setting0||100, contrast:window.DR_setting1||90, sepia:window.DR_setting2||10});}