@blockcerts/blockcerts-verifier 1.73.0 → 1.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundle-stats.html +1 -1
- package/coverage/lcov.info +104 -104
- package/dist/{DataIntegrityProof-D8TnXEkl-CGiIg0kn.js → DataIntegrityProof-DRK-bLb_-CItV0ZXY.js} +2 -2
- package/dist/EcdsaSd2023-CdilbQE4-BlaeM9K_.js +26 -0
- package/dist/EcdsaSecp256k1Signature2019-rfxWS2XE-C73WHAtH.js +1 -0
- package/dist/{Ed25519Signature2020-D2tdrIA4-PSi5TCQH.js → Ed25519Signature2020-CDbX0d2Z-Dc1L-exZ.js} +8 -8
- package/dist/{EddsaRdfc2022-CpZAUc7W-BJP0532C.js → EddsaRdfc2022-Do0HFpDb-BcV_n8Fk.js} +4 -4
- package/dist/{HashlinkVerifier-BcdAFe02-DMjUYzMR.js → HashlinkVerifier-Cdnza1Dw-A9htzw7A.js} +1 -1
- package/dist/MerkleProof2017-5uQFQKSe-dtmePIpg.js +1 -0
- package/dist/MerkleProof2019-DraC60XD-B9XV8wNx.js +5 -0
- package/dist/checkBitStringStatusList-CKk6xxUL-D99R7EXK.js +1 -0
- package/dist/checkCredentialSchemaConformity-U2NlIuJZ-swOY09NS.js +1 -0
- package/dist/controlVerificationMethod-Blm4pE1t-BYBRLxNP.js +1 -0
- package/dist/{downloadPDF-BU6CfP-N.js → downloadPDF-C-y2U2YC.js} +2 -2
- package/dist/{ensureNotRevoked-BWp1jPEo-DSQMtjrj.js → ensureNotRevoked-DrQAPfcJ-BheL-ZKZ.js} +1 -1
- package/dist/ensureValidIssuingKey-D7OT4D35--HN0afRq.js +1 -0
- package/dist/index-BNsIYV4r-BnYxKy2f.js +14 -0
- package/dist/{index-OtXtCWrq-CyttRwCk.js → index-C4ZZHHRx-BOdwDnYa.js} +1 -1
- package/dist/index-CVS5Gn9h-DNgvq6Wk.js +7 -0
- package/dist/index-D2bS6rRi-D_ppNIsb.js +66 -0
- package/dist/{index-CB7VaVsF-G_Mj6xql.js → index-Dr7MpiEc-D5LHgMik.js} +12 -12
- package/dist/{index.es-C2GPR7m7.js → index.es-BmC2s_4v.js} +1 -1
- package/dist/jsonld-DOUjwF6J-dtl20tiV.js +33 -0
- package/dist/jsonld-signatures-BJXipuab-CB799Kkm.js +56 -0
- package/dist/main.js +122 -122
- package/dist/retrieveVerificationMethodPublicKey-CT9YA_Wr-Djl8Ri41.js +1 -0
- package/dist/{verifyIssuerProfile-zkczSLpC-CTHpISfH.js → verifyIssuerProfile-BG-odQrl-0JjZhiiC.js} +1 -1
- package/package.json +2 -2
- package/dist/EcdsaSd2023-D2eJBmaY-mHNjbn8h.js +0 -26
- package/dist/EcdsaSecp256k1Signature2019-BRdQnZ0o-D_QN8KrS.js +0 -1
- package/dist/MerkleProof2017-DW_9FhLr-C0dPtifx.js +0 -1
- package/dist/MerkleProof2019-DJbo7uW--CHlhsnHk.js +0 -5
- package/dist/checkBitStringStatusList-BUPuVWy_-CYedocxJ.js +0 -13
- package/dist/checkCredentialSchemaConformity-CJdGwNcY-CaSak-bD.js +0 -1
- package/dist/controlVerificationMethod-C71lJp3H-n-AbzkO8.js +0 -1
- package/dist/ensureValidIssuingKey-BYAR3LEF-76kiqVKA.js +0 -1
- package/dist/index-Jn9Q6fuB-uChPhl1c.js +0 -56
- package/dist/jsonld-DqC1oHcn-ruRlORc0.js +0 -88
- package/dist/retrieveVerificationMethodPublicKey-Dai7em0K-BqIH8qzD.js +0 -1
- /package/dist/{index-BCu3PGuw-Dh4-8Ruv.js → index-uKBVup0_-Dh4-8Ruv.js} +0 -0
- /package/dist/{index-KzSDgEl9-Dgus2xdV.js → index-yOIIz7AL-Dgus2xdV.js} +0 -0
- /package/dist/{webcrypto.es-9hytEjC6-gGk5JRJH.js → webcrypto.es-FKUHCUj--gGk5JRJH.js} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{_ as A,K as t,L as e,M as r,N as n}from"./main.js";function i(A,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}})}),Object.freeze(A)}function s(A){const{offsetWidth:t,offsetHeight:e}=A;return{width:t,height:e}}function o(A){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(A)}var a=Uint8Array,c=Uint16Array,u=Int32Array,l=new a([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]),h=new a([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]),f=new a([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(A,t){for(var e=new c(31),r=0;r<31;++r)e[r]=t+=1<<A[r-1];var n=new u(e[30]);for(r=1;r<30;++r)for(var i=e[r];i<e[r+1];++i)n[i]=i-e[r]<<5|r;return{b:e,r:n}},g=d(l,2),B=g.b,p=g.r;B[28]=258,p[258]=28;for(var w=d(h,0).r,m=new c(32768),C=0;C<32768;++C){var y=(43690&C)>>1|(21845&C)<<1;y=(61680&(y=(52428&y)>>2|(13107&y)<<2))>>4|(3855&y)<<4,m[C]=((65280&y)>>8|(255&y)<<8)>>1}var v=function(A,t,e){for(var r=A.length,n=0,i=new c(t);n<r;++n)A[n]&&++i[A[n]-1];var s,o=new c(t);for(n=1;n<t;++n)o[n]=o[n-1]+i[n-1]<<1;if(e){s=new c(1<<t);var a=15-t;for(n=0;n<r;++n)if(A[n])for(var u=n<<4|A[n],l=t-A[n],h=o[A[n]-1]++<<l,f=h|(1<<l)-1;h<=f;++h)s[m[h]>>a]=u}else for(s=new c(r),n=0;n<r;++n)A[n]&&(s[n]=m[o[A[n]-1]++]>>15-A[n]);return s},Q=new a(288);for(C=0;C<144;++C)Q[C]=8;for(C=144;C<256;++C)Q[C]=9;for(C=256;C<280;++C)Q[C]=7;for(C=280;C<288;++C)Q[C]=8;var b=new a(32);for(C=0;C<32;++C)b[C]=5;var F=v(Q,9,0),U=v(b,5,0),L=function(A){return(A+7)/8|0},E=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8},I=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8,A[r+2]|=e>>16},x=function(A,t){for(var e=[],r=0;r<A.length;++r)A[r]&&e.push({s:r,f:A[r]});var n=e.length,i=e.slice();if(!n)return{t:D,l:0};if(1==n){var s=new a(e[0].s+1);return s[e[0].s]=1,{t:s,l:1}}e.sort(function(A,t){return A.f-t.f}),e.push({s:-1,f:25001});var o=e[0],u=e[1],l=0,h=1,f=2;for(e[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=e[e[l].f<e[f].f?l++:f++],u=e[l!=h&&e[l].f<e[f].f?l++:f++],e[h++]={s:-1,f:o.f+u.f,l:o,r:u};var d=i[0].s;for(r=1;r<n;++r)i[r].s>d&&(d=i[r].s);var g=new c(d+1),B=H(e[h-1],g,0);if(B>t){r=0;var p=0,w=B-t,m=1<<w;for(i.sort(function(A,t){return g[t.s]-g[A.s]||A.f-t.f});r<n;++r){var C=i[r].s;if(!(g[C]>t))break;p+=m-(1<<B-g[C]),g[C]=t}for(p>>=w;p>0;){var y=i[r].s;g[y]<t?p-=1<<t-g[y]++-1:++r}for(;r>=0&&p;--r){var v=i[r].s;g[v]==t&&(--g[v],++p)}B=t}return{t:new a(g),l:B}},H=function(A,t,e){return-1==A.s?Math.max(H(A.l,t,e+1),H(A.r,t,e+1)):t[A.s]=e},N=function(A){for(var t=A.length;t&&!A[--t];);for(var e=new c(++t),r=0,n=A[0],i=1,s=function(A){e[r++]=A},o=1;o<=t;++o)if(A[o]==n&&o!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=A[o]}return{c:e.subarray(0,r),n:t}},S=function(A,t){for(var e=0,r=0;r<t.length;++r)e+=A[r]*t[r];return e},_=function(A,t,e){var r=e.length,n=L(t+2);A[n]=255&r,A[n+1]=r>>8,A[n+2]=255^A[n],A[n+3]=255^A[n+1];for(var i=0;i<r;++i)A[n+i+4]=e[i];return 8*(n+4+r)},k=function(A,t,e,r,n,i,s,o,a,u,d){E(t,d++,e),++n[256];for(var g=x(n,15),B=g.t,p=g.l,w=x(i,15),m=w.t,C=w.l,y=N(B),L=y.c,H=y.n,k=N(m),P=k.c,D=k.n,M=new c(19),O=0;O<L.length;++O)++M[31&L[O]];for(O=0;O<P.length;++O)++M[31&P[O]];for(var T=x(M,7),K=T.t,R=T.l,j=19;j>4&&!K[f[j-1]];--j);var G,V,q,W,X=u+5<<3,J=S(n,Q)+S(i,b)+s,z=S(n,B)+S(i,m)+s+14+3*j+S(M,K)+2*M[16]+3*M[17]+7*M[18];if(a>=0&&X<=J&&X<=z)return _(t,d,A.subarray(a,a+u));if(E(t,d,1+(z<J)),d+=2,z<J){G=v(B,p,0),V=B,q=v(m,C,0),W=m;var Y=v(K,R,0);E(t,d,H-257),E(t,d+5,D-1),E(t,d+10,j-4),d+=14;for(O=0;O<j;++O)E(t,d+3*O,K[f[O]]);d+=3*j;for(var Z=[L,P],$=0;$<2;++$){var AA=Z[$];for(O=0;O<AA.length;++O){var tA=31&AA[O];E(t,d,Y[tA]),d+=K[tA],tA>15&&(E(t,d,AA[O]>>5&127),d+=AA[O]>>12)}}}else G=F,V=Q,q=U,W=b;for(O=0;O<o;++O){var eA=r[O];if(eA>255){I(t,d,G[(tA=eA>>18&31)+257]),d+=V[tA+257],tA>7&&(E(t,d,eA>>23&31),d+=l[tA]);var rA=31&eA;I(t,d,q[rA]),d+=W[rA],rA>3&&(I(t,d,eA>>5&8191),d+=h[rA])}else I(t,d,G[eA]),d+=V[eA]}return I(t,d,G[256]),d+V[256]},P=new u([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D=new a(0),M=function(A,t,e,r,n,i){var s=i.z||A.length,o=new a(r+s+5*(1+Math.ceil(s/7e3))+n),f=o.subarray(r,o.length-n),d=i.l,g=7&(i.r||0);if(t){g&&(f[0]=i.r>>3);for(var B=P[t-1],m=B>>13,C=8191&B,y=(1<<e)-1,v=i.p||new c(32768),Q=i.h||new c(y+1),b=Math.ceil(e/3),F=2*b,U=function(t){return(A[t]^A[t+1]<<b^A[t+2]<<F)&y},E=new u(25e3),I=new c(288),x=new c(32),H=0,N=0,S=i.i||0,D=0,M=i.w||0,O=0;S+2<s;++S){var T=U(S),K=32767&S,R=Q[T];if(v[K]=R,Q[T]=K,M<=S){var j=s-S;if((H>7e3||D>24576)&&(j>423||!d)){g=k(A,f,0,E,I,x,N,D,O,S-O,g),D=H=N=0,O=S;for(var G=0;G<286;++G)I[G]=0;for(G=0;G<30;++G)x[G]=0}var V=2,q=0,W=C,X=K-R&32767;if(j>2&&T==U(S-X))for(var J=Math.min(m,j)-1,z=Math.min(32767,S),Y=Math.min(258,j);X<=z&&--W&&K!=R;){if(A[S+V]==A[S+V-X]){for(var Z=0;Z<Y&&A[S+Z]==A[S+Z-X];++Z);if(Z>V){if(V=Z,q=X,Z>J)break;var $=Math.min(X,Z-2),AA=0;for(G=0;G<$;++G){var tA=S-X+G&32767,eA=tA-v[tA]&32767;eA>AA&&(AA=eA,R=tA)}}}X+=(K=R)-(R=v[K])&32767}if(q){E[D++]=268435456|p[V]<<18|w[q];var rA=31&p[V],nA=31&w[q];N+=l[rA]+h[nA],++I[257+rA],++x[nA],M=S+V,++H}else E[D++]=A[S],++I[A[S]]}}for(S=Math.max(S,M);S<s;++S)E[D++]=A[S],++I[A[S]];g=k(A,f,d,E,I,x,N,D,O,S-O,g),d||(i.r=7&g|f[g/8|0]<<3,g-=7,i.h=Q,i.p=v,i.i=S,i.w=M)}else{for(S=i.w||0;S<s+d;S+=65535){var iA=S+65535;iA>=s&&(f[g/8|0]=d,iA=s),g=_(f,g+1,A.subarray(S,iA))}i.i=s}return function(A,t,e){return(null==e||e>A.length)&&(e=A.length),new a(A.subarray(t,e))}(o,0,r+L(g)+n)},O=function(){var A=1,t=0;return{p:function(e){for(var r=A,n=t,i=0|e.length,s=0;s!=i;){for(var o=Math.min(s+2655,i);s<o;++s)n+=r+=e[s];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}A=r,t=n},d:function(){return(255&(A%=65521))<<24|(65280&A)<<8|(255&(t%=65521))<<8|t>>8}}},T=function(A,t,e){for(;e;++t)A[t]=e,e>>>=8};function K(A,t){t||(t={});var e=O();e.p(A);var r=function(A,t,e,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new a(i.length+A.length);s.set(i),s.set(A,i.length),A=s,n.w=i.length}return M(A,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(A.length)))):20:12+t.mem,e,r,n)}(A,t,t.dictionary?6:2,4);return function(A,t){var e=t.level,r=0==e?0:e<6?1:9==e?3:2;if(A[0]=120,A[1]=r<<6|(t.dictionary&&32),A[1]|=31-(A[0]<<8|A[1])%31,t.dictionary){var n=O();n.p(t.dictionary),T(A,2,n.d())}}(r,t),T(r,r.length-4,e.d()),r}var R="undefined"!=typeof TextDecoder&&new TextDecoder;try{R.decode(D,{stream:!0})}catch(Lr){}function j(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,r=Array(t);e<t;e++)r[e]=A[e];return r}function G(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var r,n,i,s,o=[],a=!0,c=!1;try{if(i=(e=e.call(A)).next,0===t);else for(;!(a=(r=i.call(e)).done)&&(o.push(r.value),o.length!==t);a=!0);}catch(A){c=!0,n=A}finally{try{if(!a&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw n}}return o}}(A,t)||function(A,t){if(A){if("string"==typeof A)return j(A,t);var e={}.toString.call(A).slice(8,-1);return"Object"===e&&A.constructor&&(e=A.constructor.name),"Map"===e||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?j(A,t):void 0}}(A,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(A,t="utf8"){return new TextDecoder(t).decode(A)}const q=new TextEncoder;const W=(()=>{const A=new Uint8Array(4);return!((new Uint32Array(A.buffer)[0]=1)&A[0])})(),X={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class J{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(A=8192,t={}){let e=!1;"number"==typeof A?A=new ArrayBuffer(A):(e=!0,this.lastWrittenByte=A.byteLength);const r=t.offset?t.offset>>>0:0,n=A.byteLength-r;let i=r;(ArrayBuffer.isView(A)||A instanceof J)&&(A.byteLength!==A.buffer.byteLength&&(i=A.byteOffset+r),A=A.buffer),this.lastWrittenByte=e?n:0,this.buffer=A,this.length=n,this.byteLength=n,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,n),this._mark=0,this._marks=[]}available(A=1){return this.offset+A<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(A=1){return this.offset+=A,this}back(A=1){return this.offset-=A,this}seek(A){return this.offset=A,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const A=this._marks.pop();if(void 0===A)throw new Error("Mark stack empty");return this.seek(A),this}rewind(){return this.offset=0,this}ensureAvailable(A=1){if(!this.available(A)){const t=2*(this.offset+A),e=new Uint8Array(t);e.set(new Uint8Array(this.buffer)),this.buffer=e.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(A=1){return this.readArray(A,"uint8")}readArray(A,t){const e=X[t].BYTES_PER_ELEMENT*A,r=this.byteOffset+this.offset,n=this.buffer.slice(r,r+e);if(this.littleEndian===W&&"uint8"!==t&&"int8"!==t){const A=new Uint8Array(this.buffer.slice(r,r+e));A.reverse();const n=new X[t](A.buffer);return this.offset+=e,n.reverse(),n}const i=new X[t](n);return this.offset+=e,i}readInt16(){const A=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,A}readUint16(){const A=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,A}readInt32(){const A=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,A}readUint32(){const A=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,A}readFloat32(){const A=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,A}readFloat64(){const A=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,A}readBigInt64(){const A=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,A}readBigUint64(){const A=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,A}readChar(){return String.fromCharCode(this.readInt8())}readChars(A=1){let t="";for(let e=0;e<A;e++)t+=this.readChar();return t}readUtf8(A=1){return V(this.readBytes(A))}decodeText(A=1,t="utf8"){return V(this.readBytes(A),t)}writeBoolean(A){return this.writeUint8(A?255:0),this}writeInt8(A){return this.ensureAvailable(1),this._data.setInt8(this.offset++,A),this._updateLastWrittenByte(),this}writeUint8(A){return this.ensureAvailable(1),this._data.setUint8(this.offset++,A),this._updateLastWrittenByte(),this}writeByte(A){return this.writeUint8(A)}writeBytes(A){this.ensureAvailable(A.length);for(let t=0;t<A.length;t++)this._data.setUint8(this.offset++,A[t]);return this._updateLastWrittenByte(),this}writeInt16(A){return this.ensureAvailable(2),this._data.setInt16(this.offset,A,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(A){return this.ensureAvailable(2),this._data.setUint16(this.offset,A,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(A){return this.ensureAvailable(4),this._data.setInt32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(A){return this.ensureAvailable(4),this._data.setUint32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(A){return this.ensureAvailable(4),this._data.setFloat32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(A){return this.ensureAvailable(8),this._data.setFloat64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(A){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(A){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(A){return this.writeUint8(A.charCodeAt(0))}writeChars(A){for(let t=0;t<A.length;t++)this.writeUint8(A.charCodeAt(t));return this}writeUtf8(A){return this.writeBytes(function(A){return q.encode(A)}(A))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function z(A){let t=A.length;for(;--t>=0;)A[t]=0}z(new Array(576));z(new Array(60));z(new Array(512));z(new Array(256));z(new Array(29));z(new Array(30));var Y=(A,t,e,r)=>{let n=65535&A,i=A>>>16&65535,s=0;for(;0!==e;){s=e>2e3?2e3:e,e-=s;do{n=n+t[r++]|0,i=i+n|0}while(--s);n%=65521,i%=65521}return n|i<<16};const Z=new Uint32Array((()=>{let A,t=[];for(var e=0;e<256;e++){A=e;for(var r=0;r<8;r++)A=1&A?3988292384^A>>>1:A>>>1;t[e]=A}return t})());var $=(A,t,e,r)=>{const n=Z,i=r+e;A^=-1;for(let e=r;e<i;e++)A=A>>>8^n[255&(A^t[e])];return-1^A},AA={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},tA={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const eA=(A,t)=>Object.prototype.hasOwnProperty.call(A,t);var rA=function(A){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const t in e)eA(e,t)&&(A[t]=e[t])}}return A},nA=A=>{let t=0;for(let e=0,r=A.length;e<r;e++)t+=A[e].length;const e=new Uint8Array(t);for(let t=0,r=0,n=A.length;t<n;t++){let n=A[t];e.set(n,r),r+=n.length}return e};let iA=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){iA=!1}const sA=new Uint8Array(256);for(let A=0;A<256;A++)sA[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;sA[254]=sA[254]=1;var oA=A=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);let t,e,r,n,i,s=A.length,o=0;for(n=0;n<s;n++)e=A.charCodeAt(n),55296==(64512&e)&&n+1<s&&(r=A.charCodeAt(n+1),56320==(64512&r)&&(e=65536+(e-55296<<10)+(r-56320),n++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),i=0,n=0;i<o;n++)e=A.charCodeAt(n),55296==(64512&e)&&n+1<s&&(r=A.charCodeAt(n+1),56320==(64512&r)&&(e=65536+(e-55296<<10)+(r-56320),n++)),e<128?t[i++]=e:e<2048?(t[i++]=192|e>>>6,t[i++]=128|63&e):e<65536?(t[i++]=224|e>>>12,t[i++]=128|e>>>6&63,t[i++]=128|63&e):(t[i++]=240|e>>>18,t[i++]=128|e>>>12&63,t[i++]=128|e>>>6&63,t[i++]=128|63&e);return t},aA=(A,t)=>{const e=t||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,t));let r,n;const i=new Array(2*e);for(n=0,r=0;r<e;){let t=A[r++];if(t<128){i[n++]=t;continue}let s=sA[t];if(s>4)i[n++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<e;)t=t<<6|63&A[r++],s--;s>1?i[n++]=65533:t<65536?i[n++]=t:(t-=65536,i[n++]=55296|t>>10&1023,i[n++]=56320|1023&t)}}return((A,t)=>{if(t<65534&&A.subarray&&iA)return String.fromCharCode.apply(null,A.length===t?A:A.subarray(0,t));let e="";for(let r=0;r<t;r++)e+=String.fromCharCode(A[r]);return e})(i,n)},cA=(A,t)=>{(t=t||A.length)>A.length&&(t=A.length);let e=t-1;for(;e>=0&&128==(192&A[e]);)e--;return e<0||0===e?t:e+sA[A[e]]>t?e:t};var uA=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const lA=16209;var hA=function(A,t){let e,r,n,i,s,o,a,c,u,l,h,f,d,g,B,p,w,m,C,y,v,Q,b,F;const U=A.state;e=A.next_in,b=A.input,r=e+(A.avail_in-5),n=A.next_out,F=A.output,i=n-(t-A.avail_out),s=n+(A.avail_out-257),o=U.dmax,a=U.wsize,c=U.whave,u=U.wnext,l=U.window,h=U.hold,f=U.bits,d=U.lencode,g=U.distcode,B=(1<<U.lenbits)-1,p=(1<<U.distbits)-1;A:do{f<15&&(h+=b[e++]<<f,f+=8,h+=b[e++]<<f,f+=8),w=d[h&B];t:for(;;){if(m=w>>>24,h>>>=m,f-=m,m=w>>>16&255,0===m)F[n++]=65535&w;else{if(!(16&m)){if(64&m){if(32&m){U.mode=16191;break A}A.msg="invalid literal/length code",U.mode=lA;break A}w=d[(65535&w)+(h&(1<<m)-1)];continue t}for(C=65535&w,m&=15,m&&(f<m&&(h+=b[e++]<<f,f+=8),C+=h&(1<<m)-1,h>>>=m,f-=m),f<15&&(h+=b[e++]<<f,f+=8,h+=b[e++]<<f,f+=8),w=g[h&p];;){if(m=w>>>24,h>>>=m,f-=m,m=w>>>16&255,16&m){if(y=65535&w,m&=15,f<m&&(h+=b[e++]<<f,f+=8,f<m&&(h+=b[e++]<<f,f+=8)),y+=h&(1<<m)-1,y>o){A.msg="invalid distance too far back",U.mode=lA;break A}if(h>>>=m,f-=m,m=n-i,y>m){if(m=y-m,m>c&&U.sane){A.msg="invalid distance too far back",U.mode=lA;break A}if(v=0,Q=l,0===u){if(v+=a-m,m<C){C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}}else if(u<m){if(v+=a+u-m,m-=u,m<C){C-=m;do{F[n++]=l[v++]}while(--m);if(v=0,u<C){m=u,C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}}}else if(v+=u-m,m<C){C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}for(;C>2;)F[n++]=Q[v++],F[n++]=Q[v++],F[n++]=Q[v++],C-=3;C&&(F[n++]=Q[v++],C>1&&(F[n++]=Q[v++]))}else{v=n-y;do{F[n++]=F[v++],F[n++]=F[v++],F[n++]=F[v++],C-=3}while(C>2);C&&(F[n++]=F[v++],C>1&&(F[n++]=F[v++]))}break}if(64&m){A.msg="invalid distance code",U.mode=lA;break A}w=g[(65535&w)+(h&(1<<m)-1)]}}break}}while(e<r&&n<s);C=f>>3,e-=C,f-=C<<3,h&=(1<<f)-1,A.next_in=e,A.next_out=n,A.avail_in=e<r?r-e+5:5-(e-r),A.avail_out=n<s?s-n+257:257-(n-s),U.hold=h,U.bits=f};const fA=15,dA=new Uint16Array([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,0,0]),gA=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),BA=new Uint16Array([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,0,0]),pA=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var wA=(A,t,e,r,n,i,s,o)=>{const a=o.bits;let c,u,l,h,f,d,g=0,B=0,p=0,w=0,m=0,C=0,y=0,v=0,Q=0,b=0,F=null;const U=new Uint16Array(16),L=new Uint16Array(16);let E,I,x,H=null;for(g=0;g<=fA;g++)U[g]=0;for(B=0;B<r;B++)U[t[e+B]]++;for(m=a,w=fA;w>=1&&0===U[w];w--);if(m>w&&(m=w),0===w)return n[i++]=20971520,n[i++]=20971520,o.bits=1,0;for(p=1;p<w&&0===U[p];p++);for(m<p&&(m=p),v=1,g=1;g<=fA;g++)if(v<<=1,v-=U[g],v<0)return-1;if(v>0&&(0===A||1!==w))return-1;for(L[1]=0,g=1;g<fA;g++)L[g+1]=L[g]+U[g];for(B=0;B<r;B++)0!==t[e+B]&&(s[L[t[e+B]]++]=B);if(0===A?(F=H=s,d=20):1===A?(F=dA,H=gA,d=257):(F=BA,H=pA,d=0),b=0,B=0,g=p,f=i,C=m,y=0,l=-1,Q=1<<m,h=Q-1,1===A&&Q>852||2===A&&Q>592)return 1;for(;;){E=g-y,s[B]+1<d?(I=0,x=s[B]):s[B]>=d?(I=H[s[B]-d],x=F[s[B]-d]):(I=96,x=0),c=1<<g-y,u=1<<C,p=u;do{u-=c,n[f+(b>>y)+u]=E<<24|I<<16|x}while(0!==u);for(c=1<<g-1;b&c;)c>>=1;if(0!==c?(b&=c-1,b+=c):b=0,B++,0===--U[g]){if(g===w)break;g=t[e+s[B]]}if(g>m&&(b&h)!==l){for(0===y&&(y=m),f+=p,C=g-y,v=1<<C;C+y<w&&(v-=U[C+y],!(v<=0));)C++,v<<=1;if(Q+=1<<C,1===A&&Q>852||2===A&&Q>592)return 1;l=b&h,n[l]=m<<24|C<<16|f-i}}return 0!==b&&(n[f+b]=g-y<<24|64<<16),o.bits=m,0};const{Z_FINISH:mA,Z_BLOCK:CA,Z_TREES:yA,Z_OK:vA,Z_STREAM_END:QA,Z_NEED_DICT:bA,Z_STREAM_ERROR:FA,Z_DATA_ERROR:UA,Z_MEM_ERROR:LA,Z_BUF_ERROR:EA,Z_DEFLATED:IA}=tA,xA=16180,HA=16190,NA=16191,SA=16192,_A=16194,kA=16199,PA=16200,DA=16206,MA=16209,OA=A=>(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24);function TA(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const KA=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.mode<xA||t.mode>16211?1:0},RA=A=>{if(KA(A))return FA;const t=A.state;return A.total_in=A.total_out=t.total=0,A.msg="",t.wrap&&(A.adler=1&t.wrap),t.mode=xA,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,vA},jA=A=>{if(KA(A))return FA;const t=A.state;return t.wsize=0,t.whave=0,t.wnext=0,RA(A)},GA=(A,t)=>{let e;if(KA(A))return FA;const r=A.state;return t<0?(e=0,t=-t):(e=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?FA:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=e,r.wbits=t,jA(A))},VA=(A,t)=>{if(!A)return FA;const e=new TA;A.state=e,e.strm=A,e.window=null,e.mode=xA;const r=GA(A,t);return r!==vA&&(A.state=null),r};let qA,WA,XA=!0;const JA=A=>{if(XA){qA=new Int32Array(512),WA=new Int32Array(32);let t=0;for(;t<144;)A.lens[t++]=8;for(;t<256;)A.lens[t++]=9;for(;t<280;)A.lens[t++]=7;for(;t<288;)A.lens[t++]=8;for(wA(1,A.lens,0,288,qA,0,A.work,{bits:9}),t=0;t<32;)A.lens[t++]=5;wA(2,A.lens,0,32,WA,0,A.work,{bits:5}),XA=!1}A.lencode=qA,A.lenbits=9,A.distcode=WA,A.distbits=5},zA=(A,t,e,r)=>{let n;const i=A.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(e-i.wsize,e),0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>r&&(n=r),i.window.set(t.subarray(e-r,e-r+n),i.wnext),(r-=n)?(i.window.set(t.subarray(e-r,e),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0};var YA={inflateReset:jA,inflateReset2:GA,inflateResetKeep:RA,inflateInit:A=>VA(A,15),inflateInit2:VA,inflate:(A,t)=>{let e,r,n,i,s,o,a,c,u,l,h,f,d,g,B,p,w,m,C,y,v,Q,b=0;const F=new Uint8Array(4);let U,L;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(KA(A)||!A.output||!A.input&&0!==A.avail_in)return FA;e=A.state,e.mode===NA&&(e.mode=SA),s=A.next_out,n=A.output,a=A.avail_out,i=A.next_in,r=A.input,o=A.avail_in,c=e.hold,u=e.bits,l=o,h=a,Q=vA;A:for(;;)switch(e.mode){case xA:if(0===e.wrap){e.mode=SA;break}for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(2&e.wrap&&35615===c){0===e.wbits&&(e.wbits=15),e.check=0,F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0),c=0,u=0,e.mode=16181;break}if(e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&c)<<8)+(c>>8))%31){A.msg="incorrect header check",e.mode=MA;break}if((15&c)!==IA){A.msg="unknown compression method",e.mode=MA;break}if(c>>>=4,u-=4,v=8+(15&c),0===e.wbits&&(e.wbits=v),v>15||v>e.wbits){A.msg="invalid window size",e.mode=MA;break}e.dmax=1<<e.wbits,e.flags=0,A.adler=e.check=1,e.mode=512&c?16189:NA,c=0,u=0;break;case 16181:for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(e.flags=c,(255&e.flags)!==IA){A.msg="unknown compression method",e.mode=MA;break}if(57344&e.flags){A.msg="unknown header flags set",e.mode=MA;break}e.head&&(e.head.text=c>>8&1),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0,e.mode=16182;case 16182:for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.head&&(e.head.time=c),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,e.check=$(e.check,F,4,0)),c=0,u=0,e.mode=16183;case 16183:for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.head&&(e.head.xflags=255&c,e.head.os=c>>8),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0,e.mode=16184;case 16184:if(1024&e.flags){for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.length=c,e.head&&(e.head.extra_len=c),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0}else e.head&&(e.head.extra=null);e.mode=16185;case 16185:if(1024&e.flags&&(f=e.length,f>o&&(f=o),f&&(e.head&&(v=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(i,i+f),v)),512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,e.length-=f),e.length))break A;e.length=0,e.mode=16186;case 16186:if(2048&e.flags){if(0===o)break A;f=0;do{v=r[i+f++],e.head&&v&&e.length<65536&&(e.head.name+=String.fromCharCode(v))}while(v&&f<o);if(512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,v)break A}else e.head&&(e.head.name=null);e.length=0,e.mode=16187;case 16187:if(4096&e.flags){if(0===o)break A;f=0;do{v=r[i+f++],e.head&&v&&e.length<65536&&(e.head.comment+=String.fromCharCode(v))}while(v&&f<o);if(512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,v)break A}else e.head&&(e.head.comment=null);e.mode=16188;case 16188:if(512&e.flags){for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(4&e.wrap&&c!==(65535&e.check)){A.msg="header crc mismatch",e.mode=MA;break}c=0,u=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),A.adler=e.check=0,e.mode=NA;break;case 16189:for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}A.adler=e.check=OA(c),c=0,u=0,e.mode=HA;case HA:if(0===e.havedict)return A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,bA;A.adler=e.check=1,e.mode=NA;case NA:if(t===CA||t===yA)break A;case SA:if(e.last){c>>>=7&u,u-=7&u,e.mode=DA;break}for(;u<3;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}switch(e.last=1&c,c>>>=1,u-=1,3&c){case 0:e.mode=16193;break;case 1:if(JA(e),e.mode=kA,t===yA){c>>>=2,u-=2;break A}break;case 2:e.mode=16196;break;case 3:A.msg="invalid block type",e.mode=MA}c>>>=2,u-=2;break;case 16193:for(c>>>=7&u,u-=7&u;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){A.msg="invalid stored block lengths",e.mode=MA;break}if(e.length=65535&c,c=0,u=0,e.mode=_A,t===yA)break A;case _A:e.mode=16195;case 16195:if(f=e.length,f){if(f>o&&(f=o),f>a&&(f=a),0===f)break A;n.set(r.subarray(i,i+f),s),o-=f,i+=f,a-=f,s+=f,e.length-=f;break}e.mode=NA;break;case 16196:for(;u<14;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(e.nlen=257+(31&c),c>>>=5,u-=5,e.ndist=1+(31&c),c>>>=5,u-=5,e.ncode=4+(15&c),c>>>=4,u-=4,e.nlen>286||e.ndist>30){A.msg="too many length or distance symbols",e.mode=MA;break}e.have=0,e.mode=16197;case 16197:for(;e.have<e.ncode;){for(;u<3;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.lens[E[e.have++]]=7&c,c>>>=3,u-=3}for(;e.have<19;)e.lens[E[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,U={bits:e.lenbits},Q=wA(0,e.lens,0,19,e.lencode,0,e.work,U),e.lenbits=U.bits,Q){A.msg="invalid code lengths set",e.mode=MA;break}e.have=0,e.mode=16198;case 16198:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[c&(1<<e.lenbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(w<16)c>>>=B,u-=B,e.lens[e.have++]=w;else{if(16===w){for(L=B+2;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(c>>>=B,u-=B,0===e.have){A.msg="invalid bit length repeat",e.mode=MA;break}v=e.lens[e.have-1],f=3+(3&c),c>>>=2,u-=2}else if(17===w){for(L=B+3;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=B,u-=B,v=0,f=3+(7&c),c>>>=3,u-=3}else{for(L=B+7;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=B,u-=B,v=0,f=11+(127&c),c>>>=7,u-=7}if(e.have+f>e.nlen+e.ndist){A.msg="invalid bit length repeat",e.mode=MA;break}for(;f--;)e.lens[e.have++]=v}}if(e.mode===MA)break;if(0===e.lens[256]){A.msg="invalid code -- missing end-of-block",e.mode=MA;break}if(e.lenbits=9,U={bits:e.lenbits},Q=wA(1,e.lens,0,e.nlen,e.lencode,0,e.work,U),e.lenbits=U.bits,Q){A.msg="invalid literal/lengths set",e.mode=MA;break}if(e.distbits=6,e.distcode=e.distdyn,U={bits:e.distbits},Q=wA(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,U),e.distbits=U.bits,Q){A.msg="invalid distances set",e.mode=MA;break}if(e.mode=kA,t===yA)break A;case kA:e.mode=PA;case PA:if(o>=6&&a>=258){A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,hA(A,h),s=A.next_out,n=A.output,a=A.avail_out,i=A.next_in,r=A.input,o=A.avail_in,c=e.hold,u=e.bits,e.mode===NA&&(e.back=-1);break}for(e.back=0;b=e.lencode[c&(1<<e.lenbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(p&&!(240&p)){for(m=B,C=p,y=w;b=e.lencode[y+((c&(1<<m+C)-1)>>m)],B=b>>>24,p=b>>>16&255,w=65535&b,!(m+B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,e.back+=m}if(c>>>=B,u-=B,e.back+=B,e.length=w,0===p){e.mode=16205;break}if(32&p){e.back=-1,e.mode=NA;break}if(64&p){A.msg="invalid literal/length code",e.mode=MA;break}e.extra=15&p,e.mode=16201;case 16201:if(e.extra){for(L=e.extra;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=16202;case 16202:for(;b=e.distcode[c&(1<<e.distbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(!(240&p)){for(m=B,C=p,y=w;b=e.distcode[y+((c&(1<<m+C)-1)>>m)],B=b>>>24,p=b>>>16&255,w=65535&b,!(m+B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,e.back+=m}if(c>>>=B,u-=B,e.back+=B,64&p){A.msg="invalid distance code",e.mode=MA;break}e.offset=w,e.extra=15&p,e.mode=16203;case 16203:if(e.extra){for(L=e.extra;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){A.msg="invalid distance too far back",e.mode=MA;break}e.mode=16204;case 16204:if(0===a)break A;if(f=h-a,e.offset>f){if(f=e.offset-f,f>e.whave&&e.sane){A.msg="invalid distance too far back",e.mode=MA;break}f>e.wnext?(f-=e.wnext,d=e.wsize-f):d=e.wnext-f,f>e.length&&(f=e.length),g=e.window}else g=n,d=s-e.offset,f=e.length;f>a&&(f=a),a-=f,e.length-=f;do{n[s++]=g[d++]}while(--f);0===e.length&&(e.mode=PA);break;case 16205:if(0===a)break A;n[s++]=e.length,a--,e.mode=PA;break;case DA:if(e.wrap){for(;u<32;){if(0===o)break A;o--,c|=r[i++]<<u,u+=8}if(h-=a,A.total_out+=h,e.total+=h,4&e.wrap&&h&&(A.adler=e.check=e.flags?$(e.check,n,h,s-h):Y(e.check,n,h,s-h)),h=a,4&e.wrap&&(e.flags?c:OA(c))!==e.check){A.msg="incorrect data check",e.mode=MA;break}c=0,u=0}e.mode=16207;case 16207:if(e.wrap&&e.flags){for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(4&e.wrap&&c!==(4294967295&e.total)){A.msg="incorrect length check",e.mode=MA;break}c=0,u=0}e.mode=16208;case 16208:Q=QA;break A;case MA:Q=UA;break A;case 16210:return LA;default:return FA}return A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,(e.wsize||h!==A.avail_out&&e.mode<MA&&(e.mode<DA||t!==mA))&&zA(A,A.output,A.next_out,h-A.avail_out),l-=A.avail_in,h-=A.avail_out,A.total_in+=l,A.total_out+=h,e.total+=h,4&e.wrap&&h&&(A.adler=e.check=e.flags?$(e.check,n,h,A.next_out-h):Y(e.check,n,h,A.next_out-h)),A.data_type=e.bits+(e.last?64:0)+(e.mode===NA?128:0)+(e.mode===kA||e.mode===_A?256:0),(0===l&&0===h||t===mA)&&Q===vA&&(Q=EA),Q},inflateEnd:A=>{if(KA(A))return FA;let t=A.state;return t.window&&(t.window=null),A.state=null,vA},inflateGetHeader:(A,t)=>{if(KA(A))return FA;const e=A.state;return 2&e.wrap?(e.head=t,t.done=!1,vA):FA},inflateSetDictionary:(A,t)=>{const e=t.length;let r,n,i;return KA(A)?FA:(r=A.state,0!==r.wrap&&r.mode!==HA?FA:r.mode===HA&&(n=1,n=Y(n,t,e,0),n!==r.check)?UA:(i=zA(A,t,e,e),i?(r.mode=16210,LA):(r.havedict=1,vA)))},inflateInfo:"pako inflate (from Nodeca project)"};var ZA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const $A=Object.prototype.toString,{Z_NO_FLUSH:At,Z_FINISH:tt,Z_OK:et,Z_STREAM_END:rt,Z_NEED_DICT:nt,Z_STREAM_ERROR:it,Z_DATA_ERROR:st,Z_MEM_ERROR:ot}=tA;function at(A){this.options=rA({chunkSize:65536,windowBits:15,to:""},A||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||A&&A.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new uA,this.strm.avail_out=0;let e=YA.inflateInit2(this.strm,t.windowBits);if(e!==et)throw new Error(AA[e]);if(this.header=new ZA,YA.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=oA(t.dictionary):"[object ArrayBuffer]"===$A.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=YA.inflateSetDictionary(this.strm,t.dictionary),e!==et)))throw new Error(AA[e])}at.prototype.push=function(A,t){const e=this.strm,r=this.options.chunkSize,n=this.options.dictionary;let i,s,o;if(this.ended)return!1;for(s=t===~~t?t:!0===t?tt:At,"[object ArrayBuffer]"===$A.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;){for(0===e.avail_out&&(e.output=new Uint8Array(r),e.next_out=0,e.avail_out=r),i=YA.inflate(e,s),i===nt&&n&&(i=YA.inflateSetDictionary(e,n),i===et?i=YA.inflate(e,s):i===st&&(i=nt));e.avail_in>0&&i===rt&&e.state.wrap>0&&0!==A[e.next_in];)YA.inflateReset(e),i=YA.inflate(e,s);switch(i){case it:case st:case nt:case ot:return this.onEnd(i),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(0===e.avail_out||i===rt))if("string"===this.options.to){let A=cA(e.output,e.next_out),t=e.next_out-A,n=aA(e.output,A);e.next_out=t,e.avail_out=r-t,t&&e.output.set(e.output.subarray(A,A+t),0),this.onData(n)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(i!==et||0!==o){if(i===rt)return i=YA.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===e.avail_in)break}}return!0},at.prototype.onData=function(A){this.chunks.push(A)},at.prototype.onEnd=function(A){A===et&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=nA(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var ct={Inflate:at,inflate:function(A,t){const e=new at(t);if(e.push(A),e.err)throw e.msg||AA[e.err];return e.result}};const{Inflate:ut,inflate:lt}=ct;var ht=ut,ft=lt;const dt=[];for(let A=0;A<256;A++){let t=A;for(let A=0;A<8;A++)1&t?t=3988292384^t>>>1:t>>>=1;dt[A]=t}const gt=4294967295;function Bt(A,t){return(function(A,t,e){let r=A;for(let A=0;A<e;A++)r=dt[255&(r^t[A])]^r>>>8;return r}(gt,A,t)^gt)>>>0}function pt(A,t,e){const r=A.readUint32(),n=Bt(new Uint8Array(A.buffer,A.byteOffset+A.offset-t-4,t),t);if(n!==r)throw new Error(`CRC mismatch for chunk ${e}. Expected ${r}, found ${n}`)}function wt(A,t,e){for(let r=0;r<e;r++)t[r]=A[r]}function mt(A,t,e,r){let n=0;for(;n<r;n++)t[n]=A[n];for(;n<e;n++)t[n]=A[n]+t[n-r]&255}function Ct(A,t,e,r){let n=0;if(0===e.length)for(;n<r;n++)t[n]=A[n];else for(;n<r;n++)t[n]=A[n]+e[n]&255}function yt(A,t,e,r,n){let i=0;if(0===e.length){for(;i<n;i++)t[i]=A[i];for(;i<r;i++)t[i]=A[i]+(t[i-n]>>1)&255}else{for(;i<n;i++)t[i]=A[i]+(e[i]>>1)&255;for(;i<r;i++)t[i]=A[i]+(t[i-n]+e[i]>>1)&255}}function vt(A,t,e,r,n){let i=0;if(0===e.length){for(;i<n;i++)t[i]=A[i];for(;i<r;i++)t[i]=A[i]+t[i-n]&255}else{for(;i<n;i++)t[i]=A[i]+e[i]&255;for(;i<r;i++)t[i]=A[i]+Qt(t[i-n],e[i],e[i-n])&255}}function Qt(A,t,e){const r=A+t-e,n=Math.abs(r-A),i=Math.abs(r-t),s=Math.abs(r-e);return n<=i&&n<=s?A:i<=s?t:e}function bt(A,t,e,r,n,i){switch(A){case 0:wt(t,e,n);break;case 1:mt(t,e,n,i);break;case 2:Ct(t,e,r,n);break;case 3:yt(t,e,r,n,i);break;case 4:vt(t,e,r,n,i);break;default:throw new Error(`Unsupported filter: ${A}`)}}const Ft=new Uint16Array([255]),Ut=255===new Uint8Array(Ft.buffer)[0];function Lt(A){return(255&A)<<8|A>>8&255}const Et=new Uint16Array([255]),It=255===new Uint8Array(Et.buffer)[0],xt=new Uint8Array(0);function Ht(A){const{data:t,width:e,height:r,channels:n,depth:i}=A,s=Math.ceil(i/8)*n,o=Math.ceil(i/8*n*e),a=new Uint8Array(r*o);let c,u,l=xt,h=0;for(let A=0;A<r;A++){switch(c=t.subarray(h+1,h+1+o),u=a.subarray(A*o,(A+1)*o),t[h]){case 0:wt(c,u,o);break;case 1:mt(c,u,o,s);break;case 2:Ct(c,u,l,o);break;case 3:yt(c,u,l,o,s);break;case 4:vt(c,u,l,o,s);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}l=u,h+=o+1}if(16===i){const A=new Uint16Array(a.buffer);if(It)for(let t=0;t<A.length;t++)A[t]=Nt(A[t]);return A}return a}function Nt(A){return(255&A)<<8|A>>8&255}const St=Uint8Array.of(137,80,78,71,13,10,26,10);function _t(A){if(!function(A){if(A.length<St.length)return!1;for(let t=0;t<St.length;t++)if(A[t]!==St[t])return!1;return!0}(A.readBytes(St.length)))throw new Error("wrong PNG signature")}const kt=new TextDecoder("latin1");function Pt(A){if(function(A){if(!Dt.test(A))throw new Error("invalid latin1 text")}(A),0===A.length||A.length>79)throw new Error("keyword length must be between 1 and 79")}const Dt=/^[\u0000-\u00FF]*$/;function Mt(A,t,e){const r=Ot(t);A[r]=function(A,t){return kt.decode(A.readBytes(t))}(t,e-r.length-1)}function Ot(A){for(A.mark();0!==A.readByte(););const t=A.offset;A.reset();const e=kt.decode(A.readBytes(t-A.offset-1));return A.skip(1),Pt(e),e}const Tt=-1,Kt=0,Rt=2,jt=3,Gt=4,Vt=6,qt=-1,Wt=0,Xt=-1,Jt=0,zt=-1,Yt=0,Zt=1,$t=0,Ae=1,te=2,ee=0,re=1;class ne extends J{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(A,t={}){super(A);const{checkCrc:e=!1}=t;this._checkCrc=e,this._inflator=new ht,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=qt,this._filterMethod=Xt,this._interlaceMethod=zt,this._colorType=Tt,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(_t(this);!this._end;){const A=this.readUint32(),t=this.readChars(4);this.decodeChunk(A,t)}return this.decodeImage(),this._png}decodeApng(){for(_t(this);!this._end;){const A=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(A,t)}return this.decodeApngImage(),this._apng}decodeChunk(A,t){const e=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(A);break;case"IDAT":this.decodeIDAT(A);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(A);break;case"iCCP":this.decodeiCCP(A);break;case"tEXt":Mt(this._png.text,this,A);break;case"pHYs":this.decodepHYs();break;default:this.skip(A)}if(this.offset-e!==A)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?pt(this,A+4,t):this.skip(4)}decodeApngChunk(A,t){const e=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(A);break;default:this.decodeChunk(A,t),this.offset=e+A}if(this.offset-e!==A)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?pt(this,A+4,t):this.skip(4)}decodeIHDR(){const A=this._png;A.width=this.readUint32(),A.height=this.readUint32(),A.depth=function(A){if(1!==A&&2!==A&&4!==A&&8!==A&&16!==A)throw new Error(`invalid bit depth: ${A}`);return A}(this.readUint8());const t=this.readUint8();let e;switch(this._colorType=t,t){case Kt:e=1;break;case Rt:e=3;break;case jt:e=1;break;case Gt:e=2;break;case Vt:e=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=e,this._compressionMethod=this.readUint8(),this._compressionMethod!==Wt)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const A={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(A)}decodePLTE(A){if(A%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${A}`);const t=A/3;this._hasPalette=!0;const e=[];this._palette=e;for(let A=0;A<t;A++)e.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(A){this._writingDataChunks=!0;const t=A,e=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodeFDAT(A){this._writingDataChunks=!0;let t=A,e=this.offset+this.byteOffset;if(e+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodetRNS(A){switch(this._colorType){case Kt:case Rt:if(A%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${A}`);if(A/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${A/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(A/2);for(let t=0;t<A/2;t++)this._transparency[t]=this.readUint16();break;case jt:{if(A>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${A} vs ${this._palette.length})`);let t=0;for(;t<A;t++){const A=this.readByte();this._palette[t].push(A)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(A){const t=Ot(this),e=this.readUint8();if(e!==Wt)throw new Error(`Unsupported iCCP compression method: ${e}`);const r=this.readBytes(A-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:ft(r)}}decodepHYs(){const A=this.readUint32(),t=this.readUint32(),e=this.readByte();this._png.resolution={x:A,y:t,unit:e}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let A=0;A<this._numberOfFrames;A++){const t={sequenceNumber:this._frames[A].sequenceNumber,delayNumber:this._frames[A].delayNumber,delayDenominator:this._frames[A].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},e=this._frames.at(A);if(e){if(e.data=Ht({data:e.data,width:e.width,height:e.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===A||0===e.xOffset&&0===e.yOffset&&e.width===this._png.width&&e.height===this._png.height)t.data=e.data;else{const r=this._apng.frames.at(A-1);this.disposeFrame(e,r,t),this.addFrameDataToCanvas(t,e)}this._apng.frames.push(t)}}return this._apng}disposeFrame(A,t,e){switch(A.disposeOp){case $t:break;case Ae:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const n=(t*A.width+r)*this._png.channels;for(let A=0;A<this._png.channels;A++)e.data[n+A]=0}break;case te:e.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(A,t){const e=1<<this._png.depth,r=(A,e)=>({index:((A+t.yOffset)*this._png.width+t.xOffset+e)*this._png.channels,frameIndex:(A*t.width+e)*this._png.channels});switch(t.blendOp){case ee:for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++){const{index:i,frameIndex:s}=r(e,n);for(let e=0;e<this._png.channels;e++)A.data[i+e]=t.data[s+e]}break;case re:for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const{index:s,frameIndex:o}=r(n,i);for(let r=0;r<this._png.channels;r++){const n=t.data[o+this._png.channels-1]/e,i=r%(this._png.channels-1)==0?1:t.data[o+r],a=Math.floor(n*i+(1-n)*A.data[s+r]);A.data[s+r]+=a}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const A=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==Jt)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Yt)this._png.data=Ht({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==Zt)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(A){const{data:t,width:e,height:r,channels:n,depth:i}=A,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],o=Math.ceil(i/8)*n,a=new Uint8Array(r*e*o);let c=0;for(let A=0;A<7;A++){const n=s[A],i=Math.ceil((e-n.x)/n.xStep),u=Math.ceil((r-n.y)/n.yStep);if(i<=0||u<=0)continue;const l=i*o,h=new Uint8Array(l);for(let A=0;A<u;A++){const s=t[c++],u=t.subarray(c,c+l);c+=l;const f=new Uint8Array(l);bt(s,u,f,h,l,o),h.set(f);for(let t=0;t<i;t++){const i=n.x+t*n.xStep,s=n.y+A*n.yStep;if(!(i>=e||s>=r))for(let A=0;A<o;A++)a[(s*e+i)*o+A]=f[t*o+A]}}}if(16===i){const A=new Uint16Array(a.buffer);if(Ut)for(let t=0;t<A.length;t++)A[t]=Lt(A[t]);return A}return a}({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const A=this._inflator.result,t=this._frames.at(-1);t?t.data=A:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:$t,blendOp:ee,data:A}),this._inflator=new ht,this._writingDataChunks=!1}}var ie;!function(A){A[A.UNKNOWN=0]="UNKNOWN",A[A.METRE=1]="METRE"}(ie||(ie={}));
|
|
1
|
+
import{_ as A,L as t,M as e,N as r,O as n}from"./main.js";function i(A,t){return t.forEach(function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach(function(e){if("default"!==e&&!(e in A)){var r=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(A,e,r.get?r:{enumerable:!0,get:function(){return t[e]}})}})}),Object.freeze(A)}function s(A){const{offsetWidth:t,offsetHeight:e}=A;return{width:t,height:e}}function o(A){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(A){return typeof A}:function(A){return A&&"function"==typeof Symbol&&A.constructor===Symbol&&A!==Symbol.prototype?"symbol":typeof A},o(A)}var a=Uint8Array,c=Uint16Array,u=Int32Array,l=new a([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]),h=new a([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]),f=new a([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),d=function(A,t){for(var e=new c(31),r=0;r<31;++r)e[r]=t+=1<<A[r-1];var n=new u(e[30]);for(r=1;r<30;++r)for(var i=e[r];i<e[r+1];++i)n[i]=i-e[r]<<5|r;return{b:e,r:n}},g=d(l,2),B=g.b,p=g.r;B[28]=258,p[258]=28;for(var w=d(h,0).r,m=new c(32768),C=0;C<32768;++C){var y=(43690&C)>>1|(21845&C)<<1;y=(61680&(y=(52428&y)>>2|(13107&y)<<2))>>4|(3855&y)<<4,m[C]=((65280&y)>>8|(255&y)<<8)>>1}var v=function(A,t,e){for(var r=A.length,n=0,i=new c(t);n<r;++n)A[n]&&++i[A[n]-1];var s,o=new c(t);for(n=1;n<t;++n)o[n]=o[n-1]+i[n-1]<<1;if(e){s=new c(1<<t);var a=15-t;for(n=0;n<r;++n)if(A[n])for(var u=n<<4|A[n],l=t-A[n],h=o[A[n]-1]++<<l,f=h|(1<<l)-1;h<=f;++h)s[m[h]>>a]=u}else for(s=new c(r),n=0;n<r;++n)A[n]&&(s[n]=m[o[A[n]-1]++]>>15-A[n]);return s},Q=new a(288);for(C=0;C<144;++C)Q[C]=8;for(C=144;C<256;++C)Q[C]=9;for(C=256;C<280;++C)Q[C]=7;for(C=280;C<288;++C)Q[C]=8;var b=new a(32);for(C=0;C<32;++C)b[C]=5;var F=v(Q,9,0),U=v(b,5,0),L=function(A){return(A+7)/8|0},E=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8},I=function(A,t,e){e<<=7&t;var r=t/8|0;A[r]|=e,A[r+1]|=e>>8,A[r+2]|=e>>16},x=function(A,t){for(var e=[],r=0;r<A.length;++r)A[r]&&e.push({s:r,f:A[r]});var n=e.length,i=e.slice();if(!n)return{t:D,l:0};if(1==n){var s=new a(e[0].s+1);return s[e[0].s]=1,{t:s,l:1}}e.sort(function(A,t){return A.f-t.f}),e.push({s:-1,f:25001});var o=e[0],u=e[1],l=0,h=1,f=2;for(e[0]={s:-1,f:o.f+u.f,l:o,r:u};h!=n-1;)o=e[e[l].f<e[f].f?l++:f++],u=e[l!=h&&e[l].f<e[f].f?l++:f++],e[h++]={s:-1,f:o.f+u.f,l:o,r:u};var d=i[0].s;for(r=1;r<n;++r)i[r].s>d&&(d=i[r].s);var g=new c(d+1),B=H(e[h-1],g,0);if(B>t){r=0;var p=0,w=B-t,m=1<<w;for(i.sort(function(A,t){return g[t.s]-g[A.s]||A.f-t.f});r<n;++r){var C=i[r].s;if(!(g[C]>t))break;p+=m-(1<<B-g[C]),g[C]=t}for(p>>=w;p>0;){var y=i[r].s;g[y]<t?p-=1<<t-g[y]++-1:++r}for(;r>=0&&p;--r){var v=i[r].s;g[v]==t&&(--g[v],++p)}B=t}return{t:new a(g),l:B}},H=function(A,t,e){return-1==A.s?Math.max(H(A.l,t,e+1),H(A.r,t,e+1)):t[A.s]=e},N=function(A){for(var t=A.length;t&&!A[--t];);for(var e=new c(++t),r=0,n=A[0],i=1,s=function(A){e[r++]=A},o=1;o<=t;++o)if(A[o]==n&&o!=t)++i;else{if(!n&&i>2){for(;i>138;i-=138)s(32754);i>2&&(s(i>10?i-11<<5|28690:i-3<<5|12305),i=0)}else if(i>3){for(s(n),--i;i>6;i-=6)s(8304);i>2&&(s(i-3<<5|8208),i=0)}for(;i--;)s(n);i=1,n=A[o]}return{c:e.subarray(0,r),n:t}},S=function(A,t){for(var e=0,r=0;r<t.length;++r)e+=A[r]*t[r];return e},_=function(A,t,e){var r=e.length,n=L(t+2);A[n]=255&r,A[n+1]=r>>8,A[n+2]=255^A[n],A[n+3]=255^A[n+1];for(var i=0;i<r;++i)A[n+i+4]=e[i];return 8*(n+4+r)},k=function(A,t,e,r,n,i,s,o,a,u,d){E(t,d++,e),++n[256];for(var g=x(n,15),B=g.t,p=g.l,w=x(i,15),m=w.t,C=w.l,y=N(B),L=y.c,H=y.n,k=N(m),P=k.c,D=k.n,M=new c(19),O=0;O<L.length;++O)++M[31&L[O]];for(O=0;O<P.length;++O)++M[31&P[O]];for(var T=x(M,7),K=T.t,R=T.l,j=19;j>4&&!K[f[j-1]];--j);var G,V,q,W,X=u+5<<3,J=S(n,Q)+S(i,b)+s,z=S(n,B)+S(i,m)+s+14+3*j+S(M,K)+2*M[16]+3*M[17]+7*M[18];if(a>=0&&X<=J&&X<=z)return _(t,d,A.subarray(a,a+u));if(E(t,d,1+(z<J)),d+=2,z<J){G=v(B,p,0),V=B,q=v(m,C,0),W=m;var Y=v(K,R,0);E(t,d,H-257),E(t,d+5,D-1),E(t,d+10,j-4),d+=14;for(O=0;O<j;++O)E(t,d+3*O,K[f[O]]);d+=3*j;for(var Z=[L,P],$=0;$<2;++$){var AA=Z[$];for(O=0;O<AA.length;++O){var tA=31&AA[O];E(t,d,Y[tA]),d+=K[tA],tA>15&&(E(t,d,AA[O]>>5&127),d+=AA[O]>>12)}}}else G=F,V=Q,q=U,W=b;for(O=0;O<o;++O){var eA=r[O];if(eA>255){I(t,d,G[(tA=eA>>18&31)+257]),d+=V[tA+257],tA>7&&(E(t,d,eA>>23&31),d+=l[tA]);var rA=31&eA;I(t,d,q[rA]),d+=W[rA],rA>3&&(I(t,d,eA>>5&8191),d+=h[rA])}else I(t,d,G[eA]),d+=V[eA]}return I(t,d,G[256]),d+V[256]},P=new u([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),D=new a(0),M=function(A,t,e,r,n,i){var s=i.z||A.length,o=new a(r+s+5*(1+Math.ceil(s/7e3))+n),f=o.subarray(r,o.length-n),d=i.l,g=7&(i.r||0);if(t){g&&(f[0]=i.r>>3);for(var B=P[t-1],m=B>>13,C=8191&B,y=(1<<e)-1,v=i.p||new c(32768),Q=i.h||new c(y+1),b=Math.ceil(e/3),F=2*b,U=function(t){return(A[t]^A[t+1]<<b^A[t+2]<<F)&y},E=new u(25e3),I=new c(288),x=new c(32),H=0,N=0,S=i.i||0,D=0,M=i.w||0,O=0;S+2<s;++S){var T=U(S),K=32767&S,R=Q[T];if(v[K]=R,Q[T]=K,M<=S){var j=s-S;if((H>7e3||D>24576)&&(j>423||!d)){g=k(A,f,0,E,I,x,N,D,O,S-O,g),D=H=N=0,O=S;for(var G=0;G<286;++G)I[G]=0;for(G=0;G<30;++G)x[G]=0}var V=2,q=0,W=C,X=K-R&32767;if(j>2&&T==U(S-X))for(var J=Math.min(m,j)-1,z=Math.min(32767,S),Y=Math.min(258,j);X<=z&&--W&&K!=R;){if(A[S+V]==A[S+V-X]){for(var Z=0;Z<Y&&A[S+Z]==A[S+Z-X];++Z);if(Z>V){if(V=Z,q=X,Z>J)break;var $=Math.min(X,Z-2),AA=0;for(G=0;G<$;++G){var tA=S-X+G&32767,eA=tA-v[tA]&32767;eA>AA&&(AA=eA,R=tA)}}}X+=(K=R)-(R=v[K])&32767}if(q){E[D++]=268435456|p[V]<<18|w[q];var rA=31&p[V],nA=31&w[q];N+=l[rA]+h[nA],++I[257+rA],++x[nA],M=S+V,++H}else E[D++]=A[S],++I[A[S]]}}for(S=Math.max(S,M);S<s;++S)E[D++]=A[S],++I[A[S]];g=k(A,f,d,E,I,x,N,D,O,S-O,g),d||(i.r=7&g|f[g/8|0]<<3,g-=7,i.h=Q,i.p=v,i.i=S,i.w=M)}else{for(S=i.w||0;S<s+d;S+=65535){var iA=S+65535;iA>=s&&(f[g/8|0]=d,iA=s),g=_(f,g+1,A.subarray(S,iA))}i.i=s}return function(A,t,e){return(null==e||e>A.length)&&(e=A.length),new a(A.subarray(t,e))}(o,0,r+L(g)+n)},O=function(){var A=1,t=0;return{p:function(e){for(var r=A,n=t,i=0|e.length,s=0;s!=i;){for(var o=Math.min(s+2655,i);s<o;++s)n+=r+=e[s];r=(65535&r)+15*(r>>16),n=(65535&n)+15*(n>>16)}A=r,t=n},d:function(){return(255&(A%=65521))<<24|(65280&A)<<8|(255&(t%=65521))<<8|t>>8}}},T=function(A,t,e){for(;e;++t)A[t]=e,e>>>=8};function K(A,t){t||(t={});var e=O();e.p(A);var r=function(A,t,e,r,n){if(!n&&(n={l:1},t.dictionary)){var i=t.dictionary.subarray(-32768),s=new a(i.length+A.length);s.set(i),s.set(A,i.length),A=s,n.w=i.length}return M(A,null==t.level?6:t.level,null==t.mem?n.l?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(A.length)))):20:12+t.mem,e,r,n)}(A,t,t.dictionary?6:2,4);return function(A,t){var e=t.level,r=0==e?0:e<6?1:9==e?3:2;if(A[0]=120,A[1]=r<<6|(t.dictionary&&32),A[1]|=31-(A[0]<<8|A[1])%31,t.dictionary){var n=O();n.p(t.dictionary),T(A,2,n.d())}}(r,t),T(r,r.length-4,e.d()),r}var R="undefined"!=typeof TextDecoder&&new TextDecoder;try{R.decode(D,{stream:!0})}catch(Lr){}function j(A,t){(null==t||t>A.length)&&(t=A.length);for(var e=0,r=Array(t);e<t;e++)r[e]=A[e];return r}function G(A,t){return function(A){if(Array.isArray(A))return A}(A)||function(A,t){var e=null==A?null:"undefined"!=typeof Symbol&&A[Symbol.iterator]||A["@@iterator"];if(null!=e){var r,n,i,s,o=[],a=!0,c=!1;try{if(i=(e=e.call(A)).next,0===t);else for(;!(a=(r=i.call(e)).done)&&(o.push(r.value),o.length!==t);a=!0);}catch(A){c=!0,n=A}finally{try{if(!a&&null!=e.return&&(s=e.return(),Object(s)!==s))return}finally{if(c)throw n}}return o}}(A,t)||function(A,t){if(A){if("string"==typeof A)return j(A,t);var e={}.toString.call(A).slice(8,-1);return"Object"===e&&A.constructor&&(e=A.constructor.name),"Map"===e||"Set"===e?Array.from(A):"Arguments"===e||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e)?j(A,t):void 0}}(A,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function V(A,t="utf8"){return new TextDecoder(t).decode(A)}const q=new TextEncoder;const W=(()=>{const A=new Uint8Array(4);return!((new Uint32Array(A.buffer)[0]=1)&A[0])})(),X={int8:globalThis.Int8Array,uint8:globalThis.Uint8Array,int16:globalThis.Int16Array,uint16:globalThis.Uint16Array,int32:globalThis.Int32Array,uint32:globalThis.Uint32Array,uint64:globalThis.BigUint64Array,int64:globalThis.BigInt64Array,float32:globalThis.Float32Array,float64:globalThis.Float64Array};class J{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(A=8192,t={}){let e=!1;"number"==typeof A?A=new ArrayBuffer(A):(e=!0,this.lastWrittenByte=A.byteLength);const r=t.offset?t.offset>>>0:0,n=A.byteLength-r;let i=r;(ArrayBuffer.isView(A)||A instanceof J)&&(A.byteLength!==A.buffer.byteLength&&(i=A.byteOffset+r),A=A.buffer),this.lastWrittenByte=e?n:0,this.buffer=A,this.length=n,this.byteLength=n,this.byteOffset=i,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,i,n),this._mark=0,this._marks=[]}available(A=1){return this.offset+A<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(A=1){return this.offset+=A,this}back(A=1){return this.offset-=A,this}seek(A){return this.offset=A,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){const A=this._marks.pop();if(void 0===A)throw new Error("Mark stack empty");return this.seek(A),this}rewind(){return this.offset=0,this}ensureAvailable(A=1){if(!this.available(A)){const t=2*(this.offset+A),e=new Uint8Array(t);e.set(new Uint8Array(this.buffer)),this.buffer=e.buffer,this.length=t,this.byteLength=t,this._data=new DataView(this.buffer)}return this}readBoolean(){return 0!==this.readUint8()}readInt8(){return this._data.getInt8(this.offset++)}readUint8(){return this._data.getUint8(this.offset++)}readByte(){return this.readUint8()}readBytes(A=1){return this.readArray(A,"uint8")}readArray(A,t){const e=X[t].BYTES_PER_ELEMENT*A,r=this.byteOffset+this.offset,n=this.buffer.slice(r,r+e);if(this.littleEndian===W&&"uint8"!==t&&"int8"!==t){const A=new Uint8Array(this.buffer.slice(r,r+e));A.reverse();const n=new X[t](A.buffer);return this.offset+=e,n.reverse(),n}const i=new X[t](n);return this.offset+=e,i}readInt16(){const A=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,A}readUint16(){const A=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,A}readInt32(){const A=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,A}readUint32(){const A=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,A}readFloat32(){const A=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,A}readFloat64(){const A=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,A}readBigInt64(){const A=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,A}readBigUint64(){const A=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,A}readChar(){return String.fromCharCode(this.readInt8())}readChars(A=1){let t="";for(let e=0;e<A;e++)t+=this.readChar();return t}readUtf8(A=1){return V(this.readBytes(A))}decodeText(A=1,t="utf8"){return V(this.readBytes(A),t)}writeBoolean(A){return this.writeUint8(A?255:0),this}writeInt8(A){return this.ensureAvailable(1),this._data.setInt8(this.offset++,A),this._updateLastWrittenByte(),this}writeUint8(A){return this.ensureAvailable(1),this._data.setUint8(this.offset++,A),this._updateLastWrittenByte(),this}writeByte(A){return this.writeUint8(A)}writeBytes(A){this.ensureAvailable(A.length);for(let t=0;t<A.length;t++)this._data.setUint8(this.offset++,A[t]);return this._updateLastWrittenByte(),this}writeInt16(A){return this.ensureAvailable(2),this._data.setInt16(this.offset,A,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(A){return this.ensureAvailable(2),this._data.setUint16(this.offset,A,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(A){return this.ensureAvailable(4),this._data.setInt32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(A){return this.ensureAvailable(4),this._data.setUint32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(A){return this.ensureAvailable(4),this._data.setFloat32(this.offset,A,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(A){return this.ensureAvailable(8),this._data.setFloat64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(A){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(A){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,A,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(A){return this.writeUint8(A.charCodeAt(0))}writeChars(A){for(let t=0;t<A.length;t++)this.writeUint8(A.charCodeAt(t));return this}writeUtf8(A){return this.writeBytes(function(A){return q.encode(A)}(A))}toArray(){return new Uint8Array(this.buffer,this.byteOffset,this.lastWrittenByte)}getWrittenByteLength(){return this.lastWrittenByte-this.byteOffset}_updateLastWrittenByte(){this.offset>this.lastWrittenByte&&(this.lastWrittenByte=this.offset)}}function z(A){let t=A.length;for(;--t>=0;)A[t]=0}z(new Array(576));z(new Array(60));z(new Array(512));z(new Array(256));z(new Array(29));z(new Array(30));var Y=(A,t,e,r)=>{let n=65535&A,i=A>>>16&65535,s=0;for(;0!==e;){s=e>2e3?2e3:e,e-=s;do{n=n+t[r++]|0,i=i+n|0}while(--s);n%=65521,i%=65521}return n|i<<16};const Z=new Uint32Array((()=>{let A,t=[];for(var e=0;e<256;e++){A=e;for(var r=0;r<8;r++)A=1&A?3988292384^A>>>1:A>>>1;t[e]=A}return t})());var $=(A,t,e,r)=>{const n=Z,i=r+e;A^=-1;for(let e=r;e<i;e++)A=A>>>8^n[255&(A^t[e])];return-1^A},AA={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},tA={Z_NO_FLUSH:0,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_DEFLATED:8};const eA=(A,t)=>Object.prototype.hasOwnProperty.call(A,t);var rA=function(A){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const e=t.shift();if(e){if("object"!=typeof e)throw new TypeError(e+"must be non-object");for(const t in e)eA(e,t)&&(A[t]=e[t])}}return A},nA=A=>{let t=0;for(let e=0,r=A.length;e<r;e++)t+=A[e].length;const e=new Uint8Array(t);for(let t=0,r=0,n=A.length;t<n;t++){let n=A[t];e.set(n,r),r+=n.length}return e};let iA=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(A){iA=!1}const sA=new Uint8Array(256);for(let A=0;A<256;A++)sA[A]=A>=252?6:A>=248?5:A>=240?4:A>=224?3:A>=192?2:1;sA[254]=sA[254]=1;var oA=A=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(A);let t,e,r,n,i,s=A.length,o=0;for(n=0;n<s;n++)e=A.charCodeAt(n),55296==(64512&e)&&n+1<s&&(r=A.charCodeAt(n+1),56320==(64512&r)&&(e=65536+(e-55296<<10)+(r-56320),n++)),o+=e<128?1:e<2048?2:e<65536?3:4;for(t=new Uint8Array(o),i=0,n=0;i<o;n++)e=A.charCodeAt(n),55296==(64512&e)&&n+1<s&&(r=A.charCodeAt(n+1),56320==(64512&r)&&(e=65536+(e-55296<<10)+(r-56320),n++)),e<128?t[i++]=e:e<2048?(t[i++]=192|e>>>6,t[i++]=128|63&e):e<65536?(t[i++]=224|e>>>12,t[i++]=128|e>>>6&63,t[i++]=128|63&e):(t[i++]=240|e>>>18,t[i++]=128|e>>>12&63,t[i++]=128|e>>>6&63,t[i++]=128|63&e);return t},aA=(A,t)=>{const e=t||A.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(A.subarray(0,t));let r,n;const i=new Array(2*e);for(n=0,r=0;r<e;){let t=A[r++];if(t<128){i[n++]=t;continue}let s=sA[t];if(s>4)i[n++]=65533,r+=s-1;else{for(t&=2===s?31:3===s?15:7;s>1&&r<e;)t=t<<6|63&A[r++],s--;s>1?i[n++]=65533:t<65536?i[n++]=t:(t-=65536,i[n++]=55296|t>>10&1023,i[n++]=56320|1023&t)}}return((A,t)=>{if(t<65534&&A.subarray&&iA)return String.fromCharCode.apply(null,A.length===t?A:A.subarray(0,t));let e="";for(let r=0;r<t;r++)e+=String.fromCharCode(A[r]);return e})(i,n)},cA=(A,t)=>{(t=t||A.length)>A.length&&(t=A.length);let e=t-1;for(;e>=0&&128==(192&A[e]);)e--;return e<0||0===e?t:e+sA[A[e]]>t?e:t};var uA=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const lA=16209;var hA=function(A,t){let e,r,n,i,s,o,a,c,u,l,h,f,d,g,B,p,w,m,C,y,v,Q,b,F;const U=A.state;e=A.next_in,b=A.input,r=e+(A.avail_in-5),n=A.next_out,F=A.output,i=n-(t-A.avail_out),s=n+(A.avail_out-257),o=U.dmax,a=U.wsize,c=U.whave,u=U.wnext,l=U.window,h=U.hold,f=U.bits,d=U.lencode,g=U.distcode,B=(1<<U.lenbits)-1,p=(1<<U.distbits)-1;A:do{f<15&&(h+=b[e++]<<f,f+=8,h+=b[e++]<<f,f+=8),w=d[h&B];t:for(;;){if(m=w>>>24,h>>>=m,f-=m,m=w>>>16&255,0===m)F[n++]=65535&w;else{if(!(16&m)){if(64&m){if(32&m){U.mode=16191;break A}A.msg="invalid literal/length code",U.mode=lA;break A}w=d[(65535&w)+(h&(1<<m)-1)];continue t}for(C=65535&w,m&=15,m&&(f<m&&(h+=b[e++]<<f,f+=8),C+=h&(1<<m)-1,h>>>=m,f-=m),f<15&&(h+=b[e++]<<f,f+=8,h+=b[e++]<<f,f+=8),w=g[h&p];;){if(m=w>>>24,h>>>=m,f-=m,m=w>>>16&255,16&m){if(y=65535&w,m&=15,f<m&&(h+=b[e++]<<f,f+=8,f<m&&(h+=b[e++]<<f,f+=8)),y+=h&(1<<m)-1,y>o){A.msg="invalid distance too far back",U.mode=lA;break A}if(h>>>=m,f-=m,m=n-i,y>m){if(m=y-m,m>c&&U.sane){A.msg="invalid distance too far back",U.mode=lA;break A}if(v=0,Q=l,0===u){if(v+=a-m,m<C){C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}}else if(u<m){if(v+=a+u-m,m-=u,m<C){C-=m;do{F[n++]=l[v++]}while(--m);if(v=0,u<C){m=u,C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}}}else if(v+=u-m,m<C){C-=m;do{F[n++]=l[v++]}while(--m);v=n-y,Q=F}for(;C>2;)F[n++]=Q[v++],F[n++]=Q[v++],F[n++]=Q[v++],C-=3;C&&(F[n++]=Q[v++],C>1&&(F[n++]=Q[v++]))}else{v=n-y;do{F[n++]=F[v++],F[n++]=F[v++],F[n++]=F[v++],C-=3}while(C>2);C&&(F[n++]=F[v++],C>1&&(F[n++]=F[v++]))}break}if(64&m){A.msg="invalid distance code",U.mode=lA;break A}w=g[(65535&w)+(h&(1<<m)-1)]}}break}}while(e<r&&n<s);C=f>>3,e-=C,f-=C<<3,h&=(1<<f)-1,A.next_in=e,A.next_out=n,A.avail_in=e<r?r-e+5:5-(e-r),A.avail_out=n<s?s-n+257:257-(n-s),U.hold=h,U.bits=f};const fA=15,dA=new Uint16Array([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,0,0]),gA=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),BA=new Uint16Array([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,0,0]),pA=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var wA=(A,t,e,r,n,i,s,o)=>{const a=o.bits;let c,u,l,h,f,d,g=0,B=0,p=0,w=0,m=0,C=0,y=0,v=0,Q=0,b=0,F=null;const U=new Uint16Array(16),L=new Uint16Array(16);let E,I,x,H=null;for(g=0;g<=fA;g++)U[g]=0;for(B=0;B<r;B++)U[t[e+B]]++;for(m=a,w=fA;w>=1&&0===U[w];w--);if(m>w&&(m=w),0===w)return n[i++]=20971520,n[i++]=20971520,o.bits=1,0;for(p=1;p<w&&0===U[p];p++);for(m<p&&(m=p),v=1,g=1;g<=fA;g++)if(v<<=1,v-=U[g],v<0)return-1;if(v>0&&(0===A||1!==w))return-1;for(L[1]=0,g=1;g<fA;g++)L[g+1]=L[g]+U[g];for(B=0;B<r;B++)0!==t[e+B]&&(s[L[t[e+B]]++]=B);if(0===A?(F=H=s,d=20):1===A?(F=dA,H=gA,d=257):(F=BA,H=pA,d=0),b=0,B=0,g=p,f=i,C=m,y=0,l=-1,Q=1<<m,h=Q-1,1===A&&Q>852||2===A&&Q>592)return 1;for(;;){E=g-y,s[B]+1<d?(I=0,x=s[B]):s[B]>=d?(I=H[s[B]-d],x=F[s[B]-d]):(I=96,x=0),c=1<<g-y,u=1<<C,p=u;do{u-=c,n[f+(b>>y)+u]=E<<24|I<<16|x}while(0!==u);for(c=1<<g-1;b&c;)c>>=1;if(0!==c?(b&=c-1,b+=c):b=0,B++,0===--U[g]){if(g===w)break;g=t[e+s[B]]}if(g>m&&(b&h)!==l){for(0===y&&(y=m),f+=p,C=g-y,v=1<<C;C+y<w&&(v-=U[C+y],!(v<=0));)C++,v<<=1;if(Q+=1<<C,1===A&&Q>852||2===A&&Q>592)return 1;l=b&h,n[l]=m<<24|C<<16|f-i}}return 0!==b&&(n[f+b]=g-y<<24|64<<16),o.bits=m,0};const{Z_FINISH:mA,Z_BLOCK:CA,Z_TREES:yA,Z_OK:vA,Z_STREAM_END:QA,Z_NEED_DICT:bA,Z_STREAM_ERROR:FA,Z_DATA_ERROR:UA,Z_MEM_ERROR:LA,Z_BUF_ERROR:EA,Z_DEFLATED:IA}=tA,xA=16180,HA=16190,NA=16191,SA=16192,_A=16194,kA=16199,PA=16200,DA=16206,MA=16209,OA=A=>(A>>>24&255)+(A>>>8&65280)+((65280&A)<<8)+((255&A)<<24);function TA(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const KA=A=>{if(!A)return 1;const t=A.state;return!t||t.strm!==A||t.mode<xA||t.mode>16211?1:0},RA=A=>{if(KA(A))return FA;const t=A.state;return A.total_in=A.total_out=t.total=0,A.msg="",t.wrap&&(A.adler=1&t.wrap),t.mode=xA,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,vA},jA=A=>{if(KA(A))return FA;const t=A.state;return t.wsize=0,t.whave=0,t.wnext=0,RA(A)},GA=(A,t)=>{let e;if(KA(A))return FA;const r=A.state;return t<0?(e=0,t=-t):(e=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?FA:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=e,r.wbits=t,jA(A))},VA=(A,t)=>{if(!A)return FA;const e=new TA;A.state=e,e.strm=A,e.window=null,e.mode=xA;const r=GA(A,t);return r!==vA&&(A.state=null),r};let qA,WA,XA=!0;const JA=A=>{if(XA){qA=new Int32Array(512),WA=new Int32Array(32);let t=0;for(;t<144;)A.lens[t++]=8;for(;t<256;)A.lens[t++]=9;for(;t<280;)A.lens[t++]=7;for(;t<288;)A.lens[t++]=8;for(wA(1,A.lens,0,288,qA,0,A.work,{bits:9}),t=0;t<32;)A.lens[t++]=5;wA(2,A.lens,0,32,WA,0,A.work,{bits:5}),XA=!1}A.lencode=qA,A.lenbits=9,A.distcode=WA,A.distbits=5},zA=(A,t,e,r)=>{let n;const i=A.state;return null===i.window&&(i.wsize=1<<i.wbits,i.wnext=0,i.whave=0,i.window=new Uint8Array(i.wsize)),r>=i.wsize?(i.window.set(t.subarray(e-i.wsize,e),0),i.wnext=0,i.whave=i.wsize):(n=i.wsize-i.wnext,n>r&&(n=r),i.window.set(t.subarray(e-r,e-r+n),i.wnext),(r-=n)?(i.window.set(t.subarray(e-r,e),0),i.wnext=r,i.whave=i.wsize):(i.wnext+=n,i.wnext===i.wsize&&(i.wnext=0),i.whave<i.wsize&&(i.whave+=n))),0};var YA={inflateReset:jA,inflateReset2:GA,inflateResetKeep:RA,inflateInit:A=>VA(A,15),inflateInit2:VA,inflate:(A,t)=>{let e,r,n,i,s,o,a,c,u,l,h,f,d,g,B,p,w,m,C,y,v,Q,b=0;const F=new Uint8Array(4);let U,L;const E=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(KA(A)||!A.output||!A.input&&0!==A.avail_in)return FA;e=A.state,e.mode===NA&&(e.mode=SA),s=A.next_out,n=A.output,a=A.avail_out,i=A.next_in,r=A.input,o=A.avail_in,c=e.hold,u=e.bits,l=o,h=a,Q=vA;A:for(;;)switch(e.mode){case xA:if(0===e.wrap){e.mode=SA;break}for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(2&e.wrap&&35615===c){0===e.wbits&&(e.wbits=15),e.check=0,F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0),c=0,u=0,e.mode=16181;break}if(e.head&&(e.head.done=!1),!(1&e.wrap)||(((255&c)<<8)+(c>>8))%31){A.msg="incorrect header check",e.mode=MA;break}if((15&c)!==IA){A.msg="unknown compression method",e.mode=MA;break}if(c>>>=4,u-=4,v=8+(15&c),0===e.wbits&&(e.wbits=v),v>15||v>e.wbits){A.msg="invalid window size",e.mode=MA;break}e.dmax=1<<e.wbits,e.flags=0,A.adler=e.check=1,e.mode=512&c?16189:NA,c=0,u=0;break;case 16181:for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(e.flags=c,(255&e.flags)!==IA){A.msg="unknown compression method",e.mode=MA;break}if(57344&e.flags){A.msg="unknown header flags set",e.mode=MA;break}e.head&&(e.head.text=c>>8&1),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0,e.mode=16182;case 16182:for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.head&&(e.head.time=c),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,F[2]=c>>>16&255,F[3]=c>>>24&255,e.check=$(e.check,F,4,0)),c=0,u=0,e.mode=16183;case 16183:for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.head&&(e.head.xflags=255&c,e.head.os=c>>8),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0,e.mode=16184;case 16184:if(1024&e.flags){for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.length=c,e.head&&(e.head.extra_len=c),512&e.flags&&4&e.wrap&&(F[0]=255&c,F[1]=c>>>8&255,e.check=$(e.check,F,2,0)),c=0,u=0}else e.head&&(e.head.extra=null);e.mode=16185;case 16185:if(1024&e.flags&&(f=e.length,f>o&&(f=o),f&&(e.head&&(v=e.head.extra_len-e.length,e.head.extra||(e.head.extra=new Uint8Array(e.head.extra_len)),e.head.extra.set(r.subarray(i,i+f),v)),512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,e.length-=f),e.length))break A;e.length=0,e.mode=16186;case 16186:if(2048&e.flags){if(0===o)break A;f=0;do{v=r[i+f++],e.head&&v&&e.length<65536&&(e.head.name+=String.fromCharCode(v))}while(v&&f<o);if(512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,v)break A}else e.head&&(e.head.name=null);e.length=0,e.mode=16187;case 16187:if(4096&e.flags){if(0===o)break A;f=0;do{v=r[i+f++],e.head&&v&&e.length<65536&&(e.head.comment+=String.fromCharCode(v))}while(v&&f<o);if(512&e.flags&&4&e.wrap&&(e.check=$(e.check,r,f,i)),o-=f,i+=f,v)break A}else e.head&&(e.head.comment=null);e.mode=16188;case 16188:if(512&e.flags){for(;u<16;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(4&e.wrap&&c!==(65535&e.check)){A.msg="header crc mismatch",e.mode=MA;break}c=0,u=0}e.head&&(e.head.hcrc=e.flags>>9&1,e.head.done=!0),A.adler=e.check=0,e.mode=NA;break;case 16189:for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}A.adler=e.check=OA(c),c=0,u=0,e.mode=HA;case HA:if(0===e.havedict)return A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,bA;A.adler=e.check=1,e.mode=NA;case NA:if(t===CA||t===yA)break A;case SA:if(e.last){c>>>=7&u,u-=7&u,e.mode=DA;break}for(;u<3;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}switch(e.last=1&c,c>>>=1,u-=1,3&c){case 0:e.mode=16193;break;case 1:if(JA(e),e.mode=kA,t===yA){c>>>=2,u-=2;break A}break;case 2:e.mode=16196;break;case 3:A.msg="invalid block type",e.mode=MA}c>>>=2,u-=2;break;case 16193:for(c>>>=7&u,u-=7&u;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){A.msg="invalid stored block lengths",e.mode=MA;break}if(e.length=65535&c,c=0,u=0,e.mode=_A,t===yA)break A;case _A:e.mode=16195;case 16195:if(f=e.length,f){if(f>o&&(f=o),f>a&&(f=a),0===f)break A;n.set(r.subarray(i,i+f),s),o-=f,i+=f,a-=f,s+=f,e.length-=f;break}e.mode=NA;break;case 16196:for(;u<14;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(e.nlen=257+(31&c),c>>>=5,u-=5,e.ndist=1+(31&c),c>>>=5,u-=5,e.ncode=4+(15&c),c>>>=4,u-=4,e.nlen>286||e.ndist>30){A.msg="too many length or distance symbols",e.mode=MA;break}e.have=0,e.mode=16197;case 16197:for(;e.have<e.ncode;){for(;u<3;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.lens[E[e.have++]]=7&c,c>>>=3,u-=3}for(;e.have<19;)e.lens[E[e.have++]]=0;if(e.lencode=e.lendyn,e.lenbits=7,U={bits:e.lenbits},Q=wA(0,e.lens,0,19,e.lencode,0,e.work,U),e.lenbits=U.bits,Q){A.msg="invalid code lengths set",e.mode=MA;break}e.have=0,e.mode=16198;case 16198:for(;e.have<e.nlen+e.ndist;){for(;b=e.lencode[c&(1<<e.lenbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(w<16)c>>>=B,u-=B,e.lens[e.have++]=w;else{if(16===w){for(L=B+2;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(c>>>=B,u-=B,0===e.have){A.msg="invalid bit length repeat",e.mode=MA;break}v=e.lens[e.have-1],f=3+(3&c),c>>>=2,u-=2}else if(17===w){for(L=B+3;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=B,u-=B,v=0,f=3+(7&c),c>>>=3,u-=3}else{for(L=B+7;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=B,u-=B,v=0,f=11+(127&c),c>>>=7,u-=7}if(e.have+f>e.nlen+e.ndist){A.msg="invalid bit length repeat",e.mode=MA;break}for(;f--;)e.lens[e.have++]=v}}if(e.mode===MA)break;if(0===e.lens[256]){A.msg="invalid code -- missing end-of-block",e.mode=MA;break}if(e.lenbits=9,U={bits:e.lenbits},Q=wA(1,e.lens,0,e.nlen,e.lencode,0,e.work,U),e.lenbits=U.bits,Q){A.msg="invalid literal/lengths set",e.mode=MA;break}if(e.distbits=6,e.distcode=e.distdyn,U={bits:e.distbits},Q=wA(2,e.lens,e.nlen,e.ndist,e.distcode,0,e.work,U),e.distbits=U.bits,Q){A.msg="invalid distances set",e.mode=MA;break}if(e.mode=kA,t===yA)break A;case kA:e.mode=PA;case PA:if(o>=6&&a>=258){A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,hA(A,h),s=A.next_out,n=A.output,a=A.avail_out,i=A.next_in,r=A.input,o=A.avail_in,c=e.hold,u=e.bits,e.mode===NA&&(e.back=-1);break}for(e.back=0;b=e.lencode[c&(1<<e.lenbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(p&&!(240&p)){for(m=B,C=p,y=w;b=e.lencode[y+((c&(1<<m+C)-1)>>m)],B=b>>>24,p=b>>>16&255,w=65535&b,!(m+B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,e.back+=m}if(c>>>=B,u-=B,e.back+=B,e.length=w,0===p){e.mode=16205;break}if(32&p){e.back=-1,e.mode=NA;break}if(64&p){A.msg="invalid literal/length code",e.mode=MA;break}e.extra=15&p,e.mode=16201;case 16201:if(e.extra){for(L=e.extra;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.length+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}e.was=e.length,e.mode=16202;case 16202:for(;b=e.distcode[c&(1<<e.distbits)-1],B=b>>>24,p=b>>>16&255,w=65535&b,!(B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(!(240&p)){for(m=B,C=p,y=w;b=e.distcode[y+((c&(1<<m+C)-1)>>m)],B=b>>>24,p=b>>>16&255,w=65535&b,!(m+B<=u);){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}c>>>=m,u-=m,e.back+=m}if(c>>>=B,u-=B,e.back+=B,64&p){A.msg="invalid distance code",e.mode=MA;break}e.offset=w,e.extra=15&p,e.mode=16203;case 16203:if(e.extra){for(L=e.extra;u<L;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}e.offset+=c&(1<<e.extra)-1,c>>>=e.extra,u-=e.extra,e.back+=e.extra}if(e.offset>e.dmax){A.msg="invalid distance too far back",e.mode=MA;break}e.mode=16204;case 16204:if(0===a)break A;if(f=h-a,e.offset>f){if(f=e.offset-f,f>e.whave&&e.sane){A.msg="invalid distance too far back",e.mode=MA;break}f>e.wnext?(f-=e.wnext,d=e.wsize-f):d=e.wnext-f,f>e.length&&(f=e.length),g=e.window}else g=n,d=s-e.offset,f=e.length;f>a&&(f=a),a-=f,e.length-=f;do{n[s++]=g[d++]}while(--f);0===e.length&&(e.mode=PA);break;case 16205:if(0===a)break A;n[s++]=e.length,a--,e.mode=PA;break;case DA:if(e.wrap){for(;u<32;){if(0===o)break A;o--,c|=r[i++]<<u,u+=8}if(h-=a,A.total_out+=h,e.total+=h,4&e.wrap&&h&&(A.adler=e.check=e.flags?$(e.check,n,h,s-h):Y(e.check,n,h,s-h)),h=a,4&e.wrap&&(e.flags?c:OA(c))!==e.check){A.msg="incorrect data check",e.mode=MA;break}c=0,u=0}e.mode=16207;case 16207:if(e.wrap&&e.flags){for(;u<32;){if(0===o)break A;o--,c+=r[i++]<<u,u+=8}if(4&e.wrap&&c!==(4294967295&e.total)){A.msg="incorrect length check",e.mode=MA;break}c=0,u=0}e.mode=16208;case 16208:Q=QA;break A;case MA:Q=UA;break A;case 16210:return LA;default:return FA}return A.next_out=s,A.avail_out=a,A.next_in=i,A.avail_in=o,e.hold=c,e.bits=u,(e.wsize||h!==A.avail_out&&e.mode<MA&&(e.mode<DA||t!==mA))&&zA(A,A.output,A.next_out,h-A.avail_out),l-=A.avail_in,h-=A.avail_out,A.total_in+=l,A.total_out+=h,e.total+=h,4&e.wrap&&h&&(A.adler=e.check=e.flags?$(e.check,n,h,A.next_out-h):Y(e.check,n,h,A.next_out-h)),A.data_type=e.bits+(e.last?64:0)+(e.mode===NA?128:0)+(e.mode===kA||e.mode===_A?256:0),(0===l&&0===h||t===mA)&&Q===vA&&(Q=EA),Q},inflateEnd:A=>{if(KA(A))return FA;let t=A.state;return t.window&&(t.window=null),A.state=null,vA},inflateGetHeader:(A,t)=>{if(KA(A))return FA;const e=A.state;return 2&e.wrap?(e.head=t,t.done=!1,vA):FA},inflateSetDictionary:(A,t)=>{const e=t.length;let r,n,i;return KA(A)?FA:(r=A.state,0!==r.wrap&&r.mode!==HA?FA:r.mode===HA&&(n=1,n=Y(n,t,e,0),n!==r.check)?UA:(i=zA(A,t,e,e),i?(r.mode=16210,LA):(r.havedict=1,vA)))},inflateInfo:"pako inflate (from Nodeca project)"};var ZA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const $A=Object.prototype.toString,{Z_NO_FLUSH:At,Z_FINISH:tt,Z_OK:et,Z_STREAM_END:rt,Z_NEED_DICT:nt,Z_STREAM_ERROR:it,Z_DATA_ERROR:st,Z_MEM_ERROR:ot}=tA;function at(A){this.options=rA({chunkSize:65536,windowBits:15,to:""},A||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||A&&A.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&(15&t.windowBits||(t.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new uA,this.strm.avail_out=0;let e=YA.inflateInit2(this.strm,t.windowBits);if(e!==et)throw new Error(AA[e]);if(this.header=new ZA,YA.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=oA(t.dictionary):"[object ArrayBuffer]"===$A.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(e=YA.inflateSetDictionary(this.strm,t.dictionary),e!==et)))throw new Error(AA[e])}at.prototype.push=function(A,t){const e=this.strm,r=this.options.chunkSize,n=this.options.dictionary;let i,s,o;if(this.ended)return!1;for(s=t===~~t?t:!0===t?tt:At,"[object ArrayBuffer]"===$A.call(A)?e.input=new Uint8Array(A):e.input=A,e.next_in=0,e.avail_in=e.input.length;;){for(0===e.avail_out&&(e.output=new Uint8Array(r),e.next_out=0,e.avail_out=r),i=YA.inflate(e,s),i===nt&&n&&(i=YA.inflateSetDictionary(e,n),i===et?i=YA.inflate(e,s):i===st&&(i=nt));e.avail_in>0&&i===rt&&e.state.wrap>0&&0!==A[e.next_in];)YA.inflateReset(e),i=YA.inflate(e,s);switch(i){case it:case st:case nt:case ot:return this.onEnd(i),this.ended=!0,!1}if(o=e.avail_out,e.next_out&&(0===e.avail_out||i===rt))if("string"===this.options.to){let A=cA(e.output,e.next_out),t=e.next_out-A,n=aA(e.output,A);e.next_out=t,e.avail_out=r-t,t&&e.output.set(e.output.subarray(A,A+t),0),this.onData(n)}else this.onData(e.output.length===e.next_out?e.output:e.output.subarray(0,e.next_out));if(i!==et||0!==o){if(i===rt)return i=YA.inflateEnd(this.strm),this.onEnd(i),this.ended=!0,!0;if(0===e.avail_in)break}}return!0},at.prototype.onData=function(A){this.chunks.push(A)},at.prototype.onEnd=function(A){A===et&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=nA(this.chunks)),this.chunks=[],this.err=A,this.msg=this.strm.msg};var ct={Inflate:at,inflate:function(A,t){const e=new at(t);if(e.push(A),e.err)throw e.msg||AA[e.err];return e.result}};const{Inflate:ut,inflate:lt}=ct;var ht=ut,ft=lt;const dt=[];for(let A=0;A<256;A++){let t=A;for(let A=0;A<8;A++)1&t?t=3988292384^t>>>1:t>>>=1;dt[A]=t}const gt=4294967295;function Bt(A,t){return(function(A,t,e){let r=A;for(let A=0;A<e;A++)r=dt[255&(r^t[A])]^r>>>8;return r}(gt,A,t)^gt)>>>0}function pt(A,t,e){const r=A.readUint32(),n=Bt(new Uint8Array(A.buffer,A.byteOffset+A.offset-t-4,t),t);if(n!==r)throw new Error(`CRC mismatch for chunk ${e}. Expected ${r}, found ${n}`)}function wt(A,t,e){for(let r=0;r<e;r++)t[r]=A[r]}function mt(A,t,e,r){let n=0;for(;n<r;n++)t[n]=A[n];for(;n<e;n++)t[n]=A[n]+t[n-r]&255}function Ct(A,t,e,r){let n=0;if(0===e.length)for(;n<r;n++)t[n]=A[n];else for(;n<r;n++)t[n]=A[n]+e[n]&255}function yt(A,t,e,r,n){let i=0;if(0===e.length){for(;i<n;i++)t[i]=A[i];for(;i<r;i++)t[i]=A[i]+(t[i-n]>>1)&255}else{for(;i<n;i++)t[i]=A[i]+(e[i]>>1)&255;for(;i<r;i++)t[i]=A[i]+(t[i-n]+e[i]>>1)&255}}function vt(A,t,e,r,n){let i=0;if(0===e.length){for(;i<n;i++)t[i]=A[i];for(;i<r;i++)t[i]=A[i]+t[i-n]&255}else{for(;i<n;i++)t[i]=A[i]+e[i]&255;for(;i<r;i++)t[i]=A[i]+Qt(t[i-n],e[i],e[i-n])&255}}function Qt(A,t,e){const r=A+t-e,n=Math.abs(r-A),i=Math.abs(r-t),s=Math.abs(r-e);return n<=i&&n<=s?A:i<=s?t:e}function bt(A,t,e,r,n,i){switch(A){case 0:wt(t,e,n);break;case 1:mt(t,e,n,i);break;case 2:Ct(t,e,r,n);break;case 3:yt(t,e,r,n,i);break;case 4:vt(t,e,r,n,i);break;default:throw new Error(`Unsupported filter: ${A}`)}}const Ft=new Uint16Array([255]),Ut=255===new Uint8Array(Ft.buffer)[0];function Lt(A){return(255&A)<<8|A>>8&255}const Et=new Uint16Array([255]),It=255===new Uint8Array(Et.buffer)[0],xt=new Uint8Array(0);function Ht(A){const{data:t,width:e,height:r,channels:n,depth:i}=A,s=Math.ceil(i/8)*n,o=Math.ceil(i/8*n*e),a=new Uint8Array(r*o);let c,u,l=xt,h=0;for(let A=0;A<r;A++){switch(c=t.subarray(h+1,h+1+o),u=a.subarray(A*o,(A+1)*o),t[h]){case 0:wt(c,u,o);break;case 1:mt(c,u,o,s);break;case 2:Ct(c,u,l,o);break;case 3:yt(c,u,l,o,s);break;case 4:vt(c,u,l,o,s);break;default:throw new Error(`Unsupported filter: ${t[h]}`)}l=u,h+=o+1}if(16===i){const A=new Uint16Array(a.buffer);if(It)for(let t=0;t<A.length;t++)A[t]=Nt(A[t]);return A}return a}function Nt(A){return(255&A)<<8|A>>8&255}const St=Uint8Array.of(137,80,78,71,13,10,26,10);function _t(A){if(!function(A){if(A.length<St.length)return!1;for(let t=0;t<St.length;t++)if(A[t]!==St[t])return!1;return!0}(A.readBytes(St.length)))throw new Error("wrong PNG signature")}const kt=new TextDecoder("latin1");function Pt(A){if(function(A){if(!Dt.test(A))throw new Error("invalid latin1 text")}(A),0===A.length||A.length>79)throw new Error("keyword length must be between 1 and 79")}const Dt=/^[\u0000-\u00FF]*$/;function Mt(A,t,e){const r=Ot(t);A[r]=function(A,t){return kt.decode(A.readBytes(t))}(t,e-r.length-1)}function Ot(A){for(A.mark();0!==A.readByte(););const t=A.offset;A.reset();const e=kt.decode(A.readBytes(t-A.offset-1));return A.skip(1),Pt(e),e}const Tt=-1,Kt=0,Rt=2,jt=3,Gt=4,Vt=6,qt=-1,Wt=0,Xt=-1,Jt=0,zt=-1,Yt=0,Zt=1,$t=0,Ae=1,te=2,ee=0,re=1;class ne extends J{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(A,t={}){super(A);const{checkCrc:e=!1}=t;this._checkCrc=e,this._inflator=new ht,this._png={width:-1,height:-1,channels:-1,data:new Uint8Array(0),depth:1,text:{}},this._apng={width:-1,height:-1,channels:-1,depth:1,numberOfFrames:1,numberOfPlays:0,text:{},frames:[]},this._end=!1,this._hasPalette=!1,this._palette=[],this._hasTransparency=!1,this._transparency=new Uint16Array(0),this._compressionMethod=qt,this._filterMethod=Xt,this._interlaceMethod=zt,this._colorType=Tt,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(_t(this);!this._end;){const A=this.readUint32(),t=this.readChars(4);this.decodeChunk(A,t)}return this.decodeImage(),this._png}decodeApng(){for(_t(this);!this._end;){const A=this.readUint32(),t=this.readChars(4);this.decodeApngChunk(A,t)}return this.decodeApngImage(),this._apng}decodeChunk(A,t){const e=this.offset;switch(t){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(A);break;case"IDAT":this.decodeIDAT(A);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(A);break;case"iCCP":this.decodeiCCP(A);break;case"tEXt":Mt(this._png.text,this,A);break;case"pHYs":this.decodepHYs();break;default:this.skip(A)}if(this.offset-e!==A)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?pt(this,A+4,t):this.skip(4)}decodeApngChunk(A,t){const e=this.offset;switch("fdAT"!==t&&"IDAT"!==t&&this._writingDataChunks&&this.pushDataToFrame(),t){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(A);break;default:this.decodeChunk(A,t),this.offset=e+A}if(this.offset-e!==A)throw new Error(`Length mismatch while decoding chunk ${t}`);this._checkCrc?pt(this,A+4,t):this.skip(4)}decodeIHDR(){const A=this._png;A.width=this.readUint32(),A.height=this.readUint32(),A.depth=function(A){if(1!==A&&2!==A&&4!==A&&8!==A&&16!==A)throw new Error(`invalid bit depth: ${A}`);return A}(this.readUint8());const t=this.readUint8();let e;switch(this._colorType=t,t){case Kt:e=1;break;case Rt:e=3;break;case jt:e=1;break;case Gt:e=2;break;case Vt:e=4;break;default:throw new Error(`Unknown color type: ${t}`)}if(this._png.channels=e,this._compressionMethod=this.readUint8(),this._compressionMethod!==Wt)throw new Error(`Unsupported compression method: ${this._compressionMethod}`);this._filterMethod=this.readUint8(),this._interlaceMethod=this.readUint8()}decodeACTL(){this._numberOfFrames=this.readUint32(),this._numberOfPlays=this.readUint32(),this._isAnimated=!0}decodeFCTL(){const A={sequenceNumber:this.readUint32(),width:this.readUint32(),height:this.readUint32(),xOffset:this.readUint32(),yOffset:this.readUint32(),delayNumber:this.readUint16(),delayDenominator:this.readUint16(),disposeOp:this.readUint8(),blendOp:this.readUint8(),data:new Uint8Array(0)};this._frames.push(A)}decodePLTE(A){if(A%3!=0)throw new RangeError(`PLTE field length must be a multiple of 3. Got ${A}`);const t=A/3;this._hasPalette=!0;const e=[];this._palette=e;for(let A=0;A<t;A++)e.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(A){this._writingDataChunks=!0;const t=A,e=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodeFDAT(A){this._writingDataChunks=!0;let t=A,e=this.offset+this.byteOffset;if(e+=4,t-=4,this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(A)}decodetRNS(A){switch(this._colorType){case Kt:case Rt:if(A%2!=0)throw new RangeError(`tRNS chunk length must be a multiple of 2. Got ${A}`);if(A/2>this._png.width*this._png.height)throw new Error(`tRNS chunk contains more alpha values than there are pixels (${A/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(A/2);for(let t=0;t<A/2;t++)this._transparency[t]=this.readUint16();break;case jt:{if(A>this._palette.length)throw new Error(`tRNS chunk contains more alpha values than there are palette colors (${A} vs ${this._palette.length})`);let t=0;for(;t<A;t++){const A=this.readByte();this._palette[t].push(A)}for(;t<this._palette.length;t++)this._palette[t].push(255);break}default:throw new Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(A){const t=Ot(this),e=this.readUint8();if(e!==Wt)throw new Error(`Unsupported iCCP compression method: ${e}`);const r=this.readBytes(A-t.length-2);this._png.iccEmbeddedProfile={name:t,profile:ft(r)}}decodepHYs(){const A=this.readUint32(),t=this.readUint32(),e=this.readByte();this._png.resolution={x:A,y:t,unit:e}}decodeApngImage(){this._apng.width=this._png.width,this._apng.height=this._png.height,this._apng.channels=this._png.channels,this._apng.depth=this._png.depth,this._apng.numberOfFrames=this._numberOfFrames,this._apng.numberOfPlays=this._numberOfPlays,this._apng.text=this._png.text,this._apng.resolution=this._png.resolution;for(let A=0;A<this._numberOfFrames;A++){const t={sequenceNumber:this._frames[A].sequenceNumber,delayNumber:this._frames[A].delayNumber,delayDenominator:this._frames[A].delayDenominator,data:8===this._apng.depth?new Uint8Array(this._apng.width*this._apng.height*this._apng.channels):new Uint16Array(this._apng.width*this._apng.height*this._apng.channels)},e=this._frames.at(A);if(e){if(e.data=Ht({data:e.data,width:e.width,height:e.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===A||0===e.xOffset&&0===e.yOffset&&e.width===this._png.width&&e.height===this._png.height)t.data=e.data;else{const r=this._apng.frames.at(A-1);this.disposeFrame(e,r,t),this.addFrameDataToCanvas(t,e)}this._apng.frames.push(t)}}return this._apng}disposeFrame(A,t,e){switch(A.disposeOp){case $t:break;case Ae:for(let t=0;t<this._png.height;t++)for(let r=0;r<this._png.width;r++){const n=(t*A.width+r)*this._png.channels;for(let A=0;A<this._png.channels;A++)e.data[n+A]=0}break;case te:e.data.set(t.data);break;default:throw new Error("Unknown disposeOp")}}addFrameDataToCanvas(A,t){const e=1<<this._png.depth,r=(A,e)=>({index:((A+t.yOffset)*this._png.width+t.xOffset+e)*this._png.channels,frameIndex:(A*t.width+e)*this._png.channels});switch(t.blendOp){case ee:for(let e=0;e<t.height;e++)for(let n=0;n<t.width;n++){const{index:i,frameIndex:s}=r(e,n);for(let e=0;e<this._png.channels;e++)A.data[i+e]=t.data[s+e]}break;case re:for(let n=0;n<t.height;n++)for(let i=0;i<t.width;i++){const{index:s,frameIndex:o}=r(n,i);for(let r=0;r<this._png.channels;r++){const n=t.data[o+this._png.channels-1]/e,i=r%(this._png.channels-1)==0?1:t.data[o+r],a=Math.floor(n*i+(1-n)*A.data[s+r]);A.data[s+r]+=a}}break;default:throw new Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw new Error(`Error while decompressing the data: ${this._inflator.err}`);const A=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(this._filterMethod!==Jt)throw new Error(`Filter method ${this._filterMethod} not supported`);if(this._interlaceMethod===Yt)this._png.data=Ht({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else{if(this._interlaceMethod!==Zt)throw new Error(`Interlace method ${this._interlaceMethod} not supported`);this._png.data=function(A){const{data:t,width:e,height:r,channels:n,depth:i}=A,s=[{x:0,y:0,xStep:8,yStep:8},{x:4,y:0,xStep:8,yStep:8},{x:0,y:4,xStep:4,yStep:8},{x:2,y:0,xStep:4,yStep:4},{x:0,y:2,xStep:2,yStep:4},{x:1,y:0,xStep:2,yStep:2},{x:0,y:1,xStep:1,yStep:2}],o=Math.ceil(i/8)*n,a=new Uint8Array(r*e*o);let c=0;for(let A=0;A<7;A++){const n=s[A],i=Math.ceil((e-n.x)/n.xStep),u=Math.ceil((r-n.y)/n.yStep);if(i<=0||u<=0)continue;const l=i*o,h=new Uint8Array(l);for(let A=0;A<u;A++){const s=t[c++],u=t.subarray(c,c+l);c+=l;const f=new Uint8Array(l);bt(s,u,f,h,l,o),h.set(f);for(let t=0;t<i;t++){const i=n.x+t*n.xStep,s=n.y+A*n.yStep;if(!(i>=e||s>=r))for(let A=0;A<o;A++)a[(s*e+i)*o+A]=f[t*o+A]}}}if(16===i){const A=new Uint16Array(a.buffer);if(Ut)for(let t=0;t<A.length;t++)A[t]=Lt(A[t]);return A}return a}({data:A,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth})}this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){const A=this._inflator.result,t=this._frames.at(-1);t?t.data=A:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:$t,blendOp:ee,data:A}),this._inflator=new ht,this._writingDataChunks=!1}}var ie;!function(A){A[A.UNKNOWN=0]="UNKNOWN",A[A.METRE=1]="METRE"}(ie||(ie={}));
|
|
2
2
|
/** @license
|
|
3
3
|
*
|
|
4
4
|
* jsPDF - PDF Document creation from JavaScript
|
|
@@ -260,7 +260,7 @@ function(A){A.processWEBP=function(t,e,r,n){var i=new ln(t),s=i.width,o=i.height
|
|
|
260
260
|
* Licensed under the MIT License.
|
|
261
261
|
* http://opensource.org/licenses/mit-license
|
|
262
262
|
*/
|
|
263
|
-
function(A){var t=function(A){for(var t=A.length,e=new Uint8Array(t),r=0;r<t;r++)e[r]=A.charCodeAt(r);return e};A.API.events.push(["addFont",function(e){var r=void 0,n=e.font,i=e.instance;if(!n.isStandardFont){if(void 0===i)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");if("string"!=typeof(r=!1===i.existsFileInVFS(n.postScriptName)?i.loadFile(n.postScriptName):i.getFileFromVFS(n.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");!function(e,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(de(r)),e.metadata=A.API.TTFFont.open(r),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}(n,r)}}])}(Oe),Oe.API.addSvgAsImage=function(A,t,e,r,n,i,s,o){if(isNaN(t)||isNaN(e))throw ae.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(n))throw ae.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var a=document.createElement("canvas");a.width=r,a.height=n;var c=a.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,a.width,a.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return(se.canvg?Promise.resolve(se.canvg):import("./index.es-C2GPR7m7.js")).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(t){return t.fromString(c,A,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(u)}).then(function(){l.addImage(a.toDataURL("image/jpeg",1),t,e,r,n,s,o)})},Oe.API.putTotalPages=function(A){var t,e=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(A,"g"),e=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(A,this.internal.getFont()),"g"),e=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var n=0;n<this.internal.pages[r].length;n++)this.internal.pages[r][n]=this.internal.pages[r][n].replace(t,e);return this},Oe.API.viewerPreferences=function(A,t){var e;A=A||{},t=t||!1;var r,n,i,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(s),c=[],u=0,l=0,h=0;function f(A,t){var e,r=!1;for(e=0;e<A.length;e+=1)A[e]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),e=this.internal.viewerpreferences.configuration,"reset"===A||!0===t){var d=a.length;for(h=0;h<d;h+=1)e[a[h]].value=e[a[h]].defaultValue,e[a[h]].explicitSet=!1}if("object"===o(A))for(n in A)if(i=A[n],f(a,n)&&void 0!==i){if("boolean"===e[n].type&&"boolean"==typeof i)e[n].value=i;else if("name"===e[n].type&&f(e[n].valueSet,i))e[n].value=i;else if("integer"===e[n].type&&Number.isInteger(i))e[n].value=i;else if("array"===e[n].type){for(u=0;u<i.length;u+=1)if(r=!0,1===i[u].length&&"number"==typeof i[u][0])c.push(String(i[u]-1));else if(i[u].length>1){for(l=0;l<i[u].length;l+=1)"number"!=typeof i[u][l]&&(r=!1);!0===r&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}e[n].value="["+c.join(" ")+"]"}else e[n].value=e[n].defaultValue;e[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var A,t=[];for(A in e)!0===e[A].explicitSet&&("name"===e[A].type?t.push("/"+A+" /"+e[A].value):t.push("/"+A+" "+e[A].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=e,this},Oe.API.addMetadata=function(A,t){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:A,namespaceUri:null!=t?t:"http://jspdf.default.namespaceuri/",rawXml:"boolean"==typeof t&&t},this.internal.events.subscribe("putCatalog",fn),this.internal.events.subscribe("postPutResources",hn)),this},function(A){var t=A.API,e=t.pdfEscape16=function(A,t){for(var e,r=t.metadata.Unicode.widths,n=["","0","00","000","0000"],i=[""],s=0,o=A.length;s<o;++s){if(e=t.metadata.characterToGlyph(A.charCodeAt(s)),t.metadata.glyIdsUsed.push(e),t.metadata.toUnicode[e]=A.charCodeAt(s),-1==r.indexOf(e)&&(r.push(e),r.push([parseInt(t.metadata.widthOfGlyph(e),10)])),"0"==e)return i.join("");e=e.toString(16),i.push(n[4-e.length],e)}return i.join("")},r=function(A){var t,e,r,n,i,s,o;for(i="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],s=0,o=(e=Object.keys(A).sort(function(A,t){return A-t})).length;s<o;s++)t=e[s],r.length>=100&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==A[t]&&null!==A[t]&&"function"==typeof A[t].toString&&(n=("0000"+A[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+n+">"));return r.length&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),i+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"Identity-H"===e.encoding){for(var o=e.metadata.Unicode.widths,a=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),c="",u=0;u<a.length;u++)c+=String.fromCharCode(a[u]);var l=i();s({data:c,addLength1:!0,objectId:l}),n("endobj");var h=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:h}),n("endobj");var f=i();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+Se(e.fontName)),n("/FontFile2 "+l+" 0 R"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/Flags "+e.metadata.flags),n("/StemV "+e.metadata.stemV),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n(">>"),n("endobj");var d=i();n("<<"),n("/Type /Font"),n("/BaseFont /"+Se(e.fontName)),n("/FontDescriptor "+f+" 0 R"),n("/W "+A.API.PDFObject.convert(o)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=i(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+Se(e.fontName)),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+d+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"WinAnsiEncoding"===e.encoding){for(var o=e.metadata.rawData,a="",c=0;c<o.length;c++)a+=String.fromCharCode(o[c]);var u=i();s({data:a,addLength1:!0,objectId:u}),n("endobj");var l=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:l}),n("endobj");var h=i();n("<<"),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n("/StemV "+e.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+u+" 0 R"),n("/Flags 96"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/FontName /"+Se(e.fontName)),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n(">>"),n("endobj"),e.objectNumber=i();for(var f=0;f<e.metadata.hmtx.widths.length;f++)e.metadata.hmtx.widths[f]=parseInt(e.metadata.hmtx.widths[f]*(1e3/e.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+Se(e.fontName)+"/FontDescriptor "+h+" 0 R/Encoding/"+e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+A.API.PDFObject.convert(e.metadata.hmtx.widths)+">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]);var n=function(A){var t,r=A.text||"",n=A.x,i=A.y,s=A.options||{},o=A.mutex||{},a=o.pdfEscape,c=o.activeFontKey,u=o.fonts,l=c,h="",f=0,d="",g=u[l].encoding;if("Identity-H"!==u[l].encoding)return{text:r,x:n,y:i,options:s,mutex:o};for(d=r,l=c,Array.isArray(r)&&(d=r[0]),f=0;f<d.length;f+=1)u[l].metadata.hasOwnProperty("cmap")&&(t=u[l].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]),t||d[f].charCodeAt(0)<256&&u[l].metadata.hasOwnProperty("Unicode")?h+=d[f]:h+="";var B="";return parseInt(l.slice(1))<14||"WinAnsiEncoding"===g?B=a(h,l).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):"Identity-H"===g&&(B=e(h,u[l])),o.isHex=!0,{text:B,x:n,y:i,options:s,mutex:o}};t.events.push(["postProcessText",function(A){var t=A.text||"",e=[],r={text:t,x:A.x,y:A.y,options:A.options,mutex:A.mutex};if(Array.isArray(t)){var i=0;for(i=0;i<t.length;i+=1)Array.isArray(t[i])&&3===t[i].length?e.push([n(Object.assign({},r,{text:t[i][0]})).text,t[i][1],t[i][2]]):e.push(n(Object.assign({},r,{text:t[i]})).text);A.text=e}else A.text=n(Object.assign({},r,{text:t})).text}])}(Oe),
|
|
263
|
+
function(A){var t=function(A){for(var t=A.length,e=new Uint8Array(t),r=0;r<t;r++)e[r]=A.charCodeAt(r);return e};A.API.events.push(["addFont",function(e){var r=void 0,n=e.font,i=e.instance;if(!n.isStandardFont){if(void 0===i)throw new Error("Font does not exist in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");if("string"!=typeof(r=!1===i.existsFileInVFS(n.postScriptName)?i.loadFile(n.postScriptName):i.getFileFromVFS(n.postScriptName)))throw new Error("Font is not stored as string-data in vFS, import fonts or remove declaration doc.addFont('"+n.postScriptName+"').");!function(e,r){r=/^\x00\x01\x00\x00/.test(r)?t(r):t(de(r)),e.metadata=A.API.TTFFont.open(r),e.metadata.Unicode=e.metadata.Unicode||{encoding:{},kerning:{},widths:[]},e.metadata.glyIdsUsed=[0]}(n,r)}}])}(Oe),Oe.API.addSvgAsImage=function(A,t,e,r,n,i,s,o){if(isNaN(t)||isNaN(e))throw ae.error("jsPDF.addSvgAsImage: Invalid coordinates",arguments),new Error("Invalid coordinates passed to jsPDF.addSvgAsImage");if(isNaN(r)||isNaN(n))throw ae.error("jsPDF.addSvgAsImage: Invalid measurements",arguments),new Error("Invalid measurements (width and/or height) passed to jsPDF.addSvgAsImage");var a=document.createElement("canvas");a.width=r,a.height=n;var c=a.getContext("2d");c.fillStyle="#fff",c.fillRect(0,0,a.width,a.height);var u={ignoreMouse:!0,ignoreAnimation:!0,ignoreDimensions:!0},l=this;return(se.canvg?Promise.resolve(se.canvg):import("./index.es-BmC2s_4v.js")).catch(function(A){return Promise.reject(new Error("Could not load canvg: "+A))}).then(function(A){return A.default?A.default:A}).then(function(t){return t.fromString(c,A,u)},function(){return Promise.reject(new Error("Could not load canvg."))}).then(function(A){return A.render(u)}).then(function(){l.addImage(a.toDataURL("image/jpeg",1),t,e,r,n,s,o)})},Oe.API.putTotalPages=function(A){var t,e=0;parseInt(this.internal.getFont().id.substr(1),10)<15?(t=new RegExp(A,"g"),e=this.internal.getNumberOfPages()):(t=new RegExp(this.pdfEscape16(A,this.internal.getFont()),"g"),e=this.pdfEscape16(this.internal.getNumberOfPages()+"",this.internal.getFont()));for(var r=1;r<=this.internal.getNumberOfPages();r++)for(var n=0;n<this.internal.pages[r].length;n++)this.internal.pages[r][n]=this.internal.pages[r][n].replace(t,e);return this},Oe.API.viewerPreferences=function(A,t){var e;A=A||{},t=t||!1;var r,n,i,s={HideToolbar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideMenubar:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},HideWindowUI:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},FitWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},CenterWindow:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.3},DisplayDocTitle:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.4},NonFullScreenPageMode:{defaultValue:"UseNone",value:"UseNone",type:"name",explicitSet:!1,valueSet:["UseNone","UseOutlines","UseThumbs","UseOC"],pdfVersion:1.3},Direction:{defaultValue:"L2R",value:"L2R",type:"name",explicitSet:!1,valueSet:["L2R","R2L"],pdfVersion:1.3},ViewArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},ViewClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintArea:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintClip:{defaultValue:"CropBox",value:"CropBox",type:"name",explicitSet:!1,valueSet:["MediaBox","CropBox","TrimBox","BleedBox","ArtBox"],pdfVersion:1.4},PrintScaling:{defaultValue:"AppDefault",value:"AppDefault",type:"name",explicitSet:!1,valueSet:["AppDefault","None"],pdfVersion:1.6},Duplex:{defaultValue:"",value:"none",type:"name",explicitSet:!1,valueSet:["Simplex","DuplexFlipShortEdge","DuplexFlipLongEdge","none"],pdfVersion:1.7},PickTrayByPDFSize:{defaultValue:!1,value:!1,type:"boolean",explicitSet:!1,valueSet:[!0,!1],pdfVersion:1.7},PrintPageRange:{defaultValue:"",value:"",type:"array",explicitSet:!1,valueSet:null,pdfVersion:1.7},NumCopies:{defaultValue:1,value:1,type:"integer",explicitSet:!1,valueSet:null,pdfVersion:1.7}},a=Object.keys(s),c=[],u=0,l=0,h=0;function f(A,t){var e,r=!1;for(e=0;e<A.length;e+=1)A[e]===t&&(r=!0);return r}if(void 0===this.internal.viewerpreferences&&(this.internal.viewerpreferences={},this.internal.viewerpreferences.configuration=JSON.parse(JSON.stringify(s)),this.internal.viewerpreferences.isSubscribed=!1),e=this.internal.viewerpreferences.configuration,"reset"===A||!0===t){var d=a.length;for(h=0;h<d;h+=1)e[a[h]].value=e[a[h]].defaultValue,e[a[h]].explicitSet=!1}if("object"===o(A))for(n in A)if(i=A[n],f(a,n)&&void 0!==i){if("boolean"===e[n].type&&"boolean"==typeof i)e[n].value=i;else if("name"===e[n].type&&f(e[n].valueSet,i))e[n].value=i;else if("integer"===e[n].type&&Number.isInteger(i))e[n].value=i;else if("array"===e[n].type){for(u=0;u<i.length;u+=1)if(r=!0,1===i[u].length&&"number"==typeof i[u][0])c.push(String(i[u]-1));else if(i[u].length>1){for(l=0;l<i[u].length;l+=1)"number"!=typeof i[u][l]&&(r=!1);!0===r&&c.push([i[u][0]-1,i[u][1]-1].join(" "))}e[n].value="["+c.join(" ")+"]"}else e[n].value=e[n].defaultValue;e[n].explicitSet=!0}return!1===this.internal.viewerpreferences.isSubscribed&&(this.internal.events.subscribe("putCatalog",function(){var A,t=[];for(A in e)!0===e[A].explicitSet&&("name"===e[A].type?t.push("/"+A+" /"+e[A].value):t.push("/"+A+" "+e[A].value));0!==t.length&&this.internal.write("/ViewerPreferences\n<<\n"+t.join("\n")+"\n>>")}),this.internal.viewerpreferences.isSubscribed=!0),this.internal.viewerpreferences.configuration=e,this},Oe.API.addMetadata=function(A,t){return void 0===this.internal.__metadata__&&(this.internal.__metadata__={metadata:A,namespaceUri:null!=t?t:"http://jspdf.default.namespaceuri/",rawXml:"boolean"==typeof t&&t},this.internal.events.subscribe("putCatalog",fn),this.internal.events.subscribe("postPutResources",hn)),this},function(A){var t=A.API,e=t.pdfEscape16=function(A,t){for(var e,r=t.metadata.Unicode.widths,n=["","0","00","000","0000"],i=[""],s=0,o=A.length;s<o;++s){if(e=t.metadata.characterToGlyph(A.charCodeAt(s)),t.metadata.glyIdsUsed.push(e),t.metadata.toUnicode[e]=A.charCodeAt(s),-1==r.indexOf(e)&&(r.push(e),r.push([parseInt(t.metadata.widthOfGlyph(e),10)])),"0"==e)return i.join("");e=e.toString(16),i.push(n[4-e.length],e)}return i.join("")},r=function(A){var t,e,r,n,i,s,o;for(i="/CIDInit /ProcSet findresource begin\n12 dict begin\nbegincmap\n/CIDSystemInfo <<\n /Registry (Adobe)\n /Ordering (UCS)\n /Supplement 0\n>> def\n/CMapName /Adobe-Identity-UCS def\n/CMapType 2 def\n1 begincodespacerange\n<0000><ffff>\nendcodespacerange",r=[],s=0,o=(e=Object.keys(A).sort(function(A,t){return A-t})).length;s<o;s++)t=e[s],r.length>=100&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar",r=[]),void 0!==A[t]&&null!==A[t]&&"function"==typeof A[t].toString&&(n=("0000"+A[t].toString(16)).slice(-4),t=("0000"+(+t).toString(16)).slice(-4),r.push("<"+t+"><"+n+">"));return r.length&&(i+="\n"+r.length+" beginbfchar\n"+r.join("\n")+"\nendbfchar\n"),i+"endcmap\nCMapName currentdict /CMap defineresource pop\nend\nend"};t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"Identity-H"===e.encoding){for(var o=e.metadata.Unicode.widths,a=e.metadata.subset.encode(e.metadata.glyIdsUsed,1),c="",u=0;u<a.length;u++)c+=String.fromCharCode(a[u]);var l=i();s({data:c,addLength1:!0,objectId:l}),n("endobj");var h=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:h}),n("endobj");var f=i();n("<<"),n("/Type /FontDescriptor"),n("/FontName /"+Se(e.fontName)),n("/FontFile2 "+l+" 0 R"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/Flags "+e.metadata.flags),n("/StemV "+e.metadata.stemV),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n(">>"),n("endobj");var d=i();n("<<"),n("/Type /Font"),n("/BaseFont /"+Se(e.fontName)),n("/FontDescriptor "+f+" 0 R"),n("/W "+A.API.PDFObject.convert(o)),n("/CIDToGIDMap /Identity"),n("/DW 1000"),n("/Subtype /CIDFontType2"),n("/CIDSystemInfo"),n("<<"),n("/Supplement 0"),n("/Registry (Adobe)"),n("/Ordering ("+e.encoding+")"),n(">>"),n(">>"),n("endobj"),e.objectNumber=i(),n("<<"),n("/Type /Font"),n("/Subtype /Type0"),n("/ToUnicode "+h+" 0 R"),n("/BaseFont /"+Se(e.fontName)),n("/Encoding /"+e.encoding),n("/DescendantFonts ["+d+" 0 R]"),n(">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]),t.events.push(["putFont",function(t){!function(t){var e=t.font,n=t.out,i=t.newObject,s=t.putStream;if(e.metadata instanceof A.API.TTFFont&&"WinAnsiEncoding"===e.encoding){for(var o=e.metadata.rawData,a="",c=0;c<o.length;c++)a+=String.fromCharCode(o[c]);var u=i();s({data:a,addLength1:!0,objectId:u}),n("endobj");var l=i();s({data:r(e.metadata.toUnicode),addLength1:!0,objectId:l}),n("endobj");var h=i();n("<<"),n("/Descent "+e.metadata.decender),n("/CapHeight "+e.metadata.capHeight),n("/StemV "+e.metadata.stemV),n("/Type /FontDescriptor"),n("/FontFile2 "+u+" 0 R"),n("/Flags 96"),n("/FontBBox "+A.API.PDFObject.convert(e.metadata.bbox)),n("/FontName /"+Se(e.fontName)),n("/ItalicAngle "+e.metadata.italicAngle),n("/Ascent "+e.metadata.ascender),n(">>"),n("endobj"),e.objectNumber=i();for(var f=0;f<e.metadata.hmtx.widths.length;f++)e.metadata.hmtx.widths[f]=parseInt(e.metadata.hmtx.widths[f]*(1e3/e.metadata.head.unitsPerEm));n("<</Subtype/TrueType/Type/Font/ToUnicode "+l+" 0 R/BaseFont/"+Se(e.fontName)+"/FontDescriptor "+h+" 0 R/Encoding/"+e.encoding+" /FirstChar 29 /LastChar 255 /Widths "+A.API.PDFObject.convert(e.metadata.hmtx.widths)+">>"),n("endobj"),e.isAlreadyPutted=!0}}(t)}]);var n=function(A){var t,r=A.text||"",n=A.x,i=A.y,s=A.options||{},o=A.mutex||{},a=o.pdfEscape,c=o.activeFontKey,u=o.fonts,l=c,h="",f=0,d="",g=u[l].encoding;if("Identity-H"!==u[l].encoding)return{text:r,x:n,y:i,options:s,mutex:o};for(d=r,l=c,Array.isArray(r)&&(d=r[0]),f=0;f<d.length;f+=1)u[l].metadata.hasOwnProperty("cmap")&&(t=u[l].metadata.cmap.unicode.codeMap[d[f].charCodeAt(0)]),t||d[f].charCodeAt(0)<256&&u[l].metadata.hasOwnProperty("Unicode")?h+=d[f]:h+="";var B="";return parseInt(l.slice(1))<14||"WinAnsiEncoding"===g?B=a(h,l).split("").map(function(A){return A.charCodeAt(0).toString(16)}).join(""):"Identity-H"===g&&(B=e(h,u[l])),o.isHex=!0,{text:B,x:n,y:i,options:s,mutex:o}};t.events.push(["postProcessText",function(A){var t=A.text||"",e=[],r={text:t,x:A.x,y:A.y,options:A.options,mutex:A.mutex};if(Array.isArray(t)){var i=0;for(i=0;i<t.length;i+=1)Array.isArray(t[i])&&3===t[i].length?e.push([n(Object.assign({},r,{text:t[i][0]})).text,t[i][1],t[i][2]]):e.push(n(Object.assign({},r,{text:t[i]})).text);A.text=e}else A.text=n(Object.assign({},r,{text:t})).text}])}(Oe),
|
|
264
264
|
/**
|
|
265
265
|
* @license
|
|
266
266
|
* jsPDF virtual FileSystem functionality
|
package/dist/{ensureNotRevoked-BWp1jPEo-DSQMtjrj.js → ensureNotRevoked-DrQAPfcJ-BheL-ZKZ.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{G as e,V as a,
|
|
1
|
+
import{G as e,V as a,z as t,d as n}from"./main.js";function i(i,o){if(!i||!o)return;Array.isArray(o)||(o=[o]),o=o.filter(e=>null!=e);const r=e(o,i.map(e=>e.id));if(r.length>0){const e=i.findIndex(e=>e.id===r[0]);if(e>-1)throw new a(t.checkRevokedStatus,n.certificates.generateRevocationReason(i[e].revocationReason))}}export{i as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t,V as e,g as s,P as n}from"./main.js";function i(t,e,s=""){const n=(i=t)instanceof Uint8Array||ArrayBuffer.isView(i)&&"Uint8Array"===i.constructor.name&&"BYTES_PER_ELEMENT"in i&&1===i.BYTES_PER_ELEMENT;var i;const r=t?.length;if(!n||void 0!==e){const e=(s&&`"${s}" `)+"expected Uint8Array"+""+", got "+(n?`length=${r}`:"type="+typeof t);if(!n)throw new TypeError(e);throw new RangeError(e)}return t}function r(t,e=!0){if(t.destroyed)throw new Error("Hash instance has been destroyed");if(e&&t.finished)throw new Error("Hash#digest() has already been called")}function o(...t){for(let e=0;e<t.length;e++)t[e].fill(0)}function h(t){return new DataView(t.buffer,t.byteOffset,t.byteLength)}function c(t,e){return t<<32-e|t>>>e}function u(t,e={}){const s=(e,s)=>t(s).update(e).digest(),n=t(void 0);return s.outputLen=n.outputLen,s.blockLen=n.blockLen,s.canXOF=n.canXOF,s.create=e=>t(e),Object.assign(s,e),Object.freeze(s)}const f=t=>({oid:Uint8Array.from([6,9,96,134,72,1,101,3,4,2,t])});function a(t,e,s){return t&e^~t&s}function d(t,e,s){return t&e^t&s^e&s}class l{blockLen;outputLen;canXOF=!1;padOffset;isLE;buffer;view;finished=!1;length=0;pos=0;destroyed=!1;constructor(t,e,s,n){this.blockLen=t,this.outputLen=e,this.padOffset=s,this.isLE=n,this.buffer=new Uint8Array(t),this.view=h(this.buffer)}update(t){r(this),i(t);const{view:e,buffer:s,blockLen:n}=this,o=t.length;for(let i=0;i<o;){const r=Math.min(n-this.pos,o-i);if(r===n){const e=h(t);for(;n<=o-i;i+=n)this.process(e,i);continue}s.set(t.subarray(i,i+r),this.pos),this.pos+=r,i+=r,this.pos===n&&(this.process(e,0),this.pos=0)}return this.length+=t.length,this.roundClean(),this}digestInto(t){r(this),function(t,e){i(t,void 0,"digestInto() output");const s=e.outputLen;if(t.length<s)throw new RangeError('"digestInto() output" expected to be of length >='+s)}(t,this),this.finished=!0;const{buffer:e,view:s,blockLen:n,isLE:c}=this;let{pos:u}=this;e[u++]=128,o(this.buffer.subarray(u)),this.padOffset>n-u&&(this.process(s,0),u=0);for(let t=u;t<n;t++)e[t]=0;s.setBigUint64(n-8,BigInt(8*this.length),c),this.process(s,0);const f=h(t),a=this.outputLen;if(a%4)throw new Error("_sha2: outputLen must be aligned to 32bit");const d=a/4,l=this.get();if(d>l.length)throw new Error("_sha2: outputLen bigger than state");for(let t=0;t<d;t++)f.setUint32(4*t,l[t],c)}digest(){const{buffer:t,outputLen:e}=this;this.digestInto(t);const s=t.slice(0,e);return this.destroy(),s}_cloneInto(t){t||=new this.constructor,t.set(...this.get());const{blockLen:e,buffer:s,length:n,finished:i,destroyed:r,pos:o}=this;return t.destroyed=r,t.finished=i,t.length=n,t.pos=o,n%e&&t.buffer.set(s),t}clone(){return this._cloneInto()}}const p=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),g=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),b=new Uint32Array(64);class w extends l{constructor(t){super(64,t,8,!1)}get(){const{A:t,B:e,C:s,D:n,E:i,F:r,G:o,H:h}=this;return[t,e,s,n,i,r,o,h]}set(t,e,s,n,i,r,o,h){this.A=0|t,this.B=0|e,this.C=0|s,this.D=0|n,this.E=0|i,this.F=0|r,this.G=0|o,this.H=0|h}process(t,e){for(let s=0;s<16;s++,e+=4)b[s]=t.getUint32(e,!1);for(let t=16;t<64;t++){const e=b[t-15],s=b[t-2],n=c(e,7)^c(e,18)^e>>>3,i=c(s,17)^c(s,19)^s>>>10;b[t]=i+b[t-7]+n+b[t-16]|0}let{A:s,B:n,C:i,D:r,E:o,F:h,G:u,H:f}=this;for(let t=0;t<64;t++){const e=f+(c(o,6)^c(o,11)^c(o,25))+a(o,h,u)+g[t]+b[t]|0,l=(c(s,2)^c(s,13)^c(s,22))+d(s,n,i)|0;f=u,u=h,h=o,o=r+e|0,r=i,i=n,n=s,s=e+l|0}s=s+this.A|0,n=n+this.B|0,i=i+this.C|0,r=r+this.D|0,o=o+this.E|0,h=h+this.F|0,u=u+this.G|0,f=f+this.H|0,this.set(s,n,i,r,o,h,u,f)}roundClean(){o(b)}destroy(){this.destroyed=!0,this.set(0,0,0,0,0,0,0,0),o(this.buffer)}}class y extends w{A=0|p[0];B=0|p[1];C=0|p[2];D=0|p[3];E=0|p[4];F=0|p[5];G=0|p[6];H=0|p[7];constructor(){super(32)}}const E=u(()=>new y,f(1));function L(i,r,o){let h="";const c=function(t,e){let s=null;for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&n.toLowerCase()===e.toLowerCase()&&(s=n);return t[s]}(i,r),u=t(o);if(c?(c.created&&u<=c.created&&(h="invalidIssuingAddressCreationTime"),c.revoked&&u>=c.revoked&&(h="invalidIssuingAddressRevoked"),c.expires&&u>=c.expires&&(h="invalidIssuingAddressExpired")):h="invalidIssuingAddressUnknown",h)throw new e("checkAuthenticity",s("errors",h),n.CRYPTOGRAPHIC_SECURITY_ERROR)}export{L as e,E as s};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{B as t,n as e,v as s}from"./index-D2bS6rRi-D_ppNIsb.js";import"./main.js";import"./jsonld-signatures-BJXipuab-CB799Kkm.js";import"./jsonld-DOUjwF6J-dtl20tiV.js";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
|
|
4
|
+
*/class r{constructor({length:e,buffer:s}={}){this.bitstring=new t({length:e,buffer:s}),this.length=this.bitstring.length}setStatus(t,e){if("boolean"!=typeof e)throw new TypeError('"status" must be a boolean.');return this.bitstring.set(t,e)}getStatus(t){return this.bitstring.get(t)}async encode(){return"u"+await this.bitstring.encodeBits()}static async decode({encodedList:e}){try{if("u"!==e[0])throw'"encodedList" must start with the character "u".';const s=await t.decodeBits({encoded:e.slice(1)});return new r({buffer:s})}catch(t){if(t instanceof Error)throw t;throw new Error(`Could not decode encoded status list; reason: ${t}`)}}}
|
|
5
|
+
/*!
|
|
6
|
+
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
|
|
7
|
+
*/
|
|
8
|
+
/*!
|
|
9
|
+
* Copyright (c) 2024 Digital Bazaar, Inc. All rights reserved.
|
|
10
|
+
*/
|
|
11
|
+
const i="https://www.w3.org/ns/credentials/status/v1",n=0;(new Map).set(i,{"@context":{"@protected":!0,id:"@id",type:"@type",BitstringStatusListCredential:"https://www.w3.org/ns/credentials/status#BitstringStatusListCredential",BitstringStatusList:{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusList","@context":{"@protected":!0,id:"@id",type:"@type",encodedList:{"@id":"https://www.w3.org/ns/credentials/status#encodedList","@type":"https://w3id.org/security#multibase"},statusPurpose:"https://www.w3.org/ns/credentials/status#statusPurpose",ttl:"https://www.w3.org/ns/credentials/status#ttl"}},BitstringStatusListEntry:{"@id":"https://www.w3.org/ns/credentials/status#BitstringStatusListEntry","@context":{"@protected":!0,id:"@id",type:"@type",statusListCredential:{"@id":"https://www.w3.org/ns/credentials/status#statusListCredential","@type":"@id"},statusListIndex:"https://www.w3.org/ns/credentials/status#statusListIndex",statusPurpose:"https://www.w3.org/ns/credentials/status#statusPurpose",statusMessage:{"@id":"https://www.w3.org/ns/credentials/status#statusMessage","@context":{"@protected":!0,id:"@id",type:"@type",message:"https://www.w3.org/ns/credentials/status#message",status:"https://www.w3.org/ns/credentials/status#status"}},statusReference:{"@id":"https://www.w3.org/ns/credentials/status#statusReference","@type":"@id"},statusSize:{"@id":"https://www.w3.org/ns/credentials/status#statusSize","@type":"https://www.w3.org/2001/XMLSchema#integer"}}}}});(new Map).set(i,n);const a=i,o=e.get("v1").id,u=e.get("v2").id,d=[o,a],c=[u];
|
|
12
|
+
/*!
|
|
13
|
+
* Copyright (c) 2022-2024 Digital Bazaar, Inc. All rights reserved.
|
|
14
|
+
*/async function w({length:t}){return new r({length:t})}async function l({encodedList:t}){return r.decode({encodedList:t})}async function p({id:t,list:e,statusPurpose:s,context:r}){if(!t||"string"!=typeof t)throw new TypeError('"id" is required.');if(!e||"function"!=typeof e.encode)throw new TypeError('"list" is required.');if(!s||"string"!=typeof s)throw new TypeError('"statusPurpose" is required.');if(r){if(!r.every((t,e)=>t===d[e])&&!r.every((t,e)=>t===c[e]))throw new TypeError(`"context" must be either "${d}" or "${c}".`)}else r=[...c];return{"@context":r,id:t,type:["VerifiableCredential","BitstringStatusListCredential"],credentialSubject:{id:`${t}#list`,type:"BitstringStatusList",encodedList:await e.encode(),statusPurpose:s}}}async function f({credential:t,documentLoader:e,suite:r,verifyBitstringStatusListCredential:i=!0,verifyMatchingIssuers:n=!0}={}){let a;try{a=await async function({credential:t,documentLoader:e,suite:r,verifyBitstringStatusListCredential:i,verifyMatchingIssuers:n}){if(L({credential:t}),"function"!=typeof e)throw new TypeError('"documentLoader" must be a function.');if(i&&!(r&&(a=r,Array.isArray(a)&&a.length>0&&a.every(t=>t&&"object"==typeof t)||!Array.isArray(r)&&"object"==typeof r)))throw new TypeError('"suite" must be an object or an array of objects.');var a;const o=b({credential:t});if(0===o.length)throw new Error('"credentialStatus.type" must be "BitstringStatusListEntry".');o.forEach(t=>S({credentialStatus:t}));const u=await Promise.all(o.map(a=>async function({credential:t,credentialStatus:e,verifyBitstringStatusListCredential:r,verifyMatchingIssuers:i,suite:n,documentLoader:a}){const{statusListIndex:o}=e,u=parseInt(o,10);let d;try{({document:d}=await a(e.statusListCredential))}catch(t){const e=new Error(`Could not load "BitstringStatusListCredential"; reason: ${t.message}`);throw e.cause=t,e}const{statusPurpose:c}=e,{statusPurpose:w}=d.credentialSubject;if(w!==c)throw new Error(`The status purpose "${w}" of the status list credential does not match the status purpose "${c}" in the credential.`);if(r){const t=await s({credential:d,suite:n,documentLoader:a});if(!t.verified){const{error:e}=t;let s='"BitstringStatusListCredential" not verified';s+=e?`; reason: ${e.message}`:".";const r=new Error(s);throw e&&(r.cause=t.error),r}}if(i){const e="object"==typeof t.issuer?t.issuer.id:t.issuer,s="object"==typeof d.issuer?d.issuer.id:d.issuer;if(!e||!s||e!==s)throw new Error("Issuers of the status list credential and verifiable credential do not match.")}if(!d.type.includes("BitstringStatusListCredential"))throw new Error('Status list credential type must include "BitstringStatusListCredential".');const{credentialSubject:p}=d;if("BitstringStatusList"!==p.type)throw new Error('Status list type must be "BitstringStatusList".');const{encodedList:f}=p,y=(await l({encodedList:f})).getStatus(u);return{verified:!0,credentialStatus:e,status:y}}({credential:t,credentialStatus:a,suite:r,documentLoader:e,verifyBitstringStatusListCredential:i,verifyMatchingIssuers:n})));return{verified:u.every(({verified:t=!1}={})=>!0===t),results:u}}({credential:t,documentLoader:e,suite:r,verifyBitstringStatusListCredential:i,verifyMatchingIssuers:n})}catch(t){a={verified:!1,error:t}}return a}function y({credential:t}={}){L({credential:t});const{"@context":e}=t;if(!Array.isArray(e))throw new TypeError('"@context" must be an array.');const s=e[0]===u;if(!s&&e[0]!==o)throw new TypeError(`The first "@context" value must be "${o}" or "${u}".`);const{credentialStatus:r}=t;if(!r)return!1;if("object"!=typeof r)throw new Error('"credentialStatus" is invalid.');if(!s&&!e.includes(a))return!1;return b({credential:t}).length>0}function h({credential:t}={}){L({credential:t});const{"@context":e}=t;if(!Array.isArray(e))throw new TypeError('"@context" must be an array.');if(e[0]!==u){if(e[0]!==o)throw new TypeError(`The first "@context" value must be "${o}".`);if(!e.includes(a))throw new TypeError(`"@context" must include "${a}".`)}}function g({credential:t,statusPurpose:e}={}){if(L({credential:t}),h({credential:t}),!e||"string"!=typeof e)throw new TypeError('"statusPurpose" must be a string.');if(!t.credentialStatus||"object"!=typeof t.credentialStatus)throw new Error('"credentialStatus" is missing or invalid.');const s=b({credential:t});if(0===s.length)throw new Error(`"credentialStatus" with type "BitstringStatusListEntry" and status purpose "${e}" not found.`);const r=s.filter(t=>S({credentialStatus:t})).find(t=>t.statusPurpose===e);if(!r)throw new Error(`"credentialStatus" with type "BitstringStatusListEntry" and status purpose "${e}" not found.`);return r}function S({credentialStatus:t}){if("BitstringStatusListEntry"!==t.type)throw new Error('"credentialStatus.type" must be "BitstringStatusListEntry".');if("string"!=typeof t.statusPurpose)throw new TypeError('"credentialStatus.statusPurpose" must be a string.');if(t.id&&"string"!=typeof t.id)throw new TypeError('"credentialStatus.id" must be a string.');if("string"!=typeof t.statusListCredential)throw new TypeError('"credentialStatus.statusListCredential" must be a string.');const e=parseInt(t.statusListIndex,10);if(isNaN(e))throw new TypeError('"statusListIndex" must be an integer.');if(t.id===t.statusListCredential)throw new Error('"credentialStatus.id" must not be "credentialStatus.statusListCredential".');return t}function L({credential:t}){if(!t||"object"!=typeof t)throw new TypeError('"credential" must be an object.')}function b({credential:t}){const{credentialStatus:e}=t;return Array.isArray(e)?e.filter(t=>"BitstringStatusListEntry"===t.type):e&&"BitstringStatusListEntry"===e.type?[e]:[]}export{r as BitstringStatusList,d as VC_BSL_VC_V1_CONTEXT,c as VC_BSL_VC_V2_CONTEXT,h as assertBitstringStatusListContext,f as checkStatus,p as createCredential,w as createList,l as decodeList,g as getCredentialStatus,y as statusTypeMatches};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{v as e,w as t,u as r,f as n}from"./main.js";import{n as i}from"./_polyfill-node.crypto-MVmI5M_M-exGcp6nW.js";
|
|
2
2
|
/*! noble-ed25519 - MIT License (c) 2019 Paul Miller (paulmillr.com) */const o=BigInt(0),s=BigInt(1),c=BigInt(2),a=BigInt(8),f=BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),u=Object.freeze({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),P:BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),l:f,n:f,h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960")}),l=BigInt("0x10000000000000000000000000000000000000000000000000000000000000000"),y=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt("6853475219497561581579357271197624642482790079785650197046958215289687604742");const d=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),w=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),p=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),h=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952");class b{constructor(e,t,r,n){this.x=e,this.y=t,this.z=r,this.t=n}static fromAffine(e){if(!(e instanceof k))throw new TypeError("ExtendedPoint#fromAffine: expected Point");return e.equals(k.ZERO)?b.ZERO:new b(e.x,e.y,s,j(e.x*e.y))}static toAffineBatch(e){const t=function(e,t=u.P){const r=new Array(e.length),n=_(e.reduce((e,n,i)=>n===o?e:(r[i]=e,j(e*n,t)),s),t);return e.reduceRight((e,n,i)=>n===o?e:(r[i]=j(e*r[i],t),j(e*n,t)),n),r}(e.map(e=>e.z));return e.map((e,r)=>e.toAffine(t[r]))}static normalizeZ(e){return this.toAffineBatch(e).map(this.fromAffine)}equals(e){m(e);const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e,c=j(t*s),a=j(i*n),f=j(r*s),u=j(o*n);return c===a&&f===u}negate(){return new b(j(-this.x),this.y,this.z,j(-this.t))}double(){const{x:e,y:t,z:r}=this,{a:n}=u,i=j(e*e),o=j(t*t),s=j(c*j(r*r)),a=j(n*i),f=e+t,l=j(j(f*f)-i-o),y=a+o,d=y-s,w=a-o,p=j(l*d),h=j(y*w),g=j(l*w),m=j(d*y);return new b(p,h,m,g)}add(e){m(e);const{x:t,y:r,z:n,t:i}=this,{x:s,y:a,z:f,t:u}=e,l=j((r-t)*(a+s)),y=j((r+t)*(a-s)),d=j(y-l);if(d===o)return this.double();const w=j(n*c*u),p=j(i*c*f),h=p+w,g=y+l,x=p-w,E=j(h*d),K=j(g*x),B=j(h*x),k=j(d*g);return new b(E,K,k,B)}subtract(e){return this.add(e.negate())}precomputeWindow(e){const t=1+256/e,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(b.BASE)&&(t=k.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&B.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=b.normalizeZ(n),B.set(t,n)));let i=b.ZERO,o=b.BASE;const c=1+256/r,a=2**(r-1),f=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let t=0;t<c;t++){const r=t*a;let c=Number(e&f);e>>=l,c>a&&(c-=u,e+=s);const y=r,d=r+Math.abs(c)-1,w=t%2!=0,p=c<0;0===c?o=o.add(g(w,n[y])):i=i.add(g(p,n[d]))}return b.normalizeZ([i,o])[0]}multiply(e,t){return this.wNAF(N(e,u.l),t)}multiplyUnsafe(e){let t=N(e,u.l,!1);const r=b.BASE,n=b.ZERO;if(t===o)return n;if(this.equals(n)||t===s)return this;if(this.equals(r))return this.wNAF(t);let i=n,c=this;for(;t>o;)t&s&&(i=i.add(c)),c=c.double(),t>>=s;return i}isSmallOrder(){return this.multiplyUnsafe(u.h).equals(b.ZERO)}isTorsionFree(){let e=this.multiplyUnsafe(u.l/c).double();return u.l%c&&(e=e.add(this)),e.equals(b.ZERO)}toAffine(e){const{x:t,y:r,z:n}=this,i=this.equals(b.ZERO);null==e&&(e=i?a:_(n));const o=j(t*e),c=j(r*e),f=j(n*e);if(i)return k.ZERO;if(f!==s)throw new Error("invZ was invalid");return new k(o,c)}fromRistrettoBytes(){E()}toRistrettoBytes(){E()}fromRistrettoHash(){E()}}function g(e,t){const r=t.negate();return e?r:t}function m(e){if(!(e instanceof b))throw new TypeError("ExtendedPoint expected")}function x(e){if(!(e instanceof K))throw new TypeError("RistrettoPoint expected")}function E(){throw new Error("Legacy method: switch to RistrettoPoint")}b.BASE=new b(u.Gx,u.Gy,s,j(u.Gx*u.Gy)),b.ZERO=new b(o,s,s,o);class K{constructor(e){this.ep=e}static calcElligatorRistrettoMap(e){const{d:t}=u,r=j(y*e*e),n=j((r+s)*p);let i=BigInt(-1);const o=j((i-t*r)*j(r+t));let{isValid:c,value:a}=H(n,o),f=j(a*e);S(f)||(f=j(-f)),c||(a=f),c||(i=r);const l=j(i*(r-s)*h-o),w=a*a,g=j((a+a)*o),m=j(l*d),x=j(s-w),E=j(s+w);return new b(j(g*E),j(x*m),j(m*E),j(g*x))}static hashToCurve(e){const t=O((e=V(e,64)).slice(0,32)),r=this.calcElligatorRistrettoMap(t),n=O(e.slice(32,64)),i=this.calcElligatorRistrettoMap(n);return new K(r.add(i))}static fromHex(e){e=V(e,32);const{a:t,d:r}=u,n="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",i=O(e);if(!function(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(U(i),e)||S(i))throw new Error(n);const c=j(i*i),a=j(s+t*c),f=j(s-t*c),l=j(a*a),y=j(f*f),d=j(t*r*l-y),{isValid:w,value:p}=q(j(d*y)),h=j(p*f),g=j(p*h*d);let m=j((i+i)*h);S(m)&&(m=j(-m));const x=j(a*g),E=j(m*x);if(!w||S(E)||x===o)throw new Error(n);return new K(new b(m,x,s,E))}toRawBytes(){let{x:e,y:t,z:r,t:n}=this.ep;const i=j(j(r+t)*j(r-t)),o=j(e*t),s=j(o*o),{value:c}=q(j(i*s)),a=j(c*i),f=j(c*o),u=j(a*f*n);let l;if(S(n*u)){let r=j(t*y),n=j(e*y);e=r,t=n,l=j(a*w)}else l=f;S(e*u)&&(t=j(-t));let d=j((r-t)*l);return S(d)&&(d=j(-d)),U(d)}toHex(){return P(this.toRawBytes())}toString(){return this.toHex()}equals(e){x(e);const t=this.ep,r=e.ep,n=j(t.x*r.y)===j(t.y*r.x),i=j(t.y*r.y)===j(t.x*r.x);return n||i}add(e){return x(e),new K(this.ep.add(e.ep))}subtract(e){return x(e),new K(this.ep.subtract(e.ep))}multiply(e){return new K(this.ep.multiply(e))}multiplyUnsafe(e){return new K(this.ep.multiplyUnsafe(e))}}K.BASE=new K(b.BASE),K.ZERO=new K(b.ZERO);const B=new WeakMap;class k{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,B.delete(this)}static fromHex(e,t=!0){const{d:r,P:n}=u,i=(e=V(e,32)).slice();i[31]=-129&e[31];const o=T(i);if(t&&o>=n)throw new Error("Expected 0 < hex < P");if(!t&&o>=l)throw new Error("Expected 0 < hex < 2**256");const c=j(o*o),a=j(c-s),f=j(r*c+s);let{isValid:y,value:d}=H(a,f);if(!y)throw new Error("Point.fromHex: invalid y coordinate");const w=(d&s)===s;return!!(128&e[31])!==w&&(d=j(-d)),new k(d,o)}static async fromPrivateKey(e){return(await F(e)).point}toRawBytes(){const e=U(this.y);return e[31]|=this.x&s?128:0,e}toHex(){return P(this.toRawBytes())}toX25519(){const{y:e}=this;return U(j((s+e)*_(s-e)))}isTorsionFree(){return b.fromAffine(this).isTorsionFree()}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new k(j(-this.x),this.y)}add(e){return b.fromAffine(this).add(b.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return b.fromAffine(this).multiply(e,this).toAffine()}}k.BASE=new k(u.Gx,u.Gy),k.ZERO=new k(o,s);class A{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromHex(e){const t=V(e,64),r=k.fromHex(t.slice(0,32),!1),n=T(t.slice(32,64));return new A(r,n)}assertValidity(){const{r:e,s:t}=this;if(!(e instanceof k))throw new Error("Expected Point instance");return N(t,u.l,!1),this}toRawBytes(){const e=new Uint8Array(64);return e.set(this.r.toRawBytes()),e.set(U(this.s),32),e}toHex(){return P(this.toRawBytes())}}function v(...e){if(!e.every(e=>e instanceof Uint8Array))throw new Error("Expected Uint8Array list");if(1===e.length)return e[0];const t=e.reduce((e,t)=>e+t.length,0),r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){const i=e[t];r.set(i,n),n+=i.length}return r}const M=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function P(e){if(!(e instanceof Uint8Array))throw new Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=M[e[r]];return t}function I(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex");const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function R(e){return I(e.toString(16).padStart(64,"0"))}function U(e){return R(e).reverse()}function S(e){return(j(e)&s)===s}function T(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");return BigInt("0x"+P(Uint8Array.from(e).reverse()))}const z=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function O(e){return j(T(e)&z)}function j(e,t=u.P){const r=e%t;return r>=o?r:t+r}function _(e,t=u.P){if(e===o||t<=o)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=j(e,t),n=t,i=o,c=s;for(;r!==o;){const e=n%r,t=i-c*(n/r);n=r,r=e,i=c,c=t}if(n!==s)throw new Error("invert: does not exist");return j(i,t)}function Z(e,t){const{P:r}=u;let n=e;for(;t-- >o;)n*=n,n%=r;return n}function H(e,t){const r=j(t*t*t),n=function(e){const{P:t}=u,r=BigInt(5),n=BigInt(10),i=BigInt(20),o=BigInt(40),a=BigInt(80),f=e*e%t*e%t,l=Z(f,c)*f%t,y=Z(l,s)*e%t,d=Z(y,r)*y%t,w=Z(d,n)*d%t,p=Z(w,i)*w%t,h=Z(p,o)*p%t,b=Z(h,a)*h%t,g=Z(b,a)*h%t,m=Z(g,n)*d%t;return{pow_p_5_8:Z(m,c)*e%t,b2:f}}(e*j(r*r*t)).pow_p_5_8;let i=j(e*r*n);const o=j(t*i*i),a=i,f=j(i*y),l=o===e,d=o===j(-e),w=o===j(-e*y);return l&&(i=a),(d||w)&&(i=f),S(i)&&(i=j(-i)),{isValid:l||d,value:i}}function q(e){return H(s,e)}function $(e){return j(T(e),u.l)}function V(e,t){const r=e instanceof Uint8Array?Uint8Array.from(e):I(e);if("number"==typeof t&&r.length!==t)throw new Error(`Expected ${t} bytes`);return r}function N(e,t,r=!0){if(!t)throw new TypeError("Specify max value");if("number"==typeof e&&Number.isSafeInteger(e)&&(e=BigInt(e)),"bigint"==typeof e&&e<t)if(r){if(o<e)return e}else if(o<=e)return e;throw new TypeError("Expected valid scalar: 0 < scalar < max")}let W;async function F(e){return function(e){const t=((r=e.slice(0,32))[0]&=248,r[31]&=127,r[31]|=64,r);var r;const n=e.slice(32,64),i=$(t),o=k.BASE.multiply(i),s=o.toRawBytes();return{head:t,prefix:n,scalar:i,point:o,pointBytes:s}}(await L.sha512(function(e){if(32!==(e="bigint"==typeof e||"number"==typeof e?R(N(e,l)):V(e)).length)throw new Error("Expected 32 bytes");return e}(e)))}async function G(e){return(await F(e)).pointBytes}async function J(e,t){e=V(e);const{prefix:r,scalar:n,pointBytes:i}=await F(t),o=$(await L.sha512(r,e)),s=k.BASE.multiply(o),c=j(o+$(await L.sha512(s.toRawBytes(),i,e))*n,u.l);return new A(s,c).toRawBytes()}async function C(e,t,r){const{r:n,SB:i,msg:o,pub:s}=function(e,t,r){t=V(t),r instanceof k||(r=k.fromHex(r,!1));const{r:n,s:i}=e instanceof A?e.assertValidity():A.fromHex(e);return{r:n,s:i,SB:b.BASE.multiplyUnsafe(i),pub:r,msg:t}}(e,t,r),c=await L.sha512(n.toRawBytes(),s.toRawBytes(),o);return function(e,t,r,n){const i=$(n),o=b.fromAffine(e).multiplyUnsafe(i);return b.fromAffine(t).add(o).subtract(r).multiplyUnsafe(u.h).equals(b.ZERO)}(s,n,i,c)}k.BASE._setWindowSize(8);const D={node:i,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},L={bytesToHex:P,hexToBytes:I,concatBytes:v,getExtendedPublicKey:F,mod:j,invert:_,TORSION_SUBGROUP:["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"],hashToPrivateScalar:e=>{if((e=V(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");return j(T(e),u.l-s)+s},randomBytes:(e=32)=>{if(D.web)return D.web.getRandomValues(new Uint8Array(e));if(D.node){const{randomBytes:t}=D.node;return new Uint8Array(t(e).buffer)}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>L.randomBytes(32),sha512:async(...e)=>{const t=v(...e);if(D.web){const e=await D.web.subtle.digest("SHA-512",t.buffer);return new Uint8Array(e)}if(D.node)return Uint8Array.from(D.node.createHash("sha512").update(t).digest());throw new Error("The environment doesn't have sha512 function")},precompute(e=8,t=k.BASE){const r=t.equals(k.BASE)?t:new k(t.x,t.y);return r._setWindowSize(e),r.multiply(c),r},sha512Sync:void 0};Object.defineProperties(L,{sha512Sync:{configurable:!1,get:()=>W,set(e){W||(W=e)}}});
|
|
3
3
|
/*!
|
|
4
4
|
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{v as e,B as t}from"./index-D2bS6rRi-D_ppNIsb.js";import"./main.js";import"./jsonld-signatures-BJXipuab-CB799Kkm.js";import"./jsonld-DOUjwF6J-dtl20tiV.js";
|
|
2
|
+
/*!
|
|
3
|
+
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
|
|
4
|
+
*/class r{constructor({length:e,buffer:r}={}){this.bitstring=new t({length:e,buffer:r}),this.length=this.bitstring.length}setRevoked(e,t){if("boolean"!=typeof t)throw new TypeError('"revoked" must be a boolean.');return this.bitstring.set(e,t)}isRevoked(e){return this.bitstring.get(e)}async encode(){return this.bitstring.encodeBits()}static async decode({encodedList:e}){const i=await t.decodeBits({encoded:e});return new r({buffer:i})}}
|
|
5
|
+
/*!
|
|
6
|
+
* Copyright (c) 2020-2022 Digital Bazaar, Inc. All rights reserved.
|
|
7
|
+
*/const i="https://www.w3.org/2018/credentials/v1",n="https://w3id.org/vc-revocation-list-2020/v1";async function o({length:e}){return new r({length:e})}async function s({encodedList:e}){return r.decode({encodedList:e})}async function a({id:e,list:t}){const r=await t.encode();return{"@context":[i,n],id:e,type:["VerifiableCredential","RevocationList2020Credential"],credentialSubject:{id:`${e}#list`,type:"RevocationList2020",encodedList:r}}}async function c({credential:t,documentLoader:r,suite:i,verifyRevocationListCredential:n=!0,verifyMatchingIssuers:o=!0}={}){let a;try{a=await async function({credential:t,documentLoader:r,suite:i,verifyRevocationListCredential:n,verifyMatchingIssuers:o}){if(!t||"object"!=typeof t)throw new TypeError('"credential" must be an object.');if("function"!=typeof r)throw new TypeError('"documentLoader" must be a function.');if(n&&!(i&&(a=i,Array.isArray(a)&&a.length>0&&a.every(e=>e&&"object"==typeof e)||!Array.isArray(i)&&"object"==typeof i)))throw new TypeError('"suite" must be an object or an array of objects.');var a;const c=l({credential:t}),{revocationListIndex:d}=c,u=parseInt(d,10);if(isNaN(u))throw new TypeError('"revocationListIndex" must be an integer.');let f;try{({document:f}=await r(c.revocationListCredential))}catch(e){const t=new Error(`Could not load "RevocationList2020Credential"; reason: ${e.message}`);throw t.cause=e,t}if(n){const t=await e({credential:f,suite:i,documentLoader:r});if(!t.verified){const{error:e}=t;let r='"RevocationList2020Credential" not verified';r+=e?`; reason: ${e.message}`:".";const i=new Error(r);throw e&&(i.cause=t.error),i}}if(o){const e="object"==typeof t.issuer?t.issuer.id:t.issuer,r="object"==typeof f.issuer?f.issuer.id:f.issuer;if(!e||!r||e!==r)throw new Error("Issuers of the revocation credential and verifiable credential do not match.")}if(!f.type.includes("RevocationList2020Credential"))throw new Error('"RevocationList2020Credential" type is not valid.');const{credentialSubject:y}=f;if("RevocationList2020"!==y.type)throw new Error('"RevocationList2020" type is not valid.');const{encodedList:w}=y;let v;try{v=await s({encodedList:w})}catch(e){const t=new Error(`Could not decode encoded revocation list; reason: ${e.message}`);throw t.cause=e,t}return{verified:!v.isRevoked(u)}}({credential:t,documentLoader:r,suite:i,verifyRevocationListCredential:n,verifyMatchingIssuers:o})}catch(e){a={verified:!1,error:e}}return a}function d({credential:e}={}){if(!e||"object"!=typeof e)throw new TypeError('"credential" must be an object.');const{"@context":t}=e;if(!Array.isArray(t))throw new TypeError('"@context" must be an array.');if(t[0]!==i)throw new Error(`The first "@context" value must be "${i}".`);const{credentialStatus:r}=e;if(!r)return!1;if("object"!=typeof r)throw new Error('"credentialStatus" is invalid.');return!!t.includes(n)&&"RevocationList2020Status"===r.type}function u({credential:e}={}){if(!e||"object"!=typeof e)throw new TypeError('"credential" must be an object.');const{"@context":t}=e;if(!Array.isArray(t))throw new TypeError('"@context" must be an array.');if(t[0]!==i)throw new Error(`The first "@context" value must be "${i}".`);if(!t.includes(n))throw new TypeError(`"@context" must include "${n}".`)}function l({credential:e}={}){if(!e||"object"!=typeof e)throw new TypeError('"credential" must be an object.');if(u({credential:e}),!e.credentialStatus||"object"!=typeof e.credentialStatus)throw new Error('"credentialStatus" is missing or invalid.');const{credentialStatus:t}=e;if("RevocationList2020Status"!==t.type)throw new Error('"credentialStatus" type is not "RevocationList2020Status".');if("string"!=typeof t.revocationListCredential)throw new TypeError('"credentialStatus" revocationListCredential must be a string.');return t}export{u as assertRevocationList2020Context,c as checkStatus,a as createCredential,o as createList,s as decodeList,l as getCredentialStatus,d as statusTypeMatches};
|