import{r as t,B as i,h as e}from"./p-03169580.js";import{c as r,a}from"./p-bd8b186e.js";var n=r((function(t,i){
/*!
 * Cropper.js v1.5.12
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2021-06-12T08:00:17.411Z
 */
(function(i,e){t.exports=e()})(a,(function(){function t(t,i){var e=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);if(i){r=r.filter((function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable}))}e.push.apply(e,r)}return e}function i(i){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};if(e%2){t(Object(r),true).forEach((function(t){s(i,t,r[t])}))}else if(Object.getOwnPropertyDescriptors){Object.defineProperties(i,Object.getOwnPropertyDescriptors(r))}else{t(Object(r)).forEach((function(t){Object.defineProperty(i,t,Object.getOwnPropertyDescriptor(r,t))}))}}return i}function e(t){"@babel/helpers - typeof";if(typeof Symbol==="function"&&typeof Symbol.iterator==="symbol"){e=function(t){return typeof t}}else{e=function(t){return t&&typeof Symbol==="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t}}return e(t)}function r(t,i){if(!(t instanceof i)){throw new TypeError("Cannot call a class as a function")}}function a(t,i){for(var e=0;e<i.length;e++){var r=i[e];r.enumerable=r.enumerable||false;r.configurable=true;if("value"in r)r.writable=true;Object.defineProperty(t,r.key,r)}}function n(t,i,e){if(i)a(t.prototype,i);if(e)a(t,e);return t}function s(t,i,e){if(i in t){Object.defineProperty(t,i,{value:e,enumerable:true,configurable:true,writable:true})}else{t[i]=e}return t}function o(t){return h(t)||f(t)||c(t)||p()}function h(t){if(Array.isArray(t))return u(t)}function f(t){if(typeof Symbol!=="undefined"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function c(t,i){if(!t)return;if(typeof t==="string")return u(t,i);var e=Object.prototype.toString.call(t).slice(8,-1);if(e==="Object"&&t.constructor)e=t.constructor.name;if(e==="Map"||e==="Set")return Array.from(t);if(e==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(e))return u(t,i)}function u(t,i){if(i==null||i>t.length)i=t.length;for(var e=0,r=new Array(i);e<i;e++)r[e]=t[e];return r}function p(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var v=typeof window!=="undefined"&&typeof window.document!=="undefined";var l=v?window:{};var d=v&&l.document.documentElement?"ontouchstart"in l.document.documentElement:false;var b=v?"PointerEvent"in l:false;var m="cropper";var g="all";var w="crop";var M="move";var y="zoom";var x="e";var k="w";var A="s";var C="n";var j="ne";var O="nw";var N="se";var z="sw";var R="".concat(m,"-crop");var B="".concat(m,"-disabled");var T="".concat(m,"-hidden");var D="".concat(m,"-hide");var E="".concat(m,"-invisible");var X="".concat(m,"-modal");var I="".concat(m,"-move");var S="".concat(m,"Action");var Y="".concat(m,"Preview");var H="crop";var W="move";var P="none";var F="crop";var U="cropend";var Z="cropmove";var $="cropstart";var G="dblclick";var Q=d?"touchstart":"mousedown";var V=d?"touchmove":"mousemove";var L=d?"touchend touchcancel":"mouseup";var J=b?"pointerdown":Q;var K=b?"pointermove":V;var q=b?"pointerup pointercancel":L;var _="ready";var tt="resize";var it="wheel";var et="zoom";var rt="image/jpeg";var at=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/;var nt=/^data:/;var st=/^data:image\/jpeg;base64,/;var ot=/^img|canvas$/i;var ht=200;var ft=100;var ct={viewMode:0,dragMode:H,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:true,restore:true,checkCrossOrigin:true,checkOrientation:true,modal:true,guides:true,center:true,highlight:true,background:true,autoCrop:true,autoCropArea:.8,movable:true,rotatable:true,scalable:true,zoomable:true,zoomOnTouch:true,zoomOnWheel:true,wheelZoomRatio:.1,cropBoxMovable:true,cropBoxResizable:true,toggleDragModeOnDblclick:true,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:ht,minContainerHeight:ft,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null};var ut='<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>";var pt=Number.isNaN||l.isNaN;function vt(t){return typeof t==="number"&&!pt(t)}var lt=function t(i){return i>0&&i<Infinity};function dt(t){return typeof t==="undefined"}function bt(t){return e(t)==="object"&&t!==null}var mt=Object.prototype.hasOwnProperty;function gt(t){if(!bt(t)){return false}try{var i=t.constructor;var e=i.prototype;return i&&e&&mt.call(e,"isPrototypeOf")}catch(t){return false}}function wt(t){return typeof t==="function"}var Mt=Array.prototype.slice;function yt(t){return Array.from?Array.from(t):Mt.call(t)}function xt(t,i){if(t&&wt(i)){if(Array.isArray(t)||vt(t.length)){yt(t).forEach((function(e,r){i.call(t,e,r,t)}))}else if(bt(t)){Object.keys(t).forEach((function(e){i.call(t,t[e],e,t)}))}}return t}var kt=Object.assign||function t(i){for(var e=arguments.length,r=new Array(e>1?e-1:0),a=1;a<e;a++){r[a-1]=arguments[a]}if(bt(i)&&r.length>0){r.forEach((function(t){if(bt(t)){Object.keys(t).forEach((function(e){i[e]=t[e]}))}}))}return i};var At=/\.\d*(?:0|9){12}\d*$/;function Ct(t){var i=arguments.length>1&&arguments[1]!==undefined?arguments[1]:1e11;return At.test(t)?Math.round(t*i)/i:t}var jt=/^width|height|left|top|marginLeft|marginTop$/;function Ot(t,i){var e=t.style;xt(i,(function(t,i){if(jt.test(i)&&vt(t)){t="".concat(t,"px")}e[i]=t}))}function Nt(t,i){return t.classList?t.classList.contains(i):t.className.indexOf(i)>-1}function zt(t,i){if(!i){return}if(vt(t.length)){xt(t,(function(t){zt(t,i)}));return}if(t.classList){t.classList.add(i);return}var e=t.className.trim();if(!e){t.className=i}else if(e.indexOf(i)<0){t.className="".concat(e," ").concat(i)}}function Rt(t,i){if(!i){return}if(vt(t.length)){xt(t,(function(t){Rt(t,i)}));return}if(t.classList){t.classList.remove(i);return}if(t.className.indexOf(i)>=0){t.className=t.className.replace(i,"")}}function Bt(t,i,e){if(!i){return}if(vt(t.length)){xt(t,(function(t){Bt(t,i,e)}));return}if(e){zt(t,i)}else{Rt(t,i)}}var Tt=/([a-z\d])([A-Z])/g;function Dt(t){return t.replace(Tt,"$1-$2").toLowerCase()}function Et(t,i){if(bt(t[i])){return t[i]}if(t.dataset){return t.dataset[i]}return t.getAttribute("data-".concat(Dt(i)))}function Xt(t,i,e){if(bt(e)){t[i]=e}else if(t.dataset){t.dataset[i]=e}else{t.setAttribute("data-".concat(Dt(i)),e)}}function It(t,i){if(bt(t[i])){try{delete t[i]}catch(e){t[i]=undefined}}else if(t.dataset){try{delete t.dataset[i]}catch(e){t.dataset[i]=undefined}}else{t.removeAttribute("data-".concat(Dt(i)))}}var St=/\s\s*/;var Yt=function(){var t=false;if(v){var i=false;var e=function t(){};var r=Object.defineProperty({},"once",{get:function e(){t=true;return i},set:function t(e){i=e}});l.addEventListener("test",e,r);l.removeEventListener("test",e,r)}return t}();function Ht(t,i,e){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var a=e;i.trim().split(St).forEach((function(i){if(!Yt){var n=t.listeners;if(n&&n[i]&&n[i][e]){a=n[i][e];delete n[i][e];if(Object.keys(n[i]).length===0){delete n[i]}if(Object.keys(n).length===0){delete t.listeners}}}t.removeEventListener(i,a,r)}))}function Wt(t,i,e){var r=arguments.length>3&&arguments[3]!==undefined?arguments[3]:{};var a=e;i.trim().split(St).forEach((function(i){if(r.once&&!Yt){var n=t.listeners,s=n===void 0?{}:n;a=function n(){delete s[i][e];t.removeEventListener(i,a,r);for(var o=arguments.length,h=new Array(o),f=0;f<o;f++){h[f]=arguments[f]}e.apply(t,h)};if(!s[i]){s[i]={}}if(s[i][e]){t.removeEventListener(i,s[i][e],r)}s[i][e]=a;t.listeners=s}t.addEventListener(i,a,r)}))}function Pt(t,i,e){var r;if(wt(Event)&&wt(CustomEvent)){r=new CustomEvent(i,{detail:e,bubbles:true,cancelable:true})}else{r=document.createEvent("CustomEvent");r.initCustomEvent(i,true,true,e)}return t.dispatchEvent(r)}function Ft(t){var i=t.getBoundingClientRect();return{left:i.left+(window.pageXOffset-document.documentElement.clientLeft),top:i.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ut=l.location;var Zt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function $t(t){var i=t.match(Zt);return i!==null&&(i[1]!==Ut.protocol||i[2]!==Ut.hostname||i[3]!==Ut.port)}function Gt(t){var i="timestamp=".concat((new Date).getTime());return t+(t.indexOf("?")===-1?"?":"&")+i}function Qt(t){var i=t.rotate,e=t.scaleX,r=t.scaleY,a=t.translateX,n=t.translateY;var s=[];if(vt(a)&&a!==0){s.push("translateX(".concat(a,"px)"))}if(vt(n)&&n!==0){s.push("translateY(".concat(n,"px)"))}if(vt(i)&&i!==0){s.push("rotate(".concat(i,"deg)"))}if(vt(e)&&e!==1){s.push("scaleX(".concat(e,")"))}if(vt(r)&&r!==1){s.push("scaleY(".concat(r,")"))}var o=s.length?s.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function Vt(t){var e=i({},t);var r=0;xt(t,(function(t,i){delete e[i];xt(e,(function(i){var e=Math.abs(t.startX-i.startX);var a=Math.abs(t.startY-i.startY);var n=Math.abs(t.endX-i.endX);var s=Math.abs(t.endY-i.endY);var o=Math.sqrt(e*e+a*a);var h=Math.sqrt(n*n+s*s);var f=(h-o)/o;if(Math.abs(f)>Math.abs(r)){r=f}}))}));return r}function Lt(t,e){var r=t.pageX,a=t.pageY;var n={endX:r,endY:a};return e?n:i({startX:r,startY:a},n)}function Jt(t){var i=0;var e=0;var r=0;xt(t,(function(t){var a=t.startX,n=t.startY;i+=a;e+=n;r+=1}));i/=r;e/=r;return{pageX:i,pageY:e}}function Kt(t){var i=t.aspectRatio,e=t.height,r=t.width;var a=arguments.length>1&&arguments[1]!==undefined?arguments[1]:"contain";var n=lt(r);var s=lt(e);if(n&&s){var o=e*i;if(a==="contain"&&o>r||a==="cover"&&o<r){e=r/i}else{r=e*i}}else if(n){e=r/i}else if(s){r=e*i}return{width:r,height:e}}function qt(t){var i=t.width,e=t.height,r=t.degree;r=Math.abs(r)%180;if(r===90){return{width:e,height:i}}var a=r%90*Math.PI/180;var n=Math.sin(a);var s=Math.cos(a);var o=i*s+e*n;var h=i*n+e*s;return r>90?{width:h,height:o}:{width:o,height:h}}function _t(t,i,e,r){var a=i.aspectRatio,n=i.naturalWidth,s=i.naturalHeight,h=i.rotate,f=h===void 0?0:h,c=i.scaleX,u=c===void 0?1:c,p=i.scaleY,v=p===void 0?1:p;var l=e.aspectRatio,d=e.naturalWidth,b=e.naturalHeight;var m=r.fillColor,g=m===void 0?"transparent":m,w=r.imageSmoothingEnabled,M=w===void 0?true:w,y=r.imageSmoothingQuality,x=y===void 0?"low":y,k=r.maxWidth,A=k===void 0?Infinity:k,C=r.maxHeight,j=C===void 0?Infinity:C,O=r.minWidth,N=O===void 0?0:O,z=r.minHeight,R=z===void 0?0:z;var B=document.createElement("canvas");var T=B.getContext("2d");var D=Kt({aspectRatio:l,width:A,height:j});var E=Kt({aspectRatio:l,width:N,height:R},"cover");var X=Math.min(D.width,Math.max(E.width,d));var I=Math.min(D.height,Math.max(E.height,b));var S=Kt({aspectRatio:a,width:A,height:j});var Y=Kt({aspectRatio:a,width:N,height:R},"cover");var H=Math.min(S.width,Math.max(Y.width,n));var W=Math.min(S.height,Math.max(Y.height,s));var P=[-H/2,-W/2,H,W];B.width=Ct(X);B.height=Ct(I);T.fillStyle=g;T.fillRect(0,0,X,I);T.save();T.translate(X/2,I/2);T.rotate(f*Math.PI/180);T.scale(u,v);T.imageSmoothingEnabled=M;T.imageSmoothingQuality=x;T.drawImage.apply(T,[t].concat(o(P.map((function(t){return Math.floor(Ct(t))})))));T.restore();return B}var ti=String.fromCharCode;function ii(t,i,e){var r="";e+=i;for(var a=i;a<e;a+=1){r+=ti(t.getUint8(a))}return r}var ei=/^data:.*,/;function ri(t){var i=t.replace(ei,"");var e=atob(i);var r=new ArrayBuffer(e.length);var a=new Uint8Array(r);xt(a,(function(t,i){a[i]=e.charCodeAt(i)}));return r}function ai(t,i){var e=[];var r=8192;var a=new Uint8Array(t);while(a.length>0){e.push(ti.apply(null,yt(a.subarray(0,r))));a=a.subarray(r)}return"data:".concat(i,";base64,").concat(btoa(e.join("")))}function ni(t){var i=new DataView(t);var e;try{var r;var a;var n;if(i.getUint8(0)===255&&i.getUint8(1)===216){var s=i.byteLength;var o=2;while(o+1<s){if(i.getUint8(o)===255&&i.getUint8(o+1)===225){a=o;break}o+=1}}if(a){var h=a+4;var f=a+10;if(ii(i,h,4)==="Exif"){var c=i.getUint16(f);r=c===18761;if(r||c===19789){if(i.getUint16(f+2,r)===42){var u=i.getUint32(f+4,r);if(u>=8){n=f+u}}}}}if(n){var p=i.getUint16(n,r);var v;var l;for(l=0;l<p;l+=1){v=n+l*12+2;if(i.getUint16(v,r)===274){v+=8;e=i.getUint16(v,r);i.setUint16(v,1,r);break}}}}catch(t){e=1}return e}function si(t){var i=0;var e=1;var r=1;switch(t){case 2:e=-1;break;case 3:i=-180;break;case 4:r=-1;break;case 5:i=90;r=-1;break;case 6:i=90;break;case 7:i=90;e=-1;break;case 8:i=-90;break}return{rotate:i,scaleX:e,scaleY:r}}var oi={render:function t(){this.initContainer();this.initCanvas();this.initCropBox();this.renderCanvas();if(this.cropped){this.renderCropBox()}},initContainer:function t(){var i=this.element,e=this.options,r=this.container,a=this.cropper;var n=Number(e.minContainerWidth);var s=Number(e.minContainerHeight);zt(a,T);Rt(i,T);var o={width:Math.max(r.offsetWidth,n>=0?n:ht),height:Math.max(r.offsetHeight,s>=0?s:ft)};this.containerData=o;Ot(a,{width:o.width,height:o.height});zt(i,T);Rt(a,T)},initCanvas:function t(){var i=this.containerData,e=this.imageData;var r=this.options.viewMode;var a=Math.abs(e.rotate)%180===90;var n=a?e.naturalHeight:e.naturalWidth;var s=a?e.naturalWidth:e.naturalHeight;var o=n/s;var h=i.width;var f=i.height;if(i.height*o>i.width){if(r===3){h=i.height*o}else{f=i.width/o}}else if(r===3){f=i.width/o}else{h=i.height*o}var c={aspectRatio:o,naturalWidth:n,naturalHeight:s,width:h,height:f};this.canvasData=c;this.limited=r===1||r===2;this.limitCanvas(true,true);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=(i.width-c.width)/2;c.top=(i.height-c.height)/2;c.oldLeft=c.left;c.oldTop=c.top;this.initialCanvasData=kt({},c)},limitCanvas:function t(i,e){var r=this.options,a=this.containerData,n=this.canvasData,s=this.cropBoxData;var o=r.viewMode;var h=n.aspectRatio;var f=this.cropped&&s;if(i){var c=Number(r.minCanvasWidth)||0;var u=Number(r.minCanvasHeight)||0;if(o>1){c=Math.max(c,a.width);u=Math.max(u,a.height);if(o===3){if(u*h>c){c=u*h}else{u=c/h}}}else if(o>0){if(c){c=Math.max(c,f?s.width:0)}else if(u){u=Math.max(u,f?s.height:0)}else if(f){c=s.width;u=s.height;if(u*h>c){c=u*h}else{u=c/h}}}var p=Kt({aspectRatio:h,width:c,height:u});c=p.width;u=p.height;n.minWidth=c;n.minHeight=u;n.maxWidth=Infinity;n.maxHeight=Infinity}if(e){if(o>(f?0:1)){var v=a.width-n.width;var l=a.height-n.height;n.minLeft=Math.min(0,v);n.minTop=Math.min(0,l);n.maxLeft=Math.max(0,v);n.maxTop=Math.max(0,l);if(f&&this.limited){n.minLeft=Math.min(s.left,s.left+(s.width-n.width));n.minTop=Math.min(s.top,s.top+(s.height-n.height));n.maxLeft=s.left;n.maxTop=s.top;if(o===2){if(n.width>=a.width){n.minLeft=Math.min(0,v);n.maxLeft=Math.max(0,v)}if(n.height>=a.height){n.minTop=Math.min(0,l);n.maxTop=Math.max(0,l)}}}}else{n.minLeft=-n.width;n.minTop=-n.height;n.maxLeft=a.width;n.maxTop=a.height}}},renderCanvas:function t(i,e){var r=this.canvasData,a=this.imageData;if(e){var n=qt({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),s=n.width,o=n.height;var h=r.width*(s/r.naturalWidth);var f=r.height*(o/r.naturalHeight);r.left-=(h-r.width)/2;r.top-=(f-r.height)/2;r.width=h;r.height=f;r.aspectRatio=s/o;r.naturalWidth=s;r.naturalHeight=o;this.limitCanvas(true,false)}if(r.width>r.maxWidth||r.width<r.minWidth){r.left=r.oldLeft}if(r.height>r.maxHeight||r.height<r.minHeight){r.top=r.oldTop}r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth);r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight);this.limitCanvas(false,true);r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft);r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop);r.oldLeft=r.left;r.oldTop=r.top;Ot(this.canvas,kt({width:r.width,height:r.height},Qt({translateX:r.left,translateY:r.top})));this.renderImage(i);if(this.cropped&&this.limited){this.limitCropBox(true,true)}},renderImage:function t(i){var e=this.canvasData,r=this.imageData;var a=r.naturalWidth*(e.width/e.naturalWidth);var n=r.naturalHeight*(e.height/e.naturalHeight);kt(r,{width:a,height:n,left:(e.width-a)/2,top:(e.height-n)/2});Ot(this.image,kt({width:r.width,height:r.height},Qt(kt({translateX:r.left,translateY:r.top},r))));if(i){this.output()}},initCropBox:function t(){var i=this.options,e=this.canvasData;var r=i.aspectRatio||i.initialAspectRatio;var a=Number(i.autoCropArea)||.8;var n={width:e.width,height:e.height};if(r){if(e.height*r>e.width){n.height=n.width/r}else{n.width=n.height*r}}this.cropBoxData=n;this.limitCropBox(true,true);n.width=Math.min(Math.max(n.width,n.minWidth),n.maxWidth);n.height=Math.min(Math.max(n.height,n.minHeight),n.maxHeight);n.width=Math.max(n.minWidth,n.width*a);n.height=Math.max(n.minHeight,n.height*a);n.left=e.left+(e.width-n.width)/2;n.top=e.top+(e.height-n.height)/2;n.oldLeft=n.left;n.oldTop=n.top;this.initialCropBoxData=kt({},n)},limitCropBox:function t(i,e){var r=this.options,a=this.containerData,n=this.canvasData,s=this.cropBoxData,o=this.limited;var h=r.aspectRatio;if(i){var f=Number(r.minCropBoxWidth)||0;var c=Number(r.minCropBoxHeight)||0;var u=o?Math.min(a.width,n.width,n.width+n.left,a.width-n.left):a.width;var p=o?Math.min(a.height,n.height,n.height+n.top,a.height-n.top):a.height;f=Math.min(f,a.width);c=Math.min(c,a.height);if(h){if(f&&c){if(c*h>f){c=f/h}else{f=c*h}}else if(f){c=f/h}else if(c){f=c*h}if(p*h>u){p=u/h}else{u=p*h}}s.minWidth=Math.min(f,u);s.minHeight=Math.min(c,p);s.maxWidth=u;s.maxHeight=p}if(e){if(o){s.minLeft=Math.max(0,n.left);s.minTop=Math.max(0,n.top);s.maxLeft=Math.min(a.width,n.left+n.width)-s.width;s.maxTop=Math.min(a.height,n.top+n.height)-s.height}else{s.minLeft=0;s.minTop=0;s.maxLeft=a.width-s.width;s.maxTop=a.height-s.height}}},renderCropBox:function t(){var i=this.options,e=this.containerData,r=this.cropBoxData;if(r.width>r.maxWidth||r.width<r.minWidth){r.left=r.oldLeft}if(r.height>r.maxHeight||r.height<r.minHeight){r.top=r.oldTop}r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth);r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight);this.limitCropBox(false,true);r.left=Math.min(Math.max(r.left,r.minLeft),r.maxLeft);r.top=Math.min(Math.max(r.top,r.minTop),r.maxTop);r.oldLeft=r.left;r.oldTop=r.top;if(i.movable&&i.cropBoxMovable){Xt(this.face,S,r.width>=e.width&&r.height>=e.height?M:g)}Ot(this.cropBox,kt({width:r.width,height:r.height},Qt({translateX:r.left,translateY:r.top})));if(this.cropped&&this.limited){this.limitCanvas(true,true)}if(!this.disabled){this.output()}},output:function t(){this.preview();Pt(this.element,F,this.getData())}};var hi={initPreview:function t(){var i=this.element,e=this.crossOrigin;var r=this.options.preview;var a=e?this.crossOriginUrl:this.url;var n=i.alt||"The image to preview";var s=document.createElement("img");if(e){s.crossOrigin=e}s.src=a;s.alt=n;this.viewBox.appendChild(s);this.viewBoxImage=s;if(!r){return}var o=r;if(typeof r==="string"){o=i.ownerDocument.querySelectorAll(r)}else if(r.querySelector){o=[r]}this.previews=o;xt(o,(function(t){var i=document.createElement("img");Xt(t,Y,{width:t.offsetWidth,height:t.offsetHeight,html:t.innerHTML});if(e){i.crossOrigin=e}i.src=a;i.alt=n;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 t(){xt(this.previews,(function(t){var i=Et(t,Y);Ot(t,{width:i.width,height:i.height});t.innerHTML=i.html;It(t,Y)}))},preview:function t(){var i=this.imageData,e=this.canvasData,r=this.cropBoxData;var a=r.width,n=r.height;var s=i.width,o=i.height;var h=r.left-e.left-i.left;var f=r.top-e.top-i.top;if(!this.cropped||this.disabled){return}Ot(this.viewBoxImage,kt({width:s,height:o},Qt(kt({translateX:-h,translateY:-f},i))));xt(this.previews,(function(t){var e=Et(t,Y);var r=e.width;var c=e.height;var u=r;var p=c;var v=1;if(a){v=r/a;p=n*v}if(n&&p>c){v=c/n;u=a*v;p=c}Ot(t,{width:u,height:p});Ot(t.getElementsByTagName("img")[0],kt({width:s*v,height:o*v},Qt(kt({translateX:-h*v,translateY:-f*v},i))))}))}};var fi={bind:function t(){var i=this.element,e=this.options,r=this.cropper;if(wt(e.cropstart)){Wt(i,$,e.cropstart)}if(wt(e.cropmove)){Wt(i,Z,e.cropmove)}if(wt(e.cropend)){Wt(i,U,e.cropend)}if(wt(e.crop)){Wt(i,F,e.crop)}if(wt(e.zoom)){Wt(i,et,e.zoom)}Wt(r,J,this.onCropStart=this.cropStart.bind(this));if(e.zoomable&&e.zoomOnWheel){Wt(r,it,this.onWheel=this.wheel.bind(this),{passive:false,capture:true})}if(e.toggleDragModeOnDblclick){Wt(r,G,this.onDblclick=this.dblclick.bind(this))}Wt(i.ownerDocument,K,this.onCropMove=this.cropMove.bind(this));Wt(i.ownerDocument,q,this.onCropEnd=this.cropEnd.bind(this));if(e.responsive){Wt(window,tt,this.onResize=this.resize.bind(this))}},unbind:function t(){var i=this.element,e=this.options,r=this.cropper;if(wt(e.cropstart)){Ht(i,$,e.cropstart)}if(wt(e.cropmove)){Ht(i,Z,e.cropmove)}if(wt(e.cropend)){Ht(i,U,e.cropend)}if(wt(e.crop)){Ht(i,F,e.crop)}if(wt(e.zoom)){Ht(i,et,e.zoom)}Ht(r,J,this.onCropStart);if(e.zoomable&&e.zoomOnWheel){Ht(r,it,this.onWheel,{passive:false,capture:true})}if(e.toggleDragModeOnDblclick){Ht(r,G,this.onDblclick)}Ht(i.ownerDocument,K,this.onCropMove);Ht(i.ownerDocument,q,this.onCropEnd);if(e.responsive){Ht(window,tt,this.onResize)}}};var ci={resize:function t(){if(this.disabled){return}var i=this.options,e=this.container,r=this.containerData;var a=e.offsetWidth/r.width;var n=e.offsetHeight/r.height;var s=Math.abs(a-1)>Math.abs(n-1)?a:n;if(s!==1){var o;var h;if(i.restore){o=this.getCanvasData();h=this.getCropBoxData()}this.render();if(i.restore){this.setCanvasData(xt(o,(function(t,i){o[i]=t*s})));this.setCropBoxData(xt(h,(function(t,i){h[i]=t*s})))}}},dblclick:function t(){if(this.disabled||this.options.dragMode===P){return}this.setDragMode(Nt(this.dragBox,R)?W:H)},wheel:function t(i){var e=this;var r=Number(this.options.wheelZoomRatio)||.1;var a=1;if(this.disabled){return}i.preventDefault();if(this.wheeling){return}this.wheeling=true;setTimeout((function(){e.wheeling=false}),50);if(i.deltaY){a=i.deltaY>0?1:-1}else if(i.wheelDelta){a=-i.wheelDelta/120}else if(i.detail){a=i.detail>0?1:-1}this.zoom(-a*r,i)},cropStart:function t(i){var e=i.buttons,r=i.button;if(this.disabled||(i.type==="mousedown"||i.type==="pointerdown"&&i.pointerType==="mouse")&&(vt(e)&&e!==1||vt(r)&&r!==0||i.ctrlKey)){return}var a=this.options,n=this.pointers;var s;if(i.changedTouches){xt(i.changedTouches,(function(t){n[t.identifier]=Lt(t)}))}else{n[i.pointerId||0]=Lt(i)}if(Object.keys(n).length>1&&a.zoomable&&a.zoomOnTouch){s=y}else{s=Et(i.target,S)}if(!at.test(s)){return}if(Pt(this.element,$,{originalEvent:i,action:s})===false){return}i.preventDefault();this.action=s;this.cropping=false;if(s===w){this.cropping=true;zt(this.dragBox,X)}},cropMove:function t(i){var e=this.action;if(this.disabled||!e){return}var r=this.pointers;i.preventDefault();if(Pt(this.element,Z,{originalEvent:i,action:e})===false){return}if(i.changedTouches){xt(i.changedTouches,(function(t){kt(r[t.identifier]||{},Lt(t,true))}))}else{kt(r[i.pointerId||0]||{},Lt(i,true))}this.change(i)},cropEnd:function t(i){if(this.disabled){return}var e=this.action,r=this.pointers;if(i.changedTouches){xt(i.changedTouches,(function(t){delete r[t.identifier]}))}else{delete r[i.pointerId||0]}if(!e){return}i.preventDefault();if(!Object.keys(r).length){this.action=""}if(this.cropping){this.cropping=false;Bt(this.dragBox,X,this.cropped&&this.options.modal)}Pt(this.element,U,{originalEvent:i,action:e})}};var ui={change:function t(i){var e=this.options,r=this.canvasData,a=this.containerData,n=this.cropBoxData,s=this.pointers;var o=this.action;var h=e.aspectRatio;var f=n.left,c=n.top,u=n.width,p=n.height;var v=f+u;var l=c+p;var d=0;var b=0;var m=a.width;var R=a.height;var B=true;var D;if(!h&&i.shiftKey){h=u&&p?u/p:1}if(this.limited){d=n.minLeft;b=n.minTop;m=d+Math.min(a.width,r.width,r.left+r.width);R=b+Math.min(a.height,r.height,r.top+r.height)}var E=s[Object.keys(s)[0]];var X={x:E.endX-E.startX,y:E.endY-E.startY};var I=function t(i){switch(i){case x:if(v+X.x>m){X.x=m-v}break;case k:if(f+X.x<d){X.x=d-f}break;case C:if(c+X.y<b){X.y=b-c}break;case A:if(l+X.y>R){X.y=R-l}break}};switch(o){case g:f+=X.x;c+=X.y;break;case x:if(X.x>=0&&(v>=m||h&&(c<=b||l>=R))){B=false;break}I(x);u+=X.x;if(u<0){o=k;u=-u;f-=u}if(h){p=u/h;c+=(n.height-p)/2}break;case C:if(X.y<=0&&(c<=b||h&&(f<=d||v>=m))){B=false;break}I(C);p-=X.y;c+=X.y;if(p<0){o=A;p=-p;c-=p}if(h){u=p*h;f+=(n.width-u)/2}break;case k:if(X.x<=0&&(f<=d||h&&(c<=b||l>=R))){B=false;break}I(k);u-=X.x;f+=X.x;if(u<0){o=x;u=-u;f-=u}if(h){p=u/h;c+=(n.height-p)/2}break;case A:if(X.y>=0&&(l>=R||h&&(f<=d||v>=m))){B=false;break}I(A);p+=X.y;if(p<0){o=C;p=-p;c-=p}if(h){u=p*h;f+=(n.width-u)/2}break;case j:if(h){if(X.y<=0&&(c<=b||v>=m)){B=false;break}I(C);p-=X.y;c+=X.y;u=p*h}else{I(C);I(x);if(X.x>=0){if(v<m){u+=X.x}else if(X.y<=0&&c<=b){B=false}}else{u+=X.x}if(X.y<=0){if(c>b){p-=X.y;c+=X.y}}else{p-=X.y;c+=X.y}}if(u<0&&p<0){o=z;p=-p;u=-u;c-=p;f-=u}else if(u<0){o=O;u=-u;f-=u}else if(p<0){o=N;p=-p;c-=p}break;case O:if(h){if(X.y<=0&&(c<=b||f<=d)){B=false;break}I(C);p-=X.y;c+=X.y;u=p*h;f+=n.width-u}else{I(C);I(k);if(X.x<=0){if(f>d){u-=X.x;f+=X.x}else if(X.y<=0&&c<=b){B=false}}else{u-=X.x;f+=X.x}if(X.y<=0){if(c>b){p-=X.y;c+=X.y}}else{p-=X.y;c+=X.y}}if(u<0&&p<0){o=N;p=-p;u=-u;c-=p;f-=u}else if(u<0){o=j;u=-u;f-=u}else if(p<0){o=z;p=-p;c-=p}break;case z:if(h){if(X.x<=0&&(f<=d||l>=R)){B=false;break}I(k);u-=X.x;f+=X.x;p=u/h}else{I(A);I(k);if(X.x<=0){if(f>d){u-=X.x;f+=X.x}else if(X.y>=0&&l>=R){B=false}}else{u-=X.x;f+=X.x}if(X.y>=0){if(l<R){p+=X.y}}else{p+=X.y}}if(u<0&&p<0){o=j;p=-p;u=-u;c-=p;f-=u}else if(u<0){o=N;u=-u;f-=u}else if(p<0){o=O;p=-p;c-=p}break;case N:if(h){if(X.x>=0&&(v>=m||l>=R)){B=false;break}I(x);u+=X.x;p=u/h}else{I(A);I(x);if(X.x>=0){if(v<m){u+=X.x}else if(X.y>=0&&l>=R){B=false}}else{u+=X.x}if(X.y>=0){if(l<R){p+=X.y}}else{p+=X.y}}if(u<0&&p<0){o=O;p=-p;u=-u;c-=p;f-=u}else if(u<0){o=z;u=-u;f-=u}else if(p<0){o=j;p=-p;c-=p}break;case M:this.move(X.x,X.y);B=false;break;case y:this.zoom(Vt(s),i);B=false;break;case w:if(!X.x||!X.y){B=false;break}D=Ft(this.cropper);f=E.startX-D.left;c=E.startY-D.top;u=n.minWidth;p=n.minHeight;if(X.x>0){o=X.y>0?N:j}else if(X.x<0){f-=u;o=X.y>0?z:O}if(X.y<0){c-=p}if(!this.cropped){Rt(this.cropBox,T);this.cropped=true;if(this.limited){this.limitCropBox(true,true)}}break}if(B){n.width=u;n.height=p;n.left=f;n.top=c;this.action=o;this.renderCropBox()}xt(s,(function(t){t.startX=t.endX;t.startY=t.endY}))}};var pi={crop:function t(){if(this.ready&&!this.cropped&&!this.disabled){this.cropped=true;this.limitCropBox(true,true);if(this.options.modal){zt(this.dragBox,X)}Rt(this.cropBox,T);this.setCropBoxData(this.initialCropBoxData)}return this},reset:function t(){if(this.ready&&!this.disabled){this.imageData=kt({},this.initialImageData);this.canvasData=kt({},this.initialCanvasData);this.cropBoxData=kt({},this.initialCropBoxData);this.renderCanvas();if(this.cropped){this.renderCropBox()}}return this},clear:function t(){if(this.cropped&&!this.disabled){kt(this.cropBoxData,{left:0,top:0,width:0,height:0});this.cropped=false;this.renderCropBox();this.limitCanvas(true,true);this.renderCanvas();Rt(this.dragBox,X);zt(this.cropBox,T)}return this},replace:function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:false;if(!this.disabled&&i){if(this.isImg){this.element.src=i}if(e){this.url=i;this.image.src=i;if(this.ready){this.viewBoxImage.src=i;xt(this.previews,(function(t){t.getElementsByTagName("img")[0].src=i}))}}else{if(this.isImg){this.replaced=true}this.options.data=null;this.uncreate();this.load(i)}}return this},enable:function t(){if(this.ready&&this.disabled){this.disabled=false;Rt(this.cropper,B)}return this},disable:function t(){if(this.ready&&!this.disabled){this.disabled=true;zt(this.cropper,B)}return this},destroy:function t(){var i=this.element;if(!i[m]){return this}i[m]=undefined;if(this.isImg&&this.replaced){i.src=this.originalUrl}this.uncreate();return this},move:function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:i;var r=this.canvasData,a=r.left,n=r.top;return this.moveTo(dt(i)?i:a+Number(i),dt(e)?e:n+Number(e))},moveTo:function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:i;var r=this.canvasData;var a=false;i=Number(i);e=Number(e);if(this.ready&&!this.disabled&&this.options.movable){if(vt(i)){r.left=i;a=true}if(vt(e)){r.top=e;a=true}if(a){this.renderCanvas(true)}}return this},zoom:function t(i,e){var r=this.canvasData;i=Number(i);if(i<0){i=1/(1-i)}else{i=1+i}return this.zoomTo(r.width*i/r.naturalWidth,null,e)},zoomTo:function t(i,e,r){var a=this.options,n=this.canvasData;var s=n.width,o=n.height,h=n.naturalWidth,f=n.naturalHeight;i=Number(i);if(i>=0&&this.ready&&!this.disabled&&a.zoomable){var c=h*i;var u=f*i;if(Pt(this.element,et,{ratio:i,oldRatio:s/h,originalEvent:r})===false){return this}if(r){var p=this.pointers;var v=Ft(this.cropper);var l=p&&Object.keys(p).length?Jt(p):{pageX:r.pageX,pageY:r.pageY};n.left-=(c-s)*((l.pageX-v.left-n.left)/s);n.top-=(u-o)*((l.pageY-v.top-n.top)/o)}else if(gt(e)&&vt(e.x)&&vt(e.y)){n.left-=(c-s)*((e.x-n.left)/s);n.top-=(u-o)*((e.y-n.top)/o)}else{n.left-=(c-s)/2;n.top-=(u-o)/2}n.width=c;n.height=u;this.renderCanvas(true)}return this},rotate:function t(i){return this.rotateTo((this.imageData.rotate||0)+Number(i))},rotateTo:function t(i){i=Number(i);if(vt(i)&&this.ready&&!this.disabled&&this.options.rotatable){this.imageData.rotate=i%360;this.renderCanvas(true,true)}return this},scaleX:function t(i){var e=this.imageData.scaleY;return this.scale(i,vt(e)?e:1)},scaleY:function t(i){var e=this.imageData.scaleX;return this.scale(vt(e)?e:1,i)},scale:function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:i;var r=this.imageData;var a=false;i=Number(i);e=Number(e);if(this.ready&&!this.disabled&&this.options.scalable){if(vt(i)){r.scaleX=i;a=true}if(vt(e)){r.scaleY=e;a=true}if(a){this.renderCanvas(true,true)}}return this},getData:function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:false;var e=this.options,r=this.imageData,a=this.canvasData,n=this.cropBoxData;var s;if(this.ready&&this.cropped){s={x:n.left-a.left,y:n.top-a.top,width:n.width,height:n.height};var o=r.width/r.naturalWidth;xt(s,(function(t,i){s[i]=t/o}));if(i){var h=Math.round(s.y+s.height);var f=Math.round(s.x+s.width);s.x=Math.round(s.x);s.y=Math.round(s.y);s.width=f-s.x;s.height=h-s.y}}else{s={x:0,y:0,width:0,height:0}}if(e.rotatable){s.rotate=r.rotate||0}if(e.scalable){s.scaleX=r.scaleX||1;s.scaleY=r.scaleY||1}return s},setData:function t(i){var e=this.options,r=this.imageData,a=this.canvasData;var n={};if(this.ready&&!this.disabled&&gt(i)){var s=false;if(e.rotatable){if(vt(i.rotate)&&i.rotate!==r.rotate){r.rotate=i.rotate;s=true}}if(e.scalable){if(vt(i.scaleX)&&i.scaleX!==r.scaleX){r.scaleX=i.scaleX;s=true}if(vt(i.scaleY)&&i.scaleY!==r.scaleY){r.scaleY=i.scaleY;s=true}}if(s){this.renderCanvas(true,true)}var o=r.width/r.naturalWidth;if(vt(i.x)){n.left=i.x*o+a.left}if(vt(i.y)){n.top=i.y*o+a.top}if(vt(i.width)){n.width=i.width*o}if(vt(i.height)){n.height=i.height*o}this.setCropBoxData(n)}return this},getContainerData:function t(){return this.ready?kt({},this.containerData):{}},getImageData:function t(){return this.sized?kt({},this.imageData):{}},getCanvasData:function t(){var i=this.canvasData;var e={};if(this.ready){xt(["left","top","width","height","naturalWidth","naturalHeight"],(function(t){e[t]=i[t]}))}return e},setCanvasData:function t(i){var e=this.canvasData;var r=e.aspectRatio;if(this.ready&&!this.disabled&&gt(i)){if(vt(i.left)){e.left=i.left}if(vt(i.top)){e.top=i.top}if(vt(i.width)){e.width=i.width;e.height=i.width/r}else if(vt(i.height)){e.height=i.height;e.width=i.height*r}this.renderCanvas(true)}return this},getCropBoxData:function t(){var i=this.cropBoxData;var e;if(this.ready&&this.cropped){e={left:i.left,top:i.top,width:i.width,height:i.height}}return e||{}},setCropBoxData:function t(i){var e=this.cropBoxData;var r=this.options.aspectRatio;var a;var n;if(this.ready&&this.cropped&&!this.disabled&&gt(i)){if(vt(i.left)){e.left=i.left}if(vt(i.top)){e.top=i.top}if(vt(i.width)&&i.width!==e.width){a=true;e.width=i.width}if(vt(i.height)&&i.height!==e.height){n=true;e.height=i.height}if(r){if(a){e.height=e.width/r}else if(n){e.width=e.height*r}}this.renderCropBox()}return this},getCroppedCanvas:function t(){var i=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement){return null}var e=this.canvasData;var r=_t(this.image,this.imageData,e,i);if(!this.cropped){return r}var a=this.getData(),n=a.x,s=a.y,h=a.width,f=a.height;var c=r.width/Math.floor(e.naturalWidth);if(c!==1){n*=c;s*=c;h*=c;f*=c}var u=h/f;var p=Kt({aspectRatio:u,width:i.maxWidth||Infinity,height:i.maxHeight||Infinity});var v=Kt({aspectRatio:u,width:i.minWidth||0,height:i.minHeight||0},"cover");var l=Kt({aspectRatio:u,width:i.width||(c!==1?r.width:h),height:i.height||(c!==1?r.height:f)}),d=l.width,b=l.height;d=Math.min(p.width,Math.max(v.width,d));b=Math.min(p.height,Math.max(v.height,b));var m=document.createElement("canvas");var g=m.getContext("2d");m.width=Ct(d);m.height=Ct(b);g.fillStyle=i.fillColor||"transparent";g.fillRect(0,0,d,b);var w=i.imageSmoothingEnabled,M=w===void 0?true:w,y=i.imageSmoothingQuality;g.imageSmoothingEnabled=M;if(y){g.imageSmoothingQuality=y}var x=r.width;var k=r.height;var A=n;var C=s;var j;var O;var N;var z;var R;var B;if(A<=-h||A>x){A=0;j=0;N=0;R=0}else if(A<=0){N=-A;A=0;j=Math.min(x,h+A);R=j}else if(A<=x){N=0;j=Math.min(h,x-A);R=j}if(j<=0||C<=-f||C>k){C=0;O=0;z=0;B=0}else if(C<=0){z=-C;C=0;O=Math.min(k,f+C);B=O}else if(C<=k){z=0;O=Math.min(f,k-C);B=O}var T=[A,C,j,O];if(R>0&&B>0){var D=d/h;T.push(N*D,z*D,R*D,B*D)}g.drawImage.apply(g,[r].concat(o(T.map((function(t){return Math.floor(Ct(t))})))));return m},setAspectRatio:function t(i){var e=this.options;if(!this.disabled&&!dt(i)){e.aspectRatio=Math.max(0,i)||NaN;if(this.ready){this.initCropBox();if(this.cropped){this.renderCropBox()}}}return this},setDragMode:function t(i){var e=this.options,r=this.dragBox,a=this.face;if(this.ready&&!this.disabled){var n=i===H;var s=e.movable&&i===W;i=n||s?i:P;e.dragMode=i;Xt(r,S,i);Bt(r,R,n);Bt(r,I,s);if(!e.cropBoxMovable){Xt(a,S,i);Bt(a,R,n);Bt(a,I,s)}}return this}};var vi=l.Cropper;var li=function(){function t(i){var e=arguments.length>1&&arguments[1]!==undefined?arguments[1]:{};r(this,t);if(!i||!ot.test(i.tagName)){throw new Error("The first argument is required and must be an <img> or <canvas> element.")}this.element=i;this.options=kt({},ct,gt(e)&&e);this.cropped=false;this.disabled=false;this.pointers={};this.ready=false;this.reloading=false;this.replaced=false;this.sized=false;this.sizing=false;this.init()}n(t,[{key:"init",value:function t(){var i=this.element;var e=i.tagName.toLowerCase();var r;if(i[m]){return}i[m]=this;if(e==="img"){this.isImg=true;r=i.getAttribute("src")||"";this.originalUrl=r;if(!r){return}r=i.src}else if(e==="canvas"&&window.HTMLCanvasElement){r=i.toDataURL()}this.load(r)}},{key:"load",value:function t(i){var e=this;if(!i){return}this.url=i;this.imageData={};var r=this.element,a=this.options;if(!a.rotatable&&!a.scalable){a.checkOrientation=false}if(!a.checkOrientation||!window.ArrayBuffer){this.clone();return}if(nt.test(i)){if(st.test(i)){this.read(ri(i))}else{this.clone()}return}var n=new XMLHttpRequest;var s=this.clone.bind(this);this.reloading=true;this.xhr=n;n.onabort=s;n.onerror=s;n.ontimeout=s;n.onprogress=function(){if(n.getResponseHeader("content-type")!==rt){n.abort()}};n.onload=function(){e.read(n.response)};n.onloadend=function(){e.reloading=false;e.xhr=null};if(a.checkCrossOrigin&&$t(i)&&r.crossOrigin){i=Gt(i)}n.open("GET",i,true);n.responseType="arraybuffer";n.withCredentials=r.crossOrigin==="use-credentials";n.send()}},{key:"read",value:function t(i){var e=this.options,r=this.imageData;var a=ni(i);var n=0;var s=1;var o=1;if(a>1){this.url=ai(i,rt);var h=si(a);n=h.rotate;s=h.scaleX;o=h.scaleY}if(e.rotatable){r.rotate=n}if(e.scalable){r.scaleX=s;r.scaleY=o}this.clone()}},{key:"clone",value:function t(){var i=this.element,e=this.url;var r=i.crossOrigin;var a=e;if(this.options.checkCrossOrigin&&$t(e)){if(!r){r="anonymous"}a=Gt(e)}this.crossOrigin=r;this.crossOriginUrl=a;var n=document.createElement("img");if(r){n.crossOrigin=r}n.src=a||e;n.alt=i.alt||"The image to crop";this.image=n;n.onload=this.start.bind(this);n.onerror=this.stop.bind(this);zt(n,D);i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function t(){var i=this;var e=this.image;e.onload=null;e.onerror=null;this.sizing=true;var r=l.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(l.navigator.userAgent);var a=function t(e,r){kt(i.imageData,{naturalWidth:e,naturalHeight:r,aspectRatio:e/r});i.initialImageData=kt({},i.imageData);i.sizing=false;i.sized=true;i.build()};if(e.naturalWidth&&!r){a(e.naturalWidth,e.naturalHeight);return}var n=document.createElement("img");var s=document.body||document.documentElement;this.sizingImage=n;n.onload=function(){a(n.width,n.height);if(!r){s.removeChild(n)}};n.src=e.src;if(!r){n.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;";s.appendChild(n)}}},{key:"stop",value:function t(){var i=this.image;i.onload=null;i.onerror=null;i.parentNode.removeChild(i);this.image=null}},{key:"build",value:function t(){if(!this.sized||this.ready){return}var i=this.element,e=this.options,r=this.image;var a=i.parentNode;var n=document.createElement("div");n.innerHTML=ut;var s=n.querySelector(".".concat(m,"-container"));var o=s.querySelector(".".concat(m,"-canvas"));var h=s.querySelector(".".concat(m,"-drag-box"));var f=s.querySelector(".".concat(m,"-crop-box"));var c=f.querySelector(".".concat(m,"-face"));this.container=a;this.cropper=s;this.canvas=o;this.dragBox=h;this.cropBox=f;this.viewBox=s.querySelector(".".concat(m,"-view-box"));this.face=c;o.appendChild(r);zt(i,T);a.insertBefore(s,i.nextSibling);if(!this.isImg){Rt(r,D)}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;zt(f,T);if(!e.guides){zt(f.getElementsByClassName("".concat(m,"-dashed")),T)}if(!e.center){zt(f.getElementsByClassName("".concat(m,"-center")),T)}if(e.background){zt(s,"".concat(m,"-bg"))}if(!e.highlight){zt(c,E)}if(e.cropBoxMovable){zt(c,I);Xt(c,S,g)}if(!e.cropBoxResizable){zt(f.getElementsByClassName("".concat(m,"-line")),T);zt(f.getElementsByClassName("".concat(m,"-point")),T)}this.render();this.ready=true;this.setDragMode(e.dragMode);if(e.autoCrop){this.crop()}this.setData(e.data);if(wt(e.ready)){Wt(i,_,e.ready,{once:true})}Pt(i,_)}},{key:"unbuild",value:function t(){if(!this.ready){return}this.ready=false;this.unbind();this.resetPreview();this.cropper.parentNode.removeChild(this.cropper);Rt(this.element,T)}},{key:"uncreate",value:function t(){if(this.ready){this.unbuild();this.ready=false;this.cropped=false}else if(this.sizing){this.sizingImage.onload=null;this.sizing=false;this.sized=false}else if(this.reloading){this.xhr.onabort=null;this.xhr.abort()}else if(this.image){this.stop()}}}],[{key:"noConflict",value:function i(){window.Cropper=vi;return t}},{key:"setDefaults",value:function t(i){kt(ct,gt(i)&&i)}}]);return t}();kt(li.prototype,oi,hi,fi,ci,ui,pi);return li}))}));const s='floodteam-photo-cropper{position:relative;display:block}floodteam-photo-cropper img{display:block;max-width:100%}/*!\n * Cropper.js v1.5.12\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2021-06-12T08:00:11.623Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;-ms-touch-action:none;touch-action:none;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none !important;max-width:none !important;min-height:0 !important;min-width:0 !important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{bottom:0;left:0;position:absolute;right:0;top:0}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:0.5}.cropper-view-box{display:block;height:100%;outline:1px solid #39f;outline-color:rgba(51, 153, 255, 0.75);overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:0.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:0.75;position:absolute;top:50%;width:0}.cropper-center::before,.cropper-center::after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center::before{height:1px;left:-3px;top:0;width:7px}.cropper-center::after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:0.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:0.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:0.75;width:5px}}.cropper-point.point-se::before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC")}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none !important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}';let o=class{constructor(i){t(this,i);this.aspectRatio=1/1}async setAspectRatio(t){this.aspectRatio=t}async reset(){return this.cropper.reset()}async getCroppedCanvas(t){return this.cropper.getCroppedCanvas(t)}async getImageData(t="image/png",i=1){const e=await this.getCroppedCanvas({fillColor:"#ffffff"});return e.toDataURL(t,i)}async replace(t,i=false){this.src=t;return this.cropper.replace(t,i)}componentDidLoad(){if(!(i===null||i===void 0?void 0:i.isBrowser))return;setTimeout((()=>{this.cropper=new n(this.imgEl,{aspectRatio:this.aspectRatio})}),300)}render(){return e("div",null,e("img",{src:this.src,ref:t=>this.imgEl=t}))}};o.style=s;export{o as floodteam_photo_cropper};
//# sourceMappingURL=p-f0579f9c.entry.js.map