1import{g as fe,c as be}from"./index-CYiPTCqs.js";function Ft(i,e){return Object.hasOwn(i,e)}const js=/^data:([^/]+\/[^,;]+(?:[^,]*?))(;base64)?,([\s\S]*)$/;function Hs(i,e,t){const r=js.exec(i),n=e.mimeType??r?.[1]??"plain/text";let s;if(r?.[2]!=null){const o=atob(decodeURIComponent(r[3])),a=new Uint8Array(o.length);for(let l=0;l<o.length;l++)a[l]=o.charCodeAt(l);s=[a]}else r?.[3]!=null&&(s=[decodeURIComponent(r[3])]);return new Blob(s,{type:n})}function Wi(i,e,t,r){return i===e?i:r===0?e:i+(e-i)*2**(-r/t)}const En=['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])'];class mt extends Error{cause;isNetworkError;request;constructor(e,t=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=e,this.isNetworkError=!0,this.request=t}}class Vs{#e;#t=!1;#r;#i;constructor(e,t){this.#i=e,this.#r=()=>t(e)}progress(){this.#t||this.#i>0&&(clearTimeout(this.#e),this.#e=setTimeout(this.#r,this.#i))}done(){this.#t||(clearTimeout(this.#e),this.#e=void 0,this.#t=!0)}}const Ye=()=>{};function Ws(i,e={}){const{body:t=null,headers:r={},method:n="GET",onBeforeRequest:s=Ye,onUploadProgress:o=Ye,shouldRetry:a=()=>!0,onAfterResponse:l=Ye,onTimeout:u=Ye,responseType:c,retries:h=3,signal:v=null,timeout:w=3e4,withCredentials:S=!1}=e,P=f=>.3*2**(f-1)*1e3,E=new Vs(w,u);function _(f=0){return new Promise(async(y,F)=>{const b=new XMLHttpRequest,k=x=>{a(b)&&f<h?setTimeout(()=>{_(f+1).then(y,F)},P(f)):(E.done(),F(x))};b.open(n,i,!0),b.withCredentials=S,c&&(b.responseType=c),b.onload=async()=>{try{await l(b,f)}catch(x){x.request=b,k(x);return}b.status>=200&&b.status<300?(E.done(),y(b)):a(b)&&f<h?setTimeout(()=>{_(f+1).then(y,F)},P(f)):(E.done(),F(new mt(b.statusText,b)))},b.onerror=()=>k(new mt(b.statusText,b)),b.upload.onprogress=x=>{E.progress(),o(x)},r&&Object.keys(r).forEach(x=>{b.setRequestHeader(x,r[x])});function A(){b.abort(),F(new DOMException("Aborted","AbortError"))}if(v?.addEventListener("abort",A),v?.aborted){A();return}await s(b,f),b.send(t)})}return _()}const Gs=i=>"error"in i&&!!i.error,Ks=i=>i.progress.uploadComplete;function Un(i){return i.filter(e=>!Gs(e)&&!Ks(e))}function Cn(i){return i.filter(e=>!e.progress?.uploadStarted||!e.isRestored)}function On(i){return typeof i!="object"||i===null||!("nodeType"in i)?!1:i.nodeType===Node.ELEMENT_NODE}function Gi(i){if(typeof i=="string"){const e=document.querySelectorAll(i);return e.length===0?null:Array.from(e)}return typeof i=="object"&&On(i)?[i]:null}function Xs(i,e=document){return typeof i=="string"?e.querySelector(i):On(i)?i:null}function kn(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 Ki={__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 xn(i){if(i.type)return i.type;const e=i.name?kn(i.name).extension?.toLowerCase():null;return e&&e in Ki?Ki[e]:"application/octet-stream"}
1function Ys(i){return i.charCodeAt(0).toString(32)}function Xi(i){let e="";return i.replace(/[^A-Z0-9]/gi,t=>(e+=`-${Ys(t)}`,"/"))+e}function Js(i,e){let t=e||"uppy";return typeof i.name=="string"&&(t+=`-${Xi(i.name.toLowerCase())}`),i.type!==void 0&&(t+=`-${i.type}`),i.meta&&typeof i.meta.relativePath=="string"&&(t+=`-${Xi(i.meta.relativePath.toLowerCase())}`),i.data?.size!==void 0&&(t+=`-${i.data.size}`),i.data.lastModified!==void 0&&(t+=`-${i.data.lastModified}`),t}function Qs(i){return!i.isRemote||!i.remote?!1:new Set(["box","dropbox","drive","facebook","unsplash"]).has(i.remote.provider)}function Zs(i,e){if(Qs(i))return i.id;const t=xn(i);return Js({...i,type:t},e)}function oi(i,e){return i===!0?Object.keys(e):Array.isArray(i)?i:[]}const Re=Array.from;function eo(i){const e=Re(i.files);return Promise.resolve(e)}function An(i,e,t,{onSuccess:r}){i.readEntries(n=>{const s=[...e,...n];n.length?queueMicrotask(()=>{An(i,s,t,{onSuccess:r})}):r(s)},n=>{t(n),r(e)})}function Rn(i,e){return i==null?i:{kind:i.isFile?"file":i.isDirectory?"directory":void 0,name:i.name,getFile(){return new Promise((t,r)=>i.file(t,r))},async*values(){const t=i.createReader();yield*await new Promise(n=>{An(t,[],e,{onSuccess:s=>n(s.map(o=>Rn(o,e)))})})},isSameEntry:void 0}}async function*Nn(i,e,t=void 0){const r=()=>`${e}/${i.name}`;if(i.kind==="file"){const n=await i.getFile();n!=null?(n.relativePath=e?r():null,yield n):t!=null&&(yield t)}else if(i.kind==="directory")for await(const n of i.values())yield*Nn(n,e?r():i.name);else t!=null&&(yield t)}async function*to(i,e){const t=await Promise.all(Array.from(i.items,async r=>{let n;return n??=Rn(typeof r.getAsEntry=="function"?r.getAsEntry():r.webkitGetAsEntry(),e),{fileSystemHandle:n,lastResortFile:r.getAsFile()}}));for(const{lastResortFile:r,fileSystemHandle:n}of t)if(n!=null)try{yield*Nn(n,"",r)}catch(s){r!=null?yield r:e(s)}else r!=null&&(yield r)}async function io(i,e){const t=e?.logDropError??Function.prototype;try{const r=[];for await(const n of to(i,t))r.push(n);return r}catch{return eo(i)}}function ro(i){for(;i&&!i.dir;)i=i.parentNode;return i?.dir}function Pt(i){return i<10?`0${i}`:i.toString()}function dt(){const i=new Date,e=Pt(i.getHours()),t=Pt(i.getMinutes()),r=Pt(i.getSeconds());return`${e}:${t}:${r}`}function no(){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 In(i){return i?i.readyState===4&&i.status===0:!1}function Yi(i){return i.startsWith("blob:")}function Ji(i){return i?/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(i):!1}function so(i){const e=Math.floor(i/3600)%24,t=Math.floor(i/60)%60,r=Math.floor(i%60);return{hours:e,minutes:t,seconds:r}}function oo(i){const e=so(i),t=e.hours===0?"":`${e.hours}h`,r=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}${r}${n}`}function ao(i){return new Error("Cancelled",{cause:i})}function Qi(i){if(i!=null){const e=()=>this.abort(i.reason);i.addEventListener("abort",e,{once:!0});const t=()=>{i.removeEventListener("abort",e)};this.then?.(t,t)}return this}class Dn{#e=0;#t=[];#r=!1;#i;#n=1;#s;#a;limit;constructor(e){typeof e!="number"||e===0?this.limit=1/0:this.limit=e}#o(e){this.#e+=1;let t=!1,r;try{r=e()}catch(n){throw this.#e-=1,n}return{abort:n=>{t||(t=!0,this.#e-=1,r?.(n),this.#l())},done:()=>{t||(t=!0,this.#e-=1,this.#l())}}}#l(){queueMicrotask(()=>this.#p())}#p(){if(this.#r||this.#e>=this.limit||this.#t.length===0)return;const e=this.#t.shift();if(e==null)throw new Error("Invariant violation: next is null");const t=this.#o(e.fn);e.abort=t.abort,e.done=t.done}#u(e,t){const r={fn:e,priority:t?.priority||0,abort:()=>{this.#c(r)},done:()=>{throw new Error("Cannot mark a queued request as done: this indicates a bug")}},n=this.#t.findIndex(s=>r.priority>s.priority);return n===-1?this.#t.push(r):this.#t.splice(n,0,r),r}#c(e){const t=this.#t.indexOf(e);t!==-1&&this.#t.splice(t,1)}run(e,t){return!this.#r&&this.#e<this.limit?this.#o(e):this.#u(e,t)}wrapSyncFunction(e,t){return(...r)=>{const n=this.run(()=>(e(...r),queueMicrotask(()=>n.done()),()=>{}),t);return{abortOn:Qi,abort(){n.abort()}}}}wrapPromiseFunction(e,t){return(...r)=>{let n;const s=new Promise((o,a)=>{n=this.run(()=>{let l,u;try{u=Promise.resolve(e(...r))}catch(c){u=Promise.reject(c)}return u.then(c=>{l?a(l):(n.done(),o(c))},c=>{l?a(l):(n.done(),a(c))}),c=>{l=ao(c)}},t)});return s.abort=o=>{n.abort(o)},s.abortOn=Qi,s}}resume(){this.#r=!1,clearTimeout(this.#i);for(let e=0;e<this.limit;e++)this.#l()}#d=()=>this.resume();pause(e=null){this.#r=!0,clearTimeout(this.#i),e!=null&&(this.#i=setTimeout(this.#d,e))}rateLimit(e){clearTimeout(this.#a),this.pause(e),this.limit>1&&Number.isFinite(this.limit)&&(this.#s=this.limit-1,this.limit=this.#n,this.#a=setTimeout(this.#h,e))}#h=()=>
vendor: 6,984 bytes, line 1
1{if(this.#r){this.#a=setTimeout(this.#h,0);return}this.#n=this.limit,this.limit=Math.ceil((this.#s+this.#n)/2);for(let e=this.#n;e<=this.limit;e++)this.#l();this.#s-this.#n>3?this.#a=setTimeout(this.#h,2e3):this.#n=Math.floor(this.#n/2)};get isPaused(){return this.#r}}const Tt=Symbol("__queue");function lo(i,e,t){const r=[];return i.forEach(n=>typeof n!="string"?r.push(n):e[Symbol.split](n).forEach((s,o,a)=>{s!==""&&r.push(s),o<a.length-1&&r.push(t)})),r}function Zi(i,e){const t=/\$/g,r="$$$$";let n=[i];if(e==null)return n;for(const s of Object.keys(e))if(s!=="_"){let o=e[s];typeof o=="string"&&(o=t[Symbol.replace](o,r)),n=lo(n,new RegExp(`%\\{${s}\\}`,"g"),o)}return n}const uo=i=>{throw new Error(`missing string: ${i}`)};class Bn{locale;constructor(e,{onMissingKey:t=uo}={}){this.locale={strings:{},pluralize(r){return r===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 r=this.locale.strings[e];if(r==null&&(this.#e(e),r=e),typeof r=="object"){if(t&&typeof t.smart_count<"u"){const s=this.locale.pluralize(t.smart_count);return Zi(r[s],t)}throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if(typeof r!="string")throw new Error("string was not a string");return Zi(r,t)}}const Et="...";function Mn(i,e){if(e===0)return"";if(i.length<=e)return i;if(e<=Et.length+1)return`${i.slice(0,e-1)}â¦`;const t=e-Et.length,r=Math.ceil(t/2),n=Math.floor(t/2);return i.slice(0,r)+Et+i.slice(-n)}var Ge,$,Ln,de,er,$n,zn,qn,Ei,ai,li,Ie={},jn=[],co=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ke=Array.isArray;function se(i,e){for(var t in e)i[t]=e[t];return i}function Ui(i){i&&i.parentNode&&i.parentNode.removeChild(i)}function Ci(i,e,t){var r,n,s,o={};for(s in e)s=="key"?r=e[s]:s=="ref"?n=e[s]:o[s]=e[s];if(arguments.length>2&&(o.children=arguments.length>3?Ge.call(arguments,2):t),typeof i=="function"&&i.defaultProps!=null)for(s in i.defaultProps)o[s]===void 0&&(o[s]=i.defaultProps[s]);return Ne(i,o,r,n,null)}function Ne(i,e,t,r,n){var s={type:i,props:e,key:t,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++Ln,__i:-1,__u:0};return n==null&&$.vnode!=null&&$.vnode(s),s}function ho(){return{current:null}}function ae(i){return i.children}function oe(i,e){this.props=i,this.context=e}function Fe(i,e){if(e==null)return i.__?Fe(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"?Fe(i):null}function Hn(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 Hn(i)}}function tr(i){(!i.__d&&(i.__d=!0)&&de.push(i)&&!gt.__r++||er!=$.debounceRendering)&&((er=$.debounceRendering)||$n)(gt)}function gt(){for(var i,e,t,r,n,s,o,a=1;de.length;)de.length>a&&de.sort(zn),i=de.shift(),a=de.length,i.__d&&(t=void 0,r=void 0,n=(r=(e=i).__v).__e,s=[],o=[],e.__P&&((t=se({},r)).__v=r.__v+1,$.vnode&&$.vnode(t),Oi(e.__P,t,r,e.__n,e.__P.namespaceURI,32&r.__u?[n]:null,s,n??Fe(r),!!(32&r.__u),o),t.__v=r.__v,t.__.__k[t.__i]=t,Gn(s,t,o),r.__e=r.__=null,t.__e!=n&&Hn(t)));gt.__r=0}function Vn(i,e,t,r,n,s,o,a,l,u,c){var h,v,w,S,P,E,_,f=r&&r.__k||jn,y=e.length;for(l=po(t,e,f,l,y),h=0;h<y;h++)(w=t.__k[h])!=null&&(v=w.__i==-1?Ie:f[w.__i]||Ie,w.__i=h,E=Oi(i,w,v,n,s,o,a,l,u,c),S=w.__e,w.ref&&v.ref!=w.ref&&(v.ref&&ki(v.ref,null,w),c.push(w.ref,w.__c||S,w)),P==null&&S!=null&&(P=S),(_=!!(4&w.__u))||v.__k===w.__k?l=Wn(w,l,i,_):typeof w.type=="function"&&E!==void 0?l=E:S&&(l=S.nextSibling),w.__u&=-7);return t.__e=P,l}function po(i,e,t,r,n){var s,o,a,l,u,c=t.length,h=c,v=0;for(i.__k=new Array(n),s=0;s<n;s++)(o=e[s])!=null&&typeof o!="boolean"&&typeof o!="function"?(typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?o=i.__k[s]=Ne(null,o,null,null,null):Ke(o)?o=i.__k[s]=Ne(ae,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?o=i.__k[s]=Ne(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):i.__k[s]=o,l=s+v,o.__=i,o.__b=i.__b+1,a=null,(u=o.__i=fo(o,t,l,h))!=-1&&(h--,(a=t[u])&&(a.__u|=2)),a==null||a.__v==null?(u==-1&&(n>c?v--:n<c&&v++),typeof o.type!="function"&&(o.__u|=4)):u!=l&&(u==l-1?v--:u==l+1?v++:(u>l?v--:v++,o.__u|=4))):i.__k[s]=null;if(h)for(s=0;s<c;s++)(a=t[s])!=null&&(2&a.__u)==0&&(a.__e==r&&(r=Fe(a)),Xn(a,a));return r}function Wn(i,e,t,r){var n,s;if(typeof i.type=="function"){for(n=i.__k,s=0;n&&s<n.length;s++)n[s]&&(n[s].__=i,e=Wn(n[s],e,t,r));return e}i.__e!=e&&(r&&(e&&i.type&&!e.parentNode&&(e=Fe(i)),t.insertBefore(i.__e,e||null)),e=i.__e);do e=e&&e.nextSibling;while(e!=null&&e.nodeType==8);return e}function le(i,e){return e=e||[],i==null||typeof i=="boolean"||(Ke(i)?i.some(function(t){le(t,e)}):e.push(i)),e}function fo(i,e,t,r){var n,s,o,a=i.key,l=i.type,u=e[t],c=u!=null&&(2&u.__u)==0;if(u===null&&a==null||c&&a==u.key&&l==u.type)return t;if(r>(c?1:0)){for(n=t-1,s=t+1;n>=0||s<e.length;)if((u=e[o=n>=0?n--:s++])!=null&&(2&u.__u)==0&&a==u.key&&l==u.type)return o}return-1}function ir(i,e,t){e[0]=="-"?i.setProperty(e,t??""):i[e]=t==null?"":typeof t!="number"||co.test(e)?t:t+"px"}function Je(i,e,t,r,n){var s,o;e:if(e=="style")if(typeof t=="string")i.style.cssText=t;else{if(typeof r=="string"&&(i.style.cssText=r=""),r)for(e in r)t&&e in t||ir(i.style,e,"");if(t)for(e in t)r&&t[e]==r[e]||ir(i.style,e,t[e])}else if(e[0]=="o"&&e[1]=="n")s=e!=(e=e.replace(qn,"$1")),o=e.toLowerCase(),e=o in i||e=="onFocusOut"||e=="onFocusIn"?o.slice(2):e.slice(2),i.l||(i.l={}),i.l[e+s]=t,t?r?t.u=r.u:(t.u=Ei,i.addEventListener(e,s?li:ai,s)):i.removeEventListener(e,s?li:ai,s);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 rr(i){return function(e){if(this.l){var t=this.l[e.type+i];if(e.t==null)e.t=Ei++;else if(e.t<t.u)return;return t($.event?$.event(e):e)}}}function Oi(i,e,t,r,n,s,o,a,l,u){var c,h,v,w,S,P,E,_,f,y,F,b,k,A,x,R,L,B=e.type;if(e.constructor!==void 0)return null;128&t.__u&&(l=!!(32&t.__u),s=[a=e.__e=t.__e]),(c=$.__b)&&c(e);e:if(typeof B=="function")try{if(_=e.props,f="prototype"in B&&B.prototype.render,y=(c=B.contextType)&&r[c.__c],F=c?y?y.props.value:c.__:r,t.__c?E=(h=e.__c=t.__c).__=h.__E:(f?e.__c=h=new B(_,F):(e.__c=h=new oe(_,F),h.constructor=B,h.render=go),y&&y.sub(h),h.state||(h.state={}),h.__n=r,v=h.__d=!0,h.__h=[],h._sb=[]),f&&h.__s==null&&(h.__s=h.state),f&&B.getDerivedStateFromProps!=null&&(h.__s==h.state&&(h.__s=se({}
vendor: 4,334 bytes, line 1
1,h.__s)),se(h.__s,B.getDerivedStateFromProps(_,h.__s))),w=h.props,S=h.state,h.__v=e,v)f&&B.getDerivedStateFromProps==null&&h.componentWillMount!=null&&h.componentWillMount(),f&&h.componentDidMount!=null&&h.__h.push(h.componentDidMount);else{if(f&&B.getDerivedStateFromProps==null&&_!==w&&h.componentWillReceiveProps!=null&&h.componentWillReceiveProps(_,F),e.__v==t.__v||!h.__e&&h.shouldComponentUpdate!=null&&h.shouldComponentUpdate(_,h.__s,F)===!1){for(e.__v!=t.__v&&(h.props=_,h.state=h.__s,h.__d=!1),e.__e=t.__e,e.__k=t.__k,e.__k.some(function(q){q&&(q.__=e)}),b=0;b<h._sb.length;b++)h.__h.push(h._sb[b]);h._sb=[],h.__h.length&&o.push(h);break e}h.componentWillUpdate!=null&&h.componentWillUpdate(_,h.__s,F),f&&h.componentDidUpdate!=null&&h.__h.push(function(){h.componentDidUpdate(w,S,P)})}if(h.context=F,h.props=_,h.__P=i,h.__e=!1,k=$.__r,A=0,f){for(h.state=h.__s,h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),x=0;x<h._sb.length;x++)h.__h.push(h._sb[x]);h._sb=[]}else do h.__d=!1,k&&k(e),c=h.render(h.props,h.state,h.context),h.state=h.__s;while(h.__d&&++A<25);h.state=h.__s,h.getChildContext!=null&&(r=se(se({},r),h.getChildContext())),f&&!v&&h.getSnapshotBeforeUpdate!=null&&(P=h.getSnapshotBeforeUpdate(w,S)),R=c,c!=null&&c.type===ae&&c.key==null&&(R=Kn(c.props.children)),a=Vn(i,Ke(R)?R:[R],e,t,r,n,s,o,a,l,u),h.base=e.__e,e.__u&=-161,h.__h.length&&o.push(h),E&&(h.__E=h.__=null)}catch(q){if(e.__v=null,l||s!=null)if(q.then){for(e.__u|=l?160:128;a&&a.nodeType==8&&a.nextSibling;)a=a.nextSibling;s[s.indexOf(a)]=null,e.__e=a}else{for(L=s.length;L--;)Ui(s[L]);ui(e)}else e.__e=t.__e,e.__k=t.__k,q.then||ui(e);$.__e(q,e,t)}else s==null&&e.__v==t.__v?(e.__k=t.__k,e.__e=t.__e):a=e.__e=mo(t.__e,e,t,r,n,s,o,l,u);return(c=$.diffed)&&c(e),128&e.__u?void 0:a}function ui(i){i&&i.__c&&(i.__c.__e=!0),i&&i.__k&&i.__k.forEach(ui)}function Gn(i,e,t){for(var r=0;r<t.length;r++)ki(t[r],t[++r],t[++r]);$.__c&&$.__c(e,i),i.some(function(n){try{i=n.__h,n.__h=[],i.some(function(s){s.call(n)})}catch(s){$.__e(s,n.__v)}})}function Kn(i){return typeof i!="object"||i==null||i.__b&&i.__b>0?i:Ke(i)?i.map(Kn):se({},i)}function mo(i,e,t,r,n,s,o,a,l){var u,c,h,v,w,S,P,E=t.props||Ie,_=e.props,f=e.type;if(f=="svg"?n="http://www.w3.org/2000/svg":f=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),s!=null){for(u=0;u<s.length;u++)if((w=s[u])&&"setAttribute"in w==!!f&&(f?w.localName==f:w.nodeType==3)){i=w,s[u]=null;break}}if(i==null){if(f==null)return document.createTextNode(_);i=document.createElementNS(n,f,_.is&&_),a&&($.__m&&$.__m(e,s),a=!1),s=null}if(f==null)E===_||a&&i.data==_||(i.data=_);else{if(s=s&&Ge.call(i.childNodes),!a&&s!=null)for(E={},u=0;u<i.attributes.length;u++)E[(w=i.attributes[u]).name]=w.value;for(u in E)if(w=E[u],u!="children"){if(u=="dangerouslySetInnerHTML")h=w;else if(!(u in _)){if(u=="value"&&"defaultValue"in _||u=="checked"&&"defaultChecked"in _)continue;Je(i,u,null,w,n)}}for(u in _)w=_[u],u=="children"?v=w:u=="dangerouslySetInnerHTML"?c=w:u=="value"?S=w:u=="checked"?P=w:a&&typeof w!="function"||E[u]===w||Je(i,u,w,E[u],n);if(c)a||h&&(c.__html==h.__html||c.__html==i.innerHTML)||(i.innerHTML=c.__html),e.__k=[];else if(h&&(i.innerHTML=""),Vn(e.type=="template"?i.content:i,Ke(v)?v:[v],e,t,r,f=="foreignObject"?"http://www.w3.org/1999/xhtml":n,s,o,s?s[0]:t.__k&&Fe(t,0),a,l),s!=null)for(u=s.length;u--;)Ui(s[u]);a||(u="value",f=="progress"&&S==null?i.removeAttribute("value"):S!=null&&(S!==i[u]||f=="progress"&&!S||f=="option"&&S!=E[u])&&Je(i,u,S,E[u],n),u="checked",P!=null&&P!=i[u]&&Je(i,u,P,E[u],n))}return i}function ki(i,e,t){try{if(typeof i=="function"){var r=typeof i.__u=="function";r&&i.__u(),r&&e==null||(i.__u=i(e))}else i.current=e}catch(n){$.__e(n,t)}}function Xn(i,e,t){var r,n;if($.unmount&&$.unmount(i),(r=i.ref)&&(r.current&&r.current!=i.__e||ki(r,null,e)),(r=i.__c)!=null){if(r.componentWillUnmount)try{r.componentWillUnmount()}catch(s){$.__e(s,e)}r.base=r.__P=null}if(r=i.__k)for(n=0;n<r.length;n++)r[n]&&Xn(r[n],e,t||typeof i.type!="function");t||Ui(i.__e),i.__c=i.__=i.__e=void 0}function go(i,e,t){return this.constructor(i,t)}function nr(i,e,t){var r,n,s,o;e==document&&(e=document.documentElement),$.__&&$.__(i,e),n=(r=!1)?null:e.__k,s=[],o=[],Oi(e,i=e.__k=Ci(ae,null,[i]),n||Ie,Ie,e.namespaceURI,n?null:e.firstChild?Ge.call(e.childNodes):null,
vendor: 1,050 bytes, line 1
1s,n?n.__e:e.firstChild,r,o),Gn(s,i,o)}function Yn(i,e,t){var r,n,s,o,a=se({},i.props);for(s in i.type&&i.type.defaultProps&&(o=i.type.defaultProps),e)s=="key"?r=e[s]:s=="ref"?n=e[s]:a[s]=e[s]===void 0&&o!=null?o[s]:e[s];return arguments.length>2&&(a.children=arguments.length>3?Ge.call(arguments,2):t),Ne(i.type,a,r||i.key,n||i.ref,null)}Ge=jn.slice,$={__e:function(i,e,t,r){for(var n,s,o;e=e.__;)if((n=e.__c)&&!n.__)try{if((s=n.constructor)&&s.getDerivedStateFromError!=null&&(n.setState(s.getDerivedStateFromError(i)),o=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(i,r||{}),o=n.__d),o)return n.__E=n}catch(a){i=a}throw i}},Ln=0,oe.prototype.setState=function(i,e){var t;t=this.__s!=null&&this.__s!=this.state?this.__s:this.__s=se({},this.state),typeof i=="function"&&(i=i(se({},t),this.props)),i&&se(t,i),i!=null&&this.__v&&(e&&this._sb.push(e),tr(this))},oe.prototype.forceUpdate=function(i){this.__v&&(this.__e=!0,i&&this.__h.push(i),tr(this))},oe.prototype.render=ae,de=[],$n=typeof Promise=="function"?Promise.prototype.then.bind(Prom
1ise.resolve()):setTimeout,zn=function(i,e){return i.__v.__b-e.__v.__b},gt.__r=0,qn=/(PointerCapture)$|Capture$/i,Ei=0,ai=rr(!1),li=rr(!0);var yo=0;function d(i,e,t,r,n,s){e||(e={});var o,a,l=e;if("ref"in l)for(a in l={},e)a=="ref"?o=e[a]:l[a]=e[a];var u={type:i,props:l,key:t,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--yo,__i:-1,__u:0,__source:n,__self:s};if(typeof i=="function"&&(o=i.defaultProps))for(a in o)l[a]===void 0&&(l[a]=o[a]);return $.vnode&&$.vnode(u),u}var De,j,Ut,sr,Be=0,Jn=[],H=$,or=H.__b,ar=H.__r,lr=H.diffed,ur=H.__c,dr=H.unmount,cr=H.__;function xi(i,e){H.__h&&H.__h(j,i,Be||e),Be=0;var t=j.__H||(j.__H={__:[],__h:[]});return i>=t.__.length&&t.__.push({}),t.__[i]}function Pe(i){return Be=1,bo(Zn,i)}function bo(i,e,t){var r=xi(De++,2);if(r.t=i,!r.__c&&(r.__=[Zn(void 0,e),function(a){var l=r.__N?r.__N[0]:r.__[0],u=r.t(l,a);l!==u&&(r.__N=[u,r.__[1]],r.__c.setState({}))}],r.__c=j,!j.__f)){var n=function(a,l,u){if(!r.__c.__H)return!0;var c=r.__c.__H.__.filter(function(v){return!!v.__c});if(c.every(function(v){return!v.__N}))return!s||s.call(this,a,l,u);var h=r.__c.props!==a;return c.forEach(function(v){if(v.__N){var w=v.__[0];v.__=v.__N,v.__N=void 0,w!==v.__[0]&&(h=!0)}}),s&&s.call(this,a,l,u)||h};j.__f=!0;var s=j.shouldComponentUpdate,o=j.componentWillUpdate;j.componentWillUpdate=function(a,l,u){if(this.__e){var c=s;s=void 0,n(a,l,u),s=c}o&&o.call(this,a,l,u)},j.shouldComponentUpdate=n}return r.__N||r.__}function yt(i,e){var t=xi(De++,3);!H.__s&&Qn(t.__H,e)&&(t.__=i,t.u=e,j.__H.__h.push(t))}function _e(i){return Be=5,Ai(function(){return{current:i}},[])}function Ai(i,e){var t=xi(De++,7);return Qn(t.__H,e)&&(t.__=i(),t.__H=e,t.__h=i),t.__}function bt(i,e){return Be=8,Ai(function(){return i},e)}function vo(){for(var i;i=Jn.shift();)if(i.__P&&i.__H)try{i.__H.__h.forEach(ct),i.__H.__h.forEach(di),i.__H.__h=[]}catch(e){i.__H.__h=[],H.__e(e,i.__v)}}H.__b=function(i){j=null,or&&or(i)},H.__=function(i,e){i&&e.__k&&e.__k.__m&&(i.__m=e.__k.__m),cr&&cr(i,e)},H.__r=function(i){ar&&ar(i),De=0;var e=(j=i.__c).__H;e&&(Ut===j?(e.__h=[],j.__h=[],e.__.forEach(function(t){t.__N&&(t.__=t.__N),t.u=t.__N=void 0})):(e.__h.forEach(ct),e.__h.forEach(di),e.__h=[],De=0)),Ut=j},H.diffed=function(i){lr&&lr(i);var e=i.__c;e&&e.__H&&(e.__H.__h.length&&(Jn.push(e)!==1&&sr===H.requestAnimationFrame||((sr=H.requestAnimationFrame)||wo)(vo)),e.__H.__.forEach(function(t){t.u&&(t.__H=t.u),t.u=void 0})),Ut=j=null},H.__c=function(i,e){e.some(function(t){try{t.__h.forEach(ct),t.__h=t.__h.filter(function(r){return!r.__||di(r)})}catch(r){e.some(function(n){n.__h&&(n.__h=[])}),e=[],H.__e(r,t.__v)}}),ur&&ur(i,e)},H.unmount=function(i){dr&&dr(i);var e,t=i.__c;t&&t.__H&&(t.__H.__.forEach(function(r){try{ct(r)}catch(n){e=n}}),t.__H=void 0,e&&H.__e(e,t.__v))};var hr=typeof requestAnimationFrame=="function";function wo(i){var e,t=function(){clearTimeout(r),hr&&cancelAnimationFrame(e),setTimeout(i)},r=setTimeout(t,35);hr&&(e=requestAnimationFrame(t))}function ct(i){var e=j,t=i.__c;typeof t=="function"&&(i.__c=void 0,t()),j=e}function di(i){var e=j;i.__c=i.__(),j=e}function Qn(i,e){return!i||i.length!==e.length||e.some(function(t,r){return t!==i[r]})}function Zn(i,e){return typeof e=="function"?e(i):e}const _o={position:"relative",width:"100%",minHeight:"100%"},So={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function Fo({data:i,rowHeight:e,renderRow:t,overscanCount:r=10,padding:n=4,...s}){const o=_e(null),[a,l]=Pe(0),[u,c]=Pe(0);yt(()=>{function f(){o.current!=null&&u!==o.current.offsetHeight&&c(o.current.offsetHeight)}return f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[u]);const h=bt(()=>{o.current&&l(o.current.scrollTop)},[]);let v=Math.floor(a/e),w=Math.floor(u/e);r&&(v=Math.max(0,v-v%r),w+=r);const S=v+w+n,P=i.slice(v,S),E={..._o,height:i.length*e},_={...So,top:v*e};return d("div",{onScroll:h,ref:o,...s,children:d("div",{role:"presentation",style:E,children:d("div",{role:"presentation",style:_,children:P.map(t)})})})}class Ri{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;
1constructor(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 Bn([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(){}}class es{#e;#t=[];constructor(e){this.#e=e}on(e,t){return this.#t.push([e,t]),this.#e.on(e,t)}remove(){for(const[e,t]of this.#t.splice(0))this.#e.off(e,t)}onFilePause(e,t){this.on("upload-pause",(r,n)=>{e===r?.id&&t(n)})}onFileRemove(e,t){this.on("file-removed",r=>{e===r.id&&t(r.id)})}onPause(e,t){this.on("upload-pause",(r,n)=>{e===r?.id&&t(n)})}onRetry(e,t){this.on("upload-retry",r=>{e===r?.id&&t()})}onRetryAll(e,t){this.on("retry-all",()=>{this.#e.getFile(e)&&t()})}onPauseAll(e,t){this.on("pause-all",()=>{this.#e.getFile(e)&&t()})}onCancelAll(e,t){this.on("cancel-all",(...r)=>{this.#e.getFile(e)&&t(...r)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#e.getFile(e)&&t()})}}const Po={debug:()=>{},warn:()=>{},error:(...i)=>console.error(`[Uppy] [${dt()}]`,...i)},To={debug:(...i)=>console.debug(`[Uppy] [${dt()}]`,...i),warn:(...i)=>console.warn(`[Uppy] [${dt()}]`,...i),error:(...i)=>console.error(`[Uppy] [${dt()}]`,...i)};var Ct,pr;function Eo(){return pr||(pr=1,Ct=function(e){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected a number, got ${typeof e}`);const t=e<0;let r=Math.abs(e);if(t&&(r=-r),r===0)return"0 B";const n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],s=Math.min(Math.floor(Math.log(r)/Math.log(1024)),n.length-1),o=Number(r/1024**s),a=n[s];return`${o>=10||o%1===0?Math.round(o):o.toFixed(1)} ${a}`}),Ct}var Uo=Eo();const ce=fe(Uo);var Ot,fr;function Co(){if(fr)return Ot;fr=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,r=this.parts,n,s=r.length,o;if(typeof e=="string"||e instanceof String)if(!this.hasWild&&this.text!=e)t=!1;else{for(o=(e||"").split(this.separator),n=0;t&&n<s;n++)r[n]!=="*"&&(n<o.length?t=r[n]===o[n]:t=!1);t=t&&o}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 a in e)this.match(a)&&(t[a]=e[a])}return t},Ot=function(e,t,r){var n=new i(e,r||/[\/\.]/);return typeof t<"u"?n.match(t):n},Ot}var kt,mr;function Oo(){if(mr)return kt;mr=1;var i=Co(),e=/[\/\+\.]/;return kt=function(t,r){function n(s){var o=i(s,t,e);return o&&o.length>=2}return r?n(r.split(";")[0]):n},kt}var ko=Oo();const xo=fe(ko),Ao={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};
1class Z extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class Ro{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const r=e();if(r.restrictions?.allowedFileTypes!=null&&!Array.isArray(r.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return r}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:r,maxNumberOfFiles:n}=this.getOpts().restrictions;if(n&&e.filter(o=>!o.isGhost).length+t.length>n)throw new Z(`${this.getI18n()("youCanOnlyUploadX",{smart_count:n})}`);if(r){const s=[...e,...t].reduce((o,a)=>o+(a.size??0),0);if(s>r)throw new Z(this.getI18n()("aggregateExceedsSize",{sizeAllowed:ce(r),size:ce(s)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:r,allowedFileTypes:n}=this.getOpts().restrictions;if(n&&!n.some(o=>o.includes("/")?e.type?xo(e.type.replace(/;.*?$/,""),o):!1:o[0]==="."&&e.extension?e.extension.toLowerCase()===o.slice(1).toLowerCase():!1)){const o=n.join(", ");throw new Z(this.getI18n()("youCanOnlyUploadFileTypes",{types:o}),{file:e})}if(t&&e.size!=null&&e.size>t)throw new Z(this.getI18n()("exceedsSize",{size:ce(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(r&&e.size!=null&&e.size<r)throw new Z(this.getI18n()("inferiorSize",{size:ce(r)}),{file:e})}validate(e,t){t.forEach(r=>{this.validateSingleFile(r)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new Z(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new Z(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:r}=this.getOpts().restrictions,n=[];for(const s of r)(!Object.hasOwn(e.meta,s)||e.meta[s]==="")&&n.push(s);return{missingFields:n,error:t}}}function No(i){let e=null,t;return(...r)=>(t=r,e||(e=Promise.resolve().then(()=>(e=null,i(...t)))),e)}class Me extends Ri{#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 r=e;this.uppy.iteratePlugins(n=>{n instanceof r&&(t=n)})}return t}mount(e,t){const r=t.id,n=Xs(e);if(n){this.isTargetDOMEl=!0;const a=document.createElement("div");return a.classList.add("uppy-Root"),this.#e=No(l=>{this.uppy.getPlugin(this.id)&&(nr(this.render(l,a),a),this.afterUpdate())}),this.uppy.log(`Installing ${r} to a DOM element '${e}'`),this.opts.replaceTargetContent&&(n.innerHTML=""),nr(this.render(this.uppy.getState(),a),a),this.el=a,n.appendChild(a),a.dir=this.opts.direction||ro(a)||"ltr",this.onMount(),this.el}const s=this.getTargetPlugin(e);
1if(s)return this.uppy.log(`Installing ${r} to ${s.id}`),this.parent=s,this.el=s.addTarget(t),this.onMount(),this.el;this.uppy.log(`Not installing ${r}`);let o=`Invalid target option given to ${r}.`;throw typeof e=="function"?o+=" 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.":o+="If you meant to target an HTML element, please make sure that the element exists. Check that the <script> tag initializing Uppy is right before the closing </body> tag at the end of the page. (see https://github.com/transloadit/uppy/issues/1042)\n\nIf you meant to target a plugin, please confirm that your `import` statements or `require` calls are correct.",new Error(o)}render(e,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 Io="5.0.0",Do={version:Io};class Bo{static VERSION=Do.version;state={};#e=new Set;getState(){return this.state}setState(e){const t={...this.state},r={...this.state,...e};this.state=r,this.#t(t,r,e)}subscribe(e){return this.#e.add(e),()=>{this.#e.delete(e)}}#t(...e){this.#e.forEach(t=>{t(...e)})}}var xt,gr;function Ni(){if(gr)return xt;gr=1;function i(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}return xt=i,xt}var At,yr;function Mo(){if(yr)return At;yr=1;var i=typeof be=="object"&&be&&be.Object===Object&&be;return At=i,At}var Rt,br;function ts(){if(br)return Rt;br=1;var i=Mo(),e=typeof self=="object"&&self&&self.Object===Object&&self,t=i||e||Function("return this")();return Rt=t,Rt}var Nt,vr;function Lo(){if(vr)return Nt;vr=1;var i=ts(),e=function(){return i.Date.now()};return Nt=e,Nt}var It,wr;function $o(){if(wr)return It;wr=1;var i=/\s/;function e(t){for(var r=t.length;r--&&i.test(t.charAt(r)););return r}return It=e,It}var Dt,_r;function zo(){if(_r)return Dt;_r=1;var i=$o(),e=/^\s+/;function t(r){return r&&r.slice(0,i(r)+1).replace(e,"")}return Dt=t,Dt}var Bt,Sr;function is(){if(Sr)return Bt;Sr=1;var i=ts(),e=i.Symbol;return Bt=e,Bt}var Mt,Fr;function qo(){if(Fr)return Mt;Fr=1;var i=is(),e=Object.prototype,t=e.hasOwnProperty,r=e.toString,n=i?i.toStringTag:void 0;function s(o){var a=t.call(o,n),l=o[n];try{o[n]=void 0;var u=!0}catch{}var c=r.call(o);return u&&(a?o[n]=l:delete o[n]),c}return Mt=s,Mt}var Lt,Pr;function jo(){if(Pr)return Lt;Pr=1;var i=Object.prototype,e=i.toString;function t(r){return e.call(r)}return Lt=t,Lt}var $t,Tr;function Ho(){if(Tr)return $t;Tr=1;var i=is(),e=qo(),t=jo(),r="[object Null]",n="[object Undefined]",s=i?i.toStringTag:void 0;function o(a){return a==null?a===void 0?n:r:s&&s in Object(a)?e(a):t(a)}return $t=o,$t}var zt,Er;function Vo(){if(Er)return zt;Er=1;function i(e){return e!=null&&typeof e=="object"}return zt=i,zt}var qt,Ur;function Wo(){if(Ur)return qt;Ur=1;var i=Ho(),e=Vo(),t="[object Symbol]";function r(n){return typeof n=="symbol"||e(n)&&i(n)==t}return qt=r,qt}var jt,Cr;function Go(){if(Cr)return jt;Cr=1;var i=zo(),e=Ni(),t=Wo(),r=NaN,n=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,o=/^0o[0-7]+$/i,a=parseInt;function l(u){if(typeof u=="number")return u;if(t(u))return r;if(e(u)){var c=typeof u.valueOf=="function"?u.valueOf():u;u=e(c)?c+"":c}if(typeof u!="string")return u===0?u:+u;u=i(u);var h=s.test(u);return h||o.test(u)?a(u.slice(2),h?2:8):n.test(u)?r:+u}return jt=l,jt}var Ht,Or;function rs(){if(Or)return Ht;Or=1;var i=Ni(),e=Lo(),t=Go(),r="Expected a function",n=Math.max,s=Math.min;function o(a,l,u){var c,h,v,w,S,P,E=0,_=!1,f=!1,y=!0;if(typeof a!="function")throw new TypeError(r);l=t(l)||0,i(u)&&(_=!!u.leading,f="maxWait"in u,v=f?n(t(u.maxWait)||0,l):v,y="trailing"in u?!!u.trailing:y);function F(O){var z=c,X=h;return c=h=void 0,E=O,w=a.apply(X,z),w}function b(O){return E=O,S=setTimeout(x,l),_?F(O):w}function k(O){var z=O-P,X=O-E,g=l-z;return f?s(g,v-X):g}function A(O){var z=O-P,X=O-E;return P===void 0||z>=l||z<0||f&&X>=v}function x(){var O=e();if(A(O))return R(O);S=setTimeout(x,k(O))}function R(O){return S=void 0,y&&c?F(O):(c=h=void 0,w)}function L(){S!==void 0&&clearTimeout(S),E=0,c=P=h=S=void 0}function B(){return S===void 0?w:R(e())}function q(){var O=e(),z=A(O);if(c=arguments,h=this,P=O,z){if(S===void 0)return b(P);if(f)return clearTimeout(S),S=setTimeout(x,l),F(P)}return S===void 0&&(S=setTimeout(x,l)),w}return q.cancel=L,q.flush=B,q}return Ht=o,Ht}var Vt,kr;function Ko(){if(kr)return Vt;kr=1;var i=rs(),e=Ni(),t="Expected a function";function r(n,s,o){var a=!0,l=!0;if(typeof n!="function")throw new TypeError(t);return e(o)&&(a="leading"in o?!!o.leading:a,l="trailing"in o?!!o.trailing:l),i(n,s,{leading:a,maxWait:s,trailing:l})}return Vt=r,Vt}var Xo=Ko();const Yo=fe(Xo);var Wt,xr;function Jo(){return xr||(xr=1,Wt=function(){var e={},t=e._fns={};e.emit=function(o,a,l,u,c,h,v){var w=r(o);w.length&&n(o,w,[a,l,u,c,h,v])},e.on=function(o,a){t[o]||(t[o]=[]),t[o].push(a)},e.once=function(o,a){function l(){a.apply(this,arguments),e.off(o,l)}this.on(o,l)},e.off=function(o,a){var l=[];
1if(o&&a){var u=this._fns[o],c=0,h=u?u.length:0;for(c;c<h;c++)u[c]!==a&&l.push(u[c])}l.length?this._fns[o]=l:delete this._fns[o]};function r(s){var o=t[s]?t[s]:[],a=s.indexOf(":"),l=a===-1?[s]:[s.substring(0,a),s.substring(a+1)],u=Object.keys(t),c=0,h=u.length;for(c;c<h;c++){var v=u[c];if(v==="*"&&(o=o.concat(t[v])),l.length===2&&l[0]===v){o=o.concat(t[v]);break}}return o}function n(s,o,a){var l=0,u=o.length;for(l;l<u&&o[l];l++)o[l].event=s,o[l].apply(o[l],a)}return e}),Wt}var Qo=Jo();const Zo=fe(Qo);let ea="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",ta=(i=21)=>{let e="",t=i|0;for(;t--;)e+=ea[Math.random()*64|0];return e};const ia="5.2.0",ra={version:ia};function na(i,e){return e.name?e.name:i.split("/")[0]==="image"?`${i.split("/")[0]}.${i.split("/")[1]}`:"noname"}const sa={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 oa(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 r=e[1].split(".",2),n=parseInt(r[0],10),s=parseInt(r[1],10);return n<15||n===15&&s<15063||n>18||n===18&&s>=18218}const Qe={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class St{static VERSION=ra.version;#e=Object.create(null);#t;#r;#i=Zo();#n=new Set;#s=new Set;#a=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=sa;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:Ao,meta:{},onBeforeFileAdded:(n,s)=>!Object.hasOwn(s,n.id),onBeforeUpload:n=>n,store:new Bo,logger:Po,infoTimeout:5e3},r={...t,...e};this.opts={...r,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=To),this.log(`Using Core v${St.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...Qe,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:oa(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#t=new Ro(()=>this.opts,()=>this.i18n),this.#r=this.store.subscribe((n,s,o)=>
1{this.emit("state-update",n,s,o),this.updateAll(s)}),this.opts.debug&&typeof window<"u"&&(window[this.opts.id]=this),this.#T()}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(([r,n])=>[r,{...t[r],...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=r=>this.log(`Missing i18n string: ${r}`,"error"),t=new Bn([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},r=Object.create(null);Object.keys(t).forEach(n=>{r[n]={...t[n],progress:{...t[n].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:r,...Qe})}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({...Qe,files:{}})}addPreProcessor(e){this.#n.add(e)}removePreProcessor(e){return this.#n.delete(e)}addPostProcessor(e){this.#a.add(e)}removePostProcessor(e){return this.#a.delete(e)}addUploader(e){this.#s.add(e)}removeUploader(e){return this.#s.delete(e)}setMeta(e){const t={...this.getState().meta,...e},r={...this.getState().files};Object.keys(r).forEach(n=>{r[n]={...r[n],meta:{...r[n].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:r})}setFileMeta(e,t){const r={...this.getState().files};if(!r[e]){this.log(`Was trying to set metadata for a file that has been removed: ${e}`);return}const n={...r[e].meta,...t};r[e]={...r[e],meta:n},this.setState({files:r})}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:r}=this.getState(),n=Object.values(e),s=[],o=[],a=[],l=[],u=[],c=[],h=[],v=[],w=[];for(const S of n){const{progress:P}=S;!P.uploadComplete&&P.uploadStarted&&(s.push(S),S.isPaused||v.push(S)),P.uploadStarted||o.push(S),(P.uploadStarted||P.preprocess||P.postprocess)&&a.push(S),P.uploadStarted&&l.push(S),S.isPaused&&u.push(S),P.uploadComplete&&c.push(S),S.error&&h.push(S),(P.preprocess||P.postprocess)&&w.push(S)}return{newFiles:o,startedFiles:a,uploadStartedFiles:l,pausedFiles:u,completeFiles:c,erroredFiles:h,inProgressFiles:s,inProgressNotPausedFiles:v,processingFiles:w,isUploadStarted:l.length>0,isAllComplete:t===100&&c.length===n.length&&w.length===0,isAllErrored:!!r&&h.length===n.length,isAllPaused:s.length!==0&&u.length===s.length,isUploadInProgress:s.length>0,isSomeGhost:n.some(S=>S.isGhost)}}#o(e){for(const o of e)o.isRestriction?this.emit("restriction-failed",o.file,o):this.emit("error",o,o.file),this.log(o,"warning");const t=e.filter(o=>o.isUserFacing),r=4,n=t.slice(0,r),s=t.slice(r);n.forEach(({message:o,details:a=""})=>{this.info({message:o,details:a},"error",this.opts.infoTimeout)}),s.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:s.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#t.validate(t,[e])}catch(r){return r}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(r){return r.message}return null}#l(e){const{missingFields:t,error:r}=this.#t.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:r.message}
1),this.log(r.message),this.emit("restriction-failed",e,r),!1):(t.length===0&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#p(e){let t=!0;for(const r of Object.values(e))this.#l(r)||(t=!1);return t}#u(e){const{allowNewUpload:t}=this.getState();if(t===!1){const r=new Z(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#o([r]),r}}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,r=xn(t),n=na(r,t),s=kn(n).extension,o=Zs(t,this.getID()),a={...t.meta,name:n,type:r},l=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:o,name:n,extension:s||"",meta:{...this.getState().meta,...a},type:r,progress:{percentage:0,bytesUploaded:!1,bytesTotal:l,uploadComplete:!1,uploadStarted:null},size:l,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))}#h(e){let{files:t}=this.getState(),r={...t};const n=[],s=[];for(const o of e)try{let a=this.#c(o);this.#u(a);const l=t[a.id],u=l?.isGhost;if(u&&!a.isRemote){if(a.data==null)throw new Error("File data is missing");a={...l,isGhost:!1,data:a.data},this.log(`Replaced the blob in the restored ghost file: ${a.name}, ${a.id}`)}const c=this.opts.onBeforeFileAdded(a,r);if(t=this.getState().files,r={...t,...r},!c&&this.checkIfFileAlreadyExists(a.id))throw new Z(this.i18n("noDuplicates",{fileName:a.name??this.i18n("unnamed")}),{file:a});if(c===!1&&!u)throw new Z("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:a});typeof c=="object"&&c!==null&&(a=c),this.#t.validateSingleFile(a),r[a.id]=a,n.push(a)}catch(a){s.push(a)}try{this.#t.validateAggregateRestrictions(Object.values(t),n)}catch(o){return s.push(o),{nextFilesState:t,validFilesToAdd:[],errors:s}}return{nextFilesState:r,validFilesToAdd:n,errors:s}}addFile(e){const{nextFilesState:t,validFilesToAdd:r,errors:n}=this.#h([e]),s=n.filter(a=>a.isRestriction);if(this.#o(s),n.length>0)throw n[0];this.setState({files:t});const[o]=r;return this.emit("file-added",o),this.emit("files-added",r),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),this.#d(),o.id}addFiles(e){const{nextFilesState:t,validFilesToAdd:r,errors:n}=this.#h(e),s=n.filter(a=>a.isRestriction);this.#o(s);const o=n.filter(a=>!a.isRestriction);if(o.length>0){let a=`Multiple errors occurred while adding files: 2`;if(o.forEach(l=>{a+=` 3 * ${l.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:a},"error",this.opts.infoTimeout),typeof AggregateError=="function")throw new AggregateError(o,a);{const l=new Error(a);throw l.errors=o,l}}this.setState({files:t}),r.forEach(a=>{this.emit("file-added",a)}),this.emit("files-added",r),r.length>5?this.log(`Added batch of ${r.length} files`):Object.values(r).forEach(a=>{this.log(`Added file: ${a.name} 4 id: ${a.id} 5 type: ${a.type}`)}),r.length>0&&this.#d()}removeFiles(e){const{files:t,currentUploads:r}=this.getState(),n={...t},s={...r},o=Object.create(null);e.forEach(c=>{t[c]&&(o[c]=t[c],delete n[c])});function a(c){return o[c]===void 0}Object.keys(s).forEach(c=>{const h=r[c].fileIDs.filter(a);if(h.length===0){delete s[c];return}const{capabilities:v}=this.getState();if(h.length!==r[c].fileIDs.length&&!v.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");s[c]={...r[c],fileIDs:h}});const l={currentUploads:s,files:n};Object.keys(n).length===0&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#m();const u=Object.keys(o);u.forEach(c=>{this.emit("file-removed",o[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;
5const 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(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const n={...e[r],isPaused:!0};e[r]=n}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(r=>!e[r].progress.uploadComplete&&e[r].progress.uploadStarted).forEach(r=>{const n={...e[r],isPaused:!1,error:null};e[r]=n}),this.setState({files:e}),this.emit("resume-all")}#b(){const{files:e}=this.getState();return Object.keys(e).filter(t=>{const r=e[t];return r.error&&(!r.missingRequiredMetaFields||r.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 r=this.#g(e,{forceAllowNewUpload:!0});return this.#y(r)}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(Qe)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=this.#g([e],{forceAllowNewUpload:!0});return this.#y(t)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#F=(e,t)=>{const r=e?this.getFile(e.id):void 0;if(e==null||!r){this.log(`Not setting progress for a file that has been removed: ${e?.id}`);return}if(r.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};r.progress.uploadStarted!=null?this.setFileState(e.id,{progress:{...r.progress,...n,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...r.progress,...n}}),this.#m()};#w(){const e=this.#P();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})}#m=Yo(()=>this.#w(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#w()}#P(){const t=this.getFiles().filter(l=>l.progress.uploadStarted||l.progress.preprocess||l.progress.postprocess);if(t.length===0)return 0;if(t.every(l=>l.progress.uploadComplete))return 1;const r=l=>l.progress.bytesTotal!=null&&l.progress.bytesTotal!==0,n=t.filter(r),s=t.filter(l=>!r(l));if(n.every(l=>l.progress.uploadComplete)&&s.length>0&&!s.every(l=>l.progress.uploadComplete))return null;const o=n.reduce((l,u)=>l+(u.progress.bytesTotal??0),0),a=n.reduce((l,u)=>l+(u.progress.bytesUploaded||0),0);return o===0?0:a/o}#T(){const e=(n,s,o)=>{let a=n.message||"Unknown error";n.details&&(a+=` ${n.details}`),this.setState({error:a}),s!=null&&s.id in this.getState().files&&this.setFileState(s.id,{error:a,response:o})};this.on("error",e),this.on("upload-error",(n,s,o)=>{if(e(s,n,o),typeof s=="object"&&s.message){this.log(s.message,"error");const a=new Error(this.i18n("failedToUpload",{file:n?.name??""}));a.isUserFacing=!0,a.details=s.message,s.details&&(a.details+=` ${s.details}`),this.#o([a])}else this.#o([s])});let t=null;this.on("upload-stalled",(n,s)=>{const{message:o}=n,a=s.map(l=>l.meta.name).join(", ");t||(this.info({message:o,details:a},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${o} ${a}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})});const r=n=>{const s=n.filter(a=>{const l=a!=null&&this.getFile(a.id);return l||this.log(`Not setting progress for a file that has been removed: ${a?.id}`),l}),o=Object.fromEntries(s.map(a=>[a.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:a.size}}]));this.patchFilesState(o)};this.on("upload-start",r),this.on("upload-progress",this.#F),this.on("upload-success",(n,s)=>{if(n==null||!this.getFile(n.id)){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}const o=this.getFile(n.id).progress,a=this.#a.size>0;this.setFileState(n.id,{progress:{...o,postprocess:a?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!a&&{complete:!0},percentage:100,bytesUploaded:o.bytesTotal},response:s,uploadURL:s.uploadURL,isPaused:!1}),n.size==null&&this.setFileState(n.id,{size:s.bytesUploaded||o.bytesTotal}),this.#m()}),this.on("preprocess-progress",(n,s)=>{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:s}})}),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}
5const s={...this.getState().files};s[n.id]={...s[n.id],progress:{...s[n.id].progress}},delete s[n.id].progress.preprocess,this.setState({files:s})}),this.on("postprocess-progress",(n,s)=>{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:s}})}),this.on("postprocess-complete",n=>{const s=n&&this.getFile(n.id);if(s==null){this.log(`Not setting progress for a file that has been removed: ${n?.id}`);return}const{postprocess:o,...a}=s.progress;this.patchFilesState({[s.id]:{progress:{...a,complete:!0}}})}),this.on("restored",()=>{this.#m()}),this.on("dashboard:file-edit-complete",n=>{n&&this.#l(n)}),typeof window<"u"&&window.addEventListener&&(window.addEventListener("online",this.#f),window.addEventListener("offline",this.#f),setTimeout(this.#f,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)}#f=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if(typeof e!="function"){const o=`Expected a plugin class, but got ${e===null?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`;throw new TypeError(o)}const r=new e(this,...t),n=r.id;if(!n)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");const s=this.getPlugin(n);if(s){const o=`Already found a plugin named '${s.id}'. Tried to use: '${n}'. 6Uppy plugins must have unique \`id\` options.`;throw new Error(o)}return e.VERSION&&this.log(`Using ${n} v${e.VERSION}`),r.type in this.#e?this.#e[r.type].push(r):this.#e[r.type]=[r],r.install(),this.emit("plugin-added",r),this}getPlugin(e){for(const t of Object.values(this.#e)){const r=t.find(n=>n.id===e);if(r!=null)return r}}[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],r=t.findIndex(o=>o.id===e.id);r!==-1&&t.splice(r,1);const s={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(s)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#r(),this.iteratePlugins(e=>{this.removePlugin(e)}),typeof window<"u"&&window.removeEventListener&&(window.removeEventListener("online",this.#f),window.removeEventListener("offline",this.#f))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",r=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(),r),this.emit("info-visible")}log(e,t){const{logger:r}=this.opts;switch(t){case"error":r.error(e);break;case"warning":r.warn(e);break;default:r.debug(e);break}}#_=new Map;registerRequestClient(e,t){this.#_.set(e,t)}
6getRequestClientForFile(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.#y(e);return this.emit("complete",t),t}#g(e,t={}){const{forceAllowNewUpload:r=!1}=t,{allowNewUpload:n,currentUploads:s}=this.getState();if(!n&&!r)throw new Error("Cannot create a new upload: already uploading.");const o=ta();return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:this.opts.allowMultipleUploadBatches!==!1&&this.opts.allowMultipleUploads!==!1,currentUploads:{...s,[o]:{fileIDs:e,step:0,result:{}}}}),o}[Symbol.for("uppy test: createUpload")](...e){return this.#g(...e)}#E(e){const{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#E(e)){this.log(`Not setting result for an upload that has been removed: ${e}`);return}const{currentUploads:r}=this.getState(),n={...r[e],result:{...r[e].result,...t}};this.setState({currentUploads:{...r,[e]:n}})}#S(e){const{[e]:t,...r}=this.getState().currentUploads;this.setState({currentUploads:r})}async#y(e){const t=()=>{const{currentUploads:o}=this.getState();return o[e]};let r=t();if(!r)throw new Error("Nonexistent upload");const n=[...this.#n,...this.#s,...this.#a];try{for(let o=r.step||0;o<n.length;o++){const a=n[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...r,step:o}}});const{fileIDs:l}=r;if(await a(l,e),r=t(),!r)break}}catch(o){throw this.#S(e),o}if(r){r.fileIDs.forEach(u=>{const c=this.getFile(u);c?.progress.postprocess&&this.emit("postprocess-complete",c)});const o=r.fileIDs.map(u=>this.getFile(u)),a=o.filter(u=>!u.error),l=o.filter(u=>u.error);this.addResultData(e,{successful:a,failed:l,uploadID:e}),r=t()}let s;return r&&(s=r.result,this.#S(e)),s==null&&(this.log(`Not setting result for an upload that has been removed: ${e}`),s={successful:[],failed:[],uploadID:e}),s}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(o=>o.progress.uploadStarted==null).length>0))return this.emit("complete",n),n;({files:e}=this.getState())}const r=this.opts.onBeforeUpload(e);if(r===!1)throw new Error("Not starting the upload because onBeforeUpload returned false");r&&typeof r=="object"&&(e=r,this.setState({files:e}));try{if(this.#t.validateMinNumberOfFiles(e),!this.#p(e))throw new Z(this.i18n("missingRequiredMetaField"));const{currentUploads:n}=this.getState(),s=Object.values(n).flatMap(u=>u.fileIDs),o=Object.keys(e).filter(u=>{const c=this.getFile(u);return c&&!c.progress.uploadStarted&&!s.includes(u)}),a=this.#g(o),l=await this.#y(a);return this.emit("complete",l),l}catch(n){throw this.#o([n]),n}}}var Gt={exports:{}};var Ar;function aa(){return Ar||(Ar=1,(function(i){(function(){var e={}.hasOwnProperty;function t(){for(var s="",o=0;o<arguments.length;o++){var a=arguments[o];a&&(s=n(s,r(a)))}return s}function r(s){if(typeof s=="string"||typeof s=="number")return s;if(typeof s!="object")return"";if(Array.isArray(s))return t.apply(null,s);if(s.toString!==Object.prototype.toString&&!s.toString.toString().includes("[native code]"))return s.toString();var o="";for(var a in s)e.call(s,a)&&s[a]&&(o=n(o,a));return o}function n(s,o){return o?s?s+" "+o:s+o:s}i.exports?(t.default=t,i.exports=t):window.classNames=t})()})(Gt)),Gt.exports}var la=aa();const ie=fe(la);var ua=rs();const da=fe(ua);function ca(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:d("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 M(i,e,t){return e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}var ns=typeof self<"u"?self:global;const Le=typeof navigator<"u",ha=Le&&typeof HTMLImageElement>"u",Rr=!(typeof global>"u"||typeof process>"u"||!process.versions||!process.versions.node),ss=ns.Buffer,os=!!ss,pa=i=>i!==void 0;function as(i){return i===void 0||(i instanceof Map?i.size===0:Object.values(i).filter(pa).length===0)}function G(i){let e=new Error(i);throw delete e.stack,e}function Nr(i){let e=(function(t){let r=0;return t.ifd0.enabled&&(r+=1024),t.exif.enabled&&(r+=2048),t.makerNote&&(r+=2048),t.userComment&&(r+=1024),t.gps.enabled&&(r+=512),t.interop.enabled&&(r+=100),t.ifd1.enabled&&(r+=1024),r+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 Kt=i=>String.fromCharCode.apply(null,i),Ir=typeof TextDecoder<"u"?new TextDecoder("utf-8"):void 0;class te{static from(e,t){return e instanceof this&&e.le===t?e:new te(e,void 0,void 0,t)}constructor(e,t=0,r,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){r===void 0&&(r=e.byteLength-t);let s=new DataView(e,t,r);this._swapDataView(s)}else if(e instanceof Uint8Array||e instanceof DataView||e instanceof te){r===void 0&&(r=e.byteLength-t),(t+=e.byteOffset)+r>e.byteOffset+e.byteLength&&G("Creating view outside of available memory in ArrayBuffer");let s=new DataView(e.buffer,t,r);this._swapDataView(s)}else if(typeof e=="number"){let s=new DataView(new ArrayBuffer(e));this._swapDataView(s)}else G("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,r=te){return e instanceof DataView||e instanceof te?e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer&&(e=new Uint8Array(e)),e instanceof Uint8Array||G("BufferView.set(): Invalid data argument."),this.toUint8().set(e,t),new r(this,t,e.byteLength)}subarray(e,t){return t=t||this._lengthToEnd(e),new te(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),Ir?Ir.decode(n):os?Buffer.from(n).toString("utf8"):decodeURIComponent(escape(Kt(n)));var n}getLatin1String(e=0,t=this.byteLength){let r=this.getUint8Array(e,t);return Kt(r)}getUnicodeString(e=0,t=this.byteLength){const r=[];for(let n=0;n<t&&e+n<this.byteLength;n+=2)r.push(this.getUint16(e+n));return Kt(r)}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)}
6getFloat(e,t=this.le){return this.dataView.getFloat32(e,t)}getDouble(e,t=this.le){return this.dataView.getFloat64(e,t)}getUintBytes(e,t,r){switch(t){case 1:return this.getUint8(e,r);case 2:return this.getUint16(e,r);case 4:return this.getUint32(e,r);case 8:return this.getUint64&&this.getUint64(e,r)}}getUint(e,t,r){switch(t){case 8:return this.getUint8(e,r);case 16:return this.getUint16(e,r);case 32:return this.getUint32(e,r);case 64:return this.getUint64&&this.getUint64(e,r)}}toString(e){return this.dataView.toString(e,this.constructor.name)}ensureChunk(){}}function ci(i,e){G(`${i} '${e}' was not loaded, try using full build of exifr.`)}class Ii extends Map{constructor(e){super(),this.kind=e}get(e,t){return this.has(e)||ci(this.kind,e),t&&(e in t||(function(r,n){G(`Unknown ${r} '${n}'.`)})(this.kind,e),t[e].enabled||ci(this.kind,e)),super.get(e)}keyList(){return Array.from(this.keys())}}var ls=new Ii("file parser"),ee=new Ii("segment parser"),Di=new Ii("file reader");let fa=ns.fetch;function Dr(i,e){return(t=i).startsWith("data:")||t.length>1e4?pi(i,e,"base64"):Rr&&i.includes("://")?hi(i,e,"url",Br):Rr?pi(i,e,"fs"):Le?hi(i,e,"url",Br):void G("Invalid input argument");var t}async function hi(i,e,t,r){return Di.has(t)?pi(i,e,t):r?(async function(n,s){let o=await s(n);return new te(o)})(i,r):void G(`Parser ${t} is not loaded`)}async function pi(i,e,t){let r=new(Di.get(t))(i,e);return await r.read(),r}const Br=i=>fa(i).then((e=>e.arrayBuffer())),fi=i=>new Promise(((e,t)=>{let r=new FileReader;r.onloadend=()=>e(r.result||new ArrayBuffer),r.onerror=t,r.readAsArrayBuffer(i)})),Bi=new Map,ma=new Map,ga=new Map,Ze=["chunked","firstChunkSize","firstChunkSizeNode","firstChunkSizeBrowser","chunkSize","chunkLimit"],us=["jfif","xmp","icc","iptc","ihdr"],mi=["tiff",...us],W=["ifd0","ifd1","exif","gps","interop"],et=[...mi,...W],tt=["makerNote","userComment"],ds=["translateKeys","translateValues","reviveValues","multiSegment"],it=[...ds,"sanitize","mergeOutput","silentErrors"];class cs{get translate(){return this.translateKeys||this.translateValues||this.reviveValues}}class Ue extends cs{get needed(){return this.enabled||this.deps.size>0}constructor(e,t,r,n){if(super(),M(this,"enabled",!1),M(this,"skip",new Set),M(this,"pick",
vendor: 21,237 bytes, lines 6-7
6new Set),M(this,"deps",new Set),M(this,"translateKeys",!1),M(this,"translateValues",!1),M(this,"reviveValues",!1),this.key=e,this.enabled=t,this.parse=this.enabled,this.applyInheritables(n),this.canBeFiltered=W.includes(e),this.canBeFiltered&&(this.dict=Bi.get(e)),r!==void 0)if(Array.isArray(r))this.parse=this.enabled=!0,this.canBeFiltered&&r.length>0&&this.translateTagSet(r,this.pick);else if(typeof r=="object"){if(this.enabled=!0,this.parse=r.parse!==!1,this.canBeFiltered){let{pick:s,skip:o}=r;s&&s.length>0&&this.translateTagSet(s,this.pick),o&&o.length>0&&this.translateTagSet(o,this.skip)}this.applyInheritables(r)}else r===!0||r===!1?this.parse=this.enabled=r:G(`Invalid options argument: ${r}`)}applyInheritables(e){let t,r;for(t of ds)r=e[t],r!==void 0&&(this[t]=r)}translateTagSet(e,t){if(this.dict){let r,n,{tagKeys:s,tagValues:o}=this.dict;for(r of e)typeof r=="string"?(n=o.indexOf(r),n===-1&&(n=s.indexOf(Number(r))),n!==-1&&t.add(Number(s[n]))):t.add(r)}else for(let r of e)t.add(r)}finalizeFilters(){!this.enabled&&this.deps.size>0?(this.enabled=!0,vt(this.pick,this.deps)):this.enabled&&this.pick.size>0&&vt(this.pick,this.deps)}}var Q={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},Mr=new Map;class Mi extends cs{static useCached(e){let t=Mr.get(e);return t!==void 0||(t=new this(e),Mr.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):G(`Invalid options argument ${e}`),this.firstChunkSize===void 0&&(this.firstChunkSize=Le?this.firstChunkSizeBrowser:this.firstChunkSizeNode),this.mergeOutput&&(this.ifd1.enabled=!1),this.filterNestedSegmentTags(),this.traverseTiffDependencyTree(),this.checkLoadedPlugins()}setupFromUndefined(){let e;for(e of Ze)this[e]=Q[e];for(e of it)this[e]=Q[e];for(e of tt)this[e]=Q[e];for(e of et)this[e]=new Ue(e,Q[e],void 0,this)}setupFromTrue(){let e;for(e of Ze)this[e]=Q[e];for(e of it)this[e]=Q[e];for(e of tt)this[e]=!0;for(e of et)this[e]=new Ue(e,!0,void 0,this)}setupFromArray(e){let t;for(t of Ze)this[t]=Q[t];for(t of it)this[t]=Q[t];for(t of tt)this[t]=Q[t];for(t of et)this[t]=new Ue(t,!1,void 0,this);this.setupGlobalFilters(e,void 0,W)}setupFromObject(e){let t;for(t of(W.ifd0=W.ifd0||W.image,W.ifd1=W.ifd1||W.thumbnail,Object.assign(this,e),Ze))this[t]=Xt(e[t],Q[t]);for(t of it)this[t]=Xt(e[t],Q[t]);for(t of tt)this[t]=Xt(e[t],Q[t]);for(t of mi)this[t]=new Ue(t,Q[t],e[t],this);for(t of W)this[t]=new Ue(t,Q[t],e[t],this.tiff);this.setupGlobalFilters(e.pick,e.skip,W,et),e.tiff===!0?this.batchEnableWithBool(W,!0):e.tiff===!1?this.batchEnableWithUserValue(W,e):Array.isArray(e.tiff)?this.setupGlobalFilters(e.tiff,void 0,W):typeof e.tiff=="object"&&this.setupGlobalFilters(e.tiff.pick,e.tiff.skip,W)}batchEnableWithBool(e,t){for(let r of e)this[r].enabled=t}batchEnableWithUserValue(e,t){for(let r of e){let n=t[r];this[r].enabled=n!==!1&&n!==void 0}}setupGlobalFilters(e,t,r,n=r){if(e&&e.length){for(let o of n)this[o].enabled=!1;let s=Lr(e,r);for(let[o,a]of s)vt(this[o].pick,a),this[o].enabled=!0}else if(t&&t.length){let s=Lr(t,r);for(let[o,a]of s)vt(this[o].skip,a)}}filterNestedSegmentTags(){let{ifd0:e,exif:t,xmp:r,iptc:n,icc:s}=this;this.makerNote?t.deps.add(37500):t.skip.add(37500),this.userComment?t.deps.add(37510):t.skip.add(37510),r.enabled||e.skip.add(700),n.enabled||e.skip.add(33723),s.enabled||e.skip.add(34675)}traverseTiffDependencyTree(){let{ifd0:e,exif:t,gps:r,interop:n}=this;n.needed&&(t.deps.add(40965),e.deps.add(40965)),t.needed&&e.deps.add(34665),r.needed&&e.deps.add(34853),this.tiff.enabled=W.some((s=>this[s].enabled===!0))||this.makerNote||this.userComment;for(let s of W)this[s].finalizeFilters()}get onlyTiff(){return!us.map((e=>this[e].enabled)).some((e=>e===!0))&&this.tiff.enabled}checkLoadedPlugins(){for(let e of mi)this[e].enabled&&!ee.has(e)&&ci("segment parser",e)}}function Lr(i,e){let t,r,n,s,o=[];for(n of e){for(s of(t=Bi.get(n),r=[],t))(i.includes(s[0])||i.includes(s[1]))&&r.push(s[0]);r.length&&o.push([n,r])}return o}function Xt(i,e){return i!==void 0?i:e!==void 0?e:void 0}function vt(i,e){for(let t of e)i.add(t)}M(Mi,"default",Q);class ya{constructor(e){M(this,"parsers",{}),M(this,"output",{}),M(this,"errors",[]),M(this,"pushToErrors",(t=>this.errors.push(t))),this.options=Mi.useCached(e)}async read(e){this.file=await(function(t,r){return typeof t=="string"?Dr(t,r):Le&&!ha&&t instanceof HTMLImageElement?Dr(t.src,r):t instanceof Uint8Array||t instanceof ArrayBuffer||t instanceof DataView?new te(t):Le&&t instanceof Blob?hi(t,r,"blob",fi):void G("Invalid input argument")})(e,this.options)}setup(){if(this.fileParser)return;let{file:e}=this,t=e.getUint16(0);for(let[r,n]of ls)if(n.canHandle(e,t))return this.fileParser=new n(this.options,this.file,this.parsers),e[r]=!0;this.file.close&&this.file.close(),G("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),as(r=e)?void 0:r;var r}async executeParsers(){let{output:e}=this;await this.fileParser.parse();let t=Object.values(this.parsers).map((async r=>{let n=await r.parse();r.assignToOutput(e,n)}));this.options.silentErrors&&(t=t.map((r=>r.catch(this.pushToErrors)))),await Promise.all(t)}async extractThumbnail(){this.setup();let{options:e,file:t}=this,r=ee.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 s=await this.fileParser.ensureSegmentChunk(n),o=this.parsers.tiff=new r(s,e,t),a=await o.extractThumbnail();return t.close&&t.close(),a}}class ve{static findPosition(e,t){let r=e.getUint16(t+2)+2,n=typeof this.headerLength=="function"?this.headerLength(e,t,r):this.headerLength,s=t+n,o=r-n;return{offset:t,length:r,headerLength:n,start:s,size:o,end:s+o}}static parse(e,t={}){return new this(e,new Mi({[this.type]:t}),e).parse()}normalizeInput(e){return e instanceof te?e:new te(e)}constructor(e,t={},r){M(this,"errors",[]),M(this,"raw",new Map),M(this,"handleError",(n=>{if(!this.options.silentErrors)throw n;this.errors.push(n.message)})),this.chunk=this.normalizeInput(e),this.file=r,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 r=ga.get(t),n=ma.get(t),s=Bi.get(t),o=this.options[t],a=o.reviveValues&&!!r,l=o.translateValues&&!!n,u=o.translateKeys&&!!s,c={};for(let[h,v]of e)a&&r.has(h)?v=r.get(h)(v):l&&n.has(h)&&(v=this.translateValue(v,n.get(h))),u&&s.has(h)&&(h=s.get(h)||h),c[h]=v;return c}translateValue(e,t){return t[e]||t.DEFAULT||e}assignToOutput(e,t){this.assignObjectToOutput(e,this.constructor.type,t)}assignObjectToOutput(e,t,r){if(this.globalOptions.mergeOutput)return Object.assign(e,r);e[t]?Object.assign(e[t],r):e[t]=r}}M(ve,"headerLength",4),M(ve,"type",void 0),M(ve,"multiSegment",!1),M(ve,"canHandle",(()=>!1));function ba(i){return i===192||i===194||i===196||i===219||i===221||i===218||i===254}function va(i){return i>=224&&i<=239}function wa(i,e,t){for(let[r,n]of ee)if(n.canHandle(i,e,t))return r}class $r extends class{constructor(e,t,r){M(this,"errors",[]),M(this,"ensureSegmentChunk",(async n=>{let s=n.start,o=n.size||65536;if(this.file.chunked)if(this.file.available(s,o))n.chunk=this.file.subarray(s,o);else try{n.chunk=await this.file.readChunk(s,o)}catch(a){G(`Couldn't read segment: ${JSON.stringify(n)}. ${a.message}`)}else this.file.byteLength>s+o?n.chunk=this.file.subarray(s,o):n.size===void 0?n.chunk=this.file.subarray(s):G("Segment unreachable: "+JSON.stringify(n));return n.chunk})),this.extendOptions&&this.extendOptions(e),this.options=e,this.file=t,this.parsers=r}injectSegment(e,t){this.options[e].enabled&&this.createParser(e,t)}createParser(e,t){let r=new(ee.get(e))(t,this.options,this.file);return this.parsers[e]=r}createParsers(e){for(let t of e){let{type:r,chunk:n}=t,s=this.options[r];if(s&&s.enabled){let o=this.parsers[r];o&&o.append||o||this.createParser(r,n)}}}async readSegments(e){let t=e.map(this.ensureSegmentChunk);await Promise.all(t)}}{constructor(...e){super(...e),M(this,"appSegments",[]),M(this,"jpegSegments",[]),M(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(ee.keyList())):(e=e===void 0?ee.keyList().filter((t=>this.options[t].enabled)):e.filter((t=>this.options[t].enabled&&ee.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:r,findAll:n,wanted:s,remaining:o}=this;if(!n&&this.file.chunked&&(n=Array.from(s).some((a=>{let l=ee.get(a),u=this.options[a];return l.multiSegment&&u.multiSegment})),n&&await this.file.readWhole()),e=this.findAppSegmentsInRange(e,r.byteLength),!this.options.onlyTiff&&r.chunked){let a=!1;for(;o.size>0&&!a&&(r.canReadNextChunk||this.unfinishedMultiSegment);){let{nextChunkOffset:l}=r,u=this.appSegments.some((c=>!this.file.available(c.offset||c.start,c.length||c.size)));if(a=e>l&&!u?!await r.readNextChunk(e):!await r.readNextChunk(l),(e=this.findAppSegmentsInRange(e,r.byteLength))===void 0)return}}}findAppSegmentsInRange(e,t){t-=2;let r,n,s,o,a,l,{file:u,findAll:c,wanted:h,remaining:v,options:w}=this;for(;e<t;e++)if(u.getUint8(e)===255){if(r=u.getUint8(e+1),va(r)){if(n=u.getUint16(e+2),s=wa(u,e,n),s&&h.has(s)&&(o=ee.get(s),a=o.findPosition(u,e),l=w[s],a.type=s,this.appSegments.push(a),!c&&(o.multiSegment&&l.multiSegment?(this.unfinishedMultiSegment=a.chunkNumber<a.chunkCount,this.unfinishedMultiSegment||v.delete(s)):v.delete(s),v.size===0)))break;w.recordUnknownSegments&&(a=ve.findPosition(u,e),a.marker=r,this.unknownSegments.push(a)),e+=n+1}else if(ba(r)){if(n=u.getUint16(e+2),r===218&&w.stopAfterSos!==!1)return;w.recordJpegSegments&&this.jpegSegments.push({offset:e,length:n,marker:r}),e+=n+1}}return e}mergeMultiSegments(){if(!this.appSegments.some((t=>t.multiSegment)))return;let e=(function(t,r){let n,s,o,a=new Map;for(let l=0;l<t.length;l++)n=t[l],s=n[r],a.has(s)?o=a.get(s):a.set(s,o=[]),o.push(n);return Array.from(a)})(this.appSegments,"type");this.mergedAppSegments=e.map((([t,r])=>{let n=ee.get(t,this.options);return n.handleMultiSegments?{type:t,chunk:n.handleMultiSegments(r)}:r[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}}M($r,"type","jpeg"),ls.set("jpeg",$r);const _a=[void 0,1,1,2,4,8,1,1,2,4,8,4,8,4];class Sa extends ve{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,r=new Map){let{pick:n,skip:s}=this.options[t];n=new Set(n);let o=n.size>0,a=s.size===0,l=this.chunk.getUint16(e);e+=2;for(let u=0;u<l;u++){let c=this.chunk.getUint16(e);if(o){if(n.has(c)&&(r.set(c,this.parseTag(e,c,t)),n.delete(c),n.size===0))break}else!a&&s.has(c)||r.set(c,this.parseTag(e,c,t));e+=12}return r}parseTag(e,t,r){let{chunk:n}=this,s=n.getUint16(e+2),o=n.getUint32(e+4),a=_a[s];if(a*o<=4?e+=8:e=n.getUint32(e+8),(s<1||s>13)&&G(`Invalid TIFF value type. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e}`),e>n.byteLength&&G(`Invalid TIFF value offset. block: ${r.toUpperCase()}, tag: ${t.toString(16)}, type: ${s}, offset ${e} is outside of chunk size ${n.byteLength}`),s===1)return n.getUint8Array(e,o);if(s===2)return(l=(function(u){for(;u.endsWith("\0");)u=u.slice(0,-1);return u})(l=n.getString(e,o)).trim())===""?void 0:l;var l;if(s===7)return n.getUint8Array(e,o);if(o===1)return this.parseTagValue(s,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}})(s))(o),c=a;for(let h=0;h<o;h++)u[h]=this.parseTagValue(s,e),e+=c;return u}}parseTagValue(e,t){let{chunk:r}=this;switch(e){case 1:return r.getUint8(t);case 3:return r.getUint16(t);case 4:return r.getUint32(t);case 5:return r.getUint32(t)/r.getUint32(t+4);case 6:return r.getInt8(t);case 8:return r.getInt16(t);case 9:return r.getInt32(t);case 10:return r.getInt32(t)/r.getInt32(t+4);case 11:return r.getFloat(t);case 12:return r.getDouble(t);case 13:return r.getUint32(t);default:G(`Invalid tiff type ${e}`)}}}class Yt extends Sa{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 r=new Map;return this[t]=r,this.parseTags(e,t,r),r}async parseIfd0Block(){if(this.ifd0)return;let{file:e}=this;this.findIfd0Offset(),this.ifd0Offset<8&&G("Malformed EXIF data"),!e.chunked&&this.ifd0Offset>e.byteLength&&G(`IFD0 offset points to outside of file. 7this.ifd0Offset: ${this.ifd0Offset}, file.byteLength: ${e.byteLength}`),e.tiff&&await e.ensureChunk(this.ifd0Offset,Nr(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,Nr(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 r=e.get(t);r&&r.length===1&&e.set(t,r[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",zr(...e.get(2),e.get(1))),e.set("longitude",zr(...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,r,n={};for(t of W)if(e=this[t],!as(e))if(r=this.canTranslate?this.translateBlock(e,t):Object.fromEntries(e),this.options.mergeOutput){if(t==="ifd1")continue;Object.assign(n,r)}else n[t]=r;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[r,n]of Object.entries(t))this.assignObjectToOutput(e,r,n)}}function zr(i,e,t,r){var n=i+e/60+t/3600;return r!=="S"&&r!=="W"||(n*=-1),n}M(Yt,"type","tiff"),M(Yt,"headerLength",10),ee.set("tiff",Yt);const Li={ifd0:!1,ifd1:!1,exif:!1,gps:!1,interop:!1,sanitize:!1,reviveValues:!0,translateKeys:!1,translateValues:!1,mergeOutput:!1};Object.assign({},Li,{firstChunkSize:4e4,gps:[1,2,3,4]});Object.assign({},Li,{tiff:!1,ifd1:!0,mergeOutput:!1});const Fa=Object.assign({},Li,{firstChunkSize:4e4,ifd0:[274]});async function Pa(i){let e=new ya(Fa);await e.read(i);let t=await e.parse();if(t&&t.ifd0)return t.ifd0[274]}const Ta=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 Oe=!0,ke=!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,r]=e;Oe=Number(t)+.1*Number(r)<13.4,ke=!1}}else if(i.includes("OS X 10")){let[,e]=i.match(/OS X 10[_.](\d+)/);Oe=ke=Number(e)<15}if(i.includes("Chrome/")){let[,e]=i.match(/Chrome\/(\d+)/);Oe=ke=Number(e)<81}else if(i.includes("Firefox/")){let[,e]=i.match(/Firefox\/(\d+)/);Oe=ke=Number(e)<77}}async function Ea(i){let e=await Pa(i);return Object.assign({canvas:Oe,css:ke},Ta[e])}class Ua extends te{constructor(...e){super(...e),M(this,"ranges",new Ca),this.byteLength!==0&&this.ranges.add(0,this.byteLength)}_tryExtend(e,t,r){if(e===0&&this.byteLength===0&&r){let n=new DataView(r.buffer||r,r.byteOffset,r.byteLength);this._swapDataView(n)}else{let n=e+t;if(n>this.byteLength){let{dataView:s}=this._extend(n);this._swapDataView(s)}}}_extend(e){let t;t=os?ss.allocUnsafe(e):new Uint8Array(e);let r=new DataView(t.buffer,t.byteOffset,t.byteLength);return t.set(new Uint8Array(this.buffer,this.byteOffset,this.byteLength),0),{uintView:t,dataView:r}}subarray(e,t,r=!1){return t=t||this._lengthToEnd(e),r&&this._tryExtend(e,t),this.ranges.add(e,t),super.subarray(e,t)}set(e,t,r=!1){r&&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 Ca{constructor(){M(this,"list",[])}get length(){return this.list.length}add(e,t,r=0){let n=e+t,s=this.list.filter((o=>qr(e,o.offset,n)||qr(e,o.end,n)));if(s.length>0){e=Math.min(e,...s.map((a=>a.offset))),n=Math.max(n,...s.map((a=>a.end))),t=n-e;let o=s.shift();o.offset=e,o.length=t,o.end=n,this.list=this.list.filter((a=>!s.includes(a)))}else this.list.push({offset:e,length:t,end:n})}available(e,t){let r=e+t;return this.list.some((n=>n.offset<=e&&r<=n.end))}}function qr(i,e,t){return i<=e&&e<=t}class Oa extends Ua{constructor(e,t){super(0),M(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,r=await this.readChunk(e,t);return!!r&&r.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(){}}Di.set("blob",class extends Oa{async readWhole(){this.chunked=!1;let i=await fi(this.input);this._swapArrayBuffer(i)}readChunked(){return this.chunked=!0,this.size=this.input.size,super.readChunked()}
7async _readChunk(i,e){let t=e?i+e:void 0,r=this.input.slice(i,t),n=await fi(r);return this.set(n,i,!0)}});const ka="5.1.0",xa={version:ka},Aa={strings:{generatingThumbnails:"Generating thumbnails..."}};function Ra(i,e,t){try{i.getContext("2d").getImageData(0,0,1,1)}catch(r){if(r.code===18)return Promise.reject(new Error("cannot read image, probably an svg with external resources"))}return i.toBlob?new Promise(r=>{i.toBlob(r,e,t)}).then(r=>{if(r===null)throw new Error("cannot read image, probably an svg with external resources");return r}):Promise.resolve().then(()=>Hs(i.toDataURL(e,t),{})).then(r=>{if(r===null)throw new Error("could not extract blob, probably an old browser");return r})}function Na(i,e){let t=i.width,r=i.height;(e.deg===90||e.deg===270)&&(t=i.height,r=i.width);const n=document.createElement("canvas");n.width=t,n.height=r;const s=n.getContext("2d");return s.translate(t/2,r/2),e.canvas&&(s.rotate(e.rad),s.scale(e.scaleX,e.scaleY)),s.drawImage(i,-i.width/2,-i.height/2,i.width,i.height),n}function Ia(i){const e=i.width/i.height,t=5e6,r=4096;let n=Math.floor(Math.sqrt(t*e)),s=Math.floor(t/Math.sqrt(t*e));if(n>r&&(n=r,s=Math.round(n/e)),s>r&&(s=r,n=Math.round(e*s)),i.width>n){const o=document.createElement("canvas");return o.width=n,o.height=s,o.getContext("2d").drawImage(i,0,0,n,s),o}return i}const Da={thumbnailWidth:null,thumbnailHeight:null,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,lazy:!1};class Ba extends Me{static VERSION=xa.version;queue;queueProcessing;defaultThumbnailDimension;thumbnailType;constructor(e,t){if(super(e,{...Da,...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=Aa,this.i18nInit(),this.opts.lazy&&this.opts.waitForThumbnailsBeforeUpload)throw new Error("Thumbn
7ailGenerator: The `lazy` and `waitForThumbnailsBeforeUpload` options are mutually exclusive. Please ensure at most one of them is set to `true`.")}createThumbnail(e,t,r){if(e.data==null)throw new Error("File data is empty");const n=URL.createObjectURL(e.data),s=new Promise((a,l)=>{const u=new Image;u.src=n,u.addEventListener("load",()=>{URL.revokeObjectURL(n),a(u)}),u.addEventListener("error",c=>{URL.revokeObjectURL(n),l(c.error||new Error("Could not create thumbnail"))})}),o=Ea(e.data).catch(()=>1);return Promise.all([s,o]).then(([a,l])=>{const u=this.getProportionalDimensions(a,t,r,l.deg),c=Na(a,l),h=this.resizeImage(c,u.width,u.height);return Ra(h,this.thumbnailType,80)}).then(a=>URL.createObjectURL(a))}getProportionalDimensions(e,t,r,n){let s=e.width/e.height;if((n===90||n===270)&&(s=e.height/e.width),t!=null){let o=t;return e.width<t&&(o=e.width),{width:o,height:Math.round(o/s)}}if(r!=null){let o=r;return e.height<r&&(o=e.height),{width:Math.round(o*s),height:o}}return{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/s)}}resizeImage(e,t,r){let n=Ia(e),s=Math.ceil(Math.log2(n.width/t));s<1&&(s=1);let o=t*2**(s-1),a=r*2**(s-1);const l=2;for(;s--;){const u=document.createElement("canvas");u.width=o,u.height=a,u.getContext("2d").drawImage(n,0,0,o,a),n=u,o=Math.round(o/l),a=Math.round(a/l)}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 Ji(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(t=>{this.setPreviewURL(e.id,t),this.uppy.log(`[ThumbnailGenerator] Generated thumbnail for ${e.id}`),this.uppy.emit("thumbnail:generated",this.uppy.getFile(e.id),t)}).catch(t=>{this.uppy.log(`[ThumbnailGenerator] Failed thumbnail for ${e.id}:`,"warning"),this.uppy.log(t,"warning"),this.uppy.emit("thumbnail:error",this.uppy.getFile(e.id),t)}):Promise.resolve()}onFileAdded=e=>{!e.preview&&e.data&&Ji(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&&Yi(e.preview)&&URL.revokeObjectURL(e.preview)};onRestored=()=>{this.uppy.getFiles().filter(t=>t.isRestored).forEach(t=>{(!t.preview||Yi(t.preview))&&this.addToQueue(t.id)})};onAllFilesRemoved=()=>{this.queue=[]};waitUntilAllProcessed=e=>{e.forEach(r=>{const n=this.uppy.getFile(r);this.uppy.emit("preprocess-progress",n,{mode:"indeterminate",message:this.i18n("generatingThumbnails")})});const t=()=>{e.forEach(r=>{const n=this.uppy.getFile(r);this.uppy.emit("preprocess-complete",n)})};return new Promise(r=>{this.queueProcessing?this.uppy.once("thumbnail:all-generated",()=>{t(),r()}):(t(),r())})};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 Ma="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",hs=(i=21)=>{let e="",t=i|0;for(;t--;)e+=Ma[Math.random()*64|0];return e};const La="5.1.0",$a={version:La};class ps extends oe{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)=>d("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,r)=>{const s={photo:"image/*",video:"video/*"}[e];return d("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:s,ref:r})};renderMyDeviceAcquirer=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MyDevice",children:d("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:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{className:"uppy-DashboardTab-iconMyDevice","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("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:"
7currentcolor","fill-rule":"evenodd"})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("myDevice")})]})});renderPhotoCamera=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobilePhotoCamera",children:d("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:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:d("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"})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("takePictureBtn")})]})});renderVideoCamera=()=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":"MobileVideoCamera",children:d("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:[d("div",{className:"uppy-DashboardTab-inner",children:d("svg",{"aria-hidden":"true",width:"32",height:"32",viewBox:"0 0 32 32",children:d("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 "})})}),d("div",{className:"uppy-DashboardTab-name",children:this.props.i18n("recordVideoBtn")})]})});renderBrowseButton=(e,t)=>{const r=this.props.acquirers.length;return d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-browse",onClick:t,"data-uppy-super-focusable":r===0,children:e})};renderDropPasteBrowseTagline=e=>{const t=this.renderBrowseButton(this.props.i18n("browseFiles"),this.triggerFileInputClick),r=this.renderBrowseButton(this.props.i18n("browseFolders"),this.triggerFolderInputClick),n=this.props.fileManagerSelectionType,s=n.charAt(0).toUpperCase()+n.slice(1);return d("div",{class:"uppy-Dashboard-AddFiles-title",children:this.props.disableLocalFiles?this.props.i18n("importFiles"):e>0?this.props.i18nArray(`dropPasteImport${s}`,{browseFiles:t,browseFolders:r,browse:t}):this.props.i18nArray(`dropPaste${s}`,{browseFiles:t,browseFolders:r,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=>d("div",{className:"uppy-DashboardTab",role:"presentation","data-uppy-acquirer-id":e.id,children:d("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:[d("div",{className:"uppy-DashboardTab-inner",children:e.icon()}),d("div",{className:"uppy-DashboardTab-name",children:e.name})]})});renderAcquirers=e=>{const t=[...e],r=t.splice(e.length-2,e.length);return d(ae,{children:[t.map(n=>this.renderAcquirer(n)),d("span",{role:"presentation",style:{"white-space":"nowrap"},children:r.map(n=>this.renderAcquirer(n))})]})};renderSourcesList=(e,t)=>
7{const{showNativePhotoCameraButton:r,showNativeVideoCameraButton:n}=this.props;let s=[];const o="myDevice";t||s.push({key:o,elements:this.renderMyDeviceAcquirer()}),r&&s.push({key:"nativePhotoCameraButton",elements:this.renderPhotoCamera()}),n&&s.push({key:"nativePhotoCameraButton",elements:this.renderVideoCamera()}),s.push(...e.map(c=>({key:c.id,elements:this.renderAcquirer(c)}))),s.length===1&&s[0].key===o&&(s=[]);const l=[...s],u=l.splice(s.length-2,s.length);return d(ae,{children:[this.renderDropPasteBrowseTagline(s.length),d("div",{className:"uppy-Dashboard-AddFiles-list",role:"tablist",children:[l.map(({key:c,elements:h})=>d(ae,{children:h},c)),d("span",{role:"presentation",style:{"white-space":"nowrap"},children:u.map(({key:c,elements:h})=>d(ae,{children:h},c))})]})]})};renderPoweredByUppy(){const{i18nArray:e}=this.props,t=d("span",{children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",children:d("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z",fillRule:"evenodd"})}),d("span",{className:"uppy-Dashboard-poweredByUppy",children:"Uppy"})]}),r=e("poweredBy",{uppy:t});return d("a",{tabIndex:-1,href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",className:"uppy-Dashboard-poweredBy",children:r})}render(){const{showNativePhotoCameraButton:e,showNativeVideoCameraButton:t,nativeCameraFacingMode:r}=this.props;return d("div",{className:"uppy-Dashboard-AddFiles",children:[this.renderHiddenInput(!1,n=>{this.fileInput=n}),this.renderHiddenInput(!0,n=>{this.folderInput=n}),e&&this.renderHiddenCameraInput("photo",r,n=>{this.mobilePhotoFileInput=n}),t&&this.renderHiddenCameraInput("video",r,n=>{this.mobileVideoFileInput=n}),this.renderSourcesList(this.props.acquirers,this.props.disableLocalFiles),d("div",{className:"uppy-Dashboard-AddFiles-info",children:[this.props.note&&d("div",{className:"uppy-Dashboard-note",children:this.props.note}),this.props.proudlyDisplayPoweredByUppy&&this.renderPoweredByUppy()]})]})}}const za=i=>d("div",{className:ie("uppy-Dashboard-AddFilesPanel",i.className),"data-uppy-panelType":"AddFiles","aria-hidden":!i.showAddFilesPanel,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:i.i18n("addingMoreFiles")}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>i.toggleAddFilesPanel(!1),children:i.i18n("back")})]}),d(ps,{...i})]});function qa(i){const e=i.files[i.fileCardFor],t=()=>{i.uppy.emit("file-editor:cancel",e),i.closeFileEditor()};return d("div",{className:ie("uppy-DashboardContent-panel",i.className),role:"tabpanel","data-uppy-panelType":"FileEditor",id:"uppy-DashboardContent-panel--editor",children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:i.i18nArray("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile",children:e.meta?e.meta.name:e.name})})}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:i.i18n("cancel")}),d("button",{className:"uppy-DashboardContent-save",type:"button",onClick:i.saveFileEditor,children:i.i18n("save")})]}),d("div",{className:"uppy-DashboardContent-panelBody",children:i.editors.map(r=>i.uppy.getPlugin(r.id).render(i.state))})]})}function ja(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:d("g",{fill:"#686DE0",fillRule:"evenodd",children:[d("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"}),d("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"}),d("circle",{cx:"7.5",cy:"9.5",r:"1.5"})]})})}function Ha(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("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 Va(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("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 9H5v8h10V9zm
71 4l5 3v-6l-5 3z",fill:"#19AF67",fillRule:"nonzero"})})}function Wa(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("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 Ga(){return d("svg",{"aria-hidden":"true",focusable:"false",width:"25",height:"25",viewBox:"0 0 25 25",children:d("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 Ka(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("g",{fill:"#A7AFB7",fillRule:"nonzero",children:[d("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"}),d("path",{d:"M15 4v3a1 1 0 0 0 1 1h3V7h-3V4h-1z"})]})})}function Xa(){return d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"25",height:"25",viewBox:"0 0 25 25",children:d("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 $i(i){const e={color:"#838999",icon:Ka()};if(!i)return e;const t=i.split("/")[0],r=i.split("/")[1];return t==="text"?{color:"#5a5e69",icon:Xa()}:t==="image"?{color:"#686de0",icon:ja()}:t==="audio"?{color:"#068dbb",icon:Ha()}:t==="video"?{color:"#19af67",icon:Va()}:t==="application"&&r==="pdf"?{color:"#e25149",icon:Wa()}:t==="application"&&["zip","x-7z-compressed","x-zip-compressed","x-rar-compressed","x-tar","x-gzip","x-apple-diskimage"].indexOf(r)!==-1?{color:"#00C469",icon:Ga()}:e}function ue(i){const{tagName:e}=i.target;if(e==="INPUT"||e==="TEXTAREA"){i.stopPropagation();return}i.preventDefault(),i.stopPropagation()}function fs(i){const{file:e}=i;
7if(e.preview)return d("img",{draggable:!1,className:"uppy-Dashboard-Item-previewImg",alt:e.name,src:e.preview});const{color:t,icon:r}=$i(e.type);return d("div",{className:"uppy-Dashboard-Item-previewIconWrap",children:[d("span",{className:"uppy-Dashboard-Item-previewIcon",style:{color:t},children:r}),d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-Dashboard-Item-previewIconBg",width:"58",height:"76",viewBox:"0 0 58 76",children:d("rect",{fill:"#FFF",width:"58",height:"76",rx:"3",fillRule:"evenodd"})})]})}function Ya(i){const{computedMetaFields:e,requiredMetaFields:t,updateMeta:r,form:n,formState:s}=i,o={text:"uppy-u-reset uppy-c-textInput uppy-Dashboard-FileCard-input"};return e.map(a=>{const l=`uppy-Dashboard-FileCard-input-${a.id}`,u=t.includes(a.id);return d("fieldset",{className:"uppy-Dashboard-FileCard-fieldset",children:[d("label",{className:"uppy-Dashboard-FileCard-label",htmlFor:l,children:a.name}),a.render!==void 0?a.render({value:s[a.id],onChange:c=>r(c,a.id),fieldCSSClasses:o,required:u,form:n.id},Ci):d("input",{className:o.text,id:l,form:n.id,type:a.type||"text",required:u,value:s[a.id],placeholder:a.placeholder,onInput:c=>r(c.target.value,a.id),"data-uppy-super-focusable":!0})]},a.id)})}function Ja(i){const{files:e,fileCardFor:t,toggleFileCard:r,saveFileCard:n,metaFields:s,requiredMetaFields:o,openFileEditor:a,i18n:l,i18nArray:u,className:c,canEditFile:h}=i,v=()=>typeof s=="function"?s(e[t]):s,w=e[t],S=v()??[],P=h(w),E={};S.forEach(x=>{E[x.id]=w.meta[x.id]??""});const[_,f]=Pe(E),y=bt(x=>{x.preventDefault(),n(_,t)},[n,_,t]),F=(x,R)=>{f({..._,[R]:x})},b=()=>{r(!1)},[k]=Pe(()=>{const x=document.createElement("form");return x.setAttribute("tabindex","-1"),x.id=hs(),x}),A=_e(null);return yt(()=>{const x=A.current?.getRootNode()??document;return x instanceof Document?x.body.appendChild(k):(x instanceof ShadowRoot,x.appendChild(k)),k.addEventListener("submit",y),()=>{k.removeEventListener("submit",y),k.parentNode&&k.parentNode.removeChild(k)}},[k,y]),d("div",{className:ie("uppy-Dashboard-FileCard",c),"data-uppy-panelType":"FileCard",onDragOver:ue,onDragLeave:ue,onDrop:ue,onPaste:ue,ref:A,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:u("editing",{file:d("span",{className:"uppy-DashboardContent-titleFile",children:w.meta?w.meta.name:w.name})})}),d("button",{className:"uppy-DashboardContent-back",type:"button",form:k.id,title:l("finishEditingFile"),onClick:b,children:l("cancel")})]}),d("div",{className:"uppy-Dashboard-FileCard-inner",children:[d("div",{className:"uppy-Dashboard-FileCard-preview",style:{backgroundColor:$i(w.type).color},children:[d(fs,{file:w}),P&&d("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-Dashboard-FileCard-edit",onClick:x=>{y(x),a(w)},children:l("editImage")})]}),d("div",{className:"uppy-Dashboard-FileCard-info",children:d(Ya,{computedMetaFields:S,requiredMetaFields:o,updateMeta:F,form:k,formState:_})}),d("div",{className:"uppy-Dashboard-FileCard-actions",children:[d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-FileCard-actionsBtn",type:"submit",form:k.id,children:l("saveChanges")}),d("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-FileCard-actionsBtn",type:"button",onClick:b,form:k.id,children:l("cancel")})]})]})]})}function Qa(i,e){if(i===e)return!0;if(!i||!e)return!1;const t=Object.keys(i),r=Object.keys(e),n=t.length;if(r.length!==n)return!1;for(let s=0;s<n;s++){const o=t[s];if(i[o]!==e[o]||!Object.prototype.hasOwnProperty.call(e,o))return!1}return!0}function Za(i,e="Copy the URL below"){return new Promise(t=>{const r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=i,document.body.appendChild(r),r.select();const n=()=>{document.body.removeChild(r),window.prompt(e,i),t()};try{return document.execCommand("copy")?(document.body.removeChild(r),t()):n()}catch{return document.body.removeChild(r),n()}})}function el({file:i,uploadInProgressOrComplete:e,metaFields:t,canEditFile:r,i18n:n,onClick:s}){return!e&&t&&t.length>0||!e&&r(i)?d("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:()=>s(),children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 14",children:d("g",{fillRule:"evenodd",children:[d("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"}),d("rect",{x:"1",y:"12.293",width:"11",height:"1",rx:".5"}),d("path",{fillRule:"nonzero",d:"M6.793 2.5L9.5 5.207l.707-.707L7.5 1.793z"})]})})}):null}function tl({i18n:i,onClick:e,file:t}){return d("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:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"18",height:"18",viewBox:"0 0 18 18",children:[d("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"}),d("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 il({file:i,uppy:e,i18n:t}){const r=n=>{Za(i.uploadURL,t("copyLinkToClipboardFallback")).then(()=>{e.log("Link copied to clipboard."),e.info(t("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log).then(()=>
vendor: 4,315 bytes, line 7
7n.target.focus({preventScroll:!0}))};return d("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=>r(n),children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"14",height:"14",viewBox:"0 0 14 12",children:d("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 rl(i){const{uppy:e,file:t,uploadInProgressOrComplete:r,canEditFile:n,metaFields:s,showLinkToFileUploadResult:o,showRemoveButton:a,i18n:l,toggleFileCard:u,openFileEditor:c}=i;return d("div",{className:"uppy-Dashboard-Item-actionWrapper",children:[d(el,{i18n:l,file:t,uploadInProgressOrComplete:r,canEditFile:n,metaFields:s,onClick:()=>{s&&s.length>0?u(!0,t.id):c(t)}}),o&&t.uploadURL?d(il,{file:t,uppy:e,i18n:l}):null,a?d(tl,{i18n:l,file:t,onClick:()=>e.removeFile(t.id)}):null]})}const nl=(i,e)=>(typeof e=="function"?e():e).filter(n=>n.id===i)[0].name;function ms(i){const{file:e,toggleFileCard:t,i18n:r,metaFields:n}=i,{missingRequiredMetaFields:s}=e;if(!s?.length)return null;const o=s.map(a=>nl(a,n)).join(", ");return d("div",{className:"uppy-Dashboard-Item-errorMessage",children:[r("missingRequiredMetaFields",{smart_count:s.length,fields:o})," ",d("button",{type:"button",class:"uppy-u-reset uppy-Dashboard-Item-errorMessageBtn",onClick:()=>t(!0,e.id),children:r("editFile")})]})}const sl=i=>{const{author:e,name:t}=i.file.meta;function r(){return i.isSingleFile&&i.containerHeight>=350?90:i.containerWidth<=352?35:i.containerWidth<=576?60:e?20:30}return d("div",{className:"uppy-Dashboard-Item-name",title:t,children:Mn(t,r())})},ol=i=>{const{author:e}=i.file.meta,t="remote"in i.file?i.file.remote?.providerName:void 0,r="·";return e?d("div",{className:"uppy-Dashboard-Item-author",children:[d("a",{href:`${e.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",children:Mn(e.name,13)}),t?d(ae,{children:[` ${r} `,t,` ${r} `]}):null]}):null},al=i=>i.file.size&&d("div",{className:"uppy-Dashboard-Item-statusSize",children:ce(i.file.size)}),ll=i=>i.file.isGhost&&d("span",{children:[" ⢠",d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-reSelect",type:"button",onClick:()=>i.toggleAddFilesPanel(!0),children:i.i18n("reSelect")})]}),ul=({file:i,onClick:e})=>i.error?d("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 dl(i){const{file:e,i18n:t,toggleFileCard:r,metaFields:n,toggleAddFilesPanel:s,isSingleFile:o,containerHeight:a,containerWidth:l}=i;return d("div",{className:"uppy-Dashboard-Item-fileInfo","data-uppy-file-source":e.source,children:[d("div",{className:"uppy-Dashboard-Item-fileName",children:[sl({file:e,isSingleFile:o,containerHeight:a,containerWidth:l}),d(ul,{file:e,onClick:()=>alert(e.error)})]}),d("div",{className:"uppy-Dashboard-Item-status",children:[ol({file:e}),al({file:e}),ll({file:e,toggleAddFilesPanel:s,i18n:t})]}),d(ms,{file:e,i18n:t,toggleFileCard:r,metaFields:n})]})}function cl(i){const{file:e,i18n:t,toggleFileCard:r,metaFields:n,showLinkToFileUploadResult:s}=i,a=e.preview?"rgba(255, 255, 255, 0.5)":$i(e.type).color;return d("div",{className:"uppy-Dashboard-Item-previewInnerWrap",style:{backgroundColor:a},children:[s&&e.uploadURL&&d("a",{className:"uppy-Dashboard-Item-previewLink",href:e.uploadURL,rel:"noreferrer noopener",target:"_blank","aria-label":e.meta.name,children:d("span",{hidden:!0,children:e.meta.name})}),d(fs,{file:e}
7),d(ms,{file:e,i18n:t,toggleFileCard:r,metaFields:n})]})}function hl(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 jr(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 Jt(i){return d("div",{className:"uppy-Dashboard-Item-progress",children:d("button",{className:"uppy-u-reset uppy-c-btn uppy-Dashboard-Item-progressIndicator",type:"button","aria-label":jr(i),title:jr(i),onClick:()=>hl(i),children:i.children})})}function rt({children:i}){return d("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 Qt({progress:i}){const e=2*Math.PI*15;return d("g",{children:[d("circle",{className:"uppy-Dashboard-Item-progressIcon--bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),d("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 pl(i){return!i.file.progress.uploadStarted||i.file.progress.percentage===void 0?null:i.isUploaded?d("div",{className:"uppy-Dashboard-Item-progress",children:d("div",{className:"uppy-Dashboard-Item-progressIndicator",children:d(rt,{children:[d("circle",{r:"15",cx:"18",cy:"18",fill:"#1bb240"}),d("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?d(Jt,{...i,children:d("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:[d("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),d("path",{d:"M7.9 3H10v2H7.9z"}),d("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),d("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"})]})}):i.resumableUploads&&!i.hidePauseResumeButton?d(Jt,{...i,children:d(rt,{children:[d(Qt,{progress:i.file.progress.percentage}),i.file.isPaused?d("polygon",{className:"uppy-Dashboard-Item-progressIcon--play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}):d("g",{className:"uppy-Dashboard-Item-progressIcon--pause",transform:"translate(14.5, 13)",children:[d("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),d("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})]})]})}):!i.resumableUploads&&i.individualCancellation&&!i.hideCancelButton?d(Jt,{...i,children:d(rt,{children:[d(Qt,{progress:i.file.progress.percentage}),d("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"})]})}):d("div",{className:"uppy-Dashboard-Item-progress",children:d("div",{className:"uppy-Dashboard-Item-progressIndicator",children:d(rt,{children:d(Qt,{progress:i.file.progress.percentage})})})})}class fl extends oe{componentDidMount(){const{file:e}=this.props;
7e.preview||this.props.handleRequestThumbnail(e)}shouldComponentUpdate(e){return!Qa(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,r=!!e.progress.uploadComplete&&!t&&!e.error,n=!!e.progress.uploadStarted||!!t,s=e.progress.uploadStarted&&!e.progress.uploadComplete||t,o=e.error||!1,{isGhost:a}=e;let l=(this.props.individualCancellation||!s)&&!r;r&&this.props.showRemoveButtonAfterComplete&&(l=!0);const u=ie({"uppy-Dashboard-Item":!0,"is-inprogress":s&&!this.props.recoveredState,"is-processing":t,"is-complete":r,"is-error":!!o,"is-resumable":this.props.resumableUploads,"is-noIndividualCancellation":!this.props.individualCancellation,"is-ghost":a});return d("div",{className:u,id:`uppy_${e.id}`,role:this.props.role,children:[d("div",{className:"uppy-Dashboard-Item-preview",children:[d(cl,{file:e,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,i18n:this.props.i18n,toggleFileCard:this.props.toggleFileCard,metaFields:this.props.metaFields}),d(pl,{uppy:this.props.uppy,file:e,error:o,isUploaded:r,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})]}),d("div",{className:"uppy-Dashboard-Item-fileInfoAndButtons",children:[d(dl,{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}),d(rl,{file:e,metaFields:this.props.metaFields,showLinkToFileUploadResult:this.props.showLinkToFileUploadResult,showRemoveButton:l,canEditFile:this.props.canEditFile,uploadInProgressOrComplete:n,toggleFileCard:this.props.toggleFileCard,openFileEditor:this.props.openFileEditor,uppy:this.props.uppy,i18n:this.props.i18n})]})]})}}function ml(i,e){const t=[];let r=[];return i.forEach(n=>{r.length<e?r.push(n):(t.push(r),r=[n])}),r.length&&t.push(r),t}function gl({id:i,i18n:e,uppy:t,files:r,resumableUploads:n,hideRetryButton:s,hidePauseResumeButton:o,hideCancelButton:a,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:c,isSingleFile:h,toggleFileCard:v,handleRequestThumbn
7ail:w,handleCancelThumbnail:S,recoveredState:P,individualCancellation:E,itemsPerRow:_,openFileEditor:f,canEditFile:y,toggleAddFilesPanel:F,containerWidth:b,containerHeight:k}){const A=_===1?71:200,x=Ai(()=>{const L=(q,O)=>Number(r[O].isGhost)-Number(r[q].isGhost),B=Object.keys(r);return P&&B.sort(L),ml(B,_)},[r,_,P]),R=L=>d("div",{class:"uppy-Dashboard-filesInner",role:"presentation",children:L.map(B=>d(fl,{uppy:t,id:i,i18n:e,resumableUploads:n,individualCancellation:E,hideRetryButton:s,hidePauseResumeButton:o,hideCancelButton:a,showLinkToFileUploadResult:l,showRemoveButtonAfterComplete:u,metaFields:c,recoveredState:P,isSingleFile:h,containerWidth:b,containerHeight:k,toggleFileCard:v,handleRequestThumbnail:w,handleCancelThumbnail:S,role:"listitem",openFileEditor:f,canEditFile:y,toggleAddFilesPanel:F,file:r[B]},B))},L[0]);return h?d("div",{class:"uppy-Dashboard-files",children:R(x[0])}):d(Fo,{class:"uppy-Dashboard-files",role:"list",data:x,renderRow:R,rowHeight:A})}const Hr=300;class yl extends oe{ref=ho();componentWillEnter(e){this.ref.current.style.opacity="1",this.ref.current.style.transform="none",setTimeout(e,Hr)}componentWillLeave(e){this.ref.current.style.opacity="0",this.ref.current.style.transform="translateY(350%)",setTimeout(e,Hr)}render(){const{children:e}=this.props;return d("div",{className:"uppy-Informer-animated",ref:this.ref,children:e})}}function bl(i,e){return Object.assign(i,e)}function vl(i,e){return i?.key??e}function wl(i,e){const t=i._ptgLinkedRefs||(i._ptgLinkedRefs={});return t[e]||(t[e]=r=>{i.refs[e]=r})}function Ce(i){const e={};for(let t=0;t<i.length;t++)if(i[t]!=null){const r=vl(i[t],t.toString(36));e[r]=i[t]}return e}function _l(i,e){i=i||{},e=e||{};const t=o=>Object.hasOwn(e,o)?e[o]:i[o],r={};let n=[];for(const o in i)Object.hasOwn(e,o)?n.length&&(r[o]=n,n=[]):n.push(o);const s={};for(const o in e){if(Object.hasOwn(r,o))for(let a=0;a<r[o].length;a++){const l=r[o][a];s[r[o][a]]=t(l)}s[o]=t(o)}for(let o=0;o<n.length;o++)s[n[o]]=t(n[o]);return s}const Sl=i=>i;class gs extends oe{constructor(e,t){super(e,t),this.refs={},this.state={children:Ce(le(le(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=Ce(le(e.children)||[]),r=this.state.children;this.setState(s=>({children:_l(s.children,t)}));let n;for(n in t)if(Object.hasOwn(t,n)){const s=r&&Object.hasOwn(r,n);t[n]&&s&&this.currentlyTransitioningKeys[n]?(this.keysToEnter.push(n),this.keysToAbortLeave.push(n)):t[n]&&!s&&!this.currentlyTransitioningKeys[n]&&this.keysToEnter.push(n)}for(n in r)if(Object.hasOwn(r,n)){const s=t&&Object.hasOwn(t,n);r[n]&&!s&&!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 r=Ce(le(this.props.children)||[]);(!r||!Object.hasOwn(r,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 r=Ce(le(this.props.children)||[]);(!r||!Object.hasOwn(r,e))&&this.performLeave(e)}performLeave(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;this.currentlyTransitioningKeys[e]=!0;const r=this.refs[e];r?.componentWillLeave?r.componentWillLeave(this._handleDoneLeaving.bind(this,e)):this._handleDoneLeaving(e)}_handleDoneLeaving(e){if(this.keysToAbortLeave.indexOf(e)!==-1)return;const r=this.refs[e];r?.componentDidLeave&&r.componentDidLeave(),delete this.currentlyTransitioningKeys[e];const n=Ce(le(this.props.children)||[]);if(n&&Object.hasOwn(n,e))this.performEnter(e);else{const s=bl({},this.state.children);delete s[e],this.setState({children:s})}}render({childFactory:e,transitionLeave:t,transitionName:r,transitionAppear:n,transitionEnter:s,transitionLeaveTimeout:o,transitionEnterTimeout:a,transitionAppearTimeout:l,component:u,...c},{children:h}){const v=Object.entries(h).map(([w,S])=>{if(!S)return;const P=wl(this,w);return Yn(e(S),{ref:P,key:w})}
7).filter(Boolean);return Ci(u,c,v)}}gs.defaultProps={component:"span",childFactory:Sl};class Vr extends oe{render(){const{info:e}=this.props.uppy.getState();return d("div",{className:"uppy uppy-Informer",children:d(gs,{children:e.map(t=>d(yl,{children:d("p",{role:"alert",children:[t.message," ",t.details&&d("span",{"aria-label":t.details,"data-microtip-position":"top-left","data-microtip-size":"medium",role:"tooltip",onClick:()=>alert(`${t.message} 8 9 ${t.details}`),children:"?"})]})},t.message))})})}}function Fl({activePickerPanel:i,className:e,hideAllPanels:t,i18n:r,state:n,uppy:s}){const o=_e(null);return d("div",{className:ie("uppy-DashboardContent-panel",e),role:"tabpanel","data-uppy-panelType":"PickerPanel",id:`uppy-DashboardContent-panel--${i.id}`,onDragOver:ue,onDragLeave:ue,onDrop:ue,onPaste:ue,children:[d("div",{className:"uppy-DashboardContent-bar",children:[d("div",{className:"uppy-DashboardContent-title",role:"heading","aria-level":1,children:r("importFrom",{name:i.name})}),d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:t,children:r("cancel")})]}),d("div",{ref:o,className:"uppy-DashboardContent-panelBody",children:s.getPlugin(i.id).render(n,o.current)})]})}const re={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Pl(i,e,t,r={}){if(i)return re.STATE_ERROR;if(e)return re.STATE_COMPLETE;if(t)return re.STATE_PAUSED;let n=re.STATE_WAITING;const s=Object.keys(r);for(let o=0;o<s.length;o++){const{progress:a}=r[s[o]];if(a.uploadStarted&&!a.uploadComplete)return re.STATE_UPLOADING;a.preprocess&&n!==re.STATE_UPLOADING&&(n=re.STATE_PREPROCESSING),a.postprocess&&n!==re.STATE_UPLOADING&&n!==re.STATE_PREPROCESSING&&(n=re.STATE_POSTPROCESSING)}return n}function Tl({files:i,i18n:e,isAllComplete:t,isAllErrored:r,isAllPaused:n,inProgressNotPausedFiles:s,newFiles:o,processingFiles:a}){switch(Pl(r,t,n,i)){case"uploading":return e("uploadingXFiles",{smart_count:s.length});case"preprocessing":case"postprocessing":return e("processingXFiles",{smart_count:a.length});case"paused":return e("uploadPaused");case"waiting":return e("xFilesSelected",{smart_count:o.length});case"complete":return e("uploadComplete");case"error":return e("error")}}function El(i){const{i18n:e,isAllComplete:t,hideCancelButton:r,maxNumberOfFiles:n,toggleAddFilesPanel:s,uppy:o}=i;let{allowNewUpload:a}=i;return a&&n&&(a=i.totalFileCount<i.maxNumberOfFiles),d("div",{className:"uppy-DashboardContent-bar",children:[!t&&!r?d("button",{className:"uppy-DashboardContent-back",type:"button",onClick:()=>o.cancelAll(),children:e("cancel")}):d("div",{}),d("div",{className:"uppy-DashboardContent-title",children:d(Tl,{...i})}),a?d("button",{className:"uppy-DashboardContent-addMore",type:"button","aria-label":e("addMoreFiles"),title:e("addMoreFiles"),onClick:()=>s(!0),children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"15",height:"15",viewBox:"0 0 15 15",children:d("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"})}),d("span",{className:"uppy-DashboardContent-addMoreCaption",children:e("addMore")})]}):d("div",{})]})}
9const me="uppy-transition-slideDownUp",Wr=250;function nt({children:i}){const[e,t]=Pe(null),[r,n]=Pe(""),s=_e(),o=_e(),a=_e(),l=bt(()=>{n(`${me}-enter`),cancelAnimationFrame(a.current),clearTimeout(o.current),o.current=void 0,a.current=requestAnimationFrame(()=>{n(`${me}-enter ${me}-enter-active`),s.current=setTimeout(()=>{n("")},Wr)})},[]),u=bt(()=>{n(`${me}-leave`),cancelAnimationFrame(a.current),clearTimeout(s.current),s.current=void 0,a.current=requestAnimationFrame(()=>{n(`${me}-leave ${me}-leave-active`),o.current=setTimeout(()=>{t(null),n("")},Wr)})},[]);return yt(()=>{const c=le(i)[0];e!==c&&(c&&!e?l():e&&!c&&!o.current&&u(),t(c))},[i,e,l,u]),yt(()=>()=>{clearTimeout(s.current),clearTimeout(o.current),cancelAnimationFrame(a.current)},[]),e?Yn(e,{className:ie(r,e.props.className)}):null}const ne={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete"},Ul="·",Gr=()=>` ${Ul} `;function Cl(i){const{newFiles:e,isUploadStarted:t,recoveredState:r,i18n:n,uploadState:s,isSomeGhost:o,startUpload:a}=i,l=ie("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":s===ne.STATE_WAITING},{"uppy-StatusBar-actionBtn--disabled":o}),u=e&&t&&!r?n("uploadXNewFiles",{smart_count:e}):n("uploadXFiles",{smart_count:e});return d("button",{type:"button",className:l,"aria-label":n("uploadXFiles",{smart_count:e}),onClick:a,disabled:o,"data-uppy-super-focusable":!0,children:u})}function Ol(i){const{i18n:e,uppy:t}=i;return d("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:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"8",height:"10",viewBox:"0 0 8 10",children:d("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 kl(i){const{i18n:e,uppy:t}=i;return d("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:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:d("g",{fill:"none",fillRule:"evenodd",children:[d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("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 xl(i){const{isAllPaused:e,i18n:t,isAllComplete:r,resumableUploads:n,uppy:s}=i,o=t(e?"resume":"pause");function a(){if(!r){if(!n){s.cancelAll();return}if(e){s.resumeAll();return}s.pauseAll()}}return d("button",{title:o,"aria-label":o,className:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onClick:a,"data-cy":"togglePauseResume","data-uppy-super-focusable":!0,children:d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"16",height:"16",viewBox:"0 0 16 16",children:d("g",{fill:"none",fillRule:"evenodd",children:[d("circle",{fill:"#888",cx:"8",cy:"8",r:"8"}),d("path",{fill:"#FFF",d:e?"M6 4.25L11.5 8 6 11.75z":"M5 4.5h2v7H5v-7zm4 0h2v7H9v-7z"})]})})})}function Al(i){const{i18n:e,doneButtonHandler:t}=i;return d("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 ys(){return d("svg",{className:"uppy-StatusBar-spinner","aria-hidden":"true",focusable:"false",width:"14",height:"14",children:d("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 Rl(i){const{progress:e}=i,{value:t,mode:r,message:n}=e;return d("div",{className:"uppy-StatusBar-content",children:[d(ys,{}),r==="determinate"?`${Math.round(t*100)}% · `:"",n]})}function Nl(i){const{numUploads:e,complete:t,totalUploadedSize:r,totalSize:n,totalETA:s,i18n:o}=i,a=e>1,l=ce(r);return d("div",{className:"uppy-StatusBar-statusSecondary",children:[a&&o("filesUploadedOfTotal",{complete:t,smart_count:e}),d("span",{className:"uppy-StatusBar-additionalInfo",children:[a&&Gr(),n!=null?o("dataUploadedOfTotal",{complete:l,total:ce(n)}):o("dataUploadedOfUnknown",{complete:l}),Gr(),s!=null&&o("xTimeLeft",{time:oo(s)})]})]})}function bs(i){const{i18n:e,complete:t,numUploads:r}=i;return d("div",{className:"uppy-StatusBar-statusSecondary",children:e("filesUploadedOfTotal",{complete:t,smart_count:r})})}function Il(i){const{i18n:e,newFiles:t,startUpload:r}=i,n=ie("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--uploadNewlyAdded");return d("div",{className:"uppy-StatusBar-statusSecondary",children:[d("div",{className:"uppy-StatusBar-statusSecondaryHint",children:e("xMoreFilesAdded",{smart_count:t})}),d("button",{type:"button",className:n,"aria-label":e("uploadXFiles",{smart_count:t}),onClick:r,children:e("upload")})]})}function Dl(i){const{i18n:e,supportsUploadProgress:t,totalProgress:r,hideProgressDetail
9s:n,isUploadStarted:s,isAllComplete:o,isAllPaused:a,newFiles:l,numUploads:u,complete:c,totalUploadedSize:h,totalSize:v,totalETA:w,startUpload:S}=i,P=l&&s;if(!s||o)return null;const E=e(a?"paused":"uploading");function _(){return!a&&!P&&!n?t?d(Nl,{numUploads:u,complete:c,totalUploadedSize:h,totalSize:v,totalETA:w,i18n:e}):d(bs,{i18n:e,complete:c,numUploads:u}):null}return d("div",{className:"uppy-StatusBar-content",title:E,children:[a?null:d(ys,{}),d("div",{className:"uppy-StatusBar-status",children:[d("div",{className:"uppy-StatusBar-statusPrimary",children:t&&r!==0?`${E}: ${r}%`:E}),_(),P?d(Il,{i18n:e,newFiles:l,startUpload:S}):null]})]})}function Bl(i){const{i18n:e}=i;return d("div",{className:"uppy-StatusBar-content",role:"status",title:e("complete"),children:d("div",{className:"uppy-StatusBar-status",children:d("div",{className:"uppy-StatusBar-statusPrimary",children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"15",height:"11",viewBox:"0 0 15 11",children:d("path",{d:"M.414 5.843L1.627 4.63l3.472 3.472L13.202 0l1.212 1.213L5.1 10.528z"})}),e("complete")]})})})}function Ml(i){const{error:e,i18n:t,complete:r,numUploads:n}=i;function s(){const o=`${t("uploadFailed")} 10 11 ${e}`;alert(o)}return d("div",{className:"uppy-StatusBar-content",title:t("uploadFailed"),children:[d("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-StatusBar-statusIndicator uppy-c-icon",width:"11",height:"11",viewBox:"0 0 11 11",children:d("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"})}),d("div",{className:"uppy-StatusBar-status",children:[d("div",{className:"uppy-StatusBar-statusPrimary",children:[t("uploadFailed"),d("button",{className:"uppy-u-reset uppy-StatusBar-details","aria-label":t("showErrorDetails"),"data-microtip-position":"top-right","data-microtip-size":"medium",onClick:s,type:"button",children:"?"})]}),d(bs,{i18n:t,complete:r,numUploads:n})]})]})}function Zt(i){const e=[];let t="indeterminate",r;for(const{progress:s}of Object.values(i)){const{preprocess:o,postprocess:a}=s;r==null&&(o||a)&&({mode:t,message:r}=o||a),o?.mode==="determinate"&&e.push(o.value),a?.mode==="determinate"&&e.push(a.value)}const n=e.reduce((s,o)=>s+o/e.length,0);return{mode:t,message:r,value:n}}const{STATE_ERROR:Kr,STATE_WAITING:Ll,STATE_PREPROCESSING:ei,STATE_UPLOADING:st,STATE_POSTPROCESSING:ti,STATE_COMPLETE:ot}=ne;function $l({newFiles:i,allowNewUpload:e,isUploadInProgress:t,isAllPaused:r,resumableUploads:n,error:s,hideUploadButton:o=void 0,hidePauseResumeButton:a=!1,hideCancelButton:l=!1,hideRetryButton:u=!1,recoveredState:c,uploadState:h,totalProgress:v,files:w,supportsUploadProgress:S,hideAfterFinish:P=!1,isSomeGhost:E,doneButtonHandler:_=void 0,isUploadStarted:f,i18n:y,startUpload:F,uppy:b,isAllComplete:k,hideProgressDetails:A=void 0,numUploads:x,complete:R,totalSize:L,totalETA:B,totalUploadedSize:q}){function O(){switch(h){case ti:case ei:{const Xe=Zt(w);return Xe.mode==="determinate"?Xe.value*100:v}case Kr:return null;case st:return S?v:null;default:return v}}function z(){switch(h){case ti:case ei:{const{mode:Xe}=Zt(w);return Xe==="indeterminate"}case st:return!S;default:return!1}}const X=O(),g=X??100,p=!s&&i&&(!t&&!r||c)&&e&&!o,m=!l&&h!==Ll&&h!==ot,T=n&&!a&&h===st,C=s&&!k&&!u,U=_&&h===ot,N=ie("uppy-StatusBar-progress",{"is-indeterminate":z()}),I=ie("uppy-StatusBar",`is-${h}`,{"has-ghosts":E}),D=(()=>{switch(h){case ei:case ti:return d(Rl,{progress:Zt(w)});case ot:return d(Bl,{i18n:y});case Kr:return d(Ml,{error:s,i18n:y,numUploads:x,complete:R});case st:return d(Dl,{i18n:y,supportsUploadProgress:S,totalProgress:v,hideProgressDetails:A,isUploadStarted:f,isAllComplete:k,isAllPaused:r,newFiles:i,numUploads:x,complete:R,totalUploadedSize:q,totalSize:L,totalETA:B,startUpload:F});default:return null}})();return!(p||C||T||m||U)&&!D||h===ot&&P?null:d("div",{className:I,children:[d("div",{className:N,style:{width:`${g}%`},role:"progressbar","aria-label":`${g}%`,"aria-valuetext":`${g}%`,"aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":X}),D,d("div",{className:"uppy-StatusBar-actions",children:[p?d(Cl,{newFiles:i,isUploadStarted:f,re
11coveredState:c,i18n:y,isSomeGhost:E,startUpload:F,uploadState:h}):null,C?d(Ol,{i18n:y,uppy:b}):null,T?d(xl,{isAllPaused:r,i18n:y,isAllComplete:k,resumableUploads:n,uppy:b}):null,m?d(kl,{i18n:y,uppy:b}):null,U?d(Al,{i18n:y,doneButtonHandler:_}):null]})]})}const zl=2e3,ql=2e3;function jl(i,e,t,r){if(i)return ne.STATE_ERROR;if(e)return ne.STATE_COMPLETE;if(t)return ne.STATE_WAITING;let n=ne.STATE_WAITING;const s=Object.keys(r);for(let o=0;o<s.length;o++){const{progress:a}=r[s[o]];if(a.uploadStarted&&!a.uploadComplete)return ne.STATE_UPLOADING;a.preprocess&&(n=ne.STATE_PREPROCESSING),a.postprocess&&n!==ne.STATE_PREPROCESSING&&(n=ne.STATE_POSTPROCESSING)}return n}class Hl extends oe{#e;#t;#r;#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.#n)}componentWillUnmount(){this.props.uppy.off("upload",this.#n)}#n=()=>{const{recoveredState:e}=this.props.uppy.getState();if(this.#r=null,this.#i=null,e){this.#t=Object.values(e.files).reduce((t,{progress:r})=>t+(r.bytesUploaded||0),0);return}this.#e=performance.now(),this.#t=0};#s(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 r=performance.now()-this.#e;if(r===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 s=n/r;if(!Number.isFinite(s)||s<=0)return null;const o=this.#r==null?s:Wi(s,this.#r,zl,r);if(!Number.isFinite(o)||o<=0)return null;this.#r=o;const a=t/o;if(!Number.isFinite(a)||a<0)return null;const l=Math.max((this.#i??0)-r,0),u=this.#i==null?a:Wi(a,l,ql,r);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:r,totalProgress:n,error:s,recoveredState:o}=this.props.uppy.getState(),{newFiles:a,startedFiles:l,completeFiles:u,isUploadStarted:c,isAllComplete:h,isAllPaused:v,isUploadInProgress:w,isSomeGhost:S}=this.props.uppy.getObjectOfFilesPerState(),P=o?Object.values(t):a,E=!!e.resumableUploads,_=e.uploadProgress!==!1;let f=null,y=0;l.every(b=>b.progress.bytesTotal!=null&&b.progress.bytesTotal!==0)?(f=0,l.forEach(b=>{f+=b.progress.bytesTotal||0,y+=b.progress.bytesUploaded||0})):l.forEach(b=>{y+=b.progress.bytesUploaded||0});const F=this.#s({uploaded:y,total:f});return d($l,{error:s,uploadState:jl(s,h,o,t||{}),allowNewUpload:r,totalProgress:n,totalSize:f,totalUploadedSize:y,isAllComplete:h,isAllPaused:v,isUploadStarted:c,isUploadInProgress:w,isSomeGhost:S,recoveredState:o,complete:u.length,newFiles:P.length,numUploads:l.length,totalETA:F,files:t,i18n:this.props.i18n,uppy:this.props.uppy,startUpload:this.startUpload,doneButtonHandler:this.props.doneButtonHandler,resumableUploads:E,supportsUploadProgress:_,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 Xr=900,Yr=700,ii=576,Jr=330;function Vl(i){const e=i.totalFileCount===0,t=i.totalFileCount===1,r=i.containerWidth>ii,n=i.containerHeight>Jr,s=ie({"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>ii,"uppy-size--lg":i.containerWidth>Yr,"uppy-size--xl":i.containerWidth>Xr,"uppy-size--height-md":i.containerHeight>Jr,"uppy-Dashboard--isAddFilesPanelVisible":i.showAddFilesPanel,"uppy-Dashboard--isInnerWrapVisible":i.areInsidesReadyToBeVisible,"uppy-Dashboard--singleFile":i.singleFileFullScreen&&t&&n});let o=1;i.containerWidth>Xr?o=5:i.containerWidth>Yr?o=4:i.containerWidth>ii&&(o=3);const a=i.showSelectedFiles&&!e,l=i.recoveredState?Object.keys(i.recoveredState.files).length:null,u=i.files?Object.keys(i.files).filter(v=>i.files[v].isGhost).length:0,c=()=>u>0?i.i18n("recoveredXFiles",{smart_count:u}):i.i18n("recoveredAllFiles");return d("div",{className:s,"data-uppy-theme":i.theme,"data-uppy-num-acquirers":i.acquirers.length,"data-uppy-drag-drop-supported":!i.disableLocalFiles&&no(),"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:[d("div",{"aria-hidden":"true",className:"uppy-Dashboard-overlay",tabIndex:-1,onClick:i.handleClickOutside}),d("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:d("button",{className:"uppy-u-reset uppy-Dashboard-close",type:"button","aria-label":i.i18n("closeModal"),title:i.i18n("closeModal"),onClick:i.closeModal,children:d("span",{"aria-hidden":"true",children:"Ã"})}),d("div",{className:"uppy-Dashboard-innerWrap",children:[d("div",{className:"uppy-Dashboard-dropFilesHereHint",children:i.i18n("dropHint")}),a&&d(El,{...i}),l!=null&&l>0&&d("div",{className:"uppy-Dashboard-serviceMsg",children:[d("svg",{className:"uppy-Dashboard-serviceMsg-icon","aria-hidden":"true",focusable:"false",width:"21",height:"16",viewBox:"0 0 24 19",children:d("g",{transform:"translate(0 -1)",fill:"none",fillRule:"evenodd",children:[d("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"}),d("path",{fill:"#000",d:"M11 6h2l-.3 8h-1.4z"}),d("circle",{fill:"#000",cx:"12",cy:"17",r:"1"})]})}),d("strong",{className:"uppy-Dashboard-serviceMsg-title",children:i.i18n("sessionRestored")}),d("div",{className:"uppy-Dashboard-serviceMsg-text",children:c()})]}),a?d(gl,{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,handleRequestThumbn
11ail:i.handleRequestThumbnail,handleCancelThumbnail:i.handleCancelThumbnail,recoveredState:i.recoveredState,individualCancellation:i.individualCancellation,openFileEditor:i.openFileEditor,canEditFile:i.canEditFile,toggleAddFilesPanel:i.toggleAddFilesPanel,isSingleFile:t,itemsPerRow:o,containerWidth:i.containerWidth,containerHeight:i.containerHeight}):d(ps,{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}),d(nt,{children:i.showAddFilesPanel?d(za,{...i,isSizeMD:r},"AddFiles"):null}),d(nt,{children:i.fileCardFor?d(Ja,{...i},"FileCard"):null}),d(nt,{children:i.activePickerPanel?d(Fl,{...i},"Picker"):null}),d(nt,{children:i.showFileEditor?d(qa,{...i},"Editor"):null}),d("div",{className:"uppy-Dashboard-progressindicators",children:[!i.disableInformer&&d(Vr,{uppy:i.uppy}),!i.disableStatusBar&&d(Hl,{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&&d(Vr,{uppy:i.uppy}),i.progressindicators.map(v=>i.uppy.getPlugin(v.id).render(i.state))]})]})]})]})}const Wl={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 vs(i,e){if(e){const t=i.querySelector(`[data-uppy-paneltype="${e}"]`);if(t)return t}return i}function Gl(){let i=!1;return da((t,r)=>{const n=vs(t,r),s=n.contains(document.activeElement);if(s&&i)return;const o=n.querySelector("[data-uppy-super-focusable]");s&&!o||(o?(o.focus({preventScroll:!0}
11),i=!0):(n.querySelector(En)?.focus({preventScroll:!0}),i=!1))},260)}function Qr(i,e){const t=e[0];t&&(t.focus(),i.preventDefault())}function Kl(i,e){const t=e[e.length-1];t&&(t.focus(),i.preventDefault())}function Xl(i){return i.contains(document.activeElement)}function ws(i,e,t){const r=vs(t,e),n=Re(r.querySelectorAll(En)),s=n.indexOf(document.activeElement);Xl(r)?i.shiftKey&&s===0?Kl(i,n):!i.shiftKey&&s===n.length-1&&Qr(i,n):Qr(i,n)}function Yl(i,e,t){e===null||ws(i,e,t)}const Zr=9,Jl=27;function en(){const i={};return i.promise=new Promise((e,t)=>{i.resolve=e,i.reject=t}),i}const Ql={target:"body",metaFields:[],thumbnailWidth:280,thumbnailType:"image/jpeg",waitForThumbnailsBeforeUpload:!1,defaultPickerIcon:ca,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};class _s extends Me{static VERSION=$a.version;#e;modalName=`uppy-Dashboard-${hs()}`;superFocus=Gl();ifFocusedOnUppyRecently=!1;dashboardIsDisabled;savedScrollPosition;savedActiveElement;resizeObserver;darkModeMediaQuery;makeDashboardInsidesVisibleAnywayTimeout;constructor(e,t){const r=t?.autoOpen??null;super(e,{...Ql,...t,autoOpen:r}),this.id=this.opts.id||"Dashboard",this.title="Dashboard",this.type="orchestrator",this.defaultLocale=Wl,this.opts.doneButtonHandler===void 0&&(this.opts.doneButtonHandler=()=>{this.uppy.clear(),this.requestCloseModal()}),this.opts.onRequestCloseModal??=()=>this.closeModal(),this.i18nInit()}removeTarget=e=>{const r=this.getPluginState().targets.filter(n=>n.id!==e.id);this.setPluginState({targets:r})};addTarget=e=>{const t=e.id||e.constructor.name,r=e.title||t,n=e.type;if(n!=="acquirer"&&n!=="progressindicator"&&n!=="editor")return this.up
11py.log("Dashboard: can only be targeted by plugins of types: acquirer, progressindicator, editor","error"),null;const s={id:t,name:r,type:n},a=this.getPluginState().targets.slice();return a.push(s),this.setPluginState({targets:a}),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(),r=t.find(n=>n.type==="acquirer"&&n.id===e);this.setPluginState({activePickerPanel:r,activeOverlayType:"PickerPanel"}),this.uppy.emit("dashboard:show-panel",e)};canEditFile=e=>{const{targets:t}=this.getPluginState();return this.#o(t).some(n=>this.uppy.getPlugin(n.id).canEditFile(e))};openFileEditor=e=>{const{targets:t}=this.getPluginState(),r=this.#o(t);this.setPluginState({showFileEditor:!0,fileCardFor:e.id||null,activeOverlayType:"FileEditor"}),r.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.#o(e).forEach(r=>{this.uppy.getPlugin(r.id).save()}),this.closeFileEditor()};openModal=()=>{const{promise:e,resolve:t}=en();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 r=()=>{this.setPluginState({isHidden:!1}),this.el.removeEventListener("animationend",r,!1),t()};this.el.addEventListener("animationend",r,!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:r,isClosing:n}=this.getPluginState();if(r||n)return;const{promise:s,resolve:o}=en();if(this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose){this.setPluginState({isClosing:!0});const a=()=>{this.setPluginState({isHidden:!0,isClosing:!1}),this.superFocus.cancel(),this.savedActiveElement.focus(),this.el.removeEventListener("animationend",a,!1),o()};this.el.addEventListener("animationend",a,!1)}else this.setPluginState({isHidden:!0}),this.superFocus.cancel(),this.savedActiveElement.focus(),o();return document.removeEventListener("keydown",this.handleKeyDownInModal),t&&this.opts.browserBackButtonClose&&history.state?.[this.modalName]&&history.back(),this.uppy.emit("dashboard:modal-closed"),s};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 r=this.uppy.getFile(t);e?this.uppy.emit("dashboard:file-edit-start",r):this.uppy.emit("dashboard:file-edit-complete",r),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(r=>({source:this.id,name:r.name,type:r.type,data:r,meta:{relativePath:r.relativePath||r.webkitRelativePath||null}}));try{this.uppy.addFiles(t)}
11catch(r){this.uppy.log(r)}};startListeningToResize=()=>{this.resizeObserver=new ResizeObserver(e=>{const t=e[0],{width:r,height:n}=t.contentRect;this.setPluginState({containerWidth:r,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])'],r=this.#e??Re(this.el.querySelectorAll(t)).filter(n=>!n.classList.contains("uppy-Dashboard-close"));for(const n of r)n.tagName==="A"?n.setAttribute("aria-disabled",e):n.disabled=e;e?this.#e=r: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===Jl&&this.requestCloseModal(),e.keyCode===Zr&&ws(e,this.getPluginState().activeOverlayType,this.el)};handleClickOutside=()=>{this.opts.closeModalOnClickOutside&&this.requestCloseModal()};handlePaste=e=>{this.uppy.iteratePlugins(r=>{r.type==="acquirer"&&r.handleRootPaste?.(e)});const t=Re(e.clipboardData.files);t.length>0&&(this.uppy.log("[Dashboard] Files pasted"),this.addFiles(t))};handleInputChange=e=>{e.preventDefault();const t=Re(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 o=!0;
11return this.uppy.iteratePlugins(a=>{a.canHandleRootDrop?.(e)&&(o=!0)}),o},r=()=>{const{types:o}=e.dataTransfer;return o.some(a=>a==="Files")},n=t(),s=r();if(!n&&!s||this.opts.disabled||this.opts.disableLocalFiles&&(s||!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(s=>{s.type==="acquirer"&&s.handleRootDrop?.(e)});let t=!1;const r=s=>{this.uppy.log(s,"error"),t||(this.uppy.info(s.message,"error"),t=!0)};this.uppy.log("[Dashboard] Processing dropped files");const n=await io(e.dataTransfer,{logDropError:r});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===Zr&&Yl(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 r=this.uppy.getPlugin(`${this.id}:ThumbnailGenerator`);r?.setOptions({thumbnailWidth:e});const n={...t[0],preview:void 0};r?.requestThumbnail(n).then(()=>{r?.setOptions({thumbnailWidth:this.opts.thumbnailWidth})})}};#r=e=>{const t=e[0],{metaFields:r}=this.getPluginState(),n=r&&r.length>0,s=this.canEditFile(t);n&&this.opts.autoOpen==="metaEditor"?this.toggleFileCard(!0,t.id):s&&this.opts.autoOpen==="imageEditor"&&this.openFileEditor(t)};initEvents=()=>{if(this.opts.trigger&&!this.opts.inline){const e=Gi(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.openM
11odal()` method yourself","warning")}this.startListeningToResize(),document.addEventListener("paste",this.handlePasteOnBody),this.uppy.on("plugin-added",this.#u),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.#r)};removeEvents=()=>{const e=Gi(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.#u),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.#r)};superFocusOnEachUpdate=()=>{const e=this.el.contains(document.activeElement),t=document.activeElement===document.body||document.activeElement===null,r=this.uppy.getState().info.length===0,n=!this.opts.inline;r&&(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}};#n=e=>{const t=this.uppy.getPlugin(e.id);return typeof t.isSupported!="function"?!0:t.isSupported()};#s=e=>e.filter(t=>t.type==="acquirer"&&this.#n(t)).map(this.#i);#a=e=>e.filter(t=>t.type==="progressindicator").map(this.#i);#o=e=>e.filter(t=>t.type==="editor").map(this.#i);render=e=>{const t=this.getPluginState(),{files:r,capabilities:n,allowNewUpload:s}=e,{newFiles:o,uploadStartedFiles:a,completeFiles:l,erroredFiles:u,inProgressFiles:c,inProgressNotPausedFiles:h,processingFiles:v,isUploadStarted:w,isAllComplete:S,isAllPaused:P}=this.uppy.getObjectOfFilesPerState(),E=this.#s(t.targets),_=this.#a(t.targets),f=this.#o(t.targets);let y;return this.opts.theme==="auto"?y=n.darkMode?"dark":"light":y=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}".`)),Vl({state:e,isHidden:t.isHidden,files:r,newFiles:o,uploadStartedFiles:a,completeFiles:l,erroredFiles:u,inProgressFiles:c,inProgressNotPausedFiles:h,processingFiles:v,isUploadStarted:w,isAllComplete:S,isAllPaused:P,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:s,acquirers:E,theme:y,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:_,editors:f,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,f
11ileManagerSelectionType: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})};#l=()=>{const{plugins:e}=this.opts;e.forEach(t=>{const r=this.uppy.getPlugin(t);r?r.mount(this,r):this.uppy.log(`[Uppy] Dashboard could not find plugin '${t}', make sure to uppy.use() the plugins you are specifying`,"warning")})};#p=()=>{this.uppy.iteratePlugins(this.#u)};#u=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:r,waitForThumbnailsBeforeUpload:n}=this.opts;return{thumbnailWidth:e,thumbnailHeight:t,thumbnailType:r,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:r,allowMultipleUploadBatches:n}=this.uppy.opts;(r||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:s}=this.opts;s&&this.mount(s,this),this.opts.disableThumbnailGenerator||this.uppy.use(Ba,{id:this.#d(),...this.#c()}),this.darkModeMediaQuery=typeof window<"u"&&window.matchMedia?window.matchMedia("(prefers-color-scheme: dark)"):null;const o=this.darkModeMediaQuery?this.darkModeMediaQuery.matches:!1;this.uppy.log(`[Dashboard] Dark mode is ${o?"on":"off"}`),this.setDarkModeCapability(o),this.opts.theme==="auto"&&this.darkModeMediaQuery?.addListener(this.handleSystemDarkModeChange),this.#l(),this.#p(),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 r=this.uppy.getPlugin(t);r&&r.unmount()}),this.opts.theme==="auto"&&this.darkModeMediaQuery?.removeListener(this.handleSystemDarkModeChange),this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.unmount(),this.removeEvents()}}function gi(i){"@babel/helpers - typeof";return gi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gi(i)}function Zl(i,e,t){return Object.defineProperty(i,"prototype",{writable:!1}),i}function eu(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function tu(i,e,t){return e=ze(e),iu(i,zi()?Reflect.construct(e,t||[],ze(i).constructor):e.apply(i,t))}function iu(i,e){if(e&&(gi(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ru(i)}function ru(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function nu(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&$e(i,e)}function yi(i){var e=typeof Map=="function"?new Map:void 0;return yi=function(r){if(r===null||!ou(r))return r;if(typeof r!="function")throw new TypeError("Super expression must either be null or a function");if(typeof e<"u"){if(e.has(r))return e.get(r);e.set(r,n)}function n(){return su(r,arguments,ze(this).constructor)}return n.prototype=Object.create(r.prototype,{constructor:{value:n,enumerable:!1,writable:!0,configurable:!0}}),$e(n,r)},yi(i)}function su(i,e,t){if(zi())return Reflect.construct.apply(null,arguments);var r=[null];r.push.apply(r,e);var n=new(i.bind.apply(i,r));return t&&$e(n,t.prototype),n}function zi(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(zi=function(){return!!i})()}function ou(i){try{return Function.toString.call(i).indexOf("[native code]")!==-1}catch{return typeof i=="function"}}function $e(i,e){return $e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},$e(i,e)}function ze(i){return ze=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},ze(i)}var at=(function(i){function e(t){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null,s=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,o=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;if(eu(this,e),r=tu(this,e,[t]),r.originalRequest=s,r.originalResponse=o,r.causingError=n,n!=null&&(t+=", caused by ".concat(n.toString())),s!=null){var a=s.getHeader("X-Request-ID")||"n/a",l=s.getMethod(),u=s.getURL(),c=o?o.getStatus():"n/a",h=o?o.getBody()||"":"n/a";t+=", originated from request (method: ".concat(l,", url: ").concat(u,", response code: ").concat(c,", response text: ").concat(h,", request id: ").concat(a,")")}return r.message=t,r}return nu(e,i),Zl(e)})(yi(Error));function qe(i){"@babel/helpers - typeof";return qe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qe(i)}function au(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function lu(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,du(r.key),r)}}function uu(i,e,t){return e&&lu(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function du(i){var e=cu(i,"string");return qe(e)=="symbol"?e:e+""}function cu(i,e){if(qe(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(qe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var hu=(function(){function i(){au(this,i)}return uu(i,[{key:"listAllUploads",value:function(){return Promise.resolve([])}},{key:"findUploadsByFingerprint",value:function(t){return Promise.resolve([])}},{key:"removeUpload",value:function(t){return Promise.resolve()}},{key:"addUpload",value:function(t,r){return Promise.resolve(null)}}])})();const Ss="3.7.8",pu=Ss,Ee=typeof Buffer=="function",tn=typeof TextDecoder=="function"?new TextDecoder:void 0,rn=typeof TextEncoder=="function"?new TextEncoder:void 0,fu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
11+/=",xe=Array.prototype.slice.call(fu),lt=(i=>{let e={};return i.forEach((t,r)=>e[t]=r),e})(xe),mu=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,K=String.fromCharCode.bind(String),nn=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):i=>new Uint8Array(Array.prototype.slice.call(i,0)),Fs=i=>i.replace(/=/g,"").replace(/[+\/]/g,e=>e=="+"?"-":"_"),Ps=i=>i.replace(/[^A-Za-z0-9\+\/]/g,""),Ts=i=>{let e,t,r,n,s="";const o=i.length%3;for(let a=0;a<i.length;){if((t=i.charCodeAt(a++))>255||(r=i.charCodeAt(a++))>255||(n=i.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=t<<16|r<<8|n,s+=xe[e>>18&63]+xe[e>>12&63]+xe[e>>6&63]+xe[e&63]}return o?s.slice(0,o-3)+"===".substring(o):s},qi=typeof btoa=="function"?i=>btoa(i):Ee?i=>Buffer.from(i,"binary").toString("base64"):Ts,bi=Ee?i=>Buffer.from(i).toString("base64"):i=>{let t=[];for(let r=0,n=i.length;r<n;r+=4096)t.push(K.apply(null,i.subarray(r,r+4096)));return qi(t.join(""))},ht=(i,e=!1)=>e?Fs(bi(i)):bi(i),gu=i=>{if(i.length<2){var e=i.charCodeAt(0);return e<128?i:e<2048?K(192|e>>>6)+K(128|e&63):K(224|e>>>12&15)+K(128|e>>>6&63)+K(128|e&63)}else{var e=65536+(i.charCodeAt(0)-55296)*1024+(i.charCodeAt(1)-56320);return K(240|e>>>18&7)+K(128|e>>>12&63)+K(128|e>>>6&63)+K(128|e&63)}},yu=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Es=i=>i.replace(yu,gu),sn=Ee?i=>Buffer.from(i,"utf8").toString("base64"):rn?i=>bi(rn.encode(i)):i=>qi(Es(i)),Se=(i,e=!1)=>e?Fs(sn(i)):sn(i),on=i=>Se(i,!0),bu=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,vu=i=>{switch(i.length){case 4:var e=(7&i.charCodeAt(0))<<18|(63&i.charCodeAt(1))<<12|(63&i.charCodeAt(2))<<6|63&i.charCodeAt(3),t=e-65536;return K((t>>>10)+55296)+K((t&1023)+56320);case 3:return K((15&i.charCodeAt(0))<<12|(63&i.charCodeAt(1))<<6|63&i.charCodeAt(2));default:return K((31&i.charCodeAt(0))<<6|63&i.charCodeAt(1))}},Us=i=>i.replace(bu,vu),Cs=i=>{if(i=i.replace(/\s+/g,""),!mu.test(i))throw new TypeError("malformed base64.");i+="==".slice(2-(i.length&3));let e,t,r,n=[];for(let s=0;s<i.length;)e=lt[i.charAt(s++)]<<18|lt[i.charAt(s++)]<<12|(t=lt[i.charAt(s++)])<<6|(r=lt[i.charAt(s++)]),t===64?n.push(K(e>>16&255)):r===64?n.push(K(e>>16&255,e>>8&255)):n.push(K(e>>16&255,e>>8&255,e&255));return n.join("")},ji=typeof atob=="function"?i=>atob(Ps(i)):Ee?i=>Buffer.from(i,"base64").toString("binary"):Cs,Os=Ee?i=>nn(Buffer.from(i,"base64")):i=>nn(ji(i).split("").map(e=>e.charCodeAt(0))),ks=i=>Os(xs(i)),wu=Ee?i=>Buffer.from(i,"base64").toString("utf8"):tn?i=>tn.decode(Os(i)):i=>Us(ji(i)),xs=i=>Ps(i.replace(/[-_]/g,e=>e=="-"?"+":"/")),vi=i=>wu(xs(i)),_u=i=>{if(typeof i!="string")return!1;const e=i.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(e)||!/[^\s0-9a-zA-Z\-_]/.test(e)},As=i=>({value:i,enumerable:!1,writable:!0,configurable:!0}),Rs=function(){const i=(e,t)=>Object.defineProperty(String.prototype,e,As(t));i("fromBase64",function(){return vi(this)}),i("toBase64",function(e){return Se(this,e)}),i("toBase64URI",function(){return Se(this,!0)}),i("toBase64URL",function(){return Se(this,!0)}),i("toUint8Array",function(){return ks(this)})},Ns=function(){const i=(e,t)=>Object.defineProperty(Uint8Array.prototype,e,As(t));i("toBase64",function(e){return ht(this,e)}),i("toBase64URI",function(){return ht(this,!0)}),i("toBase64URL",function(){return ht(this,!0)})},Su=()=>{Rs(),Ns()},Fu={version:Ss,VERSION:pu,atob:ji,atobPolyfill:Cs,btoa:qi,btoaPolyfill:Ts,fromBase64:vi,toBase64:Se,encode:Se,encodeURI:on,encodeURL:on,utob:Es,btou:Us,decode:vi,isValid:_u,fromUint8Array:ht,toUint8Array:ks,extendString:Rs,extendUint8Array:Ns,extendBuiltins:Su};var ri,an;function Pu(){return an||(an=1,ri=function(e,t){if(t=t.split(":")[0],e=+e,!e)return!1;switch(t){case"http":case"ws":return e!==80;case"https":case"wss":return e!==443;case"ftp":return e!==21;case"gopher":return e!==70;case"file":return!1}return e!==0}),ri}var ut={},ln;function Tu(){if(ln)return ut;ln=1;var i=Object.prototype.hasOwnProperty,e;function t(o){try{return decodeURIComponent(o.replace(/\+/g," "))}catch{return null}}function r(o){try{return encodeURIComponent(o)}catch{return null}}function n(o){for(var a=/([^=?#&]+)=?([^&]*)/g,l={},u;u=a.exec(o);){var c=t(u[1]),h=t(u[2]);c===null||h===null||c in l||(l[c]=h)}return l}function s(o,a){a=a||"";var l=[],u,c;typeof a!="string"&&(a="?");for(c in o)if(i.call(o,c)){if(u=o[c],!u&&(u===null||u===e||isNaN(u))&&(u=""),c=r(c),u=r(u),c===null||u===null)continue;l.push(c+"="+u)}return l.length?a+l.join("&"):""}return ut.stringify=s,ut.parse=n,ut}var ni,un;
vendor: 7,361 bytes, line 11
11function Eu(){if(un)return ni;un=1;var i=Pu(),e=Tu(),t=/^[\x00-\x20\u00a0\u1680\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]+/,r=/[\n\r\t]/g,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,s=/:\d+$/,o=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\\/]+)?([\S\s]*)/i,a=/^[a-zA-Z]:/;function l(f){return(f||"").toString().replace(t,"")}var u=[["#","hash"],["?","query"],function(y,F){return v(F.protocol)?y.replace(/\\/g,"/"):y},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d*)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],c={hash:1,query:1};function h(f){var y;typeof window<"u"?y=window:typeof be<"u"?y=be:typeof self<"u"?y=self:y={};var F=y.location||{};f=f||F;var b={},k=typeof f,A;if(f.protocol==="blob:")b=new P(unescape(f.pathname),{});else if(k==="string"){b=new P(f,{});for(A in c)delete b[A]}else if(k==="object"){for(A in f)A in c||(b[A]=f[A]);b.slashes===void 0&&(b.slashes=n.test(f.href))}return b}function v(f){return f==="file:"||f==="ftp:"||f==="http:"||f==="https:"||f==="ws:"||f==="wss:"}function w(f,y){f=l(f),f=f.replace(r,""),y=y||{};var F=o.exec(f),b=F[1]?F[1].toLowerCase():"",k=!!F[2],A=!!F[3],x=0,R;return k?A?(R=F[2]+F[3]+F[4],x=F[2].length+F[3].length):(R=F[2]+F[4],x=F[2].length):A?(R=F[3]+F[4],x=F[3].length):R=F[4],b==="file:"?x>=2&&(R=R.slice(2)):v(b)?R=F[4]:b?k&&(R=R.slice(2)):x>=2&&v(y.protocol)&&(R=F[4]),{protocol:b,slashes:k||v(b),slashesCount:x,rest:R}}function S(f,y){if(f==="")return y;for(var F=(y||"/").split("/").slice(0,-1).concat(f.split("/")),b=F.length,k=F[b-1],A=!1,x=0;b--;)F[b]==="."?F.splice(b,1):F[b]===".."?(F.splice(b,1),x++):x&&(b===0&&(A=!0),F.splice(b,1),x--);return A&&F.unshift(""),(k==="."||k==="..")&&F.push(""),F.join("/")}function P(f,y,F){if(f=l(f),f=f.replace(r,""),!(this instanceof P))return new P(f,y,F);var b,k,A,x,R,L,B=u.slice(),q=typeof y,O=this,z=0;for(q!=="object"&&q!=="string"&&(F=y,y=null),F&&typeof F!="function"&&(F=e.parse),y=h(y),k=w(f||"",y),b=!k.protocol&&!k.slashes,O.slashes=k.slashes||b&&y.slashes,O.protocol=k.protocol||y.protocol||"",f=k.rest,(k.protocol==="file:"&&(k.slashesCount!==2||a.test(f))||!k.slashes&&(k.protocol||k.slashesCount<2||!v(O.protocol)))&&(B[3]=[/(.*)/,"pathname"]);z<B.length;z++){if(x=B[z],typeof x=="function"){f=x(f,O);continue}A=x[0],L=x[1],A!==A?O[L]=f:typeof A=="string"?(R=A==="@"?f.lastIndexOf(A):f.indexOf(A),~R&&(typeof x[2]=="number"?(O[L]=f.slice(0,R),f=f.slice(R+x[2])):(O[L]=f.slice(R),f=f.slice(0,R)))):(R=A.exec(f))&&(O[L]=R[1],f=f.slice(0,R.index)),O[L]=O[L]||b&&x[3]&&y[L]||"",x[4]&&(O[L]=O[L].toLowerCase())}F&&(O.query=F(O.query)),b&&y.slashes&&O.pathname.charAt(0)!=="/"&&(O.pathname!==""||y.pathname!=="")&&(O.pathname=S(O.pathname,y.pathname)),O.pathname.charAt(0)!=="/"&&v(O.protocol)&&(O.pathname="/"+O.pathname),i(O.port,O.protocol)||(O.host=O.hostname,O.port=""),O.username=O.password="",O.auth&&(R=O.auth.indexOf(":"),~R?(O.username=O.auth.slice(0,R),O.username=encodeURIComponent(decodeURIComponent(O.username)),O.password=O.auth.slice(R+1),O.password=encodeURIComponent(decodeURIComponent(O.password))):O.username=encodeURIComponent(decodeURIComponent(O.auth)),O.auth=O.password?O.username+":"+O.password:O.username),O.origin=O.protocol!=="file:"&&v(O.protocol)&&O.host?O.protocol+"//"+O.host:"null",O.href=O.toString()}function E(f,y,F){var b=this;switch(f){case"query":typeof y=="string"&&y.length&&(y=(F||e.parse)(y)),b[f]=y;break;case"port":b[f]=y,i(y,b.protocol)?y&&(b.host=b.hostname+":"+y):(b.host=b.hostname,b[f]="");break;case"hostname":b[f]=y,b.port&&(y+=":"+b.port),b.host=y;break;case"host":b[f]=y,s.test(y)?(y=y.split(":"),b.port=y.pop(),b.hostname=y.join(":")):(b.hostname=y,b.port="");break;case"protocol":b.protocol=y.toLowerCase(),b.slashes=!F;break;case"pathname":case"hash":if(y){var k=f==="pathname"?"/":"#";b[f]=y.charAt(0)!==k?k+y:y}else b[f]=y;break;case"username":case"password":b[f]=encodeURIComponent(y);break;case"auth":var A=y.indexOf(":");~A?(b.username=y.slice(0,A),b.username=encodeURIComponent(decodeURIComponent(b.username)),b.password=y.slice(A+1),b.password=encodeURIComponent(decodeURIComponent(b.password))):b.username=encodeURIComponent(decodeURIComponent(y))}for(var x=0;x<u.length;x++){var R=u[x];R[4]&&(b[R[1]]=b[R[1]].toLowerCase())}return b.auth=b.password?b.username+":"+b.password:b.username,b.origin=b.protocol!=="file:"&&v(b.protocol)&&b.host?b.protocol+"//"+b.host:"null",b.href=b.toString(),b}function _(f){(!f||typeof f!="function")&&(f=e.stringify);var y,F=this,b=F.host,k=F.protocol;k&&k.charAt(k.length-1)!==":"&&(k+=":");var A=k+(F.protocol&&F.slashes||v(F.protocol)?"//":"");return F.username?(A+=F.username,F.password&&(A+=":"+F.password),A+="@"):F.password?(A+=":"+F.password,A+="@"):F.protocol!=="file:"&&v(F.protocol)&&!b&&F.pathname!=="/"&&(A+="@"),(b[b.length-1]===":"||s.test(F.hostname)&&!F.port)&&(b+=":"),A+=b+F.pathname,y=typeof F.query=="object"?f(F.query):F.query,y&&(A+=y.charAt(0)!=="?"?"?"+y:y),F.hash&&(A+=F.hash),A}return P.prototype={set:E,toString:_},P.extractProtocol=w,P.location=h,P.trimLeft=l,P.qs=e,ni=P,ni}var Uu=Eu();const Cu=fe(Uu);function Ou(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var e=Math.random()*16|0,t=i==="x"?e:e&3|8;return t.toString(16)})}function wi(){wi=function(){return e};var i,e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(g,p,m){g[p]=m.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function u(g,p,m){return Object.defineProperty(g,p,{value:m,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{u({},"")}catch{u=function(m,T,C){return m[T]=C}}function c(g,p,m,T){var C=p&&p.prototype instanceof _?p:_,U=Object.create(C.prototype),N=new z(T||[]);return n(U,"_invoke",{value:L(g,m,N)}),U}function h(g,p,m){try{return{type:"normal",arg:g.call(p,m)}}catch(T){return{type:"throw",arg:T}}}e.wrap=c;var v="suspendedStart",w="suspendedYield",S="executing",P="completed",E={};function _(){}function f(){}function y(){}var F={};u(F,o,function(){return this});var b=Object.getPrototypeOf,k=b&&b(b(X([])));k&&k!==t&&r.call(k,o)&&(F=k);var A=y.prototype=_.prototype=Object.create(F);function x(g){["next","throw","return"].forEach(function(p){u(g,p,function(m){return this._invoke(p,m)})})}function R(g,p){function m(C,U,N,I){var D=h(g[C],g,U);if(D.type!=="throw"){var Y=D.arg,V=Y.value;return V&&he(V)=="object"&&r.call(V,"__await")?p.resolve(V.__await).then(function(J){m("next",J,N,I)},function(J){m("throw",J,N,I)}):p.resolve(V).then(function(J){Y.value=J,N(Y)},function(J){return m("throw",J,N,I)})}I(D.arg)}var T;n(this,"_invoke",{value:function(U,N){function I(){return new p(function(D,Y){m(U,N,D,Y)})}return T=T?T.then(I,I):I()}})}function L(g,p,m){var T=v;return function(C,U){if(T===S)throw Error("Generator is already running");if(T===P){if(C==="throw")throw U;return{value:i,done:!0}}for(m.method=C,m.arg=U;;){var N=m.delegate;if(N){var I=B(N,m);if(I){if(I===E)continue;return I}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(T===v)throw T=P,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);T=S;var D=h(g,p,m);if(D.type==="normal"){if(T=m.done?P:w,D.arg===E)continue;return{value:D.arg,done:m.done}}D.type==="throw"&&(T=P,m.method="throw",m.arg=D.arg)}}}function B(g,p){var m=p.method,T=g.iterator[m];
vendor: 4,577 bytes, line 11
11if(T===i)return p.delegate=null,m==="throw"&&g.iterator.return&&(p.method="return",p.arg=i,B(g,p),p.method==="throw")||m!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+m+"' method")),E;var C=h(T,g.iterator,p.arg);if(C.type==="throw")return p.method="throw",p.arg=C.arg,p.delegate=null,E;var U=C.arg;return U?U.done?(p[g.resultName]=U.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=i),p.delegate=null,E):U:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,E)}function q(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function O(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function z(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(q,this),this.reset(!0)}function X(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var m=-1,T=function C(){for(;++m<g.length;)if(r.call(g,m))return C.value=g[m],C.done=!1,C;return C.value=i,C.done=!0,C};return T.next=T}}throw new TypeError(he(g)+" is not iterable")}return f.prototype=y,n(A,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:f,configurable:!0}),f.displayName=u(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===f||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,y):(g.__proto__=y,u(g,l,"GeneratorFunction")),g.prototype=Object.create(A),g},e.awrap=function(g){return{__await:g}},x(R.prototype),u(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(g,p,m,T,C){C===void 0&&(C=Promise);var U=new R(c(g,p,m,T),C);return e.isGeneratorFunction(p)?U:U.next().then(function(N){return N.done?N.value:U.next()})},x(A),u(A,l,"Generator"),u(A,o,function(){return this}),u(A,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),m=[];for(var T in p)m.push(T);return m.reverse(),function C(){for(;m.length;){var U=m.pop();if(U in p)return C.value=U,C.done=!1,C}return C.done=!0,C}},e.values=X,z.prototype={constructor:z,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(O),!p)for(var m in this)m.charAt(0)==="t"&&r.call(this,m)&&!isNaN(+m.slice(1))&&(this[m]=i)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var m=this;function T(Y,V){return N.type="throw",N.arg=p,m.next=Y,V&&(m.method="next",m.arg=i),!!V}for(var C=this.tryEntries.length-1;C>=0;--C){var U=this.tryEntries[C],N=U.completion;if(U.tryLoc==="root")return T("end");if(U.tryLoc<=this.prev){var I=r.call(U,"catchLoc"),D=r.call(U,"finallyLoc");if(I&&D){if(this.prev<U.catchLoc)return T(U.catchLoc,!0);if(this.prev<U.finallyLoc)return T(U.finallyLoc)}else if(I){if(this.prev<U.catchLoc)return T(U.catchLoc,!0)}else{if(!D)throw Error("try statement without catch or finally");if(this.prev<U.finallyLoc)return T(U.finallyLoc)}}}},abrupt:function(p,m){for(var T=this.tryEntries.length-1;T>=0;--T){var C=this.tryEntries[T];if(C.tryLoc<=this.prev&&r.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var U=C;break}}U&&(p==="break"||p==="continue")&&U.tryLoc<=m&&m<=U.finallyLoc&&(U=null);var N=U?U.completion:{};return N.type=p,N.arg=m,U?(this.method="next",this.next=U.finallyLoc,E):this.complete(N)},complete:function(p,m){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&m&&(this.next=m),E},finish:function(p){for(var m=this.tryEntries.length-1;m>=0;--m){var T=this.tryEntries[m];if(T.finallyLoc===p)return this.complete(T.completion,T.afterLoc),O(T),E}},catch:function(p){for(var m=this.tryEntries.length-1;m>=0;--m){var T=this.tryEntries[m];if(T.tryLoc===p){var C=T.completion;if(C.type==="throw"){var U=C.arg;O(T)}return U}}throw Error("illegal catch attempt")},delegateYield:function(p,m,T){return this.delegate={iterator:X(p),resultName:m,nextLoc:T},this.method==="next"&&(this.arg=i),E}},e}function dn(i,e,t,r,n,s,o){try{var a=i[s](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(r,n)}function ku(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var s=i.apply(e,t);function o(l){dn(s,r,n,o,a,"next",l)}
11function a(l){dn(s,r,n,o,a,"throw",l)}o(void 0)})}}function Is(i,e){return Ru(i)||Au(i,e)||Ds(i,e)||xu()}function xu(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. 12In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Au(i,e){var t=i==null?null:typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(t!=null){var r,n,s,o,a=[],l=!0,u=!1;try{if(s=(t=t.call(i)).next,e!==0)for(;!(l=(r=s.call(t)).done)&&(a.push(r.value),a.length!==e);l=!0);}catch(c){u=!0,n=c}finally{try{if(!l&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(u)throw n}}return a}}function Ru(i){if(Array.isArray(i))return i}function he(i){"@babel/helpers - typeof";return he=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},he(i)}function Nu(i,e){var t=typeof Symbol<"u"&&i[Symbol.iterator]||i["@@iterator"];if(!t){if(Array.isArray(i)||(t=Ds(i))||e){t&&(i=t);var r=0,n=function(){};return{s:n,n:function(){return r>=i.length?{done:!0}:{done:!1,value:i[r++]}},e:function(u){throw u},f:n}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. 13In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var s=!0,o=!1,a;return{s:function(){t=t.call(i)},n:function(){var u=t.next();return s=u.done,u},e:function(u){o=!0,a=u},f:function(){try{!s&&t.return!=null&&t.return()}finally{if(o)throw a}}}}function Ds(i,e){if(i){if(typeof i=="string")return cn(i,e);var t=Object.prototype.toString.call(i).slice(8,-1);if(t==="Object"&&i.constructor&&(t=i.constructor.name),t==="Map"||t==="Set")return Array.from(i);if(t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t))return cn(i,e)}}function cn(i,e){(e==null||e>i.length)&&(e=i.length);for(var t=0,r=new Array(e);t<e;t++)r[t]=i[t];return r}function hn(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function ge(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?hn(Object(t),!0).forEach(function(r){Iu(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):hn(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Iu(i,e,t){return e=Bs(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function Du(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pn(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Bs(r.key),r)}}function Bu(i,e,t){return e&&pn(i.prototype,e),t&&pn(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Bs(i){var e=Mu(i,"string");return he(e)=="symbol"?e:e+""}function Mu(i,e){if(he(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(he(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var pt="tus-v1",ft="ietf-draft-03",Ae="ietf-draft-05",Lu={endpoint:null,uploadUrl:null,metadata:{},metadataForPartialUploads:{},fingerprint:null,uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,onUploadUrlAvailable:null,overridePatchMethod:!1,headers:{},addRequestId:!1,onBeforeRequest:null,onAfterResponse:null,onShouldRetry:Ms,chunkSize:Number.POSITIVE_INFINITY,retryDelays:[0,1e3,3e3,5e3],parallelUploads:1,parallelUploadBoundaries:null,storeFingerprintForResuming:!0,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1,urlStorage:null,fileReader:null,httpStack:null,protocol:pt},wt=(function(){function i(e,t){Du(this,i),"resume"in t&&console.log("tus: The `resume` option has been removed in tus-js-client v2. Please use the URL storage API instead."),this.options=t,this.options.chunkSize=Number(this.options.chunkSize),this._urlStorage=this.options.urlStorage,this.file=e,this.url=null,this._req=null,this._fingerprint=null,this._urlStorageKey=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0,this._parallelUploads=null,this._parallelUploadUrls=null}return Bu(i,[{key:"findPreviousUploads",value:function(){var t=this;return this.options.fingerprint(this.file,this.options).then(function(r){return t._urlStorage.findUploadsByFingerprint(r)})}},{key:"resumeFromPreviousUpload",value:function(t){this.url=t.uploadUrl||null,this._parallelUploadUrls=t.parallelUploadUrls||null,this._urlStorageKey=t.urlStorageKey}},{key:"start",value:function(){var t=this,r=this.file;if(!r){this._emitError(new Error("tus: no file or stream to upload provided"));return}if(![pt,ft,Ae].includes(this.options.protocol)){this._emitError(new Error("tus: unsupported protocol ".concat(this.options.protocol)));return}if(!this.options.endpoint&&!this.options.uploadUrl&&!this.url){this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));return}var n=this.options.retryDelays;if(n!=null&&Object.prototype.toString.call(n)!=="[object Array]"){this._emitError(new Error("tus: the `retryDelays` option must either be an array or null"));return}if(this.options.parallelUploads>1)for(var s=0,o=["uploadUrl","uploadSize","uploadLengthDeferred"];s<o.length;s++){var a=o[s];if(this.options[a]){this._emitError(new Error("tus: cannot use the ".concat(a," option when parallelUploads is enabled")));return}}if(this.options.parallelUploadBoundaries){if(this.options.parallelUploads<=1){this._emitError(new Error("tus: cannot use the `parallelUploadBoundaries` option when `parallelUploads` is disabled"));return}if(this.options.parallelUploads!==this.options.parallelUploadBoundaries.length){this._emitError(new Error("tus: the `parallelUploadBoundaries` must have the same length as the value of `parallelUploads`"));return}}this.options.fingerprint(r,this.options).then(function(l){return t._fingerprint=l,t._source?t._source:t.options.fileReader.openFile(r,t.options.chunkSize)}).then(function(l){if(t._source=l,t.options.uploadLengthDeferred)t._size=null;else if(t.options.uploadSize!=null){if(t._size=Number(t.options.uploadSize),Number.isNaN(t._size)){t._emitError(new Error("tus: cannot convert `uploadSize` option into a number"));return}}else if(t._size=t._source.size,t._size==null){t._emitError(new Error("tus: cannot automatically derive upload's size from input. Specify it manually using the `uploadSize` option or use the `uploadLengthDeferred` option"));return}t.options.parallelUploads>1||t._parallelUploadUrls!=null?t._startParallelUpload():t._startSingleUpload()}).catch(function(l){t._emitError(l)})}},{key:"_startParallelUpload",value:function(){var t,r=this,n=this._size,s=0;this._parallelUploads=[];var o=this._parallelUploadUrls!=null?this._parallelUploadUrls.length:this.options.parallelUploads,a=(t=this.options.parallelUploadBoundaries)!==null&&t!==void 0?t:zu(this._source.size,o);this._parallelUploadUrls&&a.forEach(function(c,h){c.uploadUrl=r._parallelUploadUrls[h]||null}),this._parallelUploadUrls=new Array(a.length);var l=a.map(function(c,h){var v=0;return r._source.slice(c.start,c.end).then(function(w){var S=w.value;return new Promise(function(P,E){var _=ge(ge({},r.options),{},{uploadUrl:c.uploadUrl||null,storeFingerprintForResuming:!1,removeFingerprintOnSuccess:!1,parallelUploads:1,parallelUploadBoundaries:null,metadata:r.options.metadataForPartialUploads,headers:ge(ge({},r.options.headers),{},{"Upload-Concat":"partial"}),onSuccess:P,onError:E,onProgress:function(F){s=s-v+F,v=F,r._emitProgress(s,n)},onUploadUrlAvailable:function(){r._parallelUploadUrls[h]=f.url,r._parallelUploadUrls.filter(function(F){return!!F}).length===a.length&&r._saveUploadInUrlStorage()}}),f=new i(S,_);f.start(),r._parallelUploads.push(f)})})}),u;Promise.all(l).then(function(){u=r._openRequest("POST",r.options.endpoint),u.setHeader("Upload-Concat","final;".concat(r._parallelUploadUrls.join(" ")));var c=fn(r.options.metadata);return c!==""&&u.setHeader("Upload-Metadata",c),r._sendRequest(u,null)}).then(function(c){if(!ye(c.getStatus(),200)){r._emitHttpError(u,c,"tus: unexpected response while creating upload");return}var h=c.getHeader("Location");
13if(h==null){r._emitHttpError(u,c,"tus: invalid or missing Location header");return}r.url=bn(r.options.endpoint,h),"Created upload at ".concat(r.url),r._emitSuccess(c)}).catch(function(c){r._emitError(c)})}},{key:"_startSingleUpload",value:function(){if(this._aborted=!1,this.url!=null){"Resuming upload from previous URL: ".concat(this.url),this._resumeUpload();return}if(this.options.uploadUrl!=null){"Resuming upload from provided URL: ".concat(this.options.uploadUrl),this.url=this.options.uploadUrl,this._resumeUpload();return}this._createUpload()}},{key:"abort",value:function(t){var r=this;if(this._parallelUploads!=null){var n=Nu(this._parallelUploads),s;try{for(n.s();!(s=n.n()).done;){var o=s.value;o.abort(t)}}catch(a){n.e(a)}finally{n.f()}}return this._req!==null&&this._req.abort(),this._aborted=!0,this._retryTimeout!=null&&(clearTimeout(this._retryTimeout),this._retryTimeout=null),!t||this.url==null?Promise.resolve():i.terminate(this.url,this.options).then(function(){return r._removeFromUrlStorage()})}},{key:"_emitHttpError",value:function(t,r,n,s){this._emitError(new at(n,s,t,r))}},{key:"_emitError",value:function(t){var r=this;if(!this._aborted){if(this.options.retryDelays!=null){var n=this._offset!=null&&this._offset>this._offsetBeforeRetry;if(n&&(this._retryAttempt=0),yn(t,this._retryAttempt,this.options)){var s=this.options.retryDelays[this._retryAttempt++];this._offsetBeforeRetry=this._offset,this._retryTimeout=setTimeout(function(){r.start()},s);return}}if(typeof this.options.onError=="function")this.options.onError(t);else throw t}}},{key:"_emitSuccess",value:function(t){this.options.removeFingerprintOnSuccess&&this._removeFromUrlStorage(),typeof this.options.onSuccess=="function"&&this.options.onSuccess({lastResponse:t})}},{key:"_emitProgress",value:function(t,r){typeof this.options.onProgress=="function"&&this.options.onProgress(t,r)}},{key:"_emitChunkComplete",value:function(t,r,n){typeof this.options.onChunkComplete=="function"&&this.options.onChunkComplete(t,r,n)}},{key:"_createUpload",value:function(){var t=this;if(!this.options.endpoint){this._emitError(new Error("tus: unable to create upload because no endpoint is provided"));return}var r=this._openRequest("POST",this.options.endpoint);this.options.uploadLengthDeferred?r.setHeader("Upload-Defer-Length","1"):r.setHeader("Upload-Length","".concat(this._size));var n=fn(this.options.metadata);n!==""&&r.setHeader("Upload-Metadata",n);var s;this.options.uploadDataDuringCreation&&!this.options.uploadLengthDeferred?(this._offset=0,s=this._addChunkToRequest(r)):((this.options.protocol===ft||this.options.protocol===Ae)&&r.setHeader("Upload-Complete","?0"),s=this._sendRequest(r,null)),s.then(function(o){if(!ye(o.getStatus(),200)){t._emitHttpError(r,o,"tus: unexpected response while creating upload");return}var a=o.getHeader("Location");if(a==null){t._emitHttpError(r,o,"tus: invalid or missing Location header");return}if(t.url=bn(t.options.endpoint,a),"Created upload at ".concat(t.url),typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._size===0){t._emitSuccess(o),t._source.close();return}t._saveUploadInUrlStorage().then(function(){t.options.uploadDataDuringCreation?t._handleUploadResponse(r,o):(t._offset=0,t._performUpload())})}).catch(function(o){t._emitHttpError(r,null,"tus: failed to create upload",o)})}},{key:"_resumeUpload",value:function(){var t=this,r=this._openRequest("HEAD",this.url),n=this._sendRequest(r,null);n.then(function(s){var o=s.getStatus();if(!ye(o,200)){if(o===423){t._emitHttpError(r,s,"tus: upload is currently locked; retry later");return}if(ye(o,400)&&t._removeFromUrlStorage(),!t.options.endpoint){t._emitHttpError(r,s,"tus: unable to resume upload (new upload cannot be created without an endpoint)");return}t.url=null,t._createUpload();return}var a=Number.parseInt(s.getHeader("Upload-Offset"),10);if(Number.isNaN(a)){t._emitHttpError(r,s,"tus: invalid or missing offset value");return}var l=Number.parseInt(s.getHeader("Upload-Length"),10);if(Number.isNaN(l)&&!t.options.uploadLengthDeferred&&t.options.protocol===pt){t._emitHttpError(r,s,"tus: invali
13d or missing length value");return}typeof t.options.onUploadUrlAvailable=="function"&&t.options.onUploadUrlAvailable(),t._saveUploadInUrlStorage().then(function(){if(a===l){t._emitProgress(l,l),t._emitSuccess(s);return}t._offset=a,t._performUpload()})}).catch(function(s){t._emitHttpError(r,null,"tus: failed to resume upload",s)})}},{key:"_performUpload",value:function(){var t=this;if(!this._aborted){var r;this.options.overridePatchMethod?(r=this._openRequest("POST",this.url),r.setHeader("X-HTTP-Method-Override","PATCH")):r=this._openRequest("PATCH",this.url),r.setHeader("Upload-Offset","".concat(this._offset));var n=this._addChunkToRequest(r);n.then(function(s){if(!ye(s.getStatus(),200)){t._emitHttpError(r,s,"tus: unexpected response while uploading chunk");return}t._handleUploadResponse(r,s)}).catch(function(s){t._aborted||t._emitHttpError(r,null,"tus: failed to upload chunk at offset ".concat(t._offset),s)})}}},{key:"_addChunkToRequest",value:function(t){var r=this,n=this._offset,s=this._offset+this.options.chunkSize;return t.setProgressHandler(function(o){r._emitProgress(n+o,r._size)}),this.options.protocol===pt?t.setHeader("Content-Type","application/offset+octet-stream"):this.options.protocol===Ae&&t.setHeader("Content-Type","application/partial-upload"),(s===Number.POSITIVE_INFINITY||s>this._size)&&!this.options.uploadLengthDeferred&&(s=this._size),this._source.slice(n,s).then(function(o){var a=o.value,l=o.done,u=a!=null&&a.size?a.size:0;r.options.uploadLengthDeferred&&l&&(r._size=r._offset+u,t.setHeader("Upload-Length","".concat(r._size)));var c=r._offset+u;return!r.options.uploadLengthDeferred&&l&&c!==r._size?Promise.reject(new Error("upload was configured with a size of ".concat(r._size," bytes, but the source is done after ").concat(c," bytes"))):a===null?r._sendRequest(t):((r.options.protocol===ft||r.options.protocol===Ae)&&t.setHeader("Upload-Complete",l?"?1":"?0"),r._emitProgress(r._offset,r._size),r._sendRequest(t,a))})}},{key:"_handleUploadResponse",value:function(t,r){var n=Number.parseInt(r.getHeader("Upload-Offset"),10);if(Number.isNaN(n)){this._emitHttpError(t,r,"tus: invalid or missing offset value");return}if(this._emitProgress(n,this._size),this._emitChunkComplete(n-this._offset,n,this._size),this._offset=n,n===this._size){this._emitSuccess(r),this._source.close();return}this._performUpload()}},{key:"_openRequest",value:function(t,r){var n=mn(t,r,this.options);return this._req=n,n}},{key:"_removeFromUrlStorage",value:function(){var t=this;this._urlStorageKey&&(this._urlStorage.removeUpload(this._urlStorageKey).catch(function(r){t._emitError(r)}),this._urlStorageKey=null)}},{key:"_saveUploadInUrlStorage",value:function(){var t=this;if(!this.options.storeFingerprintForResuming||!this._fingerprint||this._urlStorageKey!==null)return Promise.resolve();var r={size:this._size,metadata:this.options.metadata,creationTime:new Date().toString()};return this._parallelUploads?r.parallelUploadUrls=this._parallelUploadUrls:r.uploadUrl=this.url,this._urlStorage.addUpload(this._fingerprint,r).then(function(n){t._urlStorageKey=n})}},{key:"_sendRequest",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return gn(t,r,this.options)}}],[{key:"terminate",value:function(t){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},n=mn("DELETE",t,r);return gn(n,null,r).then(function(s){if(s.getStatus()!==204)throw new at("tus: unexpected response while terminating upload",null,n,s)}).catch(function(s){if(s instanceof at||(s=new at("tus: failed to terminate upload",s,n,null)),!yn(s,0,r))throw s;var o=r.retryDelays[0],a=r.retryDelays.slice(1),l=ge(ge({},r),{},{retryDelays:a});return new Promise(function(u){return setTimeout(u,o)}).then(function(){return i.terminate(t,l)})})}}])})();function fn(i){return Object.entries(i).map(function(e){var t=Is(e,2),r=t[0],n=t[1];return"".concat(r," ").concat(Fu.encode(String(n)))}).join(",")}function ye(i,e){return i>=e&&i<e+100}function mn(i,e,t){var r=t.httpStack.createRequest(i,e);t.protocol===ft?r.setHeader("Upload-Draft-Interop-Version","5"):t.protocol===Ae?r.setHeader("Upload-Draft-Interop-Version","6"):r.setHeader("Tus-Resumable","1.0.0");for(var n=t.headers||{},s=0,o=Object.entries(n);s<o.length;s++){var a=Is(o[s],2),l=a[0],u=a[1];r.setHeader(l,u)}if(t.addRequestId){var c=Ou();r.setHeader("X-Request-ID",c)}return r}function gn(i,e,t){return _i.apply(this,arguments)}function _i(){return _i=ku(wi().mark(function i(e,t,r){var n;return wi().wrap(function(o){for(;;)switch(o.prev=o.next){case 0:if(typeof r.onBeforeRequest!="function"){o.next=3;break}return o.next=3,r.onBeforeRequest(e);case 3:return o.next=5,e.send(t);case 5:if(n=o.sent,typeof r.onAfterResponse!="function"){o.next=9;break}return o.next=9,r.onAfterResponse(e,n);case 9:return o.abrupt("return",n);case 10:case"end":return o.stop()}},i)})),_i.apply(this,arguments)}function $u(){var i=!0;return typeof navigator<"u"&&navigator.onLine===!1&&(i=!1),i}function yn(i,e,t){return t.retryDelays==null||e>=t.retryDelays.length||i.originalRequest==null?!1:t&&typeof t.onShouldRetry=="function"?t.onShouldRetry(i,e,t):Ms(i)}function Ms(i){var e=i.originalResponse?i.originalResponse.getStatus():0;return(!ye(e,400)||e===409||e===423)&&$u()}function bn(i,e){return new Cu(e,i).toString()}function zu(i,e){for(var t=Math.floor(i/e),r=[],n=0;n<e;n++)r.push({start:t*n,end:t*(n+1)});return r[e-1].end=i,r}wt.defaultOptions=Lu;var Ls=function(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"};function qu(i){return new Promise(function(e,t){var r=new XMLHttpRequest;r.responseType="blob",r.onload=function(){var n=r.response;e(n)},r.onerror=function(n){t(n)},r.open("GET",i),r.send()})}var ju=function(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")};function Hu(i){return new Promise(function(e,t){var r=new FileReader;r.onload=function(){var n=new Uint8Array(r.result);e({value:n})},r.onerror=function(n){t(n)},r.readAsArrayBuffer(i)})}function je(i){"@babel/helpers - typeof";return je=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},je(i)}function Vu(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Wu(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Ku(r.key),r)}}function Gu(i,e,t){return e&&Wu(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Ku(i){var e=Xu(i,"string");return je(e)=="symbol"?e:e+""}function Xu(i,e){if(je(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(je(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var vn=(function(){function i(e){Vu(this,i),this._file=e,this.size=e.size}
13return Gu(i,[{key:"slice",value:function(t,r){if(ju())return Hu(this._file.slice(t,r));var n=this._file.slice(t,r),s=r>=this.size;return Promise.resolve({value:n,done:s})}},{key:"close",value:function(){}}])})();function He(i){"@babel/helpers - typeof";return He=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},He(i)}function Yu(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ju(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Zu(r.key),r)}}function Qu(i,e,t){return e&&Ju(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Zu(i){var e=ed(i,"string");return He(e)=="symbol"?e:e+""}function ed(i,e){if(He(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(He(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}function wn(i){return i===void 0?0:i.size!==void 0?i.size:i.length}function td(i,e){if(i.concat)return i.concat(e);if(i instanceof Blob)return new Blob([i,e],{type:i.type});if(i.set){var t=new i.constructor(i.length+e.length);return t.set(i),t.set(e,i.length),t}throw new Error("Unknown data type")}var id=(function(){function i(e){Yu(this,i),this._buffer=void 0,this._bufferOffset=0,this._reader=e,this._done=!1}return Qu(i,[{key:"slice",value:function(t,r){return t<this._bufferOffset?Promise.reject(new Error("Requested data is before the reader's current offset")):this._readUntilEnoughDataOrDone(t,r)}},{key:"_readUntilEnoughDataOrDone",value:function(t,r){var n=this,s=r<=this._bufferOffset+wn(this._buffer);if(this._done||s){var o=this._getDataFromBuffer(t,r),a=o==null?this._done:!1;return Promise.resolve({value:o,done:a})}return this._reader.read().then(function(l){var u=l.value,c=l.done;return c?n._done=!0:n._buffer===void 0?n._buffer=u:n._buffer=td(n._buffer,u),n._readUntilEnoughDataOrDone(t,r)})}},{key:"_getDataFromBuffer",value:function(t,r){t>this._bufferOffset&&(this._buffer=this._buffer.slice(t-this._bufferOffset),this._bufferOffset=t);var n=wn(this._buffer)===0;return this._done&&n?null:this._buffer.slice(0,r-t)}},{key:"close",value:function(){this._reader.cancel&&this._reader.cancel()}}])})();function pe(i){"@babel/helpers - typeof";return pe=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pe(i)}function Si(){Si=function(){return e};var i,e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(g,p,m){g[p]=m.value},s=typeof Symbol=="function"?Symbol:{},o=s.iterator||"@@iterator",a=s.asyncIterator||"@@asyncIterator",l=s.toStringTag||"@@toStringTag";function u(g,p,m){return Object.defineProperty(g,p,{value:m,enumerable:!0,configurable:!0,writable:!0}),g[p]}try{u({},"")}catch{u=function(m,T,C){return m[T]=C}}function c(g,p,m,T){var C=p&&p.prototype instanceof _?p:_,U=Object.create(C.prototype),N=new z(T||[]);return n(U,"_invoke",{value:L(g,m,N)}),U}function h(g,p,m){try{return{type:"normal",arg:g.call(p,m)}}catch(T){return{type:"throw",arg:T}}}e.wrap=c;var v="suspendedStart",w="suspendedYield",S="executing",P="completed",E={};function _(){}function f(){}function y(){}var F={};u(F,o,function(){return this});var b=Object.getPrototypeOf,k=b&&b(b(X([])));k&&k!==t&&r.call(k,o)&&(F=k);var A=y.prototype=_.prototype=Object.create(F);function x(g){["next","throw","return"].forEach(function(p){u(g,p,function(m){return this._invoke(p,m)})})}function R(g,p){function m(C,U,N,I){var D=h(g[C],g,U);if(D.type!=="throw"){var Y=D.arg,V=Y.value;return V&&pe(V)=="object"&&r.call(V,"__await")?p.resolve(V.__await).then(function(J){m("next",J,N,I)},function(J){m("throw",J,N,I)}):p.resolve(V).then(function(J){Y.value=J,N(Y)},function(J){return m("throw",J,N,I)})}I(D.arg)}var T;n(this,"_invoke",{value:function(U,N){function I(){return new p(function(D,Y){m(U,N,D,Y)})}return T=T?T.then(I,I):I()}})}function L(g,p,m){var T=v;return function(C,U){if(T===S)throw Error("Generator is already running");if(T===P){if(C==="throw")throw U;return{value:i,done:!0}}for(m.method=C,m.arg=U;;){var N=m.delegate;if(N){var I=B(N,m);if(I){if(I===E)continue;return I}}if(m.method==="next")m.sent=m._sent=m.arg;else if(m.method==="throw"){if(T===v)throw T=P,m.arg;m.dispatchException(m.arg)}else m.method==="return"&&m.abrupt("return",m.arg);T=S;var D=h(g,p,m);if(D.type==="normal"){if(T=m.done?P:w,D.arg===E)continue;return{value:D.arg,done:m.done}}D.type==="throw"&&(T=P,m.method="throw",m.arg=D.arg)}}}function B(g,p){var m=p.method,T=g.iterator[m];
vendor: 4,577 bytes, line 13
13if(T===i)return p.delegate=null,m==="throw"&&g.iterator.return&&(p.method="return",p.arg=i,B(g,p),p.method==="throw")||m!=="return"&&(p.method="throw",p.arg=new TypeError("The iterator does not provide a '"+m+"' method")),E;var C=h(T,g.iterator,p.arg);if(C.type==="throw")return p.method="throw",p.arg=C.arg,p.delegate=null,E;var U=C.arg;return U?U.done?(p[g.resultName]=U.value,p.next=g.nextLoc,p.method!=="return"&&(p.method="next",p.arg=i),p.delegate=null,E):U:(p.method="throw",p.arg=new TypeError("iterator result is not an object"),p.delegate=null,E)}function q(g){var p={tryLoc:g[0]};1 in g&&(p.catchLoc=g[1]),2 in g&&(p.finallyLoc=g[2],p.afterLoc=g[3]),this.tryEntries.push(p)}function O(g){var p=g.completion||{};p.type="normal",delete p.arg,g.completion=p}function z(g){this.tryEntries=[{tryLoc:"root"}],g.forEach(q,this),this.reset(!0)}function X(g){if(g||g===""){var p=g[o];if(p)return p.call(g);if(typeof g.next=="function")return g;if(!isNaN(g.length)){var m=-1,T=function C(){for(;++m<g.length;)if(r.call(g,m))return C.value=g[m],C.done=!1,C;return C.value=i,C.done=!0,C};return T.next=T}}throw new TypeError(pe(g)+" is not iterable")}return f.prototype=y,n(A,"constructor",{value:y,configurable:!0}),n(y,"constructor",{value:f,configurable:!0}),f.displayName=u(y,l,"GeneratorFunction"),e.isGeneratorFunction=function(g){var p=typeof g=="function"&&g.constructor;return!!p&&(p===f||(p.displayName||p.name)==="GeneratorFunction")},e.mark=function(g){return Object.setPrototypeOf?Object.setPrototypeOf(g,y):(g.__proto__=y,u(g,l,"GeneratorFunction")),g.prototype=Object.create(A),g},e.awrap=function(g){return{__await:g}},x(R.prototype),u(R.prototype,a,function(){return this}),e.AsyncIterator=R,e.async=function(g,p,m,T,C){C===void 0&&(C=Promise);var U=new R(c(g,p,m,T),C);return e.isGeneratorFunction(p)?U:U.next().then(function(N){return N.done?N.value:U.next()})},x(A),u(A,l,"Generator"),u(A,o,function(){return this}),u(A,"toString",function(){return"[object Generator]"}),e.keys=function(g){var p=Object(g),m=[];for(var T in p)m.push(T);return m.reverse(),function C(){for(;m.length;){var U=m.pop();if(U in p)return C.value=U,C.done=!1,C}return C.done=!0,C}},e.values=X,z.prototype={constructor:z,reset:function(p){if(this.prev=0,this.next=0,this.sent=this._sent=i,this.done=!1,this.delegate=null,this.method="next",this.arg=i,this.tryEntries.forEach(O),!p)for(var m in this)m.charAt(0)==="t"&&r.call(this,m)&&!isNaN(+m.slice(1))&&(this[m]=i)},stop:function(){this.done=!0;var p=this.tryEntries[0].completion;if(p.type==="throw")throw p.arg;return this.rval},dispatchException:function(p){if(this.done)throw p;var m=this;function T(Y,V){return N.type="throw",N.arg=p,m.next=Y,V&&(m.method="next",m.arg=i),!!V}for(var C=this.tryEntries.length-1;C>=0;--C){var U=this.tryEntries[C],N=U.completion;if(U.tryLoc==="root")return T("end");if(U.tryLoc<=this.prev){var I=r.call(U,"catchLoc"),D=r.call(U,"finallyLoc");if(I&&D){if(this.prev<U.catchLoc)return T(U.catchLoc,!0);if(this.prev<U.finallyLoc)return T(U.finallyLoc)}else if(I){if(this.prev<U.catchLoc)return T(U.catchLoc,!0)}else{if(!D)throw Error("try statement without catch or finally");if(this.prev<U.finallyLoc)return T(U.finallyLoc)}}}},abrupt:function(p,m){for(var T=this.tryEntries.length-1;T>=0;--T){var C=this.tryEntries[T];if(C.tryLoc<=this.prev&&r.call(C,"finallyLoc")&&this.prev<C.finallyLoc){var U=C;break}}U&&(p==="break"||p==="continue")&&U.tryLoc<=m&&m<=U.finallyLoc&&(U=null);var N=U?U.completion:{};return N.type=p,N.arg=m,U?(this.method="next",this.next=U.finallyLoc,E):this.complete(N)},complete:function(p,m){if(p.type==="throw")throw p.arg;return p.type==="break"||p.type==="continue"?this.next=p.arg:p.type==="return"?(this.rval=this.arg=p.arg,this.method="return",this.next="end"):p.type==="normal"&&m&&(this.next=m),E},finish:function(p){for(var m=this.tryEntries.length-1;m>=0;--m){var T=this.tryEntries[m];if(T.finallyLoc===p)return this.complete(T.completion,T.afterLoc),O(T),E}},catch:function(p){for(var m=this.tryEntries.length-1;m>=0;--m){var T=this.tryEntries[m];if(T.tryLoc===p){var C=T.completion;if(C.type==="throw"){var U=C.arg;O(T)}return U}}throw Error("illegal catch attempt")},delegateYield:function(p,m,T){return this.delegate={iterator:X(p),resultName:m,nextLoc:T},this.method==="next"&&(this.arg=i),E}},e}function _n(i,e,t,r,n,s,o){try{var a=i[s](o),l=a.value}catch(u){t(u);return}a.done?e(l):Promise.resolve(l).then(r,n)}function rd(i){return function(){var e=this,t=arguments;return new Promise(function(r,n){var s=i.apply(e,t);function o(l){_n(s,r,n,o,a,"next",l)}
13function a(l){_n(s,r,n,o,a,"throw",l)}o(void 0)})}}function nd(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function sd(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,ad(r.key),r)}}function od(i,e,t){return e&&sd(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function ad(i){var e=ld(i,"string");return pe(e)=="symbol"?e:e+""}function ld(i,e){if(pe(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(pe(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var ud=(function(){function i(){nd(this,i)}return od(i,[{key:"openFile",value:(function(){var e=rd(Si().mark(function r(n,s){var o;return Si().wrap(function(l){for(;;)switch(l.prev=l.next){case 0:if(!(Ls()&&n&&typeof n.uri<"u")){l.next=11;break}return l.prev=1,l.next=4,qu(n.uri);case 4:return o=l.sent,l.abrupt("return",new vn(o));case 8:throw l.prev=8,l.t0=l.catch(1),new Error("tus: cannot fetch `file.uri` as Blob, make sure the uri is correct and accessible. ".concat(l.t0));case 11:if(!(typeof n.slice=="function"&&typeof n.size<"u")){l.next=13;break}return l.abrupt("return",Promise.resolve(new vn(n)));case 13:if(typeof n.read!="function"){l.next=18;break}if(s=Number(s),Number.isFinite(s)){l.next=17;break}return l.abrupt("return",Promise.reject(new Error("cannot create source for stream without a finite value for the `chunkSize` option")));case 17:return l.abrupt("return",Promise.resolve(new id(n,s)));case 18:return l.abrupt("return",Promise.reject(new Error("source object may only be an instance of File, Blob, or Reader in this environment")));case 19:case"end":return l.stop()}},r,null,[[1,8]])}));function t(r,n){return e.apply(this,arguments)}return t})()}])})();function dd(i,e){return Ls()?Promise.resolve(cd(i,e)):Promise.resolve(["tus-br",i.name,i.type,i.size,i.lastModified,e.endpoint].join("-"))}function cd(i,e){var t=i.exif?hd(JSON.stringify(i.exif)):"noexif";return["tus-rn",i.name||"noname",i.size||"nosize",t,e.endpoint].join("/")}function hd(i){var e=0;if(i.length===0)return e;for(var t=0;t<i.length;t++){var r=i.charCodeAt(t);e=(e<<5)-e+r,e&=e}return e}function Ve(i){"@babel/helpers - typeof";return Ve=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Ve(i)}function Hi(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function pd(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,fd(r.key),r)}}function Vi(i,e,t){return e&&pd(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function fd(i){var e=md(i,"string");return Ve(e)=="symbol"?e:e+""}function md(i,e){if(Ve(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Ve(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var gd=(function(){function i(){Hi(this,i)}return Vi(i,[{key:"createRequest",value:function(t,r){return new yd(t,r)}},{key:"getName",value:function(){return"XHRHttpStack"}}])})(),yd=(function(){function i(e,t){Hi(this,i),this._xhr=new XMLHttpRequest,this._xhr.open(e,t,!0),this._method=e,this._url=t,this._headers={}}return Vi(i,[{key:"getMethod",value:function(){return this._method}},{key:"getURL",value:function(){return this._url}},{key:"setHeader",value:function(t,r){this._xhr.setRequestHeader(t,r),this._headers[t]=r}},{key:"getHeader",value:function(t){return this._headers[t]}},{key:"setProgressHandler",value:function(t){"upload"in this._xhr&&(this._xhr.upload.onprogress=function(r){r.lengthComputable&&t(r.loaded)})}},{key:"send",value:function(){var t=this,r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null;return new Promise(function(n,s){t._xhr.onload=function(){n(new bd(t._xhr))},t._xhr.onerror=function(o){s(o)},t._xhr.send(r)})}},{key:"abort",value:function(){return this._xhr.abort(),Promise.resolve()}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})(),bd=(function(){function i(e){Hi(this,i),this._xhr=e}return Vi(i,[{key:"getStatus",value:function(){return this._xhr.status}},{key:"getHeader",value:function(t){return this._xhr.getResponseHeader(t)}},{key:"getBody",value:function(){return this._xhr.responseText}},{key:"getUnderlyingObject",value:function(){return this._xhr}}])})();function We(i){"@babel/helpers - typeof";return We=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},We(i)}function vd(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function wd(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,Sd(r.key),r)}}function _d(i,e,t){return e&&wd(i.prototype,e),Object.defineProperty(i,"prototype",{writable:!1}),i}function Sd(i){var e=Fd(i,"string");return We(e)=="symbol"?e:e+""}function Fd(i,e){if(We(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(We(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(i)}var Fi=!1;try{Fi="localStorage"in window;var si="tusSupport",Sn=localStorage.getItem(si);localStorage.setItem(si,Sn),Sn===null&&localStorage.removeItem(si)}
13catch(i){if(i.code===i.SECURITY_ERR||i.code===i.QUOTA_EXCEEDED_ERR)Fi=!1;else throw i}var Pd=Fi,Td=(function(){function i(){vd(this,i)}return _d(i,[{key:"findAllUploads",value:function(){var t=this._findEntries("tus::");return Promise.resolve(t)}},{key:"findUploadsByFingerprint",value:function(t){var r=this._findEntries("tus::".concat(t,"::"));return Promise.resolve(r)}},{key:"removeUpload",value:function(t){return localStorage.removeItem(t),Promise.resolve()}},{key:"addUpload",value:function(t,r){var n=Math.round(Math.random()*1e12),s="tus::".concat(t,"::").concat(n);return localStorage.setItem(s,JSON.stringify(r)),Promise.resolve(s)}},{key:"_findEntries",value:function(t){for(var r=[],n=0;n<localStorage.length;n++){var s=localStorage.key(n);if(s.indexOf(t)===0)try{var o=JSON.parse(localStorage.getItem(s));o.urlStorageKey=s,r.push(o)}catch{}}return r}}])})();function Te(i){"@babel/helpers - typeof";return Te=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Te(i)}function Ed(i,e){if(!(i instanceof e))throw new TypeError("Cannot call a class as a function")}function Ud(i,e){for(var t=0;t<e.length;t++){var r=e[t];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(i,zs(r.key),r)}}function Cd(i,e,t){return t&&Ud(i,t),Object.defineProperty(i,"prototype",{writable:!1}),i}function Od(i,e,t){return e=_t(e),kd(i,$s()?Reflect.construct(e,t||[],_t(i).constructor):e.apply(i,t))}function kd(i,e){if(e&&(Te(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return xd(i)}function xd(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function $s(){try{var i=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return($s=function(){return!!i})()}function _t(i){return _t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},_t(i)}function Ad(i,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");i.prototype=Object.create(e&&e.prototype,{constructor:{value:i,writable:!0,configurable:!0}}),Object.defineProperty(i,"prototype",{writable:!1}),e&&Pi(i,e)}function Pi(i,e){return Pi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,n){return r.__proto__=n,r},Pi(i,e)}function Fn(i,e){var t=Object.keys(i);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(i);e&&(r=r.filter(function(n){return Object.getOwnPropertyDescriptor(i,n).enumerable})),t.push.apply(t,r)}return t}function we(i){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?Fn(Object(t),!0).forEach(function(r){Rd(i,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(i,Object.getOwnPropertyDescriptors(t)):Fn(Object(t)).forEach(function(r){Object.defineProperty(i,r,Object.getOwnPropertyDescriptor(t,r))})}return i}function Rd(i,e,t){return e=zs(e),e in i?Object.defineProperty(i,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):i[e]=t,i}function zs(i){var e=Nd(i,"string");return Te(e)=="symbol"?e:e+""}function Nd(i,e){if(Te(i)!="object"||!i)return i;var t=i[Symbol.toPrimitive];if(t!==void 0){var r=t.call(i,e);if(Te(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(i)}var Ti=we(we({},wt.defaultOptions),{},{httpStack:new gd,fileReader:new ud,urlStorage:Pd?new Td:new hu,fingerprint:dd}),Id=(function(i){function e(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return Ed(this,e),r=we(we({},Ti),r),Od(this,e,[t,r])}return Ad(e,i),Cd(e,null,[{key:"terminate",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return n=we(we({},Ti),n),wt.terminate(r,n)}}])})(wt);const Dd="5.1.0",Bd={version:Dd};function Md(){return typeof window<"u"&&(typeof window.PhoneGap<"u"||typeof window.Cordova<"u"||typeof window.cordova<"u")}function Ld(){return typeof navigator<"u"&&typeof navigator.product=="string"&&navigator.product.toLowerCase()==="reactnative"}function $d(i){return(e,t)=>{if(Md()||Ld())return Ti.fingerprint(e,t);const r=["tus",i.id,t.endpoint].join("-");return Promise.resolve(r)}}const qs={endpoint:"",uploadUrl:null,metadata:{},uploadSize:null,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,overridePatchMethod:!1,headers:{},addRequestId:!1,chunkSize:1/0,retryDelays:[100,1e3,3e3,5e3],parallelUploads:1,removeFingerprintOnSuccess:!1,uploadLengthDeferred:!1,uploadDataDuringCreation:!1},zd={limit:20,retryDelays:qs.retryDelays,withCredentials:!1,allowedMetaFields:!0};class qd extends Ri{static VERSION=Bd.version;#e;requests;uploaders;uploaderEvents;constructor(e,t){if(super(e,{...zd,...t}),this.type="uploader",this.id=this.opts.id||"Tus",t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");if("autoRetry"in t)throw new Error("The `autoRetry` option was deprecated and has been removed.");this.requests=this.opts.rateLimitedQueue??new Dn(this.opts.limit),this.#e=this.opts.retryDelays?.values(),this.uploaders=Object.create(null),this.uploaderEvents=Object.create(null)}resetUploaderReferences(e,t){const r=this.uploaders[e];r&&(r.abort(),t?.abort&&r.abort(!0),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null)}async#t(e){return this.resetUploaderReferences(e.id),new Promise((t,r)=>{let n,s,o;const a={...this.opts,...e.tus||{}};typeof a.headers=="function"&&(a.headers=a.headers(e));const{onShouldRetry:l,onBeforeRequest:u,...c}=a,h={...qs,...c};h.fingerprint=$d(e),h.onBeforeRequest=async _=>{const f=_.getUnderlyingObject();f.withCredentials=!!a.withCredentials;let y;if(typeof u=="function"&&(y=u(_,e)),Ft(n,"shouldBeRequeued")){if(!n.shouldBeRequeued)return Promise.reject();let F;const b=new Promise(k=>{F=k});n=this.requests.run(()=>(e.isPaused&&n.abort(),F(),()=>{})),await Promise.all([b,y]);return}return y},h.onError=_=>
13{this.uppy.log(_);const f=_.originalRequest!=null?_.originalRequest.getUnderlyingObject():null;In(f)&&(_=new mt(_,f)),this.resetUploaderReferences(e.id),n?.abort(),typeof a.onError=="function"&&a.onError(_),r(_)},h.onProgress=(_,f)=>{this.onReceiveUploadUrl(e,o.url),typeof a.onProgress=="function"&&a.onProgress(_,f);const y=this.uppy.getFile(e.id);this.uppy.emit("upload-progress",y,{uploadStarted:y.progress.uploadStarted??0,bytesUploaded:_,bytesTotal:f})},h.onSuccess=_=>{const f={uploadURL:o.url??void 0,status:200,body:{xhr:_.lastResponse.getUnderlyingObject()}};if(this.uppy.emit("upload-success",this.uppy.getFile(e.id),f),this.resetUploaderReferences(e.id),n.done(),o.url){const{name:y}=o.file;this.uppy.log(`Download ${y} from ${o.url}`)}typeof a.onSuccess=="function"&&a.onSuccess(_),t(o)};const v=_=>{const f=_?.originalResponse?.getStatus();if(f===429){if(!this.requests.isPaused){const y=this.#e?.next();if(y==null||y.done)return!1;this.requests.rateLimit(y.value)}}else{if(f!=null&&f>=400&&f<500&&f!==409&&f!==423)return!1;typeof navigator<"u"&&navigator.onLine===!1&&(this.requests.isPaused||(this.requests.pause(),window.addEventListener("online",()=>{this.requests.resume()},{once:!0})))}return n.abort(),n={shouldBeRequeued:!0,abort(){this.shouldBeRequeued=!1},done(){throw new Error("Cannot mark a queued request as done: this indicates a bug")},fn(){throw new Error("Cannot run a queued request: this indicates a bug")}},!0};l!=null?h.onShouldRetry=(_,f)=>l(_,f,a,v):h.onShouldRetry=v;const w=(_,f,y)=>{Ft(_,f)&&!Ft(_,y)&&(_[y]=_[f])},S={};
13if(oi(a.allowedMetaFields,e.meta).forEach(_=>{S[_]=String(e.meta[_])}),w(S,"type","filetype"),w(S,"name","filename"),h.metadata=S,e.data==null)throw new Error("File data is empty");o=new Id(e.data,h),this.uploaders[e.id]=o;const E=new es(this.uppy);this.uploaderEvents[e.id]=E,s=()=>(e.isPaused||o.start(),()=>{}),o.findPreviousUploads().then(_=>{const f=_[0];f&&(this.uppy.log(`[Tus] Resuming upload of ${e.id} started at ${f.creationTime}`),o.resumeFromPreviousUpload(f)),n=this.requests.run(s)}),E.onFileRemove(e.id,_=>{n.abort(),this.resetUploaderReferences(e.id,{abort:!!o.url}),t(`upload ${_} was removed`)}),E.onPause(e.id,_=>{n.abort(),_?o.abort():n=this.requests.run(s)}),E.onPauseAll(e.id,()=>{n.abort(),o.abort()}),E.onCancelAll(e.id,()=>{n.abort(),this.resetUploaderReferences(e.id,{abort:!!o.url}),t(`upload ${e.id} was canceled`)}),E.onResumeAll(e.id,()=>{n.abort(),e.error&&o.abort(),n=this.requests.run(s)})}).catch(t=>{throw this.uppy.emit("upload-error",e,t),t})}onReceiveUploadUrl(e,t){const r=this.uppy.getFile(e.id);r&&(!r.tus||r.tus.uploadUrl!==t)&&(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(r.id,{tus:{...r.tus,uploadUrl:t}}))}#r(e){const t={...this.opts};return e.tus&&Object.assign(t,e.tus),typeof t.headers=="function"&&(t.headers=t.headers(e)),{..."remote"in e&&e.remote.body,endpoint:t.endpoint,uploadUrl:t.uploadUrl,protocol:"tus",size:e.data.size,headers:t.headers,metadata:e.meta}}async#i(e){const t=Un(e),r=Cn(t);this.uppy.emit("upload-start",r),await Promise.allSettled(t.map(n=>{if(n.isRemote){const s=()=>this.requests,o=new AbortController,a=u=>{u.id===n.id&&o.abort()};this.uppy.on("file-removed",a);
13const l=this.uppy.getRequestClientForFile(n).uploadRemoteFile(n,this.#r(n),{signal:o.signal,getQueue:s});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",a)},{priority:-1})(),l}return this.#t(n)}))}#n=async e=>{if(e.length===0){this.uppy.log("[Tus] No files to upload");return}this.opts.limit===0&&this.uppy.log("[Tus] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/tus/#limit-0","warning"),this.uppy.log("[Tus] Uploading...");const t=this.uppy.getFilesByIds(e);await this.#i(t)};install(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!0}}),this.uppy.addUploader(this.#n)}uninstall(){this.uppy.setState({capabilities:{...this.uppy.getState().capabilities,resumableUploads:!1}}),this.uppy.removeUploader(this.#n)}}const jd="5.1.1",Hd={version:jd},Vd={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function Wd(i,e){let t=e;return t||(t=new Error("Upload error")),typeof t=="string"&&(t=new Error(t)),t instanceof Error||(t=Object.assign(new Error("Upload error"),{data:t})),In(i)?(t=new mt(t,i),t):(t.request=i,t)}function Pn(i){return i.data.slice(0,i.data.size,i.meta.type)}const Gd={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:30*1e3,limit:5,withCredentials:!1,responseType:""};class Kd extends Ri{static VERSION=Hd.version;#e;requests;uploaderEvents;constructor(e,t){if(super(e,{...Gd,fieldName:t.bundle?"files[]":"file",...t}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=Vd,this.i18nInit(),Tt in this.opts?this.requests=this.opts[Tt]:this.requests=new Dn(this.opts.limit),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&typeof this.opts.headers=="function")throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(t?.allowedMetaFields===void 0&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#e=r=>async(n,s)=>{try{const o=await Ws(n,{...s,onBeforeRequest:(u,c)=>this.opts.onBeforeRequest?.(u,c,r),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:u=>{const c=Math.ceil(u/1e3),h=new Error(this.i18n("uploadStalled",{seconds:c}));
13this.uppy.emit("upload-stalled",h,r)},onUploadProgress:u=>{if(u.lengthComputable)for(const{id:c}of r){const h=this.uppy.getFile(c);h!=null&&this.uppy.emit("upload-progress",h,{uploadStarted:h.progress.uploadStarted??0,bytesUploaded:u.loaded/u.total*h.size,bytesTotal:h.size})}}});let a=await this.opts.getResponseData?.(o);if(o.responseType==="json")a??=o.response;else try{a??=JSON.parse(o.responseText)}catch(u){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:u})}const l=typeof a?.url=="string"?a.url:void 0;for(const{id:u}of r)this.uppy.emit("upload-success",this.uppy.getFile(u),{status:o.status,body:a,uploadURL:l});return o}catch(o){if(o.name==="AbortError")return;const a=o.request;for(const l of r)this.uppy.emit("upload-error",this.uppy.getFile(l.id),Wd(a,o),a);throw o}}}getOptions(e){const t=this.uppy.getState().xhrUpload,{headers:r}=this.opts,n={...this.opts,...t||{},...e.xhrUpload||{},headers:{}};return typeof r=="function"?n.headers=r(e):Object.assign(n.headers,this.opts.headers),t&&Object.assign(n.headers,t.headers),e.xhrUpload&&Object.assign(n.headers,e.xhrUpload.headers),n}addMetadata(e,t,r){oi(r.allowedMetaFields,t).forEach(s=>{const o=t[s];Array.isArray(o)?o.forEach(a=>e.append(s,a)):e.append(s,o)})}createFormDataUpload(e,t){const r=new FormData;this.addMetadata(r,e.meta,t);const n=Pn(e);return e.name?r.append(t.fieldName,n,e.meta.name):r.append(t.fieldName,n),r}createBundledUpload(e,t){const r=new FormData,{meta:n}=this.uppy.getState();return this.addMetadata(r,n,t),e.forEach(s=>{const o=this.getOptions(s),a=Pn(s);s.name?r.append(o.fieldName,a,s.name):r.append(o.fieldName,a)}),r}async#t(e){const t=new es(this.uppy),r=new AbortController,n=this.requests.wrapPromiseFunction(async()=>{const s=this.getOptions(e),o=this.#e([e]),a=s.formData?this.createFormDataUpload(e,s):e.data,l=typeof s.endpoint=="string"?s.endpoint:await s.endpoint(e);return o(l,{...s,body:a,signal:r.signal})});t.onFileRemove(e.id,()=>r.abort()),t.onCancelAll(e.id,()=>{r.abort()});try{await n()}catch(s){if(s.message!=="Cancelled")throw s}finally{t.remove()}}async#r(e){const t=new AbortController,r=this.requests.wrapPromiseFunction(async()=>{const s=this.uppy.getState().xhrUpload??{},o=this.#e(e),a=this.createBundledUpload(e,{...this.opts,...s}),l=typeof this.opts.endpoint=="string"?this.opts.endpoint:await this.opts.endpoint(e);return o(l,{...this.opts,body:a,signal:t.signal})});function n(){t.abort()}this.uppy.once("cancel-all",n);try{await r()}catch(s){if(s.message!=="Cancelled")throw s}finally{this.uppy.off("cancel-all",n)}}#i(e){const t=this.getOptions(e),r=oi(t.allowedMetaFields,e.meta);return{...e.remote?.body,protocol:"multipart",endpoint:t.endpoint,size:e.data.size,fieldname:t.fieldName,metadata:Object.fromEntries(r.map(n=>[n,e.meta[n]])),httpMethod:t.method,useFormData:t.formData,headers:t.headers}}async#n(e){await Promise.allSettled(e.map(t=>{if(t.isRemote){const r=()=>this.requests,n=new AbortController,s=a=>{a.id===t.id&&n.abort()};this.uppy.on("file-removed",s);
13const o=this.uppy.getRequestClientForFile(t).uploadRemoteFile(t,this.#i(t),{signal:n.signal,getQueue:r});return this.requests.wrapSyncFunction(()=>{this.uppy.off("file-removed",s)},{priority:-1})(),o}return this.#t(t)}))}#s=async e=>{if(e.length===0){this.uppy.log("[XHRUpload] No files to upload!");return}this.opts.limit===0&&!this.opts[Tt]&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const t=this.uppy.getFilesByIds(e),r=Un(t),n=Cn(r);if(this.uppy.emit("upload-start",n),this.opts.bundle){if(r.some(o=>o.isRemote))throw new Error("Canât upload remote files when the `bundle: true` option is set");if(typeof this.opts.headers=="function")throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#r(r)}else await this.#n(r)};install(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!1}})}this.uppy.addUploader(this.#s)}uninstall(){if(this.opts.bundle){const{capabilities:e}=this.uppy.getState();this.uppy.setState({capabilities:{...e,individualCancellation:!0}})}this.uppy.removeUploader(this.#s)}}const Tn="VideoCreateError";function Xd(i){const e=document.getElementById(i),t=document.getElementById(`uppy-dashboard-${i.replace("uppy-container-","")}`);if(!e||!t)return null;const r=e.dataset.uploadMediaUrl,n=JSON.parse(e.dataset.allowedFileTypes),s=parseInt(e.dataset.maxFileSize),o=parseInt(e.dataset.dashboardHeight)||400,a=document.querySelector('meta[name="csrf-token"]')?.content,l=n.filter(w=>!w.startsWith("video/")),u=Math.round(s/(1024*1024)),c=l.map(w=>w.split("/")[1]?.toUpperCase()||w.split("/")[0]?.toUpperCase()).filter((w,S,P)=>P.indexOf(w)===S).slice(0,5).join(", "),h=`Upload images and documents. Max size: ${u}MB. Supported: ${c}${l.length>5?" and more":""}.`,v=new St({restrictions:{allowedFileTypes:l,maxFileSize:s},autoProceed:!1,allowMultipleUploadBatches:!0}).use(_s,{target:t,inline:!0,width:"100%",height:o,showProgressDetails:!0,note:h}).use(Kd,{id:"XHRUpload",endpoint:r,fieldName:"file",headers:{"X-CSRF-TOKEN":a},shouldRetry:(w,S,P)=>P?.status!==401&&w<3,getResponseData:w=>{try{const S=JSON.parse(w);return{url:S.media?.url||S.url||""}}catch{return{url:""}}},getResponseError:w=>{try{const S=JSON.parse(w);return new Error(S.message||"Upload failed")}catch{return new Error("Upload failed")}}});return v.on("upload-error",(w,S)=>{const P=S?.message||"Upload failed. Please try again.";v.info(P,"error",5e3)}),v.on("complete",w=>{if(w.successful.length>0){const S=w.successful.length,P=S===1?"File uploaded successfully!":`${S} files uploaded successfully!`;v.info(P,"success",3e3),setTimeout(()=>{typeof Livewire<"u"&&Livewire.dispatch("media-stored"),v.cancelAll(),v.getFiles().forEach(E=>v.removeFile(E.id))},500)}if(w.failed.length>0){const S=w.failed.length,P=S===1?"1 file failed to upload":`${S} files failed to upload`;v.info(P,"error",5e3)}}),v}function Yd(i){const e=document.getElementById(i),t=document.getElementById(`uppy-dashboard-${i.replace("uppy-container-","")}`);if(!e||!t)return null;const r=e.dataset.uploadVideoUrl,n=e.dataset.storeVideoUrl,s=parseInt(e.dataset.maxFileSize),o=parseInt(e.dataset.dashboardHeight)||400,a=document.querySelector('meta[name="csrf-token"]')?.content,l=["video/mp4","video/mpeg","video/quicktime","video/x-msvideo","video/webm","video/x-ms-wmv"],u=s/(1024*1024),c=u/1024,h=c>=1?`${Math.round(c*10)/10}GB`:`${Math.round(u)}MB`,v=l.map(P=>P.split("/")[1]?.toUpperCase()).filter((P,E,_)=>_.indexOf(P)===E).join(", "),w=`Upload videos. Max size: ${h}. Supported: ${v}. Large files use resumable uploads.`,S=new St({restrictions:{allowedFileTypes:l,maxFileSize:s},autoProceed:!1,allowMultipleUploadBatches:!0}).use(_s,{target:t,inline:!0,width:"100%",height:o,showProgressDetails:!0,note:w}).use(qd,{id:"Tus",endpoint:"https://video.bunnycdn.com/tusupload",retryDelays:[0,3e3,5e3,1e4,2e4,6e4],onShouldRetry:(P,E,_,f)=>P?.name===Tn?!1:f(P,E,_),onBeforeRequest:async(P,E)=>{const _=await fetch(r,{method:"POST",headers:{"Content-Type":"application/json","X-CSRF-TOKEN":a},body:JSON.stringify({title:E.name})});if(!_.ok){const{error:k}=await _.json().catch(()=>({})),A=new Error(k||"Failed to create video");throw A.name=Tn,A}
13const{libraryId:f,videoId:y,signature:F,expirationTime:b}=await _.json();P.setHeader("AuthorizationSignature",F),P.setHeader("AuthorizationExpire",b),P.setHeader("VideoId",y),P.setHeader("LibraryId",f),E.meta.videoId=y}});return S.on("upload-success",async P=>{const E=P.meta.videoId;if(!E){S.info("Video uploaded but failed to store. Please contact support.","error",5e3);return}try{const _=new FormData;_.append("videoId",E);const f=await fetch(n,{method:"POST",body:_,headers:{"X-CSRF-TOKEN":a}});if(!f.ok){const F=await f.json().catch(()=>({}));throw new Error(F.error||"Failed to store video")}const y=await f.json().catch(()=>({}));if(S.info("Video uploaded and stored successfully!","success",3e3),typeof Livewire<"u"){const F=i.replace("uppy-container-video-","");Livewire.dispatch("media-stored",{videoId:y.video?.id??null,instanceId:F})}}catch(_){const f=_?.message||"Failed to store video. Please try again.";S.info(f,"error",5e3),S.emit("upload-error",P,_)}}),S.on("upload-error",(P,E)=>{const _=E?.message||"Upload failed. Please try again.";S.info(_,"error",5e3)}),S.on("complete",P=>{if(P.successful.length>0){const E=P.successful.length,_=E===1?"Video uploaded successfully!":`${E} videos uploaded successfully!`;S.info(_,"success",3e3),setTimeout(()=>{S.cancelAll(),S.getFiles().forEach(f=>S.removeFile(f.id))},500)}if(P.failed.length>0){const E=P.failed.length,_=E===1?"1 video failed to upload":`${E} videos failed to upload`;S.info(_,"error",5e3)}}),S}window.initUppyImageUpload=Xd;window.initUppyVideoUpload=Yd;export{Xd as initUppyImageUpload,Yd as initUppyVideoUpload};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.