mirror of https://github.com/Mai-with-u/MaiBot.git
12 lines
167 KiB
JavaScript
12 lines
167 KiB
JavaScript
import{g as re}from"./react-vendor-BmxF9s7Q.js";import{r as Ti,a as gs,b as ys}from"./reactflow-DtsZHOR4.js";import"./router-9vIXuQkh.js";import"./charts-simvewUa.js";import"./radix-extra-DmmnfeQE.js";const bs=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function vs(i,e,t){const s=bs.exec(i),n=e.mimeType??s?.[1]??"plain/text";let r;if(s?.[2]!=null){const a=atob(decodeURIComponent(s[3])),o=new Uint8Array(a.length);for(let d=0;d<a.length;d++)o[d]=a.charCodeAt(d);r=[o]}else s?.[3]!=null&&(r=[decodeURIComponent(s[3])]);return new Blob(r,{type:n})}function At(i,e,t,s){return i===e?i:s===0?e:i+(e-i)*2**(-s/t)}const Pi=['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 Ci(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Ot(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&Ci(i)?[i]:null}function ws(i,e=document){return typeof i=="string"?e.querySelector(i):Ci(i)?i:null}function Ei(i){const e=i.lastIndexOf(".");return e===-1||e===i.length-1?{name:i,extension:void 0}:{name:i.slice(0,e),extension:i.slice(e+1)}}const Ut={__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",msg:"application/vnd.ms-outlook",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 ki(i){if(i.type)return i.type;const e=i.name?Ei(i.name).extension?.toLowerCase():null;return e&&e in Ut?Ut[e]:"application/octet-stream"}function _s(i){return i.charCodeAt(0).toString(32)}function Nt(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${_s(t)}`,"/"))+e}function Fs(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Nt(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Nt(i.meta.relativePath.toLowerCase())}`),i.data?.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function Ss(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Ts(i,e){if(Ss(i))return i.id;const t=ki(i);return Fs({...i,type:t},e)}const ue=Array.from;function Ps(i){const e=ue(i.files);return Promise.resolve(e)}function Ai(i,e,t,{onSuccess:s}){i.readEntries(n=>{const r=[...e,...n];n.length?queueMicrotask(()=>{Ai(i,r,t,{onSuccess:s})}):s(r)},n=>{t(n),s(e)})}function Oi(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,s)=>i.file(t,s))},async*values(){const t=i.createReader();yield*await new Promise(n=>{Ai(t,[],e,{onSuccess:r=>n(r.map(a=>Oi(a,e)))})})},isSameEntry:void 0}}async function*Ui(i,e,t=void 0){const s=()=>`${e}/${i.name}`;if(i.kind==="file"){const n=await i.getFile();n!=null?(n.relativePath=e?s():null,yield n):t!=null&&(yield t)}else if(i.kind==="directory")for await(const n of i.values())yield*Ui(n,e?s():i.name);else t!=null&&(yield t)}async function*Cs(i,e){const t=await Promise.all(Array.from(i.items,async s=>{let n;return n??=Oi(typeof s.getAsEntry=="function"?s.getAsEntry():s.webkitGetAsEntry(),e),{fileSystemHandle:n,lastResortFile:s.getAsFile()}}));for(const{lastResortFile:s,fileSystemHandle:n}of t)if(n!=null)try{yield*Ui(n,"",s)}catch(r){s!=null?yield s:e(r)}else s!=null&&(yield s)}async function Es(i,e){const t=e?.logDropError??Function.prototype;try{const s=[];for await(const n of Cs(i,t))s.push(n);return s}catch{return Ps(i)}}function ks(i){for(;i&&!i.dir;)i=i.parentNode;return i?.dir}function Me(i){return i<10?`0${i}`:i.toString()}function Oe(){const i=new Date,e=Me(i.getHours()),t=Me(i.getMinutes()),s=Me(i.getSeconds());return`${e}:${t}:${s}`}function As(){if(typeof window>"u")return!1;const i=document.body;return!(i==null||window==null||!("draggable"in i)||!("ondragstart"in i)||!("ondrop"in i)||!("FormData"in window)||!("FileReader"in window))}function Dt(i){return i.startsWith("blob:")}function It(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function Os(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,s=Math.floor(i%60);return{hours:e,minutes:t,seconds:s}}function Us(i){const e=Os(i),t=e.hours===0?"":`${e.hours}h`,s=e.minutes===0?"":`${e.hours===0?e.minutes:` ${e.minutes.toString(10).padStart(2,"0")}`}m`,n=e.hours!==0?"":`${e.minutes===0?e.seconds:` ${e.seconds.toString(10).padStart(2,"0")}`}s`;return`${t}${s}${n}`}function Ns(i,e,t){const s=[];return i.forEach(n=>typeof n!="string"?s.push(n):e[Symbol.split](n).forEach((r,a,o)=>{r!==""&&s.push(r),a<o.length-1&&s.push(t)})),s}function xt(i,e){const t=/\$/g,s="$$$$";let n=[i];if(e==null)return n;for(const r of Object.keys(e))if(r!=="_"){let a=e[r];typeof a=="string"&&(a=t[Symbol.replace](a,s)),n=Ns(n,new RegExp(`%\\{${r}\\}`,"g"),a)}return n}const Ds=i=>{throw new Error(`missing string: ${i}`)};class Ni{locale;constructor(e,{onMissingKey:t=Ds}={}){this.locale={strings:{},pluralize(s){return s===1?0:1}},Array.isArray(e)?e.forEach(this.#t,this):this.#t(e),this.#e=t}#e;#t(e){if(!e?.strings)return;const t=this.locale;Object.assign(this.locale,{strings:{...t.strings,...e.strings},pluralize:e.pluralize||t.pluralize})}translate(e,t){return this.translateArray(e,t).join("")}translateArray(e,t){let s=this.locale.strings[e];if(s==null&&(this.#e(e),s=e),typeof s=="object"){if(t&&typeof t.smart_count<"u"){const r=this.locale.pluralize(t.smart_count);return xt(s[r],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof s!="string")throw new Error("string was not a string");return xt(s,t)}}const Be="...";function Di(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Be.length+1)return`${i.slice(0,e-1)}…`;const t=e-Be.length,s=Math.ceil(t/2),n=Math.floor(t/2);return i.slice(0,s)+Be+i.slice(-n)}var ye,T,Ii,Q,Mt,xi,Mi,Bi,ut,tt,it,ce={},Ri=[],Is=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,be=Array.isArray;function V(i,e){for(var t in e)i[t]=e[t];return i}function ht(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function ct(i,e,t){var s,n,r,a={};for(r in e)r=="key"?s=e[r]:r=="ref"?n=e[r]:a[r]=e[r];if(arguments.length>2&&(a.children=arguments.length>3?ye.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(r in i.defaultProps)a[r]===void 0&&(a[r]=i.defaultProps[r]);return he(i,a,s,n,null)}function he(i,e,t,s,n){var r={type:i,props:e,key:t,ref:s,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++Ii,__i:-1,__u:0};return n==null&&T.vnode!=null&&T.vnode(r),r}function xs(){return{current:null}}function G(i){return i.children}function W(i,e){this.props=i,this.context=e}function se(i,e){if(e==null)return i.__?se(i.__,i.__i+1):null;for(var t;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null)return t.__e;return typeof i.type=="function"?se(i):null}function Li(i){var e,t;if((i=i.__)!=null&&i.__c!=null){for(i.__e=i.__c.base=null,e=0;e<i.__k.length;e++)if((t=i.__k[e])!=null&&t.__e!=null){i.__e=i.__c.base=t.__e;break}return Li(i)}}function Bt(i){(!i.__d&&(i.__d=!0)&&Q.push(i)&&!Ne.__r++||Mt!=T.debounceRendering)&&((Mt=T.debounceRendering)||xi)(Ne)}function Ne(){for(var i,e,t,s,n,r,a,o=1;Q.length;)Q.length>o&&Q.sort(Mi),i=Q.shift(),o=Q.length,i.__d&&(t=void 0,s=void 0,n=(s=(e=i).__v).__e,r=[],a=[],e.__P&&((t=V({},s)).__v=s.__v+1,T.vnode&&T.vnode(t),pt(e.__P,t,s,e.__n,e.__P.namespaceURI,32&s.__u?[n]:null,r,n??se(s),!!(32&s.__u),a),t.__v=s.__v,t.__.__k[t.__i]=t,Hi(r,t,a),s.__e=s.__=null,t.__e!=n&&Li(t)));Ne.__r=0}function zi(i,e,t,s,n,r,a,o,d,u,c){var h,p,f,m,y,v,b,g=s&&s.__k||Ri,w=e.length;for(d=Ms(t,e,g,d,w),h=0;h<w;h++)(f=t.__k[h])!=null&&(p=f.__i==-1?ce:g[f.__i]||ce,f.__i=h,v=pt(i,f,p,n,r,a,o,d,u,c),m=f.__e,f.ref&&p.ref!=f.ref&&(p.ref&&ft(p.ref,null,f),c.push(f.ref,f.__c||m,f)),y==null&&m!=null&&(y=m),(b=!!(4&f.__u))||p.__k===f.__k?d=$i(f,d,i,b):typeof f.type=="function"&&v!==void 0?d=v:m&&(d=m.nextSibling),f.__u&=-7);return t.__e=y,d}function Ms(i,e,t,s,n){var r,a,o,d,u,c=t.length,h=c,p=0;for(i.__k=new Array(n),r=0;r<n;r++)(a=e[r])!=null&&typeof a!="boolean"&&typeof a!="function"?(d=r+p,(a=i.__k[r]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?he(null,a,null,null,null):be(a)?he(G,{children:a},null,null,null):a.constructor==null&&a.__b>0?he(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=i,a.__b=i.__b+1,o=null,(u=a.__i=Bs(a,t,d,h))!=-1&&(h--,(o=t[u])&&(o.__u|=2)),o==null||o.__v==null?(u==-1&&(n>c?p--:n<c&&p++),typeof a.type!="function"&&(a.__u|=4)):u!=d&&(u==d-1?p--:u==d+1?p++:(u>d?p--:p++,a.__u|=4))):i.__k[r]=null;if(h)for(r=0;r<c;r++)(o=t[r])!=null&&(2&o.__u)==0&&(o.__e==s&&(s=se(o)),ji(o,o));return s}function $i(i,e,t,s){var n,r;if(typeof i.type=="function"){for(n=i.__k,r=0;n&&r<n.length;r++)n[r]&&(n[r].__=i,e=$i(n[r],e,t,s));return e}i.__e!=e&&(s&&(e&&i.type&&!e.parentNode&&(e=se(i)),t.insertBefore(i.__e,e||null)),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function X(i,e){return e=e||[],i==null||typeof i=="boolean"||(be(i)?i.some(function(t){X(t,e)}):e.push(i)),e}function Bs(i,e,t,s){var n,r,a,o=i.key,d=i.type,u=e[t],c=u!=null&&(2&u.__u)==0;if(u===null&&i.key==null||c&&o==u.key&&d==u.type)return t;if(s>(c?1:0)){for(n=t-1,r=t+1;n>=0||r<e.length;)if((u=e[a=n>=0?n--:r++])!=null&&(2&u.__u)==0&&o==u.key&&d==u.type)return a}return-1}function Rt(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||Is.test(e)?t:t+"px"}function we(i,e,t,s,n){var r,a;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof s=="string"&&(i.style.cssText=s=""),s)for(e in s)t&&e in t||Rt(i.style,e,"");if(t)for(e in t)s&&t[e]==s[e]||Rt(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")r=e!=(e=e.replace(Bi,"$1")),a=e.toLowerCase(),e=a in i||e=="onFocusOut"||e=="onFocusIn"?a.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+r]=t,t?s?t.u=s.u:(t.u=ut,i.addEventListener(e,r?it:tt,r)):i.removeEventListener(e,r?it:tt,r);else{if(n=="http://www.w3.org/2000/svg")e=e.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(e!="width"&&e!="height"&&e!="href"&&e!="list"&&e!="form"&&e!="tabIndex"&&e!="download"&&e!="rowSpan"&&e!="colSpan"&&e!="role"&&e!="popover"&&e in i)try{i[e]=t??"";break e}catch{}typeof t=="function"||(t==null||t===!1&&e[4]!="-"?i.removeAttribute(e):i.setAttribute(e,e=="popover"&&t==1?"":t))}}function Lt(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=ut++;else if(e.t<t.u)return;return t(T.event?T.event(e):e)}}}function pt(i,e,t,s,n,r,a,o,d,u){var c,h,p,f,m,y,v,b,g,w,E,P,S,M,_,D,B,A=e.type;if(e.constructor!=null)return null;128&t.__u&&(d=!!(32&t.__u),r=[o=e.__e=t.__e]),(c=T.__b)&&c(e);e:if(typeof A=="function")try{if(b=e.props,g="prototype"in A&&A.prototype.render,w=(c=A.contextType)&&s[c.__c],E=c?w?w.props.value:c.__:s,t.__c?v=(h=e.__c=t.__c).__=h.__E:(g?e.__c=h=new A(b,E):(e.__c=h=new W(b,E),h.constructor=A,h.render=Ls),w&&w.sub(h),h.props=b,h.state||(h.state={}),h.context=E,h.__n=s,p=h.__d=!0,h.__h=[],h._sb=[]),g&&h.__s==null&&(h.__s=h.state),g&&A.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=V({},h.__s)),V(h.__s,A.getDerivedStateFromProps(b,h.__s))),f=h.props,m=h.state,h.__v=e,p)g&&A.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),g&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(g&&A.getDerivedStateFromProps==null&&b!==f&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(b,E),!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(b,h.__s,E)===!1||e.__v==t.__v){for(e.__v!=t.__v&&(h.props=b,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(x){x&&(x.__=e)}),P=0;P<h._sb.length;P++)h.__h.push(h._sb[P]);h._sb=[],h.__h.length&&a.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(b,h.__s,E),g&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(f,m,y)})}if(h.context=E,h.props=b,h.__P=i,h.__e=!1,S=T.__r,M=0,g){for(h.state=h.__s,h.__d=!1,S&&S(e),c=h.render(h.props,h.state,h.context),_=0;_<h._sb.length;_++)h.__h.push(h._sb[_]);h._sb=[]}else do h.__d=!1,S&&S(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++M<25);h.state=h.__s,h.getChildContext!=null&&(s=V(V({},s),h.getChildContext())),g&&!p&&h.getSnapshotBeforeUpdate!=null&&(y=h.getSnapshotBeforeUpdate(f,m)),D=c,c!=null&&c.type===G&&c.key==null&&(D=qi(c.props.children)),o=zi(i,be(D)?D:[D],e,t,s,n,r,a,o,d,u),h.base=e.__e,e.__u&=-161,h.__h.length&&a.push(h),v&&(h.__E=h.__=null)}catch(x){if(e.__v=null,d||r!=null)if(x.then){for(e.__u|=d?160:128;o&&o.nodeType==8&&o.nextSibling;)o=o.nextSibling;r[r.indexOf(o)]=null,e.__e=o}else{for(B=r.length;B--;)ht(r[B]);st(e)}else e.__e=t.__e,e.__k=t.__k,x.then||st(e);T.__e(x,e,t)}else r==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):o=e.__e=Rs(t.__e,e,t,s,n,r,a,d,u);return(c=T.diffed)&&c(e),128&e.__u?void 0:o}function st(i){i&&i.__c&&(i.__c.__e=!0),i&&i.__k&&i.__k.forEach(st)}function Hi(i,e,t){for(var s=0;s<t.length;s++)ft(t[s],t[++s],t[++s]);T.__c&&T.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(r){r.call(n)})}catch(r){T.__e(r,n.__v)}})}function qi(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:be(i)?i.map(qi):V({},i)}function Rs(i,e,t,s,n,r,a,o,d){var u,c,h,p,f,m,y,v=t.props,b=e.props,g=e.type;if(g=="svg"?n="http://www.w3.org/2000/svg":g=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),r!=null){for(u=0;u<r.length;u++)if((f=r[u])&&"setAttribute"in f==!!g&&(g?f.localName==g:f.nodeType==3)){i=f,r[u]=null;break}}if(i==null){if(g==null)return document.createTextNode(b);i=document.createElementNS(n,g,b.is&&b),o&&(T.__m&&T.__m(e,r),o=!1),r=null}if(g==null)v===b||o&&i.data==b||(i.data=b);else{if(r=r&&ye.call(i.childNodes),v=t.props||ce,!o&&r!=null)for(v={},u=0;u<i.attributes.length;u++)v[(f=i.attributes[u]).name]=f.value;for(u in v)if(f=v[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=f;else if(!(u in b)){if(u=="value"&&"defaultValue"in b||u=="checked"&&"defaultChecked"in b)continue;we(i,u,null,f,n)}}for(u in b)f=b[u],u=="children"?p=f:u=="dangerouslySetInnerHTML"?c=f:u=="value"?m=f:u=="checked"?y=f:o&&typeof f!="function"||v[u]===f||we(i,u,f,v[u],n);if(c)o||h&&(c.__html==h.__html||c.__html==i.innerHTML)||(i.innerHTML=c.__html),e.__k=[];else if(h&&(i.innerHTML=""),zi(e.type=="template"?i.content:i,be(p)?p:[p],e,t,s,g=="foreignObject"?"http://www.w3.org/1999/xhtml":n,r,a,r?r[0]:t.__k&&se(t,0),o,d),r!=null)for(u=r.length;u--;)ht(r[u]);o||(u="value",g=="progress"&&m==null?i.removeAttribute("value"):m!=null&&(m!==i[u]||g=="progress"&&!m||g=="option"&&m!=v[u])&&we(i,u,m,v[u],n),u="checked",y!=null&&y!=i[u]&&we(i,u,y,v[u],n))}return i}function ft(i,e,t){try{if(typeof i=="function"){var s=typeof i.__u=="function";s&&i.__u(),s&&e==null||(i.__u=i(e))}else i.current=e}catch(n){T.__e(n,t)}}function ji(i,e,t){var s,n;if(T.unmount&&T.unmount(i),(s=i.ref)&&(s.current&&s.current!=i.__e||ft(s,null,e)),(s=i.__c)!=null){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(r){T.__e(r,e)}s.base=s.__P=null}if(s=i.__k)for(n=0;n<s.length;n++)s[n]&&ji(s[n],e,t||typeof i.type!="function");t||ht(i.__e),i.__c=i.__=i.__e=void 0}function Ls(i,e,t){return this.constructor(i,t)}function zt(i,e,t){var s,n,r,a;e==document&&(e=document.documentElement),T.__&&T.__(i,e),n=(s=!1)?null:e.__k,r=[],a=[],pt(e,i=e.__k=ct(G,null,[i]),n||ce,ce,e.namespaceURI,n?null:e.firstChild?ye.call(e.childNodes):null,r,n?n.__e:e.firstChild,s,a),Hi(r,i,a)}function Vi(i,e,t){var s,n,r,a,o=V({},i.props);for(r in i.type&&i.type.defaultProps&&(a=i.type.defaultProps),e)r=="key"?s=e[r]:r=="ref"?n=e[r]:o[r]=e[r]===void 0&&a!=null?a[r]:e[r];return arguments.length>2&&(o.children=arguments.length>3?ye.call(arguments,2):t),he(i.type,o,s||i.key,n||i.ref,null)}ye=Ri.slice,T={__e:function(i,e,t,s){for(var n,r,a;e=e.__;)if((n=e.__c)&&!n.__)try{if((r=n.constructor)&&r.getDerivedStateFromError!=null&&(n.setState(r.getDerivedStateFromError(i)),a=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,s||{}),a=n.__d),a)return n.__E=n}catch(o){i=o}throw i}},Ii=0,W.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=V({},this.state),typeof i=="function"&&(i=i(V({},t),this.props)),i&&V(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),Bt(this))},W.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),Bt(this))},W.prototype.render=G,Q=[],xi=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Mi=function(i,e){return i.__v.__b-e.__v.__b},Ne.__r=0,Bi=/(PointerCapture)$|Capture$/i,ut=0,tt=Lt(!1),it=Lt(!0);var zs=0;function l(i,e,t,s,n,r){e||(e={});var a,o,d=e;if("ref"in d)for(o in d={},e)o=="ref"?a=e[o]:d[o]=e[o];var u={type:i,props:d,key:t,ref:a,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--zs,__i:-1,__u:0,__source:n,__self:r};if(typeof i=="function"&&(a=i.defaultProps))for(o in a)d[o]===void 0&&(d[o]=a[o]);return T.vnode&&T.vnode(u),u}var pe,k,Re,$t,fe=0,Wi=[],O=T,Ht=O.__b,qt=O.__r,jt=O.diffed,Vt=O.__c,Wt=O.unmount,Gt=O.__;function mt(i,e){O.__h&&O.__h(k,i,fe||e),fe=0;var t=k.__H||(k.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function ne(i){return fe=1,$s(Ki,i)}function $s(i,e,t){var s=mt(pe++,2);if(s.t=i,!s.__c&&(s.__=[Ki(void 0,e),function(o){var d=s.__N?s.__N[0]:s.__[0],u=s.t(d,o);d!==u&&(s.__N=[u,s.__[1]],s.__c.setState({}))}],s.__c=k,!k.__f)){var n=function(o,d,u){if(!s.__c.__H)return!0;var c=s.__c.__H.__.filter(function(p){return!!p.__c});if(c.every(function(p){return!p.__N}))return!r||r.call(this,o,d,u);var h=s.__c.props!==o;return c.forEach(function(p){if(p.__N){var f=p.__[0];p.__=p.__N,p.__N=void 0,f!==p.__[0]&&(h=!0)}}),r&&r.call(this,o,d,u)||h};k.__f=!0;var r=k.shouldComponentUpdate,a=k.componentWillUpdate;k.componentWillUpdate=function(o,d,u){if(this.__e){var c=r;r=void 0,n(o,d,u),r=c}a&&a.call(this,o,d,u)},k.shouldComponentUpdate=n}return s.__N||s.__}function De(i,e){var t=mt(pe++,3);!O.__s&&Gi(t.__H,e)&&(t.__=i,t.u=e,k.__H.__h.push(t))}function ie(i){return fe=5,gt(function(){return{current:i}},[])}function gt(i,e){var t=mt(pe++,7);return Gi(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function Ie(i,e){return fe=8,gt(function(){return i},e)}function Hs(){for(var i;i=Wi.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(Ue),i.__H.__h.forEach(nt),i.__H.__h=[]}catch(e){i.__H.__h=[],O.__e(e,i.__v)}}O.__b=function(i){k=null,Ht&&Ht(i)},O.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),Gt&&Gt(i,e)},O.__r=function(i){qt&&qt(i),pe=0;var e=(k=i.__c).__H;e&&(Re===k?(e.__h=[],k.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(Ue),e.__h.forEach(nt),e.__h=[],pe=0)),Re=k},O.diffed=function(i){jt&&jt(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Wi.push(e)!==1&&$t===O.requestAnimationFrame||(($t=O.requestAnimationFrame)||qs)(Hs)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Re=k=null},O.__c=function(i,e){e.some(function(t){try{t.__h.forEach(Ue),t.__h=t.__h.filter(function(s){return!s.__||nt(s)})}catch(s){e.some(function(n){n.__h&&(n.__h=[])}),e=[],O.__e(s,t.__v)}}),Vt&&Vt(i,e)},O.unmount=function(i){Wt&&Wt(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(s){try{Ue(s)}catch(n){e=n}}),t.__H=void 0,e&&O.__e(e,t.__v))};var Kt=typeof requestAnimationFrame=="function";function qs(i){var e,t=function(){clearTimeout(s),Kt&&cancelAnimationFrame(e),setTimeout(i)},s=setTimeout(t,35);Kt&&(e=requestAnimationFrame(t))}function Ue(i){var e=k,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),k=e}function nt(i){var e=k;i.__c=i.__(),k=e}function Gi(i,e){return!i||i.length!==e.length||e.some(function(t,s){return t!==i[s]})}function Ki(i,e){return typeof e=="function"?e(i):e}const js={position:"relative",width:"100%",minHeight:"100%"},Vs={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function Ws({data:i,rowHeight:e,renderRow:t,overscanCount:s=10,padding:n=4,...r}){const a=ie(null),[o,d]=ne(0),[u,c]=ne(0);De(()=>{function g(){a.current!=null&&u!==a.current.offsetHeight&&c(a.current.offsetHeight)}return g(),window.addEventListener("resize",g),()=>{window.removeEventListener("resize",g)}},[u]);const h=Ie(()=>{a.current&&d(a.current.scrollTop)},[]);let p=Math.floor(o/e),f=Math.floor(u/e);s&&(p=Math.max(0,p-p%s),f+=s);const m=p+f+n,y=i.slice(p,m),v={...js,height:i.length*e},b={...Vs,top:p*e};return l("div",{onScroll:h,ref:a,...r,children:l("div",{role:"presentation",style:v,children:l("div",{role:"presentation",style:b,children:y.map(t)})})})}class Gs{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(e,t){this.uppy=e,this.opts=t??{}}getPluginState(){const{plugins:e}=this.uppy.getState();return 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 Ni([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(){}}const Ks={debug:()=>{},warn:()=>{},error:(...i)=>console.error(`[Uppy] [${Oe()}]`,...i)},Xs={debug:(...i)=>console.debug(`[Uppy] [${Oe()}]`,...i),warn:(...i)=>console.warn(`[Uppy] [${Oe()}]`,...i),error:(...i)=>console.error(`[Uppy] [${Oe()}]`,...i)};var Le,Xt;function Ys(){return Xt||(Xt=1,Le=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),s===0)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(s)/Math.log(1024)),n.length-1),a=Number(s/1024**r),o=n[r];return`${a>=10||a%1===0?Math.round(a):a.toFixed(1)} ${o}`}),Le}var Qs=Ys();const J=re(Qs);var ze,Yt;function Js(){if(Yt)return ze;Yt=1;function i(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}return i.prototype.match=function(e){var t=!0,s=this.parts,n,r=s.length,a;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(a=(e||"").split(this.separator),n=0;t&&n<r;n++)s[n]!=="*"&&(n<a.length?t=s[n]===a[n]:t=!1);t=t&&a}else if(typeof e.splice=="function")for(t=[],n=e.length;n--;)this.match(e[n])&&(t[t.length]=e[n]);else if(typeof e=="object"){t={};for(var o in e)this.match(o)&&(t[o]=e[o])}return t},ze=function(e,t,s){var n=new i(e,s||/[\/\.]/);return typeof t<"u"?n.match(t):n},ze}var $e,Qt;function Zs(){if(Qt)return $e;Qt=1;var i=Js(),e=/[\/\+\.]/;return $e=function(t,s){function n(r){var a=i(r,t,e);return a&&a.length>=2}return s?n(s.split(";")[0]):n},$e}var en=Zs();const tn=re(en),sn={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class R extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class nn{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const s=e();if(s.restrictions?.allowedFileTypes!=null&&!Array.isArray(s.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return s}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:n}=this.getOpts().restrictions;if(n&&e.filter(a=>!a.isGhost).length+t.length>n)throw new R(`${this.getI18n()("youCanOnlyUploadX",{smart_count:n})}`);if(s){const r=[...e,...t].reduce((a,o)=>a+(o.size??0),0);if(r>s)throw new R(this.getI18n()("aggregateExceedsSize",{sizeAllowed:J(s),size:J(r)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:n}=this.getOpts().restrictions;if(n&&!n.some(a=>a.includes("/")?e.type?tn(e.type.replace(/;.*?$/,""),a):!1:a[0]==="."&&e.extension?e.extension.toLowerCase()===a.slice(1).toLowerCase():!1)){const a=n.join(", ");throw new R(this.getI18n()("youCanOnlyUploadFileTypes",{types:a}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new R(this.getI18n()("exceedsSize",{size:J(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(s&&e.size!=null&&e.size<s)throw new R(this.getI18n()("inferiorSize",{size:J(s)}),{file:e})}validate(e,t){t.forEach(s=>{this.validateSingleFile(s)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new R(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new R(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,n=[];for(const r of s)(!Object.hasOwn(e.meta,r)||e.meta[r]==="")&&n.push(r);return{missingFields:n,error:t}}}function rn(i){let e=null,t;return(...s)=>(t=s,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e)}class me extends Gs{#e;isTargetDOMEl;el;parent;title;getTargetPlugin(e){let t;if(typeof e?.addTarget=="function")t=e,t instanceof me||console.warn(new Error("The provided plugin is not an instance of UIPlugin. This is an indication of a bug with the way Uppy is bundled.",{cause:{targetPlugin:t,UIPlugin:me}}));else if(typeof e=="function"){const s=e;this.uppy.iteratePlugins(n=>{n instanceof s&&(t=n)})}return t}mount(e,t){const s=t.id,n=ws(e);if(n){this.isTargetDOMEl=!0;const o=document.createElement("div");return o.classList.add("uppy-Root"),this.#e=rn(d=>{this.uppy.getPlugin(this.id)&&(zt(this.render(d,o),o),this.afterUpdate())}),this.uppy.log(`Installing ${s} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),zt(this.render(this.uppy.getState(),o),o),this.el=o,n.appendChild(o),o.dir=this.opts.direction||ks(o)||"ltr",this.onMount(),this.el}const r=this.getTargetPlugin(e);if(r)return this.uppy.log(`Installing ${s} to ${r.id}`),this.parent=r,this.el=r.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${s}`);let a=`Invalid target option given to ${s}.`;throw typeof e=="function"?a+=" The given target is not a Plugin class. Please check that you're not specifying a React Component instead of a plugin. If you are using @uppy/* packages directly, make sure you have only 1 version of @uppy/core installed: run `npm ls @uppy/core` on the command line and verify that all the versions match and are deduped correctly.":a+="If you meant to target an HTML element, please make sure that the element exists. Check that the <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(a)}render(e,t){throw new Error("Extend the render method to add your plugin to a DOM element")}update(e){this.el!=null&&this.#e?.(e)}unmount(){this.isTargetDOMEl&&this.el?.remove(),this.onUnmount()}onMount(){}onUnmount(){}}const an="5.0.0",on={version:an};class ln{static VERSION=on.version;state={};#e=new Set;getState(){return this.state}setState(e){const t={...this.state},s={...this.state,...e};this.state=s,this.#t(t,s,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(t=>{t(...e)})}}var He,Jt;function Xi(){if(Jt)return He;Jt=1;var i=Ti(),e=gs(),t=ys(),s="Expected a function",n=Math.max,r=Math.min;function a(o,d,u){var c,h,p,f,m,y,v=0,b=!1,g=!1,w=!0;if(typeof o!="function")throw new TypeError(s);d=t(d)||0,i(u)&&(b=!!u.leading,g="maxWait"in u,p=g?n(t(u.maxWait)||0,d):p,w="trailing"in u?!!u.trailing:w);function E(C){var H=c,K=h;return c=h=void 0,v=C,f=o.apply(K,H),f}function P(C){return v=C,m=setTimeout(_,d),b?E(C):f}function S(C){var H=C-y,K=C-v,Z=d-H;return g?r(Z,p-K):Z}function M(C){var H=C-y,K=C-v;return y===void 0||H>=d||H<0||g&&K>=p}function _(){var C=e();if(M(C))return D(C);m=setTimeout(_,S(C))}function D(C){return m=void 0,w&&c?E(C):(c=h=void 0,f)}function B(){m!==void 0&&clearTimeout(m),v=0,c=y=h=m=void 0}function A(){return m===void 0?f:D(e())}function x(){var C=e(),H=M(C);if(c=arguments,h=this,y=C,H){if(m===void 0)return P(y);if(g)return clearTimeout(m),m=setTimeout(_,d),E(y)}return m===void 0&&(m=setTimeout(_,d)),f}return x.cancel=B,x.flush=A,x}return He=a,He}var qe,Zt;function dn(){if(Zt)return qe;Zt=1;var i=Xi(),e=Ti(),t="Expected a function";function s(n,r,a){var o=!0,d=!0;if(typeof n!="function")throw new TypeError(t);return e(a)&&(o="leading"in a?!!a.leading:o,d="trailing"in a?!!a.trailing:d),i(n,r,{leading:o,maxWait:r,trailing:d})}return qe=s,qe}var un=dn();const hn=re(un);var je,ei;function cn(){return ei||(ei=1,je=function(){var e={},t=e._fns={};e.emit=function(a,o,d,u,c,h,p){var f=s(a);f.length&&n(a,f,[o,d,u,c,h,p])},e.on=function(a,o){t[a]||(t[a]=[]),t[a].push(o)},e.once=function(a,o){function d(){o.apply(this,arguments),e.off(a,d)}this.on(a,d)},e.off=function(a,o){var d=[];if(a&&o){var u=this._fns[a],c=0,h=u?u.length:0;for(c;c<h;c++)u[c]!==o&&d.push(u[c])}d.length?this._fns[a]=d:delete this._fns[a]};function s(r){var a=t[r]?t[r]:[],o=r.indexOf(":"),d=o===-1?[r]:[r.substring(0,o),r.substring(o+1)],u=Object.keys(t),c=0,h=u.length;for(c;c<h;c++){var p=u[c];if(p==="*"&&(a=a.concat(t[p])),d.length===2&&d[0]===p){a=a.concat(t[p]);break}}return a}function n(r,a,o){var d=0,u=a.length;for(d;d<u&&a[d];d++)a[d].event=r,a[d].apply(a[d],o)}return e}),je}var pn=cn();const fn=re(pn);let mn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",gn=(i=21)=>{let e="",t=i|0;for(;t--;)e+=mn[Math.random()*64|0];return e};const yn="5.2.0",bn={version:yn};function vn(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}const wn={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",logIn:"Log in",pickFiles:"Pick files",pickPhotos:"Pick photos",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",pleaseWait:"Please wait"}};function _n(i){if(i==null&&typeof navigator<"u"&&(i=navigator.userAgent),!i)return!0;const e=/Edge\/(\d+\.\d+)/.exec(i);if(!e)return!0;const s=e[1].split(".",2),n=parseInt(s[0],10),r=parseInt(s[1],10);return n<15||n===15&&r<15063||n>18||n===18&&r>=18218}const _e={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class Yi{static VERSION=bn.version;#e=Object.create(null);#t;#n;#i=fn();#r=new Set;#a=new Set;#o=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=wn;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:sn,meta:{},onBeforeFileAdded:(n,r)=>!Object.hasOwn(r,n.id),onBeforeUpload:n=>n,store:new ln,logger:Ks,infoTimeout:5e3},s={...t,...e};this.opts={...s,restrictions:{...t.restrictions,...e?.restrictions}},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?.debug&&(this.opts.logger=Xs),this.log(`Using Core v${Yi.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({..._e,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:_n(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new nn(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((n,r,a)=>{this.emit("state-update",n,r,a),this.updateAll(r)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#P()}emit(e,...t){this.#i.emit(e,...t)}on(e,t){return this.#i.on(e,t),this}once(e,t){return this.#i.once(e,t),this}off(e,t){return this.#i.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(([s,n])=>[s,{...t[s],...n}]))}})}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=s=>this.log(`Missing i18n string: ${s}`,"error"),t=new Ni([this.defaultLocale,this.opts.locale],{onMissingKey:e});this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.locale=t.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},s=Object.create(null);Object.keys(t).forEach(n=>{s[n]={...t[n],progress:{...t[n].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:s,..._e})}clear(){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({..._e,files:{}})}addPreProcessor(e){this.#r.add(e)}removePreProcessor(e){return this.#r.delete(e)}addPostProcessor(e){this.#o.add(e)}removePostProcessor(e){return this.#o.delete(e)}addUploader(e){this.#a.add(e)}removeUploader(e){return this.#a.delete(e)}setMeta(e){const t={...this.getState().meta,...e},s={...this.getState().files};Object.keys(s).forEach(n=>{s[n]={...s[n],meta:{...s[n].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:s})}setFileMeta(e,t){const s={...this.getState().files};if(!s[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const n={...s[e].meta,...t};s[e]={...s[e],meta:n},this.setState({files:s})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(t=>this.getFile(t))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:s}=this.getState(),n=Object.values(e),r=[],a=[],o=[],d=[],u=[],c=[],h=[],p=[],f=[];for(const m of n){const{progress:y}=m;!y.uploadComplete&&y.uploadStarted&&(r.push(m),m.isPaused||p.push(m)),y.uploadStarted||a.push(m),(y.uploadStarted||y.preprocess||y.postprocess)&&o.push(m),y.uploadStarted&&d.push(m),m.isPaused&&u.push(m),y.uploadComplete&&c.push(m),m.error&&h.push(m),(y.preprocess||y.postprocess)&&f.push(m)}return{newFiles:a,startedFiles:o,uploadStartedFiles:d,pausedFiles:u,completeFiles:c,erroredFiles:h,inProgressFiles:r,inProgressNotPausedFiles:p,processingFiles:f,isUploadStarted:d.length>0,isAllComplete:t===100&&c.length===n.length&&f.length===0,isAllErrored:!!s&&h.length===n.length,isAllPaused:r.length!==0&&u.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:n.some(m=>m.isGhost)}}#s(e){for(const a of e)a.isRestriction?this.emit("restriction-failed",a.file,a):this.emit("error",a,a.file),this.log(a,"warning");const t=e.filter(a=>a.isUserFacing),s=4,n=t.slice(0,s),r=t.slice(s);n.forEach(({message:a,details:o=""})=>{this.info({message:a,details:o},"error",this.opts.infoTimeout)}),r.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:r.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#t.validate(t,[e])}catch(s){return s}return null}validateSingleFile(e){try{this.#t.validateSingleFile(e)}catch(t){return t.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{this.#t.validateAggregateRestrictions(t,e)}catch(s){return s.message}return null}#h(e){const{missingFields:t,error:s}=this.#t.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:s.message}),this.log(s.message),this.emit("restriction-failed",e,s),!1):(t.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#g(e){let t=!0;for(const s of Object.values(e))this.#h(s)||(t=!1);return t}#l(e){const{allowNewUpload:t}=this.getState();if(t===!1){const s=new R(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#s([s]),s}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!!(t[e]&&!t[e].isGhost)}#c(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,s=ki(t),n=vn(s,t),r=Ei(n).extension,a=Ts(t,this.getID()),o={...t.meta,name:n,type:s},d=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:a,name:n,extension:r||"",meta:{...this.getState().meta,...o},type:s,progress:{percentage:0,bytesUploaded:!1,bytesTotal:d,uploadComplete:!1,uploadStarted:null},size:d,isGhost:!1,...t.isRemote?{isRemote:!0,remote:t.remote,data:t.data}:{isRemote:!1,data:t.data},preview:t.preview}}#d(){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))}#y(e){let{files:t}=this.getState(),s={...t};const n=[],r=[];for(const a of e)try{let o=this.#c(a);this.#l(o);const d=t[o.id],u=d?.isGhost;if(u&&!o.isRemote){if(o.data==null)throw new Error("File data is missing");o={...d,isGhost:!1,data:o.data},this.log(`Replaced the blob in the restored ghost file: ${o.name}, ${o.id}`)}const c=this.opts.onBeforeFileAdded(o,s);if(t=this.getState().files,s={...t,...s},!c&&this.checkIfFileAlreadyExists(o.id))throw new R(this.i18n("noDuplicates",{fileName:o.name??this.i18n("unnamed")}),{file:o});if(c===!1&&!u)throw new R("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:o});typeof c=="object"&&c!==null&&(o=c),this.#t.validateSingleFile(o),s[o.id]=o,n.push(o)}catch(o){r.push(o)}try{this.#t.validateAggregateRestrictions(Object.values(t),n)}catch(a){return r.push(a),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:s,validFilesToAdd:n,errors:r}}addFile(e){const{nextFilesState:t,validFilesToAdd:s,errors:n}=this.#y([e]),r=n.filter(o=>o.isRestriction);if(this.#s(r),n.length>0)throw n[0];this.setState({files:t});const[a]=s;return this.emit("file-added",a),this.emit("files-added",s),this.log(`Added file: ${a.name}, ${a.id}, mime type: ${a.type}`),this.#d(),a.id}addFiles(e){const{nextFilesState:t,validFilesToAdd:s,errors:n}=this.#y(e),r=n.filter(o=>o.isRestriction);this.#s(r);const a=n.filter(o=>!o.isRestriction);if(a.length>0){let o=`Multiple errors occurred while adding files:
|
||
`;if(a.forEach(d=>{o+=`
|
||
* ${d.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:a.length}),details:o},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(a,o);{const d=new Error(o);throw d.errors=a,d}}this.setState({files:t}),s.forEach(o=>{this.emit("file-added",o)}),this.emit("files-added",s),s.length>5?this.log(`Added batch of ${s.length} files`):Object.values(s).forEach(o=>{this.log(`Added file: ${o.name}
|
||
id: ${o.id}
|
||
type: ${o.type}`)}),s.length>0&&this.#d()}removeFiles(e){const{files:t,currentUploads:s}=this.getState(),n={...t},r={...s},a=Object.create(null);e.forEach(c=>{t[c]&&(a[c]=t[c],delete n[c])});function o(c){return a[c]===void 0}Object.keys(r).forEach(c=>{const h=s[c].fileIDs.filter(o);if(h.length===0){delete r[c];return}const{capabilities:p}=this.getState();if(h.length!==s[c].fileIDs.length&&!p.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[c]={...s[c],fileIDs:h}});const d={currentUploads:r,files:n};Object.keys(n).length===0&&(d.allowNewUpload=!0,d.error=null,d.recoveredState=null),this.setState(d),this.#p();const u=Object.keys(a);u.forEach(c=>{this.emit("file-removed",a[c])}),u.length>5?this.log(`Removed ${u.length} files`):this.log(`Removed files: ${u.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=this.getFile(e),n=!(t.isPaused||!1);return this.setFileState(e,{isPaused:n}),this.emit("upload-pause",t,n),n}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const n={...e[s],isPaused:!0};e[s]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(s=>!e[s].progress.uploadComplete&&e[s].progress.uploadStarted).forEach(s=>{const n={...e[s],isPaused:!1,error:null};e[s]=n}),this.setState({files:e}),this.emit("resume-all")}#b(){const{files:e}=this.getState();return Object.keys(e).filter(t=>{const s=e[t];return s.error&&(!s.missingRequiredMetaFields||s.missingRequiredMetaFields.length===0)})}async#v(){const e=this.#b(),t={...this.getState().files};if(e.forEach(n=>{t[n]={...t[n],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),e.length===0)return{successful:[],failed:[]};const s=this.#f(e,{forceAllowNewUpload:!0});return this.#m(s)}async retryAll(){const e=await this.#v();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(_e)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=this.#f([e],{forceAllowNewUpload:!0});return this.#m(t)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#S=(e,t)=>{const s=e?this.getFile(e.id):void 0;if(e==null||!s){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(s.progress.percentage===100){this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);return}const n={bytesTotal:t.bytesTotal,percentage:t.bytesTotal!=null&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};s.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...s.progress,...n,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...s.progress,...n}}),this.#p()};#w(){const e=this.#T();let t=null;e!=null&&(t=Math.round(e*100),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}#p=hn(()=>this.#w(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#w()}#T(){const t=this.getFiles().filter(d=>d.progress.uploadStarted||d.progress.preprocess||d.progress.postprocess);if(t.length===0)return 0;if(t.every(d=>d.progress.uploadComplete))return 1;const s=d=>d.progress.bytesTotal!=null&&d.progress.bytesTotal!==0,n=t.filter(s),r=t.filter(d=>!s(d));if(n.every(d=>d.progress.uploadComplete)&&r.length>0&&!r.every(d=>d.progress.uploadComplete))return null;const a=n.reduce((d,u)=>d+(u.progress.bytesTotal??0),0),o=n.reduce((d,u)=>d+(u.progress.bytesUploaded||0),0);return a===0?0:o/a}#P(){const e=(n,r,a)=>{let o=n.message||"Unknown error";n.details&&(o+=` ${n.details}`),this.setState({error:o}),r!=null&&r.id in this.getState().files&&this.setFileState(r.id,{error:o,response:a})};this.on("error",e),this.on("upload-error",(n,r,a)=>{if(e(r,n,a),typeof r=="object"&&r.message){this.log(r.message,"error");const o=new Error(this.i18n("failedToUpload",{file:n?.name??""}));o.isUserFacing=!0,o.details=r.message,r.details&&(o.details+=` ${r.details}`),this.#s([o])}else this.#s([r])});let t=null;this.on("upload-stalled",(n,r)=>{const{message:a}=n,o=r.map(d=>d.meta.name).join(", ");t||(this.info({message:a,details:o},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${a} ${o}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const s=n=>{const r=n.filter(o=>{const d=o!=null&&this.getFile(o.id);return d||this.log(`Not setting progress for a file that has been removed: ${o?.id}`),d}),a=Object.fromEntries(r.map(o=>[o.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:o.size}}]));this.patchFilesState(a)};this.on("upload-start",s),this.on("upload-progress",this.#S),this.on("upload-success",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}const a=this.getFile(n.id).progress,o=this.#o.size>0;this.setFileState(n.id,{progress:{...a,postprocess:o?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!o&&{complete:!0},percentage:100,bytesUploaded:a.bytesTotal},response:r,uploadURL:r.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:r.bytesUploaded||a.bytesTotal}),this.#p()}),this.on("preprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:{...this.getFile(n.id).progress,preprocess:r}})}),this.on("preprocess-complete",n=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}const r={...this.getState().files};r[n.id]={...r[n.id],progress:{...r[n.id].progress}},delete r[n.id].progress.preprocess,this.setState({files:r})}),this.on("postprocess-progress",(n,r)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}this.setFileState(n.id,{progress:{...this.getState().files[n.id].progress,postprocess:r}})}),this.on("postprocess-complete",n=>{const r=n&&this.getFile(n.id);if(r==null){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}const{postprocess:a,...o}=r.progress;this.patchFilesState({[r.id]:{progress:{...o,complete:!0}}})}),this.on("restored",()=>{this.#p()}),this.on("dashboard:file-edit-complete",n=>{n&&this.#h(n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#u),window.addEventListener("offline",this.#u),setTimeout(this.#u,3e3))}updateOnlineStatus(){window.navigator.onLine??!0?(this.emit("is-online"),this.wasOffline&&(this.emit("back-online"),this.info(this.i18n("connectedToInternet"),"success",3e3),this.wasOffline=!1)):(this.emit("is-offline"),this.info(this.i18n("noInternetConnection"),"error",0),this.wasOffline=!0)}#u=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if(typeof e!="function"){const a=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(a)}const s=new e(this,...t),n=s.id;if(!n)throw new Error("Your plugin must have an id");if(!s.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(n);if(r){const a=`Already found a plugin named '${r.id}'. Tried to use: '${n}'.
|
||
Uppy plugins must have unique \`id\` options.`;throw new Error(a)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),s.type in this.#e?this.#e[s.type].push(s):this.#e[s.type]=[s],s.install(),this.emit("plugin-added",s),this}getPlugin(e){for(const t of Object.values(this.#e)){const s=t.find(n=>n.id===e);if(s!=null)return s}}[Symbol.for("uppy test: getPlugins")](e){return this.#e[e]}iteratePlugins(e){Object.values(this.#e).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=this.#e[e.type],s=t.findIndex(a=>a.id===e.id);s!==-1&&t.splice(s,1);const r={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(r)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#u),window.removeEventListener("offline",this.#u))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",s=3e3){const n=typeof e=="object";this.setState({info:[...this.getState().info,{type:t,message:n?e.message:e,details:n?e.details:null}]}),setTimeout(()=>this.hideInfo(),s),this.emit("info-visible")}log(e,t){const{logger:s}=this.opts;switch(t){case"error":s.error(e);break;case"warning":s.warn(e);break;default:s.debug(e);break}}#_=new Map;registerRequestClient(e,t){this.#_.set(e,t)}getRequestClientForFile(e){if(!("remote"in e&&e.remote))throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=this.#_.get(e.remote.requestClientId);if(t==null)throw new Error(`requestClientId "${e.remote.requestClientId}" not registered for file "${e.id}"`);return t}async restore(e){this.log(`Core: Running restored upload "${e}"`);const t=await this.#m(e);return this.emit("complete",t),t}#f(e,t={}){const{forceAllowNewUpload:s=!1}=t,{allowNewUpload:n,currentUploads:r}=this.getState();if(!n&&!s)throw new Error("Cannot create a new upload: already uploading.");const a=gn();return this.emit("upload",a,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...r,[a]:{fileIDs:e,step:0,result:{}}}}),a}[Symbol.for("uppy test: createUpload")](...e){return this.#f(...e)}#C(e){const{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#C(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:s}=this.getState(),n={...s[e],result:{...s[e].result,...t}};this.setState({currentUploads:{...s,[e]:n}})}#F(e){const{[e]:t,...s}=this.getState().currentUploads;this.setState({currentUploads:s})}async#m(e){const t=()=>{const{currentUploads:a}=this.getState();return a[e]};let s=t();if(!s)throw new Error("Nonexistent upload");const n=[...this.#r,...this.#a,...this.#o];try{for(let a=s.step||0;a<n.length;a++){const o=n[a];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...s,step:a}}});const{fileIDs:d}=s;if(await o(d,e),s=t(),!s)break}}catch(a){throw this.#F(e),a}if(s){s.fileIDs.forEach(u=>{const c=this.getFile(u);c?.progress.postprocess&&this.emit("postprocess-complete",c)});const a=s.fileIDs.map(u=>this.getFile(u)),o=a.filter(u=>!u.error),d=a.filter(u=>u.error);this.addResultData(e,{successful:o,failed:d,uploadID:e}),s=t()}let r;return s&&(r=s.result,this.#F(e)),r==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}async upload(){this.#e.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#b().length>0){const n=await this.#v();if(!(this.getFiles().filter(a=>a.progress.uploadStarted==null).length>0))return this.emit("complete",n),n;({files:e}=this.getState())}const s=this.opts.onBeforeUpload(e);if(s===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");s&&typeof s=="object"&&(e=s,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#g(e))throw new R(this.i18n("missingRequiredMetaField"));const{currentUploads:n}=this.getState(),r=Object.values(n).flatMap(u=>u.fileIDs),a=Object.keys(e).filter(u=>{const c=this.getFile(u);return c&&!c.progress.uploadStarted&&!r.includes(u)}),o=this.#f(a),d=await this.#m(o);return this.emit("complete",d),d}catch(n){throw this.#s([n]),n}}}var Ve={exports:{}};var ti;function Fn(){return ti||(ti=1,(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var r="",a=0;a<arguments.length;a++){var o=arguments[a];o&&(r=n(r,s(o)))}return r}function s(r){if(typeof r=="string"||typeof r=="number")return r;if(typeof r!="object")return"";if(Array.isArray(r))return t.apply(null,r);if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]"))return r.toString();var a="";for(var o in r)e.call(r,o)&&r[o]&&(a=n(a,o));return a}function n(r,a){return a?r?r+" "+a:r+a:r}i.exports?(t.default=t,i.exports=t):window.classNames=t})()})(Ve)),Ve.exports}var Sn=Fn();const $=re(Sn);var Tn=Xi();const Pn=re(Tn);function Cn(){return l("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:l("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"})})}function F(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var Qi=typeof self<"u"?self:global;const ge=typeof navigator<"u",En=ge&&typeof HTMLImageElement>"u",ii=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),Ji=Qi.Buffer,Zi=!!Ji,kn=i=>i!==void 0;function es(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(kn).length===0)}function N(i){let e=new Error(i);throw delete e.stack,e}function si(i){let e=(function(t){let s=0;return t.ifd0.enabled&&(s+=1024),t.exif.enabled&&(s+=2048),t.makerNote&&(s+=2048),t.userComment&&(s+=1024),t.gps.enabled&&(s+=512),t.interop.enabled&&(s+=100),t.ifd1.enabled&&(s+=1024),s+2048})(i);return i.jfif.enabled&&(e+=50),i.xmp.enabled&&(e+=2e4),i.iptc.enabled&&(e+=14e3),i.icc.enabled&&(e+=6e3),e}const We=i=>String.fromCharCode.apply(null,i),ni=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;class z{static from(e,t){return e instanceof this&&e.le===t?e:new z(e,void 0,void 0,t)}constructor(e,t=0,s,n){if(typeof n=="boolean"&&(this.le=n),Array.isArray(e)&&(e=new Uint8Array(e)),e===0)this.byteOffset=0,this.byteLength=0;else if(e instanceof ArrayBuffer){s===void 0&&(s=e.byteLength-t);let r=new DataView(e,t,s);this._swapDataView(r)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof z){s===void 0&&(s=e.byteLength-t),(t+=e.byteOffset)+s>e.byteOffset+e.byteLength&&N("Creating view outside of available memory in ArrayBuffer");let r=new DataView(e.buffer,t,s);this._swapDataView(r)}else if(typeof e=="number"){let r=new DataView(new ArrayBuffer(e));this._swapDataView(r)}else N("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,s=z){return e instanceof DataView||e instanceof z?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||N("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new s(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new z(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 n=this.getUint8Array(e,t),ni?ni.decode(n):Zi?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(We(n)));var n}getLatin1String(e=0,t=this.byteLength){let s=this.getUint8Array(e,t);return We(s)}getUnicodeString(e=0,t=this.byteLength){const s=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)s.push(this.getUint16(e+n));return We(s)}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,s){switch(t){case 1:return this.getUint8(e,s);case 2:return this.getUint16(e,s);case 4:return this.getUint32(e,s);case 8:return this.getUint64&&this.getUint64(e,s)}}getUint(e,t,s){switch(t){case 8:return this.getUint8(e,s);case 16:return this.getUint16(e,s);case 32:return this.getUint32(e,s);case 64:return this.getUint64&&this.getUint64(e,s)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function rt(i,e){N(`${i} '${e}' was not loaded, try using full build of exifr.`)}class yt extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||rt(this.kind,e),t&&(e in t||(function(s,n){N(`Unknown ${s} '${n}'.`)})(this.kind,e),t[e].enabled||rt(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ts=new yt("file parser"),L=new yt("segment parser"),bt=new yt("file reader");let An=Qi.fetch;function ri(i,e){return(t=i).startsWith("data:")||t.length>1e4?ot(i,e,"base64"):ii&&i.includes("://")?at(i,e,"url",ai):ii?ot(i,e,"fs"):ge?at(i,e,"url",ai):void N("Invalid input argument");var t}async function at(i,e,t,s){return bt.has(t)?ot(i,e,t):s?(async function(n,r){let a=await r(n);return new z(a)})(i,s):void N(`Parser ${t} is not loaded`)}async function ot(i,e,t){let s=new(bt.get(t))(i,e);return await s.read(),s}const ai=i=>An(i).then((e=>e.arrayBuffer())),lt=i=>new Promise(((e,t)=>{let s=new FileReader;s.onloadend=()=>e(s.result||new ArrayBuffer),s.onerror=t,s.readAsArrayBuffer(i)})),vt=new Map,On=new Map,Un=new Map,Fe=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],is=["jfif","xmp","icc","iptc","ihdr"],dt=["tiff",...is],U=["ifd0","ifd1","exif","gps","interop"],Se=[...dt,...U],Te=["makerNote","userComment"],ss=["translateKeys","translateValues","reviveValues","multiSegment"],Pe=[...ss,"sanitize","mergeOutput","silentErrors"];class ns{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class ae extends ns{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,s,n){if(super(),F(this,"enabled",!1),F(this,"skip",new Set),F(this,"pick",new Set),F(this,"deps",new Set),F(this,"translateKeys",!1),F(this,"translateValues",!1),F(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=U.includes(e),this.canBeFiltered&&(this.dict=vt.get(e)),s!==void 0)if(Array.isArray(s))this.parse=this.enabled=!0,this.canBeFiltered&&s.length>0&&this.translateTagSet(s,this.pick);else if(typeof s=="object"){if(this.enabled=!0,this.parse=s.parse!==!1,this.canBeFiltered){let{pick:r,skip:a}=s;r&&r.length>0&&this.translateTagSet(r,this.pick),a&&a.length>0&&this.translateTagSet(a,this.skip)}this.applyInheritables(s)}else s===!0||s===!1?this.parse=this.enabled=s:N(`Invalid options argument: ${s}`)}applyInheritables(e){let t,s;for(t of ss)s=e[t],s!==void 0&&(this[t]=s)}translateTagSet(e,t){if(this.dict){let s,n,{tagKeys:r,tagValues:a}=this.dict;for(s of e)typeof s=="string"?(n=a.indexOf(s),n===-1&&(n=r.indexOf(Number(s))),n!==-1&&t.add(Number(r[n]))):t.add(s)}else for(let s of e)t.add(s)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,xe(this.pick,this.deps)):this.enabled&&this.pick.size>0&&xe(this.pick,this.deps)}}var I={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},oi=new Map;class wt extends ns{static useCached(e){let t=oi.get(e);return t!==void 0||(t=new this(e),oi.set(e,t)),t}constructor(e){super(),e===!0?this.setupFromTrue():e===void 0?this.setupFromUndefined():Array.isArray(e)?this.setupFromArray(e):typeof e=="object"?this.setupFromObject(e):N(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=ge?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Fe)this[e]=I[e];for(e of Pe)this[e]=I[e];for(e of Te)this[e]=I[e];for(e of Se)this[e]=new ae(e,I[e],void 0,this)}setupFromTrue(){let e;for(e of Fe)this[e]=I[e];for(e of Pe)this[e]=I[e];for(e of Te)this[e]=!0;for(e of Se)this[e]=new ae(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Fe)this[t]=I[t];for(t of Pe)this[t]=I[t];for(t of Te)this[t]=I[t];for(t of Se)this[t]=new ae(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,U)}setupFromObject(e){let t;for(t of(U.ifd0=U.ifd0||U.image,U.ifd1=U.ifd1||U.thumbnail,Object.assign(this,e),Fe))this[t]=Ge(e[t],I[t]);for(t of Pe)this[t]=Ge(e[t],I[t]);for(t of Te)this[t]=Ge(e[t],I[t]);for(t of dt)this[t]=new ae(t,I[t],e[t],this);for(t of U)this[t]=new ae(t,I[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,U,Se),e.tiff===!0?this.batchEnableWithBool(U,!0):e.tiff===!1?this.batchEnableWithUserValue(U,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,U):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,U)}batchEnableWithBool(e,t){for(let s of e)this[s].enabled=t}batchEnableWithUserValue(e,t){for(let s of e){let n=t[s];this[s].enabled=n!==!1&&n!==void 0}}setupGlobalFilters(e,t,s,n=s){if(e&&e.length){for(let a of n)this[a].enabled=!1;let r=li(e,s);for(let[a,o]of r)xe(this[a].pick,o),this[a].enabled=!0}else if(t&&t.length){let r=li(t,s);for(let[a,o]of r)xe(this[a].skip,o)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:s,iptc:n,icc:r}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),s.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),r.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:s,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),s.needed&&e.deps.add(34853),this.tiff.enabled=U.some((r=>this[r].enabled===!0))||this.makerNote||this.userComment;for(let r of U)this[r].finalizeFilters()}get onlyTiff(){return!is.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of dt)this[e].enabled&&!L.has(e)&&rt("segment parser",e)}}function li(i,e){let t,s,n,r,a=[];for(n of e){for(r of(t=vt.get(n),s=[],t))(i.includes(r[0])||i.includes(r[1]))&&s.push(r[0]);s.length&&a.push([n,s])}return a}function Ge(i,e){return i!==void 0?i:e!==void 0?e:void 0}function xe(i,e){for(let t of e)i.add(t)}F(wt,"default",I);class Nn{constructor(e){F(this,"parsers",{}),F(this,"output",{}),F(this,"errors",[]),F(this,"pushToErrors",(t=>this.errors.push(t))),this.options=wt.useCached(e)}async read(e){this.file=await(function(t,s){return typeof t=="string"?ri(t,s):ge&&!En&&t instanceof HTMLImageElement?ri(t.src,s):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new z(t):ge&&t instanceof Blob?at(t,s,"blob",lt):void N("Invalid input argument")})(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[s,n]of ts)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[s]=!0;this.file.close&&this.file.close(),N("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),es(s=e)?void 0:s;var s}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async s=>{let n=await s.parse();s.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((s=>s.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,s=L.get("tiff",e);var n;if(t.tiff?n={start:0,type:"tiff"}:t.jpeg&&(n=await this.fileParser.getOrFindSegment("tiff")),n===void 0)return;let r=await this.fileParser.ensureSegmentChunk(n),a=this.parsers.tiff=new s(r,e,t),o=await a.extractThumbnail();return t.close&&t.close(),o}}class te{static findPosition(e,t){let s=e.getUint16(t+2)+2,n=typeof this.headerLength=="function"?this.headerLength(e,t,s):this.headerLength,r=t+n,a=s-n;return{offset:t,length:s,headerLength:n,start:r,size:a,end:r+a}}static parse(e,t={}){return new this(e,new wt({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof z?e:new z(e)}constructor(e,t={},s){F(this,"errors",[]),F(this,"raw",new Map),F(this,"handleError",(n=>{if(!this.options.silentErrors)throw n;this.errors.push(n.message)})),this.chunk=this.normalizeInput(e),this.file=s,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 s=Un.get(t),n=On.get(t),r=vt.get(t),a=this.options[t],o=a.reviveValues&&!!s,d=a.translateValues&&!!n,u=a.translateKeys&&!!r,c={};for(let[h,p]of e)o&&s.has(h)?p=s.get(h)(p):d&&n.has(h)&&(p=this.translateValue(p,n.get(h))),u&&r.has(h)&&(h=r.get(h)||h),c[h]=p;return c}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,s){if(this.globalOptions.mergeOutput)return Object.assign(e,s);e[t]?Object.assign(e[t],s):e[t]=s}}F(te,"headerLength",4),F(te,"type",void 0),F(te,"multiSegment",!1),F(te,"canHandle",(()=>!1));function Dn(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function In(i){return i>=224&&i<=239}function xn(i,e,t){for(let[s,n]of L)if(n.canHandle(i,e,t))return s}class di extends class{constructor(e,t,s){F(this,"errors",[]),F(this,"ensureSegmentChunk",(async n=>{let r=n.start,a=n.size||65536;if(this.file.chunked)if(this.file.available(r,a))n.chunk=this.file.subarray(r,a);else try{n.chunk=await this.file.readChunk(r,a)}catch(o){N(`Couldn't read segment: ${JSON.stringify(n)}. ${o.message}`)}else this.file.byteLength>r+a?n.chunk=this.file.subarray(r,a):n.size===void 0?n.chunk=this.file.subarray(r):N("Segment unreachable: "+JSON.stringify(n));return n.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=s}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let s=new(L.get(e))(t,this.options,this.file);return this.parsers[e]=s}createParsers(e){for(let t of e){let{type:s,chunk:n}=t,r=this.options[s];if(r&&r.enabled){let a=this.parsers[s];a&&a.append||a||this.createParser(s,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),F(this,"appSegments",[]),F(this,"jpegSegments",[]),F(this,"unknownSegments",[])}static canHandle(e,t){return t===65496}async parse(){await this.findAppSegments(),await this.readSegments(this.appSegments),this.mergeMultiSegments(),this.createParsers(this.mergedAppSegments||this.appSegments)}setupSegmentFinderArgs(e){e===!0?(this.findAll=!0,this.wanted=new Set(L.keyList())):(e=e===void 0?L.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&L.has(t))),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:s,findAll:n,wanted:r,remaining:a}=this;if(!n&&this.file.chunked&&(n=Array.from(r).some((o=>{let d=L.get(o),u=this.options[o];return d.multiSegment&&u.multiSegment})),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,s.byteLength),!this.options.onlyTiff&&s.chunked){let o=!1;for(;a.size>0&&!o&&(s.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:d}=s,u=this.appSegments.some((c=>!this.file.available(c.offset||c.start,c.length||c.size)));if(o=e>d&&!u?!await s.readNextChunk(e):!await s.readNextChunk(d),(e=this.findAppSegmentsInRange(e,s.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let s,n,r,a,o,d,{file:u,findAll:c,wanted:h,remaining:p,options:f}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(s=u.getUint8(e+1),In(s)){if(n=u.getUint16(e+2),r=xn(u,e,n),r&&h.has(r)&&(a=L.get(r),o=a.findPosition(u,e),d=f[r],o.type=r,this.appSegments.push(o),!c&&(a.multiSegment&&d.multiSegment?(this.unfinishedMultiSegment=o.chunkNumber<o.chunkCount,this.unfinishedMultiSegment||p.delete(r)):p.delete(r),p.size===0)))break;f.recordUnknownSegments&&(o=te.findPosition(u,e),o.marker=s,this.unknownSegments.push(o)),e+=n+1}else if(Dn(s)){if(n=u.getUint16(e+2),s===218&&f.stopAfterSos!==!1)return;f.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:s}),e+=n+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,s){let n,r,a,o=new Map;for(let d=0;d<t.length;d++)n=t[d],r=n[s],o.has(r)?a=o.get(r):o.set(r,a=[]),a.push(n);return Array.from(o)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,s])=>{let n=L.get(t,this.options);return n.handleMultiSegments?{type:t,chunk:n.handleMultiSegments(s)}:s[0]}))}getSegment(e){return this.appSegments.find((t=>t.type===e))}async getOrFindSegment(e){let t=this.getSegment(e);return t===void 0&&(await this.findAppSegments(0,[e]),t=this.getSegment(e)),t}}F(di,"type","jpeg"),ts.set("jpeg",di);const Mn=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Bn extends te{parseHeader(){var e=this.chunk.getUint16();e===18761?this.le=!0:e===19789&&(this.le=!1),this.chunk.le=this.le,this.headerParsed=!0}parseTags(e,t,s=new Map){let{pick:n,skip:r}=this.options[t];n=new Set(n);let a=n.size>0,o=r.size===0,d=this.chunk.getUint16(e);e+=2;for(let u=0;u<d;u++){let c=this.chunk.getUint16(e);if(a){if(n.has(c)&&(s.set(c,this.parseTag(e,c,t)),n.delete(c),n.size===0))break}else!o&&r.has(c)||s.set(c,this.parseTag(e,c,t));e+=12}return s}parseTag(e,t,s){let{chunk:n}=this,r=n.getUint16(e+2),a=n.getUint32(e+4),o=Mn[r];if(o*a<=4?e+=8:e=n.getUint32(e+8),(r<1||r>13)&&N(`Invalid TIFF value type. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e}`),e>n.byteLength&&N(`Invalid TIFF value offset. block: ${s.toUpperCase()}, tag: ${t.toString(16)}, type: ${r}, offset ${e} is outside of chunk size ${n.byteLength}`),r===1)return n.getUint8Array(e,a);if(r===2)return(d=(function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u})(d=n.getString(e,a)).trim())===""?void 0:d;var d;if(r===7)return n.getUint8Array(e,a);if(a===1)return this.parseTagValue(r,e);{let u=new((function(h){switch(h){case 1:return Uint8Array;case 3:return Uint16Array;case 4:return Uint32Array;case 5:return Array;case 6:return Int8Array;case 8:return Int16Array;case 9:return Int32Array;case 10:return Array;case 11:return Float32Array;case 12:return Float64Array;default:return Array}})(r))(a),c=o;for(let h=0;h<a;h++)u[h]=this.parseTagValue(r,e),e+=c;return u}}parseTagValue(e,t){let{chunk:s}=this;switch(e){case 1:return s.getUint8(t);case 3:return s.getUint16(t);case 4:return s.getUint32(t);case 5:return s.getUint32(t)/s.getUint32(t+4);case 6:return s.getInt8(t);case 8:return s.getInt16(t);case 9:return s.getInt32(t);case 10:return s.getInt32(t)/s.getInt32(t+4);case 11:return s.getFloat(t);case 12:return s.getDouble(t);case 13:return s.getUint32(t);default:N(`Invalid tiff type ${e}`)}}}class Ke extends Bn{static canHandle(e,t){return e.getUint8(t+1)===225&&e.getUint32(t+4)===1165519206&&e.getUint16(t+8)===0}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 t.catch!==void 0&&(t=t.catch(this.handleError)),t}findIfd0Offset(){this.ifd0Offset===void 0&&(this.ifd0Offset=this.chunk.getUint32(4))}findIfd1Offset(){if(this.ifd1Offset===void 0){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 s=new Map;return this[t]=s,this.parseTags(e,t,s),s}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&N("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&N(`IFD0 offset points to outside of file.
|
||
this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,si(this.options));let t=this.parseBlock(this.ifd0Offset,"ifd0");return t.size!==0?(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||(this.ifd0||await this.parseIfd0Block(),this.exifOffset===void 0))return;this.file.tiff&&await this.file.ensureChunk(this.exifOffset,si(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 s=e.get(t);s&&s.length===1&&e.set(t,s[0])}async parseGpsBlock(){if(this.gps||(this.ifd0||await this.parseIfd0Block(),this.gpsOffset===void 0))return;let e=this.parseBlock(this.gpsOffset,"gps");return e&&e.has(2)&&e.has(4)&&(e.set("latitude",ui(...e.get(2),e.get(1))),e.set("longitude",ui(...e.get(4),e.get(3)))),e}async parseInteropBlock(){if(!this.interop&&(this.ifd0||await this.parseIfd0Block(),this.interopOffset!==void 0||this.exif||await this.parseExifBlock(),this.interopOffset!==void 0))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),this.ifd1===void 0)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,s,n={};for(t of U)if(e=this[t],!es(e))if(s=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(n,s)}else n[t]=s;return this.makerNote&&(n.makerNote=this.makerNote),this.userComment&&(n.userComment=this.userComment),n}assignToOutput(e,t){if(this.globalOptions.mergeOutput)Object.assign(e,t);else for(let[s,n]of Object.entries(t))this.assignObjectToOutput(e,s,n)}}function ui(i,e,t,s){var n=i+e/60+t/3600;return s!=="S"&&s!=="W"||(n*=-1),n}F(Ke,"type","tiff"),F(Ke,"headerLength",10),L.set("tiff",Ke);const _t={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},_t,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},_t,{tiff:!1,ifd1:!0,mergeOutput:!1});const Rn=Object.assign({},_t,{firstChunkSize:4e4,ifd0:[274]});async function Ln(i){let e=new Nn(Rn);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const zn=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 le=!0,de=!0;if(typeof navigator=="object"){let i=navigator.userAgent;if(i.includes("iPad")||i.includes("iPhone")){let e=i.match(/OS (\d+)_(\d+)/);if(e){let[,t,s]=e;le=Number(t)+.1*Number(s)<13.4,de=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);le=de=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);le=de=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);le=de=Number(e)<77}}async function $n(i){let e=await Ln(i);return Object.assign({canvas:le,css:de},zn[e])}class Hn extends z{constructor(...e){super(...e),F(this,"ranges",new qn),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,s){if(e===0&&this.byteLength===0&&s){let n=new DataView(s.buffer||s,s.byteOffset,s.byteLength);this._swapDataView(n)}else{let n=e+t;if(n>this.byteLength){let{dataView:r}=this._extend(n);this._swapDataView(r)}}}_extend(e){let t;t=Zi?Ji.allocUnsafe(e):new Uint8Array(e);let s=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:s}}subarray(e,t,s=!1){return t=t||this._lengthToEnd(e),s&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,s=!1){s&&this._tryExtend(t,e.byteLength,e);let n=super.set(e,t);return this.ranges.add(t,n.byteLength),n}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 qn{constructor(){F(this,"list",[])}get length(){return this.list.length}add(e,t,s=0){let n=e+t,r=this.list.filter((a=>hi(e,a.offset,n)||hi(e,a.end,n)));if(r.length>0){e=Math.min(e,...r.map((o=>o.offset))),n=Math.max(n,...r.map((o=>o.end))),t=n-e;let a=r.shift();a.offset=e,a.length=t,a.end=n,this.list=this.list.filter((o=>!r.includes(o)))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let s=e+t;return this.list.some((n=>n.offset<=e&&s<=n.end))}}function hi(i,e,t){return i<=e&&e<=t}class jn extends Hn{constructor(e,t){super(0),F(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,s=await this.readChunk(e,t);return!!s&&s.byteLength===t}async readChunk(e,t){if(this.chunksRead++,(t=this.safeWrapAddress(e,t))!==0)return this._readChunk(e,t)}safeWrapAddress(e,t){return this.size!==void 0&&e+t>this.size?Math.max(0,this.size-e):t}get nextChunkOffset(){if(this.ranges.list.length!==0)return this.ranges.list[0].length}get canReadNextChunk(){return this.chunksRead<this.options.chunkLimit}get fullyRead(){return this.size!==void 0&&this.nextChunkOffset===this.size}read(){return this.options.chunked?this.readChunked():this.readWhole()}close(){}}bt.set("blob",class extends jn{async readWhole(){this.chunked=!1;let i=await lt(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}async _readChunk(i,e){let t=e?i+e:void 0,s=this.input.slice(i,t),n=await lt(s);return this.set(n,i,!0)}});const Vn="5.1.0",Wn={version:Vn},Gn={strings:{generatingThumbnails:"Generating thumbnails..."}};function Kn(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(s){if(s.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(s=>{i.toBlob(s,e,t)}).then(s=>{if(s===null)throw new Error("cannot read image, probably an svg with external resources");return s}):Promise.resolve().then(()=>vs(i.toDataURL(e,t),{})).then(s=>{if(s===null)throw new Error("could not extract blob, probably an old browser");return s})}function Xn(i,e){let t=i.width,s=i.height;(e.deg===90||e.deg===270)&&(t=i.height,s=i.width);const n=document.createElement("canvas");n.width=t,n.height=s;const r=n.getContext("2d");return r.translate(t/2,s/2),e.canvas&&(r.rotate(e.rad),r.scale(e.scaleX,e.scaleY)),r.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),n}function Yn(i){const e=i.width/i.height,t=5e6,s=4096;let n=Math.floor(Math.sqrt(t*e)),r=Math.floor(t/Math.sqrt(t*e));if(n>s&&(n=s,r=Math.round(n/e)),r>s&&(r=s,n=Math.round(e*r)),i.width>n){const a=document.createElement("canvas");return a.width=n,a.height=r,a.getContext("2d").drawImage(i,0,0,n,r),a}return i}const Qn={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Jn extends me{static VERSION=Wn.version;queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...Qn,...t}),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,s){if(e.data==null)throw new Error("File data is empty");const n=URL.createObjectURL(e.data),r=new Promise((o,d)=>{const u=new Image;u.src=n,u.addEventListener("load",()=>{URL.revokeObjectURL(n),o(u)}),u.addEventListener("error",c=>{URL.revokeObjectURL(n),d(c.error||new Error("Could not create thumbnail"))})}),a=$n(e.data).catch(()=>1);return Promise.all([r,a]).then(([o,d])=>{const u=this.getProportionalDimensions(o,t,s,d.deg),c=Xn(o,d),h=this.resizeImage(c,u.width,u.height);return Kn(h,this.thumbnailType,80)}).then(o=>URL.createObjectURL(o))}getProportionalDimensions(e,t,s,n){let r=e.width/e.height;if((n===90||n===270)&&(r=e.height/e.width),t!=null){let a=t;return e.width<t&&(a=e.width),{width:a,height:Math.round(a/r)}}if(s!=null){let a=s;return e.height<s&&(a=e.height),{width:Math.round(a*r),height:a}}return{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}}resizeImage(e,t,s){let n=Yn(e),r=Math.ceil(Math.log2(n.width/t));r<1&&(r=1);let a=t*2**(r-1),o=s*2**(r-1);const d=2;for(;r--;){const u=document.createElement("canvas");u.width=a,u.height=o,u.getContext("2d").drawImage(n,0,0,a,o),n=u,a=Math.round(a/d),o=Math.round(o/d)}return n}setPreviewURL(e,t){this.uppy.setFileState(e,{preview:t})}addToQueue(e){this.queue.push(e),this.queueProcessing===!1&&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 It(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()}onFileAdded=e=>{!e.preview&&e.data&&It(e.type)&&!e.isRemote&&this.addToQueue(e.id)};onCancelRequest=e=>{const t=this.queue.indexOf(e.id);t!==-1&&this.queue.splice(t,1)};onFileRemoved=e=>{const t=this.queue.indexOf(e.id);t!==-1&&this.queue.splice(t,1),e.preview&&Dt(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(t=>t.isRestored).forEach(t=>{(!t.preview||Dt(t.preview))&&this.addToQueue(t.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(s=>{const n=this.uppy.getFile(s);this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const t=()=>{e.forEach(s=>{const n=this.uppy.getFile(s);this.uppy.emit("preprocess-complete",n)})};return new Promise(s=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),s()}):(t(),s())})};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)}}let Zn="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",rs=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Zn[Math.random()*64|0];return e};const er="5.1.0",tr={version:er};class as extends W{fileInput=null;folderInput=null;mobilePhotoFileInput=null;mobileVideoFileInput=null;triggerFileInputClick=()=>{this.fileInput?.click()};triggerFolderInputClick=()=>{this.folderInput?.click()};triggerVideoCameraInputClick=()=>{this.mobileVideoFileInput?.click()};triggerPhotoCameraInputClick=()=>{this.mobilePhotoFileInput?.click()};onFileInputChange=e=>{this.props.handleInputChange(e),e.currentTarget.value=""};renderHiddenInput=(e,t)=>l("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,webkitdirectory:e,type:"file",name:"files[]",multiple:this.props.maxNumberOfFiles!==1,onChange:this.onFileInputChange,accept:this.props.allowedFileTypes?.join(", "),ref:t});renderHiddenCameraInput=(e,t,s)=>{const r={photo:"image/*",video:"video/*"}[e];return l("input",{className:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabIndex:-1,type:"file",name:`camera-${e}`,onChange:this.onFileInputChange,capture:t===""?"environment":t,accept:r,ref:s})};renderMyDeviceAcquirer=()=>l("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:l("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,children:[l("div",{className:"uppy-DashboardTab-inner",children:l("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:l("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"})})}),l("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>l("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:l("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,children:[l("div",{className:"uppy-DashboardTab-inner",children:l("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:l("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"})})}),l("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>l("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:l("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,children:[l("div",{className:"uppy-DashboardTab-inner",children:l("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:l("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 "})})}),l("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>{const s=this.props.acquirers.length;return l("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":s===0,children:e})};renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),s=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),n=this.props.fileManagerSelectionType,r=n.charAt(0).toUpperCase()+n.slice(1);return l("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${r}`,{browseFiles:t,browseFolders:s,browse:t}):this.props.i18nArray(`dropPaste${r}`,{browseFiles:t,browseFolders:s,browse:t})})};[Symbol.for("uppy test: disable unused locale key warning")](){this.props.i18nArray("dropPasteBoth"),this.props.i18nArray("dropPasteFiles"),this.props.i18nArray("dropPasteFolders"),this.props.i18nArray("dropPasteImportBoth"),this.props.i18nArray("dropPasteImportFiles"),this.props.i18nArray("dropPasteImportFolders")}renderAcquirer=e=>l("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:l("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":this.props.activePickerPanel?.id===e.id,"data-uppy-super-focusable":!0,onClick:()=>this.props.showPanel(e.id),children:[l("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),l("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{const t=[...e],s=t.splice(e.length-2,e.length);return l(G,{children:[t.map(n=>this.renderAcquirer(n)),l("span",{role:"presentation",style:{"white-space":"nowrap"},children:s.map(n=>this.renderAcquirer(n))})]})};renderSourcesList=(e,t)=>{const{showNativePhotoCameraButton:s,showNativeVideoCameraButton:n}=this.props;let r=[];const a="myDevice";t||r.push({key:a,elements:this.renderMyDeviceAcquirer()}),s&&r.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),n&&r.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),r.push(...e.map(c=>({key:c.id,elements:this.renderAcquirer(c)}))),r.length===1&&r[0].key===a&&(r=[]);const d=[...r],u=d.splice(r.length-2,r.length);return l(G,{children:[this.renderDropPasteBrowseTagline(r.length),l("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[d.map(({key:c,elements:h})=>l(G,{children:h},c)),l("span",{role:"presentation",style:{"white-space":"nowrap"},children:u.map(({key:c,elements:h})=>l(G,{children:h},c))})]})]})};renderPoweredByUppy(){const{i18nArray:e}=this.props,t=l("span",{children:[l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:l("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),l("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]}),s=e("poweredBy",{uppy:t});return l("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:s})}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:s}=this.props;return l("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,n=>{this.fileInput=n}),this.renderHiddenInput(!0,n=>{this.folderInput=n}),e&&this.renderHiddenCameraInput("photo",s,n=>{this.mobilePhotoFileInput=n}),t&&this.renderHiddenCameraInput("video",s,n=>{this.mobileVideoFileInput=n}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),l("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&l("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}const ir=i=>l("div",{className:$("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel,children:[l("div",{className:"uppy-DashboardContent-bar",children:[l("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:i.i18n("addingMoreFiles")}),l("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1),children:i.i18n("back")})]}),l(as,{...i})]});function sr(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return l("div",{className:$("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[l("div",{className:"uppy-DashboardContent-bar",children:[l("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:i.i18nArray("editing",{file:l("span",{className:"uppy-DashboardContent-titleFile",children:e.meta?e.meta.name:e.name})})}),l("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:i.i18n("cancel")}),l("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor,children:i.i18n("save")})]}),l("div",{className:"uppy-DashboardContent-panelBody",children:i.editors.map(s=>i.uppy.getPlugin(s.id).render(i.state))})]})}function nr(){return l("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:l("g",{fill:"#686DE0",fillRule:"evenodd",children:[l("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"}),l("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"}),l("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}function rr(){return l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:l("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"})})}function ar(){return l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:l("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"})})}function or(){return l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:l("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"})})}function lr(){return l("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:l("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"})})}function dr(){return l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:l("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[l("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"}),l("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})}function ur(){return l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:l("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"})})}function Ft(i){const e={color:"#838999",icon:dr()};if(!i)return e;const t=i.split("/")[0],s=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:ur()}:t==="image"?{color:"#686de0",icon:nr()}:t==="audio"?{color:"#068dbb",icon:rr()}:t==="video"?{color:"#19af67",icon:ar()}:t==="application"&&s==="pdf"?{color:"#e25149",icon:or()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(s)!==-1?{color:"#00C469",icon:lr()}:e}function Y(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function os(i){const{file:e}=i;if(e.preview)return l("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:s}=Ft(e.type);return l("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[l("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t},children:s}),l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:l("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function hr(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:s,form:n,formState:r}=i,a={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(o=>{const d=`uppy-Dashboard-FileCard-input-${o.id}`,u=t.includes(o.id);return l("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[l("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:d,children:o.name}),o.render!==void 0?o.render({value:r[o.id],onChange:c=>s(c,o.id),fieldCSSClasses:a,required:u,form:n.id},ct):l("input",{className:a.text,id:d,form:n.id,type:o.type||"text",required:u,value:r[o.id],placeholder:o.placeholder,onInput:c=>s(c.target.value,o.id),"data-uppy-super-focusable":!0})]},o.id)})}function cr(i){const{files:e,fileCardFor:t,toggleFileCard:s,saveFileCard:n,metaFields:r,requiredMetaFields:a,openFileEditor:o,i18n:d,i18nArray:u,className:c,canEditFile:h}=i,p=()=>typeof r=="function"?r(e[t]):r,f=e[t],m=p()??[],y=h(f),v={};m.forEach(_=>{v[_.id]=f.meta[_.id]??""});const[b,g]=ne(v),w=Ie(_=>{_.preventDefault(),n(b,t)},[n,b,t]),E=(_,D)=>{g({...b,[D]:_})},P=()=>{s(!1)},[S]=ne(()=>{const _=document.createElement("form");return _.setAttribute("tabindex","-1"),_.id=rs(),_}),M=ie(null);return De(()=>{const _=M.current?.getRootNode()??document;return _ instanceof Document?_.body.appendChild(S):(_ instanceof ShadowRoot,_.appendChild(S)),S.addEventListener("submit",w),()=>{S.removeEventListener("submit",w),S.parentNode&&S.parentNode.removeChild(S)}},[S,w]),l("div",{className:$("uppy-Dashboard-FileCard",c),"data-uppy-panelType":"FileCard",onDragOver:Y,onDragLeave:Y,onDrop:Y,onPaste:Y,ref:M,children:[l("div",{className:"uppy-DashboardContent-bar",children:[l("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:l("span",{className:"uppy-DashboardContent-titleFile",children:f.meta?f.meta.name:f.name})})}),l("button",{className:"uppy-DashboardContent-back",type:"button",form:S.id,title:d("finishEditingFile"),onClick:P,children:d("cancel")})]}),l("div",{className:"uppy-Dashboard-FileCard-inner",children:[l("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:Ft(f.type).color},children:[l(os,{file:f}),y&&l("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:_=>{w(_),o(f)},children:d("editImage")})]}),l("div",{className:"uppy-Dashboard-FileCard-info",children:l(hr,{computedMetaFields:m,requiredMetaFields:a,updateMeta:E,form:S,formState:b})}),l("div",{className:"uppy-Dashboard-FileCard-actions",children:[l("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:S.id,children:d("saveChanges")}),l("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:P,form:S.id,children:d("cancel")})]})]})]})}function pr(i,e){if(i===e)return!0;if(!i||!e)return!1;const t=Object.keys(i),s=Object.keys(e),n=t.length;if(s.length!==n)return!1;for(let r=0;r<n;r++){const a=t[r];if(i[a]!==e[a]||!Object.prototype.hasOwnProperty.call(e,a))return!1}return!0}function fr(i,e="Copy the URL below"){return new Promise(t=>{const s=document.createElement("textarea");s.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),s.value=i,document.body.appendChild(s),s.select();const n=()=>{document.body.removeChild(s),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(s),t()):n()}catch{return document.body.removeChild(s),n()}})}function mr({file:i,uploadInProgressOrComplete:e,metaFields:t,canEditFile:s,i18n:n,onClick:r}){return!e&&t&&t.length>0||!e&&s(i)?l("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-action uppy-Dashboard-Item-action--edit",type:"button","aria-label":n("editFileWithFilename",{file:i.meta.name}),title:n("editFileWithFilename",{file:i.meta.name}),onClick:()=>r(),children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:l("g",{fillRule:"evenodd",children:[l("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"}),l("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),l("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function gr({i18n:i,onClick:e,file:t}){return l("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--remove",type:"button","aria-label":i("removeFile",{file:t.meta.name}),title:i("removeFile",{file:t.meta.name}),onClick:()=>e(),children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[l("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"}),l("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"})]})})}function yr({file:i,uppy:e,i18n:t}){const s=n=>{fr(i.uploadURL,t("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(t("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>n.target.focus({preventScroll:!0}))};return l("button",{className:"uppy-u-reset uppy-Dashboard-Item-action uppy-Dashboard-Item-action--copyLink",type:"button","aria-label":t("copyLink"),title:t("copyLink"),onClick:n=>s(n),children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:l("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 br(i){const{uppy:e,file:t,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,showLinkToFileUploadResult:a,showRemoveButton:o,i18n:d,toggleFileCard:u,openFileEditor:c}=i;return l("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[l(mr,{i18n:d,file:t,uploadInProgressOrComplete:s,canEditFile:n,metaFields:r,onClick:()=>{r&&r.length>0?u(!0,t.id):c(t)}}),a&&t.uploadURL?l(yr,{file:t,uppy:e,i18n:d}):null,o?l(gr,{i18n:d,file:t,onClick:()=>e.removeFile(t.id)}):null]})}const vr=(i,e)=>(typeof e=="function"?e():e).filter(n=>n.id===i)[0].name;function ls(i){const{file:e,toggleFileCard:t,i18n:s,metaFields:n}=i,{missingRequiredMetaFields:r}=e;if(!r?.length)return null;const a=r.map(o=>vr(o,n)).join(", ");return l("div",{className:"uppy-Dashboard-Item-errorMessage",children:[s("missingRequiredMetaFields",{smart_count:r.length,fields:a})," ",l("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id),children:s("editFile")})]})}const wr=i=>{const{author:e,name:t}=i.file.meta;function s(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return l("div",{className:"uppy-Dashboard-Item-name",title:t,children:Di(t,s())})},_r=i=>{const{author:e}=i.file.meta,t="remote"in i.file?i.file.remote?.providerName:void 0,s="·";return e?l("div",{className:"uppy-Dashboard-Item-author",children:[l("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:Di(e.name,13)}),t?l(G,{children:[` ${s} `,t,` ${s} `]}):null]}):null},Fr=i=>i.file.size&&l("div",{className:"uppy-Dashboard-Item-statusSize",children:J(i.file.size)}),Sr=i=>i.file.isGhost&&l("span",{children:[" • ",l("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0),children:i.i18n("reSelect")})]}),Tr=({file:i,onClick:e})=>i.error?l("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-errorDetails","aria-label":i.error,"data-microtip-position":"bottom","data-microtip-size":"medium",onClick:e,type:"button",children:"?"}):null;function Pr(i){const{file:e,i18n:t,toggleFileCard:s,metaFields:n,toggleAddFilesPanel:r,isSingleFile:a,containerHeight:o,containerWidth:d}=i;return l("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source,children:[l("div",{className:"uppy-Dashboard-Item-fileName",children:[wr({file:e,isSingleFile:a,containerHeight:o,containerWidth:d}),l(Tr,{file:e,onClick:()=>alert(e.error)})]}),l("div",{className:"uppy-Dashboard-Item-status",children:[_r({file:e}),Fr({file:e}),Sr({file:e,toggleAddFilesPanel:r,i18n:t})]}),l(ls,{file:e,i18n:t,toggleFileCard:s,metaFields:n})]})}function Cr(i){const{file:e,i18n:t,toggleFileCard:s,metaFields:n,showLinkToFileUploadResult:r}=i,o=e.preview?"rgba(255, 255, 255, 0.5)":Ft(e.type).color;return l("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:o},children:[r&&e.uploadURL&&l("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name,children:l("span",{hidden:!0,children:e.meta.name})}),l(os,{file:e}),l(ls,{file:e,i18n:t,toggleFileCard:s,metaFields:n})]})}function Er(i){if(!i.isUploaded){if(i.error&&!i.hideRetryButton){i.uppy.retryUpload(i.file.id);return}i.resumableUploads&&!i.hidePauseResumeButton?i.uppy.pauseResume(i.file.id):i.individualCancellation&&!i.hideCancelButton&&i.uppy.removeFile(i.file.id)}}function ci(i){return i.isUploaded?i.i18n("uploadComplete"):i.error?i.i18n("retryUpload"):i.resumableUploads?i.file.isPaused?i.i18n("resumeUpload"):i.i18n("pauseUpload"):i.individualCancellation?i.i18n("cancelUpload"):""}function Xe(i){return l("div",{className:"uppy-Dashboard-Item-progress",children:l("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":ci(i),title:ci(i),onClick:()=>Er(i),children:i.children})})}function Ce({children:i}){return l("svg",{"aria-hidden":"true",focusable:"false",width:"70",height:"70",viewBox:"0 0 36 36",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--circle",children:i})}function Ye({progress:i}){const e=2*Math.PI*15;return l("g",{children:[l("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),l("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":e,"stroke-dashoffset":e-e/100*i})]})}function kr(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?l("div",{className:"uppy-Dashboard-Item-progress",children:l("div",{className:"uppy-Dashboard-Item-progressIndicator",children:l(Ce,{children:[l("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),l("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"})]})})}):i.recoveredState?null:i.error&&!i.hideRetryButton?l(Xe,{...i,children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-Item-progressIcon--retry",width:"28",height:"31",viewBox:"0 0 16 19",children:[l("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),l("path",{d:"M7.9 3H10v2H7.9z"}),l("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),l("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):i.resumableUploads&&!i.hidePauseResumeButton?l(Xe,{...i,children:l(Ce,{children:[l(Ye,{progress:i.file.progress.percentage}),i.file.isPaused?l("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):l("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[l("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),l("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?l(Xe,{...i,children:l(Ce,{children:[l(Ye,{progress:i.file.progress.percentage}),l("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"})]})}):l("div",{className:"uppy-Dashboard-Item-progress",children:l("div",{className:"uppy-Dashboard-Item-progressIndicator",children:l(Ce,{children:l(Ye,{progress:i.file.progress.percentage})})})})}class Ar extends W{componentDidMount(){const{file:e}=this.props;e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!pr(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,s=!!e.progress.uploadComplete&&!t&&!e.error,n=!!e.progress.uploadStarted||!!t,r=e.progress.uploadStarted&&!e.progress.uploadComplete||t,a=e.error||!1,{isGhost:o}=e;let d=(this.props.individualCancellation||!r)&&!s;s&&this.props.showRemoveButtonAfterComplete&&(d=!0);const u=$({"uppy-Dashboard-Item":!0,"is-inprogress":r&&!this.props.recoveredState,"is-processing":t,"is-complete":s,"is-error":!!a,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":o});return l("div",{className:u,id:`uppy_${e.id}`,role:this.props.role,children:[l("div",{className:"uppy-Dashboard-Item-preview",children:[l(Cr,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),l(kr,{uppy:this.props.uppy,file:e,error:a,isUploaded:s,hideRetryButton:this.props.hideRetryButton,hideCancelButton:this.props.hideCancelButton,hidePauseResumeButton:this.props.hidePauseResumeButton,recoveredState:this.props.recoveredState,resumableUploads:this.props.resumableUploads,individualCancellation:this.props.individualCancellation,i18n:this.props.i18n})]}),l("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[l(Pr,{file:e,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}),l(br,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:d,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function Or(i,e){const t=[];let s=[];return i.forEach(n=>{s.length<e?s.push(n):(t.push(s),s=[n])}),s.length&&t.push(s),t}function Ur({id:i,i18n:e,uppy:t,files:s,resumableUploads:n,hideRetryButton:r,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,metaFields:c,isSingleFile:h,toggleFileCard:p,handleRequestThumbnail:f,handleCancelThumbnail:m,recoveredState:y,individualCancellation:v,itemsPerRow:b,openFileEditor:g,canEditFile:w,toggleAddFilesPanel:E,containerWidth:P,containerHeight:S}){const M=b===1?71:200,_=gt(()=>{const B=(x,C)=>Number(s[C].isGhost)-Number(s[x].isGhost),A=Object.keys(s);return y&&A.sort(B),Or(A,b)},[s,b,y]),D=B=>l("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:B.map(A=>l(Ar,{uppy:t,id:i,i18n:e,resumableUploads:n,individualCancellation:v,hideRetryButton:r,hidePauseResumeButton:a,hideCancelButton:o,showLinkToFileUploadResult:d,showRemoveButtonAfterComplete:u,metaFields:c,recoveredState:y,isSingleFile:h,containerWidth:P,containerHeight:S,toggleFileCard:p,handleRequestThumbnail:f,handleCancelThumbnail:m,role:"listitem",openFileEditor:g,canEditFile:w,toggleAddFilesPanel:E,file:s[A]},A))},B[0]);return h?l("div",{class:"uppy-Dashboard-files",children:D(_[0])}):l(Ws,{class:"uppy-Dashboard-files",role:"list",data:_,renderRow:D,rowHeight:M})}const pi=300;class Nr extends W{ref=xs();componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,pi)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,pi)}render(){const{children:e}=this.props;return l("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function Dr(i,e){return Object.assign(i,e)}function Ir(i,e){return i?.key??e}function xr(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=s=>{i.refs[e]=s})}function oe(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const s=Ir(i[t],t.toString(36));e[s]=i[t]}return e}function Mr(i,e){i=i||{},e=e||{};const t=a=>Object.hasOwn(e,a)?e[a]:i[a],s={};let n=[];for(const a in i)Object.hasOwn(e,a)?n.length&&(s[a]=n,n=[]):n.push(a);const r={};for(const a in e){if(Object.hasOwn(s,a))for(let o=0;o<s[a].length;o++){const d=s[a][o];r[s[a][o]]=t(d)}r[a]=t(a)}for(let a=0;a<n.length;a++)r[n[a]]=t(n[a]);return r}const Br=i=>i;class ds extends W{constructor(e,t){super(e,t),this.refs={},this.state={children:oe(X(X(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=oe(X(e.children)||[]),s=this.state.children;this.setState(r=>({children:Mr(r.children,t)}));let n;for(n in t)if(Object.hasOwn(t,n)){const r=s&&Object.hasOwn(s,n);t[n]&&r&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):t[n]&&!r&&!this.currentlyTransitioningKeys[n]&&this.keysToEnter.push(n)}for(n in s)if(Object.hasOwn(s,n)){const r=t&&Object.hasOwn(t,n);s[n]&&!r&&!this.currentlyTransitioningKeys[n]&&this.keysToLeave.push(n)}}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);t!==-1&&this.keysToAbortLeave.splice(t,1)}performAppear(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillAppear?t.componentWillAppear(this._handleDoneAppearing.bind(this,e)):this._handleDoneAppearing(e)}_handleDoneAppearing(e){const t=this.refs[e];t?.componentDidAppear&&t.componentDidAppear(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=oe(X(this.props.children)||[]);(!s||!Object.hasOwn(s,e))&&this.performLeave(e)}performEnter(e){this.currentlyTransitioningKeys[e]=!0;const t=this.refs[e];t?.componentWillEnter?t.componentWillEnter(this._handleDoneEntering.bind(this,e)):this._handleDoneEntering(e)}_handleDoneEntering(e){const t=this.refs[e];t?.componentDidEnter&&t.componentDidEnter(),delete this.currentlyTransitioningKeys[e],this._finishAbort(e);const s=oe(X(this.props.children)||[]);(!s||!Object.hasOwn(s,e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const s=this.refs[e];s?.componentWillLeave?s.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const s=this.refs[e];s?.componentDidLeave&&s.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=oe(X(this.props.children)||[]);if(n&&Object.hasOwn(n,e))this.performEnter(e);else{const r=Dr({},this.state.children);delete r[e],this.setState({children:r})}}render({childFactory:e,transitionLeave:t,transitionName:s,transitionAppear:n,transitionEnter:r,transitionLeaveTimeout:a,transitionEnterTimeout:o,transitionAppearTimeout:d,component:u,...c},{children:h}){const p=Object.entries(h).map(([f,m])=>{if(!m)return;const y=xr(this,f);return Vi(e(m),{ref:y,key:f})}).filter(Boolean);return ct(u,c,p)}}ds.defaultProps={component:"span",childFactory:Br};class fi extends W{render(){const{info:e}=this.props.uppy.getState();return l("div",{className:"uppy uppy-Informer",children:l(ds,{children:e.map(t=>l(Nr,{children:l("p",{role:"alert",children:[t.message," ",t.details&&l("span",{"aria-label":t.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${t.message}
|
||
|
||
${t.details}`),children:"?"})]})},t.message))})})}}function Rr({activePickerPanel:i,className:e,hideAllPanels:t,i18n:s,state:n,uppy:r}){const a=ie(null);return l("div",{className:$("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${i.id}`,onDragOver:Y,onDragLeave:Y,onDrop:Y,onPaste:Y,children:[l("div",{className:"uppy-DashboardContent-bar",children:[l("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:s("importFrom",{name:i.name})}),l("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:s("cancel")})]}),l("div",{ref:a,className:"uppy-DashboardContent-panelBody",children:r.getPlugin(i.id).render(n,a.current)})]})}const q={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Lr(i,e,t,s={}){if(i)return q.STATE_ERROR;if(e)return q.STATE_COMPLETE;if(t)return q.STATE_PAUSED;let n=q.STATE_WAITING;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:o}=s[r[a]];if(o.uploadStarted&&!o.uploadComplete)return q.STATE_UPLOADING;o.preprocess&&n!==q.STATE_UPLOADING&&(n=q.STATE_PREPROCESSING),o.postprocess&&n!==q.STATE_UPLOADING&&n!==q.STATE_PREPROCESSING&&(n=q.STATE_POSTPROCESSING)}return n}function zr({files:i,i18n:e,isAllComplete:t,isAllErrored:s,isAllPaused:n,inProgressNotPausedFiles:r,newFiles:a,processingFiles:o}){switch(Lr(s,t,n,i)){case"uploading":return e("uploadingXFiles",{smart_count:r.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:o.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:a.length});case"complete":return e("uploadComplete");case"error":return e("error")}}function $r(i){const{i18n:e,isAllComplete:t,hideCancelButton:s,maxNumberOfFiles:n,toggleAddFilesPanel:r,uppy:a}=i;let{allowNewUpload:o}=i;return o&&n&&(o=i.totalFileCount<i.maxNumberOfFiles),l("div",{className:"uppy-DashboardContent-bar",children:[!t&&!s?l("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>a.cancelAll(),children:e("cancel")}):l("div",{}),l("div",{className:"uppy-DashboardContent-title",children:l(zr,{...i})}),o?l("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>r(!0),children:[l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:l("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"})}),l("span",{className:"uppy-DashboardContent-addMoreCaption",children:e("addMore")})]}):l("div",{})]})}const ee="uppy-transition-slideDownUp",mi=250;function Ee({children:i}){const[e,t]=ne(null),[s,n]=ne(""),r=ie(),a=ie(),o=ie(),d=Ie(()=>{n(`${ee}-enter`),cancelAnimationFrame(o.current),clearTimeout(a.current),a.current=void 0,o.current=requestAnimationFrame(()=>{n(`${ee}-enter ${ee}-enter-active`),r.current=setTimeout(()=>{n("")},mi)})},[]),u=Ie(()=>{n(`${ee}-leave`),cancelAnimationFrame(o.current),clearTimeout(r.current),r.current=void 0,o.current=requestAnimationFrame(()=>{n(`${ee}-leave ${ee}-leave-active`),a.current=setTimeout(()=>{t(null),n("")},mi)})},[]);return De(()=>{const c=X(i)[0];e!==c&&(c&&!e?d():e&&!c&&!a.current&&u(),t(c))},[i,e,d,u]),De(()=>()=>{clearTimeout(r.current),clearTimeout(a.current),cancelAnimationFrame(o.current)},[]),e?Vi(e,{className:$(s,e.props.className)}):null}const j={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},Hr="·",gi=()=>` ${Hr} `;function qr(i){const{newFiles:e,isUploadStarted:t,recoveredState:s,i18n:n,uploadState:r,isSomeGhost:a,startUpload:o}=i,d=$("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":r===j.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":a}),u=e&&t&&!s?n("uploadXNewFiles",{smart_count:e}):n("uploadXFiles",{smart_count:e});return l("button",{type:"button",className:d,"aria-label":n("uploadXFiles",{smart_count:e}),onClick:o,disabled:a,"data-uppy-super-focusable":!0,children:u})}function jr(i){const{i18n:e,uppy:t}=i;return l("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e("retryUpload"),onClick:()=>t.retryAll().catch(()=>{}),"data-uppy-super-focusable":!0,"data-cy":"retry",children:[l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:l("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"})}),e("retry")]})}function Vr(i){const{i18n:e,uppy:t}=i;return l("button",{type:"button",className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e("cancel"),"aria-label":e("cancel"),onClick:()=>t.cancelAll(),"data-cy":"cancel","data-uppy-super-focusable":!0,children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:l("g",{fill:"none",fillRule:"evenodd",children:[l("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),l("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 Wr(i){const{isAllPaused:e,i18n:t,isAllComplete:s,resumableUploads:n,uppy:r}=i,a=t(e?"resume":"pause");function o(){if(!s){if(!n){r.cancelAll();return}if(e){r.resumeAll();return}r.pauseAll()}}return l("button",{title:a,"aria-label":a,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:o,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:l("g",{fill:"none",fillRule:"evenodd",children:[l("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),l("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function Gr(i){const{i18n:e,doneButtonHandler:t}=i;return l("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--done",onClick:t,"data-uppy-super-focusable":!0,children:e("done")})}function us(){return l("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:l("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 Kr(i){const{progress:e}=i,{value:t,mode:s,message:n}=e;return l("div",{className:"uppy-StatusBar-content",children:[l(us,{}),s==="determinate"?`${Math.round(t*100)}% · `:"",n]})}function Xr(i){const{numUploads:e,complete:t,totalUploadedSize:s,totalSize:n,totalETA:r,i18n:a}=i,o=e>1,d=J(s);return l("div",{className:"uppy-StatusBar-statusSecondary",children:[o&&a("filesUploadedOfTotal",{complete:t,smart_count:e}),l("span",{className:"uppy-StatusBar-additionalInfo",children:[o&&gi(),n!=null?a("dataUploadedOfTotal",{complete:d,total:J(n)}):a("dataUploadedOfUnknown",{complete:d}),gi(),r!=null&&a("xTimeLeft",{time:Us(r)})]})]})}function hs(i){const{i18n:e,complete:t,numUploads:s}=i;return l("div",{className:"uppy-StatusBar-statusSecondary",children:e("filesUploadedOfTotal",{complete:t,smart_count:s})})}function Yr(i){const{i18n:e,newFiles:t,startUpload:s}=i,n=$("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return l("div",{className:"uppy-StatusBar-statusSecondary",children:[l("div",{className:"uppy-StatusBar-statusSecondaryHint",children:e("xMoreFilesAdded",{smart_count:t})}),l("button",{type:"button",className:n,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:s,children:e("upload")})]})}function Qr(i){const{i18n:e,supportsUploadProgress:t,totalProgress:s,hideProgressDetails:n,isUploadStarted:r,isAllComplete:a,isAllPaused:o,newFiles:d,numUploads:u,complete:c,totalUploadedSize:h,totalSize:p,totalETA:f,startUpload:m}=i,y=d&&r;if(!r||a)return null;const v=e(o?"paused":"uploading");function b(){return!o&&!y&&!n?t?l(Xr,{numUploads:u,complete:c,totalUploadedSize:h,totalSize:p,totalETA:f,i18n:e}):l(hs,{i18n:e,complete:c,numUploads:u}):null}return l("div",{className:"uppy-StatusBar-content",title:v,children:[o?null:l(us,{}),l("div",{className:"uppy-StatusBar-status",children:[l("div",{className:"uppy-StatusBar-statusPrimary",children:t&&s!==0?`${v}: ${s}%`:v}),b(),y?l(Yr,{i18n:e,newFiles:d,startUpload:m}):null]})]})}function Jr(i){const{i18n:e}=i;return l("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete"),children:l("div",{className:"uppy-StatusBar-status",children:l("div",{className:"uppy-StatusBar-statusPrimary",children:[l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:l("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),e("complete")]})})})}function Zr(i){const{error:e,i18n:t,complete:s,numUploads:n}=i;function r(){const a=`${t("uploadFailed")}
|
||
|
||
${e}`;alert(a)}return l("div",{className:"uppy-StatusBar-content",title:t("uploadFailed"),children:[l("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:l("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"})}),l("div",{className:"uppy-StatusBar-status",children:[l("div",{className:"uppy-StatusBar-statusPrimary",children:[t("uploadFailed"),l("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:r,type:"button",children:"?"})]}),l(hs,{i18n:t,complete:s,numUploads:n})]})]})}function Qe(i){const e=[];let t="indeterminate",s;for(const{progress:r}of Object.values(i)){const{preprocess:a,postprocess:o}=r;s==null&&(a||o)&&({mode:t,message:s}=a||o),a?.mode==="determinate"&&e.push(a.value),o?.mode==="determinate"&&e.push(o.value)}const n=e.reduce((r,a)=>r+a/e.length,0);return{mode:t,message:s,value:n}}const{STATE_ERROR:yi,STATE_WAITING:ea,STATE_PREPROCESSING:Je,STATE_UPLOADING:ke,STATE_POSTPROCESSING:Ze,STATE_COMPLETE:Ae}=j;function ta({newFiles:i,allowNewUpload:e,isUploadInProgress:t,isAllPaused:s,resumableUploads:n,error:r,hideUploadButton:a=void 0,hidePauseResumeButton:o=!1,hideCancelButton:d=!1,hideRetryButton:u=!1,recoveredState:c,uploadState:h,totalProgress:p,files:f,supportsUploadProgress:m,hideAfterFinish:y=!1,isSomeGhost:v,doneButtonHandler:b=void 0,isUploadStarted:g,i18n:w,startUpload:E,uppy:P,isAllComplete:S,hideProgressDetails:M=void 0,numUploads:_,complete:D,totalSize:B,totalETA:A,totalUploadedSize:x}){function C(){switch(h){case Ze:case Je:{const ve=Qe(f);return ve.mode==="determinate"?ve.value*100:p}case yi:return null;case ke:return m?p:null;default:return p}}function H(){switch(h){case Ze:case Je:{const{mode:ve}=Qe(f);return ve==="indeterminate"}case ke:return!m;default:return!1}}const K=C(),Z=K??100,St=!r&&i&&(!t&&!s||c)&&e&&!a,Tt=!d&&h!==ea&&h!==Ae,Pt=n&&!o&&h===ke,Ct=r&&!S&&!u,Et=b&&h===Ae,fs=$("uppy-StatusBar-progress",{"is-indeterminate":H()}),ms=$("uppy-StatusBar",`is-${h}`,{"has-ghosts":v}),kt=(()=>{switch(h){case Je:case Ze:return l(Kr,{progress:Qe(f)});case Ae:return l(Jr,{i18n:w});case yi:return l(Zr,{error:r,i18n:w,numUploads:_,complete:D});case ke:return l(Qr,{i18n:w,supportsUploadProgress:m,totalProgress:p,hideProgressDetails:M,isUploadStarted:g,isAllComplete:S,isAllPaused:s,newFiles:i,numUploads:_,complete:D,totalUploadedSize:x,totalSize:B,totalETA:A,startUpload:E});default:return null}})();return!(St||Ct||Pt||Tt||Et)&&!kt||h===Ae&&y?null:l("div",{className:ms,children:[l("div",{className:fs,style:{width:`${Z}%`},role:"progressbar","aria-label":`${Z}%`,"aria-valuetext":`${Z}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":K}),kt,l("div",{className:"uppy-StatusBar-actions",children:[St?l(qr,{newFiles:i,isUploadStarted:g,recoveredState:c,i18n:w,isSomeGhost:v,startUpload:E,uploadState:h}):null,Ct?l(jr,{i18n:w,uppy:P}):null,Pt?l(Wr,{isAllPaused:s,i18n:w,isAllComplete:S,resumableUploads:n,uppy:P}):null,Tt?l(Vr,{i18n:w,uppy:P}):null,Et?l(Gr,{i18n:w,doneButtonHandler:b}):null]})]})}const ia=2e3,sa=2e3;function na(i,e,t,s){if(i)return j.STATE_ERROR;if(e)return j.STATE_COMPLETE;if(t)return j.STATE_WAITING;let n=j.STATE_WAITING;const r=Object.keys(s);for(let a=0;a<r.length;a++){const{progress:o}=s[r[a]];if(o.uploadStarted&&!o.uploadComplete)return j.STATE_UPLOADING;o.preprocess&&(n=j.STATE_PREPROCESSING),o.postprocess&&n!==j.STATE_PREPROCESSING&&(n=j.STATE_POSTPROCESSING)}return n}class ra extends W{#e;#t;#n;#i;componentDidMount(){this.#e=performance.now(),this.#t=this.props.uppy.getFiles().reduce((e,t)=>e+(t.progress.bytesUploaded||0),0),this.props.uppy.on("upload",this.#r)}componentWillUnmount(){this.props.uppy.off("upload",this.#r)}#r=()=>{const{recoveredState:e}=this.props.uppy.getState();if(this.#n=null,this.#i=null,e){this.#t=Object.values(e.files).reduce((t,{progress:s})=>t+(s.bytesUploaded||0),0);return}this.#e=performance.now(),this.#t=0};#a(e){if(e.total==null||e.total===0)return null;const t=e.total-e.uploaded;if(t<=0)return null;this.#e??=performance.now();const s=performance.now()-this.#e;if(s===0)return Math.round((this.#i??0)/100)/10;if(this.#t==null)return this.#t=e.uploaded,null;const n=e.uploaded-this.#t;if(this.#t=e.uploaded,n<=0)return Math.round((this.#i??0)/100)/10;const r=n/s;if(!Number.isFinite(r)||r<=0)return null;const a=this.#n==null?r:At(r,this.#n,ia,s);if(!Number.isFinite(a)||a<=0)return null;this.#n=a;const o=t/a;if(!Number.isFinite(o)||o<0)return null;const d=Math.max((this.#i??0)-s,0),u=this.#i==null?o:At(o,d,sa,s);return!Number.isFinite(u)||u<0?null:(this.#i=u,this.#e=performance.now(),Math.round(u/100)/10)}startUpload=()=>{const{recoveredState:e}=this.props.uppy.getState();e?this.props.uppy.emit("restore-confirmed"):this.props.uppy.upload().catch((()=>{}))};render(){const{capabilities:e,files:t,allowNewUpload:s,totalProgress:n,error:r,recoveredState:a}=this.props.uppy.getState(),{newFiles:o,startedFiles:d,completeFiles:u,isUploadStarted:c,isAllComplete:h,isAllPaused:p,isUploadInProgress:f,isSomeGhost:m}=this.props.uppy.getObjectOfFilesPerState(),y=a?Object.values(t):o,v=!!e.resumableUploads,b=e.uploadProgress!==!1;let g=null,w=0;d.every(P=>P.progress.bytesTotal!=null&&P.progress.bytesTotal!==0)?(g=0,d.forEach(P=>{g+=P.progress.bytesTotal||0,w+=P.progress.bytesUploaded||0})):d.forEach(P=>{w+=P.progress.bytesUploaded||0});const E=this.#a({uploaded:w,total:g});return l(ta,{error:r,uploadState:na(r,h,a,t||{}),allowNewUpload:s,totalProgress:n,totalSize:g,totalUploadedSize:w,isAllComplete:h,isAllPaused:p,isUploadStarted:c,isUploadInProgress:f,isSomeGhost:m,recoveredState:a,complete:u.length,newFiles:y.length,numUploads:d.length,totalETA:E,files:t,i18n:this.props.i18n,uppy:this.props.uppy,startUpload:this.startUpload,doneButtonHandler:this.props.doneButtonHandler,resumableUploads:v,supportsUploadProgress:b,hideProgressDetails:this.props.hideProgressDetails,hideUploadButton:this.props.hideUploadButton,hideRetryButton:this.props.hideRetryButton,hidePauseResumeButton:this.props.hidePauseResumeButton,hideCancelButton:this.props.hideCancelButton,hideAfterFinish:this.props.hideAfterFinish})}}const bi=900,vi=700,et=576,wi=330;function aa(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,s=i.containerWidth>et,n=i.containerHeight>wi,r=$({"uppy-Dashboard":!0,"uppy-Dashboard--isDisabled":i.disabled,"uppy-Dashboard--animateOpenClose":i.animateOpenClose,"uppy-Dashboard--isClosing":i.isClosing,"uppy-Dashboard--isDraggingOver":i.isDraggingOver,"uppy-Dashboard--modal":!i.inline,"uppy-size--md":i.containerWidth>et,"uppy-size--lg":i.containerWidth>vi,"uppy-size--xl":i.containerWidth>bi,"uppy-size--height-md":i.containerHeight>wi,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&n});let a=1;i.containerWidth>bi?a=5:i.containerWidth>vi?a=4:i.containerWidth>et&&(a=3);const o=i.showSelectedFiles&&!e,d=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(p=>i.files[p].isGhost).length:0,c=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return l("div",{className:r,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&As(),"aria-hidden":i.inline?"false":i.isHidden,"aria-disabled":i.disabled,"aria-label":i.inline?i.i18n("dashboardTitle"):i.i18n("dashboardWindowTitle"),onPaste:i.handlePaste,onDragOver:i.handleDragOver,onDragLeave:i.handleDragLeave,onDrop:i.handleDrop,children:[l("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),l("div",{className:"uppy-Dashboard-inner",role:i.inline?void 0:"dialog",style:{width:i.inline&&i.width?i.width:"",height:i.inline&&i.height?i.height:""},children:[i.inline?null:l("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal,children:l("span",{"aria-hidden":"true",children:"×"})}),l("div",{className:"uppy-Dashboard-innerWrap",children:[l("div",{className:"uppy-Dashboard-dropFilesHereHint",children:i.i18n("dropHint")}),o&&l($r,{...i}),d!=null&&d>0&&l("div",{className:"uppy-Dashboard-serviceMsg",children:[l("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:l("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[l("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"}),l("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),l("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),l("strong",{className:"uppy-Dashboard-serviceMsg-title",children:i.i18n("sessionRestored")}),l("div",{className:"uppy-Dashboard-serviceMsg-text",children:c()})]}),o?l(Ur,{id:i.id,i18n:i.i18n,uppy:i.uppy,files:i.files,resumableUploads:i.resumableUploads,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,showLinkToFileUploadResult:i.showLinkToFileUploadResult,showRemoveButtonAfterComplete:i.showRemoveButtonAfterComplete,metaFields:i.metaFields,toggleFileCard:i.toggleFileCard,handleRequestThumbnail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:a,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):l(as,{i18n:i.i18n,i18nArray:i.i18nArray,acquirers:i.acquirers,handleInputChange:i.handleInputChange,maxNumberOfFiles:i.maxNumberOfFiles,allowedFileTypes:i.allowedFileTypes,showNativePhotoCameraButton:i.showNativePhotoCameraButton,showNativeVideoCameraButton:i.showNativeVideoCameraButton,nativeCameraFacingMode:i.nativeCameraFacingMode,showPanel:i.showPanel,activePickerPanel:i.activePickerPanel,disableLocalFiles:i.disableLocalFiles,fileManagerSelectionType:i.fileManagerSelectionType,note:i.note,proudlyDisplayPoweredByUppy:i.proudlyDisplayPoweredByUppy}),l(Ee,{children:i.showAddFilesPanel?l(ir,{...i,isSizeMD:s},"AddFiles"):null}),l(Ee,{children:i.fileCardFor?l(cr,{...i},"FileCard"):null}),l(Ee,{children:i.activePickerPanel?l(Rr,{...i},"Picker"):null}),l(Ee,{children:i.showFileEditor?l(sr,{...i},"Editor"):null}),l("div",{className:"uppy-Dashboard-progressindicators",children:[!i.disableInformer&&l(fi,{uppy:i.uppy}),!i.disableStatusBar&&l(ra,{uppy:i.uppy,i18n:i.i18n,hideProgressDetails:i.hideProgressDetails,hideUploadButton:i.hideUploadButton,hideRetryButton:i.hideRetryButton,hidePauseResumeButton:i.hidePauseResumeButton,hideCancelButton:i.hideCancelButton,hideAfterFinish:i.hideProgressAfterFinish,doneButtonHandler:i.doneButtonHandler}),!i.disableInformer&&l(fi,{uppy:i.uppy}),i.progressindicators.map(p=>i.uppy.getPlugin(p.id).render(i.state))]})]})]})]})}const oa={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",uploading:"Uploading",complete:"Complete",uploadFailed:"Upload failed",paused:"Paused",retry:"Retry",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}",dataUploadedOfUnknown:"%{complete} of unknown",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",xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},showErrorDetails:"Show error details"}};function cs(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function la(){let i=!1;return Pn((t,s)=>{const n=cs(t,s),r=n.contains(document.activeElement);if(r&&i)return;const a=n.querySelector("[data-uppy-super-focusable]");r&&!a||(a?(a.focus({preventScroll:!0}),i=!0):(n.querySelector(Pi)?.focus({preventScroll:!0}),i=!1))},260)}function _i(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function da(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function ua(i){return i.contains(document.activeElement)}function ps(i,e,t){const s=cs(t,e),n=ue(s.querySelectorAll(Pi)),r=n.indexOf(document.activeElement);ua(s)?i.shiftKey&&r===0?da(i,n):!i.shiftKey&&r===n.length-1&&_i(i,n):_i(i,n)}function ha(i,e,t){e===null||ps(i,e,t)}const Fi=9,ca=27;function Si(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const pa={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:Cn,showLinkToFileUploadResult:!1,hideProgressDetails:!1,hideUploadButton:!1,hideCancelButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideProgressAfterFinish:!1,note:null,singleFileFullScreen:!0,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,fileManagerSelectionType:"files",proudlyDisplayPoweredByUppy:!0,showSelectedFiles:!0,showRemoveButtonAfterComplete:!1,showNativePhotoCameraButton:!1,showNativeVideoCameraButton:!1,theme:"light",autoOpen:null,disabled:!1,disableLocalFiles:!1,nativeCameraFacingMode:"",onDragLeave:()=>{},onDragOver:()=>{},onDrop:()=>{},plugins:[],doneButtonHandler:void 0,onRequestCloseModal:null,inline:!1,animateOpenClose:!0,browserBackButtonClose:!1,closeAfterFinish:!1,closeModalOnClickOutside:!1,disablePageScrollWhenModalOpen:!0,trigger:null,width:750,height:550};let Fa=class extends me{static VERSION=tr.version;#e;modalName=`uppy-Dashboard-${rs()}`;superFocus=la();ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){const s=t?.autoOpen??null;super(e,{...pa,...t,autoOpen:s}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=oa,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{const s=this.getPluginState().targets.filter(n=>n.id!==e.id);this.setPluginState({targets:s})};addTarget=e=>{const t=e.id||e.constructor.name,s=e.title||t,n=e.type;if(n!=="acquirer"&&n!=="progressindicator"&&n!=="editor")return this.uppy.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const r={id:t,name:s,type:n},o=this.getPluginState().targets.slice();return o.push(r),this.setPluginState({targets:o}),this.el};hideAllPanels=()=>{const e=this.getPluginState(),t={activePickerPanel:void 0,showAddFilesPanel:!1,activeOverlayType:null,fileCardFor:null,showFileEditor:!1};e.activePickerPanel===t.activePickerPanel&&e.showAddFilesPanel===t.showAddFilesPanel&&e.showFileEditor===t.showFileEditor&&e.activeOverlayType===t.activeOverlayType||(this.setPluginState(t),this.uppy.emit("dashboard:close-panel",e.activePickerPanel?.id))};showPanel=e=>{const{targets:t}=this.getPluginState(),s=t.find(n=>n.type==="acquirer"&&n.id===e);this.setPluginState({activePickerPanel:s,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{const{targets:t}=this.getPluginState();return this.#s(t).some(n=>this.uppy.getPlugin(n.id).canEditFile(e))};openFileEditor=e=>{const{targets:t}=this.getPluginState(),s=this.#s(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),s.forEach(n=>{this.uppy.getPlugin(n.id).selectFile(e)})};closeFileEditor=()=>{const{metaFields:e}=this.getPluginState();e&&e.length>0?this.setPluginState({showFileEditor:!1,activeOverlayType:"FileCard"}):this.setPluginState({showFileEditor:!1,fileCardFor:null,activeOverlayType:"AddFiles"})};saveFileEditor=()=>{const{targets:e}=this.getPluginState();this.#s(e).forEach(s=>{this.uppy.getPlugin(s.id).save()}),this.closeFileEditor()};openModal=()=>{const{promise:e,resolve:t}=Si();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 s=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",s,!1),t()};this.el.addEventListener("animationend",s,!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};closeModal=e=>{const t=e?.manualClose??!0,{isHidden:s,isClosing:n}=this.getPluginState();if(s||n)return;const{promise:r,resolve:a}=Si();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const o=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",o,!1),a()};this.el.addEventListener("animationend",o,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),a();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),r};isModalOpen=()=>!this.getPluginState().isHidden||!1;requestCloseModal=()=>this.opts.onRequestCloseModal?this.opts.onRequestCloseModal():this.closeModal();setDarkModeCapability=e=>{const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,darkMode:e}})};handleSystemDarkModeChange=e=>{const t=e.matches;this.uppy.log(`[Dashboard] Dark mode is ${t?"on":"off"}`),this.setDarkModeCapability(t)};toggleFileCard=(e,t)=>{const s=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",s):this.uppy.emit("dashboard:file-edit-complete",s),this.setPluginState({fileCardFor:e?t:null,activeOverlayType:e?"FileCard":null})};toggleAddFilesPanel=e=>{this.setPluginState({showAddFilesPanel:e,activeOverlayType:e?"AddFiles":null})};addFiles=e=>{const t=e.map(s=>({source:this.id,name:s.name,type:s.type,data:s,meta:{relativePath:s.relativePath||s.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}catch(s){this.uppy.log(s)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{const t=e[0],{width:s,height:n}=t.contentRect;this.setPluginState({containerWidth:s,containerHeight:n,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)};stopListeningToResize=()=>{this.resizeObserver.disconnect(),clearTimeout(this.makeDashboardInsidesVisibleAnywayTimeout)};recordIfFocusedOnUppyRecently=e=>{this.el.contains(e.target)?this.ifFocusedOnUppyRecently=!0:(this.ifFocusedOnUppyRecently=!1,this.superFocus.cancel())};disableInteractiveElements=e=>{const t=["a[href]","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])",'[role="button"]:not([disabled])'],s=this.#e??ue(this.el.querySelectorAll(t)).filter(n=>!n.classList.contains("uppy-Dashboard-close"));for(const n of s)n.tagName==="A"?n.setAttribute("aria-disabled",e):n.disabled=e;e?this.#e=s:this.#e=null,this.dashboardIsDisabled=e};updateBrowserHistory=()=>{history.state?.[this.modalName]||history.pushState({...history.state,[this.modalName]:!0},""),window.addEventListener("popstate",this.handlePopState,!1)};handlePopState=e=>{this.isModalOpen()&&(!e.state||!e.state[this.modalName])&&this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state?.[this.modalName]&&history.back()};handleKeyDownInModal=e=>{e.keyCode===ca&&this.requestCloseModal(),e.keyCode===Fi&&ps(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(s=>{s.type==="acquirer"&&s.handleRootPaste?.(e)});const t=ue(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();const t=ue(e.currentTarget.files||[]);t.length>0&&(this.uppy.log("[Dashboard] Files selected through input"),this.addFiles(t))};handleDragOver=e=>{e.preventDefault(),e.stopPropagation();const t=()=>{let a=!0;return this.uppy.iteratePlugins(o=>{o.canHandleRootDrop?.(e)&&(a=!0)}),a},s=()=>{const{types:a}=e.dataTransfer;return a.some(o=>o==="Files")},n=t(),r=s();if(!n&&!r||this.opts.disabled||this.opts.disableLocalFiles&&(r||!n)||!this.uppy.getState().allowNewUpload){e.dataTransfer.dropEffect="none";return}e.dataTransfer.dropEffect="copy",this.setPluginState({isDraggingOver:!0}),this.opts.onDragOver(e)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.opts.onDragLeave(e)};handleDrop=async e=>{e.preventDefault(),e.stopPropagation(),this.setPluginState({isDraggingOver:!1}),this.uppy.iteratePlugins(r=>{r.type==="acquirer"&&r.handleRootDrop?.(e)});let t=!1;const s=r=>{this.uppy.log(r,"error"),t||(this.uppy.info(r.message,"error"),t=!0)};this.uppy.log("[Dashboard] Processing dropped files");const n=await Es(e.dataTransfer,{logDropError:s});n.length>0&&(this.uppy.log("[Dashboard] Files dropped"),this.addFiles(n)),this.opts.onDrop(e)};handleRequestThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:request",e)};handleCancelThumbnail=e=>{this.opts.waitForThumbnailsBeforeUpload||this.uppy.emit("thumbnail:cancel",e)};handleKeyDownInInline=e=>{e.keyCode===Fi&&ha(e,this.getPluginState().activeOverlayType,this.el)};handlePasteOnBody=e=>{this.el.contains(document.activeElement)&&this.handlePaste(e)};handleComplete=({failed:e})=>{this.opts.closeAfterFinish&&!e?.length&&this.requestCloseModal()};#t=()=>{if(this.opts.disableThumbnailGenerator)return;const e=600,t=this.uppy.getFiles();if(t.length===1){const s=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);s?.setOptions({thumbnailWidth:e});const n={...t[0],preview:void 0};s?.requestThumbnail(n).then(()=>{s?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#n=e=>{const t=e[0],{metaFields:s}=this.getPluginState(),n=s&&s.length>0,r=this.canEditFile(t);n&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,t.id):r&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=Ot(this.opts.trigger);e?e.forEach(t=>t.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",this.#l),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",this.#t),this.uppy.on("file-removed",this.#t),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",this.#n)};removeEvents=()=>{const e=Ot(this.opts.trigger);!this.opts.inline&&e&&e.forEach(t=>t.removeEventListener("click",this.openModal)),this.stopListeningToResize(),document.removeEventListener("paste",this.handlePasteOnBody),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-added",this.#l),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",this.#t),this.uppy.off("file-removed",this.#t),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",this.#n)};superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||document.activeElement===null,s=this.uppy.getState().info.length===0,n=!this.opts.inline;s&&(n||e||t&&this.ifFocusedOnUppyRecently)?this.superFocus(this.el,this.getPluginState().activeOverlayType):this.superFocus.cancel()};afterUpdate=()=>{if(this.opts.disabled&&!this.dashboardIsDisabled){this.disableInteractiveElements(!0);return}!this.opts.disabled&&this.dashboardIsDisabled&&this.disableInteractiveElements(!1),this.superFocusOnEachUpdate()};saveFileCard=(e,t)=>{this.uppy.setFileMeta(t,e),this.toggleFileCard(!1,t)};#i=e=>{const t=this.uppy.getPlugin(e.id);return{...e,icon:t.icon||this.opts.defaultPickerIcon,render:t.render}};#r=e=>{const t=this.uppy.getPlugin(e.id);return typeof t.isSupported!="function"?!0:t.isSupported()};#a=e=>e.filter(t=>t.type==="acquirer"&&this.#r(t)).map(this.#i);#o=e=>e.filter(t=>t.type==="progressindicator").map(this.#i);#s=e=>e.filter(t=>t.type==="editor").map(this.#i);render=e=>{const t=this.getPluginState(),{files:s,capabilities:n,allowNewUpload:r}=e,{newFiles:a,uploadStartedFiles:o,completeFiles:d,erroredFiles:u,inProgressFiles:c,inProgressNotPausedFiles:h,processingFiles:p,isUploadStarted:f,isAllComplete:m,isAllPaused:y}=this.uppy.getObjectOfFilesPerState(),v=this.#a(t.targets),b=this.#o(t.targets),g=this.#s(t.targets);let w;return this.opts.theme==="auto"?w=n.darkMode?"dark":"light":w=this.opts.theme,["files","folders","both"].indexOf(this.opts.fileManagerSelectionType)<0&&(this.opts.fileManagerSelectionType="files",console.warn(`Unsupported option for "fileManagerSelectionType". Using default of "${this.opts.fileManagerSelectionType}".`)),aa({state:e,isHidden:t.isHidden,files:s,newFiles:a,uploadStartedFiles:o,completeFiles:d,erroredFiles:u,inProgressFiles:c,inProgressNotPausedFiles:h,processingFiles:p,isUploadStarted:f,isAllComplete:m,isAllPaused:y,totalFileCount:Object.keys(s).length,totalProgress:e.totalProgress,allowNewUpload:r,acquirers:v,theme:w,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:b,editors:g,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:n.resumableUploads||!1,individualCancellation:n.individualCancellation,isMobileDevice:n.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,showRemoveButtonAfterComplete:this.opts.showRemoveButtonAfterComplete,containerWidth:t.containerWidth,containerHeight:t.containerHeight,areInsidesReadyToBeVisible:t.areInsidesReadyToBeVisible,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,handleRequestThumbnail:this.handleRequestThumbnail,handleCancelThumbnail:this.handleCancelThumbnail,isDraggingOver:t.isDraggingOver,handleDragOver:this.handleDragOver,handleDragLeave:this.handleDragLeave,handleDrop:this.handleDrop,disableInformer:this.opts.disableInformer,disableStatusBar:this.opts.disableStatusBar,hideProgressDetails:this.opts.hideProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideProgressAfterFinish:this.opts.hideProgressAfterFinish,doneButtonHandler:this.opts.doneButtonHandler})};#h=()=>{const{plugins:e}=this.opts;e.forEach(t=>{const s=this.uppy.getPlugin(t);s?s.mount(this,s):this.uppy.log(`[Uppy] Dashboard could not find plugin '${t}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#g=()=>{this.uppy.iteratePlugins(this.#l)};#l=e=>{const t=["acquirer","editor"];e&&!e.opts?.target&&t.includes(e.type)&&(this.getPluginState().targets.some(n=>e.id===n.id)||e.mount(this,e))};#c(){const{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:s,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:s,waitForThumbnailsBeforeUpload:n,lazy:!n}}setOptions(e){super.setOptions(e),this.uppy.getPlugin(this.#d())?.setOptions(this.#c())}#d(){return`${this.id}:ThumbnailGenerator`}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:s,allowMultipleUploadBatches:n}=this.uppy.opts;(s||n)&&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:r}=this.opts;r&&this.mount(r,this),this.opts.disableThumbnailGenerator||this.uppy.use(Jn,{id:this.#d(),...this.#c()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const a=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;this.uppy.log(`[Dashboard] Dark mode is ${a?"on":"off"}`),this.setDarkModeCapability(a),this.opts.theme==="auto"&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#h(),this.#g(),this.initEvents()};uninstall=()=>{if(!this.opts.disableThumbnailGenerator){const t=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);t&&this.uppy.removePlugin(t)}const{plugins:e}=this.opts;e.forEach(t=>{const s=this.uppy.getPlugin(t);s&&s.unmount()}),this.opts.theme==="auto"&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}};export{Fa as D,Yi as U};
|