@micromag/viewer-build 0.4.97 → 0.4.100
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/asset-manifest.json +11 -11
- package/build/index.html +1 -1
- package/build/static/js/231.23d6045b.chunk.js +1 -0
- package/build/static/js/6.41624dfe.chunk.js +1 -0
- package/build/static/js/66.a4491af0.js +2 -0
- package/build/static/js/685.1eafae9a.chunk.js +2 -0
- package/build/static/js/main.ad607bea.js +2 -0
- package/build/static/js/runtime~main.c8067dd1.js +1 -0
- package/package.json +18 -15
- package/build/static/js/231.2dd1f543.chunk.js +0 -1
- package/build/static/js/6.a54a904c.chunk.js +0 -1
- package/build/static/js/656.81c40916.js +0 -2
- package/build/static/js/66.0cdd7e66.chunk.js +0 -2
- package/build/static/js/main.e94c3a23.js +0 -2
- package/build/static/js/runtime~main.ece9ec3d.js +0 -1
- /package/build/static/css/{656.cf2dc07c.css → 66.cf2dc07c.css} +0 -0
- /package/build/static/js/{656.81c40916.js.LICENSE.txt → 66.a4491af0.js.LICENSE.txt} +0 -0
- /package/build/static/js/{66.0cdd7e66.chunk.js.LICENSE.txt → 685.1eafae9a.chunk.js.LICENSE.txt} +0 -0
- /package/build/static/js/{main.e94c3a23.js.LICENSE.txt → main.ad607bea.js.LICENSE.txt} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"files": {
|
|
3
3
|
"main.css": "/static/css/main.20574e87.css",
|
|
4
|
-
"main.js": "/static/js/main.
|
|
5
|
-
"runtime~main.js": "/static/js/runtime~main.
|
|
6
|
-
"static/js/
|
|
4
|
+
"main.js": "/static/js/main.ad607bea.js",
|
|
5
|
+
"runtime~main.js": "/static/js/runtime~main.c8067dd1.js",
|
|
6
|
+
"static/js/685.1eafae9a.chunk.js": "/static/js/685.1eafae9a.chunk.js",
|
|
7
7
|
"static/js/490.39904f7d.chunk.js": "/static/js/490.39904f7d.chunk.js",
|
|
8
8
|
"static/js/727.018496cf.chunk.js": "/static/js/727.018496cf.chunk.js",
|
|
9
|
-
"static/js/6.
|
|
9
|
+
"static/js/6.41624dfe.chunk.js": "/static/js/6.41624dfe.chunk.js",
|
|
10
10
|
"static/js/50.37bde52c.chunk.js": "/static/js/50.37bde52c.chunk.js",
|
|
11
11
|
"static/js/359.8b129b69.chunk.js": "/static/js/359.8b129b69.chunk.js",
|
|
12
12
|
"static/js/278.1bc9b3a8.chunk.js": "/static/js/278.1bc9b3a8.chunk.js",
|
|
@@ -19,19 +19,19 @@
|
|
|
19
19
|
"static/js/51.24437974.chunk.js": "/static/js/51.24437974.chunk.js",
|
|
20
20
|
"static/js/62.b7ed9084.chunk.js": "/static/js/62.b7ed9084.chunk.js",
|
|
21
21
|
"static/js/951.cb178734.chunk.js": "/static/js/951.cb178734.chunk.js",
|
|
22
|
-
"static/js/231.
|
|
23
|
-
"static/css/
|
|
24
|
-
"static/js/
|
|
22
|
+
"static/js/231.23d6045b.chunk.js": "/static/js/231.23d6045b.chunk.js",
|
|
23
|
+
"static/css/66.cf2dc07c.css": "/static/css/66.cf2dc07c.css",
|
|
24
|
+
"static/js/66.a4491af0.js": "/static/js/66.a4491af0.js",
|
|
25
25
|
"static/media/png": "/static/media/f21db7431692d889.3f599fa556b406bbed82.png",
|
|
26
26
|
"static/media/bootstrap-icons.woff?": "/static/media/bootstrap-icons.1295669cd4e305c97f2c.woff",
|
|
27
27
|
"static/media/bootstrap-icons.woff2?": "/static/media/bootstrap-icons.92ea18a81d737146ff04.woff2",
|
|
28
28
|
"index.html": "/index.html"
|
|
29
29
|
},
|
|
30
30
|
"entrypoints": [
|
|
31
|
-
"static/js/runtime~main.
|
|
32
|
-
"static/css/
|
|
33
|
-
"static/js/
|
|
31
|
+
"static/js/runtime~main.c8067dd1.js",
|
|
32
|
+
"static/css/66.cf2dc07c.css",
|
|
33
|
+
"static/js/66.a4491af0.js",
|
|
34
34
|
"static/css/main.20574e87.css",
|
|
35
|
-
"static/js/main.
|
|
35
|
+
"static/js/main.ad607bea.js"
|
|
36
36
|
]
|
|
37
37
|
}
|
package/build/index.html
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Micromag</title><script defer="defer" src="/static/js/runtime~main.
|
|
1
|
+
<!doctype html><html lang="en"><head><meta charset="utf-8"/><meta name="viewport" content="width=device-width,initial-scale=1"/><title>Micromag</title><script defer="defer" src="/static/js/runtime~main.c8067dd1.js"></script><script defer="defer" src="/static/js/66.a4491af0.js"></script><script defer="defer" src="/static/js/main.ad607bea.js"></script><link href="/static/css/66.cf2dc07c.css" rel="stylesheet"><link href="/static/css/main.20574e87.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[231],{4967:function(e,t,r){var i="object"==typeof r.g&&r.g&&r.g.Object===Object&&r.g;e.exports=i},8942:function(e,t,r){var i=r(4967),n="object"==typeof self&&self&&self.Object===Object&&self,o=i||n||Function("return this")();e.exports=o},2784:function(e,t,r){var i=r(1580),n=r(4495),o=r(6131),s=Math.max,a=Math.min;e.exports=function(e,t,r){var u,c,l,h,p,d,m=0,f=!1,g=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function v(t){var r=u,i=c;return u=c=void 0,m=t,h=e.apply(i,r)}function w(e){var r=e-d;return void 0===d||r>=t||r<0||g&&e-m>=l}function _(){var e=n();if(w(e))return b(e);p=setTimeout(_,function(e){var r=t-(e-d);return g?a(r,l-(e-m)):r}(e))}function b(e){return p=void 0,y&&u?v(e):(u=c=void 0,h)}function P(){var e=n(),r=w(e);if(u=arguments,c=this,d=e,r){if(void 0===p)return function(e){return m=e,p=setTimeout(_,t),f?v(e):h}(d);if(g)return clearTimeout(p),p=setTimeout(_,t),v(d)}return void 0===p&&(p=setTimeout(_,t)),h}return t=o(t)||0,i(r)&&(f=!!r.leading,l=(g="maxWait"in r)?s(o(r.maxWait)||0,t):l,y="trailing"in r?!!r.trailing:y),P.cancel=function(){void 0!==p&&clearTimeout(p),m=0,u=d=c=p=void 0},P.flush=function(){return void 0===p?h:b(n())},P}},4495:function(e,t,r){var i=r(8942);e.exports=function(){return i.Date.now()}},6131:function(e){e.exports=function(e){return e}},3183:function(e){"use strict";var t=Object.prototype.hasOwnProperty,r="~";function i(){}function n(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,i,o,s){if("function"!=typeof i)throw new TypeError("The listener must be a function");var a=new n(i,o||e,s),u=r?r+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],a]:e._events[u].push(a):(e._events[u]=a,e._eventsCount++),e}function s(e,t){0===--e._eventsCount?e._events=new i:delete e._events[t]}function a(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),a.prototype.eventNames=function(){var e,i,n=[];if(0===this._eventsCount)return n;for(i in e=this._events)t.call(e,i)&&n.push(r?i.slice(1):i);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(e)):n},a.prototype.listeners=function(e){var t=r?r+e:e,i=this._events[t];if(!i)return[];if(i.fn)return[i.fn];for(var n=0,o=i.length,s=new Array(o);n<o;n++)s[n]=i[n].fn;return s},a.prototype.listenerCount=function(e){var t=r?r+e:e,i=this._events[t];return i?i.fn?1:i.length:0},a.prototype.emit=function(e,t,i,n,o,s){var a=r?r+e:e;if(!this._events[a])return!1;var u,c,l=this._events[a],h=arguments.length;if(l.fn){switch(l.once&&this.removeListener(e,l.fn,void 0,!0),h){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,i),!0;case 4:return l.fn.call(l.context,t,i,n),!0;case 5:return l.fn.call(l.context,t,i,n,o),!0;case 6:return l.fn.call(l.context,t,i,n,o,s),!0}for(c=1,u=new Array(h-1);c<h;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var p,d=l.length;for(c=0;c<d;c++)switch(l[c].once&&this.removeListener(e,l[c].fn,void 0,!0),h){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,i);break;case 4:l[c].fn.call(l[c].context,t,i,n);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];l[c].fn.apply(l[c].context,u)}}return!0},a.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},a.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},a.prototype.removeListener=function(e,t,i,n){var o=r?r+e:e;if(!this._events[o])return this;if(!t)return s(this,o),this;var a=this._events[o];if(a.fn)a.fn!==t||n&&!a.once||i&&a.context!==i||s(this,o);else{for(var u=0,c=[],l=a.length;u<l;u++)(a[u].fn!==t||n&&!a[u].once||i&&a[u].context!==i)&&c.push(a[u]);c.length?this._events[o]=1===c.length?c[0]:c:s(this,o)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a},9028:function(e,t,r){"use strict";r.d(t,{FD:function(){return o},Y:function(){return o}});var i=r(5181),n=0;function o(e,t,r,o,s,a){t||(t={});var u,c,l=t;if("ref"in l)for(c in l={},t)"ref"==c?u=t[c]:l[c]=t[c];var h={type:e,props:l,key:r,ref:u,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--n,__i:-1,__u:0,__source:s,__self:a};if("function"==typeof e&&(u=e.defaultProps))for(c in u)void 0===l[c]&&(l[c]=u[c]);return i.fF.vnode&&i.fF.vnode(h),h}Array.isArray},9364:function(e,t,r){e.exports=r(1386)},1386:function(e,t,r){var i=r(3884);t.operation=function(e){var r=t.timeouts(e);return new i(r,{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},t.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var i=[],n=0;n<t.retries;n++)i.push(this.createTimeout(n,t));return e&&e.forever&&!i.length&&i.push(this.createTimeout(n,t)),i.sort(function(e,t){return e-t}),i},t.createTimeout=function(e,t){var r=t.randomize?Math.random()+1:1,i=Math.round(r*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(i,t.maxTimeout)},t.wrap=function(e,r,i){if(r instanceof Array&&(i=r,r=null),!i)for(var n in i=[],e)"function"==typeof e[n]&&i.push(n);for(var o=0;o<i.length;o++){var s=i[o],a=e[s];e[s]=function(i){var n=t.operation(r),o=Array.prototype.slice.call(arguments,1),s=o.pop();o.push(function(e){n.retry(e)||(e&&(arguments[0]=n.mainError()),s.apply(this,arguments))}),n.attempt(function(){i.apply(e,o)})}.bind(e,a),e[s].options=r}}},3884:function(e){function t(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}e.exports=t,t.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},t.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},t.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=(new Date).getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r){if(!this._cachedTimeouts)return!1;this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1)}var i=this;return this._timer=setTimeout(function(){i._attempts++,i._operationTimeoutCb&&(i._timeout=setTimeout(function(){i._operationTimeoutCb(i._attempts)},i._operationTimeout),i._options.unref&&i._timeout.unref()),i._fn(i._attempts)},r),this._options.unref&&this._timer.unref(),!0},t.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=(new Date).getTime(),this._fn(this._attempts)},t.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},t.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},t.prototype.start=t.prototype.try,t.prototype.errors=function(){return this._errors},t.prototype.attempts=function(){return this._attempts},t.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,i=0;i<this._errors.length;i++){var n=this._errors[i],o=n.message,s=(e[o]||0)+1;e[o]=s,s>=r&&(t=n,r=s)}return t}},5538:function(e,t,r){"use strict";r.d(t,{A:function(){return v}});var i=r(6317);class n extends Error{name="UserFacingApiError"}var o=n,s=r(5945),a=r(8396),u=r(9364);const c=Object.prototype.toString,l=new Set(["network error","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed","fetch failed","terminated"," A network error occurred.","Network connection lost"]);class h extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,({message:e}=e)):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const p=(e,t,r)=>{const i=r.retries-(t-1);return e.attemptNumber=t,e.retriesLeft=i,e};async function d(e,t){return new Promise((r,i)=>{t={...t},t.onFailedAttempt??=()=>{},t.shouldRetry??=()=>!0,t.retries??=10;const n=u.operation(t),o=()=>{n.stop(),i(t.signal?.reason)};t.signal&&!t.signal.aborted&&t.signal.addEventListener("abort",o,{once:!0});const s=()=>{t.signal?.removeEventListener("abort",o),n.stop()};n.attempt(async o=>{try{const t=await e(o);s(),r(t)}catch(e){try{if(!(e instanceof Error))throw new TypeError(`Non-error was thrown: "${e}". You should only throw errors.`);if(e instanceof h)throw e.originalError;if(e instanceof TypeError&&!function(e){var t;if(!e||(t=e,"[object Error]"!==c.call(t))||"TypeError"!==e.name||"string"!=typeof e.message)return!1;const{message:r,stack:i}=e;return"Load failed"===r||r.startsWith("Load failed (")&&r.endsWith(")")?void 0===i||"__sentry_captured__"in e:!!r.startsWith("error sending request for url")||!!("Failed to fetch"===r||r.startsWith("Failed to fetch (")&&r.endsWith(")"))||l.has(r)}(e))throw e;if(p(e,o,t),await t.shouldRetry(e)||(n.stop(),i(e)),await t.onFailedAttempt(e),!n.retry(e))throw n.mainError()}catch(e){p(e,o,t),s(),i(e)}}})})}class m extends Error{isAuthError;constructor(){super("Authorization required"),this.name="AuthError",this.isAuthError=!0}}var f=m;class g extends Error{statusCode;constructor({statusCode:e,message:t}){super(t),this.name="HttpError",this.statusCode=e}}class y{static VERSION="5.1.1";#e;uppy;opts;constructor(e,t){this.uppy=e,this.opts=t,this.onReceiveResponse=this.onReceiveResponse.bind(this),this.#e=t.companionHeaders}setCompanionHeaders(e){this.#e=e}[Symbol.for("uppy test: getCompanionHeaders")](){return this.#e}get hostname(){const{companion:e}=this.uppy.getState(),t=this.opts.companionUrl;return(e?.[t]?e[t]:t).replace(/\/$/,"")}async headers(e=!1){return{...{Accept:"application/json",...e?void 0:{"Content-Type":"application/json"}},...this.#e}}onReceiveResponse(e){const{headers:t}=e,r=this.uppy.getState().companion||{},i=this.opts.companionUrl;t.has("i-am")&&t.get("i-am")!==r[i]&&this.uppy.setState({companion:{...r,[i]:t.get("i-am")}})}#t(e){return/^(https?:|)\/\//.test(e)?e:`${this.hostname}/${e}`}async request({path:e,method:t="GET",data:r,skipPostResponse:i,signal:n}){try{const a=await this.headers(!r),u=await(0,s.A)(this.#t(e),{method:t,signal:n,headers:a,credentials:this.opts.companionCookiesRule||"same-origin",body:r?JSON.stringify(r):null});return i||this.onReceiveResponse(u),await async function(e){if(401===e.status)throw new f;if(e.ok)return e.json();let t,r=`Failed request with status: ${e.status}. ${e.statusText}`;try{t=await e.json(),t.message&&(r=`${r} message: ${t.message}`),t.requestId&&(r=`${r} request-Id: ${t.requestId}`)}catch(e){throw new Error(r,{cause:e})}if(e.status>=400&&e.status<=499&&t.message)throw new o(t.message);throw new g({statusCode:e.status,message:r})}(u)}catch(r){if(r.isAuthError||"UserFacingApiError"===r.name||"AbortError"===r.name)throw r;throw new a.A(`Could not ${t} ${this.#t(e)}`,{cause:r})}}async get(e,t){return this.request({...t,path:e})}async post(e,t,r){return this.request({...r,path:e,method:"POST",data:t})}async delete(e,t,r){return this.request({...r,path:e,method:"DELETE",data:t})}async uploadRemoteFile(e,t,r){try{const{signal:i,getQueue:n}=r||{};return await d(async()=>{const r=this.uppy.getFile(e.id)?.serverToken;if(null!=r)return this.uppy.log(`Connecting to exiting websocket ${r}`),this.#r({file:e,queue:n(),signal:i});const o=n().wrapPromiseFunction(async(...e)=>{try{return await this.#i(...e)}catch(e){if(e.isAuthError)throw new h(e);if(null==e.cause)throw e;const t=e.cause,r=()=>[408,409,429,418,423].includes(t.statusCode)||t.statusCode>=500&&t.statusCode<=599&&![501,505].includes(t.statusCode);if("HttpError"===t.name&&!r())throw new h(t);throw t}},{priority:-1}),s=await o({file:e,postBody:t,signal:i}).abortOn(i);return this.uppy.getFile(e.id)?(this.uppy.setFileState(e.id,{serverToken:s}),this.#r({file:this.uppy.getFile(e.id),queue:n(),signal:i})):void 0},{retries:10,signal:i,onFailedAttempt:e=>this.uppy.log(`Retrying upload due to: ${e.message}`,"warning")})}catch(t){if("AbortError"===t.name)return;throw this.uppy.emit("upload-error",e,t),t}}#i=async({file:e,postBody:t,signal:r})=>{if(null==e.remote?.url)throw new Error("Cannot connect to an undefined URL");return(await this.post(e.remote.url,{...e.remote.body,...t},{signal:r})).token};async#r({file:e,queue:t,signal:r}){let i;const{capabilities:n}=this.uppy.getState();try{return await new Promise((o,s)=>{const a=e.serverToken,u=function(e){const t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?([^\n]+)/i.exec(e)?.[1];return`${/^http:\/\//i.test(e)?"ws":"wss"}://${t}`}(e.remote.companionUrl);let c,l,h,{isPaused:p}=e;const m=(t,r)=>{null!=c&&c.readyState===c.OPEN?c.send(JSON.stringify({action:t,payload:r??{}})):this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(c?.readyState)}`,"warning")};function f(){n.resumableUploads&&m(p?"pause":"resume")}const g=e=>{n.resumableUploads&&(p=e,c&&f())},y=t=>{n.individualCancellation&&t.id===e.id&&(m("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),o())},v=()=>{m("cancel"),l?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),o()},w=(t,r)=>{t?.id===e.id&&g(r)},_=()=>g(!0),b=()=>g(!1);this.uppy.on("file-removed",y),this.uppy.on("cancel-all",v),this.uppy.on("upload-pause",w),this.uppy.on("pause-all",_),this.uppy.on("resume-all",b),i=()=>{this.uppy.off("file-removed",y),this.uppy.off("cancel-all",v),this.uppy.off("upload-pause",w),this.uppy.off("pause-all",_),this.uppy.off("resume-all",b)},r.addEventListener("abort",()=>{l?.abort()}),(async()=>{l&&l.abort(),l=new AbortController;const r=t=>{this.uppy.setFileState(e.id,{serverToken:null}),l?.abort?.(),s(t)};function i(){clearTimeout(h),p||(h=setTimeout(()=>r(new Error("Timeout waiting for message from Companion socket")),3e5))}try{await t.wrapPromiseFunction(async()=>{await d(async()=>new Promise((t,n)=>{c=new WebSocket(`${u}/api/${a}`),i(),c.addEventListener("close",()=>{c=void 0,n(new Error("Socket closed unexpectedly"))}),c.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),c?.close()}),c.addEventListener("open",()=>{f()}),c.addEventListener("message",t=>{i();try{const{action:r,payload:i}=JSON.parse(t.data);switch(r){case"progress":!function(e,t,r){const{progress:i,bytesUploaded:n,bytesTotal:o}=t;i&&(e.uppy.log(`Upload progress: ${i}`),e.uppy.emit("upload-progress",r,{uploadStarted:r.progress.uploadStarted??0,bytesUploaded:n,bytesTotal:o}))}(this,i,this.uppy.getFile(e.id));break;case"success":{const t=i.response?.responseText;this.uppy.emit("upload-success",this.uppy.getFile(e.id),{uploadURL:i.url,status:i.response?.status??200,body:t?JSON.parse(t):void 0}),l?.abort?.(),o();break}case"error":{const{message:e}=i.error;throw Object.assign(new Error(e),{cause:i.error})}default:this.uppy.log(`Companion socket unknown action ${r}`,"warning")}}catch(e){r(e)}});const s=()=>{this.uppy.log(`Closing socket ${e.id}`),clearTimeout(h),c&&c.close(),c=void 0};l.signal.addEventListener("abort",()=>{s()})}),{retries:10,signal:l.signal,onFailedAttempt:()=>{l.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(l.signal)}catch(e){if(l.signal.aborted)return;r(e)}})()})}finally{i?.()}}}class v extends y{#n;provider;id;name;pluginId;tokenKey;companionKeysParams;preAuthToken;supportsRefreshToken;constructor(e,t){super(e,t),this.provider=t.provider,this.id=this.provider,this.name=this.opts.name||this.id.split("-").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" "),this.pluginId=this.opts.pluginId,this.tokenKey=`companion-${this.pluginId}-auth-token`,this.companionKeysParams=this.opts.companionKeysParams,this.preAuthToken=null,this.supportsRefreshToken=!!t.supportsRefreshToken}async headers(){const[e,t]=await Promise.all([super.headers(),this.#o()]),r={};return t&&(r["uppy-auth-token"]=t),this.companionKeysParams&&(r["uppy-credentials-params"]=btoa(JSON.stringify({params:this.companionKeysParams}))),{...e,...r}}onReceiveResponse(e){super.onReceiveResponse(e);const t=this.#s(),r=t.getPluginState().authenticated?401!==e.status:e.status<400;return t.setPluginState({authenticated:r}),e}async setAuthToken(e){return this.#s().storage.setItem(this.tokenKey,e)}async#o(){return this.#s().storage.getItem(this.tokenKey)}async removeAuthToken(){return this.#s().storage.removeItem(this.tokenKey)}#s(){const e=this.uppy.getPlugin(this.pluginId);if(null==e)throw new Error("Plugin was nullish");return e}async ensurePreAuth(){if(this.companionKeysParams&&!this.preAuthToken&&(await this.fetchPreAuthToken(),!this.preAuthToken))throw new Error("Could not load authentication data required for third-party login. Please try again later.")}authQuery(e){return{}}authUrl({authFormData:e,query:t}){const r=new URLSearchParams({...t,state:btoa(JSON.stringify({origin:location.origin})),...this.authQuery({authFormData:e})});return this.preAuthToken&&r.set("uppyPreAuthToken",this.preAuthToken),`${this.hostname}/${this.id}/connect?${r}`}async loginSimpleAuth({uppyVersions:e,authFormData:t,signal:r}){const i=await this.post(`${this.id}/simple-auth`,{form:t},{qs:{uppyVersions:e},signal:r});this.setAuthToken(i.uppyAuthToken)}async loginOAuth({uppyVersions:e,authFormData:t,signal:r}){await this.ensurePreAuth(),r.throwIfAborted();const n=this.authUrl({query:{uppyVersions:e},authFormData:t}),o=window.open(n,"_blank");let s,a;try{return await new Promise((e,t)=>{a=r=>{if(r.source!==o){let e="";try{e=JSON.stringify(r.data)}catch(e){}return void this.uppy.log(`ignoring event from unknown source ${e}`,"warning")}const{companionAllowedHosts:n}=this.#s().opts;if(!(0,i.F)(r.origin,n))return void this.uppy.log(`ignoring event from ${r.origin} vs allowed pattern ${n}`,"warning");const s="string"==typeof r.data?JSON.parse(r.data):r.data;if(s.error){const{uppy:e}=this,r=e.i18n("authAborted");return e.info({message:r},"warning",5e3),void t(new Error("auth aborted"))}s.token?e(this.setAuthToken(s.token)):t(new Error("did not receive token from auth window"))},o&&(s=window.setInterval(()=>{o.closed&&t(new Error("Auth window was closed by the user"))},500)),r.addEventListener("abort",()=>t(new Error("Aborted"))),window.addEventListener("message",a)})}finally{o?.close(),window.clearInterval(s),a&&window.removeEventListener("message",a)}}async login({uppyVersions:e,authFormData:t,signal:r}){return this.loginOAuth({uppyVersions:e,authFormData:t,signal:r})}refreshTokenUrl(){return`${this.hostname}/${this.id}/refresh-token`}fileUrl(e){return`${this.hostname}/${this.id}/get/${e}`}async request(...e){await this.#n;try{return await super.request(...e)}catch(t){if(!this.supportsRefreshToken)throw t;const r=await this.#o();if(!t.isAuthError||!r)throw t;return null==this.#n&&(this.#n=(async()=>{try{this.uppy.log("[CompanionClient] Refreshing expired auth token");const e=await super.request({path:this.refreshTokenUrl(),method:"POST"});await this.setAuthToken(e.uppyAuthToken)}catch(e){throw e.isAuthError&&await this.removeAuthToken(),t}finally{this.#n=void 0}})()),await this.#n,super.request(...e)}}async fetchPreAuthToken(){if(this.companionKeysParams)try{const e=await this.post(`${this.id}/preauth/`,{params:this.companionKeysParams});this.preAuthToken=e.token}catch(e){this.uppy.log(`[CompanionClient] unable to fetch preAuthToken ${e}`,"warning")}}list(e,t){return this.get(`${this.id}/list/${e||""}`,t)}search(e,t={}){const r=new URLSearchParams;r.set("q",e),t.path&&r.set("path",t.path),t.cursor&&r.set("cursor",t.cursor);const i=`${this.id}/search?${r.toString()}`;return this.get(i,t)}async logout(e){const t=await this.get(`${this.id}/logout`,e);return await this.removeAuthToken(),t}}},6317:function(e,t,r){"use strict";function i(e){return"string"==typeof e?new RegExp(e):e instanceof RegExp?e:void 0}function n(e,t){if(e){const t=e=>{if(!("string"==typeof e&&i(e)||e instanceof RegExp))throw new TypeError('The option "companionAllowedHosts" must be one of string, Array, RegExp')};return Array.isArray(e)?e.every(t):t(e),e}let r=t;return/^(?!https?:\/\/).*$/i.test(r)&&(r=`https://${t.replace(/^\/\//,"")}`),r=new URL(r).origin,r=r.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&"),r}function o(e,t){return(Array.isArray(t)?t.map(i):[i(t)]).some(t=>t?.test(e)||t?.test(`${e}/`))}r.d(t,{A:function(){return n},F:function(){return o}})},50:function(e,t,r){"use strict";async function i(e,t){localStorage.setItem(e,t)}async function n(e){return localStorage.getItem(e)}async function o(e){localStorage.removeItem(e)}r.r(t),r.d(t,{getItem:function(){return n},removeItem:function(){return o},setItem:function(){return i}})},8653:function(e,t,r){"use strict";r.d(t,{A:function(){return ke}});var i,n,o,s,a=r(9028),u=r(6506),c=r(3373),l=r(2784),h=r(5181),p=0,d=[],m=h.fF,f=m.__b,g=m.__r,y=m.diffed,v=m.__c,w=m.unmount,_=m.__;function b(e,t){m.__h&&m.__h(n,e,p||t),p=0;var r=n.__H||(n.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function P(e){return p=1,function(e,t){var r=b(i++,2);if(r.t=e,!r.__c&&(r.__=[N(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],i=r.t(t,e);t!==i&&(r.__N=[i,r.__[1]],r.__c.setState({}))}],r.__c=n,!n.__f)){var o=function(e,t,i){if(!r.__c.__H)return!0;var n=r.__c.__H.__.filter(function(e){return e.__c});if(n.every(function(e){return!e.__N}))return!s||s.call(this,e,t,i);var o=r.__c.props!==e;return n.some(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(o=!0)}}),s&&s.call(this,e,t,i)||o};n.__f=!0;var s=n.shouldComponentUpdate,a=n.componentWillUpdate;n.componentWillUpdate=function(e,t,r){if(this.__e){var i=s;s=void 0,o(e,t,r),s=i}a&&a.call(this,e,t,r)},n.shouldComponentUpdate=o}return r.__N||r.__}(N,e)}function k(e,t){var r=b(i++,3);!m.__s&&C(r.__H,t)&&(r.__=e,r.u=t,n.__H.__h.push(r))}function T(e,t){var r=b(i++,7);return C(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function I(e,t){return p=8,T(function(){return e},t)}function S(){for(var e;e=d.shift();){var t=e.__H;if(e.__P&&t)try{t.__h.some(E),t.__h.some(x),t.__h=[]}catch(r){t.__h=[],m.__e(r,e.__v)}}}m.__b=function(e){n=null,f&&f(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_&&_(e,t)},m.__r=function(e){g&&g(e),i=0;var t=(n=e.__c).__H;t&&(o===n?(t.__h=[],n.__h=[],t.__.some(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.some(E),t.__h.some(x),t.__h=[],i=0)),o=n},m.diffed=function(e){y&&y(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==d.push(t)&&s===m.requestAnimationFrame||((s=m.requestAnimationFrame)||A)(S)),t.__H.__.some(function(e){e.u&&(e.__H=e.u),e.u=void 0})),o=n=null},m.__c=function(e,t){t.some(function(e){try{e.__h.some(E),e.__h=e.__h.filter(function(e){return!e.__||x(e)})}catch(r){t.some(function(e){e.__h&&(e.__h=[])}),t=[],m.__e(r,e.__v)}}),v&&v(e,t)},m.unmount=function(e){w&&w(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.some(function(e){try{E(e)}catch(e){t=e}}),r.__H=void 0,t&&m.__e(t,r.__v))};var F="function"==typeof requestAnimationFrame;function A(e){var t,r=function(){clearTimeout(i),F&&cancelAnimationFrame(t),setTimeout(e)},i=setTimeout(r,35);F&&(t=requestAnimationFrame(r))}function E(e){var t=n,r=e.__c;"function"==typeof r&&(e.__c=void 0,r()),n=t}function x(e){var t=n;e.__c=e.__(),n=t}function C(e,t){return!e||e.length!==t.length||t.some(function(t,r){return t!==e[r]})}function N(e,t){return"function"==typeof t?t(e):t}const R={position:"relative",width:"100%",minHeight:"100%"},Y={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};function q({data:e,rowHeight:t,renderRow:r,overscanCount:i=10,padding:n=4,...o}){const s=(p=5,T(function(){return{current:null}},[]));const[u,c]=P(0),[l,h]=P(0);k(()=>{function e(){null!=s.current&&l!==s.current.offsetHeight&&h(s.current.offsetHeight)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[l]);const d=I(()=>{s.current&&c(s.current.scrollTop)},[]);let m=Math.floor(u/t),f=Math.floor(l/t);i&&(m=Math.max(0,m-m%i),f+=i);const g=m+f+n,y=e.slice(m,g),v={...R,height:e.length*t},w={...Y,top:m*t};return(0,a.Y)("div",{onScroll:d,ref:s,...o,children:(0,a.Y)("div",{role:"presentation",style:v,children:(0,a.Y)("div",{role:"presentation",style:w,children:y.map(r)})})})}function L(){return(0,a.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58",children:(0,a.Y)("path",{d:"M27.437.517a1 1 0 0 0-.094.03H4.25C2.037.548.217 2.368.217 4.58v48.405c0 2.212 1.82 4.03 4.03 4.03H39.03c2.21 0 4.03-1.818 4.03-4.03V15.61a1 1 0 0 0-.03-.28 1 1 0 0 0 0-.093 1 1 0 0 0-.03-.032 1 1 0 0 0 0-.03 1 1 0 0 0-.032-.063 1 1 0 0 0-.03-.063 1 1 0 0 0-.032 0 1 1 0 0 0-.03-.063 1 1 0 0 0-.032-.03 1 1 0 0 0-.03-.063 1 1 0 0 0-.063-.062l-14.593-14a1 1 0 0 0-.062-.062A1 1 0 0 0 28 .708a1 1 0 0 0-.374-.157 1 1 0 0 0-.156 0 1 1 0 0 0-.03-.03l-.003-.003zM4.25 2.547h22.218v9.97c0 2.21 1.82 4.03 4.03 4.03h10.564v36.438a2.02 2.02 0 0 1-2.032 2.032H4.25c-1.13 0-2.032-.9-2.032-2.032V4.58c0-1.13.902-2.032 2.03-2.032zm24.218 1.345l10.375 9.937.75.718H30.5c-1.13 0-2.032-.9-2.032-2.03V3.89z"})})}function $(){return(0,a.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157",children:(0,a.Y)("path",{d:"M273.08 101.378c-3.3-4.65-8.86-7.32-15.254-7.32h-24.34V67.59c0-10.2-8.3-18.5-18.5-18.5h-85.322c-3.63 0-9.295-2.875-11.436-5.805l-6.386-8.735c-4.982-6.814-15.104-11.954-23.546-11.954H58.73c-9.292 0-18.638 6.608-21.737 15.372l-2.033 5.752c-.958 2.71-4.72 5.37-7.596 5.37H18.5C8.3 49.09 0 57.39 0 67.59v167.07c0 .886.16 1.73.443 2.52.152 3.306 1.18 6.424 3.053 9.064 3.3 4.652 8.86 7.32 15.255 7.32h188.487c11.395 0 23.27-8.425 27.035-19.18l40.677-116.188c2.11-6.035 1.43-12.164-1.87-16.816zM18.5 64.088h8.864c9.295 0 18.64-6.607 21.738-15.37l2.032-5.75c.96-2.712 4.722-5.373 7.597-5.373h29.565c3.63 0 9.295 2.876 11.437 5.806l6.386 8.735c4.982 6.815 15.104 11.954 23.546 11.954h85.322c1.898 0 3.5 1.602 3.5 3.5v26.47H69.34c-11.395 0-23.27 8.423-27.035 19.178L15 191.23V67.59c0-1.898 1.603-3.5 3.5-3.5zm242.29 49.15l-40.676 116.188c-1.674 4.78-7.812 9.135-12.877 9.135H18.75c-1.447 0-2.576-.372-3.02-.997-.442-.625-.422-1.814.057-3.18l40.677-116.19c1.674-4.78 7.812-9.134 12.877-9.134h188.487c1.448 0 2.577.372 3.02.997.443.625.423 1.814-.056 3.18z"})})}function B(){return(0,a.FD)("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58",children:[(0,a.Y)("path",{d:"M36.537 28.156l-11-7a1.005 1.005 0 0 0-1.02-.033C24.2 21.3 24 21.635 24 22v14a1 1 0 0 0 1.537.844l11-7a1.002 1.002 0 0 0 0-1.688zM26 34.18V23.82L34.137 29 26 34.18z"}),(0,a.Y)("path",{d:"M57 6H1a1 1 0 0 0-1 1v44a1 1 0 0 0 1 1h56a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1zM10 28H2v-9h8v9zm-8 2h8v9H2v-9zm10 10V8h34v42H12V40zm44-12h-8v-9h8v9zm-8 2h8v9h-8v-9zm8-22v9h-8V8h8zM2 8h8v9H2V8zm0 42v-9h8v9H2zm54 0h-8v-9h8v9z"})]})}function H({itemIconString:e,alt:t}){if(null===e)return null;switch(e){case"file":return(0,a.Y)(L,{});case"folder":return(0,a.Y)($,{});case"video":return(0,a.Y)(B,{});default:return(0,a.Y)("img",{src:e,alt:t,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}var D=function({file:e,toggleCheckbox:t,className:r,isDisabled:i,restrictionError:n,showTitles:o,children:s=null,i18n:u}){return(0,a.FD)("li",{className:r,title:i&&n?n:void 0,children:[(0,a.Y)("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox uppy-ProviderBrowserItem-checkbox--grid",onChange:t,name:"listitem",id:e.id,checked:"checked"===e.status,disabled:i,"data-uppy-super-focusable":!0}),(0,a.FD)("label",{htmlFor:e.id,"aria-label":e.data.name??u("unnamed"),className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[(0,a.Y)(H,{itemIconString:e.data.thumbnail||e.data.icon}),o&&(e.data.name??u("unnamed")),s]})]})};function O({file:e,openFolder:t,className:r,isDisabled:i,restrictionError:n,toggleCheckbox:o,showTitles:s,i18n:u}){return(0,a.FD)("li",{className:r,title:"checked"!==e.status&&n?n:void 0,children:[(0,a.Y)("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:o,name:"listitem",id:e.id,checked:"checked"===e.status,"aria-label":e.data.isFolder?u("allFilesFromFolderNamed",{name:e.data.name??u("unnamed")}):null,disabled:i,"data-uppy-super-focusable":!0}),e.data.isFolder?(0,a.FD)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:()=>t(e.id),"aria-label":u("openFolderNamed",{name:e.data.name??u("unnamed")}),children:[(0,a.Y)("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:(0,a.Y)(H,{itemIconString:e.data.icon})}),s&&e.data.name?(0,a.Y)("span",{className:"uppy-truncate-text",children:e.data.name}):u("unnamed")]}):(0,a.FD)("label",{htmlFor:e.id,className:"uppy-u-reset uppy-ProviderBrowserItem-inner",children:[(0,a.Y)("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:(0,a.Y)(H,{itemIconString:e.data.icon})}),s&&(0,a.Y)("span",{className:"uppy-truncate-text",children:e.data.name??u("unnamed")})]})]})}function z(e){const{viewType:t,toggleCheckbox:r,showTitles:i,i18n:n,openFolder:o,file:s,utmSource:u}=e,l="folder"===s.type?null:s.restrictionError,h=!!l&&"checked"!==s.status,p={file:s,openFolder:o,toggleCheckbox:r,utmSource:u,i18n:n,viewType:t,showTitles:i,className:c("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":h},{"uppy-ProviderBrowserItem--noPreview":"video"===s.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===s.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===s.status}),isDisabled:h,restrictionError:l};switch(t){case"grid":return(0,a.Y)(D,{...p});case"list":return(0,a.Y)(O,{...p});case"unsplash":return(0,a.Y)(D,{...p,children:(0,a.Y)("a",{href:`${s.data.author.url}?utm_source=${u}&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1,children:s.data.author.name})});default:throw new Error(`There is no such type ${t}`)}}var U=function(e){const{displayedPartialTree:t,viewType:r,toggleCheckbox:i,handleScroll:n,showTitles:o,i18n:s,isLoading:u,openFolder:c,noResultsLabel:l,virtualList:h,utmSource:p}=e,[d,m]=P(!1);if(k(()=>{const e=e=>{"Shift"===e.key&&m(!1)},t=e=>{"Shift"===e.key&&m(!0)};return document.addEventListener("keyup",e),document.addEventListener("keydown",t),()=>{document.removeEventListener("keyup",e),document.removeEventListener("keydown",t)}},[]),u)return(0,a.Y)("div",{className:"uppy-Provider-loading",children:"string"==typeof u?u:s("loading")});if(0===t.length)return(0,a.Y)("div",{className:"uppy-Provider-empty",children:l});const f=e=>(0,a.Y)(z,{viewType:r,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),i(e,d)},showTitles:o,i18n:s,openFolder:c,file:e,utmSource:p},e.id);return h?(0,a.Y)("div",{className:"uppy-ProviderBrowser-body",children:(0,a.Y)(q,{className:"uppy-ProviderBrowser-list",data:t,renderRow:f,rowHeight:35.5})}):(0,a.Y)("div",{className:"uppy-ProviderBrowser-body",children:(0,a.Y)("ul",{className:"uppy-ProviderBrowser-list",onScroll:n,tabIndex:-1,children:t.map(f)})})},M=r(590),j=function({value:e,onChange:t,onSubmit:r,inputLabel:i,i18n:n}){const{formId:o}=function(e){const t=I(t=>{t.preventDefault(),e()},[e]),[r]=P(()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=(0,M.A)(),e});return k(()=>(document.body.appendChild(r),r.addEventListener("submit",t),()=>{r.removeEventListener("submit",t),document.body.removeChild(r)}),[r,t]),{formId:r.id}}(r);return(0,a.FD)("section",{className:"uppy-ProviderBrowser-searchFilter",children:[(0,a.Y)("input",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterInput",type:"search","aria-label":i,placeholder:i,value:e,onInput:e=>t(e.target.value),form:o,"data-uppy-super-focusable":!0}),(0,a.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12",children:(0,a.Y)("path",{d:"M8.638 7.99l3.172 3.172a.492.492 0 1 1-.697.697L7.91 8.656a4.977 4.977 0 0 1-2.983.983C2.206 9.639 0 7.481 0 4.819 0 2.158 2.206 0 4.927 0c2.721 0 4.927 2.158 4.927 4.82a4.74 4.74 0 0 1-1.216 3.17zm-3.71.685c2.176 0 3.94-1.726 3.94-3.856 0-2.129-1.764-3.855-3.94-3.855C2.75.964.984 2.69.984 4.819c0 2.13 1.765 3.856 3.942 3.856z"})}),e&&(0,a.Y)("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":n("resetFilter"),onClick:()=>t(""),children:(0,a.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19",children:(0,a.Y)("path",{d:"M17.318 17.232L9.94 9.854 9.586 9.5l-.354.354-7.378 7.378h.707l-.62-.62v.706L9.318 9.94l.354-.354-.354-.354L1.94 1.854v.707l.62-.62h-.706l7.378 7.378.354.354.354-.354 7.378-7.378h-.707l.622.62v-.706L9.854 9.232l-.354.354.354.354 7.378 7.378.708-.707-7.38-7.378v.708l7.38-7.38.353-.353-.353-.353-.622-.622-.353-.353-.354.352-7.378 7.38h.708L2.56 1.23 2.208.88l-.353.353-.622.62-.353.355.352.353 7.38 7.38v-.708l-7.38 7.38-.353.353.352.353.622.622.353.353.354-.353 7.38-7.38h-.708l7.38 7.38z"})})})]})},V=e=>{const t=e.filter(t=>{if("file"===t.type&&"checked"===t.status)return!0;if("folder"===t.type&&"checked"===t.status){const r=e.some(e=>"root"!==e.type&&e.parentId===t.id);return!r}return!1});return t.length};function W({cancelSelection:e,donePicking:t,i18n:r,partialTree:i,validateAggregateRestrictions:n}){const o=T(()=>n(i),[i,n]),s=T(()=>V(i),[i]);return 0===s?null:(0,a.FD)("div",{className:"uppy-ProviderBrowser-footer",children:[(0,a.FD)("div",{className:"uppy-ProviderBrowser-footer-buttons",children:[(0,a.Y)("button",{className:c("uppy-u-reset uppy-c-btn uppy-c-btn-primary",{"uppy-c-btn--disabled":o}),disabled:!!o,onClick:t,type:"button",children:r("selectX",{smart_count:s})}),(0,a.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:e,type:"button",children:r("cancel")})]}),o&&(0,a.Y)("div",{className:"uppy-ProviderBrowser-footer-error",children:o})]})}var K=r(5417),J=e=>t=>{t.isAuthError||("AbortError"!==t.name?(e.log(t,"error"),"UserFacingApiError"===t.name&&e.info({message:e.i18n("companionError"),details:e.i18n(t.message)},"warning",5e3)):e.log("Aborting request","warning"))};const Q=(e,t,r)=>{const i=null===t?"null":t;if(r[i])return r[i];const n=e.find(e=>e.id===t);if("root"===n.type)return[];const o=[...Q(e,n.parentId,r),n];return r[i]=o,o};var G=r(3183);class X extends Error{constructor(e){super(e),this.name="TimeoutError"}}class Z extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const ee=e=>void 0===globalThis.DOMException?new Z(e):new DOMException(e),te=e=>{const t=void 0===e.reason?ee("This operation was aborted."):e.reason;return t instanceof Error?t:ee(t)};class re{#a=[];enqueue(e,t){const r={priority:(t={priority:0,...t}).priority,id:t.id,run:e};if(0===this.size||this.#a[this.size-1].priority>=t.priority)return void this.#a.push(r);const i=function(e,t,r){let i=0,n=e.length;for(;n>0;){const o=Math.trunc(n/2);let s=i+o;r(e[s],t)<=0?(i=++s,n-=o+1):n=o}return i}(this.#a,r,(e,t)=>t.priority-e.priority);this.#a.splice(i,0,r)}setPriority(e,t){const r=this.#a.findIndex(t=>t.id===e);if(-1===r)throw new ReferenceError(`No promise function with the id "${e}" exists in the queue.`);const[i]=this.#a.splice(r,1);this.enqueue(i.run,{priority:t,id:e})}dequeue(){const e=this.#a.shift();return e?.run}filter(e){return this.#a.filter(t=>t.priority===e.priority).map(e=>e.run)}get size(){return this.#a.length}}class ie extends G{#u;#c;#l=0;#h;#p;#d=0;#m;#f;#a;#g;#y=0;#v;#w;#_;#b=1n;timeout;constructor(e){if(super(),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:re,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${e.intervalCap?.toString()??""}\` (${typeof e.intervalCap})`);if(void 0===e.interval||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${e.interval?.toString()??""}\` (${typeof e.interval})`);this.#u=e.carryoverConcurrencyCount,this.#c=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#h=e.intervalCap,this.#p=e.interval,this.#a=new e.queueClass,this.#g=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#_=!0===e.throwOnTimeout,this.#w=!1===e.autoStart}get#P(){return this.#c||this.#l<this.#h}get#k(){return this.#y<this.#v}#T(){this.#y--,this.#I(),this.emit("next")}#S(){this.#F(),this.#A(),this.#f=void 0}get#E(){const e=Date.now();if(void 0===this.#m){const t=this.#d-e;if(!(t<0))return void 0===this.#f&&(this.#f=setTimeout(()=>{this.#S()},t)),!0;this.#l=this.#u?this.#y:0}return!1}#I(){if(0===this.#a.size)return this.#m&&clearInterval(this.#m),this.#m=void 0,this.emit("empty"),0===this.#y&&this.emit("idle"),!1;if(!this.#w){const e=!this.#E;if(this.#P&&this.#k){const t=this.#a.dequeue();return!!t&&(this.emit("active"),t(),e&&this.#A(),!0)}}return!1}#A(){this.#c||void 0!==this.#m||(this.#m=setInterval(()=>{this.#F()},this.#p),this.#d=Date.now()+this.#p)}#F(){0===this.#l&&0===this.#y&&this.#m&&(clearInterval(this.#m),this.#m=void 0),this.#l=this.#u?this.#y:0,this.#x()}#x(){for(;this.#I(););}get concurrency(){return this.#v}set concurrency(e){if(!("number"==typeof e&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this.#v=e,this.#x()}async#C(e){return new Promise((t,r)=>{e.addEventListener("abort",()=>{r(e.reason)},{once:!0})})}setPriority(e,t){this.#a.setPriority(e,t)}async add(e,t={}){return t.id??=(this.#b++).toString(),t={timeout:this.timeout,throwOnTimeout:this.#_,...t},new Promise((r,i)=>{this.#a.enqueue(async()=>{this.#y++;try{t.signal?.throwIfAborted(),this.#l++;let i=e({signal:t.signal});t.timeout&&(i=function(e,t){const{milliseconds:r,fallback:i,message:n,customTimers:o={setTimeout:setTimeout,clearTimeout:clearTimeout}}=t;let s,a;const u=new Promise((u,c)=>{if("number"!=typeof r||1!==Math.sign(r))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${r}\``);if(t.signal){const{signal:e}=t;e.aborted&&c(te(e)),a=()=>{c(te(e))},e.addEventListener("abort",a,{once:!0})}if(r===Number.POSITIVE_INFINITY)return void e.then(u,c);const l=new X;s=o.setTimeout.call(void 0,()=>{if(i)try{u(i())}catch(e){c(e)}else"function"==typeof e.cancel&&e.cancel(),!1===n?u():n instanceof Error?c(n):(l.message=n??`Promise timed out after ${r} milliseconds`,c(l))},r),(async()=>{try{u(await e)}catch(e){c(e)}})()}).finally(()=>{u.clear(),a&&t.signal&&t.signal.removeEventListener("abort",a)});return u.clear=()=>{o.clearTimeout.call(void 0,s),s=void 0},u}(Promise.resolve(i),{milliseconds:t.timeout})),t.signal&&(i=Promise.race([i,this.#C(t.signal)]));const n=await i;r(n),this.emit("completed",n)}catch(e){if(e instanceof X&&!t.throwOnTimeout)return void r();i(e),this.emit("error",e)}finally{this.#T()}},t),this.emit("add"),this.#I()})}async addAll(e,t){return Promise.all(e.map(async e=>this.add(e,t)))}start(){return this.#w?(this.#w=!1,this.#x(),this):this}pause(){this.#w=!0}clear(){this.#a=new this.#g}async onEmpty(){0!==this.#a.size&&await this.#N("empty")}async onSizeLessThan(e){this.#a.size<e||await this.#N("next",()=>this.#a.size<e)}async onIdle(){0===this.#y&&0===this.#a.size||await this.#N("idle")}async#N(e,t){return new Promise(r=>{const i=()=>{t&&!t()||(this.off(e,i),r())};this.on(e,i)})}get size(){return this.#a.size}sizeBy(e){return this.#a.filter(e).length}get pending(){return this.#y}get isPaused(){return this.#w}}var ne=e=>e.map(e=>({...e}));const oe=async(e,t,r,i,n)=>{let o=[],s=r.cached?r.nextPagePath:r.id;for(;s;){const e=await i(s);o=o.concat(e.items),s=e.nextPagePath}const a=o.filter(e=>!0===e.isFolder),u=o.filter(e=>!1===e.isFolder),c=a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:r.id,data:e})),l=u.map(e=>{const t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:t?"unchecked":"checked",parentId:r.id,data:e}});r.cached=!0,r.nextPagePath=null,t.push(...l,...c),c.forEach(async r=>{e.add(()=>oe(e,t,r,i,n))})};const se=(e,t,r)=>{e.filter(e=>"root"!==e.type&&e.parentId===t).forEach(t=>{t.status=!r||"file"===t.type&&t.restrictionError?"unchecked":"checked",se(e,t.id,r)})},ae=(e,t)=>{const r=e.find(e=>e.id===t);if("root"===r.type)return;const i=e.filter(e=>"root"!==e.type&&e.parentId===r.id&&!("file"===e.type&&e.restrictionError)),n=i.every(e=>"checked"===e.status),o=i.every(e=>"unchecked"===e.status);n&&r.cached?r.status="checked":r.status=o?"unchecked":"partial",ae(e,r.parentId)};var ue=(e,t,r,i,n)=>{const o=t.filter(t=>!e.find(e=>e.id===t.requestPath)),s=o.filter(e=>!0===e.isFolder),a=o.filter(e=>!1===e.isFolder),u="folder"===r.type&&"checked"===r.status,c=s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:u?"checked":"unchecked",parentId:r.id,data:e})),l=a.map(e=>{const t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:u&&!t?"checked":"unchecked",parentId:r.id,data:e}}),h={...r,cached:!0,nextPagePath:i};return[...e.map(e=>e.id===h.id?h:e),...c,...l]},ce=(e,t,r,i,n)=>{const o=e.find(e=>e.id===t),s=r.filter(e=>!0===e.isFolder),a=r.filter(e=>!1===e.isFolder),u={...o,nextPagePath:i},c=e.map(e=>e.id===u.id?u:e),l="folder"===u.type&&"checked"===u.status;return[...c,...s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:l?"checked":"unchecked",parentId:u.id,data:e})),...a.map(e=>{const t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:l&&!t?"checked":"unchecked",parentId:u.id,data:e}})]},le=(e,t)=>{const r=ne(e),i=r.filter(e=>"root"!==e.type&&t.includes(e.id));return i.forEach(e=>{const t="checked"===e.status?"unchecked":"checked";"file"===e.type?e.status=e.restrictionError?"unchecked":t:e.status=t,se(r,e.id,"checked"===e.status)}),ae(r,i[0].parentId),r},he=async(e,t,r,i)=>{const n=new ie({concurrency:6}),o=ne(e);return o.filter(e=>"folder"===e.type&&"checked"===e.status&&(!1===e.cached||e.nextPagePath)).forEach(e=>{n.add(()=>oe(n,o,e,t,r))}),n.on("completed",()=>{const e=o.filter(e=>"file"===e.type&&"checked"===e.status).length;i(e)}),await n.onIdle(),o};function pe(){return(0,a.Y)("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg",children:(0,a.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,a.Y)("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),(0,a.Y)("path",{d:"M21.64 13.205c0-.639-.057-1.252-.164-1.841H13v3.481h4.844a4.14 4.14 0 01-1.796 2.716v2.259h2.908c1.702-1.567 2.684-3.875 2.684-6.615z",fill:"#4285F4","fill-rule":"nonzero"}),(0,a.Y)("path",{d:"M13 22c2.43 0 4.467-.806 5.956-2.18l-2.908-2.259c-.806.54-1.837.86-3.048.86-2.344 0-4.328-1.584-5.036-3.711H4.957v2.332A8.997 8.997 0 0013 22z",fill:"#34A853","fill-rule":"nonzero"}),(0,a.Y)("path",{d:"M7.964 14.71A5.41 5.41 0 017.682 13c0-.593.102-1.17.282-1.71V8.958H4.957A8.996 8.996 0 004 13c0 1.452.348 2.827.957 4.042l3.007-2.332z",fill:"#FBBC05","fill-rule":"nonzero"}),(0,a.Y)("path",{d:"M13 7.58c1.321 0 2.508.454 3.44 1.345l2.582-2.58C17.463 4.891 15.426 4 13 4a8.997 8.997 0 00-8.043 4.958l3.007 2.332C8.672 9.163 10.656 7.58 13 7.58z",fill:"#EA4335","fill-rule":"nonzero"}),(0,a.Y)("path",{d:"M4 4h18v18H4z"})]})})}function de({pluginName:e,i18n:t,onAuth:r}){const i="Google Drive"===e,n=I(e=>{e.preventDefault(),r()},[r]);return(0,a.Y)("form",{onSubmit:n,children:i?(0,a.FD)("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn uppy-Provider-btn-google","data-uppy-super-focusable":!0,children:[(0,a.Y)(pe,{}),t("signInWithGoogle")]}):(0,a.Y)("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0,children:t("authenticateWith",{pluginName:e})})})}const me=({pluginName:e,i18n:t,onAuth:r})=>(0,a.Y)(de,{pluginName:e,i18n:t,onAuth:r});function fe({loading:e,pluginName:t,pluginIcon:r,i18n:i,handleAuth:n,renderForm:o=me}){return(0,a.FD)("div",{className:"uppy-Provider-auth",children:[(0,a.Y)("div",{className:"uppy-Provider-authIcon",children:r()}),(0,a.Y)("div",{className:"uppy-Provider-authTitle",children:i("authenticateWithTitle",{pluginName:t})}),o({pluginName:t,i18n:i,loading:e,onAuth:n})]})}var ge=({i18n:e,item:t,toggleCheckbox:r,openFolder:i})=>{const n="restrictionError"in t&&null!=t.restrictionError&&"checked"!==t.status;return(0,a.FD)("li",{className:c("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--disabled":n},{"uppy-ProviderBrowserItem--noPreview":"video"===t.data.icon},{"uppy-ProviderBrowserItem--is-checked":"checked"===t.status},{"uppy-ProviderBrowserItem--is-partial":"partial"===t.status}),title:("restrictionError"in t?t.restrictionError:void 0)??void 0,children:[(0,a.Y)("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox",onChange:()=>r(t,!1),checked:"checked"===t.status,"aria-label":t.data.name??e("unnamed"),disabled:n,"data-uppy-super-focusable":!0}),(0,a.FD)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",disabled:n,"aria-label":t.data.name,onClick:()=>{t.data.isFolder&&i(t.id)},children:[(0,a.Y)("div",{className:"uppy-ProviderBrowserItem-iconWrap",children:(0,a.Y)(H,{itemIconString:t.data.icon})}),t.data.name??e("unnamed")]})]})},ye=({searchResults:e,toggleCheckbox:t,openFolder:r,i18n:i})=>0===e.length?(0,a.Y)("div",{className:"uppy-Provider-empty",children:i("noFilesFound")}):(0,a.Y)("div",{className:"uppy-ProviderBrowser-body",children:(0,a.Y)("ul",{className:"uppy-ProviderBrowser-list",children:e.map(e=>(0,a.Y)(ge,{i18n:i,item:e,toggleCheckbox:t,openFolder:r},e.id))})});function ve(e){const{openFolder:t,title:r,breadcrumbsIcon:i,breadcrumbs:n,i18n:o}=e;return(0,a.FD)("div",{className:"uppy-Provider-breadcrumbs",children:[(0,a.Y)("div",{className:"uppy-Provider-breadcrumbsIcon",children:i}),n.map((e,i)=>(0,a.FD)(h.FK,{children:[(0,a.Y)("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:()=>t(e.id),children:"root"===e.type?r:e.data.name??o("unnamed")},e.id),n.length===i+1?"":" / "]}))]})}function we({i18n:e,logout:t,username:r}){return(0,a.FD)(h.FK,{children:[r&&(0,a.Y)("span",{className:"uppy-ProviderBrowser-user",children:r},"username"),(0,a.Y)("button",{type:"button",onClick:t,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",children:e("logOut")},"logout")]})}function _e(e){return(0,a.Y)("div",{className:"uppy-ProviderBrowser-header",children:(0,a.FD)("div",{className:c("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple"),children:[e.showBreadcrumbs&&(0,a.Y)(ve,{openFolder:e.openFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon?.(),title:e.title,i18n:e.i18n}),(0,a.Y)(we,{logout:e.logout,username:e.username,i18n:e.i18n})]})})}function be(){return(0,a.Y)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30",children:(0,a.Y)("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"})})}const Pe=e=>({authenticated:void 0,partialTree:[{type:"root",id:e,cached:!1,nextPagePath:null}],currentFolderId:e,searchString:"",didFirstRender:!1,username:null,loading:!1});class ke{static VERSION="5.2.2";static[Symbol.for("uppy test: searchDebounceMs")];plugin;provider;opts;isHandlingScroll=!1;previousCheckbox=null;#R;constructor(e,t){this.plugin=e,this.provider=t.provider,this.opts={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1,virtualList:!1,...t},this.openFolder=this.openFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.cancelSelection=this.cancelSelection.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.openSearchResultFolder=this.openSearchResultFolder.bind(this),this.clearSearchState=this.clearSearchState.bind(this),this.resetPluginState(),this.plugin.uppy.on("dashboard:close-panel",this.resetPluginState),this.plugin.uppy.registerRequestClient(this.provider.provider,this.provider);const r=Symbol.for("uppy test: searchDebounceMs"),i=ke[r],n=i??500,o=0===i?{leading:!0,trailing:!0}:void 0;this.#R=l(this.#Y,n,o)}resetPluginState(){this.plugin.setPluginState(Pe(this.plugin.rootFolderId))}tearDown(){}setLoading(e){this.plugin.setPluginState({loading:e})}get isLoading(){return this.plugin.getPluginState().loading}cancelSelection(){const{partialTree:e}=this.plugin.getPluginState(),t=e.map(e=>"root"===e.type?e:{...e,status:"unchecked"});this.plugin.setPluginState({partialTree:t})}clearSearchState(){this.plugin.setPluginState({searchResults:void 0})}#q;async#L(e){this.#q?.abort();const t=new AbortController;this.#q=t;const r=()=>{t.abort()};try{this.plugin.uppy.on("dashboard:close-panel",r),this.plugin.uppy.on("cancel-all",r),await e(t.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",r),this.plugin.uppy.off("cancel-all",r),this.#q=void 0}}async#Y(){const{partialTree:e,currentFolderId:t,searchString:r}=this.plugin.getPluginState(),i=e.find(e=>e.id===t);if(""===r.trim())return this.#q?.abort(),void this.clearSearchState();this.setLoading(!0),await this.#L(async e=>{const n="root"===i.type?void 0:t,{items:o}=await this.provider.search(r,{signal:e,path:n}),{partialTree:s}=this.plugin.getPluginState(),a=[...s];for(const e of o){const t=decodeURIComponent(e.requestPath).split("/").filter(e=>e.length>0);let r,i=this.plugin.rootFolderId;t.forEach((n,o,s)=>{const u=t.slice(0,o+1),c=encodeURIComponent(`/${u.join("/")}`),l=a.find(e=>e.id===c&&"root"!==e.type);if(l)return i=c,void(r="checked"===l.status);const h=o===s.length-1;let p;const d=r?"checked":"unchecked";if(h)if(e.isFolder)p={type:"folder",id:c,cached:!1,nextPagePath:null,status:d,parentId:i,data:e};else{const t=this.validateSingleFile(e);p={type:"file",id:c,restrictionError:t,status:t?"unchecked":d,parentId:i,data:e}}else p={type:"folder",id:c,cached:!1,nextPagePath:null,status:d,parentId:i,data:{name:decodeURIComponent(n),icon:"folder",isFolder:!0}};a.push(p),i=c,r="checked"===d})}this.plugin.setPluginState({partialTree:a,searchResults:o.map(e=>e.requestPath)})}).catch(J(this.plugin.uppy)),this.setLoading(!1)}onSearchInput=e=>{this.plugin.setPluginState({searchString:e}),this.opts.supportsSearch&&this.#R()};async openSearchResultFolder(e){this.plugin.setPluginState({searchString:""}),await this.openFolder(e)}async openFolder(e){this.clearSearchState(),this.previousCheckbox=null;const{partialTree:t}=this.plugin.getPluginState(),r=t.find(t=>t.id===e);r.cached?this.plugin.setPluginState({currentFolderId:e,searchString:""}):(this.setLoading(!0),await this.#L(async i=>{let n=e,o=[];do{const{username:e,nextPagePath:t,items:r}=await this.provider.list(n,{signal:i});this.plugin.setPluginState({username:e}),n=t,o=o.concat(r),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:o.length}))}while(this.opts.loadAllFiles&&n);const s=ue(t,o,r,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:s,currentFolderId:e,searchString:""})}).catch(J(this.plugin.uppy)),this.setLoading(!1))}async logout(){await this.#L(async e=>{const t=await this.provider.logout({signal:e});if(t.ok){if(!t.revoked){const e=this.plugin.uppy.i18n("companionUnauthorizeHint",{provider:this.plugin.title,url:t.manual_revoke_url});this.plugin.uppy.info(e,"info",7e3)}this.plugin.setPluginState({...Pe(this.plugin.rootFolderId),authenticated:!1})}}).catch(J(this.plugin.uppy))}async handleAuth(e){await this.#L(async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),await Promise.all([this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId)])}).catch(J(this.plugin.uppy)),this.setLoading(!1)}async handleScroll(e){const{partialTree:t,currentFolderId:r}=this.plugin.getPluginState(),i=t.find(e=>e.id===r);(e=>{const{scrollHeight:t,scrollTop:r,offsetHeight:i}=e.target;return t-(r+i)<50})(e)&&!this.isHandlingScroll&&i.nextPagePath&&(this.isHandlingScroll=!0,await this.#L(async e=>{const{nextPagePath:n,items:o}=await this.provider.list(i.nextPagePath,{signal:e}),s=ce(t,r,o,n,this.validateSingleFile);this.plugin.setPluginState({partialTree:s})}).catch(J(this.plugin.uppy)),this.isHandlingScroll=!1)}validateSingleFile=e=>{const t=function(e){return{...e,type:e.mimeType,extension:e.name?(0,u.A)(e.name).extension:null}}(e);return this.plugin.uppy.validateSingleFile(t)};async donePicking(){const{partialTree:e}=this.plugin.getPluginState();this.isLoading||(this.setLoading(!0),await this.#L(async t=>{const r=await he(e,e=>this.provider.list(e,{signal:t}),this.validateSingleFile,e=>{this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:e}))});if(this.validateAggregateRestrictions(r))return void this.plugin.setPluginState({partialTree:r});const i=(e=>{const t=Object.create(null),r=e.filter(e=>"file"===e.type&&"checked"===e.status).map(r=>{const i=Q(e,r.id,t),n=i.findIndex(e=>"folder"===e.type&&"checked"===e.status),o=i.slice(n),s=`/${i.map(e=>e.data.name).join("/")}`,a=1===o.length?void 0:o.map(e=>e.data.name).join("/");return{...r.data,absDirPath:s,relDirPath:a}});return r})(r);((e,t,r)=>{const i=e.map(e=>((e,t,r)=>{const i=e.name||e.id;return{id:e.id,source:t.id,name:i,type:e.mimeType,isRemote:!0,data:e,preview:e.thumbnail||void 0,meta:{authorName:e.author?.name,authorUrl:e.author?.url,relativePath:e.relDirPath||null,absolutePath:e.absDirPath},body:{fileId:e.id},remote:{companionUrl:t.opts.companionUrl,url:`${r.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:r.name,provider:r.provider,requestClientId:r.provider}}})(e,t,r)),n=[],o=[];i.forEach(e=>{t.uppy.checkIfFileAlreadyExists((0,K.N)(e,t.uppy.getID()))?o.push(e):n.push(e)}),n.length>0&&t.uppy.info(t.uppy.i18n("addedNumFiles",{numFiles:n.length})),o.length>0&&t.uppy.info(`Not adding ${o.length} files because they already exist`),t.uppy.addFiles(n)})(i,this.plugin,this.provider),this.resetPluginState()}).catch(J(this.plugin.uppy)),this.setLoading(!1))}toggleCheckbox(e,t){const{partialTree:r}=this.plugin.getPluginState(),i=((e,t,r,i)=>{const n=t.findIndex(e=>e.id===i);if(-1!==n&&r){const r=t.findIndex(t=>t.id===e);return t.slice(Math.min(n,r),Math.max(n,r)+1).map(e=>e.id)}return[e]})(e.id,this.getDisplayedPartialTree(),t,this.previousCheckbox),n=le(r,i);this.plugin.setPluginState({partialTree:n}),this.previousCheckbox=e.id}getDisplayedPartialTree=()=>{const{partialTree:e,currentFolderId:t,searchString:r}=this.plugin.getPluginState(),i=e.filter(e=>"root"!==e.type&&e.parentId===t);return this.opts.supportsSearch||""===r.trim()?i:i.filter(e=>-1!==(e.data.name??this.plugin.uppy.i18n("unnamed")).toLowerCase().indexOf(r.trim().toLowerCase()))};getBreadcrumbs=()=>{const{partialTree:e,currentFolderId:t}=this.plugin.getPluginState();return((e,t)=>{let r=e.find(e=>e.id===t),i=[];for(;i=[r,...i],"root"!==r.type;){const t=r.parentId;r=e.find(e=>e.id===t)}return i})(e,t)};getSelectedAmount=()=>{const{partialTree:e}=this.plugin.getPluginState();return V(e)};validateAggregateRestrictions=e=>{const t=e.filter(e=>"file"===e.type&&"checked"===e.status).map(e=>e.data);return this.plugin.uppy.validateAggregateRestrictions(t)};#$(){const{i18n:e}=this.plugin.uppy,{searchResults:t,partialTree:r}=this.plugin.getPluginState(),i=new Map;r.forEach(e=>{"root"!==e.type&&i.set(e.id,e)});const n=t.map(e=>{const t=i.get(e);if(null==t)throw new Error("Partial tree not complete");return t});return(0,a.Y)(ye,{searchResults:n,openFolder:this.openSearchResultFolder,toggleCheckbox:this.toggleCheckbox,i18n:e})}render(e,t={}){const{didFirstRender:r}=this.plugin.getPluginState(),{i18n:i}=this.plugin.uppy;r||(this.plugin.setPluginState({didFirstRender:!0}),this.provider.fetchPreAuthToken(),this.openFolder(this.plugin.rootFolderId));const n={...this.opts,...t},{authenticated:o,loading:s}=this.plugin.getPluginState(),u=this.plugin.icon||be;if(!1===o)return(0,a.Y)(fe,{pluginName:this.plugin.title,pluginIcon:u,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:s});const{partialTree:l,username:h,searchString:p,searchResults:d}=this.plugin.getPluginState(),m=this.getBreadcrumbs();return(0,a.FD)("div",{className:c("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${n.viewType}`),children:[(0,a.Y)(_e,{showBreadcrumbs:n.showBreadcrumbs,openFolder:this.openFolder,breadcrumbs:m,pluginIcon:u,title:this.plugin.title,logout:this.logout,username:h,i18n:i}),n.showFilter&&(0,a.Y)(j,{value:p,onChange:e=>this.onSearchInput(e),onSubmit:()=>{},inputLabel:i("filter"),i18n:i}),d?this.#$():(0,a.Y)(U,{toggleCheckbox:this.toggleCheckbox,displayedPartialTree:this.getDisplayedPartialTree(),openFolder:this.openFolder,virtualList:n.virtualList,noResultsLabel:i("noFilesFound"),handleScroll:this.handleScroll,viewType:n.viewType,showTitles:n.showTitles,i18n:this.plugin.uppy.i18n,isLoading:s,utmSource:"Companion"}),(0,a.Y)(W,{partialTree:l,donePicking:this.donePicking,cancelSelection:this.cancelSelection,i18n:i,validateAggregateRestrictions:this.validateAggregateRestrictions})]})}}},8396:function(e,t,r){"use strict";var i=r(9420);class n extends Error{isNetworkError;cause;constructor(e,t){super(e),this.cause=t?.cause,this.cause&&(0,i.A)(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}t.A=n},6681:function(e,t){"use strict";class r 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}}t.A=r},5945:function(e,t,r){"use strict";r.d(t,{A:function(){return n}});var i=r(6681);function n(...e){return fetch(...e).catch(e=>{throw"AbortError"===e.name?e:new i.A(e)})}},5417:function(e,t,r){"use strict";r.d(t,{N:function(){return o}});var i=r(7623);function n(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}function o(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const r=(0,i.A)(e);return function(e,t){let r=t||"uppy";return"string"==typeof e.name&&(r+=`-${n(e.name.toLowerCase())}`),void 0!==e.type&&(r+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(r+=`-${n(e.meta.relativePath.toLowerCase())}`),void 0!==e.data?.size&&(r+=`-${e.data.size}`),void 0!==e.data.lastModified&&(r+=`-${e.data.lastModified}`),r}({...e,type:r},t)}},6506:function(e,t,r){"use strict";function i(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}r.d(t,{A:function(){return i}})},7623:function(e,t,r){"use strict";r.d(t,{A:function(){return o}});var i=r(6506),n=r(7544);function o(e){if(e.type)return e.type;const t=e.name?(0,i.A)(e.name).extension?.toLowerCase():null;return t&&t in n.A?n.A[t]:"application/octet-stream"}},9420:function(e,t,r){"use strict";function i(e,t){return Object.hasOwn(e,t)}r.d(t,{A:function(){return i}})},590:function(e,t,r){"use strict";r.d(t,{A:function(){return i}});let i=(e=21)=>{let t="",r=0|e;for(;r--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}}}]);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[6],{7301:function(e){"use strict";e.exports=function(e){if("number"!=typeof e||Number.isNaN(e))throw new TypeError("Expected a number, got "+typeof e);const t=e<0;let s=Math.abs(e);if(t&&(s=-s),0===s)return"0 B";const i=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],r=Math.min(Math.floor(Math.log(s)/Math.log(1024)),i.length-1),o=Number(s/1024**r),n=i[r];return`${o>=10||o%1==0?Math.round(o):o.toFixed(1)} ${n}`}},4967:function(e,t,s){var i="object"==typeof s.g&&s.g&&s.g.Object===Object&&s.g;e.exports=i},8942:function(e,t,s){var i=s(4967),r="object"==typeof self&&self&&self.Object===Object&&self,o=i||r||Function("return this")();e.exports=o},2784:function(e,t,s){var i=s(1580),r=s(4495),o=s(6131),n=Math.max,l=Math.min;e.exports=function(e,t,s){var a,d,u,h,c,p,g=0,f=!1,m=!1,y=!0;if("function"!=typeof e)throw new TypeError("Expected a function");function w(t){var s=a,i=d;return a=d=void 0,g=t,h=e.apply(i,s)}function F(e){var s=e-p;return void 0===p||s>=t||s<0||m&&e-g>=u}function v(){var e=r();if(F(e))return S(e);c=setTimeout(v,function(e){var s=t-(e-p);return m?l(s,u-(e-g)):s}(e))}function S(e){return c=void 0,y&&a?w(e):(a=d=void 0,h)}function b(){var e=r(),s=F(e);if(a=arguments,d=this,p=e,s){if(void 0===c)return function(e){return g=e,c=setTimeout(v,t),f?w(e):h}(p);if(m)return clearTimeout(c),c=setTimeout(v,t),w(p)}return void 0===c&&(c=setTimeout(v,t)),h}return t=o(t)||0,i(s)&&(f=!!s.leading,u=(m="maxWait"in s)?n(o(s.maxWait)||0,t):u,y="trailing"in s?!!s.trailing:y),b.cancel=function(){void 0!==c&&clearTimeout(c),g=0,a=p=d=c=void 0},b.flush=function(){return void 0===c?h:S(r())},b}},4495:function(e,t,s){var i=s(8942);e.exports=function(){return i.Date.now()}},7331:function(e,t,s){var i=s(2784),r=s(1580);e.exports=function(e,t,s){var o=!0,n=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return r(s)&&(o="leading"in s?!!s.leading:o,n="trailing"in s?!!s.trailing:n),i(e,t,{leading:o,maxWait:t,trailing:n})}},6131:function(e){e.exports=function(e){return e}},1566:function(e,t,s){var i=s(7764),r=/[\/\+\.]/;e.exports=function(e,t){function s(t){var s=i(t,e,r);return s&&s.length>=2}return t?s(t.split(";")[0]):s}},2162:function(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,s,i,r,o,n,l){var a=function(e){for(var s=t[e]?t[e]:[],i=e.indexOf(":"),r=-1===i?[e]:[e.substring(0,i),e.substring(i+1)],o=Object.keys(t),n=0,l=o.length;n<l;n++){var a=o[n];if("*"===a&&(s=s.concat(t[a])),2===r.length&&r[0]===a){s=s.concat(t[a]);break}}return s}(e);a.length&&function(e,t,s){for(var i=0,r=t.length;i<r&&t[i];i++)t[i].event=e,t[i].apply(t[i],s)}(e,a,[s,i,r,o,n,l])},e.on=function(e,s){t[e]||(t[e]=[]),t[e].push(s)},e.once=function(t,s){this.on(t,function i(){s.apply(this,arguments),e.off(t,i)})},e.off=function(e,t){var s=[];if(e&&t)for(var i=this._fns[e],r=0,o=i?i.length:0;r<o;r++)i[r]!==t&&s.push(i[r]);s.length?this._fns[e]=s:delete this._fns[e]},e}},7764:function(e){"use strict";function t(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}t.prototype.match=function(e){var t,s,i=!0,r=this.parts,o=r.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(s=(e||"").split(this.separator),t=0;i&&t<o;t++)"*"!==r[t]&&(i=t<s.length&&r[t]===s[t]);i=i&&s}else i=!1;else if("function"==typeof e.splice)for(i=[],t=e.length;t--;)this.match(e[t])&&(i[i.length]=e[t]);else if("object"==typeof e)for(var n in i={},e)this.match(n)&&(i[n]=e[n]);return i},e.exports=function(e,s,i){var r=new t(e,i||/[\/\.]/);return void 0!==s?r.match(s):r}},4528:function(e,t,s){"use strict";s.d(t,{A:function(){return i}});class i{#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",(s,i)=>{e===s?.id&&t(i)})}onFileRemove(e,t){this.on("file-removed",s=>{e===s.id&&t(s.id)})}onPause(e,t){this.on("upload-pause",(s,i)=>{e===s?.id&&t(i)})}onRetry(e,t){this.on("upload-retry",s=>{e===s?.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",(...s)=>{this.#e.getFile(e)&&t(...s)})}onResumeAll(e,t){this.on("resume-all",()=>{this.#e.getFile(e)&&t()})}}},8006:function(e,t,s){"use strict";s.r(t),s.d(t,{BasePlugin:function(){return i.A},EventManager:function(){return r.A},RestrictionError:function(){return c},UIPlugin:function(){return g.A},Uppy:function(){return T},debugLogger:function(){return a},default:function(){return T}});var i=s(2729),r=s(4528);function o(e){return e<10?`0${e}`:e.toString()}function n(){const e=new Date;return`${o(e.getHours())}:${o(e.getMinutes())}:${o(e.getSeconds())}`}const l={debug:()=>{},warn:()=>{},error:(...e)=>console.error(`[Uppy] [${n()}]`,...e)},a={debug:(...e)=>console.debug(`[Uppy] [${n()}]`,...e),warn:(...e)=>console.warn(`[Uppy] [${n()}]`,...e),error:(...e)=>console.error(`[Uppy] [${n()}]`,...e)};var d=s(7301),u=s(1566);const h={maxFileSize:null,minFileSize:null,maxTotalFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null,requiredMetaFields:[]};class c extends Error{isUserFacing;file;constructor(e,t){super(e),this.isUserFacing=t?.isUserFacing??!0,t?.file&&(this.file=t.file)}isRestriction=!0}class p{getI18n;getOpts;constructor(e,t){this.getI18n=t,this.getOpts=()=>{const t=e();if(null!=t.restrictions?.allowedFileTypes&&!Array.isArray(t.restrictions.allowedFileTypes))throw new TypeError("`restrictions.allowedFileTypes` must be an array");return t}}validateAggregateRestrictions(e,t){const{maxTotalFileSize:s,maxNumberOfFiles:i}=this.getOpts().restrictions;if(i&&e.filter(e=>!e.isGhost).length+t.length>i)throw new c(`${this.getI18n()("youCanOnlyUploadX",{smart_count:i})}`);if(s){const i=[...e,...t].reduce((e,t)=>e+(t.size??0),0);if(i>s)throw new c(this.getI18n()("aggregateExceedsSize",{sizeAllowed:d(s),size:d(i)}))}}validateSingleFile(e){const{maxFileSize:t,minFileSize:s,allowedFileTypes:i}=this.getOpts().restrictions;if(i&&!i.some(t=>t.includes("/")?!!e.type&&u(e.type.replace(/;.*?$/,""),t):!("."!==t[0]||!e.extension)&&e.extension.toLowerCase()===t.slice(1).toLowerCase())){const t=i.join(", ");throw new c(this.getI18n()("youCanOnlyUploadFileTypes",{types:t}),{file:e})}if(t&&null!=e.size&&e.size>t)throw new c(this.getI18n()("exceedsSize",{size:d(t),file:e.name??this.getI18n()("unnamed")}),{file:e});if(s&&null!=e.size&&e.size<s)throw new c(this.getI18n()("inferiorSize",{size:d(s)}),{file:e})}validate(e,t){t.forEach(e=>{this.validateSingleFile(e)}),this.validateAggregateRestrictions(e,t)}validateMinNumberOfFiles(e){const{minNumberOfFiles:t}=this.getOpts().restrictions;if(t&&Object.keys(e).length<t)throw new c(this.getI18n()("youHaveToAtLeastSelectX",{smart_count:t}))}getMissingRequiredMetaFields(e){const t=new c(this.getI18n()("missingRequiredMetaFieldOnFile",{fileName:e.name??this.getI18n()("unnamed")})),{requiredMetaFields:s}=this.getOpts().restrictions,i=[];for(const t of s)Object.hasOwn(e.meta,t)&&""!==e.meta[t]||i.push(t);return{missingFields:i,error:t}}}var g=s(760),f=class{static VERSION="5.0.0";state={};#s=new Set;getState(){return this.state}setState(e){const t={...this.state},s={...this.state,...e};this.state=s,this.#i(t,s,e)}subscribe(e){return this.#s.add(e),()=>{this.#s.delete(e)}}#i(...e){this.#s.forEach(t=>{t(...e)})}},m=s(9491),y=s(7623),w=s(6506),F=s(5417),v=s(7331),S=s(2162),b=s(590),A={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 U(e){if(null==e&&"undefined"!=typeof navigator&&(e=navigator.userAgent),!e)return!0;const t=/Edge\/(\d+\.\d+)/.exec(e);if(!t)return!0;const s=t[1].split(".",2),i=parseInt(s[0],10),r=parseInt(s[1],10);return i<15||15===i&&r<15063||i>18||18===i&&r>=18218}const P={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class O{static VERSION="5.2.0";#r=Object.create(null);#o;#n;#l=S();#a=new Set;#d=new Set;#u=new Set;defaultLocale;locale;opts;store;i18n;i18nArray;scheduledAutoProceed=null;wasOffline=!1;constructor(e){this.defaultLocale=A;const t={id:"uppy",autoProceed:!1,allowMultipleUploadBatches:!0,debug:!1,restrictions:h,meta:{},onBeforeFileAdded:(e,t)=>!Object.hasOwn(t,e.id),onBeforeUpload:e=>e,store:new f,logger:l,infoTimeout:5e3},s={...t,...e};this.opts={...s,restrictions:{...t.restrictions,...e?.restrictions}},e?.logger&&e.debug?this.log("You are using a custom `logger`, but also set `debug: true`, which uses built-in logger to output logs to console. Ignoring `debug: true` and using your custom `logger`.","warning"):e?.debug&&(this.opts.logger=a),this.log(`Using Core v${O.VERSION}`),this.i18nInit(),this.store=this.opts.store,this.setState({...P,plugins:{},files:{},currentUploads:{},capabilities:{uploadProgress:U(),individualCancellation:!0,resumableUploads:!1},meta:{...this.opts.meta},info:[]}),this.#o=new p(()=>this.opts,()=>this.i18n),this.#n=this.store.subscribe((e,t,s)=>{this.emit("state-update",e,t,s),this.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window[this.opts.id]=this),this.#h()}emit(e,...t){this.#l.emit(e,...t)}on(e,t){return this.#l.on(e,t),this}once(e,t){return this.#l.once(e,t),this}off(e,t){return this.#l.off(e,t),this}updateAll(e){this.iteratePlugins(t=>{t.update(e)})}setState(e){this.store.setState(e)}getState(){return this.store.getState()}patchFilesState(e){const t=this.getState().files;this.setState({files:{...t,...Object.fromEntries(Object.entries(e).map(([e,s])=>[e,{...t[e],...s}]))}})}setFileState(e,t){if(!this.getState().files[e])throw new Error(`Can’t set state for ${e} (the file could have been removed)`);this.patchFilesState({[e]:t})}i18nInit(){const e=new m.A([this.defaultLocale,this.opts.locale],{onMissingKey:e=>this.log(`Missing i18n string: ${e}`,"error")});this.i18n=e.translate.bind(e),this.i18nArray=e.translateArray.bind(e),this.locale=e.locale}setOptions(e){this.opts={...this.opts,...e,restrictions:{...this.opts.restrictions,...e?.restrictions}},e.meta&&this.setMeta(e.meta),this.i18nInit(),e.locale&&this.iteratePlugins(t=>{t.setOptions(e)}),this.setState(void 0)}resetProgress(){const e={percentage:0,bytesUploaded:!1,uploadComplete:!1,uploadStarted:null},t={...this.getState().files},s=Object.create(null);Object.keys(t).forEach(i=>{s[i]={...t[i],progress:{...t[i].progress,...e},tus:void 0,transloadit:void 0}}),this.setState({files:s,...P})}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({...P,files:{}})}addPreProcessor(e){this.#a.add(e)}removePreProcessor(e){return this.#a.delete(e)}addPostProcessor(e){this.#u.add(e)}removePostProcessor(e){return this.#u.delete(e)}addUploader(e){this.#d.add(e)}removeUploader(e){return this.#d.delete(e)}setMeta(e){const t={...this.getState().meta,...e},s={...this.getState().files};Object.keys(s).forEach(t=>{s[t]={...s[t],meta:{...s[t].meta,...e}}}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:s})}setFileMeta(e,t){const s={...this.getState().files};if(!s[e])return void this.log(`Was trying to set metadata for a file that has been removed: ${e}`);const i={...s[e].meta,...t};s[e]={...s[e],meta:i},this.setState({files:s})}getFile(e){return this.getState().files[e]}getFiles(){const{files:e}=this.getState();return Object.values(e)}getFilesByIds(e){return e.map(e=>this.getFile(e))}getObjectOfFilesPerState(){const{files:e,totalProgress:t,error:s}=this.getState(),i=Object.values(e),r=[],o=[],n=[],l=[],a=[],d=[],u=[],h=[],c=[];for(const e of i){const{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(r.push(e),e.isPaused||h.push(e)),t.uploadStarted||o.push(e),(t.uploadStarted||t.preprocess||t.postprocess)&&n.push(e),t.uploadStarted&&l.push(e),e.isPaused&&a.push(e),t.uploadComplete&&d.push(e),e.error&&u.push(e),(t.preprocess||t.postprocess)&&c.push(e)}return{newFiles:o,startedFiles:n,uploadStartedFiles:l,pausedFiles:a,completeFiles:d,erroredFiles:u,inProgressFiles:r,inProgressNotPausedFiles:h,processingFiles:c,isUploadStarted:l.length>0,isAllComplete:100===t&&d.length===i.length&&0===c.length,isAllErrored:!!s&&u.length===i.length,isAllPaused:0!==r.length&&a.length===r.length,isUploadInProgress:r.length>0,isSomeGhost:i.some(e=>e.isGhost)}}#c(e){for(const t of e)t.isRestriction?this.emit("restriction-failed",t.file,t):this.emit("error",t,t.file),this.log(t,"warning");const t=e.filter(e=>e.isUserFacing),s=t.slice(0,4),i=t.slice(4);s.forEach(({message:e,details:t=""})=>{this.info({message:e,details:t},"error",this.opts.infoTimeout)}),i.length>0&&this.info({message:this.i18n("additionalRestrictionsFailed",{count:i.length})})}validateRestrictions(e,t=this.getFiles()){try{this.#o.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#o.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{this.#o.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#p(e){const{missingFields:t,error:s}=this.#o.getMissingRequiredMetaFields(e);return t.length>0?(this.setFileState(e.id,{missingRequiredMetaFields:t,error:s.message}),this.log(s.message),this.emit("restriction-failed",e,s),!1):(0===t.length&&e.missingRequiredMetaFields&&this.setFileState(e.id,{missingRequiredMetaFields:[]}),!0)}#g(e){let t=!0;for(const s of Object.values(e))this.#p(s)||(t=!1);return t}#f(e){const{allowNewUpload:t}=this.getState();if(!1===t){const t=new c(this.i18n("noMoreFilesAllowed"),{file:e});throw this.#c([t]),t}}checkIfFileAlreadyExists(e){const{files:t}=this.getState();return!(!t[e]||t[e].isGhost)}#m(e){const t=e instanceof File?{name:e.name,type:e.type,size:e.size,data:e,meta:{},isRemote:!1,source:void 0,preview:void 0}:e,s=(0,y.A)(t),i=function(e,t){return t.name?t.name:"image"===e.split("/")[0]?`${e.split("/")[0]}.${e.split("/")[1]}`:"noname"}(s,t),r=(0,w.A)(i).extension,o=(0,F.N)(t,this.getID()),n={...t.meta,name:i,type:s},l=Number.isFinite(t.data.size)?t.data.size:null;return{source:t.source||"",id:o,name:i,extension:r||"",meta:{...this.getState().meta,...n},type:s,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}}#y(){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))}#w(e){let{files:t}=this.getState(),s={...t};const i=[],r=[];for(const o of e)try{let e=this.#m(o);this.#f(e);const r=t[e.id],n=r?.isGhost;if(n&&!e.isRemote){if(null==e.data)throw new Error("File data is missing");e={...r,isGhost:!1,data:e.data},this.log(`Replaced the blob in the restored ghost file: ${e.name}, ${e.id}`)}const l=this.opts.onBeforeFileAdded(e,s);if(t=this.getState().files,s={...t,...s},!l&&this.checkIfFileAlreadyExists(e.id))throw new c(this.i18n("noDuplicates",{fileName:e.name??this.i18n("unnamed")}),{file:e});if(!1===l&&!n)throw new c("Cannot add the file because onBeforeFileAdded returned false.",{isUserFacing:!1,file:e});"object"==typeof l&&null!==l&&(e=l),this.#o.validateSingleFile(e),s[e.id]=e,i.push(e)}catch(e){r.push(e)}try{this.#o.validateAggregateRestrictions(Object.values(t),i)}catch(e){return r.push(e),{nextFilesState:t,validFilesToAdd:[],errors:r}}return{nextFilesState:s,validFilesToAdd:i,errors:r}}addFile(e){const{nextFilesState:t,validFilesToAdd:s,errors:i}=this.#w([e]),r=i.filter(e=>e.isRestriction);if(this.#c(r),i.length>0)throw i[0];this.setState({files:t});const[o]=s;return this.emit("file-added",o),this.emit("files-added",s),this.log(`Added file: ${o.name}, ${o.id}, mime type: ${o.type}`),this.#y(),o.id}addFiles(e){const{nextFilesState:t,validFilesToAdd:s,errors:i}=this.#w(e),r=i.filter(e=>e.isRestriction);this.#c(r);const o=i.filter(e=>!e.isRestriction);if(o.length>0){let e="Multiple errors occurred while adding files:\n";if(o.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:o.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(o,e);{const t=new Error(e);throw t.errors=o,t}}this.setState({files:t}),s.forEach(e=>{this.emit("file-added",e)}),this.emit("files-added",s),s.length>5?this.log(`Added batch of ${s.length} files`):Object.values(s).forEach(e=>{this.log(`Added file: ${e.name}\n id: ${e.id}\n type: ${e.type}`)}),s.length>0&&this.#y()}removeFiles(e){const{files:t,currentUploads:s}=this.getState(),i={...t},r={...s},o=Object.create(null);function n(e){return void 0===o[e]}e.forEach(e=>{t[e]&&(o[e]=t[e],delete i[e])}),Object.keys(r).forEach(e=>{const t=s[e].fileIDs.filter(n);if(0===t.length)return void delete r[e];const{capabilities:i}=this.getState();if(t.length!==s[e].fileIDs.length&&!i.individualCancellation)throw new Error("The installed uploader plugin does not allow removing files during an upload.");r[e]={...s[e],fileIDs:t}});const l={currentUploads:r,files:i};0===Object.keys(i).length&&(l.allowNewUpload=!0,l.error=null,l.recoveredState=null),this.setState(l),this.#F();const a=Object.keys(o);a.forEach(e=>{this.emit("file-removed",o[e])}),a.length>5?this.log(`Removed ${a.length} files`):this.log(`Removed files: ${a.join(", ")}`)}removeFile(e){this.removeFiles([e])}pauseResume(e){if(!this.getState().capabilities.resumableUploads||this.getFile(e).progress.uploadComplete)return;const t=this.getFile(e),s=!t.isPaused;return this.setFileState(e,{isPaused:s}),this.emit("upload-pause",t,s),s}pauseAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const s={...e[t],isPaused:!0};e[t]=s}),this.setState({files:e}),this.emit("pause-all")}resumeAll(){const e={...this.getState().files};Object.keys(e).filter(t=>!e[t].progress.uploadComplete&&e[t].progress.uploadStarted).forEach(t=>{const s={...e[t],isPaused:!1,error:null};e[t]=s}),this.setState({files:e}),this.emit("resume-all")}#v(){const{files:e}=this.getState();return Object.keys(e).filter(t=>{const s=e[t];return s.error&&(!s.missingRequiredMetaFields||0===s.missingRequiredMetaFields.length)})}async#S(){const e=this.#v(),t={...this.getState().files};if(e.forEach(e=>{t[e]={...t[e],isPaused:!1,error:null}}),this.setState({files:t,error:null}),this.emit("retry-all",this.getFilesByIds(e)),0===e.length)return{successful:[],failed:[]};const s=this.#b(e,{forceAllowNewUpload:!0});return this.#A(s)}async retryAll(){const e=await this.#S();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(P)}retryUpload(e){this.setFileState(e,{error:null,isPaused:!1}),this.emit("upload-retry",this.getFile(e));const t=this.#b([e],{forceAllowNewUpload:!0});return this.#A(t)}logout(){this.iteratePlugins(e=>{e.provider?.logout?.()})}#U=(e,t)=>{const s=e?this.getFile(e.id):void 0;if(null==e||!s)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);if(100===s.progress.percentage)return void this.log(`Not setting progress for a file that has been already uploaded: ${e.id}`);const i={bytesTotal:t.bytesTotal,percentage:null!=t.bytesTotal&&Number.isFinite(t.bytesTotal)&&t.bytesTotal>0?Math.round(t.bytesUploaded/t.bytesTotal*100):void 0};null!=s.progress.uploadStarted?this.setFileState(e.id,{progress:{...s.progress,...i,bytesUploaded:t.bytesUploaded}}):this.setFileState(e.id,{progress:{...s.progress,...i}}),this.#F()};#P(){const e=this.#O();let t=null;null!=e&&(t=Math.round(100*e),t>100?t=100:t<0&&(t=0)),this.emit("progress",t??0),this.setState({totalProgress:t??0})}#F=v(()=>this.#P(),500,{leading:!0,trailing:!0});[Symbol.for("uppy test: updateTotalProgress")](){return this.#P()}#O(){const e=this.getFiles().filter(e=>e.progress.uploadStarted||e.progress.preprocess||e.progress.postprocess);if(0===e.length)return 0;if(e.every(e=>e.progress.uploadComplete))return 1;const t=e=>null!=e.progress.bytesTotal&&0!==e.progress.bytesTotal,s=e.filter(t),i=e.filter(e=>!t(e));if(s.every(e=>e.progress.uploadComplete)&&i.length>0&&!i.every(e=>e.progress.uploadComplete))return null;const r=s.reduce((e,t)=>e+(t.progress.bytesTotal??0),0),o=s.reduce((e,t)=>e+(t.progress.bytesUploaded||0),0);return 0===r?0:o/r}#h(){const e=(e,t,s)=>{let i=e.message||"Unknown error";e.details&&(i+=` ${e.details}`),this.setState({error:i}),null!=t&&t.id in this.getState().files&&this.setFileState(t.id,{error:i,response:s})};this.on("error",e),this.on("upload-error",(t,s,i)=>{if(e(s,t,i),"object"==typeof s&&s.message){this.log(s.message,"error");const e=new Error(this.i18n("failedToUpload",{file:t?.name??""}));e.isUserFacing=!0,e.details=s.message,s.details&&(e.details+=` ${s.details}`),this.#c([e])}else this.#c([s])});let t=null;this.on("upload-stalled",(e,s)=>{const{message:i}=e,r=s.map(e=>e.meta.name).join(", ");t||(this.info({message:i,details:r},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${i} ${r}`.trim(),"warning")}),this.on("upload",()=>{this.setState({error:null})}),this.on("upload-start",e=>{const t=e.filter(e=>{const t=null!=e&&this.getFile(e.id);return t||this.log(`Not setting progress for a file that has been removed: ${e?.id}`),t}),s=Object.fromEntries(t.map(e=>[e.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,bytesUploaded:0,bytesTotal:e.size}}]));this.patchFilesState(s)}),this.on("upload-progress",this.#U),this.on("upload-success",(e,t)=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const s=this.getFile(e.id).progress,i=this.#u.size>0;this.setFileState(e.id,{progress:{...s,postprocess:i?{mode:"indeterminate"}:void 0,uploadComplete:!0,...!i&&{complete:!0},percentage:100,bytesUploaded:s.bytesTotal},response:t,uploadURL:t.uploadURL,isPaused:!1}),null==e.size&&this.setFileState(e.id,{size:t.bytesUploaded||s.bytesTotal}),this.#F()}),this.on("preprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getFile(e.id).progress,preprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)}),this.on("preprocess-complete",e=>{if(null==e||!this.getFile(e.id))return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const t={...this.getState().files};t[e.id]={...t[e.id],progress:{...t[e.id].progress}},delete t[e.id].progress.preprocess,this.setState({files:t})}),this.on("postprocess-progress",(e,t)=>{null!=e&&this.getFile(e.id)?this.setFileState(e.id,{progress:{...this.getState().files[e.id].progress,postprocess:t}}):this.log(`Not setting progress for a file that has been removed: ${e?.id}`)}),this.on("postprocess-complete",e=>{const t=e&&this.getFile(e.id);if(null==t)return void this.log(`Not setting progress for a file that has been removed: ${e?.id}`);const{postprocess:s,...i}=t.progress;this.patchFilesState({[t.id]:{progress:{...i,complete:!0}}})}),this.on("restored",()=>{this.#F()}),this.on("dashboard:file-edit-complete",e=>{e&&this.#p(e)}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",this.#T),window.addEventListener("offline",this.#T),setTimeout(this.#T,3e3))}updateOnlineStatus(){window.navigator.onLine??1?(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)}#T=this.updateOnlineStatus.bind(this);getID(){return this.opts.id}use(e,...t){if("function"!=typeof e)throw new TypeError(`Expected a plugin class, but got ${null===e?"null":typeof e}. Please verify that the plugin was imported and spelled correctly.`);const s=new e(this,...t),i=s.id;if(!i)throw new Error("Your plugin must have an id");if(!s.type)throw new Error("Your plugin must have a type");const r=this.getPlugin(i);if(r){const e=`Already found a plugin named '${r.id}'. Tried to use: '${i}'.\nUppy plugins must have unique \`id\` options.`;throw new Error(e)}return e.VERSION&&this.log(`Using ${i} v${e.VERSION}`),s.type in this.#r?this.#r[s.type].push(s):this.#r[s.type]=[s],s.install(),this.emit("plugin-added",s),this}getPlugin(e){for(const t of Object.values(this.#r)){const s=t.find(t=>t.id===e);if(null!=s)return s}}[Symbol.for("uppy test: getPlugins")](e){return this.#r[e]}iteratePlugins(e){Object.values(this.#r).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=this.#r[e.type],s=t.findIndex(t=>t.id===e.id);-1!==s&&t.splice(s,1);const i={plugins:{...this.getState().plugins,[e.id]:void 0}};this.setState(i)}destroy(){this.log(`Closing Uppy instance ${this.opts.id}: removing all files and uninstalling plugins`),this.cancelAll(),this.#n(),this.iteratePlugins(e=>{this.removePlugin(e)}),"undefined"!=typeof window&&window.removeEventListener&&(window.removeEventListener("online",this.#T),window.removeEventListener("offline",this.#T))}hideInfo(){const{info:e}=this.getState();this.setState({info:e.slice(1)}),this.emit("info-hidden")}info(e,t="info",s=3e3){const i="object"==typeof e;this.setState({info:[...this.getState().info,{type:t,message:i?e.message:e,details:i?e.details:null}]}),setTimeout(()=>this.hideInfo(),s),this.emit("info-visible")}log(e,t){const{logger:s}=this.opts;switch(t){case"error":s.error(e);break;case"warning":s.warn(e);break;default:s.debug(e)}}#E=new Map;registerRequestClient(e,t){this.#E.set(e,t)}getRequestClientForFile(e){if(!("remote"in e)||!e.remote)throw new Error(`Tried to get RequestClient for a non-remote file ${e.id}`);const t=this.#E.get(e.remote.requestClientId);if(null==t)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.#A(e);return this.emit("complete",t),t}#b(e,t={}){const{forceAllowNewUpload:s=!1}=t,{allowNewUpload:i,currentUploads:r}=this.getState();if(!i&&!s)throw new Error("Cannot create a new upload: already uploading.");const o=(0,b.A)();return this.emit("upload",o,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...r,[o]:{fileIDs:e,step:0,result:{}}}}),o}[Symbol.for("uppy test: createUpload")](...e){return this.#b(...e)}#R(e){const{currentUploads:t}=this.getState();return t[e]}addResultData(e,t){if(!this.#R(e))return void this.log(`Not setting result for an upload that has been removed: ${e}`);const{currentUploads:s}=this.getState(),i={...s[e],result:{...s[e].result,...t}};this.setState({currentUploads:{...s,[e]:i}})}#I(e){const{[e]:t,...s}=this.getState().currentUploads;this.setState({currentUploads:s})}async#A(e){const t=()=>{const{currentUploads:t}=this.getState();return t[e]};let s=t();if(!s)throw new Error("Nonexistent upload");const i=[...this.#a,...this.#d,...this.#u];try{for(let r=s.step||0;r<i.length;r++){const o=i[r];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...s,step:r}}});const{fileIDs:n}=s;if(await o(n,e),s=t(),!s)break}}catch(t){throw this.#I(e),t}if(s){s.fileIDs.forEach(e=>{const t=this.getFile(e);t?.progress.postprocess&&this.emit("postprocess-complete",t)});const i=s.fileIDs.map(e=>this.getFile(e)),r=i.filter(e=>!e.error),o=i.filter(e=>e.error);this.addResultData(e,{successful:r,failed:o,uploadID:e}),s=t()}let r;return s&&(r=s.result,this.#I(e)),null==r&&(this.log(`Not setting result for an upload that has been removed: ${e}`),r={successful:[],failed:[],uploadID:e}),r}async upload(){this.#r.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#v().length>0){const t=await this.#S();if(!(this.getFiles().filter(e=>null==e.progress.uploadStarted).length>0))return this.emit("complete",t),t;({files:e}=this.getState())}const t=this.opts.onBeforeUpload(e);if(!1===t)throw new Error("Not starting the upload because onBeforeUpload returned false");t&&"object"==typeof t&&(e=t,this.setState({files:e}));try{if(this.#o.validateMinNumberOfFiles(e),!this.#g(e))throw new c(this.i18n("missingRequiredMetaField"));const{currentUploads:t}=this.getState(),s=Object.values(t).flatMap(e=>e.fileIDs),i=Object.keys(e).filter(e=>{const t=this.getFile(e);return t&&!t.progress.uploadStarted&&!s.includes(e)}),r=this.#b(i),o=await this.#A(r);return this.emit("complete",o),o}catch(e){throw this.#c([e]),e}}}var T=O},5417:function(e,t,s){"use strict";s.d(t,{N:function(){return o}});var i=s(7623);function r(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}function o(e,t){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const s=(0,i.A)(e);return function(e,t){let s=t||"uppy";return"string"==typeof e.name&&(s+=`-${r(e.name.toLowerCase())}`),void 0!==e.type&&(s+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(s+=`-${r(e.meta.relativePath.toLowerCase())}`),void 0!==e.data?.size&&(s+=`-${e.data.size}`),void 0!==e.data.lastModified&&(s+=`-${e.data.lastModified}`),s}({...e,type:s},t)}},6506:function(e,t,s){"use strict";function i(e){const t=e.lastIndexOf(".");return-1===t||t===e.length-1?{name:e,extension:void 0}:{name:e.slice(0,t),extension:e.slice(t+1)}}s.d(t,{A:function(){return i}})},7623:function(e,t,s){"use strict";s.d(t,{A:function(){return o}});var i=s(6506),r=s(7544);function o(e){if(e.type)return e.type;const t=e.name?(0,i.A)(e.name).extension?.toLowerCase():null;return t&&t in r.A?r.A[t]:"application/octet-stream"}},590:function(e,t,s){"use strict";s.d(t,{A:function(){return i}});let i=(e=21)=>{let t="",s=0|e;for(;s--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}}}]);
|