"use strict";(()=>{var E0=Object.create;var Fa=Object.defineProperty;var O0=Object.getOwnPropertyDescriptor;var F0=Object.getOwnPropertyNames;var R0=Object.getPrototypeOf,A0=Object.prototype.hasOwnProperty;var n=(i,e)=>Fa(i,"name",{value:e,configurable:!0});var Ve=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),vo=(i,e)=>{for(var t in e)Fa(i,t,{get:e[t],enumerable:!0})},C0=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of F0(e))!A0.call(i,s)&&s!==t&&Fa(i,s,{get:()=>e[s],enumerable:!(r=O0(e,s))||r.enumerable});return i};var ie=(i,e,t)=>(t=i!=null?E0(R0(i)):{},C0(e||!i||!i.__esModule?Fa(t,"default",{value:i,enumerable:!0}):t,i));var du=Ve((L5,Qd)=>{Qd.exports=n(function(){var e={},t=e._fns={};e.emit=n(function(a,l,h,c,d,p,y){var w=r(a);w.length&&s(a,w,[l,h,c,d,p,y])},"emit"),e.on=n(function(a,l){t[a]||(t[a]=[]),t[a].push(l)},"on"),e.once=n(function(a,l){function h(){l.apply(this,arguments),e.off(a,h)}n(h,"one"),this.on(a,h)},"once"),e.off=n(function(a,l){var h=[];if(a&&l){var c=this._fns[a],d=0,p=c?c.length:0;for(d;d
{var tp="Expected a function",Zd=NaN,B0="[object Symbol]",I0=/^\s+|\s+$/g,L0=/^[-+]0x[0-9a-f]+$/i,M0=/^0b[01]+$/i,z0=/^0o[0-7]+$/i,j0=parseInt,H0=typeof global=="object"&&global&&global.Object===Object&&global,q0=typeof self=="object"&&self&&self.Object===Object&&self,$0=H0||q0||Function("return this")(),V0=Object.prototype,W0=V0.toString,K0=Math.max,G0=Math.min,pu=n(function(){return $0.Date.now()},"now");function X0(i,e,t){var r,s,o,a,l,h,c=0,d=!1,p=!1,y=!0;if(typeof i!="function")throw new TypeError(tp);e=ep(e)||0,Ra(t)&&(d=!!t.leading,p="maxWait"in t,o=p?K0(ep(t.maxWait)||0,e):o,y="trailing"in t?!!t.trailing:y);function w(T){var L=r,M=s;return r=s=void 0,c=T,a=i.apply(M,L),a}n(w,"invokeFunc");function S(T){return c=T,l=setTimeout(E,e),d?w(T):a}n(S,"leadingEdge");function O(T){var L=T-h,M=T-c,H=e-L;return p?G0(H,o-M):H}n(O,"remainingWait");function x(T){var L=T-h,M=T-c;return h===void 0||L>=e||L<0||p&&M>=o}n(x,"shouldInvoke");function E(){var T=pu();if(x(T))return D(T);l=setTimeout(E,O(T))}n(E,"timerExpired");function D(T){return l=void 0,y&&r?w(T):(r=s=void 0,a)}n(D,"trailingEdge");function z(){l!==void 0&&clearTimeout(l),c=0,r=h=s=l=void 0}n(z,"cancel");function $(){return l===void 0?a:D(pu())}n($,"flush");function W(){var T=pu(),L=x(T);if(r=arguments,s=this,h=T,L){if(l===void 0)return S(h);if(p)return l=setTimeout(E,e),w(h)}return l===void 0&&(l=setTimeout(E,e)),a}return n(W,"debounced"),W.cancel=z,W.flush=$,W}n(X0,"debounce");function Y0(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(tp);return Ra(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),X0(i,e,{leading:r,maxWait:e,trailing:s})}n(Y0,"throttle");function Ra(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}n(Ra,"isObject");function J0(i){return!!i&&typeof i=="object"}n(J0,"isObjectLike");function Q0(i){return typeof i=="symbol"||J0(i)&&W0.call(i)==B0}n(Q0,"isSymbol");function ep(i){if(typeof i=="number")return i;if(Q0(i))return Zd;if(Ra(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=Ra(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(I0,"");var t=M0.test(i);return t||z0.test(i)?j0(i.slice(2),t?2:8):L0.test(i)?Zd:+i}n(ep,"toNumber");ip.exports=Y0});var ka=Ve((hx,ap)=>{ap.exports=n(function(e){if(typeof e!="number"||isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);let t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return`${(t?"-":"")+e} B`;let s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,s));let o=r[s];return e>=10||e%1===0?`${(t?"-":"")+e.toFixed(0)} ${o}`:`${(t?"-":"")+e.toFixed(1)} ${o}`},"prettierBytes")});var hp=Ve((dx,up)=>{"use strict";function lp(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}n(lp,"WildcardMatcher");lp.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,o;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(o=(i||"").split(this.separator),r=0;e&&r{var sb=hp(),ob=/[\/\+\.]/;cp.exports=function(i,e){function t(r){var s=sb(r,i,ob);return s&&s.length>=2}return n(t,"test"),e?t(e.split(";")[0]):t}});var wt=Ve((q3,qa)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var t=[],r=0;r{var X1="Expected a function",tm=NaN,Y1="[object Symbol]",J1=/^\s+|\s+$/g,Q1=/^[-+]0x[0-9a-f]+$/i,Z1=/^0b[01]+$/i,ew=/^0o[0-7]+$/i,tw=parseInt,iw=typeof global=="object"&&global&&global.Object===Object&&global,rw=typeof self=="object"&&self&&self.Object===Object&&self,sw=iw||rw||Function("return this")(),ow=Object.prototype,nw=ow.toString,aw=Math.max,lw=Math.min,oh=n(function(){return sw.Date.now()},"now");function uw(i,e,t){var r,s,o,a,l,h,c=0,d=!1,p=!1,y=!0;if(typeof i!="function")throw new TypeError(X1);e=im(e)||0,nh(t)&&(d=!!t.leading,p="maxWait"in t,o=p?aw(im(t.maxWait)||0,e):o,y="trailing"in t?!!t.trailing:y);function w(T){var L=r,M=s;return r=s=void 0,c=T,a=i.apply(M,L),a}n(w,"invokeFunc");function S(T){return c=T,l=setTimeout(E,e),d?w(T):a}n(S,"leadingEdge");function O(T){var L=T-h,M=T-c,H=e-L;return p?lw(H,o-M):H}n(O,"remainingWait");function x(T){var L=T-h,M=T-c;return h===void 0||L>=e||L<0||p&&M>=o}n(x,"shouldInvoke");function E(){var T=oh();if(x(T))return D(T);l=setTimeout(E,O(T))}n(E,"timerExpired");function D(T){return l=void 0,y&&r?w(T):(r=s=void 0,a)}n(D,"trailingEdge");function z(){l!==void 0&&clearTimeout(l),c=0,r=h=s=l=void 0}n(z,"cancel");function $(){return l===void 0?a:D(oh())}n($,"flush");function W(){var T=oh(),L=x(T);if(r=arguments,s=this,h=T,L){if(l===void 0)return S(h);if(p)return l=setTimeout(E,e),w(h)}return l===void 0&&(l=setTimeout(E,e)),a}return n(W,"debounced"),W.cancel=z,W.flush=$,W}n(uw,"debounce");function nh(i){var e=typeof i;return!!i&&(e=="object"||e=="function")}n(nh,"isObject");function hw(i){return!!i&&typeof i=="object"}n(hw,"isObjectLike");function cw(i){return typeof i=="symbol"||hw(i)&&nw.call(i)==Y1}n(cw,"isSymbol");function im(i){if(typeof i=="number")return i;if(cw(i))return tm;if(nh(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=nh(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=i.replace(J1,"");var t=Z1.test(i);return t||ew.test(i)?tw(i.slice(2),t?2:8):Q1.test(i)?tm:+i}n(im,"toNumber");rm.exports=uw});var am=Ve((nR,nm)=>{nm.exports=n(function(e,t){if(e===t)return!0;for(var r in e)if(!(r in t))return!1;for(var r in t)if(e[r]!==t[r])return!1;return!0},"isShallowEqual")});var hm=Ve((FR,um)=>{um.exports=n(function(e){if(typeof e!="number"||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,r=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var s=Math.min(Math.floor(Math.log(e)/Math.log(1024)),r.length-1);e=Number(e/Math.pow(1024,s));var o=r[s];return e>=10||e%1===0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o},"prettierBytes")});var Nm=Ve((Fh,Rh)=>{(function(i,e){typeof Fh=="object"&&typeof Rh<"u"?Rh.exports=e():typeof define=="function"&&define.amd?define(e):(i=i||self,i.Cropper=e())})(Fh,function(){"use strict";function i(v){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i=n(function(f){return typeof f},"_typeof"):i=n(function(f){return f&&typeof Symbol=="function"&&f.constructor===Symbol&&f!==Symbol.prototype?"symbol":typeof f},"_typeof"),i(v)}n(i,"_typeof");function e(v,f){if(!(v instanceof f))throw new TypeError("Cannot call a class as a function")}n(e,"_classCallCheck");function t(v,f){for(var g=0;gv.length)&&(f=v.length);for(var g=0,m=new Array(f);g
',Jv=Number.isNaN||S.isNaN;function Q(v){return typeof v=="number"&&!Jv(v)}n(Q,"isNumber");var Id=n(function(f){return f>0&&f<1/0},"isPositiveNumber");function nu(v){return typeof v>"u"}n(nu,"isUndefined");function Ar(v){return i(v)==="object"&&v!==null}n(Ar,"isObject");var Qv=Object.prototype.hasOwnProperty;function Bs(v){if(!Ar(v))return!1;try{var f=v.constructor,g=f.prototype;return f&&g&&Qv.call(g,"isPrototypeOf")}catch{return!1}}n(Bs,"isPlainObject");function lt(v){return typeof v=="function"}n(lt,"isFunction");var Zv=Array.prototype.slice;function Ld(v){return Array.from?Array.from(v):Zv.call(v)}n(Ld,"toArray");function we(v,f){return v&<(f)&&(Array.isArray(v)||Q(v.length)?Ld(v).forEach(function(g,m){f.call(v,g,m,v)}):Ar(v)&&Object.keys(v).forEach(function(g){f.call(v,v[g],g,v)})),v}n(we,"forEach");var de=Object.assign||n(function(f){for(var g=arguments.length,m=new Array(g>1?g-1:0),P=1;P0&&m.forEach(function(b){Ar(b)&&Object.keys(b).forEach(function(_){f[_]=b[_]})}),f},"assign"),e0=/\.\d*(?:0|9){12}\d*$/;function Is(v){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return e0.test(v)?Math.round(v*f)/f:v}n(Is,"normalizeDecimalNumber");var t0=/^width|height|left|top|marginLeft|marginTop$/;function or(v,f){var g=v.style;we(f,function(m,P){t0.test(P)&&Q(m)&&(m="".concat(m,"px")),g[P]=m})}n(or,"setStyle");function i0(v,f){return v.classList?v.classList.contains(f):v.className.indexOf(f)>-1}n(i0,"hasClass");function Ue(v,f){if(!!f){if(Q(v.length)){we(v,function(m){Ue(m,f)});return}if(v.classList){v.classList.add(f);return}var g=v.className.trim();g?g.indexOf(f)<0&&(v.className="".concat(g," ").concat(f)):v.className=f}}n(Ue,"addClass");function Zt(v,f){if(!!f){if(Q(v.length)){we(v,function(g){Zt(g,f)});return}if(v.classList){v.classList.remove(f);return}v.className.indexOf(f)>=0&&(v.className=v.className.replace(f,""))}}n(Zt,"removeClass");function Ls(v,f,g){if(!!f){if(Q(v.length)){we(v,function(m){Ls(m,f,g)});return}g?Ue(v,f):Zt(v,f)}}n(Ls,"toggleClass");var r0=/([a-z\d])([A-Z])/g;function au(v){return v.replace(r0,"$1-$2").toLowerCase()}n(au,"toParamCase");function lu(v,f){return Ar(v[f])?v[f]:v.dataset?v.dataset[f]:v.getAttribute("data-".concat(au(f)))}n(lu,"getData");function go(v,f,g){Ar(g)?v[f]=g:v.dataset?v.dataset[f]=g:v.setAttribute("data-".concat(au(f)),g)}n(go,"setData");function s0(v,f){if(Ar(v[f]))try{delete v[f]}catch{v[f]=void 0}else if(v.dataset)try{delete v.dataset[f]}catch{v.dataset[f]=void 0}else v.removeAttribute("data-".concat(au(f)))}n(s0,"removeData");var Md=/\s\s*/,zd=function(){var v=!1;if(w){var f=!1,g=n(function(){},"listener"),m=Object.defineProperty({},"once",{get:n(function(){return v=!0,f},"get"),set:n(function(b){f=b},"set")});S.addEventListener("test",g,m),S.removeEventListener("test",g,m)}return v}();function zt(v,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},P=g;f.trim().split(Md).forEach(function(b){if(!zd){var _=v.listeners;_&&_[b]&&_[b][g]&&(P=_[b][g],delete _[b][g],Object.keys(_[b]).length===0&&delete _[b],Object.keys(_).length===0&&delete v.listeners)}v.removeEventListener(b,P,m)})}n(zt,"removeListener");function Ut(v,f,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},P=g;f.trim().split(Md).forEach(function(b){if(m.once&&!zd){var _=v.listeners,F=_===void 0?{}:_;P=n(function(){delete F[b][g],v.removeEventListener(b,P,m);for(var C=arguments.length,A=new Array(C),R=0;R1&&arguments[1]!==void 0?arguments[1]:"contain",b=Id(m),_=Id(g);if(b&&_){var F=g*f;P==="contain"&&F>m||P==="cover"&&F90?{width:U,height:F}:{width:F,height:U}}n(l0,"getRotatedSizes");function u0(v,f,g,m){var P=f.aspectRatio,b=f.naturalWidth,_=f.naturalHeight,F=f.rotate,U=F===void 0?0:F,C=f.scaleX,A=C===void 0?1:C,R=f.scaleY,k=R===void 0?1:R,te=g.aspectRatio,Z=g.naturalWidth,pe=g.naturalHeight,re=m.fillColor,Fe=re===void 0?"transparent":re,De=m.imageSmoothingEnabled,Se=De===void 0?!0:De,Fi=m.imageSmoothingQuality,vt=Fi===void 0?"low":Fi,N=m.maxWidth,se=N===void 0?1/0:N,Re=m.maxHeight,Dt=Re===void 0?1/0:Re,Ri=m.minWidth,Cr=Ri===void 0?0:Ri,Tr=m.minHeight,ar=Tr===void 0?0:Tr,ei=document.createElement("canvas"),ut=ei.getContext("2d"),kr=nr({aspectRatio:te,width:se,height:Dt}),Oa=nr({aspectRatio:te,width:Cr,height:ar},"cover"),hu=Math.min(kr.width,Math.max(Oa.width,Z)),cu=Math.min(kr.height,Math.max(Oa.height,pe)),Wd=nr({aspectRatio:P,width:se,height:Dt}),Kd=nr({aspectRatio:P,width:Cr,height:ar},"cover"),Gd=Math.min(Wd.width,Math.max(Kd.width,b)),Xd=Math.min(Wd.height,Math.max(Kd.height,_)),_0=[-Gd/2,-Xd/2,Gd,Xd];return ei.width=Is(hu),ei.height=Is(cu),ut.fillStyle=Fe,ut.fillRect(0,0,hu,cu),ut.save(),ut.translate(hu/2,cu/2),ut.rotate(U*Math.PI/180),ut.scale(A,k),ut.imageSmoothingEnabled=Se,ut.imageSmoothingQuality=vt,ut.drawImage.apply(ut,[v].concat(l(_0.map(function(x0){return Math.floor(Is(x0))})))),ut.restore(),ei}n(u0,"getSourceCanvas");var $d=String.fromCharCode;function h0(v,f,g){var m="";g+=f;for(var P=f;P0;)g.push($d.apply(null,Ld(P.subarray(0,m)))),P=P.subarray(m);return"data:".concat(f,";base64,").concat(btoa(g.join("")))}n(p0,"arrayBufferToDataURL");function f0(v){var f=new DataView(v),g;try{var m,P,b;if(f.getUint8(0)===255&&f.getUint8(1)===216)for(var _=f.byteLength,F=2;F+1<_;){if(f.getUint8(F)===255&&f.getUint8(F+1)===225){P=F;break}F+=1}if(P){var U=P+4,C=P+10;if(h0(f,U,4)==="Exif"){var A=f.getUint16(C);if(m=A===18761,(m||A===19789)&&f.getUint16(C+2,m)===42){var R=f.getUint32(C+4,m);R>=8&&(b=C+R)}}}if(b){var k=f.getUint16(b,m),te,Z;for(Z=0;Zf.width?m===3?U=f.height*F:C=f.width/F:m===3?C=f.width/F:U=f.height*F;var A={aspectRatio:F,naturalWidth:b,naturalHeight:_,width:U,height:C};A.left=(f.width-U)/2,A.top=(f.height-C)/2,A.oldLeft=A.left,A.oldTop=A.top,this.canvasData=A,this.limited=m===1||m===2,this.limitCanvas(!0,!0),this.initialImageData=de({},g),this.initialCanvasData=de({},A)},"initCanvas"),limitCanvas:n(function(f,g){var m=this.options,P=this.containerData,b=this.canvasData,_=this.cropBoxData,F=m.viewMode,U=b.aspectRatio,C=this.cropped&&_;if(f){var A=Number(m.minCanvasWidth)||0,R=Number(m.minCanvasHeight)||0;F>1?(A=Math.max(A,P.width),R=Math.max(R,P.height),F===3&&(R*U>A?A=R*U:R=A/U)):F>0&&(A?A=Math.max(A,C?_.width:0):R?R=Math.max(R,C?_.height:0):C&&(A=_.width,R=_.height,R*U>A?A=R*U:R=A/U));var k=nr({aspectRatio:U,width:A,height:R});A=k.width,R=k.height,b.minWidth=A,b.minHeight=R,b.maxWidth=1/0,b.maxHeight=1/0}if(g)if(F>(C?0:1)){var te=P.width-b.width,Z=P.height-b.height;b.minLeft=Math.min(0,te),b.minTop=Math.min(0,Z),b.maxLeft=Math.max(0,te),b.maxTop=Math.max(0,Z),C&&this.limited&&(b.minLeft=Math.min(_.left,_.left+(_.width-b.width)),b.minTop=Math.min(_.top,_.top+(_.height-b.height)),b.maxLeft=_.left,b.maxTop=_.top,F===2&&(b.width>=P.width&&(b.minLeft=Math.min(0,te),b.maxLeft=Math.max(0,te)),b.height>=P.height&&(b.minTop=Math.min(0,Z),b.maxTop=Math.max(0,Z))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=P.width,b.maxTop=P.height},"limitCanvas"),renderCanvas:n(function(f,g){var m=this.canvasData,P=this.imageData;if(g){var b=l0({width:P.naturalWidth*Math.abs(P.scaleX||1),height:P.naturalHeight*Math.abs(P.scaleY||1),degree:P.rotate||0}),_=b.width,F=b.height,U=m.width*(_/m.naturalWidth),C=m.height*(F/m.naturalHeight);m.left-=(U-m.width)/2,m.top-=(C-m.height)/2,m.width=U,m.height=C,m.aspectRatio=_/F,m.naturalWidth=_,m.naturalHeight=F,this.limitCanvas(!0,!1)}(m.width>m.maxWidth||m.widthm.maxHeight||m.heightg.width?b.height=b.width/m:b.width=b.height*m),this.cropBoxData=b,this.limitCropBox(!0,!0),b.width=Math.min(Math.max(b.width,b.minWidth),b.maxWidth),b.height=Math.min(Math.max(b.height,b.minHeight),b.maxHeight),b.width=Math.max(b.minWidth,b.width*P),b.height=Math.max(b.minHeight,b.height*P),b.left=g.left+(g.width-b.width)/2,b.top=g.top+(g.height-b.height)/2,b.oldLeft=b.left,b.oldTop=b.top,this.initialCropBoxData=de({},b)},"initCropBox"),limitCropBox:n(function(f,g){var m=this.options,P=this.containerData,b=this.canvasData,_=this.cropBoxData,F=this.limited,U=m.aspectRatio;if(f){var C=Number(m.minCropBoxWidth)||0,A=Number(m.minCropBoxHeight)||0,R=F?Math.min(P.width,b.width,b.width+b.left,P.width-b.left):P.width,k=F?Math.min(P.height,b.height,b.height+b.top,P.height-b.top):P.height;C=Math.min(C,P.width),A=Math.min(A,P.height),U&&(C&&A?A*U>C?A=C/U:C=A*U:C?A=C/U:A&&(C=A*U),k*U>R?k=R/U:R=k*U),_.minWidth=Math.min(C,R),_.minHeight=Math.min(A,k),_.maxWidth=R,_.maxHeight=k}g&&(F?(_.minLeft=Math.max(0,b.left),_.minTop=Math.max(0,b.top),_.maxLeft=Math.min(P.width,b.left+b.width)-_.width,_.maxTop=Math.min(P.height,b.top+b.height)-_.height):(_.minLeft=0,_.minTop=0,_.maxLeft=P.width-_.width,_.maxTop=P.height-_.height))},"limitCropBox"),renderCropBox:n(function(){var f=this.options,g=this.containerData,m=this.cropBoxData;(m.width>m.maxWidth||m.widthm.maxHeight||m.height=g.width&&m.height>=g.height?$:D),or(this.cropBox,de({width:m.width,height:m.height},yo({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:n(function(){this.preview(),Ms(this.element,Oi,this.getData())},"output")},y0={initPreview:n(function(){var f=this.element,g=this.crossOrigin,m=this.options.preview,P=g?this.crossOriginUrl:this.url,b=f.alt||"The image to preview",_=document.createElement("img");if(g&&(_.crossOrigin=g),_.src=P,_.alt=b,this.viewBox.appendChild(_),this.viewBoxImage=_,!!m){var F=m;typeof m=="string"?F=f.ownerDocument.querySelectorAll(m):m.querySelector&&(F=[m]),this.previews=F,we(F,function(U){var C=document.createElement("img");go(U,sr,{width:U.offsetWidth,height:U.offsetHeight,html:U.innerHTML}),g&&(C.crossOrigin=g),C.src=P,C.alt=b,C.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;"',U.innerHTML="",U.appendChild(C)})}},"initPreview"),resetPreview:n(function(){we(this.previews,function(f){var g=lu(f,sr);or(f,{width:g.width,height:g.height}),f.innerHTML=g.html,s0(f,sr)})},"resetPreview"),preview:n(function(){var f=this.imageData,g=this.canvasData,m=this.cropBoxData,P=m.width,b=m.height,_=f.width,F=f.height,U=m.left-g.left-f.left,C=m.top-g.top-f.top;!this.cropped||this.disabled||(or(this.viewBoxImage,de({width:_,height:F},yo(de({translateX:-U,translateY:-C},f)))),we(this.previews,function(A){var R=lu(A,sr),k=R.width,te=R.height,Z=k,pe=te,re=1;P&&(re=k/P,pe=b*re),b&&pe>te&&(re=te/b,Z=P*re,pe=te),or(A,{width:Z,height:pe}),or(A.getElementsByTagName("img")[0],de({width:_*re,height:F*re},yo(de({translateX:-U*re,translateY:-C*re},f))))}))},"preview")},v0={bind:n(function(){var f=this.element,g=this.options,m=this.cropper;lt(g.cropstart)&&Ut(f,Ns,g.cropstart),lt(g.cropmove)&&Ut(f,Ds,g.cropmove),lt(g.cropend)&&Ut(f,kt,g.cropend),lt(g.crop)&&Ut(f,Oi,g.crop),lt(g.zoom)&&Ut(f,ou,g.zoom),Ut(m,Ad,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&Ut(m,Dd,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Ut(m,mo,this.onDblclick=this.dblclick.bind(this)),Ut(f.ownerDocument,Cd,this.onCropMove=this.cropMove.bind(this)),Ut(f.ownerDocument,Td,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&Ut(window,Ud,this.onResize=this.resize.bind(this))},"bind"),unbind:n(function(){var f=this.element,g=this.options,m=this.cropper;lt(g.cropstart)&&zt(f,Ns,g.cropstart),lt(g.cropmove)&&zt(f,Ds,g.cropmove),lt(g.cropend)&&zt(f,kt,g.cropend),lt(g.crop)&&zt(f,Oi,g.crop),lt(g.zoom)&&zt(f,ou,g.zoom),zt(m,Ad,this.onCropStart),g.zoomable&&g.zoomOnWheel&&zt(m,Dd,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&zt(m,mo,this.onDblclick),zt(f.ownerDocument,Cd,this.onCropMove),zt(f.ownerDocument,Td,this.onCropEnd),g.responsive&&zt(window,Ud,this.onResize)},"unbind")},b0={resize:n(function(){if(!this.disabled){var f=this.options,g=this.container,m=this.containerData,P=g.offsetWidth/m.width;if(P!==1||g.offsetHeight!==m.height){var b,_;f.restore&&(b=this.getCanvasData(),_=this.getCropBoxData()),this.render(),f.restore&&(this.setCanvasData(we(b,function(F,U){b[U]=F*P})),this.setCropBoxData(we(_,function(F,U){_[U]=F*P})))}}},"resize"),dblclick:n(function(){this.disabled||this.options.dragMode===Rr||this.setDragMode(i0(this.dragBox,at)?Fr:Ei)},"dblclick"),wheel:n(function(f){var g=this,m=Number(this.options.wheelZoomRatio)||.1,P=1;this.disabled||(f.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),f.deltaY?P=f.deltaY>0?1:-1:f.wheelDelta?P=-f.wheelDelta/120:f.detail&&(P=f.detail>0?1:-1),this.zoom(-P*m,f)))},"wheel"),cropStart:n(function(f){var g=f.buttons,m=f.button;if(!(this.disabled||(f.type==="mousedown"||f.type==="pointerdown"&&f.pointerType==="mouse")&&(Q(g)&&g!==1||Q(m)&&m!==0||f.ctrlKey))){var P=this.options,b=this.pointers,_;f.changedTouches?we(f.changedTouches,function(F){b[F.identifier]=Ea(F)}):b[f.pointerId||0]=Ea(f),Object.keys(b).length>1&&P.zoomable&&P.zoomOnTouch?_=W:_=lu(f.target,xi),!!Wv.test(_)&&Ms(this.element,Ns,{originalEvent:f,action:_})!==!1&&(f.preventDefault(),this.action=_,this.cropping=!1,_===z&&(this.cropping=!0,Ue(this.dragBox,Qt)))}},"cropStart"),cropMove:n(function(f){var g=this.action;if(!(this.disabled||!g)){var m=this.pointers;f.preventDefault(),Ms(this.element,Ds,{originalEvent:f,action:g})!==!1&&(f.changedTouches?we(f.changedTouches,function(P){de(m[P.identifier]||{},Ea(P,!0))}):de(m[f.pointerId||0]||{},Ea(f,!0)),this.change(f))}},"cropMove"),cropEnd:n(function(f){if(!this.disabled){var g=this.action,m=this.pointers;f.changedTouches?we(f.changedTouches,function(P){delete m[P.identifier]}):delete m[f.pointerId||0],g&&(f.preventDefault(),Object.keys(m).length||(this.action=""),this.cropping&&(this.cropping=!1,Ls(this.dragBox,Qt,this.cropped&&this.options.modal)),Ms(this.element,kt,{originalEvent:f,action:g}))}},"cropEnd")},w0={change:n(function(f){var g=this.options,m=this.canvasData,P=this.containerData,b=this.cropBoxData,_=this.pointers,F=this.action,U=g.aspectRatio,C=b.left,A=b.top,R=b.width,k=b.height,te=C+R,Z=A+k,pe=0,re=0,Fe=P.width,De=P.height,Se=!0,Fi;!U&&f.shiftKey&&(U=R&&k?R/k:1),this.limited&&(pe=b.minLeft,re=b.minTop,Fe=pe+Math.min(P.width,m.width,m.left+m.width),De=re+Math.min(P.height,m.height,m.top+m.height));var vt=_[Object.keys(_)[0]],N={x:vt.endX-vt.startX,y:vt.endY-vt.startY},se=n(function(Dt){switch(Dt){case T:te+N.x>Fe&&(N.x=Fe-te);break;case L:C+N.xDe&&(N.y=De-Z);break}},"check");switch(F){case D:C+=N.x,A+=N.y;break;case T:if(N.x>=0&&(te>=Fe||U&&(A<=re||Z>=De))){Se=!1;break}se(T),R+=N.x,R<0&&(F=L,R=-R,C-=R),U&&(k=R/U,A+=(b.height-k)/2);break;case H:if(N.y<=0&&(A<=re||U&&(C<=pe||te>=Fe))){Se=!1;break}se(H),k-=N.y,A+=N.y,k<0&&(F=M,k=-k,A-=k),U&&(R=k*U,C+=(b.width-R)/2);break;case L:if(N.x<=0&&(C<=pe||U&&(A<=re||Z>=De))){Se=!1;break}se(L),R-=N.x,C+=N.x,R<0&&(F=T,R=-R,C-=R),U&&(k=R/U,A+=(b.height-k)/2);break;case M:if(N.y>=0&&(Z>=De||U&&(C<=pe||te>=Fe))){Se=!1;break}se(M),k+=N.y,k<0&&(F=H,k=-k,A-=k),U&&(R=k*U,C+=(b.width-R)/2);break;case Ee:if(U){if(N.y<=0&&(A<=re||te>=Fe)){Se=!1;break}se(H),k-=N.y,A+=N.y,R=k*U}else se(H),se(T),N.x>=0?tere&&(k-=N.y,A+=N.y):(k-=N.y,A+=N.y);R<0&&k<0?(F=ne,k=-k,R=-R,A-=k,C-=R):R<0?(F=Tt,R=-R,C-=R):k<0&&(F=yt,k=-k,A-=k);break;case Tt:if(U){if(N.y<=0&&(A<=re||C<=pe)){Se=!1;break}se(H),k-=N.y,A+=N.y,R=k*U,C+=b.width-R}else se(H),se(L),N.x<=0?C>pe?(R-=N.x,C+=N.x):N.y<=0&&A<=re&&(Se=!1):(R-=N.x,C+=N.x),N.y<=0?A>re&&(k-=N.y,A+=N.y):(k-=N.y,A+=N.y);R<0&&k<0?(F=yt,k=-k,R=-R,A-=k,C-=R):R<0?(F=Ee,R=-R,C-=R):k<0&&(F=ne,k=-k,A-=k);break;case ne:if(U){if(N.x<=0&&(C<=pe||Z>=De)){Se=!1;break}se(L),R-=N.x,C+=N.x,k=R/U}else se(M),se(L),N.x<=0?C>pe?(R-=N.x,C+=N.x):N.y>=0&&Z>=De&&(Se=!1):(R-=N.x,C+=N.x),N.y>=0?Z=0&&(te>=Fe||Z>=De)){Se=!1;break}se(T),R+=N.x,k=R/U}else se(M),se(T),N.x>=0?te=0&&Z>=De&&(Se=!1):R+=N.x,N.y>=0?Z0?F=N.y>0?yt:Ee:N.x<0&&(C-=R,F=N.y>0?ne:Tt),N.y<0&&(A-=k),this.cropped||(Zt(this.cropBox,Oe),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}Se&&(b.width=R,b.height=k,b.left=C,b.top=A,this.action=F,this.renderCropBox()),we(_,function(Re){Re.startX=Re.endX,Re.startY=Re.endY})},"change")},S0={crop:n(function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ue(this.dragBox,Qt),Zt(this.cropBox,Oe),this.setCropBoxData(this.initialCropBoxData)),this},"crop"),reset:n(function(){return this.ready&&!this.disabled&&(this.imageData=de({},this.initialImageData),this.canvasData=de({},this.initialCanvasData),this.cropBoxData=de({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},"reset"),clear:n(function(){return this.cropped&&!this.disabled&&(de(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),Zt(this.dragBox,Qt),Ue(this.cropBox,Oe)),this},"clear"),replace:n(function(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&f&&(this.isImg&&(this.element.src=f),g?(this.url=f,this.image.src=f,this.ready&&(this.viewBoxImage.src=f,we(this.previews,function(m){m.getElementsByTagName("img")[0].src=f}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(f))),this},"replace"),enable:n(function(){return this.ready&&this.disabled&&(this.disabled=!1,Zt(this.cropper,Mt)),this},"enable"),disable:n(function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ue(this.cropper,Mt)),this},"disable"),destroy:n(function(){var f=this.element;return f[E]?(f[E]=void 0,this.isImg&&this.replaced&&(f.src=this.originalUrl),this.uncreate(),this):this},"destroy"),move:n(function(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,m=this.canvasData,P=m.left,b=m.top;return this.moveTo(nu(f)?f:P+Number(f),nu(g)?g:b+Number(g))},"move"),moveTo:n(function(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,m=this.canvasData,P=!1;return f=Number(f),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(Q(f)&&(m.left=f,P=!0),Q(g)&&(m.top=g,P=!0),P&&this.renderCanvas(!0)),this},"moveTo"),zoom:n(function(f,g){var m=this.canvasData;return f=Number(f),f<0?f=1/(1-f):f=1+f,this.zoomTo(m.width*f/m.naturalWidth,null,g)},"zoom"),zoomTo:n(function(f,g,m){var P=this.options,b=this.canvasData,_=b.width,F=b.height,U=b.naturalWidth,C=b.naturalHeight;if(f=Number(f),f>=0&&this.ready&&!this.disabled&&P.zoomable){var A=U*f,R=C*f;if(Ms(this.element,ou,{ratio:f,oldRatio:_/U,originalEvent:m})===!1)return this;if(m){var k=this.pointers,te=jd(this.cropper),Z=k&&Object.keys(k).length?a0(k):{pageX:m.pageX,pageY:m.pageY};b.left-=(A-_)*((Z.pageX-te.left-b.left)/_),b.top-=(R-F)*((Z.pageY-te.top-b.top)/F)}else Bs(g)&&Q(g.x)&&Q(g.y)?(b.left-=(A-_)*((g.x-b.left)/_),b.top-=(R-F)*((g.y-b.top)/F)):(b.left-=(A-_)/2,b.top-=(R-F)/2);b.width=A,b.height=R,this.renderCanvas(!0)}return this},"zoomTo"),rotate:n(function(f){return this.rotateTo((this.imageData.rotate||0)+Number(f))},"rotate"),rotateTo:n(function(f){return f=Number(f),Q(f)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=f%360,this.renderCanvas(!0,!0)),this},"rotateTo"),scaleX:n(function(f){var g=this.imageData.scaleY;return this.scale(f,Q(g)?g:1)},"scaleX"),scaleY:n(function(f){var g=this.imageData.scaleX;return this.scale(Q(g)?g:1,f)},"scaleY"),scale:n(function(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:f,m=this.imageData,P=!1;return f=Number(f),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(Q(f)&&(m.scaleX=f,P=!0),Q(g)&&(m.scaleY=g,P=!0),P&&this.renderCanvas(!0,!0)),this},"scale"),getData:n(function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.options,m=this.imageData,P=this.canvasData,b=this.cropBoxData,_;if(this.ready&&this.cropped){_={x:b.left-P.left,y:b.top-P.top,width:b.width,height:b.height};var F=m.width/m.naturalWidth;if(we(_,function(A,R){_[R]=A/F}),f){var U=Math.round(_.y+_.height),C=Math.round(_.x+_.width);_.x=Math.round(_.x),_.y=Math.round(_.y),_.width=C-_.x,_.height=U-_.y}}else _={x:0,y:0,width:0,height:0};return g.rotatable&&(_.rotate=m.rotate||0),g.scalable&&(_.scaleX=m.scaleX||1,_.scaleY=m.scaleY||1),_},"getData"),setData:n(function(f){var g=this.options,m=this.imageData,P=this.canvasData,b={};if(this.ready&&!this.disabled&&Bs(f)){var _=!1;g.rotatable&&Q(f.rotate)&&f.rotate!==m.rotate&&(m.rotate=f.rotate,_=!0),g.scalable&&(Q(f.scaleX)&&f.scaleX!==m.scaleX&&(m.scaleX=f.scaleX,_=!0),Q(f.scaleY)&&f.scaleY!==m.scaleY&&(m.scaleY=f.scaleY,_=!0)),_&&this.renderCanvas(!0,!0);var F=m.width/m.naturalWidth;Q(f.x)&&(b.left=f.x*F+P.left),Q(f.y)&&(b.top=f.y*F+P.top),Q(f.width)&&(b.width=f.width*F),Q(f.height)&&(b.height=f.height*F),this.setCropBoxData(b)}return this},"setData"),getContainerData:n(function(){return this.ready?de({},this.containerData):{}},"getContainerData"),getImageData:n(function(){return this.sized?de({},this.imageData):{}},"getImageData"),getCanvasData:n(function(){var f=this.canvasData,g={};return this.ready&&we(["left","top","width","height","naturalWidth","naturalHeight"],function(m){g[m]=f[m]}),g},"getCanvasData"),setCanvasData:n(function(f){var g=this.canvasData,m=g.aspectRatio;return this.ready&&!this.disabled&&Bs(f)&&(Q(f.left)&&(g.left=f.left),Q(f.top)&&(g.top=f.top),Q(f.width)?(g.width=f.width,g.height=f.width/m):Q(f.height)&&(g.height=f.height,g.width=f.height*m),this.renderCanvas(!0)),this},"setCanvasData"),getCropBoxData:n(function(){var f=this.cropBoxData,g;return this.ready&&this.cropped&&(g={left:f.left,top:f.top,width:f.width,height:f.height}),g||{}},"getCropBoxData"),setCropBoxData:n(function(f){var g=this.cropBoxData,m=this.options.aspectRatio,P,b;return this.ready&&this.cropped&&!this.disabled&&Bs(f)&&(Q(f.left)&&(g.left=f.left),Q(f.top)&&(g.top=f.top),Q(f.width)&&f.width!==g.width&&(P=!0,g.width=f.width),Q(f.height)&&f.height!==g.height&&(b=!0,g.height=f.height),m&&(P?g.height=g.width/m:b&&(g.width=g.height*m)),this.renderCropBox()),this},"setCropBoxData"),getCroppedCanvas:n(function(){var f=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var g=this.canvasData,m=u0(this.image,this.imageData,g,f);if(!this.cropped)return m;var P=this.getData(),b=P.x,_=P.y,F=P.width,U=P.height,C=m.width/Math.floor(g.naturalWidth);C!==1&&(b*=C,_*=C,F*=C,U*=C);var A=F/U,R=nr({aspectRatio:A,width:f.maxWidth||1/0,height:f.maxHeight||1/0}),k=nr({aspectRatio:A,width:f.minWidth||0,height:f.minHeight||0},"cover"),te=nr({aspectRatio:A,width:f.width||(C!==1?m.width:F),height:f.height||(C!==1?m.height:U)}),Z=te.width,pe=te.height;Z=Math.min(R.width,Math.max(k.width,Z)),pe=Math.min(R.height,Math.max(k.height,pe));var re=document.createElement("canvas"),Fe=re.getContext("2d");re.width=Is(Z),re.height=Is(pe),Fe.fillStyle=f.fillColor||"transparent",Fe.fillRect(0,0,Z,pe);var De=f.imageSmoothingEnabled,Se=De===void 0?!0:De,Fi=f.imageSmoothingQuality;Fe.imageSmoothingEnabled=Se,Fi&&(Fe.imageSmoothingQuality=Fi);var vt=m.width,N=m.height,se=b,Re=_,Dt,Ri,Cr,Tr,ar,ei;se<=-F||se>vt?(se=0,Dt=0,Cr=0,ar=0):se<=0?(Cr=-se,se=0,Dt=Math.min(vt,F+se),ar=Dt):se<=vt&&(Cr=0,Dt=Math.min(F,vt-se),ar=Dt),Dt<=0||Re<=-U||Re>N?(Re=0,Ri=0,Tr=0,ei=0):Re<=0?(Tr=-Re,Re=0,Ri=Math.min(N,U+Re),ei=Ri):Re<=N&&(Tr=0,Ri=Math.min(U,N-Re),ei=Ri);var ut=[se,Re,Dt,Ri];if(ar>0&&ei>0){var kr=Z/F;ut.push(Cr*kr,Tr*kr,ar*kr,ei*kr)}return Fe.drawImage.apply(Fe,[m].concat(l(ut.map(function(Oa){return Math.floor(Is(Oa))})))),re},"getCroppedCanvas"),setAspectRatio:n(function(f){var g=this.options;return!this.disabled&&!nu(f)&&(g.aspectRatio=Math.max(0,f)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},"setAspectRatio"),setDragMode:n(function(f){var g=this.options,m=this.dragBox,P=this.face;if(this.ready&&!this.disabled){var b=f===Ei,_=g.movable&&f===Fr;f=b||_?f:Rr,g.dragMode=f,go(m,xi,f),Ls(m,at,b),Ls(m,Or,_),g.cropBoxMovable||(go(P,xi,f),Ls(P,at,b),Ls(P,Or,_))}return this},"setDragMode")},P0=S.Cropper,Vd=function(){function v(f){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,v),!f||!Xv.test(f.tagName))throw new Error("The first argument is required and must be an
or