/
zlib-inflate.min.js
29 lines (29 loc) · 13.1 KB
/
zlib-inflate.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/** @license zlib.js 2012 - imaya [ https://github.com/imaya/zlib.js ] The MIT License */
(function() {'use strict';var aa=this;function g(a,b,d){a=a.split(".");d=d||aa;!(a[0]in d)&&d.execScript&&d.execScript("var "+a[0]);for(var c;a.length&&(c=a.shift());)!a.length&&void 0!==b?d[c]=b:d=d[c]?d[c]:d[c]={}}Math.floor(2147483648*Math.random()).toString(36);var j="undefined"!==typeof Uint8Array&&"undefined"!==typeof Uint16Array&&"undefined"!==typeof Uint32Array;var ba=new (j?Uint8Array:Array)(256),l;for(l=0;256>l;++l){for(var ca=ba,da=l,n=l,o=n,q=7,n=n>>>1;n;n>>>=1)o<<=1,o|=n&1,--q;ca[da]=(o<<q&255)>>>0};var ea=[0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,
2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,
2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,
2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,
3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,
936918E3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117];j&&new Uint32Array(ea);function r(a){var b=a.length,d=0,c=Number.POSITIVE_INFINITY,f,e,h,i,p,w,x,k,m;for(k=0;k<b;++k)a[k]>d&&(d=a[k]),a[k]<c&&(c=a[k]);f=1<<d;e=new (j?Uint32Array:Array)(f);h=1;i=0;for(p=2;h<=d;){for(k=0;k<b;++k)if(a[k]===h){w=0;x=i;for(m=0;m<h;++m)w=w<<1|x&1,x>>=1;for(m=w;m<f;m+=p)e[m]=h<<16|k;++i}++h;i<<=1;p<<=1}return[e,d,c]};var s=[],t;for(t=0;288>t;t++)switch(!0){case 143>=t:s.push([t+48,8]);break;case 255>=t:s.push([t-144+400,9]);break;case 279>=t:s.push([t-256+0,7]);break;case 287>=t:s.push([t-280+192,8]);break;default:throw"invalid literal: "+t;}function u(a,b){this.length=a;this.z=b}
function fa(a){switch(!0){case 3===a:return[257,a-3,0];case 4===a:return[258,a-4,0];case 5===a:return[259,a-5,0];case 6===a:return[260,a-6,0];case 7===a:return[261,a-7,0];case 8===a:return[262,a-8,0];case 9===a:return[263,a-9,0];case 10===a:return[264,a-10,0];case 12>=a:return[265,a-11,1];case 14>=a:return[266,a-13,1];case 16>=a:return[267,a-15,1];case 18>=a:return[268,a-17,1];case 22>=a:return[269,a-19,2];case 26>=a:return[270,a-23,2];case 30>=a:return[271,a-27,2];case 34>=a:return[272,a-31,2];case 42>=
a:return[273,a-35,3];case 50>=a:return[274,a-43,3];case 58>=a:return[275,a-51,3];case 66>=a:return[276,a-59,3];case 82>=a:return[277,a-67,4];case 98>=a:return[278,a-83,4];case 114>=a:return[279,a-99,4];case 130>=a:return[280,a-115,4];case 162>=a:return[281,a-131,5];case 194>=a:return[282,a-163,5];case 226>=a:return[283,a-195,5];case 257>=a:return[284,a-227,5];case 258===a:return[285,a-258,0];default:throw"invalid length: "+a;}}var v=[],y,z;for(y=3;258>=y;y++)z=fa(y),v[y]=z[2]<<24|z[1]<<16|z[0];
var ga=j?new Uint32Array(v):v;
u.prototype.D=function(a){switch(!0){case 1===a:a=[0,a-1,0];break;case 2===a:a=[1,a-2,0];break;case 3===a:a=[2,a-3,0];break;case 4===a:a=[3,a-4,0];break;case 6>=a:a=[4,a-5,1];break;case 8>=a:a=[5,a-7,1];break;case 12>=a:a=[6,a-9,2];break;case 16>=a:a=[7,a-13,2];break;case 24>=a:a=[8,a-17,3];break;case 32>=a:a=[9,a-25,3];break;case 48>=a:a=[10,a-33,4];break;case 64>=a:a=[11,a-49,4];break;case 96>=a:a=[12,a-65,5];break;case 128>=a:a=[13,a-97,5];break;case 192>=a:a=[14,a-129,6];break;case 256>=a:a=[15,
a-193,6];break;case 384>=a:a=[16,a-257,7];break;case 512>=a:a=[17,a-385,7];break;case 768>=a:a=[18,a-513,8];break;case 1024>=a:a=[19,a-769,8];break;case 1536>=a:a=[20,a-1025,9];break;case 2048>=a:a=[21,a-1537,9];break;case 3072>=a:a=[22,a-2049,10];break;case 4096>=a:a=[23,a-3073,10];break;case 6144>=a:a=[24,a-4097,11];break;case 8192>=a:a=[25,a-6145,11];break;case 12288>=a:a=[26,a-8193,12];break;case 16384>=a:a=[27,a-12289,12];break;case 24576>=a:a=[28,a-16385,13];break;case 32768>=a:a=[29,a-24577,
13];break;default:throw"invalid distance";}return a};u.prototype.K=function(){var a=this.z,b=[],d=0,c;c=ga[this.length];b[d++]=c&65535;b[d++]=c>>16&255;b[d++]=c>>24;c=this.D(a);b[d++]=c[0];b[d++]=c[1];b[d++]=c[2];return b};function A(a,b){this.i=[];this.j=32768;this.e=this.g=this.a=this.n=0;this.input=j?new Uint8Array(a):a;this.o=!1;this.k=B;this.t=!1;if(b||!(b={}))if(b.index&&(this.a=b.index),b.bufferSize&&(this.j=b.bufferSize),b.bufferType&&(this.k=b.bufferType),b.resize)this.t=b.resize;switch(this.k){case C:this.b=32768;this.c=new (j?Uint8Array:Array)(32768+this.j+258);break;case B:this.b=0;this.c=new (j?Uint8Array:Array)(this.j);this.f=this.C;this.p=this.A;this.l=this.B;break;default:throw Error("invalid inflate mode");
}}var C=0,B=1,D={v:C,u:B};A.prototype.m=function(){for(;!this.o;)this.F();return this.p()};
var E=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],F=j?new Uint16Array(E):E,G=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258],H=j?new Uint16Array(G):G,I=[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],J=j?new Uint8Array(I):I,K=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577],L=j?new Uint16Array(K):K,M=[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],N=j?new Uint8Array(M):M,O=new (j?Uint8Array:Array)(288),P,Q;P=0;for(Q=O.length;P<Q;++P)O[P]=143>=P?8:255>=P?9:279>=P?7:8;var ha=r(O),R=new (j?Uint8Array:Array)(30),S,T;S=0;for(T=R.length;S<T;++S)R[S]=5;var ia=r(R);A.prototype.F=function(){var a=this.d(3);a&1&&(this.o=!0);a>>>=1;switch(a){case 0:this.I();break;case 1:this.H();break;case 2:this.G();break;default:throw Error("unknown BTYPE: "+a);}};
A.prototype.d=function(a){for(var b=this.g,d=this.e,c=this.input,f=this.a,e;d<a;){e=c[f++];if(void 0===e)throw Error("input buffer is broken");b|=e<<d;d+=8}e=b&(1<<a)-1;this.g=b>>>a;this.e=d-a;this.a=f;return e};A.prototype.h=function(a){for(var b=this.g,d=this.e,c=this.input,f=this.a,e=a[0],a=a[1],h;d<a;){h=c[f++];if(void 0===h)throw Error("input buffer is broken");b|=h<<d;d+=8}c=e[b&(1<<a)-1];e=c>>>16;this.g=b>>e;this.e=d-e;this.a=f;return c&65535};
A.prototype.I=function(){var a=this.input,b=this.a,d=this.c,c=this.b,f,e,h,i=d.length;this.e=this.g=0;f=a[b++];if(void 0===f)throw Error("invalid uncompressed block header: LEN (first byte)");e=f;f=a[b++];if(void 0===f)throw Error("invalid uncompressed block header: LEN (second byte)");e|=f<<8;f=a[b++];if(void 0===f)throw Error("invalid uncompressed block header: NLEN (first byte)");h=f;f=a[b++];if(void 0===f)throw Error("invalid uncompressed block header: NLEN (second byte)");if(e===~(h|f<<8))throw Error("invalid uncompressed block header: length verify");
if(b+e>a.length)throw Error("input buffer is broken");switch(this.k){case C:for(;c+e>d.length;){f=i-c;e-=f;if(j)d.set(a.subarray(b,b+f),c),c+=f,b+=f;else for(;f--;)d[c++]=a[b++];this.b=c;d=this.f();c=this.b}break;case B:for(;c+e>d.length;)d=this.f({r:2});break;default:throw Error("invalid inflate mode");}if(j)d.set(a.subarray(b,b+e),c),c+=e,b+=e;else for(;e--;)d[c++]=a[b++];this.a=b;this.b=c;this.c=d};A.prototype.H=function(){this.l(ha,ia)};
A.prototype.G=function(){function a(a,d,c){var b,e,f;for(f=0;f<a;)switch(b=this.h(d),b){case 16:for(b=3+this.d(2);b--;)c[f++]=e;break;case 17:for(b=3+this.d(3);b--;)c[f++]=0;e=0;break;case 18:for(b=11+this.d(7);b--;)c[f++]=0;e=0;break;default:e=c[f++]=b}return c}var b=this.d(5)+257,d=this.d(5)+1,c=this.d(4)+4,f=new (j?Uint8Array:Array)(F.length),e;for(e=0;e<c;++e)f[F[e]]=this.d(3);c=r(f);f=new (j?Uint8Array:Array)(b);e=new (j?Uint8Array:Array)(d);this.l(r(a.call(this,b,c,f)),r(a.call(this,d,c,e)))};
A.prototype.l=function(a,b){var d=this.c,c=this.b;this.q=a;for(var f=d.length-258,e,h,i;256!==(e=this.h(a));)if(256>e)c>=f&&(this.b=c,d=this.f(),c=this.b),d[c++]=e;else{e-=257;i=H[e];0<J[e]&&(i+=this.d(J[e]));e=this.h(b);h=L[e];0<N[e]&&(h+=this.d(N[e]));c>=f&&(this.b=c,d=this.f(),c=this.b);for(;i--;)d[c]=d[c++-h]}for(;8<=this.e;)this.e-=8,this.a--;this.b=c};
A.prototype.B=function(a,b){var d=this.c,c=this.b;this.q=a;for(var f=d.length,e,h,i;256!==(e=this.h(a));)if(256>e)c>=f&&(d=this.f(),f=d.length),d[c++]=e;else{e-=257;i=H[e];0<J[e]&&(i+=this.d(J[e]));e=this.h(b);h=L[e];0<N[e]&&(h+=this.d(N[e]));c+i>f&&(d=this.f(),f=d.length);for(;i--;)d[c]=d[c++-h]}for(;8<=this.e;)this.e-=8,this.a--;this.b=c};
A.prototype.f=function(){var a=new (j?Uint8Array:Array)(this.b-32768),b=this.b-32768,d,c,f=this.c;if(j)a.set(f.subarray(32768,a.length));else{d=0;for(c=a.length;d<c;++d)a[d]=f[d+32768]}this.i.push(a);this.n+=a.length;if(j)f.set(f.subarray(b,b+32768));else for(d=0;32768>d;++d)f[d]=f[b+d];this.b=32768;return f};
A.prototype.C=function(a){var b=this.input.length/this.a+1|0,d=this.input,c=this.c;a&&("number"===typeof a.r&&(b=a.r),"number"===typeof a.w&&(b+=a.w));2>b?(a=(d.length-this.a)/this.q[2],a=258*(a/2)|0,a=a<c.length?c.length+a:c.length<<1):a=c.length*b;j?(a=new Uint8Array(a),a.set(c)):a=c;return this.c=a};
A.prototype.p=function(){var a=0,b=this.c,d=this.i,c,f=new (j?Uint8Array:Array)(this.n+(this.b-32768)),e,h,i,p;if(0===d.length)return j?this.c.subarray(32768,this.b):this.c.slice(32768,this.b);e=0;for(h=d.length;e<h;++e){c=d[e];i=0;for(p=c.length;i<p;++i)f[a++]=c[i]}e=32768;for(h=this.b;e<h;++e)f[a++]=b[e];this.i=[];return this.buffer=f};
A.prototype.A=function(){var a,b=this.b;j?this.t?(a=new Uint8Array(b),a.set(this.c.subarray(0,b))):a=this.c.subarray(0,b):(this.c.length>b&&(this.c.length=b),a=this.c);return this.buffer=a};function U(a,b){var d,c;this.input=a;this.a=0;if(b||!(b={}))if(b.index&&(this.a=b.index),b.verify)this.J=b.verify;d=a[this.a++];c=a[this.a++];switch(d&15){case V:this.method=V;break;default:throw Error("unsupported compression method");}if(0!==((d<<8)+c)%31)throw Error("invalid fcheck flag:"+((d<<8)+c)%31);if(c&32)throw Error("fdict flag is not supported");this.s=new A(a,{index:this.a,bufferSize:b.bufferSize,bufferType:b.bufferType,resize:b.resize})}
U.prototype.m=function(){var a=this.input,b;b=this.s.m();this.a=this.s.a;if(this.J){var a=a[this.a++]<<24|a[this.a++]<<16|a[this.a++]<<8|a[this.a++],d=b;if("string"===typeof d){var d=d.split(""),c,f;c=0;for(f=d.length;c<f;c++)d[c]=(d[c].charCodeAt(0)&255)>>>0}c=1;f=0;for(var e=d.length,h,i=0;0<e;){h=1024<e?1024:e;e-=h;do c+=d[i++],f+=c;while(--h);c%=65521;f%=65521}if(a!==(f<<16|c)>>>0)throw Error("invalid adler-32 checksum");}return b};g("Zlib.Inflate",U,void 0);g("Zlib.Inflate.BufferType",D,void 0);
D.ADAPTIVE=D.u;D.BLOCK=D.v;g("Zlib.Inflate.prototype.decompress",U.prototype.m,void 0);var ja=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];j&&new Uint16Array(ja);var ka=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,258,258];j&&new Uint16Array(ka);var la=[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];j&&new Uint8Array(la);var ma=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577];j&&new Uint16Array(ma);
var na=[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];j&&new Uint8Array(na);var W=new (j?Uint8Array:Array)(288),X,Y;X=0;for(Y=W.length;X<Y;++X)W[X]=143>=X?8:255>=X?9:279>=X?7:8;r(W);var Z=new (j?Uint8Array:Array)(30),$,oa;$=0;for(oa=Z.length;$<oa;++$)Z[$]=5;r(Z);var V=8;}).call(module.exports);