import{c as e}from"./_commonjsHelpers.a5007c1f.js";import{Q as t}from"./index.9313841a.js";function i(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var s=0;function n(e){return"__private_"+s+++"_"+e}function r(e,t,i){const s=[];return e.forEach((e=>"string"!=typeof e?s.push(e):t[Symbol.split](e).forEach(((e,t,n)=>{""!==e&&s.push(e),t<n.length-1&&s.push(i)})))),s}
/**
 * Takes a string with placeholder variables like `%{smart_count} file selected`
 * and replaces it with values from options `{smart_count: 5}`
 *
 * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
 * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
 *
 * @param phrase that needs interpolation, with placeholders
 * @param options with values that will be used to replace placeholders
 */function a(e,t){const i=/\$/g;let s=[e];if(null==t)return s;for(const n of Object.keys(t))if("_"!==n){let e=t[n];"string"==typeof e&&(e=i[Symbol.replace](e,"$$$$")),s=r(s,new RegExp(`%\\{${n}\\}`,"g"),e)}return s}const o=e=>{throw new Error(`missing string: ${e}`)};var l=n("onMissingKey"),h=n("apply");class p{constructor(e,t){let{onMissingKey:s=o}=void 0===t?{}:t;Object.defineProperty(this,h,{value:d}),Object.defineProperty(this,l,{writable:!0,value:void 0}),this.locale={strings:{},pluralize:e=>1===e?0:1},Array.isArray(e)?e.forEach(i(this,h)[h],this):i(this,h)[h](e),i(this,l)[l]=s}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];null==s&&(i(this,l)[l](e),s=e);if("object"==typeof s){if(t&&void 0!==t.smart_count){return a(s[this.locale.pluralize(t.smart_count)],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof s)throw new Error("string was not a string");return a(s,t)}}function d(e){if(null==e||!e.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}var u=function(){var e={},t=e._fns={};return e.emit=function(e,i,s,n,r,a,o){var l=function(e){var i=t[e]?t[e]:[],s=e.indexOf(":"),n=-1===s?[e]:[e.substring(0,s),e.substring(s+1)],r=Object.keys(t),a=0,o=r.length;for(;a<o;a++){var l=r[a];if("*"===l&&(i=i.concat(t[l])),2===n.length&&n[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){var s=0,n=t.length;for(;s<n&&t[s];s++)t[s].event=e,t[s].apply(t[s],i)}(e,l,[i,s,n,r,a,o])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,(function s(){i.apply(this,arguments),e.off(t,s)}))},e.off=function(e,t){var i=[];if(e&&t)for(var s=this._fns[e],n=0,r=s?s.length:0;n<r;n++)s[n]!==t&&i.push(s[n]);i.length?this._fns[e]=i:delete this._fns[e]},e};let c=(e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t};var f=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)},m="object"==typeof e&&e&&e.Object===Object&&e,g="object"==typeof self&&self&&self.Object===Object&&self,y=m||g||Function("return this")(),v=y,b=function(){return v.Date.now()},w=/\s/;var _=function(e){for(var t=e.length;t--&&w.test(e.charAt(t)););return t},F=/^\s+/;var C=function(e){return e?e.slice(0,_(e)+1).replace(F,""):e},S=y.Symbol,P=S,x=Object.prototype,O=x.hasOwnProperty,k=x.toString,D=P?P.toStringTag:void 0;var T=function(e){var t=O.call(e,D),i=e[D];try{e[D]=void 0;var s=!0}catch(r){}var n=k.call(e);return s&&(t?e[D]=i:delete e[D]),n},E=Object.prototype.toString;var A=T,M=function(e){return E.call(e)},N=S?S.toStringTag:void 0;var U=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":N&&N in Object(e)?A(e):M(e)},B=function(e){return null!=e&&"object"==typeof e};var I=C,R=f,z=function(e){return"symbol"==typeof e||B(e)&&"[object Symbol]"==U(e)},L=/^[-+]0x[0-9a-f]+$/i,j=/^0b[01]+$/i,H=/^0o[0-7]+$/i,q=parseInt;var W=f,$=b,V=function(e){if("number"==typeof e)return e;if(z(e))return NaN;if(R(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=R(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=I(e);var i=j.test(e);return i||H.test(e)?q(e.slice(2),i?2:8):L.test(e)?NaN:+e},X=Math.max,G=Math.min;var Y=function(e,t,i){var s,n,r,a,o,l,h=0,p=!1,d=!1,u=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function c(t){var i=s,r=n;return s=n=void 0,h=t,a=e.apply(r,i)}function f(e){return h=e,o=setTimeout(g,t),p?c(e):a}function m(e){var i=e-l;return void 0===l||i>=t||i<0||d&&e-h>=r}function g(){var e=$();if(m(e))return y(e);o=setTimeout(g,function(e){var i=t-(e-l);return d?G(i,r-(e-h)):i}(e))}function y(e){return o=void 0,u&&s?c(e):(s=n=void 0,a)}function v(){var e=$(),i=m(e);if(s=arguments,n=this,l=e,i){if(void 0===o)return f(l);if(d)return clearTimeout(o),o=setTimeout(g,t),c(l)}return void 0===o&&(o=setTimeout(g,t)),a}return t=V(t)||0,W(i)&&(p=!!i.leading,r=(d="maxWait"in i)?X(V(i.maxWait)||0,t):r,u="trailing"in i?!!i.trailing:u),v.cancel=function(){void 0!==o&&clearTimeout(o),h=0,s=l=n=o=void 0},v.flush=function(){return void 0===o?a:y($())},v},K=Y,Q=f;var Z=function(e,t,i){var s=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return Q(i)&&(s="leading"in i?!!i.leading:s,n="trailing"in i?!!i.trailing:n),K(e,t,{leading:s,maxWait:t,trailing:n})};function J(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ee=0;function te(e){return"__private_"+ee+++"_"+e}var ie=te("callbacks"),se=te("publish");class ne{constructor(){Object.defineProperty(this,se,{value:re}),this.state={},Object.defineProperty(this,ie,{writable:!0,value:new Set})}getState(){return this.state}setState(e){const t={...this.state},i={...this.state,...e};this.state=i,J(this,se)[se](t,i,e)}subscribe(e){return J(this,ie)[ie].add(e),()=>{J(this,ie)[ie].delete(e)}}}function re(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];J(this,ie)[ie].forEach((e=>{e(...t)}))}function ae(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}ne.VERSION="3.2.2";var oe={__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 le(e){var t;if(e.type)return e.type;const i=e.name?null==(t=ae(e.name).extension)?void 0:t.toLowerCase():null;return i&&i in oe?oe[i]:"application/octet-stream"}function he(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}function pe(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const i=le(e);return function(e,t){let i=t||"uppy";return"string"==typeof e.name&&(i+=`-${he(e.name.toLowerCase())}`),void 0!==e.type&&(i+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(i+=`-${he(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(i+=`-${e.data.size}`),void 0!==e.data.lastModified&&(i+=`-${e.data.lastModified}`),i}({...e,type:i},t)}function de(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const i=t[1].split(".",2),s=parseInt(i[0],10),n=parseInt(i[1],10);return s<15||15===s&&n<15063||(s>18||18===s&&n>=18218)}const ue={debug:()=>{},warn:()=>{},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]}},ce={debug:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]},warn:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]},error:function(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i]}};var fe=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0;let i=Math.abs(e);if(t&&(i=-i),0===i)return"0 B";const s=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.min(Math.floor(Math.log(i)/Math.log(1024)),s.length-1),r=Number(i/1024**n),a=s[n];return`${r>=10||r%1==0?Math.round(r):r.toFixed(1)} ${a}`};function me(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}me.prototype.match=function(e){var t,i,s=!0,n=this.parts,r=n.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(i=(e||"").split(this.separator),t=0;s&&t<r;t++)"*"!==n[t]&&(s=t<i.length&&n[t]===i[t]);s=s&&i}else s=!1;else if("function"==typeof e.splice)for(s=[],t=e.length;t--;)this.match(e[t])&&(s[s.length]=e[t]);else if("object"==typeof e)for(var a in s={},e)this.match(a)&&(s[a]=e[a]);return s};var ge=function(e,t,i){var s=new me(e,i||/[\/\.]/);return void 0!==t?s.match(t):s},ye=/[\/\+\.]/;const ve={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class be extends Error{constructor(e,t){var i;super(e),this.isRestriction=!0,this.isUserFacing=null==(i=null==t?void 0:t.isUserFacing)||i,null!=t&&t.file&&(this.file=t.file)}}class we{constructor(e,t){this.getI18n=t,this.getOpts=()=>{var t;const i=e();if(null!=(null==(t=i.restrictions)?void 0:t.allowedFileTypes)&&!Array.isArray(i.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return i}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:i,maxNumberOfFiles:s}=this.getOpts().restrictions;if(s){if(e.filter((e=>!e.isGhost)).length+t.length>s)throw new be(`${this.getI18n()("youCanOnlyUploadX",{smart_count:s})}`)}if(i){const s=[...e,...t].reduce(((e,t)=>{var i;return e+(null!=(i=t.size)?i:0)}),0);if(s>i)throw new be(this.getI18n()("aggregateExceedsSize",{sizeAllowed:fe(i),size:fe(s)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:i,allowedFileTypes:s}=this.getOpts().restrictions;if(s){if(!s.some((t=>t.includes("/")?!!e.type&&function(e,t){function i(t){var i=ge(t,e,ye);return i&&i.length>=2}return t?i(t.split(";")[0]):i}(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase()))){const t=s.join(", ");throw new be(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}}if(t&&null!=e.size&&e.size>t)throw new be(this.getI18n()("exceedsSize",{size:fe(t),file:e.name}),{file:e});if(i&&null!=e.size&&e.size<i)throw new be(this.getI18n()("inferiorSize",{size:fe(i)}),{file:e})}validate(e,t){t.forEach((e=>{this.validateSingleFile(e)})),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new be(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new be(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name})),{requiredMetaFields:i}=this.getOpts().restrictions,s=[];for(const n of i)Object.hasOwn(e.meta,n)&&""!==e.meta[n]||s.push(n);return{missingFields:s,error:t}}}var _e={strings:{addBulkFilesFailed:{0:"Failed to add %{smart_count} file due to an internal error",1:"Failed to add %{smart_count} files due to internal errors"},youCanOnlyUploadX:{0:"You can only upload %{smart_count} file",1:"You can only upload %{smart_count} files"},youHaveToAtLeastSelectX:{0:"You have to select at least %{smart_count} file",1:"You have to select at least %{smart_count} files"},aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",inferiorSize:"This file is smaller than the allowed size of %{size}",youCanOnlyUploadFileTypes:"You can only upload: %{types}",noMoreFilesAllowed:"Cannot add more files",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",companionError:"Connection with Companion failed",authAborted:"Authentication aborted",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",noSearchResults:"Unfortunately, there are no results for this search",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},allFilesFromFolderNamed:"All files from folder %{name}",openFolderNamed:"Open folder %{name}",cancel:"Cancel",logOut:"Log out",filter:"Filter",resetFilter:"Reset filter",loading:"Loading...",loadedXFiles:"Loaded %{numFiles} files",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",authenticateWith:"Connect to %{pluginName}",signInWithGoogle:"Sign in with Google",searchImages:"Search for images",enterTextToSearch:"Enter text to search for images",search:"Search",resetSearch:"Reset search",emptyFolderAdded:"No files were added from empty folder",addedNumFiles:"Added %{numFiles} file(s)",folderAlreadyAdded:'The folder "%{folder}" was already added',folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",unnamed:"Unnamed"}};let Fe,Ce;function Se(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Pe=0;function xe(e){return"__private_"+Pe+++"_"+e}const Oe={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};var ke=xe("plugins"),De=xe("restricter"),Te=xe("storeUnsubscribe"),Ee=xe("emitter"),Ae=xe("preProcessors"),Me=xe("uploaders"),Ne=xe("postProcessors"),Ue=xe("informAndEmit"),Be=xe("checkRequiredMetaFieldsOnFile"),Ie=xe("checkRequiredMetaFields"),Re=xe("assertNewUploadAllowed"),ze=xe("transformFile"),Le=xe("startIfAutoProceed"),je=xe("checkAndUpdateFileState"),He=xe("addListeners"),qe=xe("updateOnlineStatus"),We=xe("requestClientById"),$e=xe("createUpload"),Ve=xe("getUpload"),Xe=xe("removeUpload"),Ge=xe("runUpload");Fe=Symbol.for("uppy test: getPlugins"),Ce=Symbol.for("uppy test: createUpload");class Ye{constructor(e){Object.defineProperty(this,Ge,{value:ot}),Object.defineProperty(this,Xe,{value:at}),Object.defineProperty(this,Ve,{value:rt}),Object.defineProperty(this,$e,{value:nt}),Object.defineProperty(this,He,{value:st}),Object.defineProperty(this,je,{value:it}),Object.defineProperty(this,Le,{value:tt}),Object.defineProperty(this,ze,{value:et}),Object.defineProperty(this,Re,{value:Je}),Object.defineProperty(this,Ie,{value:Ze}),Object.defineProperty(this,Be,{value:Qe}),Object.defineProperty(this,Ue,{value:Ke}),Object.defineProperty(this,ke,{writable:!0,value:Object.create(null)}),Object.defineProperty(this,De,{writable:!0,value:void 0}),Object.defineProperty(this,Te,{writable:!0,value:void 0}),Object.defineProperty(this,Ee,{writable:!0,value:u()}),Object.defineProperty(this,Ae,{writable:!0,value:new Set}),Object.defineProperty(this,Me,{writable:!0,value:new Set}),Object.defineProperty(this,Ne,{writable:!0,value:new Set}),this.scheduledAutoProceed=null,this.wasOffline=!1,this.calculateProgress=Z(((e,t)=>{const i=this.getFile(null==e?void 0:e.id);if(null==e||!i)return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);if(100===i.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);const s=Number.isFinite(t.bytesTotal)&&t.bytesTotal>0;this.setFileState(e.id,{progress:{...i.progress,bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:s?Math.round(t.bytesUploaded/t.bytesTotal*100):0}}),this.calculateTotalProgress()}),500,{leading:!0,trailing:!0}),Object.defineProperty(this,qe,{writable:!0,value:this.updateOnlineStatus.bind(this)}),Object.defineProperty(this,We,{writable:!0,value:new Map}),this.defaultLocale=_e;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:ve,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new ne,logger:ue,infoTimeout:5e3},i={...t,...e};this.opts={...i,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=ce),this.log(`Using Core v${Ye.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Oe,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:de(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),Se(this,De)[De]=new we((()=>this.opts),(()=>this.i18n)),Se(this,Te)[Te]=this.store.subscribe(((e,t,i)=>{this.emit("state-update",e,t,i),this.updateAll(t)})),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),Se(this,He)[He]()}emit(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];Se(this,Ee)[Ee].emit(e,...i)}on(e,t){return Se(this,Ee)[Ee].on(e,t),this}once(e,t){return Se(this,Ee)[Ee].once(e,t),this}off(e,t){return Se(this,Ee)[Ee].off(e,t),this}updateAll(e){this.iteratePlugins((t=>{t.update(e)}))}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map((e=>{let[i,s]=e;return[i,{...t[i],...s}]})))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=new p([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...null==e?void 0:e.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins((t=>{t.setOptions(e)})),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},i={};Object.keys(t).forEach((s=>{i[s]={...t[s],progress:{...t[s].progress,...e}}})),this.setState({files:i,...Oe}),this.emit("reset-progress")}clearUploadedFiles(){const{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({...Oe,files:{}})}addPreProcessor(e){Se(this,Ae)[Ae].add(e)}removePreProcessor(e){return Se(this,Ae)[Ae].delete(e)}addPostProcessor(e){Se(this,Ne)[Ne].add(e)}removePostProcessor(e){return Se(this,Ne)[Ne].delete(e)}addUploader(e){Se(this,Me)[Me].add(e)}removeUploader(e){return Se(this,Me)[Me].delete(e)}setMeta(e){const t={...this.getState().meta,...e},i={...this.getState().files};Object.keys(i).forEach((t=>{i[t]={...i[t],meta:{...i[t].meta,...e}}})),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:i})}setFileMeta(e,t){const i={...this.getState().files};if(!i[e])return void this.log("Was trying to set metadata for a file that has been removed: ",e);const s={...i[e].meta,...t};i[e]={...i[e],meta:s},this.setState({files:i})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map((e=>this.getFile(e)))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:i}=this.getState(),s=Object.values(e),n=[],r=[],a=[],o=[],l=[],h=[],p=[],d=[],u=[];for(const c of s){const{progress:e}=c;!e.uploadComplete&&e.uploadStarted&&(n.push(c),c.isPaused||d.push(c)),e.uploadStarted||r.push(c),(e.uploadStarted||e.preprocess||e.postprocess)&&a.push(c),e.uploadStarted&&o.push(c),c.isPaused&&l.push(c),e.uploadComplete&&h.push(c),c.error&&p.push(c),(e.preprocess||e.postprocess)&&u.push(c)}return{newFiles:r,startedFiles:a,uploadStartedFiles:o,pausedFiles:l,completeFiles:h,erroredFiles:p,inProgressFiles:n,inProgressNotPausedFiles:d,processingFiles:u,isUploadStarted:o.length>0,isAllComplete:100===t&&h.length===s.length&&0===u.length,isAllErrored:!!i&&p.length===s.length,isAllPaused:0!==n.length&&l.length===n.length,isUploadInProgress:n.length>0,isSomeGhost:s.some((e=>e.isGhost))}}validateRestrictions(e,t){void 0===t&&(t=this.getFiles());try{Se(this,De)[De].validate(t,[e])}catch(i){return i}return null}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}addFile(e){Se(this,Re)[Re](e);const{nextFilesState:t,validFilesToAdd:i,errors:s}=Se(this,je)[je]([e]),n=s.filter((e=>e.isRestriction));if(Se(this,Ue)[Ue](n),s.length>0)throw s[0];this.setState({files:t});const[r]=i;return this.emit("file-added",r),this.emit("files-added",i),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),Se(this,Le)[Le](),r.id}addFiles(e){Se(this,Re)[Re]();const{nextFilesState:t,validFilesToAdd:i,errors:s}=Se(this,je)[je](e),n=s.filter((e=>e.isRestriction));Se(this,Ue)[Ue](n);const r=s.filter((e=>!e.isRestriction));if(r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach((t=>{e+=`\n * ${t.message}`})),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}this.setState({files:t}),i.forEach((e=>{this.emit("file-added",e)})),this.emit("files-added",i),i.length>5?this.log(`Added batch of ${i.length} files`):Object.values(i).forEach((e=>{this.log(`Added file: ${e.name}\n id: ${e.id}\n type: ${e.type}`)})),i.length>0&&Se(this,Le)[Le]()}removeFiles(e,t){const{files:i,currentUploads:s}=this.getState(),n={...i},r={...s},a=Object.create(null);function o(e){return void 0===a[e]}e.forEach((e=>{i[e]&&(a[e]=i[e],delete n[e])})),Object.keys(r).forEach((e=>{const t=s[e].fileIDs.filter(o);if(0===t.length)return void delete r[e];const{capabilities:i}=this.getState();if(t.length!==s[e].fileIDs.length&&!i.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[e]={...s[e],fileIDs:t}}));const l={currentUploads:r,files:n};0===Object.keys(n).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.calculateTotalProgress();const h=Object.keys(a);h.forEach((e=>{this.emit("file-removed",a[e],t)})),h.length>5?this.log(`Removed ${h.length} files`):this.log(`Removed files: ${h.join(", ")}`)}removeFile(e,t){this.removeFiles([e],t)}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=!(this.getFile(e).isPaused||!1);return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}pauseAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!0};e[t]=i})),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter((t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted)).forEach((t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i})),this.setState({files:e}),this.emit("resume-all")}retryAll(){const e={...this.getState().files},t=Object.keys(e).filter((t=>e[t].error));if(t.forEach((t=>{const i={...e[t],isPaused:!1,error:null};e[t]=i})),this.setState({files:e,error:null}),this.emit("retry-all",t),0===t.length)return Promise.resolve({successful:[],failed:[]});const i=Se(this,$e)[$e](t,{forceAllowNewUpload:!0});return Se(this,Ge)[Ge](i)}cancelAll(e){let{reason:t="user"}=void 0===e?{}:e;if(this.emit("cancel-all",{reason:t}),"user"===t){const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t,"cancel-all"),this.setState(Oe)}}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",e);const t=Se(this,$e)[$e]([e],{forceAllowNewUpload:!0});return Se(this,Ge)[Ge](t)}logout(){this.iteratePlugins((e=>{var t;null==(t=e.provider)||null==t.logout||t.logout()}))}calculateTotalProgress(){const e=this.getFiles().filter((e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess));if(0===e.length)return this.emit("progress",0),void this.setState({totalProgress:0});const t=e.filter((e=>null!=e.progress.bytesTotal)),i=e.filter((e=>null==e.progress.bytesTotal));if(0===t.length){const t=100*e.length,s=i.reduce(((e,t)=>e+t.progress.percentage),0),n=Math.round(s/t*100);return void this.setState({totalProgress:n})}let s=t.reduce(((e,t)=>{var i;return e+(null!=(i=t.progress.bytesTotal)?i:0)}),0);const n=s/t.length;s+=n*i.length;let r=0;t.forEach((e=>{r+=e.progress.bytesUploaded})),i.forEach((e=>{r+=n*(e.progress.percentage||0)/100}));let a=0===s?0:Math.round(r/s*100);a>100&&(a=100),this.setState({totalProgress:a}),this.emit("progress",a)}updateOnlineStatus(){var e;null==(e=window.navigator.onLine)||e?(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("function"!=typeof e){throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`)}const i=new e(this,t),s=i.id;if(!s)throw new Error("Your plugin must have an id");if(!i.type)throw new Error("Your plugin must have a type");const n=this.getPlugin(s);if(n){const e=`Already found a plugin named '${n.id}'. Tried to use: '${s}'.\nUppy plugins must have unique \`id\` options. See https://uppy.io/docs/plugins/#id.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${s} v${e.VERSION}`),i.type in Se(this,ke)[ke]?Se(this,ke)[ke][i.type].push(i):Se(this,ke)[ke][i.type]=[i],i.install(),this.emit("plugin-added",i),this}getPlugin(e){for(const t of Object.values(Se(this,ke)[ke])){const i=t.find((t=>t.id===e));if(null!=i)return i}}[Fe](e){return Se(this,ke)[ke][e]}iteratePlugins(e){Object.values(Se(this,ke)[ke]).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=Se(this,ke)[ke][e.type],i=t.findIndex((t=>t.id===e.id));-1!==i&&t.splice(i,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}close(e){let{reason:t}=void 0===e?{}:e;this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll({reason:t}),Se(this,Te)[Te](),this.iteratePlugins((e=>{this.removePlugin(e)})),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",Se(this,qe)[qe]),window.removeEventListener("offline",Se(this,qe)[qe]))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t,i){void 0===t&&(t="info"),void 0===i&&(i=3e3);const s="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:s?e.message:e,details:s?e.details:null}]}),setTimeout((()=>this.hideInfo()),i),this.emit("info-visible")}log(e,t){const{logger:i}=this.opts;switch(t){case"error":i.error(e);break;case"warning":i.warn(e);break;default:i.debug(e)}}registerRequestClient(e,t){Se(this,We)[We].set(e,t)}getRequestClientForFile(e){if(!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=Se(this,We)[We].get(e.remote.requestClientId);if(null==t)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]?Se(this,Ge)[Ge](e):(Se(this,Xe)[Xe](e),Promise.reject(new Error("Nonexistent upload")))}[Ce](){return Se(this,$e)[$e](...arguments)}addResultData(e,t){if(!Se(this,Ve)[Ve](e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:i}=this.getState(),s={...i[e],result:{...i[e].result,...t}};this.setState({currentUploads:{...i,[e]:s}})}upload(){var e;null!=(e=Se(this,ke)[ke].uploader)&&e.length||this.log("No uploader type plugins are used","warning");let{files:t}=this.getState();const i=this.opts.onBeforeUpload(t);return!1===i?Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false")):(i&&"object"==typeof i&&(t=i,this.setState({files:t})),Promise.resolve().then((()=>Se(this,De)[De].validateMinNumberOfFiles(t))).catch((e=>{throw Se(this,Ue)[Ue]([e]),e})).then((()=>{if(!Se(this,Ie)[Ie](t))throw new be(this.i18n("missingRequiredMetaField"))})).catch((e=>{throw e})).then((()=>{const{currentUploads:e}=this.getState(),i=Object.values(e).flatMap((e=>e.fileIDs)),s=[];Object.keys(t).forEach((e=>{const t=this.getFile(e);t.progress.uploadStarted||-1!==i.indexOf(e)||s.push(t.id)}));const n=Se(this,$e)[$e](s);return Se(this,Ge)[Ge](n)})).catch((e=>{throw this.emit("error",e),this.log(e,"error"),e})))}}function Ke(e){for(const n of e)n.isRestriction?this.emit("restriction-failed",n.file,n):this.emit("error",n,n.file),this.log(n,"warning");const t=e.filter((e=>e.isUserFacing)),i=t.slice(0,4),s=t.slice(4);i.forEach((e=>{let{message:t,details:i=""}=e;this.info({message:t,details:i},"error",this.opts.infoTimeout)})),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}function Qe(e){const{missingFields:t,error:i}=Se(this,De)[De].getMissingRequiredMetaFields(e);return!(t.length>0)||(this.setFileState(e.id,{missingRequiredMetaFields:t}),this.log(i.message),this.emit("restriction-failed",e,i),!1)}function Ze(e){let t=!0;for(const i of Object.values(e))Se(this,Be)[Be](i)||(t=!1);return t}function Je(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new be(this.i18n("noMoreFilesAllowed"),{file:e});throw Se(this,Ue)[Ue]([t]),t}}function et(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e}:e,i=le(t),s=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(i,t),n=ae(s).extension,r=pe(t,this.getID()),a=t.meta||{};a.name=s,a.type=i;const o=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:r,name:s,extension:n||"",meta:{...this.getState().meta,...a},type:i,data:t.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:o,uploadComplete:!1,uploadStarted:null},size:o,isGhost:!1,isRemote:t.isRemote||!1,remote:t.remote||"",preview:t.preview}}function tt(){this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout((()=>{this.scheduledAutoProceed=null,this.upload().catch((e=>{e.isRestriction||this.log(e.stack||e.message||e)}))}),4))}function it(e){const{files:t}=this.getState(),i={...t},s=[],n=[];for(const o of e)try{var r;let e=Se(this,ze)[ze](o);const n=null==(r=t[e.id])?void 0:r.isGhost;if(n){e={...t[e.id],isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`)}const a=this.opts.onBeforeFileAdded(e,i);if(!a&&this.checkIfFileAlreadyExists(e.id))throw new be(this.i18n("noDuplicates",{fileName:e.name}),{file:o});if(!1===a&&!n)throw new be("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});"object"==typeof a&&null!==a&&(e=a),Se(this,De)[De].validateSingleFile(e),i[e.id]=e,s.push(e)}catch(a){n.push(a)}try{Se(this,De)[De].validateAggregateRestrictions(Object.values(t),s)}catch(a){return n.push(a),{nextFilesState:t,validFilesToAdd:[],errors:n}}return{nextFilesState:i,validFilesToAdd:s,errors:n}}function st(){const e=(e,t,i)=>{let s=e.message||"Unknown error";e.details&&(s+=` ${e.details}`),this.setState({error:s}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:s,response:i})};this.on("error",e),this.on("upload-error",((t,i,s)=>{if(e(i,t,s),"object"==typeof i&&i.message){var n;this.log(i.message,"error");const e=new Error(this.i18n("failedToUpload",{file:null!=(n=null==t?void 0:t.name)?n:""}));e.isUserFacing=!0,e.details=i.message,i.details&&(e.details+=` ${i.details}`),Se(this,Ue)[Ue]([e])}else Se(this,Ue)[Ue]([i])}));let t=null;this.on("upload-stalled",((e,i)=>{const{message:s}=e,n=i.map((e=>e.meta.name)).join(", ");t||(this.info({message:s,details:n},"warning",this.opts.infoTimeout),t=setTimeout((()=>{t=null}),this.opts.infoTimeout)),this.log(`${s} ${n}`.trim(),"warning")})),this.on("upload",(()=>{this.setState({error:null})}));const i=e=>{const t=e.filter((e=>{const t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`),t})),i=Object.fromEntries(t.map((e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:e.size}}])));this.patchFilesState(i)};this.on("upload-start",(e=>{e.forEach((e=>{this.emit("upload-started",e)})),i(e)})),this.on("upload-progress",this.calculateProgress),this.on("upload-success",((e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const i=this.getFile(e.id).progress;this.setFileState(e.id,{progress:{...i,postprocess:Se(this,Ne)[Ne].size>0?{mode:"indeterminate"}:void 0,uploadComplete:!0,percentage:100,bytesUploaded:i.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||i.bytesTotal}),this.calculateTotalProgress()})),this.on("preprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("preprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})})),this.on("postprocess-progress",((e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`)})),this.on("postprocess-complete",(e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${null==e?void 0:e.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.postprocess,this.setState({files:t})})),this.on("restored",(()=>{this.calculateTotalProgress()})),this.on("dashboard:file-edit-complete",(e=>{e&&Se(this,Be)[Be](e)})),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",Se(this,qe)[qe]),window.addEventListener("offline",Se(this,qe)[qe]),setTimeout(Se(this,qe)[qe],3e3))}function nt(e,t){void 0===t&&(t={});const{forceAllowNewUpload:i=!1}=t,{allowNewUpload:s,currentUploads:n}=this.getState();if(!s&&!i)throw new Error("Cannot create a new upload: already uploading.");const r=c();return this.emit("upload",{id:r,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...n,[r]:{fileIDs:e,step:0,result:{}}}}),r}function rt(e){const{currentUploads:t}=this.getState();return t[e]}function at(e){const t={...this.getState().currentUploads};delete t[e],this.setState({currentUploads:t})}async function ot(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let i=t();const s=[...Se(this,Ae)[Ae],...Se(this,Me)[Me],...Se(this,Ne)[Ne]];try{for(let n=i.step||0;n<s.length&&i;n++){const r=s[n];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...i,step:n}}});const{fileIDs:a}=i;await r(a,e),i=t()}}catch(r){throw Se(this,Xe)[Xe](e),r}if(i){i.fileIDs.forEach((e=>{const t=this.getFile(e);t&&t.progress.postprocess&&this.emit("postprocess-complete",t)}));const s=i.fileIDs.map((e=>this.getFile(e))),n=s.filter((e=>!e.error)),r=s.filter((e=>e.error));this.addResultData(e,{successful:n,failed:r,uploadID:e}),i=t()}let n;return i&&(n=i.result,this.emit("complete",n),Se(this,Xe)[Xe](e)),null==n&&this.log(`Not setting result for an upload that has been removed: ${e}`),n}Ye.VERSION="3.13.1";var lt,ht,pt,dt,ut,ct,ft,mt,gt,yt,vt,bt=Ye,wt={},_t=[],Ft=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ct=Array.isArray;function St(e,t){for(var i in t)e[i]=t[i];return e}function Pt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function xt(e,t,i){var s,n,r,a={};for(r in t)"key"==r?s=t[r]:"ref"==r?n=t[r]:a[r]=t[r];if(arguments.length>2&&(a.children=arguments.length>3?lt.call(arguments,2):i),"function"==typeof e&&null!=e.defaultProps)for(r in e.defaultProps)void 0===a[r]&&(a[r]=e.defaultProps[r]);return Ot(e,a,s,n,null)}function Ot(e,t,i,s,n){var r={type:e,props:t,key:i,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==n?++pt:n,__i:-1,__u:0};return null==n&&null!=ht.vnode&&ht.vnode(r),r}function kt(e){return e.children}function Dt(e,t){this.props=e,this.context=t}function Tt(e,t){if(null==t)return e.__?Tt(e.__,e.__i+1):null;for(var i;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e)return i.__e;return"function"==typeof e.type?Tt(e):null}function Et(e){var t,i;if(null!=(e=e.__)&&null!=e.__c){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if(null!=(i=e.__k[t])&&null!=i.__e){e.__e=e.__c.base=i.__e;break}return Et(e)}}function At(e){(!e.__d&&(e.__d=!0)&&dt.push(e)&&!Mt.__r++||ut!=ht.debounceRendering)&&((ut=ht.debounceRendering)||ct)(Mt)}function Mt(){for(var e,t,i,s,n,r,a,o=1;dt.length;)dt.length>o&&dt.sort(ft),e=dt.shift(),o=dt.length,e.__d&&(i=void 0,n=(s=(t=e).__v).__e,r=[],a=[],t.__P&&((i=St({},s)).__v=s.__v+1,ht.vnode&&ht.vnode(i),jt(t.__P,i,s,t.__n,t.__P.namespaceURI,32&s.__u?[n]:null,r,null==n?Tt(s):n,!!(32&s.__u),a),i.__v=s.__v,i.__.__k[i.__i]=i,qt(r,i,a),i.__e!=n&&Et(i)));Mt.__r=0}function Nt(e,t,i,s,n,r,a,o,l,h,p){var d,u,c,f,m,g,y,v=s&&s.__k||_t,b=t.length;for(l=function(e,t,i,s,n){var r,a,o,l,h,p=i.length,d=p,u=0;for(e.__k=new Array(n),r=0;r<n;r++)null!=(a=t[r])&&"boolean"!=typeof a&&"function"!=typeof a?(l=r+u,(a=e.__k[r]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?Ot(null,a,null,null,null):Ct(a)?Ot(kt,{children:a},null,null,null):null==a.constructor&&a.__b>0?Ot(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,o=null,-1!=(h=a.__i=It(a,i,l,d))&&(d--,(o=i[h])&&(o.__u|=2)),null==o||null==o.__v?(-1==h&&(n>p?u--:n<p&&u++),"function"!=typeof a.type&&(a.__u|=4)):h!=l&&(h==l-1?u--:h==l+1?u++:(h>l?u--:u++,a.__u|=4))):e.__k[r]=null;if(d)for(r=0;r<p;r++)null!=(o=i[r])&&0==(2&o.__u)&&(o.__e==s&&(s=Tt(o)),Vt(o,o));return s}(i,t,v,l,b),d=0;d<b;d++)null!=(c=i.__k[d])&&(u=-1==c.__i?wt:v[c.__i]||wt,c.__i=d,g=jt(e,c,u,n,r,a,o,l,h,p),f=c.__e,c.ref&&u.ref!=c.ref&&(u.ref&&$t(u.ref,null,c),p.push(c.ref,c.__c||f,c)),null==m&&null!=f&&(m=f),(y=!!(4&c.__u))||u.__k===c.__k?l=Ut(c,l,e,y):"function"==typeof c.type&&void 0!==g?l=g:f&&(l=f.nextSibling),c.__u&=-7);return i.__e=m,l}function Ut(e,t,i,s){var n,r;if("function"==typeof e.type){for(n=e.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=e,t=Ut(n[r],t,i,s));return t}e.__e!=t&&(s&&(t&&e.type&&!t.parentNode&&(t=Tt(e)),i.insertBefore(e.__e,t||null)),t=e.__e);do{t=t&&t.nextSibling}while(null!=t&&8==t.nodeType);return t}function Bt(e,t){return t=t||[],null==e||"boolean"==typeof e||(Ct(e)?e.some((function(e){Bt(e,t)})):t.push(e)),t}function It(e,t,i,s){var n,r,a,o=e.key,l=e.type,h=t[i],p=null!=h&&0==(2&h.__u);if(null===h&&null==e.key||p&&o==h.key&&l==h.type)return i;if(s>(p?1:0))for(n=i-1,r=i+1;n>=0||r<t.length;)if(null!=(h=t[a=n>=0?n--:r++])&&0==(2&h.__u)&&o==h.key&&l==h.type)return a;return-1}function Rt(e,t,i){"-"==t[0]?e.setProperty(t,null==i?"":i):e[t]=null==i?"":"number"!=typeof i||Ft.test(t)?i:i+"px"}function zt(e,t,i,s,n){var r,a;e:if("style"==t)if("string"==typeof i)e.style.cssText=i;else{if("string"==typeof s&&(e.style.cssText=s=""),s)for(t in s)i&&t in i||Rt(e.style,t,"");if(i)for(t in i)s&&i[t]==s[t]||Rt(e.style,t,i[t])}else if("o"==t[0]&&"n"==t[1])r=t!=(t=t.replace(mt,"$1")),a=t.toLowerCase(),t=a in e||"onFocusOut"==t||"onFocusIn"==t?a.slice(2):t.slice(2),e.l||(e.l={}),e.l[t+r]=i,i?s?i.u=s.u:(i.u=gt,e.addEventListener(t,r?vt:yt,r)):e.removeEventListener(t,r?vt:yt,r);else{if("http://www.w3.org/2000/svg"==n)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==i?"":i;break e}catch(o){}"function"==typeof i||(null==i||!1===i&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==i?"":i))}}function Lt(e){return function(t){if(this.l){var i=this.l[t.type+e];if(null==t.t)t.t=gt++;else if(t.t<i.u)return;return i(ht.event?ht.event(t):t)}}}function jt(e,t,i,s,n,r,a,o,l,h){var p,d,u,c,f,m,g,y,v,b,w,_,F,C,S,P,x,O=t.type;if(null!=t.constructor)return null;128&i.__u&&(l=!!(32&i.__u),r=[o=t.__e=i.__e]),(p=ht.__b)&&p(t);e:if("function"==typeof O)try{if(y=t.props,v="prototype"in O&&O.prototype.render,b=(p=O.contextType)&&s[p.__c],w=p?b?b.props.value:p.__:s,i.__c?g=(d=t.__c=i.__c).__=d.__E:(v?t.__c=d=new O(y,w):(t.__c=d=new Dt(y,w),d.constructor=O,d.render=Xt),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=w,d.__n=s,u=d.__d=!0,d.__h=[],d._sb=[]),v&&null==d.__s&&(d.__s=d.state),v&&null!=O.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=St({},d.__s)),St(d.__s,O.getDerivedStateFromProps(y,d.__s))),c=d.props,f=d.state,d.__v=t,u)v&&null==O.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),v&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(v&&null==O.getDerivedStateFromProps&&y!==c&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)||t.__v==i.__v){for(t.__v!=i.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=i.__e,t.__k=i.__k,t.__k.some((function(e){e&&(e.__=t)})),_=0;_<d._sb.length;_++)d.__h.push(d._sb[_]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),v&&null!=d.componentDidUpdate&&d.__h.push((function(){d.componentDidUpdate(c,f,m)}))}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,F=ht.__r,C=0,v){for(d.state=d.__s,d.__d=!1,F&&F(t),p=d.render(d.props,d.state,d.context),S=0;S<d._sb.length;S++)d.__h.push(d._sb[S]);d._sb=[]}else do{d.__d=!1,F&&F(t),p=d.render(d.props,d.state,d.context),d.state=d.__s}while(d.__d&&++C<25);d.state=d.__s,null!=d.getChildContext&&(s=St(St({},s),d.getChildContext())),v&&!u&&null!=d.getSnapshotBeforeUpdate&&(m=d.getSnapshotBeforeUpdate(c,f)),P=p,null!=p&&p.type===kt&&null==p.key&&(P=Wt(p.props.children)),o=Nt(e,Ct(P)?P:[P],t,i,s,n,r,a,o,l,h),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),g&&(d.__E=d.__=null)}catch(k){if(t.__v=null,l||null!=r)if(k.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,t.__e=o}else{for(x=r.length;x--;)Pt(r[x]);Ht(t)}else t.__e=i.__e,t.__k=i.__k,k.then||Ht(t);ht.__e(k,t,i)}else null==r&&t.__v==i.__v?(t.__k=i.__k,t.__e=i.__e):o=t.__e=function(e,t,i,s,n,r,a,o,l){var h,p,d,u,c,f,m,g=i.props,y=t.props,v=t.type;if("svg"==v?n="http://www.w3.org/2000/svg":"math"==v?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),null!=r)for(h=0;h<r.length;h++)if((c=r[h])&&"setAttribute"in c==!!v&&(v?c.localName==v:3==c.nodeType)){e=c,r[h]=null;break}if(null==e){if(null==v)return document.createTextNode(y);e=document.createElementNS(n,v,y.is&&y),o&&(ht.__m&&ht.__m(t,r),o=!1),r=null}if(null==v)g===y||o&&e.data==y||(e.data=y);else{if(r=r&&lt.call(e.childNodes),g=i.props||wt,!o&&null!=r)for(g={},h=0;h<e.attributes.length;h++)g[(c=e.attributes[h]).name]=c.value;for(h in g)if(c=g[h],"children"==h);else if("dangerouslySetInnerHTML"==h)d=c;else if(!(h in y)){if("value"==h&&"defaultValue"in y||"checked"==h&&"defaultChecked"in y)continue;zt(e,h,null,c,n)}for(h in y)c=y[h],"children"==h?u=c:"dangerouslySetInnerHTML"==h?p=c:"value"==h?f=c:"checked"==h?m=c:o&&"function"!=typeof c||g[h]===c||zt(e,h,c,g[h],n);if(p)o||d&&(p.__html==d.__html||p.__html==e.innerHTML)||(e.innerHTML=p.__html),t.__k=[];else if(d&&(e.innerHTML=""),Nt("template"==t.type?e.content:e,Ct(u)?u:[u],t,i,s,"foreignObject"==v?"http://www.w3.org/1999/xhtml":n,r,a,r?r[0]:i.__k&&Tt(i,0),o,l),null!=r)for(h=r.length;h--;)Pt(r[h]);o||(h="value","progress"==v&&null==f?e.removeAttribute("value"):null!=f&&(f!==e[h]||"progress"==v&&!f||"option"==v&&f!=g[h])&&zt(e,h,f,g[h],n),h="checked",null!=m&&m!=e[h]&&zt(e,h,m,g[h],n))}return e}(i.__e,t,i,s,n,r,a,l,h);return(p=ht.diffed)&&p(t),128&t.__u?void 0:o}function Ht(e){e&&e.__c&&(e.__c.__e=!0),e&&e.__k&&e.__k.forEach(Ht)}function qt(e,t,i){for(var s=0;s<i.length;s++)$t(i[s],i[++s],i[++s]);ht.__c&&ht.__c(t,e),e.some((function(t){try{e=t.__h,t.__h=[],e.some((function(e){e.call(t)}))}catch(i){ht.__e(i,t.__v)}}))}function Wt(e){return"object"!=typeof e||null==e||e.__b&&e.__b>0?e:Ct(e)?e.map(Wt):St({},e)}function $t(e,t,i){try{if("function"==typeof e){var s="function"==typeof e.__u;s&&e.__u(),s&&null==t||(e.__u=e(t))}else e.current=t}catch(n){ht.__e(n,i)}}function Vt(e,t,i){var s,n;if(ht.unmount&&ht.unmount(e),(s=e.ref)&&(s.current&&s.current!=e.__e||$t(s,null,t)),null!=(s=e.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(r){ht.__e(r,t)}s.base=s.__P=null}if(s=e.__k)for(n=0;n<s.length;n++)s[n]&&Vt(s[n],t,i||"function"!=typeof e.type);i||Pt(e.__e),e.__c=e.__=e.__e=void 0}function Xt(e,t,i){return this.constructor(e,i)}function Gt(e,t,i){var s,n,r,a;t==document&&(t=document.documentElement),ht.__&&ht.__(e,t),n=(s="function"==typeof i)?null:i&&i.__k||t.__k,r=[],a=[],jt(t,e=(!s&&i||t).__k=xt(kt,null,[e]),n||wt,wt,t.namespaceURI,!s&&i?[i]:n?null:t.firstChild?lt.call(t.childNodes):null,r,!s&&i?i:n?n.__e:t.firstChild,s,a),qt(r,e,a)}function Yt(e,t,i){var s,n,r,a,o=St({},e.props);for(r in e.type&&e.type.defaultProps&&(a=e.type.defaultProps),t)"key"==r?s=t[r]:"ref"==r?n=t[r]:o[r]=void 0===t[r]&&null!=a?a[r]:t[r];return arguments.length>2&&(o.children=arguments.length>3?lt.call(arguments,2):i),Ot(e.type,o,s||e.key,n||e.ref,null)}function Kt(e){return"object"==typeof e&&null!==e&&("nodeType"in e&&e.nodeType===Node.ELEMENT_NODE)}function Qt(e){for(var t;e&&!e.dir;)e=e.parentNode;return null==(t=e)?void 0:t.dir}lt=_t.slice,ht={__e:function(e,t,i,s){for(var n,r,a;t=t.__;)if((n=t.__c)&&!n.__)try{if((r=n.constructor)&&null!=r.getDerivedStateFromError&&(n.setState(r.getDerivedStateFromError(e)),a=n.__d),null!=n.componentDidCatch&&(n.componentDidCatch(e,s||{}),a=n.__d),a)return n.__E=n}catch(o){e=o}throw e}},pt=0,Dt.prototype.setState=function(e,t){var i;i=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=St({},this.state),"function"==typeof e&&(e=e(St({},i),this.props)),e&&St(i,e),null!=e&&this.__v&&(t&&this._sb.push(t),At(this))},Dt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),At(this))},Dt.prototype.render=kt,dt=[],ct="function"==typeof Promise?Promise.prototype.then.bind(Promise.resolve()):setTimeout,ft=function(e,t){return e.__v.__b-t.__v.__b},Mt.__r=0,mt=/(PointerCapture)$|Capture$/i,gt=0,yt=Lt(!1),vt=Lt(!0);class Zt{constructor(e,t){this.uppy=e,this.opts=null!=t?t:{}}getPluginState(){const{plugins:e}=this.uppy.getState();return(null==e?void 0:e[this.id])||{}}setPluginState(e){const{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(){const e=new p([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 Jt(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var ei=0;function ti(e){return"__private_"+ei+++"_"+e}var ii=ti("updateUI");class si extends Zt{constructor(){super(...arguments),Object.defineProperty(this,ii,{writable:!0,value:void 0})}getTargetPlugin(e){let t;if("function"==typeof(null==e?void 0:e.addTarget))t=e;else if("function"==typeof e){const i=e;this.uppy.iteratePlugins((e=>{e instanceof i&&(t=e)}))}return t}mount(e,t){const i=t.id,s=(n=e,void 0===r&&(r=document),"string"==typeof n?r.querySelector(n):Kt(n)?n:null);var n,r;if(s){this.isTargetDOMEl=!0;const t=document.createElement("div");return t.classList.add("uppy-Root"),Jt(this,ii)[ii]=function(e){let t,i=null;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];return t=n,i||(i=Promise.resolve().then((()=>(i=null,e(...t))))),i}}((e=>{this.uppy.getPlugin(this.id)&&(Gt(this.render(e),t),this.afterUpdate())})),this.uppy.log(`Installing ${i} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(s.innerHTML=""),Gt(this.render(this.uppy.getState()),t),this.el=t,s.appendChild(t),t.dir=this.opts.direction||Qt(t)||"ltr",this.onMount(),this.el}const a=this.getTargetPlugin(e);if(a)return this.uppy.log(`Installing ${i} to ${a.id}`),this.parent=a,this.el=a.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${i}`);let o=`Invalid target option given to ${i}.`;throw o+="function"==typeof e?" 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.":"If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){var t,i;null!=this.el&&(null==(t=(i=Jt(this,ii))[ii])||t.call(i,e))}unmount(){var e;this.isTargetDOMEl&&(null==(e=this.el)||e.remove());this.onUnmount()}onMount(){}onUnmount(){}}var ni=si;function ri(e,t,i,s){return 0===i||e===t?e:0===s?t:e+(t-e)*2**(-s/i)}var ai,oi={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},li={exports:{}};
/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/
ai=li,function(){var e={}.hasOwnProperty;function t(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=s(e,i(n)))}return e}function i(i){if("string"==typeof i||"number"==typeof i)return i;if("object"!=typeof i)return"";if(Array.isArray(i))return t.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var n="";for(var r in i)e.call(i,r)&&i[r]&&(n=s(n,r));return n}function s(e,t){return t?e?e+" "+t:e+t:e}ai.exports?(t.default=t,ai.exports=t):window.classNames=t}();var hi=li.exports;function pi(e){const t=[];let i,s="indeterminate";for(const{progress:n}of Object.values(e)){const{preprocess:e,postprocess:r}=n;null==i&&(e||r)&&({mode:s,message:i}=e||r),"determinate"===(null==e?void 0:e.mode)&&t.push(e.value),"determinate"===(null==r?void 0:r.mode)&&t.push(r.value)}return{mode:s,message:i,value:t.reduce(((e,i)=>e+i/t.length),0)}}function di(e){const t=(i=e,{hours:Math.floor(i/3600)%24,minutes:Math.floor(i/60)%60,seconds:Math.floor(i%60)});var i;return`${0===t.hours?"":`${t.hours}h`}${0===t.minutes?"":`${0===t.hours?t.minutes:` ${t.minutes.toString(10).padStart(2,"0")}`}m`}${0!==t.hours?"":`${0===t.minutes?t.seconds:` ${t.seconds.toString(10).padStart(2,"0")}`}s`}`}function ui(e){const{newFiles:t,isUploadStarted:i,recoveredState:s,i18n:n,uploadState:r,isSomeGhost:a,startUpload:o}=e,l=hi("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":r===oi.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),h=n(t&&i&&!s?"uploadXNewFiles":"uploadXFiles",{smart_count:t});return xt("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:t}),onClick:o,disabled:a,"data-uppy-super-focusable":!0},h)}function ci(e){const{i18n:t,uppy:i}=e;return xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":t("retryUpload"),onClick:()=>i.retryAll().catch((()=>{})),"data-uppy-super-focusable":!0,"data-cy":"retry"},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10"},xt("path",{d:"M4 2.408a2.75 2.75 0 1 0 2.75 2.75.626.626 0 0 1 1.25.018v.023a4 4 0 1 1-4-4.041V.25a.25.25 0 0 1 .389-.208l2.299 1.533a.25.25 0 0 1 0 .416l-2.3 1.533A.25.25 0 0 1 4 3.316v-.908z"})),t("retry"))}function fi(e){const{i18n:t,uppy:i}=e;return xt("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:t("cancel"),"aria-label":t("cancel"),onClick:()=>i.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},xt("g",{fill:"none",fillRule:"evenodd"},xt("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),xt("path",{fill:"#FFF",d:"M9.283 8l2.567 2.567-1.283 1.283L8 9.283 5.433 11.85 4.15 10.567 6.717 8 4.15 5.433 5.433 4.15 8 6.717l2.567-2.567 1.283 1.283z"}))))}function mi(e){const{isAllPaused:t,i18n:i,isAllComplete:s,resumableUploads:n,uppy:r}=e,a=i(t?"resume":"pause");return xt("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:function(){s||(n?t?r.resumeAll():r.pauseAll():r.cancelAll())},"data-cy":"togglePauseResume","data-uppy-super-focusable":!0},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16"},xt("g",{fill:"none",fillRule:"evenodd"},xt("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),xt("path",{fill:"#FFF",d:t?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"}))))}function gi(e){const{i18n:t,doneButtonHandler:i}=e;return xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:i,"data-uppy-super-focusable":!0},t("done"))}function yi(){return xt("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14"},xt("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0",fillRule:"evenodd"}))}function vi(e){const{progress:t}=e,{value:i,mode:s,message:n}=t;return xt("div",{className:"uppy-StatusBar-content"},xt(yi,null),"determinate"===s?`${Math.round(100*i)}% · `:"",n)}function bi(e){const{numUploads:t,complete:i,totalUploadedSize:s,totalSize:n,totalETA:r,i18n:a}=e,o=t>1;return xt("div",{className:"uppy-StatusBar-statusSecondary"},o&&a("filesUploadedOfTotal",{complete:i,smart_count:t}),xt("span",{className:"uppy-StatusBar-additionalInfo"},o&&" · ",a("dataUploadedOfTotal",{complete:fe(s),total:fe(n)})," · ",a("xTimeLeft",{time:di(r)})))}function wi(e){const{i18n:t,complete:i,numUploads:s}=e;return xt("div",{className:"uppy-StatusBar-statusSecondary"},t("filesUploadedOfTotal",{complete:i,smart_count:s}))}function _i(e){const{i18n:t,newFiles:i,startUpload:s}=e,n=hi("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return xt("div",{className:"uppy-StatusBar-statusSecondary"},xt("div",{className:"uppy-StatusBar-statusSecondaryHint"},t("xMoreFilesAdded",{smart_count:i})),xt("button",{type:"button",className:n,"aria-label":t("uploadXFiles",{smart_count:i}),onClick:s},t("upload")))}function Fi(e){const{i18n:t,supportsUploadProgress:i,totalProgress:s,showProgressDetails:n,isUploadStarted:r,isAllComplete:a,isAllPaused:o,newFiles:l,numUploads:h,complete:p,totalUploadedSize:d,totalSize:u,totalETA:c,startUpload:f}=e,m=l&&r;if(!r||a)return null;const g=t(o?"paused":"uploading");return xt("div",{className:"uppy-StatusBar-content","aria-label":g,title:g},o?null:xt(yi,null),xt("div",{className:"uppy-StatusBar-status"},xt("div",{className:"uppy-StatusBar-statusPrimary"},i?`${g}: ${s}%`:g),o||m||!n?null:i?xt(bi,{numUploads:h,complete:p,totalUploadedSize:d,totalSize:u,totalETA:c,i18n:t}):xt(wi,{i18n:t,complete:p,numUploads:h}),m?xt(_i,{i18n:t,newFiles:l,startUpload:f}):null))}function Ci(e){const{i18n:t}=e;return xt("div",{className:"uppy-StatusBar-content",role:"status",title:t("complete")},xt("div",{className:"uppy-StatusBar-status"},xt("div",{className:"uppy-StatusBar-statusPrimary"},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11"},xt("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})),t("complete"))))}function Si(e){const{error:t,i18n:i,complete:s,numUploads:n}=e;return xt("div",{className:"uppy-StatusBar-content",title:i("uploadFailed")},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11"},xt("path",{d:"M4.278 5.5L0 1.222 1.222 0 5.5 4.278 9.778 0 11 1.222 6.722 5.5 11 9.778 9.778 11 5.5 6.722 1.222 11 0 9.778z"})),xt("div",{className:"uppy-StatusBar-status"},xt("div",{className:"uppy-StatusBar-statusPrimary"},i("uploadFailed"),xt("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":i("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:function(){const e=`${i("uploadFailed")} \n\n ${t}`;alert(e)},type:"button"},"?")),xt(wi,{i18n:i,complete:s,numUploads:n})))}const{STATE_ERROR:Pi,STATE_WAITING:xi,STATE_PREPROCESSING:Oi,STATE_UPLOADING:ki,STATE_POSTPROCESSING:Di,STATE_COMPLETE:Ti}=oi;function Ei(e){const{newFiles:t,allowNewUpload:i,isUploadInProgress:s,isAllPaused:n,resumableUploads:r,error:a,hideUploadButton:o,hidePauseResumeButton:l,hideCancelButton:h,hideRetryButton:p,recoveredState:d,uploadState:u,totalProgress:c,files:f,supportsUploadProgress:m,hideAfterFinish:g,isSomeGhost:y,doneButtonHandler:v,isUploadStarted:b,i18n:w,startUpload:_,uppy:F,isAllComplete:C,showProgressDetails:S,numUploads:P,complete:x,totalSize:O,totalETA:k,totalUploadedSize:D}=e;const T=function(){switch(u){case Di:case Oi:{const e=pi(f);return"determinate"===e.mode?100*e.value:c}case Pi:return null;case ki:return m?c:null;default:return c}}(),E=function(){if(d)return!1;switch(u){case xi:return o||0===t;case Ti:return g;default:return!1}}(),A=null!=T?T:100,M=!a&&t&&!s&&!n&&i&&!o,N=!h&&u!==xi&&u!==Ti,U=r&&!l&&u===ki,B=a&&!C&&!p,I=v&&u===Ti,R=hi("uppy-StatusBar-progress",{"is-indeterminate":function(){switch(u){case Di:case Oi:{const{mode:e}=pi(f);return"indeterminate"===e}case ki:return!m;default:return!1}}()});return xt("div",{className:hi("uppy-StatusBar",`is-${u}`,{"has-ghosts":y}),"aria-hidden":E},xt("div",{className:R,style:{width:`${A}%`},role:"progressbar","aria-label":`${A}%`,"aria-valuetext":`${A}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":T}),(()=>{switch(u){case Oi:case Di:return xt(vi,{progress:pi(f)});case Ti:return xt(Ci,{i18n:w});case Pi:return xt(Si,{error:a,i18n:w,numUploads:P,complete:x});case ki:return xt(Fi,{i18n:w,supportsUploadProgress:m,totalProgress:c,showProgressDetails:S,isUploadStarted:b,isAllComplete:C,isAllPaused:n,newFiles:t,numUploads:P,complete:x,totalUploadedSize:D,totalSize:O,totalETA:k,startUpload:_});default:return null}})(),xt("div",{className:"uppy-StatusBar-actions"},d||M?xt(ui,{newFiles:t,isUploadStarted:b,recoveredState:d,i18n:w,isSomeGhost:y,startUpload:_,uploadState:u}):null,B?xt(ci,{i18n:w,uppy:F}):null,U?xt(mi,{isAllPaused:n,i18n:w,isAllComplete:C,resumableUploads:r,uppy:F}):null,N?xt(fi,{i18n:w,uppy:F}):null,I?xt(gi,{i18n:w,doneButtonHandler:v}):null))}Ei.defaultProps={doneButtonHandler:void 0,hideAfterFinish:!1,hideCancelButton:!1,hidePauseResumeButton:!1,hideRetryButton:!1,hideUploadButton:void 0,showProgressDetails:void 0};var Ai={strings:{uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",done:"Done",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},upload:"Upload",retryUpload:"Retry upload",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function Mi(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Ni=0;function Ui(e){return"__private_"+Ni+++"_"+e}function Bi(e,t,i,s){if(e)return oi.STATE_ERROR;if(t)return oi.STATE_COMPLETE;if(i)return oi.STATE_WAITING;let n=oi.STATE_WAITING;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:e}=s[r[a]];if(e.uploadStarted&&!e.uploadComplete)return oi.STATE_UPLOADING;e.preprocess&&(n=oi.STATE_PREPROCESSING),e.postprocess&&n!==oi.STATE_PREPROCESSING&&(n=oi.STATE_POSTPROCESSING)}return n}const Ii={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,hideAfterFinish:!0,doneButtonHandler:null};var Ri=Ui("lastUpdateTime"),zi=Ui("previousUploadedBytes"),Li=Ui("previousSpeed"),ji=Ui("previousETA"),Hi=Ui("computeSmoothETA"),qi=Ui("onUploadStart");class Wi extends ni{constructor(e,t){super(e,{...Ii,...t}),Object.defineProperty(this,Hi,{value:$i}),Object.defineProperty(this,Ri,{writable:!0,value:void 0}),Object.defineProperty(this,zi,{writable:!0,value:void 0}),Object.defineProperty(this,Li,{writable:!0,value:void 0}),Object.defineProperty(this,ji,{writable:!0,value:void 0}),this.startUpload=()=>this.uppy.upload().catch((()=>{})),Object.defineProperty(this,qi,{writable:!0,value:()=>{const{recoveredState:e}=this.uppy.getState();if(Mi(this,Li)[Li]=null,Mi(this,ji)[ji]=null,e)return Mi(this,zi)[zi]=Object.values(e.files).reduce(((e,t)=>{let{progress:i}=t;return e+i.bytesUploaded}),0),void this.uppy.emit("restore-confirmed");Mi(this,Ri)[Ri]=performance.now(),Mi(this,zi)[zi]=0}}),this.id=this.opts.id||"StatusBar",this.title="StatusBar",this.type="progressindicator",this.defaultLocale=Ai,this.i18nInit(),this.render=this.render.bind(this),this.install=this.install.bind(this)}render(e){const{capabilities:t,files:i,allowNewUpload:s,totalProgress:n,error:r,recoveredState:a}=e,{newFiles:o,startedFiles:l,completeFiles:h,isUploadStarted:p,isAllComplete:d,isAllErrored:u,isAllPaused:c,isUploadInProgress:f,isSomeGhost:m}=this.uppy.getObjectOfFilesPerState(),g=a?Object.values(i):o,y=!!t.resumableUploads,v=!1!==t.uploadProgress;let b=0,w=0;l.forEach((e=>{b+=e.progress.bytesTotal||0,w+=e.progress.bytesUploaded||0}));const _=Mi(this,Hi)[Hi]({uploaded:w,total:b,remaining:b-w});return Ei({error:r,uploadState:Bi(r,d,a,e.files||{}),allowNewUpload:s,totalProgress:n,totalSize:b,totalUploadedSize:w,isAllComplete:!1,isAllPaused:c,isAllErrored:u,isUploadStarted:p,isUploadInProgress:f,isSomeGhost:m,recoveredState:a,complete:h.length,newFiles:g.length,numUploads:l.length,totalETA:_,files:i,i18n:this.i18n,uppy:this.uppy,startUpload:this.startUpload,doneButtonHandler:this.opts.doneButtonHandler,resumableUploads:y,supportsUploadProgress:v,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})}onMount(){const e=this.el;Qt(e)||(e.dir="ltr")}install(){const{target:e}=this.opts;e&&this.mount(e,this),this.uppy.on("upload",Mi(this,qi)[qi]),Mi(this,Ri)[Ri]=performance.now(),Mi(this,zi)[zi]=this.uppy.getFiles().reduce(((e,t)=>e+t.progress.bytesUploaded),0)}uninstall(){this.unmount(),this.uppy.off("upload",Mi(this,qi)[qi])}}function $i(e){var t;if(0===e.total||0===e.remaining)return 0;null!=(t=Mi(this,Ri))[Ri]||(t[Ri]=performance.now());const i=performance.now()-Mi(this,Ri)[Ri];var s;if(0===i)return Math.round((null!=(s=Mi(this,ji)[ji])?s:0)/100)/10;const n=e.uploaded-Mi(this,zi)[zi];var r;if(Mi(this,zi)[zi]=e.uploaded,n<=0)return Math.round((null!=(r=Mi(this,ji)[ji])?r:0)/100)/10;const a=n/i,o=null==Mi(this,Li)[Li]?a:ri(a,Mi(this,Li)[Li],2e3,i);Mi(this,Li)[Li]=o;const l=e.remaining/o,h=Math.max(Mi(this,ji)[ji]-i,0),p=null==Mi(this,ji)[ji]?l:ri(l,h,2e3,i);return Mi(this,ji)[ji]=p,Mi(this,Ri)[Ri]=performance.now(),Math.round(p/100)/10}Wi.VERSION="3.3.3";class Vi extends Dt{constructor(){super(...arguments),this.ref={current:null}}componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,300)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,300)}render(){const{children:e}=this.props;return xt("div",{className:"uppy-Informer-animated",ref:this.ref},e)}}function Xi(e){const t={};for(let r=0;r<e.length;r++)if(null!=e[r]){t[(i=e[r],s=r.toString(36),n=void 0,null!=(n=null==i?void 0:i.key)?n:s)]=e[r]}var i,s,n;return t}function Gi(e,t){e=e||{},t=t||{};const i=i=>t.hasOwnProperty(i)?t[i]:e[i],s={};let n=[];for(const a in e)t.hasOwnProperty(a)?n.length&&(s[a]=n,n=[]):n.push(a);const r={};for(const a in t){if(s.hasOwnProperty(a))for(let e=0;e<s[a].length;e++){const t=s[a][e];r[s[a][e]]=i(t)}r[a]=i(a)}for(let a=0;a<n.length;a++)r[n[a]]=i(n[a]);return r}class Yi extends Dt{constructor(e,t){super(e,t),this.refs={},this.state={children:Xi(Bt(Bt(this.props.children))||[])},this.performAppear=this.performAppear.bind(this),this.performEnter=this.performEnter.bind(this),this.performLeave=this.performLeave.bind(this)}componentWillMount(){this.currentlyTransitioningKeys={},this.keysToAbortLeave=[],this.keysToEnter=[],this.keysToLeave=[]}componentDidMount(){const e=this.state.children;for(const t in e)e[t]&&this.performAppear(t)}componentWillReceiveProps(e){const t=Xi(Bt(e.children)||[]),i=this.state.children;let s;for(s in this.setState((e=>({children:Gi(e.children,t)}))),t)if(t.hasOwnProperty(s)){const e=i&&i.hasOwnProperty(s);t[s]&&e&&this.currentlyTransitioningKeys[s]?(this.keysToEnter.push(s),this.keysToAbortLeave.push(s)):!t[s]||e||this.currentlyTransitioningKeys[s]||this.keysToEnter.push(s)}for(s in i)if(i.hasOwnProperty(s)){const e=t&&t.hasOwnProperty(s);!i[s]||e||this.currentlyTransitioningKeys[s]||this.keysToLeave.push(s)}}componentDidUpdate(){const{keysToEnter:e}=this;this.keysToEnter=[],e.forEach(this.performEnter);const{keysToLeave:t}=this;this.keysToLeave=[],t.forEach(this.performLeave)}_finishAbort(e){const t=this.keysToAbortLeave.indexOf(e);-1!==t&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];null!=t&&t.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Xi(Bt(this.props.children)||[]);i&&i.hasOwnProperty(e)||this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];null!=t&&t.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const i=Xi(Bt(this.props.children)||[]);i&&i.hasOwnProperty(e)||this.performLeave(e)}performLeave(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];null!=t&&t.componentWillLeave?t.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(-1!==this.keysToAbortLeave.indexOf(e))return;const t=this.refs[e];null!=t&&t.componentDidLeave&&t.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const i=Xi(Bt(this.props.children)||[]);if(i&&i.hasOwnProperty(e))this.performEnter(e);else{const t=(s={},n=this.state.children,Object.assign(s,n));delete t[e],this.setState({children:t})}var s,n}render(e,t){let{childFactory:i,transitionLeave:s,transitionName:n,transitionAppear:r,transitionEnter:a,transitionLeaveTimeout:o,transitionEnterTimeout:l,transitionAppearTimeout:h,component:p,...d}=e,{children:u}=t;const c=Object.entries(u).map((e=>{let[t,s]=e;if(!s)return;const n=function(e,t){const i=e._ptgLinkedRefs||(e._ptgLinkedRefs={});return i[t]||(i[t]=i=>{e.refs[t]=i})}(this,t);return Yt(i(s),{ref:n,key:t})})).filter(Boolean);return xt(p,d,c)}}Yi.defaultProps={component:"span",childFactory:e=>e};class Ki extends ni{constructor(e,t){super(e,t),this.render=e=>xt("div",{className:"uppy uppy-Informer"},xt(Yi,null,e.info.map((e=>xt(Vi,{key:e.message},xt("p",{role:"alert"},e.message," ",e.details&&xt("span",{"aria-label":e.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${e.message} \n\n ${e.details}`)},"?"))))))),this.type="progressindicator",this.id=this.opts.id||"Informer",this.title="Informer"}install(){const{target:e}=this.opts;e&&this.mount(e,this)}}Ki.VERSION="3.1.0";const Qi=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function Zi(e){return e.startsWith("blob:")}function Ji(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}function es(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}var ts="undefined"!=typeof self?self:global;const is="undefined"!=typeof navigator,ss=is&&"undefined"==typeof HTMLImageElement,ns=!("undefined"==typeof global||"undefined"==typeof process||!process.versions||!process.versions.node),rs=ts.Buffer,as=!!rs,os=e=>void 0!==e;function ls(e){return void 0===e||(e instanceof Map?0===e.size:0===Object.values(e).filter(os).length)}function hs(e){let t=new Error(e);throw delete t.stack,t}function ps(e){let t=function(e){let t=0;return e.ifd0.enabled&&(t+=1024),e.exif.enabled&&(t+=2048),e.makerNote&&(t+=2048),e.userComment&&(t+=1024),e.gps.enabled&&(t+=512),e.interop.enabled&&(t+=100),e.ifd1.enabled&&(t+=1024),t+2048}(e);return e.jfif.enabled&&(t+=50),e.xmp.enabled&&(t+=2e4),e.iptc.enabled&&(t+=14e3),e.icc.enabled&&(t+=6e3),t}const ds=e=>String.fromCharCode.apply(null,e),us="undefined"!=typeof TextDecoder?new TextDecoder("utf-8"):void 0;class cs{static from(e,t){return e instanceof this&&e.le===t?e:new cs(e,void 0,void 0,t)}constructor(e,t=0,i,s){if("boolean"==typeof s&&(this.le=s),Array.isArray(e)&&(e=new Uint8Array(e)),0===e)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){void 0===i&&(i=e.byteLength-t);let s=new DataView(e,t,i);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof cs){void 0===i&&(i=e.byteLength-t),(t+=e.byteOffset)+i>e.byteOffset+e.byteLength&&hs("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,i);this._swapDataView(s)}else if("number"==typeof e){let t=new DataView(new ArrayBuffer(e));this._swapDataView(t)}else hs("Invalid input argument for BufferView: "+e)}_swapArrayBuffer(e){this._swapDataView(new DataView(e))}_swapBuffer(e){this._swapDataView(new DataView(e.buffer,e.byteOffset,e.byteLength))}_swapDataView(e){this.dataView=e,this.buffer=e.buffer,this.byteOffset=e.byteOffset,this.byteLength=e.byteLength}_lengthToEnd(e){return this.byteLength-e}set(e,t,i=cs){return e instanceof DataView||e instanceof cs?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||hs("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new i(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new cs(this,e,t)}toUint8(){return new Uint8Array(this.buffer,this.byteOffset,this.byteLength)}getUint8Array(e,t){return new Uint8Array(this.buffer,this.byteOffset+e,t)}getString(e=0,t=this.byteLength){return i=this.getUint8Array(e,t),us?us.decode(i):as?Buffer.from(i).toString("utf8"):decodeURIComponent(escape(ds(i)));var i}getLatin1String(e=0,t=this.byteLength){let i=this.getUint8Array(e,t);return ds(i)}getUnicodeString(e=0,t=this.byteLength){const i=[];for(let s=0;s<t&&e+s<this.byteLength;s+=2)i.push(this.getUint16(e+s));return ds(i)}getInt8(e){return this.dataView.getInt8(e)}getUint8(e){return this.dataView.getUint8(e)}getInt16(e,t=this.le){return this.dataView.getInt16(e,t)}getInt32(e,t=this.le){return this.dataView.getInt32(e,t)}getUint16(e,t=this.le){return this.dataView.getUint16(e,t)}getUint32(e,t=this.le){return this.dataView.getUint32(e,t)}getFloat32(e,t=this.le){return this.dataView.getFloat32(e,t)}getFloat64(e,t=this.le){return this.dataView.getFloat64(e,t)}getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,i){switch(t){case 1:return this.getUint8(e,i);case 2:return this.getUint16(e,i);case 4:return this.getUint32(e,i);case 8:return this.getUint64&&this.getUint64(e,i)}}getUint(e,t,i){switch(t){case 8:return this.getUint8(e,i);case 16:return this.getUint16(e,i);case 32:return this.getUint32(e,i);case 64:return this.getUint64&&this.getUint64(e,i)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function fs(e,t){hs(`${e} '${t}' was not loaded, try using full build of exifr.`)}class ms extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||fs(this.kind,e),t&&(e in t||hs(`Unknown ${this.kind} '${e}'.`),t[e].enabled||fs(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var gs=new ms("file parser"),ys=new ms("segment parser"),vs=new ms("file reader");let bs=ts.fetch;function ws(e,t){return(i=e).startsWith("data:")||i.length>1e4?Fs(e,t,"base64"):ns&&e.includes("://")?_s(e,t,"url",Cs):ns?Fs(e,t,"fs"):is?_s(e,t,"url",Cs):void hs("Invalid input argument");var i}async function _s(e,t,i,s){return vs.has(i)?Fs(e,t,i):s?async function(e,t){let i=await t(e);return new cs(i)}(e,s):void hs(`Parser ${i} is not loaded`)}async function Fs(e,t,i){let s=new(vs.get(i))(e,t);return await s.read(),s}const Cs=e=>bs(e).then((e=>e.arrayBuffer())),Ss=e=>new Promise(((t,i)=>{let s=new FileReader;s.onloadend=()=>t(s.result||new ArrayBuffer),s.onerror=i,s.readAsArrayBuffer(e)}));class Ps extends Map{get tagKeys(){return this.allKeys||(this.allKeys=Array.from(this.keys())),this.allKeys}get tagValues(){return this.allValues||(this.allValues=Array.from(this.values())),this.allValues}}function xs(e,t,i){let s=new Ps;for(let[n,r]of i)s.set(n,r);if(Array.isArray(t))for(let n of t)e.set(n,s);else e.set(t,s);return s}function Os(e,t,i){let s,n=e.get(t);for(s of i)n.set(s[0],s[1])}const ks=new Map,Ds=new Map,Ts=new Map,Es=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],As=["jfif","xmp","icc","iptc","ihdr"],Ms=["tiff",...As],Ns=["ifd0","ifd1","exif","gps","interop"],Us=[...Ms,...Ns],Bs=["makerNote","userComment"],Is=["translateKeys","translateValues","reviveValues","multiSegment"],Rs=[...Is,"sanitize","mergeOutput","silentErrors"];class zs{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Ls extends zs{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,i,s){if(super(),es(this,"enabled",!1),es(this,"skip",new Set),es(this,"pick",new Set),es(this,"deps",new Set),es(this,"translateKeys",!1),es(this,"translateValues",!1),es(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(s),this.canBeFiltered=Ns.includes(e),this.canBeFiltered&&(this.dict=ks.get(e)),void 0!==i)if(Array.isArray(i))this.parse=this.enabled=!0,this.canBeFiltered&&i.length>0&&this.translateTagSet(i,this.pick);else if("object"==typeof i){if(this.enabled=!0,this.parse=!1!==i.parse,this.canBeFiltered){let{pick:e,skip:t}=i;e&&e.length>0&&this.translateTagSet(e,this.pick),t&&t.length>0&&this.translateTagSet(t,this.skip)}this.applyInheritables(i)}else!0===i||!1===i?this.parse=this.enabled=i:hs(`Invalid options argument: ${i}`)}applyInheritables(e){let t,i;for(t of Is)i=e[t],void 0!==i&&(this[t]=i)}translateTagSet(e,t){if(this.dict){let i,s,{tagKeys:n,tagValues:r}=this.dict;for(i of e)"string"==typeof i?(s=r.indexOf(i),-1===s&&(s=n.indexOf(Number(i))),-1!==s&&t.add(Number(n[s]))):t.add(i)}else for(let i of e)t.add(i)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,Vs(this.pick,this.deps)):this.enabled&&this.pick.size>0&&Vs(this.pick,this.deps)}}var js={jfif:!1,tiff:!0,xmp:!1,icc:!1,iptc:!1,ifd0:!0,ifd1:!1,exif:!0,gps:!0,interop:!1,ihdr:void 0,makerNote:!1,userComment:!1,multiSegment:!1,skip:[],pick:[],translateKeys:!0,translateValues:!0,reviveValues:!0,sanitize:!0,mergeOutput:!0,silentErrors:!0,chunked:!0,firstChunkSize:void 0,firstChunkSizeNode:512,firstChunkSizeBrowser:65536,chunkSize:65536,chunkLimit:5},Hs=new Map;class qs extends zs{static useCached(e){let t=Hs.get(e);return void 0!==t||(t=new this(e),Hs.set(e,t)),t}constructor(e){super(),!0===e?this.setupFromTrue():void 0===e?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):"object"==typeof e?this.setupFromObject(e):hs(`Invalid options argument ${e}`),void 0===this.firstChunkSize&&(this.firstChunkSize=is?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Es)this[e]=js[e];for(e of Rs)this[e]=js[e];for(e of Bs)this[e]=js[e];for(e of Us)this[e]=new Ls(e,js[e],void 0,this)}setupFromTrue(){let e;for(e of Es)this[e]=js[e];for(e of Rs)this[e]=js[e];for(e of Bs)this[e]=!0;for(e of Us)this[e]=new Ls(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Es)this[t]=js[t];for(t of Rs)this[t]=js[t];for(t of Bs)this[t]=js[t];for(t of Us)this[t]=new Ls(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,Ns)}setupFromObject(e){let t;for(t of(Ns.ifd0=Ns.ifd0||Ns.image,Ns.ifd1=Ns.ifd1||Ns.thumbnail,Object.assign(this,e),Es))this[t]=$s(e[t],js[t]);for(t of Rs)this[t]=$s(e[t],js[t]);for(t of Bs)this[t]=$s(e[t],js[t]);for(t of Ms)this[t]=new Ls(t,js[t],e[t],this);for(t of Ns)this[t]=new Ls(t,js[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,Ns,Us),!0===e.tiff?this.batchEnableWithBool(Ns,!0):!1===e.tiff?this.batchEnableWithUserValue(Ns,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,Ns):"object"==typeof e.tiff&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,Ns)}batchEnableWithBool(e,t){for(let i of e)this[i].enabled=t}batchEnableWithUserValue(e,t){for(let i of e){let e=t[i];this[i].enabled=!1!==e&&void 0!==e}}setupGlobalFilters(e,t,i,s=i){if(e&&e.length){for(let e of s)this[e].enabled=!1;let t=Ws(e,i);for(let[e,i]of t)Vs(this[e].pick,i),this[e].enabled=!0}else if(t&&t.length){let e=Ws(t,i);for(let[t,i]of e)Vs(this[t].skip,i)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:i,iptc:s,icc:n}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),i.enabled||e.skip.add(700),s.enabled||e.skip.add(33723),n.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:i,interop:s}=this;s.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),i.needed&&e.deps.add(34853),this.tiff.enabled=Ns.some((e=>!0===this[e].enabled))||this.makerNote||this.userComment;for(let n of Ns)this[n].finalizeFilters()}get onlyTiff(){return!As.map((e=>this[e].enabled)).some((e=>!0===e))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of Ms)this[e].enabled&&!ys.has(e)&&fs("segment parser",e)}}function Ws(e,t){let i,s,n,r,a=[];for(n of t){for(r of(i=ks.get(n),s=[],i))(e.includes(r[0])||e.includes(r[1]))&&s.push(r[0]);s.length&&a.push([n,s])}return a}function $s(e,t){return void 0!==e?e:void 0!==t?t:void 0}function Vs(e,t){for(let i of t)e.add(i)}es(qs,"default",js);class Xs{constructor(e){es(this,"parsers",{}),es(this,"output",{}),es(this,"errors",[]),es(this,"pushToErrors",(e=>this.errors.push(e))),this.options=qs.useCached(e)}async read(e){var t,i;this.file=await(t=e,i=this.options,"string"==typeof t?ws(t,i):is&&!ss&&t instanceof HTMLImageElement?ws(t.src,i):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new cs(t):is&&t instanceof Blob?_s(t,i,"blob",Ss):void hs("Invalid input argument"))}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[i,s]of gs)if(s.canHandle(e,t))return this.fileParser=new s(this.options,this.file,this.parsers),e[i]=!0;this.file.close&&this.file.close(),hs("Unknown file format")}async parse(){let{output:e,errors:t}=this;return this.setup(),this.options.silentErrors?(await this.executeParsers().catch(this.pushToErrors),t.push(...this.fileParser.errors)):await this.executeParsers(),this.file.close&&this.file.close(),this.options.silentErrors&&t.length>0&&(e.errors=t),ls(i=e)?void 0:i;var i}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async t=>{let i=await t.parse();t.assignToOutput(e,i)}));this.options.silentErrors&&(t=t.map((e=>e.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,i=ys.get("tiff",e);var s;if(t.tiff?s={start:0,type:"tiff"}:t.jpeg&&(s=await this.fileParser.getOrFindSegment("tiff")),void 0===s)return;let n=await this.fileParser.ensureSegmentChunk(s),r=this.parsers.tiff=new i(n,e,t),a=await r.extractThumbnail();return t.close&&t.close(),a}}async function Gs(e,t){let i=new Xs(t);return await i.read(e),i.parse()}var Ys=Object.freeze({__proto__:null,parse:Gs,Exifr:Xs,fileParsers:gs,segmentParsers:ys,fileReaders:vs,tagKeys:ks,tagValues:Ds,tagRevivers:Ts,createDictionary:xs,extendDictionary:Os,fetchUrlAsArrayBuffer:Cs,readBlobAsArrayBuffer:Ss,chunkedProps:Es,otherSegments:As,segments:Ms,tiffBlocks:Ns,segmentsAndBlocks:Us,tiffExtractables:Bs,inheritables:Is,allFormatters:Rs,Options:qs});class Ks{static findPosition(e,t){let i=e.getUint16(t+2)+2,s="function"==typeof this.headerLength?this.headerLength(e,t,i):this.headerLength,n=t+s,r=i-s;return{offset:t,length:i,headerLength:s,start:n,size:r,end:n+r}}static parse(e,t={}){return new this(e,new qs({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof cs?e:new cs(e)}constructor(e,t={},i){es(this,"errors",[]),es(this,"raw",new Map),es(this,"handleError",(e=>{if(!this.options.silentErrors)throw e;this.errors.push(e.message)})),this.chunk=this.normalizeInput(e),this.file=i,this.type=this.constructor.type,this.globalOptions=this.options=t,this.localOptions=t[this.type],this.canTranslate=this.localOptions&&this.localOptions.translate}translate(){this.canTranslate&&(this.translated=this.translateBlock(this.raw,this.type))}get output(){return this.translated?this.translated:this.raw?Object.fromEntries(this.raw):void 0}translateBlock(e,t){let i=Ts.get(t),s=Ds.get(t),n=ks.get(t),r=this.options[t],a=r.reviveValues&&!!i,o=r.translateValues&&!!s,l=r.translateKeys&&!!n,h={};for(let[p,d]of e)a&&i.has(p)?d=i.get(p)(d):o&&s.has(p)&&(d=this.translateValue(d,s.get(p))),l&&n.has(p)&&(p=n.get(p)||p),h[p]=d;return h}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,i){if(this.globalOptions.mergeOutput)return Object.assign(e,i);e[t]?Object.assign(e[t],i):e[t]=i}}function Qs(e){return 192===e||194===e||196===e||219===e||221===e||218===e||254===e}function Zs(e){return e>=224&&e<=239}function Js(e,t,i){for(let[s,n]of ys)if(n.canHandle(e,t,i))return s}es(Ks,"headerLength",4),es(Ks,"type",void 0),es(Ks,"multiSegment",!1),es(Ks,"canHandle",(()=>!1));class en extends class{constructor(e,t,i){es(this,"errors",[]),es(this,"ensureSegmentChunk",(async e=>{let t=e.start,i=e.size||65536;if(this.file.chunked)if(this.file.available(t,i))e.chunk=this.file.subarray(t,i);else try{e.chunk=await this.file.readChunk(t,i)}catch(s){hs(`Couldn't read segment: ${JSON.stringify(e)}. ${s.message}`)}else this.file.byteLength>t+i?e.chunk=this.file.subarray(t,i):void 0===e.size?e.chunk=this.file.subarray(t):hs("Segment unreachable: "+JSON.stringify(e));return e.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=i}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let i=new(ys.get(e))(t,this.options,this.file);return this.parsers[e]=i}createParsers(e){for(let t of e){let{type:e,chunk:i}=t,s=this.options[e];if(s&&s.enabled){let t=this.parsers[e];t&&t.append||t||this.createParser(e,i)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),es(this,"appSegments",[]),es(this,"jpegSegments",[]),es(this,"unknownSegments",[])}static canHandle(e,t){return 65496===t}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){!0===e?(this.findAll=!0,this.wanted=new Set(ys.keyList())):(e=void 0===e?ys.keyList().filter((e=>this.options[e].enabled)):e.filter((e=>this.options[e].enabled&&ys.has(e))),this.findAll=!1,this.remaining=new Set(e),this.wanted=new Set(e)),this.unfinishedMultiSegment=!1}async findAppSegments(e=0,t){this.setupSegmentFinderArgs(t);let{file:i,findAll:s,wanted:n,remaining:r}=this;if(!s&&this.file.chunked&&(s=Array.from(n).some((e=>{let t=ys.get(e),i=this.options[e];return t.multiSegment&&i.multiSegment})),s&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,i.byteLength),!this.options.onlyTiff&&i.chunked){let t=!1;for(;r.size>0&&!t&&(i.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:s}=i,n=this.appSegments.some((e=>!this.file.available(e.offset||e.start,e.length||e.size)));if(t=e>s&&!n?!(await i.readNextChunk(e)):!(await i.readNextChunk(s)),void 0===(e=this.findAppSegmentsInRange(e,i.byteLength)))return}}}findAppSegmentsInRange(e,t){t-=2;let i,s,n,r,a,o,{file:l,findAll:h,wanted:p,remaining:d,options:u}=this;for(;e<t;e++)if(255===l.getUint8(e))if(i=l.getUint8(e+1),Zs(i)){if(s=l.getUint16(e+2),n=Js(l,e,s),n&&p.has(n)&&(r=ys.get(n),a=r.findPosition(l,e),o=u[n],a.type=n,this.appSegments.push(a),!h&&(r.multiSegment&&o.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||d.delete(n)):d.delete(n),0===d.size)))break;u.recordUnknownSegments&&(a=Ks.findPosition(l,e),a.marker=i,this.unknownSegments.push(a)),e+=s+1}else if(Qs(i)){if(s=l.getUint16(e+2),218===i&&!1!==u.stopAfterSos)return;u.recordJpegSegments&&this.jpegSegments.push({offset:e,length:s,marker:i}),e+=s+1}return e}mergeMultiSegments(){if(!this.appSegments.some((e=>e.multiSegment)))return;let e=function(e,t){let i,s,n,r=new Map;for(let a=0;a<e.length;a++)i=e[a],s=i.type,r.has(s)?n=r.get(s):r.set(s,n=[]),n.push(i);return Array.from(r)}(this.appSegments);this.mergedAppSegments=e.map((([e,t])=>{let i=ys.get(e,this.options);return i.handleMultiSegments?{type:e,chunk:i.handleMultiSegments(t)}:t[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return void 0===t&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}es(en,"type","jpeg"),gs.set("jpeg",en);const tn=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class sn extends Ks{parseHeader(){var e=this.chunk.getUint16();18761===e?this.le=!0:19789===e&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,i=new Map){let{pick:s,skip:n}=this.options[t];s=new Set(s);let r=s.size>0,a=0===n.size,o=this.chunk.getUint16(e);e+=2;for(let l=0;l<o;l++){let o=this.chunk.getUint16(e);if(r){if(s.has(o)&&(i.set(o,this.parseTag(e,o,t)),s.delete(o),0===s.size))break}else!a&&n.has(o)||i.set(o,this.parseTag(e,o,t));e+=12}return i}parseTag(e,t,i){let{chunk:s}=this,n=s.getUint16(e+2),r=s.getUint32(e+4),a=tn[n];if(a*r<=4?e+=8:e=s.getUint32(e+8),(n<1||n>13)&&hs(`Invalid TIFF value type. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e}`),e>s.byteLength&&hs(`Invalid TIFF value offset. block: ${i.toUpperCase()}, tag: ${t.toString(16)}, type: ${n}, offset ${e} is outside of chunk size ${s.byteLength}`),1===n)return s.getUint8Array(e,r);if(2===n)return""===(o=function(e){for(;e.endsWith("\0");)e=e.slice(0,-1);return e}(o=s.getString(e,r)).trim())?void 0:o;var o;if(7===n)return s.getUint8Array(e,r);if(1===r)return this.parseTagValue(n,e);{let t=new(function(e){switch(e){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:case 10:default:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 11:return Float32Array;case 12:return Float64Array}}(n))(r),i=a;for(let s=0;s<r;s++)t[s]=this.parseTagValue(n,e),e+=i;return t}}parseTagValue(e,t){let{chunk:i}=this;switch(e){case 1:return i.getUint8(t);case 3:return i.getUint16(t);case 4:case 13:return i.getUint32(t);case 5:return i.getUint32(t)/i.getUint32(t+4);case 6:return i.getInt8(t);case 8:return i.getInt16(t);case 9:return i.getInt32(t);case 10:return i.getInt32(t)/i.getInt32(t+4);case 11:return i.getFloat(t);case 12:return i.getDouble(t);default:hs(`Invalid tiff type ${e}`)}}}class nn extends sn{static canHandle(e,t){return 225===e.getUint8(t+1)&&1165519206===e.getUint32(t+4)&&0===e.getUint16(t+8)}async parse(){this.parseHeader();let{options:e}=this;return e.ifd0.enabled&&await this.parseIfd0Block(),e.exif.enabled&&await this.safeParse("parseExifBlock"),e.gps.enabled&&await this.safeParse("parseGpsBlock"),e.interop.enabled&&await this.safeParse("parseInteropBlock"),e.ifd1.enabled&&await this.safeParse("parseThumbnailBlock"),this.createOutput()}safeParse(e){let t=this[e]();return void 0!==t.catch&&(t=t.catch(this.handleError)),t}findIfd0Offset(){void 0===this.ifd0Offset&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(void 0===this.ifd1Offset){this.findIfd0Offset();let e=this.chunk.getUint16(this.ifd0Offset),t=this.ifd0Offset+2+12*e;this.ifd1Offset=this.chunk.getUint32(t)}}parseBlock(e,t){let i=new Map;return this[t]=i,this.parseTags(e,t,i),i}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&hs("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&hs(`IFD0 offset points to outside of file.\nthis.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,ps(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return 0!==t.size?(this.exifOffset=t.get(34665),this.interopOffset=t.get(40965),this.gpsOffset=t.get(34853),this.xmp=t.get(700),this.iptc=t.get(33723),this.icc=t.get(34675),this.options.sanitize&&(t.delete(34665),t.delete(40965),t.delete(34853),t.delete(700),t.delete(33723),t.delete(34675)),t):void 0}async parseExifBlock(){if(this.exif)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.exifOffset)return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,ps(this.options));let e=this.parseBlock(this.exifOffset,"exif");return this.interopOffset||(this.interopOffset=e.get(40965)),this.makerNote=e.get(37500),this.userComment=e.get(37510),this.options.sanitize&&(e.delete(40965),e.delete(37500),e.delete(37510)),this.unpack(e,41728),this.unpack(e,41729),e}unpack(e,t){let i=e.get(t);i&&1===i.length&&e.set(t,i[0])}async parseGpsBlock(){if(this.gps)return;if(this.ifd0||await this.parseIfd0Block(),void 0===this.gpsOffset)return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",rn(...e.get(2),e.get(1))),e.set("longitude",rn(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),void 0!==this.interopOffset||this.exif||await this.parseExifBlock(),void 0!==this.interopOffset))return this.parseBlock(this.interopOffset,"interop")}async parseThumbnailBlock(e=!1){if(!this.ifd1&&!this.ifd1Parsed&&(!this.options.mergeOutput||e))return this.findIfd1Offset(),this.ifd1Offset>0&&(this.parseBlock(this.ifd1Offset,"ifd1"),this.ifd1Parsed=!0),this.ifd1}async extractThumbnail(){if(this.headerParsed||this.parseHeader(),this.ifd1Parsed||await this.parseThumbnailBlock(!0),void 0===this.ifd1)return;let e=this.ifd1.get(513),t=this.ifd1.get(514);return this.chunk.getUint8Array(e,t)}get image(){return this.ifd0}get thumbnail(){return this.ifd1}createOutput(){let e,t,i,s={};for(t of Ns)if(e=this[t],!ls(e))if(i=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if("ifd1"===t)continue;Object.assign(s,i)}else s[t]=i;return this.makerNote&&(s.makerNote=this.makerNote),this.userComment&&(s.userComment=this.userComment),s}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[i,s]of Object.entries(t))this.assignObjectToOutput(e,i,s)}}function rn(e,t,i,s){var n=e+t/60+i/3600;return"S"!==s&&"W"!==s||(n*=-1),n}es(nn,"type","tiff"),es(nn,"headerLength",10),ys.set("tiff",nn),Object.freeze({__proto__:null,default:Ys,Exifr:Xs,fileParsers:gs,segmentParsers:ys,fileReaders:vs,tagKeys:ks,tagValues:Ds,tagRevivers:Ts,createDictionary:xs,extendDictionary:Os,fetchUrlAsArrayBuffer:Cs,readBlobAsArrayBuffer:Ss,chunkedProps:Es,otherSegments:As,segments:Ms,tiffBlocks:Ns,segmentsAndBlocks:Us,tiffExtractables:Bs,inheritables:Is,allFormatters:Rs,Options:qs,parse:Gs});const an={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},an,{firstChunkSize:4e4,gps:[1,2,3,4]}),Object.assign({},an,{tiff:!1,ifd1:!0,mergeOutput:!1});const on=Object.assign({},an,{firstChunkSize:4e4,ifd0:[274]});const ln=Object.freeze({1:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:0,rad:0},2:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:0,rad:0},3:{dimensionSwapped:!1,scaleX:1,scaleY:1,deg:180,rad:180*Math.PI/180},4:{dimensionSwapped:!1,scaleX:-1,scaleY:1,deg:180,rad:180*Math.PI/180},5:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:90,rad:90*Math.PI/180},6:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:90,rad:90*Math.PI/180},7:{dimensionSwapped:!0,scaleX:1,scaleY:-1,deg:270,rad:270*Math.PI/180},8:{dimensionSwapped:!0,scaleX:1,scaleY:1,deg:270,rad:270*Math.PI/180}});let hn=!0,pn=!0;if("object"==typeof navigator){let e=navigator.userAgent;if(e.includes("iPad")||e.includes("iPhone")){let t=e.match(/OS (\d+)_(\d+)/);if(t){let[,e,i]=t,s=Number(e)+.1*Number(i);hn=s<13.4,pn=!1}}else if(e.includes("OS X 10")){let[,t]=e.match(/OS X 10[_.](\d+)/);hn=pn=Number(t)<15}if(e.includes("Chrome/")){let[,t]=e.match(/Chrome\/(\d+)/);hn=pn=Number(t)<81}else if(e.includes("Firefox/")){let[,t]=e.match(/Firefox\/(\d+)/);hn=pn=Number(t)<77}}async function dn(e){let t=await async function(e){let t=new Xs(on);await t.read(e);let i=await t.parse();if(i&&i.ifd0)return i.ifd0[274]}(e);return Object.assign({canvas:hn,css:pn},ln[t])}class un extends cs{constructor(...e){super(...e),es(this,"ranges",new cn),0!==this.byteLength&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,i){if(0===e&&0===this.byteLength&&i){let e=new DataView(i.buffer||i,i.byteOffset,i.byteLength);this._swapDataView(e)}else{let i=e+t;if(i>this.byteLength){let{dataView:e}=this._extend(i);this._swapDataView(e)}}}_extend(e){let t;t=as?rs.allocUnsafe(e):new Uint8Array(e);let i=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:i}}subarray(e,t,i=!1){return t=t||this._lengthToEnd(e),i&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,i=!1){i&&this._tryExtend(t,e.byteLength,e);let s=super.set(e,t);return this.ranges.add(t,s.byteLength),s}async ensureChunk(e,t){this.chunked&&(this.ranges.available(e,t)||await this.readChunk(e,t))}available(e,t){return this.ranges.available(e,t)}}class cn{constructor(){es(this,"list",[])}get length(){return this.list.length}add(e,t,i=0){let s=e+t,n=this.list.filter((t=>fn(e,t.offset,s)||fn(e,t.end,s)));if(n.length>0){e=Math.min(e,...n.map((e=>e.offset))),s=Math.max(s,...n.map((e=>e.end))),t=s-e;let i=n.shift();i.offset=e,i.length=t,i.end=s,this.list=this.list.filter((e=>!n.includes(e)))}else this.list.push({offset:e,length:t,end:s})}available(e,t){let i=e+t;return this.list.some((t=>t.offset<=e&&i<=t.end))}}function fn(e,t,i){return e<=t&&t<=i}class mn extends un{constructor(e,t){super(0),es(this,"chunksRead",0),this.input=e,this.options=t}async readWhole(){this.chunked=!1,await this.readChunk(this.nextChunkOffset)}async readChunked(){this.chunked=!0,await this.readChunk(0,this.options.firstChunkSize)}async readNextChunk(e=this.nextChunkOffset){if(this.fullyRead)return this.chunksRead++,!1;let t=this.options.chunkSize,i=await this.readChunk(e,t);return!!i&&i.byteLength===t}async readChunk(e,t){if(this.chunksRead++,0!==(t=this.safeWrapAddress(e,t)))return this._readChunk(e,t)}safeWrapAddress(e,t){return void 0!==this.size&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(0!==this.ranges.list.length)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return void 0!==this.size&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}vs.set("blob",class extends mn{async readWhole(){this.chunked=!1;let e=await Ss(this.input);this._swapArrayBuffer(e)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(e,t){let i=t?e+t:void 0,s=this.input.slice(e,i),n=await Ss(s);return this.set(n,e,!0)}});var gn={strings:{generatingThumbnails:"Generating thumbnails..."}};function yn(e,t,i){try{e.getContext("2d").getImageData(0,0,1,1)}catch(s){if(18===s.code)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return e.toBlob?new Promise((s=>{e.toBlob(s,t,i)})).then((e=>{if(null===e)throw new Error("cannot read image, probably an svg with external resources");return e})):Promise.resolve().then((()=>function(e,t,i){var s,n;const r=Qi.exec(e),a=null!=(s=null!=(n=t.mimeType)?n:null==r?void 0:r[1])?s:"plain/text";let o;if(null!=(null==r?void 0:r[2])){const e=atob(decodeURIComponent(r[3])),t=new Uint8Array(e.length);for(let i=0;i<e.length;i++)t[i]=e.charCodeAt(i);o=[t]}else null!=(null==r?void 0:r[3])&&(o=[decodeURIComponent(r[3])]);return i?new File(o,t.name||"",{type:a}):new Blob(o,{type:a})}(e.toDataURL(t,i),{}))).then((e=>{if(null===e)throw new Error("could not extract blob, probably an old browser");return e}))}const vn={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class bn extends ni{constructor(e,t){if(super(e,{...vn,...t}),this.onFileAdded=e=>{!e.preview&&e.data&&Ji(e.type)&&!e.isRemote&&this.addToQueue(e.id)},this.onCancelRequest=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1)},this.onFileRemoved=e=>{const t=this.queue.indexOf(e.id);-1!==t&&this.queue.splice(t,1),e.preview&&Zi(e.preview)&&URL.revokeObjectURL(e.preview)},this.onRestored=()=>{this.uppy.getFiles().filter((e=>e.isRestored)).forEach((e=>{e.preview&&!Zi(e.preview)||this.addToQueue(e.id)}))},this.onAllFilesRemoved=()=>{this.queue=[]},this.waitUntilAllProcessed=e=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})}));const t=()=>{e.forEach((e=>{const t=this.uppy.getFile(e);this.uppy.emit("preprocess-complete",t)}))};return new Promise((e=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",(()=>{t(),e()})):(t(),e())}))},this.type="modifier",this.id=this.opts.id||"ThumbnailGenerator",this.title="Thumbnail Generator",this.queue=[],this.queueProcessing=!1,this.defaultThumbnailDimension=200,this.thumbnailType=this.opts.thumbnailType,this.defaultLocale=gn,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("ThumbnailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,i){const s=URL.createObjectURL(e.data),n=new Promise(((e,t)=>{const i=new Image;i.src=s,i.addEventListener("load",(()=>{URL.revokeObjectURL(s),e(i)})),i.addEventListener("error",(e=>{URL.revokeObjectURL(s),t(e.error||new Error("Could not create thumbnail"))}))})),r=dn(e.data).catch((()=>1));return Promise.all([n,r]).then((e=>{let[s,n]=e;const r=this.getProportionalDimensions(s,t,i,n.deg),a=function(e,t){let i=e.width,s=e.height;90!==t.deg&&270!==t.deg||(i=e.height,s=e.width);const n=document.createElement("canvas");n.width=i,n.height=s;const r=n.getContext("2d");return r.translate(i/2,s/2),t.canvas&&(r.rotate(t.rad),r.scale(t.scaleX,t.scaleY)),r.drawImage(e,-e.width/2,-e.height/2,e.width,e.height),n}(s,n);return yn(this.resizeImage(a,r.width,r.height),this.thumbnailType,80)})).then((e=>URL.createObjectURL(e)))}getProportionalDimensions(e,t,i,s){let n=e.width/e.height;return 90!==s&&270!==s||(n=e.height/e.width),null!=t?{width:t,height:Math.round(t/n)}:null!=i?{width:Math.round(i*n),height:i}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/n)}}resizeImage(e,t,i){let s=function(e){const t=e.width/e.height,i=5e6,s=4096;let n=Math.floor(Math.sqrt(i*t)),r=Math.floor(i/Math.sqrt(i*t));if(n>s&&(n=s,r=Math.round(n/t)),r>s&&(r=s,n=Math.round(t*r)),e.width>n){const t=document.createElement("canvas");return t.width=n,t.height=r,t.getContext("2d").drawImage(e,0,0,n,r),t}return e}(e),n=Math.ceil(Math.log2(s.width/t));n<1&&(n=1);let r=t*2**(n-1),a=i*2**(n-1);for(;n--;){const e=document.createElement("canvas");e.width=r,e.height=a,e.getContext("2d").drawImage(s,0,0,r,a),s=e,r=Math.round(r/2),a=Math.round(a/2)}return s}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()}processQueue(){if(this.queueProcessing=!0,this.queue.length>0){const e=this.uppy.getFile(this.queue.shift());return e?this.requestThumbnail(e).catch((()=>{})).then((()=>this.processQueue())):(this.uppy.log("[ThumbnailGenerator] file was removed before a thumbnail could be generated, but not removed from the queue. This is probably a bug","error"),Promise.resolve())}return this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated"),Promise.resolve()}requestThumbnail(e){return Ji(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then((t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)})).catch((t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)})):Promise.resolve()}install(){this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("thumbnail:cancel",this.onCancelRequest)):(this.uppy.on("thumbnail:request",this.onFileAdded),this.uppy.on("file-added",this.onFileAdded),this.uppy.on("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.addPreProcessor(this.waitUntilAllProcessed)}uninstall(){this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("cancel-all",this.onAllFilesRemoved),this.opts.lazy?(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("thumbnail:cancel",this.onCancelRequest)):(this.uppy.off("thumbnail:request",this.onFileAdded),this.uppy.off("file-added",this.onFileAdded),this.uppy.off("restored",this.onRestored)),this.opts.waitForThumbnailsBeforeUpload&&this.uppy.removePreProcessor(this.waitUntilAllProcessed)}}function wn(e){if("string"==typeof e){const t=document.querySelectorAll(e);return 0===t.length?null:Array.from(t)}return"object"==typeof e&&Kt(e)?[e]:null}bn.VERSION="3.1.0";var _n=Array.from;function Fn(e,t,i,s){let{onSuccess:n}=s;e.readEntries((s=>{const r=[...t,...s];s.length?queueMicrotask((()=>{Fn(e,r,i,{onSuccess:n})})):n(r)}),(e=>{i(e),n(t)}))}function Cn(e,t){return null==e?e:{kind:e.isFile?"file":e.isDirectory?"directory":void 0,name:e.name,getFile:()=>new Promise(((t,i)=>e.file(t,i))),async*values(){const i=e.createReader(),s=await new Promise((e=>{Fn(i,[],t,{onSuccess:i=>e(i.map((e=>Cn(e,t))))})}));yield*s},isSameEntry:void 0}}function Sn(e,t,i){try{return void 0===i&&(i=void 0),async function*(){const s=()=>`${t}/${e.name}`;if("file"===e.kind){const n=await e.getFile();null!=n?(n.relativePath=t?s():null,yield n):null!=i&&(yield i)}else if("directory"===e.kind)for await(const i of e.values())yield*Sn(i,t?s():e.name);else null!=i&&(yield i)}()}catch(s){return Promise.reject(s)}}async function Pn(e,t){var i;const s=null!=(i=null==t?void 0:t.logDropError)?i:Function.prototype;try{const t=[];for await(const i of async function*(e,t){const i=await Promise.all(Array.from(e.items,(async e=>{let i;return null!=i||(i=Cn("function"==typeof e.getAsEntry?e.getAsEntry():e.webkitGetAsEntry(),t)),{fileSystemHandle:i,lastResortFile:e.getAsFile()}})));for(const{lastResortFile:n,fileSystemHandle:r}of i)if(null!=r)try{yield*Sn(r,"",n)}catch(s){null!=n?yield n:t(s)}else null!=n&&(yield n)}(e,s))t.push(i);return t}catch{return function(e){const t=_n(e.files);return Promise.resolve(t)}(e)}}!function(e){var t=Object.prototype.hasOwnProperty,i="~";function s(){}function n(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function r(e,t,s,r,a){if("function"!=typeof s)throw new TypeError("The listener must be a function");var o=new n(s,r||e,a),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new s:delete e._events[t]}function o(){this._events=new s,this._eventsCount=0}Object.create&&(s.prototype=Object.create(null),(new s).__proto__||(i=!1)),o.prototype.eventNames=function(){var e,s,n=[];if(0===this._eventsCount)return n;for(s in e=this._events)t.call(e,s)&&n.push(i?s.slice(1):s);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},o.prototype.listeners=function(e){var t=i?i+e:e,s=this._events[t];if(!s)return[];if(s.fn)return[s.fn];for(var n=0,r=s.length,a=new Array(r);n<r;n++)a[n]=s[n].fn;return a},o.prototype.listenerCount=function(e){var t=i?i+e:e,s=this._events[t];return s?s.fn?1:s.length:0},o.prototype.emit=function(e,t,s,n,r,a){var o=i?i+e:e;if(!this._events[o])return!1;var l,h,p=this._events[o],d=arguments.length;if(p.fn){switch(p.once&&this.removeListener(e,p.fn,void 0,!0),d){case 1:return p.fn.call(p.context),!0;case 2:return p.fn.call(p.context,t),!0;case 3:return p.fn.call(p.context,t,s),!0;case 4:return p.fn.call(p.context,t,s,n),!0;case 5:return p.fn.call(p.context,t,s,n,r),!0;case 6:return p.fn.call(p.context,t,s,n,r,a),!0}for(h=1,l=new Array(d-1);h<d;h++)l[h-1]=arguments[h];p.fn.apply(p.context,l)}else{var u,c=p.length;for(h=0;h<c;h++)switch(p[h].once&&this.removeListener(e,p[h].fn,void 0,!0),d){case 1:p[h].fn.call(p[h].context);break;case 2:p[h].fn.call(p[h].context,t);break;case 3:p[h].fn.call(p[h].context,t,s);break;case 4:p[h].fn.call(p[h].context,t,s,n);break;default:if(!l)for(u=1,l=new Array(d-1);u<d;u++)l[u-1]=arguments[u];p[h].fn.apply(p[h].context,l)}}return!0},o.prototype.on=function(e,t,i){return r(this,e,t,i,!1)},o.prototype.once=function(e,t,i){return r(this,e,t,i,!0)},o.prototype.removeListener=function(e,t,s,n){var r=i?i+e:e;if(!this._events[r])return this;if(!t)return a(this,r),this;var o=this._events[r];if(o.fn)o.fn!==t||n&&!o.once||s&&o.context!==s||a(this,r);else{for(var l=0,h=[],p=o.length;l<p;l++)(o[l].fn!==t||n&&!o[l].once||s&&o[l].context!==s)&&h.push(o[l]);h.length?this._events[r]=1===h.length?h[0]:h:a(this,r)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&a(this,t)):(this._events=new s,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=i,o.EventEmitter=o,e.exports=o}({exports:{}}),globalThis&&globalThis.__classPrivateFieldGet,globalThis&&globalThis.__classPrivateFieldSet,globalThis&&globalThis.__classPrivateFieldGet;var xn,On,kn,Dn,Tn=0,En=[],An=ht,Mn=An.__b,Nn=An.__r,Un=An.diffed,Bn=An.__c,In=An.unmount,Rn=An.__;function zn(e,t){An.__h&&An.__h(On,e,Tn||t),Tn=0;var i=On.__H||(On.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({}),i.__[e]}function Ln(e){return Tn=1,function(e,t,i){var s=zn(xn++,2);if(s.t=e,!s.__c&&(s.__=[i?i(t):Kn(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],i=s.t(t,e);t!==i&&(s.__N=[i,s.__[1]],s.__c.setState({}))}],s.__c=On,!On.__f)){var n=function(e,t,i){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!r||r.call(this,e,t,i);var a=s.__c.props!==e;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}})),r&&r.call(this,e,t,i)||a};On.__f=!0;var r=On.shouldComponentUpdate,a=On.componentWillUpdate;On.componentWillUpdate=function(e,t,i){if(this.__e){var s=r;r=void 0,n(e,t,i),r=s}a&&a.call(this,e,t,i)},On.shouldComponentUpdate=n}return s.__N||s.__}(Kn,e)}function jn(e,t){var i=zn(xn++,3);!An.__s&&Yn(i.__H,t)&&(i.__=e,i.u=t,On.__H.__h.push(i))}function Hn(e){return Tn=5,qn((function(){return{current:e}}),[])}function qn(e,t){var i=zn(xn++,7);return Yn(i.__H,t)&&(i.__=e(),i.__H=t,i.__h=e),i.__}function Wn(){for(var e;e=En.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Xn),e.__H.__h.forEach(Gn),e.__H.__h=[]}catch(t){e.__H.__h=[],An.__e(t,e.__v)}}An.__b=function(e){On=null,Mn&&Mn(e)},An.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Rn&&Rn(e,t)},An.__r=function(e){Nn&&Nn(e),xn=0;var t=(On=e.__c).__H;t&&(kn===On?(t.__h=[],On.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0}))):(t.__h.forEach(Xn),t.__h.forEach(Gn),t.__h=[],xn=0)),kn=On},An.diffed=function(e){Un&&Un(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==En.push(t)&&Dn===An.requestAnimationFrame||((Dn=An.requestAnimationFrame)||Vn)(Wn)),t.__H.__.forEach((function(e){e.u&&(e.__H=e.u),e.u=void 0}))),kn=On=null},An.__c=function(e,t){t.some((function(e){try{e.__h.forEach(Xn),e.__h=e.__h.filter((function(e){return!e.__||Gn(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],An.__e(i,e.__v)}})),Bn&&Bn(e,t)},An.unmount=function(e){In&&In(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{Xn(e)}catch(i){t=i}})),i.__H=void 0,t&&An.__e(t,i.__v))};var $n="function"==typeof requestAnimationFrame;function Vn(e){var t,i=function(){clearTimeout(s),$n&&cancelAnimationFrame(t),setTimeout(e)},s=setTimeout(i,35);$n&&(t=requestAnimationFrame(i))}function Xn(e){var t=On,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),On=t}function Gn(e){var t=On;e.__c=e.__(),On=t}function Yn(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function Kn(e,t){return"function"==typeof t?t(e):t}function Qn(){return Qn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Qn.apply(this,arguments)}const Zn={position:"relative",width:"100%",minHeight:"100%"},Jn={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class er extends Dt{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:i,renderRow:s,overscanCount:n=10,...r}=e;const{offset:a,height:o}=this.state;let l=Math.floor(a/i),h=Math.floor(o/i);n&&(l=Math.max(0,l-l%n),h+=n);const p=l+h+4,d=t.slice(l,p),u={...Zn,height:t.length*i},c={...Jn,top:l*i};return xt("div",Qn({onScroll:this.handleScroll},r),xt("div",{role:"presentation",style:u},xt("div",{role:"presentation",style:c},d.map(s))))}}var tr=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function ir(e,t){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(s=e[i],n=t[i],!(s===n||tr(s)&&tr(n)))return!1;var s,n;return!0}function sr(e,t){void 0===t&&(t=ir);var i=null;function s(){for(var s=[],n=0;n<arguments.length;n++)s[n]=arguments[n];if(i&&i.lastThis===this&&t(s,i.lastArgs))return i.lastResult;var r=e.apply(this,s);return i={lastResult:r,lastArgs:s,lastThis:this},r}return s.clear=function(){i=null},s}var nr=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'];function rr(e,t){if(t){const i=e.querySelector(`[data-uppy-paneltype="${t}"]`);if(i)return i}return e}function ar(e,t){const i=t[0];i&&(i.focus(),e.preventDefault())}function or(e,t,i){const s=rr(i,t),n=_n(s.querySelectorAll(nr)),r=n.indexOf(document.activeElement);!function(e){return e.contains(document.activeElement)}(s)?ar(e,n):e.shiftKey&&0===r?function(e,t){const i=t[t.length-1];i&&(i.focus(),e.preventDefault())}(e,n):e.shiftKey||r!==n.length-1||ar(e,n)}function lr(){const e=document.body;return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&("FormData"in window&&"FileReader"in window)}function hr(e){const t={color:"#838999",icon:xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},xt("g",{fill:"#A7AFB7",fillRule:"nonzero"},xt("path",{d:"M5.5 22a.5.5 0 0 1-.5-.5v-18a.5.5 0 0 1 .5-.5h10.719a.5.5 0 0 1 .367.16l3.281 3.556a.5.5 0 0 1 .133.339V21.5a.5.5 0 0 1-.5.5h-14zm.5-1h13V7.25L16 4H6v17z"}),xt("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})))};if(!e)return t;const i=e.split("/")[0],s=e.split("/")[1];if("text"===i)return{color:"#5a5e69",icon:xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},xt("path",{d:"M4.5 7h13a.5.5 0 1 1 0 1h-13a.5.5 0 0 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h15a.5.5 0 1 1 0 1h-15a.5.5 0 1 1 0-1zm0 3h10a.5.5 0 1 1 0 1h-10a.5.5 0 1 1 0-1z",fill:"#5A5E69",fillRule:"nonzero"}))};if("image"===i)return{color:"#686de0",icon:xt("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},xt("g",{fill:"#686DE0",fillRule:"evenodd"},xt("path",{d:"M5 7v10h15V7H5zm0-1h15a1 1 0 0 1 1 1v10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1z",fillRule:"nonzero"}),xt("path",{d:"M6.35 17.172l4.994-5.026a.5.5 0 0 1 .707 0l2.16 2.16 3.505-3.505a.5.5 0 0 1 .707 0l2.336 2.31-.707.72-1.983-1.97-3.505 3.505a.5.5 0 0 1-.707 0l-2.16-2.159-3.938 3.939-1.409.026z",fillRule:"nonzero"}),xt("circle",{cx:"7.5",cy:"9.5",r:"1.5"})))};if("audio"===i)return{color:"#068dbb",icon:xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},xt("path",{d:"M9.5 18.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V7.25a.5.5 0 0 1 .379-.485l9-2.25A.5.5 0 0 1 18.5 5v11.64c0 1.14-1.145 2-2.5 2s-2.5-.86-2.5-2c0-1.14 1.145-2 2.5-2 .557 0 1.079.145 1.5.396V8.67l-8 2v7.97zm8-11v-2l-8 2v2l8-2zM7 19.64c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1zm9-2c.855 0 1.5-.484 1.5-1s-.645-1-1.5-1-1.5.484-1.5 1 .645 1 1.5 1z",fill:"#049BCF",fillRule:"nonzero"}))};if("video"===i)return{color:"#19af67",icon:xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},xt("path",{d:"M16 11.834l4.486-2.691A1 1 0 0 1 22 10v6a1 1 0 0 1-1.514.857L16 14.167V17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V9a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v2.834zM15 9H5v8h10V9zm1 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"}))};if("application"===i&&"pdf"===s)return{color:"#e25149",icon:xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25"},xt("path",{d:"M9.766 8.295c-.691-1.843-.539-3.401.747-3.726 1.643-.414 2.505.938 2.39 3.299-.039.79-.194 1.662-.537 3.148.324.49.66.967 1.055 1.51.17.231.382.488.629.757 1.866-.128 3.653.114 4.918.655 1.487.635 2.192 1.685 1.614 2.84-.566 1.133-1.839 1.084-3.416.249-1.141-.604-2.457-1.634-3.51-2.707a13.467 13.467 0 0 0-2.238.426c-1.392 4.051-4.534 6.453-5.707 4.572-.986-1.58 1.38-4.206 4.914-5.375.097-.322.185-.656.264-1.001.08-.353.306-1.31.407-1.737-.678-1.059-1.2-2.031-1.53-2.91zm2.098 4.87c-.033.144-.068.287-.104.427l.033-.01-.012.038a14.065 14.065 0 0 1 1.02-.197l-.032-.033.052-.004a7.902 7.902 0 0 1-.208-.271c-.197-.27-.38-.526-.555-.775l-.006.028-.002-.003c-.076.323-.148.632-.186.8zm5.77 2.978c1.143.605 1.832.632 2.054.187.26-.519-.087-1.034-1.113-1.473-.911-.39-2.175-.608-3.55-.608.845.766 1.787 1.459 2.609 1.894zM6.559 18.789c.14.223.693.16 1.425-.413.827-.648 1.61-1.747 2.208-3.206-2.563 1.064-4.102 2.867-3.633 3.62zm5.345-10.97c.088-1.793-.351-2.48-1.146-2.28-.473.119-.564 1.05-.056 2.405.213.566.52 1.188.908 1.859.18-.858.268-1.453.294-1.984z",fill:"#E2514A",fillRule:"nonzero"}))};return"application"===i&&-1!==["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)?{color:"#00C469",icon:xt("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25"},xt("path",{d:"M10.45 2.05h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V2.55a.5.5 0 0 1 .5-.5zm2.05 1.024h1.05a.5.5 0 0 1 .5.5V3.6a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5v-.001zM10.45 0h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5V.5a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 3.074h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-2.05 1.024h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm-2.05 1.025h1.05a.5.5 0 0 1 .5.5v.025a.5.5 0 0 1-.5.5h-1.05a.5.5 0 0 1-.5-.5v-.025a.5.5 0 0 1 .5-.5zm2.05 1.025h1.05a.5.5 0 0 1 .5.5v.024a.5.5 0 0 1-.5.5H12.5a.5.5 0 0 1-.5-.5v-.024a.5.5 0 0 1 .5-.5zm-1.656 3.074l-.82 5.946c.52.302 1.174.458 1.976.458.803 0 1.455-.156 1.975-.458l-.82-5.946h-2.311zm0-1.025h2.312c.512 0 .946.378 1.015.885l.82 5.946c.056.412-.142.817-.501 1.026-.686.398-1.515.597-2.49.597-.974 0-1.804-.199-2.49-.597a1.025 1.025 0 0 1-.5-1.026l.819-5.946c.07-.507.503-.885 1.015-.885zm.545 6.6a.5.5 0 0 1-.397-.561l.143-.999a.5.5 0 0 1 .495-.429h.74a.5.5 0 0 1 .495.43l.143.998a.5.5 0 0 1-.397.561c-.404.08-.819.08-1.222 0z",fill:"#00C469",fillRule:"nonzero"}))}:t}function pr(e){const{file:t}=e;if(t.preview)return xt("img",{className:"uppy-Dashboard-Item-previewImg",alt:t.name,src:t.preview});const{color:i,icon:s}=hr(t.type);return xt("div",{className:"uppy-Dashboard-Item-previewIconWrap"},xt("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:i}},s),xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76"},xt("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})))}function dr(e){const{file:t,toggleFileCard:i,i18n:s,metaFields:n}=e,{missingRequiredMetaFields:r}=t;if(null==r||!r.length)return null;const a=r.map((e=>((e,t)=>("function"==typeof t?t():t).filter((t=>t.id===e))[0].name)(e,n))).join(", ");return xt("div",{className:"uppy-Dashboard-Item-errorMessage"},s("missingRequiredMetaFields",{smart_count:r.length,fields:a})," ",xt("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>i(!0,t.id)},s("editFile")))}function ur(e){const{file:t,i18n:i,toggleFileCard:s,metaFields:n,showLinkToFileUploadResult:r}=e;return xt("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:t.preview?"rgba(255, 255, 255, 0.5)":hr(t.type).color}},r&&t.uploadURL&&xt("a",{className:"uppy-Dashboard-Item-previewLink",href:t.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":t.meta.name},xt("span",{hidden:!0},t.meta.name)),xt(pr,{file:t}),xt(dr,{file:t,i18n:i,toggleFileCard:s,metaFields:n}))}function cr(e){return e.isUploaded?e.i18n("uploadComplete"):e.error?e.i18n("retryUpload"):e.resumableUploads?e.file.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.individualCancellation?e.i18n("cancelUpload"):""}function fr(e){return xt("div",{className:"uppy-Dashboard-Item-progress"},xt("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":cr(e),title:cr(e),onClick:()=>function(e){e.isUploaded||(!e.error||e.hideRetryButton?e.resumableUploads&&!e.hidePauseResumeButton?e.uppy.pauseResume(e.file.id):e.individualCancellation&&!e.hideCancelButton&&e.uppy.removeFile(e.file.id):e.uppy.retryUpload(e.file.id))}(e)},e.children))}function mr(e){let{children:t}=e;return xt("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle"},t)}function gr(e){let{progress:t}=e;const i=2*Math.PI*15;return xt("g",null,xt("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),xt("circle",{className:"uppy-Dashboard-Item-progressIcon--progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)",fill:"none","stroke-width":"2","stroke-dasharray":i,"stroke-dashoffset":i-i/100*t}))}function yr(e){return e.file.progress.uploadStarted?e.isUploaded?xt("div",{className:"uppy-Dashboard-Item-progress"},xt("div",{className:"uppy-Dashboard-Item-progressIndicator"},xt(mr,null,xt("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),xt("polygon",{className:"uppy-Dashboard-Item-progressIcon--check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"})))):e.recoveredState?void 0:e.error&&!e.hideRetryButton?xt(fr,e,xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19"},xt("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),xt("path",{d:"M7.9 3H10v2H7.9z"}),xt("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),xt("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))):e.resumableUploads&&!e.hidePauseResumeButton?xt(fr,e,xt(mr,null,xt(gr,{progress:e.file.progress.percentage}),e.file.isPaused?xt("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):xt("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)"},xt("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),xt("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})))):e.resumableUploads||!e.individualCancellation||e.hideCancelButton?xt("div",{className:"uppy-Dashboard-Item-progress"},xt("div",{className:"uppy-Dashboard-Item-progressIndicator"},xt(mr,null,xt(gr,{progress:e.file.progress.percentage})))):xt(fr,e,xt(mr,null,xt(gr,{progress:e.file.progress.percentage}),xt("polygon",{className:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"}))):null}function vr(e,t){if(0===t)return"";if(e.length<=t)return e;if(t<="...".length+1)return`${e.slice(0,t-1)}…`;const i=t-"...".length,s=Math.ceil(i/2),n=Math.floor(i/2);return e.slice(0,s)+"..."+e.slice(-n)}const br=e=>{let{file:t,onClick:i}=e;return t.error?xt("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":t.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:i,type:"button"},"?"):null};function wr(e){const{file:t}=e;return xt("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":t.source},xt("div",{className:"uppy-Dashboard-Item-fileName"},(e=>{const{author:t,name:i}=e.file.meta;return xt("div",{className:"uppy-Dashboard-Item-name",title:i},vr(i,e.isSingleFile&&e.containerHeight>=350?90:e.containerWidth<=352?35:e.containerWidth<=576?60:t?20:30))})(e),xt(br,{file:e.file,onClick:()=>alert(e.file.error)})),xt("div",{className:"uppy-Dashboard-Item-status"},(e=>{var t;const{author:i}=e.file.meta,s=null==(t=e.file.remote)?void 0:t.providerName;return i?xt("div",{className:"uppy-Dashboard-Item-author"},xt("a",{href:`${i.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer"},vr(i.name,13)),s?xt(kt,null," · ",s," · "):null):null})(e),(e=>e.file.size&&xt("div",{className:"uppy-Dashboard-Item-statusSize"},fe(e.file.size)))(e),(e=>e.file.isGhost&&xt("span",null," • ",xt("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:e.toggleAddFilesPanel},e.i18n("reSelect"))))(e)),xt(dr,{file:e.file,i18n:e.i18n,toggleFileCard:e.toggleFileCard,metaFields:e.metaFields}))}function _r(e){let{file:t,uploadInProgressOrComplete:i,metaFields:s,canEditFile:n,i18n:r,onClick:a}=e;return!i&&s&&s.length>0||!i&&n(t)?xt("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":r("editFileWithFilename",{file:t.meta.name}),title:r("editFileWithFilename",{file:t.meta.name}),onClick:()=>a()},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14"},xt("g",{fillRule:"evenodd"},xt("path",{d:"M1.5 10.793h2.793A1 1 0 0 0 5 10.5L11.5 4a1 1 0 0 0 0-1.414L9.707.793a1 1 0 0 0-1.414 0l-6.5 6.5A1 1 0 0 0 1.5 8v2.793zm1-1V8L9 1.5l1.793 1.793-6.5 6.5H2.5z",fillRule:"nonzero"}),xt("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),xt("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})))):null}function Fr(e){let{i18n:t,onClick:i,file:s}=e;return xt("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":t("removeFile",{file:s.meta.name}),title:t("removeFile",{file:s.meta.name}),onClick:()=>i()},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18"},xt("path",{d:"M9 0C4.034 0 0 4.034 0 9s4.034 9 9 9 9-4.034 9-9-4.034-9-9-9z"}),xt("path",{fill:"#FFF",d:"M13 12.222l-.778.778L9 9.778 5.778 13 5 12.222 8.222 9 5 5.778 5.778 5 9 8.222 12.222 5l.778.778L9.778 9z"})))}const Cr=(e,t)=>{var i,s;(i=t.file.uploadURL,s=t.i18n("copyLinkToClipboardFallback"),void 0===s&&(s="Copy the URL below"),new Promise((e=>{const t=document.createElement("textarea");t.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),t.value=i,document.body.appendChild(t),t.select();const n=()=>{document.body.removeChild(t),window.prompt(s,i),e()};try{return document.execCommand("copy")?(document.body.removeChild(t),e()):n()}catch(r){return document.body.removeChild(t),n()}}))).then((()=>{t.uppy.log("Link copied to clipboard."),t.uppy.info(t.i18n("copyLinkToClipboardSuccess"),"info",3e3)})).catch(t.uppy.log).then((()=>e.target.focus({preventScroll:!0})))};function Sr(e){const{i18n:t}=e;return xt("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:t=>Cr(t,e)},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12"},xt("path",{d:"M7.94 7.703a2.613 2.613 0 0 1-.626 2.681l-.852.851a2.597 2.597 0 0 1-1.849.766A2.616 2.616 0 0 1 2.764 7.54l.852-.852a2.596 2.596 0 0 1 2.69-.625L5.267 7.099a1.44 1.44 0 0 0-.833.407l-.852.851a1.458 1.458 0 0 0 1.03 2.486c.39 0 .755-.152 1.03-.426l.852-.852c.231-.231.363-.522.406-.824l1.04-1.038zm4.295-5.937A2.596 2.596 0 0 0 10.387 1c-.698 0-1.355.272-1.849.766l-.852.851a2.614 2.614 0 0 0-.624 2.688l1.036-1.036c.041-.304.173-.6.407-.833l.852-.852c.275-.275.64-.426 1.03-.426a1.458 1.458 0 0 1 1.03 2.486l-.852.851a1.442 1.442 0 0 1-.824.406l-1.04 1.04a2.596 2.596 0 0 0 2.683-.628l.851-.85a2.616 2.616 0 0 0 0-3.697zm-6.88 6.883a.577.577 0 0 0 .82 0l3.474-3.474a.579.579 0 1 0-.819-.82L5.355 7.83a.579.579 0 0 0 0 .819z"})))}function Pr(e){const{uppy:t,file:i,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:l,toggleFileCard:h,openFileEditor:p}=e;return xt("div",{className:"uppy-Dashboard-Item-actionWrapper"},xt(_r,{i18n:l,file:i,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,onClick:()=>{r&&r.length>0?h(!0,i.id):p(i)}}),a&&i.uploadURL?xt(Sr,{file:i,uppy:t,i18n:l}):null,o?xt(Fr,{i18n:l,file:i,uppy:t,onClick:()=>t.removeFile(i.id,"removed-by-user")}):null)}class xr extends Dt{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!function(e,t){if(e===t)return!0;for(var i in e)if(!(i in t))return!1;for(var i in t)if(e[i]!==t[i])return!1;return!0}(this.props,e)}componentDidUpdate(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}componentWillUnmount(){const{file:e}=this.props;e.preview||this.props.handleCancelThumbnail(e)}render(){const{file:e}=this.props,t=e.progress.preprocess||e.progress.postprocess,i=e.progress.uploadComplete&&!t&&!e.error,s=e.progress.uploadStarted||t,n=e.progress.uploadStarted&&!e.progress.uploadComplete||t,r=e.error||!1,{isGhost:a}=e;let o=(this.props.individualCancellation||!n)&&!i;i&&this.props.showRemoveButtonAfterComplete&&(o=!0);return xt("div",{className:hi({"uppy-Dashboard-Item":!0,"is-inprogress":n&&!this.props.recoveredState,"is-processing":t,"is-complete":i,"is-error":!!r,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a}),id:`uppy_${e.id}`,role:this.props.role},xt("div",{className:"uppy-Dashboard-Item-preview"},xt(ur,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),xt(yr,{uppy:this.props.uppy,file:e,error:r,isUploaded:i,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,showRemoveButtonAfterComplete:this.props.showRemoveButtonAfterComplete,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})),xt("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons"},xt(wr,{file:e,id:this.props.id,acquirers:this.props.acquirers,containerWidth:this.props.containerWidth,containerHeight:this.props.containerHeight,i18n:this.props.i18n,toggleAddFilesPanel:this.props.toggleAddFilesPanel,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields,isSingleFile:this.props.isSingleFile}),xt(Pr,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:o,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:s,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})))}}function Or(e){let{id:t,error:i,i18n:s,uppy:n,files:r,acquirers:a,resumableUploads:o,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:p,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,isWide:c,metaFields:f,isSingleFile:m,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,recoveredState:b,individualCancellation:w,itemsPerRow:_,openFileEditor:F,canEditFile:C,toggleAddFilesPanel:S,containerWidth:P,containerHeight:x}=e;const O=1===_?71:200,k=qn((()=>{const e=Object.keys(r);return b&&e.sort(((e,t)=>r[t].isGhost-r[e].isGhost)),function(e,t){const i=[];let s=[];return e.forEach((e=>{s.length<t?s.push(e):(i.push(s),s=[e])})),s.length&&i.push(s),i}(e,_)}),[r,_,b]),D=e=>xt("div",{class:"uppy-Dashboard-filesInner",role:"presentation",key:e[0]},e.map((e=>xt(xr,{key:e,uppy:n,id:t,error:i,i18n:s,acquirers:a,resumableUploads:o,individualCancellation:w,hideRetryButton:l,hidePauseResumeButton:h,hideCancelButton:p,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,isWide:c,metaFields:f,recoveredState:b,isSingleFile:m,containerWidth:P,containerHeight:x,toggleFileCard:g,handleRequestThumbnail:y,handleCancelThumbnail:v,role:"listitem",openFileEditor:F,canEditFile:C,toggleAddFilesPanel:S,file:r[e]}))));return m?xt("div",{class:"uppy-Dashboard-files"},D(k[0])):xt(er,{class:"uppy-Dashboard-files",role:"list",data:k,renderRow:D,rowHeight:O})}let kr;kr=Symbol.for("uppy test: disable unused locale key warning");class Dr extends Dt{constructor(){super(...arguments),this.triggerFileInputClick=()=>{this.fileInput.click()},this.triggerFolderInputClick=()=>{this.folderInput.click()},this.triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput.click()},this.triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput.click()},this.onFileInputChange=e=>{this.props.handleInputChange(e),e.target.value=null},this.renderHiddenInput=(e,t)=>xt("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes,ref:t}),this.renderHiddenCameraInput=(e,t,i)=>{const s={photo:"image/*",video:"video/*"}[e];return xt("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t,accept:s,ref:i})},this.renderMyDeviceAcquirer=()=>xt("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice"},xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerFileInputClick},xt("div",{className:"uppy-DashboardTab-inner"},xt("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},xt("path",{d:"M8.45 22.087l-1.305-6.674h17.678l-1.572 6.674H8.45zm4.975-12.412l1.083 1.765a.823.823 0 00.715.386h7.951V13.5H8.587V9.675h4.838zM26.043 13.5h-1.195v-2.598c0-.463-.336-.75-.798-.75h-8.356l-1.082-1.766A.823.823 0 0013.897 8H7.728c-.462 0-.815.256-.815.718V13.5h-.956a.97.97 0 00-.746.37.972.972 0 00-.19.81l1.724 8.565c.095.44.484.755.933.755H24c.44 0 .824-.3.929-.727l2.043-8.568a.972.972 0 00-.176-.825.967.967 0 00-.753-.38z",fill:"currentcolor","fill-rule":"evenodd"}))),xt("div",{className:"uppy-DashboardTab-name"},this.props.i18n("myDevice")))),this.renderPhotoCamera=()=>xt("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera"},xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerPhotoCameraInputClick},xt("div",{className:"uppy-DashboardTab-inner"},xt("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32"},xt("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383","fill-rule":"nonzero"}))),xt("div",{className:"uppy-DashboardTab-name"},this.props.i18n("takePictureBtn")))),this.renderVideoCamera=()=>xt("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera"},xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-uppy-super-focusable":!0,onClick:this.triggerVideoCameraInputClick},xt("div",{className:"uppy-DashboardTab-inner"},xt("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32"},xt("path",{fill:"#FF675E",fillRule:"nonzero",d:"m21.254 14.277 2.941-2.588c.797-.313 1.243.818 1.09 1.554-.01 2.094.02 4.189-.017 6.282-.126.915-1.145 1.08-1.58.34l-2.434-2.142c-.192.287-.504 1.305-.738.468-.104-1.293-.028-2.596-.05-3.894.047-.312.381.823.426 1.069.063-.384.206-.744.362-1.09zm-12.939-3.73c3.858.013 7.717-.025 11.574.02.912.129 1.492 1.237 1.351 2.217-.019 2.412.04 4.83-.03 7.239-.17 1.025-1.166 1.59-2.029 1.429-3.705-.012-7.41.025-11.114-.019-.913-.129-1.492-1.237-1.352-2.217.018-2.404-.036-4.813.029-7.214.136-.82.83-1.473 1.571-1.454z "}))),xt("div",{className:"uppy-DashboardTab-name"},this.props.i18n("recordVideoBtn")))),this.renderBrowseButton=(e,t)=>xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":0===this.props.acquirers.length},e),this.renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),i=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),s=this.props.fileManagerSelectionType,n=s.charAt(0).toUpperCase()+s.slice(1);return xt("div",{class:"uppy-Dashboard-AddFiles-title"},this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${n}`,{browseFiles:t,browseFolders:i,browse:t}):this.props.i18nArray(`dropPaste${n}`,{browseFiles:t,browseFolders:i,browse:t}))},this.renderAcquirer=e=>{var t;return xt("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id},xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-DashboardTab-btn",role:"tab",tabIndex:0,"data-cy":e.id,"aria-controls":`uppy-DashboardContent-panel--${e.id}`,"aria-selected":(null==(t=this.props.activePickerPanel)?void 0:t.id)===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id)},xt("div",{className:"uppy-DashboardTab-inner"},e.icon()),xt("div",{className:"uppy-DashboardTab-name"},e.name)))},this.renderAcquirers=e=>{const t=[...e],i=t.splice(e.length-2,e.length);return xt(kt,null,t.map((e=>this.renderAcquirer(e))),xt("span",{role:"presentation",style:{"white-space":"nowrap"}},i.map((e=>this.renderAcquirer(e)))))},this.renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:i,showNativeVideoCameraButton:s}=this.props;let n=[];const r="myDevice";t||n.push({key:r,elements:this.renderMyDeviceAcquirer()}),i&&n.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),s&&n.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),n.push(...e.map((e=>({key:e.id,elements:this.renderAcquirer(e)}))));1===n.length&&n[0].key===r&&(n=[]);const a=[...n],o=a.splice(n.length-2,n.length),l=e=>e.map((e=>{let{key:t,elements:i}=e;return xt(kt,{key:t},i)}));return xt(kt,null,this.renderDropPasteBrowseTagline(n.length),xt("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist"},l(a),xt("span",{role:"presentation",style:{"white-space":"nowrap"}},l(o))))}}[kr](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderPoweredByUppy(){const{i18nArray:e}=this.props,t=xt("span",null,xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11"},xt("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})),xt("span",{className:"uppy-Dashboard-poweredByUppy"},"Uppy"));return xt("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy"},e("poweredBy",{uppy:t}))}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:i}=this.props;return xt("div",{className:"uppy-Dashboard-AddFiles"},this.renderHiddenInput(!1,(e=>{this.fileInput=e})),this.renderHiddenInput(!0,(e=>{this.folderInput=e})),e&&this.renderHiddenCameraInput("photo",i,(e=>{this.mobilePhotoFileInput=e})),t&&this.renderHiddenCameraInput("video",i,(e=>{this.mobileVideoFileInput=e})),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),xt("div",{className:"uppy-Dashboard-AddFiles-info"},this.props.note&&xt("div",{className:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy(this.props)))}}const Tr=e=>xt("div",{className:hi("uppy-Dashboard-AddFilesPanel",e.className),"data-uppy-panelType":"AddFiles","aria-hidden":!e.showAddFilesPanel},xt("div",{className:"uppy-DashboardContent-bar"},xt("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18n("addingMoreFiles")),xt("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>e.toggleAddFilesPanel(!1)},e.i18n("back"))),xt(Dr,e));function Er(e){const{tagName:t}=e.target;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()}function Ar(e){let{activePickerPanel:t,className:i,hideAllPanels:s,i18n:n,state:r,uppy:a}=e;return xt("div",{className:hi("uppy-DashboardContent-panel",i),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${t.id}`,onDragOver:Er,onDragLeave:Er,onDrop:Er,onPaste:Er},xt("div",{className:"uppy-DashboardContent-bar"},xt("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},n("importFrom",{name:t.name})),xt("button",{className:"uppy-DashboardContent-back",type:"button",onClick:s},n("cancel"))),xt("div",{className:"uppy-DashboardContent-panelBody"},a.getPlugin(t.id).render(r)))}function Mr(e){const t=e.files[e.fileCardFor];return xt("div",{className:hi("uppy-DashboardContent-panel",e.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor"},xt("div",{className:"uppy-DashboardContent-bar"},xt("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},e.i18nArray("editing",{file:xt("span",{className:"uppy-DashboardContent-titleFile"},t.meta?t.meta.name:t.name)})),xt("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>{e.uppy.emit("file-editor:cancel",t),e.closeFileEditor()}},e.i18n("cancel")),xt("button",{className:"uppy-DashboardContent-save",type:"button",onClick:e.saveFileEditor},e.i18n("save"))),xt("div",{className:"uppy-DashboardContent-panelBody"},e.editors.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))}const Nr="error",Ur="waiting",Br="preprocessing",Ir="uploading",Rr="postprocessing",zr="complete",Lr="paused";function jr(e){let{files:t,i18n:i,isAllComplete:s,isAllErrored:n,isAllPaused:r,inProgressNotPausedFiles:a,newFiles:o,processingFiles:l}=e;const h=function(e,t,i,s){if(void 0===s&&(s={}),e)return Nr;if(t)return zr;if(i)return Lr;let n=Ur;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:e}=s[r[a]];if(e.uploadStarted&&!e.uploadComplete)return Ir;e.preprocess&&n!==Ir&&(n=Br),e.postprocess&&n!==Ir&&n!==Br&&(n=Rr)}return n}(n,s,r,t);switch(h){case"uploading":return i("uploadingXFiles",{smart_count:a.length});case"preprocessing":case"postprocessing":return i("processingXFiles",{smart_count:l.length});case"paused":return i("uploadPaused");case"waiting":return i("xFilesSelected",{smart_count:o.length});case"complete":return i("uploadComplete");case"error":return i("error")}}function Hr(e){const{i18n:t,isAllComplete:i,hideCancelButton:s,maxNumberOfFiles:n,toggleAddFilesPanel:r,uppy:a}=e;let{allowNewUpload:o}=e;return o&&n&&(o=e.totalFileCount<e.maxNumberOfFiles),xt("div",{className:"uppy-DashboardContent-bar"},i||s?xt("div",null):xt("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll()},t("cancel")),xt("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},xt(jr,e)),o?xt("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":t("addMoreFiles"),title:t("addMoreFiles"),onClick:()=>r(!0)},xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15"},xt("path",{d:"M8 6.5h6a.5.5 0 0 1 .5.5v.5a.5.5 0 0 1-.5.5H8v6a.5.5 0 0 1-.5.5H7a.5.5 0 0 1-.5-.5V8h-6a.5.5 0 0 1-.5-.5V7a.5.5 0 0 1 .5-.5h6v-6A.5.5 0 0 1 7 0h.5a.5.5 0 0 1 .5.5v6z"})),xt("span",{className:"uppy-DashboardContent-addMoreCaption"},t("addMore"))):xt("div",null))}function qr(e){const{computedMetaFields:t,requiredMetaFields:i,updateMeta:s,form:n,formState:r}=e,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return t.map((e=>{const t=`uppy-Dashboard-FileCard-input-${e.id}`,o=i.includes(e.id);return xt("fieldset",{key:e.id,className:"uppy-Dashboard-FileCard-fieldset"},xt("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:t},e.name),void 0!==e.render?e.render({value:r[e.id],onChange:t=>s(t,e.id),fieldCSSClasses:a,required:o,form:n.id},xt):xt("input",{className:a.text,id:t,form:n.id,type:e.type||"text",required:o,value:r[e.id],placeholder:e.placeholder,onInput:t=>s(t.target.value,e.id),"data-uppy-super-focusable":!0}))}))}function Wr(e){var t;const{files:i,fileCardFor:s,toggleFileCard:n,saveFileCard:r,metaFields:a,requiredMetaFields:o,openFileEditor:l,i18n:h,i18nArray:p,className:d,canEditFile:u}=e,f=i[s],m=null!=(t="function"==typeof a?a(i[s]):a)?t:[],g=u(f),y={};m.forEach((e=>{var t;y[e.id]=null!=(t=f.meta[e.id])?t:""}));const[v,b]=Ln(y),w=(_=e=>{e.preventDefault(),r(v,s)},Tn=8,qn((function(){return _}),[r,v,s]));var _;const F=()=>{n(!1)},[C]=Ln((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=c(),e}));return jn((()=>(document.body.appendChild(C),C.addEventListener("submit",w),()=>{C.removeEventListener("submit",w),document.body.removeChild(C)})),[C,w]),xt("div",{className:hi("uppy-Dashboard-FileCard",d),"data-uppy-panelType":"FileCard",onDragOver:Er,onDragLeave:Er,onDrop:Er,onPaste:Er},xt("div",{className:"uppy-DashboardContent-bar"},xt("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":"1"},p("editing",{file:xt("span",{className:"uppy-DashboardContent-titleFile"},f.meta?f.meta.name:f.name)})),xt("button",{className:"uppy-DashboardContent-back",type:"button",form:C.id,title:h("finishEditingFile"),onClick:F},h("cancel"))),xt("div",{className:"uppy-Dashboard-FileCard-inner"},xt("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:hr(f.type).color}},xt(pr,{file:f}),g&&xt("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:e=>{w(e),l(f)}},h("editImage"))),xt("div",{className:"uppy-Dashboard-FileCard-info"},xt(qr,{computedMetaFields:m,requiredMetaFields:o,updateMeta:(e,t)=>{b({...v,[t]:e})},form:C,formState:v})),xt("div",{className:"uppy-Dashboard-FileCard-actions"},xt("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:C.id},h("saveChanges")),xt("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:F,form:C.id},h("cancel")))))}const $r="uppy-transition-slideDownUp";function Vr(e){let{children:t}=e;const[i,s]=Ln(null),[n,r]=Ln(""),a=Hn(),o=Hn(),l=Hn();return jn((()=>{const e=Bt(t)[0];i!==e&&(e&&!i?(r(`${$r}-enter`),cancelAnimationFrame(l.current),clearTimeout(o.current),o.current=void 0,l.current=requestAnimationFrame((()=>{r(`${$r}-enter ${$r}-enter-active`),a.current=setTimeout((()=>{r("")}),250)}))):!i||e||o.current||(r(`${$r}-leave`),cancelAnimationFrame(l.current),clearTimeout(a.current),a.current=void 0,l.current=requestAnimationFrame((()=>{r(`${$r}-leave ${$r}-leave-active`),o.current=setTimeout((()=>{s(null),r("")}),250)}))),s(e))}),[t,i]),jn((()=>()=>{clearTimeout(a.current),clearTimeout(o.current),cancelAnimationFrame(l.current)}),[]),i?Yt(i,{className:hi(n,i.props.className)}):null}function Xr(){return Xr=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&(e[s]=i[s])}return e},Xr.apply(this,arguments)}var Gr={strings:{closeModal:"Close Modal",addMoreFiles:"Add more files",addingMoreFiles:"Adding more files",importFrom:"Import from %{name}",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard.",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",back:"Back",removeFile:"Remove file",editFile:"Edit file",editImage:"Edit image",editing:"Editing %{file}",error:"Error",finishEditingFile:"Finish editing file",saveChanges:"Save changes",myDevice:"My Device",dropHint:"Drop your files here",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},poweredBy:"Powered by %{uppy}",addMore:"Add more",editFileWithFilename:"Edit file %{file}",save:"Save",cancel:"Cancel",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",importFiles:"Import files from:",browseFiles:"browse files",browseFolders:"browse folders",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},recoveredAllFiles:"We restored all files. You can now resume the upload.",sessionRestored:"Session restored",reSelect:"Re-select",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},takePictureBtn:"Take Picture",recordVideoBtn:"Record Video"}};function Yr(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Kr=0;function Qr(e){return"__private_"+Kr+++"_"+e}const Zr=sr.default||sr;function Jr(){const e={};return e.promise=new Promise(((t,i)=>{e.resolve=t,e.reject=i})),e}const ea={target:"body",metaFields:[],inline:!1,width:750,height:550,thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:function(){return xt("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},xt("path",{d:"M15 30c8.284 0 15-6.716 15-15 0-8.284-6.716-15-15-15C6.716 0 0 6.716 0 15c0 8.284 6.716 15 15 15zm4.258-12.676v6.846h-8.426v-6.846H5.204l9.82-12.364 9.82 12.364H19.26z"}))},showLinkToFileUploadResult:!1,showProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,browserBackButtonClose:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,autoOpenFileEditor:!1,disabled:!1,disableLocalFiles:!1,doneButtonHandler:void 0,onRequestCloseModal:null};var ta=Qr("disabledNodes"),ia=Qr("generateLargeThumbnailIfSingleFile"),sa=Qr("openFileEditorWhenFilesAdded"),na=Qr("attachRenderFunctionToTarget"),ra=Qr("isTargetSupported"),aa=Qr("getAcquirers"),oa=Qr("getProgressIndicators"),la=Qr("getEditors"),ha=Qr("addSpecifiedPluginsFromOptions"),pa=Qr("autoDiscoverPlugins"),da=Qr("addSupportedPluginIfNoTarget");class ua extends ni{constructor(e,t){var i;let s;s=t?void 0===t.autoOpen?t.autoOpenFileEditor?"imageEditor":null:t.autoOpen:null,super(e,{...ea,...t,autoOpen:s}),Object.defineProperty(this,ta,{writable:!0,value:void 0}),this.modalName=`uppy-Dashboard-${c()}`,this.superFocus=function(){let e=!1;return Y(((t,i)=>{const s=rr(t,i),n=s.contains(document.activeElement);if(n&&e)return;const r=s.querySelector("[data-uppy-super-focusable]");if(!n||r)if(r)r.focus({preventScroll:!0}),e=!0;else{const t=s.querySelector(nr);null==t||t.focus({preventScroll:!0}),e=!1}}),260)}(),this.ifFocusedOnUppyRecently=!1,this.removeTarget=e=>{const t=this.getPluginState().targets.filter((t=>t.id!==e.id));this.setPluginState({targets:t})},this.addTarget=e=>{const t=e.id||e.constructor.name,i=e.title||t,s=e.type;if("acquirer"!==s&&"progressindicator"!==s&&"editor"!==s){const e="Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor";return this.uppy.log(e,"error"),null}const n={id:t,name:i,type:s},r=this.getPluginState().targets.slice();return r.push(n),this.setPluginState({targets:r}),this.el},this.hideAllPanels=()=>{var e;const t=this.getPluginState(),i={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};t.activePickerPanel===i.activePickerPanel&&t.showAddFilesPanel===i.showAddFilesPanel&&t.showFileEditor===i.showFileEditor&&t.activeOverlayType===i.activeOverlayType||(this.setPluginState(i),this.uppy.emit("dashboard:close-panel",null==(e=t.activePickerPanel)?void 0:e.id))},this.showPanel=e=>{const{targets:t}=this.getPluginState(),i=t.find((t=>"acquirer"===t.type&&t.id===e));this.setPluginState({activePickerPanel:i,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)},this.canEditFile=e=>{const{targets:t}=this.getPluginState();return Yr(this,la)[la](t).some((t=>this.uppy.getPlugin(t.id).canEditFile(e)))},this.openFileEditor=e=>{const{targets:t}=this.getPluginState(),i=Yr(this,la)[la](t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),i.forEach((t=>{this.uppy.getPlugin(t.id).selectFile(e)}))},this.closeFileEditor=()=>{const{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})},this.saveFileEditor=()=>{const{targets:e}=this.getPluginState();Yr(this,la)[la](e).forEach((e=>{this.uppy.getPlugin(e.id).save()})),this.closeFileEditor()},this.openModal=()=>{const{promise:e,resolve:t}=Jr();if(this.savedScrollPosition=window.pageYOffset,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing){const e=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",e,!1),t()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!1}),t();return this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDownInModal),this.uppy.emit("dashboard:modal-open"),e},this.closeModal=e=>{var t;const i=null==(t=null==e?void 0:e.manualClose)||t,{isHidden:s,isClosing:n}=this.getPluginState();if(s||n)return;const{promise:r,resolve:a}=Jr();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const e=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",e,!1),a()};this.el.addEventListener("animationend",e,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),a();var o;(document.removeEventListener("keydown",this.handleKeyDownInModal),i)&&(this.opts.browserBackButtonClose&&null!=(o=history.state)&&o[this.modalName]&&history.back());return this.uppy.emit("dashboard:modal-closed"),r},this.isModalOpen=()=>!this.getPluginState().isHidden||!1,this.requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal(),this.setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})},this.handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log("[Dashboard] Dark mode is "+(t?"on":"off")),this.setDarkModeCapability(t)},this.toggleFileCard=(e,t)=>{const i=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",i):this.uppy.emit("dashboard:file-edit-complete",i),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})},this.toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})},this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||e.webkitRelativePath||null}})));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}},this.startListeningToResize=()=>{this.resizeObserver=new ResizeObserver((e=>{const t=e[0],{width:i,height:s}=t.contentRect;this.setPluginState({containerWidth:i,containerHeight:s,areInsidesReadyToBeVisible:!0})})),this.resizeObserver.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.makeDashboardInsidesVisibleAnywayTimeout=setTimeout((()=>{const e=this.getPluginState(),t=!this.opts.inline&&e.isHidden;e.areInsidesReadyToBeVisible||t||(this.uppy.log("[Dashboard] resize event didn’t fire on time: defaulted to mobile layout","warning"),this.setPluginState({areInsidesReadyToBeVisible:!0}))}),1e3)},this.stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)},this.recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())},this.disableInteractiveElements=e=>{var t;const i=null!=(t=Yr(this,ta)[ta])?t:_n(this.el.querySelectorAll(["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'])).filter((e=>!e.classList.contains("uppy-Dashboard-close")));for(const s of i)"A"===s.tagName?s.setAttribute("aria-disabled",e):s.disabled=e;Yr(this,ta)[ta]=e?i:null,this.dashboardIsDisabled=e},this.updateBrowserHistory=()=>{var e;null!=(e=history.state)&&e[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)},this.handlePopState=e=>{var t;!this.isModalOpen()||e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&null!=(t=e.state)&&t[this.modalName]&&history.back()},this.handleKeyDownInModal=e=>{27===e.keyCode&&this.requestCloseModal(),9===e.keyCode&&or(e,this.getPluginState().activeOverlayType,this.el)},this.handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()},this.handlePaste=e=>{this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootPaste||t.handleRootPaste(e))}));const t=_n(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))},this.handleInputChange=e=>{e.preventDefault();const t=_n(e.target.files);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))},this.handleDragOver=e=>{var t,i;e.preventDefault(),e.stopPropagation();const s=(()=>{let t=!0;return this.uppy.iteratePlugins((i=>{null!=i.canHandleRootDrop&&i.canHandleRootDrop(e)&&(t=!0)})),t})(),n=(()=>{const{types:t}=e.dataTransfer;return t.some((e=>"Files"===e))})();if(!s&&!n||this.opts.disabled||this.opts.disableLocalFiles&&(n||!s)||!this.uppy.getState().allowNewUpload)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(i=this.opts).onDragOver)||t.call(i,e)},this.handleDragLeave=e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(i=this.opts).onDragLeave)||t.call(i,e)},this.handleDrop=async e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins((t=>{"acquirer"===t.type&&(null==t.handleRootDrop||t.handleRootDrop(e))}));let s=!1;this.uppy.log("[Dashboard] Processing dropped files");const n=await Pn(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error"),s||(this.uppy.info(e.message,"error"),s=!0)}});n.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(n)),null==(t=(i=this.opts).onDrop)||t.call(i,e)},this.handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)},this.handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)},this.handleKeyDownInInline=e=>{9===e.keyCode&&function(e,t,i){null===t||or(e,t,i)}(e,this.getPluginState().activeOverlayType,this.el)},this.handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)},this.handleComplete=e=>{let{failed:t}=e;!this.opts.closeAfterFinish||null!=t&&t.length||this.requestCloseModal()},this.handleCancelRestore=()=>{this.uppy.emit("restore-canceled")},Object.defineProperty(this,ia,{writable:!0,value:()=>{if(this.opts.disableThumbnailGenerator)return;const e=this.uppy.getFiles();if(1===e.length){const t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);null==t||t.setOptions({thumbnailWidth:600});const i={...e[0],preview:void 0};null==t||t.requestThumbnail(i).then((()=>{null==t||t.setOptions({thumbnailWidth:this.opts.thumbnailWidth})}))}}}),Object.defineProperty(this,sa,{writable:!0,value:e=>{const t=e[0],{metaFields:i}=this.getPluginState(),s=i&&i.length>0,n=this.canEditFile(t);s&&"metaEditor"===this.opts.autoOpen?this.toggleFileCard(!0,t.id):n&&"imageEditor"===this.opts.autoOpen&&this.openFileEditor(t)}}),this.initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=wn(this.opts.trigger);e?e.forEach((e=>e.addEventListener("click",this.openModal))):this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options, unless you are planning to call `dashboard.openModal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",Yr(this,da)[da]),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.hideAllPanels),this.uppy.on("dashboard:modal-closed",this.hideAllPanels),this.uppy.on("complete",this.handleComplete),this.uppy.on("files-added",Yr(this,ia)[ia]),this.uppy.on("file-removed",Yr(this,ia)[ia]),document.addEventListener("focus",this.recordIfFocusedOnUppyRecently,!0),document.addEventListener("click",this.recordIfFocusedOnUppyRecently,!0),this.opts.inline&&this.el.addEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.on("files-added",Yr(this,sa)[sa])},this.removeEvents=()=>{const e=wn(this.opts.trigger);!this.opts.inline&&e&&e.forEach((e=>e.removeEventListener("click",this.openModal))),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",Yr(this,da)[da]),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.hideAllPanels),this.uppy.off("dashboard:modal-closed",this.hideAllPanels),this.uppy.off("complete",this.handleComplete),this.uppy.off("files-added",Yr(this,ia)[ia]),this.uppy.off("file-removed",Yr(this,ia)[ia]),document.removeEventListener("focus",this.recordIfFocusedOnUppyRecently),document.removeEventListener("click",this.recordIfFocusedOnUppyRecently),this.opts.inline&&this.el.removeEventListener("keydown",this.handleKeyDownInInline),this.opts.autoOpen&&this.uppy.off("files-added",Yr(this,sa)[sa])},this.superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||null===document.activeElement,i=0===this.uppy.getState().info.length,s=!this.opts.inline;i&&(s||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()},this.afterUpdate=()=>{!this.opts.disabled||this.dashboardIsDisabled?(!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()):this.disableInteractiveElements(!0)},this.saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)},Object.defineProperty(this,na,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}}}),Object.defineProperty(this,ra,{writable:!0,value:e=>{const t=this.uppy.getPlugin(e.id);return"function"!=typeof t.isSupported||t.isSupported()}}),Object.defineProperty(this,aa,{writable:!0,value:Zr((e=>e.filter((e=>"acquirer"===e.type&&Yr(this,ra)[ra](e))).map(Yr(this,na)[na])))}),Object.defineProperty(this,oa,{writable:!0,value:Zr((e=>e.filter((e=>"progressindicator"===e.type)).map(Yr(this,na)[na])))}),Object.defineProperty(this,la,{writable:!0,value:Zr((e=>e.filter((e=>"editor"===e.type)).map(Yr(this,na)[na])))}),this.render=e=>{const t=this.getPluginState(),{files:i,capabilities:s,allowNewUpload:n}=e,{newFiles:r,uploadStartedFiles:a,completeFiles:o,erroredFiles:l,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:u,isAllComplete:c,isAllErrored:f,isAllPaused:m}=this.uppy.getObjectOfFilesPerState(),g=Yr(this,aa)[aa](t.targets),y=Yr(this,oa)[oa](t.targets),v=Yr(this,la)[la](t.targets);let b;return b="auto"===this.opts.theme?s.darkMode?"dark":"light":this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files"),function(e){const t=0===e.totalFileCount,i=1===e.totalFileCount,s=e.containerWidth>576,n=e.containerHeight>330,r=hi({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":e.disabled,"uppy-Dashboard--animateOpenClose":e.animateOpenClose,"uppy-Dashboard--isClosing":e.isClosing,"uppy-Dashboard--isDraggingOver":e.isDraggingOver,"uppy-Dashboard--modal":!e.inline,"uppy-size--md":e.containerWidth>576,"uppy-size--lg":e.containerWidth>700,"uppy-size--xl":e.containerWidth>900,"uppy-size--height-md":e.containerHeight>330,"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":e.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":e.singleFileFullScreen&&i&&n});let a=1;e.containerWidth>900?a=5:e.containerWidth>700?a=4:e.containerWidth>576&&(a=3);const o=e.showSelectedFiles&&!t,l=e.recoveredState?Object.keys(e.recoveredState.files).length:null,h=e.files?Object.keys(e.files).filter((t=>e.files[t].isGhost)).length:null;return xt("div",{className:r,"data-uppy-theme":e.theme,"data-uppy-num-acquirers":e.acquirers.length,"data-uppy-drag-drop-supported":!e.disableLocalFiles&&lr(),"aria-hidden":e.inline?"false":e.isHidden,"aria-disabled":e.disabled,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onPaste:e.handlePaste,onDragOver:e.handleDragOver,onDragLeave:e.handleDragLeave,onDrop:e.handleDrop},xt("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:e.handleClickOutside}),xt("div",{className:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:e.inline?void 0:"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},e.inline?null:xt("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onClick:e.closeModal},xt("span",{"aria-hidden":"true"},"×")),xt("div",{className:"uppy-Dashboard-innerWrap"},xt("div",{className:"uppy-Dashboard-dropFilesHereHint"},e.i18n("dropHint")),o&&xt(Hr,e),l&&xt("div",{className:"uppy-Dashboard-serviceMsg"},xt("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19"},xt("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd"},xt("path",{d:"M12.857 1.43l10.234 17.056A1 1 0 0122.234 20H1.766a1 1 0 01-.857-1.514L11.143 1.429a1 1 0 011.714 0z",fill:"#FFD300"}),xt("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),xt("circle",{fill:"#000",cx:"12",cy:"17",r:"1"}))),xt("strong",{className:"uppy-Dashboard-serviceMsg-title"},e.i18n("sessionRestored")),xt("div",{className:"uppy-Dashboard-serviceMsg-text"},h>0?e.i18n("recoveredXFiles",{smart_count:h}):e.i18n("recoveredAllFiles"))),o?xt(Or,{id:e.id,error:e.error,i18n:e.i18n,uppy:e.uppy,files:e.files,acquirers:e.acquirers,resumableUploads:e.resumableUploads,hideRetryButton:e.hideRetryButton,hidePauseResumeButton:e.hidePauseResumeButton,hideCancelButton:e.hideCancelButton,showLinkToFileUploadResult:e.showLinkToFileUploadResult,showRemoveButtonAfterComplete:e.showRemoveButtonAfterComplete,isWide:e.isWide,metaFields:e.metaFields,toggleFileCard:e.toggleFileCard,handleRequestThumbnail:e.handleRequestThumbnail,handleCancelThumbnail:e.handleCancelThumbnail,recoveredState:e.recoveredState,individualCancellation:e.individualCancellation,openFileEditor:e.openFileEditor,canEditFile:e.canEditFile,toggleAddFilesPanel:e.toggleAddFilesPanel,isSingleFile:i,itemsPerRow:a}):xt(Dr,Xr({},e,{isSizeMD:s})),xt(Vr,null,e.showAddFilesPanel?xt(Tr,Xr({key:"AddFiles"},e,{isSizeMD:s})):null),xt(Vr,null,e.fileCardFor?xt(Wr,Xr({key:"FileCard"},e)):null),xt(Vr,null,e.activePickerPanel?xt(Ar,Xr({key:"Picker"},e)):null),xt(Vr,null,e.showFileEditor?xt(Mr,Xr({key:"Editor"},e)):null),xt("div",{className:"uppy-Dashboard-progressindicators"},e.progressindicators.map((t=>e.uppy.getPlugin(t.id).render(e.state)))))))}({state:e,isHidden:t.isHidden,files:i,newFiles:r,uploadStartedFiles:a,completeFiles:o,erroredFiles:l,inProgressFiles:h,inProgressNotPausedFiles:p,processingFiles:d,isUploadStarted:u,isAllComplete:c,isAllErrored:f,isAllPaused:m,totalFileCount:Object.keys(i).length,totalProgress:e.totalProgress,allowNewUpload:n,acquirers:g,theme:b,disabled:this.opts.disabled,disableLocalFiles:this.opts.disableLocalFiles,direction:this.opts.direction,activePickerPanel:t.activePickerPanel,showFileEditor:t.showFileEditor,saveFileEditor:this.saveFileEditor,closeFileEditor:this.closeFileEditor,disableInteractiveElements:this.disableInteractiveElements,animateOpenClose:this.opts.animateOpenClose,isClosing:t.isClosing,progressindicators:y,editors:v,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,i18n:this.i18n,i18nArray:this.i18nArray,uppy:this.uppy,note:this.opts.note,recoveredState:e.recoveredState,metaFields:t.metaFields,resumableUploads:s.resumableUploads||!1,individualCancellation:s.individualCancellation,isMobileDevice:s.isMobileDevice,fileCardFor:t.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:t.showAddFilesPanel,saveFileCard:this.saveFileCard,openFileEditor:this.openFileEditor,canEditFile:this.canEditFile,width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,fileManagerSelectionType:this.opts.fileManagerSelectionType,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,hideCancelButton:this.opts.hideCancelButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,isTargetDOMEl:this.isTargetDOMEl,parentElement:this.el,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,requiredMetaFields:this.uppy.opts.restrictions.requiredMetaFields,showSelectedFiles:this.opts.showSelectedFiles,showNativePhotoCameraButton:this.opts.showNativePhotoCameraButton,showNativeVideoCameraButton:this.opts.showNativeVideoCameraButton,nativeCameraFacingMode:this.opts.nativeCameraFacingMode,singleFileFullScreen:this.opts.singleFileFullScreen,handleCancelRestore:this.handleCancelRestore,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop})},Object.defineProperty(this,ha,{writable:!0,value:()=>{(this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t?t.mount(this,t):this.uppy.log(`[Uppy] Dashboard could not find plugin '${e}', make sure to uppy.use() the plugins you are specifying`,"warning")}))}}),Object.defineProperty(this,pa,{writable:!0,value:()=>{this.uppy.iteratePlugins(Yr(this,da)[da])}}),Object.defineProperty(this,da,{writable:!0,value:e=>{var t;if(e&&(null==(t=e.opts)||!t.target)&&["acquirer","editor"].includes(e.type)){this.getPluginState().targets.some((t=>e.id===t.id))||e.mount(this,e)}}}),this.install=()=>{this.setPluginState({isHidden:!0,fileCardFor:null,activeOverlayType:null,showAddFilesPanel:!1,activePickerPanel:void 0,showFileEditor:!1,metaFields:this.opts.metaFields,targets:[],areInsidesReadyToBeVisible:!1,isDraggingOver:!1});const{inline:e,closeAfterFinish:t}=this.opts;if(e&&t)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");const{allowMultipleUploads:i,allowMultipleUploadBatches:s}=this.uppy.opts;(i||s)&&t&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploadBatches` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");const{target:n}=this.opts;n&&this.mount(n,this),this.opts.disableStatusBar||this.uppy.use(Wi,{id:`${this.id}:StatusBar`,target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale,doneButtonHandler:this.opts.doneButtonHandler}),this.opts.disableInformer||this.uppy.use(Ki,{id:`${this.id}:Informer`,target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(bn,{id:`${this.id}:ThumbnailGenerator`,thumbnailWidth:this.opts.thumbnailWidth,thumbnailHeight:this.opts.thumbnailHeight,thumbnailType:this.opts.thumbnailType,waitForThumbnailsBeforeUpload:this.opts.waitForThumbnailsBeforeUpload,lazy:!this.opts.waitForThumbnailsBeforeUpload}),this.darkModeMediaQuery="undefined"!=typeof window&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const r=!!this.darkModeMediaQuery&&this.darkModeMediaQuery.matches;var a;(this.uppy.log("[Dashboard] Dark mode is "+(r?"on":"off")),this.setDarkModeCapability(r),"auto"===this.opts.theme)&&(null==(a=this.darkModeMediaQuery)||a.addListener(this.handleSystemDarkModeChange));Yr(this,ha)[ha](),Yr(this,pa)[pa](),this.initEvents()},this.uninstall=()=>{if(!this.opts.disableInformer){const e=this.uppy.getPlugin(`${this.id}:Informer`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableStatusBar){const e=this.uppy.getPlugin(`${this.id}:StatusBar`);e&&this.uppy.removePlugin(e)}if(!this.opts.disableThumbnailGenerator){const e=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);e&&this.uppy.removePlugin(e)}var e;((this.opts.plugins||[]).forEach((e=>{const t=this.uppy.getPlugin(e);t&&t.unmount()})),"auto"===this.opts.theme)&&(null==(e=this.darkModeMediaQuery)||e.removeListener(this.handleSystemDarkModeChange));this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()},this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Gr,void 0===this.opts.doneButtonHandler&&(this.opts.doneButtonHandler=()=>{this.uppy.clearUploadedFiles(),this.requestCloseModal()}),null!=(i=this.opts).onRequestCloseModal||(i.onRequestCloseModal=()=>this.closeModal()),this.i18nInit()}}ua.VERSION="3.9.1";var ca={data:()=>({plugin:{}}),props:{uppy:{required:!0},props:{type:Object},plugins:{type:Array}},mounted(){this.installPlugin()},methods:{installPlugin(){const{uppy:e}=this,t={id:"vue:Dashboard",inline:!0,plugins:this.plugins,...this.props,target:this.$refs.container};e.use(ua,t),this.plugin=e.getPlugin(t.id)},uninstallPlugin(e){e.removePlugin(this.plugin)}},beforeDestroy(){this.uninstallPlugin(this.uppy)},beforeUnmount(){this.uninstallPlugin(this.uppy)},watch:{uppy(e,t){t!==e&&(this.uninstallPlugin(t),this.installPlugin())},props(e,t){(function(e,t){if(e===t)return!0;if(!e||!t)return!1;var i=Object.keys(e),s=Object.keys(t),n=i.length;if(s.length!==n)return!1;for(var r=0;r<n;r++){var a=i[r];if(e[a]!==t[a]||!Object.prototype.hasOwnProperty.call(t,a))return!1}return!0})(e,t)||this.plugin.setOptions({...e})}},render(){for(var e=arguments.length,i=new Array(e),s=0;s<e;s++)i[s]=arguments[s];if(function(){return arguments.length>0&&"function"==typeof(arguments.length<=0?void 0:arguments[0])}(...i)){const[e]=i;return e("div",{ref:"container"})}return t("div",{ref:"container"})}},fa={strings:{dropHereOr:"Drop here or %{browse}",browse:"browse"}};const ma={inputName:"files[]",width:"100%",height:"100%"};class ga extends ni{constructor(e,t){super(e,{...ma,...t}),this.isDragDropSupported=lr(),this.addFiles=e=>{const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e,meta:{relativePath:e.relativePath||null}})));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}},this.onInputChange=e=>{const t=_n(e.target.files);t.length>0&&(this.uppy.log("[DragDrop] Files selected through input"),this.addFiles(t)),e.target.value=null},this.handleDragOver=e=>{var t,i;e.preventDefault(),e.stopPropagation();const{types:s}=e.dataTransfer,n=s.some((e=>"Files"===e)),{allowNewUpload:r}=this.uppy.getState();if(!n||!r)return e.dataTransfer.dropEffect="none",void clearTimeout(this.removeDragOverClassTimeout);e.dataTransfer.dropEffect="copy",clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!0}),null==(t=(i=this.opts).onDragOver)||t.call(i,e)},this.handleDragLeave=e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.removeDragOverClassTimeout=setTimeout((()=>{this.setPluginState({isDraggingOver:!1})}),50),null==(t=(i=this.opts).onDragLeave)||t.call(i,e)},this.handleDrop=async e=>{var t,i;e.preventDefault(),e.stopPropagation(),clearTimeout(this.removeDragOverClassTimeout),this.setPluginState({isDraggingOver:!1});const s=await Pn(e.dataTransfer,{logDropError:e=>{this.uppy.log(e,"error")}});s.length>0&&(this.uppy.log("[DragDrop] Files dropped"),this.addFiles(s)),null==(t=(i=this.opts).onDrop)||t.call(i,e)},this.type="acquirer",this.id=this.opts.id||"DragDrop",this.title="Drag & Drop",this.defaultLocale=fa,this.i18nInit()}renderHiddenFileInput(){const{restrictions:e}=this.uppy.opts;return xt("input",{className:"uppy-DragDrop-input",type:"file",hidden:!0,ref:e=>{this.fileInputRef=e},name:this.opts.inputName,multiple:1!==e.maxNumberOfFiles,accept:e.allowedFileTypes,onChange:this.onInputChange})}static renderArrowSvg(){return xt("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16"},xt("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0",fillRule:"evenodd"}))}renderLabel(){return xt("div",{className:"uppy-DragDrop-label"},this.i18nArray("dropHereOr",{browse:xt("span",{className:"uppy-DragDrop-browse"},this.i18n("browse"))}))}renderNote(){return xt("span",{className:"uppy-DragDrop-note"},this.opts.note)}render(){return xt("button",{type:"button",className:`uppy-u-reset\n      uppy-DragDrop-container\n      ${this.isDragDropSupported?"uppy-DragDrop--isDragDropSupported":""}\n      ${this.getPluginState().isDraggingOver?"uppy-DragDrop--isDraggingOver":""}\n    `,style:{width:this.opts.width,height:this.opts.height},onClick:()=>this.fileInputRef.click(),onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop},this.renderHiddenFileInput(),xt("div",{className:"uppy-DragDrop-inner"},ga.renderArrowSvg(),this.renderLabel(),this.renderNote()))}install(){const{target:e}=this.opts;this.setPluginState({isDraggingOver:!1}),e&&this.mount(e,this)}uninstall(){this.unmount()}}ga.VERSION="3.1.1";const ya={target:"body",fixed:!1,hideAfterFinish:!0};(class extends ni{constructor(e,t){super(e,{...ya,...t}),this.id=this.opts.id||"ProgressBar",this.title="Progress Bar",this.type="progressindicator",this.render=this.render.bind(this)}render(e){const t=e.totalProgress||0,i=(0===t||100===t)&&this.opts.hideAfterFinish;return xt("div",{className:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":i},xt("div",{className:"uppy-ProgressBar-inner",style:{width:`${t}%`}}),xt("div",{className:"uppy-ProgressBar-percentage"},t))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}).VERSION="3.1.1";var va={strings:{chooseFiles:"Choose files"}};const ba={pretty:!0,inputName:"files[]"};(class extends ni{constructor(e,t){super(e,{...ba,...t}),this.id=this.opts.id||"FileInput",this.title="File Input",this.type="acquirer",this.defaultLocale=va,this.i18nInit(),this.render=this.render.bind(this),this.handleInputChange=this.handleInputChange.bind(this),this.handleClick=this.handleClick.bind(this)}addFiles(e){const t=e.map((e=>({source:this.id,name:e.name,type:e.type,data:e})));try{this.uppy.addFiles(t)}catch(i){this.uppy.log(i)}}handleInputChange(e){this.uppy.log("[FileInput] Something selected through input...");const t=_n(e.target.files);this.addFiles(t),e.target.value=null}handleClick(){this.input.click()}render(){const{restrictions:e}=this.uppy.opts,t=e.allowedFileTypes?e.allowedFileTypes.join(","):void 0;return xt("div",{className:"uppy-FileInput-container"},xt("input",{className:"uppy-FileInput-input",style:this.opts.pretty?{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1}:void 0,type:"file",name:this.opts.inputName,onChange:this.handleInputChange,multiple:1!==e.maxNumberOfFiles,accept:t,ref:e=>{this.input=e}}),this.opts.pretty&&xt("button",{className:"uppy-FileInput-btn",type:"button",onClick:this.handleClick},this.i18n("chooseFiles")))}install(){const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){this.unmount()}}).VERSION="3.1.2";
/*!
 * Cropper.js v1.5.7
 * https://fengyuanchen.github.io/cropperjs
 *
 * Copyright 2015-present Chen Fengyuan
 * Released under the MIT license
 *
 * Date: 2020-05-23T05:23:00.081Z
 */
function wa(e){return(wa="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Fa(e,t){for(var i=0;i<t.length;i++){var s=t[i];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(e,s.key,s)}}function Ca(e,t,i){return t in e?Object.defineProperty(e,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):e[t]=i,e}function Sa(e,t){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),i.push.apply(i,s)}return i}function Pa(e){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};t%2?Sa(Object(i),!0).forEach((function(t){Ca(e,t,i[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):Sa(Object(i)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(i,t))}))}return e}function xa(e){return function(e){if(Array.isArray(e))return Oa(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Oa(e,t);var i=Object.prototype.toString.call(e).slice(8,-1);"Object"===i&&e.constructor&&(i=e.constructor.name);if("Map"===i||"Set"===i)return Array.from(e);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return Oa(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Oa(e,t){(null==t||t>e.length)&&(t=e.length);for(var i=0,s=new Array(t);i<t;i++)s[i]=e[i];return s}var ka="undefined"!=typeof window&&void 0!==window.document,Da=ka?window:{},Ta=!(!ka||!Da.document.documentElement)&&"ontouchstart"in Da.document.documentElement,Ea=!!ka&&"PointerEvent"in Da,Aa="".concat("cropper","-crop"),Ma="".concat("cropper","-disabled"),Na="".concat("cropper","-hidden"),Ua="".concat("cropper","-hide"),Ba="".concat("cropper","-invisible"),Ia="".concat("cropper","-modal"),Ra="".concat("cropper","-move"),za="".concat("cropper","Action"),La="".concat("cropper","Preview"),ja=Ea?"pointerdown":Ta?"touchstart":"mousedown",Ha=Ea?"pointermove":Ta?"touchmove":"mousemove",qa=Ea?"pointerup pointercancel":Ta?"touchend touchcancel":"mouseup",Wa=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,$a=/^data:/,Va=/^data:image\/jpeg;base64,/,Xa=/^img|canvas$/i,Ga={viewMode:0,dragMode:"crop",initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Ya=Number.isNaN||Da.isNaN;function Ka(e){return"number"==typeof e&&!Ya(e)}var Qa=function(e){return e>0&&e<1/0};function Za(e){return void 0===e}function Ja(e){return"object"===wa(e)&&null!==e}var eo=Object.prototype.hasOwnProperty;function to(e){if(!Ja(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&eo.call(i,"isPrototypeOf")}catch(s){return!1}}function io(e){return"function"==typeof e}var so=Array.prototype.slice;function no(e){return Array.from?Array.from(e):so.call(e)}function ro(e,t){return e&&io(t)&&(Array.isArray(e)||Ka(e.length)?no(e).forEach((function(i,s){t.call(e,i,s,e)})):Ja(e)&&Object.keys(e).forEach((function(i){t.call(e,e[i],i,e)}))),e}var ao=Object.assign||function(e){for(var t=arguments.length,i=new Array(t>1?t-1:0),s=1;s<t;s++)i[s-1]=arguments[s];return Ja(e)&&i.length>0&&i.forEach((function(t){Ja(t)&&Object.keys(t).forEach((function(i){e[i]=t[i]}))})),e},oo=/\.\d*(?:0|9){12}\d*$/;function lo(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return oo.test(e)?Math.round(e*t)/t:e}var ho=/^width|height|left|top|marginLeft|marginTop$/;function po(e,t){var i=e.style;ro(t,(function(e,t){ho.test(t)&&Ka(e)&&(e="".concat(e,"px")),i[t]=e}))}function uo(e,t){if(t)if(Ka(e.length))ro(e,(function(e){uo(e,t)}));else if(e.classList)e.classList.add(t);else{var i=e.className.trim();i?i.indexOf(t)<0&&(e.className="".concat(i," ").concat(t)):e.className=t}}function co(e,t){t&&(Ka(e.length)?ro(e,(function(e){co(e,t)})):e.classList?e.classList.remove(t):e.className.indexOf(t)>=0&&(e.className=e.className.replace(t,"")))}function fo(e,t,i){t&&(Ka(e.length)?ro(e,(function(e){fo(e,t,i)})):i?uo(e,t):co(e,t))}var mo=/([a-z\d])([A-Z])/g;function go(e){return e.replace(mo,"$1-$2").toLowerCase()}function yo(e,t){return Ja(e[t])?e[t]:e.dataset?e.dataset[t]:e.getAttribute("data-".concat(go(t)))}function vo(e,t,i){Ja(i)?e[t]=i:e.dataset?e.dataset[t]=i:e.setAttribute("data-".concat(go(t)),i)}var bo=/\s\s*/,wo=function(){var e=!1;if(ka){var t=!1,i=function(){},s=Object.defineProperty({},"once",{get:function(){return e=!0,t},set:function(e){t=e}});Da.addEventListener("test",i,s),Da.removeEventListener("test",i,s)}return e}();function _o(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(bo).forEach((function(t){if(!wo){var r=e.listeners;r&&r[t]&&r[t][i]&&(n=r[t][i],delete r[t][i],0===Object.keys(r[t]).length&&delete r[t],0===Object.keys(r).length&&delete e.listeners)}e.removeEventListener(t,n,s)}))}function Fo(e,t,i){var s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(bo).forEach((function(t){if(s.once&&!wo){var r=e.listeners,a=void 0===r?{}:r;n=function(){delete a[t][i],e.removeEventListener(t,n,s);for(var r=arguments.length,o=new Array(r),l=0;l<r;l++)o[l]=arguments[l];i.apply(e,o)},a[t]||(a[t]={}),a[t][i]&&e.removeEventListener(t,a[t][i],s),a[t][i]=n,e.listeners=a}e.addEventListener(t,n,s)}))}function Co(e,t,i){var s;return io(Event)&&io(CustomEvent)?s=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(s=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,i),e.dispatchEvent(s)}function So(e){var t=e.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Po=Da.location,xo=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Oo(e){var t=e.match(xo);return null!==t&&(t[1]!==Po.protocol||t[2]!==Po.hostname||t[3]!==Po.port)}function ko(e){var t="timestamp=".concat((new Date).getTime());return e+(-1===e.indexOf("?")?"?":"&")+t}function Do(e){var t=e.rotate,i=e.scaleX,s=e.scaleY,n=e.translateX,r=e.translateY,a=[];Ka(n)&&0!==n&&a.push("translateX(".concat(n,"px)")),Ka(r)&&0!==r&&a.push("translateY(".concat(r,"px)")),Ka(t)&&0!==t&&a.push("rotate(".concat(t,"deg)")),Ka(i)&&1!==i&&a.push("scaleX(".concat(i,")")),Ka(s)&&1!==s&&a.push("scaleY(".concat(s,")"));var o=a.length?a.join(" "):"none";return{WebkitTransform:o,msTransform:o,transform:o}}function To(e,t){var i=e.pageX,s=e.pageY,n={endX:i,endY:s};return t?n:Pa({startX:i,startY:s},n)}function Eo(e){var t=e.aspectRatio,i=e.height,s=e.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=Qa(s),a=Qa(i);if(r&&a){var o=i*t;"contain"===n&&o>s||"cover"===n&&o<s?i=s/t:s=i*t}else r?i=s/t:a&&(s=i*t);return{width:s,height:i}}function Ao(e,t,i,s){var n=t.aspectRatio,r=t.naturalWidth,a=t.naturalHeight,o=t.rotate,l=void 0===o?0:o,h=t.scaleX,p=void 0===h?1:h,d=t.scaleY,u=void 0===d?1:d,c=i.aspectRatio,f=i.naturalWidth,m=i.naturalHeight,g=s.fillColor,y=void 0===g?"transparent":g,v=s.imageSmoothingEnabled,b=void 0===v||v,w=s.imageSmoothingQuality,_=void 0===w?"low":w,F=s.maxWidth,C=void 0===F?1/0:F,S=s.maxHeight,P=void 0===S?1/0:S,x=s.minWidth,O=void 0===x?0:x,k=s.minHeight,D=void 0===k?0:k,T=document.createElement("canvas"),E=T.getContext("2d"),A=Eo({aspectRatio:c,width:C,height:P}),M=Eo({aspectRatio:c,width:O,height:D},"cover"),N=Math.min(A.width,Math.max(M.width,f)),U=Math.min(A.height,Math.max(M.height,m)),B=Eo({aspectRatio:n,width:C,height:P}),I=Eo({aspectRatio:n,width:O,height:D},"cover"),R=Math.min(B.width,Math.max(I.width,r)),z=Math.min(B.height,Math.max(I.height,a)),L=[-R/2,-z/2,R,z];return T.width=lo(N),T.height=lo(U),E.fillStyle=y,E.fillRect(0,0,N,U),E.save(),E.translate(N/2,U/2),E.rotate(l*Math.PI/180),E.scale(p,u),E.imageSmoothingEnabled=b,E.imageSmoothingQuality=_,E.drawImage.apply(E,[e].concat(xa(L.map((function(e){return Math.floor(lo(e))}))))),E.restore(),T}var Mo=String.fromCharCode;var No=/^data:.*,/;function Uo(e){var t,i=new DataView(e);try{var s,n,r;if(255===i.getUint8(0)&&216===i.getUint8(1))for(var a=i.byteLength,o=2;o+1<a;){if(255===i.getUint8(o)&&225===i.getUint8(o+1)){n=o;break}o+=1}if(n){var l=n+10;if("Exif"===function(e,t,i){var s="";i+=t;for(var n=t;n<i;n+=1)s+=Mo(e.getUint8(n));return s}(i,n+4,4)){var h=i.getUint16(l);if(((s=18761===h)||19789===h)&&42===i.getUint16(l+2,s)){var p=i.getUint32(l+4,s);p>=8&&(r=l+p)}}}if(r){var d,u,c=i.getUint16(r,s);for(u=0;u<c;u+=1)if(d=r+12*u+2,274===i.getUint16(d,s)){d+=8,t=i.getUint16(d,s),i.setUint16(d,1,s);break}}}catch(f){t=1}return t}var Bo={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var e=this.element,t=this.options,i=this.container,s=this.cropper;uo(s,Na),co(e,Na);var n={width:Math.max(i.offsetWidth,Number(t.minContainerWidth)||200),height:Math.max(i.offsetHeight,Number(t.minContainerHeight)||100)};this.containerData=n,po(s,{width:n.width,height:n.height}),uo(e,Na),co(s,Na)},initCanvas:function(){var e=this.containerData,t=this.imageData,i=this.options.viewMode,s=Math.abs(t.rotate)%180==90,n=s?t.naturalHeight:t.naturalWidth,r=s?t.naturalWidth:t.naturalHeight,a=n/r,o=e.width,l=e.height;e.height*a>e.width?3===i?o=e.height*a:l=e.width/a:3===i?l=e.width/a:o=e.height*a;var h={aspectRatio:a,naturalWidth:n,naturalHeight:r,width:o,height:l};h.left=(e.width-o)/2,h.top=(e.height-l)/2,h.oldLeft=h.left,h.oldTop=h.top,this.canvasData=h,this.limited=1===i||2===i,this.limitCanvas(!0,!0),this.initialImageData=ao({},t),this.initialCanvasData=ao({},h)},limitCanvas:function(e,t){var i=this.options,s=this.containerData,n=this.canvasData,r=this.cropBoxData,a=i.viewMode,o=n.aspectRatio,l=this.cropped&&r;if(e){var h=Number(i.minCanvasWidth)||0,p=Number(i.minCanvasHeight)||0;a>1?(h=Math.max(h,s.width),p=Math.max(p,s.height),3===a&&(p*o>h?h=p*o:p=h/o)):a>0&&(h?h=Math.max(h,l?r.width:0):p?p=Math.max(p,l?r.height:0):l&&(h=r.width,(p=r.height)*o>h?h=p*o:p=h/o));var d=Eo({aspectRatio:o,width:h,height:p});h=d.width,p=d.height,n.minWidth=h,n.minHeight=p,n.maxWidth=1/0,n.maxHeight=1/0}if(t)if(a>(l?0:1)){var u=s.width-n.width,c=s.height-n.height;n.minLeft=Math.min(0,u),n.minTop=Math.min(0,c),n.maxLeft=Math.max(0,u),n.maxTop=Math.max(0,c),l&&this.limited&&(n.minLeft=Math.min(r.left,r.left+(r.width-n.width)),n.minTop=Math.min(r.top,r.top+(r.height-n.height)),n.maxLeft=r.left,n.maxTop=r.top,2===a&&(n.width>=s.width&&(n.minLeft=Math.min(0,u),n.maxLeft=Math.max(0,u)),n.height>=s.height&&(n.minTop=Math.min(0,c),n.maxTop=Math.max(0,c))))}else n.minLeft=-n.width,n.minTop=-n.height,n.maxLeft=s.width,n.maxTop=s.height},renderCanvas:function(e,t){var i=this.canvasData,s=this.imageData;if(t){var n=function(e){var t=e.width,i=e.height,s=e.degree;if(90==(s=Math.abs(s)%180))return{width:i,height:t};var n=s%90*Math.PI/180,r=Math.sin(n),a=Math.cos(n),o=t*a+i*r,l=t*r+i*a;return s>90?{width:l,height:o}:{width:o,height:l}}({width:s.naturalWidth*Math.abs(s.scaleX||1),height:s.naturalHeight*Math.abs(s.scaleY||1),degree:s.rotate||0}),r=n.width,a=n.height,o=i.width*(r/i.naturalWidth),l=i.height*(a/i.naturalHeight);i.left-=(o-i.width)/2,i.top-=(l-i.height)/2,i.width=o,i.height=l,i.aspectRatio=r/a,i.naturalWidth=r,i.naturalHeight=a,this.limitCanvas(!0,!1)}(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCanvas(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,po(this.canvas,ao({width:i.width,height:i.height},Do({translateX:i.left,translateY:i.top}))),this.renderImage(e),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(e){var t=this.canvasData,i=this.imageData,s=i.naturalWidth*(t.width/t.naturalWidth),n=i.naturalHeight*(t.height/t.naturalHeight);ao(i,{width:s,height:n,left:(t.width-s)/2,top:(t.height-n)/2}),po(this.image,ao({width:i.width,height:i.height},Do(ao({translateX:i.left,translateY:i.top},i)))),e&&this.output()},initCropBox:function(){var e=this.options,t=this.canvasData,i=e.aspectRatio||e.initialAspectRatio,s=Number(e.autoCropArea)||.8,n={width:t.width,height:t.height};i&&(t.height*i>t.width?n.height=n.width/i:n.width=n.height*i),this.cropBoxData=n,this.limitCropBox(!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.width=Math.max(n.minWidth,n.width*s),n.height=Math.max(n.minHeight,n.height*s),n.left=t.left+(t.width-n.width)/2,n.top=t.top+(t.height-n.height)/2,n.oldLeft=n.left,n.oldTop=n.top,this.initialCropBoxData=ao({},n)},limitCropBox:function(e,t){var i=this.options,s=this.containerData,n=this.canvasData,r=this.cropBoxData,a=this.limited,o=i.aspectRatio;if(e){var l=Number(i.minCropBoxWidth)||0,h=Number(i.minCropBoxHeight)||0,p=a?Math.min(s.width,n.width,n.width+n.left,s.width-n.left):s.width,d=a?Math.min(s.height,n.height,n.height+n.top,s.height-n.top):s.height;l=Math.min(l,s.width),h=Math.min(h,s.height),o&&(l&&h?h*o>l?h=l/o:l=h*o:l?h=l/o:h&&(l=h*o),d*o>p?d=p/o:p=d*o),r.minWidth=Math.min(l,p),r.minHeight=Math.min(h,d),r.maxWidth=p,r.maxHeight=d}t&&(a?(r.minLeft=Math.max(0,n.left),r.minTop=Math.max(0,n.top),r.maxLeft=Math.min(s.width,n.left+n.width)-r.width,r.maxTop=Math.min(s.height,n.top+n.height)-r.height):(r.minLeft=0,r.minTop=0,r.maxLeft=s.width-r.width,r.maxTop=s.height-r.height))},renderCropBox:function(){var e=this.options,t=this.containerData,i=this.cropBoxData;(i.width>i.maxWidth||i.width<i.minWidth)&&(i.left=i.oldLeft),(i.height>i.maxHeight||i.height<i.minHeight)&&(i.top=i.oldTop),i.width=Math.min(Math.max(i.width,i.minWidth),i.maxWidth),i.height=Math.min(Math.max(i.height,i.minHeight),i.maxHeight),this.limitCropBox(!1,!0),i.left=Math.min(Math.max(i.left,i.minLeft),i.maxLeft),i.top=Math.min(Math.max(i.top,i.minTop),i.maxTop),i.oldLeft=i.left,i.oldTop=i.top,e.movable&&e.cropBoxMovable&&vo(this.face,za,i.width>=t.width&&i.height>=t.height?"move":"all"),po(this.cropBox,ao({width:i.width,height:i.height},Do({translateX:i.left,translateY:i.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),Co(this.element,"crop",this.getData())}},Io={initPreview:function(){var e=this.element,t=this.crossOrigin,i=this.options.preview,s=t?this.crossOriginUrl:this.url,n=e.alt||"The image to preview",r=document.createElement("img");if(t&&(r.crossOrigin=t),r.src=s,r.alt=n,this.viewBox.appendChild(r),this.viewBoxImage=r,i){var a=i;"string"==typeof i?a=e.ownerDocument.querySelectorAll(i):i.querySelector&&(a=[i]),this.previews=a,ro(a,(function(e){var i=document.createElement("img");vo(e,La,{width:e.offsetWidth,height:e.offsetHeight,html:e.innerHTML}),t&&(i.crossOrigin=t),i.src=s,i.alt=n,i.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',e.innerHTML="",e.appendChild(i)}))}},resetPreview:function(){ro(this.previews,(function(e){var t=yo(e,La);po(e,{width:t.width,height:t.height}),e.innerHTML=t.html,function(e,t){if(Ja(e[t]))try{delete e[t]}catch(i){e[t]=void 0}else if(e.dataset)try{delete e.dataset[t]}catch(i){e.dataset[t]=void 0}else e.removeAttribute("data-".concat(go(t)))}(e,La)}))},preview:function(){var e=this.imageData,t=this.canvasData,i=this.cropBoxData,s=i.width,n=i.height,r=e.width,a=e.height,o=i.left-t.left-e.left,l=i.top-t.top-e.top;this.cropped&&!this.disabled&&(po(this.viewBoxImage,ao({width:r,height:a},Do(ao({translateX:-o,translateY:-l},e)))),ro(this.previews,(function(t){var i=yo(t,La),h=i.width,p=i.height,d=h,u=p,c=1;s&&(u=n*(c=h/s)),n&&u>p&&(d=s*(c=p/n),u=p),po(t,{width:d,height:u}),po(t.getElementsByTagName("img")[0],ao({width:r*c,height:a*c},Do(ao({translateX:-o*c,translateY:-l*c},e))))})))}},Ro={bind:function(){var e=this.element,t=this.options,i=this.cropper;io(t.cropstart)&&Fo(e,"cropstart",t.cropstart),io(t.cropmove)&&Fo(e,"cropmove",t.cropmove),io(t.cropend)&&Fo(e,"cropend",t.cropend),io(t.crop)&&Fo(e,"crop",t.crop),io(t.zoom)&&Fo(e,"zoom",t.zoom),Fo(i,ja,this.onCropStart=this.cropStart.bind(this)),t.zoomable&&t.zoomOnWheel&&Fo(i,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&Fo(i,"dblclick",this.onDblclick=this.dblclick.bind(this)),Fo(e.ownerDocument,Ha,this.onCropMove=this.cropMove.bind(this)),Fo(e.ownerDocument,qa,this.onCropEnd=this.cropEnd.bind(this)),t.responsive&&Fo(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var e=this.element,t=this.options,i=this.cropper;io(t.cropstart)&&_o(e,"cropstart",t.cropstart),io(t.cropmove)&&_o(e,"cropmove",t.cropmove),io(t.cropend)&&_o(e,"cropend",t.cropend),io(t.crop)&&_o(e,"crop",t.crop),io(t.zoom)&&_o(e,"zoom",t.zoom),_o(i,ja,this.onCropStart),t.zoomable&&t.zoomOnWheel&&_o(i,"wheel",this.onWheel,{passive:!1,capture:!0}),t.toggleDragModeOnDblclick&&_o(i,"dblclick",this.onDblclick),_o(e.ownerDocument,Ha,this.onCropMove),_o(e.ownerDocument,qa,this.onCropEnd),t.responsive&&_o(window,"resize",this.onResize)}},zo={resize:function(){if(!this.disabled){var e,t,i=this.options,s=this.container,n=this.containerData,r=s.offsetWidth/n.width;if(1!==r||s.offsetHeight!==n.height)i.restore&&(e=this.getCanvasData(),t=this.getCropBoxData()),this.render(),i.restore&&(this.setCanvasData(ro(e,(function(t,i){e[i]=t*r}))),this.setCropBoxData(ro(t,(function(e,i){t[i]=e*r}))))}},dblclick:function(){var e,t;this.disabled||"none"===this.options.dragMode||this.setDragMode((e=this.dragBox,t=Aa,(e.classList?e.classList.contains(t):e.className.indexOf(t)>-1)?"move":"crop"))},wheel:function(e){var t=this,i=Number(this.options.wheelZoomRatio)||.1,s=1;this.disabled||(e.preventDefault(),this.wheeling||(this.wheeling=!0,setTimeout((function(){t.wheeling=!1}),50),e.deltaY?s=e.deltaY>0?1:-1:e.wheelDelta?s=-e.wheelDelta/120:e.detail&&(s=e.detail>0?1:-1),this.zoom(-s*i,e)))},cropStart:function(e){var t=e.buttons,i=e.button;if(!(this.disabled||("mousedown"===e.type||"pointerdown"===e.type&&"mouse"===e.pointerType)&&(Ka(t)&&1!==t||Ka(i)&&0!==i||e.ctrlKey))){var s,n=this.options,r=this.pointers;e.changedTouches?ro(e.changedTouches,(function(e){r[e.identifier]=To(e)})):r[e.pointerId||0]=To(e),s=Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?"zoom":yo(e.target,za),Wa.test(s)&&!1!==Co(this.element,"cropstart",{originalEvent:e,action:s})&&(e.preventDefault(),this.action=s,this.cropping=!1,"crop"===s&&(this.cropping=!0,uo(this.dragBox,Ia)))}},cropMove:function(e){var t=this.action;if(!this.disabled&&t){var i=this.pointers;e.preventDefault(),!1!==Co(this.element,"cropmove",{originalEvent:e,action:t})&&(e.changedTouches?ro(e.changedTouches,(function(e){ao(i[e.identifier]||{},To(e,!0))})):ao(i[e.pointerId||0]||{},To(e,!0)),this.change(e))}},cropEnd:function(e){if(!this.disabled){var t=this.action,i=this.pointers;e.changedTouches?ro(e.changedTouches,(function(e){delete i[e.identifier]})):delete i[e.pointerId||0],t&&(e.preventDefault(),Object.keys(i).length||(this.action=""),this.cropping&&(this.cropping=!1,fo(this.dragBox,Ia,this.cropped&&this.options.modal)),Co(this.element,"cropend",{originalEvent:e,action:t}))}}},Lo={change:function(e){var t,i=this.options,s=this.canvasData,n=this.containerData,r=this.cropBoxData,a=this.pointers,o=this.action,l=i.aspectRatio,h=r.left,p=r.top,d=r.width,u=r.height,c=h+d,f=p+u,m=0,g=0,y=n.width,v=n.height,b=!0;!l&&e.shiftKey&&(l=d&&u?d/u:1),this.limited&&(m=r.minLeft,g=r.minTop,y=m+Math.min(n.width,s.width,s.left+s.width),v=g+Math.min(n.height,s.height,s.top+s.height));var w=a[Object.keys(a)[0]],_={x:w.endX-w.startX,y:w.endY-w.startY},F=function(e){switch(e){case"e":c+_.x>y&&(_.x=y-c);break;case"w":h+_.x<m&&(_.x=m-h);break;case"n":p+_.y<g&&(_.y=g-p);break;case"s":f+_.y>v&&(_.y=v-f)}};switch(o){case"all":h+=_.x,p+=_.y;break;case"e":if(_.x>=0&&(c>=y||l&&(p<=g||f>=v))){b=!1;break}F("e"),(d+=_.x)<0&&(o="w",h-=d=-d),l&&(u=d/l,p+=(r.height-u)/2);break;case"n":if(_.y<=0&&(p<=g||l&&(h<=m||c>=y))){b=!1;break}F("n"),u-=_.y,p+=_.y,u<0&&(o="s",p-=u=-u),l&&(d=u*l,h+=(r.width-d)/2);break;case"w":if(_.x<=0&&(h<=m||l&&(p<=g||f>=v))){b=!1;break}F("w"),d-=_.x,h+=_.x,d<0&&(o="e",h-=d=-d),l&&(u=d/l,p+=(r.height-u)/2);break;case"s":if(_.y>=0&&(f>=v||l&&(h<=m||c>=y))){b=!1;break}F("s"),(u+=_.y)<0&&(o="n",p-=u=-u),l&&(d=u*l,h+=(r.width-d)/2);break;case"ne":if(l){if(_.y<=0&&(p<=g||c>=y)){b=!1;break}F("n"),u-=_.y,p+=_.y,d=u*l}else F("n"),F("e"),_.x>=0?c<y?d+=_.x:_.y<=0&&p<=g&&(b=!1):d+=_.x,_.y<=0?p>g&&(u-=_.y,p+=_.y):(u-=_.y,p+=_.y);d<0&&u<0?(o="sw",p-=u=-u,h-=d=-d):d<0?(o="nw",h-=d=-d):u<0&&(o="se",p-=u=-u);break;case"nw":if(l){if(_.y<=0&&(p<=g||h<=m)){b=!1;break}F("n"),u-=_.y,p+=_.y,d=u*l,h+=r.width-d}else F("n"),F("w"),_.x<=0?h>m?(d-=_.x,h+=_.x):_.y<=0&&p<=g&&(b=!1):(d-=_.x,h+=_.x),_.y<=0?p>g&&(u-=_.y,p+=_.y):(u-=_.y,p+=_.y);d<0&&u<0?(o="se",p-=u=-u,h-=d=-d):d<0?(o="ne",h-=d=-d):u<0&&(o="sw",p-=u=-u);break;case"sw":if(l){if(_.x<=0&&(h<=m||f>=v)){b=!1;break}F("w"),d-=_.x,h+=_.x,u=d/l}else F("s"),F("w"),_.x<=0?h>m?(d-=_.x,h+=_.x):_.y>=0&&f>=v&&(b=!1):(d-=_.x,h+=_.x),_.y>=0?f<v&&(u+=_.y):u+=_.y;d<0&&u<0?(o="ne",p-=u=-u,h-=d=-d):d<0?(o="se",h-=d=-d):u<0&&(o="nw",p-=u=-u);break;case"se":if(l){if(_.x>=0&&(c>=y||f>=v)){b=!1;break}F("e"),u=(d+=_.x)/l}else F("s"),F("e"),_.x>=0?c<y?d+=_.x:_.y>=0&&f>=v&&(b=!1):d+=_.x,_.y>=0?f<v&&(u+=_.y):u+=_.y;d<0&&u<0?(o="nw",p-=u=-u,h-=d=-d):d<0?(o="sw",h-=d=-d):u<0&&(o="ne",p-=u=-u);break;case"move":this.move(_.x,_.y),b=!1;break;case"zoom":this.zoom(function(e){var t=Pa({},e),i=[];return ro(e,(function(e,s){delete t[s],ro(t,(function(t){var s=Math.abs(e.startX-t.startX),n=Math.abs(e.startY-t.startY),r=Math.abs(e.endX-t.endX),a=Math.abs(e.endY-t.endY),o=Math.sqrt(s*s+n*n),l=(Math.sqrt(r*r+a*a)-o)/o;i.push(l)}))})),i.sort((function(e,t){return Math.abs(e)<Math.abs(t)})),i[0]}(a),e),b=!1;break;case"crop":if(!_.x||!_.y){b=!1;break}t=So(this.cropper),h=w.startX-t.left,p=w.startY-t.top,d=r.minWidth,u=r.minHeight,_.x>0?o=_.y>0?"se":"ne":_.x<0&&(h-=d,o=_.y>0?"sw":"nw"),_.y<0&&(p-=u),this.cropped||(co(this.cropBox,Na),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}b&&(r.width=d,r.height=u,r.left=h,r.top=p,this.action=o,this.renderCropBox()),ro(a,(function(e){e.startX=e.endX,e.startY=e.endY}))}},jo={crop:function(){return!this.ready||this.cropped||this.disabled||(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&uo(this.dragBox,Ia),co(this.cropBox,Na),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=ao({},this.initialImageData),this.canvasData=ao({},this.initialCanvasData),this.cropBoxData=ao({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(ao(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),co(this.dragBox,Ia),uo(this.cropBox,Na)),this},replace:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&e&&(this.isImg&&(this.element.src=e),t?(this.url=e,this.image.src=e,this.ready&&(this.viewBoxImage.src=e,ro(this.previews,(function(t){t.getElementsByTagName("img")[0].src=e})))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(e))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,co(this.cropper,Ma)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,uo(this.cropper,Ma)),this},destroy:function(){var e=this.element;return e.cropper?(e.cropper=void 0,this.isImg&&this.replaced&&(e.src=this.originalUrl),this.uncreate(),this):this},move:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,s=i.left,n=i.top;return this.moveTo(Za(e)?e:s+Number(e),Za(t)?t:n+Number(t))},moveTo:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.canvasData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.movable&&(Ka(e)&&(i.left=e,s=!0),Ka(t)&&(i.top=t,s=!0),s&&this.renderCanvas(!0)),this},zoom:function(e,t){var i=this.canvasData;return e=(e=Number(e))<0?1/(1-e):1+e,this.zoomTo(i.width*e/i.naturalWidth,null,t)},zoomTo:function(e,t,i){var s=this.options,n=this.canvasData,r=n.width,a=n.height,o=n.naturalWidth,l=n.naturalHeight;if((e=Number(e))>=0&&this.ready&&!this.disabled&&s.zoomable){var h=o*e,p=l*e;if(!1===Co(this.element,"zoom",{ratio:e,oldRatio:r/o,originalEvent:i}))return this;if(i){var d=this.pointers,u=So(this.cropper),c=d&&Object.keys(d).length?function(e){var t=0,i=0,s=0;return ro(e,(function(e){var n=e.startX,r=e.startY;t+=n,i+=r,s+=1})),{pageX:t/=s,pageY:i/=s}}(d):{pageX:i.pageX,pageY:i.pageY};n.left-=(h-r)*((c.pageX-u.left-n.left)/r),n.top-=(p-a)*((c.pageY-u.top-n.top)/a)}else to(t)&&Ka(t.x)&&Ka(t.y)?(n.left-=(h-r)*((t.x-n.left)/r),n.top-=(p-a)*((t.y-n.top)/a)):(n.left-=(h-r)/2,n.top-=(p-a)/2);n.width=h,n.height=p,this.renderCanvas(!0)}return this},rotate:function(e){return this.rotateTo((this.imageData.rotate||0)+Number(e))},rotateTo:function(e){return Ka(e=Number(e))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=e%360,this.renderCanvas(!0,!0)),this},scaleX:function(e){var t=this.imageData.scaleY;return this.scale(e,Ka(t)?t:1)},scaleY:function(e){var t=this.imageData.scaleX;return this.scale(Ka(t)?t:1,e)},scale:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:e,i=this.imageData,s=!1;return e=Number(e),t=Number(t),this.ready&&!this.disabled&&this.options.scalable&&(Ka(e)&&(i.scaleX=e,s=!0),Ka(t)&&(i.scaleY=t,s=!0),s&&this.renderCanvas(!0,!0)),this},getData:function(){var e,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,s=this.imageData,n=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){e={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height};var a=s.width/s.naturalWidth;if(ro(e,(function(t,i){e[i]=t/a})),t){var o=Math.round(e.y+e.height),l=Math.round(e.x+e.width);e.x=Math.round(e.x),e.y=Math.round(e.y),e.width=l-e.x,e.height=o-e.y}}else e={x:0,y:0,width:0,height:0};return i.rotatable&&(e.rotate=s.rotate||0),i.scalable&&(e.scaleX=s.scaleX||1,e.scaleY=s.scaleY||1),e},setData:function(e){var t=this.options,i=this.imageData,s=this.canvasData,n={};if(this.ready&&!this.disabled&&to(e)){var r=!1;t.rotatable&&Ka(e.rotate)&&e.rotate!==i.rotate&&(i.rotate=e.rotate,r=!0),t.scalable&&(Ka(e.scaleX)&&e.scaleX!==i.scaleX&&(i.scaleX=e.scaleX,r=!0),Ka(e.scaleY)&&e.scaleY!==i.scaleY&&(i.scaleY=e.scaleY,r=!0)),r&&this.renderCanvas(!0,!0);var a=i.width/i.naturalWidth;Ka(e.x)&&(n.left=e.x*a+s.left),Ka(e.y)&&(n.top=e.y*a+s.top),Ka(e.width)&&(n.width=e.width*a),Ka(e.height)&&(n.height=e.height*a),this.setCropBoxData(n)}return this},getContainerData:function(){return this.ready?ao({},this.containerData):{}},getImageData:function(){return this.sized?ao({},this.imageData):{}},getCanvasData:function(){var e=this.canvasData,t={};return this.ready&&ro(["left","top","width","height","naturalWidth","naturalHeight"],(function(i){t[i]=e[i]})),t},setCanvasData:function(e){var t=this.canvasData,i=t.aspectRatio;return this.ready&&!this.disabled&&to(e)&&(Ka(e.left)&&(t.left=e.left),Ka(e.top)&&(t.top=e.top),Ka(e.width)?(t.width=e.width,t.height=e.width/i):Ka(e.height)&&(t.height=e.height,t.width=e.height*i),this.renderCanvas(!0)),this},getCropBoxData:function(){var e,t=this.cropBoxData;return this.ready&&this.cropped&&(e={left:t.left,top:t.top,width:t.width,height:t.height}),e||{}},setCropBoxData:function(e){var t,i,s=this.cropBoxData,n=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&to(e)&&(Ka(e.left)&&(s.left=e.left),Ka(e.top)&&(s.top=e.top),Ka(e.width)&&e.width!==s.width&&(t=!0,s.width=e.width),Ka(e.height)&&e.height!==s.height&&(i=!0,s.height=e.height),n&&(t?s.height=s.width/n:i&&(s.width=s.height*n)),this.renderCropBox()),this},getCroppedCanvas:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var t=this.canvasData,i=Ao(this.image,this.imageData,t,e);if(!this.cropped)return i;var s=this.getData(),n=s.x,r=s.y,a=s.width,o=s.height,l=i.width/Math.floor(t.naturalWidth);1!==l&&(n*=l,r*=l,a*=l,o*=l);var h=a/o,p=Eo({aspectRatio:h,width:e.maxWidth||1/0,height:e.maxHeight||1/0}),d=Eo({aspectRatio:h,width:e.minWidth||0,height:e.minHeight||0},"cover"),u=Eo({aspectRatio:h,width:e.width||(1!==l?i.width:a),height:e.height||(1!==l?i.height:o)}),c=u.width,f=u.height;c=Math.min(p.width,Math.max(d.width,c)),f=Math.min(p.height,Math.max(d.height,f));var m=document.createElement("canvas"),g=m.getContext("2d");m.width=lo(c),m.height=lo(f),g.fillStyle=e.fillColor||"transparent",g.fillRect(0,0,c,f);var y=e.imageSmoothingEnabled,v=void 0===y||y,b=e.imageSmoothingQuality;g.imageSmoothingEnabled=v,b&&(g.imageSmoothingQuality=b);var w,_,F,C,S,P,x=i.width,O=i.height,k=n,D=r;k<=-a||k>x?(k=0,w=0,F=0,S=0):k<=0?(F=-k,k=0,S=w=Math.min(x,a+k)):k<=x&&(F=0,S=w=Math.min(a,x-k)),w<=0||D<=-o||D>O?(D=0,_=0,C=0,P=0):D<=0?(C=-D,D=0,P=_=Math.min(O,o+D)):D<=O&&(C=0,P=_=Math.min(o,O-D));var T=[k,D,w,_];if(S>0&&P>0){var E=c/a;T.push(F*E,C*E,S*E,P*E)}return g.drawImage.apply(g,[i].concat(xa(T.map((function(e){return Math.floor(lo(e))}))))),m},setAspectRatio:function(e){var t=this.options;return this.disabled||Za(e)||(t.aspectRatio=Math.max(0,e)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(e){var t=this.options,i=this.dragBox,s=this.face;if(this.ready&&!this.disabled){var n="crop"===e,r=t.movable&&"move"===e;e=n||r?e:"none",t.dragMode=e,vo(i,za,e),fo(i,Aa,n),fo(i,Ra,r),t.cropBoxMovable||(vo(s,za,e),fo(s,Aa,n),fo(s,Ra,r))}return this}},Ho=Da.Cropper,qo=function(){function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(_a(this,e),!t||!Xa.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=ao({},Ga,to(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}var t,i,s;return t=e,s=[{key:"noConflict",value:function(){return window.Cropper=Ho,e}},{key:"setDefaults",value:function(e){ao(Ga,to(e)&&e)}}],(i=[{key:"init",value:function(){var e,t=this.element,i=t.tagName.toLowerCase();if(!t.cropper){if(t.cropper=this,"img"===i){if(this.isImg=!0,e=t.getAttribute("src")||"",this.originalUrl=e,!e)return;e=t.src}else"canvas"===i&&window.HTMLCanvasElement&&(e=t.toDataURL());this.load(e)}}},{key:"load",value:function(e){var t=this;if(e){this.url=e,this.imageData={};var i=this.element,s=this.options;if(s.rotatable||s.scalable||(s.checkOrientation=!1),s.checkOrientation&&window.ArrayBuffer)if($a.test(e))Va.test(e)?this.read((n=e.replace(No,""),r=atob(n),a=new ArrayBuffer(r.length),ro(o=new Uint8Array(a),(function(e,t){o[t]=r.charCodeAt(t)})),a)):this.clone();else{var n,r,a,o,l=new XMLHttpRequest,h=this.clone.bind(this);this.reloading=!0,this.xhr=l,l.onabort=h,l.onerror=h,l.ontimeout=h,l.onprogress=function(){"image/jpeg"!==l.getResponseHeader("content-type")&&l.abort()},l.onload=function(){t.read(l.response)},l.onloadend=function(){t.reloading=!1,t.xhr=null},s.checkCrossOrigin&&Oo(e)&&i.crossOrigin&&(e=ko(e)),l.open("GET",e),l.responseType="arraybuffer",l.withCredentials="use-credentials"===i.crossOrigin,l.send()}else this.clone()}}},{key:"read",value:function(e){var t=this.options,i=this.imageData,s=Uo(e),n=0,r=1,a=1;if(s>1){this.url=function(e,t){for(var i=[],s=new Uint8Array(e);s.length>0;)i.push(Mo.apply(null,no(s.subarray(0,8192)))),s=s.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}(e,"image/jpeg");var o=function(e){var t=0,i=1,s=1;switch(e){case 2:i=-1;break;case 3:t=-180;break;case 4:s=-1;break;case 5:t=90,s=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90}return{rotate:t,scaleX:i,scaleY:s}}(s);n=o.rotate,r=o.scaleX,a=o.scaleY}t.rotatable&&(i.rotate=n),t.scalable&&(i.scaleX=r,i.scaleY=a),this.clone()}},{key:"clone",value:function(){var e=this.element,t=this.url,i=e.crossOrigin,s=t;this.options.checkCrossOrigin&&Oo(t)&&(i||(i="anonymous"),s=ko(t)),this.crossOrigin=i,this.crossOriginUrl=s;var n=document.createElement("img");i&&(n.crossOrigin=i),n.src=s||t,n.alt=e.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),uo(n,Ua),e.parentNode.insertBefore(n,e.nextSibling)}},{key:"start",value:function(){var e=this,t=this.image;t.onload=null,t.onerror=null,this.sizing=!0;var i=Da.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Da.navigator.userAgent),s=function(t,i){ao(e.imageData,{naturalWidth:t,naturalHeight:i,aspectRatio:t/i}),e.sizing=!1,e.sized=!0,e.build()};if(!t.naturalWidth||i){var n=document.createElement("img"),r=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){s(n.width,n.height),i||r.removeChild(n)},n.src=t.src,i||(n.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",r.appendChild(n))}else s(t.naturalWidth,t.naturalHeight)}},{key:"stop",value:function(){var e=this.image;e.onload=null,e.onerror=null,e.parentNode.removeChild(e),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var e=this.element,t=this.options,i=this.image,s=e.parentNode,n=document.createElement("div");n.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var r=n.querySelector(".".concat("cropper","-container")),a=r.querySelector(".".concat("cropper","-canvas")),o=r.querySelector(".".concat("cropper","-drag-box")),l=r.querySelector(".".concat("cropper","-crop-box")),h=l.querySelector(".".concat("cropper","-face"));this.container=s,this.cropper=r,this.canvas=a,this.dragBox=o,this.cropBox=l,this.viewBox=r.querySelector(".".concat("cropper","-view-box")),this.face=h,a.appendChild(i),uo(e,Na),s.insertBefore(r,e.nextSibling),this.isImg||co(i,Ua),this.initPreview(),this.bind(),t.initialAspectRatio=Math.max(0,t.initialAspectRatio)||NaN,t.aspectRatio=Math.max(0,t.aspectRatio)||NaN,t.viewMode=Math.max(0,Math.min(3,Math.round(t.viewMode)))||0,uo(l,Na),t.guides||uo(l.getElementsByClassName("".concat("cropper","-dashed")),Na),t.center||uo(l.getElementsByClassName("".concat("cropper","-center")),Na),t.background&&uo(r,"".concat("cropper","-bg")),t.highlight||uo(h,Ba),t.cropBoxMovable&&(uo(h,Ra),vo(h,za,"all")),t.cropBoxResizable||(uo(l.getElementsByClassName("".concat("cropper","-line")),Na),uo(l.getElementsByClassName("".concat("cropper","-point")),Na)),this.render(),this.ready=!0,this.setDragMode(t.dragMode),t.autoCrop&&this.crop(),this.setData(t.data),io(t.ready)&&Fo(e,"ready",t.ready,{once:!0}),Co(e,"ready")}}},{key:"unbuild",value:function(){this.ready&&(this.ready=!1,this.unbind(),this.resetPreview(),this.cropper.parentNode.removeChild(this.cropper),co(this.element,Na))}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}])&&Fa(t.prototype,i),s&&Fa(t,s),e}();function Wo(e,t,i){const s=Math.abs(i*(Math.PI/180));return Math.max((Math.sin(s)*e+Math.cos(s)*t)/t,(Math.sin(s)*t+Math.cos(s)*e)/e)}ao(qo.prototype,Bo,Io,Ro,zo,Lo,jo);class $o extends Dt{constructor(e){super(e),this.onRotate90Deg=()=>{const{angle90Deg:e}=this.state,t=e-90;this.setState({angle90Deg:t,angleGranular:0}),this.cropper.scale(1),this.cropper.rotateTo(t);const i=this.cropper.getCanvasData(),s=function(e,t){const i=e.width/t.width,s=e.height/t.height,n=Math.min(i,s),r=t.width*n,a=t.height*n;return{width:r,height:a,left:(e.width-r)/2,top:(e.height-a)/2}}(this.cropper.getContainerData(),i);this.cropper.setCanvasData(s),this.cropper.setCropBoxData(s)},this.onRotateGranular=e=>{const t=Number(e.target.value);this.setState({angleGranular:t});const{angle90Deg:i}=this.state,s=i+t;this.cropper.rotateTo(s);const n=this.cropper.getImageData(),r=Wo(n.naturalWidth,n.naturalHeight,t),a=this.cropper.getImageData().scaleX<0?-r:r;this.cropper.scale(a,r)},this.state={angle90Deg:0,angleGranular:0,prevCropboxData:null},this.storePrevCropboxData=this.storePrevCropboxData.bind(this),this.limitCropboxMovement=this.limitCropboxMovement.bind(this)}componentDidMount(){const{opts:e,storeCropperInstance:t}=this.props;this.cropper=new qo(this.imgElement,e.cropperOptions),this.imgElement.addEventListener("cropstart",this.storePrevCropboxData),this.imgElement.addEventListener("cropend",this.limitCropboxMovement),t(this.cropper)}componentWillUnmount(){this.cropper.destroy(),this.imgElement.removeEventListener("cropstart",this.storePrevCropboxData),this.imgElement.removeEventListener("cropend",this.limitCropboxMovement)}storePrevCropboxData(){this.setState({prevCropboxData:this.cropper.getCropBoxData()})}limitCropboxMovement(e){const t=this.cropper.getCanvasData(),i=this.cropper.getCropBoxData(),{prevCropboxData:s}=this.state;if("all"===e.detail.action){const e=(n=t,a=s,(r=i).left<n.left?{left:n.left,width:a.width}:r.top<n.top?{top:n.top,height:a.height}:r.left+r.width>n.left+n.width?{left:n.left+n.width-a.width,width:a.width}:r.top+r.height>n.top+n.height?{top:n.top+n.height-a.height,height:a.height}:null);e&&this.cropper.setCropBoxData(e)}else{const e=function(e,t,i){return t.left<e.left?{left:e.left,width:i.left+i.width-e.left}:t.top<e.top?{top:e.top,height:i.top+i.height-e.top}:t.left+t.width>e.left+e.width?{left:i.left,width:e.left+e.width-i.left}:t.top+t.height>e.top+e.height?{top:i.top,height:e.top+e.height-i.top}:null}(t,i,s);e&&this.cropper.setCropBoxData(e)}var n,r,a}renderGranularRotate(){const{i18n:e}=this.props,{angleGranular:t}=this.state;return xt("label",{role:"tooltip","aria-label":`${t}º`,"data-microtip-position":"top",className:"uppy-ImageCropper-rangeWrapper"},xt("input",{className:"uppy-ImageCropper-range uppy-u-reset",type:"range",onInput:this.onRotateGranular,onChange:this.onRotateGranular,value:t,min:"-45",max:"45","aria-label":e("rotate")}))}renderRevert(){const{i18n:e,opts:t}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("revert"),onClick:()=>{this.cropper.reset(),this.cropper.setAspectRatio(t.cropperOptions.initialAspectRatio),this.setState({angle90Deg:0,angleGranular:0})}},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M0 0h24v24H0z",fill:"none"}),xt("path",{d:"M13 3c-4.97 0-9 4.03-9 9H1l3.89 3.89.07.14L9 12H6c0-3.87 3.13-7 7-7s7 3.13 7 7-3.13 7-7 7c-1.93 0-3.68-.79-4.94-2.06l-1.42 1.42C8.27 19.99 10.51 21 13 21c4.97 0 9-4.03 9-9s-4.03-9-9-9zm-1 5v5l4.28 2.54.72-1.21-3.5-2.08V8H12z"})))}renderRotate(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("rotate"),onClick:this.onRotate90Deg},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M0 0h24v24H0V0zm0 0h24v24H0V0z",fill:"none"}),xt("path",{d:"M14 10a2 2 0 012 2v7a2 2 0 01-2 2H6a2 2 0 01-2-2v-7a2 2 0 012-2h8zm0 1.75H6a.25.25 0 00-.243.193L5.75 12v7a.25.25 0 00.193.243L6 19.25h8a.25.25 0 00.243-.193L14.25 19v-7a.25.25 0 00-.193-.243L14 11.75zM12 .76V4c2.3 0 4.61.88 6.36 2.64a8.95 8.95 0 012.634 6.025L21 13a1 1 0 01-1.993.117L19 13h-.003a6.979 6.979 0 00-2.047-4.95 6.97 6.97 0 00-4.652-2.044L12 6v3.24L7.76 5 12 .76z"})))}renderFlip(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("flipHorizontal"),onClick:()=>this.cropper.scaleX(-this.cropper.getData().scaleX||-1)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M0 0h24v24H0z",fill:"none"}),xt("path",{d:"M15 21h2v-2h-2v2zm4-12h2V7h-2v2zM3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2zm16-2v2h2c0-1.1-.9-2-2-2zm-8 20h2V1h-2v22zm8-6h2v-2h-2v2zM15 5h2V3h-2v2zm4 8h2v-2h-2v2zm0 8c1.1 0 2-.9 2-2h-2v2z"})))}renderZoomIn(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomIn"),onClick:()=>this.cropper.zoom(.1)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",height:"24",viewBox:"0 0 24 24",width:"24"},xt("path",{d:"M0 0h24v24H0V0z",fill:"none"}),xt("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z"}),xt("path",{d:"M12 10h-2v2H9v-2H7V9h2V7h1v2h2v1z"})))}renderZoomOut(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("zoomOut"),onClick:()=>this.cropper.zoom(-.1)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M0 0h24v24H0V0z",fill:"none"}),xt("path",{d:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zM7 9h5v1H7z"})))}renderCropSquare(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioSquare"),onClick:()=>this.cropper.setAspectRatio(1)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M0 0h24v24H0z",fill:"none"}),xt("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"})))}renderCropWidescreen(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button",className:"uppy-u-reset uppy-c-btn","aria-label":e("aspectRatioLandscape"),onClick:()=>this.cropper.setAspectRatio(16/9)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M 19,4.9999992 V 17.000001 H 4.9999998 V 6.9999992 H 19 m 0,-2 H 4.9999998 c -1.0999999,0 -1.9999999,0.9000001 -1.9999999,2 V 17.000001 c 0,1.1 0.9,2 1.9999999,2 H 19 c 1.1,0 2,-0.9 2,-2 V 6.9999992 c 0,-1.0999999 -0.9,-2 -2,-2 z"}),xt("path",{fill:"none",d:"M0 0h24v24H0z"})))}renderCropWidescreenVertical(){const{i18n:e}=this.props;return xt("button",{role:"button tooltip","data-microtip-position":"top",type:"button","aria-label":e("aspectRatioPortrait"),className:"uppy-u-reset uppy-c-btn",onClick:()=>this.cropper.setAspectRatio(9/16)},xt("svg",{"aria-hidden":"true",className:"uppy-c-icon",width:"24",height:"24",viewBox:"0 0 24 24"},xt("path",{d:"M 19.000001,19 H 6.999999 V 5 h 10.000002 v 14 m 2,0 V 5 c 0,-1.0999999 -0.9,-1.9999999 -2,-1.9999999 H 6.999999 c -1.1,0 -2,0.9 -2,1.9999999 v 14 c 0,1.1 0.9,2 2,2 h 10.000002 c 1.1,0 2,-0.9 2,-2 z"}),xt("path",{d:"M0 0h24v24H0z",fill:"none"})))}render(){const{currentImage:e,opts:t}=this.props,{actions:i}=t,s=URL.createObjectURL(e.data);return xt("div",{className:"uppy-ImageCropper"},xt("div",{className:"uppy-ImageCropper-container"},xt("img",{className:"uppy-ImageCropper-image",alt:e.name,src:s,ref:e=>{this.imgElement=e}})),xt("div",{className:"uppy-ImageCropper-controls"},i.revert&&this.renderRevert(),i.rotate&&this.renderRotate(),i.granularRotate&&this.renderGranularRotate(),i.flip&&this.renderFlip(),i.zoomIn&&this.renderZoomIn(),i.zoomOut&&this.renderZoomOut(),i.cropSquare&&this.renderCropSquare(),i.cropWidescreen&&this.renderCropWidescreen(),i.cropWidescreenVertical&&this.renderCropWidescreenVertical()))}}var Vo={strings:{revert:"Reset",rotate:"Rotate 90°",zoomIn:"Zoom in",zoomOut:"Zoom out",flipHorizontal:"Flip horizontally",aspectRatioSquare:"Crop square",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)"}};const Xo={viewMode:0,background:!1,autoCropArea:1,responsive:!0,minCropBoxWidth:70,minCropBoxHeight:70,croppedCanvasOptions:{},initialAspectRatio:0},Go={revert:!0,rotate:!0,granularRotate:!0,flip:!0,zoomIn:!0,zoomOut:!0,cropSquare:!0,cropWidescreen:!0,cropWidescreenVertical:!0},Yo={quality:.8,actions:Go,cropperOptions:Xo};class Ko extends ni{constructor(e,t){super(e,{...Yo,...t,actions:{...Go,...null==t?void 0:t.actions},cropperOptions:{...Xo,...null==t?void 0:t.cropperOptions}}),this.save=()=>{const{currentImage:e}=this.getPluginState(),t=this.cropper.getCroppedCanvas({});t.width%2!=0&&this.cropper.setData({width:t.width-1}),t.height%2!=0&&this.cropper.setData({height:t.height-1}),this.cropper.getCroppedCanvas(this.opts.cropperOptions.croppedCanvasOptions).toBlob((e=>{const{currentImage:t}=this.getPluginState();this.uppy.setFileState(t.id,{data:new File([e],t.name,{type:e.type}),size:e.size,preview:void 0});const i=this.uppy.getFile(t.id);this.uppy.emit("thumbnail:request",i),this.setPluginState({currentImage:i}),this.uppy.emit("file-editor:complete",i)}),e.type,this.opts.quality)},this.storeCropperInstance=e=>{this.cropper=e},this.selectFile=e=>{this.uppy.emit("file-editor:start",e),this.setPluginState({currentImage:e})},this.id=this.opts.id||"ImageEditor",this.title="Image Editor",this.type="editor",this.defaultLocale=Vo,this.i18nInit()}canEditFile(e){if(!e.type||e.isRemote)return!1;const t=e.type.split("/")[1];return!!/^(jpe?g|gif|png|bmp|webp)$/.test(t)}install(){this.setPluginState({currentImage:null});const{target:e}=this.opts;e&&this.mount(e,this)}uninstall(){const{currentImage:e}=this.getPluginState();if(e){const t=this.uppy.getFile(e.id);this.uppy.emit("file-editor:cancel",t)}this.unmount()}render(){const{currentImage:e}=this.getPluginState();return null===e||e.isRemote?null:xt($o,{currentImage:e,storeCropperInstance:this.storeCropperInstance,save:this.save,opts:this.opts,i18n:this.i18n})}}function Qo(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Ko.VERSION="2.4.6";var Zo=0;function Jo(e){return"__private_"+Zo+++"_"+e}var el=Jo("uppy"),tl=Jo("events");class il{constructor(e){Object.defineProperty(this,el,{writable:!0,value:void 0}),Object.defineProperty(this,tl,{writable:!0,value:[]}),Qo(this,el)[el]=e}on(e,t){return Qo(this,tl)[tl].push([e,t]),Qo(this,el)[el].on(e,t)}remove(){for(const[e,t]of Qo(this,tl)[tl].splice(0))Qo(this,el)[el].off(e,t)}onFilePause(e,t){this.on("upload-pause",((i,s)=>{e===i&&t(s)}))}onFileRemove(e,t){this.on("file-removed",(i=>{e===i.id&&t(i.id)}))}onPause(e,t){this.on("upload-pause",((i,s)=>{e===i&&t(s)}))}onRetry(e,t){this.on("upload-retry",(i=>{e===i&&t()}))}onRetryAll(e,t){this.on("retry-all",(()=>{Qo(this,el)[el].getFile(e)&&t()}))}onPauseAll(e,t){this.on("pause-all",(()=>{Qo(this,el)[el].getFile(e)&&t()}))}onCancelAll(e,t){var i=this;this.on("cancel-all",(function(){Qo(i,el)[el].getFile(e)&&t(...arguments)}))}onResumeAll(e,t){this.on("resume-all",(()=>{Qo(this,el)[el].getFile(e)&&t()}))}}function sl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var nl=0;function rl(e){return"__private_"+nl+++"_"+e}function al(e){return new Error("Cancelled",{cause:e})}function ol(e){if(null!=e){var t;const i=()=>this.abort(e.reason);e.addEventListener("abort",i,{once:!0});const s=()=>{e.removeEventListener("abort",i)};null==(t=this.then)||t.call(this,s,s)}return this}var ll=rl("activeRequests"),hl=rl("queuedHandlers"),pl=rl("paused"),dl=rl("pauseTimer"),ul=rl("downLimit"),cl=rl("upperLimit"),fl=rl("rateLimitingTimer"),ml=rl("call"),gl=rl("queueNext"),yl=rl("next"),vl=rl("queue"),bl=rl("dequeue"),wl=rl("resume"),_l=rl("increaseLimit");class Fl{constructor(e){Object.defineProperty(this,bl,{value:Ol}),Object.defineProperty(this,vl,{value:xl}),Object.defineProperty(this,yl,{value:Pl}),Object.defineProperty(this,gl,{value:Sl}),Object.defineProperty(this,ml,{value:Cl}),Object.defineProperty(this,ll,{writable:!0,value:0}),Object.defineProperty(this,hl,{writable:!0,value:[]}),Object.defineProperty(this,pl,{writable:!0,value:!1}),Object.defineProperty(this,dl,{writable:!0,value:void 0}),Object.defineProperty(this,ul,{writable:!0,value:1}),Object.defineProperty(this,cl,{writable:!0,value:void 0}),Object.defineProperty(this,fl,{writable:!0,value:void 0}),Object.defineProperty(this,wl,{writable:!0,value:()=>this.resume()}),Object.defineProperty(this,_l,{writable:!0,value:()=>{if(sl(this,pl)[pl])sl(this,fl)[fl]=setTimeout(sl(this,_l)[_l],0);else{sl(this,ul)[ul]=this.limit,this.limit=Math.ceil((sl(this,cl)[cl]+sl(this,ul)[ul])/2);for(let e=sl(this,ul)[ul];e<=this.limit;e++)sl(this,gl)[gl]();sl(this,cl)[cl]-sl(this,ul)[ul]>3?sl(this,fl)[fl]=setTimeout(sl(this,_l)[_l],2e3):sl(this,ul)[ul]=Math.floor(sl(this,ul)[ul]/2)}}}),this.limit="number"!=typeof e||0===e?1/0:e}run(e,t){return!sl(this,pl)[pl]&&sl(this,ll)[ll]<this.limit?sl(this,ml)[ml](e):sl(this,vl)[vl](e,t)}wrapSyncFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];const a=i.run((()=>(e(...n),queueMicrotask((()=>a.done())),()=>{})),t);return{abortOn:ol,abort(){a.abort()}}}}wrapPromiseFunction(e,t){var i=this;return function(){for(var s=arguments.length,n=new Array(s),r=0;r<s;r++)n[r]=arguments[r];let a;const o=new Promise(((s,r)=>{a=i.run((()=>{let t,i;try{i=Promise.resolve(e(...n))}catch(o){i=Promise.reject(o)}return i.then((e=>{t?r(t):(a.done(),s(e))}),(e=>{t?r(t):(a.done(),r(e))})),e=>{t=al(e)}}),t)}));return o.abort=e=>{a.abort(e)},o.abortOn=ol,o}}resume(){sl(this,pl)[pl]=!1,clearTimeout(sl(this,dl)[dl]);for(let e=0;e<this.limit;e++)sl(this,gl)[gl]()}pause(e){void 0===e&&(e=null),sl(this,pl)[pl]=!0,clearTimeout(sl(this,dl)[dl]),null!=e&&(sl(this,dl)[dl]=setTimeout(sl(this,wl)[wl],e))}rateLimit(e){clearTimeout(sl(this,fl)[fl]),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(sl(this,cl)[cl]=this.limit-1,this.limit=sl(this,ul)[ul],sl(this,fl)[fl]=setTimeout(sl(this,_l)[_l],e))}get isPaused(){return sl(this,pl)[pl]}}function Cl(e){sl(this,ll)[ll]+=1;let t,i=!1;try{t=e()}catch(s){throw sl(this,ll)[ll]-=1,s}return{abort:e=>{i||(i=!0,sl(this,ll)[ll]-=1,null==t||t(e),sl(this,gl)[gl]())},done:()=>{i||(i=!0,sl(this,ll)[ll]-=1,sl(this,gl)[gl]())}}}function Sl(){queueMicrotask((()=>sl(this,yl)[yl]()))}function Pl(){if(sl(this,pl)[pl]||sl(this,ll)[ll]>=this.limit)return;if(0===sl(this,hl)[hl].length)return;const e=sl(this,hl)[hl].shift();if(null==e)throw new Error("Invariant violation: next is null");const t=sl(this,ml)[ml](e.fn);e.abort=t.abort,e.done=t.done}function xl(e,t){const i={fn:e,priority:(null==t?void 0:t.priority)||0,abort:()=>{sl(this,bl)[bl](i)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},s=sl(this,hl)[hl].findIndex((e=>i.priority>e.priority));return-1===s?sl(this,hl)[hl].push(i):sl(this,hl)[hl].splice(s,0,i),i}function Ol(e){const t=sl(this,hl)[hl].indexOf(e);-1!==t&&sl(this,hl)[hl].splice(t,1)}const kl=Symbol("__queue");class Dl extends Error{constructor(e,t){void 0===t&&(t=null),super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}function Tl(e){return!!e&&(0!==e.readyState&&4!==e.readyState||0===e.status)}function El(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Al=0;function Ml(e){return"__private_"+Al+++"_"+e}var Nl=Ml("aliveTimer"),Ul=Ml("isDone"),Bl=Ml("onTimedOut"),Il=Ml("timeout");class Rl{constructor(e,t){Object.defineProperty(this,Nl,{writable:!0,value:void 0}),Object.defineProperty(this,Ul,{writable:!0,value:!1}),Object.defineProperty(this,Bl,{writable:!0,value:void 0}),Object.defineProperty(this,Il,{writable:!0,value:void 0}),El(this,Il)[Il]=e,El(this,Bl)[Bl]=()=>t(e)}progress(){El(this,Ul)[Ul]||El(this,Il)[Il]>0&&(clearTimeout(El(this,Nl)[Nl]),El(this,Nl)[Nl]=setTimeout(El(this,Bl)[Bl],El(this,Il)[Il]))}done(){El(this,Ul)[Ul]||(clearTimeout(El(this,Nl)[Nl]),El(this,Nl)[Nl]=void 0,El(this,Ul)[Ul]=!0)}}const zl=()=>{};var Ll={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function jl(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var Hl=0;function ql(e){return"__private_"+Hl+++"_"+e}function Wl(e){return e.data.slice(0,e.data.size,e.meta.type)}const $l={formData:!0,fieldName:"file",method:"post",allowedMetaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:"",getResponseData(e){let t={};try{t=JSON.parse(e)}catch{}return t},getResponseError(e,t){let i=new Error("Upload error");return Tl(t)&&(i=new Dl(i,t)),i},validateStatus:e=>e>=200&&e<300};var Vl=ql("getFetcher"),Xl=ql("uploadLocalFile"),Gl=ql("uploadBundle"),Yl=ql("getCompanionClientArgs"),Kl=ql("uploadFiles"),Ql=ql("handleUpload");class Zl extends Zt{constructor(e,t){if(super(e,{...$l,fieldName:t.bundle?"files[]":"file",...t}),Object.defineProperty(this,Kl,{value:ih}),Object.defineProperty(this,Yl,{value:th}),Object.defineProperty(this,Gl,{value:eh}),Object.defineProperty(this,Xl,{value:Jl}),Object.defineProperty(this,Vl,{writable:!0,value:void 0}),Object.defineProperty(this,Ql,{writable:!0,value:async e=>{if(0===e.length)return void this.uppy.log("[XHRUpload] No files to upload!");0!==this.opts.limit||this.opts[kl]||this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=function(e){return e.filter((e=>!(e=>"error"in e&&!!e.error)(e)))}(this.uppy.getFilesByIds(e)),i=function(e){return e.filter((e=>{var t;return!(null!=(t=e.progress)&&t.uploadStarted&&e.isRestored)}))}(t);if(this.uppy.emit("upload-start",i),this.opts.bundle){if(t.some((e=>e.isRemote)))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await jl(this,Gl)[Gl](t)}else await jl(this,Kl)[Kl](t)}}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Ll,this.i18nInit(),kl in this.opts?this.requests=this.opts[kl]:this.requests=new Fl(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&"function"==typeof this.opts.headers)throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(void 0===(null==t?void 0:t.allowedMetaFields)&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),jl(this,Vl)[Vl]=e=>async(t,i)=>{try{var s;const n=await function(e,t){void 0===t&&(t={});const{body:i=null,headers:s={},method:n="GET",onBeforeRequest:r=zl,onUploadProgress:a=zl,shouldRetry:o=(()=>!0),onAfterRequest:l=zl,onTimeout:h=zl,responseType:p,retries:d=3,signal:u=null,timeout:c=3e4,withCredentials:f=!1}=t,m=e=>.3*2**(e-1)*1e3,g=new Rl(c,h);return function t(h){return void 0===h&&(h=0),new Promise((async(c,y)=>{const v=new XMLHttpRequest;v.open(n,e,!0),v.withCredentials=f,p&&(v.responseType=p),null==u||u.addEventListener("abort",(()=>{v.abort(),y(new DOMException("Aborted","AbortError"))})),v.onload=async()=>{await l(v,h),v.status>=200&&v.status<300?(g.done(),c(v)):o(v)&&h<d?setTimeout((()=>{t(h+1).then(c,y)}),m(h)):(g.done(),y(new Dl(v.statusText,v)))},v.onerror=()=>{o(v)&&h<d?setTimeout((()=>{t(h+1).then(c,y)}),m(h)):(g.done(),y(new Dl(v.statusText,v)))},v.upload.onprogress=e=>{g.progress(),a(e)},s&&Object.keys(s).forEach((e=>{v.setRequestHeader(e,s[e])})),await r(v,h),v.send(i)}))}()}(t,{...i,method:null==i||null==(s=i.method)?void 0:s.toUpperCase(),onTimeout:t=>{const i=Math.ceil(t/1e3),s=new Error(this.i18n("uploadStalled",{seconds:i}));this.uppy.emit("upload-stalled",s,e)},onUploadProgress:t=>{if(t.lengthComputable)for(const i of e)this.uppy.emit("upload-progress",i,{uploader:this,bytesUploaded:t.loaded/t.total*i.size,bytesTotal:i.size})}});if(!this.opts.validateStatus(n.status,n.responseText,n))throw new Dl(n.statusText,n);const r=this.opts.getResponseData(n.responseText,n),a=null==r?void 0:r[this.opts.responseUrlFieldName];for(const t of e)this.uppy.emit("upload-success",t,{status:n.status,body:r,uploadURL:a});return n}catch(n){if("AbortError"===n.name)return;if(n instanceof Dl){const t=n.request,i=function(e,t){let i=t;return i||(i=new Error("Upload error")),"string"==typeof i&&(i=new Error(i)),i instanceof Error||(i=Object.assign(new Error("Upload error"),{data:i})),Tl(e)?(i=new Dl(i,e),i):(i.request=e,i)}(t,this.opts.getResponseError(t.responseText,t));for(const s of e)this.uppy.emit("upload-error",s,i)}throw n}}}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:i}=this.opts,s={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return"function"==typeof i?s.headers=i(e):Object.assign(s.headers,this.opts.headers),t&&Object.assign(s.headers,t.headers),e.xhrUpload&&Object.assign(s.headers,e.xhrUpload.headers),s}addMetadata(e,t,i){(Array.isArray(i.allowedMetaFields)?i.allowedMetaFields:Object.keys(t)).forEach((i=>{const s=t[i];Array.isArray(s)?s.forEach((t=>e.append(i,t))):e.append(i,s)}))}createFormDataUpload(e,t){const i=new FormData;this.addMetadata(i,e.meta,t);const s=Wl(e);return e.name?i.append(t.fieldName,s,e.meta.name):i.append(t.fieldName,s),i}createBundledUpload(e,t){const i=new FormData,{meta:s}=this.uppy.getState();return this.addMetadata(i,s,t),e.forEach((e=>{const t=this.getOptions(e),s=Wl(e);e.name?i.append(t.fieldName,s,e.name):i.append(t.fieldName,s)})),i}install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(jl(this,Ql)[Ql])}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(jl(this,Ql)[Ql])}}async function Jl(e){const t=new il(this.uppy),i=new AbortController,s=this.requests.wrapPromiseFunction((async()=>{const t=this.getOptions(e),s=jl(this,Vl)[Vl]([e]),n=t.formData?this.createFormDataUpload(e,t):e.data;return s(t.endpoint,{...t,body:n,signal:i.signal})}));t.onFileRemove(e.id,(()=>i.abort())),t.onCancelAll(e.id,(e=>{let{reason:t}=e;"user"===t&&i.abort()}));try{await s().abortOn(i.signal)}catch(n){if("Cancelled"!==n.message)throw n}finally{t.remove()}}async function eh(e){const t=new AbortController,i=this.requests.wrapPromiseFunction((async()=>{var i;const s=null!=(i=this.uppy.getState().xhrUpload)?i:{},n=jl(this,Vl)[Vl](e),r=this.createBundledUpload(e,{...this.opts,...s});return n(this.opts.endpoint,{...this.opts,body:r,signal:t.signal})}));function s(){t.abort()}this.uppy.once("cancel-all",s);try{await i().abortOn(t.signal)}catch(n){if("Cancelled"!==n.message)throw n}finally{this.uppy.off("cancel-all",s)}}function th(e){var t;const i=this.getOptions(e),s=Array.isArray(i.allowedMetaFields)?i.allowedMetaFields:Object.keys(e.meta);return{...null==(t=e.remote)?void 0:t.body,protocol:"multipart",endpoint:i.endpoint,size:e.data.size,fieldname:i.fieldName,metadata:Object.fromEntries(s.map((t=>[t,e.meta[t]]))),httpMethod:i.method,useFormData:i.formData,headers:i.headers}}async function ih(e){await Promise.allSettled(e.map((e=>{if(e.isRemote){const t=()=>this.requests,i=new AbortController,s=t=>{t.id===e.id&&i.abort()};this.uppy.on("file-removed",s);const n=this.uppy.getRequestClientForFile(e).uploadRemoteFile(e,jl(this,Yl)[Yl](e),{signal:i.signal,getQueue:t});return this.requests.wrapSyncFunction((()=>{this.uppy.off("file-removed",s)}),{priority:-1})(),n}return jl(this,Xl)[Xl](e)})))}Zl.VERSION="3.6.8";export{ca as D,Ko as I,bt as U,Zl as X};
