@micromag/viewer-build 0.4.89 → 0.4.90-alpha.1

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.
Files changed (33) hide show
  1. package/build/asset-manifest.json +26 -8
  2. package/build/index.html +1 -1
  3. package/build/static/css/656.cf2dc07c.css +5 -0
  4. package/build/static/css/main.8d373834.css +2 -0
  5. package/build/static/js/160.0718cb47.chunk.js +1 -0
  6. package/build/static/js/231.2dd1f543.chunk.js +1 -0
  7. package/build/static/js/268.f9b85afc.chunk.js +1 -0
  8. package/build/static/js/270.85f114b4.chunk.js +1 -0
  9. package/build/static/js/278.1bc9b3a8.chunk.js +1 -0
  10. package/build/static/js/359.8b129b69.chunk.js +1 -0
  11. package/build/static/js/50.37bde52c.chunk.js +1 -0
  12. package/build/static/js/51.24437974.chunk.js +2 -0
  13. package/build/static/js/51.24437974.chunk.js.LICENSE.txt +10 -0
  14. package/build/static/js/543.a221a89d.chunk.js +1 -0
  15. package/build/static/js/558.01ab5aca.chunk.js +1 -0
  16. package/build/static/js/6.a54a904c.chunk.js +1 -0
  17. package/build/static/js/656.81c40916.js +2 -0
  18. package/build/static/js/{616.1967daa4.js.LICENSE.txt → 656.81c40916.js.LICENSE.txt} +4 -2
  19. package/build/static/js/699.abf614c9.chunk.js +2 -0
  20. package/build/static/js/699.abf614c9.chunk.js.LICENSE.txt +12 -0
  21. package/build/static/js/727.018496cf.chunk.js +1 -0
  22. package/build/static/js/951.cb178734.chunk.js +2 -0
  23. package/build/static/js/951.cb178734.chunk.js.LICENSE.txt +10 -0
  24. package/build/static/js/main.caa09ea9.js +2 -0
  25. package/build/static/js/runtime~main.ece9ec3d.js +1 -0
  26. package/build/static/media/bootstrap-icons.1295669cd4e305c97f2c.woff +0 -0
  27. package/build/static/media/bootstrap-icons.92ea18a81d737146ff04.woff2 +0 -0
  28. package/package.json +6 -6
  29. package/build/static/css/main.090cebea.css +0 -2
  30. package/build/static/js/616.1967daa4.js +0 -2
  31. package/build/static/js/main.4ae8461a.js +0 -2
  32. package/build/static/js/runtime~main.0daca723.js +0 -1
  33. /package/build/static/js/{main.4ae8461a.js.LICENSE.txt → main.caa09ea9.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[160],{8106:function(t){function s(t){if(t)return function(t){return Object.assign(t,s.prototype),t._callbacks=new Map,t}(t);this._callbacks=new Map}s.prototype.on=function(t,s){const e=this._callbacks.get(t)??[];return e.push(s),this._callbacks.set(t,e),this},s.prototype.once=function(t,s){const e=(...i)=>{this.off(t,e),s.apply(this,i)};return e.fn=s,this.on(t,e),this},s.prototype.off=function(t,s){if(void 0===t&&void 0===s)return this._callbacks.clear(),this;if(void 0===s)return this._callbacks.delete(t),this;const e=this._callbacks.get(t);if(e){for(const[t,i]of e.entries())if(i===s||i.fn===s){e.splice(t,1);break}0===e.length?this._callbacks.delete(t):this._callbacks.set(t,e)}return this},s.prototype.emit=function(t,...s){const e=this._callbacks.get(t);if(e){const t=[...e];for(const e of t)e.apply(this,s)}return this},s.prototype.listeners=function(t){return this._callbacks.get(t)??[]},s.prototype.listenerCount=function(t){if(t)return this.listeners(t).length;let s=0;for(const t of this._callbacks.values())s+=t.length;return s},s.prototype.hasListeners=function(t){return this.listenerCount(t)>0},s.prototype.addEventListener=s.prototype.on,s.prototype.removeListener=s.prototype.off,s.prototype.removeEventListener=s.prototype.off,s.prototype.removeAllListeners=s.prototype.off,t.exports=s},9160:function(t,s,e){"use strict";e.r(s),e.d(s,{Assembly:function(){return y},AssemblyError:function(){return g},COMPANION_ALLOWED_HOSTS:function(){return L},COMPANION_URL:function(){return U},Client:function(){return w},default:function(){return k},getAssemblyUrl:function(){return F},getAssemblyUrlSsl:function(){return R}});var i=e(2729),r=e(7699),o=e(8396),a=e(1422),n=e(9420),l=e(5945),h=e(6681),p=e(8106);const u="ASSEMBLY_EXECUTING",c="ASSEMBLY_COMPLETED",d=["ASSEMBLY_UPLOADING",u,c];function m(t,s){return"string"==typeof t&&d.indexOf(t)>=d.indexOf(s)}var y=class extends p{#t;#s;#e=!1;#i=null;#r;pollInterval;closed;constructor(t,s){super(),this.#r=t,this.pollInterval=null,this.closed=!1,this.#t=s,this.#s=s.wrapPromiseFunction(l.A)}connect(){this.#o(),this.#a()}#n(){this.emit("finished"),this.close()}get status(){return this.#r}set status(t){this.#r=t,this.emit("status",t)}#o(){this.#i=new EventSource(`${this.status.websocket_url}?assembly=${this.status.assembly_id}`),this.#i.addEventListener("open",()=>{clearInterval(this.pollInterval),this.pollInterval=null}),this.#i.addEventListener("message",t=>{"assembly_finished"===t.data&&this.#n(),"assembly_uploading_finished"===t.data&&this.emit("executing"),"assembly_upload_meta_data_extracted"===t.data&&(this.emit("metadata"),this.#l({diff:!1}))}),this.#i.addEventListener("assembly_upload_finished",t=>{const s=JSON.parse(t.data);this.status={...this.status,uploads:[...this.status.uploads??[],s]},this.emit("upload",s)}),this.#i.addEventListener("assembly_result_finished",t=>{const[s,e]=JSON.parse(t.data);this.status={...this.status,results:{...this.status.results,[s]:[...this.status.results?.[s]??[],e]}},this.emit("result",s,e)}),this.#i.addEventListener("assembly_execution_progress",t=>{const s=JSON.parse(t.data);this.emit("execution-progress",s)}),this.#i.addEventListener("assembly_error",t=>{try{this.#h(JSON.parse(t.data))}catch{this.#h(new Error(t.data))}this.#l({diff:!1})})}#h(t){this.emit("error",Object.assign(new Error(t.message),t)),this.close()}#a(){this.pollInterval=setInterval(()=>{this.#l()},2e3)}async#l({diff:t=!0}={}){if(!(this.closed||this.#t.isPaused||this.#e))try{this.#e=!0;const s=R(this.status),e=await this.#s(s);if(this.#e=!1,this.closed)return;if(429===e.status)return void this.#t.rateLimit(2e3);if(!e.ok)return void this.#h(new h.A(e.statusText));const i=await e.json();if(this.closed)return;t?this.updateStatus(i):this.status=i}catch(t){this.#h(t)}}update(){return this.#l({diff:!0})}updateStatus(t){this.#p(this.status,t),this.status=t}#p(t,s){const e=t.ok,i=s.ok;if(s.error&&!t.error)return this.#h(s);const r=m(i,u)&&!m(e,u);r&&this.emit("executing");const o=t.uploads,a=s.uploads;null!=a&&null!=o&&Object.keys(a).filter(t=>!(0,n.A)(o,t)).forEach(t=>{this.emit("upload",a[t])}),r&&this.emit("metadata");const l=s.results,h=t.results;null!=l&&null!=h&&Object.keys(l).forEach(t=>{const s=l[t]??[],e=h[t]??[];s.filter(t=>!e||!e.some(s=>s.id===t.id)).forEach(s=>{this.emit("result",t,s)})}),m(i,c)&&!m(e,c)&&this.emit("finished")}close(){this.closed=!0,this.#i&&(this.#i.close(),this.#i=null),clearInterval(this.pollInterval),this.pollInterval=null}},f=class extends p{#u;#c;promise;#d;#m;#y;constructor(t,s){super(),this.#y=t,this.#u=s,this.#c=s.length,this.promise=new Promise((t,s)=>{this.#d=t,this.#m=s}),this.#f()}#b(t){return-1!==this.#u.indexOf(t)}#g=t=>{const s=t.assembly_id;null!=s&&this.#b(s)&&(this.#y.log(`[Transloadit] AssemblyWatcher: Got Assembly finish ${s}`),this.emit("assembly-complete",s),this.#w())};#A=t=>{const s=t.assembly_id;null!=s&&this.#b(s)&&this.#w()};#E=(t,s)=>{const e=t.assembly_id;null!=e&&this.#b(e)&&(this.#y.log(`[Transloadit] AssemblyWatcher: Got Assembly error ${e}`),this.#y.log(s),this.emit("assembly-error",e,s),this.#w())};#_=(t,s,e)=>{const i=t.assembly_id;null!=i&&this.#b(i)&&this.#E(t,e)};#w(){this.#c-=1,0===this.#c&&(this.#S(),this.#d())}#S(){this.#y.off("transloadit:complete",this.#g),this.#y.off("transloadit:assembly-cancel",this.#A),this.#y.off("transloadit:assembly-error",this.#E),this.#y.off("transloadit:import-error",this.#_)}#f(){this.#y.on("transloadit:complete",this.#g),this.#y.on("transloadit:assembly-cancel",this.#A),this.#y.on("transloadit:assembly-error",this.#E),this.#y.on("transloadit:import-error",this.#_)}};const b="/assemblies";class g extends Error{details;assembly;constructor(t,s,e){super(t),this.details=s,this.assembly=e}}class w{#v={};#s;opts;constructor(t){this.opts=t,null!=this.opts.client&&(this.#v["Transloadit-Client"]=this.opts.client),this.#s=this.opts.rateLimitedQueue.wrapPromiseFunction(l.A)}async#F(...t){const s=await this.#s(...t);if(429===s.status)return this.opts.rateLimitedQueue.rateLimit(2e3),this.#F(...t);if(!s.ok){const e=new Error(s.statusText);return e.statusCode=s.status,`${t[0]}`.endsWith(b)?s.json().then(t=>{if(!t.error)throw e;const s=new g(t.error,t.message,t);throw t.assembly_id&&(s.details+=` Assembly ID: ${t.assembly_id}`),s},t=>{throw t.cause=e,t}):Promise.reject(e)}return s.json()}async createAssembly({params:t,fields:s,signature:e,expectedFiles:i}){const r=new FormData;r.append("params","string"==typeof t?t:JSON.stringify(t)),e&&r.append("signature",e),Object.keys(s).forEach(t=>{r.append(t,String(s[t]))}),r.append("num_expected_upload_files",String(i));const o=new URL(b,`${this.opts.service}`).href;return this.#F(o,{method:"POST",headers:this.#v,body:r}).catch(t=>this.#R(t,{url:o,type:"API_ERROR"}))}async reserveFile(t,s){const e=encodeURIComponent(s.size),i=`${R(t)}/reserve_file?size=${e}`;return this.#F(i,{method:"POST",headers:this.#v}).catch(e=>this.#R(e,{assembly:t,file:s,url:i,type:"API_ERROR"}))}async addFile(t,s){if(!s.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));const e=encodeURIComponent(s.size),i=encodeURIComponent(s.uploadURL),r=`size=${e}&filename=${encodeURIComponent(s.name??"Unnamed")}&fieldname=file&s3Url=${i}`,o=`${R(t)}/add_file?${r}`;return this.#F(o,{method:"POST",headers:this.#v}).catch(e=>this.#R(e,{assembly:t,file:s,url:o,type:"API_ERROR"}))}async cancelAssembly(t){const s=R(t);await this.#s(s,{method:"DELETE",headers:this.#v}).catch(t=>this.#R(t,{url:s,type:"API_ERROR"}))}async getAssemblyStatus(t){return this.#F(t,{headers:this.#v}).catch(s=>this.#R(s,{url:t,type:"STATUS_ERROR"}))}async submitError(t,{endpoint:s,instance:e,assembly:i}={}){const r=t.details?`${t.message} (${t.details})`:t.message;return this.#F("https://transloaditstatus.com/client_error",{method:"POST",body:JSON.stringify({endpoint:s,instance:e,assembly_id:i,agent:"undefined"!=typeof navigator?navigator.userAgent:"",client:this.opts.client,error:r})})}#R=(t,s)=>{if(!1===this.opts.errorReporting)throw t;const e={type:s.type};throw s.assembly&&(e.assembly=s.assembly.assembly_id,e.instance=s.assembly.instance),s.url&&(e.endpoint=s.url),this.submitError(t,e).catch(()=>{}),t}}var A={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}};const E={service:"https://api2.transloadit.com",errorReporting:!0,waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,limit:20,retryDelays:[7e3,1e4,15e3,2e4],clientName:null},_=t=>s=>{const e=new o.A("Failed to send error to the client",{cause:s});console.error(e,t)};function S(t){if(!t.assembly_id)throw console.warn("Assembly status is missing `assembly_id`.",t),new Error("Transloadit: Assembly status is missing `assembly_id`.");return t.assembly_id}function v(t,...s){for(const t of s)if("string"==typeof t&&t.length>0)return t;throw new Error(`Transloadit: Assembly status is missing ${t}.`)}function F(t){return v("`assembly_url`",t.assembly_url,t.assembly_ssl_url)}function R(t){return v("`assembly_ssl_url`",t.assembly_ssl_url,t.assembly_url)}const U="https://api2.transloadit.com/companion",L=/\.transloadit\.com$/,O=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/;class k extends i.A{static VERSION="5.5.1";static COMPANION_URL=U;static COMPANION_ALLOWED_HOSTS=L;#t;client;#U;#L;completedFiles;restored=null;constructor(t,s){super(t,{...E,...s}),this.type="uploader",this.id=this.opts.id||"Transloadit",this.defaultLocale=A,this.#t=new a.i(this.opts.limit),this.i18nInit(),this.client=new w({service:this.opts.service,client:this.#O(),errorReporting:this.opts.errorReporting,rateLimitedQueue:this.#t}),this.completedFiles=Object.create(null)}#O(){const t=[`uppy-core:${this.uppy.constructor.VERSION}`,`uppy-transloadit:${this.constructor.VERSION}`,`uppy-tus:${r.default.VERSION}`],s=(s,e)=>{const i=this.uppy.getPlugin(s);i&&t.push(`${e}:${i.constructor.VERSION}`)};return this.opts.importFromUploadURLs&&(s("XHRUpload","uppy-xhr-upload"),s("AwsS3","uppy-aws-s3"),s("AwsS3Multipart","uppy-aws-s3-multipart")),s("Dropbox","uppy-dropbox"),s("Box","uppy-box"),s("Facebook","uppy-facebook"),s("GoogleDrive","uppy-google-drive"),s("GoogleDrivePicker","uppy-google-drive-picker"),s("GooglePhotosPicker","uppy-google-photos-picker"),s("Instagram","uppy-instagram"),s("OneDrive","uppy-onedrive"),s("Zoom","uppy-zoom"),s("Url","uppy-url"),null!=this.opts.clientName&&t.push(this.opts.clientName),t.join(",")}#k(t,s){const e=F(s),i=v("`tus_url`",s.tus_url),r=S(s),o={...t.meta,assembly_url:e,filename:t.name,fieldname:"file"},a={...t.tus,endpoint:i,addRequestId:!0};let n;if("remote"in t&&t.remote&&(({remote:n}=t),s.companion_url&&O.test(t.remote.companionUrl))){const e=s.companion_url.replace(/\/$/,""),i=t.remote.url.replace(t.remote.companionUrl,"").replace(/^\//,"");n={...t.remote,companionUrl:e,url:`${e}/${i}`}}const l={...t,transloadit:{assembly:r}};return this.opts.importFromUploadURLs||Object.assign(l,{meta:o,tus:a,remote:n}),l}async#N(t,s){this.uppy.log("[Transloadit] Create Assembly");try{const e=await this.client.createAssembly({...s,expectedFiles:t.length}),i=this.uppy.getFiles().filter(({id:s})=>t.includes(s));if(0===i.length&&0!==t.length)return await this.client.cancelAssembly(e),null;const r=new y(e,this.#t),{status:o}=r,a=S(o),n={};return i.forEach(t=>{n[t.id]=this.#k(t,o)}),this.uppy.setState({files:{...this.uppy.getState().files,...n}}),this.uppy.emit("transloadit:assembly-created",o,t),this.uppy.log(`[Transloadit] Created Assembly ${a}`),r}catch(t){const s=new o.A(`${this.i18n("creatingAssemblyFailed")}: ${t.message}`,{cause:t});throw"details"in t&&(s.details=t.details),"assembly"in t&&(s.assembly=t.assembly),s}}#P(t){const s=Array.isArray(t)?t:[t],e=new f(this.uppy,s);e.on("assembly-complete",t=>{this.getAssemblyFiles(t).forEach(t=>{this.completedFiles[t.id]=!0,this.uppy.emit("postprocess-complete",t)})}),e.on("assembly-error",(t,s)=>{const e=this.getAssemblyFiles(t);e.forEach(t=>{this.uppy.emit("upload-error",t,s),this.uppy.emit("postprocess-complete",t)});const i={...this.uppy.getState().files};e.forEach(t=>delete i[t.id].tus),this.uppy.setState({files:i}),this.uppy.emit("error",s)}),this.#L=e}#I(){return this.opts.waitForEncoding||this.opts.waitForMetadata}#C(t,s){return Promise.all(s.map(s=>{const e=this.uppy.getFile(s);return this.client.reserveFile(t.status,e)}))}#T=t=>{this.uppy.emit("restore:plugin-data-changed",{[this.id]:t?{assemblyResponse:t}:void 0})};get assembly(){return this.#U}set assembly(t){!t&&this.assembly&&this.assembly.off("status",this.#T),this.#U=t,this.#T(t?.status),t&&t.on("status",this.#T)}#x=t=>{const s=this.uppy.getFile(t.id);if(!s?.transloadit?.assembly)return;const{status:e}=this.assembly;this.client.addFile(e,s).catch(t=>{this.uppy.log(t),this.uppy.emit("transloadit:import-error",e,s.id,t)})};#$(t){const s=this.uppy.getFiles();for(let e=0;e<s.length;e++){const i=s[e];if(i.uploadURL===t.tus_upload_url)return i;if(i.tus&&i.tus.uploadUrl===t.tus_upload_url)return i;if(!t.is_tus_file&&i.name===t.name&&i.size===t.size)return i}}#D(t,s){const e=this.getPluginState(),i=this.#$(s);i?(this.setPluginState({files:{...e.files,[s.id]:{assembly:t,id:i.id,uploadedFile:s}}}),this.uppy.emit("transloadit:upload",s,this.getAssembly())):this.uppy.log("[Transloadit] Couldn’t find the file, it was likely removed in the process")}#M(t,s,e){const i=this.getPluginState();if(!("id"in e))return void console.warn("Result has no id",e);if("string"!=typeof e.id)return void console.warn("Result has no id of type string",e);const r={result:e,stepName:s,id:e.id,assembly:t};this.setPluginState({results:[...i.results,r]}),this.uppy.emit("transloadit:result",s,r.result,this.getAssembly())}#j(t){const s=R(t.status);this.client.getAssemblyStatus(s).then(s=>{t.status=s,this.uppy.emit("transloadit:complete",s)})}async#W(t){await this.client.cancelAssembly(t),this.uppy.emit("transloadit:assembly-cancelled",t),this.assembly=void 0}#J=async()=>{if(this.assembly)try{await this.#W(this.assembly.status)}catch(t){this.uppy.log(t)}this.uppy.setState({allowNewUpload:!0})};#Q=t=>{const s=(t?.[this.id]?t[this.id]:{}).assemblyResponse;if(!s)return;const e=()=>{const t={},e=[],i=S(s);s.uploads?.forEach(s=>{const e=this.#$(s);t[s.id]={id:e.id,assembly:i,uploadedFile:s}});const r=this.getPluginState(),o=s.results??{};Object.keys(o).forEach(t=>{const s=o[t]??[];for(const o of s){if(!("id"in o)){console.warn("Result has no id",o);continue}if("string"!=typeof o.id){console.warn("Result has no id of type string",o);continue}if(!("original_id"in o)){console.warn("Result has no original_id",o);continue}if("string"!=typeof o.original_id){console.warn("Result has no original_id of type string",o);continue}const s=r.files[o.original_id];e.push({id:o.id,result:{...o,localId:s?s.id:null},stepName:t,assembly:i})}});const a=new y(s,this.#t);return a.status=s,this.assembly=a,this.setPluginState({files:t,results:e}),t},i=t=>{this.#P(S(s)),this.#z(this.assembly,t)},r=()=>this.assembly?.update();this.restored=(async()=>{const t=e();i(Object.keys(t)),await r(),this.restored=null})(),this.restored.catch(t=>{this.uppy.log("Failed to restore",t)})};#z(t,s){const{status:e}=t,i=S(e);return t.on("upload",t=>{this.#D(i,t)}),t.on("error",s=>{s.assembly=t.status,this.uppy.emit("transloadit:assembly-error",t.status,s)}),t.on("executing",()=>{this.uppy.emit("transloadit:assembly-executing",t.status)}),t.on("execution-progress",t=>{if(this.uppy.emit("transloadit:execution-progress",t),null!=t.progress_combined)for(const e of this.uppy.getFilesByIds(s))this.uppy.emit("postprocess-progress",e,{mode:"determinate",value:t.progress_combined/100,message:this.i18n("encoding")})}),this.opts.waitForEncoding&&t.on("result",(t,s)=>{this.#M(i,t,s)}),this.opts.waitForEncoding?t.on("finished",()=>{this.#j(t)}):this.opts.waitForMetadata&&t.on("metadata",()=>{this.#j(t)}),"ASSEMBLY_COMPLETE"===t.ok||t.connect(),t}#G=async t=>{this.uppy.setState({allowNewUpload:!1});const s="function"==typeof this.opts.assemblyOptions?await this.opts.assemblyOptions():this.opts.assemblyOptions;s.fields={...s.fields??{}},function(t){if(null==t)throw new Error("Transloadit: The `params` option is required.");let s;if("string"==typeof t)try{s=JSON.parse(t)}catch(t){throw new o.A("Transloadit: The `params` option is a malformed JSON string.",{cause:t})}else s=t;if(!s.auth||!s.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/c/template-credentials")}(s.params);try{const e=this.assembly??await this.#N(t,s);if(null==e)throw new Error("All files were canceled after assembly was created");this.opts.importFromUploadURLs&&await this.#C(e,t),t.forEach(t=>{const s=this.uppy.getFile(t);this.uppy.emit("preprocess-complete",s)}),this.#P(S(e.status)),this.assembly=e,this.#z(e,t)}catch(s){throw t.forEach(t=>{const e=this.uppy.getFile(t);this.uppy.emit("preprocess-complete",e),this.uppy.emit("upload-error",e,s)}),this.uppy.setState({allowNewUpload:!0}),s}};#V=async(t,s)=>{try{await this.restored;const e=t.map(t=>this.uppy.getFile(t)).filter(t=>!t.error),i=this.assembly?S(this.assembly.status):void 0,r=()=>{this.assembly?.close()};if(!this.#I()){r();const t=this.assembly?.status;return void(null!=t&&this.uppy.addResultData(s,{transloadit:[t]}))}if(!i)return void this.uppy.addResultData(s,{transloadit:[]});e.filter(t=>!(0,n.A)(this.completedFiles,t.id)).forEach(t=>{this.uppy.emit("postprocess-progress",t,{mode:"indeterminate",message:this.i18n("encoding")})}),await this.#L.promise,r();const o=this.assembly?.status;null!=o&&this.uppy.addResultData(s,{transloadit:[o]})}finally{this.assembly=void 0,this.uppy.setState({allowNewUpload:!0})}};#B=()=>{this.assembly?.close()};#h=t=>{this.#B(),this.assembly=void 0,this.client.submitError(t).catch(_(t)),this.uppy.setState({allowNewUpload:!0})};#Y=(t,s)=>{if(this.#B(),s?.message?.startsWith("tus: ")){const t=s.originalRequest?.getUnderlyingObject()?.responseURL;this.client.submitError(s,{endpoint:t}).catch(_(s))}};install(){this.uppy.addPreProcessor(this.#G),this.uppy.addPostProcessor(this.#V),this.uppy.on("error",this.#h),this.uppy.on("cancel-all",this.#J),this.uppy.on("upload-error",this.#Y),this.opts.importFromUploadURLs?this.uppy.on("upload-success",this.#x):this.uppy.use(r.default,{storeFingerprintForResuming:!1,allowedMetaFields:!0,limit:this.opts.limit,rateLimitedQueue:this.#t,retryDelays:this.opts.retryDelays}),this.uppy.on("restored",this.#Q),this.setPluginState({files:{},results:[]});const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!1}})}uninstall(){this.uppy.removePreProcessor(this.#G),this.uppy.removePostProcessor(this.#V),this.uppy.off("error",this.#h),this.uppy.off("cancel-all",this.#J),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",this.#x);const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!0}})}getAssembly(){return this.assembly?.status}getAssemblyFiles(t){return this.uppy.getFiles().filter(s=>s?.transloadit?.assembly===t)}}},8396:function(t,s,e){"use strict";var i=e(9420);class r extends Error{isNetworkError;cause;constructor(t,s){super(t),this.cause=s?.cause,this.cause&&(0,i.A)(this.cause,"isNetworkError")?this.isNetworkError=this.cause.isNetworkError:this.isNetworkError=!1}}s.A=r},5945:function(t,s,e){"use strict";e.d(s,{A:function(){return r}});var i=e(6681);function r(...t){return fetch(...t).catch(t=>{throw"AbortError"===t.name?t:new i.A(t)})}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[231],{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,l,c=this._events[a],h=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),h){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,i),!0;case 4:return c.fn.call(c.context,t,i,n),!0;case 5:return c.fn.call(c.context,t,i,n,o),!0;case 6:return c.fn.call(c.context,t,i,n,o,s),!0}for(l=1,u=new Array(h-1);l<h;l++)u[l-1]=arguments[l];c.fn.apply(c.context,u)}else{var p,d=c.length;for(l=0;l<d;l++)switch(c[l].once&&this.removeListener(e,c[l].fn,void 0,!0),h){case 1:c[l].fn.call(c[l].context);break;case 2:c[l].fn.call(c[l].context,t);break;case 3:c[l].fn.call(c[l].context,t,i);break;case 4:c[l].fn.call(c[l].context,t,i,n);break;default:if(!u)for(p=1,u=new Array(h-1);p<h;p++)u[p-1]=arguments[p];c[l].fn.apply(c[l].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,l=[],c=a.length;u<c;u++)(a[u].fn!==t||n&&!a[u].once||i&&a[u].context!==i)&&l.push(a[u]);l.length?this._events[o]=1===l.length?l[0]:l: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,l,c=t;if("ref"in c)for(l in c={},t)"ref"==l?u=t[l]:c[l]=t[l];var h={type:e,props:c,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(l in u)void 0===c[l]&&(c[l]=u[l]);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 l=Object.prototype.toString,c=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]"!==l.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(")"))||c.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 g=m;class f 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 g;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 f({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 l,c,h,{isPaused:p}=e;const m=(t,r)=>{null!=l&&l.readyState===l.OPEN?l.send(JSON.stringify({action:t,payload:r??{}})):this.uppy.log(`Cannot send "${t}" to socket ${e.id} because the socket state was ${String(l?.readyState)}`,"warning")};function g(){n.resumableUploads&&m(p?"pause":"resume")}const f=e=>{n.resumableUploads&&(p=e,l&&g())},y=t=>{n.individualCancellation&&t.id===e.id&&(m("cancel"),c?.abort?.(),this.uppy.log(`upload ${e.id} was removed`),o())},v=()=>{m("cancel"),c?.abort?.(),this.uppy.log(`upload ${e.id} was canceled`),o()},w=(t,r)=>{t?.id===e.id&&f(r)},_=()=>f(!0),b=()=>f(!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",()=>{c?.abort()}),(async()=>{c&&c.abort(),c=new AbortController;const r=t=>{this.uppy.setFileState(e.id,{serverToken:null}),c?.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)=>{l=new WebSocket(`${u}/api/${a}`),i(),l.addEventListener("close",()=>{l=void 0,n(new Error("Socket closed unexpectedly"))}),l.addEventListener("error",e=>{this.uppy.log(`Companion socket error ${JSON.stringify(e)}, closing socket`,"warning"),l?.close()}),l.addEventListener("open",()=>{g()}),l.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}),c?.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),l&&l.close(),l=void 0};c.signal.addEventListener("abort",()=>{s()})}),{retries:10,signal:c.signal,onFailedAttempt:()=>{c.signal.aborted||this.uppy.log(`Retrying websocket ${e.id}`)}})})().abortOn(c.signal)}catch(e){if(c.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),l=r(3373),c=r(2784),h=r(5181),p=0,d=[],m=h.fF,g=m.__b,f=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&&x(r.__H,t)&&(r.__=e,r.u=t,n.__H.__h.push(r))}function T(e,t){var r=b(i++,7);return x(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(C),t.__h=[]}catch(r){t.__h=[],m.__e(r,e.__v)}}}m.__b=function(e){n=null,g&&g(e)},m.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),_&&_(e,t)},m.__r=function(e){f&&f(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(C),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.__||C(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 C(e){var t=n;e.__c=e.__(),n=t}function x(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,l]=P(0),[c,h]=P(0);k(()=>{function e(){null!=s.current&&c!==s.current.offsetHeight&&h(s.current.offsetHeight)}return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[c]);const d=I(()=>{s.current&&l(s.current.scrollTop)},[]);let m=Math.floor(u/t),g=Math.floor(c/t);i&&(m=Math.max(0,m-m%i),g+=i);const f=m+g+n,y=e.slice(m,f),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 z=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 D({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 O(e){const{viewType:t,toggleCheckbox:r,showTitles:i,i18n:n,openFolder:o,file:s,utmSource:u}=e,c="folder"===s.type?null:s.restrictionError,h=!!c&&"checked"!==s.status,p={file:s,openFolder:o,toggleCheckbox:r,utmSource:u,i18n:n,viewType:t,showTitles:i,className:l("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:c};switch(t){case"grid":return(0,a.Y)(z,{...p});case"list":return(0,a.Y)(D,{...p});case"unsplash":return(0,a.Y)(z,{...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:l,noResultsLabel:c,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:c});const g=e=>(0,a.Y)(O,{viewType:r,toggleCheckbox:t=>{t.stopPropagation(),t.preventDefault(),document.getSelection()?.removeAllRanges(),i(e,d)},showTitles:o,i18n:s,openFolder:l,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:g,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(g)})})},M=r(590),V=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"})})})]})},j=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 K({cancelSelection:e,donePicking:t,i18n:r,partialTree:i,validateAggregateRestrictions:n}){const o=T(()=>n(i),[i,n]),s=T(()=>j(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:l("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 W=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;#l;#c=0;#h;#p;#d=0;#m;#g;#a;#f;#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.#l=e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,this.#h=e.intervalCap,this.#p=e.interval,this.#a=new e.queueClass,this.#f=e.queueClass,this.concurrency=e.concurrency,this.timeout=e.timeout,this.#_=!0===e.throwOnTimeout,this.#w=!1===e.autoStart}get#P(){return this.#l||this.#c<this.#h}get#k(){return this.#y<this.#v}#T(){this.#y--,this.#I(),this.emit("next")}#S(){this.#F(),this.#A(),this.#g=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.#g&&(this.#g=setTimeout(()=>{this.#S()},t)),!0;this.#c=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.#l||void 0!==this.#m||(this.#m=setInterval(()=>{this.#F()},this.#p),this.#d=Date.now()+this.#p)}#F(){0===this.#c&&0===this.#y&&this.#m&&(clearInterval(this.#m),this.#m=void 0),this.#c=this.#u?this.#y:0,this.#C()}#C(){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.#C()}async#x(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.#c++;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,l)=>{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&&l(te(e)),a=()=>{l(te(e))},e.addEventListener("abort",a,{once:!0})}if(r===Number.POSITIVE_INFINITY)return void e.then(u,l);const c=new X;s=o.setTimeout.call(void 0,()=>{if(i)try{u(i())}catch(e){l(e)}else"function"==typeof e.cancel&&e.cancel(),!1===n?u():n instanceof Error?l(n):(c.message=n??`Promise timed out after ${r} milliseconds`,l(c))},r),(async()=>{try{u(await e)}catch(e){l(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.#x(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.#C(),this):this}pause(){this.#w=!0}clear(){this.#a=new this.#f}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),l=a.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:"checked",parentId:r.id,data:e})),c=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(...c,...l),l.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,l=s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:u?"checked":"unchecked",parentId:r.id,data:e})),c=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),...l,...c]},le=(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},l=e.map(e=>e.id===u.id?u:e),c="folder"===u.type&&"checked"===u.status;return[...l,...s.map(e=>({type:"folder",id:e.requestPath,cached:!1,nextPagePath:null,status:c?"checked":"unchecked",parentId:u.id,data:e})),...a.map(e=>{const t=n(e);return{type:"file",id:e.requestPath,restrictionError:t,status:c&&!t?"checked":"unchecked",parentId:u.id,data:e}})]},ce=(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 ge({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 fe=({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:l("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)(fe,{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:l("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=c(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),l=encodeURIComponent(`/${u.join("/")}`),c=a.find(e=>e.id===l&&"root"!==e.type);if(c)return i=l,void(r="checked"===c.status);const h=o===s.length-1;let p;const d=r?"checked":"unchecked";if(h)if(e.isFolder)p={type:"folder",id:l,cached:!1,nextPagePath:null,status:d,parentId:i,data:e};else{const t=this.validateSingleFile(e);p={type:"file",id:l,restrictionError:t,status:t?"unchecked":d,parentId:i,data:e}}else p={type:"folder",id:l,cached:!1,nextPagePath:null,status:d,parentId:i,data:{name:decodeURIComponent(n),icon:"folder",isFolder:!0}};a.push(p),i=l,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=le(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,W.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=ce(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 j(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)(ge,{pluginName:this.plugin.title,pluginIcon:u,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18n,renderForm:n.renderAuthForm,loading:s});const{partialTree:c,username:h,searchString:p,searchResults:d}=this.plugin.getPluginState(),m=this.getBreadcrumbs();return(0,a.FD)("div",{className:l("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)(V,{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)(K,{partialTree:c,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
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[268],{5268:function(i,e,t){t.r(e),t.d(e,{default:function(){return d}});var s=t(9028),o=t(50),l=t(6317),r=t(5538),n=t(760),h=(t(5181),"5.1.0"),a=t(8653);class c extends a.A{toggleCheckbox(i,e){i.data.custom?.isSharedDrive||super.toggleCheckbox(i,e)}}var p={strings:{pluginNameGoogleDrive:"Google Drive"}};class d extends n.A{static VERSION=h;icon;provider;view;storage;files;rootFolderId="root";constructor(i,e){super(i,e),this.type="acquirer",this.storage=this.opts.storage||o,this.files=[],this.id=this.opts.id||"GoogleDrive",this.icon=()=>(0,s.Y)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:(0,s.FD)("g",{fillRule:"nonzero",fill:"none",children:[(0,s.Y)("path",{d:"M6.663 22.284l.97 1.62c.202.34.492.609.832.804l3.465-5.798H5c0 .378.1.755.302 1.096l1.361 2.278z",fill:"#0066DA"}),(0,s.Y)("path",{d:"M16 12.09l-3.465-5.798c-.34.195-.63.463-.832.804l-6.4 10.718A2.15 2.15 0 005 18.91h6.93L16 12.09z",fill:"#00AC47"}),(0,s.Y)("path",{d:"M23.535 24.708c.34-.195.63-.463.832-.804l.403-.67 1.928-3.228c.201-.34.302-.718.302-1.096h-6.93l1.474 2.802 1.991 2.996z",fill:"#EA4335"}),(0,s.Y)("path",{d:"M16 12.09l3.465-5.798A2.274 2.274 0 0018.331 6h-4.662c-.403 0-.794.11-1.134.292L16 12.09z",fill:"#00832D"}),(0,s.Y)("path",{d:"M20.07 18.91h-8.14l-3.465 5.798c.34.195.73.292 1.134.292h12.802c.403 0 .794-.11 1.134-.292L20.07 18.91z",fill:"#2684FC"}),(0,s.Y)("path",{d:"M23.497 12.455l-3.2-5.359a2.252 2.252 0 00-.832-.804L16 12.09l4.07 6.82h6.917c0-.377-.1-.755-.302-1.096l-3.188-5.359z",fill:"#FFBA00"})]})}),this.opts.companionAllowedHosts=(0,l.A)(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new r.A(i,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"drive",pluginId:this.id,supportsRefreshToken:!0}),this.defaultLocale=p,this.i18nInit(),this.title=this.i18n("pluginNameGoogleDrive"),this.render=this.render.bind(this)}install(){this.view=new c(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0});const{target:i}=this.opts;i&&this.mount(i,this)}uninstall(){this.view.tearDown(),this.unmount()}render(i){return this.view.render(i)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[270],{1270:function(i,e,t){t.r(e),t.d(e,{default:function(){return p}});var s=t(9028),o=t(50),n=t(6317),r=t(5538),h=t(760),a=t(8653),l=(t(5181),"5.1.0"),c={strings:{pluginNameFacebook:"Facebook"}};class p extends h.A{static VERSION=l;icon;provider;view;storage;files;rootFolderId=null;constructor(i,e){super(i,e),this.id=this.opts.id||"Facebook",this.type="acquirer",this.storage=this.opts.storage||o,this.files=[],this.icon=()=>(0,s.Y)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:(0,s.FD)("g",{fill:"none",fillRule:"evenodd",children:[(0,s.Y)("path",{d:"M27 16c0-6.075-4.925-11-11-11S5 9.925 5 16c0 5.49 4.023 10.041 9.281 10.866V19.18h-2.793V16h2.793v-2.423c0-2.757 1.642-4.28 4.155-4.28 1.204 0 2.462.215 2.462.215v2.707h-1.387c-1.366 0-1.792.848-1.792 1.718V16h3.05l-.487 3.18h-2.563v7.686C22.977 26.041 27 21.49 27 16",fill:"#1777F2"}),(0,s.Y)("path",{d:"M20.282 19.18L20.77 16h-3.051v-2.063c0-.87.426-1.718 1.792-1.718h1.387V9.512s-1.258-.215-2.462-.215c-2.513 0-4.155 1.523-4.155 4.28V16h-2.793v3.18h2.793v7.686a11.082 11.082 0 003.438 0V19.18h2.563",fill:"#FFFFFE"})]})}),this.opts.companionAllowedHosts=(0,n.A)(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new r.A(i,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"facebook",pluginId:this.id,supportsRefreshToken:!1}),this.defaultLocale=c,this.i18nInit(),this.title=this.i18n("pluginNameFacebook"),this.render=this.render.bind(this)}install(){this.view=new a.A(this,{provider:this.provider});const{target:i}=this.opts;i&&this.mount(i,this)}uninstall(){this.view.tearDown(),this.unmount()}render(i){const{partialTree:e,currentFolderId:t}=this.getPluginState();return 0===e.filter(i=>"folder"===i.type&&i.parentId===t).length?this.view.render(i,{viewType:"grid",showFilter:!1,showTitles:!1}):this.view.render(i)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[278],{5611:function(e){e.exports=r,e.exports.isMobile=r,e.exports.default=r;const t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,i=/CrOS/,o=/android|ipad|playbook|silk/i;function r(e){e||(e={});let r=e.ua;if(r||"undefined"==typeof navigator||(r=navigator.userAgent),r&&r.headers&&"string"==typeof r.headers["user-agent"]&&(r=r.headers["user-agent"]),"string"!=typeof r)return!1;let s=t.test(r)&&!i.test(r)||!!e.tablet&&o.test(r);return!s&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==r.indexOf("Macintosh")&&-1!==r.indexOf("Safari")&&(s=!0),s}},9028:function(e,t,i){i.d(t,{FD:function(){return s},Y:function(){return s}});var o=i(5181),r=0;function s(e,t,i,s,n,a){t||(t={});var c,d,h=t;if("ref"in h)for(d in h={},t)"ref"==d?c=t[d]:h[d]=t[d];var u={type:e,props:h,key:i,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--r,__i:-1,__u:0,__source:n,__self:a};if("function"==typeof e&&(c=e.defaultProps))for(d in c)void 0===h[d]&&(h[d]=c[d]);return o.fF.vnode&&o.fF.vnode(u),u}Array.isArray},9278:function(e,t,i){i.r(t),i.d(t,{default:function(){return D},defaultOptions:function(){return P}});var o=i(9028),r=i(760),s=i(7544);const n={__proto__:null,"audio/mp3":"mp3","audio/mp4":"mp4","audio/ogg":"ogg","audio/webm":"webm","image/gif":"gif","image/heic":"heic","image/heif":"heif","image/jpeg":"jpg","image/webp":"webp","image/png":"png","image/svg+xml":"svg","video/mp4":"mp4","video/ogg":"ogv","video/quicktime":"mov","video/webm":"webm","video/x-matroska":"mkv","video/x-msvideo":"avi"};function a(e){return[e]=e.split(";",1),n[e]||null}var c=i(5611),d=i(5181);function h(){return(0,o.Y)("svg",{"aria-hidden":"true",focusable:"false",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55",children:(0,o.Y)("path",{d:"M57.3 8.433c4.59 0 8.1 3.51 8.1 8.1v29.7c0 4.59-3.51 8.1-8.1 8.1H8.7c-4.59 0-8.1-3.51-8.1-8.1v-29.7c0-4.59 3.51-8.1 8.1-8.1h9.45l4.59-7.02c.54-.54 1.35-1.08 2.16-1.08h16.2c.81 0 1.62.54 2.16 1.08l4.59 7.02h9.45zM33 14.64c-8.62 0-15.393 6.773-15.393 15.393 0 8.62 6.773 15.393 15.393 15.393 8.62 0 15.393-6.773 15.393-15.393 0-8.62-6.773-15.393-15.393-15.393zM33 40c-5.648 0-9.966-4.319-9.966-9.967 0-5.647 4.318-9.966 9.966-9.966s9.966 4.319 9.966 9.966C42.966 35.681 38.648 40 33 40z",fillRule:"evenodd"})})}var u=function({onDiscard:e,i18n:t}){return(0,o.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--discard",type:"button",title:t("discardRecordedFile"),"aria-label":t("discardRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:(0,o.Y)("svg",{width:"13",height:"13",viewBox:"0 0 13 13",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:(0,o.FD)("g",{fill:"#FFF",fillRule:"evenodd",children:[(0,o.Y)("path",{d:"M.496 11.367L11.103.76l1.414 1.414L1.911 12.781z"}),(0,o.Y)("path",{d:"M11.104 12.782L.497 2.175 1.911.76l10.607 10.606z"})]})})})};function l({recording:e,onStartRecording:t,onStopRecording:i,i18n:r}){return e?(0,o.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("stopRecording"),"aria-label":r("stopRecording"),onClick:i,"data-uppy-super-focusable":!0,children:(0,o.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:(0,o.Y)("rect",{x:"15",y:"15",width:"70",height:"70"})})}):(0,o.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button",type:"button",title:r("startRecording"),"aria-label":r("startRecording"),onClick:t,"data-uppy-super-focusable":!0,children:(0,o.Y)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:"100",height:"100",viewBox:"0 0 100 100",children:(0,o.Y)("circle",{cx:"50",cy:"50",r:"40"})})})}function p({recordingLengthSeconds:e}){const t=(i=e,`${Math.floor(i/60)}:${String(i%60).padStart(2,"0")}`);var i;return(0,o.Y)("span",{children:t})}function m({onSnapshot:e,i18n:t}){return(0,o.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:t("takePicture"),"aria-label":t("takePicture"),onClick:e,"data-uppy-super-focusable":!0,children:h()})}var g=function({onSubmit:e,i18n:t}){return(0,o.Y)("button",{className:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--submit",type:"button",title:t("submitRecordedFile"),"aria-label":t("submitRecordedFile"),onClick:e,"data-uppy-super-focusable":!0,children:(0,o.Y)("svg",{width:"12",height:"9",viewBox:"0 0 12 9",xmlns:"http://www.w3.org/2000/svg","aria-hidden":"true",focusable:"false",className:"uppy-c-icon",children:(0,o.Y)("path",{fill:"#fff",fillRule:"nonzero",d:"M10.66 0L12 1.31 4.136 9 0 4.956l1.34-1.31L4.136 6.38z"})})})};function v({currentDeviceId:e,videoSources:t,onChangeVideoSource:i}){return(0,o.Y)("div",{className:"uppy-Webcam-videoSource",children:(0,o.Y)("select",{className:"uppy-u-reset uppy-Webcam-videoSource-select",onChange:e=>{i(e.target.value)},children:t.map(t=>(0,o.Y)("option",{value:t.deviceId,selected:t.deviceId===e,children:t.label},t.deviceId))})})}function b(e,t){return e.includes(t)}class f extends d.uA{videoElement;refs;componentDidMount(){const{onFocus:e}=this.props;e()}componentWillUnmount(){const{onStop:e}=this.props;e()}render(){const{src:e,recordedVideo:t,capturedSnapshot:i,recording:r,modes:s,supportsRecording:n,videoSources:a,showVideoSourceDropdown:c,showRecordingLength:d,onSubmit:h,i18n:f,mirror:y,onSnapshot:S,onStartRecording:w,onStopRecording:R,onDiscardRecordedMedia:C,recordingLengthSeconds:M}=this.props,k=!!t,P=!!i,D=k||P,I=!D&&n&&(b(s,"video-only")||b(s,"audio-only")||b(s,"video-audio")),L=!D&&b(s,"picture"),Y=n&&d&&!k,T=c&&a&&a.length>1,x={playsInline:!0};return t?(x.muted=!1,x.controls=!0,x.src=t,this.videoElement&&(this.videoElement.srcObject=null)):(x.muted=!0,x.autoPlay=!0,x.srcObject=e),(0,o.FD)("div",{className:"uppy uppy-Webcam-container",children:[(0,o.Y)("div",{className:"uppy-Webcam-videoContainer",children:!i||r||t?(0,o.Y)("video",{ref:e=>{this.videoElement=e},className:"uppy-Webcam-video "+(y?"uppy-Webcam-video--mirrored":""),...x}):(0,o.Y)("div",{className:"uppy-Webcam-imageContainer",children:(0,o.Y)("img",{src:i,className:"uppy-Webcam-video",alt:"capturedSnapshot"})})}),(0,o.FD)("div",{className:"uppy-Webcam-footer",children:[(0,o.Y)("div",{className:"uppy-Webcam-videoSourceContainer",children:T?v(this.props):null}),(0,o.FD)("div",{className:"uppy-Webcam-buttonContainer",children:[L&&(0,o.Y)(m,{onSnapshot:S,i18n:f}),I&&(0,o.Y)(l,{recording:r,onStartRecording:w,onStopRecording:R,i18n:f}),(k||P)&&(0,o.Y)(g,{onSubmit:h,i18n:f}),(k||P)&&(0,o.Y)(u,{onDiscard:C,i18n:f})]}),(0,o.Y)("div",{className:"uppy-Webcam-recordingLength",children:Y&&(0,o.Y)(p,{recordingLengthSeconds:M})})]})]})}}var y=f,S={strings:{pluginNameCamera:"Camera",noCameraTitle:"Camera Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",submitRecordedFile:"Submit recorded file",discardRecordedFile:"Discard recorded file",smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",recordingLength:"Recording length %{recording_length}",allowAccessTitle:"Please allow access to your camera",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site."}};function w({icon:e,i18n:t,hasCamera:i}){return(0,o.FD)("div",{className:"uppy-Webcam-permissons",children:[(0,o.Y)("div",{className:"uppy-Webcam-permissonsIcon",children:e()}),(0,o.Y)("div",{className:"uppy-Webcam-title",children:t(i?"allowAccessTitle":"noCameraTitle")}),(0,o.Y)("p",{children:t(i?"allowAccessDescription":"noCameraDescription")})]})}function R(e){return"."===e[0]?s.A[e.slice(1)]:e}function C(e){return/^video\/[^*]+$/.test(e)}function M(e){return/^image\/[^*]+$/.test(e)}function k(e,t){return e.includes(t)}const P={onBeforeSnapshot:()=>Promise.resolve(),countdown:!1,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,showVideoSourceDropdown:!1,preferredImageMimeType:null,preferredVideoMimeType:null,showRecordingLength:!1,mobileNativeCamera:(0,c.isMobile)({tablet:!0})};class D extends r.A{static VERSION="5.1.0";#e;mediaDevices;supportsUserMedia;protocol;capturedMediaFile;icon;webcamActive;stream=null;recorder=null;recordingChunks=null;recordingLengthTimer;captureInProgress=!1;constructor(e,t){super(e,{...P,...t}),this.mediaDevices=navigator.mediaDevices,this.supportsUserMedia=!!this.mediaDevices,this.protocol=location.protocol.match(/https/i)?"https":"http",this.id=this.opts.id||"Webcam",this.type="acquirer",this.capturedMediaFile=null,this.icon=()=>(0,o.Y)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:(0,o.Y)("path",{d:"M23.5 9.5c1.417 0 2.5 1.083 2.5 2.5v9.167c0 1.416-1.083 2.5-2.5 2.5h-15c-1.417 0-2.5-1.084-2.5-2.5V12c0-1.417 1.083-2.5 2.5-2.5h2.917l1.416-2.167C13 7.167 13.25 7 13.5 7h5c.25 0 .5.167.667.333L20.583 9.5H23.5zM16 11.417a4.706 4.706 0 00-4.75 4.75 4.704 4.704 0 004.75 4.75 4.703 4.703 0 004.75-4.75c0-2.663-2.09-4.75-4.75-4.75zm0 7.825c-1.744 0-3.076-1.332-3.076-3.074 0-1.745 1.333-3.077 3.076-3.077 1.744 0 3.074 1.333 3.074 3.076s-1.33 3.075-3.074 3.075z",fill:"#02B383",fillRule:"nonzero"})}),this.defaultLocale=S,this.i18nInit(),this.title=this.i18n("pluginNameCamera"),this.#e=this.opts.mirror,this.install=this.install.bind(this),this.setPluginState=this.setPluginState.bind(this),this.render=this.render.bind(this),this.start=this.start.bind(this),this.stop=this.stop.bind(this),this.takeSnapshot=this.takeSnapshot.bind(this),this.startRecording=this.startRecording.bind(this),this.stopRecording=this.stopRecording.bind(this),this.discardRecordedMedia=this.discardRecordedMedia.bind(this),this.submit=this.submit.bind(this),this.oneTwoThreeSmile=this.oneTwoThreeSmile.bind(this),this.focus=this.focus.bind(this),this.changeVideoSource=this.changeVideoSource.bind(this),this.webcamActive=!1,this.opts.countdown&&(this.opts.onBeforeSnapshot=this.oneTwoThreeSmile),this.setPluginState({hasCamera:!1,cameraReady:!1,cameraError:null,recordingLengthSeconds:0,videoSources:[],currentDeviceId:null,capturedSnapshot:null})}getStatus(){const{recordedVideo:e,capturedSnapshot:t,isRecording:i,cameraReady:o,cameraError:r}=this.getPluginState();return i?"recording":null!=e||null!=t?"captured":o?"ready":r?"error":"init"}setOptions(e){super.setOptions({...e,videoConstraints:{...this.opts.videoConstraints,...e?.videoConstraints}})}hasCameraCheck(){return this.mediaDevices?this.mediaDevices.enumerateDevices().then(e=>e.some(e=>"videoinput"===e.kind)):Promise.resolve(!1)}isAudioOnly(){return 1===this.opts.modes.length&&"audio-only"===this.opts.modes[0]}getConstraints(e=null){const t=-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),i=!this.isAudioOnly()&&(-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("video-only")||-1!==this.opts.modes.indexOf("picture")),o={...this.opts.videoConstraints||{},...null!=e&&{deviceId:e}};return{audio:t,video:!!i&&o}}start(e=null){if(!this.supportsUserMedia)return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0,this.opts.mirror&&(this.#e=!0);const t=this.getConstraints(e?.deviceId);this.hasCameraCheck().then(i=>(this.setPluginState({hasCamera:i}),this.mediaDevices.getUserMedia(t).then(t=>{this.stream=t;let i=null;const o=this.isAudioOnly()?t.getAudioTracks():t.getVideoTracks();e&&e.deviceId?o.forEach(t=>{t.getSettings().deviceId===e.deviceId&&(i=t.getSettings().deviceId)}):i=o[0].getSettings().deviceId,this.updateVideoSources(),this.setPluginState({currentDeviceId:i,cameraReady:!0})}).catch(e=>{this.setPluginState({cameraReady:!1,cameraError:e}),this.uppy.info(e.message,"error")})))}getMediaRecorderOptions(){const e={};if(MediaRecorder.isTypeSupported){const{restrictions:t}=this.uppy.opts;let i=[];this.opts.preferredVideoMimeType?i=[this.opts.preferredVideoMimeType]:t.allowedFileTypes&&(i=t.allowedFileTypes.map(R).filter(C));const o=e=>MediaRecorder.isTypeSupported(e)&&a(e),r=i.filter(o);r.length>0&&(e.mimeType=r[0])}return e}startRecording(){this.recorder=new MediaRecorder(this.stream,this.getMediaRecorderOptions()),this.recordingChunks=[];let e=!1;this.recorder.addEventListener("dataavailable",t=>{this.recordingChunks.push(t.data);const{restrictions:i}=this.uppy.opts;if(this.recordingChunks.length>1&&null!=i.maxFileSize&&!e){const t=this.recordingChunks.reduce((e,t)=>e+t.size,0),o=(t-this.recordingChunks[0].size)/(this.recordingChunks.length-1)*3;t>Math.max(0,i.maxFileSize-o)&&(e=!0,this.uppy.info(this.i18n("recordingStoppedMaxSize"),"warning",4e3),this.stopRecording())}}),this.recorder.start(500),this.opts.showRecordingLength&&(this.recordingLengthTimer=setInterval(()=>{const e=this.getPluginState().recordingLengthSeconds;this.setPluginState({recordingLengthSeconds:e+1})},1e3)),this.setPluginState({isRecording:!0})}stopRecording(){return new Promise(e=>{this.recorder.addEventListener("stop",()=>{e()}),this.recorder.stop(),this.opts.showRecordingLength&&(clearInterval(this.recordingLengthTimer),this.setPluginState({recordingLengthSeconds:0}))}).then(()=>(this.setPluginState({isRecording:!1}),this.getVideo())).then(e=>{try{this.capturedMediaFile=e,this.setPluginState({recordedVideo:URL.createObjectURL(e.data)}),this.#e=!1}catch(e){e.isRestriction||this.uppy.log(e)}}).then(()=>{this.recordingChunks=null,this.recorder=null},e=>{throw this.recordingChunks=null,this.recorder=null,e})}discardRecordedMedia(){const{recordedVideo:e,capturedSnapshot:t}=this.getPluginState();e&&URL.revokeObjectURL(e),t&&URL.revokeObjectURL(t),this.setPluginState({recordedVideo:null,capturedSnapshot:null}),this.opts.mirror&&(this.#e=!0),this.capturedMediaFile=null}submit(){try{this.capturedMediaFile&&this.uppy.addFile(this.capturedMediaFile)}catch(e){e.isRestriction||this.uppy.log(e,"error")}}async stop(){if(this.stream){const e=this.stream.getAudioTracks(),t=this.stream.getVideoTracks();e.concat(t).forEach(e=>e.stop())}this.recorder&&await new Promise(e=>{this.recorder.addEventListener("stop",e,{once:!0}),this.recorder.stop(),this.opts.showRecordingLength&&clearInterval(this.recordingLengthTimer)}),this.recordingChunks=null,this.recorder=null,this.webcamActive=!1,this.stream=null,this.setPluginState({recordedVideo:null,capturedSnapshot:null,isRecording:!1,recordingLengthSeconds:0})}getVideoElement(){return this.el.querySelector(".uppy-Webcam-video")}oneTwoThreeSmile(){return new Promise((e,t)=>{let i=this.opts.countdown;const o=setInterval(()=>{if(!this.webcamActive)return clearInterval(o),this.captureInProgress=!1,t(new Error("Webcam is not active"));i?(this.uppy.info(`${i}...`,"warning",800),i--):(clearInterval(o),this.uppy.info(this.i18n("smile"),"success",1500),setTimeout(()=>e(),1500))},1e3)})}async takeSnapshot(){if(!this.captureInProgress){this.captureInProgress=!0;try{await this.opts.onBeforeSnapshot()}catch(e){const t="object"==typeof e?e.message:e;throw this.uppy.info(t,"error",5e3),new Error(`onBeforeSnapshot: ${t}`)}try{const e=await this.getImage();if(this.capturedMediaFile=e,null==e.data)throw new Error("File data is empty");const t=URL.createObjectURL(e.data);this.setPluginState({capturedSnapshot:t}),this.captureInProgress=!1}catch(e){this.captureInProgress=!1,e.isRestriction||this.uppy.log(e)}}}async getImage(){const e=this.getVideoElement();if(!e)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));const t=e.videoWidth,i=e.videoHeight,o=document.createElement("canvas");o.width=t,o.height=i,o.getContext("2d").drawImage(e,0,0);const{restrictions:r}=this.uppy.opts;let s=[];this.opts.preferredImageMimeType?s=[this.opts.preferredImageMimeType]:r.allowedFileTypes&&(s=r.allowedFileTypes.map(R).filter(M));const n=s[0]||"image/jpeg",c=a(n)||"jpg",d=`cam-${Date.now()}.${c}`;return function(e,t){return new Promise(i=>{e.toBlob(i,t,void 0)})}(o,n).then(e=>({source:this.id,name:d,data:new Blob([e],{type:n}),type:n}))}getVideo(){const e=this.recordingChunks.find(e=>e.type?.length>0).type,t=a(e);if(!t)return Promise.reject(new Error(`Could not retrieve recording: Unsupported media type "${e}"`));const i=`webcam-${Date.now()}.${t}`,o=new Blob(this.recordingChunks,{type:e}),r={source:this.id,name:i,data:new Blob([o],{type:e}),type:e};return Promise.resolve(r)}focus(){this.opts.countdown&&setTimeout(()=>{this.uppy.info(this.i18n("smile"),"success",1500)},1e3)}changeVideoSource(e){this.stop(),this.start({deviceId:e})}updateVideoSources(){this.mediaDevices.enumerateDevices().then(e=>{this.setPluginState({videoSources:e.filter(e=>"videoinput"===e.kind)})})}render(){this.webcamActive||this.start();const e=this.getPluginState();return e.cameraReady&&e.hasCamera?(0,o.Y)(y,{...e,onChangeVideoSource:this.changeVideoSource,onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onDiscardRecordedMedia:this.discardRecordedMedia,onSubmit:this.submit,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,showRecordingLength:this.opts.showRecordingLength,showVideoSourceDropdown:this.opts.showVideoSourceDropdown,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:e.isRecording,mirror:this.#e,src:this.stream}):(0,o.Y)(w,{icon:h,i18n:this.i18n,hasCamera:e.hasCamera})}install(){const{mobileNativeCamera:e,modes:t,videoConstraints:i}=this.opts,{target:o}=this.opts;e&&o?this.getTargetPlugin(o)?.setOptions({showNativeVideoCameraButton:k(t,"video-only")||k(t,"video-audio"),showNativePhotoCameraButton:k(t,"picture"),nativeCameraFacingMode:i?.facingMode}):(this.setPluginState({cameraReady:!1,recordingLengthSeconds:0}),o&&this.mount(o,this),this.mediaDevices&&(this.updateVideoSources(),this.mediaDevices.ondevicechange=()=>{if(this.updateVideoSources(),this.stream){let e=!0;const{videoSources:t,currentDeviceId:i}=this.getPluginState();t.forEach(t=>{i===t.deviceId&&(e=!1)}),e&&(this.stop(),this.start())}}))}uninstall(){this.stop(),this.unmount()}onUnmount(){this.stop()}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[359],{8359:function(e,o,i){i.r(o);const r={strings:{},pluralize(e){return 1===e?0:1}};r.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"},addedNumFiles:"Added %{numFiles} file(s)",addingMoreFiles:"Adding more files",additionalRestrictionsFailed:"%{count} additional restrictions were not fulfilled",addMore:"Add more",addMoreFiles:"Add more files",aggregateExceedsSize:"You selected %{size} of files, but maximum allowed size is %{sizeAllowed}",allFilesFromFolderNamed:"All files from folder %{name}",allowAccessDescription:"In order to take pictures or record video with your camera, please allow camera access for this site.",allowAccessTitle:"Please allow access to your camera",allowAudioAccessDescription:"In order to record audio, please allow microphone access for this site.",allowAudioAccessTitle:"Please allow access to your microphone",aspectRatioLandscape:"Crop landscape (16:9)",aspectRatioPortrait:"Crop portrait (9:16)",aspectRatioSquare:"Crop square",authAborted:"Authentication aborted",authenticate:"Connect",authenticateWith:"Connect to %{pluginName}",authenticateWithTitle:"Please authenticate with %{pluginName} to select files",back:"Back",browse:"browse",browseFiles:"browse files",browseFolders:"browse folders",cancel:"Cancel",cancelUpload:"Cancel upload",closeModal:"Close Modal",companionError:"Connection with Companion failed",companionUnauthorizeHint:"To unauthorize to your %{provider} account, please go to %{url}",complete:"Complete",compressedX:"Saved %{size} by compressing images",compressingImages:"Compressing images...",connectedToInternet:"Connected to the Internet",copyLink:"Copy link",copyLinkToClipboardFallback:"Copy the URL below",copyLinkToClipboardSuccess:"Link copied to clipboard.",creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",dashboardTitle:"Uppy Dashboard",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dataUploadedOfTotal:"%{complete} of %{total}",dataUploadedOfUnknown:"%{complete} of unknown",discardMediaFile:"Discard Media",discardRecordedFile:"Discard recorded file",done:"Done",dropHereOr:"Drop here or %{browse}",dropHint:"Drop your files here",dropPasteBoth:"Drop files here, %{browseFiles} or %{browseFolders}",dropPasteFiles:"Drop files here or %{browseFiles}",dropPasteFolders:"Drop files here or %{browseFolders}",dropPasteImportBoth:"Drop files here, %{browseFiles}, %{browseFolders} or import from:",dropPasteImportFiles:"Drop files here, %{browseFiles} or import from:",dropPasteImportFolders:"Drop files here, %{browseFolders} or import from:",editFile:"Edit file",editFileWithFilename:"Edit file %{file}",editImage:"Edit image",editing:"Editing %{file}",emptyFolderAdded:"No files were added from empty folder",encoding:"Encoding...",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file",enterTextToSearch:"Enter text to search for images",enterUrlToImport:"Enter URL to import a file",error:"Error",exceedsSize:"%{file} exceeds maximum allowed size of %{size}",failedToAddFiles:"Failed to add files",failedToFetch:"Companion failed to fetch this URL, please make sure it’s correct",failedToUpload:"Failed to upload %{file}",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},filter:"Filter",finishEditingFile:"Finish editing file",flipHorizontal:"Flip horizontally",folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"},folderAlreadyAdded:'The folder "%{folder}" was already added',generateImage:"Generate image",generateImagePlaceholder:"A serene sunset over a mountain lake, with pine trees reflecting in the water",generating1:"AI is thinking...",generating2:"Crunching pixels...",generating3:"Summoning images...",generating4:"AI is working...",generating5:"Creating magic...",generatingThumbnails:"Generating thumbnails...",import:"Import",importFiles:"Import files from:",importFrom:"Import from %{name}",inferiorSize:"This file is smaller than the allowed size of %{size}",loadedXFiles:"Loaded %{numFiles} files",loading:"Loading...",logIn:"Log in",logOut:"Log out",micDisabled:"Microphone access denied by user",missingRequiredMetaField:"Missing required meta fields",missingRequiredMetaFieldOnFile:"Missing required meta fields in %{fileName}",missingRequiredMetaFields:{0:"Missing required meta field: %{fields}.",1:"Missing required meta fields: %{fields}."},myDevice:"My Device",noAudioDescription:"In order to record audio, please connect a microphone or another audio input device",noAudioTitle:"Microphone Not Available",noCameraDescription:"In order to take pictures or record video, please connect a camera device",noCameraTitle:"Camera Not Available",noDuplicates:"Cannot add the duplicate file '%{fileName}', it already exists",noFilesFound:"You have no files or folders here",noInternetConnection:"No Internet connection",noMoreFilesAllowed:"Cannot add more files",noSearchResults:"Unfortunately, there are no results for this search",openFolderNamed:"Open folder %{name}",pause:"Pause",paused:"Paused",pauseUpload:"Pause upload",pickFiles:"Pick files",pickPhotos:"Pick photos",pleaseWait:"Please wait",pluginNameAudio:"Audio",pluginNameBox:"Box",pluginNameCamera:"Camera",pluginNameDropbox:"Dropbox",pluginNameFacebook:"Facebook",pluginNameGoogleDrive:"Google Drive",pluginNameGoogleDrivePicker:"Google Drive",pluginNameGooglePhotosPicker:"Google Photos",pluginNameInstagram:"Instagram",pluginNameOneDrive:"OneDrive",pluginNameScreenCapture:"Screencast",pluginNameUnsplash:"Unsplash",pluginNameUrl:"Link",pluginNameWebdav:"WebDAV",pluginNameZoom:"Zoom",pluginWebdavInputLabel:"WebDAV URL for a file (e.g. from ownCloud or Nextcloud)",poweredBy:"Powered by %{uppy}",processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},recording:"Recording",recordingLength:"Recording length %{recording_length}",recordingStoppedMaxSize:"Recording stopped because the file size is about to exceed the limit",recordVideoBtn:"Record Video",recoveredAllFiles:"We restored all files. You can now resume the upload.",recoveredXFiles:{0:"We could not fully recover 1 file. Please re-select it and resume the upload.",1:"We could not fully recover %{smart_count} files. Please re-select them and resume the upload."},removeFile:"Remove file",reSelect:"Re-select",resetFilter:"Reset filter",resetSearch:"Reset search",resume:"Resume",resumeUpload:"Resume upload",retry:"Retry",retryUpload:"Retry upload",revert:"Reset",rotate:"Rotate 90°",save:"Save",saveChanges:"Save changes",search:"Search",searchImages:"Search for images",selectX:{0:"Select %{smart_count}",1:"Select %{smart_count}"},sessionRestored:"Session restored",showErrorDetails:"Show error details",signInWithGoogle:"Sign in with Google",smile:"Smile!",startAudioRecording:"Begin audio recording",startCapturing:"Begin screen capturing",startRecording:"Begin video recording",stopAudioRecording:"Stop audio recording",stopCapturing:"Stop screen capturing",stopRecording:"Stop video recording",streamActive:"Stream active",streamPassive:"Stream passive",submitRecordedFile:"Submit recorded file",takePicture:"Take a picture",takePictureBtn:"Take Picture",takeScreenshot:"Take Screenshot",unnamed:"Unnamed",upload:"Upload",uploadComplete:"Upload complete",uploadFailed:"Upload failed",uploading:"Uploading",uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},uploadPaused:"Upload paused",uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it.",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"},xTimeLeft:"%{time} left",youCanOnlyUploadFileTypes:"You can only upload: %{types}",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"},zoomIn:"Zoom in",zoomOut:"Zoom out"},"undefined"!=typeof Uppy&&(globalThis.Uppy.locales.en_US=r),o.default=r}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[50],{6050:function(e,r,i){i.r(r);const s={strings:{},pluralize(e){return e<=1?0:1}};s.strings={addBulkFilesFailed:{0:"L’ajout de %{smart_count} fichier a échoué en raison d’une erreur interne",1:"L’ajout de %{smart_count} fichiers a échoué en raison d’erreurs internes"},addedNumFiles:"%{numFiles} fichier(s) ajouté(s)",addingMoreFiles:"Ajout de fichiers",additionalRestrictionsFailed:"%{count} restrictions supplémentaires n’ont pas été respectées",addMore:"Ajouter d’autres",addMoreFiles:"Ajouter d’autres fichiers",aggregateExceedsSize:"Vous avez sélectionné %{size} de fichiers, mais la taille maximale autorisée est %{sizeAllowed}",allFilesFromFolderNamed:"Tous les fichiers du dossier %{name}",allowAccessDescription:"Pour prendre des photos ou enregistrer une vidéo, veuillez autoriser l’accès à votre caméra pour ce site.",allowAccessTitle:"Veuillez autoriser l’accès à votre caméra",allowAudioAccessDescription:"Pour enregistrer de l’audio, veuillez autoriser l’accès au microphone pour ce site.",allowAudioAccessTitle:"Veuillez autoriser l’accès au microphone",aspectRatioLandscape:"Recadrer en paysage (16:9)",aspectRatioPortrait:"Recadrer en portrait (9:16)",aspectRatioSquare:"Recadrer pour obtenir une photo carrée",authAborted:"Authentification interrompue",authenticateWith:"Se connecter à %{pluginName}",authenticateWithTitle:"Veuillez vous authentifier avec %{pluginName} pour sélectionner les fichiers",back:"Retour",browse:"naviguer",browseFiles:"naviguer dans les fichiers",browseFolders:"naviguer dans les dossiers",cancel:"Annuler",cancelUpload:"Annuler le téléversement",closeModal:"Fermer la fenêtre",companionError:"Connexion à Companion a échoué",companionUnauthorizeHint:"Pour vous déconnecter de votre compte %{provider}, veuillez aller à %{url}",complete:"Terminé",compressedX:"%{size} économisé(s) par la compression",compressingImages:"Compression des images…",connectedToInternet:"Connecté à Internet",copyLink:"Copier le lien",copyLinkToClipboardFallback:"Copier le lien ci-dessous",copyLinkToClipboardSuccess:"Lien copié",creatingAssembly:"Préparation du téléversement…",creatingAssemblyFailed:"Transloadit: Impossible de créer Assembly",dashboardTitle:"Téléverseur de fichiers",dashboardWindowTitle:"Fenêtre de téléversement de fichiers (Appuyez sur Échap pour fermer)",dataUploadedOfTotal:"%{complete} sur %{total}",discardRecordedFile:"Supprimer le fichier enregistré",done:"Terminé",dropHint:"Déposez vos fichiers ici",dropPasteBoth:"Déposer les fichiers ici, coller ou %{browse}",dropPasteFiles:"Déposer les fichiers ici, coller ou %{browse}",dropPasteFolders:"Déposer les fichiers ici, coller ou %{browse}",dropPasteImportBoth:"Déposer les fichiers ici, coller, %{browse} ou importer de",dropPasteImportFiles:"Déposer les fichiers ici, coller, %{browse} ou importer de",dropPasteImportFolders:"Déposer les fichiers ici, coller, %{browse} ou importer de",editFile:"Modifier le fichier",editImage:"Modifier l’image",editFileWithFilename:"Modifier le fichier %{file}",editing:"Modification en cours de %{file}",emptyFolderAdded:"Aucun fichier n’a été ajouté depuis un dossier vide",encoding:"Traitement…",enterCorrectUrl:"Lien incorrect: Assurez-vous que vous entrez un lien direct vers le fichier",enterTextToSearch:"Entrez un texte pour rechercher des images",enterUrlToImport:"Entrez le lien pour importer un fichier",error:"Erreur",exceedsSize:"Le fichier %{file} dépasse la taille maximale autorisée de %{size}",failedToFetch:"Companion a échoué à récupérer ce lien, assurez-vous qu’il est correct",failedToUpload:"Le téléversement de %{file} a échoué",fileSource:"Fichier source: %{name}",filesUploadedOfTotal:{0:"%{complete} sur %{smart_count} fichier téléversé",1:"%{complete} sur %{smart_count} fichiers téléversés"},filter:"Filtrer",finishEditingFile:"Terminer l’édition du fichier",flipHorizontal:"Retourner horizontalement",folderAdded:{0:"%{smart_count} fichier ajouté de %{folder}",1:"%{smart_count} fichiers ajoutés de %{folder}"},folderAlreadyAdded:'Le dossier "%{folder}" a déjà été ajouté',generatingThumbnails:"Génération des vignettes…",import:"Importer",importFiles:"Importer des fichiers depuis :",importFrom:"Importer de %{name}",inferiorSize:"Ce fichier est plus petit que la taille autorisée de %{size}",loadedXFiles:"Chargé %{numFiles} fichiers",loading:"Chargement…",logOut:"Déconnexion",micDisabled:"Accès au micro refusé par l’utilisateur",missingRequiredMetaField:"Champ méta requis manquant",missingRequiredMetaFieldOnFile:"Champs méta requis manquants dans %{fileName}",missingRequiredMetaFields:{0:"Champ méta requis manquant : %{fields}.",1:"Champs méta requis manquants : %{fields}."},myDevice:"Mon Appareil",noAudioDescription:"Pour enregistrer de l’audio, veuillez connecter un microphone ou un autre appareil d’entrée audio",noAudioTitle:"Microphone non disponible",noCameraDescription:"Pour prendre des photos ou enregistrer une vidéo, veuillez connecter une caméra",noDuplicates:'Impossible d’ajouter le fichier "%{fileName}", il existe déjà',noFilesFound:"Vous n’avez aucun fichier ou dossier ici",noInternetConnection:"Pas de connexion à Internet",noMoreFilesAllowed:"Impossible d’ajouter de nouveaux fichiers: en cours de chargement ",noSearchResults:"Malheureusement, il n’y a aucun résultat pour cette recherche",openFolderNamed:"Ouvrir %{name}",pause:"Pause",pauseUpload:"Mettre en pause le téléversement",paused:"En pause",poweredBy:"Propulsé par %{uppy}",processingXFiles:{0:"Traitement de %{smart_count} fichier",1:"Traitement de %{smart_count} fichiers"},recording:"Enregistrement",recordingLength:"Durée d’enregistrement %{recording_length}",recordingStoppedMaxSize:"L’enregistrement s’est arrété car la taille du fichier dépasse la limite",recordVideoBtn:"Enregistrer une vidéo",recoveredAllFiles:"Nous avons restauré tous les fichiers. Vous pouvez maintenant reprendre le téléversement.",recoveredXFiles:{0:"Nous n’avons pas pu récupérer entièrement 1 fichier. Veuillez le resélectionner et reprendre le téléversement.",1:"Nous n’avons pas pu récupérer entièrement %{smart_count} fichiers. Veuillez les resélectionner et reprendre le téléversement."},removeFile:"Effacer le fichier %{file}",resetFilter:"Réinitialiser filtre",resume:"Reprendre",resumeUpload:"Reprendre le téléversement",retry:"Réessayer",retryUpload:"Réessayer le téléversement",reSelect:"Resélectionner",save:"Sauvegarder",saveChanges:"Sauvegarder les modifications",selectFileNamed:"Sélectionner le fichier %{name}",selectX:{0:"Sélectionner %{smart_count}",1:"Sélectionner %{smart_count}"},sessionRestored:"Session restaurée",signInWithGoogle:"Se connecter avec Google",smile:"Souriez !",startRecording:"Commencer l’enregistrement vidéo",stopRecording:"Arrêter l’enregistrement vidéo",streamActive:"Stream actif",streamPassive:"Stream passif",submitRecordedFile:"Envoyer la vidéo enregistrée",takePicture:"Prendre une photo",takePictureBtn:"Prendre une photo",timedOut:"Téléversement bloqué durant %{seconds} secondes, annulation.",unselectFileNamed:"Désélectionner le fichier %{name}",upload:"Téléverser",uploadComplete:"Téléversement terminé",uploadFailed:"Le téléversement a échoué",uploadPaused:"Téléversement mis en pause",uploadStalled:"Téléversement bloqué depuis %{seconds} secondes. Il est peut-être nécessaire de recommencer l’opération.",uploadXFiles:{0:"Téléverser %{smart_count} fichier",1:"Téléverser %{smart_count} fichiers"},uploadXNewFiles:{0:"Téléverser +%{smart_count} fichier",1:"Téléverser +%{smart_count} fichiers"},uploading:"Téléversement en cours",uploadingXFiles:{0:"Téléversement de %{smart_count} fichier",1:"Téléversement de %{smart_count} fichiers"},xFilesSelected:{0:"%{smart_count} fichier sélectionné",1:"%{smart_count} fichiers sélectionnés"},xMoreFilesAdded:{0:"%{smart_count} autre fichier ajouté",1:"%{smart_count} autres fichiers ajoutés"},xTimeLeft:"%{time} restantes",youCanOnlyUploadFileTypes:"Vous pouvez seulement téléverser: %{types}",youCanOnlyUploadX:{0:"Vous pouvez seulement téléverser %{smart_count} fichier",1:"Vous pouvez seulement téléverser %{smart_count} fichiers"},youHaveToAtLeastSelectX:{0:"Vous devez sélectionner au moins %{smart_count} fichier",1:"Vous devez sélectionner au moins %{smart_count} fichiers"}},"undefined"!=typeof Uppy&&(globalThis.Uppy.locales.fr_FR=s),r.default=s}}]);
@@ -0,0 +1,2 @@
1
+ /*! For license information please see 51.24437974.chunk.js.LICENSE.txt */
2
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[51],{2729:function(t,e,s){s.d(e,{A:function(){return o}});var n=s(9491);class o{uppy;opts;id;defaultLocale;i18n;i18nArray;type;VERSION;constructor(t,e){this.uppy=t,this.opts=e??{}}getPluginState(){const{plugins:t}=this.uppy.getState();return t?.[this.id]||{}}setPluginState(t){const{plugins:e}=this.uppy.getState();this.uppy.setState({plugins:{...e,[this.id]:{...e[this.id],...t}}})}setOptions(t){this.opts={...this.opts,...t},this.setPluginState(void 0),this.i18nInit()}i18nInit(){const t=new n.A([this.defaultLocale,this.uppy.locale,this.opts.locale]);this.i18n=t.translate.bind(t),this.i18nArray=t.translateArray.bind(t),this.setPluginState(void 0)}addTarget(t){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")}install(){}uninstall(){}update(t){}afterUpdate(){}}},4528:function(t,e,s){s.d(e,{A:function(){return n}});class n{#t;#e=[];constructor(t){this.#t=t}on(t,e){return this.#e.push([t,e]),this.#t.on(t,e)}remove(){for(const[t,e]of this.#e.splice(0))this.#t.off(t,e)}onFilePause(t,e){this.on("upload-pause",(s,n)=>{t===s?.id&&e(n)})}onFileRemove(t,e){this.on("file-removed",s=>{t===s.id&&e(s.id)})}onPause(t,e){this.on("upload-pause",(s,n)=>{t===s?.id&&e(n)})}onRetry(t,e){this.on("upload-retry",s=>{t===s?.id&&e()})}onRetryAll(t,e){this.on("retry-all",()=>{this.#t.getFile(t)&&e()})}onPauseAll(t,e){this.on("pause-all",()=>{this.#t.getFile(t)&&e()})}onCancelAll(t,e){this.on("cancel-all",(...s)=>{this.#t.getFile(t)&&e(...s)})}onResumeAll(t,e){this.on("resume-all",()=>{this.#t.getFile(t)&&e()})}}},6681:function(t,e){class s extends Error{cause;isNetworkError;request;constructor(t,e=null){super("This looks like a network error, the endpoint might be blocked by an internet provider or a firewall."),this.cause=t,this.isNetworkError=!0,this.request=e}}e.A=s},9491:function(t,e,s){function n(t,e,s){const n=[];return t.forEach(t=>"string"!=typeof t?n.push(t):e[Symbol.split](t).forEach((t,e,o)=>{""!==t&&n.push(t),e<o.length-1&&n.push(s)})),n}function o(t,e){const s=/\$/g;let o=[t];if(null==e)return o;for(const t of Object.keys(e))if("_"!==t){let r=e[t];"string"==typeof r&&(r=s[Symbol.replace](r,"$$$$")),o=n(o,new RegExp(`%\\{${t}\\}`,"g"),r)}return o}s.d(e,{A:function(){return i}});const r=t=>{throw new Error(`missing string: ${t}`)};class i{locale;constructor(t,{onMissingKey:e=r}={}){this.locale={strings:{},pluralize(t){return 1===t?0:1}},Array.isArray(t)?t.forEach(this.#s,this):this.#s(t),this.#n=e}#n;#s(t){if(!t?.strings)return;const e=this.locale;Object.assign(this.locale,{strings:{...e.strings,...t.strings},pluralize:t.pluralize||e.pluralize})}translate(t,e){return this.translateArray(t,e).join("")}translateArray(t,e){let s=this.locale.strings[t];if(null==s&&(this.#n(t),s=t),"object"==typeof s){if(e&&void 0!==e.smart_count)return o(s[this.locale.pluralize(e.smart_count)],e);throw new Error("Attempted to use a string with plural forms, but no value was given for %{smart_count}")}if("string"!=typeof s)throw new Error("string was not a string");return o(s,e)}}},8284:function(t,e,s){s.d(e,{S:function(){return i},e:function(){return r}});const n=t=>"error"in t&&!!t.error,o=t=>t.progress.uploadComplete;function r(t){return t.filter(t=>!n(t)&&!o(t))}function i(t){return t.filter(t=>!t.progress?.uploadStarted||!t.isRestored)}},2289:function(t,e,s){function n(t,e){return!0===t?Object.keys(e):Array.isArray(t)?t:[]}s.d(e,{A:function(){return n}})},7853:function(t,e){e.A=function(t){return!!t&&4===t.readyState&&0===t.status}},9051:function(t,e,s){s.r(e),s.d(e,{default:function(){return g}});var n=s(2729),o=s(4528),r=s(7853),i=s(6681);class a{#o=[];#r=0;#i;#a=!1;constructor(t){const e=t?.concurrency;this.#i="number"!=typeof e||0===e?1/0:e}add(t){const e=new AbortController;let s,n;const o=new Promise((t,e)=>{s=t,n=e}),r={run:()=>t(e.signal),resolve:s,reject:n,controller:e};return e.signal.addEventListener("abort",()=>{const t=this.#o.indexOf(r);-1!==t&&(this.#o.splice(t,1),n(e.signal.reason??new DOMException("Aborted","AbortError")))},{once:!0}),o.abort=t=>{e.abort(t??new DOMException("Aborted","AbortError"))},o.abortOn=t=>{if(t){const e=()=>o.abort(t.reason);t.addEventListener("abort",e,{once:!0}),o.then(()=>t.removeEventListener("abort",e),()=>t.removeEventListener("abort",e))}return o},!this.#a&&this.#r<this.#i?this.#l(r):this.#o.push(r),o}#l(t){if(this.#r++,t.controller.signal.aborted)return this.#r--,t.reject(t.controller.signal.reason??new DOMException("Aborted","AbortError")),void this.#u();let e;try{e=t.run()}catch(t){e=Promise.reject(t)}e.then(e=>{t.controller.signal.aborted?t.reject(t.controller.signal.reason??new DOMException("Aborted","AbortError")):t.resolve(e)},e=>{t.reject(e)}).finally(()=>{this.#r--,this.#u()})}#u(){queueMicrotask(()=>{if(!(this.#a||this.#r>=this.#i))for(;this.#o.length>0;){const t=this.#o.shift();if(!t.controller.signal.aborted)return void this.#l(t)}})}pause(){this.#a=!0}resume(){this.#a=!1;const t=this.#i-this.#r;for(let e=0;e<t;e++)this.#u()}clear(t){const e=this.#o.splice(0),s=t??new DOMException("Cleared","AbortError");for(const t of e)t.controller.abort(s),t.reject(s)}get concurrency(){return this.#i}set concurrency(t){if(this.#i="number"!=typeof t||0===t?1/0:t,!this.#a){const t=this.#i-this.#r;for(let e=0;e<t;e++)this.#u()}}get pending(){return this.#o.length}get running(){return this.#r}get isPaused(){return this.#a}wrapPromiseFunction(t){return(...e)=>this.add(s=>t(...e))}}var l=class{#p;#d=!1;#h;#c;constructor(t,e){this.#c=t,this.#h=()=>e(t)}progress(){this.#d||this.#c>0&&(clearTimeout(this.#p),this.#p=setTimeout(this.#h,this.#c))}done(){this.#d||(clearTimeout(this.#p),this.#p=void 0,this.#d=!0)}};const u=()=>{};var p=s(2289),d=s(8284),h={strings:{uploadStalled:"Upload has not made any progress for %{seconds} seconds. You may want to retry it."}};function c(t,e){let s=e;return s||(s=new Error("Upload error")),"string"==typeof s&&(s=new Error(s)),s instanceof Error||(s=Object.assign(new Error("Upload error"),{data:s})),(0,r.A)(t)?(s=new i.A(s,t),s):(s.request=t,s)}function f(t){return t.data.slice(0,t.data.size,t.meta.type)}const y={formData:!0,fieldName:"file",method:"post",allowedMetaFields:!0,bundle:!1,headers:{},timeout:3e4,limit:5,withCredentials:!1,responseType:""};class g extends n.A{static VERSION="5.2.0";#f;#o;uploaderEvents;constructor(t,e){if(super(t,{...y,fieldName:e.bundle?"files[]":"file",...e}),this.type="uploader",this.id=this.opts.id||"XHRUpload",this.defaultLocale=h,this.i18nInit(),this.#o=new a({concurrency:this.opts.limit}),this.opts.bundle&&!this.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");if(this.opts.bundle&&"function"==typeof this.opts.headers)throw new Error("`opts.headers` can not be a function when the `bundle: true` option is set.");if(void 0===e?.allowedMetaFields&&"metaFields"in this.opts)throw new Error("The `metaFields` option has been renamed to `allowedMetaFields`.");this.uploaderEvents=Object.create(null),this.#f=t=>async(e,s)=>{try{const n=await function(t,e={}){const{body:s=null,headers:n={},method:o="GET",onBeforeRequest:r=u,onUploadProgress:a=u,shouldRetry:p=()=>!0,onAfterResponse:d=u,onTimeout:h=u,responseType:c,retries:f=3,signal:y=null,timeout:g=3e4,withCredentials:m=!1}=e,b=t=>.3*2**(t-1)*1e3,w=new l(g,h);return function e(l=0){return new Promise(async(u,h)=>{const g=new XMLHttpRequest,A=t=>{p(g)&&l<f?setTimeout(()=>{e(l+1).then(u,h)},b(l)):(w.done(),h(t))};function v(){g.abort(),h(new DOMException("Aborted","AbortError"))}g.open(o,t,!0),g.withCredentials=m,c&&(g.responseType=c),g.onload=async()=>{try{await d(g,l)}catch(t){return t.request=g,void A(t)}g.status>=200&&g.status<300?(w.done(),u(g)):p(g)&&l<f?setTimeout(()=>{e(l+1).then(u,h)},b(l)):(w.done(),h(new i.A(g.statusText,g)))},g.onerror=()=>A(new i.A(g.statusText,g)),g.upload.onprogress=t=>{w.progress(),a(t)},n&&Object.keys(n).forEach(t=>{g.setRequestHeader(t,n[t])}),y?.addEventListener("abort",v),y?.aborted?v():(await r(g,l),g.send(s))})}()}(e,{...s,onBeforeRequest:(e,s)=>this.opts.onBeforeRequest?.(e,s,t),shouldRetry:this.opts.shouldRetry,onAfterResponse:this.opts.onAfterResponse,onTimeout:e=>{const s=Math.ceil(e/1e3),n=new Error(this.i18n("uploadStalled",{seconds:s}));this.uppy.emit("upload-stalled",n,t)},onUploadProgress:e=>{if(e.lengthComputable)for(const{id:s}of t){const t=this.uppy.getFile(s);null!=t&&this.uppy.emit("upload-progress",t,{uploadStarted:t.progress.uploadStarted??0,bytesUploaded:e.loaded/e.total*t.size,bytesTotal:t.size})}}});let o=await(this.opts.getResponseData?.(n));if("json"===n.responseType)o??=n.response;else try{o??=JSON.parse(n.responseText)}catch(t){throw new Error("@uppy/xhr-upload expects a JSON response (with a `url` property). To parse non-JSON responses, use `getResponseData` to turn your response into JSON.",{cause:t})}const r="string"==typeof o?.url?o.url:void 0;for(const{id:e}of t)this.uppy.emit("upload-success",this.uppy.getFile(e),{status:n.status,body:o,uploadURL:r});return n}catch(e){if("AbortError"===e.name)return;const s=e.request;for(const n of t)this.uppy.emit("upload-error",this.uppy.getFile(n.id),c(s,e),s);throw e}}}getOptions(t){const e=this.uppy.getState().xhrUpload,{headers:s}=this.opts,n={...this.opts,...e||{},...t.xhrUpload||{},headers:{}};return"function"==typeof s?n.headers=s(t):Object.assign(n.headers,this.opts.headers),e&&Object.assign(n.headers,e.headers),t.xhrUpload&&Object.assign(n.headers,t.xhrUpload.headers),n}addMetadata(t,e,s){(0,p.A)(s.allowedMetaFields,e).forEach(s=>{const n=e[s];Array.isArray(n)?n.forEach(e=>t.append(s,e)):t.append(s,n)})}createFormDataUpload(t,e){const s=new FormData;this.addMetadata(s,t.meta,e);const n=f(t);return t.name?s.append(e.fieldName,n,t.meta.name):s.append(e.fieldName,n),s}createBundledUpload(t,e){const s=new FormData,{meta:n}=this.uppy.getState();return this.addMetadata(s,n,e),t.forEach(t=>{const e=this.getOptions(t),n=f(t);t.name?s.append(e.fieldName,n,t.name):s.append(e.fieldName,n)}),s}async#y(t){const e=new o.A(this.uppy),s=new AbortController;e.onFileRemove(t.id,()=>s.abort()),e.onCancelAll(t.id,()=>s.abort());try{await this.#o.add(async e=>{const n=this.getOptions(t),o=this.#f([t]),r=n.formData?this.createFormDataUpload(t,n):t.data;return o("string"==typeof n.endpoint?n.endpoint:await n.endpoint(t),{...n,body:r,signal:AbortSignal.any([e,s.signal])})})}catch(t){if("AbortError"===t.name)return;throw t}finally{e.remove()}}async#g(t){const e=new AbortController;function s(){e.abort()}this.uppy.once("cancel-all",s);try{await this.#o.add(async s=>{const n=this.uppy.getState().xhrUpload??{},o=this.#f(t),r=this.createBundledUpload(t,{...this.opts,...n});return o("string"==typeof this.opts.endpoint?this.opts.endpoint:await this.opts.endpoint(t),{...this.opts,body:r,signal:AbortSignal.any([s,e.signal])})})}catch(t){if("AbortError"===t.name)return;throw t}finally{this.uppy.off("cancel-all",s)}}#m(t){const e=this.getOptions(t),s=(0,p.A)(e.allowedMetaFields,t.meta);return{...t.remote?.body,protocol:"multipart",endpoint:e.endpoint,size:t.data.size,fieldname:e.fieldName,metadata:Object.fromEntries(s.map(e=>[e,t.meta[e]])),httpMethod:e.method,useFormData:e.formData,headers:e.headers}}async#b(t){await Promise.allSettled(t.map(t=>{if(t.isRemote){const e=()=>this.#o,s=new AbortController,n=e=>{e.id===t.id&&s.abort()};return this.uppy.on("file-removed",n),this.uppy.getRequestClientForFile(t).uploadRemoteFile(t,this.#m(t),{signal:s.signal,getQueue:e}).finally(()=>{this.uppy.off("file-removed",n)})}return this.#y(t)}))}#w=async t=>{if(0===t.length)return void this.uppy.log("[XHRUpload] No files to upload!");0===this.opts.limit&&this.uppy.log("[XHRUpload] When uploading multiple files at once, consider setting the `limit` option (to `10` for example), to limit the number of concurrent uploads, which helps prevent memory and network issues: https://uppy.io/docs/xhr-upload/#limit-0","warning"),this.uppy.log("[XHRUpload] Uploading...");const e=this.uppy.getFilesByIds(t),s=(0,d.e)(e),n=(0,d.S)(s);if(this.uppy.emit("upload-start",n),this.opts.bundle){if(s.some(t=>t.isRemote))throw new Error("Can’t upload remote files when the `bundle: true` option is set");if("function"==typeof this.opts.headers)throw new TypeError("`headers` may not be a function when the `bundle: true` option is set");await this.#g(s)}else await this.#b(s)};install(){if(this.opts.bundle){const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!1}})}this.uppy.addUploader(this.#w)}uninstall(){if(this.opts.bundle){const{capabilities:t}=this.uppy.getState();this.uppy.setState({capabilities:{...t,individualCancellation:!0}})}this.uppy.removeUploader(this.#w)}}}}]);
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Takes a string with placeholder variables like `%{smart_count} file selected`
3
+ * and replaces it with values from options `{smart_count: 5}`
4
+ *
5
+ * @license https://github.com/airbnb/polyglot.js/blob/master/LICENSE
6
+ * taken from https://github.com/airbnb/polyglot.js/blob/master/lib/polyglot.js#L299
7
+ *
8
+ * @param phrase that needs interpolation, with placeholders
9
+ * @param options with values that will be used to replace placeholders
10
+ */
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[543],{9543:function(i,o,s){s.r(o),s.d(o,{default:function(){return c}});var t=s(9028),e=s(50),r=s(6317),n=s(5538),a=s(760),l=s(8653),p=(s(5181),"5.1.0"),h={strings:{pluginNameDropbox:"Dropbox"}};class c extends a.A{static VERSION=p;icon;provider;view;storage;files;rootFolderId=null;constructor(i,o){super(i,o),this.id=this.opts.id||"Dropbox",this.type="acquirer",this.storage=this.opts.storage||e,this.files=[],this.icon=()=>(0,t.Y)("svg",{className:"uppy-DashboardTab-iconDropbox","aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:(0,t.Y)("path",{d:"M10.5 7.5L5 10.955l5.5 3.454 5.5-3.454 5.5 3.454 5.5-3.454L21.5 7.5 16 10.955zM10.5 21.319L5 17.864l5.5-3.455 5.5 3.455zM16 17.864l5.5-3.455 5.5 3.455-5.5 3.455zM16 25.925l-5.5-3.455 5.5-3.454 5.5 3.454z",fill:"currentcolor",fillRule:"nonzero"})}),this.opts.companionAllowedHosts=(0,r.A)(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new n.A(i,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"dropbox",pluginId:this.id,supportsRefreshToken:!0}),this.defaultLocale=h,this.i18nInit(),this.title=this.i18n("pluginNameDropbox"),this.render=this.render.bind(this)}install(){this.view=new l.A(this,{provider:this.provider,loadAllFiles:!0,virtualList:!0,supportsSearch:!0});const{target:i}=this.opts;i&&this.mount(i,this)}uninstall(){this.view.tearDown(),this.unmount()}render(i){return this.view.render(i)}}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[558],{6558:function(A,s,i){i.r(s),i.d(s,{default:function(){return c}});var e=i(9028),a=i(50),n=i(6317),r=i(5538),t=i(760),o=i(8653),l=(i(5181),"5.1.0"),p={strings:{pluginNameInstagram:"Instagram"}};class c extends t.A{static VERSION=l;icon;provider;view;storage;files;rootFolderId="recent";constructor(A,s){super(A,s),this.type="acquirer",this.files=[],this.storage=this.opts.storage||a,this.id=this.opts.id||"Instagram",this.icon=()=>(0,e.FD)("svg",{"aria-hidden":"true",focusable:"false",width:"32",height:"32",viewBox:"0 0 32 32",children:[(0,e.Y)("defs",{children:(0,e.Y)("path",{d:"M16.825 5l.483-.001.799.002c1.168.005 1.598.021 2.407.057 1.17.05 1.97.235 2.67.506.725.28 1.34.655 1.951 1.265.613.61.99 1.223 1.273 1.946.273.7.46 1.498.516 2.67l.025.552.008.205c.029.748.037 1.51.042 3.777l.001.846v.703l-.001.398a50.82 50.82 0 01-.058 2.588c-.05 1.17-.235 1.97-.506 2.67a5.394 5.394 0 01-1.265 1.951c-.61.613-1.222.99-1.946 1.273-.699.273-1.498.46-2.668.516-.243.012-.451.022-.656.03l-.204.007c-.719.026-1.512.034-3.676.038l-.847.001h-1.1a50.279 50.279 0 01-2.587-.059c-1.171-.05-1.971-.235-2.671-.506a5.394 5.394 0 01-1.951-1.265 5.385 5.385 0 01-1.272-1.946c-.274-.699-.46-1.498-.517-2.668a88.15 88.15 0 01-.03-.656l-.007-.205c-.026-.718-.034-1.512-.038-3.674v-2.129c.006-1.168.022-1.597.058-2.406.051-1.171.235-1.971.506-2.672a5.39 5.39 0 011.265-1.95 5.381 5.381 0 011.946-1.272c.699-.274 1.498-.462 2.669-.517l.656-.03.204-.007c.718-.026 1.511-.034 3.674-.038zm.678 1.981h-1.226l-.295.001c-2.307.005-3.016.013-3.777.043l-.21.009-.457.02c-1.072.052-1.654.232-2.042.383-.513.2-.879.44-1.263.825a3.413 3.413 0 00-.82 1.267c-.15.388-.33.97-.375 2.043a48.89 48.89 0 00-.056 2.482v.398 1.565c.006 2.937.018 3.285.073 4.444.05 1.073.231 1.654.382 2.043.2.512.44.878.825 1.263.386.383.753.621 1.267.82.388.15.97.328 2.043.374.207.01.388.017.563.024l.208.007a63.28 63.28 0 002.109.026h1.564c2.938-.006 3.286-.019 4.446-.073 1.071-.051 1.654-.232 2.04-.383.514-.2.88-.44 1.264-.825.384-.386.622-.753.82-1.266.15-.389.328-.971.375-2.044.039-.88.054-1.292.057-2.723v-1.15-.572c-.006-2.936-.019-3.284-.074-4.445-.05-1.071-.23-1.654-.382-2.04-.2-.515-.44-.88-.825-1.264a3.405 3.405 0 00-1.267-.82c-.388-.15-.97-.328-2.042-.375a48.987 48.987 0 00-2.535-.056zm-1.515 3.37a5.65 5.65 0 11.021 11.299 5.65 5.65 0 01-.02-11.3zm.004 1.982a3.667 3.667 0 10.015 7.334 3.667 3.667 0 00-.015-7.334zm5.865-3.536a1.32 1.32 0 11.005 2.64 1.32 1.32 0 01-.005-2.64z",id:"a"})}),(0,e.FD)("g",{fill:"none","fill-rule":"evenodd",children:[(0,e.Y)("mask",{id:"b",fill:"#fff",children:(0,e.Y)("use",{xlinkHref:"#a"})}),(0,e.Y)("image",{mask:"url(#b)",x:"4",y:"4",width:"24",height:"24",xlinkHref:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACwAAAAsCAYAAAAehFoBAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAALKADAAQAAAABAAAALAAAAAD8buejAAALZklEQVRYCVWZC2LbNhAFCRKykvP0bD1506SxRKIzbwHJoU3jv5h9WICU3P7+6zlG2zZvr8s/rW1tN7U0rMll8aDYufdzbLfc1JHmpv3jpPy8tsO+3O2s/O6YMSjTl/qdCds4mIIG60m8vdq2Z+phm2V4vAb9+o7BbZeuoM0NyYazvTvbvlN1MGjHUAesZ/IWWOsCeF0BOwAK4ITR0WYd/QKHEPv2DEymmorZtiubjOHEMYEzXmC9GMxu+95Kz+kuwxjDBKb8iUoCAdqZoAeyALreW6ZNx9Y4Jz8cLwjTZOEoR+HU05k2RzgP2iafGgfZiEdZbEr94zpX/xkPtDtGAxF+LRcgTsp9CAZg0rnEnXmPqFshY5vLnVWxLXO/bah2sZQgBZppGSe8NbjNPN5kc/WbIYEn8U+jXCOezT4zfgS1eoVEhceVeK74Fe4N6CoYEoLWykzHsd+GMAUqdTTVvvqT1uWqB3lVCLb12/ORAe8/5Zu9mp7lqoEFUCAFDIxqz7i1bq2AY1U9jqq2QK/7DYl+1AeZlAFcEc+U/jkRUqsvCHQ/nyGvjrOl6EuZWRWVGCKUMCkntQ5o+u2AZ3OxakbTcoBZnY0xhgGCUM4Kp1xtBTnBnXM5ASRms/Fs7d9OpX8bXN45pibQY/ML1MmA5G9CINBuCpdftexr6i2c5qd9J441LNJm3zk1GVusJ7v6mPJ7HPxJR0Li/vg9O1XHTEgvsQoSgExU0NnlLF0paK+6d06aOMKE2nCKV0ofNw4WsWmLsWrv6lPLnhGpr9E137QkHOMB/jh/T8MOqOadXarR44zPBW5NvDccnBxVmdK81+7RQ5p6qnQoRDZPh9+xWj0N2XpqxX1HzMty9UlFnKya/h3gulziAsyxwkSmpTIPB8vagKLyktRdDuBEHNGZMm4oCFWgjq31WPHpaC93gGNqpOpP4Ez4spa+nMNvhTWcuPKAJ79fqIxVoUvdjEG9qSy2WhpQlz61yG/gnKEA25IrIOYK6DIsQs2EE9LR/sTKq38Nd1y/X//FXG0QDHkEqSz3EYVV2dhb00rgLPSDcqmrScs55NNOD2zVqKmYnYTFnkACp520dkW5vBxK99BVzr792/iZ+VVo92UkKU2oG5WFTb6mNiA1H2C8KC0E44qaQleR3EQvQNwLrECOVAiSwM5gpF7nvDND0lZvYuQ9JbZfqdTrqCgwMcVrRS0z9QkLu9NWmkgEHb8p2zDRylj9VWA3lXD2vObEdWpT3w5MiFqQ1W/lteG4eipastxv2w+TeTBP0ypK84HiOW9fUzLcjRDwCW2b2VxmnGSKTX6uRSwMnC9YX4l05Mh2uwI+QVWdWUOSTWd5Xjjf7/tPYk2stSh053XTGN5RJMCMSajMcS8Trn3j/E1ajthlxCkmJXVi47PSUsyyq+jyexsayQNuv5GVYJaszprNsQD3RkgYiy49kFl2JlJJxlf8Uu/lpkq7+aWqzEzjr5cTVpFaJvSVr8AKRtiTlVPFk5t1nO30W+o6jrbAk76kxFa/tX+dom4C1wDPk03gqCw8HTBSxx4FHxIA+mh2pM3rKu5SNqBAuOSZnHzsB9JwW7DV/ge8dlVsOh375PvH8YO8EALU1HuecIC6qQgXifNuSx9XAoLaoGIYDjkWFrawX1U1XrknuMFw7QBSPtg79XovmBvwqnDICrhClEO6wgKFj9vPqJWlthUvdgH1DOA8+wFMexzQc5BUS1d1IsdBSjEv4Fe1LgBO1CpFPTpV1JuPSFNt4y/trzbtaUfwBWwM3/6JsrL6MSQYwLKXAm9YJBxsM8992MblZ63Gami0+rnwOMyPykVpQsyl9eYNOfVC6kRBkwaop//LgcAKWivkHF791g0JK5kMmCgKPas2QRkUFQsuTvm6R1946Wg95k764ZRLW59yO5UVGsawwELupCfAbdCuAwvcz5Xk18rIVEdgSRBRgO77R206QdXHuA2goaGiCQ0GmUfN1JlmFayjv0IcKGkfYt4HAj0yuQBRGDjzuS/rTmAf29Gov1S+FF7QBayNcpoBOEsMt3vFcIUC7VxOnE+pxmkgqEzduzwsPykrjBszCusgdarsRIAL6CM/KqsqcAf1vj8P1TXFyN6e5G8ao48fjKfDQJYizIdIfb+Xwp6Z2fE2C7mUfUEzMKqSBp4VUV1A49Sz1M2LzVzahEfyHUAcQNltR0nADYkBvHXDZQo8H9dQvHF7qhjPtSolBJ0A/vaLwdRz5YFFGoWBy8E/4aKcjqimaUBXXnjBpzOZnMlIVXsTVEBBUa+dD0BR0xVopgAD70psY0KjMHpmHB2kApea9o23NS83mpsref5OZet4U/0CMhSEDpwnxB9lVKSfk5djllXRFPizQmKcqMpnyZ3ycPntf96Ym9ChzU8vCQnhgWZ2UuySArw+cVBG4gqNCS6YoSEEziRWVStKUpe4FfCd91V0XA/qgOJuF7FpGjjyQgsFoNDtibp8cm+cyXxbB6zh4pMUO4H06yzsv4E/A6rg/uRJRnMRmrhMDIhyOjABX9CMDFhBFxx19KujjqWeim5PwVFU6IBiewfyk7IPETcg52kjXN7nsbaoEykKf/cjUgVxpTZZVtnqFMgv4FHa8oSOisawinMLHfUBzJcK1j8BeqquedKDtgcgnA4bym4P6gBWYVM3W/pn41ku5L4RElFWtlk5SXHEThhOWDiIyVROlQNM+wyHimlgATI/PPIm4BB8qfqwHnhgL89gzs+Ww1xQb4821SZ/4IwOJiRqH/X9u7Hj08JLSZfawOQcpRzwgk1oBNzzcgLn1FBNHspMENik9OG4awIDaUjw9rKNT1KXPl9neua6sSbkgqfs/CNfBdNfDDhQuL4AKXEXeOgZID91eOiRUnEFOIA5rnTkBU0/IT05gByoq5KBJF4Hym4Pxh3UcxZ7HjdhEhKWURbhavNR9rjLBwk3ryDcrGzfvk9I69b1yhMGWQ4bqMwv/RMSplQkjjVKXzZX8wESVcuB7QG0YUCMjk/aOmWgc/vC4oMCVYfghIGP6MT1zpeUhM1rQzOnGxmFKwTCir1Xaj5vN7T7nDZvnbDGHbCKnwji2zofNsOvbold3zlUtKGosBun3PbJSrrReHEaCQVCIDEMaCCBs+P+AbybkbIhmbNecGwF+E5/L2ECuPKCWsUESQkKnyyJ93TGACk7OrAY9P8XG//fGCoM7DAEUGnj5Mw7aQfelySWOm9iPuFyvrL8rKQR6mM6qdCUDQsfNPVu4yv/HaPOT1e/yDaviMKmTkg/I/F7MUG9OlrmDrBLRVd3c8KBJlPEKoVRcIJuhoQAmZDUkPC00W5OI1dOpQ1F61kFNqr9SmFcaHdBheOaDHF6QZMOP6QyiZ804oj98wLiAMIgcWw4UDYkDAWfR+4d5s0zP2GgUZX04i+NeSgYGokvbDhIZYUWHgd9K8zZzir264NxZUFbsfM1jdqpV2naA48tx6hsvBSabE4IMtlcOGgq8PqCjoly2rw2soqy4RJWQtPZl6PUCU14ZUWENuZV2Honn3f+k6R6wrkqgTStyQ0bFY+XAaafMRFgUlVeXxXFUcpLEYfZz3FrVUzZrOOJK+4B/wnIZ8TGRvb9OB8EUM0w8uNYj/oa9iK9AMoy6gA72o02srMxpAPUD+EDnVEF7P5xw896VyAbFk8MgnpVpR3gfLnt/wECq3rYFvYLcKCpqvcI+/hVl8AumXDeApklDRRKJSS+KOaq1Rgg4igOYtiQK1hJy46TBtDjznDp3iqJff5j0/LfSZbYVdauqXccJ9W+czupp0sU9gMlqkQ52lU1E6tUwoDUukAD6YRpAwqDrAErzA8QCRvXm98KEep0xIdY1CN1ye27IP0IHvvYIW18qGz8S7VWUZuMkUOb3P8DHTl67ur/i1UAAAAASUVORK5CYII="})]})]}),this.defaultLocale=p,this.i18nInit(),this.title=this.i18n("pluginNameInstagram"),this.opts.companionAllowedHosts=(0,n.A)(this.opts.companionAllowedHosts,this.opts.companionUrl),this.provider=new r.A(A,{companionUrl:this.opts.companionUrl,companionHeaders:this.opts.companionHeaders,companionKeysParams:this.opts.companionKeysParams,companionCookiesRule:this.opts.companionCookiesRule,provider:"instagram",pluginId:this.id,supportsRefreshToken:!1}),this.render=this.render.bind(this)}install(){this.view=new o.A(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1});const{target:A}=this.opts;A&&this.mount(A,this)}uninstall(){this.view.tearDown(),this.unmount()}render(A){return this.view.render(A)}}}}]);
@@ -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"],o=Math.min(Math.floor(Math.log(s)/Math.log(1024)),i.length-1),r=Number(s/1024**o),n=i[o];return`${r>=10||r%1==0?Math.round(r):r.toFixed(1)} ${n}`}},1566:function(e,t,s){var i=s(7764),o=/[\/\+\.]/;e.exports=function(e,t){function s(t){var s=i(t,e,o);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,o,r,n,l){var a=function(e){for(var s=t[e]?t[e]:[],i=e.indexOf(":"),o=-1===i?[e]:[e.substring(0,i),e.substring(i+1)],r=Object.keys(t),n=0,l=r.length;n<l;n++){var a=r[n];if("*"===a&&(s=s.concat(t[a])),2===o.length&&o[0]===a){s=s.concat(t[a]);break}}return s}(e);a.length&&function(e,t,s){for(var i=0,o=t.length;i<o&&t[i];i++)t[i].event=e,t[i].apply(t[i],s)}(e,a,[s,i,o,r,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],o=0,r=i?i.length:0;o<r;o++)i[o]!==t&&s.push(i[o]);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,o=this.parts,r=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(s=(e||"").split(this.separator),t=0;i&&t<r;t++)"*"!==o[t]&&(i=t<s.length&&o[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 o=new t(e,i||/[\/\.]/);return void 0!==s?o.match(s):o}},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 o.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),o=s(4528);function r(e){return e<10?`0${e}`:e.toString()}function n(){const e=new Date;return`${r(e.getHours())}:${r(e.getMinutes())}:${r(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),S=s(7331),v=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),o=parseInt(s[1],10);return i<15||15===i&&o<15063||i>18||18===i&&o>=18218}const P={totalProgress:0,allowNewUpload:!0,error:null,recoveredState:null};class O{static VERSION="5.2.0";#o=Object.create(null);#r;#n;#l=v();#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.#r=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),o=[],r=[],n=[],l=[],a=[],d=[],u=[],h=[],c=[];for(const e of i){const{progress:t}=e;!t.uploadComplete&&t.uploadStarted&&(o.push(e),e.isPaused||h.push(e)),t.uploadStarted||r.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:r,startedFiles:n,uploadStartedFiles:l,pausedFiles:a,completeFiles:d,erroredFiles:u,inProgressFiles:o,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!==o.length&&a.length===o.length,isUploadInProgress:o.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.#r.validate(t,[e])}catch(e){return e}return null}validateSingleFile(e){try{this.#r.validateSingleFile(e)}catch(e){return e.message}return null}validateAggregateRestrictions(e){const t=this.getFiles();try{this.#r.validateAggregateRestrictions(t,e)}catch(e){return e.message}return null}#p(e){const{missingFields:t,error:s}=this.#r.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),o=(0,w.A)(i).extension,r=(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:r,name:i,extension:o||"",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=[],o=[];for(const r of e)try{let e=this.#m(r);this.#f(e);const o=t[e.id],n=o?.isGhost;if(n&&!e.isRemote){if(null==e.data)throw new Error("File data is missing");e={...o,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.#r.validateSingleFile(e),s[e.id]=e,i.push(e)}catch(e){o.push(e)}try{this.#r.validateAggregateRestrictions(Object.values(t),i)}catch(e){return o.push(e),{nextFilesState:t,validFilesToAdd:[],errors:o}}return{nextFilesState:s,validFilesToAdd:i,errors:o}}addFile(e){const{nextFilesState:t,validFilesToAdd:s,errors:i}=this.#w([e]),o=i.filter(e=>e.isRestriction);if(this.#c(o),i.length>0)throw i[0];this.setState({files:t});const[r]=s;return this.emit("file-added",r),this.emit("files-added",s),this.log(`Added file: ${r.name}, ${r.id}, mime type: ${r.type}`),this.#y(),r.id}addFiles(e){const{nextFilesState:t,validFilesToAdd:s,errors:i}=this.#w(e),o=i.filter(e=>e.isRestriction);this.#c(o);const r=i.filter(e=>!e.isRestriction);if(r.length>0){let e="Multiple errors occurred while adding files:\n";if(r.forEach(t=>{e+=`\n * ${t.message}`}),this.info({message:this.i18n("addBulkFilesFailed",{smart_count:r.length}),details:e},"error",this.opts.infoTimeout),"function"==typeof AggregateError)throw new AggregateError(r,e);{const t=new Error(e);throw t.errors=r,t}}this.setState({files:t}),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},o={...s},r=Object.create(null);function n(e){return void 0===r[e]}e.forEach(e=>{t[e]&&(r[e]=t[e],delete i[e])}),Object.keys(o).forEach(e=>{const t=s[e].fileIDs.filter(n);if(0===t.length)return void delete o[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.");o[e]={...s[e],fileIDs:t}});const l={currentUploads:o,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(r);a.forEach(e=>{this.emit("file-removed",r[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")}#S(){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#v(){const e=this.#S(),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.#v();return this.emit("complete",e),e}cancelAll(){this.emit("cancel-all");const{files:e}=this.getState(),t=Object.keys(e);t.length&&this.removeFiles(t),this.setState(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=S(()=>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 o=s.reduce((e,t)=>e+(t.progress.bytesTotal??0),0),r=s.reduce((e,t)=>e+(t.progress.bytesUploaded||0),0);return 0===o?0:r/o}#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,o=s.map(e=>e.meta.name).join(", ");t||(this.info({message:i,details:o},"warning",this.opts.infoTimeout),t=setTimeout(()=>{t=null},this.opts.infoTimeout)),this.log(`${i} ${o}`.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 o=this.getPlugin(i);if(o){const e=`Already found a plugin named '${o.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.#o?this.#o[s.type].push(s):this.#o[s.type]=[s],s.install(),this.emit("plugin-added",s),this}getPlugin(e){for(const t of Object.values(this.#o)){const s=t.find(t=>t.id===e);if(null!=s)return s}}[Symbol.for("uppy test: getPlugins")](e){return this.#o[e]}iteratePlugins(e){Object.values(this.#o).flat(1).forEach(e)}removePlugin(e){this.log(`Removing plugin ${e.id}`),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();const t=this.#o[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:o}=this.getState();if(!i&&!s)throw new Error("Cannot create a new upload: already uploading.");const r=(0,b.A)();return this.emit("upload",r,this.getFilesByIds(e)),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploadBatches&&!1!==this.opts.allowMultipleUploads,currentUploads:{...o,[r]:{fileIDs:e,step:0,result:{}}}}),r}[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 o=s.step||0;o<i.length;o++){const r=i[o];this.setState({currentUploads:{...this.getState().currentUploads,[e]:{...s,step:o}}});const{fileIDs:n}=s;if(await r(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)),o=i.filter(e=>!e.error),r=i.filter(e=>e.error);this.addResultData(e,{successful:o,failed:r,uploadID:e}),s=t()}let o;return s&&(o=s.result,this.#I(e)),null==o&&(this.log(`Not setting result for an upload that has been removed: ${e}`),o={successful:[],failed:[],uploadID:e}),o}async upload(){this.#o.uploader?.length||this.log("No uploader type plugins are used","warning");let{files:e}=this.getState();if(this.#S().length>0){const t=await this.#v();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.#r.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)}),o=this.#b(i),r=await this.#A(o);return this.emit("complete",r),r}catch(e){throw this.#c([e]),e}}}var T=O},5417:function(e,t,s){"use strict";s.d(t,{N:function(){return r}});var i=s(7623);function o(e){let t="";return e.replace(/[^A-Z0-9]/gi,e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/"))+t}function r(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+=`-${o(e.name.toLowerCase())}`),void 0!==e.type&&(s+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(s+=`-${o(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 r}});var i=s(6506),o=s(7544);function r(e){if(e.type)return e.type;const t=e.name?(0,i.A)(e.name).extension?.toLowerCase():null;return t&&t in o.A?o.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}}}]);