!function(t){var e={};function i(a){if(e[a])return e[a].exports;var o=e[a]={i:a,l:!1,exports:{}};return t[a].call(o.exports,o,o.exports,i),o.l=!0,o.exports}i.m=t,i.c=e,i.d=function(t,e,a){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:a})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var a=Object.create(null);if(i.r(a),Object.defineProperty(a,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)i.d(a,o,function(e){return t[e]}.bind(null,o));return a},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=1)}([function(t,e,i){var a,o,n;function r(t){return(r="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})(t)}
/*!
 * Cropper.js v1.5.1
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2019-03-10T09:55:53.729Z
 */
/*!
 * Cropper.js v1.5.1
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2019-03-10T09:55:53.729Z
 */
n=function(){"use strict";function t(e){return(t="function"==typeof Symbol&&"symbol"===r(Symbol.iterator)?function(t){return r(t)}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":r(t)})(e)}function e(t,e){for(var i=0;i<e.length;i++){var a=e[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,a.key,a)}}function i(t){return function(t){if(Array.isArray(t)){for(var e=0,i=new Array(t.length);e<t.length;e++)i[e]=t[e];return i}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}var a="undefined"!=typeof window,o=a?window:{},n=!!a&&"ontouchstart"in o.document.documentElement,s=!!a&&"PointerEvent"in o,c="".concat("cropper","-crop"),h="".concat("cropper","-disabled"),p="".concat("cropper","-hidden"),d="".concat("cropper","-hide"),l="".concat("cropper","-invisible"),m="".concat("cropper","-modal"),f="".concat("cropper","-move"),u="".concat("cropper","Action"),g="".concat("cropper","Preview"),v=s?"pointerdown":n?"touchstart":"mousedown",w=s?"pointermove":n?"touchmove":"mousemove",b=s?"pointerup pointercancel":n?"touchend touchcancel":"mouseup",y=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,x=/^data:image\/jpeg;base64,/,M=/^img|canvas$/i,C={viewMode:0,dragMode:"crop",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:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},D=Number.isNaN||o.isNaN;function k(t){return"number"==typeof t&&!D(t)}var B=function(t){return t>0&&t<1/0};function j(t){return void 0===t}function _(e){return"object"===t(e)&&null!==e}var z=Object.prototype.hasOwnProperty;function L(t){if(!_(t))return!1;try{var e=t.constructor,i=e.prototype;return e&&i&&z.call(i,"isPrototypeOf")}catch(t){return!1}}function T(t){return"function"==typeof t}var H=Array.prototype.slice;function E(t){return Array.from?Array.from(t):H.call(t)}function O(t,e){return t&&T(e)&&(Array.isArray(t)||k(t.length)?E(t).forEach(function(i,a){e.call(t,i,a,t)}):_(t)&&Object.keys(t).forEach(function(i){e.call(t,t[i],i,t)})),t}var N=Object.assign||function(t){for(var e=arguments.length,i=new Array(e>1?e-1:0),a=1;a<e;a++)i[a-1]=arguments[a];return _(t)&&i.length>0&&i.forEach(function(e){_(e)&&Object.keys(e).forEach(function(i){t[i]=e[i]})}),t},W=/\.\d*(?:0|9){12}\d*$/;function R(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return W.test(t)?Math.round(t*e)/e:t}var S=/^width|height|left|top|marginLeft|marginTop$/;function Y(t,e){var i=t.style;O(e,function(t,e){S.test(e)&&k(t)&&(t="".concat(t,"px")),i[e]=t})}function A(t,e){if(e)if(k(t.length))O(t,function(t){A(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 X(t,e){e&&(k(t.length)?O(t,function(t){X(t,e)}):t.classList?t.classList.remove(e):t.className.indexOf(e)>=0&&(t.className=t.className.replace(e,"")))}function $(t,e,i){e&&(k(t.length)?O(t,function(t){$(t,e,i)}):i?A(t,e):X(t,e))}var I=/([a-z\d])([A-Z])/g;function U(t){return t.replace(I,"$1-$2").toLowerCase()}function P(t,e){return _(t[e])?t[e]:t.dataset?t.dataset[e]:t.getAttribute("data-".concat(U(e)))}function q(t,e,i){_(i)?t[e]=i:t.dataset?t.dataset[e]=i:t.setAttribute("data-".concat(U(e)),i)}var F=/\s\s*/,V=function(){var t=!1;if(a){var e=!1,i=function(){},n=Object.defineProperty({},"once",{get:function(){return t=!0,e},set:function(t){e=t}});o.addEventListener("test",i,n),o.removeEventListener("test",i,n)}return t}();function Q(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(F).forEach(function(e){if(!V){var n=t.listeners;n&&n[e]&&n[e][i]&&(o=n[e][i],delete n[e][i],0===Object.keys(n[e]).length&&delete n[e],0===Object.keys(n).length&&delete t.listeners)}t.removeEventListener(e,o,a)})}function G(t,e,i){var a=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},o=i;e.trim().split(F).forEach(function(e){if(a.once&&!V){var n=t.listeners,r=void 0===n?{}:n;o=function(){delete r[e][i],t.removeEventListener(e,o,a);for(var n=arguments.length,s=new Array(n),c=0;c<n;c++)s[c]=arguments[c];i.apply(t,s)},r[e]||(r[e]={}),r[e][i]&&t.removeEventListener(e,r[e][i],a),r[e][i]=o,t.listeners=r}t.addEventListener(e,o,a)})}function Z(t,e,i){var a;return T(Event)&&T(CustomEvent)?a=new CustomEvent(e,{detail:i,bubbles:!0,cancelable:!0}):(a=document.createEvent("CustomEvent")).initCustomEvent(e,!0,!0,i),t.dispatchEvent(a)}function J(t){var e=t.getBoundingClientRect();return{left:e.left+(window.pageXOffset-document.documentElement.clientLeft),top:e.top+(window.pageYOffset-document.documentElement.clientTop)}}var K=o.location,tt=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function et(t){var e=t.match(tt);return null!==e&&(e[1]!==K.protocol||e[2]!==K.hostname||e[3]!==K.port)}function it(t){var e="timestamp=".concat((new Date).getTime());return t+(-1===t.indexOf("?")?"?":"&")+e}function at(t){var e=t.rotate,i=t.scaleX,a=t.scaleY,o=t.translateX,n=t.translateY,r=[];k(o)&&0!==o&&r.push("translateX(".concat(o,"px)")),k(n)&&0!==n&&r.push("translateY(".concat(n,"px)")),k(e)&&0!==e&&r.push("rotate(".concat(e,"deg)")),k(i)&&1!==i&&r.push("scaleX(".concat(i,")")),k(a)&&1!==a&&r.push("scaleY(".concat(a,")"));var s=r.length?r.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function ot(t,e){var i=t.pageX,a=t.pageY,o={endX:i,endY:a};return e?o:N({startX:i,startY:a},o)}function nt(t){var e=t.aspectRatio,i=t.height,a=t.width,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",n=B(a),r=B(i);if(n&&r){var s=i*e;"contain"===o&&s>a||"cover"===o&&s<a?i=a/e:a=i*e}else n?i=a/e:r&&(a=i*e);return{width:a,height:i}}var rt=String.fromCharCode,st=/^data:.*,/;function ct(t){var e,i=new DataView(t);try{var a,o,n;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var r=i.byteLength,s=2;s+1<r;){if(255===i.getUint8(s)&&225===i.getUint8(s+1)){o=s;break}s+=1}if(o){var c=o+10;if("Exif"===function(t,e,i){var a="";i+=e;for(var o=e;o<i;o+=1)a+=rt(t.getUint8(o));return a}(i,o+4,4)){var h=i.getUint16(c);if(((a=18761===h)||19789===h)&&42===i.getUint16(c+2,a)){var p=i.getUint32(c+4,a);p>=8&&(n=c+p)}}}if(n){var d,l,m=i.getUint16(n,a);for(l=0;l<m;l+=1)if(d=n+12*l+2,274===i.getUint16(d,a)){d+=8,e=i.getUint16(d,a),i.setUint16(d,1,a);break}}}catch(t){e=1}return e}var ht={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,a=this.cropper;A(a,p),X(t,p);var o={width:Math.max(i.offsetWidth,Number(e.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(e.minContainerHeight)||100)};this.containerData=o,Y(a,{width:o.width,height:o.height}),A(t,p),X(a,p)},initCanvas:function(){var t=this.containerData,e=this.imageData,i=this.options.viewMode,a=Math.abs(e.rotate)%180==90,o=a?e.naturalHeight:e.naturalWidth,n=a?e.naturalWidth:e.naturalHeight,r=o/n,s=t.width,c=t.height;t.height*r>t.width?3===i?s=t.height*r:c=t.width/r:3===i?c=t.width/r:s=t.height*r;var h={aspectRatio:r,naturalWidth:o,naturalHeight:n,width:s,height:c};h.left=(t.width-s)/2,h.top=(t.height-c)/2,h.oldLeft=h.left,h.oldTop=h.top,this.canvasData=h,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=N({},e),this.initialCanvasData=N({},h)},limitCanvas:function(t,e){var i=this.options,a=this.containerData,o=this.canvasData,n=this.cropBoxData,r=i.viewMode,s=o.aspectRatio,c=this.cropped&&n;if(t){var h=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;r>1?(h=Math.max(h,a.width),p=Math.max(p,a.height),3===r&&(p*s>h?h=p*s:p=h/s)):r>0&&(h?h=Math.max(h,c?n.width:0):p?p=Math.max(p,c?n.height:0):c&&(h=n.width,(p=n.height)*s>h?h=p*s:p=h/s));var d=nt({aspectRatio:s,width:h,height:p});h=d.width,p=d.height,o.minWidth=h,o.minHeight=p,o.maxWidth=1/0,o.maxHeight=1/0}if(e)if(r>(c?0:1)){var l=a.width-o.width,m=a.height-o.height;o.minLeft=Math.min(0,l),o.minTop=Math.min(0,m),o.maxLeft=Math.max(0,l),o.maxTop=Math.max(0,m),c&&this.limited&&(o.minLeft=Math.min(n.left,n.left+(n.width-o.width)),o.minTop=Math.min(n.top,n.top+(n.height-o.height)),o.maxLeft=n.left,o.maxTop=n.top,2===r&&(o.width>=a.width&&(o.minLeft=Math.min(0,l),o.maxLeft=Math.max(0,l)),o.height>=a.height&&(o.minTop=Math.min(0,m),o.maxTop=Math.max(0,m))))}else o.minLeft=-o.width,o.minTop=-o.height,o.maxLeft=a.width,o.maxTop=a.height},renderCanvas:function(t,e){var i=this.canvasData,a=this.imageData;if(e){var o=function(t){var e=t.width,i=t.height,a=t.degree;if(90==(a=Math.abs(a)%180))return{width:i,height:e};var o=a%90*Math.PI/180,n=Math.sin(o),r=Math.cos(o),s=e*r+i*n,c=e*n+i*r;return a>90?{width:c,height:s}:{width:s,height:c}}({width:a.naturalWidth*Math.abs(a.scaleX||1),height:a.naturalHeight*Math.abs(a.scaleY||1),degree:a.rotate||0}),n=o.width,r=o.height,s=i.width*(n/i.naturalWidth),c=i.height*(r/i.naturalHeight);i.left-=(s-i.width)/2,i.top-=(c-i.height)/2,i.width=s,i.height=c,i.aspectRatio=n/r,i.naturalWidth=n,i.naturalHeight=r,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,Y(this.canvas,N({width:i.width,height:i.height},at({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,a=i.naturalWidth*(e.width/e.naturalWidth),o=i.naturalHeight*(e.height/e.naturalHeight);N(i,{width:a,height:o,left:(e.width-a)/2,top:(e.height-o)/2}),Y(this.image,N({width:i.width,height:i.height},at(N({translateX:i.left,translateY:i.top},i)))),t&&this.output()},initCropBox:function(){var t=this.options,e=this.canvasData,i=t.aspectRatio||t.initialAspectRatio,a=Number(t.autoCropArea)||.8,o={width:e.width,height:e.height};i&&(e.height*i>e.width?o.height=o.width/i:o.width=o.height*i),this.cropBoxData=o,this.limitCropBox(!0,!0),o.width=Math.min(Math.max(o.width,o.minWidth),o.maxWidth),o.height=Math.min(Math.max(o.height,o.minHeight),o.maxHeight),o.width=Math.max(o.minWidth,o.width*a),o.height=Math.max(o.minHeight,o.height*a),o.left=e.left+(e.width-o.width)/2,o.top=e.top+(e.height-o.height)/2,o.oldLeft=o.left,o.oldTop=o.top,this.initialCropBoxData=N({},o)},limitCropBox:function(t,e){var i=this.options,a=this.containerData,o=this.canvasData,n=this.cropBoxData,r=this.limited,s=i.aspectRatio;if(t){var c=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,p=r?Math.min(a.width,o.width,o.width+o.left,a.width-o.left):a.width,d=r?Math.min(a.height,o.height,o.height+o.top,a.height-o.top):a.height;c=Math.min(c,a.width),h=Math.min(h,a.height),s&&(c&&h?h*s>c?h=c/s:c=h*s:c?h=c/s:h&&(c=h*s),d*s>p?d=p/s:p=d*s),n.minWidth=Math.min(c,p),n.minHeight=Math.min(h,d),n.maxWidth=p,n.maxHeight=d}e&&(r?(n.minLeft=Math.max(0,o.left),n.minTop=Math.max(0,o.top),n.maxLeft=Math.min(a.width,o.left+o.width)-n.width,n.maxTop=Math.min(a.height,o.top+o.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=a.width-n.width,n.maxTop=a.height-n.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&&q(this.face,u,i.width>=e.width&&i.height>=e.height?"move":"all"),Y(this.cropBox,N({width:i.width,height:i.height},at({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Z(this.element,"crop",this.getData())}},pt={initPreview:function(){var t=this.crossOrigin,e=this.options.preview,i=t?this.crossOriginUrl:this.url,a=document.createElement("img");if(t&&(a.crossOrigin=t),a.src=i,this.viewBox.appendChild(a),this.viewBoxImage=a,e){var o=e;"string"==typeof e?o=this.element.ownerDocument.querySelectorAll(e):e.querySelector&&(o=[e]),this.previews=o,O(o,function(e){var a=document.createElement("img");q(e,g,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(a.crossOrigin=t),a.src=i,a.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;"',e.innerHTML="",e.appendChild(a)})}},resetPreview:function(){O(this.previews,function(t){var e=P(t,g);Y(t,{width:e.width,height:e.height}),t.innerHTML=e.html,function(t,e){if(_(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(U(e)))}(t,g)})},preview:function(){var t=this.imageData,e=this.canvasData,i=this.cropBoxData,a=i.width,o=i.height,n=t.width,r=t.height,s=i.left-e.left-t.left,c=i.top-e.top-t.top;this.cropped&&!this.disabled&&(Y(this.viewBoxImage,N({width:n,height:r},at(N({translateX:-s,translateY:-c},t)))),O(this.previews,function(e){var i=P(e,g),h=i.width,p=i.height,d=h,l=p,m=1;a&&(l=o*(m=h/a)),o&&l>p&&(d=a*(m=p/o),l=p),Y(e,{width:d,height:l}),Y(e.getElementsByTagName("img")[0],N({width:n*m,height:r*m},at(N({translateX:-s*m,translateY:-c*m},t))))}))}},dt={bind:function(){var t=this.element,e=this.options,i=this.cropper;T(e.cropstart)&&G(t,"cropstart",e.cropstart),T(e.cropmove)&&G(t,"cropmove",e.cropmove),T(e.cropend)&&G(t,"cropend",e.cropend),T(e.crop)&&G(t,"crop",e.crop),T(e.zoom)&&G(t,"zoom",e.zoom),G(i,v,this.onCropStart=this.cropStart.bind(this)),e.zoomable&&e.zoomOnWheel&&G(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&G(i,"dblclick",this.onDblclick=this.dblclick.bind(this)),G(t.ownerDocument,w,this.onCropMove=this.cropMove.bind(this)),G(t.ownerDocument,b,this.onCropEnd=this.cropEnd.bind(this)),e.responsive&&G(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,e=this.options,i=this.cropper;T(e.cropstart)&&Q(t,"cropstart",e.cropstart),T(e.cropmove)&&Q(t,"cropmove",e.cropmove),T(e.cropend)&&Q(t,"cropend",e.cropend),T(e.crop)&&Q(t,"crop",e.crop),T(e.zoom)&&Q(t,"zoom",e.zoom),Q(i,v,this.onCropStart),e.zoomable&&e.zoomOnWheel&&Q(i,"wheel",this.onWheel,{passive:!1,capture:!0}),e.toggleDragModeOnDblclick&&Q(i,"dblclick",this.onDblclick),Q(t.ownerDocument,w,this.onCropMove),Q(t.ownerDocument,b,this.onCropEnd),e.responsive&&Q(window,"resize",this.onResize)}},lt={resize:function(){var t=this.options,e=this.container,i=this.containerData,a=Number(t.minContainerWidth)||200,o=Number(t.minContainerHeight)||100;if(!(this.disabled||i.width<=a||i.height<=o)){var n,r,s=e.offsetWidth/i.width;if(1!==s||e.offsetHeight!==i.height)t.restore&&(n=this.getCanvasData(),r=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(O(n,function(t,e){n[e]=t*s})),this.setCropBoxData(O(r,function(t,e){r[e]=t*s})))}},dblclick:function(){var t,e;this.disabled||"none"===this.options.dragMode||this.setDragMode((t=this.dragBox,e=c,(t.classList?t.classList.contains(e):t.className.indexOf(e)>-1)?"move":"crop"))},wheel:function(t){var e=this,i=Number(this.options.wheelZoomRatio)||.1,a=1;this.disabled||(t.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout(function(){e.wheeling=!1},50),t.deltaY?a=t.deltaY>0?1:-1:t.wheelDelta?a=-t.wheelDelta/120:t.detail&&(a=t.detail>0?1:-1),this.zoom(-a*i,t)))},cropStart:function(t){var e=t.buttons,i=t.button;if(!(this.disabled||k(e)&&1!==e||k(i)&&0!==i||t.ctrlKey)){var a,o=this.options,n=this.pointers;t.changedTouches?O(t.changedTouches,function(t){n[t.identifier]=ot(t)}):n[t.pointerId||0]=ot(t),a=Object.keys(n).length>1&&o.zoomable&&o.zoomOnTouch?"zoom":P(t.target,u),y.test(a)&&!1!==Z(this.element,"cropstart",{originalEvent:t,action:a})&&(t.preventDefault(),this.action=a,this.cropping=!1,"crop"===a&&(this.cropping=!0,A(this.dragBox,m)))}},cropMove:function(t){var e=this.action;if(!this.disabled&&e){var i=this.pointers;t.preventDefault(),!1!==Z(this.element,"cropmove",{originalEvent:t,action:e})&&(t.changedTouches?O(t.changedTouches,function(t){N(i[t.identifier]||{},ot(t,!0))}):N(i[t.pointerId||0]||{},ot(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var e=this.action,i=this.pointers;t.changedTouches?O(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,$(this.dragBox,m,this.cropped&&this.options.modal)),Z(this.element,"cropend",{originalEvent:t,action:e}))}}},mt={change:function(t){var e,i=this.options,a=this.canvasData,o=this.containerData,n=this.cropBoxData,r=this.pointers,s=this.action,c=i.aspectRatio,h=n.left,d=n.top,l=n.width,m=n.height,f=h+l,u=d+m,g=0,v=0,w=o.width,b=o.height,y=!0;!c&&t.shiftKey&&(c=l&&m?l/m:1),this.limited&&(g=n.minLeft,v=n.minTop,w=g+Math.min(o.width,a.width,a.left+a.width),b=v+Math.min(o.height,a.height,a.top+a.height));var x=r[Object.keys(r)[0]],M={x:x.endX-x.startX,y:x.endY-x.startY},C=function(t){switch(t){case"e":f+M.x>w&&(M.x=w-f);break;case"w":h+M.x<g&&(M.x=g-h);break;case"n":d+M.y<v&&(M.y=v-d);break;case"s":u+M.y>b&&(M.y=b-u)}};switch(s){case"all":h+=M.x,d+=M.y;break;case"e":if(M.x>=0&&(f>=w||c&&(d<=v||u>=b))){y=!1;break}C("e"),(l+=M.x)<0&&(s="w",h-=l=-l),c&&(m=l/c,d+=(n.height-m)/2);break;case"n":if(M.y<=0&&(d<=v||c&&(h<=g||f>=w))){y=!1;break}C("n"),m-=M.y,d+=M.y,m<0&&(s="s",d-=m=-m),c&&(l=m*c,h+=(n.width-l)/2);break;case"w":if(M.x<=0&&(h<=g||c&&(d<=v||u>=b))){y=!1;break}C("w"),l-=M.x,h+=M.x,l<0&&(s="e",h-=l=-l),c&&(m=l/c,d+=(n.height-m)/2);break;case"s":if(M.y>=0&&(u>=b||c&&(h<=g||f>=w))){y=!1;break}C("s"),(m+=M.y)<0&&(s="n",d-=m=-m),c&&(l=m*c,h+=(n.width-l)/2);break;case"ne":if(c){if(M.y<=0&&(d<=v||f>=w)){y=!1;break}C("n"),m-=M.y,d+=M.y,l=m*c}else C("n"),C("e"),M.x>=0?f<w?l+=M.x:M.y<=0&&d<=v&&(y=!1):l+=M.x,M.y<=0?d>v&&(m-=M.y,d+=M.y):(m-=M.y,d+=M.y);l<0&&m<0?(s="sw",d-=m=-m,h-=l=-l):l<0?(s="nw",h-=l=-l):m<0&&(s="se",d-=m=-m);break;case"nw":if(c){if(M.y<=0&&(d<=v||h<=g)){y=!1;break}C("n"),m-=M.y,d+=M.y,l=m*c,h+=n.width-l}else C("n"),C("w"),M.x<=0?h>g?(l-=M.x,h+=M.x):M.y<=0&&d<=v&&(y=!1):(l-=M.x,h+=M.x),M.y<=0?d>v&&(m-=M.y,d+=M.y):(m-=M.y,d+=M.y);l<0&&m<0?(s="se",d-=m=-m,h-=l=-l):l<0?(s="ne",h-=l=-l):m<0&&(s="sw",d-=m=-m);break;case"sw":if(c){if(M.x<=0&&(h<=g||u>=b)){y=!1;break}C("w"),l-=M.x,h+=M.x,m=l/c}else C("s"),C("w"),M.x<=0?h>g?(l-=M.x,h+=M.x):M.y>=0&&u>=b&&(y=!1):(l-=M.x,h+=M.x),M.y>=0?u<b&&(m+=M.y):m+=M.y;l<0&&m<0?(s="ne",d-=m=-m,h-=l=-l):l<0?(s="se",h-=l=-l):m<0&&(s="nw",d-=m=-m);break;case"se":if(c){if(M.x>=0&&(f>=w||u>=b)){y=!1;break}C("e"),m=(l+=M.x)/c}else C("s"),C("e"),M.x>=0?f<w?l+=M.x:M.y>=0&&u>=b&&(y=!1):l+=M.x,M.y>=0?u<b&&(m+=M.y):m+=M.y;l<0&&m<0?(s="nw",d-=m=-m,h-=l=-l):l<0?(s="sw",h-=l=-l):m<0&&(s="ne",d-=m=-m);break;case"move":this.move(M.x,M.y),y=!1;break;case"zoom":this.zoom(function(t){var e=N({},t),i=[];return O(t,function(t,a){delete e[a],O(e,function(e){var a=Math.abs(t.startX-e.startX),o=Math.abs(t.startY-e.startY),n=Math.abs(t.endX-e.endX),r=Math.abs(t.endY-e.endY),s=Math.sqrt(a*a+o*o),c=(Math.sqrt(n*n+r*r)-s)/s;i.push(c)})}),i.sort(function(t,e){return Math.abs(t)<Math.abs(e)}),i[0]}(r),t),y=!1;break;case"crop":if(!M.x||!M.y){y=!1;break}e=J(this.cropper),h=x.startX-e.left,d=x.startY-e.top,l=n.minWidth,m=n.minHeight,M.x>0?s=M.y>0?"se":"ne":M.x<0&&(h-=l,s=M.y>0?"sw":"nw"),M.y<0&&(d-=m),this.cropped||(X(this.cropBox,p),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}y&&(n.width=l,n.height=m,n.left=h,n.top=d,this.action=s,this.renderCropBox()),O(r,function(t){t.startX=t.endX,t.startY=t.endY})}},ft={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&A(this.dragBox,m),X(this.cropBox,p),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=N({},this.initialImageData),this.canvasData=N({},this.initialCanvasData),this.cropBoxData=N({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(N(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),X(this.dragBox,m),A(this.cropBox,p)),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,O(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,X(this.cropper,h)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,A(this.cropper,h)),this},destroy:function(){var t=this.element;return t.cropper?(t.cropper=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,a=i.left,o=i.top;return this.moveTo(j(t)?t:a+Number(t),j(e)?e:o+Number(e))},moveTo:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.canvasData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.movable&&(k(t)&&(i.left=t,a=!0),k(e)&&(i.top=e,a=!0),a&&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 a=this.options,o=this.canvasData,n=o.width,r=o.height,s=o.naturalWidth,c=o.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&a.zoomable){var h=s*t,p=c*t;if(!1===Z(this.element,"zoom",{ratio:t,oldRatio:n/s,originalEvent:i}))return this;if(i){var d=this.pointers,l=J(this.cropper),m=d&&Object.keys(d).length?function(t){var e=0,i=0,a=0;return O(t,function(t){var o=t.startX,n=t.startY;e+=o,i+=n,a+=1}),{pageX:e/=a,pageY:i/=a}}(d):{pageX:i.pageX,pageY:i.pageY};o.left-=(h-n)*((m.pageX-l.left-o.left)/n),o.top-=(p-r)*((m.pageY-l.top-o.top)/r)}else L(e)&&k(e.x)&&k(e.y)?(o.left-=(h-n)*((e.x-o.left)/n),o.top-=(p-r)*((e.y-o.top)/r)):(o.left-=(h-n)/2,o.top-=(p-r)/2);o.width=h,o.height=p,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return k(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,k(e)?e:1)},scaleY:function(t){var e=this.imageData.scaleX;return this.scale(k(e)?e:1,t)},scale:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,i=this.imageData,a=!1;return t=Number(t),e=Number(e),this.ready&&!this.disabled&&this.options.scalable&&(k(t)&&(i.scaleX=t,a=!0),k(e)&&(i.scaleY=e,a=!0),a&&this.renderCanvas(!0,!0)),this},getData:function(){var t,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,a=this.imageData,o=this.canvasData,n=this.cropBoxData;if(this.ready&&this.cropped){t={x:n.left-o.left,y:n.top-o.top,width:n.width,height:n.height};var r=a.width/a.naturalWidth;if(O(t,function(e,i){t[i]=e/r}),e){var s=Math.round(t.y+t.height),c=Math.round(t.x+t.width);t.x=Math.round(t.x),t.y=Math.round(t.y),t.width=c-t.x,t.height=s-t.y}}else t={x:0,y:0,width:0,height:0};return i.rotatable&&(t.rotate=a.rotate||0),i.scalable&&(t.scaleX=a.scaleX||1,t.scaleY=a.scaleY||1),t},setData:function(t){var e=this.options,i=this.imageData,a=this.canvasData,o={};if(this.ready&&!this.disabled&&L(t)){var n=!1;e.rotatable&&k(t.rotate)&&t.rotate!==i.rotate&&(i.rotate=t.rotate,n=!0),e.scalable&&(k(t.scaleX)&&t.scaleX!==i.scaleX&&(i.scaleX=t.scaleX,n=!0),k(t.scaleY)&&t.scaleY!==i.scaleY&&(i.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var r=i.width/i.naturalWidth;k(t.x)&&(o.left=t.x*r+a.left),k(t.y)&&(o.top=t.y*r+a.top),k(t.width)&&(o.width=t.width*r),k(t.height)&&(o.height=t.height*r),this.setCropBoxData(o)}return this},getContainerData:function(){return this.ready?N({},this.containerData):{}},getImageData:function(){return this.sized?N({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,e={};return this.ready&&O(["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&&L(t)&&(k(t.left)&&(e.left=t.left),k(t.top)&&(e.top=t.top),k(t.width)?(e.width=t.width,e.height=t.width/i):k(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,a=this.cropBoxData,o=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&L(t)&&(k(t.left)&&(a.left=t.left),k(t.top)&&(a.top=t.top),k(t.width)&&t.width!==a.width&&(e=!0,a.width=t.width),k(t.height)&&t.height!==a.height&&(i=!0,a.height=t.height),o&&(e?a.height=a.width/o:i&&(a.width=a.height*o)),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,a=function(t,e,a,o){var n=e.aspectRatio,r=e.naturalWidth,s=e.naturalHeight,c=e.rotate,h=void 0===c?0:c,p=e.scaleX,d=void 0===p?1:p,l=e.scaleY,m=void 0===l?1:l,f=a.aspectRatio,u=a.naturalWidth,g=a.naturalHeight,v=o.fillColor,w=void 0===v?"transparent":v,b=o.imageSmoothingEnabled,y=void 0===b||b,x=o.imageSmoothingQuality,M=void 0===x?"low":x,C=o.maxWidth,D=void 0===C?1/0:C,k=o.maxHeight,B=void 0===k?1/0:k,j=o.minWidth,_=void 0===j?0:j,z=o.minHeight,L=void 0===z?0:z,T=document.createElement("canvas"),H=T.getContext("2d"),E=nt({aspectRatio:f,width:D,height:B}),O=nt({aspectRatio:f,width:_,height:L},"cover"),N=Math.min(E.width,Math.max(O.width,u)),W=Math.min(E.height,Math.max(O.height,g)),S=nt({aspectRatio:n,width:D,height:B}),Y=nt({aspectRatio:n,width:_,height:L},"cover"),A=Math.min(S.width,Math.max(Y.width,r)),X=Math.min(S.height,Math.max(Y.height,s)),$=[-A/2,-X/2,A,X];return T.width=R(N),T.height=R(W),H.fillStyle=w,H.fillRect(0,0,N,W),H.save(),H.translate(N/2,W/2),H.rotate(h*Math.PI/180),H.scale(d,m),H.imageSmoothingEnabled=y,H.imageSmoothingQuality=M,H.drawImage.apply(H,[t].concat(i($.map(function(t){return Math.floor(R(t))})))),H.restore(),T}(this.image,this.imageData,e,t);if(!this.cropped)return a;var o=this.getData(),n=o.x,r=o.y,s=o.width,c=o.height,h=a.width/Math.floor(e.naturalWidth);1!==h&&(n*=h,r*=h,s*=h,c*=h);var p=s/c,d=nt({aspectRatio:p,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),l=nt({aspectRatio:p,width:t.minWidth||0,height:t.minHeight||0},"cover"),m=nt({aspectRatio:p,width:t.width||(1!==h?a.width:s),height:t.height||(1!==h?a.height:c)}),f=m.width,u=m.height;f=Math.min(d.width,Math.max(l.width,f)),u=Math.min(d.height,Math.max(l.height,u));var g=document.createElement("canvas"),v=g.getContext("2d");g.width=R(f),g.height=R(u),v.fillStyle=t.fillColor||"transparent",v.fillRect(0,0,f,u);var w=t.imageSmoothingEnabled,b=void 0===w||w,y=t.imageSmoothingQuality;v.imageSmoothingEnabled=b,y&&(v.imageSmoothingQuality=y);var x,M,C,D,k,B,j=a.width,_=a.height,z=n,L=r;z<=-s||z>j?(z=0,x=0,C=0,k=0):z<=0?(C=-z,z=0,k=x=Math.min(j,s+z)):z<=j&&(C=0,k=x=Math.min(s,j-z)),x<=0||L<=-c||L>_?(L=0,M=0,D=0,B=0):L<=0?(D=-L,L=0,B=M=Math.min(_,c+L)):L<=_&&(D=0,B=M=Math.min(c,_-L));var T=[z,L,x,M];if(k>0&&B>0){var H=f/s;T.push(C*H,D*H,k*H,B*H)}return v.drawImage.apply(v,[a].concat(i(T.map(function(t){return Math.floor(R(t))})))),g},setAspectRatio:function(t){var e=this.options;return this.disabled||j(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,a=this.face;if(this.ready&&!this.disabled){var o="crop"===t,n=e.movable&&"move"===t;t=o||n?t:"none",e.dragMode=t,q(i,u,t),$(i,c,o),$(i,f,n),e.cropBoxMovable||(q(a,u,t),$(a,c,o),$(a,f,n))}return this}},ut=o.Cropper,gt=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||!M.test(e.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=e,this.options=N({},C,L(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()}var i,a,n;return i=t,n=[{key:"noConflict",value:function(){return window.Cropper=ut,t}},{key:"setDefaults",value:function(t){N(C,L(t)&&t)}}],(a=[{key:"init",value:function(){var t,e=this.element,i=e.tagName.toLowerCase();if(!e.cropper){if(e.cropper=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=this;if(t){this.url=t,this.imageData={};var i=this.element,a=this.options;if(a.rotatable||a.scalable||(a.checkOrientation=!1),a.checkOrientation&&window.ArrayBuffer)if(x.test(t))this.read((o=t.replace(st,""),n=atob(o),r=new ArrayBuffer(n.length),O(s=new Uint8Array(r),function(t,e){s[e]=n.charCodeAt(e)}),r));else{var o,n,r,s,c=new XMLHttpRequest,h=this.clone.bind(this);this.reloading=!0,this.xhr=c,c.onabort=h,c.onerror=h,c.ontimeout=h,c.onprogress=function(){"image/jpeg"!==c.getResponseHeader("content-type")&&c.abort()},c.onload=function(){e.read(c.response)},c.onloadend=function(){e.reloading=!1,e.xhr=null},a.checkCrossOrigin&&et(t)&&i.crossOrigin&&(t=it(t)),c.open("GET",t),c.responseType="arraybuffer",c.withCredentials="use-credentials"===i.crossOrigin,c.send()}else this.clone()}}},{key:"read",value:function(t){var e=this.options,i=this.imageData,a=ct(t),o=0,n=1,r=1;if(a>1){this.url=function(t,e){for(var i=[],a=new Uint8Array(t);a.length>0;)i.push(rt.apply(null,E(a.subarray(0,8192)))),a=a.subarray(8192);return"data:".concat(e,";base64,").concat(btoa(i.join("")))}(t,"image/jpeg");var s=function(t){var e=0,i=1,a=1;switch(t){case 2:i=-1;break;case 3:e=-180;break;case 4:a=-1;break;case 5:e=90,a=-1;break;case 6:e=90;break;case 7:e=90,i=-1;break;case 8:e=-90}return{rotate:e,scaleX:i,scaleY:a}}(a);o=s.rotate,n=s.scaleX,r=s.scaleY}e.rotatable&&(i.rotate=o),e.scalable&&(i.scaleX=n,i.scaleY=r),this.clone()}},{key:"clone",value:function(){var t,e,i=this.element,a=this.url;this.options.checkCrossOrigin&&et(a)&&((t=i.crossOrigin)?e=a:(t="anonymous",e=it(a))),this.crossOrigin=t,this.crossOriginUrl=e;var o=document.createElement("img");t&&(o.crossOrigin=t),o.src=e||a,this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),A(o,d),i.parentNode.insertBefore(o,i.nextSibling)}},{key:"start",value:function(){var t=this,e=this.isImg?this.element:this.image;e.onload=null,e.onerror=null,this.sizing=!0;var i=o.navigator&&/^(?:.(?!chrome|android))*safari/i.test(o.navigator.userAgent),a=function(e,i){N(t.imageData,{naturalWidth:e,naturalHeight:i,aspectRatio:e/i}),t.sizing=!1,t.sized=!0,t.build()};if(!e.naturalWidth||i){var n=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){a(n.width,n.height),i||r.removeChild(n)},n.src=e.src,i||(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;",r.appendChild(n))}else a(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,a=t.parentNode,o=document.createElement("div");o.innerHTML='<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 n=o.querySelector(".".concat("cropper","-container")),r=n.querySelector(".".concat("cropper","-canvas")),s=n.querySelector(".".concat("cropper","-drag-box")),c=n.querySelector(".".concat("cropper","-crop-box")),h=c.querySelector(".".concat("cropper","-face"));this.container=a,this.cropper=n,this.canvas=r,this.dragBox=s,this.cropBox=c,this.viewBox=n.querySelector(".".concat("cropper","-view-box")),this.face=h,r.appendChild(i),A(t,p),a.insertBefore(n,t.nextSibling),this.isImg||X(i,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,A(c,p),e.guides||A(c.getElementsByClassName("".concat("cropper","-dashed")),p),e.center||A(c.getElementsByClassName("".concat("cropper","-center")),p),e.background&&A(n,"".concat("cropper","-bg")),e.highlight||A(h,l),e.cropBoxMovable&&(A(h,f),q(h,u,"all")),e.cropBoxResizable||(A(c.getElementsByClassName("".concat("cropper","-line")),p),A(c.getElementsByClassName("".concat("cropper","-point")),p)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),T(e.ready)&&G(t,"ready",e.ready,{once:!0}),Z(t,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),X(this.element,p))}},{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()}}])&&e(i.prototype,a),n&&e(i,n),t}();return N(gt.prototype,ht,pt,dt,lt,mt,ft),gt},"object"===r(e)&&void 0!==t?t.exports=n():void 0===(o="function"==typeof(a=n)?a.call(e,i,e,t):a)||(t.exports=o)},function(t,e,i){"use strict";i.r(e);var a=i(0),o=i.n(a);
/*!
 * Based on assets/js/acf-input.js from
 * https://github.com/AdvancedCustomFields/acf by elliotcondon, licensed
 * under GPLv2 or later
 */
!function(t){var e=null;function a(t){}function n(e){var i=t(e),a=i.val();if("pixel_size"===a){var o=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-min-width");o.val("");var n=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-aspect-ratio-width");n.val()&&o.attr("value",n.val()),o.prop("disabled",!0);var r=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-min-height");r.val("");var s=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-aspect-ratio-height");s.val()&&r.attr("value",s.val()),r.prop("disabled",!0)}if("aspect_ratio"===a){var c=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-min-width");c.val(""),c.prop("disabled",!1);var h=i.parents(".acf-field-object-image-aspect-ratio-crop").first().find(".js-min-height");h.val(""),h.prop("disabled",!1)}}acf.fields.image_aspect_ratio_crop=acf.field.extend({type:"image_aspect_ratio_crop",$el:null,$input:null,$img:null,actions:{ready:"initialize",append:"initialize"},events:{'click a[data-name="add"]':"add",'click a[data-name="edit"]':"edit",'click a[data-name="remove"]':"remove",'change input[type="file"]':"change",'click a[data-name="crop"]':"changeCrop"},focus:function(){this.$el=this.$field.find(".acf-image-uploader-aspect-ratio-crop"),this.$input=this.$el.find('input[type="hidden"]'),this.$img=this.$el.find("img"),this.o=acf.get_data(this.$el)},initialize:function(){var i=this;this.isFirstCrop=null;var a=this;"basic"==this.o.uploader&&this.$el.closest("form").attr("enctype","multipart/form-data"),this.escapeHandlerBound=this.escapeHandler.bind(this),t(document).on("click",".js-acf-image-aspect-ratio-crop-cancel",function(){return i.closeModal()}),t(document).off("click",".js-acf-image-aspect-ratio-crop-reset").on("click",".js-acf-image-aspect-ratio-crop-reset",function(){i.cropper.reset()}),t(document).off("click",".js-acf-image-aspect-ratio-crop-crop").on("click",".js-acf-image-aspect-ratio-crop-crop",function(){var i=a.cropper.getData(!0);t(".js-acf-image-aspect-ratio-crop-modal").css("max-width",a.cropper.containerData.width);t(e).find(".acf-image-uploader-aspect-ratio-crop").data("crop_type");var o={action:"acf_image_aspect_ratio_crop_crop",data:JSON.stringify({id:t(this).data("id"),aspectRatioHeight:t(this).data("aspect-ratio-height"),aspectRatioWidth:t(this).data("aspect-ratio-width"),cropType:t(this).data("crop-type"),x:i.x,y:i.y,width:i.width,height:i.height,temp_post_id:aiarc.temp_post_id})};t(".js-acf-image-aspect-ratio-crop-crop").prop("disabled",!0),t(".js-acf-image-aspect-ratio-crop-reset").prop("disabled",!0);var n='<div class="acf-image-aspect-ratio-crop-modal-loading"><div class="acf-image-aspect-ratio-crop-modal-loading-icon">\x3c!-- Icon from https://github.com/google/material-design-icons --\x3e\x3c!-- Licensed under Apache License 2.0 --\x3e\x3c!-- Copyright (c) Google Inc. --\x3e<svg width="14" height="14" viewBox="0 0 14 14" xmlns="http://www.w3.org/2000/svg"><path d="M7 2.64V1L4.75 3.18 7 5.36V3.73A3.33 3.33 0 0 1 10.38 7c0 .55-.15 1.07-.4 1.53l.82.8c.44-.68.7-1.47.7-2.33A4.43 4.43 0 0 0 7 2.64zm0 7.63A3.33 3.33 0 0 1 3.62 7c0-.55.15-1.07.4-1.53l-.82-.8c-.44.68-.7 1.47-.7 2.33A4.43 4.43 0 0 0 7 11.36V13l2.25-2.18L7 8.64v1.63z" fill="#FFF" fill-rule="nonzero"/></svg></div><div class="acf-image-aspect-ratio-crop-modal-loading-text">'+aiarc_translations.cropping_in_progress+"</div></div>",r='<div class="acf-image-aspect-ratio-crop-modal-error"><div class="acf-image-aspect-ratio-crop-modal-error-icon">\x3c!-- Icon from https://github.com/google/material-design-icons --\x3e\x3c!-- Licensed under Apache License 2.0 --\x3e\x3c!-- Copyright (c) Google Inc. --\x3e<svg width="22" height="22" viewBox="0 0 22 22" xmlns="http://www.w3.org/2000/svg"><path d="M1 20.14h20l-10-17-10 17zm10.9-2.69h-1.8v-1.79h1.8v1.8zm0-3.58h-1.8V10.3h1.8v3.58z" fill="#F44336" fill-rule="nonzero"/></svg></div><div class="acf-image-aspect-ratio-crop-modal-error-text">'+aiarc_translations.cropping_failed+"</div></div>";t(".js-acf-image-aspect-ratio-crop-modal-footer-status").empty(),t(".js-acf-image-aspect-ratio-crop-modal-footer-status").html(n),a.cropper.disable(),t.post(ajaxurl,o).done(function(e){a.cropComplete(e),t(".js-acf-image-aspect-ratio-crop-crop").prop("disabled",!1),t(".js-acf-image-aspect-ratio-crop-reset").prop("disabled",!1),t(".js-acf-image-aspect-ratio-crop-modal-footer-status").empty()}).fail(function(){a.cropper.enable(),t(".js-acf-image-aspect-ratio-crop-crop").prop("disabled",!1),t(".js-acf-image-aspect-ratio-crop-reset").prop("disabled",!1),t(".js-acf-image-aspect-ratio-crop-modal-footer-status").empty(),t(".js-acf-image-aspect-ratio-crop-modal-footer-status").html(r)})})},prepare:function(t){if((t=t||{})._valid)return t;var e={url:"",alt:"",title:"",caption:"",description:"",width:0,height:0};return t.id&&((e=t.attributes).url=acf.maybe_get(e,"sizes."+this.o.preview_size+".url",e.url)),e._valid=!0,e},render:function(t){t=this.prepare(t),this.$img.attr({src:t.url,alt:t.alt,title:t.title});var e="";t.id&&(e=t.id),acf.val(this.$input,e),e?this.$el.addClass("has-value"):this.$el.removeClass("has-value")},add:function(){var e=this,i=this.$field,a=acf.get_closest_field(this.$field,"repeater");acf.media.popup({title:acf._e("image","select"),mode:"select",type:"image",field:i.data("key"),multiple:!1,library:this.o.library,mime_types:this.o.mime_types,select:function(o,n){if(n>0){var r=i.data("key"),s=i.closest(".acf-row");if(i=!1,s.nextAll(".acf-row:visible").each(function(){if(i=acf.get_field(r,t(this))){if(!i.find(".acf-image-uploader-aspect-ratio-crop.has-value").exists())return!1;i=!1}}),!i){if(!(s=acf.fields.repeater.doFocus(a).add()))return!1;i=acf.get_field(r,s)}}e.isFirstCrop=!0,i.find(".acf-image-uploader-aspect-ratio-crop").data("original-image-id",o.id).attr("data-original-image-id",o.id),e.openModal({attachment:o,field:i}),e.set("$field",i).render(o)}})},changeCrop:function(){this.isFirstCrop=!1;var e=t(this.$field).find(".acf-image-uploader-aspect-ratio-crop").data("original-image-id"),i=new wp.media.model.Attachment.get(e),a=this;i.fetch({success:function(t){a.openModal({attachment:t,field:a.$field})}})},edit:function(){this.$field;var t=null;if(t=this.$input.parent().attr("data-original-image-id")&&"original"===window.aiarc_settings.modal_type?this.$input.parent().attr("data-original-image-id"):this.$input.val())acf.media.popup({title:acf._e("image","edit"),button:acf._e("image","update"),mode:"edit",attachment:t})},remove:function(){this.$field.find(".acf-image-uploader-aspect-ratio-crop").data("original-image-id",null).attr("data-original-image-id",null).data("coordinates",null).attr("data-coordinates",null);this.render({})},change:function(t){acf.fields.file.get_file_info(t.$el,this.$input)},escapeHandler:function(t){"Escape"===t.key&&this.closeModal()},openModal:function(a){var n=a.attachment.attributes.url,r=a.attachment.attributes.id;e=a.field,document.addEventListener("keydown",this.escapeHandlerBound);var s=t(e).find(".acf-image-uploader-aspect-ratio-crop").data("aspect_ratio_width"),c=t(e).find(".acf-image-uploader-aspect-ratio-crop").data("aspect_ratio_height"),h=t(e).find(".acf-image-uploader-aspect-ratio-crop").data("crop_type"),p={aspectRatio:s/c,viewMode:1,autoCropArea:1,zoomable:!1,checkCrossOrigin:!1,checkOrientation:!1};"pixel_size"===h&&(p.crop=function(t){var e=t.detail.width,i=t.detail.height;(e<s||i<c)&&this.cropper.setData({width:s,height:c})});var d=t(e).find(".acf-image-uploader-aspect-ratio-crop").data("coordinates");d&&(p.data=d),t("body").append('\n<div class="acf-image-aspect-ratio-crop-backdrop">\n  <div class="acf-image-aspect-ratio-crop-modal-wrapper">\n    <div\n      class="acf-image-aspect-ratio-crop-modal js-acf-image-aspect-ratio-crop-modal"\n    >\n      <div class="acf-image-aspect-ratio-crop-modal-heading">\n        <div class="acf-image-aspect-ratio-crop-modal-heading-text">\n          '.concat(aiarc_translations.modal_title,'\n        </div>\n        <button\n          class="acf-image-aspect-ratio-crop-modal-heading-close js-acf-image-aspect-ratio-crop-cancel"\n          aria-label="Close"\n        >\n          ').concat(i(2),'\n        </button>\n      </div>\n      <div class="acf-image-aspect-ratio-crop-modal-image-container">\n        <img\n          class="acf-image-aspect-ratio-crop-modal-image js-acf-image-aspect-ratio-crop-modal-image"\n          src="').concat(n,'"\n        />\n      </div>\n\n      <div class="acf-image-aspect-ratio-crop-modal-footer">\n        <div\n          class="acf-image-aspect-ratio-crop-modal-footer-status js-acf-image-aspect-ratio-crop-modal-footer-status"\n        ></div>\n        <div class="acf-image-aspect-ratio-crop-modal-footer-buttons">\n          <button\n            class="button button-link acf-image-aspect-ratio-crop-reset js-acf-image-aspect-ratio-crop-reset"\n          >\n            ').concat(i(3),"\n            ").concat(aiarc_translations.reset,'\n          </button>\n          <button class="button js-acf-image-aspect-ratio-crop-cancel">\n            ').concat(aiarc_translations.cancel,'\n          </button>\n          <button\n            class="button button-primary js-acf-image-aspect-ratio-crop-crop"\n            data-id="').concat(r,'"\n            data-aspect-ratio-height="').concat(c,'"\n            data-aspect-ratio-width="').concat(s,'"\n            data-crop-type="').concat(h,'"\n          >\n            ').concat(aiarc_translations.crop,"\n          </button>\n        </div>\n      </div>\n    </div>\n  </div>\n</div>\n")),this.cropper=new o.a(t(".js-acf-image-aspect-ratio-crop-modal-image")[0],p),window._acf_image_aspect_ratio_cropper=this.cropper},cropComplete:function(i){t(e).find(".acf-image-uploader-aspect-ratio-crop").data("coordinates",this.cropper.getData()).attr("data-coordinates",JSON.stringify(this.cropper.getData())),this.cropper.destroy(),t(e).find("input").val(i.id);var a=new wp.media.model.Attachment.get(i.id),o=this;a.fetch({success:function(t){o.render(t)}}),this.closeModal()},closeModal:function(){this.isFirstCrop&&(acf.val(this.$input,""),this.render({})),t(".acf-image-aspect-ratio-crop-backdrop").remove(),document.removeEventListener("keydown",this.escapeHandlerBound),this.cropper.destroy()}}),acf.add_action("ready_field/type=image_aspect_ratio_crop",a),acf.add_action("append_field/type=image_aspect_ratio_crop",a),t(document).ready(function(){t(".acf-field-object-image-aspect-ratio-crop .crop-type-select").each(function(){n(this)})}),acf.add_action("append",function(){t(".acf-field-object-image-aspect-ratio-crop .crop-type-select").each(function(){n(this)})}),t(document).on("change",".acf-field-object-image-aspect-ratio-crop .crop-type-select",function(t){n(this)}),t(document).on("input change",".acf-field-object-image-aspect-ratio-crop .js-aspect-ratio-height",function(e){n(t(this).parents(".acf-field-object-image-aspect-ratio-crop").first().find(".crop-type-select"))}),t(document).on("input change",".acf-field-object-image-aspect-ratio-crop .js-aspect-ratio-width",function(e){n(t(this).parents(".acf-field-object-image-aspect-ratio-crop").first().find(".crop-type-select"))})}(jQuery)},function(t,e){t.exports='\x3c!-- Icon from https://github.com/google/material-design-icons --\x3e\n\x3c!-- Licensed under Apache License 2.0 --\x3e\n\x3c!-- Copyright (c) Google Inc. --\x3e\n<svg\n        width="20"\n        height="20"\n        viewBox="0 0 20 20"\n        xmlns="http://www.w3.org/2000/svg"\n>\n    <g fill="none" fill-rule="evenodd">\n        <path\n                fill="#666"\n                fill-rule="nonzero"\n                d="M12.12 10l3.53 3.53-2.12 2.12L10 12.12l-3.54 3.54-2.12-2.12L7.88 10 4.34 6.46l2.12-2.12L10 7.88l3.54-3.53 2.12 2.12z"\n        />\n    </g>\n</svg>'},function(t,e){t.exports='<svg\n        xmlns="http://www.w3.org/2000/svg"\n        width="24"\n        height="24"\n        viewBox="0 0 24 24"\n>\n    <path d="M0 0h24v24H0z" fill="none" />\n    <path\n            d="M12 5V1L7 6l5 5V7c3.31 0 6 2.69 6 6s-2.69 6-6 6-6-2.69-6-6H4c0 4.42 3.58 8 8 8s8-3.58 8-8-3.58-8-8-8z"\n    />\n</svg>'}]);
//# sourceMappingURL=input-script.js.map