/*! For license information please see npm-async-87e0bff3.2726b3f243dca54529c2.js.LICENSE.txt */ (self.__LOADABLE_LOADED_CHUNKS__=self.__LOADABLE_LOADED_CHUNKS__||[]).push([[9127],{41077:function(e){e.exports=function(){"use strict";function e(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,i)}return r}function t(t){for(var r=1;r0&&e<1/0},f=Array.prototype.slice;function h(e){return Array.from?Array.from(e):f.call(e)}var d=/^image\/.+$/;function m(e){return d.test(e)}var b=String.fromCharCode;var v=c.btoa;function p(e,t){for(var r=[],i=new Uint8Array(e);i.length>0;)r.push(b.apply(null,h(i.subarray(0,8192)))),i=i.subarray(8192);return"data:".concat(t,";base64,").concat(v(r.join("")))}function g(e){var t,r=new DataView(e);try{var i,a,n;if(255===r.getUint8(0)&&216===r.getUint8(1))for(var o=r.byteLength,l=2;l+1=8&&(n=s+u)}}}if(n){var f,h,d=r.getUint16(n,i);for(h=0;h1&&void 0!==arguments[1]?arguments[1]:1e11;return w.test(e)?Math.round(e*t)/t:e}function B(e){var t=e.aspectRatio,r=e.height,i=e.width,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"none",n=u(i),o=u(r);if(n&&o){var l=r*t;("contain"===a||"none"===a)&&l>i||"cover"===a&&l1&&a(o,function(e){var t=0,r=1,i=1;switch(e){case 2:r=-1;break;case 3:t=-180;break;case 4:i=-1;break;case 5:t=90,i=-1;break;case 6:t=90;break;case 7:t=90,r=-1;break;case 8:t=-90}return{rotate:t,scaleX:r,scaleY:i}}(c)),s&&(t.exif=function(e){for(var t=h(new Uint8Array(e)),r=t.length,i=[],a=0;a+31?p(i,n):A.createObjectURL(r):i,t.load(o)},c.onabort=function(){t.fail(new Error("Aborted to read the image with FileReader."))},c.onerror=function(){t.fail(new Error("Failed to read the image with FileReader."))},c.onloadend=function(){t.reader=null},l||s?c.readAsArrayBuffer(r):c.readAsDataURL(r)}else this.load({url:A.createObjectURL(r)})}else this.fail(new Error("The current browser does not support image compression."));else this.fail(new Error("The first argument must be an image File or Blob object."))}else this.fail(new Error("The first argument must be a File or Blob object."))}},{key:"load",value:function(e){var r=this,i=this.file,a=this.image;a.onload=function(){r.draw(t(t({},e),{},{naturalWidth:a.naturalWidth,naturalHeight:a.naturalHeight}))},a.onabort=function(){r.fail(new Error("Aborted to load the image."))},a.onerror=function(){r.fail(new Error("Failed to load the image."))},c.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(c.navigator.userAgent)&&(a.crossOrigin="anonymous"),a.alt=i.name,a.src=e.url}},{key:"draw",value:function(e){var t=this,r=e.naturalWidth,i=e.naturalHeight,a=e.rotate,n=void 0===a?0:a,o=e.scaleX,s=void 0===o?1:o,c=e.scaleY,f=void 0===c?1:c,d=this.file,b=this.image,v=this.options,g=document.createElement("canvas"),w=g.getContext("2d"),U=Math.abs(n)%180==90,A=("contain"===v.resize||"cover"===v.resize)&&u(v.width)&&u(v.height),j=Math.max(v.maxWidth,0)||1/0,x=Math.max(v.maxHeight,0)||1/0,E=Math.max(v.minWidth,0)||0,R=Math.max(v.minHeight,0)||0,T=r/i,D=v.width,k=v.height;if(U){var L=[x,j];j=L[0],x=L[1];var M=[R,E];E=M[0],R=M[1];var P=[k,D];D=P[0],k=P[1]}A&&(T=D/k);var H=B({aspectRatio:T,width:j,height:x},"contain");j=H.width,x=H.height;var C=B({aspectRatio:T,width:E,height:R},"cover");if(E=C.width,R=C.height,A){var S=B({aspectRatio:T,width:D,height:k},v.resize);D=S.width,k=S.height}else{var z=B({aspectRatio:T,width:D,height:k}),F=z.width;D=void 0===F?r:F;var W=z.height;k=void 0===W?i:W}var _=-(D=Math.floor(y(Math.min(Math.max(D,E),j))))/2,I=-(k=Math.floor(y(Math.min(Math.max(k,R),x))))/2,K=D,q=k,N=[];if(A){var $,G,X,Y,V=B({aspectRatio:T,width:r,height:i},{contain:"cover",cover:"contain"}[v.resize]);X=V.width,Y=V.height,$=(r-X)/2,G=(i-Y)/2,N.push($,G,X,Y)}if(N.push(_,I,K,q),U){var J=[k,D];D=J[0],k=J[1]}g.width=D,g.height=k,m(v.mimeType)||(v.mimeType=d.type);var Q="transparent";d.size>v.convertSize&&v.convertTypes.indexOf(v.mimeType)>=0&&(v.mimeType="image/jpeg");var Z="image/jpeg"===v.mimeType;if(Z&&(Q="#fff"),w.fillStyle=Q,w.fillRect(0,0,D,k),v.beforeDraw&&v.beforeDraw.call(this,w,g),!this.aborted&&(w.save(),w.translate(D/2,k/2),w.rotate(n*Math.PI/180),w.scale(s,f),w.drawImage.apply(w,[b].concat(N)),w.restore(),v.drew&&v.drew.call(this,w,g),!this.aborted)){var ee=function(e){if(!t.aborted){var a=function(e){return t.done({naturalWidth:r,naturalHeight:i,result:e})};if(e&&Z&&v.retainExif&&t.exif&&t.exif.length>0){var n=function(e){return a(l(p(function(e,t){var r=h(new Uint8Array(e));if(255!==r[2]||224!==r[3])return e;var i=256*r[4]+r[5],a=[255,216].concat(t,r.slice(4+i));return new Uint8Array(a)}(e,t.exif),v.mimeType)))};if(e.arrayBuffer)e.arrayBuffer().then(n).catch((function(){t.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))}));else{var o=new O;t.reader=o,o.onload=function(e){var t=e.target;n(t.result)},o.onabort=function(){t.fail(new Error("Aborted to read the compressed image with FileReader."))},o.onerror=function(){t.fail(new Error("Failed to read the compressed image with FileReader."))},o.onloadend=function(){t.reader=null},o.readAsArrayBuffer(e)}}else a(e)}};g.toBlob?g.toBlob(ee,v.mimeType,v.quality):ee(l(g.toDataURL(v.mimeType,v.quality)))}}},{key:"done",value:function(e){var t,r,i=e.naturalWidth,a=e.naturalHeight,n=e.result,o=this.file,l=this.image,s=this.options;if(A&&0===l.src.indexOf("blob:")&&A.revokeObjectURL(l.src),n)if(s.strict&&!s.retainExif&&n.size>o.size&&s.mimeType===o.type&&!(s.width>i||s.height>a||s.minWidth>i||s.minHeight>a||s.maxWidth