"use strict";(this.webpackChunktweb=this.webpackChunktweb||[]).push([[866],{2553:(t,e,r)=>{r.d(e,{cv:()=>g});vari=r(2155),n=r(7885);consth=[137,80,78,71,13,10,26,10],s=[];for(lett=0;t<256;t++){lete=t;for(lett=0;t<8;t++)1&e?e=3988292384^e>>>1:e>>>=1;s[t]=e}consto=4294967295;varc,a,w,E,N,A,d,l;(l=c||(c={}))[l.UNKNOWN=-1]="UNKNOWN",l[l.GREYSCALE=0]="GREYSCALE",l[l.TRUECOLOUR=2]="TRUECOLOUR",l[l.INDEXED_COLOUR=3]="INDEXED_COLOUR",l[l.GREYSCALE_ALPHA=4]="GREYSCALE_ALPHA",l[l.TRUECOLOUR_ALPHA=6]="TRUECOLOUR_ALPHA",(d=a||(a={}))[d.UNKNOWN=-1]="UNKNOWN",d[d.DEFLATE=0]="DEFLATE",(A=w||(w={}))[A.UNKNOWN=-1]="UNKNOWN",A[A.ADAPTIVE=0]="ADAPTIVE",(N=E||(E={}))[N.UNKNOWN=-1]="UNKNOWN",N[N.NO_INTERLACE=0]="NO_INTERLACE",N[N.ADAM7=1]="ADAM7",newUint8Array(0);constu=newUint16Array([255]);newUint8Array(u.buffer)[0];constU={level:3};classpextendsi.l{constructor(t,e={}){super(),this._colorType=c.UNKNOWN,this._zlibOptions=Object.assign({},U,e.zlib),this._png=this._checkData(t),this.setBigEndian()}encode(){returnthis.encodeSignature(),this.encodeIHDR(),this.encodeData(),this.encodeIEND(),this.toArray()}encodeSignature(){this.writeBytes(h)}encodeIHDR(){this.writeUint32(13),this.writeChars("IHDR"),this.writeUint32(this._png.width),this.writeUint32(this._png.height),this.writeByte(this._png.depth),this.writeByte(this._colorType),this.writeByte(a.DEFLATE),this.writeByte(w.ADAPTIVE),this.writeByte(E.NO_INTERLACE),this.writeCrc(17)}encodeIEND(){this.writeUint32(0),this.writeChars("IEND"),this.writeCrc(4)}encodeIDAT(t){this.writeUint32(t.length),this.writeChars("IDAT"),this.writeBytes(t),this.writeCrc(t.length+4)}encodeData(){const{width:t,height:e,channels:r,depth:h,data:s}=this._png,o=r*t,c=(newi.l).setBigEndian();leta=0;for(lett=0;t<e;t++)if(c.writeByte(0),8===h)a=f(s,c,o,a);else{if(16!==h)thrownewError("unreachable");a=R(s,c,o,a)}constw=c.toArray(),E=(0,n.Wt)(w,this._zlibOptions);this.encodeIDAT(E)}_checkData(t){const{colorType:e,channels:r,depth:i}=function(t){const{channels:e=4,depth:r=8}=t;if(4!==e&&3!==e&&2!==e&&1!==e)thrownewRangeError(`unsupported number of channels: ${e}`);if(8!==r&&16!==r)thrownewRangeError(`unsupported bit depth: ${r}`);consti={channels:e,depth:r,colorType:c.UNKNOWN};switch(e){case4:i.colorType=c.TRUECOLOUR_ALPHA;break;case3:i.colorType=c.TRUECOLOUR;break;case1:i.colorType=c.GREYSCALE;break;case2:i.colorType=c.GREYSCALE_ALPHA;break;default:thrownewError("unsupported number of channels")}returni}(t),n={width:O(t.width,"width"),height:O(t.height,"height"),channels:r,data:t.data,depth:i,text:{}};this._colorType=e;consth=n.width*n.height*r;if(n.data.length!==h)thrownewRangeError(`wrong data size. Found ${n.data.length}, expected ${h}`);returnn}writeCrc(t){this.writeUint32(function(t,e){return(function(t,e,r){leti=4294967295;for(lett=0;t<r;t++)i=s[255&(i^e[t])]^i>>>8;returni}(0,t,e)^o)>>>0}(newUint8Array(this.buffer,this.byteOffset+this.offset-t,t),t))}}functionO(t,e){if(Number.isInteger(t)&&t>0)returnt;thrownewTypeError(`${e} must be a positive integer`)}functionf(t,e,r,i){for(letn=0;n<r;n++)e.writeByte(t[i++]);returni}functionR(t,e,r,i){for(letn=0;n<r;n++)e.writeUint16(t[i++]);returni}varT;functiong(t,e){returnnewp(t,e).encode()}!function(t){t[t.UNKNOWN=0]="UNKNOWN",t[t.METRE=1]="METRE"}(T||(T={}))}}]);