expatbase/var/www/html/flarum/public/assets/extensions/fof-profile-image-crop/chunk~modules.js
2025-08-29 00:22:05 +09:00

3 lines
No EOL
85 KiB
JavaScript

/*! For license information please see chunk~modules.js.LICENSE.txt */
(self["webpackChunkmodule_exports"]=self["webpackChunkmodule_exports"]||[]).push([[54],{558:function(t){1&&(t.exports=function(){"use strict";function t(t,e){var i=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),i.push.apply(i,n)}return i}function e(e){for(var i=1;i<arguments.length;i++){var n=null!=arguments[i]?arguments[i]:{};i%2?t(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):t(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(t){return i="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},i(t)}function n(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function a(t,e,i){return e in t?Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}function r(t){return function(t){if(Array.isArray(t))return o(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return o(t,e);var i=Object.prototype.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)?o(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var s="undefined"!=typeof window&&void 0!==window.document,h=s?window:{},c=!(!s||!h.document.documentElement)&&"ontouchstart"in h.document.documentElement,A=!!s&&"PointerEvent"in h,u="cropper",l="all",f="crop",d="move",g="zoom",p="e",m="w",v="s",w="n",b="ne",y="nw",I="se",B="sw",_="".concat(u,"-crop"),E="".concat(u,"-disabled"),C="".concat(u,"-hidden"),x="".concat(u,"-hide"),Q="".concat(u,"-invisible"),M="".concat(u,"-modal"),D="".concat(u,"-move"),k="".concat(u,"Action"),R="".concat(u,"Preview"),U="crop",O="move",H="none",j="crop",L="cropend",T="cropmove",W="cropstart",z="dblclick",G=A?"pointerdown":c?"touchstart":"mousedown",N=A?"pointermove":c?"touchmove":"mousemove",S=A?"pointerup pointercancel":c?"touchend touchcancel":"mouseup",Y="ready",P="resize",F="wheel",q="zoom",X="image/jpeg",J=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Z=/^data:/,K=/^data:image\/jpeg;base64,/,V=/^img|canvas$/i,$=200,tt=100,et={viewMode:0,dragMode:U,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:$,minContainerHeight:tt,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},it='<div class="cropper-container" touch-action="none">'+'<div class="cropper-wrap-box">'+'<div class="cropper-canvas"></div>'+"</div>"+'<div class="cropper-drag-box"></div>'+'<div class="cropper-crop-box">'+'<span class="cropper-view-box"></span>'+'<span class="cropper-dashed dashed-h"></span>'+'<span class="cropper-dashed dashed-v"></span>'+'<span class="cropper-center"></span>'+'<span class="cropper-face"></span>'+'<span class="cropper-line line-e" data-cropper-action="e"></span>'+'<span class="cropper-line line-n" data-cropper-action="n"></span>'+'<span class="cropper-line line-w" data-cropper-action="w"></span>'+'<span class="cropper-line line-s" data-cropper-action="s"></span>'+'<span class="cropper-point point-e" data-cropper-action="e"></span>'+'<span class="cropper-point point-n" data-cropper-action="n"></span>'+'<span class="cropper-point point-w" data-cropper-action="w"></span>'+'<span class="cropper-point point-s" data-cropper-action="s"></span>'+'<span class="cropper-point point-ne" data-cropper-action="ne"></span>'+'<span class="cropper-point point-nw" data-cropper-action="nw"></span>'+'<span class="cropper-point point-sw" data-cropper-action="sw"></span>'+'<span class="cropper-point point-se" data-cropper-action="se"></span>'+"</div>"+"</div>",nt=Number.isNaN||h.isNaN;function at(t){return"number"==typeof t&&!nt(t)}var rt=function(t){return t>0&&t<1/0};function ot(t){return void 0===t}function st(t){return"object"===i(t)&&null!==t}var ht=Object.prototype.hasOwnProperty;function ct(t){if(!st(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&ht.call(i,"isPrototypeOf")}catch(t){return!1}}function At(t){return"function"==typeof t}var ut=Array.prototype.slice;function lt(t){return Array.from?Array.from(t):ut.call(t)}function ft(t,e){return t&&At(e)&&(Array.isArray(t)||at(t.length)?lt(t).forEach((function(i,n){e.call(t,i,n,t)})):st(t)&&Object.keys(t).forEach((function(i){e.call(t,t[i],i,t)}))),t}var dt=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),n=1;n<e;n++)i[n-1]=arguments[n];return st(t)&&i.length>0&&i.forEach((function(e){st(e)&&Object.keys(e).forEach((function(i){t[i]=e[i]}))})),t},gt=/\.\d*(?:0|9){12}\d*$/;function pt(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return gt.test(t)?Math.round(t*e)/e:t}var mt=/^width|height|left|top|marginLeft|marginTop$/;function vt(t,e){var i=t.style;ft(e,(function(t,e){mt.test(e)&&at(t)&&(t="".concat(t,"px")),i[e]=t}))}function wt(t,e){if(e)if(at(t.length))ft(t,(function(t){wt(t,e)}));else if(t.classList)t.classList.add(e);else{var i=t.className.trim();i?i.indexOf(e)<0&&(t.className="".concat(i," ").concat(e)):t.className=e}}function bt(t,e){e&&(at(t.length)?ft(t,(function(t){bt(t,e)})):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function yt(t,e,i){e&&(at(t.length)?ft(t,(function(t){yt(t,e,i)})):i?wt(t,e):bt(t,e))}var It=/([a-z\d])([A-Z])/g;function Bt(t){return t.replace(It,"$1-$2").toLowerCase()}function _t(t,e){return st(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(Bt(e)))}function Et(t,e,i){st(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(Bt(e)),i)}var Ct=/\s\s*/,xt=function(){var t=!1;if(s){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});h.addEventListener("test",i,n),h.removeEventListener("test",i,n)}return t}();function Qt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i;e.trim().split(Ct).forEach((function(e){if(!xt){var r=t.listeners;r&&r[e]&&r[e][i]&&(a=r[e][i],delete r[e][i],0===Object.keys(r[e]).length&&delete r[e],0===Object.keys(r).length&&delete t.listeners)}t.removeEventListener(e,a,n)}))}function Mt(t,e,i){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},a=i;e.trim().split(Ct).forEach((function(e){if(n.once&&!xt){var r=t.listeners,o=void 0===r?{}:r;a=function(){delete o[e][i],t.removeEventListener(e,a,n);for(var r=arguments.length,s=new Array(r),h=0;h<r;h++)s[h]=arguments[h];i.apply(t,s)},o[e]||(o[e]={}),o[e][i]&&t.removeEventListener(e,o[e][i],n),o[e][i]=a,t.listeners=o}t.addEventListener(e,a,n)}))}function Dt(t,e,i){var n;return At(Event)&&At(CustomEvent)?n=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(n=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(n)}function kt(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var Rt=h.location,Ut=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ot(t){var e=t.match(Ut);return null!==e&&(e[1]!==Rt.protocol||e[2]!==Rt.hostname||e[3]!==Rt.port)}function Ht(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function jt(t){var e=t.rotate,i=t.scaleX,n=t.scaleY,a=t.translateX,r=t.translateY,o=[];at(a)&&0!==a&&o.push("translateX(".concat(a,"px)")),at(r)&&0!==r&&o.push("translateY(".concat(r,"px)")),at(e)&&0!==e&&o.push("rotate(".concat(e,"deg)")),at(i)&&1!==i&&o.push("scaleX(".concat(i,")")),at(n)&&1!==n&&o.push("scaleY(".concat(n,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Lt(t,i){var n=t.pageX,a=t.pageY,r={endX:n,endY:a};return i?r:e({startX:n,startY:a},r)}function Tt(t){var e=t.aspectRatio,i=t.height,n=t.width,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=rt(n),o=rt(i);if(r&&o){var s=i*e;"contain"===a&&s>n||"cover"===a&&s<n?i=n/e:n=i*e}else r?i=n/e:o&&(n=i*e);return{width:n,height:i}}var Wt=String.fromCharCode;var zt=/^data:.*,/;function Gt(t){var e,i=new DataView(t);try{var n,a,r;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var o=i.byteLength,s=2;s+1<o;){if(255===i.getUint8(s)&&225===i.getUint8(s+1)){a=s;break}s+=1}if(a){var h=a+10;if("Exif"===function(t,e,i){var n="";i+=e;for(var a=e;a<i;a+=1)n+=Wt(t.getUint8(a));return n}(i,a+4,4)){var c=i.getUint16(h);if(((n=18761===c)||19789===c)&&42===i.getUint16(h+2,n)){var A=i.getUint32(h+4,n);A>=8&&(r=h+A)}}}if(r){var u,l,f=i.getUint16(r,n);for(l=0;l<f;l+=1)if(u=r+12*l+2,274===i.getUint16(u,n)){u+=8,e=i.getUint16(u,n),i.setUint16(u,1,n);break}}}catch(t){e=1}return e}var Nt={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,e=this.options,i=this.container,n=this.cropper,a=Number(e.minContainerWidth),r=Number(e.minContainerHeight);wt(n,C),bt(t,C);var o={width:Math.max(i.offsetWidth,a>=0?a:$),height:Math.max(i.offsetHeight,r>=0?r:tt)};this.containerData=o,vt(n,{width:o.width,height:o.height}),wt(t,C),bt(n,C)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,n=Math.abs(e.rotate)%180==90,a=n?e.naturalHeight:e.naturalWidth,r=n?e.naturalWidth:e.naturalHeight,o=a/r,s=t.width,h=t.height;t.height*o>t.width?3===i?s=t.height*o:h=t.width/o:3===i?h=t.width/o:s=t.height*o;var c={aspectRatio:o,naturalWidth:a,naturalHeight:r,width:s,height:h};this.canvasData=c,this.limited=1===i||2===i,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=dt({},c)},limitCanvas:function(t,e){var i=this.options,n=this.containerData,a=this.canvasData,r=this.cropBoxData,o=i.viewMode,s=a.aspectRatio,h=this.cropped&&r;if(t){var c=Number(i.minCanvasWidth)||0,A=Number(i.minCanvasHeight)||0;o>1?(c=Math.max(c,n.width),A=Math.max(A,n.height),3===o&&(A*s>c?c=A*s:A=c/s)):o>0&&(c?c=Math.max(c,h?r.width:0):A?A=Math.max(A,h?r.height:0):h&&(c=r.width,(A=r.height)*s>c?c=A*s:A=c/s));var u=Tt({aspectRatio:s,width:c,height:A});c=u.width,A=u.height,a.minWidth=c,a.minHeight=A,a.maxWidth=1/0,a.maxHeight=1/0}if(e)if(o>(h?0:1)){var l=n.width-a.width,f=n.height-a.height;a.minLeft=Math.min(0,l),a.minTop=Math.min(0,f),a.maxLeft=Math.max(0,l),a.maxTop=Math.max(0,f),h&&this.limited&&(a.minLeft=Math.min(r.left,r.left+(r.width-a.width)),a.minTop=Math.min(r.top,r.top+(r.height-a.height)),a.maxLeft=r.left,a.maxTop=r.top,2===o&&(a.width>=n.width&&(a.minLeft=Math.min(0,l),a.maxLeft=Math.max(0,l)),a.height>=n.height&&(a.minTop=Math.min(0,f),a.maxTop=Math.max(0,f))))}else a.minLeft=-a.width,a.minTop=-a.height,a.maxLeft=n.width,a.maxTop=n.height},renderCanvas:function(t,e){var i=this.canvasData,n=this.imageData;if(e){var a=function(t){var e=t.width,i=t.height,n=t.degree;if(90==(n=Math.abs(n)%180))return{width:i,height:e};var a=n%90*Math.PI/180,r=Math.sin(a),o=Math.cos(a),s=e*o+i*r,h=e*r+i*o;return n>90?{width:h,height:s}:{width:s,height:h}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),r=a.width,o=a.height,s=i.width*(r/i.naturalWidth),h=i.height*(o/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(h-i.height)/2,i.width=s,i.height=h,i.aspectRatio=r/o,i.naturalWidth=r,i.naturalHeight=o,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,vt(this.canvas,dt({width:i.width,height:i.height},jt({translateX:i.left,translateY:i.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var e=this.canvasData,i=this.imageData,n=i.naturalWidth*(e.width/e.naturalWidth),a=i.naturalHeight*(e.height/e.naturalHeight);dt(i,{width:n,height:a,left:(e.width-n)/2,top:(e.height-a)/2}),vt(this.image,dt({width:i.width,height:i.height},jt(dt({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,a={width:e.width,height:e.height};i&&(e.height*i>e.width?a.height=a.width/i:a.width=a.height*i),this.cropBoxData=a,this.limitCropBox(!0,!0),a.width=Math.min(Math.max(a.width,a.minWidth),a.maxWidth),a.height=Math.min(Math.max(a.height,a.minHeight),a.maxHeight),a.width=Math.max(a.minWidth,a.width*n),a.height=Math.max(a.minHeight,a.height*n),a.left=e.left+(e.width-a.width)/2,a.top=e.top+(e.height-a.height)/2,a.oldLeft=a.left,a.oldTop=a.top,this.initialCropBoxData=dt({},a)},limitCropBox:function(t,e){var i=this.options,n=this.containerData,a=this.canvasData,r=this.cropBoxData,o=this.limited,s=i.aspectRatio;if(t){var h=Number(i.minCropBoxWidth)||0,c=Number(i.minCropBoxHeight)||0,A=o?Math.min(n.width,a.width,a.width+a.left,n.width-a.left):n.width,u=o?Math.min(n.height,a.height,a.height+a.top,n.height-a.top):n.height;h=Math.min(h,n.width),c=Math.min(c,n.height),s&&(h&&c?c*s>h?c=h/s:h=c*s:h?c=h/s:c&&(h=c*s),u*s>A?u=A/s:A=u*s),r.minWidth=Math.min(h,A),r.minHeight=Math.min(c,u),r.maxWidth=A,r.maxHeight=u}e&&(o?(r.minLeft=Math.max(0,a.left),r.minTop=Math.max(0,a.top),r.maxLeft=Math.min(n.width,a.left+a.width)-r.width,r.maxTop=Math.min(n.height,a.top+a.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=n.width-r.width,r.maxTop=n.height-r.height))},renderCropBox:function(){var t=this.options,e=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,t.movable&&t.cropBoxMovable&&Et(this.face,k,i.width>=e.width&&i.height>=e.height?d:l),vt(this.cropBox,dt({width:i.width,height:i.height},jt({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Dt(this.element,j,this.getData())}},St={initPreview:function(){var t=this.element,e=this.crossOrigin,i=this.options.preview,n=e?this.crossOriginUrl:this.url,a=t.alt||"The image to preview",r=document.createElement("img");if(e&&(r.crossOrigin=e),r.src=n,r.alt=a,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var o=i;"string"==typeof i?o=t.ownerDocument.querySelectorAll(i):i.querySelector&&(o=[i]),this.previews=o,ft(o,(function(t){var i=document.createElement("img");Et(t,R,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML}),e&&(i.crossOrigin=e),i.src=n,i.alt=a,i.style.cssText="display:block;"+"width:100%;"+"height:auto;"+"min-width:0!important;"+"min-height:0!important;"+"max-width:none!important;"+"max-height:none!important;"+'image-orientation:0deg!important;"',t.innerHTML="",t.appendChild(i)}))}},resetPreview:function(){ft(this.previews,(function(t){var e=_t(t,R);vt(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(st(t[e]))try{delete t[e]}catch(i){t[e]=void 0}else if(t.dataset)try{delete t.dataset[e]}catch(i){t.dataset[e]=void 0}else t.removeAttribute("data-".concat(Bt(e)))}(t,R)}))},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,n=i.width,a=i.height,r=t.width,o=t.height,s=i.left-e.left-t.left,h=i.top-e.top-t.top;this.cropped&&!this.disabled&&(vt(this.viewBoxImage,dt({width:r,height:o},jt(dt({translateX:-s,translateY:-h},t)))),ft(this.previews,(function(e){var i=_t(e,R),c=i.width,A=i.height,u=c,l=A,f=1;n&&(l=a*(f=c/n)),a&&l>A&&(u=n*(f=A/a),l=A),vt(e,{width:u,height:l}),vt(e.getElementsByTagName("img")[0],dt({width:r*f,height:o*f},jt(dt({translateX:-s*f,translateY:-h*f},t))))})))}},Yt={bind:function(){var t=this.element,e=this.options,i=this.cropper;At(e.cropstart)&&Mt(t,W,e.cropstart),At(e.cropmove)&&Mt(t,T,e.cropmove),At(e.cropend)&&Mt(t,L,e.cropend),At(e.crop)&&Mt(t,j,e.crop),At(e.zoom)&&Mt(t,q,e.zoom),Mt(i,G,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&Mt(i,F,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Mt(i,z,this.onDblclick=this.dblclick.bind(this)),Mt(t.ownerDocument,N,this.onCropMove=this.cropMove.bind(this)),Mt(t.ownerDocument,S,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&Mt(window,P,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;At(e.cropstart)&&Qt(t,W,e.cropstart),At(e.cropmove)&&Qt(t,T,e.cropmove),At(e.cropend)&&Qt(t,L,e.cropend),At(e.crop)&&Qt(t,j,e.crop),At(e.zoom)&&Qt(t,q,e.zoom),Qt(i,G,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Qt(i,F,this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Qt(i,z,this.onDblclick),Qt(t.ownerDocument,N,this.onCropMove),Qt(t.ownerDocument,S,this.onCropEnd),e.responsive&&Qt(window,P,this.onResize)}},Pt={resize:function(){if(!this.disabled){var t,e,i=this.options,n=this.container,a=this.containerData,r=n.offsetWidth/a.width,o=n.offsetHeight/a.height,s=Math.abs(r-1)>Math.abs(o-1)?r:o;1!==s&&(i.restore&&(t=this.getCanvasData(),e=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(ft(t,(function(e,i){t[i]=e*s}))),this.setCropBoxData(ft(e,(function(t,i){e[i]=t*s})))))}},dblclick:function(){var t,e;this.disabled||this.options.dragMode===H||this.setDragMode((t=this.dragBox,e=_,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?O:U))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){e.wheeling=!1}),50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(at(e)&&1!==e||at(i)&&0!==i||t.ctrlKey))){var n,a=this.options,r=this.pointers;t.changedTouches?ft(t.changedTouches,(function(t){r[t.identifier]=Lt(t)})):r[t.pointerId||0]=Lt(t),n=Object.keys(r).length>1&&a.zoomable&&a.zoomOnTouch?g:_t(t.target,k),J.test(n)&&!1!==Dt(this.element,W,{originalEvent:t,action:n})&&(t.preventDefault(),this.action=n,this.cropping=!1,n===f&&(this.cropping=!0,wt(this.dragBox,M)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==Dt(this.element,T,{originalEvent:t,action:e})&&(t.changedTouches?ft(t.changedTouches,(function(t){dt(i[t.identifier]||{},Lt(t,!0))})):dt(i[t.pointerId||0]||{},Lt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?ft(t.changedTouches,(function(t){delete i[t.identifier]})):delete i[t.pointerId||0],e&&(t.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,yt(this.dragBox,M,this.cropped&&this.options.modal)),Dt(this.element,L,{originalEvent:t,action:e}))}}},Ft={change:function(t){var i,n=this.options,a=this.canvasData,r=this.containerData,o=this.cropBoxData,s=this.pointers,h=this.action,c=n.aspectRatio,A=o.left,u=o.top,_=o.width,E=o.height,x=A+_,Q=u+E,M=0,D=0,k=r.width,R=r.height,U=!0;!c&&t.shiftKey&&(c=_&&E?_/E:1),this.limited&&(M=o.minLeft,D=o.minTop,k=M+Math.min(r.width,a.width,a.left+a.width),R=D+Math.min(r.height,a.height,a.top+a.height));var O=s[Object.keys(s)[0]],H={x:O.endX-O.startX,y:O.endY-O.startY},j=function(t){switch(t){case p:x+H.x>k&&(H.x=k-x);break;case m:A+H.x<M&&(H.x=M-A);break;case w:u+H.y<D&&(H.y=D-u);break;case v:Q+H.y>R&&(H.y=R-Q)}};switch(h){case l:A+=H.x,u+=H.y;break;case p:if(H.x>=0&&(x>=k||c&&(u<=D||Q>=R))){U=!1;break}j(p),(_+=H.x)<0&&(h=m,A-=_=-_),c&&(E=_/c,u+=(o.height-E)/2);break;case w:if(H.y<=0&&(u<=D||c&&(A<=M||x>=k))){U=!1;break}j(w),E-=H.y,u+=H.y,E<0&&(h=v,u-=E=-E),c&&(_=E*c,A+=(o.width-_)/2);break;case m:if(H.x<=0&&(A<=M||c&&(u<=D||Q>=R))){U=!1;break}j(m),_-=H.x,A+=H.x,_<0&&(h=p,A-=_=-_),c&&(E=_/c,u+=(o.height-E)/2);break;case v:if(H.y>=0&&(Q>=R||c&&(A<=M||x>=k))){U=!1;break}j(v),(E+=H.y)<0&&(h=w,u-=E=-E),c&&(_=E*c,A+=(o.width-_)/2);break;case b:if(c){if(H.y<=0&&(u<=D||x>=k)){U=!1;break}j(w),E-=H.y,u+=H.y,_=E*c}else j(w),j(p),H.x>=0?x<k?_+=H.x:H.y<=0&&u<=D&&(U=!1):_+=H.x,H.y<=0?u>D&&(E-=H.y,u+=H.y):(E-=H.y,u+=H.y);_<0&&E<0?(h=B,u-=E=-E,A-=_=-_):_<0?(h=y,A-=_=-_):E<0&&(h=I,u-=E=-E);break;case y:if(c){if(H.y<=0&&(u<=D||A<=M)){U=!1;break}j(w),E-=H.y,u+=H.y,_=E*c,A+=o.width-_}else j(w),j(m),H.x<=0?A>M?(_-=H.x,A+=H.x):H.y<=0&&u<=D&&(U=!1):(_-=H.x,A+=H.x),H.y<=0?u>D&&(E-=H.y,u+=H.y):(E-=H.y,u+=H.y);_<0&&E<0?(h=I,u-=E=-E,A-=_=-_):_<0?(h=b,A-=_=-_):E<0&&(h=B,u-=E=-E);break;case B:if(c){if(H.x<=0&&(A<=M||Q>=R)){U=!1;break}j(m),_-=H.x,A+=H.x,E=_/c}else j(v),j(m),H.x<=0?A>M?(_-=H.x,A+=H.x):H.y>=0&&Q>=R&&(U=!1):(_-=H.x,A+=H.x),H.y>=0?Q<R&&(E+=H.y):E+=H.y;_<0&&E<0?(h=b,u-=E=-E,A-=_=-_):_<0?(h=I,A-=_=-_):E<0&&(h=y,u-=E=-E);break;case I:if(c){if(H.x>=0&&(x>=k||Q>=R)){U=!1;break}j(p),E=(_+=H.x)/c}else j(v),j(p),H.x>=0?x<k?_+=H.x:H.y>=0&&Q>=R&&(U=!1):_+=H.x,H.y>=0?Q<R&&(E+=H.y):E+=H.y;_<0&&E<0?(h=y,u-=E=-E,A-=_=-_):_<0?(h=B,A-=_=-_):E<0&&(h=b,u-=E=-E);break;case d:this.move(H.x,H.y),U=!1;break;case g:this.zoom(function(t){var i=e({},t),n=0;return ft(t,(function(t,e){delete i[e],ft(i,(function(e){var i=Math.abs(t.startX-e.startX),a=Math.abs(t.startY-e.startY),r=Math.abs(t.endX-e.endX),o=Math.abs(t.endY-e.endY),s=Math.sqrt(i*i+a*a),h=(Math.sqrt(r*r+o*o)-s)/s;Math.abs(h)>Math.abs(n)&&(n=h)}))})),n}(s),t),U=!1;break;case f:if(!H.x||!H.y){U=!1;break}i=kt(this.cropper),A=O.startX-i.left,u=O.startY-i.top,_=o.minWidth,E=o.minHeight,H.x>0?h=H.y>0?I:b:H.x<0&&(A-=_,h=H.y>0?B:y),H.y<0&&(u-=E),this.cropped||(bt(this.cropBox,C),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}U&&(o.width=_,o.height=E,o.left=A,o.top=u,this.action=h,this.renderCropBox()),ft(s,(function(t){t.startX=t.endX,t.startY=t.endY}))}},qt={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&wt(this.dragBox,M),bt(this.cropBox,C),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=dt({},this.initialImageData),this.canvasData=dt({},this.initialCanvasData),this.cropBoxData=dt({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(dt(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),bt(this.dragBox,M),wt(this.cropBox,C)),this},replace:function(t){var e=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),e?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,ft(this.previews,(function(e){e.getElementsByTagName("img")[0].src=t})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,bt(this.cropper,E)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,wt(this.cropper,E)),this},destroy:function(){var t=this.element;return t[u]?(t[u]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,n=i.left,a=i.top;return this.moveTo(ot(t)?t:n+Number(t),ot(e)?e:a+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(at(t)&&(i.left=t,n=!0),at(e)&&(i.top=e,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,e){var i=this.canvasData;return t=(t=Number(t))<0?1/(1-t):1+t,this.zoomTo(i.width*t/i.naturalWidth,null,e)},zoomTo:function(t,e,i){var n=this.options,a=this.canvasData,r=a.width,o=a.height,s=a.naturalWidth,h=a.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&n.zoomable){var c=s*t,A=h*t;if(!1===Dt(this.element,q,{ratio:t,oldRatio:r/s,originalEvent:i}))return this;if(i){var u=this.pointers,l=kt(this.cropper),f=u&&Object.keys(u).length?function(t){var e=0,i=0,n=0;return ft(t,(function(t){var a=t.startX,r=t.startY;e+=a,i+=r,n+=1})),{pageX:e/=n,pageY:i/=n}}(u):{pageX:i.pageX,pageY:i.pageY};a.left-=(c-r)*((f.pageX-l.left-a.left)/r),a.top-=(A-o)*((f.pageY-l.top-a.top)/o)}else ct(e)&&at(e.x)&&at(e.y)?(a.left-=(c-r)*((e.x-a.left)/r),a.top-=(A-o)*((e.y-a.top)/o)):(a.left-=(c-r)/2,a.top-=(A-o)/2);a.width=c,a.height=A,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return at(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var e=this.imageData.scaleY;return this.scale(t,at(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(at(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,n=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(at(t)&&(i.scaleX=t,n=!0),at(e)&&(i.scaleY=e,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,n=this.imageData,a=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){t={x:r.left-a.left,y:r.top-a.top,width:r.width,height:r.height};var o=n.width/n.naturalWidth;if(ft(t,(function(e,i){t[i]=e/o})),e){var s=Math.round(t.y+t.height),h=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=h-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return i.rotatable&&(t.rotate=n.rotate||0),i.scalable&&(t.scaleX=n.scaleX||1,t.scaleY=n.scaleY||1),t},setData:function(t){var e=this.options,i=this.imageData,n=this.canvasData,a={};if(this.ready&&!this.disabled&&ct(t)){var r=!1;e.rotatable&&at(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,r=!0),e.scalable&&(at(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,r=!0),at(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var o=i.width/i.naturalWidth;at(t.x)&&(a.left=t.x*o+n.left),at(t.y)&&(a.top=t.y*o+n.top),at(t.width)&&(a.width=t.width*o),at(t.height)&&(a.height=t.height*o),this.setCropBoxData(a)}return this},getContainerData:function(){return this.ready?dt({},this.containerData):{}},getImageData:function(){return this.sized?dt({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&ft(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){e[i]=t[i]})),e},setCanvasData:function(t){var e=this.canvasData,i=e.aspectRatio;return this.ready&&!this.disabled&&ct(t)&&(at(t.left)&&(e.left=t.left),at(t.top)&&(e.top=t.top),at(t.width)?(e.width=t.width,e.height=t.width/i):at(t.height)&&(e.height=t.height,e.width=t.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var t,e=this.cropBoxData;return this.ready&&this.cropped&&(t={left:e.left,top:e.top,width:e.width,height:e.height}),t||{}},setCropBoxData:function(t){var e,i,n=this.cropBoxData,a=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&ct(t)&&(at(t.left)&&(n.left=t.left),at(t.top)&&(n.top=t.top),at(t.width)&&t.width!==n.width&&(e=!0,n.width=t.width),at(t.height)&&t.height!==n.height&&(i=!0,n.height=t.height),a&&(e?n.height=n.width/a:i&&(n.width=n.height*a)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var e=this.canvasData,i=function(t,e,i,n){var a=e.aspectRatio,o=e.naturalWidth,s=e.naturalHeight,h=e.rotate,c=void 0===h?0:h,A=e.scaleX,u=void 0===A?1:A,l=e.scaleY,f=void 0===l?1:l,d=i.aspectRatio,g=i.naturalWidth,p=i.naturalHeight,m=n.fillColor,v=void 0===m?"transparent":m,w=n.imageSmoothingEnabled,b=void 0===w||w,y=n.imageSmoothingQuality,I=void 0===y?"low":y,B=n.maxWidth,_=void 0===B?1/0:B,E=n.maxHeight,C=void 0===E?1/0:E,x=n.minWidth,Q=void 0===x?0:x,M=n.minHeight,D=void 0===M?0:M,k=document.createElement("canvas"),R=k.getContext("2d"),U=Tt({aspectRatio:d,width:_,height:C}),O=Tt({aspectRatio:d,width:Q,height:D},"cover"),H=Math.min(U.width,Math.max(O.width,g)),j=Math.min(U.height,Math.max(O.height,p)),L=Tt({aspectRatio:a,width:_,height:C}),T=Tt({aspectRatio:a,width:Q,height:D},"cover"),W=Math.min(L.width,Math.max(T.width,o)),z=Math.min(L.height,Math.max(T.height,s)),G=[-W/2,-z/2,W,z];return k.width=pt(H),k.height=pt(j),R.fillStyle=v,R.fillRect(0,0,H,j),R.save(),R.translate(H/2,j/2),R.rotate(c*Math.PI/180),R.scale(u,f),R.imageSmoothingEnabled=b,R.imageSmoothingQuality=I,R.drawImage.apply(R,[t].concat(r(G.map((function(t){return Math.floor(pt(t))}))))),R.restore(),k}(this.image,this.imageData,e,t);if(!this.cropped)return i;var n=this.getData(),a=n.x,o=n.y,s=n.width,h=n.height,c=i.width/Math.floor(e.naturalWidth);1!==c&&(a*=c,o*=c,s*=c,h*=c);var A=s/h,u=Tt({aspectRatio:A,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),l=Tt({aspectRatio:A,width:t.minWidth||0,height:t.minHeight||0},"cover"),f=Tt({aspectRatio:A,width:t.width||(1!==c?i.width:s),height:t.height||(1!==c?i.height:h)}),d=f.width,g=f.height;d=Math.min(u.width,Math.max(l.width,d)),g=Math.min(u.height,Math.max(l.height,g));var p=document.createElement("canvas"),m=p.getContext("2d");p.width=pt(d),p.height=pt(g),m.fillStyle=t.fillColor||"transparent",m.fillRect(0,0,d,g);var v=t.imageSmoothingEnabled,w=void 0===v||v,b=t.imageSmoothingQuality;m.imageSmoothingEnabled=w,b&&(m.imageSmoothingQuality=b);var y,I,B,_,E,C,x=i.width,Q=i.height,M=a,D=o;M<=-s||M>x?(M=0,y=0,B=0,E=0):M<=0?(B=-M,M=0,E=y=Math.min(x,s+M)):M<=x&&(B=0,E=y=Math.min(s,x-M)),y<=0||D<=-h||D>Q?(D=0,I=0,_=0,C=0):D<=0?(_=-D,D=0,C=I=Math.min(Q,h+D)):D<=Q&&(_=0,C=I=Math.min(h,Q-D));var k=[M,D,y,I];if(E>0&&C>0){var R=d/s;k.push(B*R,_*R,E*R,C*R)}return m.drawImage.apply(m,[i].concat(r(k.map((function(t){return Math.floor(pt(t))}))))),p},setAspectRatio:function(t){var e=this.options;return this.disabled||ot(t)||(e.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var e=this.options,i=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var a=t===U,r=e.movable&&t===O;t=a||r?t:H,e.dragMode=t,Et(i,k,t),yt(i,_,a),yt(i,D,r),e.cropBoxMovable||(Et(n,k,t),yt(n,_,a),yt(n,D,r))}return this}},Xt=h.Cropper,Jt=function(){function t(e){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),!e||!V.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=dt({},et,ct(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return e=t,a=[{key:"noConflict",value:function(){return window.Cropper=Xt,t}},{key:"setDefaults",value:function(t){dt(et,ct(t)&&t)}}],(i=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e[u]){if(e[u]=this,"img"===i){if(this.isImg=!0,t=e.getAttribute("src")||"",this.originalUrl=t,!t)return;t=e.src}else"canvas"===i&&window.HTMLCanvasElement&&(t=e.toDataURL());this.load(t)}}},{key:"load",value:function(t){var e,i,n,a,r=this;if(t){this.url=t,this.imageData={};var o=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if(Z.test(t))K.test(t)?this.read((e=t.replace(zt,""),i=atob(e),n=new ArrayBuffer(i.length),ft(a=new Uint8Array(n),(function(t,e){a[e]=i.charCodeAt(e)})),n)):this.clone();else{var h=new XMLHttpRequest,c=this.clone.bind(this);this.reloading=!0,this.xhr=h,h.onabort=c,h.onerror=c,h.ontimeout=c,h.onprogress=function(){h.getResponseHeader("content-type")!==X&&h.abort()},h.onload=function(){r.read(h.response)},h.onloadend=function(){r.reloading=!1,r.xhr=null},s.checkCrossOrigin&&Ot(t)&&o.crossOrigin&&(t=Ht(t)),h.open("GET",t,!0),h.responseType="arraybuffer",h.withCredentials="use-credentials"===o.crossOrigin,h.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,n=Gt(t),a=0,r=1,o=1;if(n>1){this.url=function(t,e){for(var i=[],n=8192,a=new Uint8Array(t);a.length>0;)i.push(Wt.apply(null,lt(a.subarray(0,n)))),a=a.subarray(n);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,X);var s=function(t){var e=0,i=1,n=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:n=-1;break;case 5:e=90,n=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:n}}(n);a=s.rotate,r=s.scaleX,o=s.scaleY}e.rotatable&&(i.rotate=a),e.scalable&&(i.scaleX=r,i.scaleY=o),this.clone()}},{key:"clone",value:function(){var t=this.element,e=this.url,i=t.crossOrigin,n=e;this.options.checkCrossOrigin&&Ot(e)&&(i||(i="anonymous"),n=Ht(e)),this.crossOrigin=i,this.crossOriginUrl=n;var a=document.createElement("img");i&&(a.crossOrigin=i),a.src=n||e,a.alt=t.alt||"The image to crop",this.image=a,a.onload=this.start.bind(this),a.onerror=this.stop.bind(this),wt(a,x),t.parentNode.insertBefore(a,t.nextSibling)}},{key:"start",value:function(){var t=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=h.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(h.navigator.userAgent),n=function(e,i){dt(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.initialImageData=dt({},t.imageData),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var a=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=a,a.onload=function(){n(a.width,a.height),i||r.removeChild(a)},a.src=e.src,i||(a.style.cssText="left:0;"+"max-height:none!important;"+"max-width:none!important;"+"min-height:0!important;"+"min-width:0!important;"+"opacity:0;"+"position:absolute;"+"top:0;"+"z-index:-1;",r.appendChild(a))}else n(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var t=this.image;t.onload=null,t.onerror=null,t.parentNode.removeChild(t),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var t=this.element,e=this.options,i=this.image,n=t.parentNode,a=document.createElement("div");a.innerHTML=it;var r=a.querySelector(".".concat(u,"-container")),o=r.querySelector(".".concat(u,"-canvas")),s=r.querySelector(".".concat(u,"-drag-box")),h=r.querySelector(".".concat(u,"-crop-box")),c=h.querySelector(".".concat(u,"-face"));this.container=n,this.cropper=r,this.canvas=o,this.dragBox=s,this.cropBox=h,this.viewBox=r.querySelector(".".concat(u,"-view-box")),this.face=c,o.appendChild(i),wt(t,C),n.insertBefore(r,t.nextSibling),bt(i,x),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,wt(h,C),e.guides||wt(h.getElementsByClassName("".concat(u,"-dashed")),C),e.center||wt(h.getElementsByClassName("".concat(u,"-center")),C),e.background&&wt(r,"".concat(u,"-bg")),e.highlight||wt(c,Q),e.cropBoxMovable&&(wt(c,D),Et(c,k,l)),e.cropBoxResizable||(wt(h.getElementsByClassName("".concat(u,"-line")),C),wt(h.getElementsByClassName("".concat(u,"-point")),C)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),At(e.ready)&&Mt(t,Y,e.ready,{once:!0}),Dt(t,Y)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var t=this.cropper.parentNode;t&&t.removeChild(this.cropper),bt(this.element,C)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&n(e.prototype,i),a&&n(e,a),Object.defineProperty(e,"prototype",{writable:!1}),t;var e,i,a}();return dt(Jt.prototype,Nt,St,Yt,Pt,Ft,qt),Jt}())},291:(t,e,i)=>{"use strict";var n=i(984),a=i(634);function r(t){if(!(this instanceof r))return new r(t);t=t||{},this.pica=t.pica||a({}),this.initialized=!1,this.utils=n}r.prototype.use=function(t){var e=[this].concat(Array.prototype.slice.call(arguments,1));return t.apply(t,e),this},r.prototype.init=function(){this.use(i(780).f0)},r.prototype.toBlob=function(t,e){var i={blob:t,opts:n.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(i).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then(this._create_blob).then((function(t){return t.out_canvas.width=t.out_canvas.height=0,t.out_blob}))},r.prototype.toCanvas=function(t,e){var i={blob:t,opts:n.assign({max:1/0},e)};return this.initialized||(this.init(),this.initialized=!0),Promise.resolve(i).then(this._blob_to_image).then(this._calculate_size).then(this._transform).then(this._cleanup).then((function(t){return t.out_canvas}))},r.prototype.before=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var i=this[t],n=this;return this[t]=function(t){return e.call(n,t).then((function(t){return i.call(n,t)}))},this},r.prototype.after=function(t,e){if(!this[t])throw new Error('Method "'+t+'" does not exist');if("function"!=typeof e)throw new Error('Invalid argument "fn", function expected');var i=this[t],n=this;return this[t]=function(t){return i.call(n,t).then((function(t){return e.call(n,t)}))},this},r.prototype._blob_to_image=function(t){var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return t.image=document.createElement("img"),t.image_url=e.createObjectURL(t.blob),t.image.src=t.image_url,new Promise((function(e,i){t.image.onerror=function(){i(new Error("ImageBlobReduce: failed to create Image() from blob"))},t.image.onload=function(){e(t)}}))},r.prototype._calculate_size=function(t){var e=t.opts.max/Math.max(t.image.width,t.image.height);return e>1&&(e=1),t.transform_width=Math.max(Math.round(t.image.width*e),1),t.transform_height=Math.max(Math.round(t.image.height*e),1),t.scale_factor=e,Promise.resolve(t)},r.prototype._transform=function(t){t.out_canvas=this.pica.options.createCanvas(t.transform_width,t.transform_height),t.transform_width=null,t.transform_height=null;var e={alpha:"image/png"===t.blob.type};return this.utils.assign(e,this.utils.pick_pica_resize_options(t.opts)),this.pica.resize(t.image,t.out_canvas,e).then((function(){return t}))},r.prototype._cleanup=function(t){t.image.src="",t.image=null;var e=window.URL||window.webkitURL||window.mozURL||window.msURL;return e.revokeObjectURL&&e.revokeObjectURL(t.image_url),t.image_url=null,Promise.resolve(t)},r.prototype._create_blob=function(t){return this.pica.toBlob(t.out_canvas,t.blob.type).then((function(e){return t.out_blob=e,t}))},r.prototype._getUint8Array=function(t){return t.arrayBuffer?t.arrayBuffer().then((function(t){return new Uint8Array(t)})):new Promise((function(e,i){var n=new FileReader;n.readAsArrayBuffer(t),n.onload=function(){e(new Uint8Array(n.result))},n.onerror=function(){i(new Error("ImageBlobReduce: failed to load data from input blob")),n.abort()},n.onabort=function(){i(new Error("ImageBlobReduce: failed to load data from input blob (aborted)"))}}))},r.pica=a,t.exports=r},663:t=>{"use strict";function e(t,e){var i=new Error(t);return i.code=e,i}function i(t){for(var e=t.toString(16).toUpperCase(),i=2-e.length;i>0;i--)e="0"+e;return"0x"+e}function n(t){try{return decodeURIComponent(escape(t))}catch(e){return t}}function a(t){return"[object Uint8Array]"===Object.prototype.toString.call(t)}function r(t,i,n){this.input=t.subarray(i,n),this.start=i;var a=String.fromCharCode.apply(null,this.input.subarray(0,4));if("II*\0"!==a&&"MM\0*"!==a)throw e("invalid TIFF signature","EBADDATA");this.big_endian="M"===a[0]}r.prototype.each=function(t){this.aborted=!1;var e=this.read_uint32(4);for(this.ifds_to_read=[{id:0,offset:e}];this.ifds_to_read.length>0&&!this.aborted;){var i=this.ifds_to_read.shift();i.offset&&this.scan_ifd(i.id,i.offset,t)}},r.prototype.filter=function(t){var i={ifd0:{id:0,entries:[]}};this.each((function(e){(!1!==t(e)||e.is_subifd_link)&&(e.is_subifd_link&&1!==e.count&&4!==e.format||(i["ifd"+e.ifd]||(i["ifd"+e.ifd]={id:e.ifd,entries:[]}),i["ifd"+e.ifd].entries.push(e)))})),delete i.ifd1;var n=8;Object.keys(i).forEach((function(t){n+=2,i[t].entries.forEach((function(t){n+=12+(t.data_length>4?2*Math.ceil(t.data_length/2):0)})),n+=4})),this.output=new Uint8Array(n),this.output[0]=this.output[1]=(this.big_endian?"M":"I").charCodeAt(0),this.write_uint16(2,42);var a=8,r=this;if(this.write_uint32(4,a),Object.keys(i).forEach((function(t){i[t].written_offset=a;var e=a,n=e+2+12*i[t].entries.length+4;a=n,r.write_uint16(e,i[t].entries.length),i[t].entries.sort((function(t,e){return t.tag-e.tag})).forEach((function(t,n){var o=e+2+12*n;r.write_uint16(o,t.tag),r.write_uint16(o+2,t.format),r.write_uint32(o+4,t.count),t.is_subifd_link?i["ifd"+t.tag]&&(i["ifd"+t.tag].link_offset=o+8):t.data_length<=4?r.output.set(r.input.subarray(t.data_offset-r.start,t.data_offset-r.start+4),o+8):(r.write_uint32(o+8,a),r.output.set(r.input.subarray(t.data_offset-r.start,t.data_offset-r.start+t.data_length),a),a+=2*Math.ceil(t.data_length/2))}));var o=i["ifd"+(i[t].id+1)];o&&(o.link_offset=n-4)})),Object.keys(i).forEach((function(t){i[t].written_offset&&i[t].link_offset&&r.write_uint32(i[t].link_offset,i[t].written_offset)})),this.output.length!==a)throw e("internal error: incorrect buffer size allocated");return this.output},r.prototype.read_uint16=function(t){var i=this.input;if(t+2>i.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?256*i[t]+i[t+1]:i[t]+256*i[t+1]},r.prototype.read_uint32=function(t){var i=this.input;if(t+4>i.length)throw e("unexpected EOF","EBADDATA");return this.big_endian?16777216*i[t]+65536*i[t+1]+256*i[t+2]+i[t+3]:i[t]+256*i[t+1]+65536*i[t+2]+16777216*i[t+3]},r.prototype.write_uint16=function(t,e){var i=this.output;this.big_endian?(i[t]=e>>>8&255,i[t+1]=255&e):(i[t]=255&e,i[t+1]=e>>>8&255)},r.prototype.write_uint32=function(t,e){var i=this.output;this.big_endian?(i[t]=e>>>24&255,i[t+1]=e>>>16&255,i[t+2]=e>>>8&255,i[t+3]=255&e):(i[t]=255&e,i[t+1]=e>>>8&255,i[t+2]=e>>>16&255,i[t+3]=e>>>24&255)},r.prototype.is_subifd_link=function(t,e){return 0===t&&34665===e||0===t&&34853===e||34665===t&&40965===e},r.prototype.exif_format_length=function(t){switch(t){case 1:case 2:case 6:case 7:return 1;case 3:case 8:return 2;case 4:case 9:case 11:return 4;case 5:case 10:case 12:return 8;default:return 0}},r.prototype.exif_format_read=function(t,e){var i;switch(t){case 1:case 2:return this.input[e];case 6:return(i=this.input[e])|33554430*(128&i);case 3:return this.read_uint16(e);case 8:return(i=this.read_uint16(e))|131070*(32768&i);case 4:return this.read_uint32(e);case 9:return 0|this.read_uint32(e);default:return null}},r.prototype.scan_ifd=function(t,i,a){var r=this.read_uint16(i);i+=2;for(var o=0;o<r;o++){var s=this.read_uint16(i),h=this.read_uint16(i+2),c=this.read_uint32(i+4),A=this.exif_format_length(h),u=c*A,l=u<=4?i+8:this.read_uint32(i+8),f=!1;if(l+u>this.input.length)throw e("unexpected EOF","EBADDATA");for(var d=[],g=l,p=0;p<c;p++,g+=A){var m=this.exif_format_read(h,g);if(null===m){d=null;break}d.push(m)}if(Array.isArray(d)&&2===h){try{d=n(String.fromCharCode.apply(null,d))}catch(t){d=null}d&&"\0"===d[d.length-1]&&(d=d.slice(0,-1))}if(this.is_subifd_link(t,s)&&Array.isArray(d)&&Number.isInteger(d[0])&&d[0]>0&&(this.ifds_to_read.push({id:s,offset:d[0]}),f=!0),!1===a({is_big_endian:this.big_endian,ifd:t,tag:s,format:h,count:c,entry_offset:i+this.start,data_length:u,data_offset:l+this.start,value:d,is_subifd_link:f}))return void(this.aborted=!0);i+=12}0===t&&this.ifds_to_read.push({id:1,offset:this.read_uint32(i)})},t.exports.is_jpeg=function(t){return t.length>=4&&255===t[0]&&216===t[1]&&255===t[2]},t.exports.jpeg_segments_each=function(n,r){if(!a(n))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof r)throw e("Invalid argument (on_segment), Function expected","EINVAL");if(!t.exports.is_jpeg(n))throw e("Unknown file format","ENOTJPEG");for(var o=0,s=n.length,h=!1;;){var c,A;if(o+1>=s)throw e("Unexpected EOF","EBADDATA");var u=n[o],l=n[o+1];if(255===u&&255===l)c=255,A=1;else if(255===u&&0!==l){if(A=2,208<=(c=l)&&c<=217||1===c);else{if(o+3>=s)throw e("Unexpected EOF","EBADDATA");if((A+=256*n[o+2]+n[o+3])<2)throw e("Invalid segment length","EBADDATA");if(o+A-1>=s)throw e("Unexpected EOF","EBADDATA")}h&&(c>=208&&c<=215||(h=!1)),218===c&&(h=!0)}else{if(!h)throw e("Unexpected byte at segment start: "+i(u)+" (offset "+i(o)+")","EBADDATA");for(var f=o+1;;f++){if(f>=s)throw e("Unexpected EOF","EBADDATA");if(255===n[f]){if(f+1>=s)throw e("Unexpected EOF","EBADDATA");if(0!==n[f+1]){c=0,A=f-o;break}}}}if(!1===r({code:c,offset:o,length:A}))break;if(217===c)break;o+=A}},t.exports.jpeg_segments_filter=function(i,n){if(!a(i))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_segment), Function expected","EINVAL");var r=[],o=0;t.exports.jpeg_segments_each(i,(function(t){var e=n(t);if(a(e))r.push({data:e}),o+=e.length;else if(Array.isArray(e))e.filter(a).forEach((function(t){r.push({data:t}),o+=t.length}));else if(!1!==e){var i={start:t.offset,end:t.offset+t.length};r.length>0&&r[r.length-1].end===i.start?r[r.length-1].end=i.end:r.push(i),o+=t.length}}));var s=new Uint8Array(o),h=0;return r.forEach((function(t){var e=t.data||i.subarray(t.start,t.end);s.set(e,h),h+=e.length})),s},t.exports.jpeg_exif_tags_each=function(i,n){if(!a(i))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");t.exports.jpeg_segments_each(i,(function(t){return 218!==t.code&&(225===t.code&&t.length>=10&&69===i[t.offset+4]&&120===i[t.offset+5]&&105===i[t.offset+6]&&102===i[t.offset+7]&&0===i[t.offset+8]&&0===i[t.offset+9]?(new r(i,t.offset+10,t.offset+t.length).each(n),!1):void 0)}))},t.exports.jpeg_exif_tags_filter=function(i,n){if(!a(i))throw e("Invalid argument (jpeg_bin), Uint8Array expected","EINVAL");if("function"!=typeof n)throw e("Invalid argument (on_exif_entry), Function expected","EINVAL");var o=!1;return t.exports.jpeg_segments_filter(i,(function(t){if(!o&&(218===t.code&&(o=!0),225===t.code&&t.length>=10&&69===i[t.offset+4]&&120===i[t.offset+5]&&105===i[t.offset+6]&&102===i[t.offset+7]&&0===i[t.offset+8]&&0===i[t.offset+9])){var e=new r(i,t.offset+10,t.offset+t.length).filter(n);if(!e)return!1;var a=new Uint8Array(10);return a.set(i.slice(t.offset,t.offset+10)),a[2]=e.length+8>>>8&255,a[3]=e.length+8&255,o=!0,[a,e]}}))},t.exports.jpeg_add_comment=function(e,i){var n=!1,a=0;return t.exports.jpeg_segments_filter(e,(function(t){if(!(1==++a&&216===t.code||2===a&&224===t.code||n)){i=function(t){try{return unescape(encodeURIComponent(t))}catch(e){return t}}(i);var r=new Uint8Array(5+i.length),o=0;return r[o++]=255,r[o++]=254,r[o++]=i.length+3>>>8&255,r[o++]=i.length+3&255,i.split("").forEach((function(t){r[o++]=255&t.charCodeAt(0)})),r[o++]=0,n=!0,[r,e.subarray(t.offset,t.offset+t.length)]}}))}},780:(t,e,i)=>{"use strict";var n=i(663);function a(t){return this._getUint8Array(t.blob).then((function(e){if(t.is_jpeg=n.is_jpeg(e),!t.is_jpeg)return Promise.resolve(t);t.orig_blob=t.blob;try{var i,a;if(n.jpeg_exif_tags_each(e,(function(e){if(0===e.ifd&&274===e.tag&&Array.isArray(e.value))return t.orientation=e.value[0]||1,i=e.is_big_endian,a=e.data_offset,!1})),a){var r=i?new Uint8Array([0,1]):new Uint8Array([1,0]);t.blob=new Blob([e.slice(0,a),r,e.slice(a+2)],{type:"image/jpeg"})}}catch(t){}return t}))}function r(t){if(!t.is_jpeg)return Promise.resolve(t);var e,i=t.orientation-1;if(!i)return Promise.resolve(t);var n=(e=4&i?this.pica.options.createCanvas(t.out_canvas.height,t.out_canvas.width):this.pica.options.createCanvas(t.out_canvas.width,t.out_canvas.height)).getContext("2d");return n.save(),1&i&&n.transform(-1,0,0,1,e.width,0),2&i&&n.transform(-1,0,0,-1,e.width,e.height),4&i&&n.transform(0,1,1,0,0,0),n.drawImage(t.out_canvas,0,0),n.restore(),t.out_canvas.width=t.out_canvas.height=0,t.out_canvas=e,Promise.resolve(t)}function o(t){return t.is_jpeg?Promise.all([this._getUint8Array(t.blob),this._getUint8Array(t.out_blob)]).then((function(e){var i=e[0],a=e[1];if(!n.is_jpeg(i))return Promise.resolve(t);var r=[];return n.jpeg_segments_each(i,(function(t){if(218===t.code)return!1;r.push(t)})),r=r.filter((function(t){return 226!==t.code&&(t.code>=224&&t.code<240||254===t.code)})).map((function(t){return i.slice(t.offset,t.offset+t.length)})),t.out_blob=new Blob([a.slice(0,2)].concat(r).concat([a.slice(20)]),{type:"image/jpeg"}),t})):Promise.resolve(t)}t.exports.f0=function(t){t.before("_blob_to_image",a),t.after("_transform",r),t.after("_create_blob",o)}},984:t=>{"use strict";function e(t,e){var i={};return e.forEach((function(e){Object.prototype.hasOwnProperty.call(t,e)&&(i[e]=t[e])})),i}t.exports.assign=function(t){for(var e,i=1;i<arguments.length;i++)for(var n in e=Object(arguments[i]))Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},t.exports.pick=e,t.exports.pick_pica_resize_options=function(t){return e(t,["alpha","unsharpAmount","unsharpRadius","unsharpThreshold","cancelToken"])}},634:t=>{1&&(t.exports=function t(e,i,n){function a(o,s){if(!i[o]){if(!e[o]){if(!s&&void 0)return require(o,!0);if(r)return r(o,!0);var h=new Error("Cannot find module '"+o+"'");throw h.code="MODULE_NOT_FOUND",h}var c=i[o]={exports:{}};e[o][0].call(c.exports,(function(t){return a(e[o][1][t]||t)}),c,c.exports,t,e,i,n)}return i[o].exports}for(var r=void 0,o=0;o<n.length;o++)a(n[o]);return a}({1:[function(t,e,i){"use strict";var n=t("multimath"),a=t("./mm_unsharp_mask"),r=t("./mm_resize");function o(t){var e=t||[],i={js:e.indexOf("js")>=0,wasm:e.indexOf("wasm")>=0};n.call(this,i),this.features={js:i.js,wasm:i.wasm&&this.has_wasm()},this.use(a),this.use(r)}o.prototype=Object.create(n.prototype),o.prototype.constructor=o,o.prototype.resizeAndUnsharp=function(t,e){var i=this.resize(t,e);return t.unsharpAmount&&this.unsharp_mask(i,t.toWidth,t.toHeight,t.unsharpAmount,t.unsharpRadius,t.unsharpThreshold),i},e.exports=o},{"./mm_resize":4,"./mm_unsharp_mask":9,multimath:19}],2:[function(t,e,i){"use strict";function n(t){return t<0?0:t>255?255:t}function a(t){return t>=0?t:0}e.exports={convolveHor:function(t,e,i,n,r,o){var s,h,c,A,u,l,f,d,g,p,m,v=0,w=0;for(g=0;g<n;g++){for(u=0,p=0;p<r;p++){for(l=o[u++],f=o[u++],d=v+4*l|0,s=h=c=A=0;f>0;f--)A=A+(m=o[u++])*t[d+3]|0,c=c+m*t[d+2]|0,h=h+m*t[d+1]|0,s=s+m*t[d]|0,d=d+4|0;e[w+3]=a(A>>7),e[w+2]=a(c>>7),e[w+1]=a(h>>7),e[w]=a(s>>7),w=w+4*n|0}w=4*(g+1)|0,v=(g+1)*i*4|0}},convolveVert:function(t,e,i,a,r,o){var s,h,c,A,u,l,f,d,g,p,m,v=0,w=0;for(g=0;g<a;g++){for(u=0,p=0;p<r;p++){for(l=o[u++],f=o[u++],d=v+4*l|0,s=h=c=A=0;f>0;f--)A=A+(m=o[u++])*t[d+3]|0,c=c+m*t[d+2]|0,h=h+m*t[d+1]|0,s=s+m*t[d]|0,d=d+4|0;s>>=7,h>>=7,c>>=7,A>>=7,e[w+3]=n(A+(1<<13)>>14),e[w+2]=n(c+(1<<13)>>14),e[w+1]=n(h+(1<<13)>>14),e[w]=n(s+(1<<13)>>14),w=w+4*a|0}w=4*(g+1)|0,v=(g+1)*i*4|0}},convolveHorWithPre:function(t,e,i,n,r,o){var s,h,c,A,u,l,f,d,g,p,m,v,w=0,b=0;for(p=0;p<n;p++){for(l=0,m=0;m<r;m++){for(f=o[l++],d=o[l++],g=w+4*f|0,s=h=c=A=0;d>0;d--)A=A+(v=o[l++])*(u=t[g+3])|0,c=c+v*t[g+2]*u|0,h=h+v*t[g+1]*u|0,s=s+v*t[g]*u|0,g=g+4|0;c=c/255|0,h=h/255|0,s=s/255|0,e[b+3]=a(A>>7),e[b+2]=a(c>>7),e[b+1]=a(h>>7),e[b]=a(s>>7),b=b+4*n|0}b=4*(p+1)|0,w=(p+1)*i*4|0}},convolveVertWithPre:function(t,e,i,a,r,o){var s,h,c,A,u,l,f,d,g,p,m,v=0,w=0;for(g=0;g<a;g++){for(u=0,p=0;p<r;p++){for(l=o[u++],f=o[u++],d=v+4*l|0,s=h=c=A=0;f>0;f--)A=A+(m=o[u++])*t[d+3]|0,c=c+m*t[d+2]|0,h=h+m*t[d+1]|0,s=s+m*t[d]|0,d=d+4|0;s>>=7,h>>=7,c>>=7,(A=n((A>>=7)+(1<<13)>>14))>0&&(s=255*s/A|0,h=255*h/A|0,c=255*c/A|0),e[w+3]=A,e[w+2]=n(c+(1<<13)>>14),e[w+1]=n(h+(1<<13)>>14),e[w]=n(s+(1<<13)>>14),w=w+4*a|0}w=4*(g+1)|0,v=(g+1)*i*4|0}}}},{}],3:[function(t,e,i){"use strict";e.exports="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"},{}],4:[function(t,e,i){"use strict";e.exports={name:"resize",fn:t("./resize"),wasm_fn:t("./resize_wasm"),wasm_src:t("./convolve_wasm_base64")}},{"./convolve_wasm_base64":3,"./resize":5,"./resize_wasm":8}],5:[function(t,e,i){"use strict";var n=t("./resize_filter_gen"),a=t("./convolve"),r=a.convolveHor,o=a.convolveVert,s=a.convolveHorWithPre,h=a.convolveVertWithPre;e.exports=function(t){var e=t.src,i=t.width,a=t.height,c=t.toWidth,A=t.toHeight,u=t.scaleX||t.toWidth/t.width,l=t.scaleY||t.toHeight/t.height,f=t.offsetX||0,d=t.offsetY||0,g=t.dest||new Uint8Array(c*A*4),p=void 0===t.filter?"mks2013":t.filter,m=n(p,i,c,u,f),v=n(p,a,A,l,d),w=new Uint16Array(c*a*4);return function(t,e,i){for(var n=3,a=e*i*4|0;n<a;){if(255!==t[n])return!0;n=n+4|0}return!1}(e,i,a)?(s(e,w,i,a,c,m),h(w,g,a,c,A,v)):(r(e,w,i,a,c,m),o(w,g,a,c,A,v),function(t,e,i){for(var n=3,a=e*i*4|0;n<a;)t[n]=255,n=n+4|0}(g,c,A)),g}},{"./convolve":2,"./resize_filter_gen":6}],6:[function(t,e,i){"use strict";var n=t("./resize_filter_info"),a=14;function r(t){return Math.round(t*((1<<a)-1))}e.exports=function(t,e,i,a,o){var s,h,c,A,u,l,f,d,g,p,m,v,w,b,y,I,B,_=n.filter[t].fn,E=1/a,C=Math.min(1,a),x=n.filter[t].win/C,Q=Math.floor(2*(x+1)),M=new Int16Array((Q+2)*i),D=0,k=!M.subarray||!M.set;for(s=0;s<i;s++){for(h=(s+.5)*E+o,c=Math.max(0,Math.floor(h-x)),u=(A=Math.min(e-1,Math.ceil(h+x)))-c+1,l=new Float32Array(u),f=new Int16Array(u),d=0,g=c,p=0;g<=A;g++,p++)d+=m=_((g+.5-h)*C),l[p]=m;for(v=0,p=0;p<l.length;p++)v+=w=l[p]/d,f[p]=r(w);for(f[i>>1]+=r(1-v),b=0;b<f.length&&0===f[b];)b++;if(b<f.length){for(y=f.length-1;y>0&&0===f[y];)y--;if(I=c+b,B=y-b+1,M[D++]=I,M[D++]=B,k)for(p=b;p<=y;p++)M[D++]=f[p];else M.set(f.subarray(b,y+1),D),D+=B}else M[D++]=0,M[D++]=0}return M}},{"./resize_filter_info":7}],7:[function(t,e,i){"use strict";var n={box:{win:.5,fn:function(t){return t<0&&(t=-t),t<.5?1:0}},hamming:{win:1,fn:function(t){if(t<0&&(t=-t),t>=1)return 0;if(t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*(.54+.46*Math.cos(e/1))}},lanczos2:{win:2,fn:function(t){if(t<0&&(t=-t),t>=2)return 0;if(t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/2)/(e/2)}},lanczos3:{win:3,fn:function(t){if(t<0&&(t=-t),t>=3)return 0;if(t<1.1920929e-7)return 1;var e=t*Math.PI;return Math.sin(e)/e*Math.sin(e/3)/(e/3)}},mks2013:{win:2.5,fn:function(t){return t<0&&(t=-t),t>=2.5?0:t>=1.5?-.125*(t-2.5)*(t-2.5):t>=.5?.25*(4*t*t-11*t+7):1.0625-1.75*t*t}}};e.exports={filter:n,f2q:{box:0,hamming:1,lanczos2:2,lanczos3:3},q2f:["box","hamming","lanczos2","lanczos3"]}},{}],8:[function(t,e,i){"use strict";var n=t("./resize_filter_gen"),a=!0;try{a=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0]}catch(t){}function r(t,e,i){if(a)e.set(function(t){return new Uint8Array(t.buffer,0,t.byteLength)}(t),i);else for(var n=i,r=0;r<t.length;r++){var o=t[r];e[n++]=255&o,e[n++]=o>>8&255}}e.exports=function(t){var e=t.src,i=t.width,a=t.height,o=t.toWidth,s=t.toHeight,h=t.scaleX||t.toWidth/t.width,c=t.scaleY||t.toHeight/t.height,A=t.offsetX||0,u=t.offsetY||0,l=t.dest||new Uint8Array(o*s*4),f=void 0===t.filter?"mks2013":t.filter,d=n(f,i,o,h,A),g=n(f,a,s,c,u),p=Math.max(e.byteLength,l.byteLength),m=this.__align(0+p),v=a*o*4*2,w=this.__align(m+v),b=this.__align(w+d.byteLength),y=b+g.byteLength,I=this.__instance("resize",y),B=new Uint8Array(this.__memory.buffer),_=new Uint32Array(this.__memory.buffer),E=new Uint32Array(e.buffer);_.set(E),r(d,B,w),r(g,B,b);var C=I.exports.convolveHV||I.exports._convolveHV;return function(t,e,i){for(var n=3,a=e*i*4|0;n<a;){if(255!==t[n])return!0;n=n+4|0}return!1}(e,i,a)?C(w,b,m,i,a,o,s,1):(C(w,b,m,i,a,o,s,0),function(t,e,i){for(var n=3,a=e*i*4|0;n<a;)t[n]=255,n=n+4|0}(l,o,s)),new Uint32Array(l.buffer).set(new Uint32Array(this.__memory.buffer,0,s*o)),l}},{"./resize_filter_gen":6}],9:[function(t,e,i){"use strict";e.exports={name:"unsharp_mask",fn:t("./unsharp_mask"),wasm_fn:t("./unsharp_mask_wasm"),wasm_src:t("./unsharp_mask_wasm_base64")}},{"./unsharp_mask":10,"./unsharp_mask_wasm":11,"./unsharp_mask_wasm_base64":12}],10:[function(t,e,i){"use strict";var n=t("glur/mono16");e.exports=function(t,e,i,a,r,o){var s,h,c,A,u;if(!(0===a||r<.5)){r>2&&(r=2);var l=function(t,e,i){for(var n,a,r,o,s=e*i,h=new Uint16Array(s),c=0;c<s;c++)n=t[4*c],a=t[4*c+1],r=t[4*c+2],o=n>=a&&n>=r?n:a>=r&&a>=n?a:r,h[c]=o<<8;return h}(t,e,i),f=new Uint16Array(l);n(f,e,i,r);for(var d=a/100*4096+.5|0,g=o<<8,p=e*i,m=0;m<p;m++)A=(s=l[m])-f[m],Math.abs(A)>=g&&(c=((h=(h=(h=s+(d*A+2048>>12))>65280?65280:h)<0?0:h)<<12)/(s=0!==s?s:1)|0,t[u=4*m]=t[u]*c+2048>>12,t[u+1]=t[u+1]*c+2048>>12,t[u+2]=t[u+2]*c+2048>>12)}}},{"glur/mono16":18}],11:[function(t,e,i){"use strict";e.exports=function(t,e,i,n,a,r){if(!(0===n||a<.5)){a>2&&(a=2);var o=e*i,s=4*o,h=2*o,c=2*o,A=4*Math.max(e,i),u=0,l=s,f=l+h,d=f+c,g=d+c,p=g+A,m=this.__instance("unsharp_mask",s+h+2*c+A+8*4,{exp:Math.exp}),v=new Uint32Array(t.buffer);new Uint32Array(this.__memory.buffer).set(v);var w=m.exports.hsv_v16||m.exports._hsv_v16;w(u,l,e,i),(w=m.exports.blurMono16||m.exports._blurMono16)(l,f,d,g,p,e,i,a),(w=m.exports.unsharp||m.exports._unsharp)(u,u,l,f,e,i,n,r),v.set(new Uint32Array(this.__memory.buffer,0,o))}}},{}],12:[function(t,e,i){"use strict";e.exports="AGFzbQEAAAAADAZkeWxpbmsAAAAAAAE0B2AAAGAEf39/fwBgBn9/f39/fwBgCH9/f39/f39/AGAIf39/f39/f30AYAJ9fwBgAXwBfAIZAgNlbnYDZXhwAAYDZW52Bm1lbW9yeQIAAAMHBgAFAgQBAwYGAX8AQQALB4oBCBFfX3dhc21fY2FsbF9jdG9ycwABFl9fYnVpbGRfZ2F1c3NpYW5fY29lZnMAAg5fX2dhdXNzMTZfbGluZQADCmJsdXJNb25vMTYABAdoc3ZfdjE2AAUHdW5zaGFycAAGDF9fZHNvX2hhbmRsZQMAGF9fd2FzbV9hcHBseV9kYXRhX3JlbG9jcwABCsUMBgMAAQvWAQEHfCABRNuGukOCGvs/IAC7oyICRAAAAAAAAADAohAAIgW2jDgCFCABIAKaEAAiAyADoCIGtjgCECABRAAAAAAAAPA/IAOhIgQgBKIgAyACIAKgokQAAAAAAADwP6AgBaGjIgS2OAIAIAEgBSAEmqIiB7Y4AgwgASADIAJEAAAAAAAA8D+gIASioiIItjgCCCABIAMgAkQAAAAAAADwv6AgBKKiIgK2OAIEIAEgByAIoCAFRAAAAAAAAPA/IAahoCIDo7Y4AhwgASAEIAKgIAOjtjgCGAuGBQMGfwl8An0gAyoCDCEVIAMqAgghFiADKgIUuyERIAMqAhC7IRACQCAEQQFrIghBAEgiCQRAIAIhByAAIQYMAQsgAiAALwEAuCIPIAMqAhi7oiIMIBGiIg0gDCAQoiAPIAMqAgS7IhOiIhQgAyoCALsiEiAPoqCgoCIOtjgCACACQQRqIQcgAEECaiEGIAhFDQAgCEEBIAhBAUgbIgpBf3MhCwJ/IAQgCmtBAXFFBEAgDiENIAgMAQsgAiANIA4gEKIgFCASIAAvAQK4Ig+ioKCgIg22OAIEIAJBCGohByAAQQRqIQYgDiEMIARBAmsLIQIgC0EAIARrRg0AA0AgByAMIBGiIA0gEKIgDyAToiASIAYvAQC4Ig6ioKCgIgy2OAIAIAcgDSARoiAMIBCiIA4gE6IgEiAGLwECuCIPoqCgoCINtjgCBCAHQQhqIQcgBkEEaiEGIAJBAkohACACQQJrIQIgAA0ACwsCQCAJDQAgASAFIAhsQQF0aiIAAn8gBkECay8BACICuCINIBW7IhKiIA0gFrsiE6KgIA0gAyoCHLuiIgwgEKKgIAwgEaKgIg8gB0EEayIHKgIAu6AiDkQAAAAAAADwQWMgDkQAAAAAAAAAAGZxBEAgDqsMAQtBAAs7AQAgCEUNACAGQQRrIQZBACAFa0EBdCEBA0ACfyANIBKiIAJB//8DcbgiDSAToqAgDyIOIBCioCAMIBGioCIPIAdBBGsiByoCALugIgxEAAAAAAAA8EFjIAxEAAAAAAAAAABmcQRAIAyrDAELQQALIQMgBi8BACECIAAgAWoiACADOwEAIAZBAmshBiAIQQFKIQMgDiEMIAhBAWshCCADDQALCwvRAgIBfwd8AkAgB0MAAAAAWw0AIARE24a6Q4Ia+z8gB0MAAAA/l7ujIglEAAAAAAAAAMCiEAAiDLaMOAIUIAQgCZoQACIKIAqgIg22OAIQIAREAAAAAAAA8D8gCqEiCyALoiAKIAkgCaCiRAAAAAAAAPA/oCAMoaMiC7Y4AgAgBCAMIAuaoiIOtjgCDCAEIAogCUQAAAAAAADwP6AgC6KiIg+2OAIIIAQgCiAJRAAAAAAAAPC/oCALoqIiCbY4AgQgBCAOIA+gIAxEAAAAAAAA8D8gDaGgIgqjtjgCHCAEIAsgCaAgCqO2OAIYIAYEQANAIAAgBSAIbEEBdGogAiAIQQF0aiADIAQgBSAGEAMgCEEBaiIIIAZHDQALCyAFRQ0AQQAhCANAIAIgBiAIbEEBdGogASAIQQF0aiADIAQgBiAFEAMgCEEBaiIIIAVHDQALCwtxAQN/IAIgA2wiBQRAA0AgASAAKAIAIgRBEHZB/wFxIgIgAiAEQQh2Qf8BcSIDIAMgBEH/AXEiBEkbIAIgA0sbIgYgBiAEIAIgBEsbIAMgBEsbQQh0OwEAIAFBAmohASAAQQRqIQAgBUEBayIFDQALCwuZAgIDfwF8IAQgBWwhBAJ/IAazQwAAgEWUQwAAyEKVu0QAAAAAAADgP6AiC5lEAAAAAAAA4EFjBEAgC6oMAQtBgICAgHgLIQUgBARAIAdBCHQhCUEAIQYDQCAJIAIgBkEBdCIHai8BACIBIAMgB2ovAQBrIgcgB0EfdSIIaiAIc00EQCAAIAZBAnQiCGoiCiAFIAdsQYAQakEMdSABaiIHQYD+AyAHQYD+A0gbIgdBACAHQQBKG0EMdCABQQEgARtuIgEgCi0AAGxBgBBqQQx2OgAAIAAgCEEBcmoiByABIActAABsQYAQakEMdjoAACAAIAhBAnJqIgcgASAHLQAAbEGAEGpBDHY6AAALIAZBAWoiBiAERw0ACwsL"},{}],13:[function(t,e,i){"use strict";var n=100;function a(t,e){this.create=t,this.available=[],this.acquired={},this.lastId=1,this.timeoutId=0,this.idle=e||2e3}a.prototype.acquire=function(){var t,e=this;return 0!==this.available.length?t=this.available.pop():((t=this.create()).id=this.lastId++,t.release=function(){return e.release(t)}),this.acquired[t.id]=t,t},a.prototype.release=function(t){var e=this;delete this.acquired[t.id],t.lastUsed=Date.now(),this.available.push(t),0===this.timeoutId&&(this.timeoutId=setTimeout((function(){return e.gc()}),n))},a.prototype.gc=function(){var t=this,e=Date.now();this.available=this.available.filter((function(i){return!(e-i.lastUsed>t.idle&&(i.destroy(),1))})),0!==this.available.length?this.timeoutId=setTimeout((function(){return t.gc()}),n):this.timeoutId=0},e.exports=a},{}],14:[function(t,e,i){"use strict";var n=2;e.exports=function(t,e,i,a,r,o){var s=i/t,h=a/e,c=(2*o+n+1)/r;if(c>.5)return[[i,a]];var A=Math.ceil(Math.log(Math.min(s,h))/Math.log(c));if(A<=1)return[[i,a]];for(var u=[],l=0;l<A;l++){var f=Math.round(Math.pow(Math.pow(t,A-l-1)*Math.pow(i,l+1),1/A)),d=Math.round(Math.pow(Math.pow(e,A-l-1)*Math.pow(a,l+1),1/A));u.push([f,d])}return u}},{}],15:[function(t,e,i){"use strict";var n=1e-5;function a(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.floor(t)}function r(t){var e=Math.round(t);return Math.abs(t-e)<n?e:Math.ceil(t)}e.exports=function(t){var e,i,n,o,s,h,c=t.toWidth/t.width,A=t.toHeight/t.height,u=a(t.srcTileSize*c)-2*t.destTileBorder,l=a(t.srcTileSize*A)-2*t.destTileBorder;if(u<1||l<1)throw new Error("Internal error in pica: target tile width/height is too small.");var f,d=[];for(o=0;o<t.toHeight;o+=l)for(n=0;n<t.toWidth;n+=u)(e=n-t.destTileBorder)<0&&(e=0),e+(s=n+u+t.destTileBorder-e)>=t.toWidth&&(s=t.toWidth-e),(i=o-t.destTileBorder)<0&&(i=0),i+(h=o+l+t.destTileBorder-i)>=t.toHeight&&(h=t.toHeight-i),f={toX:e,toY:i,toWidth:s,toHeight:h,toInnerX:n,toInnerY:o,toInnerWidth:u,toInnerHeight:l,offsetX:e/c-a(e/c),offsetY:i/A-a(i/A),scaleX:c,scaleY:A,x:a(e/c),y:a(i/A),width:r(s/c),height:r(h/A)},d.push(f);return d}},{}],16:[function(t,e,i){"use strict";function n(t){return Object.prototype.toString.call(t)}e.exports.isCanvas=function(t){var e=n(t);return"[object HTMLCanvasElement]"===e||"[object OffscreenCanvas]"===e||"[object Canvas]"===e},e.exports.isImage=function(t){return"[object HTMLImageElement]"===n(t)},e.exports.isImageBitmap=function(t){return"[object ImageBitmap]"===n(t)},e.exports.limiter=function(t){var e=0,i=[];function n(){e<t&&i.length&&(e++,i.shift()())}return function(t){return new Promise((function(a,r){i.push((function(){t().then((function(t){a(t),e--,n()}),(function(t){r(t),e--,n()}))})),n()}))}},e.exports.cib_quality_name=function(t){switch(t){case 0:return"pixelated";case 1:return"low";case 2:return"medium"}return"high"},e.exports.cib_support=function(t){return Promise.resolve().then((function(){if("undefined"==typeof createImageBitmap)return!1;var e=t(100,100);return createImageBitmap(e,0,0,100,100,{resizeWidth:10,resizeHeight:10,resizeQuality:"high"}).then((function(t){var i=10===t.width;return t.close(),e=null,i}))}))["catch"]((function(){return!1}))},e.exports.worker_offscreen_canvas_support=function(){return new Promise((function(t,e){if("undefined"!=typeof OffscreenCanvas){var i=btoa("(".concat(function(t){"undefined"!=typeof createImageBitmap?Promise.resolve().then((function(){var t=new OffscreenCanvas(10,10);return t.getContext("2d").rect(0,0,1,1),createImageBitmap(t,0,0,1,1)})).then((function(){return t.postMessage(!0)}),(function(){return t.postMessage(!1)})):t.postMessage(!1)}.toString(),")(self);")),n=new Worker("data:text/javascript;base64,".concat(i));n.onmessage=function(e){return t(e.data)},n.onerror=e}else t(!1)})).then((function(t){return t}),(function(){return!1}))},e.exports.can_use_canvas=function(t){var e=!1;try{var i=t(2,1).getContext("2d"),n=i.createImageData(2,1);n.data[0]=12,n.data[1]=23,n.data[2]=34,n.data[3]=255,n.data[4]=45,n.data[5]=56,n.data[6]=67,n.data[7]=255,i.putImageData(n,0,0),n=null,12===(n=i.getImageData(0,0,2,1)).data[0]&&23===n.data[1]&&34===n.data[2]&&255===n.data[3]&&45===n.data[4]&&56===n.data[5]&&67===n.data[6]&&255===n.data[7]&&(e=!0)}catch(t){}return e},e.exports.cib_can_use_region=function(){return new Promise((function(t){if("undefined"!=typeof Image&&"undefined"!=typeof createImageBitmap){var e=new Image;e.src="data:image/jpeg;base64,"+"/9j/4QBiRXhpZgAATU0AKgAAAAgABQESAAMAAAABAAYAAAEaAAUAAAABAAAASgEbAAUAA"+"AABAAAAUgEoAAMAAAABAAIAAAITAAMAAAABAAEAAAAAAAAAAABIAAAAAQAAAEgAAAAB/9"+"sAQwAEAwMEAwMEBAMEBQQEBQYKBwYGBgYNCQoICg8NEBAPDQ8OERMYFBESFxIODxUcFRc"+"ZGRsbGxAUHR8dGh8YGhsa/9sAQwEEBQUGBQYMBwcMGhEPERoaGhoaGhoaGhoaGhoaGhoa"+"GhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoaGhoa/8IAEQgAAQACAwERAAIRAQMRA"+"f/EABQAAQAAAAAAAAAAAAAAAAAAAAf/xAAUAQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAA"+"IQAxAAAAF/P//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAQUCf//EABQRAQAAAAA"+"AAAAAAAAAAAAAAAD/2gAIAQMBAT8Bf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIB"+"AT8Bf//EABQQAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEABj8Cf//EABQQAQAAAAAAAAAAA"+"AAAAAAAAAD/2gAIAQEAAT8hf//aAAwDAQACAAMAAAAQH//EABQRAQAAAAAAAAAAAAAAAA"+"AAAAD/2gAIAQMBAT8Qf//EABQRAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQIBAT8Qf//EABQ"+"QAQAAAAAAAAAAAAAAAAAAAAD/2gAIAQEAAT8Qf//Z",e.onload=function(){createImageBitmap(e,0,0,e.width,e.height).then((function(i){i.width===e.width&&i.height===e.height?t(!0):t(!1)}),(function(){return t(!1)}))},e.onerror=function(){return t(!1)}}else t(!1)}))}},{}],17:[function(t,e,i){"use strict";e.exports=function(){var e,i=t("./mathlib");onmessage=function(t){var n=t.data.opts;if(!n.src&&n.srcBitmap){var a=new OffscreenCanvas(n.width,n.height),r=a.getContext("2d");r.drawImage(n.srcBitmap,0,0),n.src=r.getImageData(0,0,n.width,n.height).data,a.width=a.height=0,a=null,n.srcBitmap.close(),n.srcBitmap=null}e||(e=new i(t.data.features));var o=e.resizeAndUnsharp(n);if(1)postMessage({data:o},[o.buffer]);else{var s=new ImageData(new Uint8ClampedArray(o),n.toWidth,n.toHeight),h=new OffscreenCanvas(n.toWidth,n.toHeight);h.getContext("2d").putImageData(s,0,0),createImageBitmap(h).then((function(t){postMessage({bitmap:t},[t])}))}}}},{"./mathlib":1}],18:[function(t,e,i){var n,a,r,o,s,h;function c(t,e,i,n,a,r){var o,s,h,c,A,u,l,f,d,g,p,m,v,w;for(d=0;d<r;d++){for(l=d,f=0,c=A=(o=t[u=d*a])*n[6],p=n[0],m=n[1],v=n[4],w=n[5],g=0;g<a;g++)h=(s=t[u])*p+o*m+c*v+A*w,A=c,c=h,o=s,i[f]=c,f++,u++;for(f--,l+=r*(a-1),c=A=(o=t[--u])*n[7],s=o,p=n[2],m=n[3],g=a-1;g>=0;g--)h=s*p+o*m+c*v+A*w,A=c,c=h,o=s,s=t[u],e[l]=i[f]+c,u--,f--,l-=r}}e.exports=function(t,e,i,A){if(A){var u=new Uint16Array(t.length),l=new Float32Array(Math.max(e,i)),f=function(t){t<.5&&(t=.5);var e=Math.exp(.726*.726)/t,i=Math.exp(-e),c=Math.exp(-2*e),A=(1-i)*(1-i)/(1+2*e*i-c);return n=A,a=A*(e-1)*i,r=A*(e+1)*i,o=-A*c,s=2*i,h=-c,new Float32Array([n,a,r,o,s,h,(n+a)/(1-s-h),(r+o)/(1-s-h)])}(A);c(t,u,l,f,e,i),c(u,t,l,f,i,e)}}},{}],19:[function(t,e,i){"use strict";var n=t("object-assign"),a=t("./lib/base64decode"),r=t("./lib/wa_detect"),o={js:!0,wasm:!0};function s(t){if(!(this instanceof s))return new s(t);var e=n({},o,t||{});if(this.options=e,this.__cache={},this.__init_promise=null,this.__modules=e.modules||{},this.__memory=null,this.__wasm={},this.__isLE=1===new Uint32Array(new Uint8Array([1,0,0,0]).buffer)[0],!this.options.js&&!this.options.wasm)throw new Error('mathlib: at least "js" or "wasm" should be enabled')}s.prototype.has_wasm=r,s.prototype.use=function(t){return this.__modules[t.name]=t,this.options.wasm&&this.has_wasm()&&t.wasm_fn?this[t.name]=t.wasm_fn:this[t.name]=t.fn,this},s.prototype.init=function(){if(this.__init_promise)return this.__init_promise;if(!this.options.js&&this.options.wasm&&!this.has_wasm())return Promise.reject(new Error('mathlib: only "wasm" was enabled, but it\'s not supported'));var t=this;return this.__init_promise=Promise.all(Object.keys(t.__modules).map((function(e){var i=t.__modules[e];return t.options.wasm&&t.has_wasm()&&i.wasm_fn?t.__wasm[e]?null:WebAssembly.compile(t.__base64decode(i.wasm_src)).then((function(i){t.__wasm[e]=i})):null}))).then((function(){return t})),this.__init_promise},s.prototype.__base64decode=a,s.prototype.__reallocate=function(t){if(!this.__memory)return this.__memory=new WebAssembly.Memory({initial:Math.ceil(t/(64*1024))}),this.__memory;var e=this.__memory.buffer.byteLength;return e<t&&this.__memory.grow(Math.ceil((t-e)/(64*1024))),this.__memory},s.prototype.__instance=function(t,e,i){if(e&&this.__reallocate(e),!this.__wasm[t]){var a=this.__modules[t];this.__wasm[t]=new WebAssembly.Module(this.__base64decode(a.wasm_src))}if(!this.__cache[t]){var r={memoryBase:0,memory:this.__memory,tableBase:0,table:new WebAssembly.Table({initial:0,element:"anyfunc"})};this.__cache[t]=new WebAssembly.Instance(this.__wasm[t],{env:n(r,i||{})})}return this.__cache[t]},s.prototype.__align=function(t,e){var i=t%(e=e||8);return t+(i?e-i:0)},e.exports=s},{"./lib/base64decode":20,"./lib/wa_detect":21,"object-assign":22}],20:[function(t,e,i){"use strict";var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";e.exports=function(t){for(var e=t.replace(/[\r\n=]/g,""),i=e.length,a=new Uint8Array(3*i>>2),r=0,o=0,s=0;s<i;s++)s%4==0&&s&&(a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=255&r),r=r<<6|n.indexOf(e.charAt(s));var h=i%4*6;return 0===h?(a[o++]=r>>16&255,a[o++]=r>>8&255,a[o++]=255&r):18===h?(a[o++]=r>>10&255,a[o++]=r>>2&255):12===h&&(a[o++]=r>>4&255),a}},{}],21:[function(t,e,i){"use strict";var n;e.exports=function(){if(void 0!==n)return n;if(n=!1,"undefined"==typeof WebAssembly)return n;try{var t=new Uint8Array([0,97,115,109,1,0,0,0,1,6,1,96,1,127,1,127,3,2,1,0,5,3,1,0,1,7,8,1,4,116,101,115,116,0,0,10,16,1,14,0,32,0,65,1,54,2,0,32,0,40,2,0,11]),e=new WebAssembly.Module(t);return 0!==new WebAssembly.Instance(e,{}).exports.test(4)&&(n=!0),n}catch(t){}return n}},{}],22:[function(t,e,i){"use strict";var n=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var t=new String("abc");if(t[5]="de","5"===Object.getOwnPropertyNames(t)[0])return!1;for(var e={},i=0;i<10;i++)e["_"+String.fromCharCode(i)]=i;if("0123456789"!==Object.getOwnPropertyNames(e).map((function(t){return e[t]})).join(""))return!1;var n={};return"abcdefghijklmnopqrst".split("").forEach((function(t){n[t]=t})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},n)).join("")}catch(t){return!1}}()?Object.assign:function(t,e){for(var i,o,s=function(t){if(null==t)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(t)}(t),h=1;h<arguments.length;h++){for(var c in i=Object(arguments[h]))a.call(i,c)&&(s[c]=i[c]);if(n){o=n(i);for(var A=0;A<o.length;A++)r.call(i,o[A])&&(s[o[A]]=i[o[A]])}}return s}},{}],23:[function(t,e,i){var n=arguments[3],a=arguments[4],r=arguments[5],o=JSON.stringify;e.exports=function(t,e){for(var i,s=Object.keys(r),h=0,c=s.length;h<c;h++){var A=s[h],u=r[A].exports;if(u===t||u&&u["default"]===t){i=A;break}}if(!i){i=Math.floor(Math.pow(16,8)*Math.random()).toString(16);var l={};for(h=0,c=s.length;h<c;h++)l[A=s[h]]=A;a[i]=["function(require,module,exports){"+t+"(self); }",l]}var f=Math.floor(Math.pow(16,8)*Math.random()).toString(16),d={};d[i]=i,a[f]=["function(require,module,exports){"+"var f = require("+o(i)+");"+"(f.default ? f.default : f)(self);"+"}",d];var g={};!function t(e){for(var i in g[e]=!0,a[e][1]){var n=a[e][1][i];g[n]||t(n)}}(f);var p="("+n+")({"+Object.keys(g).map((function(t){return o(t)+":["+a[t][0]+","+o(a[t][1])+"]"})).join(",")+"},{},["+o(f)+"])",m=window.URL||window.webkitURL||window.mozURL||window.msURL,v=new Blob([p],{type:"text/javascript"});if(e&&e.bare)return v;var w=m.createObjectURL(v),b=new Worker(w);return b.objectURL=w,b}},{}],"/index.js":[function(t,e,i){"use strict";function n(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){var i=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=i){var n,a,r=[],o=!0,s=!1;try{for(i=i.call(t);!(o=(n=i.next()).done)&&(r.push(n.value),!e||r.length!==e);o=!0);}catch(t){s=!0,a=t}finally{try{o||null==i["return"]||i["return"]()}finally{if(s)throw a}}return r}}(t,e)||function(t,e){if(t){if("string"==typeof t)return a(t,e);var i=Object.prototype.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)?a(t,e):void 0}}(t,e)||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 a(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var r=t("object-assign"),o=t("webworkify"),s=t("./lib/mathlib"),h=t("./lib/pool"),c=t("./lib/utils"),A=t("./lib/worker"),u=t("./lib/stepper"),l=t("./lib/tiler"),f=t("./lib/mm_resize/resize_filter_info"),d={},g=!1;try{"undefined"!=typeof navigator&&navigator.userAgent&&(g=navigator.userAgent.indexOf("Safari")>=0)}catch(t){}var p=1;"undefined"!=typeof navigator&&(p=Math.min(navigator.hardwareConcurrency||1,4));var m={tile:1024,concurrency:p,features:["js","wasm","ww"],idle:2e3,createCanvas:function(t,e){var i=document.createElement("canvas");return i.width=t,i.height=e,i}},v={filter:"mks2013",unsharpAmount:0,unsharpRadius:0,unsharpThreshold:0},w=!1,b=!1,y=!1,I=!1,B=!1;function _(){return{value:o(A),destroy:function(){if(this.value.terminate(),"undefined"!=typeof window){var t=window.URL||window.webkitURL||window.mozURL||window.msURL;t&&t.revokeObjectURL&&this.value.objectURL&&t.revokeObjectURL(this.value.objectURL)}}}}function E(t){if(!(this instanceof E))return new E(t);this.options=r({},m,t||{});var e="lk_".concat(this.options.concurrency);this.__limit=d[e]||c.limiter(this.options.concurrency),d[e]||(d[e]=this.__limit),this.features={js:!1,wasm:!1,cib:!1,ww:!1},this.__workersPool=null,this.__requested_features=[],this.__mathlib=null}E.prototype.init=function(){var e=this;if(this.__initPromise)return this.__initPromise;if("undefined"!=typeof ImageData&&"undefined"!=typeof Uint8ClampedArray)try{new ImageData(new Uint8ClampedArray(400),10,10),w=!0}catch(t){}"undefined"!=typeof ImageBitmap&&(ImageBitmap.prototype&&ImageBitmap.prototype.close?b=!0:this.debug("ImageBitmap does not support .close(), disabled"));var i=this.options.features.slice();if(i.indexOf("all")>=0&&(i=["cib","wasm","js","ww"]),this.__requested_features=i,this.__mathlib=new s(i),i.indexOf("ww")>=0&&"undefined"!=typeof window&&"Worker"in window)try{t("webworkify")((function(){})).terminate(),this.features.ww=!0;var n="wp_".concat(JSON.stringify(this.options));d[n]?this.__workersPool=d[n]:(this.__workersPool=new h(_,this.options.idle),d[n]=this.__workersPool)}catch(t){}var a,o,A=this.__mathlib.init().then((function(t){r(e.features,t.features)}));a=b?c.cib_support(this.options.createCanvas).then((function(t){e.features.cib&&i.indexOf("cib")<0?e.debug("createImageBitmap() resize supported, but disabled by config"):i.indexOf("cib")>=0&&(e.features.cib=t)})):Promise.resolve(!1),y=c.can_use_canvas(this.options.createCanvas),o=(o=b&&w&&-1!==i.indexOf("ww")?c.worker_offscreen_canvas_support():Promise.resolve(!1)).then((function(t){I=t}));var u=c.cib_can_use_region().then((function(t){B=t}));return this.__initPromise=Promise.all([A,a,o,u]).then((function(){return e})),this.__initPromise},E.prototype.__invokeResize=function(t,e){var i=this;return e.__mathCache=e.__mathCache||{},Promise.resolve().then((function(){return i.features.ww?new Promise((function(n,a){var r=i.__workersPool.acquire();e.cancelToken&&e.cancelToken["catch"]((function(t){return a(t)})),r.value.onmessage=function(t){r.release(),t.data.err?a(t.data.err):n(t.data)};var o=[];t.src&&o.push(t.src.buffer),t.srcBitmap&&o.push(t.srcBitmap),r.value.postMessage({opts:t,features:i.__requested_features,preload:{wasm_nodule:i.__mathlib.__}},o)})):{data:i.__mathlib.resizeAndUnsharp(t,e.__mathCache)}}))},E.prototype.__extractTileData=function(t,e,i,n,a){if(this.features.ww&&I&&(c.isCanvas(e)||B))return this.debug("Create tile for OffscreenCanvas"),createImageBitmap(n.srcImageBitmap||e,t.x,t.y,t.width,t.height).then((function(t){return a.srcBitmap=t,a}));if(c.isCanvas(e))return n.srcCtx||(n.srcCtx=e.getContext("2d")),this.debug("Get tile pixel data"),a.src=n.srcCtx.getImageData(t.x,t.y,t.width,t.height).data,a;this.debug("Draw tile imageBitmap/image to temporary canvas");var r=this.options.createCanvas(t.width,t.height),o=r.getContext("2d");return o.globalCompositeOperation="copy",o.drawImage(n.srcImageBitmap||e,t.x,t.y,t.width,t.height,0,0,t.width,t.height),this.debug("Get tile pixel data"),a.src=o.getImageData(0,0,t.width,t.height).data,r.width=r.height=0,a},E.prototype.__landTileData=function(t,e,i){var n;if(this.debug("Convert raw rgba tile result to ImageData"),e.bitmap)return i.toCtx.drawImage(e.bitmap,t.toX,t.toY),null;if(w)n=new ImageData(new Uint8ClampedArray(e.data),t.toWidth,t.toHeight);else if((n=i.toCtx.createImageData(t.toWidth,t.toHeight)).data.set)n.data.set(e.data);else for(var a=n.data.length-1;a>=0;a--)n.data[a]=e.data[a];return this.debug("Draw tile"),g?i.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth+1e-5,t.toInnerHeight+1e-5):i.toCtx.putImageData(n,t.toX,t.toY,t.toInnerX-t.toX,t.toInnerY-t.toY,t.toInnerWidth,t.toInnerHeight),null},E.prototype.__tileAndResize=function(t,e,i){var n=this,a={srcCtx:null,srcImageBitmap:null,isImageBitmapReused:!1,toCtx:null};return Promise.resolve().then((function(){if(a.toCtx=e.getContext("2d"),c.isCanvas(t))return null;if(c.isImageBitmap(t))return a.srcImageBitmap=t,a.isImageBitmapReused=!0,null;if(c.isImage(t))return b?(n.debug("Decode image via createImageBitmap"),createImageBitmap(t).then((function(t){a.srcImageBitmap=t}))["catch"]((function(t){return null}))):null;throw new Error('Pica: ".from" should be Image, Canvas or ImageBitmap')})).then((function(){if(i.canceled)return i.cancelToken;n.debug("Calculate tiles");var r=l({width:i.width,height:i.height,srcTileSize:n.options.tile,toWidth:i.toWidth,toHeight:i.toHeight,destTileBorder:i.__destTileBorder}).map((function(e){return function(e){return n.__limit((function(){if(i.canceled)return i.cancelToken;var r={width:e.width,height:e.height,toWidth:e.toWidth,toHeight:e.toHeight,scaleX:e.scaleX,scaleY:e.scaleY,offsetX:e.offsetX,offsetY:e.offsetY,filter:i.filter,unsharpAmount:i.unsharpAmount,unsharpRadius:i.unsharpRadius,unsharpThreshold:i.unsharpThreshold};return n.debug("Invoke resize math"),Promise.resolve(r).then((function(r){return n.__extractTileData(e,t,i,a,r)})).then((function(t){return n.debug("Invoke resize math"),n.__invokeResize(t,i)})).then((function(t){return i.canceled?i.cancelToken:(a.srcImageData=null,n.__landTileData(e,t,a))}))}))}(e)}));function o(t){t.srcImageBitmap&&(t.isImageBitmapReused||t.srcImageBitmap.close(),t.srcImageBitmap=null)}return n.debug("Process tiles"),Promise.all(r).then((function(){return n.debug("Finished!"),o(a),e}),(function(t){throw o(a),t}))}))},E.prototype.__processStages=function(t,e,i,a){var o=this;if(a.canceled)return a.cancelToken;var s,h,c=n(t.shift(),2),A=c[0],u=c[1],l=0===t.length;return s=l||f.q2f.indexOf(a.filter)<0?a.filter:"box"===a.filter?"box":"hamming",a=r({},a,{toWidth:A,toHeight:u,filter:s}),l||(h=this.options.createCanvas(A,u)),this.__tileAndResize(e,l?i:h,a).then((function(){return l?i:(a.width=A,a.height=u,o.__processStages(t,h,i,a))})).then((function(t){return h&&(h.width=h.height=0),t}))},E.prototype.__resizeViaCreateImageBitmap=function(t,e,i){var n=this,a=e.getContext("2d");return this.debug("Resize via createImageBitmap()"),createImageBitmap(t,{resizeWidth:i.toWidth,resizeHeight:i.toHeight,resizeQuality:c.cib_quality_name(f.f2q[i.filter])}).then((function(t){if(i.canceled)return i.cancelToken;if(!i.unsharpAmount)return a.drawImage(t,0,0),t.close(),a=null,n.debug("Finished!"),e;n.debug("Unsharp result");var r=n.options.createCanvas(i.toWidth,i.toHeight),o=r.getContext("2d");o.drawImage(t,0,0),t.close();var s=o.getImageData(0,0,i.toWidth,i.toHeight);return n.__mathlib.unsharp_mask(s.data,i.toWidth,i.toHeight,i.unsharpAmount,i.unsharpRadius,i.unsharpThreshold),a.putImageData(s,0,0),r.width=r.height=0,s=o=r=a=null,n.debug("Finished!"),e}))},E.prototype.resize=function(t,e,i){var n=this;this.debug("Start resize...");var a=r({},v);if(isNaN(i)?i&&(a=r(a,i)):a=r(a,{quality:i}),a.toWidth=e.width,a.toHeight=e.height,a.width=t.naturalWidth||t.width,a.height=t.naturalHeight||t.height,Object.prototype.hasOwnProperty.call(a,"quality")){if(a.quality<0||a.quality>3)throw new Error("Pica: .quality should be [0..3], got ".concat(a.quality));a.filter=f.q2f[a.quality]}return 0===e.width||0===e.height?Promise.reject(new Error("Invalid output size: ".concat(e.width,"x").concat(e.height))):(a.unsharpRadius>2&&(a.unsharpRadius=2),a.canceled=!1,a.cancelToken&&(a.cancelToken=a.cancelToken.then((function(t){throw a.canceled=!0,t}),(function(t){throw a.canceled=!0,t}))),a.__destTileBorder=Math.ceil(Math.max(3,2.5*a.unsharpRadius|0)),this.init().then((function(){if(a.canceled)return a.cancelToken;if(n.features.cib){if(f.q2f.indexOf(a.filter)>=0)return n.__resizeViaCreateImageBitmap(t,e,a);n.debug("cib is enabled, but not supports provided filter, fallback to manual math")}if(!y){var i=new Error("Pica: cannot use getImageData on canvas, "+"make sure fingerprinting protection isn't enabled");throw i.code="ERR_GET_IMAGE_DATA",i}var r=u(a.width,a.height,a.toWidth,a.toHeight,n.options.tile,a.__destTileBorder);return n.__processStages(r,t,e,a)})))},E.prototype.resizeBuffer=function(t){var e=this,i=r({},v,t);if(Object.prototype.hasOwnProperty.call(i,"quality")){if(i.quality<0||i.quality>3)throw new Error("Pica: .quality should be [0..3], got ".concat(i.quality));i.filter=f.q2f[i.quality]}return this.init().then((function(){return e.__mathlib.resizeAndUnsharp(i)}))},E.prototype.toBlob=function(t,e,i){return e=e||"image/png",new Promise((function(n){if(t.toBlob)t.toBlob((function(t){return n(t)}),e,i);else if(t.convertToBlob)n(t.convertToBlob({type:e,quality:i}));else{for(var a=atob(t.toDataURL(e,i).split(",")[1]),r=a.length,o=new Uint8Array(r),s=0;s<r;s++)o[s]=a.charCodeAt(s);n(new Blob([o],{type:e}))}}))},E.prototype.debug=function(){},e.exports=E},{"./lib/mathlib":1,"./lib/mm_resize/resize_filter_info":7,"./lib/pool":13,"./lib/stepper":14,"./lib/tiler":15,"./lib/utils":16,"./lib/worker":17,"object-assign":22,webworkify:23}]},{},[])("/index.js"))}}]);
//# sourceMappingURL=chunk~modules.js.map