!function(t){function e(r){if(i[r])return i[r].exports;var s=i[r]={i:r,l:!1,exports:{}};return t[r].call(s.exports,s,s.exports,e),s.l=!0,s.exports}var i={};e.m=t,e.c=i,e.d=function(t,i,r){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=0)}([function(t,e){~function(){function t(t,e,i,r){function a(t,e){F[P++]=t,P>=254&&d(e)}function f(t){c(u),D=S+2,G=!0,b(S,t)}function c(t){for(var e=0;e=0){a=p-s,0===s&&(a=1);do{if((s-=a)<0&&(s+=p),A[s]===i){o=C[s];continue t}}while(A[s]>=0)}b(o,e),o=r,D<1<0&&(t.writeByte(P),t.writeBytes(F,0,P),P=0)}function g(t){return(1<0?v|=t<=8;)a(255&v,e),v>>=8,I-=8;if((D>B||G)&&(G?(B=g(n=m),G=!1):(++n,B=n==l?1<0;)a(255&v,e),v>>=8,I-=8;d(e)}}var v,P,B,m,S,T,M=Math.max(2,r),F=new Uint8Array(256),A=new Int32Array(u),C=new Int32Array(u),I=0,D=0,G=!1;this.encode=w}function e(t,e){function i(){B=[],S=new Int32Array(256),R=new Int32Array(c),U=new Int32Array(c),Q=new Int32Array(c>>3);var t,e;for(t=0;t>=w,B[t][1]>>=w,B[t][2]>>=w,B[t][3]=t}function s(t,e,i,r,s){B[e][0]-=t*(B[e][0]-i)/F,B[e][1]-=t*(B[e][1]-r)/F,B[e][2]-=t*(B[e][2]-s)/F}function o(t,e,i,r,s){for(var o,n,a=Math.abs(e-t),h=Math.min(e+t,c),l=e+1,u=e-1,p=1;la;)n=Q[p++],la&&(o=B[u--],o[0]-=n*(o[0]-i)/C,o[1]-=n*(o[1]-r)/C,o[2]-=n*(o[2]-s)/C)}function n(t,e,i){var r,s,o,n,a,h=~(1<<31),l=h,u=-1,p=u;for(r=0;r>d-w),n>b,U[r]-=a,R[r]+=a<>1,e=n+1;e>1,e=n+1;e<256;e++)S[e]=y}function h(t,e,i){for(var r,s,o,n=1e3,a=-1,h=S[e],l=h-1;h=0;)h=n?h=c:(h++,o<0&&(o=-o),r=s[0]-t,r<0&&(r=-r),(o+=r)=0&&(s=B[l],o=e-s[1],o>=n?l=-1:(l--,o<0&&(o=-o),r=s[0]-t,r<0&&(r=-r),(o+=r)>m;for(c<=1&&(c=0),i=0;i=r&&(v-=r),i++,0===l&&(l=1),i%l==0)for(u-=u/a,p-=p/M,c=p>>m,c<=1&&(c=0),b=0;b>b,P=g<>3,m=6,S=1<=i.pageSize&&this.newPage(),this.pages[this.page][this.cursor++]=t},i.prototype.writeUTFBytes=function(t){for(var e=t.length,i=0;i=0&&(this.dispose=t)},r.prototype.setRepeat=function(t){this.repeat=t},r.prototype.setTransparent=function(t){this.transparent=t},r.prototype.addFrame=function(t){this.image=t,this.colorTab=this.globalPalette&&this.globalPalette.slice?this.globalPalette:null,this.getImagePixels(),this.analyzePixels(),!0===this.globalPalette&&(this.globalPalette=this.colorTab),this.firstFrame&&(this.writeLSD(),this.writePalette(),this.repeat>=0&&this.writeNetscapeExt()),this.writeGraphicCtrlExt(),this.writeImageDesc(),this.firstFrame||this.globalPalette||this.writePalette(),this.writePixels(),this.firstFrame=!1},r.prototype.finish=function(){this.out.writeByte(59)},r.prototype.setQuality=function(t){t<1&&(t=1),this.sample=t},r.prototype.setDither=function(t){!0===t&&(t="FloydSteinberg"),this.dither=t},r.prototype.setGlobalPalette=function(t){this.globalPalette=t},r.prototype.getGlobalPalette=function(){return this.globalPalette&&this.globalPalette.slice&&this.globalPalette.slice(0)||this.globalPalette},r.prototype.writeHeader=function(){this.out.writeUTFBytes("GIF89a")},r.prototype.analyzePixels=function(){this.colorTab||(this.neuQuant=new e(this.pixels,this.sample),this.neuQuant.buildColormap(),this.colorTab=this.neuQuant.getColormap()),this.dither?this.ditherPixels(this.dither.replace("-serpentine",""),null!==this.dither.match(/-serpentine/)):this.indexPixels(),this.pixels=null,this.colorDepth=8,this.palSize=7,null!==this.transparent&&(this.transIndex=this.findClosest(this.transparent,!0))},r.prototype.indexPixels=function(t){var e=this.pixels.length/3;this.indexedPixels=new Uint8Array(e);for(var i=0,r=0;r=0&&S+u=0&&T+l>16,(65280&t)>>8,255&t,e)},r.prototype.findClosestRGB=function(t,e,i,r){if(null===this.colorTab)return-1;if(this.neuQuant&&!r)return this.neuQuant.lookupRGB(t,e,i);for(var s=0,o=16777216,n=this.colorTab.length,a=0,h=0;a=0&&(e=7&dispose),e<<=2,this.out.writeByte(0|e|t),this.writeShort(this.delay),this.out.writeByte(this.transIndex),this.out.writeByte(0)},r.prototype.writeImageDesc=function(){this.out.writeByte(44),this.writeShort(0),this.writeShort(0),this.writeShort(this.width),this.writeShort(this.height),this.firstFrame||this.globalPalette?this.out.writeByte(0):this.out.writeByte(128|this.palSize)},r.prototype.writeLSD=function(){this.writeShort(this.width),this.writeShort(this.height),this.out.writeByte(240|this.palSize),this.out.writeByte(0),this.out.writeByte(0)},r.prototype.writeNetscapeExt=function(){this.out.writeByte(33),this.out.writeByte(255),this.out.writeByte(11),this.out.writeUTFBytes("NETSCAPE2.0"),this.out.writeByte(3),this.out.writeByte(1),this.writeShort(this.repeat),this.out.writeByte(0)},r.prototype.writePalette=function(){this.out.writeBytes(this.colorTab);for(var t=768-this.colorTab.length,e=0;e>8&255)},r.prototype.writePixels=function(){new t(this.width,this.height,this.indexedPixels,this.colorDepth).encode(this.out)},r.prototype.stream=function(){return this.out}}()}]); //# sourceMappingURL=2c74dc4a359491c13776.worker.js.map