"use strict";(()=>{var b1=Object.create;var Hl=Object.defineProperty;var w1=Object.getOwnPropertyDescriptor;var S1=Object.getOwnPropertyNames;var P1=Object.getPrototypeOf,_1=Object.prototype.hasOwnProperty;var o=(i,e)=>Hl(i,"name",{value:e,configurable:!0});var ve=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),ql=(i,e)=>{for(var t in e)Hl(i,t,{get:e[t],enumerable:!0})},x1=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of S1(e))!_1.call(i,s)&&s!==t&&Hl(i,s,{get:()=>e[s],enumerable:!(r=w1(e,s))||r.enumerable});return i};var be=(i,e,t)=>(t=i!=null?b1(P1(i)):{},x1(e||!i||!i.__esModule?Hl(t,"default",{value:i,enumerable:!0}):t,i));var bc=ve((PE,qf)=>{qf.exports=o(function(){var e={},t=e._fns={};e.emit=o(function(a,l,u,h,d,f,y){var w=r(a);w.length&&s(a,w,[l,u,h,d,f,y])},"emit"),e.on=o(function(a,l){t[a]||(t[a]=[]),t[a].push(l)},"on"),e.once=o(function(a,l){function u(){l.apply(this,arguments),e.off(a,u)}o(u,"one"),this.on(a,u)},"once"),e.off=o(function(a,l){var u=[];if(a&&l){var h=this._fns[a],d=0,f=h?h.length:0;for(d;d{function T1(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}o(T1,"isObject");$f.exports=T1});var Wf=ve((CE,Vf)=>{var R1=typeof global=="object"&&global&&global.Object===Object&&global;Vf.exports=R1});var wc=ve((AE,Gf)=>{var k1=Wf(),U1=typeof self=="object"&&self&&self.Object===Object&&self,D1=k1||U1||Function("return this")();Gf.exports=D1});var Xf=ve((TE,Kf)=>{var I1=wc(),L1=o(function(){return I1.Date.now()},"now");Kf.exports=L1});var Qf=ve((kE,Yf)=>{var N1=/\s/;function M1(i){for(var e=i.length;e--&&N1.test(i.charAt(e)););return e}o(M1,"trimmedEndIndex");Yf.exports=M1});var Zf=ve((DE,Jf)=>{var B1=Qf(),j1=/^\s+/;function z1(i){return i&&i.slice(0,B1(i)+1).replace(j1,"")}o(z1,"baseTrim");Jf.exports=z1});var Sc=ve((LE,em)=>{var H1=wc(),q1=H1.Symbol;em.exports=q1});var sm=ve((NE,rm)=>{var tm=Sc(),im=Object.prototype,$1=im.hasOwnProperty,V1=im.toString,bn=tm?tm.toStringTag:void 0;function W1(i){var e=$1.call(i,bn),t=i[bn];try{i[bn]=void 0;var r=!0}catch{}var s=V1.call(i);return r&&(e?i[bn]=t:delete i[bn]),s}o(W1,"getRawTag");rm.exports=W1});var nm=ve((BE,om)=>{var G1=Object.prototype,K1=G1.toString;function X1(i){return K1.call(i)}o(X1,"objectToString");om.exports=X1});var cm=ve((zE,um)=>{var am=Sc(),Y1=sm(),Q1=nm(),J1="[object Null]",Z1="[object Undefined]",lm=am?am.toStringTag:void 0;function ew(i){return i==null?i===void 0?Z1:J1:lm&&lm in Object(i)?Y1(i):Q1(i)}o(ew,"baseGetTag");um.exports=ew});var dm=ve((qE,hm)=>{function tw(i){return i!=null&&typeof i=="object"}o(tw,"isObjectLike");hm.exports=tw});var fm=ve((VE,pm)=>{var iw=cm(),rw=dm(),sw="[object Symbol]";function ow(i){return typeof i=="symbol"||rw(i)&&iw(i)==sw}o(ow,"isSymbol");pm.exports=ow});var vm=ve((GE,ym)=>{var nw=Zf(),mm=Vl(),aw=fm(),gm=NaN,lw=/^[-+]0x[0-9a-f]+$/i,uw=/^0b[01]+$/i,cw=/^0o[0-7]+$/i,hw=parseInt;function dw(i){if(typeof i=="number")return i;if(aw(i))return gm;if(mm(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=mm(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=nw(i);var t=uw.test(i);return t||cw.test(i)?hw(i.slice(2),t?2:8):lw.test(i)?gm:+i}o(dw,"toNumber");ym.exports=dw});var _c=ve((XE,wm)=>{var pw=Vl(),Pc=Xf(),bm=vm(),fw="Expected a function",mw=Math.max,gw=Math.min;function yw(i,e,t){var r,s,n,a,l,u,h=0,d=!1,f=!1,y=!0;if(typeof i!="function")throw new TypeError(fw);e=bm(e)||0,pw(t)&&(d=!!t.leading,f="maxWait"in t,n=f?mw(bm(t.maxWait)||0,e):n,y="trailing"in t?!!t.trailing:y);function w($){var G=r,te=s;return r=s=void 0,h=$,a=i.apply(te,G),a}o(w,"invokeFunc");function S($){return h=$,l=setTimeout(_,e),d?w($):a}o(S,"leadingEdge");function T($){var G=$-u,te=$-h,re=e-G;return f?gw(re,n-te):re}o(T,"remainingWait");function C($){var G=$-u,te=$-h;return u===void 0||G>=e||G<0||f&&te>=n}o(C,"shouldInvoke");function _(){var $=Pc();if(C($))return R($);l=setTimeout(_,T($))}o(_,"timerExpired");function R($){return l=void 0,y&&r?w($):(r=s=void 0,a)}o(R,"trailingEdge");function q(){l!==void 0&&clearTimeout(l),h=0,r=u=s=l=void 0}o(q,"cancel");function W(){return l===void 0?a:R(Pc())}o(W,"flush");function K(){var $=Pc(),G=C($);if(r=arguments,s=this,u=$,G){if(l===void 0)return S(u);if(f)return clearTimeout(l),l=setTimeout(_,e),w(u)}return l===void 0&&(l=setTimeout(_,e)),a}return o(K,"debounced"),K.cancel=q,K.flush=W,K}o(yw,"debounce");wm.exports=yw});var Wl=ve((QE,Sm)=>{var vw=_c(),bw=Vl(),ww="Expected a function";function Sw(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(ww);return bw(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),vw(i,e,{leading:r,maxWait:e,trailing:s})}o(Sw,"throttle");Sm.exports=Sw});var _n=ve((b3,Em)=>{"use strict";Em.exports=o(function(e){if(typeof e!="number"||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/1024**s);let n=r[s];return e>=10||e%1===0?`${(t?"-":"")+e.toFixed(0)} ${n}`:`${(t?"-":"")+e.toFixed(1)} ${n}`},"prettierBytes")});var Am=ve((S3,Cm)=>{"use strict";function Om(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}o(Om,"WildcardMatcher");Om.prototype.match=function(i){var e=!0,t=this.parts,r,s=t.length,n;if(typeof i=="string"||i instanceof String)if(!this.hasWild&&this.text!=i)e=!1;else{for(n=(i||"").split(this.separator),r=0;e&&r{var Ow=Am(),Cw=/[\/\+\.]/;Tm.exports=function(i,e){function t(r){var s=Ow(r,i,Cw);return s&&s.length>=2}return o(t,"test"),e?t(e.split(";")[0]):t}});var sg=ve((dO,rg)=>{function _i(i,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(i)),this._timeouts=i,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}o(_i,"RetryOperation");rg.exports=_i;_i.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};_i.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};_i.prototype.retry=function(i){if(this._timeout&&clearTimeout(this._timeout),!i)return!1;var e=new Date().getTime();if(i&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(i),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(i);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var r=this;return this._timer=setTimeout(function(){r._attempts++,r._operationTimeoutCb&&(r._timeout=setTimeout(function(){r._operationTimeoutCb(r._attempts)},r._operationTimeout),r._options.unref&&r._timeout.unref()),r._fn(r._attempts)},t),this._options.unref&&this._timer.unref(),!0};_i.prototype.attempt=function(i,e){this._fn=i,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};_i.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};_i.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};_i.prototype.start=_i.prototype.try;_i.prototype.errors=function(){return this._errors};_i.prototype.attempts=function(){return this._attempts};_i.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r=t&&(e=s,t=a)}return e}});var og=ve(Fs=>{var eS=sg();Fs.operation=function(i){var e=Fs.timeouts(i);return new eS(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};Fs.timeouts=function(i){if(i instanceof Array)return[].concat(i);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var t in i)e[t]=i[t];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var r=[],s=0;s{ng.exports=og()});var wg=ve((uC,Kc)=>{"use strict";var _S=Object.prototype.hasOwnProperty,Nt="~";function zn(){}o(zn,"Events");Object.create&&(zn.prototype=Object.create(null),new zn().__proto__||(Nt=!1));function xS(i,e,t){this.fn=i,this.context=e,this.once=t||!1}o(xS,"EE");function bg(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new xS(t,r||i,s),a=Nt?Nt+e:e;return i._events[a]?i._events[a].fn?i._events[a]=[i._events[a],n]:i._events[a].push(n):(i._events[a]=n,i._eventsCount++),i}o(bg,"addListener");function lu(i,e){--i._eventsCount===0?i._events=new zn:delete i._events[e]}o(lu,"clearEvent");function Lt(){this._events=new zn,this._eventsCount=0}o(Lt,"EventEmitter");Lt.prototype.eventNames=o(function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)_S.call(t,r)&&e.push(Nt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},"eventNames");Lt.prototype.listeners=o(function(e){var t=Nt?Nt+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,n=r.length,a=new Array(n);s{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var t=[],r=0;r{Iy.exports=o(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 av=ve((fd,md)=>{(function(i,e){typeof fd=="object"&&typeof md<"u"?md.exports=e():typeof define=="function"&&define.amd?define(e):(i=i||self,i.Cropper=e())})(fd,function(){"use strict";function i(v){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?i=o(function(p){return typeof p},"_typeof"):i=o(function(p){return p&&typeof Symbol=="function"&&p.constructor===Symbol&&p!==Symbol.prototype?"symbol":typeof p},"_typeof"),i(v)}o(i,"_typeof");function e(v,p){if(!(v instanceof p))throw new TypeError("Cannot call a class as a function")}o(e,"_classCallCheck");function t(v,p){for(var g=0;gv.length)&&(p=v.length);for(var g=0,m=new Array(p);g
',Dl=Number.isNaN||S.isNaN;function he(v){return typeof v=="number"&&!Dl(v)}o(he,"isNumber");var dn=o(function(p){return p>0&&p<1/0},"isPositiveNumber");function Ro(v){return typeof v>"u"}o(Ro,"isUndefined");function $i(v){return i(v)==="object"&&v!==null}o($i,"isObject");var Il=Object.prototype.hasOwnProperty;function sr(v){if(!$i(v))return!1;try{var p=v.constructor,g=p.prototype;return p&&g&&Il.call(g,"isPrototypeOf")}catch{return!1}}o(sr,"isPlainObject");function St(v){return typeof v=="function"}o(St,"isFunction");var Ll=Array.prototype.slice;function Nl(v){return Array.from?Array.from(v):Ll.call(v)}o(Nl,"toArray");function $e(v,p){return v&&St(p)&&(Array.isArray(v)||he(v.length)?Nl(v).forEach(function(g,m){p.call(v,g,m,v)}):$i(v)&&Object.keys(v).forEach(function(g){p.call(v,v[g],g,v)})),v}o($e,"forEach");var Ce=Object.assign||o(function(p){for(var g=arguments.length,m=new Array(g>1?g-1:0),x=1;x0&&m.forEach(function(b){$i(b)&&Object.keys(b).forEach(function(F){p[F]=b[F]})}),p},"assign"),mc=/\.\d*(?:0|9){12}\d*$/;function Vi(v){var p=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return mc.test(v)?Math.round(v*p)/p:v}o(Vi,"normalizeDecimalNumber");var Ml=/^width|height|left|top|marginLeft|marginTop$/;function Ai(v,p){var g=v.style;$e(p,function(m,x){Ml.test(x)&&he(m)&&(m="".concat(m,"px")),g[x]=m})}o(Ai,"setStyle");function pn(v,p){return v.classList?v.classList.contains(p):v.className.indexOf(p)>-1}o(pn,"hasClass");function Ve(v,p){if(p){if(he(v.length)){$e(v,function(m){Ve(m,p)});return}if(v.classList){v.classList.add(p);return}var g=v.className.trim();g?g.indexOf(p)<0&&(v.className="".concat(g," ").concat(p)):v.className=p}}o(Ve,"addClass");function ti(v,p){if(p){if(he(v.length)){$e(v,function(g){ti(g,p)});return}if(v.classList){v.classList.remove(p);return}v.className.indexOf(p)>=0&&(v.className=v.className.replace(p,""))}}o(ti,"removeClass");function or(v,p,g){if(p){if(he(v.length)){$e(v,function(m){or(m,p,g)});return}g?Ve(v,p):ti(v,p)}}o(or,"toggleClass");var Bl=/([a-z\d])([A-Z])/g;function ko(v){return v.replace(Bl,"$1-$2").toLowerCase()}o(ko,"toParamCase");function Uo(v,p){return $i(v[p])?v[p]:v.dataset?v.dataset[p]:v.getAttribute("data-".concat(ko(p)))}o(Uo,"getData");function Do(v,p,g){$i(g)?v[p]=g:v.dataset?v.dataset[p]=g:v.setAttribute("data-".concat(ko(p)),g)}o(Do,"setData");function gs(v,p){if($i(v[p]))try{delete v[p]}catch{v[p]=void 0}else if(v.dataset)try{delete v.dataset[p]}catch{v.dataset[p]=void 0}else v.removeAttribute("data-".concat(ko(p)))}o(gs,"removeData");var fn=/\s\s*/,mn=function(){var v=!1;if(w){var p=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return v=!0,p},"get"),set:o(function(b){p=b},"set")});S.addEventListener("test",g,m),S.removeEventListener("test",g,m)}return v}();function gt(v,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=g;p.trim().split(fn).forEach(function(b){if(!mn){var F=v.listeners;F&&F[b]&&F[b][g]&&(x=F[b][g],delete F[b][g],Object.keys(F[b]).length===0&&delete F[b],Object.keys(F).length===0&&delete v.listeners)}v.removeEventListener(b,x,m)})}o(gt,"removeListener");function Ut(v,p,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},x=g;p.trim().split(fn).forEach(function(b){if(m.once&&!mn){var F=v.listeners,U=F===void 0?{}:F;x=o(function(){delete U[b][g],v.removeEventListener(b,x,m);for(var j=arguments.length,M=new Array(j),I=0;I1&&arguments[1]!==void 0?arguments[1]:"contain",b=dn(m),F=dn(g);if(b&&F){var U=g*p;x==="contain"&&U>m||x==="cover"&&U90?{width:V,height:U}:{width:U,height:V}}o(i1,"getRotatedSizes");function r1(v,p,g,m){var x=p.aspectRatio,b=p.naturalWidth,F=p.naturalHeight,U=p.rotate,V=U===void 0?0:U,j=p.scaleX,M=j===void 0?1:j,I=p.scaleY,H=I===void 0?1:I,ye=g.aspectRatio,fe=g.naturalWidth,Ue=g.naturalHeight,_e=m.fillColor,ut=_e===void 0?"transparent":_e,yt=m.imageSmoothingEnabled,st=yt===void 0?!0:yt,nr=m.imageSmoothingQuality,ii=nr===void 0?"low":nr,X=m.maxWidth,xe=X===void 0?1/0:X,ct=m.maxHeight,Si=ct===void 0?1/0:ct,ar=m.minWidth,ys=ar===void 0?0:ar,vs=m.minHeight,ts=vs===void 0?0:vs,Wi=document.createElement("canvas"),Kt=Wi.getContext("2d"),bs=es({aspectRatio:ye,width:xe,height:Si}),zl=es({aspectRatio:ye,width:ys,height:ts},"cover"),yc=Math.min(bs.width,Math.max(zl.width,fe)),vc=Math.min(bs.height,Math.max(zl.height,Ue)),Nf=es({aspectRatio:x,width:xe,height:Si}),Mf=es({aspectRatio:x,width:ys,height:ts},"cover"),Bf=Math.min(Nf.width,Math.max(Mf.width,b)),jf=Math.min(Nf.height,Math.max(Mf.height,F)),y1=[-Bf/2,-jf/2,Bf,jf];return Wi.width=Vi(yc),Wi.height=Vi(vc),Kt.fillStyle=ut,Kt.fillRect(0,0,yc,vc),Kt.save(),Kt.translate(yc/2,vc/2),Kt.rotate(V*Math.PI/180),Kt.scale(M,H),Kt.imageSmoothingEnabled=st,Kt.imageSmoothingQuality=ii,Kt.drawImage.apply(Kt,[v].concat(l(y1.map(function(v1){return Math.floor(Vi(v1))})))),Kt.restore(),Wi}o(r1,"getSourceCanvas");var If=String.fromCharCode;function s1(v,p,g){var m="";g+=p;for(var x=p;x0;)g.push(If.apply(null,Nl(x.subarray(0,m)))),x=x.subarray(m);return"data:".concat(p,";base64,").concat(btoa(g.join("")))}o(a1,"arrayBufferToDataURL");function l1(v){var p=new DataView(v),g;try{var m,x,b;if(p.getUint8(0)===255&&p.getUint8(1)===216)for(var F=p.byteLength,U=2;U+1=8&&(b=j+I)}}}if(b){var H=p.getUint16(b,m),ye,fe;for(fe=0;fep.width?m===3?V=p.height*U:j=p.width/U:m===3?j=p.width/U:V=p.height*U;var M={aspectRatio:U,naturalWidth:b,naturalHeight:F,width:V,height:j};M.left=(p.width-V)/2,M.top=(p.height-j)/2,M.oldLeft=M.left,M.oldTop=M.top,this.canvasData=M,this.limited=m===1||m===2,this.limitCanvas(!0,!0),this.initialImageData=Ce({},g),this.initialCanvasData=Ce({},M)},"initCanvas"),limitCanvas:o(function(p,g){var m=this.options,x=this.containerData,b=this.canvasData,F=this.cropBoxData,U=m.viewMode,V=b.aspectRatio,j=this.cropped&&F;if(p){var M=Number(m.minCanvasWidth)||0,I=Number(m.minCanvasHeight)||0;U>1?(M=Math.max(M,x.width),I=Math.max(I,x.height),U===3&&(I*V>M?M=I*V:I=M/V)):U>0&&(M?M=Math.max(M,j?F.width:0):I?I=Math.max(I,j?F.height:0):j&&(M=F.width,I=F.height,I*V>M?M=I*V:I=M/V));var H=es({aspectRatio:V,width:M,height:I});M=H.width,I=H.height,b.minWidth=M,b.minHeight=I,b.maxWidth=1/0,b.maxHeight=1/0}if(g)if(U>(j?0:1)){var ye=x.width-b.width,fe=x.height-b.height;b.minLeft=Math.min(0,ye),b.minTop=Math.min(0,fe),b.maxLeft=Math.max(0,ye),b.maxTop=Math.max(0,fe),j&&this.limited&&(b.minLeft=Math.min(F.left,F.left+(F.width-b.width)),b.minTop=Math.min(F.top,F.top+(F.height-b.height)),b.maxLeft=F.left,b.maxTop=F.top,U===2&&(b.width>=x.width&&(b.minLeft=Math.min(0,ye),b.maxLeft=Math.max(0,ye)),b.height>=x.height&&(b.minTop=Math.min(0,fe),b.maxTop=Math.max(0,fe))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=x.width,b.maxTop=x.height},"limitCanvas"),renderCanvas:o(function(p,g){var m=this.canvasData,x=this.imageData;if(g){var b=i1({width:x.naturalWidth*Math.abs(x.scaleX||1),height:x.naturalHeight*Math.abs(x.scaleY||1),degree:x.rotate||0}),F=b.width,U=b.height,V=m.width*(F/m.naturalWidth),j=m.height*(U/m.naturalHeight);m.left-=(V-m.width)/2,m.top-=(j-m.height)/2,m.width=V,m.height=j,m.aspectRatio=F/U,m.naturalWidth=F,m.naturalHeight=U,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*x),b.height=Math.max(b.minHeight,b.height*x),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=Ce({},b)},"initCropBox"),limitCropBox:o(function(p,g){var m=this.options,x=this.containerData,b=this.canvasData,F=this.cropBoxData,U=this.limited,V=m.aspectRatio;if(p){var j=Number(m.minCropBoxWidth)||0,M=Number(m.minCropBoxHeight)||0,I=U?Math.min(x.width,b.width,b.width+b.left,x.width-b.left):x.width,H=U?Math.min(x.height,b.height,b.height+b.top,x.height-b.top):x.height;j=Math.min(j,x.width),M=Math.min(M,x.height),V&&(j&&M?M*V>j?M=j/V:j=M*V:j?M=j/V:M&&(j=M*V),H*V>I?H=I/V:I=H*V),F.minWidth=Math.min(j,I),F.minHeight=Math.min(M,H),F.maxWidth=I,F.maxHeight=H}g&&(U?(F.minLeft=Math.max(0,b.left),F.minTop=Math.max(0,b.top),F.maxLeft=Math.min(x.width,b.left+b.width)-F.width,F.maxTop=Math.min(x.height,b.top+b.height)-F.height):(F.minLeft=0,F.minTop=0,F.maxLeft=x.width-F.width,F.maxTop=x.height-F.height))},"limitCropBox"),renderCropBox:o(function(){var p=this.options,g=this.containerData,m=this.cropBoxData;(m.width>m.maxWidth||m.widthm.maxHeight||m.height=g.width&&m.height>=g.height?W:R),Ai(this.cropBox,Ce({width:m.width,height:m.height},gn({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),wi(this.element,Y,this.getData())},"output")},h1={initPreview:o(function(){var p=this.element,g=this.crossOrigin,m=this.options.preview,x=g?this.crossOriginUrl:this.url,b=p.alt||"The image to preview",F=document.createElement("img");if(g&&(F.crossOrigin=g),F.src=x,F.alt=b,this.viewBox.appendChild(F),this.viewBoxImage=F,!!m){var U=m;typeof m=="string"?U=p.ownerDocument.querySelectorAll(m):m.querySelector&&(U=[m]),this.previews=U,$e(U,function(V){var j=document.createElement("img");Do(V,D,{width:V.offsetWidth,height:V.offsetHeight,html:V.innerHTML}),g&&(j.crossOrigin=g),j.src=x,j.alt=b,j.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;"',V.innerHTML="",V.appendChild(j)})}},"initPreview"),resetPreview:o(function(){$e(this.previews,function(p){var g=Uo(p,D);Ai(p,{width:g.width,height:g.height}),p.innerHTML=g.html,gs(p,D)})},"resetPreview"),preview:o(function(){var p=this.imageData,g=this.canvasData,m=this.cropBoxData,x=m.width,b=m.height,F=p.width,U=p.height,V=m.left-g.left-p.left,j=m.top-g.top-p.top;!this.cropped||this.disabled||(Ai(this.viewBoxImage,Ce({width:F,height:U},gn(Ce({translateX:-V,translateY:-j},p)))),$e(this.previews,function(M){var I=Uo(M,D),H=I.width,ye=I.height,fe=H,Ue=ye,_e=1;x&&(_e=H/x,Ue=b*_e),b&&Ue>ye&&(_e=ye/b,fe=x*_e,Ue=ye),Ai(M,{width:fe,height:Ue}),Ai(M.getElementsByTagName("img")[0],Ce({width:F*_e,height:U*_e},gn(Ce({translateX:-V*_e,translateY:-j*_e},p))))}))},"preview")},d1={bind:o(function(){var p=this.element,g=this.options,m=this.cropper;St(g.cropstart)&&Ut(p,ge,g.cropstart),St(g.cropmove)&&Ut(p,Oe,g.cropmove),St(g.cropend)&&Ut(p,Q,g.cropend),St(g.crop)&&Ut(p,Y,g.crop),St(g.zoom)&&Ut(p,ds,g.zoom),Ut(m,Rt,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&Ut(m,rr,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Ut(m,ue,this.onDblclick=this.dblclick.bind(this)),Ut(p.ownerDocument,qe,this.onCropMove=this.cropMove.bind(this)),Ut(p.ownerDocument,oe,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&Ut(window,rt,this.onResize=this.resize.bind(this))},"bind"),unbind:o(function(){var p=this.element,g=this.options,m=this.cropper;St(g.cropstart)&>(p,ge,g.cropstart),St(g.cropmove)&>(p,Oe,g.cropmove),St(g.cropend)&>(p,Q,g.cropend),St(g.crop)&>(p,Y,g.crop),St(g.zoom)&>(p,ds,g.zoom),gt(m,Rt,this.onCropStart),g.zoomable&&g.zoomOnWheel&>(m,rr,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&>(m,ue,this.onDblclick),gt(p.ownerDocument,qe,this.onCropMove),gt(p.ownerDocument,oe,this.onCropEnd),g.responsive&>(window,rt,this.onResize)},"unbind")},p1={resize:o(function(){if(!this.disabled){var p=this.options,g=this.container,m=this.containerData,x=g.offsetWidth/m.width;if(x!==1||g.offsetHeight!==m.height){var b,F;p.restore&&(b=this.getCanvasData(),F=this.getCropBoxData()),this.render(),p.restore&&(this.setCanvasData($e(b,function(U,V){b[V]=U*x})),this.setCropBoxData($e(F,function(U,V){F[V]=U*x})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===N||this.setDragMode(pn(this.dragBox,Pe)?k:A)},"dblclick"),wheel:o(function(p){var g=this,m=Number(this.options.wheelZoomRatio)||.1,x=1;this.disabled||(p.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),p.deltaY?x=p.deltaY>0?1:-1:p.wheelDelta?x=-p.wheelDelta/120:p.detail&&(x=p.detail>0?1:-1),this.zoom(-x*m,p)))},"wheel"),cropStart:o(function(p){var g=p.buttons,m=p.button;if(!(this.disabled||(p.type==="mousedown"||p.type==="pointerdown"&&p.pointerType==="mouse")&&(he(g)&&g!==1||he(m)&&m!==0||p.ctrlKey))){var x=this.options,b=this.pointers,F;p.changedTouches?$e(p.changedTouches,function(U){b[U.identifier]=jl(U)}):b[p.pointerId||0]=jl(p),Object.keys(b).length>1&&x.zoomable&&x.zoomOnTouch?F=K:F=Uo(p.target,B),ps.test(F)&&wi(this.element,ge,{originalEvent:p,action:F})!==!1&&(p.preventDefault(),this.action=F,this.cropping=!1,F===q&&(this.cropping=!0,Ve(this.dragBox,L)))}},"cropStart"),cropMove:o(function(p){var g=this.action;if(!(this.disabled||!g)){var m=this.pointers;p.preventDefault(),wi(this.element,Oe,{originalEvent:p,action:g})!==!1&&(p.changedTouches?$e(p.changedTouches,function(x){Ce(m[x.identifier]||{},jl(x,!0))}):Ce(m[p.pointerId||0]||{},jl(p,!0)),this.change(p))}},"cropMove"),cropEnd:o(function(p){if(!this.disabled){var g=this.action,m=this.pointers;p.changedTouches?$e(p.changedTouches,function(x){delete m[x.identifier]}):delete m[p.pointerId||0],g&&(p.preventDefault(),Object.keys(m).length||(this.action=""),this.cropping&&(this.cropping=!1,or(this.dragBox,L,this.cropped&&this.options.modal)),wi(this.element,Q,{originalEvent:p,action:g}))}},"cropEnd")},f1={change:o(function(p){var g=this.options,m=this.canvasData,x=this.containerData,b=this.cropBoxData,F=this.pointers,U=this.action,V=g.aspectRatio,j=b.left,M=b.top,I=b.width,H=b.height,ye=j+I,fe=M+H,Ue=0,_e=0,ut=x.width,yt=x.height,st=!0,nr;!V&&p.shiftKey&&(V=I&&H?I/H:1),this.limited&&(Ue=b.minLeft,_e=b.minTop,ut=Ue+Math.min(x.width,m.width,m.left+m.width),yt=_e+Math.min(x.height,m.height,m.top+m.height));var ii=F[Object.keys(F)[0]],X={x:ii.endX-ii.startX,y:ii.endY-ii.startY},xe=o(function(Si){switch(Si){case $:ye+X.x>ut&&(X.x=ut-ye);break;case G:j+X.xyt&&(X.y=yt-fe);break}},"check");switch(U){case R:j+=X.x,M+=X.y;break;case $:if(X.x>=0&&(ye>=ut||V&&(M<=_e||fe>=yt))){st=!1;break}xe($),I+=X.x,I<0&&(U=G,I=-I,j-=I),V&&(H=I/V,M+=(b.height-H)/2);break;case re:if(X.y<=0&&(M<=_e||V&&(j<=Ue||ye>=ut))){st=!1;break}xe(re),H-=X.y,M+=X.y,H<0&&(U=te,H=-H,M-=H),V&&(I=H*V,j+=(b.width-I)/2);break;case G:if(X.x<=0&&(j<=Ue||V&&(M<=_e||fe>=yt))){st=!1;break}xe(G),I-=X.x,j+=X.x,I<0&&(U=$,I=-I,j-=I),V&&(H=I/V,M+=(b.height-H)/2);break;case te:if(X.y>=0&&(fe>=yt||V&&(j<=Ue||ye>=ut))){st=!1;break}xe(te),H+=X.y,H<0&&(U=re,H=-H,M-=H),V&&(I=H*V,j+=(b.width-I)/2);break;case Te:if(V){if(X.y<=0&&(M<=_e||ye>=ut)){st=!1;break}xe(re),H-=X.y,M+=X.y,I=H*V}else xe(re),xe($),X.x>=0?ye_e&&(H-=X.y,M+=X.y):(H-=X.y,M+=X.y);I<0&&H<0?(U=we,H=-H,I=-I,M-=H,j-=I):I<0?(U=Ke,I=-I,j-=I):H<0&&(U=He,H=-H,M-=H);break;case Ke:if(V){if(X.y<=0&&(M<=_e||j<=Ue)){st=!1;break}xe(re),H-=X.y,M+=X.y,I=H*V,j+=b.width-I}else xe(re),xe(G),X.x<=0?j>Ue?(I-=X.x,j+=X.x):X.y<=0&&M<=_e&&(st=!1):(I-=X.x,j+=X.x),X.y<=0?M>_e&&(H-=X.y,M+=X.y):(H-=X.y,M+=X.y);I<0&&H<0?(U=He,H=-H,I=-I,M-=H,j-=I):I<0?(U=Te,I=-I,j-=I):H<0&&(U=we,H=-H,M-=H);break;case we:if(V){if(X.x<=0&&(j<=Ue||fe>=yt)){st=!1;break}xe(G),I-=X.x,j+=X.x,H=I/V}else xe(te),xe(G),X.x<=0?j>Ue?(I-=X.x,j+=X.x):X.y>=0&&fe>=yt&&(st=!1):(I-=X.x,j+=X.x),X.y>=0?fe=0&&(ye>=ut||fe>=yt)){st=!1;break}xe($),I+=X.x,H=I/V}else xe(te),xe($),X.x>=0?ye=0&&fe>=yt&&(st=!1):I+=X.x,X.y>=0?fe0?U=X.y>0?He:Te:X.x<0&&(j-=I,U=X.y>0?we:Ke),X.y<0&&(M-=H),this.cropped||(ti(this.cropBox,O),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}st&&(b.width=I,b.height=H,b.left=j,b.top=M,this.action=U,this.renderCropBox()),$e(F,function(ct){ct.startX=ct.endX,ct.startY=ct.endY})},"change")},m1={crop:o(function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&Ve(this.dragBox,L),ti(this.cropBox,O),this.setCropBoxData(this.initialCropBoxData)),this},"crop"),reset:o(function(){return this.ready&&!this.disabled&&(this.imageData=Ce({},this.initialImageData),this.canvasData=Ce({},this.initialCanvasData),this.cropBoxData=Ce({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},"reset"),clear:o(function(){return this.cropped&&!this.disabled&&(Ce(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),ti(this.dragBox,L),Ve(this.cropBox,O)),this},"clear"),replace:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return!this.disabled&&p&&(this.isImg&&(this.element.src=p),g?(this.url=p,this.image.src=p,this.ready&&(this.viewBoxImage.src=p,$e(this.previews,function(m){m.getElementsByTagName("img")[0].src=p}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(p))),this},"replace"),enable:o(function(){return this.ready&&this.disabled&&(this.disabled=!1,ti(this.cropper,Ie)),this},"enable"),disable:o(function(){return this.ready&&!this.disabled&&(this.disabled=!0,Ve(this.cropper,Ie)),this},"disable"),destroy:o(function(){var p=this.element;return p[_]?(p[_]=void 0,this.isImg&&this.replaced&&(p.src=this.originalUrl),this.uncreate(),this):this},"destroy"),move:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.canvasData,x=m.left,b=m.top;return this.moveTo(Ro(p)?p:x+Number(p),Ro(g)?g:b+Number(g))},"move"),moveTo:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.canvasData,x=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.movable&&(he(p)&&(m.left=p,x=!0),he(g)&&(m.top=g,x=!0),x&&this.renderCanvas(!0)),this},"moveTo"),zoom:o(function(p,g){var m=this.canvasData;return p=Number(p),p<0?p=1/(1-p):p=1+p,this.zoomTo(m.width*p/m.naturalWidth,null,g)},"zoom"),zoomTo:o(function(p,g,m){var x=this.options,b=this.canvasData,F=b.width,U=b.height,V=b.naturalWidth,j=b.naturalHeight;if(p=Number(p),p>=0&&this.ready&&!this.disabled&&x.zoomable){var M=V*p,I=j*p;if(wi(this.element,ds,{ratio:p,oldRatio:F/V,originalEvent:m})===!1)return this;if(m){var H=this.pointers,ye=kf(this.cropper),fe=H&&Object.keys(H).length?t1(H):{pageX:m.pageX,pageY:m.pageY};b.left-=(M-F)*((fe.pageX-ye.left-b.left)/F),b.top-=(I-U)*((fe.pageY-ye.top-b.top)/U)}else sr(g)&&he(g.x)&&he(g.y)?(b.left-=(M-F)*((g.x-b.left)/F),b.top-=(I-U)*((g.y-b.top)/U)):(b.left-=(M-F)/2,b.top-=(I-U)/2);b.width=M,b.height=I,this.renderCanvas(!0)}return this},"zoomTo"),rotate:o(function(p){return this.rotateTo((this.imageData.rotate||0)+Number(p))},"rotate"),rotateTo:o(function(p){return p=Number(p),he(p)&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=p%360,this.renderCanvas(!0,!0)),this},"rotateTo"),scaleX:o(function(p){var g=this.imageData.scaleY;return this.scale(p,he(g)?g:1)},"scaleX"),scaleY:o(function(p){var g=this.imageData.scaleX;return this.scale(he(g)?g:1,p)},"scaleY"),scale:o(function(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:p,m=this.imageData,x=!1;return p=Number(p),g=Number(g),this.ready&&!this.disabled&&this.options.scalable&&(he(p)&&(m.scaleX=p,x=!0),he(g)&&(m.scaleY=g,x=!0),x&&this.renderCanvas(!0,!0)),this},"scale"),getData:o(function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,g=this.options,m=this.imageData,x=this.canvasData,b=this.cropBoxData,F;if(this.ready&&this.cropped){F={x:b.left-x.left,y:b.top-x.top,width:b.width,height:b.height};var U=m.width/m.naturalWidth;if($e(F,function(M,I){F[I]=M/U}),p){var V=Math.round(F.y+F.height),j=Math.round(F.x+F.width);F.x=Math.round(F.x),F.y=Math.round(F.y),F.width=j-F.x,F.height=V-F.y}}else F={x:0,y:0,width:0,height:0};return g.rotatable&&(F.rotate=m.rotate||0),g.scalable&&(F.scaleX=m.scaleX||1,F.scaleY=m.scaleY||1),F},"getData"),setData:o(function(p){var g=this.options,m=this.imageData,x=this.canvasData,b={};if(this.ready&&!this.disabled&&sr(p)){var F=!1;g.rotatable&&he(p.rotate)&&p.rotate!==m.rotate&&(m.rotate=p.rotate,F=!0),g.scalable&&(he(p.scaleX)&&p.scaleX!==m.scaleX&&(m.scaleX=p.scaleX,F=!0),he(p.scaleY)&&p.scaleY!==m.scaleY&&(m.scaleY=p.scaleY,F=!0)),F&&this.renderCanvas(!0,!0);var U=m.width/m.naturalWidth;he(p.x)&&(b.left=p.x*U+x.left),he(p.y)&&(b.top=p.y*U+x.top),he(p.width)&&(b.width=p.width*U),he(p.height)&&(b.height=p.height*U),this.setCropBoxData(b)}return this},"setData"),getContainerData:o(function(){return this.ready?Ce({},this.containerData):{}},"getContainerData"),getImageData:o(function(){return this.sized?Ce({},this.imageData):{}},"getImageData"),getCanvasData:o(function(){var p=this.canvasData,g={};return this.ready&&$e(["left","top","width","height","naturalWidth","naturalHeight"],function(m){g[m]=p[m]}),g},"getCanvasData"),setCanvasData:o(function(p){var g=this.canvasData,m=g.aspectRatio;return this.ready&&!this.disabled&&sr(p)&&(he(p.left)&&(g.left=p.left),he(p.top)&&(g.top=p.top),he(p.width)?(g.width=p.width,g.height=p.width/m):he(p.height)&&(g.height=p.height,g.width=p.height*m),this.renderCanvas(!0)),this},"setCanvasData"),getCropBoxData:o(function(){var p=this.cropBoxData,g;return this.ready&&this.cropped&&(g={left:p.left,top:p.top,width:p.width,height:p.height}),g||{}},"getCropBoxData"),setCropBoxData:o(function(p){var g=this.cropBoxData,m=this.options.aspectRatio,x,b;return this.ready&&this.cropped&&!this.disabled&&sr(p)&&(he(p.left)&&(g.left=p.left),he(p.top)&&(g.top=p.top),he(p.width)&&p.width!==g.width&&(x=!0,g.width=p.width),he(p.height)&&p.height!==g.height&&(b=!0,g.height=p.height),m&&(x?g.height=g.width/m:b&&(g.width=g.height*m)),this.renderCropBox()),this},"setCropBoxData"),getCroppedCanvas:o(function(){var p=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var g=this.canvasData,m=r1(this.image,this.imageData,g,p);if(!this.cropped)return m;var x=this.getData(),b=x.x,F=x.y,U=x.width,V=x.height,j=m.width/Math.floor(g.naturalWidth);j!==1&&(b*=j,F*=j,U*=j,V*=j);var M=U/V,I=es({aspectRatio:M,width:p.maxWidth||1/0,height:p.maxHeight||1/0}),H=es({aspectRatio:M,width:p.minWidth||0,height:p.minHeight||0},"cover"),ye=es({aspectRatio:M,width:p.width||(j!==1?m.width:U),height:p.height||(j!==1?m.height:V)}),fe=ye.width,Ue=ye.height;fe=Math.min(I.width,Math.max(H.width,fe)),Ue=Math.min(I.height,Math.max(H.height,Ue));var _e=document.createElement("canvas"),ut=_e.getContext("2d");_e.width=Vi(fe),_e.height=Vi(Ue),ut.fillStyle=p.fillColor||"transparent",ut.fillRect(0,0,fe,Ue);var yt=p.imageSmoothingEnabled,st=yt===void 0?!0:yt,nr=p.imageSmoothingQuality;ut.imageSmoothingEnabled=st,nr&&(ut.imageSmoothingQuality=nr);var ii=m.width,X=m.height,xe=b,ct=F,Si,ar,ys,vs,ts,Wi;xe<=-U||xe>ii?(xe=0,Si=0,ys=0,ts=0):xe<=0?(ys=-xe,xe=0,Si=Math.min(ii,U+xe),ts=Si):xe<=ii&&(ys=0,Si=Math.min(U,ii-xe),ts=Si),Si<=0||ct<=-V||ct>X?(ct=0,ar=0,vs=0,Wi=0):ct<=0?(vs=-ct,ct=0,ar=Math.min(X,V+ct),Wi=ar):ct<=X&&(vs=0,ar=Math.min(V,X-ct),Wi=ar);var Kt=[xe,ct,Si,ar];if(ts>0&&Wi>0){var bs=fe/U;Kt.push(ys*bs,vs*bs,ts*bs,Wi*bs)}return ut.drawImage.apply(ut,[m].concat(l(Kt.map(function(zl){return Math.floor(Vi(zl))})))),_e},"getCroppedCanvas"),setAspectRatio:o(function(p){var g=this.options;return!this.disabled&&!Ro(p)&&(g.aspectRatio=Math.max(0,p)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},"setAspectRatio"),setDragMode:o(function(p){var g=this.options,m=this.dragBox,x=this.face;if(this.ready&&!this.disabled){var b=p===A,F=g.movable&&p===k;p=b||F?p:N,g.dragMode=p,Do(m,B,p),or(m,Pe,b),or(m,z,F),g.cropBoxMovable||(Do(x,B,p),or(x,Pe,b),or(x,z,F))}return this},"setDragMode")},g1=S.Cropper,Lf=function(){function v(p){var g=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e(this,v),!p||!Zr.test(p.tagName))throw new Error("The first argument is required and must be an or element.");this.element=p,this.options=Ce({},lt,sr(g)&&g),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return o(v,"Cropper"),r(v,[{key:"init",value:o(function(){var g=this.element,m=g.tagName.toLowerCase(),x;if(!g[_]){if(g[_]=this,m==="img"){if(this.isImg=!0,x=g.getAttribute("src")||"",this.originalUrl=x,!x)return;x=g.src}else m==="canvas"&&window.HTMLCanvasElement&&(x=g.toDataURL());this.load(x)}},"init")},{key:"load",value:o(function(g){var m=this;if(g){this.url=g,this.imageData={};var x=this.element,b=this.options;if(!b.rotatable&&!b.scalable&&(b.checkOrientation=!1),!b.checkOrientation||!window.ArrayBuffer){this.clone();return}if(fs.test(g)){ms.test(g)?this.read(n1(g)):this.clone();return}var F=new XMLHttpRequest,U=this.clone.bind(this);this.reloading=!0,this.xhr=F,F.onabort=U,F.onerror=U,F.ontimeout=U,F.onprogress=function(){F.getResponseHeader("content-type")!==Jr&&F.abort()},F.onload=function(){m.read(F.response)},F.onloadend=function(){m.reloading=!1,m.xhr=null},b.checkCrossOrigin&&Uf(g)&&x.crossOrigin&&(g=Df(g)),F.open("GET",g),F.responseType="arraybuffer",F.withCredentials=x.crossOrigin==="use-credentials",F.send()}},"load")},{key:"read",value:o(function(g){var m=this.options,x=this.imageData,b=l1(g),F=0,U=1,V=1;if(b>1){this.url=a1(g,Jr);var j=u1(b);F=j.rotate,U=j.scaleX,V=j.scaleY}m.rotatable&&(x.rotate=F),m.scalable&&(x.scaleX=U,x.scaleY=V),this.clone()},"read")},{key:"clone",value:o(function(){var g=this.element,m=this.url,x=g.crossOrigin,b=m;this.options.checkCrossOrigin&&Uf(m)&&(x||(x="anonymous"),b=Df(m)),this.crossOrigin=x,this.crossOriginUrl=b;var F=document.createElement("img");x&&(F.crossOrigin=x),F.src=b||m,F.alt=g.alt||"The image to crop",this.image=F,F.onload=this.start.bind(this),F.onerror=this.stop.bind(this),Ve(F,P),g.parentNode.insertBefore(F,g.nextSibling)},"clone")},{key:"start",value:o(function(){var g=this,m=this.image;m.onload=null,m.onerror=null,this.sizing=!0;var x=S.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(S.navigator.userAgent),b=o(function(j,M){Ce(g.imageData,{naturalWidth:j,naturalHeight:M,aspectRatio:j/M}),g.sizing=!1,g.sized=!0,g.build()},"done");if(m.naturalWidth&&!x){b(m.naturalWidth,m.naturalHeight);return}var F=document.createElement("img"),U=document.body||document.documentElement;this.sizingImage=F,F.onload=function(){b(F.width,F.height),x||U.removeChild(F)},F.src=m.src,x||(F.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;",U.appendChild(F))},"start")},{key:"stop",value:o(function(){var g=this.image;g.onload=null,g.onerror=null,g.parentNode.removeChild(g),this.image=null},"stop")},{key:"build",value:o(function(){if(!(!this.sized||this.ready)){var g=this.element,m=this.options,x=this.image,b=g.parentNode,F=document.createElement("div");F.innerHTML=mt;var U=F.querySelector(".".concat(_,"-container")),V=U.querySelector(".".concat(_,"-canvas")),j=U.querySelector(".".concat(_,"-drag-box")),M=U.querySelector(".".concat(_,"-crop-box")),I=M.querySelector(".".concat(_,"-face"));this.container=b,this.cropper=U,this.canvas=V,this.dragBox=j,this.cropBox=M,this.viewBox=U.querySelector(".".concat(_,"-view-box")),this.face=I,V.appendChild(x),Ve(g,O),b.insertBefore(U,g.nextSibling),this.isImg||ti(x,P),this.initPreview(),this.bind(),m.initialAspectRatio=Math.max(0,m.initialAspectRatio)||NaN,m.aspectRatio=Math.max(0,m.aspectRatio)||NaN,m.viewMode=Math.max(0,Math.min(3,Math.round(m.viewMode)))||0,Ve(M,O),m.guides||Ve(M.getElementsByClassName("".concat(_,"-dashed")),O),m.center||Ve(M.getElementsByClassName("".concat(_,"-center")),O),m.background&&Ve(U,"".concat(_,"-bg")),m.highlight||Ve(I,E),m.cropBoxMovable&&(Ve(I,z),Do(I,B,R)),m.cropBoxResizable||(Ve(M.getElementsByClassName("".concat(_,"-line")),O),Ve(M.getElementsByClassName("".concat(_,"-point")),O)),this.render(),this.ready=!0,this.setDragMode(m.dragMode),m.autoCrop&&this.crop(),this.setData(m.data),St(m.ready)&&Ut(g,kt,m.ready,{once:!0}),wi(g,kt)}},"build")},{key:"unbuild",value:o(function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),ti(this.element,O))},"unbuild")},{key:"uncreate",value:o(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()},"uncreate")}],[{key:"noConflict",value:o(function(){return window.Cropper=g1,v},"noConflict")},{key:"setDefaults",value:o(function(g){Ce(lt,sr(g)&&g)},"setDefaults")}]),v}();return Ce(Lf.prototype,c1,h1,d1,p1,f1,m1),Lf})});var Nv=ve((W7,Vu)=>{"use strict";Vu.exports=jd;Vu.exports.isMobile=jd;Vu.exports.default=jd;var y_=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,v_=/CrOS/,b_=/android|ipad|playbook|silk/i;function jd(i){i||(i={});let e=i.ua;if(!e&&typeof navigator<"u"&&(e=navigator.userAgent),e&&e.headers&&typeof e.headers["user-agent"]=="string"&&(e=e.headers["user-agent"]),typeof e!="string")return!1;let t=y_.test(e)&&!v_.test(e)||!!i.tablet&&b_.test(e);return!t&&i.tablet&&i.featureDetect&&navigator&&navigator.maxTouchPoints>1&&e.indexOf("Macintosh")!==-1&&e.indexOf("Safari")!==-1&&(t=!0),t}o(jd,"isMobile")});var Fb=ve((nL,xb)=>{"use strict";xb.exports=o(function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0},"required")});var Cb=ve(xp=>{"use strict";var U5=Object.prototype.hasOwnProperty,D5;function Eb(i){try{return decodeURIComponent(i.replace(/\+/g," "))}catch{return null}}o(Eb,"decode");function Ob(i){try{return encodeURIComponent(i)}catch{return null}}o(Ob,"encode");function I5(i){for(var e=/([^=?#&]+)=?([^&]*)/g,t={},r;r=e.exec(i);){var s=Eb(r[1]),n=Eb(r[2]);s===null||n===null||s in t||(t[s]=n)}return t}o(I5,"querystring");function L5(i,e){e=e||"";var t=[],r,s;typeof e!="string"&&(e="?");for(s in i)if(U5.call(i,s)){if(r=i[s],!r&&(r===null||r===D5||isNaN(r))&&(r=""),s=Ob(s),r=Ob(r),s===null||r===null)continue;t.push(s+"="+r)}return t.length?e+t.join("&"):""}o(L5,"querystringify");xp.stringify=L5;xp.parse=I5});var Lb=ve((cL,Ib)=>{"use strict";var Tb=Fb(),ec=Cb(),N5=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,Rb=/[\n\r\t]/g,M5=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,kb=/:\d+$/,B5=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,j5=/^[a-zA-Z]:/;function Ep(i){return(i||"").toString().replace(N5,"")}o(Ep,"trimLeft");var Fp=[["#","hash"],["?","query"],o(function(e,t){return Zi(t.protocol)?e.replace(/\\/g,"/"):e},"sanitize"),["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],Ab={hash:1,query:1};function Ub(i){var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e={};var t=e.location||{};i=i||t;var r={},s=typeof i,n;if(i.protocol==="blob:")r=new er(unescape(i.pathname),{});else if(s==="string"){r=new er(i,{});for(n in Ab)delete r[n]}else if(s==="object"){for(n in i)n in Ab||(r[n]=i[n]);r.slashes===void 0&&(r.slashes=M5.test(i.href))}return r}o(Ub,"lolcation");function Zi(i){return i==="file:"||i==="ftp:"||i==="http:"||i==="https:"||i==="ws:"||i==="wss:"}o(Zi,"isSpecial");function Db(i,e){i=Ep(i),i=i.replace(Rb,""),e=e||{};var t=B5.exec(i),r=t[1]?t[1].toLowerCase():"",s=!!t[2],n=!!t[3],a=0,l;return s?n?(l=t[2]+t[3]+t[4],a=t[2].length+t[3].length):(l=t[2]+t[4],a=t[2].length):n?(l=t[3]+t[4],a=t[3].length):l=t[4],r==="file:"?a>=2&&(l=l.slice(2)):Zi(r)?l=t[4]:r?s&&(l=l.slice(2)):a>=2&&Zi(e.protocol)&&(l=t[4]),{protocol:r,slashes:s||Zi(r),slashesCount:a,rest:l}}o(Db,"extractProtocol");function z5(i,e){if(i==="")return e;for(var t=(e||"/").split("/").slice(0,-1).concat(i.split("/")),r=t.length,s=t[r-1],n=!1,a=0;r--;)t[r]==="."?t.splice(r,1):t[r]===".."?(t.splice(r,1),a++):a&&(r===0&&(n=!0),t.splice(r,1),a--);return n&&t.unshift(""),(s==="."||s==="..")&&t.push(""),t.join("/")}o(z5,"resolve");function er(i,e,t){if(i=Ep(i),i=i.replace(Rb,""),!(this instanceof er))return new er(i,e,t);var r,s,n,a,l,u,h=Fp.slice(),d=typeof e,f=this,y=0;for(d!=="object"&&d!=="string"&&(t=e,e=null),t&&typeof t!="function"&&(t=ec.parse),e=Ub(e),s=Db(i||"",e),r=!s.protocol&&!s.slashes,f.slashes=s.slashes||r&&e.slashes,f.protocol=s.protocol||e.protocol||"",i=s.rest,(s.protocol==="file:"&&(s.slashesCount!==2||j5.test(i))||!s.slashes&&(s.protocol||s.slashesCount<2||!Zi(f.protocol)))&&(h[3]=[/(.*)/,"pathname"]);y{typeof Vp<"u"&&(Vp.exports=yi);function yi(i){if(i)return aF(i)}o(yi,"Emitter");function aF(i){for(var e in yi.prototype)i[e]=yi.prototype[e];return i}o(aF,"mixin");yi.prototype.on=yi.prototype.addEventListener=function(i,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+i]=this._callbacks["$"+i]||[]).push(e),this};yi.prototype.once=function(i,e){function t(){this.off(i,t),e.apply(this,arguments)}return o(t,"on"),t.fn=e,this.on(i,t),this};yi.prototype.off=yi.prototype.removeListener=yi.prototype.removeAllListeners=yi.prototype.removeEventListener=function(i,e){if(this._callbacks=this._callbacks||{},arguments.length==0)return this._callbacks={},this;var t=this._callbacks["$"+i];if(!t)return this;if(arguments.length==1)return delete this._callbacks["$"+i],this;for(var r,s=0;s{(function(i,e){typeof Cf=="object"&&typeof Af<"u"?Af.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(Cf,function(){"use strict";function i(D,A){var k=Object.keys(D);if(Object.getOwnPropertySymbols){var N=Object.getOwnPropertySymbols(D);A&&(N=N.filter(function(Y){return Object.getOwnPropertyDescriptor(D,Y).enumerable})),k.push.apply(k,N)}return k}o(i,"ownKeys");function e(D){for(var A=1;A"u"||function(A){var k=A.HTMLCanvasElement&&A.HTMLCanvasElement.prototype,N=A.Blob&&function(){try{return!!new Blob}catch{return!1}}(),Y=N&&A.Uint8Array&&function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}}(),Q=A.BlobBuilder||A.WebKitBlobBuilder||A.MozBlobBuilder||A.MSBlobBuilder,Oe=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,ge=(N||Q)&&A.atob&&A.ArrayBuffer&&A.Uint8Array&&function(ue){var ce,ke,Le,Rt,qe,oe,kt,rt,rr;if(ce=ue.match(Oe),!ce)throw new Error("invalid data URI");for(ke=ce[2]?ce[1]:"text/plain"+(ce[3]||";charset=US-ASCII"),Le=!!ce[4],Rt=ue.slice(ce[0].length),Le?qe=atob(Rt):qe=decodeURIComponent(Rt),oe=new ArrayBuffer(qe.length),kt=new Uint8Array(oe),rt=0;rt"u"?!1:A instanceof Blob||Object.prototype.toString.call(A)==="[object Blob]"},"isBlob"),y={strict:!0,checkOrientation:!0,retainExif:!1,maxWidth:1/0,maxHeight:1/0,minWidth:0,minHeight:0,width:void 0,height:void 0,resize:"none",quality:.8,mimeType:"auto",convertTypes:["image/png"],convertSize:5e6,beforeDraw:null,drew:null,success:null,error:null},w=typeof window<"u"&&typeof window.document<"u",S=w?window:{},T=o(function(A){return A>0&&A<1/0},"isPositiveNumber"),C=Array.prototype.slice;function _(D){return Array.from?Array.from(D):C.call(D)}o(_,"toArray");var R=/^image\/.+$/;function q(D){return R.test(D)}o(q,"isImageType");function W(D){var A=q(D)?D.substr(6):"";return A==="jpeg"&&(A="jpg"),".".concat(A)}o(W,"imageTypeToExtension");var K=String.fromCharCode;function $(D,A,k){var N="",Y;for(k+=A,Y=A;Y0;)k.push(K.apply(null,_(Y.subarray(0,N)))),Y=Y.subarray(N);return"data:".concat(A,";base64,").concat(G(k.join("")))}o(te,"arrayBufferToDataURL");function re(D){var A=new DataView(D),k;try{var N,Y,Q;if(A.getUint8(0)===255&&A.getUint8(1)===216)for(var Oe=A.byteLength,ge=2;ge+1=8&&(Q=ce+Le)}}}if(Q){var Rt=A.getUint16(Q,N),qe,oe;for(oe=0;oe1&&arguments[1]!==void 0?arguments[1]:1e11;return Ke.test(D)?Math.round(D*A)/A:D}o(He,"normalizeDecimalNumber");function we(D){var A=D.aspectRatio,k=D.height,N=D.width,Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",Q=T(N),Oe=T(k);if(Q&&Oe){var ge=k*A;(Y==="contain"||Y==="none")&&ge>N||Y==="cover"&&ge1&&a(qe,Te(oe))),ue&&(k.exif=Pe(Rt)),ge||ue?!E||oe>1?qe.url=te(Rt,Q):qe.url=E.createObjectURL(N):qe.url=Rt,k.load(qe)},ce.onabort=function(){k.fail(new Error("Aborted to read the image with FileReader."))},ce.onerror=function(){k.fail(new Error("Failed to read the image with FileReader."))},ce.onloadend=function(){k.reader=null},ge||ue?ce.readAsArrayBuffer(N):ce.readAsDataURL(N)}},"init")},{key:"load",value:o(function(k){var N=this,Y=this.file,Q=this.image;Q.onload=function(){N.draw(e(e({},k),{},{naturalWidth:Q.naturalWidth,naturalHeight:Q.naturalHeight}))},Q.onabort=function(){N.fail(new Error("Aborted to load the image."))},Q.onerror=function(){N.fail(new Error("Failed to load the image."))},S.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(S.navigator.userAgent)&&(Q.crossOrigin="anonymous"),Q.alt=Y.name,Q.src=k.url},"load")},{key:"draw",value:o(function(k){var N=this,Y=k.naturalWidth,Q=k.naturalHeight,Oe=k.rotate,ge=Oe===void 0?0:Oe,ue=k.scaleX,ce=ue===void 0?1:ue,ke=k.scaleY,Le=ke===void 0?1:ke,Rt=this.file,qe=this.image,oe=this.options,kt=document.createElement("canvas"),rt=kt.getContext("2d"),rr=Math.abs(ge)%180===90,ds=(oe.resize==="contain"||oe.resize==="cover")&&T(oe.width)&&T(oe.height),Jr=Math.max(oe.maxWidth,0)||1/0,ps=Math.max(oe.maxHeight,0)||1/0,fs=Math.max(oe.minWidth,0)||0,ms=Math.max(oe.minHeight,0)||0,Zr=Y/Q,lt=oe.width,mt=oe.height;if(rr){var Dl=[ps,Jr];Jr=Dl[0],ps=Dl[1];var he=[ms,fs];fs=he[0],ms=he[1];var dn=[mt,lt];lt=dn[0],mt=dn[1]}ds&&(Zr=lt/mt);var Ro=we({aspectRatio:Zr,width:Jr,height:ps},"contain");Jr=Ro.width,ps=Ro.height;var $i=we({aspectRatio:Zr,width:fs,height:ms},"cover");if(fs=$i.width,ms=$i.height,ds){var Il=we({aspectRatio:Zr,width:lt,height:mt},oe.resize);lt=Il.width,mt=Il.height}else{var sr=we({aspectRatio:Zr,width:lt,height:mt}),St=sr.width;lt=St===void 0?Y:St;var Ll=sr.height;mt=Ll===void 0?Q:Ll}lt=Math.floor(He(Math.min(Math.max(lt,fs),Jr))),mt=Math.floor(He(Math.min(Math.max(mt,ms),ps)));var Nl=-lt/2,$e=-mt/2,Ce=lt,mc=mt,Vi=[];if(ds){var Ml=0,Ai=0,pn=Y,Ve=Q,ti=we({aspectRatio:Zr,width:Y,height:Q},{contain:"cover",cover:"contain"}[oe.resize]);pn=ti.width,Ve=ti.height,Ml=(Y-pn)/2,Ai=(Q-Ve)/2,Vi.push(Ml,Ai,pn,Ve)}if(Vi.push(Nl,$e,Ce,mc),rr){var or=[mt,lt];lt=or[0],mt=or[1]}kt.width=lt,kt.height=mt,q(oe.mimeType)||(oe.mimeType=Rt.type);var Bl="transparent";Rt.size>oe.convertSize&&oe.convertTypes.indexOf(oe.mimeType)>=0&&(oe.mimeType="image/jpeg");var ko=oe.mimeType==="image/jpeg";if(ko&&(Bl="#fff"),rt.fillStyle=Bl,rt.fillRect(0,0,lt,mt),oe.beforeDraw&&oe.beforeDraw.call(this,rt,kt),!this.aborted&&(rt.save(),rt.translate(lt/2,mt/2),rt.rotate(ge*Math.PI/180),rt.scale(ce,Le),rt.drawImage.apply(rt,[qe].concat(Vi)),rt.restore(),oe.drew&&oe.drew.call(this,rt,kt),!this.aborted)){var Uo=o(function(gs){if(!N.aborted){var fn=o(function(wi){return N.done({naturalWidth:Y,naturalHeight:Q,result:wi})},"done");if(gs&&ko&&oe.retainExif&&N.exif&&N.exif.length>0){var mn=o(function(wi){return fn(d(te(Ie(wi,N.exif),oe.mimeType)))},"next");if(gs.arrayBuffer)gs.arrayBuffer().then(mn).catch(function(){N.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var gt=new P;N.reader=gt,gt.onload=function(Ut){var wi=Ut.target;mn(wi.result)},gt.onabort=function(){N.fail(new Error("Aborted to read the compressed image with FileReader."))},gt.onerror=function(){N.fail(new Error("Failed to read the compressed image with FileReader."))},gt.onloadend=function(){N.reader=null},gt.readAsArrayBuffer(gs)}}else fn(gs)}},"callback");kt.toBlob?kt.toBlob(Uo,oe.mimeType,oe.quality):Uo(d(kt.toDataURL(oe.mimeType,oe.quality)))}},"draw")},{key:"done",value:o(function(k){var N=k.naturalWidth,Y=k.naturalHeight,Q=k.result,Oe=this.file,ge=this.image,ue=this.options;if(E&&ge.src.indexOf("blob:")===0&&E.revokeObjectURL(ge.src),Q)if(ue.strict&&!ue.retainExif&&Q.size>Oe.size&&ue.mimeType===Oe.type&&!(ue.width>N||ue.height>Y||ue.minWidth>N||ue.minHeight>Y||ue.maxWidthYs,AwsS3:()=>Yo,AwsS3Multipart:()=>us,BasePlugin:()=>Ee,Box:()=>Rr,Compressor:()=>Ul,Core:()=>gE,Dashboard:()=>qs,DefaultStore:()=>Xl,DragDrop:()=>$s,DropTarget:()=>Go,Dropbox:()=>kr,Facebook:()=>Ur,FileInput:()=>Vs,Form:()=>un,GoldenRetriever:()=>cn,GoogleDrive:()=>Dr,GooglePhotos:()=>Ir,ImageEditor:()=>Ws,Informer:()=>Fr,Instagram:()=>Lr,OneDrive:()=>Nr,ProgressBar:()=>Gs,ReduxDevTools:()=>hn,ReduxStore:()=>Gg,RemoteSources:()=>Ko,ScreenCapture:()=>Js,StatusBar:()=>xr,ThumbnailGenerator:()=>os,Transloadit:()=>qi,Tus:()=>Kr,UIPlugin:()=>ne,Unsplash:()=>Mr,Uppy:()=>kc,Url:()=>Ei,Webcam:()=>Zs,XHRUpload:()=>an,Zoom:()=>Br,debugLogger:()=>Pn,locales:()=>vE,server:()=>Gc,views:()=>yE});function $l(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o($l,"_classPrivateFieldLooseBase");var F1=0;function Hf(i){return"__private_"+F1+++"_"+i}o(Hf,"_classPrivateFieldLooseKey");function E1(i,e,t){let r=[];return i.forEach(s=>typeof s!="string"?r.push(s):e[Symbol.split](s).forEach((n,a,l)=>{n!==""&&r.push(n),a{throw new Error(`missing string: ${i}`)},"defaultOnMissingKey"),yn=Hf("onMissingKey"),vn=Hf("apply"),ws=class{static{o(this,"Translator")}constructor(e,t){let{onMissingKey:r=O1}=t===void 0?{}:t;Object.defineProperty(this,vn,{value:C1}),Object.defineProperty(this,yn,{writable:!0,value:void 0}),this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach($l(this,vn)[vn],this):$l(this,vn)[vn](e),$l(this,yn)[yn]=r}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let r=this.locale.strings[e];if(r==null&&($l(this,yn)[yn](e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){let n=this.locale.pluralize(t.smart_count);return zf(r[n],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return zf(r,t)}};function C1(i){if(!(i!=null&&i.strings))return;let e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...i.strings},pluralize:i.pluralize||e.pluralize})}o(C1,"_apply2");var Nm=be(bc(),1);var A1="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict";var Xt=o((i=21)=>{let e="",t=i;for(;t--;)e+=A1[Math.random()*64|0];return e},"nanoid");var Mm=be(Wl(),1);function Gl(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(Gl,"_classPrivateFieldLooseBase");var Pw=0;function Pm(i){return"__private_"+Pw+++"_"+i}o(Pm,"_classPrivateFieldLooseKey");var _w={version:"3.2.2"},Ss=Pm("callbacks"),xc=Pm("publish"),Kl=class{static{o(this,"DefaultStore")}constructor(){Object.defineProperty(this,xc,{value:xw}),this.state={},Object.defineProperty(this,Ss,{writable:!0,value:new Set})}getState(){return this.state}setState(e){let t={...this.state},r={...this.state,...e};this.state=r,Gl(this,xc)[xc](t,r,e)}subscribe(e){return Gl(this,Ss)[Ss].add(e),()=>{Gl(this,Ss)[Ss].delete(e)}}};function xw(){for(var i=arguments.length,e=new Array(i),t=0;t{r(...e)})}o(xw,"_publish2");Kl.VERSION=_w.version;var Xl=Kl;function Gi(i){let e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}o(Gi,"getFileNameAndExtension");var wn={__proto__:null,md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",webp:"image/webp",gif:"image/gif",heic:"image/heic",heif:"image/heif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",tsv:"text/tab-separated-values",tab:"text/tab-separated-values",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",dicom:"application/dicom",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel",txt:"text/plain",text:"text/plain",conf:"text/plain",log:"text/plain",pdf:"application/pdf",zip:"application/zip","7z":"application/x-7z-compressed",rar:"application/x-rar-compressed",tar:"application/x-tar",gz:"application/gzip",dmg:"application/x-apple-diskimage"};function Sn(i){var e;if(i.type)return i.type;let t=i.name?(e=Gi(i.name).extension)==null?void 0:e.toLowerCase():null;return t&&t in wn?wn[t]:"application/octet-stream"}o(Sn,"getFileType");function Fw(i){return i.charCodeAt(0).toString(32)}o(Fw,"encodeCharacter");function _m(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Fw(t)}`,"/"))+e}o(_m,"encodeFilename");function xm(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${_m(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${_m(i.meta.relativePath.toLowerCase())}`),i.data.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}o(xm,"generateFileID");function Ew(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}o(Ew,"hasFileStableId");function Yl(i,e){if(Ew(i))return i.id;let t=Sn(i);return xm({...i,type:t},e)}o(Yl,"getSafeFileId");function Fc(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;let e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;let r=e[1].split(".",2),s=parseInt(r[0],10),n=parseInt(r[1],10);return s<15||s===15&&n<15063||s>18||s===18&&n>=18218}o(Fc,"supportsUploadProgress");function Ec(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}o(Ec,"getFileName");function Oc(i){return i<10?`0${i}`:i.toString()}o(Oc,"pad");function Io(){let i=new Date,e=Oc(i.getHours()),t=Oc(i.getMinutes()),r=Oc(i.getSeconds());return`${e}:${t}:${r}`}o(Io,"getTimeStamp");var Fm={debug:()=>{},warn:()=>{},error:function(){for(var i=arguments.length,e=new Array(i),t=0;t{var r;let s=e();if(((r=s.restrictions)==null?void 0:r.allowedFileTypes)!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){let{maxTotalFileSize:r,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s&&e.filter(a=>!a.isGhost).length+t.length>s)throw new Yt(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`);if(r){let n=[...e,...t].reduce((a,l)=>{var u;return a+((u=l.size)!=null?u:0)},0);if(n>r)throw new Yt(this.getI18n()("aggregateExceedsSize",{sizeAllowed:(0,xn.default)(r),size:(0,xn.default)(n)}))}}validateSingleFile(e){let{maxFileSize:t,minFileSize:r,allowedFileTypes:s}=this.getOpts().restrictions;if(s&&!s.some(a=>a.includes("/")?e.type?(0,km.default)(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){let a=s.join(", ");throw new Yt(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Yt(this.getI18n()("exceedsSize",{size:(0,xn.default)(t),file:e.name}),{file:e});if(r&&e.size!=null&&e.size{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){let{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length{let a=this.getFile(s?.id);if(s==null||!a){this.log(`Not setting progress for a file that has been removed: ${s?.id}`);return}if(a.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${s.id}`);return}let l=Number.isFinite(n.bytesTotal)&&n.bytesTotal>0;this.setFileState(s.id,{progress:{...a.progress,bytesUploaded:n.bytesUploaded,bytesTotal:n.bytesTotal,percentage:l?Math.round(n.bytesUploaded/n.bytesTotal*100):0}}),this.calculateTotalProgress()},500,{leading:!0,trailing:!0}),Object.defineProperty(this,Ti,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,An,{writable:!0,value:new Map}),this.defaultLocale=Dm;let t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Um,meta:{},onBeforeFileAdded:(s,n)=>!Object.hasOwn(n,s.id),onBeforeUpload:s=>s,store:new Xl,logger:Fm,infoTimeout:5e3},r={...t,...e};this.opts={...r,restrictions:{...t.restrictions,...e&&e.restrictions}},e&&e.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e&&e.debug&&(this.opts.logger=Pn),this.log(`Using Core v${i.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Jl,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:Fc(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),J(this,ri)[ri]=new Ql(()=>this.opts,()=>this.i18n),J(this,Fn)[Fn]=this.store.subscribe((s,n,a)=>{this.emit("state-update",s,n,a),this.updateAll(n)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),J(this,Ac)[Ac]()}emit(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),s=1;s{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){let t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(r=>{let[s,n]=r;return[s,{...t[s],...n}]}))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can\u2019t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){let e=o(r=>this.log(`Missing i18n string: ${r}`,"error"),"onMissingKey"),t=new ws([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){let e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},r={};Object.keys(t).forEach(s=>{r[s]={...t[s],progress:{...t[s].progress,...e}}}),this.setState({files:r,...Jl}),this.emit("reset-progress")}clearUploadedFiles(){let{capabilities:e,currentUploads:t}=this.getState();if(Object.keys(t).length>0&&!e.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");this.setState({...Jl,files:{}})}addPreProcessor(e){J(this,Ps)[Ps].add(e)}removePreProcessor(e){return J(this,Ps)[Ps].delete(e)}addPostProcessor(e){J(this,hr)[hr].add(e)}removePostProcessor(e){return J(this,hr)[hr].delete(e)}addUploader(e){J(this,_s)[_s].add(e)}removeUploader(e){return J(this,_s)[_s].delete(e)}setMeta(e){let t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(s=>{r[s]={...r[s],meta:{...r[s].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){let r={...this.getState().files};if(!r[e]){this.log("Was trying to set metadata for a file that has been removed: ",e);return}let s={...r[e].meta,...t};r[e]={...r[e],meta:s},this.setState({files:r})}getFile(e){return this.getState().files[e]}getFiles(){let{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){let{files:e,totalProgress:t,error:r}=this.getState(),s=Object.values(e),n=[],a=[],l=[],u=[],h=[],d=[],f=[],y=[],w=[];for(let S of s){let{progress:T}=S;!T.uploadComplete&&T.uploadStarted&&(n.push(S),S.isPaused||y.push(S)),T.uploadStarted||a.push(S),(T.uploadStarted||T.preprocess||T.postprocess)&&l.push(S),T.uploadStarted&&u.push(S),S.isPaused&&h.push(S),T.uploadComplete&&d.push(S),S.error&&f.push(S),(T.preprocess||T.postprocess)&&w.push(S)}return{newFiles:a,startedFiles:l,uploadStartedFiles:u,pausedFiles:h,completeFiles:d,erroredFiles:f,inProgressFiles:n,inProgressNotPausedFiles:y,processingFiles:w,isUploadStarted:u.length>0,isAllComplete:t===100&&d.length===s.length&&w.length===0,isAllErrored:!!r&&f.length===s.length,isAllPaused:n.length!==0&&h.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some(S=>S.isGhost)}}validateRestrictions(e,t){t===void 0&&(t=this.getFiles());try{J(this,ri)[ri].validate(t,[e])}catch(r){return r}return null}checkIfFileAlreadyExists(e){let{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}addFile(e){J(this,En)[En](e);let{nextFilesState:t,validFilesToAdd:r,errors:s}=J(this,Cn)[Cn]([e]),n=s.filter(l=>l.isRestriction);if(J(this,si)[si](n),s.length>0)throw s[0];this.setState({files:t});let[a]=r;return this.emit("file-added",a),this.emit("files-added",r),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),J(this,On)[On](),a.id}addFiles(e){J(this,En)[En]();let{nextFilesState:t,validFilesToAdd:r,errors:s}=J(this,Cn)[Cn](e),n=s.filter(l=>l.isRestriction);J(this,si)[si](n);let a=s.filter(l=>!l.isRestriction);if(a.length>0){let l=`Multiple errors occurred while adding files: `;if(a.forEach(u=>{l+=` * ${u.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:l},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,l);{let u=new Error(l);throw u.errors=a,u}}this.setState({files:t}),r.forEach(l=>{this.emit("file-added",l)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(l=>{this.log(`Added file: ${l.name} id: ${l.id} type: ${l.type}`)}),r.length>0&&J(this,On)[On]()}removeFiles(e,t){let{files:r,currentUploads:s}=this.getState(),n={...r},a={...s},l=Object.create(null);e.forEach(f=>{r[f]&&(l[f]=r[f],delete n[f])});function u(f){return l[f]===void 0}o(u,"fileIsNotRemoved"),Object.keys(a).forEach(f=>{let y=s[f].fileIDs.filter(u);if(y.length===0){delete a[f];return}let{capabilities:w}=this.getState();if(y.length!==s[f].fileIDs.length&&!w.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");a[f]={...s[f],fileIDs:y}});let h={currentUploads:a,files:n};Object.keys(n).length===0&&(h.allowNewUpload=!0,h.error=null,h.recoveredState=null),this.setState(h),this.calculateTotalProgress();let d=Object.keys(l);d.forEach(f=>{this.emit("file-removed",l[f],t)}),d.length>5?this.log(`Removed ${d.length} files`):this.log(`Removed files: ${d.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;let r=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:r}),this.emit("upload-pause",e,r),r}pauseAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!0};e[r]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){let e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{let s={...e[r],isPaused:!1,error:null};e[r]=s}),this.setState({files:e}),this.emit("resume-all")}retryAll(){let e={...this.getState().files},t=Object.keys(e).filter(s=>e[s].error);if(t.forEach(s=>{let n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t),t.length===0)return Promise.resolve({successful:[],failed:[]});let r=J(this,ur)[ur](t,{forceAllowNewUpload:!0});return J(this,cr)[cr](r)}cancelAll(e){let{reason:t="user"}=e===void 0?{}:e;if(this.emit("cancel-all",{reason:t}),t==="user"){let{files:r}=this.getState(),s=Object.keys(r);s.length&&this.removeFiles(s,"cancel-all"),this.setState(Jl)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);let t=J(this,ur)[ur]([e],{forceAllowNewUpload:!0});return J(this,cr)[cr](t)}logout(){this.iteratePlugins(e=>{var t;(t=e.provider)==null||t.logout==null||t.logout()})}calculateTotalProgress(){let t=this.getFiles().filter(h=>h.progress.uploadStarted||h.progress.preprocess||h.progress.postprocess);if(t.length===0){this.emit("progress",0),this.setState({totalProgress:0});return}let r=t.filter(h=>h.progress.bytesTotal!=null),s=t.filter(h=>h.progress.bytesTotal==null);if(r.length===0){let h=t.length*100,d=s.reduce((y,w)=>y+w.progress.percentage,0),f=Math.round(d/h*100);this.setState({totalProgress:f});return}let n=r.reduce((h,d)=>{var f;return h+((f=d.progress.bytesTotal)!=null?f:0)},0),a=n/r.length;n+=a*s.length;let l=0;r.forEach(h=>{l+=h.progress.bytesUploaded}),s.forEach(h=>{l+=a*(h.progress.percentage||0)/100});let u=n===0?0:Math.round(l/n*100);u>100&&(u=100),this.setState({totalProgress:u}),this.emit("progress",u)}updateOnlineStatus(){var e;((e=window.navigator.onLine)!=null?e:!0)?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}getID(){return this.opts.id}use(e,t){if(typeof e!="function"){let a=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(a)}let r=new e(this,t),s=r.id;if(!s)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");let n=this.getPlugin(s);if(n){let a=`Already found a plugin named '${n.id}'. Tried to use: '${s}'. Uppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(a)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),r.type in J(this,Pt)[Pt]?J(this,Pt)[Pt][r.type].push(r):J(this,Pt)[Pt][r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(let t of Object.values(J(this,Pt)[Pt])){let r=t.find(s=>s.id===e);if(r!=null)return r}}[Im](e){return J(this,Pt)[Pt][e]}iteratePlugins(e){Object.values(J(this,Pt)[Pt]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();let t=J(this,Pt)[Pt][e.type],r=t.findIndex(a=>a.id===e.id);r!==-1&&t.splice(r,1);let n={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(n)}close(e){let{reason:t}=e===void 0?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),J(this,Fn)[Fn](),this.iteratePlugins(r=>{this.removePlugin(r)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",J(this,Ti)[Ti]),window.removeEventListener("offline",J(this,Ti)[Ti]))}hideInfo(){let{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,r){t===void 0&&(t="info"),r===void 0&&(r=3e3);let s=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout(()=>this.hideInfo(),r),this.emit("info-visible")}log(e,t){let{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}registerRequestClient(e,t){J(this,An)[An].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);let t=J(this,An)[An].get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}restore(e){return this.log(`Core: attempting to restore upload "${e}"`),this.getState().currentUploads[e]?J(this,cr)[cr](e):(J(this,xs)[xs](e),Promise.reject(new Error("Nonexistent upload")))}[Lm](){return J(this,ur)[ur](...arguments)}addResultData(e,t){if(!J(this,Tc)[Tc](e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}let{currentUploads:r}=this.getState(),s={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:s}})}upload(){var e;(e=J(this,Pt)[Pt].uploader)!=null&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState(),r=this.opts.onBeforeUpload(t);return r===!1?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(r&&typeof r=="object"&&(t=r,this.setState({files:t})),Promise.resolve().then(()=>J(this,ri)[ri].validateMinNumberOfFiles(t)).catch(s=>{throw J(this,si)[si]([s]),s}).then(()=>{if(!J(this,Cc)[Cc](t))throw new Yt(this.i18n("missingRequiredMetaField"))}).catch(s=>{throw s}).then(()=>{let{currentUploads:s}=this.getState(),n=Object.values(s).flatMap(u=>u.fileIDs),a=[];Object.keys(t).forEach(u=>{let h=this.getFile(u);!h.progress.uploadStarted&&n.indexOf(u)===-1&&a.push(h.id)});let l=J(this,ur)[ur](a);return J(this,cr)[cr](l)}).catch(s=>{throw this.emit("error",s),this.log(s,"error"),s}))}};function Rw(i){for(let n of i)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");let e=i.filter(n=>n.isUserFacing),t=4,r=e.slice(0,t),s=e.slice(t);r.forEach(n=>{let{message:a,details:l=""}=n;this.info({message:a,details:l},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}o(Rw,"_informAndEmit2");function kw(i){let{missingFields:e,error:t}=J(this,ri)[ri].getMissingRequiredMetaFields(i);return e.length>0?(this.setFileState(i.id,{missingRequiredMetaFields:e}),this.log(t.message),this.emit("restriction-failed",i,t),!1):!0}o(kw,"_checkRequiredMetaFieldsOnFile2");function Uw(i){let e=!0;for(let t of Object.values(i))J(this,Tn)[Tn](t)||(e=!1);return e}o(Uw,"_checkRequiredMetaFields2");function Dw(i){let{allowNewUpload:e}=this.getState();if(e===!1){let t=new Yt(this.i18n("noMoreFilesAllowed"),{file:i});throw J(this,si)[si]([t]),t}}o(Dw,"_assertNewUploadAllowed2");function Iw(i){let e=i instanceof File?{name:i.name,type:i.type,size:i.size,data:i}:i,t=Sn(e),r=Ec(t,e),s=Gi(r).extension,n=Yl(e,this.getID()),a=e.meta||{};a.name=r,a.type=t;let l=Number.isFinite(e.data.size)?e.data.size:null;return{source:e.source||"",id:n,name:r,extension:s||"",meta:{...this.getState().meta,...a},type:t,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,isGhost:!1,isRemote:e.isRemote||!1,remote:e.remote||"",preview:e.preview}}o(Iw,"_transformFile2");function Lw(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(()=>{this.scheduledAutoProceed=null,this.upload().catch(i=>{i.isRestriction||this.log(i.stack||i.message||i)})},4))}o(Lw,"_startIfAutoProceed2");function Nw(i){let{files:e}=this.getState(),t={...e},r=[],s=[];for(let a of i)try{var n;let l=J(this,Rc)[Rc](a),u=(n=e[l.id])==null?void 0:n.isGhost;u&&(l={...e[l.id],isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${l.name}, ${l.id}`));let h=this.opts.onBeforeFileAdded(l,t);if(!h&&this.checkIfFileAlreadyExists(l.id))throw new Yt(this.i18n("noDuplicates",{fileName:l.name}),{file:a});if(h===!1&&!u)throw new Yt("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof h=="object"&&h!==null&&(l=h),J(this,ri)[ri].validateSingleFile(l),t[l.id]=l,r.push(l)}catch(l){s.push(l)}try{J(this,ri)[ri].validateAggregateRestrictions(Object.values(e),r)}catch(a){return s.push(a),{nextFilesState:e,validFilesToAdd:[],errors:s}}return{nextFilesState:t,validFilesToAdd:r,errors:s}}o(Nw,"_checkAndUpdateFileState2");function Mw(){let i=o((r,s,n)=>{let a=r.message||"Unknown error";r.details&&(a+=` ${r.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:n})},"errorHandler");this.on("error",i),this.on("upload-error",(r,s,n)=>{if(i(s,r,n),typeof s=="object"&&s.message){var a;this.log(s.message,"error");let l=new Error(this.i18n("failedToUpload",{file:(a=r?.name)!=null?a:""}));l.isUserFacing=!0,l.details=s.message,s.details&&(l.details+=` ${s.details}`),J(this,si)[si]([l])}else J(this,si)[si]([s])});let e=null;this.on("upload-stalled",(r,s)=>{let{message:n}=r,a=s.map(l=>l.meta.name).join(", ");e||(this.info({message:n,details:a},"warning",this.opts.infoTimeout),e=setTimeout(()=>{e=null},this.opts.infoTimeout)),this.log(`${n} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});let t=o(r=>{let s=r.filter(a=>{let l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),n=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(n)},"onUploadStarted");this.on("upload-start",r=>{r.forEach(s=>{this.emit("upload-started",s)}),t(r)}),this.on("upload-progress",this.calculateProgress),this.on("upload-success",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let n=this.getFile(r.id).progress;this.setFileState(r.id,{progress:{...n,postprocess:J(this,hr)[hr].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:n.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),r.size==null&&this.setFileState(r.id,{size:s.bytesUploaded||n.bytesTotal}),this.calculateTotalProgress()}),this.on("preprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getFile(r.id).progress,preprocess:s}})}),this.on("preprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(r,s)=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}this.setFileState(r.id,{progress:{...this.getState().files[r.id].progress,postprocess:s}})}),this.on("postprocess-complete",r=>{if(r==null||!this.getFile(r.id)){this.log(`Not setting progress for a file that has been removed: ${r?.id}`);return}let s={...this.getState().files};s[r.id]={...s[r.id],progress:{...s[r.id].progress}},delete s[r.id].progress.postprocess,this.setState({files:s})}),this.on("restored",()=>{this.calculateTotalProgress()}),this.on("dashboard:file-edit-complete",r=>{r&&J(this,Tn)[Tn](r)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",J(this,Ti)[Ti]),window.addEventListener("offline",J(this,Ti)[Ti]),setTimeout(J(this,Ti)[Ti],3e3))}o(Mw,"_addListeners2");function Bw(i,e){e===void 0&&(e={});let{forceAllowNewUpload:t=!1}=e,{allowNewUpload:r,currentUploads:s}=this.getState();if(!r&&!t)throw new Error("Cannot create a new upload: already uploading.");let n=Xt();return this.emit("upload",{id:n,fileIDs:i}),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[n]:{fileIDs:i,step:0,result:{}}}}),n}o(Bw,"_createUpload2");function jw(i){let{currentUploads:e}=this.getState();return e[i]}o(jw,"_getUpload2");function zw(i){let e={...this.getState().currentUploads};delete e[i],this.setState({currentUploads:e})}o(zw,"_removeUpload2");async function Hw(i){let e=o(()=>{let{currentUploads:n}=this.getState();return n[i]},"getCurrentUpload"),t=e(),r=[...J(this,Ps)[Ps],...J(this,_s)[_s],...J(this,hr)[hr]];try{for(let n=t.step||0;n{let h=this.getFile(u);h&&h.progress.postprocess&&this.emit("postprocess-complete",h)});let n=t.fileIDs.map(u=>this.getFile(u)),a=n.filter(u=>!u.error),l=n.filter(u=>u.error);this.addResultData(i,{successful:a,failed:l,uploadID:i}),t=e()}let s;return t&&(s=t.result,this.emit("complete",s),J(this,xs)[xs](i)),s==null&&this.log(`Not setting result for an upload that has been removed: ${i}`),s}o(Hw,"_runUpload2");Zl.VERSION=Tw.version;var kc=Zl;var Un,le,$m,qw,Rn,Bm,$w,eu={},Vm=[],Vw=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i;function dr(i,e){for(var t in e)i[t]=e[t];return i}o(dr,"s");function Wm(i){var e=i.parentNode;e&&e.removeChild(i)}o(Wm,"a");function c(i,e,t){var r,s,n,a={};for(n in e)n=="key"?r=e[n]:n=="ref"?s=e[n]:a[n]=e[n];if(arguments.length>2&&(a.children=arguments.length>3?Un.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(n in i.defaultProps)a[n]===void 0&&(a[n]=i.defaultProps[n]);return kn(i,a,r,s,null)}o(c,"h");function kn(i,e,t,r,s){var n={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,__h:null,constructor:void 0,__v:s??++$m};return s==null&&le.vnode!=null&&le.vnode(n),n}o(kn,"v");function Gm(){return{current:null}}o(Gm,"y");function vt(i){return i.children}o(vt,"p");function Ae(i,e){this.props=i,this.context=e}o(Ae,"d");function Lo(i,e){if(e==null)return i.__?Lo(i.__,i.__.__k.indexOf(i)+1):null;for(var t;e0?kn(w.type,w.props,w.key,null,w.__v):w)!=null){if(w.__=t,w.__b=t.__b+1,(y=_[d])===null||y&&w.key==y.key&&w.type===y.type)_[d]=void 0;else for(f=0;f2&&(a.children=arguments.length>3?Un.call(arguments,2):t),kn(i.type,a,r||i.key,s||i.ref,null)}o(ru,"q");Un=Vm.slice,le={__e:function(i,e,t,r){for(var s,n,a;e=e.__;)if((s=e.__c)&&!s.__)try{if((n=s.constructor)&&n.getDerivedStateFromError!=null&&(s.setState(n.getDerivedStateFromError(i)),a=s.__d),s.componentDidCatch!=null&&(s.componentDidCatch(i,r||{}),a=s.__d),a)return s.__E=s}catch(l){i=l}throw i}},$m=0,qw=o(function(i){return i!=null&&i.constructor===void 0},"i"),Ae.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=dr({},this.state),typeof i=="function"&&(i=i(dr({},t),this.props)),i&&dr(t,i),i!=null&&this.__v&&(e&&this.__h.push(e),jm(this))},Ae.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),jm(this))},Ae.prototype.render=vt,Rn=[],tu.__r=0,$w=0;function Dn(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}o(Dn,"isDOMElement");function Xw(i,e){return e===void 0&&(e=document),typeof i=="string"?e.querySelector(i):Dn(i)?i:null}o(Xw,"findDOMElement");var su=Xw;function Yw(i){for(var e;i&&!i.dir;)i=i.parentNode;return(e=i)==null?void 0:e.dir}o(Yw,"getTextDirection");var ou=Yw;var Ee=class{static{o(this,"BasePlugin")}constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){let{plugins:e}=this.uppy.getState();return e?.[this.id]||{}}setPluginState(e){let{plugins:t}=this.uppy.getState();this.uppy.setState({plugins:{...t,[this.id]:{...t[this.id],...e}}})}setOptions(e){this.opts={...this.opts,...e},this.setPluginState(void 0),this.i18nInit()}i18nInit(){let e=new ws([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.setPluginState(void 0)}addTarget(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(e){}afterUpdate(){}};function tg(i,e){if(!Object.prototype.hasOwnProperty.call(i,e))throw new TypeError("attempted to use private field on non-instance");return i}o(tg,"_classPrivateFieldLooseBase");var Qw=0;function Jw(i){return"__private_"+Qw+++"_"+i}o(Jw,"_classPrivateFieldLooseKey");function Zw(i){let e=null,t;return function(){for(var r=arguments.length,s=new Array(r),n=0;n(e=null,i(...t)))),e}}o(Zw,"debounce");var In=Jw("updateUI"),Ic=class i extends Ee{static{o(this,"UIPlugin")}constructor(){super(...arguments),Object.defineProperty(this,In,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof i||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:i}}));else if(typeof e=="function"){let r=e;this.uppy.iteratePlugins(s=>{s instanceof r&&(t=s)})}return t}mount(e,t){let r=t.id,s=su(e);if(s){this.isTargetDOMEl=!0;let l=document.createElement("div");return l.classList.add("uppy-Root"),tg(this,In)[In]=Zw(u=>{this.uppy.getPlugin(this.id)&&(Dc(this.render(u),l),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Dc(this.render(this.uppy.getState()),l),this.el=l,s.appendChild(l),l.dir=this.opts.direction||ou(l)||"ltr",this.onMount(),this.el}let n=this.getTargetPlugin(e);if(n)return this.uppy.log(`Installing ${r} to ${n.id}`),this.parent=n,this.el=n.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let a=`Invalid target option given to ${r}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the