1 line
18 KiB
JavaScript
1 line
18 KiB
JavaScript
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4802],{13994:(t,e,i)=>{function r(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,r=Array(e);i<e;i++)r[i]=t[i];return r}function s(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"u">typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var r,s,n,a,h=[],o=!0,f=!1;try{if(n=(i=i.call(t)).next,0===e){if(Object(i)!==i)return;o=!1}else for(;!(o=(r=n.call(i)).done)&&(h.push(r.value),h.length!==e);o=!0);}catch(t){f=!0,s=t}finally{try{if(!o&&null!=i.return&&(a=i.return(),Object(a)!==a))return}finally{if(f)throw s}}return h}}(t,e)||function(t,e){if(t){if("string"==typeof t)return r(t,e);var i=({}).toString.call(t).slice(8,-1);return"Object"===i&&t.constructor&&(i=t.constructor.name),"Map"===i||"Set"===i?Array.from(t):"Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i)?r(t,e):void 0}}(t,e)||function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}i.d(e,{A:()=>s})},76808:(t,e,i)=>{let r;function s(t,e="utf8"){return new TextDecoder(e).decode(t)}i.d(e,{D4:()=>x});let n=new TextEncoder,a=!((new Uint32Array((r=new Uint8Array(4)).buffer)[0]=1)&r[0]),h={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 o{buffer;byteLength;byteOffset;length;offset;lastWrittenByte;littleEndian;_data;_mark;_marks;constructor(t=8192,e={}){let i=!1;"number"==typeof t?t=new ArrayBuffer(t):(i=!0,this.lastWrittenByte=t.byteLength);const r=e.offset?e.offset>>>0:0,s=t.byteLength-r;let n=r;(ArrayBuffer.isView(t)||t instanceof o)&&(t.byteLength!==t.buffer.byteLength&&(n=t.byteOffset+r),t=t.buffer),i?this.lastWrittenByte=s:this.lastWrittenByte=0,this.buffer=t,this.length=s,this.byteLength=s,this.byteOffset=n,this.offset=0,this.littleEndian=!0,this._data=new DataView(this.buffer,n,s),this._mark=0,this._marks=[]}available(t=1){return this.offset+t<=this.length}isLittleEndian(){return this.littleEndian}setLittleEndian(){return this.littleEndian=!0,this}isBigEndian(){return!this.littleEndian}setBigEndian(){return this.littleEndian=!1,this}skip(t=1){return this.offset+=t,this}back(t=1){return this.offset-=t,this}seek(t){return this.offset=t,this}mark(){return this._mark=this.offset,this}reset(){return this.offset=this._mark,this}pushMark(){return this._marks.push(this.offset),this}popMark(){let t=this._marks.pop();if(void 0===t)throw Error("Mark stack empty");return this.seek(t),this}rewind(){return this.offset=0,this}ensureAvailable(t=1){if(!this.available(t)){let e=2*(this.offset+t),i=new Uint8Array(e);i.set(new Uint8Array(this.buffer)),this.buffer=i.buffer,this.length=e,this.byteLength=e,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(t=1){return this.readArray(t,"uint8")}readArray(t,e){let i=h[e].BYTES_PER_ELEMENT*t,r=this.byteOffset+this.offset,s=this.buffer.slice(r,r+i);if(this.littleEndian===a&&"uint8"!==e&&"int8"!==e){let t=new Uint8Array(this.buffer.slice(r,r+i));t.reverse();let s=new h[e](t.buffer);return this.offset+=i,s.reverse(),s}let n=new h[e](s);return this.offset+=i,n}readInt16(){let t=this._data.getInt16(this.offset,this.littleEndian);return this.offset+=2,t}readUint16(){let t=this._data.getUint16(this.offset,this.littleEndian);return this.offset+=2,t}readInt32(){let t=this._data.getInt32(this.offset,this.littleEndian);return this.offset+=4,t}readUint32(){let t=this._data.getUint32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat32(){let t=this._data.getFloat32(this.offset,this.littleEndian);return this.offset+=4,t}readFloat64(){let t=this._data.getFloat64(this.offset,this.littleEndian);return this.offset+=8,t}readBigInt64(){let t=this._data.getBigInt64(this.offset,this.littleEndian);return this.offset+=8,t}readBigUint64(){let t=this._data.getBigUint64(this.offset,this.littleEndian);return this.offset+=8,t}readChar(){return String.fromCharCode(this.readInt8())}readChars(t=1){let e="";for(let i=0;i<t;i++)e+=this.readChar();return e}readUtf8(t=1){return s(this.readBytes(t))}decodeText(t=1,e="utf8"){return s(this.readBytes(t),e)}writeBoolean(t){return this.writeUint8(255*!!t),this}writeInt8(t){return this.ensureAvailable(1),this._data.setInt8(this.offset++,t),this._updateLastWrittenByte(),this}writeUint8(t){return this.ensureAvailable(1),this._data.setUint8(this.offset++,t),this._updateLastWrittenByte(),this}writeByte(t){return this.writeUint8(t)}writeBytes(t){this.ensureAvailable(t.length);for(let e=0;e<t.length;e++)this._data.setUint8(this.offset++,t[e]);return this._updateLastWrittenByte(),this}writeInt16(t){return this.ensureAvailable(2),this._data.setInt16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeUint16(t){return this.ensureAvailable(2),this._data.setUint16(this.offset,t,this.littleEndian),this.offset+=2,this._updateLastWrittenByte(),this}writeInt32(t){return this.ensureAvailable(4),this._data.setInt32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeUint32(t){return this.ensureAvailable(4),this._data.setUint32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat32(t){return this.ensureAvailable(4),this._data.setFloat32(this.offset,t,this.littleEndian),this.offset+=4,this._updateLastWrittenByte(),this}writeFloat64(t){return this.ensureAvailable(8),this._data.setFloat64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigInt64(t){return this.ensureAvailable(8),this._data.setBigInt64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeBigUint64(t){return this.ensureAvailable(8),this._data.setBigUint64(this.offset,t,this.littleEndian),this.offset+=8,this._updateLastWrittenByte(),this}writeChar(t){return this.writeUint8(t.charCodeAt(0))}writeChars(t){for(let e=0;e<t.length;e++)this.writeUint8(t.charCodeAt(e));return this}writeUtf8(t){return this.writeBytes(n.encode(t))}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)}}var f,l,d=i(63233);let u=[];for(let t=0;t<256;t++){let e=t;for(let t=0;t<8;t++)1&e?e=0xedb88320^e>>>1:e>>>=1;u[t]=e}function c(t,e,i){let r=t.readUint32(),s=(0xffffffff^function(t,e){let i=0xffffffff;for(let r=0;r<e;r++)i=u[(i^t[r])&255]^i>>>8;return i}(new Uint8Array(t.buffer,t.byteOffset+t.offset-e-4,e),e))>>>0;if(s!==r)throw Error(`CRC mismatch for chunk ${i}. Expected ${r}, found ${s}`)}function p(t,e,i){for(let r=0;r<i;r++)e[r]=t[r]}function _(t,e,i,r){let s=0;for(;s<r;s++)e[s]=t[s];for(;s<i;s++)e[s]=t[s]+e[s-r]&255}function g(t,e,i,r){let s=0;if(0===i.length)for(;s<r;s++)e[s]=t[s];else for(;s<r;s++)e[s]=t[s]+i[s]&255}function y(t,e,i,r,s){let n=0;if(0===i.length){for(;n<s;n++)e[n]=t[n];for(;n<r;n++)e[n]=t[n]+(e[n-s]>>1)&255}else{for(;n<s;n++)e[n]=t[n]+(i[n]>>1)&255;for(;n<r;n++)e[n]=t[n]+(e[n-s]+i[n]>>1)&255}}function b(t,e,i,r,s){let n=0;if(0===i.length){for(;n<s;n++)e[n]=t[n];for(;n<r;n++)e[n]=t[n]+e[n-s]&255}else{for(;n<s;n++)e[n]=t[n]+i[n]&255;for(;n<r;n++)e[n]=t[n]+function(t,e,i){let r=t+e-i,s=Math.abs(r-t),n=Math.abs(r-e),a=Math.abs(r-i);return s<=n&&s<=a?t:n<=a?e:i}(e[n-s],i[n],i[n-s])&255}}let w=255===new Uint8Array(new Uint16Array([255]).buffer)[0],m=255===new Uint8Array(new Uint16Array([255]).buffer)[0],U=new Uint8Array(0);function k(t){let e,i,{data:r,width:s,height:n,channels:a,depth:h}=t,o=Math.ceil(h/8)*a,f=Math.ceil(h/8*a*s),l=new Uint8Array(n*f),d=U,u=0;for(let t=0;t<n;t++){switch(e=r.subarray(u+1,u+1+f),i=l.subarray(t*f,(t+1)*f),r[u]){case 0:p(e,i,f);break;case 1:_(e,i,f,o);break;case 2:g(e,i,d,f);break;case 3:y(e,i,d,f,o);break;case 4:b(e,i,d,f,o);break;default:throw Error(`Unsupported filter: ${r[u]}`)}d=i,u+=f+1}if(16!==h)return l;{let t=new Uint16Array(l.buffer);if(m)for(let e=0;e<t.length;e++){var c;t[e]=(255&(c=t[e]))<<8|c>>8&255}return t}}let A=Uint8Array.of(137,80,78,71,13,10,26,10);function E(t){if(!function(t){if(t.length<A.length)return!1;for(let e=0;e<A.length;e++)if(t[e]!==A[e])return!1;return!0}(t.readBytes(A.length)))throw Error("wrong PNG signature")}let B=new TextDecoder("latin1"),T=/^[\u0000-\u00FF]*$/;function C(t){for(t.mark();0!==t.readByte(););let e=t.offset;t.reset();let i=B.decode(t.readBytes(e-t.offset-1));t.skip(1);if(function(t){if(!T.test(t))throw Error("invalid latin1 text")}(i),0===i.length||i.length>79)throw Error("keyword length must be between 1 and 79");return i}class O extends o{_checkCrc;_inflator;_png;_apng;_end;_hasPalette;_palette;_hasTransparency;_transparency;_compressionMethod;_filterMethod;_interlaceMethod;_colorType;_isAnimated;_numberOfFrames;_numberOfPlays;_frames;_writingDataChunks;constructor(t,e={}){super(t);const{checkCrc:i=!1}=e;this._checkCrc=i,this._inflator=new d.EL,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=-1,this._filterMethod=-1,this._interlaceMethod=-1,this._colorType=-1,this._isAnimated=!1,this._numberOfFrames=1,this._numberOfPlays=0,this._frames=[],this._writingDataChunks=!1,this.setBigEndian()}decode(){for(E(this);!this._end;){let t=this.readUint32(),e=this.readChars(4);this.decodeChunk(t,e)}return this.decodeImage(),this._png}decodeApng(){for(E(this);!this._end;){let t=this.readUint32(),e=this.readChars(4);this.decodeApngChunk(t,e)}return this.decodeApngImage(),this._apng}decodeChunk(t,e){let i=this.offset;switch(e){case"IHDR":this.decodeIHDR();break;case"PLTE":this.decodePLTE(t);break;case"IDAT":this.decodeIDAT(t);break;case"IEND":this._end=!0;break;case"tRNS":this.decodetRNS(t);break;case"iCCP":this.decodeiCCP(t);break;case"tEXt":var r,s,n;let a;r=this._png.text,r[a=C(this)]=(s=this,n=t-a.length-1,B.decode(s.readBytes(n)));break;case"pHYs":this.decodepHYs();break;default:this.skip(t)}if(this.offset-i!==t)throw Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?c(this,t+4,e):this.skip(4)}decodeApngChunk(t,e){let i=this.offset;switch("fdAT"!==e&&"IDAT"!==e&&this._writingDataChunks&&this.pushDataToFrame(),e){case"acTL":this.decodeACTL();break;case"fcTL":this.decodeFCTL();break;case"fdAT":this.decodeFDAT(t);break;default:this.decodeChunk(t,e),this.offset=i+t}if(this.offset-i!==t)throw Error(`Length mismatch while decoding chunk ${e}`);this._checkCrc?c(this,t+4,e):this.skip(4)}decodeIHDR(){let t,e=this._png;e.width=this.readUint32(),e.height=this.readUint32(),e.depth=function(t){if(1!==t&&2!==t&&4!==t&&8!==t&&16!==t)throw Error(`invalid bit depth: ${t}`);return t}(this.readUint8());let i=this.readUint8();switch(this._colorType=i,i){case 0:case 3:t=1;break;case 2:t=3;break;case 4:t=2;break;case 6:t=4;break;default:throw Error(`Unknown color type: ${i}`)}if(this._png.channels=t,this._compressionMethod=this.readUint8(),0!==this._compressionMethod)throw 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(){let t={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(t)}decodePLTE(t){if(t%3!=0)throw RangeError(`PLTE field length must be a multiple of 3. Got ${t}`);let e=t/3;this._hasPalette=!0;let i=[];this._palette=i;for(let t=0;t<e;t++)i.push([this.readUint8(),this.readUint8(),this.readUint8()])}decodeIDAT(t){this._writingDataChunks=!0;let e=this.offset+this.byteOffset;if(this._inflator.push(new Uint8Array(this.buffer,e,t)),this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodeFDAT(t){this._writingDataChunks=!0;let e=t,i=this.offset+this.byteOffset;if(i+=4,e-=4,this._inflator.push(new Uint8Array(this.buffer,i,e)),this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);this.skip(t)}decodetRNS(t){switch(this._colorType){case 0:case 2:if(t%2!=0)throw RangeError(`tRNS chunk length must be a multiple of 2. Got ${t}`);if(t/2>this._png.width*this._png.height)throw Error(`tRNS chunk contains more alpha values than there are pixels (${t/2} vs ${this._png.width*this._png.height})`);this._hasTransparency=!0,this._transparency=new Uint16Array(t/2);for(let e=0;e<t/2;e++)this._transparency[e]=this.readUint16();break;case 3:{if(t>this._palette.length)throw Error(`tRNS chunk contains more alpha values than there are palette colors (${t} vs ${this._palette.length})`);let e=0;for(;e<t;e++){let t=this.readByte();this._palette[e].push(t)}for(;e<this._palette.length;e++)this._palette[e].push(255);break}default:throw Error(`tRNS chunk is not supported for color type ${this._colorType}`)}}decodeiCCP(t){let e=C(this),i=this.readUint8();if(0!==i)throw Error(`Unsupported iCCP compression method: ${i}`);let r=this.readBytes(t-e.length-2);this._png.iccEmbeddedProfile={name:e,profile:(0,d.UD)(r)}}decodepHYs(){let t=this.readUint32(),e=this.readUint32(),i=this.readByte();this._png.resolution={x:t,y:e,unit:i}}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 t=0;t<this._numberOfFrames;t++){let e={sequenceNumber:this._frames[t].sequenceNumber,delayNumber:this._frames[t].delayNumber,delayDenominator:this._frames[t].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)},i=this._frames.at(t);if(i){if(i.data=k({data:i.data,width:i.width,height:i.height,channels:this._apng.channels,depth:this._apng.depth}),this._hasPalette&&(this._apng.palette=this._palette),this._hasTransparency&&(this._apng.transparency=this._transparency),0===t||0===i.xOffset&&0===i.yOffset&&i.width===this._png.width&&i.height===this._png.height)e.data=i.data;else{let r=this._apng.frames.at(t-1);this.disposeFrame(i,r,e),this.addFrameDataToCanvas(e,i)}this._apng.frames.push(e)}}return this._apng}disposeFrame(t,e,i){switch(t.disposeOp){case 0:break;case 1:for(let e=0;e<this._png.height;e++)for(let r=0;r<this._png.width;r++){let s=(e*t.width+r)*this._png.channels;for(let t=0;t<this._png.channels;t++)i.data[s+t]=0}break;case 2:i.data.set(e.data);break;default:throw Error("Unknown disposeOp")}}addFrameDataToCanvas(t,e){let i=1<<this._png.depth,r=(t,i)=>({index:((t+e.yOffset)*this._png.width+e.xOffset+i)*this._png.channels,frameIndex:(t*e.width+i)*this._png.channels});switch(e.blendOp){case 0:for(let i=0;i<e.height;i++)for(let s=0;s<e.width;s++){let{index:n,frameIndex:a}=r(i,s);for(let i=0;i<this._png.channels;i++)t.data[n+i]=e.data[a+i]}break;case 1:for(let s=0;s<e.height;s++)for(let n=0;n<e.width;n++){let{index:a,frameIndex:h}=r(s,n);for(let r=0;r<this._png.channels;r++){let s=e.data[h+this._png.channels-1]/i,n=Math.floor(s*(r%(this._png.channels-1)==0?1:e.data[h+r])+(1-s)*t.data[a+r]);t.data[a+r]+=n}}break;default:throw Error("Unknown blendOp")}}decodeImage(){if(this._inflator.err)throw Error(`Error while decompressing the data: ${this._inflator.err}`);let t=this._isAnimated?(this._frames?.at(0)).data:this._inflator.result;if(0!==this._filterMethod)throw Error(`Filter method ${this._filterMethod} not supported`);if(0===this._interlaceMethod)this._png.data=k({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else if(1===this._interlaceMethod)this._png.data=function(t){let{data:e,width:i,height:r,channels:s,depth:n}=t,a=[{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}],h=Math.ceil(n/8)*s,o=new Uint8Array(r*i*h),f=0;for(let t=0;t<7;t++){let s=a[t],n=Math.ceil((i-s.x)/s.xStep),l=Math.ceil((r-s.y)/s.yStep);if(n<=0||l<=0)continue;let d=n*h,u=new Uint8Array(d);for(let t=0;t<l;t++){let a=e[f++],l=e.subarray(f,f+d);f+=d;let c=new Uint8Array(d);switch(a){case 0:p(l,c,d);break;case 1:_(l,c,d,h);break;case 2:g(l,c,u,d);break;case 3:y(l,c,u,d,h);break;case 4:b(l,c,u,d,h);break;default:throw Error(`Unsupported filter: ${a}`)}u.set(c);for(let e=0;e<n;e++){let n=s.x+e*s.xStep,a=s.y+t*s.yStep;if(!(n>=i)&&!(a>=r))for(let t=0;t<h;t++)o[(a*i+n)*h+t]=c[e*h+t]}}}if(16!==n)return o;{let t=new Uint16Array(o.buffer);if(w)for(let e=0;e<t.length;e++){var l;t[e]=(255&(l=t[e]))<<8|l>>8&255}return t}}({data:t,width:this._png.width,height:this._png.height,channels:this._png.channels,depth:this._png.depth});else throw Error(`Interlace method ${this._interlaceMethod} not supported`);this._hasPalette&&(this._png.palette=this._palette),this._hasTransparency&&(this._png.transparency=this._transparency)}pushDataToFrame(){let t=this._inflator.result,e=this._frames.at(-1);e?e.data=t:this._frames.push({sequenceNumber:0,width:this._png.width,height:this._png.height,xOffset:0,yOffset:0,delayNumber:0,delayDenominator:0,disposeOp:0,blendOp:0,data:t}),this._inflator=new d.EL,this._writingDataChunks=!1}}function x(t,e){return new O(t,e).decode()}(f=l||(l={}))[f.UNKNOWN=0]="UNKNOWN",f[f.METRE=1]="METRE"},77530:(t,e,i)=>{i.d(e,{A:()=>r});function r(t){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}}}]); |