Rules-For-Quantumult-X/Scripts/AdBlock/Bilibili/BiliBili.helper.beta.min.js

4 lines
66 KiB
JavaScript
Raw Normal View History

2023-05-31 09:52:23 +08:00
// Build: 2023/5/28 17:05:10
(()=>{console.time=function(o){this._times=this._times||{},this._times[o]=Date.now()};console.timeEnd=function(o){if(this._times&&this._times[o]){let e=Date.now()-this._times[o];console.log(`${o}: ${e}ms`),delete this._times[o]}else console.log(`Timer with label ${o} does not exist.`)};function Tn(o){"use strict";function e(){}function t(){}var n=String.fromCharCode,i={}.toString,r=i.call(o.SharedArrayBuffer),s=i(),a=o.Uint8Array,l=a||Array,f=a?ArrayBuffer:l,c=f.isView||function(v){return v&&"length"in v},p=i.call(f.prototype);f=t.prototype;var g=o.TextEncoder,m=new(a?Uint16Array:l)(32);e.prototype.decode=function(v){if(!c(v)){var L=i.call(v);if(L!==p&&L!==r&&L!==s)throw TypeError("Failed to execute 'decode' on 'TextDecoder': The provided value is not of type '(ArrayBuffer or ArrayBufferView)'");v=a?new l(v):v||[]}for(var x=L="",y=0,w=v.length|0,G=w-32|0,F,E,V=0,j=0,S,A=0,D=-1;y<w;){for(F=y<=G?32:w-y|0;A<F;y=y+1|0,A=A+1|0){switch(E=v[y]&255,E>>4){case 15:if(S=v[y=y+1|0]&255,S>>6!==2||247<E){y=y-1|0;break}V=(E&7)<<6|S&63,j=5,E=256;case 14:S=v[y=y+1|0]&255,V<<=6,V|=(E&15)<<6|S&63,j=S>>6===2?j+4|0:24,E=E+256&768;case 13:case 12:S=v[y=y+1|0]&255,V<<=6,V|=(E&31)<<6|S&63,j=j+7|0,y<w&&S>>6===2&&V>>j&&1114112>V?(E=V,V=V-65536|0,0<=V&&(D=(V>>10)+55296|0,E=(V&1023)+56320|0,31>A?(m[A]=D,A=A+1|0,D=-1):(S=D,D=E,E=S))):(E>>=8,y=y-E-1|0,E=65533),V=j=0,F=y<=G?32:w-y|0;default:m[A]=E;continue;case 11:case 10:case 9:case 8:}m[A]=65533}if(x+=n(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15],m[16],m[17],m[18],m[19],m[20],m[21],m[22],m[23],m[24],m[25],m[26],m[27],m[28],m[29],m[30],m[31]),32>A&&(x=x.slice(0,A-32|0)),y<w){if(m[0]=D,A=~D>>>31,D=-1,x.length<L.length)continue}else D!==-1&&(x+=n(D));L+=x,x=""}return L},f.encode=function(v){v=v===void 0?"":""+v;var L=v.length|0,x=new l((L<<1)+8|0),y,w=0,G=!a;for(y=0;y<L;y=y+1|0,w=w+1|0){var F=v.charCodeAt(y)|0;if(127>=F)x[w]=F;else{if(2047>=F)x[w]=192|F>>6;else{e:{if(55296<=F)if(56319>=F){var E=v.charCodeAt(y=y+1|0)|0;if(56320<=E&&57343>=E){if(F=(F<<10)+E-56613888|0,65535<F){x[w]=240|F>>18,x[w=w+1|0]=128|F>>12&63,x[w=w+1|0]=128|F>>6&63,x[w=w+1|0]=128|F&63;continue}break e}F=65533}else 57343>=F&&(F=65533);!G&&y<<1<w&&y<<1<(w-7|0)&&(G=!0,E=new l(3*L),E.set(x),x=E)}x[w]=224|F>>12,x[w=w+1|0]=128|F>>6&63}x[w=w+1|0]=128|F&63}}return a?x.subarray(0,w):x.slice(0,w)},o.TextDecoder=e,o.TextEncoder=t}var b=Tn(globalThis);var z=Uint8Array,ee=Uint16Array,Nn=Int32Array,St=new z([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),At=new z([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),xn=new z([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Mt=function(o,e){for(var t=new ee(31),n=0;n<31;++n)t[n]=e+=1<<o[n-1];for(var i=new Nn(t[30]),n=1;n<30;++n)for(var r=t[n];r<t[n+1];++r)i[r]=r-t[n]<<5|n;return{b:t,r:i}},Ct=Mt(St,2),zt=Ct.b,In=Ct.r;zt[28]=258,In[258]=28;var Wt=Mt(At,0),Bn=Wt.b,Qn=Wt.r,Oe=new ee(32768);for(T=0;T<32768;++T)K=(T&43690)>>1|(T&21845)<<1,K=(K&52428)>>2|(K&13107)<<2,K=(K&61680)>>4|(K&3855)<<4,Oe[T]=((K&65280)>>8|(K&255)<<8)>>1;var K,T,oe=function(o,e,t){for(var n=o.length,i=0,r=new ee(e);i<n;++i)o[i]&&++r[o[i]-1];var s=new ee(e);for(i=1;i<e;++i)s[i]=s[i-1]+r[i-1]<<1;var a;if(t){a=new ee(1<<e);var l=15-e;for(i=0;i<n;++i)if(o[i])for(var f=i<<4|o[i],c=e-o[i],p=s[o[i]-1]++<<c,g=p|(1<<c)-1;p<=g;++p)a[Oe[p]>>l]=f}else for(a=new ee(n),i=0;i<n;++i)o[i]&&(a[i]=Oe[s[o[i]-1]++]>>15-o[i]);return a},ae=new z(288);for(T=0;T<144;++T)ae[T]=8;var T;for(T=144;T<256;++T)ae[T]=9;var T;for(T=256;T<280;++T)ae[T]=7;var T;for(T=280;T<288;++T)ae[T]=8;var T,$t=new z(32);for(T=0;T<32;++T)$t[T]=5;var T;var Un=oe(ae,9,1);var En=oe($t,5,1),Ee=function(o){for(var e=o[0],t=1;t<o.length;++t)o[t]>e&&(e=o[t]);return e},$=function(o,e,t){var n=e/8|0;return(o[n]|o[n+1]<<8)>>(e&7)&t},Fe=function(o,e){var t=e/8|0;return(o[t]|o[t+1]<<8|o[t+2]<<16)>>(e&7)},Fn=function(o){return(o+7)/8|0},On=function(o,e,t){(e==null||e<0)&&(e=0),(t==null||t>o.length)&&(t=o.length);var n=new z(t-e);return n.set(o.subarray(e,t)),n};var Rn=["unexpected EOF","invalid block type","i
`:case"\r":case" ":case" ":continue;default:throw Error("invalid base64 string.")}switch(i){case 0:s=r,i=1;break;case 1:t[n++]=s<<2|(r&48)>>4,s=r,i=2;break;case 2:t[n++]=(s&15)<<4|(r&60)>>2,s=r,i=3;break;case 3:t[n++]=(s&3)<<6|r,i=0;break}}if(i==1)throw Error("invalid base64 string.");return t.subarray(0,n)}function Jt(o){let e="",t=0,n,i=0;for(let r=0;r<o.length;r++)switch(n=o[r],t){case 0:e+=X[n>>2],i=(n&3)<<4,t=1;break;case 1:e+=X[i|n>>4],i=(n&15)<<2,t=2;break;case 2:e+=X[i|n>>6],e+=X[n&63],t=0;break}return t&&(e+=X[i],e+="=",t==1&&(e+="=")),e}var d;(function(o){o.symbol=Symbol.for("protobuf-ts/unknown"),o.onRead=(t,n,i,r,s)=>{(e(n)?n[o.symbol]:n[o.symbol]=[]).push({no:i,wireType:r,data:s})},o.onWrite=(t,n,i)=>{for(let{no:r,wireType:s,data:a}of o.list(n))i.tag(r,s).raw(a)},o.list=(t,n)=>{if(e(t)){let i=t[o.symbol];return n?i.filter(r=>r.no==n):i}return[]},o.last=(t,n)=>o.list(t,n).slice(-1)[0];let e=t=>t&&Array.isArray(t[o.symbol])})(d||(d={}));var h;(function(o){o[o.Varint=0]="Varint",o[o.Bit64=1]="Bit64",o[o.LengthDelimited=2]="LengthDelimited",o[o.StartGroup=3]="StartGroup",o[o.EndGroup=4]="EndGroup",o[o.Bit32=5]="Bit32"})(h||(h={}));function Gt(){let o=0,e=0;for(let n=0;n<28;n+=7){let i=this.buf[this.pos++];if(o|=(i&127)<<n,!(i&128))return this.assertBounds(),[o,e]}let t=this.buf[this.pos++];if(o|=(t&15)<<28,e=(t&112)>>4,!(t&128))return this.assertBounds(),[o,e];for(let n=3;n<=31;n+=7){let i=this.buf[this.pos++];if(e|=(i&127)<<n,!(i&128))return this.assertBounds(),[o,e]}throw new Error("invalid varint")}function me(o,e,t){for(let r=0;r<28;r=r+7){let s=o>>>r,a=!(!(s>>>7)&&e==0),l=(a?s|128:s)&255;if(t.push(l),!a)return}let n=o>>>28&15|(e&7)<<4,i=!!(e>>3);if(t.push((i?n|128:n)&255),!!i){for(let r=3;r<31;r=r+7){let s=e>>>r,a=!!(s>>>7),l=(a?s|128:s)&255;if(t.push(l),!a)return}t.push(e>>>31&1)}}var pe=65536*65536;function Re(o){let e=o[0]=="-";e&&(o=o.slice(1));let t=1e6,n=0,i=0;function r(s,a){let l=Number(o.slice(s,a));i*=t,n=n*t+l,n>=pe&&(i=i+(n/pe|0),n=n%pe)}return r(-24,-18),r(-18,-12),r(-12,-6),r(-6),[e,n,i]}function de(o,e){if(e<=2097151)return""+(pe*e+(o>>>0));let t=o&16777215,n=(o>>>24|e<<8)>>>0&16777215,i=e>>16&65535,r=t+n*6777216+i*6710656,s=n+i*8147497,a=i*2,l=1e7;r>=l&&(s+=Math.floor(r/l),r%=l),s>=l&&(a+=Math.floor(s/l),s%=l);function f(c,p){let g=c?String(c):"";return p?"0000000".slice(g.length)+g:g}return f(a,0)+f(s,a)+f(r,1)}function De(o,e){if(o>=0){for(;o>127;)e.push(o&127|128),o=o>>>7;e.push(o)}else{for(let t=0;t<9;t++)e.push(o&127|128),o=o>>7;e.push(1)}}function Kt(){let o=this.buf[this.pos++],e=o&127;if(!(o&128))return this.assertBounds(),e;if(o=this.buf[this.pos++],e|=(o&127)<<7,!(o&128))return this.assertBounds(),e;if(o=this.buf[this.pos++],e|=(o&127)<<14,!(o&128))return this.assertBounds(),e;if(o=this.buf[this.pos++],e|=(o&127)<<21,!(o&128))return this.assertBounds(),e;o=this.buf[this.pos++],e|=(o&15)<<28;for(let t=5;o&128&&t<10;t++)o=this.buf[this.pos++];if(o&128)throw new Error("invalid varint");return this.assertBounds(),e>>>0}function Cn(){let o=new DataView(new ArrayBuffer(8));return globalThis.BigInt!==void 0&&typeof o.getBigInt64=="function"&&typeof o.getBigUint64=="function"&&typeof o.setBigInt64=="function"&&typeof o.setBigUint64=="function"?{MIN:BigInt("-9223372036854775808"),MAX:BigInt("9223372036854775807"),UMIN:BigInt("0"),UMAX:BigInt("18446744073709551615"),C:BigInt,V:o}:void 0}var O=Cn();function Xt(o){if(!o)throw new Error("BigInt unavailable, see https://github.com/timostamm/protobuf-ts/blob/v1.0.8/MANUAL.md#bigint-support")}var Zt=/^-?[0-9]+$/,ge=65536*65536,ye=class{constructor(e,t){this.lo=e|0,this.hi=t|0}isZero(){return this.lo==0&&this.hi==0}toNumber(){let e=this.hi*ge+(this.lo>>>0);if(!Number.isSafeInteger(e))throw new Error("cannot convert to safe number");return e}},R=class extends ye{static from(e){if(O)switch(typeof e){case"string":if(e=="0")return this.ZERO;if(e=="")throw new Error("string is no integer");e=O.C(e);case"number":if(e===0)return this.ZERO;e=O.C(e);case"bigint":if(!e)return this.ZERO;if(e<O.UMIN)throw new Error("signed value for ulong");if(e>O.UMAX)throw