uppy
Version:
Extensible JavaScript file upload widget with support for drag&drop, resumable uploads, previews, restrictions, file processing/encoding, remote providers like Instagram, Dropbox, Google Drive, S3 and more :dog:
2 lines • 589 kB
JavaScript
(()=>{var jg=Object.create;var po=Object.defineProperty;var Bg=Object.getOwnPropertyDescriptor;var zg=Object.getOwnPropertyNames;var Hg=Object.getPrototypeOf,qg=Object.prototype.hasOwnProperty;var o=(i,e)=>po(i,"name",{value:e,configurable:!0});var pe=(i,e)=>()=>(e||i((e={exports:{}}).exports,e),e.exports),ho=(i,e)=>{for(var t in e)po(i,t,{get:e[t],enumerable:!0})},Vg=(i,e,t,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of zg(e))!qg.call(i,s)&&s!==t&&po(i,s,{get:()=>e[s],enumerable:!(r=Bg(e,s))||r.enumerable});return i};var ae=(i,e,t)=>(t=i!=null?jg(Hg(i)):{},Vg(e||!i||!i.__esModule?po(t,"default",{value:i,enumerable:!0}):t,i));var Zi=pe((O5,Sc)=>{"use strict";Sc.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 Pc=pe((I5,_c)=>{"use strict";function xc(i,e){this.text=i=i||"",this.hasWild=~i.indexOf("*"),this.separator=e,this.parts=i.split(e)}o(xc,"WildcardMatcher");xc.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<s;r++)t[r]!=="*"&&(r<n.length?e=t[r]===n[r]:e=!1);e=e&&n}else if(typeof i.splice=="function")for(e=[],r=i.length;r--;)this.match(i[r])&&(e[e.length]=i[r]);else if(typeof i=="object"){e={};for(var a in i)this.match(a)&&(e[a]=i[a])}return e};_c.exports=function(i,e,t){var r=new xc(i,t||/[\/\.]/);return typeof e<"u"?r.match(e):r}});var kc=pe((M5,Ec)=>{var by=Pc(),wy=/[\/\+\.]/;Ec.exports=function(i,e){function t(r){var s=by(r,i,wy);return s&&s.length>=2}return o(t,"test"),e?t(e.split(";")[0]):t}});var Eo=pe((Y5,Ac)=>{function _y(i){var e=typeof i;return i!=null&&(e=="object"||e=="function")}o(_y,"isObject");Ac.exports=_y});var Uc=pe((Q5,Rc)=>{var Py=typeof global=="object"&&global&&global.Object===Object&&global;Rc.exports=Py});var sa=pe((Z5,Oc)=>{var Ey=Uc(),ky=typeof self=="object"&&self&&self.Object===Object&&self,Fy=Ey||ky||Function("return this")();Oc.exports=Fy});var Ic=pe((e3,Dc)=>{var Ty=sa(),Cy=o(function(){return Ty.Date.now()},"now");Dc.exports=Cy});var Mc=pe((i3,Nc)=>{var Ay=/\s/;function Ry(i){for(var e=i.length;e--&&Ay.test(i.charAt(e)););return e}o(Ry,"trimmedEndIndex");Nc.exports=Ry});var jc=pe((s3,Lc)=>{var Uy=Mc(),Oy=/^\s+/;function Dy(i){return i&&i.slice(0,Uy(i)+1).replace(Oy,"")}o(Dy,"baseTrim");Lc.exports=Dy});var oa=pe((n3,Bc)=>{var Iy=sa(),Ny=Iy.Symbol;Bc.exports=Ny});var Vc=pe((a3,qc)=>{var zc=oa(),Hc=Object.prototype,My=Hc.hasOwnProperty,Ly=Hc.toString,ns=zc?zc.toStringTag:void 0;function jy(i){var e=My.call(i,ns),t=i[ns];try{i[ns]=void 0;var r=!0}catch{}var s=Ly.call(i);return r&&(e?i[ns]=t:delete i[ns]),s}o(jy,"getRawTag");qc.exports=jy});var Wc=pe((u3,$c)=>{var By=Object.prototype,zy=By.toString;function Hy(i){return zy.call(i)}o(Hy,"objectToString");$c.exports=Hy});var Yc=pe((p3,Xc)=>{var Gc=oa(),qy=Vc(),Vy=Wc(),$y="[object Null]",Wy="[object Undefined]",Kc=Gc?Gc.toStringTag:void 0;function Gy(i){return i==null?i===void 0?Wy:$y:Kc&&Kc in Object(i)?qy(i):Vy(i)}o(Gy,"baseGetTag");Xc.exports=Gy});var Qc=pe((h3,Jc)=>{function Ky(i){return i!=null&&typeof i=="object"}o(Ky,"isObjectLike");Jc.exports=Ky});var ep=pe((m3,Zc)=>{var Xy=Yc(),Yy=Qc(),Jy="[object Symbol]";function Qy(i){return typeof i=="symbol"||Yy(i)&&Xy(i)==Jy}o(Qy,"isSymbol");Zc.exports=Qy});var sp=pe((y3,rp)=>{var Zy=jc(),tp=Eo(),ev=ep(),ip=NaN,tv=/^[-+]0x[0-9a-f]+$/i,iv=/^0b[01]+$/i,rv=/^0o[0-7]+$/i,sv=parseInt;function ov(i){if(typeof i=="number")return i;if(ev(i))return ip;if(tp(i)){var e=typeof i.valueOf=="function"?i.valueOf():i;i=tp(e)?e+"":e}if(typeof i!="string")return i===0?i:+i;i=Zy(i);var t=iv.test(i);return t||rv.test(i)?sv(i.slice(2),t?2:8):tv.test(i)?ip:+i}o(ov,"toNumber");rp.exports=ov});var ko=pe((b3,np)=>{var nv=Eo(),na=Ic(),op=sp(),av="Expected a function",lv=Math.max,uv=Math.min;function cv(i,e,t){var r,s,n,a,u,c,p=0,f=!1,d=!1,v=!0;if(typeof i!="function")throw new TypeError(av);e=op(e)||0,nv(t)&&(f=!!t.leading,d="maxWait"in t,n=d?lv(op(t.maxWait)||0,e):n,v="trailing"in t?!!t.trailing:v);function P(H){var Q=r,K=s;return r=s=void 0,p=H,a=i.apply(K,Q),a}o(P,"invokeFunc");function E(H){return p=H,u=setTimeout(R,e),f?P(H):a}o(E,"leadingEdge");function A(H){var Q=H-c,K=H-p,Z=e-Q;return d?uv(Z,n-K):Z}o(A,"remainingWait");function C(H){var Q=H-c,K=H-p;return c===void 0||Q>=e||Q<0||d&&K>=n}o(C,"shouldInvoke");function R(){var H=na();if(C(H))return U(H);u=setTimeout(R,A(H))}o(R,"timerExpired");function U(H){return u=void 0,v&&r?P(H):(r=s=void 0,a)}o(U,"trailingEdge");function F(){u!==void 0&&clearTimeout(u),p=0,r=c=s=u=void 0}o(F,"cancel");function Y(){return u===void 0?a:U(na())}o(Y,"flush");function $(){var H=na(),Q=C(H);if(r=arguments,s=this,c=H,Q){if(u===void 0)return E(c);if(d)return clearTimeout(u),u=setTimeout(R,e),P(c)}return u===void 0&&(u=setTimeout(R,e)),a}return o($,"debounced"),$.cancel=F,$.flush=Y,$}o(cv,"debounce");np.exports=cv});var aa=pe((S3,ap)=>{var pv=ko(),dv=Eo(),hv="Expected a function";function fv(i,e,t){var r=!0,s=!0;if(typeof i!="function")throw new TypeError(hv);return dv(t)&&(r="leading"in t?!!t.leading:r,s="trailing"in t?!!t.trailing:s),pv(i,e,{leading:r,maxWait:e,trailing:s})}o(fv,"throttle");ap.exports=fv});var up=pe((_3,lp)=>{lp.exports=o(function(){var e={},t=e._fns={};e.emit=o(function(a,u,c,p,f,d,v){var P=r(a);P.length&&s(a,P,[u,c,p,f,d,v])},"emit"),e.on=o(function(a,u){t[a]||(t[a]=[]),t[a].push(u)},"on"),e.once=o(function(a,u){function c(){u.apply(this,arguments),e.off(a,c)}o(c,"one"),this.on(a,c)},"once"),e.off=o(function(a,u){var c=[];if(a&&u){var p=this._fns[a],f=0,d=p?p.length:0;for(f;f<d;f++)p[f]!==u&&c.push(p[f])}c.length?this._fns[a]=c:delete this._fns[a]},"off");function r(n){var a=t[n]?t[n]:[],u=n.indexOf(":"),c=u===-1?[n]:[n.substring(0,u),n.substring(u+1)],p=Object.keys(t),f=0,d=p.length;for(f;f<d;f++){var v=p[f];if(v==="*"&&(a=a.concat(t[v])),c.length===2&&c[0]===v){a=a.concat(t[v]);break}}return a}o(r,"getListeners");function s(n,a,u){var c=0,p=a.length;for(c;c<p&&a[c];c++)a[c].event=n,a[c].apply(a[c],u)}return o(s,"emitAll"),e},"createNamespaceEmitter")});var gp=pe((Q3,mp)=>{function xt(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(xt,"RetryOperation");mp.exports=xt;xt.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};xt.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};xt.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};xt.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)};xt.prototype.try=function(i){console.log("Using RetryOperation.try() is deprecated"),this.attempt(i)};xt.prototype.start=function(i){console.log("Using RetryOperation.start() is deprecated"),this.attempt(i)};xt.prototype.start=xt.prototype.try;xt.prototype.errors=function(){return this._errors};xt.prototype.attempts=function(){return this._attempts};xt.prototype.mainError=function(){if(this._errors.length===0)return null;for(var i={},e=null,t=0,r=0;r<this._errors.length;r++){var s=this._errors[r],n=s.message,a=(i[n]||0)+1;i[n]=a,a>=t&&(e=s,t=a)}return e}});var yp=pe(Fi=>{var vv=gp();Fi.operation=function(i){var e=Fi.timeouts(i);return new vv(e,{forever:i&&(i.forever||i.retries===1/0),unref:i&&i.unref,maxRetryTime:i&&i.maxRetryTime})};Fi.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<e.retries;s++)r.push(this.createTimeout(s,e));return i&&i.forever&&!r.length&&r.push(this.createTimeout(s,e)),r.sort(function(n,a){return n-a}),r};Fi.createTimeout=function(i,e){var t=e.randomize?Math.random()+1:1,r=Math.round(t*Math.max(e.minTimeout,1)*Math.pow(e.factor,i));return r=Math.min(r,e.maxTimeout),r};Fi.wrap=function(i,e,t){if(e instanceof Array&&(t=e,e=null),!t){t=[];for(var r in i)typeof i[r]=="function"&&t.push(r)}for(var s=0;s<t.length;s++){var n=t[s],a=i[n];i[n]=o(function(c){var p=Fi.operation(e),f=Array.prototype.slice.call(arguments,1),d=f.pop();f.push(function(v){p.retry(v)||(v&&(arguments[0]=p.mainError()),d.apply(this,arguments))}),p.attempt(function(){c.apply(i,f)})},"retryWrapper").bind(i,a),i[n].options=e}}});var bp=pe((i_,vp)=>{vp.exports=yp()});var Ge=pe((Z_,No)=>{(function(){"use strict";var i={}.hasOwnProperty;function e(){for(var s="",n=0;n<arguments.length;n++){var a=arguments[n];a&&(s=r(s,t(a)))}return s}o(e,"classNames");function t(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return e.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var n="";for(var a in s)i.call(s,a)&&s[a]&&(n=r(n,a));return n}o(t,"parseValue");function r(s,n){return n?s?s+" "+n:s+n:s}o(r,"appendClass"),typeof No<"u"&&No.exports?(e.default=e,No.exports=e):typeof define=="function"&&typeof define.amd=="object"&&define.amd?define("classnames",[],function(){return e}):window.classNames=e})()});var Dp=pe(($P,wa)=>{"use strict";var Zv=Object.prototype.hasOwnProperty,nt="~";function cs(){}o(cs,"Events");Object.create&&(cs.prototype=Object.create(null),new cs().__proto__||(nt=!1));function e0(i,e,t){this.fn=i,this.context=e,this.once=t||!1}o(e0,"EE");function Op(i,e,t,r,s){if(typeof t!="function")throw new TypeError("The listener must be a function");var n=new e0(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(Op,"addListener");function qo(i,e){--i._eventsCount===0?i._events=new cs:delete i._events[e]}o(qo,"clearEvent");function st(){this._events=new cs,this._eventsCount=0}o(st,"EventEmitter");st.prototype.eventNames=o(function(){var e=[],t,r;if(this._eventsCount===0)return e;for(r in t=this._events)Zv.call(t,r)&&e.push(nt?r.slice(1):r);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(t)):e},"eventNames");st.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<n;s++)a[s]=r[s].fn;return a},"listeners");st.prototype.listenerCount=o(function(e){var t=nt?nt+e:e,r=this._events[t];return r?r.fn?1:r.length:0},"listenerCount");st.prototype.emit=o(function(e,t,r,s,n,a){var u=nt?nt+e:e;if(!this._events[u])return!1;var c=this._events[u],p=arguments.length,f,d;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),p){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,s),!0;case 5:return c.fn.call(c.context,t,r,s,n),!0;case 6:return c.fn.call(c.context,t,r,s,n,a),!0}for(d=1,f=new Array(p-1);d<p;d++)f[d-1]=arguments[d];c.fn.apply(c.context,f)}else{var v=c.length,P;for(d=0;d<v;d++)switch(c[d].once&&this.removeListener(e,c[d].fn,void 0,!0),p){case 1:c[d].fn.call(c[d].context);break;case 2:c[d].fn.call(c[d].context,t);break;case 3:c[d].fn.call(c[d].context,t,r);break;case 4:c[d].fn.call(c[d].context,t,r,s);break;default:if(!f)for(P=1,f=new Array(p-1);P<p;P++)f[P-1]=arguments[P];c[d].fn.apply(c[d].context,f)}}return!0},"emit");st.prototype.on=o(function(e,t,r){return Op(this,e,t,r,!1)},"on");st.prototype.once=o(function(e,t,r){return Op(this,e,t,r,!0)},"once");st.prototype.removeListener=o(function(e,t,r,s){var n=nt?nt+e:e;if(!this._events[n])return this;if(!t)return qo(this,n),this;var a=this._events[n];if(a.fn)a.fn===t&&(!s||a.once)&&(!r||a.context===r)&&qo(this,n);else{for(var u=0,c=[],p=a.length;u<p;u++)(a[u].fn!==t||s&&!a[u].once||r&&a[u].context!==r)&&c.push(a[u]);c.length?this._events[n]=c.length===1?c[0]:c:qo(this,n)}return this},"removeListener");st.prototype.removeAllListeners=o(function(e){var t;return e?(t=nt?nt+e:e,this._events[t]&&qo(this,t)):(this._events=new cs,this._eventsCount=0),this},"removeAllListeners");st.prototype.off=st.prototype.removeListener;st.prototype.addListener=st.prototype.on;st.prefixed=nt;st.EventEmitter=st;typeof wa<"u"&&(wa.exports=st)});var hd=pe((La,ja)=>{(function(i,e){typeof La=="object"&&typeof ja<"u"?ja.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Compressor=e())})(La,(function(){"use strict";function i(I,T){var O=Object.keys(I);if(Object.getOwnPropertySymbols){var L=Object.getOwnPropertySymbols(I);T&&(L=L.filter(function(X){return Object.getOwnPropertyDescriptor(I,X).enumerable})),O.push.apply(O,L)}return O}o(i,"ownKeys");function e(I){for(var T=1;T<arguments.length;T++){var O=arguments[T]!=null?arguments[T]:{};T%2?i(Object(O),!0).forEach(function(L){n(I,L,O[L])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(O)):i(Object(O)).forEach(function(L){Object.defineProperty(I,L,Object.getOwnPropertyDescriptor(O,L))})}return I}o(e,"_objectSpread2");function t(I,T){if(!(I instanceof T))throw new TypeError("Cannot call a class as a function")}o(t,"_classCallCheck");function r(I,T){for(var O=0;O<T.length;O++){var L=T[O];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(I,c(L.key),L)}}o(r,"_defineProperties");function s(I,T,O){return T&&r(I.prototype,T),O&&r(I,O),Object.defineProperty(I,"prototype",{writable:!1}),I}o(s,"_createClass");function n(I,T,O){return T=c(T),T in I?Object.defineProperty(I,T,{value:O,enumerable:!0,configurable:!0,writable:!0}):I[T]=O,I}o(n,"_defineProperty");function a(){return a=Object.assign?Object.assign.bind():function(I){for(var T=1;T<arguments.length;T++){var O=arguments[T];for(var L in O)Object.prototype.hasOwnProperty.call(O,L)&&(I[L]=O[L])}return I},a.apply(this,arguments)}o(a,"_extends");function u(I,T){if(typeof I!="object"||I===null)return I;var O=I[Symbol.toPrimitive];if(O!==void 0){var L=O.call(I,T||"default");if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}o(u,"_toPrimitive");function c(I){var T=u(I,"string");return typeof T=="symbol"?T:String(T)}o(c,"_toPropertyKey");var p={exports:{}};(function(I){typeof window>"u"||(function(T){var O=T.HTMLCanvasElement&&T.HTMLCanvasElement.prototype,L=T.Blob&&(function(){try{return!!new Blob}catch{return!1}})(),X=L&&T.Uint8Array&&(function(){try{return new Blob([new Uint8Array(100)]).size===100}catch{return!1}})(),J=T.BlobBuilder||T.WebKitBlobBuilder||T.MozBlobBuilder||T.MSBlobBuilder,ne=/^data:((.*?)(;charset=.*?)?)(;base64)?,/,ue=(L||J)&&T.atob&&T.ArrayBuffer&&T.Uint8Array&&function(te){var ie,_e,ke,ot,Ce,ee,et,Oe,Bt;if(ie=te.match(ne),!ie)throw new Error("invalid data URI");for(_e=ie[2]?ie[1]:"text/plain"+(ie[3]||";charset=US-ASCII"),ke=!!ie[4],ot=te.slice(ie[0].length),ke?Ce=atob(ot):Ce=decodeURIComponent(ot),ee=new ArrayBuffer(Ce.length),et=new Uint8Array(ee),Oe=0;Oe<Ce.length;Oe+=1)et[Oe]=Ce.charCodeAt(Oe);return L?new Blob([X?et:ee],{type:_e}):(Bt=new J,Bt.append(ee),Bt.getBlob(_e))};T.HTMLCanvasElement&&!O.toBlob&&(O.mozGetAsFile?O.toBlob=function(te,ie,_e){var ke=this;setTimeout(function(){_e&&O.toDataURL&&ue?te(ue(ke.toDataURL(ie,_e))):te(ke.mozGetAsFile("blob",ie))})}:O.toDataURL&&ue&&(O.msToBlob?O.toBlob=function(te,ie,_e){var ke=this;setTimeout(function(){(ie&&ie!=="image/png"||_e)&&O.toDataURL&&ue?te(ue(ke.toDataURL(ie,_e))):te(ke.msToBlob(ie))})}:O.toBlob=function(te,ie,_e){var ke=this;setTimeout(function(){te(ue(ke.toDataURL(ie,_e)))})})),I.exports?I.exports=ue:T.dataURLtoBlob=ue})(window)})(p);var f=p.exports,d=o(function(T){return typeof Blob>"u"?!1:T instanceof Blob||Object.prototype.toString.call(T)==="[object Blob]"},"isBlob"),v={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},P=typeof window<"u"&&typeof window.document<"u",E=P?window:{},A=o(function(T){return T>0&&T<1/0},"isPositiveNumber"),C=Array.prototype.slice;function R(I){return Array.from?Array.from(I):C.call(I)}o(R,"toArray");var U=/^image\/.+$/;function F(I){return U.test(I)}o(F,"isImageType");function Y(I){var T=F(I)?I.substr(6):"";return T==="jpeg"&&(T="jpg"),".".concat(T)}o(Y,"imageTypeToExtension");var $=String.fromCharCode;function H(I,T,O){var L="",X;for(O+=T,X=T;X<O;X+=1)L+=$(I.getUint8(X));return L}o(H,"getStringFromCharCode");var Q=E.btoa;function K(I,T){for(var O=[],L=8192,X=new Uint8Array(I);X.length>0;)O.push($.apply(null,R(X.subarray(0,L)))),X=X.subarray(L);return"data:".concat(T,";base64,").concat(Q(O.join("")))}o(K,"arrayBufferToDataURL");function Z(I){var T=new DataView(I),O;try{var L,X,J;if(T.getUint8(0)===255&&T.getUint8(1)===216)for(var ne=T.byteLength,ue=2;ue+1<ne;){if(T.getUint8(ue)===255&&T.getUint8(ue+1)===225){X=ue;break}ue+=1}if(X){var te=X+4,ie=X+10;if(H(T,te,4)==="Exif"){var _e=T.getUint16(ie);if(L=_e===18761,(L||_e===19789)&&T.getUint16(ie+2,L)===42){var ke=T.getUint32(ie+4,L);ke>=8&&(J=ie+ke)}}}if(J){var ot=T.getUint16(J,L),Ce,ee;for(ee=0;ee<ot;ee+=1)if(Ce=J+ee*12+2,T.getUint16(Ce,L)===274){Ce+=8,O=T.getUint16(Ce,L),T.setUint16(Ce,1,L);break}}}catch{O=1}return O}o(Z,"resetAndGetOrientation");function ye(I){var T=0,O=1,L=1;switch(I){case 2:O=-1;break;case 3:T=-180;break;case 4:L=-1;break;case 5:T=90,L=-1;break;case 6:T=90;break;case 7:T=90,O=-1;break;case 8:T=-90;break}return{rotate:T,scaleX:O,scaleY:L}}o(ye,"parseOrientation");var se=/\.\d*(?:0|9){12}\d*$/;function be(I){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return se.test(I)?Math.round(I*T)/T:I}o(be,"normalizeDecimalNumber");function me(I){var T=I.aspectRatio,O=I.height,L=I.width,X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"none",J=A(L),ne=A(O);if(J&&ne){var ue=O*T;(X==="contain"||X==="none")&&ue>L||X==="cover"&&ue<L?O=L/T:L=O*T}else J?O=L/T:ne&&(L=O*T);return{width:L,height:O}}o(me,"getAdjustedSizes");function Pe(I){for(var T=R(new Uint8Array(I)),O=T.length,L=[],X=0;X+3<O;){var J=T[X],ne=T[X+1];if(J===255&&ne===218)break;if(J===255&&ne===216)X+=2;else{var ue=T[X+2]*256+T[X+3],te=X+ue+2,ie=T.slice(X,te);L.push(ie),X=te}}return L.reduce(function(_e,ke){return ke[0]===255&&ke[1]===225?_e.concat(ke):_e},[])}o(Pe,"getExif");function ve(I,T){var O=R(new Uint8Array(I));if(O[2]!==255||O[3]!==224)return I;var L=O[4]*256+O[5],X=[255,216].concat(T,O.slice(4+L));return new Uint8Array(X)}o(ve,"insertExif");var k=E.ArrayBuffer,w=E.FileReader,S=E.URL||E.webkitURL,j=/\.\w+$/,q=E.Compressor,B=(function(){function I(T,O){t(this,I),this.file=T,this.exif=[],this.image=new Image,this.options=e(e({},v),O),this.aborted=!1,this.result=null,this.init()}return o(I,"Compressor"),s(I,[{key:"init",value:o(function(){var O=this,L=this.file,X=this.options;if(!d(L)){this.fail(new Error("The first argument must be a File or Blob object."));return}var J=L.type;if(!F(J)){this.fail(new Error("The first argument must be an image File or Blob object."));return}if(!S||!w){this.fail(new Error("The current browser does not support image compression."));return}k||(X.checkOrientation=!1,X.retainExif=!1);var ne=J==="image/jpeg",ue=ne&&X.checkOrientation,te=ne&&X.retainExif;if(S&&!ue&&!te)this.load({url:S.createObjectURL(L)});else{var ie=new w;this.reader=ie,ie.onload=function(_e){var ke=_e.target,ot=ke.result,Ce={},ee=1;ue&&(ee=Z(ot),ee>1&&a(Ce,ye(ee))),te&&(O.exif=Pe(ot)),ue||te?!S||ee>1?Ce.url=K(ot,J):Ce.url=S.createObjectURL(L):Ce.url=ot,O.load(Ce)},ie.onabort=function(){O.fail(new Error("Aborted to read the image with FileReader."))},ie.onerror=function(){O.fail(new Error("Failed to read the image with FileReader."))},ie.onloadend=function(){O.reader=null},ue||te?ie.readAsArrayBuffer(L):ie.readAsDataURL(L)}},"init")},{key:"load",value:o(function(O){var L=this,X=this.file,J=this.image;J.onload=function(){L.draw(e(e({},O),{},{naturalWidth:J.naturalWidth,naturalHeight:J.naturalHeight}))},J.onabort=function(){L.fail(new Error("Aborted to load the image."))},J.onerror=function(){L.fail(new Error("Failed to load the image."))},E.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(E.navigator.userAgent)&&(J.crossOrigin="anonymous"),J.alt=X.name,J.src=O.url},"load")},{key:"draw",value:o(function(O){var L=this,X=O.naturalWidth,J=O.naturalHeight,ne=O.rotate,ue=ne===void 0?0:ne,te=O.scaleX,ie=te===void 0?1:te,_e=O.scaleY,ke=_e===void 0?1:_e,ot=this.file,Ce=this.image,ee=this.options,et=document.createElement("canvas"),Oe=et.getContext("2d"),Bt=Math.abs(ue)%180===90,Bi=(ee.resize==="contain"||ee.resize==="cover")&&A(ee.width)&&A(ee.height),$t=Math.max(ee.maxWidth,0)||1/0,zt=Math.max(ee.maxHeight,0)||1/0,Wt=Math.max(ee.minWidth,0)||0,mi=Math.max(ee.minHeight,0)||0,Gt=X/J,Ve=ee.width,$e=ee.height;if(Bt){var Ur=[zt,$t];$t=Ur[0],zt=Ur[1];var Or=[mi,Wt];Wt=Or[0],mi=Or[1];var Dr=[$e,Ve];Ve=Dr[0],$e=Dr[1]}Bi&&(Gt=Ve/$e);var oo=me({aspectRatio:Gt,width:$t,height:zt},"contain");$t=oo.width,zt=oo.height;var no=me({aspectRatio:Gt,width:Wt,height:mi},"cover");if(Wt=no.width,mi=no.height,Bi){var oe=me({aspectRatio:Gt,width:Ve,height:$e},ee.resize);Ve=oe.width,$e=oe.height}else{var Ir=me({aspectRatio:Gt,width:Ve,height:$e}),zi=Ir.width;Ve=zi===void 0?X:zi;var Ft=Ir.height;$e=Ft===void 0?J:Ft}Ve=Math.floor(be(Math.min(Math.max(Ve,Wt),$t))),$e=Math.floor(be(Math.min(Math.max($e,mi),zt)));var Tn=-Ve/2,Kt=-$e/2,tt=Ve,Cn=$e,Hi=[];if(Bi){var Fe=0,we=0,Nr=X,Tt=J,ao=me({aspectRatio:Gt,width:X,height:J},{contain:"cover",cover:"contain"}[ee.resize]);Nr=ao.width,Tt=ao.height,Fe=(X-Nr)/2,we=(J-Tt)/2,Hi.push(Fe,we,Nr,Tt)}if(Hi.push(Tn,Kt,tt,Cn),Bt){var _t=[$e,Ve];Ve=_t[0],$e=_t[1]}et.width=Ve,et.height=$e,F(ee.mimeType)||(ee.mimeType=ot.type);var lo="transparent";ot.size>ee.convertSize&&ee.convertTypes.indexOf(ee.mimeType)>=0&&(ee.mimeType="image/jpeg");var Ae=ee.mimeType==="image/jpeg";if(Ae&&(lo="#fff"),Oe.fillStyle=lo,Oe.fillRect(0,0,Ve,$e),ee.beforeDraw&&ee.beforeDraw.call(this,Oe,et),!this.aborted&&(Oe.save(),Oe.translate(Ve/2,$e/2),Oe.rotate(ue*Math.PI/180),Oe.scale(ie,ke),Oe.drawImage.apply(Oe,[Ce].concat(Hi)),Oe.restore(),ee.drew&&ee.drew.call(this,Oe,et),!this.aborted)){var dt=o(function(yi){if(!L.aborted){var qi=o(function(Xt){return L.done({naturalWidth:X,naturalHeight:J,result:Xt})},"done");if(yi&&Ae&&ee.retainExif&&L.exif&&L.exif.length>0){var Vi=o(function(Xt){return qi(f(K(ve(Xt,L.exif),ee.mimeType)))},"next");if(yi.arrayBuffer)yi.arrayBuffer().then(Vi).catch(function(){L.fail(new Error("Failed to read the compressed image with Blob.arrayBuffer()."))});else{var yt=new w;L.reader=yt,yt.onload=function(Mr){var Xt=Mr.target;Vi(Xt.result)},yt.onabort=function(){L.fail(new Error("Aborted to read the compressed image with FileReader."))},yt.onerror=function(){L.fail(new Error("Failed to read the compressed image with FileReader."))},yt.onloadend=function(){L.reader=null},yt.readAsArrayBuffer(yi)}}else qi(yi)}},"callback");et.toBlob?et.toBlob(dt,ee.mimeType,ee.quality):dt(f(et.toDataURL(ee.mimeType,ee.quality)))}},"draw")},{key:"done",value:o(function(O){var L=O.naturalWidth,X=O.naturalHeight,J=O.result,ne=this.file,ue=this.image,te=this.options;if(S&&ue.src.indexOf("blob:")===0&&S.revokeObjectURL(ue.src),J)if(te.strict&&!te.retainExif&&J.size>ne.size&&te.mimeType===ne.type&&!(te.width>L||te.height>X||te.minWidth>L||te.minHeight>X||te.maxWidth<L||te.maxHeight<X))J=ne;else{var ie=new Date;J.lastModified=ie.getTime(),J.lastModifiedDate=ie,J.name=ne.name,J.name&&J.type!==ne.type&&(J.name=J.name.replace(j,Y(J.type)))}else J=ne;this.result=J,te.success&&te.success.call(this,J)},"done")},{key:"fail",value:o(function(O){var L=this.options;if(L.error)L.error.call(this,O);else throw O},"fail")},{key:"abort",value:o(function(){this.aborted||(this.aborted=!0,this.reader?this.reader.abort():this.image.complete?this.fail(new Error("The compression process has been aborted.")):(this.image.onload=null,this.image.onabort()))},"abort")}],[{key:"noConflict",value:o(function(){return window.Compressor=q,I},"noConflict")},{key:"setDefaults",value:o(function(O){a(v,O)},"setDefaults")}]),I})();return B}))});var Kh=pe((Pl,El)=>{(function(i,e){typeof Pl=="object"&&typeof El<"u"?El.exports=e():typeof define=="function"&&define.amd?define(e):(i=typeof globalThis<"u"?globalThis:i||self,i.Cropper=e())})(Pl,(function(){"use strict";function i(y,h){var g=Object.keys(y);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(y);h&&(m=m.filter(function(_){return Object.getOwnPropertyDescriptor(y,_).enumerable})),g.push.apply(g,m)}return g}o(i,"ownKeys");function e(y){for(var h=1;h<arguments.length;h++){var g=arguments[h]!=null?arguments[h]:{};h%2?i(Object(g),!0).forEach(function(m){c(y,m,g[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(y,Object.getOwnPropertyDescriptors(g)):i(Object(g)).forEach(function(m){Object.defineProperty(y,m,Object.getOwnPropertyDescriptor(g,m))})}return y}o(e,"_objectSpread2");function t(y,h){if(typeof y!="object"||!y)return y;var g=y[Symbol.toPrimitive];if(g!==void 0){var m=g.call(y,h||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(y)}o(t,"_toPrimitive");function r(y){var h=t(y,"string");return typeof h=="symbol"?h:h+""}o(r,"_toPropertyKey");function s(y){"@babel/helpers - typeof";return s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(h){return typeof h}:function(h){return h&&typeof Symbol=="function"&&h.constructor===Symbol&&h!==Symbol.prototype?"symbol":typeof h},s(y)}o(s,"_typeof");function n(y,h){if(!(y instanceof h))throw new TypeError("Cannot call a class as a function")}o(n,"_classCallCheck");function a(y,h){for(var g=0;g<h.length;g++){var m=h[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(y,r(m.key),m)}}o(a,"_defineProperties");function u(y,h,g){return h&&a(y.prototype,h),g&&a(y,g),Object.defineProperty(y,"prototype",{writable:!1}),y}o(u,"_createClass");function c(y,h,g){return h=r(h),h in y?Object.defineProperty(y,h,{value:g,enumerable:!0,configurable:!0,writable:!0}):y[h]=g,y}o(c,"_defineProperty");function p(y){return f(y)||d(y)||v(y)||E()}o(p,"_toConsumableArray");function f(y){if(Array.isArray(y))return P(y)}o(f,"_arrayWithoutHoles");function d(y){if(typeof Symbol<"u"&&y[Symbol.iterator]!=null||y["@@iterator"]!=null)return Array.from(y)}o(d,"_iterableToArray");function v(y,h){if(y){if(typeof y=="string")return P(y,h);var g=Object.prototype.toString.call(y).slice(8,-1);if(g==="Object"&&y.constructor&&(g=y.constructor.name),g==="Map"||g==="Set")return Array.from(y);if(g==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(g))return P(y,h)}}o(v,"_unsupportedIterableToArray");function P(y,h){(h==null||h>y.length)&&(h=y.length);for(var g=0,m=new Array(h);g<h;g++)m[g]=y[g];return m}o(P,"_arrayLikeToArray");function E(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}o(E,"_nonIterableSpread");var A=typeof window<"u"&&typeof window.document<"u",C=A?window:{},R=A&&C.document.documentElement?"ontouchstart"in C.document.documentElement:!1,U=A?"PointerEvent"in C:!1,F="cropper",Y="all",$="crop",H="move",Q="zoom",K="e",Z="w",ye="s",se="n",be="ne",me="nw",Pe="se",ve="sw",k="".concat(F,"-crop"),w="".concat(F,"-disabled"),S="".concat(F,"-hidden"),j="".concat(F,"-hide"),q="".concat(F,"-invisible"),B="".concat(F,"-modal"),I="".concat(F,"-move"),T="".concat(F,"Action"),O="".concat(F,"Preview"),L="crop",X="move",J="none",ne="crop",ue="cropend",te="cropmove",ie="cropstart",_e="dblclick",ke=R?"touchstart":"mousedown",ot=R?"touchmove":"mousemove",Ce=R?"touchend touchcancel":"mouseup",ee=U?"pointerdown":ke,et=U?"pointermove":ot,Oe=U?"pointerup pointercancel":Ce,Bt="ready",Bi="resize",$t="wheel",zt="zoom",Wt="image/jpeg",mi=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Gt=/^data:/,Ve=/^data:image\/jpeg;base64,/,$e=/^img|canvas$/i,Ur=200,Or=100,Dr={viewMode:0,dragMode:L,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Ur,minContainerHeight:Or,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},oo='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',no=Number.isNaN||C.isNaN;function oe(y){return typeof y=="number"&&!no(y)}o(oe,"isNumber");var Ir=o(function(h){return h>0&&h<1/0},"isPositiveNumber");function zi(y){return typeof y>"u"}o(zi,"isUndefined");function Ft(y){return s(y)==="object"&&y!==null}o(Ft,"isObject");var Tn=Object.prototype.hasOwnProperty;function Kt(y){if(!Ft(y))return!1;try{var h=y.constructor,g=h.prototype;return h&&g&&Tn.call(g,"isPrototypeOf")}catch{return!1}}o(Kt,"isPlainObject");function tt(y){return typeof y=="function"}o(tt,"isFunction");var Cn=Array.prototype.slice;function Hi(y){return Array.from?Array.from(y):Cn.call(y)}o(Hi,"toArray");function Fe(y,h){return y&&tt(h)&&(Array.isArray(y)||oe(y.length)?Hi(y).forEach(function(g,m){h.call(y,g,m,y)}):Ft(y)&&Object.keys(y).forEach(function(g){h.call(y,y[g],g,y)})),y}o(Fe,"forEach");var we=Object.assign||o(function(h){for(var g=arguments.length,m=new Array(g>1?g-1:0),_=1;_<g;_++)m[_-1]=arguments[_];return Ft(h)&&m.length>0&&m.forEach(function(b){Ft(b)&&Object.keys(b).forEach(function(x){h[x]=b[x]})}),h},"assign"),Nr=/\.\d*(?:0|9){12}\d*$/;function Tt(y){var h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return Nr.test(y)?Math.round(y*h)/h:y}o(Tt,"normalizeDecimalNumber");var ao=/^width|height|left|top|marginLeft|marginTop$/;function _t(y,h){var g=y.style;Fe(h,function(m,_){ao.test(_)&&oe(m)&&(m="".concat(m,"px")),g[_]=m})}o(_t,"setStyle");function lo(y,h){return y.classList?y.classList.contains(h):y.className.indexOf(h)>-1}o(lo,"hasClass");function Ae(y,h){if(h){if(oe(y.length)){Fe(y,function(m){Ae(m,h)});return}if(y.classList){y.classList.add(h);return}var g=y.className.trim();g?g.indexOf(h)<0&&(y.className="".concat(g," ").concat(h)):y.className=h}}o(Ae,"addClass");function dt(y,h){if(h){if(oe(y.length)){Fe(y,function(g){dt(g,h)});return}if(y.classList){y.classList.remove(h);return}y.className.indexOf(h)>=0&&(y.className=y.className.replace(h,""))}}o(dt,"removeClass");function gi(y,h,g){if(h){if(oe(y.length)){Fe(y,function(m){gi(m,h,g)});return}g?Ae(y,h):dt(y,h)}}o(gi,"toggleClass");var yi=/([a-z\d])([A-Z])/g;function qi(y){return y.replace(yi,"$1-$2").toLowerCase()}o(qi,"toParamCase");function Vi(y,h){return Ft(y[h])?y[h]:y.dataset?y.dataset[h]:y.getAttribute("data-".concat(qi(h)))}o(Vi,"getData");function yt(y,h,g){Ft(g)?y[h]=g:y.dataset?y.dataset[h]=g:y.setAttribute("data-".concat(qi(h)),g)}o(yt,"setData");function Mr(y,h){if(Ft(y[h]))try{delete y[h]}catch{y[h]=void 0}else if(y.dataset)try{delete y.dataset[h]}catch{y.dataset[h]=void 0}else y.removeAttribute("data-".concat(qi(h)))}o(Mr,"removeData");var Xt=/\s\s*/,Ru=(function(){var y=!1;if(A){var h=!1,g=o(function(){},"listener"),m=Object.defineProperty({},"once",{get:o(function(){return y=!0,h},"get"),set:o(function(b){h=b},"set")});C.addEventListener("test",g,m),C.removeEventListener("test",g,m)}return y})();function Pt(y,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=g;h.trim().split(Xt).forEach(function(b){if(!Ru){var x=y.listeners;x&&x[b]&&x[b][g]&&(_=x[b][g],delete x[b][g],Object.keys(x[b]).length===0&&delete x[b],Object.keys(x).length===0&&delete y.listeners)}y.removeEventListener(b,_,m)})}o(Pt,"removeListener");function vt(y,h,g){var m=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},_=g;h.trim().split(Xt).forEach(function(b){if(m.once&&!Ru){var x=y.listeners,D=x===void 0?{}:x;_=o(function(){delete D[b][g],y.removeEventListener(b,_,m);for(var z=arguments.length,N=new Array(z),M=0;M<z;M++)N[M]=arguments[M];g.apply(y,N)},"handler"),D[b]||(D[b]={}),D[b][g]&&y.removeEventListener(b,D[b][g],m),D[b][g]=_,y.listeners=D}y.addEventListener(b,_,m)})}o(vt,"addListener");function $i(y,h,g){var m;return tt(Event)&&tt(CustomEvent)?m=new CustomEvent(h,{detail:g,bubbles:!0,cancelable:!0}):(m=document.createEvent("CustomEvent"),m.initCustomEvent(h,!0,!0,g)),y.dispatchEvent(m)}o($i,"dispatchEvent");function Uu(y){var h=y.getBoundingClientRect();return{left:h.left+(window.pageXOffset-document.documentElement.clientLeft),top:h.top+(window.pageYOffset-document.documentElement.clientTop)}}o(Uu,"getOffset");var An=C.location,bg=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Ou(y){var h=y.match(bg);return h!==null&&(h[1]!==An.protocol||h[2]!==An.hostname||h[3]!==An.port)}o(Ou,"isCrossOriginURL");function Du(y){var h="timestamp=".concat(new Date().getTime());return y+(y.indexOf("?")===-1?"?":"&")+h}o(Du,"addTimestamp");function Lr(y){var h=y.rotate,g=y.scaleX,m=y.scaleY,_=y.translateX,b=y.translateY,x=[];oe(_)&&_!==0&&x.push("translateX(".concat(_,"px)")),oe(b)&&b!==0&&x.push("translateY(".concat(b,"px)")),oe(h)&&h!==0&&x.push("rotate(".concat(h,"deg)")),oe(g)&&g!==1&&x.push("scaleX(".concat(g,")")),oe(m)&&m!==1&&x.push("scaleY(".concat(m,")"));var D=x.length?x.join(" "):"none";return{WebkitTransform:D,msTransform:D,transform:D}}o(Lr,"getTransforms");function wg(y){var h=e({},y),g=0;return Fe(y,function(m,_){delete h[_],Fe(h,function(b){var x=Math.abs(m.startX-b.startX),D=Math.abs(m.startY-b.startY),W=Math.abs(m.endX-b.endX),z=Math.abs(m.endY-b.endY),N=Math.sqrt(x*x+D*D),M=Math.sqrt(W*W+z*z),V=(M-N)/N;Math.abs(V)>Math.abs(g)&&(g=V)})}),g}o(wg,"getMaxZoomRatio");function uo(y,h){var g=y.pageX,m=y.pageY,_={endX:g,endY:m};return h?_:e({startX:g,startY:m},_)}o(uo,"getPointer");function Sg(y){var h=0,g=0,m=0;return Fe(y,function(_){var b=_.startX,x=_.startY;h+=b,g+=x,m+=1}),h/=m,g/=m,{pageX:h,pageY:g}}o(Sg,"getPointersCenter");function Yt(y){var h=y.aspectRatio,g=y.height,m=y.width,_=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",b=Ir(m),x=Ir(g);if(b&&x){var D=g*h;_==="contain"&&D>m||_==="cover"&&D<m?g=m/h:m=g*h}else b?g=m/h:x&&(m=g*h);return{width:m,height:g}}o(Yt,"getAdjustedSizes");function xg(y){var h=y.width,g=y.height,m=y.degree;if(m=Math.abs(m)%180,m===90)return{width:g,height:h};var _=m%90*Math.PI/180,b=Math.sin(_),x=Math.cos(_),D=h*x+g*b,W=h*b+g*x;return m>90?{width:W,height:D}:{width:D,height:W}}o(xg,"getRotatedSizes");function _g(y,h,g,m){var _=h.aspectRatio,b=h.naturalWidth,x=h.naturalHeight,D=h.rotate,W=D===void 0?0:D,z=h.scaleX,N=z===void 0?1:z,M=h.scaleY,V=M===void 0?1:M,ce=g.aspectRatio,le=g.naturalWidth,Ee=g.naturalHeight,de=m.fillColor,Le=de===void 0?"transparent":de,We=m.imageSmoothingEnabled,De=We===void 0?!0:We,Ht=m.imageSmoothingQuality,ht=Ht===void 0?"low":Ht,G=m.maxWidth,he=G===void 0?1/0:G,je=m.maxHeight,bt=je===void 0?1/0:je,qt=m.minWidth,vi=qt===void 0?0:qt,bi=m.minHeight,Jt=bi===void 0?0:bi,Ct=document.createElement("canvas"),lt=Ct.getContext("2d"),wi=Yt({aspectRatio:ce,width:he,height:bt}),co=Yt({aspectRatio:ce,width:vi,height:Jt},"cover"),Rn=Math.min(wi.width,Math.max(co.width,le)),Un=Math.min(wi.height,Math.max(co.height,Ee)),Mu=Yt({aspectRatio:_,width:he,height:bt}),Lu=Yt({aspectRatio:_,width:vi,height:Jt},"cover"),ju=Math.min(Mu.width,Math.max(Lu.width,b)),Bu=Math.min(Mu.height,Math.max(Lu.height,x)),Mg=[-ju/2,-Bu/2,ju,Bu];return Ct.width=Tt(Rn),Ct.height=Tt(Un),lt.fillStyle=Le,lt.fillRect(0,0,Rn,Un),lt.save(),lt.translate(Rn/2,Un/2),lt.rotate(W*Math.PI/180),lt.scale(N,V),lt.imageSmoothingEnabled=De,lt.imageSmoothingQuality=ht,lt.drawImage.apply(lt,[y].concat(p(Mg.map(function(Lg){return Math.floor(Tt(Lg))})))),lt.restore(),Ct}o(_g,"getSourceCanvas");var Iu=String.fromCharCode;function Pg(y,h,g){var m="";g+=h;for(var _=h;_<g;_+=1)m+=Iu(y.getUint8(_));return m}o(Pg,"getStringFromCharCode");var Eg=/^data:.*,/;function kg(y){var h=y.replace(Eg,""),g=atob(h),m=new ArrayBuffer(g.length),_=new Uint8Array(m);return Fe(_,function(b,x){_[x]=g.charCodeAt(x)}),m}o(kg,"dataURLToArrayBuffer");function Fg(y,h){for(var g=[],m=8192,_=new Uint8Array(y);_.length>0;)g.push(Iu.apply(null,Hi(_.subarray(0,m)))),_=_.subarray(m);return"data:".concat(h,";base64,").concat(btoa(g.join("")))}o(Fg,"arrayBufferToDataURL");function Tg(y){var h=new DataView(y),g;try{var m,_,b;if(h.getUint8(0)===255&&h.getUint8(1)===216)for(var x=h.byteLength,D=2;D+1<x;){if(h.getUint8(D)===255&&h.getUint8(D+1)===225){_=D;break}D+=1}if(_){var W=_+4,z=_+10;if(Pg(h,W,4)==="Exif"){var N=h.getUint16(z);if(m=N===18761,(m||N===19789)&&h.getUint16(z+2,m)===42){var M=h.getUint32(z+4,m);M>=8&&(b=z+M)}}}if(b){var V=h.getUint16(b,m),ce,le;for(le=0;le<V;le+=1)if(ce=b+le*12+2,h.getUint16(ce,m)===274){ce+=8,g=h.getUint16(ce,m),h.setUint16(ce,1,m);break}}}catch{g=1}return g}o(Tg,"resetAndGetOrientation");function Cg(y){var h=0,g=1,m=1;switch(y){case 2:g=-1;break;case 3:h=-180;break;case 4:m=-1;break;case 5:h=90,m=-1;break;case 6:h=90;break;case 7:h=90,g=-1;break;case 8:h=-90;break}return{rotate:h,scaleX:g,scaleY:m}}o(Cg,"parseOrientation");var Ag={render:o(function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},"render"),initContainer:o(function(){var h=this.element,g=this.options,m=this.container,_=this.cropper,b=Number(g.minContainerWidth),x=Number(g.minContainerHeight);Ae(_,S),dt(h,S);var D={width:Math.max(m.offsetWidth,b>=0?b:Ur),height:Math.max(m.offsetHeight,x>=0?x:Or)};this.containerData=D,_t(_,{width:D.width,height:D.height}),Ae(h,S),dt(_,S)},"initContainer"),initCanvas:o(function(){var h=this.containerData,g=this.imageData,m=this.options.viewMode,_=Math.abs(g.rotate)%180===90,b=_?g.naturalHeight:g.naturalWidth,x=_?g.naturalWidth:g.naturalHeight,D=b/x,W=h.width,z=h.height;h.height*D>h.width?m===3?W=h.height*D:z=h.width/D:m===3?z=h.width/D:W=h.height*D;var N={aspectRatio:D,naturalWidth:b,naturalHeight:x,width:W,height:z};this.canvasData=N,this.limited=m===1||m===2,this.limitCanvas(!0,!0),N.width=Math.min(Math.max(N.width,N.minWidth),N.maxWidth),N.height=Math.min(Math.max(N.height,N.minHeight),N.maxHeight),N.left=(h.width-N.width)/2,N.top=(h.height-N.height)/2,N.oldLeft=N.left,N.oldTop=N.top,this.initialCanvasData=we({},N)},"initCanvas"),limitCanvas:o(function(h,g){var m=this.options,_=this.containerData,b=this.canvasData,x=this.cropBoxData,D=m.viewMode,W=b.aspectRatio,z=this.cropped&&x;if(h){var N=Number(m.minCanvasWidth)||0,M=Number(m.minCanvasHeight)||0;D>1?(N=Math.max(N,_.width),M=Math.max(M,_.height),D===3&&(M*W>N?N=M*W:M=N/W)):D>0&&(N?N=Math.max(N,z?x.width:0):M?M=Math.max(M,z?x.height:0):z&&(N=x.width,M=x.height,M*W>N?N=M*W:M=N/W));var V=Yt({aspectRatio:W,width:N,height:M});N=V.width,M=V.height,b.minWidth=N,b.minHeight=M,b.maxWidth=1/0,b.maxHeight=1/0}if(g)if(D>(z?0:1)){var ce=_.width-b.width,le=_.height-b.height;b.minLeft=Math.min(0,ce),b.minTop=Math.min(0,le),b.maxLeft=Math.max(0,ce),b.maxTop=Math.max(0,le),z&&this.limited&&(b.minLeft=Math.min(x.left,x.left+(x.width-b.width)),b.minTop=Math.min(x.top,x.top+(x.height-b.height)),b.maxLeft=x.left,b.maxTop=x.top,D===2&&(b.width>=_.width&&(b.minLeft=Math.min(0,ce),b.maxLeft=Math.max(0,ce)),b.height>=_.height&&(b.minTop=Math.min(0,le),b.maxTop=Math.max(0,le))))}else b.minLeft=-b.width,b.minTop=-b.height,b.maxLeft=_.width,b.maxTop=_.height},"limitCanvas"),renderCanvas:o(function(h,g){var m=this.canvasData,_=this.imageData;if(g){var b=xg({width:_.naturalWidth*Math.abs(_.scaleX||1),height:_.naturalHeight*Math.abs(_.scaleY||1),degree:_.rotate||0}),x=b.width,D=b.height,W=m.width*(x/m.naturalWidth),z=m.height*(D/m.naturalHeight);m.left-=(W-m.width)/2,m.top-=(z-m.height)/2,m.width=W,m.height=z,m.aspectRatio=x/D,m.naturalWidth=x,m.naturalHeight=D,this.limitCanvas(!0,!1)}(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCanvas(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,_t(this.canvas,we({width:m.width,height:m.height},Lr({translateX:m.left,translateY:m.top}))),this.renderImage(h),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},"renderCanvas"),renderImage:o(function(h){var g=this.canvasData,m=this.imageData,_=m.naturalWidth*(g.width/g.naturalWidth),b=m.naturalHeight*(g.height/g.naturalHeight);we(m,{width:_,height:b,left:(g.width-_)/2,top:(g.height-b)/2}),_t(this.image,we({width:m.width,height:m.height},Lr(we({translateX:m.left,translateY:m.top},m)))),h&&this.output()},"renderImage"),initCropBox:o(function(){var h=this.options,g=this.canvasData,m=h.aspectRatio||h.initialAspectRatio,_=Number(h.autoCropArea)||.8,b={width:g.width,height:g.height};m&&(g.height*m>g.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*_),b.height=Math.max(b.minHeight,b.height*_),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=we({},b)},"initCropBox"),limitCropBox:o(function(h,g){var m=this.options,_=this.containerData,b=this.canvasData,x=this.cropBoxData,D=this.limited,W=m.aspectRatio;if(h){var z=Number(m.minCropBoxWidth)||0,N=Number(m.minCropBoxHeight)||0,M=D?Math.min(_.width,b.width,b.width+b.left,_.width-b.left):_.width,V=D?Math.min(_.height,b.height,b.height+b.top,_.height-b.top):_.height;z=Math.min(z,_.width),N=Math.min(N,_.height),W&&(z&&N?N*W>z?N=z/W:z=N*W:z?N=z/W:N&&(z=N*W),V*W>M?V=M/W:M=V*W),x.minWidth=Math.min(z,M),x.minHeight=Math.min(N,V),x.maxWidth=M,x.maxHeight=V}g&&(D?(x.minLeft=Math.max(0,b.left),x.minTop=Math.max(0,b.top),x.maxLeft=Math.min(_.width,b.left+b.width)-x.width,x.maxTop=Math.min(_.height,b.top+b.height)-x.height):(x.minLeft=0,x.minTop=0,x.maxLeft=_.width-x.width,x.maxTop=_.height-x.height))},"limitCropBox"),renderCropBox:o(function(){var h=this.options,g=this.containerData,m=this.cropBoxData;(m.width>m.maxWidth||m.width<m.minWidth)&&(m.left=m.oldLeft),(m.height>m.maxHeight||m.height<m.minHeight)&&(m.top=m.oldTop),m.width=Math.min(Math.max(m.width,m.minWidth),m.maxWidth),m.height=Math.min(Math.max(m.height,m.minHeight),m.maxHeight),this.limitCropBox(!1,!0),m.left=Math.min(Math.max(m.left,m.minLeft),m.maxLeft),m.top=Math.min(Math.max(m.top,m.minTop),m.maxTop),m.oldLeft=m.left,m.oldTop=m.top,h.movable&&h.cropBoxMovable&&yt(this.face,T,m.width>=g.width&&m.height>=g.height?H:Y),_t(this.cropBox,we({width:m.width,height:m.height},Lr({translateX:m.left,translateY:m.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},"renderCropBox"),output:o(function(){this.preview(),$i(this.element,ne,this.getData())},"output")},Rg={initPreview:o(function(){var h=this.element,g=this.crossOrigin,m=this.options.preview,_=g?this.crossOriginUrl:this.url,b=h.alt||"The image to preview",x=document.createElement("img");if(g&&(x.crossOrigin=g),x.src=_,x.alt=b,this.viewBox.appendChild(x),this.viewBoxImage=x,!!m){var D=m;typeof m=="string"?D=h.ownerDocument.querySelectorAll(m):m.querySelector&&(D=[m]),this.previews=D,Fe(D,function(W){var z=document.createElement("img");yt(W,O,{width:W.offsetWidth,height:W.offsetHeight,html:W.innerHTML}),g&&(z.crossOrigin=g),z.src=_,z.alt=b,z.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;"',W.innerHTML="",W.appendChild(z)})}},"initPreview"),resetPreview:o(function(){Fe(this.previews,function(h){var g=Vi(h,O);_t(h,{width:g.width,height:g.height}),h.innerHTML=g.html,Mr(h,O)})},"resetPreview"),preview:o(function(){var h=this.imageData,g=this.canvasData,m=this.cropBoxData,_=m.width,b=m.height,x=h.width,D=h.height,W=m.left-g.left-h.left,z=m.top-g.top-h.top;!this.cropped||this.disabled||(_t(this.viewBoxImage,we({width:x,height:D},Lr(we({translateX:-W,translateY:-z},h)))),Fe(this.previews,function(N){var M=Vi(N,O),V=M.width,ce=M.height,le=V,Ee=ce,de=1;_&&(de=V/_,Ee=b*de),b&&Ee>ce&&(de=ce/b,le=_*de,Ee=ce),_t(N,{width:le,height:Ee}),_t(N.getElementsByTagName("img")[0],we({width:x*de,height:D*de},Lr(we({translateX:-W*de,translateY:-z*de},h))))}))},"preview")},Ug={bind:o(function(){var h=this.element,g=this.options,m=this.cropper;tt(g.cropstart)&&vt(h,ie,g.cropstart),tt(g.cropmove)&&vt(h,te,g.cropmove),tt(g.cropend)&&vt(h,ue,g.cropend),tt(g.crop)&&vt(h,ne,g.crop),tt(g.zoom)&&vt(h,zt,g.zoom),vt(m,ee,this.onCropStart=this.cropStart.bind(this)),g.zoomable&&g.zoomOnWheel&&vt(m,$t,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&vt(m,_e,this.onDblclick=this.dblclick.bind(this)),vt(h.ownerDocument,et,this.onCropMove=this.cropMove.bind(this)),vt(h.ownerDocument,Oe,this.onCropEnd=this.cropEnd.bind(this)),g.responsive&&vt(window,Bi,this.onResize=this.resize.bind(this))},"bind"),unbind:o(function(){var h=this.element,g=this.options,m=this.cropper;tt(g.cropstart)&&Pt(h,ie,g.cropstart),tt(g.cropmove)&&Pt(h,te,g.cropmove),tt(g.cropend)&&Pt(h,ue,g.cropend),tt(g.crop)&&Pt(h,ne,g.crop),tt(g.zoom)&&Pt(h,zt,g.zoom),Pt(m,ee,this.onCropStart),g.zoomable&&g.zoomOnWheel&&Pt(m,$t,this.onWheel,{passive:!1,capture:!0}),g.toggleDragModeOnDblclick&&Pt(m,_e,this.onDblclick),Pt(h.ownerDocument,et,this.onCropMove),Pt(h.ownerDocument,Oe,this.onCropEnd),g.responsive&&Pt(window,Bi,this.onResize)},"unbind")},Og={resize:o(function(){if(!this.disabled){var h=this.options,g=this.container,m=this.containerData,_=g.offsetWidth/m.width,b=g.offsetHeight/m.height,x=Math.abs(_-1)>Math.abs(b-1)?_:b;if(x!==1){var D,W;h.restore&&(D=this.getCanvasData(),W=this.getCropBoxData()),this.render(),h.restore&&(this.setCanvasData(Fe(D,function(z,N){D[N]=z*x})),this.setCropBoxData(Fe(W,function(z,N){W[N]=z*x})))}}},"resize"),dblclick:o(function(){this.disabled||this.options.dragMode===J||this.setDragMode(lo(this.dragBox,k)?X:L)},"dblclick"),wheel:o(function(h){var g=this,m=Number(this.options.wheelZoomRatio)||.1,_=1;this.disabled||(h.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){g.wheeling=!1},50),h.deltaY?_=h.deltaY>0?1:-1:h.wheelDelta?_=-h.wheelDelta/120:h.detail&&(_=h.detail>0?1:-1),this.zoom(-_*m,h)))},"wheel"),cropStart:o(function(h){var g=h.buttons,m=h.button;if(!(this.disabled||(h.type==="mousedown"||h.type==="pointerdown"&&h.pointerType==="mouse")&&(oe(g)&&g!==1||oe(m)&&m!==0||h.ctrlKey))){var _=this.options,b=this.pointers,x;h.changedTouches?Fe(h.changedTouches,function(D){b[D.identifier]=uo(D)}):b[h.pointerId||0]=uo(h),Object.keys(b).length>1&&_.zoomable&&_.zoomOnTouch?x=Q:x=Vi(h.target,T),