@micromag/viewer-build 0.3.517 → 0.3.518

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 (31) hide show
  1. package/build/asset-manifest.json +6 -23
  2. package/build/index.html +1 -1
  3. package/build/static/js/175.42d3627e.js +2 -0
  4. package/build/static/js/{887.8a6921e5.js.LICENSE.txt → 175.42d3627e.js.LICENSE.txt} +0 -10
  5. package/build/static/js/main.5411c29e.js +2 -0
  6. package/build/static/js/runtime~main.3754c53b.js +1 -0
  7. package/package.json +6 -6
  8. package/build/static/js/104.e7b2f53b.chunk.js +0 -1
  9. package/build/static/js/119.409edb1a.chunk.js +0 -1
  10. package/build/static/js/139.4365a1df.chunk.js +0 -1
  11. package/build/static/js/165.a09e3185.chunk.js +0 -1
  12. package/build/static/js/177.d6cc3845.chunk.js +0 -1
  13. package/build/static/js/299.a106f35a.chunk.js +0 -1
  14. package/build/static/js/359.768ec35e.chunk.js +0 -1
  15. package/build/static/js/375.0bcd7609.chunk.js +0 -2
  16. package/build/static/js/375.0bcd7609.chunk.js.LICENSE.txt +0 -10
  17. package/build/static/js/462.307a7cd0.chunk.js +0 -1
  18. package/build/static/js/50.9da80c9d.chunk.js +0 -1
  19. package/build/static/js/526.efc3b856.chunk.js +0 -2
  20. package/build/static/js/526.efc3b856.chunk.js.LICENSE.txt +0 -10
  21. package/build/static/js/567.1a366653.chunk.js +0 -1
  22. package/build/static/js/595.27131768.chunk.js +0 -1
  23. package/build/static/js/626.c42d15c2.chunk.js +0 -2
  24. package/build/static/js/626.c42d15c2.chunk.js.LICENSE.txt +0 -1
  25. package/build/static/js/784.1708dd96.chunk.js +0 -1
  26. package/build/static/js/786.6bf1d59f.chunk.js +0 -1
  27. package/build/static/js/793.ed1b7b39.chunk.js +0 -1
  28. package/build/static/js/887.8a6921e5.js +0 -2
  29. package/build/static/js/main.b4414625.js +0 -2
  30. package/build/static/js/runtime~main.4d15fd3a.js +0 -1
  31. /package/build/static/js/{main.b4414625.js.LICENSE.txt → main.5411c29e.js.LICENSE.txt} +0 -0
@@ -1 +0,0 @@
1
- (self.webpackChunk_micromag_viewer_build=self.webpackChunk_micromag_viewer_build||[]).push([[793],{2534:function(e){"use strict";var t=Object.prototype.hasOwnProperty,i="~";function n(){}function r(e,t,i){this.fn=e,this.context=t,this.once=i||!1}function s(e,t,n,s,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var a=new r(n,s||e,o),l=i?i+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],a]:e._events[l].push(a):(e._events[l]=a,e._eventsCount++),e}function o(e,t){0==--e._eventsCount?e._events=new n:delete e._events[t]}function a(){this._events=new n,this._eventsCount=0}Object.create&&(n.prototype=Object.create(null),(new n).__proto__||(i=!1)),a.prototype.eventNames=function(){var e,n,r=[];if(0===this._eventsCount)return r;for(n in e=this._events)t.call(e,n)&&r.push(i?n.slice(1):n);return Object.getOwnPropertySymbols?r.concat(Object.getOwnPropertySymbols(e)):r},a.prototype.listeners=function(e){var t=i?i+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,s=n.length,o=new Array(s);r<s;r++)o[r]=n[r].fn;return o},a.prototype.listenerCount=function(e){var t=i?i+e:e,n=this._events[t];return n?n.fn?1:n.length:0},a.prototype.emit=function(e,t,n,r,s,o){var a=i?i+e:e;if(!this._events[a])return!1;var l,h,c=this._events[a],u=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),u){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,n),!0;case 4:return c.fn.call(c.context,t,n,r),!0;case 5:return c.fn.call(c.context,t,n,r,s),!0;case 6:return c.fn.call(c.context,t,n,r,s,o),!0}for(h=1,l=new Array(u-1);h<u;h++)l[h-1]=arguments[h];c.fn.apply(c.context,l)}else{var p,d=c.length;for(h=0;h<d;h++)switch(c[h].once&&this.removeListener(e,c[h].fn,void 0,!0),u){case 1:c[h].fn.call(c[h].context);break;case 2:c[h].fn.call(c[h].context,t);break;case 3:c[h].fn.call(c[h].context,t,n);break;case 4:c[h].fn.call(c[h].context,t,n,r);break;default:if(!l)for(p=1,l=new Array(u-1);p<u;p++)l[p-1]=arguments[p];c[h].fn.apply(c[h].context,l)}}return!0},a.prototype.on=function(e,t,i){return s(this,e,t,i,!1)},a.prototype.once=function(e,t,i){return s(this,e,t,i,!0)},a.prototype.removeListener=function(e,t,n,r){var s=i?i+e:e;if(!this._events[s])return this;if(!t)return o(this,s),this;var a=this._events[s];if(a.fn)a.fn!==t||r&&!a.once||n&&a.context!==n||o(this,s);else{for(var l=0,h=[],c=a.length;l<c;l++)(a[l].fn!==t||r&&!a[l].once||n&&a[l].context!==n)&&h.push(a[l]);h.length?this._events[s]=1===h.length?h[0]:h:o(this,s)}return this},a.prototype.removeAllListeners=function(e){var t;return e?(t=i?i+e:e,this._events[t]&&o(this,t)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=i,a.EventEmitter=a,e.exports=a},2162:function(e){e.exports=function(){var e={},t=e._fns={};return e.emit=function(e,i,n,r,s,o,a){var l=function(e){for(var i=t[e]?t[e]:[],n=e.indexOf(":"),r=-1===n?[e]:[e.substring(0,n),e.substring(n+1)],s=Object.keys(t),o=0,a=s.length;o<a;o++){var l=s[o];if("*"===l&&(i=i.concat(t[l])),2===r.length&&r[0]===l){i=i.concat(t[l]);break}}return i}(e);l.length&&function(e,t,i){for(var n=0,r=t.length;n<r&&t[n];n++)t[n].event=e,t[n].apply(t[n],i)}(e,l,[i,n,r,s,o,a])},e.on=function(e,i){t[e]||(t[e]=[]),t[e].push(i)},e.once=function(t,i){this.on(t,(function n(){i.apply(this,arguments),e.off(t,n)}))},e.off=function(e,t){var i=[];if(e&&t)for(var n=this._fns[e],r=0,s=n?n.length:0;r<s;r++)n[r]!==t&&i.push(n[r]);i.length?this._fns[e]=i:delete this._fns[e]},e}},3817:function(e,t,i){"use strict";i.d(t,{J0:function(){return b},Kr:function(){return P},hb:function(){return S},li:function(){return w},vJ:function(){return _}});var n,r,s,o,a=i(5181),l=0,h=[],c=[],u=a.fF,p=u.__b,d=u.__r,f=u.diffed,m=u.__c,g=u.unmount,v=u.__;function y(e,t){u.__h&&u.__h(r,e,l||t),l=0;var i=r.__H||(r.__H={__:[],__h:[]});return e>=i.__.length&&i.__.push({__V:c}),i.__[e]}function b(e){return l=1,function(e,t,i){var s=y(n++,2);if(s.t=e,!s.__c&&(s.__=[T(void 0,t),function(e){var t=s.__N?s.__N[0]:s.__[0],i=s.t(t,e);t!==i&&(s.__N=[i,s.__[1]],s.__c.setState({}))}],s.__c=r,!r.u)){var o=function(e,t,i){if(!s.__c.__H)return!0;var n=s.__c.__H.__.filter((function(e){return!!e.__c}));if(n.every((function(e){return!e.__N})))return!a||a.call(this,e,t,i);var r=!1;return n.forEach((function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(r=!0)}})),!(!r&&s.__c.props===e)&&(!a||a.call(this,e,t,i))};r.u=!0;var a=r.shouldComponentUpdate,l=r.componentWillUpdate;r.componentWillUpdate=function(e,t,i){if(this.__e){var n=a;a=void 0,o(e,t,i),a=n}l&&l.call(this,e,t,i)},r.shouldComponentUpdate=o}return s.__N||s.__}(T,e)}function _(e,t){var i=y(n++,3);!u.__s&&N(i.__H,t)&&(i.__=e,i.i=t,r.__H.__h.push(i))}function w(e){return l=5,P((function(){return{current:e}}),[])}function P(e,t){var i=y(n++,7);return N(i.__H,t)?(i.__V=e(),i.i=t,i.__h=e,i.__V):i.__}function S(e,t){return l=8,P((function(){return e}),t)}function F(){for(var e;e=h.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(I),e.__H.__h.forEach(k),e.__H.__h=[]}catch(t){e.__H.__h=[],u.__e(t,e.__v)}}u.__b=function(e){r=null,p&&p(e)},u.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),v&&v(e,t)},u.__r=function(e){d&&d(e),n=0;var t=(r=e.__c).__H;t&&(s===r?(t.__h=[],r.__h=[],t.__.forEach((function(e){e.__N&&(e.__=e.__N),e.__V=c,e.__N=e.i=void 0}))):(t.__h.forEach(I),t.__h.forEach(k),t.__h=[],n=0)),s=r},u.diffed=function(e){f&&f(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==h.push(t)&&o===u.requestAnimationFrame||((o=u.requestAnimationFrame)||C)(F)),t.__H.__.forEach((function(e){e.i&&(e.__H=e.i),e.__V!==c&&(e.__=e.__V),e.i=void 0,e.__V=c}))),s=r=null},u.__c=function(e,t){t.some((function(e){try{e.__h.forEach(I),e.__h=e.__h.filter((function(e){return!e.__||k(e)}))}catch(i){t.some((function(e){e.__h&&(e.__h=[])})),t=[],u.__e(i,e.__v)}})),m&&m(e,t)},u.unmount=function(e){g&&g(e);var t,i=e.__c;i&&i.__H&&(i.__H.__.forEach((function(e){try{I(e)}catch(e){t=e}})),i.__H=void 0,t&&u.__e(t,i.__v))};var x="function"==typeof requestAnimationFrame;function C(e){var t,i=function(){clearTimeout(n),x&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(i,100);x&&(t=requestAnimationFrame(i))}function I(e){var t=r,i=e.__c;"function"==typeof i&&(e.__c=void 0,i()),r=t}function k(e){var t=r;e.__c=e.__(),r=t}function N(e,t){return!e||e.length!==t.length||t.some((function(t,i){return t!==e[i]}))}function T(e,t){return"function"==typeof t?t(e):t}},5144:function(e,t,i){"use strict";i.d(t,{gi:function(){return Te},ZY:function(){return Se}});var n=i(5181),r=i(2534);class s extends Error{constructor(e){super(e),this.name="TimeoutError"}}class o extends Error{constructor(e){super(),this.name="AbortError",this.message=e}}const a=e=>void 0===globalThis.DOMException?new o(e):new DOMException(e),l=e=>{const t=void 0===e.reason?a("This operation was aborted."):e.reason;return t instanceof Error?t:a(t)};var h,c=function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)};h=new WeakMap;var u,p,d,f,m,g,v,y,b,_,w,P,S,F,x,C,I,k,N,T,E,A,L,B,z,H,O=class{constructor(){h.set(this,[])}enqueue(e,t){const i={priority:(t={priority:0,...t}).priority,run:e};if(this.size&&c(this,h,"f")[this.size-1].priority>=t.priority)return void c(this,h,"f").push(i);const n=function(e,t,i){let n=0,r=e.length;for(;r>0;){const i=Math.trunc(r/2);let o=n+i;s=e[o],t.priority-s.priority<=0?(n=++o,r-=i+1):r=i}var s;return n}(c(this,h,"f"),i);c(this,h,"f").splice(n,0,i)}dequeue(){const e=c(this,h,"f").shift();return null==e?void 0:e.run}filter(e){return c(this,h,"f").filter((t=>t.priority===e.priority)).map((e=>e.run))}get size(){return c(this,h,"f").length}},M=function(e,t,i,n,r){if("m"===n)throw new TypeError("Private method is not writable");if("a"===n&&!r)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof t?e!==t||!r:!t.has(e))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===n?r.call(e,i):r?r.value=i:t.set(e,i),i},D=function(e,t,i,n){if("a"===i&&!n)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof t?e!==t||!n:!t.has(e))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===i?n:"a"===i?n.call(e):n?n.value:t.get(e)};class R extends Error{}p=new WeakMap,d=new WeakMap,f=new WeakMap,m=new WeakMap,g=new WeakMap,v=new WeakMap,y=new WeakMap,b=new WeakMap,_=new WeakMap,w=new WeakMap,P=new WeakMap,S=new WeakMap,F=new WeakMap,x=new WeakMap,u=new WeakSet,C=function(){return D(this,d,"f")||D(this,f,"f")<D(this,m,"f")},I=function(){return D(this,P,"f")<D(this,S,"f")},k=function(){var e;M(this,P,(e=D(this,P,"f"),--e),"f"),D(this,u,"m",E).call(this),this.emit("next")},N=function(){D(this,u,"m",L).call(this),D(this,u,"m",A).call(this),M(this,b,void 0,"f")},T=function(){const e=Date.now();if(void 0===D(this,y,"f")){const t=D(this,v,"f")-e;if(!(t<0))return void 0===D(this,b,"f")&&M(this,b,setTimeout((()=>{D(this,u,"m",N).call(this)}),t),"f"),!0;M(this,f,D(this,p,"f")?D(this,P,"f"):0,"f")}return!1},E=function(){if(0===D(this,_,"f").size)return D(this,y,"f")&&clearInterval(D(this,y,"f")),M(this,y,void 0,"f"),this.emit("empty"),0===D(this,P,"f")&&this.emit("idle"),!1;if(!D(this,F,"f")){const e=!D(this,u,"a",T);if(D(this,u,"a",C)&&D(this,u,"a",I)){const t=D(this,_,"f").dequeue();return!!t&&(this.emit("active"),t(),e&&D(this,u,"m",A).call(this),!0)}}return!1},A=function(){D(this,d,"f")||void 0!==D(this,y,"f")||(M(this,y,setInterval((()=>{D(this,u,"m",L).call(this)}),D(this,g,"f")),"f"),M(this,v,Date.now()+D(this,g,"f"),"f"))},L=function(){0===D(this,f,"f")&&0===D(this,P,"f")&&D(this,y,"f")&&(clearInterval(D(this,y,"f")),M(this,y,void 0,"f")),M(this,f,D(this,p,"f")?D(this,P,"f"):0,"f"),D(this,u,"m",B).call(this)},B=function(){for(;D(this,u,"m",E).call(this););},z=async function(e){return new Promise(((t,i)=>{e.addEventListener("abort",(()=>{i(new R("The task was aborted."))}),{once:!0})}))},H=async function(e,t){return new Promise((i=>{const n=()=>{t&&!t()||(this.off(e,n),i())};this.on(e,n)}))};var q=class extends r{constructor(e){var t,i,n,r;if(super(),u.add(this),p.set(this,void 0),d.set(this,void 0),f.set(this,0),m.set(this,void 0),g.set(this,void 0),v.set(this,0),y.set(this,void 0),b.set(this,void 0),_.set(this,void 0),w.set(this,void 0),P.set(this,0),S.set(this,void 0),F.set(this,void 0),x.set(this,void 0),Object.defineProperty(this,"timeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),!("number"==typeof(e={carryoverConcurrencyCount:!1,intervalCap:Number.POSITIVE_INFINITY,interval:0,concurrency:Number.POSITIVE_INFINITY,autoStart:!0,queueClass:O,...e}).intervalCap&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${null!==(i=null===(t=e.intervalCap)||void 0===t?void 0:t.toString())&&void 0!==i?i:""}\` (${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 \`${null!==(r=null===(n=e.interval)||void 0===n?void 0:n.toString())&&void 0!==r?r:""}\` (${typeof e.interval})`);M(this,p,e.carryoverConcurrencyCount,"f"),M(this,d,e.intervalCap===Number.POSITIVE_INFINITY||0===e.interval,"f"),M(this,m,e.intervalCap,"f"),M(this,g,e.interval,"f"),M(this,_,new e.queueClass,"f"),M(this,w,e.queueClass,"f"),this.concurrency=e.concurrency,this.timeout=e.timeout,M(this,x,!0===e.throwOnTimeout,"f"),M(this,F,!1===e.autoStart,"f")}get concurrency(){return D(this,S,"f")}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})`);M(this,S,e,"f"),D(this,u,"m",B).call(this)}async add(e,t={}){return t={timeout:this.timeout,throwOnTimeout:D(this,x,"f"),...t},new Promise(((i,n)=>{D(this,_,"f").enqueue((async()=>{var r,o,a;M(this,P,(o=D(this,P,"f"),++o),"f"),M(this,f,(a=D(this,f,"f"),++a),"f");try{if(null===(r=t.signal)||void 0===r?void 0:r.aborted)throw new R("The task was aborted.");let n=e({signal:t.signal});t.timeout&&(n=function(e,t,i,n){let r;const o=new Promise(((o,a)=>{if("number"!=typeof t||1!==Math.sign(t))throw new TypeError(`Expected \`milliseconds\` to be a positive number, got \`${t}\``);if(t!==Number.POSITIVE_INFINITY){if((n={customTimers:{setTimeout:setTimeout,clearTimeout:clearTimeout},...n}).signal){const{signal:e}=n;e.aborted&&a(l(e)),e.addEventListener("abort",(()=>{a(l(e))}))}r=n.customTimers.setTimeout.call(void 0,(()=>{const n=i instanceof Error?i:new s(`Promise timed out after ${t} milliseconds`);"function"==typeof e.cancel&&e.cancel(),a(n)}),t),(async()=>{try{o(await e)}catch(e){a(e)}finally{n.customTimers.clearTimeout.call(void 0,r)}})()}else o(e)}));return o.clear=()=>{clearTimeout(r),r=void 0},o}(Promise.resolve(n),t.timeout)),t.signal&&(n=Promise.race([n,D(this,u,"m",z).call(this,t.signal)]));const o=await n;i(o),this.emit("completed",o)}catch(e){if(e instanceof s&&!t.throwOnTimeout)return void i();n(e),this.emit("error",e)}finally{D(this,u,"m",k).call(this)}}),t),this.emit("add"),D(this,u,"m",E).call(this)}))}async addAll(e,t){return Promise.all(e.map((async e=>this.add(e,t))))}start(){return D(this,F,"f")?(M(this,F,!1,"f"),D(this,u,"m",B).call(this),this):this}pause(){M(this,F,!0,"f")}clear(){M(this,_,new(D(this,w,"f")),"f")}async onEmpty(){0!==D(this,_,"f").size&&await D(this,u,"m",H).call(this,"empty")}async onSizeLessThan(e){D(this,_,"f").size<e||await D(this,u,"m",H).call(this,"next",(()=>D(this,_,"f").size<e))}async onIdle(){0===D(this,P,"f")&&0===D(this,_,"f").size||await D(this,u,"m",H).call(this,"idle")}get size(){return D(this,_,"f").size}sizeBy(e){return D(this,_,"f").filter(e).length}get pending(){return D(this,P,"f")}get isPaused(){return D(this,F,"f")}},$=i(5417),W=i(3817);function j(){return(0,n.h)("svg",{width:"26",height:"26",viewBox:"0 0 26 26",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("g",{fill:"none","fill-rule":"evenodd"},(0,n.h)("circle",{fill:"#FFF",cx:"13",cy:"13",r:"13"}),(0,n.h)("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,n.h)("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,n.h)("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,n.h)("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,n.h)("path",{d:"M4 4h18v18H4z"})))}function V(e){let{pluginName:t,i18n:i,onAuth:r}=e;const s="Google Drive"===t,o=(0,W.hb)((e=>{e.preventDefault(),r()}),[r]);return(0,n.h)("form",{onSubmit:o},s?(0,n.h)("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},(0,n.h)(j,null),i("signInWithGoogle")):(0,n.h)("button",{type:"submit",className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn","data-uppy-super-focusable":!0},i("authenticateWith",{pluginName:t})))}const K=e=>{let{pluginName:t,i18n:i,onAuth:r}=e;return(0,n.h)(V,{pluginName:t,i18n:i,onAuth:r})};function U(e){const{loading:t,pluginName:i,pluginIcon:r,i18n:s,handleAuth:o,renderForm:a=K}=e;return(0,n.h)("div",{className:"uppy-Provider-auth"},(0,n.h)("div",{className:"uppy-Provider-authIcon"},r()),(0,n.h)("div",{className:"uppy-Provider-authTitle"},s("authenticateWithTitle",{pluginName:i})),(0,n.h)("div",{className:"uppy-Provider-authForm"},a({pluginName:i,i18n:s,loading:t,onAuth:o})))}function Q(e){let{i18n:t,logout:i,username:r}=e;return(0,n.h)(n.FK,null,(0,n.h)("span",{className:"uppy-ProviderBrowser-user",key:"username"},r),(0,n.h)("button",{type:"button",onClick:i,className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowser-userLogout",key:"logout"},t("logOut")))}const J=e=>{const{getFolder:t,title:i,isLast:r}=e;return(0,n.h)(n.FK,null,(0,n.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn",onClick:t},i),r?"":" / ")};function Y(e){const{getFolder:t,title:i,breadcrumbsIcon:r,breadcrumbs:s}=e;return(0,n.h)("div",{className:"uppy-Provider-breadcrumbs"},(0,n.h)("div",{className:"uppy-Provider-breadcrumbsIcon"},r),s.map(((e,r)=>(0,n.h)(J,{key:e.id,getFolder:()=>t(e.requestPath,e.name),title:0===r?i:e.name,isLast:r+1===s.length}))))}function G(e){return(0,n.h)(n.FK,null,e.showBreadcrumbs&&(0,n.h)(Y,{getFolder:e.getFolder,breadcrumbs:e.breadcrumbs,breadcrumbsIcon:e.pluginIcon&&e.pluginIcon(),title:e.title}),(0,n.h)(Q,{logout:e.logout,username:e.username,i18n:e.i18n}))}var X=i(3373),Z=i(6506);function ee(e){return{...e,type:e.mimeType,extension:e.name?(0,Z.A)(e.name).extension:null}}var te=i(4414),ie=i(590);function ne(e){const{search:t,searchOnInput:i,searchTerm:r,showButton:s,inputLabel:o,clearSearchLabel:a,buttonLabel:l,clearSearch:h,inputClassName:c,buttonCSSClassName:u}=e,[p,d]=(0,W.J0)(null!=r?r:""),f=(0,W.hb)((e=>{e.preventDefault(),t(p)}),[t,p]),m=(0,W.hb)((e=>{const n=e.target.value;d(n),i&&t(n)}),[d,i,t]),[g]=(0,W.J0)((()=>{const e=document.createElement("form");return e.setAttribute("tabindex","-1"),e.id=(0,ie.A)(),e}));return(0,W.vJ)((()=>(document.body.appendChild(g),g.addEventListener("submit",f),()=>{g.removeEventListener("submit",f),document.body.removeChild(g)})),[g,f]),(0,n.h)(n.FK,null,(0,n.h)("input",{className:`uppy-u-reset ${c}`,type:"search","aria-label":o,placeholder:o,value:p,onInput:m,form:g.id,"data-uppy-super-focusable":!0}),!s&&(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon uppy-ProviderBrowser-searchFilterIcon",width:"12",height:"12",viewBox:"0 0 12 12"},(0,n.h)("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"})),!s&&p&&(0,n.h)("button",{className:"uppy-u-reset uppy-ProviderBrowser-searchFilterReset",type:"button","aria-label":a,title:a,onClick:()=>{d(""),h&&h()}},(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",viewBox:"0 0 19 19"},(0,n.h)("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"}))),s&&(0,n.h)("button",{className:`uppy-u-reset uppy-c-btn uppy-c-btn-primary ${u}`,type:"submit",form:g.id},l))}function re(e){let{cancel:t,done:i,i18n:r,selected:s}=e;return(0,n.h)("div",{className:"uppy-ProviderBrowser-footer"},(0,n.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onClick:i,type:"button"},r("selectX",{smart_count:s})),(0,n.h)("button",{className:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onClick:t,type:"button"},r("cancel")))}function se(){return(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",width:11,height:14.5,viewBox:"0 0 44 58"},(0,n.h)("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 oe(){return(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",className:"uppy-c-icon",style:{minWidth:16,marginRight:3},viewBox:"0 0 276.157 276.157"},(0,n.h)("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 ae(){return(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",style:{width:16,marginRight:4},viewBox:"0 0 58 58"},(0,n.h)("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,n.h)("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 le(e){const{itemIconString:t}=e;if(null===t)return null;switch(t){case"file":return(0,n.h)(se,null);case"folder":return(0,n.h)(oe,null);case"video":return(0,n.h)(ae,null);default:{const{alt:i}=e;return(0,n.h)("img",{src:t,alt:i,referrerPolicy:"no-referrer",loading:"lazy",width:16,height:16})}}}var he=function(e){const{className:t,isDisabled:i,restrictionError:r,isChecked:s,title:o,itemIconEl:a,showTitles:l,toggleCheckbox:h,recordShiftKeyPress:c,id:u,children:p}=e,d=X("uppy-u-reset","uppy-ProviderBrowserItem-checkbox","uppy-ProviderBrowserItem-checkbox--grid",{"uppy-ProviderBrowserItem-checkbox--is-checked":s});return(0,n.h)("li",{className:t,title:i?null==r?void 0:r.message:void 0},(0,n.h)("input",{type:"checkbox",className:d,onChange:h,onKeyDown:c,onMouseDown:c,name:"listitem",id:u,checked:s,disabled:i,"data-uppy-super-focusable":!0}),(0,n.h)("label",{htmlFor:u,"aria-label":o,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},a,l&&o,p))};function ce(e){const{className:t,isDisabled:i,restrictionError:r,isCheckboxDisabled:s,isChecked:o,toggleCheckbox:a,recordShiftKeyPress:l,type:h,id:c,itemIconEl:u,title:p,handleFolderClick:d,showTitles:f,i18n:m}=e;return(0,n.h)("li",{className:t,title:i?null==r?void 0:r.message:void 0},s?null:(0,n.h)("input",{type:"checkbox",className:"uppy-u-reset uppy-ProviderBrowserItem-checkbox "+(o?"uppy-ProviderBrowserItem-checkbox--is-checked":""),onChange:a,onKeyDown:l,onMouseDown:l,name:"listitem",id:c,checked:o,"aria-label":"file"===h?null:m("allFilesFromFolderNamed",{name:p}),disabled:i,"data-uppy-super-focusable":!0}),"file"===h?(0,n.h)("label",{htmlFor:c,className:"uppy-u-reset uppy-ProviderBrowserItem-inner"},(0,n.h)("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u),f&&p):(0,n.h)("button",{type:"button",className:"uppy-u-reset uppy-c-btn uppy-ProviderBrowserItem-inner",onClick:d,"aria-label":m("openFolderNamed",{name:p})},(0,n.h)("div",{className:"uppy-ProviderBrowserItem-iconWrap"},u),f&&(0,n.h)("span",null,p)))}function ue(){return ue=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},ue.apply(this,arguments)}function pe(e){const{author:t,getItemIcon:i,isChecked:r,isDisabled:s,viewType:o}=e,a=i(),l=X("uppy-ProviderBrowserItem",{"uppy-ProviderBrowserItem--selected":r},{"uppy-ProviderBrowserItem--disabled":s},{"uppy-ProviderBrowserItem--noPreview":"video"===a}),h=(0,n.h)(le,{itemIconString:a});switch(o){case"grid":return(0,n.h)(he,ue({},e,{className:l,itemIconEl:h}));case"list":return(0,n.h)(ce,ue({},e,{className:l,itemIconEl:h}));case"unsplash":return(0,n.h)(he,ue({},e,{className:l,itemIconEl:h}),(0,n.h)("a",{href:`${t.url}?utm_source=Companion&utm_medium=referral`,target:"_blank",rel:"noopener noreferrer",className:"uppy-ProviderBrowserItem-author",tabIndex:-1},t.name));default:throw new Error(`There is no such type ${o}`)}}function de(e){const{currentSelection:t,uppyFiles:i,viewType:n,isChecked:r,toggleCheckbox:s,recordShiftKeyPress:o,showTitles:a,i18n:l,validateRestrictions:h,getNextFolder:c,f:u}=e;if(u.isFolder)return pe({showTitles:a,viewType:n,i18n:l,id:u.id,title:u.name,getItemIcon:()=>u.icon,isChecked:r(u),toggleCheckbox:e=>s(e,u),recordShiftKeyPress:o,type:"folder",isDisabled:!1,isCheckboxDisabled:"shared-with-me"===u.id,handleFolderClick:()=>c(u)});const p=h(ee(u),[...i,...t]);return pe({id:u.id,title:u.name,author:u.author,getItemIcon:()=>u.icon,isChecked:r(u),toggleCheckbox:e=>s(e,u),isCheckboxDisabled:!1,recordShiftKeyPress:o,showTitles:a,viewType:n,i18n:l,type:"file",isDisabled:Boolean(p)&&!r(u),restrictionError:p})}var fe=function(e){const{currentSelection:t,folders:i,files:r,uppyFiles:s,viewType:o,headerComponent:a,showBreadcrumbs:l,isChecked:h,toggleCheckbox:c,recordShiftKeyPress:u,handleScroll:p,showTitles:d,i18n:f,validateRestrictions:m,isLoading:g,showSearchFilter:v,search:y,searchTerm:b,clearSearch:_,searchOnInput:w,searchInputLabel:P,clearSearchLabel:S,getNextFolder:F,cancel:x,done:C,noResultsLabel:I,loadAllFiles:k}=e,N=t.length,T=(0,W.Kr)((()=>[...i,...r]),[i,r]);return(0,n.h)("div",{className:X("uppy-ProviderBrowser",`uppy-ProviderBrowser-viewType--${o}`)},a&&(0,n.h)("div",{className:"uppy-ProviderBrowser-header"},(0,n.h)("div",{className:X("uppy-ProviderBrowser-headerBar",!l&&"uppy-ProviderBrowser-headerBar--simple")},a)),v&&(0,n.h)("div",{class:"uppy-ProviderBrowser-searchFilter"},(0,n.h)(ne,{search:y,searchTerm:b,clearSearch:_,inputLabel:P,clearSearchLabel:S,inputClassName:"uppy-ProviderBrowser-searchFilterInput",searchOnInput:w})),g?(0,n.h)("div",{className:"uppy-Provider-loading"},(0,n.h)("span",null,f("loading"))):i.length||r.length?k?(0,n.h)("div",{className:"uppy-ProviderBrowser-body"},(0,n.h)("ul",{className:"uppy-ProviderBrowser-list"},(0,n.h)(te.A,{data:T,renderRow:e=>(0,n.h)(de,{currentSelection:t,uppyFiles:s,viewType:o,isChecked:h,toggleCheckbox:c,recordShiftKeyPress:u,showTitles:d,i18n:f,validateRestrictions:m,getNextFolder:F,f:e}),rowHeight:31}))):(0,n.h)("div",{className:"uppy-ProviderBrowser-body"},(0,n.h)("ul",{className:"uppy-ProviderBrowser-list",onScroll:p,role:"listbox",tabIndex:-1},T.map((e=>(0,n.h)(de,{currentSelection:t,uppyFiles:s,viewType:o,isChecked:h,toggleCheckbox:c,recordShiftKeyPress:u,showTitles:d,i18n:f,validateRestrictions:m,getNextFolder:F,f:e}))))):(0,n.h)("div",{className:"uppy-Provider-empty"},I),N>0&&(0,n.h)(re,{selected:N,done:C,cancel:x,i18n:f}))};class me extends n.uA{componentWillUnmount(){const{onUnmount:e}=this.props;e()}render(){const{children:e}=this.props;return(0,n.v2)(e)[0]}}var ge=i(7623),ve=i(8311);class ye{constructor(e,t){this.filterItems=e=>{const t=this.plugin.getPluginState();return t.filterInput&&""!==t.filterInput?e.filter((e=>-1!==e.name.toLowerCase().indexOf(t.filterInput.toLowerCase()))):e},this.recordShiftKeyPress=e=>{this.isShiftKeyPressed=e.shiftKey},this.isChecked=e=>{const{currentSelection:t}=this.plugin.getPluginState();return t.some((t=>t.id===e.id))},this.plugin=e,this.provider=t.provider,this.opts=t,this.isHandlingScroll=!1,this.preFirstRender=this.preFirstRender.bind(this),this.handleError=this.handleError.bind(this),this.clearSelection=this.clearSelection.bind(this),this.cancelPicking=this.cancelPicking.bind(this)}preFirstRender(){this.plugin.setPluginState({didFirstRender:!0}),this.plugin.onFirstRender()}shouldHandleScroll(e){const{scrollHeight:t,scrollTop:i,offsetHeight:n}=e.target;return t-(i+n)<50&&!this.isHandlingScroll}clearSelection(){this.plugin.setPluginState({currentSelection:[],filterInput:""})}cancelPicking(){this.clearSelection();const e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()}handleError(e){var t;const{uppy:i}=this.plugin,n=i.i18n("companionError");i.log(e.toString()),e.isAuthError||"AbortError"===(null==(t=e.cause)?void 0:t.name)||i.info({message:n,details:e.toString()},"error",5e3)}registerRequestClient(){this.requestClientId=this.provider.provider,this.plugin.uppy.registerRequestClient(this.requestClientId,this.provider)}getTagFile(e){const t={id:e.id,source:this.plugin.id,name:e.name||e.id,type:e.mimeType,isRemote:!0,data:e,meta:{},body:{fileId:e.id},remote:{companionUrl:this.plugin.opts.companionUrl,url:`${this.provider.fileUrl(e.requestPath)}`,body:{fileId:e.id},providerName:this.provider.name,provider:this.provider.provider,requestClientId:this.requestClientId}},i=(0,ge.A)(t);return i&&(0,ve.A)(i)&&(t.preview=e.thumbnail),e.author&&(null!=e.author.name&&(t.meta.authorName=String(e.author.name)),e.author.url&&(t.meta.authorUrl=e.author.url)),null!=e.relDirPath&&(t.meta.relativePath=e.relDirPath?`${e.relDirPath}/${t.name}`:null),null!=e.absDirPath&&(t.meta.absolutePath=e.absDirPath?`/${e.absDirPath}/${t.name}`:`/${t.name}`),t}toggleCheckbox(e,t){e.stopPropagation(),e.preventDefault(),e.currentTarget.focus();const{folders:i,files:n}=this.plugin.getPluginState(),r=this.filterItems(i.concat(n));if(this.lastCheckbox&&this.isShiftKeyPressed){const{currentSelection:e}=this.plugin.getPluginState(),i=r.indexOf(this.lastCheckbox),n=r.indexOf(t),s=i<n?r.slice(i,n+1):r.slice(n,i+1),o=[];for(const e of s){const{uppy:t}=this.plugin,i=t.validateRestrictions(ee(e),[...t.getFiles(),...o]);i?t.info({message:i.message},"error",t.opts.infoTimeout):o.push(e)}return void this.plugin.setPluginState({currentSelection:[...new Set([...e,...o])]})}this.lastCheckbox=t;const{currentSelection:s}=this.plugin.getPluginState();this.isChecked(t)?this.plugin.setPluginState({currentSelection:s.filter((e=>e.id!==t.id))}):this.plugin.setPluginState({currentSelection:s.concat([t])})}setLoading(e){this.plugin.setPluginState({loading:e})}}function be(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}var _e=0;function we(e){return"__private_"+_e+++"_"+e}function Pe(e,t){return e?`${e}/${t}`:t}function Se(){return(0,n.h)("svg",{"aria-hidden":"true",focusable:"false",width:"30",height:"30",viewBox:"0 0 30 30"},(0,n.h)("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 Fe={viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0,loadAllFiles:!1};var xe=we("abortController"),Ce=we("withAbort"),Ie=we("list"),ke=we("listFilesAndFolders"),Ne=we("recursivelyListAllFiles");class Te extends ye{constructor(e,t){super(e,{...Fe,...t}),Object.defineProperty(this,Ne,{value:Be}),Object.defineProperty(this,ke,{value:Le}),Object.defineProperty(this,Ie,{value:Ae}),Object.defineProperty(this,Ce,{value:Ee}),Object.defineProperty(this,xe,{writable:!0,value:void 0}),this.filterQuery=this.filterQuery.bind(this),this.clearFilter=this.clearFilter.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState({authenticated:void 0,files:[],folders:[],breadcrumbs:[],filterInput:"",isSearchVisible:!1,currentSelection:[]}),this.registerRequestClient()}tearDown(){}async getFolder(e,t){this.setLoading(!0);try{await be(this,Ce)[Ce]((async i=>{this.lastCheckbox=void 0;let{breadcrumbs:n}=this.plugin.getPluginState();const r=n.findIndex((t=>e===t.requestPath));n=-1!==r?n.slice(0,r+1):[...n,{requestPath:e,name:t}],this.nextPagePath=e;let s=[],o=[];do{const{files:e,folders:t}=await be(this,ke)[ke]({breadcrumbs:n,signal:i});s=s.concat(e),o=o.concat(t),this.setLoading(this.plugin.uppy.i18n("loadedXFiles",{numFiles:s.length+o.length}))}while(this.opts.loadAllFiles&&this.nextPagePath);this.plugin.setPluginState({folders:o,files:s,breadcrumbs:n,filterInput:""})}))}catch(e){if("UserFacingApiError"===(null==e?void 0:e.name))return void this.plugin.uppy.info({message:this.plugin.uppy.i18n(e.message)},"warning",5e3);this.handleError(e)}finally{this.setLoading(!1)}}getNextFolder(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0}async logout(){try{await be(this,Ce)[Ce]((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)}const e={authenticated:!1,files:[],folders:[],breadcrumbs:[],filterInput:""};this.plugin.setPluginState(e)}}))}catch(e){this.handleError(e)}}filterQuery(e){this.plugin.setPluginState({filterInput:e})}clearFilter(){this.plugin.setPluginState({filterInput:""})}async handleAuth(e){try{await be(this,Ce)[Ce]((async t=>{this.setLoading(!0),await this.provider.login({authFormData:e,signal:t}),this.plugin.setPluginState({authenticated:!0}),this.preFirstRender()}))}catch(e){if("UserFacingApiError"===e.name)return void this.plugin.uppy.info({message:this.plugin.uppy.i18n(e.message)},"warning",5e3);this.plugin.uppy.log(`login failed: ${e.message}`)}finally{this.setLoading(!1)}}async handleScroll(e){if(this.shouldHandleScroll(e)&&this.nextPagePath){this.isHandlingScroll=!0;try{await be(this,Ce)[Ce]((async e=>{const{files:t,folders:i,breadcrumbs:n}=this.plugin.getPluginState(),{files:r,folders:s}=await be(this,ke)[ke]({breadcrumbs:n,signal:e}),o=t.concat(r),a=i.concat(s);this.plugin.setPluginState({folders:a,files:o})}))}catch(e){this.handleError(e)}finally{this.isHandlingScroll=!1}}}async donePicking(){this.setLoading(!0);try{await be(this,Ce)[Ce]((async e=>{const{currentSelection:t}=this.plugin.getPluginState(),i=[],n=[];for(const r of t){const{requestPath:t}=r,s=e=>({...e,relDirPath:e.absDirPath.replace(r.absDirPath,"").replace(/^\//,"")});if(r.isFolder){let o=!0,a=0;const l=new q({concurrency:6}),h=e=>{for(const t of e){const e=this.getTagFile(t),i=(0,$.N)(e);this.plugin.uppy.checkIfFileAlreadyExists(i)||(n.push(s(t)),a++,this.setLoading(this.plugin.uppy.i18n("addedNumFiles",{numFiles:a}))),o=!1}};let c;await be(this,Ne)[Ne]({requestPath:t,absDirPath:Pe(r.absDirPath,r.name),relDirPath:r.name,queue:l,onFiles:h,signal:e}),await l.onIdle(),c=o?this.plugin.uppy.i18n("emptyFolderAdded"):0===a?this.plugin.uppy.i18n("folderAlreadyAdded",{folder:r.name}):this.plugin.uppy.i18n("folderAdded",{smart_count:a,folder:r.name}),i.push(c)}else n.push(s(r))}this.plugin.uppy.log("Adding files from a remote provider"),this.plugin.uppy.addFiles(n.map((e=>this.getTagFile(e,this.requestClientId)))),this.plugin.setPluginState({filterInput:""}),i.forEach((e=>this.plugin.uppy.info(e))),this.clearSelection()}))}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}render(e,t){var i=this;void 0===t&&(t={});const{authenticated:r,didFirstRender:s}=this.plugin.getPluginState(),{i18n:o}=this.plugin.uppy;s||this.preFirstRender();const a={...this.opts,...t},{files:l,folders:h,filterInput:c,loading:u,currentSelection:p}=this.plugin.getPluginState(),{isChecked:d,recordShiftKeyPress:f,filterItems:m}=this,g=""!==c,v=this.plugin.icon||Se,y={showBreadcrumbs:a.showBreadcrumbs,getFolder:this.getFolder,breadcrumbs:this.plugin.getPluginState().breadcrumbs,pluginIcon:v,title:this.plugin.title,logout:this.logout,username:this.username,i18n:o},b={isChecked:d,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:f,currentSelection:p,files:g?m(l):l,folders:g?m(h):h,getNextFolder:this.getNextFolder,getFolder:this.getFolder,loadAllFiles:this.opts.loadAllFiles,showSearchFilter:a.showFilter,search:this.filterQuery,clearSearch:this.clearFilter,searchTerm:c,searchOnInput:!0,searchInputLabel:o("filter"),clearSearchLabel:o("resetFilter"),noResultsLabel:o("noFilesFound"),logout:this.logout,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,headerComponent:(0,n.h)(G,y),title:this.plugin.title,viewType:a.viewType,showTitles:a.showTitles,showBreadcrumbs:a.showBreadcrumbs,pluginIcon:v,i18n:this.plugin.uppy.i18n,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return i.plugin.uppy.validateRestrictions(...arguments)},isLoading:u};return!1===r?(0,n.h)(me,{onUnmount:this.clearSelection},(0,n.h)(U,{pluginName:this.plugin.title,pluginIcon:v,handleAuth:this.handleAuth,i18n:this.plugin.uppy.i18nArray,renderForm:this.opts.renderAuthForm,loading:u})):(0,n.h)(me,{onUnmount:this.clearSelection},(0,n.h)(fe,b))}}async function Ee(e){var t;null==(t=be(this,xe)[xe])||t.abort();const i=new AbortController;be(this,xe)[xe]=i;const n=()=>{i.abort(),this.clearSelection()};try{this.plugin.uppy.on("dashboard:close-panel",n),this.plugin.uppy.on("cancel-all",n),await e(i.signal)}finally{this.plugin.uppy.off("dashboard:close-panel",n),this.plugin.uppy.off("cancel-all",n),be(this,xe)[xe]=void 0}}async function Ae(e){let{requestPath:t,absDirPath:i,signal:n}=e;const{username:r,nextPagePath:s,items:o}=await this.provider.list(t,{signal:n});return this.username=r||this.username,{items:o.map((e=>({...e,absDirPath:i}))),nextPagePath:s}}async function Le(e){let{breadcrumbs:t,signal:i}=e;const n=function(e){return e.slice(1).map((e=>e.name)).join("/")}(t),{items:r,nextPagePath:s}=await be(this,Ie)[Ie]({requestPath:this.nextPagePath,absDirPath:n,signal:i});this.nextPagePath=s;const o=[],a=[];return r.forEach((e=>{e.isFolder?a.push(e):o.push(e)})),{files:o,folders:a}}async function Be(e){let{requestPath:t,absDirPath:i,relDirPath:n,queue:r,onFiles:s,signal:o}=e,a=t;for(;a;){const e=await be(this,Ie)[Ie]({requestPath:a,absDirPath:i,signal:o});a=e.nextPagePath;const t=e.items.filter((e=>!e.isFolder)),l=e.items.filter((e=>e.isFolder));s(t);const h=l.map((async e=>r.add((async()=>be(this,Ne)[Ne]({requestPath:e.requestPath,absDirPath:Pe(i,e.name),relDirPath:Pe(n,e.name),queue:r,onFiles:s,signal:o})))));await Promise.all(h)}}function ze(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Te.VERSION="3.11.0";var He=0;function Oe(e){return"__private_"+He+++"_"+e}const Me={isInputMode:!0,files:[],folders:[],breadcrumbs:[],filterInput:"",currentSelection:[],searchTerm:null},De={viewType:"grid",showTitles:!0,showFilter:!0,showBreadcrumbs:!0};var Re=Oe("updateFilesAndInputMode");function qe(e,t){this.nextPageQuery=e.nextPageQuery,e.items.forEach((e=>{t.push(e)})),this.plugin.setPluginState({currentSelection:[],isInputMode:!1,files:t,searchTerm:e.searchedFor})}(class extends ye{constructor(e,t){super(e,{...De,...t}),Object.defineProperty(this,Re,{value:qe}),this.nextPageQuery=null,this.search=this.search.bind(this),this.clearSearch=this.clearSearch.bind(this),this.resetPluginState=this.resetPluginState.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.render=this.render.bind(this),this.plugin.setPluginState(Me),this.registerRequestClient()}tearDown(){}resetPluginState(){this.plugin.setPluginState(Me)}async search(e){const{searchTerm:t}=this.plugin.getPluginState();if(!e||e!==t){this.setLoading(!0);try{const t=await this.provider.search(e);ze(this,Re)[Re](t,[])}catch(e){this.handleError(e)}finally{this.setLoading(!1)}}}clearSearch(){this.plugin.setPluginState({currentSelection:[],files:[],searchTerm:null})}async handleScroll(e){const t=this.nextPageQuery||null;if(this.shouldHandleScroll(e)&&t){this.isHandlingScroll=!0;try{const{files:e,searchTerm:i}=this.plugin.getPluginState(),n=await this.provider.search(i,t);ze(this,Re)[Re](n,e)}catch(e){this.handleError(e)}finally{this.isHandlingScroll=!1}}}donePicking(){const{currentSelection:e}=this.plugin.getPluginState();this.plugin.uppy.log("Adding remote search provider files"),this.plugin.uppy.addFiles(e.map((e=>this.getTagFile(e)))),this.resetPluginState()}render(e,t){var i=this;void 0===t&&(t={});const{didFirstRender:r,isInputMode:s,searchTerm:o}=this.plugin.getPluginState(),{i18n:a}=this.plugin.uppy;r||this.preFirstRender();const l={...this.opts,...t},{files:h,folders:c,filterInput:u,loading:p,currentSelection:d}=this.plugin.getPluginState(),{isChecked:f,filterItems:m,recordShiftKeyPress:g}=this,v=""!==u,y={isChecked:f,toggleCheckbox:this.toggleCheckbox.bind(this),recordShiftKeyPress:g,currentSelection:d,files:v?m(h):h,folders:v?m(c):c,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,showSearchFilter:l.showFilter,search:this.search,clearSearch:this.clearSearch,searchTerm:o,searchOnInput:!1,searchInputLabel:a("search"),clearSearchLabel:a("resetSearch"),noResultsLabel:a("noSearchResults"),title:this.plugin.title,viewType:l.viewType,showTitles:l.showTitles,showFilter:l.showFilter,isLoading:p,showBreadcrumbs:l.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:a,uppyFiles:this.plugin.uppy.getFiles(),validateRestrictions:function(){return i.plugin.uppy.validateRestrictions(...arguments)}};return s?(0,n.h)(me,{onUnmount:this.resetPluginState},(0,n.h)("div",{className:"uppy-SearchProvider"},(0,n.h)(ne,{search:this.search,inputLabel:a("enterTextToSearch"),buttonLabel:a("searchImages"),inputClassName:"uppy-c-textInput uppy-SearchProvider-input",buttonCSSClassName:"uppy-SearchProvider-searchButton",showButton:!0}))):(0,n.h)(me,{onUnmount:this.resetPluginState},(0,n.h)(fe,y))}}).VERSION="3.11.0"},4414:function(e,t,i){"use strict";var n=i(5181);function r(){return r=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var i=arguments[t];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(e[n]=i[n])}return e},r.apply(this,arguments)}const s={position:"relative",width:"100%",minHeight:"100%"},o={position:"absolute",top:0,left:0,width:"100%",overflow:"visible"};class a extends n.uA{constructor(e){super(e),this.handleScroll=()=>{this.setState({offset:this.base.scrollTop})},this.handleResize=()=>{this.resize()},this.focusElement=null,this.state={offset:0,height:0}}componentDidMount(){this.resize(),window.addEventListener("resize",this.handleResize)}componentWillUpdate(){this.base.contains(document.activeElement)&&(this.focusElement=document.activeElement)}componentDidUpdate(){this.focusElement&&this.focusElement.parentNode&&document.activeElement!==this.focusElement&&this.focusElement.focus(),this.focusElement=null,this.resize()}componentWillUnmount(){window.removeEventListener("resize",this.handleResize)}resize(){const{height:e}=this.state;e!==this.base.offsetHeight&&this.setState({height:this.base.offsetHeight})}render(e){let{data:t,rowHeight:i,renderRow:a,overscanCount:l=10,...h}=e;const{offset:c,height:u}=this.state;let p=Math.floor(c/i),d=Math.floor(u/i);l&&(p=Math.max(0,p-p%l),d+=l);const f=p+d+4,m=t.slice(p,f),g={...s,height:t.length*i},v={...o,top:p*i};return(0,n.h)("div",r({onScroll:this.handleScroll},h),(0,n.h)("div",{role:"presentation",style:g},(0,n.h)("div",{role:"presentation",style:v},m.map(a))))}}t.A=a},5417:function(e,t,i){"use strict";i.d(t,{N:function(){return s}});var n=i(7623);function r(e){let t="";return e.replace(/[^A-Z0-9]/gi,(e=>(t+=`-${function(e){return e.charCodeAt(0).toString(32)}(e)}`,"/")))+t}function s(e){if(function(e){return!(!e.isRemote||!e.remote)&&new Set(["box","dropbox","drive","facebook","unsplash"]).has(e.remote.provider)}(e))return e.id;const t=(0,n.A)(e);return function(e){let t="uppy";return"string"==typeof e.name&&(t+=`-${r(e.name.toLowerCase())}`),void 0!==e.type&&(t+=`-${e.type}`),e.meta&&"string"==typeof e.meta.relativePath&&(t+=`-${r(e.meta.relativePath.toLowerCase())}`),void 0!==e.data.size&&(t+=`-${e.data.size}`),void 0!==e.data.lastModified&&(t+=`-${e.data.lastModified}`),t}({...e,type:t})}},6506:function(e,t,i){"use strict";function n(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)}}i.d(t,{A:function(){return n}})},7623:function(e,t,i){"use strict";i.d(t,{A:function(){return s}});var n=i(6506),r=i(7544);function s(e){var t;if(e.type)return e.type;const i=e.name?null==(t=(0,n.A)(e.name).extension)?void 0:t.toLowerCase():null;return i&&i in r.A?r.A[i]:"application/octet-stream"}},8311:function(e,t,i){"use strict";function n(e){return!!e&&/^[^/]+\/(jpe?g|gif|png|svg|svg\+xml|bmp|webp|avif)$/.test(e)}i.d(t,{A:function(){return n}})},590:function(e,t,i){"use strict";i.d(t,{A:function(){return n}});let n=(e=21)=>{let t="",i=e;for(;i--;)t+="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"[64*Math.random()|0];return t}}}]);