uppy_on_rails 0.29.0 → 0.29.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.
- checksums.yaml +4 -4
- data/README.md +11 -13
- data/lib/uppy_on_rails/version.rb +1 -1
- data/vendor/assets/javascripts/uppy_on_rails.js +2 -0
- data/vendor/assets/stylesheets/uppy_on_rails.css +1 -0
- metadata +3 -5
- data/.gitignore +0 -8
- data/CODE_OF_CONDUCT.md +0 -74
- data/Gemfile +0 -6
- data/uppy_on_rails.gemspec +0 -30
@@ -0,0 +1,2 @@
|
|
1
|
+
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).Uppy=e()}}(function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},n={limit:1,onStart:function(){},onProgress:function(){},onPartComplete:function(){},onSuccess:function(){},onError:function(e){throw e}};function r(e,t){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}var o=function(){function o(e,r){!function(e,t){if(!(e instanceof o))throw new TypeError("Cannot call a class as a function")}(this),this.options=t({},n,r),this.file=e,this.key=this.options.key||null,this.uploadId=this.options.uploadId||null,this.parts=this.options.parts||[],this.isPaused=!1,this.chunks=null,this.chunkState=null,this.uploading=[],this._initChunks()}return o.prototype._initChunks=function(){for(var e=[],t=Math.max(Math.ceil(this.file.size/1e4),5242880),n=0;n<this.file.size;n+=t){var r=Math.min(this.file.size,n+t);e.push(this.file.slice(n,r))}this.chunks=e,this.chunkState=e.map(function(){return{uploaded:0,busy:!1,done:!1}})},o.prototype._createUpload=function(){var t=this;return Promise.resolve().then(function(){return t.options.createMultipartUpload()}).then(function(t){if("object"!==(void 0===t?"undefined":e(t))||!t||"string"!=typeof t.uploadId||"string"!=typeof t.key)throw new TypeError("AwsS3/Multipart: Got incorrect result from 'createMultipartUpload()', expected an object '{ uploadId, key }'.");return t}).then(function(e){t.key=e.key,t.uploadId=e.uploadId,t.options.onStart(e)}).then(function(){t._uploadParts()}).catch(function(e){t._onError(e)})},o.prototype._resumeUpload=function(){var e=this;return Promise.resolve().then(function(){return e.options.listParts({uploadId:e.uploadId,key:e.key})}).then(function(t){t.forEach(function(t){var n=t.PartNumber-1;e.chunkState[n]={uploaded:t.Size,etag:t.ETag,done:!0},e.parts.some(function(e){return e.PartNumber===t.PartNumber})||e.parts.push({PartNumber:t.PartNumber,ETag:t.ETag})}),e._uploadParts()}).catch(function(t){e._onError(t)})},o.prototype._uploadParts=function(){var e=this;if(!this.isPaused){var t=this.options.limit-this.uploading.length;if(0!==t)if(this.chunkState.every(function(e){return e.done}))this._completeUpload();else{for(var n=[],r=0;r<this.chunkState.length;r++){var o=this.chunkState[r];if(!o.done&&!o.busy&&(n.push(r),n.length>=t))break}n.forEach(function(t){e._uploadPart(t)})}}},o.prototype._uploadPart=function(t){var n=this,r=this.chunks[t];return this.chunkState[t].busy=!0,Promise.resolve().then(function(){return n.options.prepareUploadPart({key:n.key,uploadId:n.uploadId,body:r,number:t+1})}).then(function(t){if("object"!==(void 0===t?"undefined":e(t))||!t||"string"!=typeof t.url)throw new TypeError("AwsS3/Multipart: Got incorrect result from 'prepareUploadPart()', expected an object '{ url }'.");return t}).then(function(e){var r=e.url;n._uploadPartBytes(t,r)},function(e){n._onError(e)})},o.prototype._onPartProgress=function(e,t,n){this.chunkState[e].uploaded=t;var r=this.chunkState.reduce(function(e,t){return e+t.uploaded},0);this.options.onProgress(r,this.file.size)},o.prototype._onPartComplete=function(e,t){this.chunkState[e].etag=t,this.chunkState[e].done=!0;var n={PartNumber:e+1,ETag:t};this.parts.push(n),this.options.onPartComplete(n),this._uploadParts()},o.prototype._uploadPartBytes=function(e,t){var n=this,o=this.chunks[e],i=new XMLHttpRequest;i.open("PUT",t,!0),i.responseType="text",this.uploading.push(i),i.upload.addEventListener("progress",function(t){t.lengthComputable&&n._onPartProgress(e,t.loaded,t.total)}),i.addEventListener("abort",function(t){r(n.uploading,t.target),n.chunkState[e].busy=!1}),i.addEventListener("load",function(t){if(r(n.uploading,t.target),n.chunkState[e].busy=!1,t.target.status<200||t.target.status>=300)n._onError(new Error("Non 2xx"));else{n._onPartProgress(e,o.size,o.size);var i=t.target.getResponseHeader("ETag");null!==i?n._onPartComplete(e,i):n._onError(new Error("AwsS3/Multipart: Could not read the ETag header. This likely means CORS is not configured correctly on the S3 Bucket. Seee https://uppy.io/docs/aws-s3-multipart#S3-Bucket-Configuration for instructions."))}}),i.addEventListener("error",function(t){r(n.uploading,t.target),n.chunkState[e].busy=!1;var o=new Error("Unknown error");o.source=t.target,n._onError(o)}),i.send(o)},o.prototype._completeUpload=function(){var e=this;return this.parts.sort(function(e,t){return e.PartNumber-t.PartNumber}),Promise.resolve().then(function(){return e.options.completeMultipartUpload({key:e.key,uploadId:e.uploadId,parts:e.parts})}).then(function(t){e.options.onSuccess(t)},function(t){e._onError(t)})},o.prototype._abortUpload=function(){this.uploading.slice().forEach(function(e){e.abort()}),this.options.abortMultipartUpload({key:this.key,uploadId:this.uploadId}),this.uploading=[]},o.prototype._onError=function(e){this.options.onError(e)},o.prototype.start=function(){this.isPaused=!1,this.uploadId?this._resumeUpload():this._createUpload()},o.prototype.pause=function(){this.uploading.slice().forEach(function(e){e.abort()}),this.isPaused=!0},o.prototype.abort=function(){if(!(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).really)return this.pause();this._abortUpload()},o}(),i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},s=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),a=function(){function e(t,n){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.uppy=t,this.opts=n,this.onReceiveResponse=this.onReceiveResponse.bind(this)}return e.prototype.onReceiveResponse=function(e){var t,n=this.uppy.getState().companion||{},r=this.opts.serverUrl,o=e.headers;return o.has("i-am")&&o.get("i-am")!==n[r]&&this.uppy.setState({companion:i({},n,(t={},t[r]=o.get("i-am"),t))}),e},e.prototype._getUrl=function(e){return/^(https?:|)\/\//.test(e)?e:this.hostname+"/"+e},e.prototype.get=function(e){var t=this;return fetch(this._getUrl(e),{method:"get",headers:this.headers,credentials:"same-origin"}).then(this.onReceiveResponse).then(function(e){return e.json()}).catch(function(n){throw new Error("Could not get "+t._getUrl(e)+". "+n)})},e.prototype.post=function(e,t){var n=this;return fetch(this._getUrl(e),{method:"post",headers:this.headers,credentials:"same-origin",body:JSON.stringify(t)}).then(this.onReceiveResponse).then(function(t){if(t.status<200||t.status>300)throw new Error("Could not post "+n._getUrl(e)+". "+t.statusText);return t.json()}).catch(function(t){throw new Error("Could not post "+n._getUrl(e)+". "+t)})},e.prototype.delete=function(e,t){var n=this;return fetch(this.hostname+"/"+e,{method:"delete",headers:this.headers,credentials:"same-origin",body:t?JSON.stringify(t):null}).then(this.onReceiveResponse).then(function(e){return e.json()}).catch(function(t){throw new Error("Could not delete "+n._getUrl(e)+". "+t)})},s(e,[{key:"hostname",get:function(){var e=this.uppy.getState().companion,t=this.opts.serverUrl;return(e&&e[t]?e[t]:t).replace(/\/$/,"")}},{key:"defaultHeaders",get:function(){return{Accept:"application/json","Content-Type":"application/json"}}},{key:"headers",get:function(){return i({},this.defaultHeaders,this.opts.serverHeaders||{})}}]),e}(),l=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},u=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),p=function(e){return e.split("-").map(function(e){return e.charAt(0).toUpperCase()+e.slice(1)}).join(" ")},c=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.provider=r.provider,o.id=o.provider,o.authProvider=r.authProvider||o.provider,o.name=o.opts.name||p(o.id),o.tokenKey="companion-"+o.id+"-auth-token",o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.setAuthToken=function(e){localStorage.setItem(this.tokenKey,e)},t.prototype.checkAuth=function(){return this.get(this.id+"/authorized").then(function(e){return e.authenticated})},t.prototype.authUrl=function(){return this.hostname+"/"+this.id+"/connect"},t.prototype.fileUrl=function(e){return this.hostname+"/"+this.id+"/get/"+e},t.prototype.list=function(e){return this.get(this.id+"/list/"+(e||""))},t.prototype.logout=function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:location.href;return this.get(this.id+"/logout?redirect="+t).then(function(t){return localStorage.removeItem(e.tokenKey),t})},t.initPlugin=function(e,t,n){if(e.type="acquirer",e.files=[],n&&(e.opts=l({},n,t)),t.serverPattern){var r=t.serverPattern;if(!("string"==typeof r||Array.isArray(r)||r instanceof RegExp))throw new TypeError(e.id+': the option "serverPattern" must be one of string, Array, RegExp');e.opts.serverPattern=r}else/^(?!https?:\/\/).*$/.test(t.serverUrl)?e.opts.serverPattern=location.protocol+"//"+t.serverUrl.replace(/^\/\//,""):e.opts.serverPattern=t.serverUrl},u(t,[{key:"defaultHeaders",get:function(){return l({},e.prototype.defaultHeaders,{"uppy-auth-token":localStorage.getItem(this.tokenKey)})}}]),t}(a),h=function(){var e={},t=e._fns={};return e.emit=function(e,n,r,o,i,s,a){var l=function(e){for(var n=t[e]?t[e]:[],r=e.indexOf(":"),o=-1===r?[e]:[e.substring(0,r),e.substring(r+1)],i=Object.keys(t),s=0,a=i.length;s<a;s++){var l=i[s];if("*"===l&&(n=n.concat(t[l])),2===o.length&&o[0]===l){n=n.concat(t[l]);break}}return n}(e);l.length&&function(e,t,n){for(var r=0,o=t.length;r<o&&t[r];r++)t[r].event=e,t[r].apply(t[r],n)}(e,l,[n,r,o,i,s,a])},e.on=function(e,n){t[e]||(t[e]=[]),t[e].push(n)},e.once=function(t,n){this.on(t,function r(){n.apply(this,arguments),e.off(t,r)})},e.off=function(e,t){var n=[];if(e&&t)for(var r=this._fns[e],o=0,i=r?r.length:0;o<i;o++)r[o]!==t&&n.push(r[o]);n.length?this._fns[e]=n:delete this._fns[e]},e},d={RequestClient:a,Provider:c,Socket:function(){function e(t){var n=this;!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.queued=[],this.isOpen=!1,this.socket=new WebSocket(t.target),this.emitter=h(),this.socket.onopen=function(e){for(n.isOpen=!0;n.queued.length>0&&n.isOpen;){var t=n.queued[0];n.send(t.action,t.payload),n.queued=n.queued.slice(1)}},this.socket.onclose=function(e){n.isOpen=!1},this._handleMessage=this._handleMessage.bind(this),this.socket.onmessage=this._handleMessage,this.close=this.close.bind(this),this.emit=this.emit.bind(this),this.on=this.on.bind(this),this.once=this.once.bind(this),this.send=this.send.bind(this)}return e.prototype.close=function(){return this.socket.close()},e.prototype.send=function(e,t){this.isOpen?this.socket.send(JSON.stringify({action:e,payload:t})):this.queued.push({action:e,payload:t})},e.prototype.on=function(e,t){this.emitter.on(e,t)},e.prototype.emit=function(e,t){this.emitter.emit(e,t)},e.prototype.once=function(e,t){this.emitter.once(e,t)},e.prototype._handleMessage=function(e){try{var t=JSON.parse(e.data);this.emit(t.action,t.payload)}catch(e){console.log(e)}},e}()},f=function(e,t){var n="000000000"+e;return n.substr(n.length-t)},y="object"==typeof window?window:self,g=Object.keys(y).length,m=f(((navigator.mimeTypes?navigator.mimeTypes.length:0)+navigator.userAgent.length).toString(36)+g.toString(36),4),v=function(){return m},b={},w=0,S=4,C=36,_=Math.pow(C,S);function P(){return f((Math.random()*_<<0).toString(C),S)}function E(){return w=w<_?w:0,++w-1}function F(){return"c"+(new Date).getTime().toString(C)+f(E().toString(C),S)+v()+(P()+P())}F.slug=function(){var e=(new Date).getTime().toString(36),t=E().toString(36).slice(-4),n=v().slice(0,1)+v().slice(-1),r=P().slice(-2);return e.slice(-2)+t+n+r},F.isCuid=function(e){return"string"==typeof e&&!!e.startsWith("c")},F.isSlug=function(e){if("string"!=typeof e)return!1;var t=e.length;return t>=7&&t<=10},F.fingerprint=v,b=F;var k={};function A(e,t){this.text=e=e||"",this.hasWild=~e.indexOf("*"),this.separator=t,this.parts=e.split(t)}A.prototype.match=function(e){var t,n,r=!0,o=this.parts,i=o.length;if("string"==typeof e||e instanceof String)if(this.hasWild||this.text==e){for(n=(e||"").split(this.separator),t=0;r&&t<i;t++)"*"!==o[t]&&(r=t<n.length&&o[t]===n[t]);r=r&&n}else r=!1;else if("function"==typeof e.splice)for(r=[],t=e.length;t--;)this.match(e[t])&&(r[r.length]=e[t]);else if("object"==typeof e)for(var s in r={},e)this.match(s)&&(r[s]=e[s]);return r},k=function(e,t,n){var r=new A(e,n||/[\/\.]/);return void 0!==t?r.match(t):r};var T=/[\/\+\.]/,O=function(e){if("number"!=typeof e||isNaN(e))throw new TypeError("Expected a number, got "+typeof e);var t=e<0,n=["B","KB","MB","GB","TB","PB","EB","ZB","YB"];if(t&&(e=-e),e<1)return(t?"-":"")+e+" B";var r=Math.min(Math.floor(Math.log(e)/Math.log(1e3)),n.length-1);e=Number(e/Math.pow(1e3,r));var o=n[r];return e>=10||e%1==0?(t?"-":"")+e.toFixed(0)+" "+o:(t?"-":"")+e.toFixed(1)+" "+o},U={exports:{}};!function(){"use strict";function e(e,t){var n,r,o,i,s=C;for(i=arguments.length;i-- >2;)S.push(arguments[i]);for(t&&null!=t.children&&(S.length||S.push(t.children),delete t.children);S.length;)if((r=S.pop())&&void 0!==r.pop)for(i=r.length;i--;)S.push(r[i]);else"boolean"==typeof r&&(r=null),(o="function"!=typeof e)&&(null==r?r="":"number"==typeof r?r=String(r):"string"!=typeof r&&(o=!1)),o&&n?s[s.length-1]+=r:s===C?s=[r]:s.push(r),n=o;var a=new b;return a.nodeName=e,a.children=s,a.attributes=null==t?void 0:t,a.key=null==t?void 0:t.key,void 0!==w.vnode&&w.vnode(a),a}function t(e,t){for(var n in t)e[n]=t[n];return e}function n(e){!e.__d&&(e.__d=!0)&&1==E.push(e)&&(w.debounceRendering||_)(r)}function r(){var e,t=E;for(E=[];e=t.pop();)e.__d&&g(e)}function o(e,t){return e.__n===t||e.nodeName.toLowerCase()===t.toLowerCase()}function i(e){var n=t({},e.attributes);n.children=e.children;var r=e.nodeName.defaultProps;if(void 0!==r)for(var o in r)void 0===n[o]&&(n[o]=r[o]);return n}function s(e){var t=e.parentNode;t&&t.removeChild(e)}function a(e,t,n,r,o){if("className"===t&&(t="class"),"key"===t);else if("ref"===t)n&&n(null),r&&r(e);else if("class"!==t||o)if("style"===t){if(r&&"string"!=typeof r&&"string"!=typeof n||(e.style.cssText=r||""),r&&"object"==typeof r){if("string"!=typeof n)for(var i in n)i in r||(e.style[i]="");for(var i in r)e.style[i]="number"==typeof r[i]&&!1===P.test(i)?r[i]+"px":r[i]}}else if("dangerouslySetInnerHTML"===t)r&&(e.innerHTML=r.__html||"");else if("o"==t[0]&&"n"==t[1]){var s=t!==(t=t.replace(/Capture$/,""));t=t.toLowerCase().substring(2),r?n||e.addEventListener(t,l,s):e.removeEventListener(t,l,s),(e.__l||(e.__l={}))[t]=r}else if("list"!==t&&"type"!==t&&!o&&t in e){try{e[t]=null==r?"":r}catch(e){}null!=r&&!1!==r||"spellcheck"==t||e.removeAttribute(t)}else{var a=o&&t!==(t=t.replace(/^xlink:?/,""));null==r||!1===r?a?e.removeAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase()):e.removeAttribute(t):"function"!=typeof r&&(a?e.setAttributeNS("http://www.w3.org/1999/xlink",t.toLowerCase(),r):e.setAttribute(t,r))}else e.className=r||""}function l(e){return this.__l[e.type](w.event&&w.event(e)||e)}function u(){for(var e;e=F.pop();)w.afterMount&&w.afterMount(e),e.componentDidMount&&e.componentDidMount()}function p(e,t,n,r,l,p){k++||(A=null!=l&&void 0!==l.ownerSVGElement,T=null!=e&&!("__preactattr_"in e));var h=function e(t,n,r,l,u){var p=t,h=A;if(null!=n&&"boolean"!=typeof n||(n=""),"string"==typeof n||"number"==typeof n)return t&&void 0!==t.splitText&&t.parentNode&&(!t._component||u)?t.nodeValue!=n&&(t.nodeValue=n):(p=document.createTextNode(n),t&&(t.parentNode&&t.parentNode.replaceChild(p,t),c(t,!0))),p.__preactattr_=!0,p;var f,g,v=n.nodeName;if("function"==typeof v)return function(e,t,n,r){for(var o=e&&e._component,s=o,a=e,l=o&&e._componentConstructor===t.nodeName,u=l,p=i(t);o&&!u&&(o=o.__u);)u=o.constructor===t.nodeName;return o&&u&&(!r||o._component)?(y(o,p,3,n,r),e=o.base):(s&&!l&&(m(s),e=a=null),o=d(t.nodeName,p,n),e&&!o.__b&&(o.__b=e,a=null),y(o,p,1,n,r),e=o.base,a&&e!==a&&(a._component=null,c(a,!1))),e}(t,n,r,l);if(A="svg"===v||"foreignObject"!==v&&A,v=String(v),(!t||!o(t,v))&&(f=v,(g=A?document.createElementNS("http://www.w3.org/2000/svg",f):document.createElement(f)).__n=f,p=g,t)){for(;t.firstChild;)p.appendChild(t.firstChild);t.parentNode&&t.parentNode.replaceChild(p,t),c(t,!0)}var b=p.firstChild,w=p.__preactattr_,S=n.children;if(null==w){w=p.__preactattr_={};for(var C=p.attributes,_=C.length;_--;)w[C[_].name]=C[_].value}return!T&&S&&1===S.length&&"string"==typeof S[0]&&null!=b&&void 0!==b.splitText&&null==b.nextSibling?b.nodeValue!=S[0]&&(b.nodeValue=S[0]):(S&&S.length||null!=b)&&function(t,n,r,i,a){var l,u,p,h,d,f,y,g,m=t.childNodes,v=[],b={},w=0,S=0,C=m.length,_=0,P=n?n.length:0;if(0!==C)for(var E=0;E<C;E++){var F=m[E],k=F.__preactattr_,A=P&&k?F._component?F._component.__k:k.key:null;null!=A?(w++,b[A]=F):(k||(void 0!==F.splitText?!a||F.nodeValue.trim():a))&&(v[_++]=F)}if(0!==P)for(var E=0;E<P;E++){h=n[E],d=null;var A=h.key;if(null!=A)w&&void 0!==b[A]&&(d=b[A],b[A]=void 0,w--);else if(S<_)for(l=S;l<_;l++)if(void 0!==v[l]&&(f=u=v[l],g=a,"string"==typeof(y=h)||"number"==typeof y?void 0!==f.splitText:"string"==typeof y.nodeName?!f._componentConstructor&&o(f,y.nodeName):g||f._componentConstructor===y.nodeName)){d=u,v[l]=void 0,l===_-1&&_--,l===S&&S++;break}d=e(d,h,r,i),p=m[E],d&&d!==t&&d!==p&&(null==p?t.appendChild(d):d===p.nextSibling?s(p):t.insertBefore(d,p))}if(w)for(var E in b)void 0!==b[E]&&c(b[E],!1);for(;S<=_;)void 0!==(d=v[_--])&&c(d,!1)}(p,S,r,l,T||null!=w.dangerouslySetInnerHTML),function(e,t,n){var r;for(r in n)t&&null!=t[r]||null==n[r]||a(e,r,n[r],n[r]=void 0,A);for(r in t)"children"===r||"innerHTML"===r||r in n&&t[r]===("value"===r||"checked"===r?e[r]:n[r])||a(e,r,n[r],n[r]=t[r],A)}(p,n.attributes,w),A=h,p}(e,t,n,r,p);return l&&h.parentNode!==l&&l.appendChild(h),--k||(T=!1,p||u()),h}function c(e,t){var n=e._component;n?m(n):(null!=e.__preactattr_&&e.__preactattr_.ref&&e.__preactattr_.ref(null),!1!==t&&null!=e.__preactattr_||s(e),h(e))}function h(e){for(e=e.lastChild;e;){var t=e.previousSibling;c(e,!0),e=t}}function d(e,t,n){var r,o=O.length;for(e.prototype&&e.prototype.render?(r=new e(t,n),v.call(r,t,n)):((r=new v(t,n)).constructor=e,r.render=f);o--;)if(O[o].constructor===e)return r.__b=O[o].__b,O.splice(o,1),r;return r}function f(e,t,n){return this.constructor(e,n)}function y(e,t,r,o,i){e.__x||(e.__x=!0,e.__r=t.ref,e.__k=t.key,delete t.ref,delete t.key,void 0===e.constructor.getDerivedStateFromProps&&(!e.base||i?e.componentWillMount&&e.componentWillMount():e.componentWillReceiveProps&&e.componentWillReceiveProps(t,o)),o&&o!==e.context&&(e.__c||(e.__c=e.context),e.context=o),e.__p||(e.__p=e.props),e.props=t,e.__x=!1,0!==r&&(1!==r&&!1===w.syncComponentUpdates&&e.base?n(e):g(e,1,i)),e.__r&&e.__r(e))}function g(e,n,r,o){if(!e.__x){var s,a,l,h=e.props,f=e.state,v=e.context,b=e.__p||h,S=e.__s||f,C=e.__c||v,_=e.base,P=e.__b,E=_||P,A=e._component,T=!1,O=C;if(e.constructor.getDerivedStateFromProps&&(f=t(t({},f),e.constructor.getDerivedStateFromProps(h,f)),e.state=f),_&&(e.props=b,e.state=S,e.context=C,2!==n&&e.shouldComponentUpdate&&!1===e.shouldComponentUpdate(h,f,v)?T=!0:e.componentWillUpdate&&e.componentWillUpdate(h,f,v),e.props=h,e.state=f,e.context=v),e.__p=e.__s=e.__c=e.__b=null,e.__d=!1,!T){s=e.render(h,f,v),e.getChildContext&&(v=t(t({},v),e.getChildContext())),_&&e.getSnapshotBeforeUpdate&&(O=e.getSnapshotBeforeUpdate(b,S));var U,x,R=s&&s.nodeName;if("function"==typeof R){var D=i(s);(a=A)&&a.constructor===R&&D.key==a.__k?y(a,D,1,v,!1):(U=a,e._component=a=d(R,D,v),a.__b=a.__b||P,a.__u=e,y(a,D,0,v,!1),g(a,1,r,!0)),x=a.base}else l=E,(U=A)&&(l=e._component=null),(E||1===n)&&(l&&(l._component=null),x=p(l,s,v,r||!_,E&&E.parentNode,!0));if(E&&x!==E&&a!==A){var B=E.parentNode;B&&x!==B&&(B.replaceChild(x,E),U||(E._component=null,c(E,!1)))}if(U&&m(U),e.base=x,x&&!o){for(var j=e,I=e;I=I.__u;)(j=I).base=x;x._component=j,x._componentConstructor=j.constructor}}for(!_||r?F.unshift(e):T||(e.componentDidUpdate&&e.componentDidUpdate(b,S,O),w.afterUpdate&&w.afterUpdate(e));e.__h.length;)e.__h.pop().call(e);k||o||u()}}function m(e){w.beforeUnmount&&w.beforeUnmount(e);var t=e.base;e.__x=!0,e.componentWillUnmount&&e.componentWillUnmount(),e.base=null;var n=e._component;n?m(n):t&&(t.__preactattr_&&t.__preactattr_.ref&&t.__preactattr_.ref(null),e.__b=t,s(t),O.push(e),h(t)),e.__r&&e.__r(null)}function v(e,t){this.__d=!0,this.context=t,this.props=e,this.state=this.state||{},this.__h=[]}var b=function(){},w={},S=[],C=[],_="function"==typeof Promise?Promise.resolve().then.bind(Promise.resolve()):setTimeout,P=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,E=[],F=[],k=0,A=!1,T=!1,O=[];t(v.prototype,{setState:function(e,r){this.__s||(this.__s=this.state),this.state=t(t({},this.state),"function"==typeof e?e(this.state,this.props):e),r&&this.__h.push(r),n(this)},forceUpdate:function(e){e&&this.__h.push(e),g(this,2)},render:function(){}});var x={h:e,createElement:e,cloneElement:function(n,r){return e(n.nodeName,t(t({},n.attributes),r),arguments.length>2?[].slice.call(arguments,2):n.children)},Component:v,render:function(e,t,n){return p(n,e,{},!1,t,!1)},rerender:r,options:w};U.exports=x}(),U=U.exports;var x="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},R=function(e){return e&&"object"===(void 0===e?"undefined":x(e))&&e.nodeType===Node.ELEMENT_NODE},D="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},B=function(e){return"string"==typeof e?document.querySelector(e):"object"===(void 0===e?"undefined":D(e))&&R(e)?e:void 0},j="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},I=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},L=function(){function e(t,n){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.uppy=t,this.opts=n||{},this.update=this.update.bind(this),this.mount=this.mount.bind(this),this.install=this.install.bind(this),this.uninstall=this.uninstall.bind(this)}return e.prototype.getPluginState=function(){return this.uppy.getState().plugins[this.id]||{}},e.prototype.setPluginState=function(e){var t,n=this.uppy.getState().plugins;this.uppy.setState({plugins:I({},n,(t={},t[this.id]=I({},n[this.id],e),t))})},e.prototype.update=function(e){void 0!==this.el&&this._updateUI&&this._updateUI(e)},e.prototype.onMount=function(){},e.prototype.mount=function(t,n){var r,o,i,s=this,a=n.id,l=B(t);if(l)return this.isTargetDOMEl=!0,this.rerender=function(e){s.uppy.getPlugin(s.id)&&(s.el=U.render(s.render(e),l,s.el))},this._updateUI=(r=this.rerender,o=null,i=null,function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return i=t,o||(o=Promise.resolve().then(function(){return o=null,r.apply(void 0,i)})),o}),this.uppy.log("Installing "+a+" to a DOM element"),this.opts.replaceTargetContent&&(l.innerHTML=""),this.el=U.render(this.render(this.uppy.getState()),l),this.onMount(),this.el;var u=void 0;if("object"===(void 0===t?"undefined":j(t))&&t instanceof e)u=t;else if("function"==typeof t){var p=t;this.uppy.iteratePlugins(function(e){if(e instanceof p)return u=e,!1})}if(u)return this.uppy.log("Installing "+a+" to "+u.id),this.parent=u,this.el=u.addTarget(n),this.onMount(),this.el;throw this.uppy.log("Not installing "+a),new Error("Invalid target option given to "+a+". Please make sure that the element \n exists on the page, or that the plugin you are targeting has been installed. Check that the <script> tag initializing Uppy \n comes at the bottom of the page, before the closing </body> tag (see https://github.com/transloadit/uppy/issues/1042).")},e.prototype.render=function(e){throw new Error("Extend the render method to add your plugin to a DOM element")},e.prototype.addTarget=function(e){throw new Error("Extend the addTarget method to add your plugin to another plugin's target")},e.prototype.unmount=function(){this.isTargetDOMEl&&this.el&&this.el.parentNode&&this.el.parentNode.removeChild(this.el)},e.prototype.install=function(){},e.prototype.uninstall=function(){this.unmount()},e}(),M=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},N=function(){function e(){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.state={},this.callbacks=[]}return e.prototype.getState=function(){return this.state},e.prototype.setState=function(e){var t=M({},this.state),n=M({},this.state,e);this.state=n,this._publish(t,n,e)},e.prototype.subscribe=function(e){var t=this;return this.callbacks.push(e),function(){t.callbacks.splice(t.callbacks.indexOf(e),1)}},e.prototype._publish=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];this.callbacks.forEach(function(e){e.apply(void 0,t)})},e}(),z=function(){return new N},q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},H=function(){function e(t){var n=this;!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.locale={strings:{},pluralize:function(e){return 1===e?0:1}},Array.isArray(t)?t.forEach(function(e){return n._apply(e)}):this._apply(t)}return e.prototype._apply=function(e){if(e&&e.strings){var t=this.locale;this.locale=q({},t,{strings:q({},t.strings,e.strings)}),this.locale.pluralize=e.pluralize||t.pluralize}},e.prototype.interpolate=function(e,t){var n=String.prototype,r=n.split,o=n.replace,i=/\$/g,s=[e];for(var a in t)if("_"!==a&&t.hasOwnProperty(a)){var l=t[a];"string"==typeof l&&(l=o.call(t[a],i,"$$$$")),s=u(s,new RegExp("%\\{"+a+"\\}","g"),l)}return s;function u(e,t,n){var o=[];return e.forEach(function(e){r.call(e,t).forEach(function(e,t,r){""!==e&&o.push(e),t<r.length-1&&o.push(n)})}),o}},e.prototype.translate=function(e,t){return this.translateArray(e,t).join("")},e.prototype.translateArray=function(e,t){if(t&&void 0!==t.smart_count){var n=this.locale.pluralize(t.smart_count);return this.interpolate(this.locale.strings[e][n],t)}return this.interpolate(this.locale.strings[e],t)},e}(),W=function(e){return["uppy",e.name?e.name.toLowerCase().replace(/[^A-Z0-9]/gi,""):"",e.type,e.data.size,e.data.lastModified].filter(function(e){return e}).join("-")},X=function(e){var t=/(?:\.([^.]+))?$/.exec(e)[1];return{name:e.replace("."+t,""),extension:t}},G={md:"text/markdown",markdown:"text/markdown",mp4:"video/mp4",mp3:"audio/mp3",svg:"image/svg+xml",jpg:"image/jpeg",png:"image/png",gif:"image/gif",yaml:"text/yaml",yml:"text/yaml",csv:"text/csv",avi:"video/x-msvideo",mks:"video/x-matroska",mkv:"video/x-matroska",mov:"video/quicktime",doc:"application/msword",docm:"application/vnd.ms-word.document.macroenabled.12",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",dot:"application/msword",dotm:"application/vnd.ms-word.template.macroenabled.12",dotx:"application/vnd.openxmlformats-officedocument.wordprocessingml.template",xla:"application/vnd.ms-excel",xlam:"application/vnd.ms-excel.addin.macroenabled.12",xlc:"application/vnd.ms-excel",xlf:"application/x-xliff+xml",xlm:"application/vnd.ms-excel",xls:"application/vnd.ms-excel",xlsb:"application/vnd.ms-excel.sheet.binary.macroenabled.12",xlsm:"application/vnd.ms-excel.sheet.macroenabled.12",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",xlt:"application/vnd.ms-excel",xltm:"application/vnd.ms-excel.template.macroenabled.12",xltx:"application/vnd.openxmlformats-officedocument.spreadsheetml.template",xlw:"application/vnd.ms-excel"},V=function(e){var t=e.name?X(e.name).extension:null;return t=t?t.toLowerCase():null,e.isRemote?e.type?e.type:G[t]:e.type?e.type:t&&G[t]?G[t]:"application/octet-stream"};function K(e){return 2!==e.length?0+e:e}var Y,J=function(){var e=new Date;return K(e.getHours().toString())+":"+K(e.getMinutes().toString())+":"+K(e.getSeconds().toString())},$="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Q=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Z=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}(),ee=function(){function e(t){var n=this;!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this);var r={strings:{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"},exceedsSize:"This file exceeds maximum allowed size of",youCanOnlyUploadFileTypes:"You can only upload:",companionError:"Connection with Companion failed",failedToUpload:"Failed to upload %{file}",noInternetConnection:"No Internet connection",connectedToInternet:"Connected to the Internet",noFilesFound:"You have no files or folders here",selectXFiles:{0:"Select %{smart_count} file",1:"Select %{smart_count} files"},cancel:"Cancel",logOut:"Log out"}},o={id:"uppy",autoProceed:!1,allowMultipleUploads:!0,debug:!1,restrictions:{maxFileSize:null,maxNumberOfFiles:null,minNumberOfFiles:null,allowedFileTypes:null},meta:{},onBeforeFileAdded:function(e,t){return e},onBeforeUpload:function(e){return e},locale:r,store:z()};this.opts=Q({},o,t),this.opts.restrictions=Q({},o.restrictions,this.opts.restrictions),this.translator=new H([r,this.opts.locale]),this.locale=this.translator.locale,this.i18n=this.translator.translate.bind(this.translator),this.plugins={},this.getState=this.getState.bind(this),this.getPlugin=this.getPlugin.bind(this),this.setFileMeta=this.setFileMeta.bind(this),this.setFileState=this.setFileState.bind(this),this.log=this.log.bind(this),this.info=this.info.bind(this),this.hideInfo=this.hideInfo.bind(this),this.addFile=this.addFile.bind(this),this.removeFile=this.removeFile.bind(this),this.pauseResume=this.pauseResume.bind(this),this._calculateProgress=this._calculateProgress.bind(this),this.updateOnlineStatus=this.updateOnlineStatus.bind(this),this.resetProgress=this.resetProgress.bind(this),this.pauseAll=this.pauseAll.bind(this),this.resumeAll=this.resumeAll.bind(this),this.retryAll=this.retryAll.bind(this),this.cancelAll=this.cancelAll.bind(this),this.retryUpload=this.retryUpload.bind(this),this.upload=this.upload.bind(this),this.emitter=h(),this.on=this.on.bind(this),this.off=this.off.bind(this),this.once=this.emitter.once.bind(this.emitter),this.emit=this.emitter.emit.bind(this.emitter),this.preProcessors=[],this.uploaders=[],this.postProcessors=[],this.store=this.opts.store,this.setState({plugins:{},files:{},currentUploads:{},allowNewUpload:!0,capabilities:{resumableUploads:!1},totalProgress:0,meta:Q({},this.opts.meta),info:{isHidden:!0,type:"info",message:""}}),this._storeUnsubscribe=this.store.subscribe(function(e,t,r){n.emit("state-update",e,t,r),n.updateAll(t)}),this.opts.debug&&"undefined"!=typeof window&&(window.uppyLog="",window[this.opts.id]=this),this._addListeners()}return e.prototype.on=function(e,t){return this.emitter.on(e,t),this},e.prototype.off=function(e,t){return this.emitter.off(e,t),this},e.prototype.updateAll=function(e){this.iteratePlugins(function(t){t.update(e)})},e.prototype.setState=function(e){this.store.setState(e)},e.prototype.getState=function(){return this.store.getState()},e.prototype.setFileState=function(e,t){var n;if(!this.getState().files[e])throw new Error("Can\u2019t set state for "+e+" (the file could have been removed)");this.setState({files:Q({},this.getState().files,(n={},n[e]=Q({},this.getState().files[e],t),n))})},e.prototype.resetProgress=function(){var e={percentage:0,bytesUploaded:0,uploadComplete:!1,uploadStarted:!1},t=Q({},this.getState().files),n={};Object.keys(t).forEach(function(r){var o=Q({},t[r]);o.progress=Q({},o.progress,e),n[r]=o}),this.setState({files:n,totalProgress:0}),this.emit("reset-progress")},e.prototype.addPreProcessor=function(e){this.preProcessors.push(e)},e.prototype.removePreProcessor=function(e){var t=this.preProcessors.indexOf(e);-1!==t&&this.preProcessors.splice(t,1)},e.prototype.addPostProcessor=function(e){this.postProcessors.push(e)},e.prototype.removePostProcessor=function(e){var t=this.postProcessors.indexOf(e);-1!==t&&this.postProcessors.splice(t,1)},e.prototype.addUploader=function(e){this.uploaders.push(e)},e.prototype.removeUploader=function(e){var t=this.uploaders.indexOf(e);-1!==t&&this.uploaders.splice(t,1)},e.prototype.setMeta=function(e){var t=Q({},this.getState().meta,e),n=Q({},this.getState().files);Object.keys(n).forEach(function(t){n[t]=Q({},n[t],{meta:Q({},n[t].meta,e)})}),this.log("Adding metadata:"),this.log(e),this.setState({meta:t,files:n})},e.prototype.setFileMeta=function(e,t){var n=Q({},this.getState().files);if(n[e]){var r=Q({},n[e].meta,t);n[e]=Q({},n[e],{meta:r}),this.setState({files:n})}else this.log("Was trying to set metadata for a file that\u2019s not with us anymore: ",e)},e.prototype.getFile=function(e){return this.getState().files[e]},e.prototype.getFiles=function(){var e=this.getState().files;return Object.keys(e).map(function(t){return e[t]})},e.prototype._checkMinNumberOfFiles=function(e){var t=this.opts.restrictions.minNumberOfFiles;if(Object.keys(e).length<t)throw new Error(""+this.i18n("youHaveToAtLeastSelectX",{smart_count:t}))},e.prototype._checkRestrictions=function(e){var t=this.opts.restrictions,n=t.maxFileSize,r=t.maxNumberOfFiles,o=t.allowedFileTypes;if(r&&Object.keys(this.getState().files).length+1>r)throw new Error(""+this.i18n("youCanOnlyUploadX",{smart_count:r}));if(o&&!(o.filter(function(t){return t.indexOf("/")>-1?!!e.type&&function(e,t){function n(t){var n=k(t,e,T);return n&&n.length>=2}return t?n(t.split(";")[0]):n}(e.type,t):"."===t[0]&&e.extension===t.substr(1)?e.extension:void 0}).length>0)){var i=o.join(", ");throw new Error(this.i18n("youCanOnlyUploadFileTypes")+" "+i)}if(n&&e.data.size>n)throw new Error(this.i18n("exceedsSize")+" "+O(n))},e.prototype.addFile=function(e){var t,n=this,r=this.getState(),o=r.files,i=function(e){var t="object"===(void 0===e?"undefined":$(e))?e:new Error(e);throw n.log(t.message),n.info(t.message,"error",5e3),t};!1===r.allowNewUpload&&i(new Error("Cannot add new files: already uploading."));var s=this.opts.onBeforeFileAdded(e,o);if(!1!==s){if("object"===(void 0===s?"undefined":$(s))&&s){if(s.then)throw new TypeError("onBeforeFileAdded() returned a Promise, but this is no longer supported. It must be synchronous.");e=s}var a,l=V(e);a=e.name?e.name:"image"===l.split("/")[0]?l.split("/")[0]+"."+l.split("/")[1]:"noname";var u=X(a).extension,p=e.isRemote||!1,c=W(e),h=e.meta||{};h.name=a,h.type=l;var d={source:e.source||"",id:c,name:a,extension:u||"",meta:Q({},this.getState().meta,h),type:l,data:e.data,progress:{percentage:0,bytesUploaded:0,bytesTotal:e.data.size||0,uploadComplete:!1,uploadStarted:!1},size:e.data.size||0,isRemote:p,remote:e.remote||"",preview:e.preview};try{this._checkRestrictions(d)}catch(e){i(e)}this.setState({files:Q({},o,(t={},t[c]=d,t))}),this.emit("file-added",d),this.log("Added file: "+a+", "+c+", mime type: "+l),this.opts.autoProceed&&!this.scheduledAutoProceed&&(this.scheduledAutoProceed=setTimeout(function(){n.scheduledAutoProceed=null,n.upload().catch(function(e){console.error(e.stack||e.message||e)})},4))}else this.log("Not adding file because onBeforeFileAdded returned false")},e.prototype.removeFile=function(e){var t=this,n=this.getState(),r=n.files,o=n.currentUploads,i=Q({},r),s=i[e];delete i[e];var a=Q({},o),l=[];Object.keys(a).forEach(function(t){var n=o[t].fileIDs.filter(function(t){return t!==e});0!==n.length?a[t]=Q({},o[t],{fileIDs:n}):l.push(t)}),this.setState({currentUploads:a,files:i}),l.forEach(function(e){t._removeUpload(e)}),this._calculateTotalProgress(),this.emit("file-removed",s),this.log("File removed: "+s.id)},e.prototype.pauseResume=function(e){if(this.getState().capabilities.resumableUploads&&!this.getFile(e).uploadComplete){var t=!this.getFile(e).isPaused;return this.setFileState(e,{isPaused:t}),this.emit("upload-pause",e,t),t}},e.prototype.pauseAll=function(){var e=Q({},this.getState().files);Object.keys(e).filter(function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted}).forEach(function(t){var n=Q({},e[t],{isPaused:!0});e[t]=n}),this.setState({files:e}),this.emit("pause-all")},e.prototype.resumeAll=function(){var e=Q({},this.getState().files);Object.keys(e).filter(function(t){return!e[t].progress.uploadComplete&&e[t].progress.uploadStarted}).forEach(function(t){var n=Q({},e[t],{isPaused:!1,error:null});e[t]=n}),this.setState({files:e}),this.emit("resume-all")},e.prototype.retryAll=function(){var e=Q({},this.getState().files),t=Object.keys(e).filter(function(t){return e[t].error});t.forEach(function(t){var n=Q({},e[t],{isPaused:!1,error:null});e[t]=n}),this.setState({files:e,error:null}),this.emit("retry-all",t);var n=this._createUpload(t);return this._runUpload(n)},e.prototype.cancelAll=function(){var e=this;this.emit("cancel-all"),Object.keys(this.getState().files).forEach(function(t){e.removeFile(t)}),this.setState({allowNewUpload:!0,totalProgress:0,error:null})},e.prototype.retryUpload=function(e){var t=Q({},this.getState().files),n=Q({},t[e],{error:null,isPaused:!1});t[e]=n,this.setState({files:t}),this.emit("upload-retry",e);var r=this._createUpload([e]);return this._runUpload(r)},e.prototype.reset=function(){this.cancelAll()},e.prototype._calculateProgress=function(e,t){this.getFile(e.id)?(this.setFileState(e.id,{progress:Q({},this.getFile(e.id).progress,{bytesUploaded:t.bytesUploaded,bytesTotal:t.bytesTotal,percentage:Math.floor((t.bytesUploaded/t.bytesTotal*100).toFixed(2))})}),this._calculateTotalProgress()):this.log("Not setting progress for a file that has been removed: "+e.id)},e.prototype._calculateTotalProgress=function(){var e=this.getFiles().filter(function(e){return e.progress.uploadStarted});if(0!==e.length){var t=e.filter(function(e){return null!=e.progress.bytesTotal}),n=e.filter(function(e){return null==e.progress.bytesTotal});if(0!==t.length){var r=t.reduce(function(e,t){return e+t.progress.bytesTotal},0),o=r/t.length;r+=o*n.length;var i=0;t.forEach(function(e){i+=e.progress.bytesUploaded}),n.forEach(function(e){i+=o*(e.progress.percentage||0)});var s=0===r?0:Math.round(i/r*100);this.setState({totalProgress:s})}else{var a=e.length,l=n.reduce(function(e,t){return e+t.progress.percentage},0),u=Math.round(l/a*100);this.setState({totalProgress:u})}}else this.setState({totalProgress:0})},e.prototype._addListeners=function(){var e=this;this.on("error",function(t){e.setState({error:t.message})}),this.on("upload-error",function(t,n){e.setFileState(t.id,{error:n.message}),e.setState({error:n.message});var r=e.i18n("failedToUpload",{file:t.name});"object"===(void 0===n?"undefined":$(n))&&n.message&&(r={message:r,details:n.message}),e.info(r,"error",5e3)}),this.on("upload",function(){e.setState({error:null})}),this.on("upload-started",function(t,n){e.getFile(t.id)?e.setFileState(t.id,{progress:{uploadStarted:Date.now(),uploadComplete:!1,percentage:0,bytesUploaded:0,bytesTotal:t.size}}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("upload-progress",this._calculateProgress),this.on("upload-success",function(t,n,r){var o=e.getFile(t.id).progress;e.setFileState(t.id,{progress:Q({},o,{uploadComplete:!0,percentage:100,bytesUploaded:o.bytesTotal}),uploadURL:r,isPaused:!1}),e._calculateTotalProgress()}),this.on("preprocess-progress",function(t,n){e.getFile(t.id)?e.setFileState(t.id,{progress:Q({},e.getFile(t.id).progress,{preprocess:n})}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("preprocess-complete",function(t){if(e.getFile(t.id)){var n=Q({},e.getState().files);n[t.id]=Q({},n[t.id],{progress:Q({},n[t.id].progress)}),delete n[t.id].progress.preprocess,e.setState({files:n})}else e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("postprocess-progress",function(t,n){e.getFile(t.id)?e.setFileState(t.id,{progress:Q({},e.getState().files[t.id].progress,{postprocess:n})}):e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("postprocess-complete",function(t){if(e.getFile(t.id)){var n=Q({},e.getState().files);n[t.id]=Q({},n[t.id],{progress:Q({},n[t.id].progress)}),delete n[t.id].progress.postprocess,e.setState({files:n})}else e.log("Not setting progress for a file that has been removed: "+t.id)}),this.on("restored",function(){e._calculateTotalProgress()}),"undefined"!=typeof window&&window.addEventListener&&(window.addEventListener("online",function(){return e.updateOnlineStatus()}),window.addEventListener("offline",function(){return e.updateOnlineStatus()}),setTimeout(function(){return e.updateOnlineStatus()},3e3))},e.prototype.updateOnlineStatus=function(){void 0===window.navigator.onLine||window.navigator.onLine?(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)},e.prototype.getID=function(){return this.opts.id},e.prototype.use=function(e,t){if("function"!=typeof e){var n="Expected a plugin class, but got "+(null===e?"null":void 0===e?"undefined":$(e))+". Please verify that the plugin was imported and spelled correctly.";throw new TypeError(n)}var r=new e(this,t),o=r.id;if(this.plugins[r.type]=this.plugins[r.type]||[],!o)throw new Error("Your plugin must have an id");if(!r.type)throw new Error("Your plugin must have a type");var i=this.getPlugin(o);if(i){var s="Already found a plugin named '"+i.id+"'. Tried to use: '"+o+"'.\nUppy plugins must have unique 'id' options. See https://uppy.io/docs/plugins/#id.";throw new Error(s)}return this.plugins[r.type].push(r),r.install(),this},e.prototype.getPlugin=function(e){var t=null;return this.iteratePlugins(function(n){if(n.id===e)return t=n,!1}),t},e.prototype.iteratePlugins=function(e){var t=this;Object.keys(this.plugins).forEach(function(n){t.plugins[n].forEach(e)})},e.prototype.removePlugin=function(e){this.log("Removing plugin "+e.id),this.emit("plugin-remove",e),e.uninstall&&e.uninstall();var t=this.plugins[e.type].slice(),n=t.indexOf(e);-1!==n&&(t.splice(n,1),this.plugins[e.type]=t);var r=this.getState();delete r.plugins[e.id],this.setState(r)},e.prototype.close=function(){var e=this;this.log("Closing Uppy instance "+this.opts.id+": removing all files and uninstalling plugins"),this.reset(),this._storeUnsubscribe(),this.iteratePlugins(function(t){e.removePlugin(t)})},e.prototype.info=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"info",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:3e3,r="object"===(void 0===e?"undefined":$(e));this.setState({info:{isHidden:!1,type:t,message:r?e.message:e,details:r?e.details:null}}),this.emit("info-visible"),clearTimeout(this.infoTimeoutID),this.infoTimeoutID=0!==n?setTimeout(this.hideInfo,n):void 0},e.prototype.hideInfo=function(){var e=Q({},this.getState().info,{isHidden:!0});this.setState({info:e}),this.emit("info-hidden")},e.prototype.log=function(e,t){if(this.opts.debug){var n="[Uppy] ["+J()+"] "+e;window.uppyLog=window.uppyLog+"\nDEBUG LOG: "+e,"error"!==t?"warning"!==t?e===""+e?console.log(n):(n="[Uppy] ["+J()+"]",console.log(n),console.dir(e)):console.warn(n):console.error(n)}},e.prototype.run=function(){return this.log("Calling run() is no longer necessary.","warning"),this},e.prototype.restore=function(e){return this.log('Core: attempting to restore upload "'+e+'"'),this.getState().currentUploads[e]?this._runUpload(e):(this._removeUpload(e),Promise.reject(new Error("Nonexistent upload")))},e.prototype._createUpload=function(e){var t,n=this.getState(),r=n.allowNewUpload,o=n.currentUploads;if(!r)throw new Error("Cannot create a new upload: already uploading.");var i=b();return this.emit("upload",{id:i,fileIDs:e}),this.setState({allowNewUpload:!1!==this.opts.allowMultipleUploads,currentUploads:Q({},o,(t={},t[i]={fileIDs:e,step:0,result:{}},t))}),i},e.prototype._getUpload=function(e){return this.getState().currentUploads[e]},e.prototype.addResultData=function(e,t){var n;if(this._getUpload(e)){var r=this.getState().currentUploads,o=Q({},r[e],{result:Q({},r[e].result,t)});this.setState({currentUploads:Q({},r,(n={},n[e]=o,n))})}else this.log("Not setting result for an upload that has been removed: "+e)},e.prototype._removeUpload=function(e){var t=Q({},this.getState().currentUploads);delete t[e],this.setState({currentUploads:t})},e.prototype._runUpload=function(e){var t=this,n=this.getState().currentUploads[e].step,r=[].concat(this.preProcessors,this.uploaders,this.postProcessors),o=Promise.resolve();return r.forEach(function(r,i){i<n||(o=o.then(function(){var n,o=t.getState().currentUploads,s=Q({},o[e],{step:i});return t.setState({currentUploads:Q({},o,(n={},n[e]=s,n))}),r(s.fileIDs,e)}).then(function(e){return null}))}),o.catch(function(n){t.emit("error",n,e),t._removeUpload(e)}),o.then(function(){var n=t.getState().currentUploads[e];if(n){var r=n.fileIDs.map(function(e){return t.getFile(e)}),o=r.filter(function(e){return!e.error}),i=r.filter(function(e){return e.error});t.addResultData(e,{successful:o,failed:i,uploadID:e})}else t.log("Not setting result for an upload that has been removed: "+e)}).then(function(){var n=t.getState().currentUploads[e].result;return t.emit("complete",n),t._removeUpload(e),n})},e.prototype.upload=function(){var e=this;this.plugins.uploader||this.log("No uploader type plugins are used","warning");var t=this.getState().files,n=this.opts.onBeforeUpload(t);if(!1===n)return Promise.reject(new Error("Not starting the upload because onBeforeUpload returned false"));if(n&&"object"===(void 0===n?"undefined":$(n))){if(n.then)throw new TypeError("onBeforeUpload() returned a Promise, but this is no longer supported. It must be synchronous.");t=n}return Promise.resolve().then(function(){return e._checkMinNumberOfFiles(t)}).then(function(){var n=e.getState().currentUploads,r=Object.keys(n).reduce(function(e,t){return e.concat(n[t].fileIDs)},[]),o=[];Object.keys(t).forEach(function(t){var n=e.getFile(t);n.progress.uploadStarted||-1!==r.indexOf(t)||o.push(n.id)});var i=e._createUpload(o);return e._runUpload(i)}).catch(function(t){var n="object"===(void 0===t?"undefined":$(t))?t.message:t,r="object"===(void 0===t?"undefined":$(t))?t.details:null;return e.log(n+" "+r),e.info({message:n,details:r},"error",4e3),Promise.reject("object"===(void 0===t?"undefined":$(t))?t:new Error(t))})},Z(e,[{key:"state",get:function(){return this.getState()}}]),e}();(Y=function(e){return new ee(e)}).Uppy=ee,Y.Plugin=L;var te={};(function(e){var t="Expected a function",n=NaN,r="[object Symbol]",o=/^\s+|\s+$/g,i=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,a=/^0o[0-7]+$/i,l=parseInt,u="object"==typeof e&&e&&e.Object===Object&&e,p="object"==typeof self&&self&&self.Object===Object&&self,c=u||p||Function("return this")(),h=Object.prototype.toString,d=Math.max,f=Math.min,y=function(){return c.Date.now()};function g(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function m(e){if("number"==typeof e)return e;if(function(e){return"symbol"==typeof e||function(e){return!!e&&"object"==typeof e}(e)&&h.call(e)==r}(e))return n;if(g(e)){var t="function"==typeof e.valueOf?e.valueOf():e;e=g(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(o,"");var u=s.test(e);return u||a.test(e)?l(e.slice(2),u?2:8):i.test(e)?n:+e}te=function(e,n,r){var o=!0,i=!0;if("function"!=typeof e)throw new TypeError(t);return g(r)&&(o="leading"in r?!!r.leading:o,i="trailing"in r?!!r.trailing:i),function(e,n,r){var o,i,s,a,l,u,p=0,c=!1,h=!1,v=!0;if("function"!=typeof e)throw new TypeError(t);function b(t){var n=o,r=i;return o=i=void 0,p=t,a=e.apply(r,n)}function w(e){var t=e-u;return void 0===u||t>=n||t<0||h&&e-p>=s}function S(){var e=y();if(w(e))return C(e);l=setTimeout(S,function(e){var t=n-(e-u);return h?f(t,s-(e-p)):t}(e))}function C(e){return l=void 0,v&&o?b(e):(o=i=void 0,a)}function _(){var e=y(),t=w(e);if(o=arguments,i=this,u=e,t){if(void 0===l)return function(e){return p=e,l=setTimeout(S,n),c?b(e):a}(u);if(h)return l=setTimeout(S,n),b(u)}return void 0===l&&(l=setTimeout(S,n)),a}return n=m(n)||0,g(r)&&(c=!!r.leading,s=(h="maxWait"in r)?d(m(r.maxWait)||0,n):s,v="trailing"in r?!!r.trailing:v),_.cancel=function(){void 0!==l&&clearTimeout(l),p=0,o=u=i=l=void 0},_.flush=function(){return void 0===l?a:C(y())},_}(e,n,{leading:o,maxWait:n,trailing:i})}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ne=te(function(e,t,n){var r=t.progress,o=t.bytesUploaded,i=t.bytesTotal;r&&(e.uppy.log("Upload progress: "+r),e.uppy.emit("upload-progress",n,{uploader:e,bytesUploaded:o,bytesTotal:i}))},300,{leading:!0,trailing:!0}),re=function(e){var t=/^(?:https?:\/\/|\/\/)?(?:[^@\n]+@)?(?:www\.)?([^\n]+)/.exec(e)[1];return("https:"===location.protocol?"wss":"ws")+"://"+t},oe=function(e){var t=0,n=[];return function(o){return function(){for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];var l=function(){t++;var e=o.apply(void 0,s);return e.then(r,r),e};return t>=e?new Promise(function(e,t){n.push(function(){l().then(e,t)})}):l()}};function r(){t--;var e=n.shift();e&&e()}},ie=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},se=d.Socket,ae=d.RequestClient;function le(e){var t=[];return{on:function(n,r){return t.push([n,r]),e.on(n,r)},remove:function(){t.forEach(function(t){var n=t[0],r=t[1];e.off(n,r)})}}}function ue(e){if(e&&e.error){var t=new Error(e.message);throw ie(t,e.error),t}return e}var pe,ce=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.type="uploader",o.id="AwsS3Multipart",o.title="AWS S3 Multipart",o.client=new ae(n,r);var i={timeout:3e4,limit:0,createMultipartUpload:o.createMultipartUpload.bind(o),listParts:o.listParts.bind(o),prepareUploadPart:o.prepareUploadPart.bind(o),abortMultipartUpload:o.abortMultipartUpload.bind(o),completeMultipartUpload:o.completeMultipartUpload.bind(o)};return o.opts=ie({},i,r),o.upload=o.upload.bind(o),"number"==typeof o.opts.limit&&0!==o.opts.limit?o.limitRequests=oe(o.opts.limit):o.limitRequests=function(e){return e},o.uploaders=Object.create(null),o.uploaderEvents=Object.create(null),o.uploaderSockets=Object.create(null),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.resetUploaderReferences=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};this.uploaders[e]&&(this.uploaders[e].abort({really:t.abort||!1}),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},t.prototype.assertHost=function(){if(!this.opts.serverUrl)throw new Error("Expected a `serverUrl` option containing a Companion address.")},t.prototype.createMultipartUpload=function(e){return this.assertHost(),this.client.post("s3/multipart",{filename:e.name,type:e.type}).then(ue)},t.prototype.listParts=function(e,t){var n=t.key,r=t.uploadId;this.assertHost();var o=encodeURIComponent(n);return this.client.get("s3/multipart/"+r+"?key="+o).then(ue)},t.prototype.prepareUploadPart=function(e,t){var n=t.key,r=t.uploadId,o=t.number;this.assertHost();var i=encodeURIComponent(n);return this.client.get("s3/multipart/"+r+"/"+o+"?key="+i).then(ue)},t.prototype.completeMultipartUpload=function(e,t){var n=t.key,r=t.uploadId,o=t.parts;this.assertHost();var i=encodeURIComponent(n),s=encodeURIComponent(r);return this.client.post("s3/multipart/"+s+"/complete?key="+i,{parts:o}).then(ue)},t.prototype.abortMultipartUpload=function(e,t){var n=t.key,r=t.uploadId;this.assertHost();var o=encodeURIComponent(n),i=encodeURIComponent(r);return this.client.delete("s3/multipart/"+i+"?key="+o).then(ue)},t.prototype.uploadFile=function(e){var t=this;return new Promise(function(n,r){var i=new o(e.data,ie({createMultipartUpload:t.limitRequests(t.opts.createMultipartUpload.bind(t,e)),listParts:t.limitRequests(t.opts.listParts.bind(t,e)),prepareUploadPart:t.opts.prepareUploadPart.bind(t,e),completeMultipartUpload:t.limitRequests(t.opts.completeMultipartUpload.bind(t,e)),abortMultipartUpload:t.limitRequests(t.opts.abortMultipartUpload.bind(t,e)),limit:t.opts.limit||5,onStart:function(n){var r=t.uppy.getFile(e.id);t.uppy.setFileState(e.id,{s3Multipart:ie({},r.s3Multipart,{key:n.key,uploadId:n.uploadId,parts:[]})})},onProgress:function(n,r){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:n,bytesTotal:r})},onError:function(n){t.uppy.log(n),t.uppy.emit("upload-error",e,n),n.message="Failed because: "+n.message,t.resetUploaderReferences(e.id),r(n)},onSuccess:function(r){t.uppy.emit("upload-success",e,i,r.location),r.location&&t.uppy.log("Download "+i.file.name+" from "+r.location),t.resetUploaderReferences(e.id),n(i)},onPartComplete:function(n){var r=t.uppy.getFile(e.id);r&&(t.uppy.setFileState(e.id,{s3Multipart:ie({},r.s3Multipart,{parts:[].concat(r.s3Multipart.parts,[n])})}),t.uppy.emit("s3-multipart:part-uploaded",r,n))}},e.s3Multipart));t.uploaders[e.id]=i,t.uploaderEvents[e.id]=le(t.uppy),t.onFileRemove(e.id,function(r){t.resetUploaderReferences(e.id,{abort:!0}),n("upload "+r.id+" was removed")}),t.onFilePause(e.id,function(e){e?i.pause():i.start()}),t.onPauseAll(e.id,function(){i.pause()}),t.onResumeAll(e.id,function(){i.start()}),e.isPaused||i.start(),e.isRestored||t.uppy.emit("upload-started",e,i)})},t.prototype.uploadRemote=function(e){var t=this;return this.resetUploaderReferences(e.id),new Promise(function(n,r){if(e.serverToken)return t.connectToServerSocket(e).then(function(){return n()}).catch(r);t.uppy.emit("upload-started",e),fetch(e.remote.url,{method:"post",credentials:"include",headers:{Accept:"application/json","Content-Type":"application/json"},body:JSON.stringify(ie({},e.remote.body,{protocol:"s3-multipart",size:e.data.size,metadata:e.meta}))}).then(function(n){return n.status<200||n.status>300?r(n.statusText):n.json().then(function(n){return t.uppy.setFileState(e.id,{serverToken:n.token}),t.uppy.getFile(e.id)})}).then(function(e){return t.connectToServerSocket(e)}).then(function(){n()}).catch(function(e){r(new Error(e))})})},t.prototype.connectToServerSocket=function(e){var t=this;return new Promise(function(n,r){var o=e.serverToken,i=re(e.remote.serverUrl),s=new se({target:i+"/api/"+o});t.uploaderSockets[s]=s,t.uploaderEvents[e.id]=le(t.uppy),t.onFileRemove(e.id,function(r){t.resetUploaderReferences(e.id,{abort:!0}),n("upload "+e.id+" was removed")}),t.onFilePause(e.id,function(e){s.send(e?"pause":"resume",{})}),t.onPauseAll(e.id,function(){return s.send("pause",{})}),t.onResumeAll(e.id,function(){e.error&&s.send("pause",{}),s.send("resume",{})}),t.onRetry(e.id,function(){s.send("pause",{}),s.send("resume",{})}),t.onRetryAll(e.id,function(){s.send("pause",{}),s.send("resume",{})}),e.isPaused&&s.send("pause",{}),s.on("progress",function(n){return ne(t,n,e)}),s.on("error",function(n){t.uppy.emit("upload-error",e,new Error(n.error)),r(new Error(n.error))}),s.on("success",function(r){t.uppy.emit("upload-success",e,r,r.url),n()})})},t.prototype.upload=function(e){var t=this;if(0===e.length)return Promise.resolve();var n=e.map(function(e){var n=t.uppy.getFile(e);return n.isRemote?t.uploadRemote(n):t.uploadFile(n)});return Promise.all(n)},t.prototype.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",function(n){e===n.id&&t(n.id)})},t.prototype.onFilePause=function(e,t){this.uploaderEvents[e].on("upload-pause",function(n,r){e===n&&t(r)})},t.prototype.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",function(n){e===n&&t()})},t.prototype.onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",function(r){n.uppy.getFile(e)&&t()})},t.prototype.onPauseAll=function(e,t){var n=this;this.uploaderEvents[e].on("pause-all",function(){n.uppy.getFile(e)&&t()})},t.prototype.onResumeAll=function(e,t){var n=this;this.uploaderEvents[e].on("resume-all",function(){n.uppy.getFile(e)&&t()})},t.prototype.install=function(){var e=this,t=this.uppy.getState().capabilities;this.uppy.setState({capabilities:ie({},t,{resumableUploads:!0})}),this.uppy.addUploader(this.upload),this.uppy.on("cancel-all",function(){e.uppy.getFiles().forEach(function(t){e.resetUploaderReferences(t.id,{abort:!0})})})},t.prototype.uninstall=function(){this.uppy.setState({capabilities:ie({},this.uppy.getState().capabilities,{resumableUploads:!1})}),this.uppy.removeUploader(this.upload)},t}(Y.Plugin),he={};pe=function(){return function(){var e=arguments.length;if(0===e)throw new Error("resolveUrl requires at least one argument; got none.");var t=document.createElement("base");if(t.href=arguments[0],1===e)return t.href;var n=document.getElementsByTagName("head")[0];n.insertBefore(t,n.firstChild);for(var r,o=document.createElement("a"),i=1;i<e;i++)o.href=arguments[i],r=o.href,t.href=r;return n.removeChild(t),r}},"object"==typeof he?he=pe():this.resolveUrl=pe();var de=function(e){var t=[],n=[];function r(e){t.push(e)}function o(e){n.push(e)}return Promise.all(e.map(function(e){return e.then(r,o)})).then(function(){return{successful:t,failed:n}})},fe=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ye=d.Provider,ge=d.Socket;function me(e,t){return t||(t=new Error("Upload error")),"string"==typeof t&&(t=new Error(t)),t instanceof Error||(t=fe(new Error("Upload error"),{data:t})),t.request=e,t}var ve=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.type="uploader",o.id="XHRUpload",o.title="XHRUpload";var i={strings:{timedOut:"Upload stalled for %{seconds} seconds, aborting."}},s={formData:!0,fieldName:"files[]",method:"post",metaFields:null,responseUrlFieldName:"url",bundle:!1,headers:{},locale:i,timeout:3e4,limit:0,withCredentials:!1,responseType:"",getResponseData:function(e,t){var n={};try{n=JSON.parse(e)}catch(e){console.log(e)}return n},getResponseError:function(e,t){return new Error("Upload error")}};if(o.opts=fe({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.handleUpload=o.handleUpload.bind(o),"number"==typeof o.opts.limit&&0!==o.opts.limit?o.limitUploads=oe(o.opts.limit):o.limitUploads=function(e){return e},o.opts.bundle&&!o.opts.formData)throw new Error("`opts.formData` must be true when `opts.bundle` is enabled.");return o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getOptions=function(e){var t=this.uppy.getState().xhrUpload,n=fe({},this.opts,t||{},e.xhrUpload||{});return n.headers={},fe(n.headers,this.opts.headers),t&&fe(n.headers,t.headers),e.xhrUpload&&fe(n.headers,e.xhrUpload.headers),n},t.prototype.createProgressTimeout=function(e,t){var n=this.uppy,r=this,o=!1;function i(){n.log("[XHRUpload] timed out");var o=new Error(r.i18n("timedOut",{seconds:Math.ceil(e/1e3)}));t(o)}var s=null;return{progress:function(){o||e>0&&(s&&clearTimeout(s),s=setTimeout(i,e))},done:function(){n.log("[XHRUpload] timer done"),s&&(clearTimeout(s),s=null),o=!0}}},t.prototype.createFormDataUpload=function(e,t){var n=new FormData;return(Array.isArray(t.metaFields)?t.metaFields:Object.keys(e.meta)).forEach(function(t){n.append(t,e.meta[t])}),e.name?n.append(t.fieldName,e.data,e.name):n.append(t.fieldName,e.data),n},t.prototype.createBareUpload=function(e,t){return e.data},t.prototype.upload=function(e,t,n){var r=this,o=this.getOptions(e);return this.uppy.log("uploading "+t+" of "+n),new Promise(function(t,n){var i=o.formData?r.createFormDataUpload(e,o):r.createBareUpload(e,o),s=r.createProgressTimeout(o.timeout,function(t){a.abort(),r.uppy.emit("upload-error",e,t),n(t)}),a=new XMLHttpRequest;""!==o.responseType&&(a.responseType=o.responseType);var l=b();a.upload.addEventListener("loadstart",function(e){r.uppy.log("[XHRUpload] "+l+" started"),s.progress()}),a.upload.addEventListener("progress",function(t){r.uppy.log("[XHRUpload] "+l+" progress: "+t.loaded+" / "+t.total),s.progress(),t.lengthComputable&&r.uppy.emit("upload-progress",e,{uploader:r,bytesUploaded:t.loaded,bytesTotal:t.total})}),a.addEventListener("load",function(i){if(r.uppy.log("[XHRUpload] "+l+" finished"),s.done(),i.target.status>=200&&i.target.status<300){var u=o.getResponseData(a.responseText,a),p=u[o.responseUrlFieldName],c={status:i.target.status,body:u,uploadURL:p};return r.uppy.setFileState(e.id,{response:c}),r.uppy.emit("upload-success",e,u,p),p&&r.uppy.log("Download "+e.name+" from "+e.uploadURL),t(e)}var h=o.getResponseData(a.responseText,a),d=me(a,o.getResponseError(a.responseText,a)),f={status:i.target.status,body:h};return r.uppy.setFileState(e.id,{response:f}),r.uppy.emit("upload-error",e,d),n(d)}),a.addEventListener("error",function(t){r.uppy.log("[XHRUpload] "+l+" errored"),s.done();var i=me(a,o.getResponseError(a.responseText,a));return r.uppy.emit("upload-error",e,i),n(i)}),a.open(o.method.toUpperCase(),o.endpoint,!0),a.withCredentials=o.withCredentials,Object.keys(o.headers).forEach(function(e){a.setRequestHeader(e,o.headers[e])}),a.send(i),r.uppy.on("file-removed",function(t){t.id===e.id&&(s.done(),a.abort())}),r.uppy.on("cancel-all",function(){s.done(),a.abort()})})},t.prototype.uploadRemote=function(e,t,n){var r=this,o=this.getOptions(e);return new Promise(function(t,n){var i={};(Array.isArray(o.metaFields)?o.metaFields:Object.keys(e.meta)).forEach(function(t){i[t]=e.meta[t]}),new ye(r.uppy,e.remote.providerOptions).post(e.remote.url,fe({},e.remote.body,{endpoint:o.endpoint,size:e.data.size,fieldname:o.fieldName,metadata:i,headers:o.headers})).then(function(i){var s=i.token,a=re(e.remote.serverUrl),l=new ge({target:a+"/api/"+s});l.on("progress",function(t){return ne(r,t,e)}),l.on("success",function(n){var i=o.getResponseData(n.response.responseText,n.response),s=i[o.responseUrlFieldName];return r.uppy.emit("upload-success",e,i,s),l.close(),t()}),l.on("error",function(t){var i=t.response,s=i?o.getResponseError(i.responseText,i):fe(new Error(t.error.message),{cause:t.error});r.uppy.emit("upload-error",e,s),n(s)})})})},t.prototype.uploadBundle=function(e){var t=this;return new Promise(function(n,r){var o=t.opts.endpoint,i=t.opts.method,s=new FormData;e.forEach(function(e,n){var r=t.getOptions(e);s.append(r.fieldName,e.data)});var a=new XMLHttpRequest;""!==t.opts.responseType&&(a.responseType=t.opts.responseType);var l=t.createProgressTimeout(t.opts.timeout,function(e){a.abort(),u(e),r(e)}),u=function(n){e.forEach(function(e){t.uppy.emit("upload-error",e,n)})};a.upload.addEventListener("loadstart",function(e){t.uppy.log("[XHRUpload] started uploading bundle"),l.progress()}),a.upload.addEventListener("progress",function(n){l.progress(),n.lengthComputable&&e.forEach(function(e){t.uppy.emit("upload-progress",e,{uploader:t,bytesUploaded:n.loaded/n.total*e.size,bytesTotal:e.size})})}),a.addEventListener("load",function(o){if(l.done(),o.target.status>=200&&o.target.status<300){var i=t.opts.getResponseData(a.responseText,a);return e.forEach(function(e){t.uppy.emit("upload-success",e,i)}),n()}var s=t.opts.getResponseError(a.responseText,a)||new Error("Upload error");return s.request=a,u(s),r(s)}),a.addEventListener("error",function(e){l.done();var n=t.opts.getResponseError(a.responseText,a)||new Error("Upload error");return u(n),r(n)}),t.uppy.on("cancel-all",function(){l.done(),a.abort()}),a.open(i.toUpperCase(),o,!0),a.withCredentials=t.opts.withCredentials,Object.keys(t.opts.headers).forEach(function(e){a.setRequestHeader(e,t.opts.headers[e])}),a.send(s),e.forEach(function(e){t.uppy.emit("upload-started",e)})})},t.prototype.uploadFiles=function(e){var t=this,n=e.map(function(n,r){var o=parseInt(r,10)+1,i=e.length;return n.error?function(){return Promise.reject(new Error(n.error))}:n.isRemote?(t.uppy.emit("upload-started",n),t.uploadRemote.bind(t,n,o,i)):(t.uppy.emit("upload-started",n),t.upload.bind(t,n,o,i))}).map(function(e){return t.limitUploads(e)()});return de(n)},t.prototype.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("[XHRUpload] No files to upload!"),Promise.resolve();this.uppy.log("[XHRUpload] Uploading...");var n=e.map(function(e){return t.uppy.getFile(e)});return this.opts.bundle?this.uploadBundle(n):this.uploadFiles(n).then(function(){return null})},t.prototype.install=function(){this.opts.bundle&&this.uppy.setState({capabilities:fe({},this.uppy.getState().capabilities,{bundled:!0})}),this.uppy.addUploader(this.handleUpload)},t.prototype.uninstall=function(){this.opts.bundle&&this.uppy.setState({capabilities:fe({},this.uppy.getState().capabilities,{bundled:!0})}),this.uppy.removeUploader(this.handleUpload)},t}(Y.Plugin),be="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},we=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Se=d.RequestClient;function Ce(e){var t=e.headers?e.headers["content-type"]:e.getResponseHeader("Content-Type");return"string"==typeof t&&"application/xml"===t.toLowerCase()}function _e(e,t){var n=e.indexOf("<"+t+">"),r=e.indexOf("</"+t+">",n);return-1!==n&&-1!==r?e.slice(n+t.length+2,r):""}function Pe(e){if(e&&e.error){var t=new Error(e.message);throw we(t,e.error),t}return e}var Ee,Fe,ke,Ae=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.type="uploader",o.id="AwsS3",o.title="AWS S3";var i={strings:{preparingUpload:"Preparing upload..."}},s={timeout:3e4,limit:0,getUploadParameters:o.getUploadParameters.bind(o),locale:i};return o.opts=we({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.client=new Se(n,r),o.prepareUpload=o.prepareUpload.bind(o),"number"==typeof o.opts.limit&&0!==o.opts.limit?o.limitRequests=oe(o.opts.limit):o.limitRequests=function(e){return e},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getUploadParameters=function(e){if(!this.opts.serverUrl)throw new Error("Expected a `serverUrl` option containing a Companion address.");var t=encodeURIComponent(e.name),n=encodeURIComponent(e.type);return this.client.get("s3/params?filename="+t+"&type="+n).then(Pe)},t.prototype.validateParameters=function(e,t){if("object"!==(void 0===t?"undefined":be(t))||!t||"string"!=typeof t.url||"object"!==be(t.fields)&&null!=t.fields||null!=t.method&&!/^(put|post)$/i.test(t.method)){var n=new TypeError("AwsS3: got incorrect result from 'getUploadParameters()' for file '"+e.name+"', expected an object '{ url, method, fields, headers }'.\nSee https://uppy.io/docs/aws-s3/#getUploadParameters-file for more on the expected format.");throw console.error(n),n}return t},t.prototype.prepareUpload=function(e){var t=this;e.forEach(function(e){var n=t.uppy.getFile(e);t.uppy.emit("preprocess-progress",n,{mode:"determinate",message:t.i18n("preparingUpload"),value:0})});var n=this.limitRequests(this.opts.getUploadParameters);return Promise.all(e.map(function(e){var r=t.uppy.getFile(e);return Promise.resolve().then(function(){return n(r)}).then(function(e){return t.validateParameters(r,e)}).then(function(e){return t.uppy.emit("preprocess-progress",r,{mode:"determinate",message:t.i18n("preparingUpload"),value:1}),e}).catch(function(e){t.uppy.emit("upload-error",r,e)})})).then(function(n){var r={};e.forEach(function(e,o){var i=t.uppy.getFile(e);if(!i.error){var s=n[o],a=s.method,l=void 0===a?"post":a,u=s.url,p=s.fields,c=s.headers,h={method:l,formData:"post"===l.toLowerCase(),endpoint:u,metaFields:Object.keys(p)};c&&(h.headers=c);var d=we({},i,{meta:we({},i.meta,p),xhrUpload:h});r[e]=d}}),t.uppy.setState({files:we({},t.uppy.getState().files,r)}),e.forEach(function(e){var n=t.uppy.getFile(e);t.uppy.emit("preprocess-complete",n)})})},t.prototype.install=function(){var e=this.uppy.log;this.uppy.addPreProcessor(this.prepareUpload);var t=!1;this.uppy.use(ve,{fieldName:"file",responseUrlFieldName:"location",timeout:this.opts.timeout,limit:this.opts.limit,responseType:"text",getResponseData:function(n,r){return Ce(r)?{location:he(r.responseURL,_e(n,"Location")),bucket:_e(n,"Bucket"),key:_e(n,"Key"),etag:_e(n,"ETag")}:"POST"===this.method.toUpperCase()?(t||(e("[AwsS3] No response data found, make sure to set the success_action_status AWS SDK option to 201. See https://uppy.io/docs/aws-s3/#POST-Uploads","warning"),t=!0),{location:null}):r.responseURL?{location:r.responseURL.replace(/\?.*$/,"")}:{location:null}},getResponseError:function(e,t){if(Ce(t)){var n=_e(e,"Message");return new Error(n)}}})},t.prototype.uninstall=function(){var e=this.uppy.getPlugin("XHRUpload");this.uppy.removePlugin(e),this.uppy.removePreProcessor(this.prepareUpload)},t}(Y.Plugin),Te=function(e,t){return(t="number"==typeof t?t:1/0)?function e(n,r){return n.reduce(function(n,o){return Array.isArray(o)&&r<t?n.concat(e(o,r+1)):n.concat(o)},[])}(e,1):Array.isArray(e)?e.map(function(e){return e}):e},Oe=Ee={};function Ue(){throw new Error("setTimeout has not been defined")}function xe(){throw new Error("clearTimeout has not been defined")}function Re(e){if(Fe===setTimeout)return setTimeout(e,0);if((Fe===Ue||!Fe)&&setTimeout)return Fe=setTimeout,setTimeout(e,0);try{return Fe(e,0)}catch(t){try{return Fe.call(null,e,0)}catch(t){return Fe.call(this,e,0)}}}!function(){try{Fe="function"==typeof setTimeout?setTimeout:Ue}catch(e){Fe=Ue}try{ke="function"==typeof clearTimeout?clearTimeout:xe}catch(e){ke=xe}}();var De,Be=[],je=!1,Ie=-1;function Le(){je&&De&&(je=!1,De.length?Be=De.concat(Be):Ie=-1,Be.length&&Me())}function Me(){if(!je){var e=Re(Le);je=!0;for(var t=Be.length;t;){for(De=Be,Be=[];++Ie<t;)De&&De[Ie].run();Ie=-1,t=Be.length}De=null,je=!1,function(e){if(ke===clearTimeout)return clearTimeout(e);if((ke===xe||!ke)&&clearTimeout)return ke=clearTimeout,clearTimeout(e);try{ke(e)}catch(t){try{return ke.call(null,e)}catch(t){return ke.call(this,e)}}}(e)}}function Ne(e,t){this.fun=e,this.array=t}function ze(){}Oe.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Be.push(new Ne(e,t)),1!==Be.length||je||Re(Me)},Ne.prototype.run=function(){this.fun.apply(null,this.array)},Oe.title="browser",Oe.browser=!0,Oe.env={},Oe.argv=[],Oe.version="",Oe.versions={},Oe.on=ze,Oe.addListener=ze,Oe.once=ze,Oe.off=ze,Oe.removeListener=ze,Oe.removeAllListeners=ze,Oe.emit=ze,Oe.prependListener=ze,Oe.prependOnceListener=ze,Oe.listeners=function(e){return[]},Oe.binding=function(e){throw new Error("process.binding is not supported")},Oe.cwd=function(){return"/"},Oe.chdir=function(e){throw new Error("process.chdir is not supported")},Oe.umask=function(){return 0};var qe={};(function(e){qe=function(t,n){var r,o,i,s=!0;function a(t){function o(){n&&n(t,r),n=null}s?e.nextTick(o):o()}function l(e,t,n){r[e]=n,(0==--o||t)&&a(t)}Array.isArray(t)?(r=[],o=t.length):(i=Object.keys(t),r={},o=i.length),o?i?i.forEach(function(e){t[e](function(t,n){l(e,t,n)})}):t.forEach(function(e,t){e(function(e,n){l(t,e,n)})}):a(null),s=!1}}).call(this,Ee);var He=function(e,t){if("string"==typeof e){var n=e;if(!(e=window.document.querySelector(e)))throw new Error('"'+n+'" does not match any HTML elements')}if(!e)throw new Error('"'+e+'" is not a valid HTML element');var r;return"function"==typeof t&&(t={onDrop:t}),e.addEventListener("dragenter",o,!1),e.addEventListener("dragover",i,!1),e.addEventListener("dragleave",s,!1),e.addEventListener("drop",a,!1),function(){l(),e.removeEventListener("dragenter",o,!1),e.removeEventListener("dragover",i,!1),e.removeEventListener("dragleave",s,!1),e.removeEventListener("drop",a,!1)};function o(e){return t.onDragEnter&&t.onDragEnter(e),e.stopPropagation(),e.preventDefault(),!1}function i(n){if(n.stopPropagation(),n.preventDefault(),n.dataTransfer.items){var o=Xe(n.dataTransfer.items),i=o.filter(function(e){return"file"===e.kind}),s=o.filter(function(e){return"string"===e.kind});if(0===i.length&&!t.onDropText)return;if(0===s.length&&!t.onDrop)return;if(0===i.length&&0===s.length)return}return e.classList.add("drag"),clearTimeout(r),t.onDragOver&&t.onDragOver(n),n.dataTransfer.dropEffect="copy",!1}function s(e){return e.stopPropagation(),e.preventDefault(),t.onDragLeave&&t.onDragLeave(e),clearTimeout(r),r=setTimeout(l,50),!1}function a(e){e.stopPropagation(),e.preventDefault(),t.onDragLeave&&t.onDragLeave(e),clearTimeout(r),l();var n={x:e.clientX,y:e.clientY},o=e.dataTransfer.getData("text");if(o&&t.onDropText&&t.onDropText(o,n),e.dataTransfer.items){var i=Xe(e.dataTransfer.items).filter(function(e){return"file"===e.kind});if(0===i.length)return;qe(i.map(function(e){return function(t){!function(e,t){var n=[];if(e.isFile)e.file(function(n){n.fullPath=e.fullPath,t(null,n)},function(e){t(e)});else if(e.isDirectory){var r=e.createReader();!function e(){r.readEntries(function(r){r.length>0?(n=n.concat(Xe(r)),e()):qe(n.map(function(e){return function(t){!function(e,t){var n=[];if(e.isFile)e.file(function(n){n.fullPath=e.fullPath,t(null,n)},function(e){t(e)});else if(e.isDirectory){var r=e.createReader();!function e(){r.readEntries(function(r){r.length>0?(n=n.concat(Xe(r)),e()):qe(n.map(function(e){return function(t){We(e,t)}}),t)})}()}}(e,t)}}),t)})}()}}(e.webkitGetAsEntry(),t)}}),function(e,r){if(e)throw e;t.onDrop&&t.onDrop(Te(r),n)})}else{var s=Xe(e.dataTransfer.files);if(0===s.length)return;s.forEach(function(e){e.fullPath="/"+e.name}),t.onDrop&&t.onDrop(s,n)}return!1}function l(){e.classList.remove("drag")}};function We(e,t){var n=[];if(e.isFile){e.file(function(n){n.fullPath=e.fullPath;t(null,n)},function(e){t(e)})}else if(e.isDirectory){var r=e.createReader();o()}function o(){r.readEntries(function(e){if(e.length>0){n=n.concat(Xe(e));o()}else{i()}})}function i(){qe(n.map(function(e){return function(t){We(e,t)}}),t)}}function Xe(e){return Array.prototype.slice.call(e||[],0)}var Ge={exports:{}};(function(e){!function(e,t){"object"==typeof Ge.exports?Ge.exports=t():e.ResizeObserver=t()}(this,function(){"use strict";var t=function(){if("undefined"!=typeof Map)return Map;function e(e,t){var n=-1;return e.some(function(e,r){return e[0]===t&&(n=r,!0)}),n}return function(){function t(){this.__entries__=[]}var n={size:{configurable:!0}};return n.size.get=function(){return this.__entries__.length},t.prototype.get=function(t){var n=e(this.__entries__,t),r=this.__entries__[n];return r&&r[1]},t.prototype.set=function(t,n){var r=e(this.__entries__,t);~r?this.__entries__[r][1]=n:this.__entries__.push([t,n])},t.prototype.delete=function(t){var n=this.__entries__,r=e(n,t);~r&&n.splice(r,1)},t.prototype.has=function(t){return!!~e(this.__entries__,t)},t.prototype.clear=function(){this.__entries__.splice(0)},t.prototype.forEach=function(e,t){void 0===t&&(t=null);for(var n=0,r=this.__entries__;n<r.length;n+=1){var o=r[n];e.call(t,o[1],o[0])}},Object.defineProperties(t.prototype,n),t}()}(),n="undefined"!=typeof window&&"undefined"!=typeof document&&window.document===document,r=void 0!==e&&e.Math===Math?e:"undefined"!=typeof self&&self.Math===Math?self:"undefined"!=typeof window&&window.Math===Math?window:Function("return this")(),o="function"==typeof requestAnimationFrame?requestAnimationFrame.bind(r):function(e){return setTimeout(function(){return e(Date.now())},1e3/60)},i=2,s=["top","right","bottom","left","width","height","size","weight"],a="undefined"!=typeof MutationObserver,l=function(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=function(e,t){var n=!1,r=!1,s=0;function a(){n&&(n=!1,e()),r&&u()}function l(){o(a)}function u(){var e=Date.now();if(n){if(e-s<i)return;r=!0}else n=!0,r=!1,setTimeout(l,t);s=e}return u}(this.refresh.bind(this),20)};l.prototype.addObserver=function(e){~this.observers_.indexOf(e)||this.observers_.push(e),this.connected_||this.connect_()},l.prototype.removeObserver=function(e){var t=this.observers_,n=t.indexOf(e);~n&&t.splice(n,1),!t.length&&this.connected_&&this.disconnect_()},l.prototype.refresh=function(){this.updateObservers_()&&this.refresh()},l.prototype.updateObservers_=function(){var e=this.observers_.filter(function(e){return e.gatherActive(),e.hasActive()});return e.forEach(function(e){return e.broadcastActive()}),e.length>0},l.prototype.connect_=function(){n&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),a?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},l.prototype.disconnect_=function(){n&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},l.prototype.onTransitionEnd_=function(e){var t=e.propertyName;void 0===t&&(t=""),s.some(function(e){return!!~t.indexOf(e)})&&this.refresh()},l.getInstance=function(){return this.instance_||(this.instance_=new l),this.instance_},l.instance_=null;var u=function(e,t){for(var n=0,r=Object.keys(t);n<r.length;n+=1){var o=r[n];Object.defineProperty(e,o,{value:t[o],enumerable:!1,writable:!1,configurable:!0})}return e},p=function(e){return e&&e.ownerDocument&&e.ownerDocument.defaultView||r},c=g(0,0,0,0);function h(e){return parseFloat(e)||0}function d(e){for(var t=[],n=arguments.length-1;n-- >0;)t[n]=arguments[n+1];return t.reduce(function(t,n){return t+h(e["border-"+n+"-width"])},0)}var f="undefined"!=typeof SVGGraphicsElement?function(e){return e instanceof p(e).SVGGraphicsElement}:function(e){return e instanceof p(e).SVGElement&&"function"==typeof e.getBBox};function y(e){return n?f(e)?function(e){var t=e.getBBox();return g(0,0,t.width,t.height)}(e):function(e){var t=e.clientWidth,n=e.clientHeight;if(!t&&!n)return c;var r=p(e).getComputedStyle(e),o=function(e){for(var t={},n=0,r=["top","right","bottom","left"];n<r.length;n+=1){var o=r[n],i=e["padding-"+o];t[o]=h(i)}return t}(r),i=o.left+o.right,s=o.top+o.bottom,a=h(r.width),l=h(r.height);if("border-box"===r.boxSizing&&(Math.round(a+i)!==t&&(a-=d(r,"left","right")+i),Math.round(l+s)!==n&&(l-=d(r,"top","bottom")+s)),!function(e){return e===p(e).document.documentElement}(e)){var u=Math.round(a+i)-t,f=Math.round(l+s)-n;1!==Math.abs(u)&&(a-=u),1!==Math.abs(f)&&(l-=f)}return g(o.left,o.top,a,l)}(e):c}function g(e,t,n,r){return{x:e,y:t,width:n,height:r}}var m=function(e){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=g(0,0,0,0),this.target=e};m.prototype.isActive=function(){var e=y(this.target);return this.contentRect_=e,e.width!==this.broadcastWidth||e.height!==this.broadcastHeight},m.prototype.broadcastRect=function(){var e=this.contentRect_;return this.broadcastWidth=e.width,this.broadcastHeight=e.height,e};var v=function(e,t){var n,r,o,i,s,a,l,p=(r=(n=t).x,o=n.y,i=n.width,s=n.height,a="undefined"!=typeof DOMRectReadOnly?DOMRectReadOnly:Object,l=Object.create(a.prototype),u(l,{x:r,y:o,width:i,height:s,top:o,right:r+i,bottom:s+o,left:r}),l);u(this,{target:e,contentRect:p})},b=function(e,n,r){if(this.activeObservations_=[],this.observations_=new t,"function"!=typeof e)throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=e,this.controller_=n,this.callbackCtx_=r};b.prototype.observe=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)||(t.set(e,new m(e)),this.controller_.addObserver(this),this.controller_.refresh())}},b.prototype.unobserve=function(e){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if("undefined"!=typeof Element&&Element instanceof Object){if(!(e instanceof p(e).Element))throw new TypeError('parameter 1 is not of type "Element".');var t=this.observations_;t.has(e)&&(t.delete(e),t.size||this.controller_.removeObserver(this))}},b.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},b.prototype.gatherActive=function(){var e=this;this.clearActive(),this.observations_.forEach(function(t){t.isActive()&&e.activeObservations_.push(t)})},b.prototype.broadcastActive=function(){if(this.hasActive()){var e=this.callbackCtx_,t=this.activeObservations_.map(function(e){return new v(e.target,e.broadcastRect())});this.callback_.call(e,t,e),this.clearActive()}},b.prototype.clearActive=function(){this.activeObservations_.splice(0)},b.prototype.hasActive=function(){return this.activeObservations_.length>0};var w="undefined"!=typeof WeakMap?new WeakMap:new t,S=function(e){if(!(this instanceof S))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var t=l.getInstance(),n=new b(e,t,this);w.set(this,n)};return["observe","unobserve","disconnect"].forEach(function(e){S.prototype[e]=function(){return(t=w.get(this))[e].apply(t,arguments);var t}}),void 0!==r.ResizeObserver?r.ResizeObserver:S})}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}),Ge=Ge.exports;var Ve={exports:{}};!function(){"use strict";var e={}.hasOwnProperty;function t(){for(var n=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var i=typeof o;if("string"===i||"number"===i)n.push(o);else if(Array.isArray(o)&&o.length){var s=t.apply(null,o);s&&n.push(s)}else if("object"===i)for(var a in o)e.call(o,a)&&o[a]&&n.push(a)}}return n.join(" ")}Ve.exports?(t.default=t,Ve.exports=t):window.classNames=t}(),Ve=Ve.exports;var Ke,Ye={exports:{}};Ke=function(e){"use strict";function t(e){return e.attributes&&e.attributes.key}function n(e){return e.base}function r(e){return e&&e.filter(function(e){return null!==e})}function o(e,t){for(var n=e.length;n--;)if(t(e[n]))return!0;return!1}function i(e,n){return o(e,function(e){return t(e)===n})}function s(e,n){return i(e,t(n))}function a(e,n,r){return o(e,function(e){return t(e)===n&&e.props[r]})}function l(e,n,r){return a(e,t(n),r)}var u=" ",p=/[\n\t\r]+/g,c=function(e){return(u+e+u).replace(p,u)};function h(e,t){var n;e.classList?(n=e.classList).add.apply(n,t.split(" ")):e.className+=" "+t}function d(e,t){if(t=t.trim(),e.classList){var n;(n=e.classList).remove.apply(n,t.split(" "))}else{var r=e.className.trim(),o=c(r);for(t=u+t+u;o.indexOf(t)>=0;)o=o.replace(t,u);e.className=o.trim()}}var f={transitionend:{transition:"transitionend",WebkitTransition:"webkitTransitionEnd",MozTransition:"mozTransitionEnd",OTransition:"oTransitionEnd",msTransition:"MSTransitionEnd"},animationend:{animation:"animationend",WebkitAnimation:"webkitAnimationEnd",MozAnimation:"mozAnimationEnd",OAnimation:"oAnimationEnd",msAnimation:"MSAnimationEnd"}},y=[];"undefined"!=typeof window&&function(){var e=document.createElement("div").style;for(var t in"AnimationEvent"in window||delete f.animationend.animation,"TransitionEvent"in window||delete f.transitionend.transition,f){var n=f[t];for(var r in n)if(r in e){y.push(n[r]);break}}}();var g=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},m=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)},v=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t},b=function(e){function t(){var r,o;g(this,t);for(var i=arguments.length,s=Array(i),a=0;a<i;a++)s[a]=arguments[a];return r=o=v(this,e.call.apply(e,[this].concat(s))),o.flushClassNameQueue=function(){n(o)&&h(n(o),o.classNameQueue.join(" ")),o.classNameQueue.length=0,o.timeout=null},v(o,r)}return m(t,e),t.prototype.transition=function(e,t,r){var o=this,i=n(this),s=this.props.name[e]||this.props.name+"-"+e,a=this.props.name[e+"Active"]||s+"-active",l=null;this.endListener&&this.endListener(),this.endListener=function(e){e&&e.target!==i||(clearTimeout(l),d(i,s),d(i,a),function(e,t){y.length&&y.forEach(function(n){e.removeEventListener(n,t,!1)})}(i,o.endListener),o.endListener=null,t&&t())},r?(l=setTimeout(this.endListener,r),this.transitionTimeouts.push(l)):function(e,t){if(!y.length)return window.setTimeout(t,0);y.forEach(function(n){e.addEventListener(n,t,!1)})}(i,this.endListener),h(i,s),this.queueClass(a)},t.prototype.queueClass=function(e){this.classNameQueue.push(e),this.timeout||(this.timeout=setTimeout(this.flushClassNameQueue,17))},t.prototype.stop=function(){this.timeout&&(clearTimeout(this.timeout),this.classNameQueue.length=0,this.timeout=null),this.endListener&&this.endListener()},t.prototype.componentWillMount=function(){this.classNameQueue=[],this.transitionTimeouts=[]},t.prototype.componentWillUnmount=function(){this.timeout&&clearTimeout(this.timeout),this.transitionTimeouts.forEach(function(e){clearTimeout(e)})},t.prototype.componentWillEnter=function(e){this.props.enter?this.transition("enter",e,this.props.enterTimeout):e()},t.prototype.componentWillLeave=function(e){this.props.leave?this.transition("leave",e,this.props.leaveTimeout):e()},t.prototype.render=function(){return(e=this.props.children)&&e[0];var e},t}(e.Component),w=function(n){function o(r){g(this,o);var i=v(this,n.call(this));return i.renderChild=function(n){var r=i.props,o=r.transitionName,s=r.transitionEnter,a=r.transitionLeave,l=r.transitionEnterTimeout,u=r.transitionLeaveTimeout,p=t(n);return e.h(b,{key:p,ref:function(e){(i.refs[p]=e)||(n=null)},name:o,enter:s,leave:a,enterTimeout:l,leaveTimeout:u},n)},i.refs={},i.state={children:(r.children||[]).slice()},i}return m(o,n),o.prototype.shouldComponentUpdate=function(e,t){return t.children!==this.state.children},o.prototype.componentWillMount=function(){this.currentlyTransitioningKeys={},this.keysToEnter=[],this.keysToLeave=[]},o.prototype.componentWillReceiveProps=function(n){var o,a,u,p,c=this,h=n.children,d=n.exclusive,f=n.showProp,y=r(h||[]).slice(),g=r(d?this.props.children:this.state.children),m=(o=y,a=[],u={},p=[],g.forEach(function(e){var n=t(e);i(o,n)?p.length&&(u[n]=p,p=[]):p.push(e)}),o.forEach(function(e){var n=t(e);u.hasOwnProperty(n)&&(a=a.concat(u[n])),a.push(e)}),a.concat(p));f&&(m=m.map(function(t){var n;return!t.props[f]&&l(g,t,f)&&(t=e.cloneElement(t,((n={})[f]=!0,n))),t})),d&&m.forEach(function(e){return c.stop(t(e))}),this.setState({children:m}),this.forceUpdate(),y.forEach(function(e){var t=e.key,n=g&&s(g,e);if(f){if(n){var r=l(g,e,f),o=e.props[f];r||!o||c.currentlyTransitioningKeys[t]||c.keysToEnter.push(t)}}else n||c.currentlyTransitioningKeys[t]||c.keysToEnter.push(t)}),g.forEach(function(e){var t=e.key,n=y&&s(y,e);if(f){if(n){var r=l(y,e,f),o=e.props[f];r||!o||c.currentlyTransitioningKeys[t]||c.keysToLeave.push(t)}}else n||c.currentlyTransitioningKeys[t]||c.keysToLeave.push(t)})},o.prototype.performEnter=function(e){var t=this;this.currentlyTransitioningKeys[e]=!0;var n=this.refs[e];n.componentWillEnter?n.componentWillEnter(function(){return t._handleDoneEntering(e)}):this._handleDoneEntering(e)},o.prototype._handleDoneEntering=function(e){delete this.currentlyTransitioningKeys[e];var t=r(this.props.children),n=this.props.showProp;!t||!n&&!i(t,e)||n&&!a(t,e,n)?this.performLeave(e):this.setState({children:t})},o.prototype.stop=function(e){delete this.currentlyTransitioningKeys[e];var t=this.refs[e];t&&t.stop()},o.prototype.performLeave=function(e){var t=this;this.currentlyTransitioningKeys[e]=!0;var n=this.refs[e];n&&n.componentWillLeave?n.componentWillLeave(function(){return t._handleDoneLeaving(e)}):this._handleDoneLeaving(e)},o.prototype._handleDoneLeaving=function(e){delete this.currentlyTransitioningKeys[e];var t=this.props.showProp,n=r(this.props.children);t&&n&&a(n,e,t)?this.performEnter(e):!t&&n&&i(n,e)?this.performEnter(e):this.setState({children:n})},o.prototype.componentDidUpdate=function(){var e=this,t=this.keysToEnter,n=this.keysToLeave;this.keysToEnter=[],t.forEach(function(t){return e.performEnter(t)}),this.keysToLeave=[],n.forEach(function(t){return e.performLeave(t)})},o.prototype.render=function(t,n){var o=t.component,i=(t.transitionName,t.transitionEnter,t.transitionLeave,t.transitionEnterTimeout,t.transitionLeaveTimeout,t.children,function(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}(t,["component","transitionName","transitionEnter","transitionLeave","transitionEnterTimeout","transitionLeaveTimeout","children"])),s=n.children;return e.h(o,i,r(s).map(this.renderChild))},o}(e.Component);return w.defaultProps={component:"span",transitionEnter:!0,transitionLeave:!0},w},"object"==typeof Ye.exports?Ye.exports=Ke(U):this.PreactCSSTransitionGroup=Ke(this.preact),Ye=Ye.exports;var Je=U.h,$e=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r.handleClick=r.handleClick.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleClick=function(e){this.input.click()},t.prototype.render=function(){var e=this,t=Je("button",{type:"button",class:"uppy-Dashboard-browse",onclick:this.handleClick},this.props.i18n("browse"));return Je("div",{class:"uppy-Dashboard-dropFilesTitle"},0===this.props.acquirers.length?this.props.i18nArray("dropPaste",{browse:t}):this.props.i18nArray("dropPasteImport",{browse:t}),Je("input",{class:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabindex:-1,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,onchange:this.props.handleInputChange,accept:this.props.allowedFileTypes,value:"",ref:function(t){e.input=t}}))},t}(U.Component),Qe=U.h,Ze=function(){return Qe("svg",{"aria-hidden":"true",width:"30",height:"30",viewBox:"0 0 30 30"},Qe("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"}))},et=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon",width:"51",height:"51",viewBox:"0 0 51 51"},Qe("path",{d:"M17.21 45.765a5.394 5.394 0 0 1-7.62 0l-4.12-4.122a5.393 5.393 0 0 1 0-7.618l6.774-6.775-2.404-2.404-6.775 6.776c-3.424 3.427-3.424 9 0 12.426l4.12 4.123a8.766 8.766 0 0 0 6.216 2.57c2.25 0 4.5-.858 6.214-2.57l13.55-13.552a8.72 8.72 0 0 0 2.575-6.213 8.73 8.73 0 0 0-2.575-6.213l-4.123-4.12-2.404 2.404 4.123 4.12a5.352 5.352 0 0 1 1.58 3.81c0 1.438-.562 2.79-1.58 3.808l-13.55 13.55z"}),Qe("path",{d:"M44.256 2.858A8.728 8.728 0 0 0 38.043.283h-.002a8.73 8.73 0 0 0-6.212 2.574l-13.55 13.55a8.725 8.725 0 0 0-2.575 6.214 8.73 8.73 0 0 0 2.574 6.216l4.12 4.12 2.405-2.403-4.12-4.12a5.357 5.357 0 0 1-1.58-3.812c0-1.437.562-2.79 1.58-3.808l13.55-13.55a5.348 5.348 0 0 1 3.81-1.58c1.44 0 2.792.562 3.81 1.58l4.12 4.12c2.1 2.1 2.1 5.518 0 7.617L39.2 23.775l2.404 2.404 6.775-6.777c3.426-3.427 3.426-9 0-12.426l-4.12-4.12z"}))},tt=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon retry",width:"28",height:"31",viewBox:"0 0 16 19",xmlns:"http://www.w3.org/2000/svg"},Qe("path",{d:"M16 11a8 8 0 1 1-8-8v2a6 6 0 1 0 6 6h2z"}),Qe("path",{d:"M7.9 3H10v2H7.9z"}),Qe("path",{d:"M8.536.5l3.535 3.536-1.414 1.414L7.12 1.914z"}),Qe("path",{d:"M10.657 2.621l1.414 1.415L8.536 7.57 7.12 6.157z"}))},nt=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon",width:"55",height:"55",viewBox:"0 0 55 55"},Qe("path",{d:"M52.66.25c-.216-.19-.5-.276-.79-.242l-31 4.01a1 1 0 0 0-.87.992V40.622C18.174 38.428 15.273 37 12 37c-5.514 0-10 4.037-10 9s4.486 9 10 9 10-4.037 10-9c0-.232-.02-.46-.04-.687.014-.065.04-.124.04-.192V16.12l29-3.753v18.257C49.174 28.428 46.273 27 43 27c-5.514 0-10 4.037-10 9s4.486 9 10 9c5.464 0 9.913-3.966 9.993-8.867 0-.013.007-.024.007-.037V1a.998.998 0 0 0-.34-.75zM12 53c-4.41 0-8-3.14-8-7s3.59-7 8-7 8 3.14 8 7-3.59 7-8 7zm31-10c-4.41 0-8-3.14-8-7s3.59-7 8-7 8 3.14 8 7-3.59 7-8 7zM22 14.1V5.89l29-3.753v8.21l-29 3.754z"}))},rt=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon",viewBox:"0 0 58 58"},Qe("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"}),Qe("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"}))},ot=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon",viewBox:"0 0 342 335"},Qe("path",{d:"M329.337 227.84c-2.1 1.3-8.1 2.1-11.9 2.1-12.4 0-27.6-5.7-49.1-14.9 8.3-.6 15.8-.9 22.6-.9 12.4 0 16 0 28.2 3.1 12.1 3 12.2 9.3 10.2 10.6zm-215.1 1.9c4.8-8.4 9.7-17.3 14.7-26.8 12.2-23.1 20-41.3 25.7-56.2 11.5 20.9 25.8 38.6 42.5 52.8 2.1 1.8 4.3 3.5 6.7 5.3-34.1 6.8-63.6 15-89.6 24.9zm39.8-218.9c6.8 0 10.7 17.06 11 33.16.3 16-3.4 27.2-8.1 35.6-3.9-12.4-5.7-31.8-5.7-44.5 0 0-.3-24.26 2.8-24.26zm-133.4 307.2c3.9-10.5 19.1-31.3 41.6-49.8 1.4-1.1 4.9-4.4 8.1-7.4-23.5 37.6-39.3 52.5-49.7 57.2zm315.2-112.3c-6.8-6.7-22-10.2-45-10.5-15.6-.2-34.3 1.2-54.1 3.9-8.8-5.1-17.9-10.6-25.1-17.3-19.2-18-35.2-42.9-45.2-70.3.6-2.6 1.2-4.8 1.7-7.1 0 0 10.8-61.5 7.9-82.3-.4-2.9-.6-3.7-1.4-5.9l-.9-2.5c-2.9-6.76-8.7-13.96-17.8-13.57l-5.3-.17h-.1c-10.1 0-18.4 5.17-20.5 12.84-6.6 24.3.2 60.5 12.5 107.4l-3.2 7.7c-8.8 21.4-19.8 43-29.5 62l-1.3 2.5c-10.2 20-19.5 37-27.9 51.4l-8.7 4.6c-.6.4-15.5 8.2-19 10.3-29.6 17.7-49.28 37.8-52.54 53.8-1.04 5-.26 11.5 5.01 14.6l8.4 4.2c3.63 1.8 7.53 2.7 11.43 2.7 21.1 0 45.6-26.2 79.3-85.1 39-12.7 83.4-23.3 122.3-29.1 29.6 16.7 66 28.3 89 28.3 4.1 0 7.6-.4 10.5-1.2 4.4-1.1 8.1-3.6 10.4-7.1 4.4-6.7 5.4-15.9 4.1-25.4-.3-2.8-2.6-6.3-5-8.7z"}))},it=function(){return Qe("svg",{"aria-hidden":"true",class:"UppyIcon",width:"62",height:"62",viewBox:"0 0 62 62",xmlns:"http://www.w3.org/2000/svg"},Qe("path",{d:"M4.309 4.309h24.912v53.382h-6.525v3.559h16.608v-3.559h-6.525V4.309h24.912v10.676h3.559V.75H.75v14.235h3.559z","fill-rule":"nonzero",fill:"#000"}))},st=function(){return Qe("svg",{"aria-hidden":"true",fill:"#607d8b",width:"27",height:"25",viewBox:"0 0 27 25"},Qe("path",{d:"M5.586 9.288a.313.313 0 0 0 .282.176h4.84v3.922c0 1.514 1.25 2.24 2.792 2.24 1.54 0 2.79-.726 2.79-2.24V9.464h4.84c.122 0 .23-.068.284-.176a.304.304 0 0 0-.046-.324L13.735.106a.316.316 0 0 0-.472 0l-7.63 8.857a.302.302 0 0 0-.047.325z"}),Qe("path",{d:"M24.3 5.093c-.218-.76-.54-1.187-1.208-1.187h-4.856l1.018 1.18h3.948l2.043 11.038h-7.193v2.728H9.114v-2.725h-7.36l2.66-11.04h3.33l1.018-1.18H3.907c-.668 0-1.06.46-1.21 1.186L0 16.456v7.062C0 24.338.676 25 1.51 25h23.98c.833 0 1.51-.663 1.51-1.482v-7.062L24.3 5.093z"}))},at=U.h,lt=U.Component,ut=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r.handleClick=r.handleClick.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleClick=function(e){this.input.click()},t.prototype.render=function(){var e=this,t=0!==this.props.acquirers.length;return at("div",{class:"uppy-DashboarAddFiles"},t?at("div",{class:"uppy-DashboardTabs"},at($e,{acquirers:this.props.acquirers,handleInputChange:this.props.handleInputChange,i18n:this.props.i18n,i18nArray:this.props.i18nArray,allowedFileTypes:this.props.allowedFileTypes,maxNumberOfFiles:this.props.maxNumberOfFiles}),at("div",{class:"uppy-DashboardTabs-list",role:"tablist"},at("div",{class:"uppy-DashboardTab",role:"presentation"},at("button",{type:"button",class:"uppy-DashboardTab-btn",role:"tab",tabindex:0,onclick:this.handleClick},st(),at("div",{class:"uppy-DashboardTab-name"},this.props.i18n("myDevice"))),at("input",{class:"uppy-Dashboard-input",hidden:!0,"aria-hidden":"true",tabindex:-1,type:"file",name:"files[]",multiple:1!==this.props.maxNumberOfFiles,accept:this.props.allowedFileTypes,onchange:this.props.handleInputChange,value:"",ref:function(t){e.input=t}})),this.props.acquirers.map(function(t){return at("div",{class:"uppy-DashboardTab",role:"presentation"},at("button",{class:"uppy-DashboardTab-btn",type:"button",role:"tab",tabindex:0,"aria-controls":"uppy-DashboardContent-panel--"+t.id,"aria-selected":e.props.activePanel.id===t.id,onclick:function(){return e.props.showPanel(t.id)}},t.icon(),at("div",{class:"uppy-DashboardTab-name"},t.name)))}))):at("div",{class:"uppy-DashboardTabs"},at($e,{acquirers:this.props.acquirers,handleInputChange:this.props.handleInputChange,i18n:this.props.i18n,i18nArray:this.props.i18nArray,allowedFileTypes:this.props.allowedFileTypes,maxNumberOfFiles:this.props.maxNumberOfFiles})),at("div",{class:"uppy-DashboarAddFiles-info"},this.props.note&&at("div",{class:"uppy-Dashboard-note"},this.props.note),this.props.proudlyDisplayPoweredByUppy&&(this.props,at("a",{tabindex:"-1",href:"https://uppy.io",rel:"noreferrer noopener",target:"_blank",class:"uppy-Dashboard-poweredBy"},"Powered by ",at("svg",{"aria-hidden":"true",class:"UppyIcon uppy-Dashboard-poweredByIcon",width:"11",height:"11",viewBox:"0 0 11 11",xmlns:"http://www.w3.org/2000/svg"},at("path",{d:"M7.365 10.5l-.01-4.045h2.612L5.5.806l-4.467 5.65h2.604l.01 4.044h3.718z","fill-rule":"evenodd"})),at("span",{class:"uppy-Dashboard-poweredByUppy"},"Uppy")))))},t}(lt),pt=U.h,ct=function(e){return pt("div",{class:"uppy-Dashboard-AddFilesPanel","aria-hidden":e.showAddFilesPanel},pt("div",{class:"uppy-DashboardContent-bar"},pt("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"h1"},e.i18n("addingMoreFiles")),pt("button",{class:"uppy-DashboardContent-back",type:"button",onclick:function(t){return e.toggleAddFilesPanel(!1)}},e.i18n("back"))),pt(ut,e))},ht=it,dt=nt,ft=rt,yt=ot,gt=function(e){var t={color:"#cbcbcb",icon:""};if(!e)return t;var n=e.split("/")[0],r=e.split("/")[1];return"text"===n?{color:"#cbcbcb",icon:ht()}:"audio"===n?{color:"#1abc9c",icon:dt()}:"video"===n?{color:"#2980b9",icon:ft()}:"application"===n&&"pdf"===r?{color:"#e74c3c",icon:yt()}:"image"===n?{color:"#f2f2f2",icon:""}:t},mt=U.h,vt=function(e){var t=e.file;if(t.preview)return mt("img",{class:"uppy-DashboardItem-previewImg",alt:t.name,src:t.preview});var n=gt(t.type),r=n.color,o=n.icon;return mt("div",{class:"uppy-DashboardItem-previewIconWrap"},mt("span",{class:"uppy-DashboardItem-previewIcon",style:{color:r}},o),mt("svg",{class:"uppy-DashboardItem-previewIconBg",width:"72",height:"93",viewBox:"0 0 72 93"},mt("g",null,mt("path",{d:"M24.08 5h38.922A2.997 2.997 0 0 1 66 8.003v74.994A2.997 2.997 0 0 1 63.004 86H8.996A2.998 2.998 0 0 1 6 83.01V22.234L24.08 5z",fill:"#FFF"}),mt("path",{d:"M24 5L6 22.248h15.007A2.995 2.995 0 0 0 24 19.244V5z",fill:"#E4E4E4"}))))},bt=function(e){var t=e.target.tagName;"INPUT"!==t&&"TEXTAREA"!==t?(e.preventDefault(),e.stopPropagation()):e.stopPropagation()},wt=U.h,St=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r.meta={},r.tempStoreMetaOrSubmit=r.tempStoreMetaOrSubmit.bind(r),r.renderMetaFields=r.renderMetaFields.bind(r),r.handleSave=r.handleSave.bind(r),r.handleCancel=r.handleCancel.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){var e=this;setTimeout(function(){e.firstInput&&e.firstInput.focus({preventScroll:!0})},150)},t.prototype.tempStoreMetaOrSubmit=function(e){var t=this.props.files[this.props.fileCardFor];if(13===e.keyCode)return e.stopPropagation(),e.preventDefault(),void this.props.saveFileCard(this.meta,t.id);var n=e.target.value,r=e.target.dataset.name;this.meta[r]=n},t.prototype.renderMetaFields=function(e){var t=this;return(this.props.metaFields||[]).map(function(n,r){return wt("fieldset",{class:"uppy-DashboardFileCard-fieldset"},wt("label",{class:"uppy-DashboardFileCard-label"},n.name),wt("input",{class:"uppy-c-textInput uppy-DashboardFileCard-input",type:"text","data-name":n.id,value:e.meta[n.id],placeholder:n.placeholder,onkeyup:t.tempStoreMetaOrSubmit,onkeydown:t.tempStoreMetaOrSubmit,onkeypress:t.tempStoreMetaOrSubmit,ref:function(e){0===r&&(t.firstInput=e)}}))})},t.prototype.handleSave=function(e){var t=this.props.fileCardFor;this.props.saveFileCard(this.meta,t)},t.prototype.handleCancel=function(e){this.meta={},this.props.toggleFileCard()},t.prototype.render=function(){var e=this.props.files[this.props.fileCardFor];return wt("div",{class:"uppy-DashboardFileCard",onDragOver:bt,onDragLeave:bt,onDrop:bt,onPaste:bt},wt("div",{class:"uppy-DashboardContent-bar"},wt("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"h1"},this.props.i18nArray("editing",{file:wt("span",{class:"uppy-DashboardContent-titleFile"},e.meta?e.meta.name:e.name)})),wt("button",{class:"uppy-DashboardContent-back",type:"button",title:this.props.i18n("finishEditingFile"),onclick:this.handleSave},this.props.i18n("done"))),wt("div",{class:"uppy-DashboardFileCard-inner"},wt("div",{class:"uppy-DashboardFileCard-preview",style:{backgroundColor:gt(e.type).color}},wt(vt,{file:e})),wt("div",{class:"uppy-DashboardFileCard-info"},this.renderMetaFields(e)),wt("div",{class:"uppy-Dashboard-actions"},wt("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Dashboard-actionsBtn",type:"button",onclick:this.handleSave},this.props.i18n("saveChanges")),wt("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-link uppy-Dashboard-actionsBtn",type:"button",onclick:this.handleCancel},this.props.i18n("cancel")))))},t}(U.Component),Ct=U.h,_t=2*Math.PI*15,Pt=function(e){return Ct("svg",{width:"70",height:"70",viewBox:"0 0 36 36",class:"UppyIcon UppyIcon-progressCircle"},Ct("g",{class:"progress-group"},Ct("circle",{class:"bg",r:"15",cx:"18",cy:"18","stroke-width":"2",fill:"none"}),Ct("circle",{class:"progress",r:"15",cx:"18",cy:"18",transform:"rotate(-90, 18, 18)","stroke-width":"2",fill:"none","stroke-dasharray":_t,"stroke-dashoffset":_t-_t/100*e.progress})),e.hidePauseResumeCancelButtons||e.bundled?null:Ct("g",null,Ct("polygon",{class:"play",transform:"translate(3, 3)",points:"12 20 12 10 20 15"}),Ct("g",{class:"pause",transform:"translate(14.5, 13)"},Ct("rect",{x:"0",y:"0",width:"2",height:"10",rx:"0"}),Ct("rect",{x:"5",y:"0",width:"2",height:"10",rx:"0"})),Ct("polygon",{class:"cancel",transform:"translate(2, 2)",points:"19.8856516 11.0625 16 14.9481516 12.1019737 11.0625 11.0625 12.1143484 14.9481516 16 11.0625 19.8980263 12.1019737 20.9375 16 17.0518484 19.8856516 20.9375 20.9375 19.8980263 17.0518484 16 20.9375 12"})),Ct("polygon",{class:"check",transform:"translate(2, 3)",points:"14 22.5 7 15.2457065 8.99985857 13.1732815 14 18.3547104 22.9729883 9 25 11.1005634"}))},Et=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Ft=et,kt=tt,At=U.h;function Tt(e){if(!e.hideRetryButton||!e.error)return e.isUploaded||e.bundled||e.hidePauseResumeCancelButtons&&!e.error?At("div",{class:"uppy-DashboardItem-progressIndicator"},At(Pt,{progress:e.file.progress.percentage,fileID:e.file.id,hidePauseResumeCancelButtons:e.hidePauseResumeCancelButtons,bundled:e.bundled})):At("button",{class:"uppy-DashboardItem-progressIndicator",type:"button","aria-label":e.progressIndicatorTitle,title:e.progressIndicatorTitle,onclick:e.onPauseResumeCancelRetry},e.error?e.hideRetryButton?null:kt():At(Pt,{progress:e.file.progress.percentage,fileID:e.file.id,hidePauseResumeCancelButtons:e.hidePauseResumeCancelButtons}))}var Ot=function(e){var t,n,r=e.file,o=e.acquirers,i=r.progress.preprocess||r.progress.postprocess,s=r.progress.uploadComplete&&!i&&!r.error,a=r.progress.uploadStarted||i,l=r.progress.uploadStarted&&!r.progress.uploadComplete||i,u=r.isPaused||!1,p=r.error||!1,c=X(r.meta.name).name,h=e.isWide?(n=30,(t=c).length>n?t.substr(0,n/2)+"..."+t.substr(t.length-n/4,t.length):t):c,d=Ve("uppy-DashboardItem",{"is-inprogress":l},{"is-processing":i},{"is-complete":s},{"is-paused":u},{"is-error":p},{"is-resumable":e.resumableUploads},{"is-bundled":e.bundledUpload});return At("li",{class:d,id:"uppy_"+r.id,title:r.meta.name},At("div",{class:"uppy-DashboardItem-preview"},At("div",{class:"uppy-DashboardItem-previewInnerWrap",style:{backgroundColor:gt(r.type).color}},e.showLinkToFileUploadResult&&r.uploadURL?At("a",{class:"uppy-DashboardItem-previewLink",href:r.uploadURL,rel:"noreferrer noopener",target:"_blank"}):null,At(vt,{file:r})),At("div",{class:"uppy-DashboardItem-progress"},At(Tt,Et({progressIndicatorTitle:function(e){return s?e.i18n("uploadComplete"):p?e.i18n("retryUpload"):e.resumableUploads?r.isPaused?e.i18n("resumeUpload"):e.i18n("pauseUpload"):e.i18n("cancelUpload")}(e),onPauseResumeCancelRetry:function(t){s||(!p||e.hideRetryButton?e.hidePauseResumeCancelButtons||(e.resumableUploads?e.pauseUpload(r.id):e.cancelUpload(r.id)):e.retryUpload(r.id))},file:r,error:p},e)))),At("div",{class:"uppy-DashboardItem-info"},At("div",{class:"uppy-DashboardItem-name",title:c},e.showLinkToFileUploadResult&&r.uploadURL?At("a",{href:r.uploadURL,rel:"noreferrer noopener",target:"_blank"},r.extension?h+"."+r.extension:h):r.extension?h+"."+r.extension:h),At("div",{class:"uppy-DashboardItem-status"},r.data.size?At("div",{class:"uppy-DashboardItem-statusSize"},O(r.data.size)):null,r.source&&r.source!==e.id&&At("div",{class:"uppy-DashboardItem-sourceIcon"},o.map(function(t){if(t.id===r.source)return At("span",{title:e.i18n("fileSource",{name:t.name})},t.icon())})),!a&&e.metaFields&&e.metaFields.length?At("button",{class:"uppy-DashboardItem-edit",type:"button","aria-label":e.i18n("editFile"),title:e.i18n("editFile"),onclick:function(t){return e.toggleFileCard(r.id)}},e.i18n("edit")):null,e.showLinkToFileUploadResult&&r.uploadURL?At("button",{class:"uppy-DashboardItem-copyLink",type:"button","aria-label":e.i18n("copyLink"),title:e.i18n("copyLink"),onclick:function(){var t,n;(t=r.uploadURL,n=e.i18n("copyLinkToClipboardFallback"),n=n||"Copy the URL below",new Promise(function(e){var r=document.createElement("textarea");r.setAttribute("style",{position:"fixed",top:0,left:0,width:"2em",height:"2em",padding:0,border:"none",outline:"none",boxShadow:"none",background:"transparent"}),r.value=t,document.body.appendChild(r),r.select();var o=function(){document.body.removeChild(r),window.prompt(n,t),e()};try{return document.execCommand("copy")?(document.body.removeChild(r),e()):o()}catch(e){return document.body.removeChild(r),o()}})).then(function(){e.log("Link copied to clipboard."),e.info(e.i18n("copyLinkToClipboardSuccess"),"info",3e3)}).catch(e.log)}},Ft()):"")),At("div",{class:"uppy-DashboardItem-action"},!s&&At("button",{class:"uppy-DashboardItem-remove",type:"button","aria-label":e.i18n("removeFile"),title:e.i18n("removeFile"),onclick:function(){return e.removeFile(r.id)}},At("svg",{"aria-hidden":"true",class:"UppyIcon",width:"60",height:"60",viewBox:"0 0 60 60",xmlns:"http://www.w3.org/2000/svg"},At("path",{stroke:"#FFF","stroke-width":"1","fill-rule":"nonzero","vector-effect":"non-scaling-stroke",d:"M30 1C14 1 1 14 1 30s13 29 29 29 29-13 29-29S46 1 30 1z"}),At("path",{fill:"#FFF","vector-effect":"non-scaling-stroke",d:"M42 39.667L39.667 42 30 32.333 20.333 42 18 39.667 27.667 30 18 20.333 20.333 18 30 27.667 39.667 18 42 20.333 32.333 30z"})))))},Ut=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},xt=U.h,Rt=function(e){var t=0===e.totalFileCount,n=Ve("uppy-Dashboard-files",{"uppy-Dashboard-files--noFiles":t});return xt("ul",{class:n},Object.keys(e.files).map(function(t){return xt(Ot,Ut({},e,{acquirers:e.acquirers,file:e.files[t]}))}))},Dt=U.h,Bt=function(e){return Dt("div",{class:"uppy-DashboardContent-panel",role:"tabpanel",id:e.activePanel&&"uppy-DashboardContent-panel--"+e.activePanel.id,onDragOver:bt,onDragLeave:bt,onDrop:bt,onPaste:bt},Dt("div",{class:"uppy-DashboardContent-bar"},Dt("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"h1"},e.i18n("importFrom",{name:e.activePanel.name})),Dt("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.hideAllPanels},e.i18n("done"))),Dt("div",{class:"uppy-DashboardContent-panelBody"},e.getPlugin(e.activePanel.id).render(e.state)))},jt=U.h,It={STATE_ERROR:"error",STATE_WAITING:"waiting",STATE_PREPROCESSING:"preprocessing",STATE_UPLOADING:"uploading",STATE_POSTPROCESSING:"postprocessing",STATE_COMPLETE:"complete",STATE_PAUSED:"paused"};function Lt(e){switch(function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{};if(e)return It.STATE_ERROR;if(t)return It.STATE_COMPLETE;if(n)return It.STATE_PAUSED;for(var o=It.STATE_WAITING,i=Object.keys(r),s=0;s<i.length;s++){var a=r[i[s]].progress;if(a.uploadStarted&&!a.uploadComplete)return It.STATE_UPLOADING;a.preprocess&&o!==It.STATE_UPLOADING&&(o=It.STATE_PREPROCESSING),a.postprocess&&o!==It.STATE_UPLOADING&&o!==It.STATE_PREPROCESSING&&(o=It.STATE_POSTPROCESSING)}return o}(e.isAllErrored,e.isAllComplete,e.isAllPaused,e.files)){case"uploading":return e.i18n("uploadingXFiles",{smart_count:e.inProgressNotPausedFiles.length});case"preprocessing":case"postprocessing":return e.i18n("processingXFiles",{smart_count:e.processingFiles.length});case"paused":return e.i18n("uploadPaused");case"waiting":return e.i18n("xFilesSelected",{smart_count:e.newFiles.length});case"complete":return e.i18n("uploadComplete")}}var Mt=function(e){var t=e.allowNewUpload;return t&&e.maxNumberOfFiles&&(t=e.totalFileCount<e.maxNumberOfFiles),jt("div",{class:"uppy-DashboardContent-bar"},jt("div",null,e.isAllComplete?null:jt("button",{class:"uppy-DashboardContent-back",type:"button",onclick:e.cancelAll},e.i18n("cancel"))),jt("div",{class:"uppy-DashboardContent-title",role:"heading","aria-level":"h1"},jt(Lt,e)),t&&jt("button",{class:"uppy-DashboardContent-addMore",type:"button","aria-label":e.i18n("addMoreFiles"),title:e.i18n("addMoreFiles"),onclick:function(){return e.toggleAddFilesPanel(!0)}},jt("svg",{class:"UppyIcon",width:"15",height:"15",viewBox:"0 0 13 13",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},jt("path",{d:"M7,6 L13,6 L13,7 L7,7 L7,13 L6,13 L6,7 L0,7 L0,6 L6,6 L6,0 L7,0 L7,6 Z"}))))},Nt=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},zt=U.h,qt=function(e){var t=0===e.totalFileCount,n=Ve({"uppy-Root":e.isTargetDOMEl},"uppy-Dashboard",{"Uppy--isTouchDevice":"ontouchstart"in window||navigator.maxTouchPoints},{"uppy-Dashboard--animateOpenClose":e.animateOpenClose},{"uppy-Dashboard--isClosing":e.isClosing},{"uppy-Dashboard--modal":!e.inline},{"uppy-size--md":e.containerWidth>576},{"uppy-size--lg":e.containerWidth>700},{"uppy-Dashboard--isAddFilesPanelVisible":e.showAddFilesPanel});return zt("div",{class:n,"aria-hidden":e.inline?"false":e.modal.isHidden,"aria-label":e.inline?e.i18n("dashboardTitle"):e.i18n("dashboardWindowTitle"),onpaste:e.handlePaste},zt("div",{class:"uppy-Dashboard-overlay",tabindex:-1,onclick:e.handleClickOutside}),zt("div",{class:"uppy-Dashboard-inner","aria-modal":!e.inline&&"true",role:!e.inline&&"dialog",style:{width:e.inline&&e.width?e.width:"",height:e.inline&&e.height?e.height:""}},zt("button",{class:"uppy-Dashboard-close",type:"button","aria-label":e.i18n("closeModal"),title:e.i18n("closeModal"),onclick:e.closeModal},zt("span",{"aria-hidden":"true"},"\xd7")),zt("div",{class:"uppy-Dashboard-innerWrap"},!t&&e.showSelectedFiles&&zt(Mt,e),e.showSelectedFiles?zt(t?ut:Rt,e):zt(ut,e),zt(Ye,{transitionName:"uppy-transition-slideDownUp",transitionEnterTimeout:250,transitionLeaveTimeout:250},e.showAddFilesPanel?zt(ct,Nt({key:"AddFilesPanel"},e)):null),zt(Ye,{transitionName:"uppy-transition-slideDownUp",transitionEnterTimeout:250,transitionLeaveTimeout:250},e.fileCardFor?zt(St,Nt({key:"FileCard"},e)):null),zt(Ye,{transitionName:"uppy-transition-slideDownUp",transitionEnterTimeout:250,transitionLeaveTimeout:250},e.activePanel?zt(Bt,Nt({key:"PanelContent"},e)):null),zt("div",{class:"uppy-Dashboard-progressindicators"},e.progressindicators.map(function(t){return e.getPlugin(t.id).render(e.state)})))))},Ht=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Wt=Y.Plugin,Xt=U.h,Gt=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="progressindicator",o.id=o.opts.id||"Informer",o.title="Informer",o.opts=Ht({},{typeColors:{info:{text:"#fff",bg:"#000"},warning:{text:"#fff",bg:"#F6A623"},error:{text:"#fff",bg:"#D32F2F"},success:{text:"#fff",bg:"#1BB240"}}},r),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.render=function(e){var t=e.info,n=t.isHidden,r=t.message,o=t.details;return Xt("div",{class:"uppy uppy-Informer","aria-hidden":n},Xt("p",{role:"alert"},r," ",o&&Xt("span",{"aria-label":o,"data-microtip-position":"top","data-microtip-size":"large",role:"tooltip"},"?")))},t.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},t}(Wt),Vt="error",Kt="waiting",Yt="preprocessing",Jt="uploading",$t="postprocessing",Qt="complete",Zt=function(e){var t,n=(t=e,{hours:Math.floor(t/3600)%24,minutes:Math.floor(t/60)%60,seconds:Math.floor(t%60)}),r=n.hours?n.hours+"h ":"",o=n.hours?("0"+n.minutes).substr(-2):n.minutes;return r+(o?o+"m ":"")+(o?("0"+n.seconds).substr(-2):n.seconds)+"s"},en=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},tn=U.h,nn=function(e){var t=Ve("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn","uppy-StatusBar-actionBtn--upload",{"uppy-c-btn-primary":e.uploadState===Kt});return tn("button",{type:"button",class:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onclick:e.startUpload},e.newFiles&&e.isUploadStarted?e.i18n("uploadXNewFiles",{smart_count:e.newFiles}):e.i18n("uploadXFiles",{smart_count:e.newFiles}))},rn=function(e){return tn("button",{type:"button",class:"uppy-u-reset uppy-c-btn uppy-StatusBar-actionBtn uppy-StatusBar-actionBtn--retry","aria-label":e.i18n("retryUpload"),onclick:e.retryAll},e.i18n("retry"))},on=function(e){return tn("button",{type:"button",class:"uppy-u-reset uppy-StatusBar-actionCircleBtn",title:e.i18n("cancel"),"aria-label":e.i18n("cancel"),onclick:e.cancelAll},tn("svg",{"aria-hidden":"true",class:"UppyIcon",width:"8",height:"8",viewBox:"0 0 8 8",xmlns:"http://www.w3.org/2000/svg"},tn("path",{d:"M5.21 4.104l1.658 1.658-1.106 1.106-1.658-1.659-1.659 1.659L1.34 5.762l1.658-1.658L1.34 2.445 2.445 1.34l1.659 1.658L5.762 1.34l1.106 1.105-1.659 1.659z","fill-rule":"evenodd"})))},sn=function(e){var t=e.isAllPaused,n=(0,e.i18n)(t?"resume":"pause");return tn("button",{title:n,class:"uppy-u-reset uppy-StatusBar-actionCircleBtn",type:"button",onclick:function(){return function(e){if(!e.isAllComplete)return e.resumableUploads?e.isAllPaused?e.resumeAll():e.pauseAll():e.cancelAll()}(e)}},tn("svg",{"aria-hidden":"true",class:"UppyIcon",width:"8",height:"8",viewBox:"0 0 8 8",xmlns:"http://www.w3.org/2000/svg"},tn("path",t?{d:"M6.736 3.852l-4.472 2.84V1.075z","fill-rule":"evenodd"}:{d:"M1 1h2v6H1zM5 1h2v6H5z","fill-rule":"evenodd"})))},an=function(e){return tn("svg",{class:"uppy-StatusBar-spinner",width:"14",height:"14",xmlns:"http://www.w3.org/2000/svg"},tn("path",{d:"M13.983 6.547c-.12-2.509-1.64-4.893-3.939-5.936-2.48-1.127-5.488-.656-7.556 1.094C.524 3.367-.398 6.048.162 8.562c.556 2.495 2.46 4.52 4.94 5.183 2.932.784 5.61-.602 7.256-3.015-1.493 1.993-3.745 3.309-6.298 2.868-2.514-.434-4.578-2.349-5.153-4.84a6.226 6.226 0 0 1 2.98-6.778C6.34.586 9.74 1.1 11.373 3.493c.407.596.693 1.282.842 1.988.127.598.073 1.197.161 1.794.078.525.543 1.257 1.15.864.525-.341.49-1.05.456-1.592-.007-.15.02.3 0 0","fill-rule":"evenodd"}))},ln=function(e){var t=Math.round(100*e.value);return tn("div",{class:"uppy-StatusBar-content"},tn(an,e),"determinate"===e.mode?t+"% \xb7 ":"",e.message)},un=function(e){var t=Ve("uppy-u-reset","uppy-c-btn","uppy-StatusBar-actionBtn");return tn("div",{class:"uppy-StatusBar-statusSecondary"},tn("div",{class:"uppy-StatusBar-statusSecondaryHint"},e.i18n("xMoreFilesAdded",{smart_count:e.newFiles})),tn("button",{type:"button",class:t,"aria-label":e.i18n("uploadXFiles",{smart_count:e.newFiles}),onclick:e.startUpload},e.i18n("upload")))},pn=te(function(e){return tn("div",{class:"uppy-StatusBar-statusSecondary"},e.numUploads>1&&e.i18n("filesUploadedOfTotal",{complete:e.complete,smart_count:e.numUploads})+" \xb7 ",e.i18n("dataUploadedOfTotal",{complete:O(e.totalUploadedSize),total:O(e.totalSize)})+" \xb7 ",e.i18n("xTimeLeft",{time:Zt(e.totalETA)}))},500,{leading:!0,trailing:!0}),cn=function(e){if(!e.isUploadStarted||e.isAllComplete)return null;var t=e.isAllPaused?e.i18n("paused"):e.i18n("uploading"),n=e.newFiles&&e.isUploadStarted;return tn("div",{class:"uppy-StatusBar-content","aria-label":t,title:t},e.isAllPaused?null:tn(an,e),tn("div",{class:"uppy-StatusBar-status"},tn("div",{class:"uppy-StatusBar-statusPrimary"},t,": ",e.totalProgress,"%"),e.isAllPaused||n||!e.showProgressDetails?null:tn(pn,e),n?tn(un,e):null))},hn=function(e){e.totalProgress;var t=e.i18n;return tn("div",{class:"uppy-StatusBar-content",role:"status",title:t("complete")},tn("svg",{"aria-hidden":"true",class:"uppy-StatusBar-statusIndicator UppyIcon",width:"18",height:"17",viewBox:"0 0 23 17"},tn("path",{d:"M8.944 17L0 7.865l2.555-2.61 6.39 6.525L20.41 0 23 2.645z"})),t("complete"))},dn=function(e){var t=e.error,n=(e.retryAll,e.hideRetryButton,e.i18n);return tn("div",{class:"uppy-StatusBar-content",role:"alert"},tn("span",{class:"uppy-StatusBar-contentPadding"},n("uploadFailed"),"."),tn("span",{class:"uppy-StatusBar-details","aria-label":t,"data-microtip-position":"top","data-microtip-size":"large",role:"tooltip"},"?"))},fn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},yn=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.id=o.opts.id||"StatusBar",o.title="StatusBar",o.type="progressindicator";var i={strings:{uploading:"Uploading",upload:"Upload",complete:"Complete",uploadFailed:"Upload failed",pleasePressRetry:"Please press Retry to upload again",paused:"Paused",error:"Error",retry:"Retry",cancel:"Cancel",pause:"Pause",resume:"Resume",pressToRetry:"Press to retry",filesUploadedOfTotal:{0:"%{complete} of %{smart_count} file uploaded",1:"%{complete} of %{smart_count} files uploaded"},dataUploadedOfTotal:"%{complete} of %{total}",xTimeLeft:"%{time} left",uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},xMoreFilesAdded:{0:"%{smart_count} more file added",1:"%{smart_count} more files added"}}},s={target:"body",hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeButton:!1,hideCancelButton:!1,showProgressDetails:!1,locale:i,hideAfterFinish:!0};return o.opts=fn({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.startUpload=o.startUpload.bind(o),o.render=o.render.bind(o),o.install=o.install.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getTotalSpeed=function(e){var t=0;return e.forEach(function(e){t+=function(e){if(!e.bytesUploaded)return 0;var t=new Date-e.uploadStarted;return e.bytesUploaded/(t/1e3)}(e.progress)}),t},t.prototype.getTotalETA=function(e){var t=this.getTotalSpeed(e);if(0===t)return 0;var n=e.reduce(function(e,t){return e+((n=t.progress).bytesTotal-n.bytesUploaded);var n},0);return Math.round(n/t*10)/10},t.prototype.startUpload=function(){var e=this;return this.uppy.upload().catch(function(t){e.uppy.log(t.stack||t.message||t)})},t.prototype.getUploadingState=function(e,t,n){if(e)return Vt;if(t)return Qt;for(var r=Kt,o=Object.keys(n),i=0;i<o.length;i++){var s=n[o[i]].progress;if(s.uploadStarted&&!s.uploadComplete)return Jt;s.preprocess&&r!==Jt&&(r=Yt),s.postprocess&&r!==Jt&&r!==Yt&&(r=$t)}return r},t.prototype.render=function(e){var t=e.capabilities,n=e.files,r=e.allowNewUpload,o=e.totalProgress,i=e.error,s=Object.keys(n).filter(function(e){return!n[e].progress.uploadStarted&&!n[e].progress.preprocess&&!n[e].progress.postprocess}),a=Object.keys(n).filter(function(e){return n[e].progress.uploadStarted}),l=a.filter(function(e){return n[e].isPaused}),u=Object.keys(n).filter(function(e){return n[e].progress.uploadComplete}),p=Object.keys(n).filter(function(e){return n[e].error}),c=Object.keys(n).filter(function(e){return!n[e].progress.uploadComplete&&n[e].progress.uploadStarted}),h=c.filter(function(e){return!n[e].isPaused}),d=Object.keys(n).filter(function(e){return n[e].progress.uploadStarted||n[e].progress.preprocess||n[e].progress.postprocess}),f=Object.keys(n).filter(function(e){return n[e].progress.preprocess||n[e].progress.postprocess}),y=h.map(function(e){return n[e]}),g=this.getTotalETA(y),m=0,v=0;y.forEach(function(e){m+=e.progress.bytesTotal||0,v+=e.progress.bytesUploaded||0});var b=a.length>0,w=100===o&&u.length===Object.keys(n).length&&0===f.length,S=b&&p.length===a.length,C=0!==c.length&&l.length===c.length,_=c.length>0,P=t.resumableUploads||!1;return function(e){var t=e=e||{},n=t.newFiles,r=t.allowNewUpload,o=t.isUploadInProgress,i=t.isAllPaused,s=t.resumableUploads,a=t.error,l=t.hideUploadButton,u=t.hidePauseResumeButton,p=t.hideCancelButton,c=t.hideRetryButton,h=e.uploadState,d=e.totalProgress,f=void 0,y=void 0;if(h===Yt||h===$t){var g=function(e){var t=[];Object.keys(e).forEach(function(n){var r=e[n].progress;r.preprocess&&t.push(r.preprocess),r.postprocess&&t.push(r.postprocess)});var n=t[0];return{mode:n.mode,message:n.message,value:t.filter(function(e){return"determinate"===e.mode}).reduce(function(e,t,n,r){return e+t.value/r.length},0)}}(e.files);"determinate"===(f=g.mode)&&(d=100*g.value),y=ln(g)}else h===Qt?y=hn(e):h===Jt?y=cn(e):h===Vt&&(d=void 0,y=dn(e));var m="number"==typeof d?d:100,v=h===Kt&&e.hideUploadButton||h===Kt&&!e.newFiles>0||h===Qt&&e.hideAfterFinish,b=!a&&n&&!o&&!i&&r&&!l,w=!p&&h!==Kt&&h!==Qt,S=s&&!u&&h!==Kt&&h!==Yt&&h!==$t&&h!==Qt,C=a&&!c,_="uppy-StatusBar-progress\n "+(f?"is-"+f:""),P=Ve({"uppy-Root":e.isTargetDOMEl},"uppy-StatusBar","is-"+h);return tn("div",{class:P,"aria-hidden":v},tn("div",{class:_,style:{width:m+"%"},role:"progressbar","aria-valuemin":"0","aria-valuemax":"100","aria-valuenow":d}),y,tn("div",{class:"uppy-StatusBar-actions"},b?tn(nn,en({},e,{uploadState:h})):null,C?tn(rn,e):null,S?tn(sn,e):null,w?tn(on,e):null))}({error:i,uploadState:this.getUploadingState(S,w,e.files||{}),allowNewUpload:r,totalProgress:o,totalSize:m,totalUploadedSize:v,isAllComplete:w,isAllPaused:C,isAllErrored:S,isUploadStarted:b,isUploadInProgress:_,complete:u.length,newFiles:s.length,numUploads:d.length,totalETA:g,files:n,i18n:this.i18n,pauseAll:this.uppy.pauseAll,resumeAll:this.uppy.resumeAll,retryAll:this.uppy.retryAll,cancelAll:this.uppy.cancelAll,startUpload:this.startUpload,resumableUploads:P,showProgressDetails:this.opts.showProgressDetails,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,hideAfterFinish:this.opts.hideAfterFinish,isTargetDOMEl:this.isTargetDOMEl})},t.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.unmount()},t}(Y.Plugin),gn=function(e,t,n){var r=e.split(",")[1],o=t.mimeType||e.split(",")[0].split(":")[1].split(";")[0];null==o&&(o="plain/text");for(var i=atob(r),s=[],a=0;a<i.length;a++)s.push(i.charCodeAt(a));return n?new File([new Uint8Array(s)],t.name||"",{type:o}):new Blob([new Uint8Array(s)],{type:o})},mn=function(e){return 0===e.indexOf("blob:")},vn=function(e){if(!e)return!1;var t=e.split("/")[1];return!!/^(jpe?g|gif|png|svg|svg\+xml|bmp)$/.test(t)},bn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},wn=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="thumbnail",o.id=o.opts.id||"ThumbnailGenerator",o.title="Thumbnail Generator",o.queue=[],o.queueProcessing=!1,o.defaultThumbnailDimension=200,o.opts=bn({},{thumbnailWidth:null,thumbnailHeight:null},r),o.onFileAdded=o.onFileAdded.bind(o),o.onFileRemoved=o.onFileRemoved.bind(o),o.onRestored=o.onRestored.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.createThumbnail=function(e,t,n){var r=this,o=URL.createObjectURL(e.data);return new Promise(function(e,t){var n=new Image;n.src=o,n.addEventListener("load",function(){URL.revokeObjectURL(o),e(n)}),n.addEventListener("error",function(e){URL.revokeObjectURL(o),t(e.error||new Error("Could not create thumbnail"))})}).then(function(e){var o=r.getProportionalDimensions(e,t,n),i=r.resizeImage(e,o.width,o.height);return r.canvasToBlob(i,"image/png")}).then(function(e){return URL.createObjectURL(e)})},t.prototype.getProportionalDimensions=function(e,t,n){var r=e.width/e.height;return null!=t?{width:t,height:Math.round(t/r)}:null!=n?{width:Math.round(n*r),height:n}:{width:this.defaultThumbnailDimension,height:Math.round(this.defaultThumbnailDimension/r)}},t.prototype.protect=function(e){var t=e.width/e.height,n=Math.floor(Math.sqrt(5e6*t)),r=Math.floor(5e6/Math.sqrt(5e6*t));if(n>4096&&(n=4096,r=Math.round(n/t)),r>4096&&(r=4096,n=Math.round(t*r)),e.width>n){var o=document.createElement("canvas");o.width=n,o.height=r,o.getContext("2d").drawImage(e,0,0,n,r),e=o}return e},t.prototype.resizeImage=function(e,t,n){e=this.protect(e);var r=Math.ceil(Math.log(e.width/t)*Math.LOG2E);r<1&&(r=1);for(var o=t*Math.pow(2,r-1),i=n*Math.pow(2,r-1);r--;){var s=document.createElement("canvas");s.width=o,s.height=i,s.getContext("2d").drawImage(e,0,0,o,i),e=s,o=Math.round(o/2),i=Math.round(i/2)}return e},t.prototype.canvasToBlob=function(e,t,n){return e.toBlob?new Promise(function(r){e.toBlob(r,t,n)}):Promise.resolve().then(function(){return gn(e.toDataURL(t,n),{})})},t.prototype.setPreviewURL=function(e,t){this.uppy.setFileState(e,{preview:t})},t.prototype.addToQueue=function(e){this.queue.push(e),!1===this.queueProcessing&&this.processQueue()},t.prototype.processQueue=function(){var e=this;if(this.queueProcessing=!0,this.queue.length>0){var t=this.queue.shift();return this.requestThumbnail(t).catch(function(e){}).then(function(){return e.processQueue()})}this.queueProcessing=!1,this.uppy.log("[ThumbnailGenerator] Emptied thumbnail queue"),this.uppy.emit("thumbnail:all-generated")},t.prototype.requestThumbnail=function(e){var t=this;return vn(e.type)&&!e.isRemote?this.createThumbnail(e,this.opts.thumbnailWidth,this.opts.thumbnailHeight).then(function(n){t.setPreviewURL(e.id,n),t.uppy.log("[ThumbnailGenerator] Generated thumbnail for "+e.id),t.uppy.emit("thumbnail:generated",t.uppy.getFile(e.id),n)}).catch(function(n){t.uppy.log("[ThumbnailGenerator] Failed thumbnail for "+e.id),t.uppy.log(n,"warning"),t.uppy.emit("thumbnail:error",t.uppy.getFile(e.id),n)}):Promise.resolve()},t.prototype.onFileAdded=function(e){e.preview||this.addToQueue(e)},t.prototype.onFileRemoved=function(e){var t=this.queue.indexOf(e);-1!==t&&this.queue.splice(t,1),e.preview&&mn(e.preview)&&URL.revokeObjectURL(e.preview)},t.prototype.onRestored=function(){var e=this,t=this.uppy.getState().files;Object.keys(t).forEach(function(t){var n=e.uppy.getFile(t);n.isRestored&&(n.preview&&!mn(n.preview)||e.addToQueue(n))})},t.prototype.install=function(){this.uppy.on("file-added",this.onFileAdded),this.uppy.on("file-removed",this.onFileRemoved),this.uppy.on("restored",this.onRestored)},t.prototype.uninstall=function(){this.uppy.off("file-added",this.onFileAdded),this.uppy.off("file-removed",this.onFileRemoved),this.uppy.off("restored",this.onRestored)},t}(Y.Plugin),Sn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Cn=function(e){if("string"==typeof e){var t=[].slice.call(document.querySelectorAll(e));return t.length>0?t:null}if("object"===(void 0===e?"undefined":Sn(e))&&R(e))return[e]},_n=function(e){return Array.prototype.slice.call(e||[],0)},Pn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},En=Y.Plugin,Fn=Ge.default||Ge,kn=Ze,An=['a[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','area[href]:not([tabindex^="-"]):not([inert]):not([aria-hidden])',"input:not([disabled]):not([inert]):not([aria-hidden])","select:not([disabled]):not([inert]):not([aria-hidden])","textarea:not([disabled]):not([inert]):not([aria-hidden])","button:not([disabled]):not([inert]):not([aria-hidden])",'iframe:not([tabindex^="-"]):not([inert]):not([aria-hidden])','object:not([tabindex^="-"]):not([inert]):not([aria-hidden])','embed:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[contenteditable]:not([tabindex^="-"]):not([inert]):not([aria-hidden])','[tabindex]:not([tabindex^="-"]):not([inert]):not([aria-hidden])'],Tn=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.id=o.opts.id||"Dashboard",o.title="Dashboard",o.type="orchestrator",o.modalName="uppy-Dashboard";var i={target:"body",metaFields:[],trigger:"#uppy-select-files",inline:!1,width:750,height:550,thumbnailWidth:280,defaultTabIcon:kn,showLinkToFileUploadResult:!0,showProgressDetails:!1,hideUploadButton:!1,hideRetryButton:!1,hidePauseResumeCancelButtons:!1,hideProgressAfterFinish:!1,note:null,closeModalOnClickOutside:!1,closeAfterFinish:!1,disableStatusBar:!1,disableInformer:!1,disableThumbnailGenerator:!1,disablePageScrollWhenModalOpen:!0,animateOpenClose:!0,proudlyDisplayPoweredByUppy:!0,onRequestCloseModal:function(){return o.closeModal()},showSelectedFiles:!0,browserBackButtonClose:!1};return o.opts=Pn({},i,r),o.translator=new H([{strings:{selectToUpload:"Select files to upload",closeModal:"Close Modal",upload:"Upload",importFrom:"Import from %{name}",addingMoreFiles:"Adding more files",addMoreFiles:"Add more files",dashboardWindowTitle:"Uppy Dashboard Window (Press escape to close)",dashboardTitle:"Uppy Dashboard",copyLinkToClipboardSuccess:"Link copied to clipboard",copyLinkToClipboardFallback:"Copy the URL below",copyLink:"Copy link",fileSource:"File source: %{name}",done:"Done",back:"Back",name:"Name",removeFile:"Remove file",editFile:"Edit file",editing:"Editing %{file}",edit:"Edit",finishEditingFile:"Finish editing file",saveChanges:"Save changes",cancel:"Cancel",localDisk:"Local Disk",myDevice:"My Device",dropPasteImport:"Drop files here, paste, %{browse} or import from",dropPaste:"Drop files here, paste or %{browse}",browse:"browse",fileProgress:"File progress: upload speed and ETA",numberOfSelectedFiles:"Number of selected files",uploadAllNewFiles:"Upload all new files",emptyFolderAdded:"No files were added from empty folder",uploadComplete:"Upload complete",uploadPaused:"Upload paused",resumeUpload:"Resume upload",pauseUpload:"Pause upload",retryUpload:"Retry upload",cancelUpload:"Cancel upload",xFilesSelected:{0:"%{smart_count} file selected",1:"%{smart_count} files selected"},uploadXFiles:{0:"Upload %{smart_count} file",1:"Upload %{smart_count} files"},uploadingXFiles:{0:"Uploading %{smart_count} file",1:"Uploading %{smart_count} files"},processingXFiles:{0:"Processing %{smart_count} file",1:"Processing %{smart_count} files"},uploadXNewFiles:{0:"Upload +%{smart_count} file",1:"Upload +%{smart_count} files"},folderAdded:{0:"Added %{smart_count} file from %{folder}",1:"Added %{smart_count} files from %{folder}"}}},o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.openModal=o.openModal.bind(o),o.closeModal=o.closeModal.bind(o),o.requestCloseModal=o.requestCloseModal.bind(o),o.isModalOpen=o.isModalOpen.bind(o),o.addTarget=o.addTarget.bind(o),o.removeTarget=o.removeTarget.bind(o),o.hideAllPanels=o.hideAllPanels.bind(o),o.showPanel=o.showPanel.bind(o),o.getFocusableNodes=o.getFocusableNodes.bind(o),o.setFocusToFirstNode=o.setFocusToFirstNode.bind(o),o.handlePopState=o.handlePopState.bind(o),o.maintainFocus=o.maintainFocus.bind(o),o.initEvents=o.initEvents.bind(o),o.handleKeyDown=o.handleKeyDown.bind(o),o.handleFileAdded=o.handleFileAdded.bind(o),o.handleComplete=o.handleComplete.bind(o),o.handleClickOutside=o.handleClickOutside.bind(o),o.toggleFileCard=o.toggleFileCard.bind(o),o.toggleAddFilesPanel=o.toggleAddFilesPanel.bind(o),o.handleDrop=o.handleDrop.bind(o),o.handlePaste=o.handlePaste.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.render=o.render.bind(o),o.install=o.install.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.removeTarget=function(e){var t=this.getPluginState().targets.filter(function(t){return t.id!==e.id});this.setPluginState({targets:t})},t.prototype.addTarget=function(e){var t=e.id||e.constructor.name,n=e.title||t,r=e.type;if("acquirer"===r||"progressindicator"===r||"presenter"===r){var o={id:t,name:n,type:r},i=this.getPluginState().targets.slice();return i.push(o),this.setPluginState({targets:i}),this.el}this.uppy.log("Dashboard: Modal can only be used by plugins of types: acquirer, progressindicator, presenter")},t.prototype.hideAllPanels=function(){this.setPluginState({activePanel:!1,showAddFilesPanel:!1})},t.prototype.showPanel=function(e){var t=this.getPluginState().targets.filter(function(t){return"acquirer"===t.type&&t.id===e})[0];this.setPluginState({activePanel:t})},t.prototype.requestCloseModal=function(){if(this.opts.onRequestCloseModal)return this.opts.onRequestCloseModal();this.closeModal()},t.prototype.getFocusableNodes=function(){var e=this.el.querySelectorAll(An);return Object.keys(e).map(function(t){return e[t]})},t.prototype.setFocusToFirstNode=function(){var e=this.getFocusableNodes();e.length&&e[0].focus()},t.prototype.updateBrowserHistory=function(){var e;history.state&&history.state[this.modalName]||history.pushState(((e={})[this.modalName]=!0,e),""),window.addEventListener("popstate",this.handlePopState,!1)},t.prototype.handlePopState=function(e){e.state&&e.state[this.modalName]||this.closeModal({manualClose:!1}),!this.isModalOpen()&&e.state&&e.state[this.modalName]&&history.go(-1)},t.prototype.setFocusToBrowse=function(){var e=this.el.querySelector(".uppy-Dashboard-browse");e&&e.focus()},t.prototype.maintainFocus=function(e){var t=this.getFocusableNodes(),n=t.indexOf(document.activeElement);e.shiftKey&&0===n&&(t[t.length-1].focus(),e.preventDefault()),e.shiftKey||n!==t.length-1||(t[0].focus(),e.preventDefault())},t.prototype.openModal=function(){var e=this;this.savedScrollPosition=window.scrollY,this.savedActiveElement=document.activeElement,this.opts.disablePageScrollWhenModalOpen&&document.body.classList.add("uppy-Dashboard-isFixed"),this.opts.animateOpenClose&&this.getPluginState().isClosing?this.el.addEventListener("animationend",function t(){e.setPluginState({isHidden:!1}),e.el.removeEventListener("animationend",t,!1)},!1):this.setPluginState({isHidden:!1}),this.opts.browserBackButtonClose&&this.updateBrowserHistory(),document.addEventListener("keydown",this.handleKeyDown),this.setFocusToBrowse()},t.prototype.closeModal=function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).manualClose,n=void 0===t||t;this.opts.disablePageScrollWhenModalOpen&&document.body.classList.remove("uppy-Dashboard-isFixed"),this.opts.animateOpenClose?(this.setPluginState({isClosing:!0}),this.el.addEventListener("animationend",function t(){e.setPluginState({isHidden:!0,isClosing:!1}),e.el.removeEventListener("animationend",t,!1)},!1)):this.setPluginState({isHidden:!0}),document.removeEventListener("keydown",this.handleKeyDown),this.savedActiveElement.focus(),n&&this.opts.browserBackButtonClose&&history.state&&history.state[this.modalName]&&history.go(-1)},t.prototype.isModalOpen=function(){return!this.getPluginState().isHidden||!1},t.prototype.handleKeyDown=function(e){27===e.keyCode&&this.requestCloseModal(e),9===e.keyCode&&this.maintainFocus(e)},t.prototype.handleClickOutside=function(){this.opts.closeModalOnClickOutside&&this.requestCloseModal()},t.prototype.handlePaste=function(e){var t=this;_n(e.clipboardData.items).forEach(function(e){if("file"===e.kind){var n=e.getAsFile();if(!n)return t.uppy.log("[Dashboard] File pasted, but the file blob is empty"),void t.uppy.info("Error pasting file","error");t.uppy.log("[Dashboard] File pasted");try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:n})}catch(e){}}})},t.prototype.handleInputChange=function(e){var t=this;e.preventDefault(),_n(e.target.files).forEach(function(e){try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:e})}catch(e){}})},t.prototype.initEvents=function(){var e=this,t=Cn(this.opts.trigger);!this.opts.inline&&t&&t.forEach(function(t){return t.addEventListener("click",e.openModal)}),this.opts.inline||t||this.uppy.log("Dashboard modal trigger not found. Make sure `trigger` is set in Dashboard options unless you are planning to call openModal() method yourself"),this.removeDragDropListener=He(this.el,function(t){e.handleDrop(t)}),this.ro=new Fn(function(t,n){var r=t,o=Array.isArray(r),i=0;for(r=o?r:r[Symbol.iterator]();;){var s;if(o){if(i>=r.length)break;s=r[i++]}else{if((i=r.next()).done)break;s=i.value}var a=s.contentRect,l=a.width,u=a.height;e.uppy.log("[Dashboard] resized: "+l+" / "+u),e.setPluginState({containerWidth:l,containerHeight:u})}}),this.ro.observe(this.el.querySelector(".uppy-Dashboard-inner")),this.uppy.on("plugin-remove",this.removeTarget),this.uppy.on("file-added",this.handleFileAdded),this.uppy.on("complete",this.handleComplete)},t.prototype.handleFileAdded=function(){this.hideAllPanels()},t.prototype.handleComplete=function(e){var t=e.failed;e.uploadID,this.opts.closeAfterFinish&&0===t.length&&this.requestCloseModal()},t.prototype.removeEvents=function(){var e=this,t=Cn(this.opts.trigger);!this.opts.inline&&t&&t.forEach(function(t){return t.removeEventListener("click",e.openModal)}),this.ro.unobserve(this.el.querySelector(".uppy-Dashboard-inner")),this.removeDragDropListener(),window.removeEventListener("popstate",this.handlePopState,!1),this.uppy.off("plugin-remove",this.removeTarget),this.uppy.off("file-added",this.handleFileAdded),this.uppy.off("complete",this.handleComplete)},t.prototype.toggleFileCard=function(e){this.setPluginState({fileCardFor:e||!1})},t.prototype.toggleAddFilesPanel=function(e){this.setPluginState({showAddFilesPanel:e})},t.prototype.handleDrop=function(e){var t=this;this.uppy.log("[Dashboard] Files were dropped"),e.forEach(function(e){try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:e})}catch(e){}})},t.prototype.render=function(e){var t=this,n=this.getPluginState(),r=e.files,o=e.capabilities,i=e.allowNewUpload,s=Object.keys(r).filter(function(e){return!r[e].progress.uploadStarted}),a=Object.keys(r).filter(function(e){return r[e].progress.uploadStarted}),l=Object.keys(r).filter(function(e){return r[e].isPaused}),u=Object.keys(r).filter(function(e){return r[e].progress.uploadComplete}),p=Object.keys(r).filter(function(e){return r[e].error}),c=Object.keys(r).filter(function(e){return!r[e].progress.uploadComplete&&r[e].progress.uploadStarted}),h=c.filter(function(e){return!r[e].isPaused}),d=Object.keys(r).filter(function(e){return r[e].progress.preprocess||r[e].progress.postprocess}),f=a.length>0,y=100===e.totalProgress&&u.length===Object.keys(r).length&&0===d.length,g=f&&p.length===a.length,m=0!==c.length&&l.length===c.length,v=function(e){var n=t.uppy.getPlugin(e.id);return Pn({},e,{icon:n.icon||t.opts.defaultTabIcon,render:n.render})},b=n.targets.filter(function(e){return"acquirer"===e.type&&function(e){var n=t.uppy.getPlugin(e.id);return"function"!=typeof n.isSupported||n.isSupported()}(e)}).map(v),w=n.targets.filter(function(e){return"progressindicator"===e.type}).map(v);return qt({state:e,modal:n,files:r,newFiles:s,uploadStartedFiles:a,completeFiles:u,erroredFiles:p,inProgressFiles:c,inProgressNotPausedFiles:h,processingFiles:d,isUploadStarted:f,isAllComplete:y,isAllErrored:g,isAllPaused:m,totalFileCount:Object.keys(r).length,totalProgress:e.totalProgress,allowNewUpload:i,acquirers:b,activePanel:n.activePanel,animateOpenClose:this.opts.animateOpenClose,isClosing:n.isClosing,getPlugin:this.uppy.getPlugin,progressindicators:w,autoProceed:this.uppy.opts.autoProceed,id:this.id,closeModal:this.requestCloseModal,handleClickOutside:this.handleClickOutside,handleInputChange:this.handleInputChange,handlePaste:this.handlePaste,inline:this.opts.inline,showPanel:this.showPanel,hideAllPanels:this.hideAllPanels,log:this.uppy.log,i18n:this.i18n,i18nArray:this.i18nArray,addFile:this.uppy.addFile,removeFile:this.uppy.removeFile,info:this.uppy.info,note:this.opts.note,metaFields:n.metaFields,resumableUploads:o.resumableUploads||!1,bundled:o.bundled||!1,startUpload:function(e){t.uppy.upload().catch(function(e){t.uppy.log(e.stack||e.message||e)})},pauseUpload:this.uppy.pauseResume,retryUpload:this.uppy.retryUpload,cancelUpload:function(e){t.uppy.removeFile(e)},cancelAll:this.uppy.cancelAll,fileCardFor:n.fileCardFor,toggleFileCard:this.toggleFileCard,toggleAddFilesPanel:this.toggleAddFilesPanel,showAddFilesPanel:n.showAddFilesPanel,saveFileCard:function(e,n){t.uppy.setFileMeta(n,e),t.toggleFileCard()},width:this.opts.width,height:this.opts.height,showLinkToFileUploadResult:this.opts.showLinkToFileUploadResult,proudlyDisplayPoweredByUppy:this.opts.proudlyDisplayPoweredByUppy,currentWidth:n.containerWidth,isWide:n.containerWidth>400,containerWidth:n.containerWidth,isTargetDOMEl:this.isTargetDOMEl,allowedFileTypes:this.uppy.opts.restrictions.allowedFileTypes,maxNumberOfFiles:this.uppy.opts.restrictions.maxNumberOfFiles,showSelectedFiles:this.opts.showSelectedFiles})},t.prototype.discoverProviderPlugins=function(){var e=this;this.uppy.iteratePlugins(function(t){t&&!t.target&&t.opts&&t.opts.target===e.constructor&&e.addTarget(t)})},t.prototype.install=function(){var e=this;this.setPluginState({isHidden:!0,showFileCard:!1,showAddFilesPanel:!1,activePanel:!1,metaFields:this.opts.metaFields,targets:[]});var t=this.opts,n=t.inline,r=t.closeAfterFinish;if(n&&r)throw new Error("[Dashboard] `closeAfterFinish: true` cannot be used on an inline Dashboard, because an inline Dashboard cannot be closed at all. Either set `inline: false`, or disable the `closeAfterFinish` option.");this.uppy.opts.allowMultipleUploads&&r&&this.uppy.log("[Dashboard] When using `closeAfterFinish`, we recommended setting the `allowMultipleUploads` option to `false` in the Uppy constructor. See https://uppy.io/docs/uppy/#allowMultipleUploads-true","warning");var o=this.opts.target;o&&this.mount(o,this),(this.opts.plugins||[]).forEach(function(t){var n=e.uppy.getPlugin(t);n&&n.mount(e,n)}),this.opts.disableStatusBar||this.uppy.use(yn,{id:this.id+":StatusBar",target:this,hideUploadButton:this.opts.hideUploadButton,hideRetryButton:this.opts.hideRetryButton,hidePauseResumeButton:this.opts.hidePauseResumeButton,hideCancelButton:this.opts.hideCancelButton,showProgressDetails:this.opts.showProgressDetails,hideAfterFinish:this.opts.hideProgressAfterFinish,locale:this.opts.locale}),this.opts.disableInformer||this.uppy.use(Gt,{id:this.id+":Informer",target:this}),this.opts.disableThumbnailGenerator||this.uppy.use(wn,{id:this.id+":ThumbnailGenerator",thumbnailWidth:this.opts.thumbnailWidth}),this.discoverProviderPlugins(),this.initEvents()},t.prototype.uninstall=function(){var e=this;if(!this.opts.disableInformer){var t=this.uppy.getPlugin(this.id+":Informer");t&&this.uppy.removePlugin(t)}if(!this.opts.disableStatusBar){var n=this.uppy.getPlugin(this.id+":StatusBar");n&&this.uppy.removePlugin(n)}if(!this.opts.disableThumbnailGenerator){var r=this.uppy.getPlugin(this.id+":ThumbnailGenerator");r&&this.uppy.removePlugin(r)}(this.opts.plugins||[]).forEach(function(t){var n=e.uppy.getPlugin(t);n&&n.unmount()}),this.unmount(),this.removeEvents()},t}(En),On=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Un=Y.Plugin,xn=U.h,Rn=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.type="acquirer",o.id=o.opts.id||"DragDrop",o.title="Drag & Drop";var i={strings:{dropHereOr:"Drop files here or %{browse}",browse:"browse"}},s={target:null,inputName:"files[]",width:"100%",height:"100%",note:null,locale:i};return o.opts=On({},s,r),o.isDragDropSupported=o.checkDragDropSupport(),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.handleDrop=o.handleDrop.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.checkDragDropSupport=o.checkDragDropSupport.bind(o),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.checkDragDropSupport=function(){var e=document.createElement("div");return"draggable"in e&&"ondragstart"in e&&"ondrop"in e&&"FormData"in window&&"FileReader"in window},t.prototype.handleDrop=function(e){var t=this;this.uppy.log("[DragDrop] Files dropped"),e.forEach(function(e){try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:e})}catch(e){}})},t.prototype.handleInputChange=function(e){var t=this;this.uppy.log("[DragDrop] Files selected through input"),_n(e.target.files).forEach(function(e){try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:e})}catch(e){}})},t.prototype.render=function(e){var t=this,n="uppy-Root uppy-DragDrop-container "+(this.isDragDropSupported?"uppy-DragDrop--is-dragdrop-supported":""),r={width:this.opts.width,height:this.opts.height},o=this.uppy.opts.restrictions;return xn("div",{class:n,style:r},xn("div",{class:"uppy-DragDrop-inner"},xn("svg",{"aria-hidden":"true",class:"UppyIcon uppy-DragDrop-arrow",width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},xn("path",{d:"M11 10V0H5v10H2l6 6 6-6h-3zm0 0","fill-rule":"evenodd"})),xn("label",{class:"uppy-DragDrop-label"},xn("input",{style:{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},class:"uppy-DragDrop-input",type:"file",name:this.opts.inputName,multiple:1!==o.maxNumberOfFiles,accept:o.allowedFileTypes,ref:function(e){t.input=e},onchange:this.handleInputChange,value:""}),this.i18nArray("dropHereOr",{browse:xn("span",{class:"uppy-DragDrop-dragText"},this.i18n("browse"))})),xn("span",{class:"uppy-DragDrop-note"},this.opts.note)))},t.prototype.install=function(){var e=this,t=this.opts.target;t&&this.mount(t,this),this.removeDragDropListener=He(this.el,function(t){e.handleDrop(t),e.uppy.log(t)})},t.prototype.uninstall=function(){this.unmount(),this.removeDragDropListener()},t}(Un),Dn=U.h,Bn=function(e){return Dn("div",{class:"uppy-Provider-loading"},Dn("span",null,"Loading..."))};function jn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function In(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function Ln(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}var Mn=U.h,Nn=U.Component,zn=function(e){function t(){return jn(this,t),In(this,e.apply(this,arguments))}return Ln(t,e),t.prototype.componentDidMount=function(){var e=this;setTimeout(function(){e.connectButton&&e.connectButton.focus({preventScroll:!0})},150)},t.prototype.render=function(){var e=this;return Mn("div",{class:"uppy-Provider-auth"},Mn("div",{class:"uppy-Provider-authIcon"},this.props.pluginIcon()),Mn("h1",{class:"uppy-Provider-authTitle"},"Please authenticate with ",Mn("span",{class:"uppy-Provider-authTitleName"},this.props.pluginName),Mn("br",null)," to select files"),Mn("button",{type:"button",class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn",onclick:this.props.handleAuth,ref:function(t){e.connectButton=t}},"Connect to ",this.props.pluginName),this.props.demo&&Mn("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Provider-authBtn",onclick:this.props.handleDemoAuth},"Proceed with Demo Account"))},t}(Nn),qn=function(e){function t(){return jn(this,t),In(this,e.apply(this,arguments))}return Ln(t,e),t.prototype.componentDidMount=function(){this.props.checkAuth()},t.prototype.render=function(){return this.props.checkAuthInProgress?Mn(Bn,null):Mn(zn,this.props)},t}(Nn),Hn=U.h,Wn=U.h,Xn=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r.isEmpty=!0,r.handleKeyPress=r.handleKeyPress.bind(r),r.handleClear=r.handleClear.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleKeyPress=function(e){if(13===e.keyCode)return e.stopPropagation(),void e.preventDefault();this.isEmpty=!this.input.value.length>0,this.props.filterQuery(e)},t.prototype.handleClear=function(e){this.input.value="",this.props.filterQuery()},t.prototype.render=function(){var e=this;return Wn("div",{class:"uppy-u-reset uppy-ProviderBrowser-search"},Wn("svg",{class:"UppyIcon uppy-ProviderBrowser-searchIcon",viewBox:"0 0 100 100"},Wn("path",{d:"M87.533 80.03L62.942 55.439c3.324-4.587 5.312-10.207 5.312-16.295 0-.312-.043-.611-.092-.908.05-.301.093-.605.093-.922 0-15.36-12.497-27.857-27.857-27.857-.273 0-.536.043-.799.08-.265-.037-.526-.08-.799-.08-15.361 0-27.858 12.497-27.858 27.857 0 .312.042.611.092.909a5.466 5.466 0 0 0-.093.921c0 15.36 12.496 27.858 27.857 27.858.273 0 .535-.043.8-.081.263.038.524.081.798.081 5.208 0 10.071-1.464 14.245-3.963L79.582 87.98a5.603 5.603 0 0 0 3.976 1.647 5.621 5.621 0 0 0 3.975-9.597zM39.598 55.838c-.265-.038-.526-.081-.8-.081-9.16 0-16.612-7.452-16.612-16.612 0-.312-.042-.611-.092-.908.051-.301.093-.605.093-.922 0-9.16 7.453-16.612 16.613-16.612.272 0 .534-.042.799-.079.263.037.525.079.799.079 9.16 0 16.612 7.452 16.612 16.612 0 .312.043.611.092.909-.05.301-.094.604-.094.921 0 9.16-7.452 16.612-16.612 16.612-.274 0-.536.043-.798.081z"})),Wn("input",{class:"uppy-u-reset uppy-ProviderBrowser-searchInput",type:"text",placeholder:"Filter","aria-label":"Filter",onkeyup:this.handleKeyPress,onkeydown:this.handleKeyPress,onkeypress:this.handleKeyPress,value:this.props.filterInput,ref:function(t){e.input=t}}),!this.isEmpty&&Wn("button",{class:"uppy-u-reset uppy-ProviderBrowser-searchClose",type:"button",onclick:this.handleClear},Wn("svg",{class:"UppyIcon",viewBox:"0 0 19 19"},Wn("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"}))))},t}(U.Component),Gn=U.h,Vn=function(e){return Gn("div",{class:"uppy-ProviderBrowser-footer"},Gn("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary",onclick:e.done},e.i18n("selectXFiles",{smart_count:e.selected})),Gn("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-link",onclick:e.cancel},e.i18n("cancel")))},Kn=U.h,Yn=function(e){var t=function(e){13===e.keyCode&&(e.stopPropagation(),e.preventDefault())},n=e.getItemIcon();return Kn("li",{class:"uppy-ProviderBrowserItem"+(e.isChecked?" uppy-ProviderBrowserItem--selected":"")+("video"===n?" uppy-ProviderBrowserItem--noPreview":"")},Kn("div",{class:"uppy-ProviderBrowserItem-checkbox"},Kn("input",{type:"checkbox",role:"option",tabindex:0,"aria-label":"Select "+e.title,id:e.id,checked:e.isChecked,disabled:e.isDisabled,onchange:e.handleClick,onkeyup:t,onkeydown:t,onkeypress:t}),Kn("label",{for:e.id,onclick:e.handleClick})),Kn("button",{type:"button",class:"uppy-ProviderBrowserItem-inner","aria-label":"Select "+e.title,tabindex:0,onclick:function(t){if(t.preventDefault(),"folder"===e.type)return e.handleFolderClick(t);e.handleClick(t)}},function(e){if(null!==e)switch(e){case"file":return Kn("svg",{"aria-hidden":"true",class:"UppyIcon",width:11,height:14.5,viewBox:"0 0 44 58"},Kn("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"}));case"folder":return Kn("svg",{"aria-hidden":"true",class:"UppyIcon",style:{width:16,marginRight:3},viewBox:"0 0 276.157 276.157"},Kn("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"}));case"video":return Kn("svg",{"aria-hidden":"true",viewBox:"0 0 58 58"},Kn("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"}),Kn("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"}));default:return Kn("img",{src:e})}}(e.getItemIcon()),e.showTitles&&e.title))},Jn=U.h,$n=function(e){return e.folders.length||e.files.length?Jn("div",{class:"uppy-ProviderBrowser-body"},Jn("ul",{class:"uppy-ProviderBrowser-list",onscroll:e.handleScroll,role:"listbox","aria-label":"List of files from "+e.title},e.folders.map(function(t){var n=!1,r=e.isChecked(t);return r&&(n=r.loading),Yn({title:t.name,id:t.id,type:"folder",getItemIcon:function(){return t.icon},isDisabled:n,isChecked:r,handleFolderClick:function(){return e.handleFolderClick(t)},handleClick:function(n){return e.toggleCheckbox(n,t)},columns:e.columns,showTitles:e.showTitles})}),e.files.map(function(t){return Yn({title:t.name,id:t.id,type:"file",getItemIcon:function(){return t.icon},isDisabled:!1,isChecked:e.isChecked(t),handleClick:function(n){return e.toggleCheckbox(n,t)},columns:e.columns,showTitles:e.showTitles})}))):Jn("div",{class:"uppy-Provider-empty"},e.i18n("noFilesFound"))},Qn=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Zn=U.h,er=function(e){var t=e.folders,n=e.files;""!==e.filterInput&&(t=e.filterItems(e.folders),n=e.filterItems(e.files));var r=e.currentSelection.length;return Zn("div",{class:Ve("uppy-ProviderBrowser","uppy-ProviderBrowser-viewType--"+e.viewType)},Zn("div",{class:"uppy-ProviderBrowser-header"},Zn("div",{class:Ve("uppy-ProviderBrowser-headerBar",!e.showBreadcrumbs&&"uppy-ProviderBrowser-headerBar--simple")},Zn("div",{class:"uppy-Provider-breadcrumbsWrap"},Zn("div",{class:"uppy-Provider-breadcrumbsIcon"},e.pluginIcon&&e.pluginIcon()),e.showBreadcrumbs&&function(e){return Hn("div",{class:"uppy-Provider-breadcrumbs"},e.directories.map(function(t,n){return function(e){return Hn("button",{type:"button",onclick:e.getFolder},e.title)}({getFolder:function(){return e.getFolder(t.id)},title:0===n?e.title:t.title})}))}({getFolder:e.getFolder,directories:e.directories,title:e.title})),Zn("span",{class:"uppy-ProviderBrowser-user"},e.username),Zn("button",{type:"button",onclick:e.logout,class:"uppy-ProviderBrowser-userLogout"},e.i18n("logOut")))),e.showFilter&&Zn(Xn,e),Zn($n,{columns:[{name:"Name",key:"title"}],folders:t,files:n,activeRow:e.isActiveRow,sortByTitle:e.sortByTitle,sortByDate:e.sortByDate,isChecked:e.isChecked,handleFolderClick:e.getNextFolder,toggleCheckbox:e.toggleCheckbox,handleScroll:e.handleScroll,title:e.title,showTitles:e.showTitles,i18n:e.i18n}),r>0&&Zn(Vn,Qn({selected:r},e)))},tr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function nr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var rr=U.h,or=function(e){function t(){return nr(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentWillUnmount=function(){this.props.onUnmount()},t.prototype.render=function(){return this.props.children[0]},t}(U.Component),ir=function(){function e(t,n){nr(this,e),this.plugin=t,this.provider=n.provider,this.opts=tr({},{viewType:"list",showTitles:!0,showFilter:!0,showBreadcrumbs:!0},n),this.addFile=this.addFile.bind(this),this.filterItems=this.filterItems.bind(this),this.filterQuery=this.filterQuery.bind(this),this.toggleSearch=this.toggleSearch.bind(this),this.getFolder=this.getFolder.bind(this),this.getNextFolder=this.getNextFolder.bind(this),this.logout=this.logout.bind(this),this.checkAuth=this.checkAuth.bind(this),this.handleAuth=this.handleAuth.bind(this),this.handleDemoAuth=this.handleDemoAuth.bind(this),this.sortByTitle=this.sortByTitle.bind(this),this.sortByDate=this.sortByDate.bind(this),this.isActiveRow=this.isActiveRow.bind(this),this.isChecked=this.isChecked.bind(this),this.toggleCheckbox=this.toggleCheckbox.bind(this),this.handleError=this.handleError.bind(this),this.handleScroll=this.handleScroll.bind(this),this.donePicking=this.donePicking.bind(this),this.cancelPicking=this.cancelPicking.bind(this),this.clearSelection=this.clearSelection.bind(this),this.render=this.render.bind(this),this.clearSelection()}return e.prototype.tearDown=function(){},e.prototype._updateFilesAndFolders=function(e,t,n){e.items.forEach(function(e){e.isFolder?n.push(e):t.push(e)}),this.plugin.setPluginState({folders:n,files:t})},e.prototype.checkAuth=function(){var e=this;this.plugin.setPluginState({checkAuthInProgress:!0}),this.provider.checkAuth().then(function(t){e.plugin.setPluginState({checkAuthInProgress:!1}),e.plugin.onAuth(t)}).catch(function(t){e.plugin.setPluginState({checkAuthInProgress:!1}),e.handleError(t)})},e.prototype.getFolder=function(e,t){var n=this;return this._loaderWrapper(this.provider.list(e),function(r){var o,i=n.plugin.getPluginState(),s=function(t,n){for(var r=0;r<t.length;r++)if(o=t[r],e===o.id)return r;var o;return-1}(i.directories);o=-1!==s?i.directories.slice(0,s+1):i.directories.concat([{id:e,title:t}]),n.username=n.username?n.username:r.username,n.nextPagePath=r.nextPagePath,n._updateFilesAndFolders(r,[],[]),n.plugin.setPluginState({directories:o})},this.handleError)},e.prototype.getNextFolder=function(e){this.getFolder(e.requestPath,e.name),this.lastCheckbox=void 0},e.prototype.addFile=function(e){var t={id:this.providerFileToId(e),source:this.plugin.id,data:e,name:e.name||e.id,type:e.mimeType,isRemote:!0,body:{fileId:e.id},remote:{serverUrl:this.plugin.opts.serverUrl,url:""+this.provider.fileUrl(e.requestPath),body:{fileId:e.id},providerOptions:this.provider.opts}},n=V(t);n&&vn(n)&&(t.preview=e.thumbnail),this.plugin.uppy.log("Adding remote file");try{this.plugin.uppy.addFile(t)}catch(e){}},e.prototype.removeFile=function(e){var t=this.plugin.getPluginState().currentSelection;this.plugin.setPluginState({currentSelection:t.filter(function(t){return t.id!==e})})},e.prototype.logout=function(){var e=this;this.provider.logout(location.href).then(function(t){t.ok&&e.plugin.setPluginState({authenticated:!1,files:[],folders:[],directories:[]})}).catch(this.handleError)},e.prototype.filterQuery=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState(tr({},t,{filterInput:e?e.target.value:""}))},e.prototype.toggleSearch=function(e){var t=this.plugin.getPluginState();this.plugin.setPluginState({isSearchVisible:!t.isSearchVisible,filterInput:""})},e.prototype.filterItems=function(e){var t=this.plugin.getPluginState();return""===t.filterInput?e:e.filter(function(e){return-1!==e.name.toLowerCase().indexOf(t.filterInput.toLowerCase())})},e.prototype.sortByTitle=function(){var e=tr({},this.plugin.getPluginState()),t=e.files,n=e.folders,r=e.sorting,o=t.sort(function(e,t){return"titleDescending"===r?t.name.localeCompare(e.name):e.name.localeCompare(t.name)}),i=n.sort(function(e,t){return"titleDescending"===r?t.name.localeCompare(e.name):e.name.localeCompare(t.name)});this.plugin.setPluginState(tr({},e,{files:o,folders:i,sorting:"titleDescending"===r?"titleAscending":"titleDescending"}))},e.prototype.sortByDate=function(){var e=tr({},this.plugin.getPluginState()),t=e.files,n=e.folders,r=e.sorting,o=t.sort(function(e,t){var n=new Date(e.modifiedDate),o=new Date(t.modifiedDate);return"dateDescending"===r?n>o?-1:n<o?1:0:n>o?1:n<o?-1:0}),i=n.sort(function(e,t){var n=new Date(e.modifiedDate),o=new Date(t.modifiedDate);return"dateDescending"===r?n>o?-1:n<o?1:0:n>o?1:n<o?-1:0});this.plugin.setPluginState(tr({},e,{files:o,folders:i,sorting:"dateDescending"===r?"dateAscending":"dateDescending"}))},e.prototype.sortBySize=function(){var e=tr({},this.plugin.getPluginState()),t=e.files,n=e.sorting;if(t.length&&this.plugin.getItemData(t[0]).size){var r=t.sort(function(e,t){var r=e.size,o=t.size;return"sizeDescending"===n?r>o?-1:r<o?1:0:r>o?1:r<o?-1:0});this.plugin.setPluginState(tr({},e,{files:r,sorting:"sizeDescending"===n?"sizeAscending":"sizeDescending"}))}},e.prototype.isActiveRow=function(e){return this.plugin.getPluginState().activeRow===this.plugin.getItemId(e)},e.prototype.isChecked=function(e){return this.plugin.getPluginState().currentSelection.some(function(t){return t===e})},e.prototype.addFolder=function(e){var t=this,n=this.providerFileToId(e),r=this.plugin.getPluginState(),o=r.selectedFolders||{};if(!(n in o&&o[n].loading))return o[n]={loading:!0,files:[]},this.plugin.setPluginState({selectedFolders:o}),this.provider.list(e.requestPath).then(function(i){var s=[];i.items.forEach(function(e){e.isFolder||(t.addFile(e),s.push(t.providerFileToId(e)))}),(r=t.plugin.getPluginState()).selectedFolders[n]={loading:!1,files:s},t.plugin.setPluginState({selectedFolders:o});var a,l=t.plugin.uppy.getPlugin("Dashboard");a=s.length?l.i18n("folderAdded",{smart_count:s.length,folder:e.name}):l.i18n("emptyFolderAdded"),t.plugin.uppy.info(a)}).catch(function(e){delete(r=t.plugin.getPluginState()).selectedFolders[n],t.plugin.setPluginState({selectedFolders:r.selectedFolders}),t.handleError(e)})},e.prototype.toggleCheckbox=function(e,t){e.stopPropagation(),e.preventDefault();var n=this.plugin.getPluginState(),r=n.folders,o=n.files,i=this.filterItems(r.concat(o));if(this.lastCheckbox&&e.shiftKey){var s,a=i.indexOf(this.lastCheckbox),l=i.indexOf(t);return s=a<l?i.slice(a,l+1):i.slice(l,a+1),void this.plugin.setPluginState({currentSelection:s})}this.lastCheckbox=t;var u=this.plugin.getPluginState().currentSelection;this.isChecked(t)?this.plugin.setPluginState({currentSelection:u.filter(function(e){return e!==t})}):this.plugin.setPluginState({currentSelection:u.concat([t])})},e.prototype.providerFileToId=function(e){return W({data:e,name:e.name||e.id,type:e.mimeType})},e.prototype.handleDemoAuth=function(){var e=this.plugin.getPluginState();this.plugin.setPluginState({},e,{authenticated:!0})},e.prototype.handleAuth=function(){var e=this,t=btoa(JSON.stringify({origin:location.origin})),n=this.provider.authUrl()+"?state="+t,r=window.open(n,"_blank");window.addEventListener("message",function t(n){e._isOriginAllowed(n.origin,e.plugin.opts.serverPattern)&&n.source===r?(r.close(),window.removeEventListener("message",t),e.provider.setAuthToken(n.data.token),e._loaderWrapper(e.provider.checkAuth(),e.plugin.onAuth,e.handleError)):e.plugin.uppy.log("rejecting event from "+n.origin+" vs allowed pattern "+e.plugin.opts.serverPattern)})},e.prototype._isOriginAllowed=function(e,t){var n=function(e){return"string"==typeof e?new RegExp("^"+e+"$"):e instanceof RegExp?e:void 0};return(Array.isArray(t)?t.map(n):[n(t)]).filter(function(e){return null!==e}).some(function(t){return t.test(e)})},e.prototype.handleError=function(e){var t=this.plugin.uppy,n=t.i18n("companionError");t.log(e.toString()),t.info({message:n,details:e.toString()},"error",5e3)},e.prototype.handleScroll=function(e){var t=this,n=e.target.scrollHeight-(e.target.scrollTop+e.target.offsetHeight),r=this.nextPagePath?this.nextPagePath:null;n<50&&r&&!this._isHandlingScroll&&(this.provider.list(r).then(function(e){var n=t.plugin.getPluginState(),r=n.files,o=n.folders;t._updateFilesAndFolders(e,r,o)}).catch(this.handleError).then(function(){t._isHandlingScroll=!1}),this._isHandlingScroll=!0)},e.prototype.donePicking=function(){var e=this,t=this.plugin.getPluginState().currentSelection.map(function(t){return t.isFolder?e.addFolder(t):e.addFile(t)});this._loaderWrapper(Promise.all(t),function(){e.clearSelection()},function(){})},e.prototype.cancelPicking=function(){this.clearSelection();var e=this.plugin.uppy.getPlugin("Dashboard");e&&e.hideAllPanels()},e.prototype.clearSelection=function(){this.plugin.setPluginState({currentSelection:[]})},e.prototype._loaderWrapper=function(e,t,n){var r=this;e.then(function(e){r.plugin.setPluginState({loading:!1}),t(e)}).catch(function(e){r.plugin.setPluginState({loading:!1}),n(e)}),this.plugin.setPluginState({loading:!0})},e.prototype.render=function(e){var t=this.plugin.getPluginState(),n=t.authenticated,r=t.checkAuthInProgress;if(t.loading)return rr(or,{onUnmount:this.clearSelection},rr(Bn,null));if(!n)return rr(or,{onUnmount:this.clearSelection},rr(qn,{pluginName:this.plugin.title,pluginIcon:this.plugin.icon,demo:this.plugin.opts.demo,checkAuth:this.checkAuth,handleAuth:this.handleAuth,handleDemoAuth:this.handleDemoAuth,checkAuthInProgress:r}));var o=tr({},this.plugin.getPluginState(),{username:this.username,getNextFolder:this.getNextFolder,getFolder:this.getFolder,filterItems:this.filterItems,filterQuery:this.filterQuery,toggleSearch:this.toggleSearch,sortByTitle:this.sortByTitle,sortByDate:this.sortByDate,logout:this.logout,demo:this.plugin.opts.demo,isActiveRow:this.isActiveRow,isChecked:this.isChecked,toggleCheckbox:this.toggleCheckbox,handleScroll:this.handleScroll,done:this.donePicking,cancel:this.cancelPicking,title:this.plugin.title,viewType:this.opts.viewType,showTitles:this.opts.showTitles,showFilter:this.opts.showFilter,showBreadcrumbs:this.opts.showBreadcrumbs,pluginIcon:this.plugin.icon,i18n:this.plugin.uppy.i18n});return rr(or,{onUnmount:this.clearSelection},rr(er,o))},e}(),sr=Y.Plugin,ar=d.Provider,lr=U.h,ur=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.id=o.opts.id||"Dropbox",ar.initPlugin(o,r),o.title=o.opts.title||"Dropbox",o.icon=function(){return lr("svg",{"aria-hidden":"true",fill:"#0060ff",width:"128",height:"118",viewBox:"0 0 128 118"},lr("path",{d:"M38.145.777L1.108 24.96l25.608 20.507 37.344-23.06z"}),lr("path",{d:"M1.108 65.975l37.037 24.183L64.06 68.525l-37.343-23.06zM64.06 68.525l25.917 21.633 37.036-24.183-25.61-20.51z"}),lr("path",{d:"M127.014 24.96L89.977.776 64.06 22.407l37.345 23.06zM64.136 73.18l-25.99 21.567-11.122-7.262v8.142l37.112 22.256 37.114-22.256v-8.142l-11.12 7.262z"}))},o.provider=new ar(n,{serverUrl:o.opts.serverUrl,serverHeaders:o.opts.serverHeaders,provider:"dropbox"}),o.onAuth=o.onAuth.bind(o),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.install=function(){this.view=new ir(this,{provider:this.provider}),this.setPluginState({authenticated:!1,files:[],folders:[],directories:[],activeRow:-1,filterInput:"",isSearchVisible:!1});var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.view.tearDown(),this.unmount()},t.prototype.onAuth=function(e){this.setPluginState({authenticated:e}),e&&this.view.getFolder()},t.prototype.render=function(e){return this.view.render(e)},t}(sr),pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},cr=Y.Plugin,hr=U.h,dr=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.id=o.opts.id||"FileInput",o.title="File Input",o.type="acquirer";var i={strings:{chooseFiles:"Choose files"}},s={target:null,pretty:!0,inputName:"files[]",locale:i};return o.opts=pr({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.render=o.render.bind(o),o.handleInputChange=o.handleInputChange.bind(o),o.handleClick=o.handleClick.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleInputChange=function(e){var t=this;this.uppy.log("[FileInput] Something selected through input..."),_n(e.target.files).forEach(function(e){try{t.uppy.addFile({source:t.id,name:e.name,type:e.type,data:e})}catch(e){}})},t.prototype.handleClick=function(e){this.input.click()},t.prototype.render=function(e){var t=this,n=this.uppy.opts.restrictions;return hr("div",{class:"uppy-Root uppy-FileInput-container"},hr("input",{class:"uppy-FileInput-input",style:this.opts.pretty&&{width:"0.1px",height:"0.1px",opacity:0,overflow:"hidden",position:"absolute",zIndex:-1},type:"file",name:this.opts.inputName,onchange:this.handleInputChange,multiple:1!==n.maxNumberOfFiles,accept:n.allowedFileTypes,ref:function(e){t.input=e},value:""}),this.opts.pretty&&hr("button",{class:"uppy-FileInput-btn",type:"button",onclick:this.handleClick},this.i18n("chooseFiles")))},t.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.unmount()},t}(cr),fr={__esModule:!0};fr.default=Sr,fr.getFieldData=Cr;var yr={"[object HTMLCollection]":!0,"[object NodeList]":!0,"[object RadioNodeList]":!0},gr={button:!0,fieldset:!0,reset:!0,submit:!0},mr={checkbox:!0,radio:!0},vr=/^\s+|\s+$/g,br=Array.prototype.slice,wr=Object.prototype.toString;function Sr(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{trim:!1};if(!e)throw new Error("A form is required by getFormData, was given form="+e);for(var n={},r=void 0,o=[],i={},s=0,a=e.elements.length;s<a;s++){var l=e.elements[s];gr[l.type]||l.disabled||(r=l.name||l.id)&&!i[r]&&(o.push(r),i[r]=!0)}for(var u=0,p=o.length;u<p;u++){var c=Cr(e,r=o[u],t);null!=c&&(n[r]=c)}return n}function Cr(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{trim:!1};if(!e)throw new Error("A form is required by getFieldData, was given form="+e);if(!t&&"[object String]"!==wr.call(t))throw new Error("A field name is required by getFieldData, was given fieldName="+t);var r=e.elements[t];if(!r||r.disabled)return null;if(!yr[wr.call(r)])return _r(r,n.trim);for(var o=[],i=!0,s=0,a=r.length;s<a;s++)if(!r[s].disabled){i&&"radio"!==r[s].type&&(i=!1);var l=_r(r[s],n.trim);null!=l&&(o=o.concat(l))}return i&&1===o.length?o[0]:o.length>0?o:null}function _r(e,t){var n=null,r=e.type;if("select-one"===r)return e.options.length&&(n=e.options[e.selectedIndex].value),n;if("select-multiple"===r){n=[];for(var o=0,i=e.options.length;o<i;o++)e.options[o].selected&&n.push(e.options[o].value);return 0===n.length&&(n=null),n}return"file"===r&&"files"in e?(e.multiple?0===(n=br.call(e.files)).length&&(n=null):n=e.files[0],n):(mr[r]?e.checked&&(n=e.value):n=t?e.value.replace(vr,""):e.value,n)}Sr.getFieldData=Cr;var Pr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Er=Y.Plugin,Fr=fr.default||fr,kr=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="acquirer",o.id="Form",o.title="Form",o.opts=Pr({},{target:null,resultName:"uppyResult",getMetaFromForm:!0,addResultToForm:!0,submitOnSuccess:!1,triggerUploadOnSubmit:!1},r),o.handleFormSubmit=o.handleFormSubmit.bind(o),o.handleUploadStart=o.handleUploadStart.bind(o),o.handleSuccess=o.handleSuccess.bind(o),o.addResultToForm=o.addResultToForm.bind(o),o.getMetaFromForm=o.getMetaFromForm.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleUploadStart=function(){this.opts.getMetaFromForm&&this.getMetaFromForm()},t.prototype.handleSuccess=function(e){this.opts.addResultToForm&&this.addResultToForm(e),this.opts.submitOnSuccess&&this.form.submit()},t.prototype.handleFormSubmit=function(e){var t=this;this.opts.triggerUploadOnSubmit&&(e.preventDefault(),this.uppy.upload().catch(function(e){t.uppy.log(e.stack||e.message||e)}))},t.prototype.addResultToForm=function(e){this.uppy.log("[Form] Adding result to the original form:"),this.uppy.log(e);var t=this.form.querySelector('[name="'+this.opts.resultName+'"]');t?t.value=JSON.stringify(e):((t=document.createElement("input")).name=this.opts.resultName,t.type="hidden",t.value=JSON.stringify(e),this.form.appendChild(t))},t.prototype.getMetaFromForm=function(){var e=Fr(this.form);this.uppy.setMeta(e)},t.prototype.install=function(){this.form=B(this.opts.target),this.form&&"FORM"!==!this.form.nodeName?(this.form.addEventListener("submit",this.handleFormSubmit),this.uppy.on("upload",this.handleUploadStart),this.uppy.on("complete",this.handleSuccess)):console.error("Form plugin requires a <form> target element passed in options to operate, none was found","error")},t.prototype.uninstall=function(){this.form.removeEventListener("submit",this.handleFormSubmit),this.uppy.off("upload",this.handleUploadStart),this.uppy.off("complete",this.handleSuccess)},t}(Er),Ar={},Tr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Or="undefined"!=typeof window&&(window.indexedDB||window.webkitIndexedDB||window.mozIndexedDB||window.OIndexedDB||window.msIndexedDB),Ur=!!Or,xr="uppy-blobs",Rr="files",Dr=864e5,Br=3;function jr(e){var t=Or.open(e,Br);return new Promise(function(e,n){t.onupgradeneeded=function(t){var n=t.target.result,r=t.currentTarget.transaction;if(t.oldVersion<2&&n.createObjectStore(Rr,{keyPath:"id"}).createIndex("store","store",{unique:!1}),t.oldVersion<3){var o=r.objectStore(Rr);o.createIndex("expires","expires",{unique:!1}),o.openCursor().onsuccess=function(e){var t=e.target.result;if(t){var n=t.value;n.expires=Date.now()+Dr,t.update(n)}}}r.oncomplete=function(){e(n)}},t.onsuccess=function(t){e(t.target.result)},t.onerror=n})}function Ir(e){return new Promise(function(t,n){e.onsuccess=function(e){t(e.target.result)},e.onerror=n})}var Lr=!1,Mr=function(){function e(t){var n=this;!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.opts=Tr({dbName:xr,storeName:"default",expires:Dr,maxFileSize:10485760,maxTotalSize:314572800},t),this.name=this.opts.storeName;var r=function(){return jr(n.opts.dbName)};Lr?this.ready=r():(Lr=!0,this.ready=e.cleanup().then(r,r))}return e.prototype.key=function(e){return this.name+"!"+e},e.prototype.list=function(){var e=this;return this.ready.then(function(t){return Ir(t.transaction([Rr],"readonly").objectStore(Rr).index("store").getAll(IDBKeyRange.only(e.name)))}).then(function(e){var t={};return e.forEach(function(e){t[e.fileID]=e.data}),t})},e.prototype.get=function(e){var t=this;return this.ready.then(function(n){return Ir(n.transaction([Rr],"readonly").objectStore(Rr).get(t.key(e)))}).then(function(e){return{id:e.data.fileID,data:e.data.data}})},e.prototype.getSize=function(){var e=this;return this.ready.then(function(t){var n=t.transaction([Rr],"readonly").objectStore(Rr).index("store").openCursor(IDBKeyRange.only(e.name));return new Promise(function(e,t){var r=0;n.onsuccess=function(t){var n=t.target.result;n?(r+=n.value.data.size,n.continue()):e(r)},n.onerror=function(){t(new Error("Could not retrieve stored blobs size"))}})})},e.prototype.put=function(e){var t=this;return e.data.size>this.opts.maxFileSize?Promise.reject(new Error("File is too big to store.")):this.getSize().then(function(e){return e>t.opts.maxTotalSize?Promise.reject(new Error("No space left")):t.ready}).then(function(n){return Ir(n.transaction([Rr],"readwrite").objectStore(Rr).add({id:t.key(e.id),fileID:e.id,store:t.name,expires:Date.now()+t.opts.expires,data:e.data}))})},e.prototype.delete=function(e){var t=this;return this.ready.then(function(n){return Ir(n.transaction([Rr],"readwrite").objectStore(Rr).delete(t.key(e)))})},e.cleanup=function(){return jr(xr).then(function(e){var t=e.transaction([Rr],"readwrite").objectStore(Rr).index("expires").openCursor(IDBKeyRange.upperBound(Date.now()));return new Promise(function(n,r){t.onsuccess=function(t){var r=t.target.result;if(r){var o=r.value;console.log("[IndexedDBStore] Deleting record",o.fileID,"of size",O(o.data.size),"- expired on",new Date(o.expires)),r.delete(),r.continue()}else n(e)},t.onerror=r})}).then(function(e){e.close()})},e}();Mr.isSupported=Ur,Ar=Mr;var Nr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function zr(e){try{return JSON.parse(e)}catch(e){return null}}var qr=!1,Hr=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.opts=Nr({expires:864e5},t),this.name="uppyState:"+t.storeName,qr||(qr=!0,e.cleanup())}return e.prototype.load=function(){var e=localStorage.getItem(this.name);if(!e)return null;var t=zr(e);return t?t.metadata?t.metadata:(this.save(t),t):null},e.prototype.save=function(e){var t=Date.now()+this.opts.expires,n=JSON.stringify({metadata:e,expires:t});localStorage.setItem(this.name,n)},e.cleanup=function(){var e=function(){for(var e=[],t=0;t<localStorage.length;t++){var n=localStorage.key(t);/^uppyState:/.test(n)&&e.push(n.slice("uppyState:".length))}return e}(),t=Date.now();e.forEach(function(e){var n=localStorage.getItem("uppyState:"+e);if(!n)return null;var r=zr(n);if(!r)return null;r.expires&&r.expires<t&&localStorage.removeItem("uppyState:"+e)})},e}(),Wr={},Xr="undefined"!=typeof navigator&&"serviceWorker"in navigator,Gr=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.ready=new Promise(function(e,t){Xr?navigator.serviceWorker.controller?e():navigator.serviceWorker.addEventListener("controllerchange",function(){e()}):t(new Error("Unsupported"))}),this.name=t.storeName}return e.prototype.list=function(){var e=this,t={},n=new Promise(function(e,n){t.resolve=e,t.reject=n});console.log("Loading stored blobs from Service Worker");var r=function n(r){if(r.data.store===e.name)switch(r.data.type){case"uppy/ALL_FILES":t.resolve(r.data.files),navigator.serviceWorker.removeEventListener("message",n)}};return this.ready.then(function(){navigator.serviceWorker.addEventListener("message",r),navigator.serviceWorker.controller.postMessage({type:"uppy/GET_FILES",store:e.name})}),n},e.prototype.put=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/ADD_FILE",store:t.name,file:e})})},e.prototype.delete=function(e){var t=this;return this.ready.then(function(){navigator.serviceWorker.controller.postMessage({type:"uppy/REMOVE_FILE",store:t.name,fileID:e})})},e}();Gr.isSupported=Xr,Wr=Gr;var Vr,Kr=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Yr=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="debugger",o.id="GoldenRetriever",o.title="Golden Retriever",o.opts=Kr({},{expires:864e5,serviceWorker:!1},r),o.MetaDataStore=new Hr({expires:o.opts.expires,storeName:n.getID()}),o.ServiceWorkerStore=null,o.opts.serviceWorker&&(o.ServiceWorkerStore=new Wr({storeName:n.getID()})),o.IndexedDBStore=new Ar(Kr({expires:o.opts.expires},r.indexedDB||{},{storeName:n.getID()})),o.saveFilesStateToLocalStorage=o.saveFilesStateToLocalStorage.bind(o),o.loadFilesStateFromLocalStorage=o.loadFilesStateFromLocalStorage.bind(o),o.loadFileBlobsFromServiceWorker=o.loadFileBlobsFromServiceWorker.bind(o),o.loadFileBlobsFromIndexedDB=o.loadFileBlobsFromIndexedDB.bind(o),o.onBlobsLoaded=o.onBlobsLoaded.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.loadFilesStateFromLocalStorage=function(){var e=this.MetaDataStore.load();e&&(this.uppy.log("[GoldenRetriever] Recovered some state from Local Storage"),this.uppy.setState({currentUploads:e.currentUploads||{},files:e.files||{}}),this.savedPluginData=e.pluginData)},t.prototype.getWaitingFiles=function(){var e={};return this.uppy.getFiles().forEach(function(t){t.progress&&t.progress.uploadStarted||(e[t.id]=t)}),e},t.prototype.getUploadingFiles=function(){var e=this,t={},n=this.uppy.getState().currentUploads;return n&&Object.keys(n).forEach(function(r){n[r].fileIDs.forEach(function(n){t[n]=e.uppy.getFile(n)})}),t},t.prototype.saveFilesStateToLocalStorage=function(){var e=Kr(this.getWaitingFiles(),this.getUploadingFiles()),t={};this.uppy.emit("restore:get-data",function(e){Kr(t,e)});var n=this.uppy.getState().currentUploads;this.MetaDataStore.save({currentUploads:n,files:e,pluginData:t})},t.prototype.loadFileBlobsFromServiceWorker=function(){var e=this;this.ServiceWorkerStore.list().then(function(t){var n=Object.keys(t).length;return n===e.uppy.getFiles().length?(e.uppy.log("[GoldenRetriever] Successfully recovered "+n+" blobs from Service Worker!"),e.uppy.info("Successfully recovered "+n+" files","success",3e3),e.onBlobsLoaded(t)):(e.uppy.log("[GoldenRetriever] No blobs found in Service Worker, trying IndexedDB now..."),e.loadFileBlobsFromIndexedDB())}).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to recover blobs from Service Worker","warning"),e.uppy.log(t)})},t.prototype.loadFileBlobsFromIndexedDB=function(){var e=this;this.IndexedDBStore.list().then(function(t){var n=Object.keys(t).length;if(n>0)return e.uppy.log("[GoldenRetriever] Successfully recovered "+n+" blobs from IndexedDB!"),e.uppy.info("Successfully recovered "+n+" files","success",3e3),e.onBlobsLoaded(t);e.uppy.log("[GoldenRetriever] No blobs found in IndexedDB")}).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to recover blobs from IndexedDB","warning"),e.uppy.log(t)})},t.prototype.onBlobsLoaded=function(e){var t=this,n=[],r=Kr({},this.uppy.getState().files);Object.keys(e).forEach(function(o){var i=t.uppy.getFile(o);if(i){var s=e[o],a=Kr({},i,{data:s,isRestored:!0});r[o]=a}else n.push(o)}),this.uppy.setState({files:r}),this.uppy.emit("restored",this.savedPluginData),n.length&&this.deleteBlobs(n).then(function(){t.uppy.log("[GoldenRetriever] Cleaned up "+n.length+" old files")}).catch(function(e){t.uppy.log("[GoldenRetriever] Could not clean up "+n.length+" old files","warning"),t.uppy.log(e)})},t.prototype.deleteBlobs=function(e){var t=this,n=[];return e.forEach(function(e){t.ServiceWorkerStore&&n.push(t.ServiceWorkerStore.delete(e)),t.IndexedDBStore&&n.push(t.IndexedDBStore.delete(e))}),Promise.all(n)},t.prototype.install=function(){var e=this;this.loadFilesStateFromLocalStorage(),this.uppy.getFiles().length>0?this.ServiceWorkerStore?(this.uppy.log("[GoldenRetriever] Attempting to load files from Service Worker..."),this.loadFileBlobsFromServiceWorker()):(this.uppy.log("[GoldenRetriever] Attempting to load files from Indexed DB..."),this.loadFileBlobsFromIndexedDB()):(this.uppy.log("[GoldenRetriever] No files need to be loaded, only restoring processing state..."),this.onBlobsLoaded([])),this.uppy.on("file-added",function(t){t.isRemote||(e.ServiceWorkerStore&&e.ServiceWorkerStore.put(t).catch(function(t){e.uppy.log("[GoldenRetriever] Could not store file","warning"),e.uppy.log(t)}),e.IndexedDBStore.put(t).catch(function(t){e.uppy.log("[GoldenRetriever] Could not store file","warning"),e.uppy.log(t)}))}),this.uppy.on("file-removed",function(t){e.ServiceWorkerStore&&e.ServiceWorkerStore.delete(t.id).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to remove file","warning"),e.uppy.log(t)}),e.IndexedDBStore.delete(t.id).catch(function(t){e.uppy.log("[GoldenRetriever] Failed to remove file","warning"),e.uppy.log(t)})}),this.uppy.on("complete",function(t){var n=t.successful,r=n.map(function(e){return e.id});e.deleteBlobs(r).then(function(){e.uppy.log("[GoldenRetriever] Removed "+n.length+" files that finished uploading")}).catch(function(t){e.uppy.log("[GoldenRetriever] Could not remove "+n.length+" files that finished uploading","warning"),e.uppy.log(t)})}),this.uppy.on("state-update",this.saveFilesStateToLocalStorage),this.uppy.on("restored",function(){var t=e.uppy.getState().currentUploads;t&&Object.keys(t).forEach(function(n){e.uppy.restore(n,t[n])})})},t}(Y.Plugin),Jr=function(e){function t(){return function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.toggleCheckbox=function(t,n){t.stopPropagation(),t.preventDefault(),n.custom.isTeamDrive||e.prototype.toggleCheckbox.call(this,t,n)},t}(ir),$r=Y.Plugin,Qr=d.Provider,Zr=U.h,eo=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.id=o.opts.id||"GoogleDrive",o.title=o.opts.title||"Google Drive",Qr.initPlugin(o,r),o.title=o.opts.title||"Google Drive",o.icon=function(){return Zr("svg",{"aria-hidden":"true",width:"18px",height:"16px",viewBox:"0 0 18 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},Zr("g",{"fill-rule":"evenodd"},Zr("polygon",{fill:"#3089FC",points:"6.32475 10.2 18 10.2 14.999625 15.3 3.324375 15.3"}),Zr("polygon",{fill:"#00A85D",points:"3.000375 15.3 0 10.2 5.83875 0.275974026 8.838 5.37597403 5.999625 10.2"}),Zr("polygon",{fill:"#FFD024",points:"11.838375 9.92402597 5.999625 0 12.000375 0 17.839125 9.92402597"})))},o.provider=new Qr(n,{serverUrl:o.opts.serverUrl,serverHeaders:o.opts.serverHeaders,provider:"drive",authProvider:"google"}),o.onAuth=o.onAuth.bind(o),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.install=function(){this.view=new Jr(this,{provider:this.provider}),this.setPluginState({authenticated:!1,files:[],folders:[],directories:[],activeRow:-1,filterInput:"",isSearchVisible:!1,hasTeamDrives:!1,teamDrives:[],teamDriveId:""});var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.view.tearDown(),this.unmount()},t.prototype.onAuth=function(e){this.setPluginState({authenticated:e}),e&&this.view.getFolder("root","/")},t.prototype.render=function(e){return this.view.render(e)},t}($r),to=Y.Plugin,no=d.Provider,ro=U.h,oo=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.id=o.opts.id||"Instagram",no.initPlugin(o,r),o.title=o.opts.title||"Instagram",o.icon=function(){return ro("svg",{"aria-hidden":"true",fill:"#DE3573",width:"28",height:"28",viewBox:"0 0 512 512"},ro("path",{d:"M256,49.471c67.266,0,75.233.257,101.8,1.469,24.562,1.121,37.9,5.224,46.778,8.674a78.052,78.052,0,0,1,28.966,18.845,78.052,78.052,0,0,1,18.845,28.966c3.45,8.877,7.554,22.216,8.674,46.778,1.212,26.565,1.469,34.532,1.469,101.8s-0.257,75.233-1.469,101.8c-1.121,24.562-5.225,37.9-8.674,46.778a83.427,83.427,0,0,1-47.811,47.811c-8.877,3.45-22.216,7.554-46.778,8.674-26.56,1.212-34.527,1.469-101.8,1.469s-75.237-.257-101.8-1.469c-24.562-1.121-37.9-5.225-46.778-8.674a78.051,78.051,0,0,1-28.966-18.845,78.053,78.053,0,0,1-18.845-28.966c-3.45-8.877-7.554-22.216-8.674-46.778-1.212-26.564-1.469-34.532-1.469-101.8s0.257-75.233,1.469-101.8c1.121-24.562,5.224-37.9,8.674-46.778A78.052,78.052,0,0,1,78.458,78.458a78.053,78.053,0,0,1,28.966-18.845c8.877-3.45,22.216-7.554,46.778-8.674,26.565-1.212,34.532-1.469,101.8-1.469m0-45.391c-68.418,0-77,.29-103.866,1.516-26.815,1.224-45.127,5.482-61.151,11.71a123.488,123.488,0,0,0-44.62,29.057A123.488,123.488,0,0,0,17.3,90.982C11.077,107.007,6.819,125.319,5.6,152.134,4.369,179,4.079,187.582,4.079,256S4.369,333,5.6,359.866c1.224,26.815,5.482,45.127,11.71,61.151a123.489,123.489,0,0,0,29.057,44.62,123.486,123.486,0,0,0,44.62,29.057c16.025,6.228,34.337,10.486,61.151,11.71,26.87,1.226,35.449,1.516,103.866,1.516s77-.29,103.866-1.516c26.815-1.224,45.127-5.482,61.151-11.71a128.817,128.817,0,0,0,73.677-73.677c6.228-16.025,10.486-34.337,11.71-61.151,1.226-26.87,1.516-35.449,1.516-103.866s-0.29-77-1.516-103.866c-1.224-26.815-5.482-45.127-11.71-61.151a123.486,123.486,0,0,0-29.057-44.62A123.487,123.487,0,0,0,421.018,17.3C404.993,11.077,386.681,6.819,359.866,5.6,333,4.369,324.418,4.079,256,4.079h0Z"}),ro("path",{d:"M256,126.635A129.365,129.365,0,1,0,385.365,256,129.365,129.365,0,0,0,256,126.635Zm0,213.338A83.973,83.973,0,1,1,339.974,256,83.974,83.974,0,0,1,256,339.973Z"}),ro("circle",{cx:"390.476",cy:"121.524",r:"30.23"}))},o.provider=new no(n,{serverUrl:o.opts.serverUrl,serverHeaders:o.opts.serverHeaders,provider:"instagram",authProvider:"instagram"}),o.onAuth=o.onAuth.bind(o),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.install=function(){this.view=new ir(this,{provider:this.provider,viewType:"grid",showTitles:!1,showFilter:!1,showBreadcrumbs:!1}),this.setPluginState({authenticated:!1,files:[],folders:[],directories:[],activeRow:-1,filterInput:"",isSearchVisible:!1});var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.view.tearDown(),this.unmount()},t.prototype.onAuth=function(e){this.setPluginState({authenticated:e}),e&&this.view.getFolder("recent")},t.prototype.render=function(e){return this.view.render(e)},t}(to),io=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},so=Y.Plugin,ao=U.h,lo=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.id=o.opts.id||"ProgressBar",o.title="Progress Bar",o.type="progressindicator",o.opts=io({},{target:"body",replaceTargetContent:!1,fixed:!1,hideAfterFinish:!0},r),o.render=o.render.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.render=function(e){var t=e.totalProgress||0,n=100===t&&this.opts.hideAfterFinish;return ao("div",{class:"uppy uppy-ProgressBar",style:{position:this.opts.fixed?"fixed":"initial"},"aria-hidden":n},ao("div",{class:"uppy-ProgressBar-inner",style:{width:t+"%"}}),ao("div",{class:"uppy-ProgressBar-percentage"},t))},t.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.unmount()},t}(so),uo=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},po=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="debugger",o.id="ReduxDevTools",o.title="Redux DevTools",o.opts=uo({},{},r),o.handleStateChange=o.handleStateChange.bind(o),o.initDevTools=o.initDevTools.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleStateChange=function(e,t,n){this.devTools.send("UPPY_STATE_UPDATE",t)},t.prototype.initDevTools=function(){var e=this;this.devTools=window.devToolsExtension.connect(),this.devToolsUnsubscribe=this.devTools.subscribe(function(t){if("DISPATCH"===t.type)switch(console.log(t.payload.type),t.payload.type){case"RESET":return void e.uppy.reset();case"IMPORT_STATE":var n=t.payload.nextLiftedState.computedStates;return e.uppy.store.state=uo({},e.uppy.getState(),n[n.length-1].state),void e.uppy.updateAll(e.uppy.getState());case"JUMP_TO_STATE":case"JUMP_TO_ACTION":e.uppy.store.state=uo({},e.uppy.getState(),JSON.parse(t.state)),e.uppy.updateAll(e.uppy.getState())}})},t.prototype.install=function(){this.withDevTools="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__,this.withDevTools&&(this.initDevTools(),this.uppy.on("state-update",this.handleStateChange))},t.prototype.uninstall=function(){this.withDevTools&&(this.devToolsUnsubscribe(),this.uppy.off("state-update",this.handleStateUpdate))},t}(Y.Plugin),co=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ho=function(e){return function(t){return t.uppy[e]}},fo=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this._store=t.store,this._id=t.id||b(),this._selector=t.selector||ho(this._id),this.setState({})}return e.prototype.setState=function(e){this._store.dispatch({type:"uppy/STATE_UPDATE",id:this._id,payload:e})},e.prototype.getState=function(){return this._selector(this._store.getState())},e.prototype.subscribe=function(e){var t=this,n=this.getState();return this._store.subscribe(function(){var r=t.getState();if(n!==r){var o=function(e,t){var n=Object.keys(t),r={};return n.forEach(function(n){e[n]!==t[n]&&(r[n]=t[n])}),r}(n,r);e(n,r,o),n=r}})},e}();(Vr=function(e){return new fo(e)}).STATE_UPDATE="uppy/STATE_UPDATE",Vr.reducer=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments[1];if("uppy/STATE_UPDATE"===t.type){var n,r=co({},e[t.id],t.payload);return co({},e,((n={})[t.id]=r,n))}return e},Vr.middleware=function(){return function(){return function(e){return function(t){e(t)}}}};var yo={exports:{}};function go(e){if(e)return function(e){for(var t in go.prototype)e[t]=go.prototype[t];return e}(e)}yo.exports=go,go.prototype.on=go.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},go.prototype.once=function(e,t){function n(){this.off(e,n),t.apply(this,arguments)}return n.fn=t,this.on(e,n),this},go.prototype.off=go.prototype.removeListener=go.prototype.removeAllListeners=go.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var n,r=this._callbacks["$"+e];if(!r)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<r.length;o++)if((n=r[o])===t||n.fn===t){r.splice(o,1);break}return this},go.prototype.emit=function(e){this._callbacks=this._callbacks||{};var t=[].slice.call(arguments,1),n=this._callbacks["$"+e];if(n)for(var r=0,o=(n=n.slice(0)).length;r<o;++r)n[r].apply(this,t);return this},go.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},go.prototype.hasListeners=function(e){return!!this.listeners(e).length},yo=yo.exports;var mo={};function vo(e){e=e||{},this.ms=e.min||100,this.max=e.max||1e4,this.factor=e.factor||2,this.jitter=e.jitter>0&&e.jitter<=1?e.jitter:0,this.attempts=0}mo=vo,vo.prototype.duration=function(){var e=this.ms*Math.pow(this.factor,this.attempts++);if(this.jitter){var t=Math.random(),n=Math.floor(t*this.jitter*e);e=0==(1&Math.floor(10*t))?e-n:e+n}return 0|Math.min(e,this.max)},vo.prototype.reset=function(){this.attempts=0},vo.prototype.setMin=function(e){this.ms=e},vo.prototype.setMax=function(e){this.max=e},vo.prototype.setJitter=function(e){this.jitter=e};var bo=[].slice,wo=function(e,t){if("string"==typeof t&&(t=e[t]),"function"!=typeof t)throw new Error("bind() requires a function");var n=bo.call(arguments,2);return function(){return t.apply(e,n.concat(bo.call(arguments)))}};function So(){}var Co=function(e,t,n){var r=!1;return n=n||So,o.count=e,0===e?t():o;function o(e,i){if(o.count<=0)throw new Error("after called too many times");--o.count,e?(r=!0,t(e),t=n):0!==o.count||r||t(null,i)}},_o=function(e,t,n){var r=e.byteLength;if(t=t||0,n=n||r,e.slice)return e.slice(t,n);if(t<0&&(t+=r),n<0&&(n+=r),n>r&&(n=r),t>=r||t>=n||0===r)return new ArrayBuffer(0);for(var o=new Uint8Array(e),i=new Uint8Array(n-t),s=t,a=0;s<n;s++,a++)i[a]=o[s];return i.buffer},Po={};!function(){"use strict";for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=new Uint8Array(256),n=0;n<e.length;n++)t[e.charCodeAt(n)]=n;Po.encode=function(t){var n,r=new Uint8Array(t),o=r.length,i="";for(n=0;n<o;n+=3)i+=e[r[n]>>2],i+=e[(3&r[n])<<4|r[n+1]>>4],i+=e[(15&r[n+1])<<2|r[n+2]>>6],i+=e[63&r[n+2]];return o%3==2?i=i.substring(0,i.length-1)+"=":o%3==1&&(i=i.substring(0,i.length-2)+"=="),i},Po.decode=function(e){var n,r,o,i,s,a=.75*e.length,l=e.length,u=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);var p=new ArrayBuffer(a),c=new Uint8Array(p);for(n=0;n<l;n+=4)r=t[e.charCodeAt(n)],o=t[e.charCodeAt(n+1)],i=t[e.charCodeAt(n+2)],s=t[e.charCodeAt(n+3)],c[u++]=r<<2|o>>4,c[u++]=(15&o)<<4|i>>2,c[u++]=(3&i)<<6|63&s;return p}}();var Eo={},Fo=void 0!==Fo?Fo:"undefined"!=typeof WebKitBlobBuilder?WebKitBlobBuilder:"undefined"!=typeof MSBlobBuilder?MSBlobBuilder:"undefined"!=typeof MozBlobBuilder&&MozBlobBuilder,ko=function(){try{return 2===new Blob(["hi"]).size}catch(e){return!1}}(),Ao=ko&&function(){try{return 2===new Blob([new Uint8Array([1,2])]).size}catch(e){return!1}}(),To=Fo&&Fo.prototype.append&&Fo.prototype.getBlob;function Oo(e){return e.map(function(e){if(e.buffer instanceof ArrayBuffer){var t=e.buffer;if(e.byteLength!==t.byteLength){var n=new Uint8Array(e.byteLength);n.set(new Uint8Array(t,e.byteOffset,e.byteLength)),t=n.buffer}return t}return e})}function Uo(e,t){t=t||{};var n=new Fo;return Oo(e).forEach(function(e){n.append(e)}),t.type?n.getBlob(t.type):n.getBlob()}function xo(e,t){return new Blob(Oo(e),t||{})}"undefined"!=typeof Blob&&(Uo.prototype=Blob.prototype,xo.prototype=Blob.prototype),Eo=ko?Ao?Blob:xo:To?Uo:void 0;var Ro,Do,Bo,jo=Object.keys||function(e){var t=[],n=Object.prototype.hasOwnProperty;for(var r in e)n.call(e,r)&&t.push(r);return t},Io=String.fromCharCode;function Lo(e){for(var t,n,r=[],o=0,i=e.length;o<i;)(t=e.charCodeAt(o++))>=55296&&t<=56319&&o<i?56320==(64512&(n=e.charCodeAt(o++)))?r.push(((1023&t)<<10)+(1023&n)+65536):(r.push(t),o--):r.push(t);return r}function Mo(e,t){if(e>=55296&&e<=57343){if(t)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value");return!1}return!0}function No(e,t){return Io(e>>t&63|128)}function zo(e,t){if(0==(4294967168&e))return Io(e);var n="";return 0==(4294965248&e)?n=Io(e>>6&31|192):0==(4294901760&e)?(Mo(e,t)||(e=65533),n=Io(e>>12&15|224),n+=No(e,6)):0==(4292870144&e)&&(n=Io(e>>18&7|240),n+=No(e,12),n+=No(e,6)),n+Io(63&e|128)}function qo(){if(Bo>=Do)throw Error("Invalid byte index");var e=255&Ro[Bo];if(Bo++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function Ho(e){var t,n;if(Bo>Do)throw Error("Invalid byte index");if(Bo==Do)return!1;if(t=255&Ro[Bo],Bo++,0==(128&t))return t;if(192==(224&t)){if((n=(31&t)<<6|qo())>=128)return n;throw Error("Invalid continuation byte")}if(224==(240&t)){if((n=(15&t)<<12|qo()<<6|qo())>=2048)return Mo(n,e)?n:65533;throw Error("Invalid continuation byte")}if(240==(248&t)&&(n=(7&t)<<18|qo()<<12|qo()<<6|qo())>=65536&&n<=1114111)return n;throw Error("Invalid UTF-8 detected")}for(var Wo=function(e,t){for(var n=!1!==(t=t||{}).strict,r=Lo(e),o=r.length,i=-1,s="";++i<o;)s+=zo(r[i],n);return s},Xo=function(e,t){var n=!1!==(t=t||{}).strict;Ro=Lo(e),Do=Ro.length,Bo=0;for(var r,o=[];!1!==(r=Ho(n));)o.push(r);return function(e){for(var t,n=e.length,r=-1,o="";++r<n;)(t=e[r])>65535&&(o+=Io((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=Io(t);return o}(o)},Go={toByteArray:function(e){for(var t,n=Zo(e),r=n[0],o=n[1],i=new Yo(function(e,t,n){return 3*(t+n)/4-n}(0,r,o)),s=0,a=o>0?r-4:r,l=0;l<a;l+=4)t=Ko[e.charCodeAt(l)]<<18|Ko[e.charCodeAt(l+1)]<<12|Ko[e.charCodeAt(l+2)]<<6|Ko[e.charCodeAt(l+3)],i[s++]=t>>16&255,i[s++]=t>>8&255,i[s++]=255&t;return 2===o&&(t=Ko[e.charCodeAt(l)]<<2|Ko[e.charCodeAt(l+1)]>>4,i[s++]=255&t),1===o&&(t=Ko[e.charCodeAt(l)]<<10|Ko[e.charCodeAt(l+1)]<<4|Ko[e.charCodeAt(l+2)]>>2,i[s++]=t>>8&255,i[s++]=255&t),i},fromByteArray:function(e){for(var t,n=e.length,r=n%3,o=[],i=0,s=n-r;i<s;i+=16383)o.push(ei(e,i,i+16383>s?s:i+16383));return 1===r?(t=e[n-1],o.push(Vo[t>>2]+Vo[t<<4&63]+"==")):2===r&&(t=(e[n-2]<<8)+e[n-1],o.push(Vo[t>>10]+Vo[t>>4&63]+Vo[t<<2&63]+"=")),o.join("")}},Vo=[],Ko=[],Yo="undefined"!=typeof Uint8Array?Uint8Array:Array,Jo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",$o=0,Qo=Jo.length;$o<Qo;++$o)Vo[$o]=Jo[$o],Ko[Jo.charCodeAt($o)]=$o;function Zo(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=e.indexOf("=");return-1===n&&(n=t),[n,n===t?0:4-n%4]}function ei(e,t,n){for(var r,o,i=[],s=t;s<n;s+=3)r=(e[s]<<16&16711680)+(e[s+1]<<8&65280)+(255&e[s+2]),i.push(Vo[(o=r)>>18&63]+Vo[o>>12&63]+Vo[o>>6&63]+Vo[63&o]);return i.join("")}Ko["-".charCodeAt(0)]=62,Ko["_".charCodeAt(0)]=63;var ti={read:function(e,t,n,r,o){var i,s,a=8*o-r-1,l=(1<<a)-1,u=l>>1,p=-7,c=n?o-1:0,h=n?-1:1,d=e[t+c];for(c+=h,i=d&(1<<-p)-1,d>>=-p,p+=a;p>0;i=256*i+e[t+c],c+=h,p-=8);for(s=i&(1<<-p)-1,i>>=-p,p+=r;p>0;s=256*s+e[t+c],c+=h,p-=8);if(0===i)i=1-u;else{if(i===l)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,r),i-=u}return(d?-1:1)*s*Math.pow(2,i-r)},write:function(e,t,n,r,o,i){var s,a,l,u=8*i-o-1,p=(1<<u)-1,c=p>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,d=r?0:i-1,f=r?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=p):(s=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-s))<1&&(s--,l*=2),(t+=s+c>=1?h/l:h*Math.pow(2,1-c))*l>=2&&(s++,l/=2),s+c>=p?(a=0,s=p):s+c>=1?(a=(t*l-1)*Math.pow(2,o),s+=c):(a=t*Math.pow(2,c-1)*Math.pow(2,o),s=0));o>=8;e[n+d]=255&a,d+=f,a/=256,o-=8);for(s=s<<o|a,u+=o;u>0;e[n+d]=255&s,d+=f,s/=256,u-=8);e[n+d-f]|=128*y}},ni={};ni.Buffer=ii,ni.INSPECT_MAX_BYTES=50;var ri=2147483647;function oi(e){if(e>ri)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return t.__proto__=ii.prototype,t}function ii(e,t,n){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return li(e)}return si(e,t,n)}function si(e,t,n){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!ii.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var n=0|ci(e,t),r=oi(n),o=r.write(e,t);return o!==n&&(r=r.slice(0,o)),r}(e,t);if(ArrayBuffer.isView(e))return ui(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(Ii(e,ArrayBuffer)||e&&Ii(e.buffer,ArrayBuffer))return function(e,t,n){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(n||0))throw new RangeError('"length" is outside of buffer bounds');var r;return(r=void 0===t&&void 0===n?new Uint8Array(e):void 0===n?new Uint8Array(e,t):new Uint8Array(e,t,n)).__proto__=ii.prototype,r}(e,t,n);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var r=e.valueOf&&e.valueOf();if(null!=r&&r!==e)return ii.from(r,t,n);var o=function(e){if(ii.isBuffer(e)){var t=0|pi(e.length),n=oi(t);return 0===n.length?n:(e.copy(n,0,0,t),n)}return void 0!==e.length?"number"!=typeof e.length||Li(e.length)?oi(0):ui(e):"Buffer"===e.type&&Array.isArray(e.data)?ui(e.data):void 0}(e);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return ii.from(e[Symbol.toPrimitive]("string"),t,n);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function ai(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function li(e){return ai(e),oi(e<0?0:0|pi(e))}function ui(e){for(var t=e.length<0?0:0|pi(e.length),n=oi(t),r=0;r<t;r+=1)n[r]=255&e[r];return n}function pi(e){if(e>=ri)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+ri.toString(16)+" bytes");return 0|e}function ci(e,t){if(ii.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||Ii(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var n=e.length,r=arguments.length>2&&!0===arguments[2];if(!r&&0===n)return 0;for(var o=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":return Di(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Bi(e).length;default:if(o)return r?-1:Di(e).length;t=(""+t).toLowerCase(),o=!0}}function hi(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function di(e,t,n,r,o){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),Li(n=+n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if("string"==typeof t&&(t=ii.from(t,r)),ii.isBuffer(t))return 0===t.length?-1:fi(e,t,n,r,o);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):fi(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function fi(e,t,n,r,o){var i,s=1,a=e.length,l=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;s=2,a/=2,l/=2,n/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(o){var p=-1;for(i=n;i<a;i++)if(u(e,i)===u(t,-1===p?0:i-p)){if(-1===p&&(p=i),i-p+1===l)return p*s}else-1!==p&&(i-=i-p),p=-1}else for(n+l>a&&(n=a-l),i=n;i>=0;i--){for(var c=!0,h=0;h<l;h++)if(u(e,i+h)!==u(t,h)){c=!1;break}if(c)return i}return-1}function yi(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;r>i/2&&(r=i/2);for(var s=0;s<r;++s){var a=parseInt(t.substr(2*s,2),16);if(Li(a))return s;e[n+s]=a}return s}function gi(e,t,n,r){return ji(Di(t,e.length-n),e,n,r)}function mi(e,t,n,r){return ji(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function vi(e,t,n,r){return mi(e,t,n,r)}function bi(e,t,n,r){return ji(Bi(t),e,n,r)}function wi(e,t,n,r){return ji(function(e,t){for(var n,r,o,i=[],s=0;s<e.length&&!((t-=2)<0);++s)r=(n=e.charCodeAt(s))>>8,o=n%256,i.push(o),i.push(r);return i}(t,e.length-n),e,n,r)}function Si(e,t,n){return 0===t&&n===e.length?Go.fromByteArray(e):Go.fromByteArray(e.slice(t,n))}function Ci(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,s,a,l,u=e[o],p=null,c=u>239?4:u>223?3:u>191?2:1;if(o+c<=n)switch(c){case 1:u<128&&(p=u);break;case 2:128==(192&(i=e[o+1]))&&(l=(31&u)<<6|63&i)>127&&(p=l);break;case 3:i=e[o+1],s=e[o+2],128==(192&i)&&128==(192&s)&&(l=(15&u)<<12|(63&i)<<6|63&s)>2047&&(l<55296||l>57343)&&(p=l);break;case 4:i=e[o+1],s=e[o+2],a=e[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(l=(15&u)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&l<1114112&&(p=l)}null===p?(p=65533,c=1):p>65535&&(p-=65536,r.push(p>>>10&1023|55296),p=56320|1023&p),r.push(p),o+=c}return function(e){var t=e.length;if(t<=_i)return String.fromCharCode.apply(String,e);for(var n="",r=0;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=_i));return n}(r)}ii.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1);return e.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===e.foo()}catch(e){return!1}}(),ii.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(ii.prototype,"parent",{enumerable:!0,get:function(){if(ii.isBuffer(this))return this.buffer}}),Object.defineProperty(ii.prototype,"offset",{enumerable:!0,get:function(){if(ii.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&ii[Symbol.species]===ii&&Object.defineProperty(ii,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),ii.poolSize=8192,ii.from=function(e,t,n){return si(e,t,n)},ii.prototype.__proto__=Uint8Array.prototype,ii.__proto__=Uint8Array,ii.alloc=function(e,t,n){return function(e,t,n){return ai(e),e<=0?oi(e):void 0!==t?"string"==typeof n?oi(e).fill(t,n):oi(e).fill(t):oi(e)}(e,t,n)},ii.allocUnsafe=function(e){return li(e)},ii.allocUnsafeSlow=function(e){return li(e)},ii.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==ii.prototype},ii.compare=function(e,t){if(Ii(e,Uint8Array)&&(e=ii.from(e,e.offset,e.byteLength)),Ii(t,Uint8Array)&&(t=ii.from(t,t.offset,t.byteLength)),!ii.isBuffer(e)||!ii.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},ii.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},ii.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return ii.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=ii.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(Ii(i,Uint8Array)&&(i=ii.from(i)),!ii.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},ii.byteLength=ci,ii.prototype._isBuffer=!0,ii.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)hi(this,t,t+1);return this},ii.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)hi(this,t,t+3),hi(this,t+1,t+2);return this},ii.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)hi(this,t,t+7),hi(this,t+1,t+6),hi(this,t+2,t+5),hi(this,t+3,t+4);return this},ii.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?Ci(this,0,e):function(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Fi(this,t,n);case"utf8":case"utf-8":return Ci(this,t,n);case"ascii":return Pi(this,t,n);case"latin1":case"binary":return Ei(this,t,n);case"base64":return Si(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ki(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}.apply(this,arguments)},ii.prototype.toLocaleString=ii.prototype.toString,ii.prototype.equals=function(e){if(!ii.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===ii.compare(this,e)},ii.prototype.inspect=function(){var e="",t=ni.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},ii.prototype.compare=function(e,t,n,r,o){if(Ii(e,Uint8Array)&&(e=ii.from(e,e.offset,e.byteLength)),!ii.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===o&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),s=(n>>>=0)-(t>>>=0),a=Math.min(i,s),l=this.slice(r,o),u=e.slice(t,n),p=0;p<a;++p)if(l[p]!==u[p]){i=l[p],s=u[p];break}return i<s?-1:s<i?1:0},ii.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},ii.prototype.indexOf=function(e,t,n){return di(this,e,t,n,!0)},ii.prototype.lastIndexOf=function(e,t,n){return di(this,e,t,n,!1)},ii.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(n)?(n>>>=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((void 0===n||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return yi(this,e,t,n);case"utf8":case"utf-8":return gi(this,e,t,n);case"ascii":return mi(this,e,t,n);case"latin1":case"binary":return vi(this,e,t,n);case"base64":return bi(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wi(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},ii.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var _i=4096;function Pi(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function Ei(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function Fi(e,t,n){var r,o=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>o)&&(n=o);for(var i="",s=t;s<n;++s)i+=(r=e[s])<16?"0"+r.toString(16):r.toString(16);return i}function ki(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function Ai(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Ti(e,t,n,r,o,i){if(!ii.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Oi(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Ui(e,t,n,r,o){return t=+t,n>>>=0,o||Oi(e,0,n,4),ti.write(e,t,n,r,23,4),n+4}function xi(e,t,n,r,o){return t=+t,n>>>=0,o||Oi(e,0,n,8),ti.write(e,t,n,r,52,8),n+8}ii.prototype.slice=function(e,t){var n=this.length;(e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e);var r=this.subarray(e,t);return r.__proto__=ii.prototype,r},ii.prototype.readUIntLE=function(e,t,n){e>>>=0,t>>>=0,n||Ai(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},ii.prototype.readUIntBE=function(e,t,n){e>>>=0,t>>>=0,n||Ai(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},ii.prototype.readUInt8=function(e,t){return e>>>=0,t||Ai(e,1,this.length),this[e]},ii.prototype.readUInt16LE=function(e,t){return e>>>=0,t||Ai(e,2,this.length),this[e]|this[e+1]<<8},ii.prototype.readUInt16BE=function(e,t){return e>>>=0,t||Ai(e,2,this.length),this[e]<<8|this[e+1]},ii.prototype.readUInt32LE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ii.prototype.readUInt32BE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ii.prototype.readIntLE=function(e,t,n){e>>>=0,t>>>=0,n||Ai(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},ii.prototype.readIntBE=function(e,t,n){e>>>=0,t>>>=0,n||Ai(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},ii.prototype.readInt8=function(e,t){return e>>>=0,t||Ai(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},ii.prototype.readInt16LE=function(e,t){e>>>=0,t||Ai(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ii.prototype.readInt16BE=function(e,t){e>>>=0,t||Ai(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ii.prototype.readInt32LE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ii.prototype.readInt32BE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ii.prototype.readFloatLE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),ti.read(this,e,!0,23,4)},ii.prototype.readFloatBE=function(e,t){return e>>>=0,t||Ai(e,4,this.length),ti.read(this,e,!1,23,4)},ii.prototype.readDoubleLE=function(e,t){return e>>>=0,t||Ai(e,8,this.length),ti.read(this,e,!0,52,8)},ii.prototype.readDoubleBE=function(e,t){return e>>>=0,t||Ai(e,8,this.length),ti.read(this,e,!1,52,8)},ii.prototype.writeUIntLE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||Ti(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},ii.prototype.writeUIntBE=function(e,t,n,r){e=+e,t>>>=0,n>>>=0,r||Ti(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},ii.prototype.writeUInt8=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,1,255,0),this[t]=255&e,t+1},ii.prototype.writeUInt16LE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},ii.prototype.writeUInt16BE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},ii.prototype.writeUInt32LE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},ii.prototype.writeUInt32BE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ii.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);Ti(this,e,t,n,o-1,-o)}var i=0,s=1,a=0;for(this[t]=255&e;++i<n&&(s*=256);)e<0&&0===a&&0!==this[t+i-1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},ii.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t>>>=0,!r){var o=Math.pow(2,8*n-1);Ti(this,e,t,n,o-1,-o)}var i=n-1,s=1,a=0;for(this[t+i]=255&e;--i>=0&&(s*=256);)e<0&&0===a&&0!==this[t+i+1]&&(a=1),this[t+i]=(e/s>>0)-a&255;return t+n},ii.prototype.writeInt8=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},ii.prototype.writeInt16LE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},ii.prototype.writeInt16BE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},ii.prototype.writeInt32LE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},ii.prototype.writeInt32BE=function(e,t,n){return e=+e,t>>>=0,n||Ti(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},ii.prototype.writeFloatLE=function(e,t,n){return Ui(this,e,t,!0,n)},ii.prototype.writeFloatBE=function(e,t,n){return Ui(this,e,t,!1,n)},ii.prototype.writeDoubleLE=function(e,t,n){return xi(this,e,t,!0,n)},ii.prototype.writeDoubleBE=function(e,t,n){return xi(this,e,t,!1,n)},ii.prototype.copy=function(e,t,n,r){if(!ii.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o=r-n;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,n,r);else if(this===e&&n<t&&t<r)for(var i=o-1;i>=0;--i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,r),t);return o},ii.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!ii.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(1===e.length){var o=e.charCodeAt(0);("utf8"===r&&o<128||"latin1"===r)&&(e=o)}}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(i=t;i<n;++i)this[i]=e;else{var s=ii.isBuffer(e)?e:ii.from(e,r),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<n-t;++i)this[i+t]=s[i%a]}return this};var Ri=/[^+\/0-9A-Za-z-_]/g;function Di(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],s=0;s<r;++s){if((n=e.charCodeAt(s))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(s+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function Bi(e){return Go.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Ri,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function ji(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function Ii(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Li(e){return e!=e}var Mi={}.toString,Ni=Array.isArray||function(e){return"[object Array]"==Mi.call(e)},zi={};(function(e){var t=Object.prototype.toString,n="function"==typeof Blob||"undefined"!=typeof Blob&&"[object BlobConstructor]"===t.call(Blob),r="function"==typeof File||"undefined"!=typeof File&&"[object FileConstructor]"===t.call(File);zi=function t(o){if(!o||"object"!=typeof o)return!1;if(Ni(o)){for(var i=0,s=o.length;i<s;i++)if(t(o[i]))return!0;return!1}if("function"==typeof e&&e.isBuffer&&e.isBuffer(o)||"function"==typeof ArrayBuffer&&o instanceof ArrayBuffer||n&&o instanceof Blob||r&&o instanceof File)return!0;if(o.toJSON&&"function"==typeof o.toJSON&&1===arguments.length)return t(o.toJSON(),!0);for(var a in o)if(Object.prototype.hasOwnProperty.call(o,a)&&t(o[a]))return!0;return!1}}).call(this,ni.Buffer);var qi,Hi={};"undefined"!=typeof ArrayBuffer&&(qi=Po);var Wi="undefined"!=typeof navigator&&/Android/i.test(navigator.userAgent),Xi="undefined"!=typeof navigator&&/PhantomJS/i.test(navigator.userAgent),Gi=Wi||Xi;Hi.protocol=3;var Vi=Hi.packets={open:0,close:1,ping:2,pong:3,message:4,upgrade:5,noop:6},Ki=jo(Vi),Yi={type:"error",data:"parser error"};function Ji(e,t,n){for(var r=new Array(e.length),o=Co(e.length,n),i=function(e,n,o){t(n,function(t,n){r[e]=n,o(t,r)})},s=0;s<e.length;s++)i(s,e[s],o)}Hi.encodePacket=function(e,t,n,r){"function"==typeof t&&(r=t,t=!1),"function"==typeof n&&(r=n,n=null);var o=void 0===e.data?void 0:e.data.buffer||e.data;if("undefined"!=typeof ArrayBuffer&&o instanceof ArrayBuffer)return function(e,t,n){if(!t)return Hi.encodeBase64Packet(e,n);var r=e.data,o=new Uint8Array(r),i=new Uint8Array(1+r.byteLength);i[0]=Vi[e.type];for(var s=0;s<o.length;s++)i[s+1]=o[s];return n(i.buffer)}(e,t,r);if(void 0!==Eo&&o instanceof Eo)return function(e,t,n){if(!t)return Hi.encodeBase64Packet(e,n);if(Gi)return function(e,t,n){if(!t)return Hi.encodeBase64Packet(e,n);var r=new FileReader;return r.onload=function(){Hi.encodePacket({type:e.type,data:r.result},t,!0,n)},r.readAsArrayBuffer(e.data)}(e,t,n);var r=new Uint8Array(1);return r[0]=Vi[e.type],n(new Eo([r.buffer,e.data]))}(e,t,r);if(o&&o.base64)return function(e,t){return t("b"+Hi.packets[e.type]+e.data.data)}(e,r);var i=Vi[e.type];return void 0!==e.data&&(i+=n?Wo(String(e.data),{strict:!1}):String(e.data)),r(""+i)},Hi.encodeBase64Packet=function(e,t){var n,r="b"+Hi.packets[e.type];if(void 0!==Eo&&e.data instanceof Eo){var o=new FileReader;return o.onload=function(){var e=o.result.split(",")[1];t(r+e)},o.readAsDataURL(e.data)}try{n=String.fromCharCode.apply(null,new Uint8Array(e.data))}catch(t){for(var i=new Uint8Array(e.data),s=new Array(i.length),a=0;a<i.length;a++)s[a]=i[a];n=String.fromCharCode.apply(null,s)}return r+=btoa(n),t(r)},Hi.decodePacket=function(e,t,n){if(void 0===e)return Yi;if("string"==typeof e){if("b"===e.charAt(0))return Hi.decodeBase64Packet(e.substr(1),t);if(n&&!1===(e=function(e){try{e=Xo(e,{strict:!1})}catch(e){return!1}return e}(e)))return Yi;var r=e.charAt(0);return Number(r)==r&&Ki[r]?e.length>1?{type:Ki[r],data:e.substring(1)}:{type:Ki[r]}:Yi}r=new Uint8Array(e)[0];var o=_o(e,1);return Eo&&"blob"===t&&(o=new Eo([o])),{type:Ki[r],data:o}},Hi.decodeBase64Packet=function(e,t){var n=Ki[e.charAt(0)];if(!qi)return{type:n,data:{base64:!0,data:e.substr(1)}};var r=qi.decode(e.substr(1));return"blob"===t&&Eo&&(r=new Eo([r])),{type:n,data:r}},Hi.encodePayload=function(e,t,n){"function"==typeof t&&(n=t,t=null);var r=zi(e);return t&&r?Eo&&!Gi?Hi.encodePayloadAsBlob(e,n):Hi.encodePayloadAsArrayBuffer(e,n):e.length?void Ji(e,function(e,n){Hi.encodePacket(e,!!r&&t,!1,function(e){n(null,function(e){return e.length+":"+e}(e))})},function(e,t){return n(t.join(""))}):n("0:")},Hi.decodePayload=function(e,t,n){if("string"!=typeof e)return Hi.decodePayloadAsBinary(e,t,n);var r;if("function"==typeof t&&(n=t,t=null),""===e)return n(Yi,0,1);for(var o,i,s="",a=0,l=e.length;a<l;a++){var u=e.charAt(a);if(":"===u){if(""===s||s!=(o=Number(s)))return n(Yi,0,1);if(s!=(i=e.substr(a+1,o)).length)return n(Yi,0,1);if(i.length){if(r=Hi.decodePacket(i,t,!1),Yi.type===r.type&&Yi.data===r.data)return n(Yi,0,1);if(!1===n(r,a+o,l))return}a+=o,s=""}else s+=u}return""!==s?n(Yi,0,1):void 0},Hi.encodePayloadAsArrayBuffer=function(e,t){if(!e.length)return t(new ArrayBuffer(0));Ji(e,function(e,t){Hi.encodePacket(e,!0,!0,function(e){return t(null,e)})},function(e,n){var r=n.reduce(function(e,t){var n;return e+(n="string"==typeof t?t.length:t.byteLength).toString().length+n+2},0),o=new Uint8Array(r),i=0;return n.forEach(function(e){var t="string"==typeof e,n=e;if(t){for(var r=new Uint8Array(e.length),s=0;s<e.length;s++)r[s]=e.charCodeAt(s);n=r.buffer}o[i++]=t?0:1;var a=n.byteLength.toString();for(s=0;s<a.length;s++)o[i++]=parseInt(a[s]);for(o[i++]=255,r=new Uint8Array(n),s=0;s<r.length;s++)o[i++]=r[s]}),t(o.buffer)})},Hi.encodePayloadAsBlob=function(e,t){Ji(e,function(e,t){Hi.encodePacket(e,!0,!0,function(e){var n=new Uint8Array(1);if(n[0]=1,"string"==typeof e){for(var r=new Uint8Array(e.length),o=0;o<e.length;o++)r[o]=e.charCodeAt(o);e=r.buffer,n[0]=0}var i=(e instanceof ArrayBuffer?e.byteLength:e.size).toString(),s=new Uint8Array(i.length+1);for(o=0;o<i.length;o++)s[o]=parseInt(i[o]);if(s[i.length]=255,Eo){var a=new Eo([n.buffer,s.buffer,e]);t(null,a)}})},function(e,n){return t(new Eo(n))})},Hi.decodePayloadAsBinary=function(e,t,n){"function"==typeof t&&(n=t,t=null);for(var r=e,o=[];r.byteLength>0;){for(var i=new Uint8Array(r),s=0===i[0],a="",l=1;255!==i[l];l++){if(a.length>310)return n(Yi,0,1);a+=i[l]}r=_o(r,2+a.length),a=parseInt(a);var u=_o(r,0,a);if(s)try{u=String.fromCharCode.apply(null,new Uint8Array(u))}catch(e){var p=new Uint8Array(u);for(u="",l=0;l<p.length;l++)u+=String.fromCharCode(p[l])}o.push(u),r=_o(r,a)}var c=o.length;o.forEach(function(e,r){n(Hi.decodePacket(e,t,!0),r,c)})};var $i={};function Qi(e){this.path=e.path,this.hostname=e.hostname,this.port=e.port,this.secure=e.secure,this.query=e.query,this.timestampParam=e.timestampParam,this.timestampRequests=e.timestampRequests,this.readyState="",this.agent=e.agent||!1,this.socket=e.socket,this.enablesXDR=e.enablesXDR,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.forceNode=e.forceNode,this.extraHeaders=e.extraHeaders,this.localAddress=e.localAddress}$i=Qi,yo(Qi.prototype),Qi.prototype.onError=function(e,t){var n=new Error(e);return n.type="TransportError",n.description=t,this.emit("error",n),this},Qi.prototype.open=function(){return"closed"!==this.readyState&&""!==this.readyState||(this.readyState="opening",this.doOpen()),this},Qi.prototype.close=function(){return"opening"!==this.readyState&&"open"!==this.readyState||(this.doClose(),this.onClose()),this},Qi.prototype.send=function(e){if("open"!==this.readyState)throw new Error("Transport not open");this.write(e)},Qi.prototype.onOpen=function(){this.readyState="open",this.writable=!0,this.emit("open")},Qi.prototype.onData=function(e){var t=Hi.decodePacket(e,this.socket.binaryType);this.onPacket(t)},Qi.prototype.onPacket=function(e){this.emit("packet",e)},Qi.prototype.onClose=function(){this.readyState="closed",this.emit("close")};var Zi=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},es={};try{es="undefined"!=typeof XMLHttpRequest&&"withCredentials"in new XMLHttpRequest}catch(Yi){es=!1}var ts={};(function(e){ts=function(t){var n=t.xdomain,r=t.xscheme,o=t.enablesXDR;try{if("undefined"!=typeof XMLHttpRequest&&(!n||es))return new XMLHttpRequest}catch(e){}try{if("undefined"!=typeof XDomainRequest&&!r&&o)return new XDomainRequest}catch(e){}if(!n)try{return new(e[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")}catch(e){}}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ns=1e3,rs=6e4,os=864e5;function is(e,t,n){if(!(e<t))return e<1.5*t?Math.floor(e/t)+" "+n:Math.ceil(e/t)+" "+n+"s"}var ss=function(e,t){t=t||{};var n,r=typeof e;if("string"===r&&e.length>0)return function(e){if(!((e=String(e)).length>100)){var t=/^((?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]);switch((t[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*n;case"days":case"day":case"d":return n*os;case"hours":case"hour":case"hrs":case"hr":case"h":return 36e5*n;case"minutes":case"minute":case"mins":case"min":case"m":return n*rs;case"seconds":case"second":case"secs":case"sec":case"s":return n*ns;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}(e);if("number"===r&&!1===isNaN(e))return t.long?is(n=e,os,"day")||is(n,36e5,"hour")||is(n,rs,"minute")||is(n,ns,"second")||n+" ms":function(e){return e>=os?Math.round(e/os)+"d":e>=36e5?Math.round(e/36e5)+"h":e>=rs?Math.round(e/rs)+"m":e>=ns?Math.round(e/ns)+"s":e+"ms"}(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))},as={};function ls(e){var t;function n(){if(n.enabled){var e=n,r=+new Date,o=r-(t||r);e.diff=o,e.prev=t,e.curr=r,t=r;for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];i[0]=as.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var r=as.formatters[n];if("function"==typeof r){var o=i[a];t=r.call(e,o),i.splice(a,1),a--}return t}),as.formatArgs.call(e,i),(n.log||as.log||console.log.bind(console)).apply(e,i)}}return n.namespace=e,n.enabled=as.enabled(e),n.useColors=as.useColors(),n.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return as.colors[Math.abs(n)%as.colors.length]}(e),n.destroy=us,"function"==typeof as.init&&as.init(n),as.instances.push(n),n}function us(){var e=as.instances.indexOf(this);return-1!==e&&(as.instances.splice(e,1),!0)}(as=as=ls.debug=ls.default=ls).coerce=function(e){return e instanceof Error?e.stack||e.message:e},as.disable=function(){as.enable("")},as.enable=function(e){var t;as.save(e),as.names=[],as.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?as.skips.push(new RegExp("^"+e.substr(1)+"$")):as.names.push(new RegExp("^"+e+"$")));for(t=0;t<as.instances.length;t++){var o=as.instances[t];o.enabled=as.enabled(o.namespace)}},as.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=as.skips.length;t<n;t++)if(as.skips[t].test(e))return!1;for(t=0,n=as.names.length;t<n;t++)if(as.names[t].test(e))return!0;return!1},as.humanize=ss,as.instances=[],as.names=[],as.skips=[],as.formatters={};var ps={};(function(e){function t(){var t;try{t=ps.storage.debug}catch(e){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(ps=ps=as).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},ps.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+ps.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))}),e.splice(o,0,n)}},ps.save=function(e){try{null==e?ps.storage.removeItem("debug"):ps.storage.debug=e}catch(e){}},ps.load=t,ps.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},ps.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),ps.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],ps.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},ps.enable(t())}).call(this,Ee);var cs,hs={encode:function(e){var t="";for(var n in e)e.hasOwnProperty(n)&&(t.length&&(t+="&"),t+=encodeURIComponent(n)+"="+encodeURIComponent(e[n]));return t},decode:function(e){for(var t={},n=e.split("&"),r=0,o=n.length;r<o;r++){var i=n[r].split("=");t[decodeURIComponent(i[0])]=decodeURIComponent(i[1])}return t}},ds={},fs="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_".split(""),ys=64,gs={},ms=0,vs=0;function bs(e){var t="";do{t=fs[e%ys]+t,e=Math.floor(e/ys)}while(e>0);return t}function ws(){var e=bs(+new Date);return e!==cs?(ms=0,cs=e):e+"."+bs(ms++)}for(;vs<ys;vs++)gs[fs[vs]]=vs;ws.encode=bs,ws.decode=function(e){var t=0;for(vs=0;vs<e.length;vs++)t=t*ys+gs[e.charAt(vs)];return t},ds=ws;var Ss=ps("engine.io-client:polling"),Cs=Ps,_s=null!=new ts({xdomain:!1}).responseType;function Ps(e){var t=e&&e.forceBase64;_s&&!t||(this.supportsBinary=!1),$i.call(this,e)}Zi(Ps,$i),Ps.prototype.name="polling",Ps.prototype.doOpen=function(){this.poll()},Ps.prototype.pause=function(e){var t=this;function n(){Ss("paused"),t.readyState="paused",e()}if(this.readyState="pausing",this.polling||!this.writable){var r=0;this.polling&&(Ss("we are currently polling - waiting to pause"),r++,this.once("pollComplete",function(){Ss("pre-pause polling complete"),--r||n()})),this.writable||(Ss("we are currently writing - waiting to pause"),r++,this.once("drain",function(){Ss("pre-pause writing complete"),--r||n()}))}else n()},Ps.prototype.poll=function(){Ss("polling"),this.polling=!0,this.doPoll(),this.emit("poll")},Ps.prototype.onData=function(e){var t=this;Ss("polling got data %s",e),Hi.decodePayload(e,this.socket.binaryType,function(e,n,r){if("opening"===t.readyState&&t.onOpen(),"close"===e.type)return t.onClose(),!1;t.onPacket(e)}),"closed"!==this.readyState&&(this.polling=!1,this.emit("pollComplete"),"open"===this.readyState?this.poll():Ss('ignoring poll - transport state "%s"',this.readyState))},Ps.prototype.doClose=function(){var e=this;function t(){Ss("writing close packet"),e.write([{type:"close"}])}"open"===this.readyState?(Ss("transport open - closing"),t()):(Ss("transport not open - deferring close"),this.once("open",t))},Ps.prototype.write=function(e){var t=this;this.writable=!1;var n=function(){t.writable=!0,t.emit("drain")};Hi.encodePayload(e,this.supportsBinary,function(e){t.doWrite(e,n)})},Ps.prototype.uri=function(){var e=this.query||{},t=this.secure?"https":"http",n="";return!1!==this.timestampRequests&&(e[this.timestampParam]=ds()),this.supportsBinary||e.sid||(e.b64=1),e=hs.encode(e),this.port&&("https"===t&&443!==Number(this.port)||"http"===t&&80!==Number(this.port))&&(n=":"+this.port),e.length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e};var Es={};(function(e){Es=i;var t,n=/\n/g,r=/\\n/g;function o(){}function i(n){Cs.call(this,n),this.query=this.query||{},t||(e.___eio||(e.___eio=[]),t=e.___eio),this.index=t.length;var r=this;t.push(function(e){r.onData(e)}),this.query.j=this.index,e.document&&e.addEventListener&&e.addEventListener("beforeunload",function(){r.script&&(r.script.onerror=o)},!1)}Zi(i,Cs),i.prototype.supportsBinary=!1,i.prototype.doClose=function(){this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),this.form&&(this.form.parentNode.removeChild(this.form),this.form=null,this.iframe=null),Cs.prototype.doClose.call(this)},i.prototype.doPoll=function(){var e=this,t=document.createElement("script");this.script&&(this.script.parentNode.removeChild(this.script),this.script=null),t.async=!0,t.src=this.uri(),t.onerror=function(t){e.onError("jsonp poll error",t)};var n=document.getElementsByTagName("script")[0];n?n.parentNode.insertBefore(t,n):(document.head||document.body).appendChild(t),this.script=t,"undefined"!=typeof navigator&&/gecko/i.test(navigator.userAgent)&&setTimeout(function(){var e=document.createElement("iframe");document.body.appendChild(e),document.body.removeChild(e)},100)},i.prototype.doWrite=function(e,t){var o=this;if(!this.form){var i,s=document.createElement("form"),a=document.createElement("textarea"),l=this.iframeId="eio_iframe_"+this.index;s.className="socketio",s.style.position="absolute",s.style.top="-1000px",s.style.left="-1000px",s.target=l,s.method="POST",s.setAttribute("accept-charset","utf-8"),a.name="d",s.appendChild(a),document.body.appendChild(s),this.form=s,this.area=a}function u(){p(),t()}function p(){if(o.iframe)try{o.form.removeChild(o.iframe)}catch(e){o.onError("jsonp polling iframe removal error",e)}try{var e='<iframe src="javascript:0" name="'+o.iframeId+'">';i=document.createElement(e)}catch(e){(i=document.createElement("iframe")).name=o.iframeId,i.src="javascript:0"}i.id=o.iframeId,o.form.appendChild(i),o.iframe=i}this.form.action=this.uri(),p(),e=e.replace(r,"\\\n"),this.area.value=e.replace(n,"\\n");try{this.form.submit()}catch(e){}this.iframe.attachEvent?this.iframe.onreadystatechange=function(){"complete"===o.iframe.readyState&&u()}:this.iframe.onload=u}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Fs={};(function(e){var t=ps("engine.io-client:polling-xhr");function n(){}function r(t){if(Cs.call(this,t),this.requestTimeout=t.requestTimeout,this.extraHeaders=t.extraHeaders,e.location){var n="https:"===location.protocol,r=location.port;r||(r=n?443:80),this.xd=t.hostname!==e.location.hostname||r!==t.port,this.xs=t.secure!==n}}function o(e){this.method=e.method||"GET",this.uri=e.uri,this.xd=!!e.xd,this.xs=!!e.xs,this.async=!1!==e.async,this.data=void 0!==e.data?e.data:null,this.agent=e.agent,this.isBinary=e.isBinary,this.supportsBinary=e.supportsBinary,this.enablesXDR=e.enablesXDR,this.requestTimeout=e.requestTimeout,this.pfx=e.pfx,this.key=e.key,this.passphrase=e.passphrase,this.cert=e.cert,this.ca=e.ca,this.ciphers=e.ciphers,this.rejectUnauthorized=e.rejectUnauthorized,this.extraHeaders=e.extraHeaders,this.create()}function i(){for(var e in o.requests)o.requests.hasOwnProperty(e)&&o.requests[e].abort()}(Fs=r).Request=o,Zi(r,Cs),r.prototype.supportsBinary=!0,r.prototype.request=function(e){return(e=e||{}).uri=this.uri(),e.xd=this.xd,e.xs=this.xs,e.agent=this.agent||!1,e.supportsBinary=this.supportsBinary,e.enablesXDR=this.enablesXDR,e.pfx=this.pfx,e.key=this.key,e.passphrase=this.passphrase,e.cert=this.cert,e.ca=this.ca,e.ciphers=this.ciphers,e.rejectUnauthorized=this.rejectUnauthorized,e.requestTimeout=this.requestTimeout,e.extraHeaders=this.extraHeaders,new o(e)},r.prototype.doWrite=function(e,t){var n="string"!=typeof e&&void 0!==e,r=this.request({method:"POST",data:e,isBinary:n}),o=this;r.on("success",t),r.on("error",function(e){o.onError("xhr post error",e)}),this.sendXhr=r},r.prototype.doPoll=function(){t("xhr poll");var e=this.request(),n=this;e.on("data",function(e){n.onData(e)}),e.on("error",function(e){n.onError("xhr poll error",e)}),this.pollXhr=e},yo(o.prototype),o.prototype.create=function(){var n={agent:this.agent,xdomain:this.xd,xscheme:this.xs,enablesXDR:this.enablesXDR};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized;var r=this.xhr=new ts(n),i=this;try{t("xhr open %s: %s",this.method,this.uri),r.open(this.method,this.uri,this.async);try{if(this.extraHeaders)for(var s in r.setDisableHeaderCheck&&r.setDisableHeaderCheck(!0),this.extraHeaders)this.extraHeaders.hasOwnProperty(s)&&r.setRequestHeader(s,this.extraHeaders[s])}catch(e){}if("POST"===this.method)try{this.isBinary?r.setRequestHeader("Content-type","application/octet-stream"):r.setRequestHeader("Content-type","text/plain;charset=UTF-8")}catch(e){}try{r.setRequestHeader("Accept","*/*")}catch(e){}"withCredentials"in r&&(r.withCredentials=!0),this.requestTimeout&&(r.timeout=this.requestTimeout),this.hasXDR()?(r.onload=function(){i.onLoad()},r.onerror=function(){i.onError(r.responseText)}):r.onreadystatechange=function(){if(2===r.readyState)try{var e=r.getResponseHeader("Content-Type");i.supportsBinary&&"application/octet-stream"===e&&(r.responseType="arraybuffer")}catch(e){}4===r.readyState&&(200===r.status||1223===r.status?i.onLoad():setTimeout(function(){i.onError(r.status)},0))},t("xhr data %s",this.data),r.send(this.data)}catch(e){return void setTimeout(function(){i.onError(e)},0)}e.document&&(this.index=o.requestsCount++,o.requests[this.index]=this)},o.prototype.onSuccess=function(){this.emit("success"),this.cleanup()},o.prototype.onData=function(e){this.emit("data",e),this.onSuccess()},o.prototype.onError=function(e){this.emit("error",e),this.cleanup(!0)},o.prototype.cleanup=function(t){if(void 0!==this.xhr&&null!==this.xhr){if(this.hasXDR()?this.xhr.onload=this.xhr.onerror=n:this.xhr.onreadystatechange=n,t)try{this.xhr.abort()}catch(e){}e.document&&delete o.requests[this.index],this.xhr=null}},o.prototype.onLoad=function(){var e;try{var t;try{t=this.xhr.getResponseHeader("Content-Type")}catch(e){}e="application/octet-stream"===t&&this.xhr.response||this.xhr.responseText}catch(e){this.onError(e)}null!=e&&this.onData(e)},o.prototype.hasXDR=function(){return void 0!==e.XDomainRequest&&!this.xs&&this.enablesXDR},o.prototype.abort=function(){this.cleanup()},o.requestsCount=0,o.requests={},e.document&&(e.attachEvent?e.attachEvent("onunload",i):e.addEventListener&&e.addEventListener("beforeunload",i,!1))}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var ks={},As={};(function(e){var t,n=ps("engine.io-client:websocket"),r=e.WebSocket||e.MozWebSocket;if("undefined"==typeof window)try{t=ks}catch(e){}var o=r;function i(e){e&&e.forceBase64&&(this.supportsBinary=!1),this.perMessageDeflate=e.perMessageDeflate,this.usingBrowserWebSocket=r&&!e.forceNode,this.protocols=e.protocols,this.usingBrowserWebSocket||(o=t),$i.call(this,e)}o||"undefined"!=typeof window||(o=t),As=i,Zi(i,$i),i.prototype.name="websocket",i.prototype.supportsBinary=!0,i.prototype.doOpen=function(){if(this.check()){var e=this.uri(),t=this.protocols,n={agent:this.agent,perMessageDeflate:this.perMessageDeflate};n.pfx=this.pfx,n.key=this.key,n.passphrase=this.passphrase,n.cert=this.cert,n.ca=this.ca,n.ciphers=this.ciphers,n.rejectUnauthorized=this.rejectUnauthorized,this.extraHeaders&&(n.headers=this.extraHeaders),this.localAddress&&(n.localAddress=this.localAddress);try{this.ws=this.usingBrowserWebSocket?t?new o(e,t):new o(e):new o(e,t,n)}catch(e){return this.emit("error",e)}void 0===this.ws.binaryType&&(this.supportsBinary=!1),this.ws.supports&&this.ws.supports.binary?(this.supportsBinary=!0,this.ws.binaryType="nodebuffer"):this.ws.binaryType="arraybuffer",this.addEventListeners()}},i.prototype.addEventListeners=function(){var e=this;this.ws.onopen=function(){e.onOpen()},this.ws.onclose=function(){e.onClose()},this.ws.onmessage=function(t){e.onData(t.data)},this.ws.onerror=function(t){e.onError("websocket error",t)}},i.prototype.write=function(t){var r=this;this.writable=!1;for(var o=t.length,i=0,s=o;i<s;i++)!function(t){Hi.encodePacket(t,r.supportsBinary,function(i){if(!r.usingBrowserWebSocket){var s={};t.options&&(s.compress=t.options.compress),r.perMessageDeflate&&("string"==typeof i?e.Buffer.byteLength(i):i.length)<r.perMessageDeflate.threshold&&(s.compress=!1)}try{r.usingBrowserWebSocket?r.ws.send(i):r.ws.send(i,s)}catch(e){n("websocket closed before onclose event")}--o||(r.emit("flush"),setTimeout(function(){r.writable=!0,r.emit("drain")},0))})}(t[i])},i.prototype.onClose=function(){$i.prototype.onClose.call(this)},i.prototype.doClose=function(){void 0!==this.ws&&this.ws.close()},i.prototype.uri=function(){var e=this.query||{},t=this.secure?"wss":"ws",n="";return this.port&&("wss"===t&&443!==Number(this.port)||"ws"===t&&80!==Number(this.port))&&(n=":"+this.port),this.timestampRequests&&(e[this.timestampParam]=ds()),this.supportsBinary||(e.b64=1),(e=hs.encode(e)).length&&(e="?"+e),t+"://"+(-1!==this.hostname.indexOf(":")?"["+this.hostname+"]":this.hostname)+n+this.path+e},i.prototype.check=function(){return!(!o||"__initialize"in o&&this.name===i.prototype.name)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ts={};(function(e){Ts.polling=function(t){var n=!1,r=!1,o=!1!==t.jsonp;if(e.location){var i="https:"===location.protocol,s=location.port;s||(s=i?443:80),n=t.hostname!==location.hostname||s!==t.port,r=t.secure!==i}if(t.xdomain=n,t.xscheme=r,"open"in new ts(t)&&!t.forceJSONP)return new Fs(t);if(!o)throw new Error("JSONP disabled");return new Es(t)},Ts.websocket=As}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Os=[].indexOf,Us=function(e,t){if(Os)return e.indexOf(t);for(var n=0;n<e.length;++n)if(e[n]===t)return n;return-1},xs=/^(?:(?![^:@]+:[^:@\/]*@)(http|https|ws|wss):\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?((?:[a-f0-9]{0,4}:){2,7}[a-f0-9]{0,4}|[^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,Rs=["source","protocol","authority","userInfo","user","password","host","port","relative","path","directory","file","query","anchor"],Ds=function(e){var t=e,n=e.indexOf("["),r=e.indexOf("]");-1!=n&&-1!=r&&(e=e.substring(0,n)+e.substring(n,r).replace(/:/g,";")+e.substring(r,e.length));for(var o=xs.exec(e||""),i={},s=14;s--;)i[Rs[s]]=o[s]||"";return-1!=n&&-1!=r&&(i.source=t,i.host=i.host.substring(1,i.host.length-1).replace(/;/g,":"),i.authority=i.authority.replace("[","").replace("]","").replace(/;/g,":"),i.ipv6uri=!0),i},Bs={};(function(e){var t=ps("engine.io-client:socket");function n(t,r){if(!(this instanceof n))return new n(t,r);r=r||{},t&&"object"==typeof t&&(r=t,t=null),t?(t=Ds(t),r.hostname=t.host,r.secure="https"===t.protocol||"wss"===t.protocol,r.port=t.port,t.query&&(r.query=t.query)):r.host&&(r.hostname=Ds(r.host).host),this.secure=null!=r.secure?r.secure:e.location&&"https:"===location.protocol,r.hostname&&!r.port&&(r.port=this.secure?"443":"80"),this.agent=r.agent||!1,this.hostname=r.hostname||(e.location?location.hostname:"localhost"),this.port=r.port||(e.location&&location.port?location.port:this.secure?443:80),this.query=r.query||{},"string"==typeof this.query&&(this.query=hs.decode(this.query)),this.upgrade=!1!==r.upgrade,this.path=(r.path||"/engine.io").replace(/\/$/,"")+"/",this.forceJSONP=!!r.forceJSONP,this.jsonp=!1!==r.jsonp,this.forceBase64=!!r.forceBase64,this.enablesXDR=!!r.enablesXDR,this.timestampParam=r.timestampParam||"t",this.timestampRequests=r.timestampRequests,this.transports=r.transports||["polling","websocket"],this.transportOptions=r.transportOptions||{},this.readyState="",this.writeBuffer=[],this.prevBufferLen=0,this.policyPort=r.policyPort||843,this.rememberUpgrade=r.rememberUpgrade||!1,this.binaryType=null,this.onlyBinaryUpgrades=r.onlyBinaryUpgrades,this.perMessageDeflate=!1!==r.perMessageDeflate&&(r.perMessageDeflate||{}),!0===this.perMessageDeflate&&(this.perMessageDeflate={}),this.perMessageDeflate&&null==this.perMessageDeflate.threshold&&(this.perMessageDeflate.threshold=1024),this.pfx=r.pfx||null,this.key=r.key||null,this.passphrase=r.passphrase||null,this.cert=r.cert||null,this.ca=r.ca||null,this.ciphers=r.ciphers||null,this.rejectUnauthorized=void 0===r.rejectUnauthorized||r.rejectUnauthorized,this.forceNode=!!r.forceNode;var o="object"==typeof e&&e;o.global===o&&(r.extraHeaders&&Object.keys(r.extraHeaders).length>0&&(this.extraHeaders=r.extraHeaders),r.localAddress&&(this.localAddress=r.localAddress)),this.id=null,this.upgrades=null,this.pingInterval=null,this.pingTimeout=null,this.pingIntervalTimer=null,this.pingTimeoutTimer=null,this.open()}Bs=n,n.priorWebsocketSuccess=!1,yo(n.prototype),n.protocol=Hi.protocol,n.Socket=n,n.Transport=$i,n.transports=Ts,n.parser=Hi,n.prototype.createTransport=function(e){t('creating transport "%s"',e);var n=function(e){var t={};for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);return t}(this.query);n.EIO=Hi.protocol,n.transport=e;var r=this.transportOptions[e]||{};return this.id&&(n.sid=this.id),new Ts[e]({query:n,socket:this,agent:r.agent||this.agent,hostname:r.hostname||this.hostname,port:r.port||this.port,secure:r.secure||this.secure,path:r.path||this.path,forceJSONP:r.forceJSONP||this.forceJSONP,jsonp:r.jsonp||this.jsonp,forceBase64:r.forceBase64||this.forceBase64,enablesXDR:r.enablesXDR||this.enablesXDR,timestampRequests:r.timestampRequests||this.timestampRequests,timestampParam:r.timestampParam||this.timestampParam,policyPort:r.policyPort||this.policyPort,pfx:r.pfx||this.pfx,key:r.key||this.key,passphrase:r.passphrase||this.passphrase,cert:r.cert||this.cert,ca:r.ca||this.ca,ciphers:r.ciphers||this.ciphers,rejectUnauthorized:r.rejectUnauthorized||this.rejectUnauthorized,perMessageDeflate:r.perMessageDeflate||this.perMessageDeflate,extraHeaders:r.extraHeaders||this.extraHeaders,forceNode:r.forceNode||this.forceNode,localAddress:r.localAddress||this.localAddress,requestTimeout:r.requestTimeout||this.requestTimeout,protocols:r.protocols||void 0})},n.prototype.open=function(){var e;if(this.rememberUpgrade&&n.priorWebsocketSuccess&&-1!==this.transports.indexOf("websocket"))e="websocket";else{if(0===this.transports.length){var t=this;return void setTimeout(function(){t.emit("error","No transports available")},0)}e=this.transports[0]}this.readyState="opening";try{e=this.createTransport(e)}catch(e){return this.transports.shift(),void this.open()}e.open(),this.setTransport(e)},n.prototype.setTransport=function(e){t("setting transport %s",e.name);var n=this;this.transport&&(t("clearing existing transport %s",this.transport.name),this.transport.removeAllListeners()),this.transport=e,e.on("drain",function(){n.onDrain()}).on("packet",function(e){n.onPacket(e)}).on("error",function(e){n.onError(e)}).on("close",function(){n.onClose("transport close")})},n.prototype.probe=function(e){t('probing transport "%s"',e);var r=this.createTransport(e,{probe:1}),o=!1,i=this;function s(){if(i.onlyBinaryUpgrades){var s=!this.supportsBinary&&i.transport.supportsBinary;o=o||s}o||(t('probe transport "%s" opened',e),r.send([{type:"ping",data:"probe"}]),r.once("packet",function(s){if(!o)if("pong"===s.type&&"probe"===s.data){if(t('probe transport "%s" pong',e),i.upgrading=!0,i.emit("upgrading",r),!r)return;n.priorWebsocketSuccess="websocket"===r.name,t('pausing current transport "%s"',i.transport.name),i.transport.pause(function(){o||"closed"!==i.readyState&&(t("changing transport and sending upgrade packet"),h(),i.setTransport(r),r.send([{type:"upgrade"}]),i.emit("upgrade",r),r=null,i.upgrading=!1,i.flush())})}else{t('probe transport "%s" failed',e);var a=new Error("probe error");a.transport=r.name,i.emit("upgradeError",a)}}))}function a(){o||(o=!0,h(),r.close(),r=null)}function l(n){var o=new Error("probe error: "+n);o.transport=r.name,a(),t('probe transport "%s" failed because of error: %s',e,n),i.emit("upgradeError",o)}function u(){l("transport closed")}function p(){l("socket closed")}function c(e){r&&e.name!==r.name&&(t('"%s" works - aborting "%s"',e.name,r.name),a())}function h(){r.removeListener("open",s),r.removeListener("error",l),r.removeListener("close",u),i.removeListener("close",p),i.removeListener("upgrading",c)}n.priorWebsocketSuccess=!1,r.once("open",s),r.once("error",l),r.once("close",u),this.once("close",p),this.once("upgrading",c),r.open()},n.prototype.onOpen=function(){if(t("socket open"),this.readyState="open",n.priorWebsocketSuccess="websocket"===this.transport.name,this.emit("open"),this.flush(),"open"===this.readyState&&this.upgrade&&this.transport.pause){t("starting upgrade probes");for(var e=0,r=this.upgrades.length;e<r;e++)this.probe(this.upgrades[e])}},n.prototype.onPacket=function(e){if("opening"===this.readyState||"open"===this.readyState||"closing"===this.readyState)switch(t('socket receive: type "%s", data "%s"',e.type,e.data),this.emit("packet",e),this.emit("heartbeat"),e.type){case"open":this.onHandshake(JSON.parse(e.data));break;case"pong":this.setPing(),this.emit("pong");break;case"error":var n=new Error("server error");n.code=e.data,this.onError(n);break;case"message":this.emit("data",e.data),this.emit("message",e.data)}else t('packet received with socket readyState "%s"',this.readyState)},n.prototype.onHandshake=function(e){this.emit("handshake",e),this.id=e.sid,this.transport.query.sid=e.sid,this.upgrades=this.filterUpgrades(e.upgrades),this.pingInterval=e.pingInterval,this.pingTimeout=e.pingTimeout,this.onOpen(),"closed"!==this.readyState&&(this.setPing(),this.removeListener("heartbeat",this.onHeartbeat),this.on("heartbeat",this.onHeartbeat))},n.prototype.onHeartbeat=function(e){clearTimeout(this.pingTimeoutTimer);var t=this;t.pingTimeoutTimer=setTimeout(function(){"closed"!==t.readyState&&t.onClose("ping timeout")},e||t.pingInterval+t.pingTimeout)},n.prototype.setPing=function(){var e=this;clearTimeout(e.pingIntervalTimer),e.pingIntervalTimer=setTimeout(function(){t("writing ping packet - expecting pong within %sms",e.pingTimeout),e.ping(),e.onHeartbeat(e.pingTimeout)},e.pingInterval)},n.prototype.ping=function(){var e=this;this.sendPacket("ping",function(){e.emit("ping")})},n.prototype.onDrain=function(){this.writeBuffer.splice(0,this.prevBufferLen),this.prevBufferLen=0,0===this.writeBuffer.length?this.emit("drain"):this.flush()},n.prototype.flush=function(){"closed"!==this.readyState&&this.transport.writable&&!this.upgrading&&this.writeBuffer.length&&(t("flushing %d packets in socket",this.writeBuffer.length),this.transport.send(this.writeBuffer),this.prevBufferLen=this.writeBuffer.length,this.emit("flush"))},n.prototype.write=n.prototype.send=function(e,t,n){return this.sendPacket("message",e,t,n),this},n.prototype.sendPacket=function(e,t,n,r){if("function"==typeof t&&(r=t,t=void 0),"function"==typeof n&&(r=n,n=null),"closing"!==this.readyState&&"closed"!==this.readyState){(n=n||{}).compress=!1!==n.compress;var o={type:e,data:t,options:n};this.emit("packetCreate",o),this.writeBuffer.push(o),r&&this.once("flush",r),this.flush()}},n.prototype.close=function(){if("opening"===this.readyState||"open"===this.readyState){this.readyState="closing";var e=this;this.writeBuffer.length?this.once("drain",function(){this.upgrading?o():n()}):this.upgrading?o():n()}function n(){e.onClose("forced close"),t("socket closing - telling transport to close"),e.transport.close()}function r(){e.removeListener("upgrade",r),e.removeListener("upgradeError",r),n()}function o(){e.once("upgrade",r),e.once("upgradeError",r)}return this},n.prototype.onError=function(e){t("socket error %j",e),n.priorWebsocketSuccess=!1,this.emit("error",e),this.onClose("transport error",e)},n.prototype.onClose=function(e,n){"opening"!==this.readyState&&"open"!==this.readyState&&"closing"!==this.readyState||(t('socket close with reason: "%s"',e),clearTimeout(this.pingIntervalTimer),clearTimeout(this.pingTimeoutTimer),this.transport.removeAllListeners("close"),this.transport.close(),this.transport.removeAllListeners(),this.readyState="closed",this.id=null,this.emit("close",e,n),this.writeBuffer=[],this.prevBufferLen=0)},n.prototype.filterUpgrades=function(e){for(var t=[],n=0,r=e.length;n<r;n++)~Us(this.transports,e[n])&&t.push(e[n]);return t}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var js={};(js=Bs).parser=Hi;var Is=function(e,t,n){return e.on(t,n),{destroy:function(){e.removeListener(t,n)}}},Ls={};function Ms(e){var t;function n(){if(n.enabled){var e=n,r=+new Date,o=r-(t||r);e.diff=o,e.prev=t,e.curr=r,t=r;for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];i[0]=Ls.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var r=Ls.formatters[n];if("function"==typeof r){var o=i[a];t=r.call(e,o),i.splice(a,1),a--}return t}),Ls.formatArgs.call(e,i),(n.log||Ls.log||console.log.bind(console)).apply(e,i)}}return n.namespace=e,n.enabled=Ls.enabled(e),n.useColors=Ls.useColors(),n.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return Ls.colors[Math.abs(n)%Ls.colors.length]}(e),n.destroy=Ns,"function"==typeof Ls.init&&Ls.init(n),Ls.instances.push(n),n}function Ns(){var e=Ls.instances.indexOf(this);return-1!==e&&(Ls.instances.splice(e,1),!0)}(Ls=Ls=Ms.debug=Ms.default=Ms).coerce=function(e){return e instanceof Error?e.stack||e.message:e},Ls.disable=function(){Ls.enable("")},Ls.enable=function(e){var t;Ls.save(e),Ls.names=[],Ls.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?Ls.skips.push(new RegExp("^"+e.substr(1)+"$")):Ls.names.push(new RegExp("^"+e+"$")));for(t=0;t<Ls.instances.length;t++){var o=Ls.instances[t];o.enabled=Ls.enabled(o.namespace)}},Ls.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=Ls.skips.length;t<n;t++)if(Ls.skips[t].test(e))return!1;for(t=0,n=Ls.names.length;t<n;t++)if(Ls.names[t].test(e))return!0;return!1},Ls.humanize=ss,Ls.instances=[],Ls.names=[],Ls.skips=[],Ls.formatters={};var zs={};(function(e){function t(){var t;try{t=zs.storage.debug}catch(e){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(zs=zs=Ls).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},zs.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+zs.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))}),e.splice(o,0,n)}},zs.save=function(e){try{null==e?zs.storage.removeItem("debug"):zs.storage.debug=e}catch(e){}},zs.load=t,zs.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},zs.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),zs.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],zs.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},zs.enable(t())}).call(this,Ee);var qs={};(function(e){qs=function(o){return t&&e.Buffer.isBuffer(o)||n&&(o instanceof e.ArrayBuffer||r(o))};var t="function"==typeof e.Buffer&&"function"==typeof e.Buffer.isBuffer,n="function"==typeof e.ArrayBuffer,r=n&&"function"==typeof e.ArrayBuffer.isView?e.ArrayBuffer.isView:function(t){return t.buffer instanceof e.ArrayBuffer}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Hs={};(function(e){var t=Object.prototype.toString,n="function"==typeof e.Blob||"[object BlobConstructor]"===t.call(e.Blob),r="function"==typeof e.File||"[object FileConstructor]"===t.call(e.File);Hs.deconstructPacket=function(e){var t=[],n=e.data,r=e;return r.data=function e(t,n){if(!t)return t;if(qs(t)){var r={_placeholder:!0,num:n.length};return n.push(t),r}if(Ni(t)){for(var o=new Array(t.length),i=0;i<t.length;i++)o[i]=e(t[i],n);return o}if("object"==typeof t&&!(t instanceof Date)){o={};for(var s in t)o[s]=e(t[s],n);return o}return t}(n,t),r.attachments=t.length,{packet:r,buffers:t}},Hs.reconstructPacket=function(e,t){return e.data=function e(t,n){if(!t)return t;if(t&&t._placeholder)return n[t.num];if(Ni(t))for(var r=0;r<t.length;r++)t[r]=e(t[r],n);else if("object"==typeof t)for(var o in t)t[o]=e(t[o],n);return t}(e.data,t),e.attachments=void 0,e},Hs.removeBlobs=function(e,t){var o=0,i=e;!function e(s,a,l){if(!s)return s;if(n&&s instanceof Blob||r&&s instanceof File){o++;var u=new FileReader;u.onload=function(){l?l[a]=this.result:i=this.result,--o||t(i)},u.readAsArrayBuffer(s)}else if(Ni(s))for(var p=0;p<s.length;p++)e(s[p],p,s);else if("object"==typeof s&&!qs(s))for(var c in s)e(s[c],c,s)}(i),o||t(i)}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Ws={};function Xs(e){var t;function n(){if(n.enabled){var e=n,r=+new Date,o=r-(t||r);e.diff=o,e.prev=t,e.curr=r,t=r;for(var i=new Array(arguments.length),s=0;s<i.length;s++)i[s]=arguments[s];i[0]=Ws.coerce(i[0]),"string"!=typeof i[0]&&i.unshift("%O");var a=0;i[0]=i[0].replace(/%([a-zA-Z%])/g,function(t,n){if("%%"===t)return t;a++;var r=Ws.formatters[n];if("function"==typeof r){var o=i[a];t=r.call(e,o),i.splice(a,1),a--}return t}),Ws.formatArgs.call(e,i),(n.log||Ws.log||console.log.bind(console)).apply(e,i)}}return n.namespace=e,n.enabled=Ws.enabled(e),n.useColors=Ws.useColors(),n.color=function(e){var t,n=0;for(t in e)n=(n<<5)-n+e.charCodeAt(t),n|=0;return Ws.colors[Math.abs(n)%Ws.colors.length]}(e),n.destroy=Gs,"function"==typeof Ws.init&&Ws.init(n),Ws.instances.push(n),n}function Gs(){var e=Ws.instances.indexOf(this);return-1!==e&&(Ws.instances.splice(e,1),!0)}(Ws=Ws=Xs.debug=Xs.default=Xs).coerce=function(e){return e instanceof Error?e.stack||e.message:e},Ws.disable=function(){Ws.enable("")},Ws.enable=function(e){var t;Ws.save(e),Ws.names=[],Ws.skips=[];var n=("string"==typeof e?e:"").split(/[\s,]+/),r=n.length;for(t=0;t<r;t++)n[t]&&("-"===(e=n[t].replace(/\*/g,".*?"))[0]?Ws.skips.push(new RegExp("^"+e.substr(1)+"$")):Ws.names.push(new RegExp("^"+e+"$")));for(t=0;t<Ws.instances.length;t++){var o=Ws.instances[t];o.enabled=Ws.enabled(o.namespace)}},Ws.enabled=function(e){if("*"===e[e.length-1])return!0;var t,n;for(t=0,n=Ws.skips.length;t<n;t++)if(Ws.skips[t].test(e))return!1;for(t=0,n=Ws.names.length;t<n;t++)if(Ws.names[t].test(e))return!0;return!1},Ws.humanize=ss,Ws.instances=[],Ws.names=[],Ws.skips=[],Ws.formatters={};var Vs={};(function(e){function t(){var t;try{t=Vs.storage.debug}catch(e){}return!t&&void 0!==e&&"env"in e&&(t=e.env.DEBUG),t}(Vs=Vs=Ws).log=function(){return"object"==typeof console&&console.log&&Function.prototype.apply.call(console.log,console,arguments)},Vs.formatArgs=function(e){var t=this.useColors;if(e[0]=(t?"%c":"")+this.namespace+(t?" %c":" ")+e[0]+(t?"%c ":" ")+"+"+Vs.humanize(this.diff),t){var n="color: "+this.color;e.splice(1,0,n,"color: inherit");var r=0,o=0;e[0].replace(/%[a-zA-Z%]/g,function(e){"%%"!==e&&(r++,"%c"===e&&(o=r))}),e.splice(o,0,n)}},Vs.save=function(e){try{null==e?Vs.storage.removeItem("debug"):Vs.storage.debug=e}catch(e){}},Vs.load=t,Vs.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},Vs.storage="undefined"!=typeof chrome&&void 0!==chrome.storage?chrome.storage.local:function(){try{return window.localStorage}catch(e){}}(),Vs.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],Vs.formatters.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}},Vs.enable(t())}).call(this,Ee);var Ks={},Ys=Vs("socket.io-parser");function Js(){}Ks.protocol=4,Ks.types=["CONNECT","DISCONNECT","EVENT","ACK","ERROR","BINARY_EVENT","BINARY_ACK"],Ks.CONNECT=0,Ks.DISCONNECT=1,Ks.EVENT=2,Ks.ACK=3,Ks.ERROR=4,Ks.BINARY_EVENT=5,Ks.BINARY_ACK=6,Ks.Encoder=Js,Ks.Decoder=Zs;var $s=Ks.ERROR+'"encode error"';function Qs(e){var t=""+e.type;if(Ks.BINARY_EVENT!==e.type&&Ks.BINARY_ACK!==e.type||(t+=e.attachments+"-"),e.nsp&&"/"!==e.nsp&&(t+=e.nsp+","),null!=e.id&&(t+=e.id),null!=e.data){var n=function(e){try{return JSON.stringify(e)}catch(e){return!1}}(e.data);if(!1===n)return $s;t+=n}return Ys("encoded %j as %s",e,t),t}function Zs(){this.reconstructor=null}function ea(e){this.reconPack=e,this.buffers=[]}function ta(e){return{type:Ks.ERROR,data:"parser error: "+e}}Js.prototype.encode=function(e,t){Ys("encoding packet %j",e),Ks.BINARY_EVENT===e.type||Ks.BINARY_ACK===e.type?function(e,t){Hs.removeBlobs(e,function(e){var n=Hs.deconstructPacket(e),r=Qs(n.packet),o=n.buffers;o.unshift(r),t(o)})}(e,t):t([Qs(e)])},yo(Zs.prototype),Zs.prototype.add=function(e){var t;if("string"==typeof e)t=function(e){var t=0,n={type:Number(e.charAt(0))};if(null==Ks.types[n.type])return ta("unknown packet type "+n.type);if(Ks.BINARY_EVENT===n.type||Ks.BINARY_ACK===n.type){for(var r="";"-"!==e.charAt(++t)&&(r+=e.charAt(t),t!=e.length););if(r!=Number(r)||"-"!==e.charAt(t))throw new Error("Illegal attachments");n.attachments=Number(r)}if("/"===e.charAt(t+1))for(n.nsp="";++t;){if(","===(i=e.charAt(t)))break;if(n.nsp+=i,t===e.length)break}else n.nsp="/";var o=e.charAt(t+1);if(""!==o&&Number(o)==o){for(n.id="";++t;){var i;if(null==(i=e.charAt(t))||Number(i)!=i){--t;break}if(n.id+=e.charAt(t),t===e.length)break}n.id=Number(n.id)}if(e.charAt(++t)){var s=function(e){try{return JSON.parse(e)}catch(e){return!1}}(e.substr(t));if(!(!1!==s&&(n.type===Ks.ERROR||Ni(s))))return ta("invalid payload");n.data=s}return Ys("decoded %s as %j",e,n),n}(e),Ks.BINARY_EVENT===t.type||Ks.BINARY_ACK===t.type?(this.reconstructor=new ea(t),0===this.reconstructor.reconPack.attachments&&this.emit("decoded",t)):this.emit("decoded",t);else{if(!qs(e)&&!e.base64)throw new Error("Unknown type: "+e);if(!this.reconstructor)throw new Error("got binary data when not reconstructing a packet");(t=this.reconstructor.takeBinaryData(e))&&(this.reconstructor=null,this.emit("decoded",t))}},Zs.prototype.destroy=function(){this.reconstructor&&this.reconstructor.finishedReconstruction()},ea.prototype.takeBinaryData=function(e){if(this.buffers.push(e),this.buffers.length===this.reconPack.attachments){var t=Hs.reconstructPacket(this.reconPack,this.buffers);return this.finishedReconstruction(),t}return null},ea.prototype.finishedReconstruction=function(){this.reconPack=null,this.buffers=[]};var na=function(e,t){for(var n=[],r=(t=t||0)||0;r<e.length;r++)n[r-t]=e[r];return n},ra={},oa=zs("socket.io-client:socket");ra=ra=aa;var ia={connect:1,connect_error:1,connect_timeout:1,connecting:1,disconnect:1,error:1,reconnect:1,reconnect_attempt:1,reconnect_failed:1,reconnect_error:1,reconnecting:1,ping:1,pong:1},sa=yo.prototype.emit;function aa(e,t,n){this.io=e,this.nsp=t,this.json=this,this.ids=0,this.acks={},this.receiveBuffer=[],this.sendBuffer=[],this.connected=!1,this.disconnected=!0,this.flags={},n&&n.query&&(this.query=n.query),this.io.autoConnect&&this.open()}yo(aa.prototype),aa.prototype.subEvents=function(){if(!this.subs){var e=this.io;this.subs=[Is(e,"open",wo(this,"onopen")),Is(e,"packet",wo(this,"onpacket")),Is(e,"close",wo(this,"onclose"))]}},aa.prototype.open=aa.prototype.connect=function(){return this.connected?this:(this.subEvents(),this.io.open(),"open"===this.io.readyState&&this.onopen(),this.emit("connecting"),this)},aa.prototype.send=function(){var e=na(arguments);return e.unshift("message"),this.emit.apply(this,e),this},aa.prototype.emit=function(e){if(ia.hasOwnProperty(e))return sa.apply(this,arguments),this;var t=na(arguments),n={type:(void 0!==this.flags.binary?this.flags.binary:zi(t))?Ks.BINARY_EVENT:Ks.EVENT,data:t,options:{}};return n.options.compress=!this.flags||!1!==this.flags.compress,"function"==typeof t[t.length-1]&&(oa("emitting packet with ack id %d",this.ids),this.acks[this.ids]=t.pop(),n.id=this.ids++),this.connected?this.packet(n):this.sendBuffer.push(n),this.flags={},this},aa.prototype.packet=function(e){e.nsp=this.nsp,this.io.packet(e)},aa.prototype.onopen=function(){if(oa("transport is open - connecting"),"/"!==this.nsp)if(this.query){var e="object"==typeof this.query?hs.encode(this.query):this.query;oa("sending connect packet with query %s",e),this.packet({type:Ks.CONNECT,query:e})}else this.packet({type:Ks.CONNECT})},aa.prototype.onclose=function(e){oa("close (%s)",e),this.connected=!1,this.disconnected=!0,delete this.id,this.emit("disconnect",e)},aa.prototype.onpacket=function(e){var t=e.nsp===this.nsp,n=e.type===Ks.ERROR&&"/"===e.nsp;if(t||n)switch(e.type){case Ks.CONNECT:this.onconnect();break;case Ks.EVENT:case Ks.BINARY_EVENT:this.onevent(e);break;case Ks.ACK:case Ks.BINARY_ACK:this.onack(e);break;case Ks.DISCONNECT:this.ondisconnect();break;case Ks.ERROR:this.emit("error",e.data)}},aa.prototype.onevent=function(e){var t=e.data||[];oa("emitting event %j",t),null!=e.id&&(oa("attaching ack callback to event"),t.push(this.ack(e.id))),this.connected?sa.apply(this,t):this.receiveBuffer.push(t)},aa.prototype.ack=function(e){var t=this,n=!1;return function(){if(!n){n=!0;var r=na(arguments);oa("sending ack %j",r),t.packet({type:zi(r)?Ks.BINARY_ACK:Ks.ACK,id:e,data:r})}}},aa.prototype.onack=function(e){var t=this.acks[e.id];"function"==typeof t?(oa("calling ack %s with %j",e.id,e.data),t.apply(this,e.data),delete this.acks[e.id]):oa("bad ack %s",e.id)},aa.prototype.onconnect=function(){this.connected=!0,this.disconnected=!1,this.emit("connect"),this.emitBuffered()},aa.prototype.emitBuffered=function(){var e;for(e=0;e<this.receiveBuffer.length;e++)sa.apply(this,this.receiveBuffer[e]);for(this.receiveBuffer=[],e=0;e<this.sendBuffer.length;e++)this.packet(this.sendBuffer[e]);this.sendBuffer=[]},aa.prototype.ondisconnect=function(){oa("server disconnect (%s)",this.nsp),this.destroy(),this.onclose("io server disconnect")},aa.prototype.destroy=function(){if(this.subs){for(var e=0;e<this.subs.length;e++)this.subs[e].destroy();this.subs=null}this.io.destroy(this)},aa.prototype.close=aa.prototype.disconnect=function(){return this.connected&&(oa("performing disconnect (%s)",this.nsp),this.packet({type:Ks.DISCONNECT})),this.destroy(),this.connected&&this.onclose("io client disconnect"),this},aa.prototype.compress=function(e){return this.flags.compress=e,this},aa.prototype.binary=function(e){return this.flags.binary=e,this};var la={},ua=zs("socket.io-client:manager"),pa=Object.prototype.hasOwnProperty;function ca(e,t){if(!(this instanceof ca))return new ca(e,t);e&&"object"==typeof e&&(t=e,e=void 0),(t=t||{}).path=t.path||"/socket.io",this.nsps={},this.subs=[],this.opts=t,this.reconnection(!1!==t.reconnection),this.reconnectionAttempts(t.reconnectionAttempts||1/0),this.reconnectionDelay(t.reconnectionDelay||1e3),this.reconnectionDelayMax(t.reconnectionDelayMax||5e3),this.randomizationFactor(t.randomizationFactor||.5),this.backoff=new mo({min:this.reconnectionDelay(),max:this.reconnectionDelayMax(),jitter:this.randomizationFactor()}),this.timeout(null==t.timeout?2e4:t.timeout),this.readyState="closed",this.uri=e,this.connecting=[],this.lastPing=null,this.encoding=!1,this.packetBuffer=[];var n=t.parser||Ks;this.encoder=new n.Encoder,this.decoder=new n.Decoder,this.autoConnect=!1!==t.autoConnect,this.autoConnect&&this.open()}la=ca,ca.prototype.emitAll=function(){for(var e in this.emit.apply(this,arguments),this.nsps)pa.call(this.nsps,e)&&this.nsps[e].emit.apply(this.nsps[e],arguments)},ca.prototype.updateSocketIds=function(){for(var e in this.nsps)pa.call(this.nsps,e)&&(this.nsps[e].id=this.generateId(e))},ca.prototype.generateId=function(e){return("/"===e?"":e+"#")+this.engine.id},yo(ca.prototype),ca.prototype.reconnection=function(e){return arguments.length?(this._reconnection=!!e,this):this._reconnection},ca.prototype.reconnectionAttempts=function(e){return arguments.length?(this._reconnectionAttempts=e,this):this._reconnectionAttempts},ca.prototype.reconnectionDelay=function(e){return arguments.length?(this._reconnectionDelay=e,this.backoff&&this.backoff.setMin(e),this):this._reconnectionDelay},ca.prototype.randomizationFactor=function(e){return arguments.length?(this._randomizationFactor=e,this.backoff&&this.backoff.setJitter(e),this):this._randomizationFactor},ca.prototype.reconnectionDelayMax=function(e){return arguments.length?(this._reconnectionDelayMax=e,this.backoff&&this.backoff.setMax(e),this):this._reconnectionDelayMax},ca.prototype.timeout=function(e){return arguments.length?(this._timeout=e,this):this._timeout},ca.prototype.maybeReconnectOnOpen=function(){!this.reconnecting&&this._reconnection&&0===this.backoff.attempts&&this.reconnect()},ca.prototype.open=ca.prototype.connect=function(e,t){if(ua("readyState %s",this.readyState),~this.readyState.indexOf("open"))return this;ua("opening %s",this.uri),this.engine=js(this.uri,this.opts);var n=this.engine,r=this;this.readyState="opening",this.skipReconnect=!1;var o=Is(n,"open",function(){r.onopen(),e&&e()}),i=Is(n,"error",function(t){if(ua("connect_error"),r.cleanup(),r.readyState="closed",r.emitAll("connect_error",t),e){var n=new Error("Connection error");n.data=t,e(n)}else r.maybeReconnectOnOpen()});if(!1!==this._timeout){var s=this._timeout;ua("connect attempt will timeout after %d",s);var a=setTimeout(function(){ua("connect attempt timed out after %d",s),o.destroy(),n.close(),n.emit("error","timeout"),r.emitAll("connect_timeout",s)},s);this.subs.push({destroy:function(){clearTimeout(a)}})}return this.subs.push(o),this.subs.push(i),this},ca.prototype.onopen=function(){ua("open"),this.cleanup(),this.readyState="open",this.emit("open");var e=this.engine;this.subs.push(Is(e,"data",wo(this,"ondata"))),this.subs.push(Is(e,"ping",wo(this,"onping"))),this.subs.push(Is(e,"pong",wo(this,"onpong"))),this.subs.push(Is(e,"error",wo(this,"onerror"))),this.subs.push(Is(e,"close",wo(this,"onclose"))),this.subs.push(Is(this.decoder,"decoded",wo(this,"ondecoded")))},ca.prototype.onping=function(){this.lastPing=new Date,this.emitAll("ping")},ca.prototype.onpong=function(){this.emitAll("pong",new Date-this.lastPing)},ca.prototype.ondata=function(e){this.decoder.add(e)},ca.prototype.ondecoded=function(e){this.emit("packet",e)},ca.prototype.onerror=function(e){ua("error",e),this.emitAll("error",e)},ca.prototype.socket=function(e,t){var n=this.nsps[e];if(!n){n=new ra(this,e,t),this.nsps[e]=n;var r=this;n.on("connecting",o),n.on("connect",function(){n.id=r.generateId(e)}),this.autoConnect&&o()}function o(){~Us(r.connecting,n)||r.connecting.push(n)}return n},ca.prototype.destroy=function(e){var t=Us(this.connecting,e);~t&&this.connecting.splice(t,1),this.connecting.length||this.close()},ca.prototype.packet=function(e){ua("writing packet %j",e);var t=this;e.query&&0===e.type&&(e.nsp+="?"+e.query),t.encoding?t.packetBuffer.push(e):(t.encoding=!0,this.encoder.encode(e,function(n){for(var r=0;r<n.length;r++)t.engine.write(n[r],e.options);t.encoding=!1,t.processPacketQueue()}))},ca.prototype.processPacketQueue=function(){if(this.packetBuffer.length>0&&!this.encoding){var e=this.packetBuffer.shift();this.packet(e)}},ca.prototype.cleanup=function(){ua("cleanup");for(var e=this.subs.length,t=0;t<e;t++)this.subs.shift().destroy();this.packetBuffer=[],this.encoding=!1,this.lastPing=null,this.decoder.destroy()},ca.prototype.close=ca.prototype.disconnect=function(){ua("disconnect"),this.skipReconnect=!0,this.reconnecting=!1,"opening"===this.readyState&&this.cleanup(),this.backoff.reset(),this.readyState="closed",this.engine&&this.engine.close()},ca.prototype.onclose=function(e){ua("onclose"),this.cleanup(),this.backoff.reset(),this.readyState="closed",this.emit("close",e),this._reconnection&&!this.skipReconnect&&this.reconnect()},ca.prototype.reconnect=function(){if(this.reconnecting||this.skipReconnect)return this;var e=this;if(this.backoff.attempts>=this._reconnectionAttempts)ua("reconnect failed"),this.backoff.reset(),this.emitAll("reconnect_failed"),this.reconnecting=!1;else{var t=this.backoff.duration();ua("will wait %dms before reconnect attempt",t),this.reconnecting=!0;var n=setTimeout(function(){e.skipReconnect||(ua("attempting reconnect"),e.emitAll("reconnect_attempt",e.backoff.attempts),e.emitAll("reconnecting",e.backoff.attempts),e.skipReconnect||e.open(function(t){t?(ua("reconnect attempt error"),e.reconnecting=!1,e.reconnect(),e.emitAll("reconnect_error",t.data)):(ua("reconnect success"),e.onreconnect())}))},t);this.subs.push({destroy:function(){clearTimeout(n)}})}},ca.prototype.onreconnect=function(){var e=this.backoff.attempts;this.reconnecting=!1,this.backoff.reset(),this.updateSocketIds(),this.emitAll("reconnect",e)};var ha={};(function(e){var t=zs("socket.io-client:url");ha=function(n,r){var o=n;r=r||e.location,null==n&&(n=r.protocol+"//"+r.host),"string"==typeof n&&("/"===n.charAt(0)&&(n="/"===n.charAt(1)?r.protocol+n:r.host+n),/^(https?|wss?):\/\//.test(n)||(t("protocol-less url %s",n),n=void 0!==r?r.protocol+"//"+n:"https://"+n),t("parse %s",n),o=Ds(n)),o.port||(/^(http|ws)$/.test(o.protocol)?o.port="80":/^(http|ws)s$/.test(o.protocol)&&(o.port="443")),o.path=o.path||"/";var i=-1!==o.host.indexOf(":")?"["+o.host+"]":o.host;return o.id=o.protocol+"://"+i+":"+o.port,o.href=o.protocol+"://"+i+(r&&r.port===o.port?"":":"+o.port),o}}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var da={},fa=zs("socket.io-client"),ya=(da=da=ga).managers={};function ga(e,t){"object"==typeof e&&(t=e,e=void 0),t=t||{};var n,r=ha(e),o=r.source,i=r.id,s=r.path,a=ya[i]&&s in ya[i].nsps;return t.forceNew||t["force new connection"]||!1===t.multiplex||a?(fa("ignoring socket cache for %s",o),n=la(o,t)):(ya[i]||(fa("new io instance for %s",o),ya[i]=la(o,t)),n=ya[i]),r.query&&!t.query&&(t.query=r.query),n.socket(r.path,t)}da.protocol=Ks.protocol,da.connect=ga,da.Manager=la,da.Socket=ra;var ma=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},va=void 0,ba=["ASSEMBLY_UPLOADING","ASSEMBLY_EXECUTING","ASSEMBLY_COMPLETED"];function wa(e,t){return ba.indexOf(e)>=ba.indexOf(t)}var Sa=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this));return r.status=n,r.socket=null,r.pollInterval=null,r.closed=!1,r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.connect=function(){this._connectSocket(),this._beginPolling()},t.prototype._onFinished=function(){this.emit("finished"),this.close()},t.prototype._connectSocket=function(){var e=this,t=function(e){var t=/^\w+:\/\//.exec(e),n=0;t&&(n=t[0].length+1);var r=e.indexOf("/",n);return-1===r?{origin:e,pathname:"/"}:{origin:e.slice(0,r),pathname:e.slice(r)}}(this.status.websocket_url),n=(va||(va=da),va).connect(t.origin,{transports:["websocket"],path:t.pathname});n.on("connect",function(){n.emit("assembly_connect",{id:e.status.assembly_id}),e.emit("connect")}),n.on("error",function(){n.disconnect(),e.socket=null}),n.on("assembly_finished",function(){e._onFinished()}),n.on("assembly_upload_finished",function(t){e.emit("upload",t),e._fetchStatus({diff:!1})}),n.on("assembly_uploading_finished",function(){e.emit("executing"),e._fetchStatus({diff:!1})}),n.on("assembly_upload_meta_data_extracted",function(){e.emit("metadata"),e._fetchStatus({diff:!1})}),n.on("assembly_result_finished",function(t,n){e.emit("result",t,n),e._fetchStatus({diff:!1})}),n.on("assembly_error",function(t){e._onError(t),e._fetchStatus({diff:!1})}),this.socket=n},t.prototype._onError=function(e){this.emit("error",ma(new Error(e.message),e))},t.prototype._beginPolling=function(){var e=this;this.pollInterval=setInterval(function(){e.socket&&e.socket.connected||e._fetchStatus()},2e3)},t.prototype._fetchStatus=function(){var e=this,t=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}).diff,n=void 0===t||t;return fetch(this.status.assembly_ssl_url).then(function(e){return e.json()}).then(function(t){e.closed||(e.emit("status",t),n?e.updateStatus(t):e.status=t)})},t.prototype.update=function(){return this._fetchStatus({diff:!0})},t.prototype.updateStatus=function(e){this._diffStatus(this.status,e),this.status=e},t.prototype._diffStatus=function(e,t){var n=this,r=e.ok,o=t.ok;if(t.error&&!e.error)return this._onError(t);var i=wa(o,"ASSEMBLY_EXECUTING")&&!wa(r,"ASSEMBLY_EXECUTING");i&&this.emit("executing"),Object.keys(t.uploads).filter(function(t){return!e.uploads.hasOwnProperty(t)}).map(function(e){return t.uploads[e]}).forEach(function(e){n.emit("upload",e)}),i&&this.emit("metadata"),Object.keys(t.results).forEach(function(r){var o=t.results[r],i=e.results[r];o.filter(function(e){return!i||!i.some(function(t){return t.id===e.id})}).forEach(function(e){n.emit("result",r,e)})}),wa(o,"ASSEMBLY_COMPLETED")&&!wa(r,"ASSEMBLY_COMPLETED")&&this.emit("finished")},t.prototype.close=function(){this.closed=!0,this.socket&&(this.socket.disconnect(),this.socket=null),clearInterval(this.pollInterval)},t}(yo);function Ca(e){if(!e)throw new Error("Transloadit: The `params` option is required.");if("string"==typeof e)try{e=JSON.parse(e)}catch(e){throw e.message="Transloadit: The `params` option is a malformed JSON string: "+e.message,e}if(!e.auth||!e.auth.key)throw new Error("Transloadit: The `params.auth.key` option is required. You can find your Transloadit API key at https://transloadit.com/account/api-settings.")}var _a=(Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e})(function(){function e(t,n){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.files=t,this.opts=n}return e.prototype._normalizeAssemblyOptions=function(e,t){if(Array.isArray(t.fields)){var n=t.fields;t.fields={},n.forEach(function(n){t.fields[n]=e.meta[n]})}return t.fields||(t.fields={}),t},e.prototype._getAssemblyOptions=function(e){var t=this,n=this.opts;return Promise.resolve().then(function(){return n.getAssemblyOptions(e,n)}).then(function(n){return t._normalizeAssemblyOptions(e,n)}).then(function(t){return Ca(t.params),{fileIDs:[e.id],options:t}})},e.prototype._dedupe=function(e){var t=Object.create(null);return e.forEach(function(e){var n,r=e.fileIDs,o=e.options,i=JSON.stringify(o);t[i]?(n=t[i].fileIDs).push.apply(n,r):t[i]={options:o,fileIDs:[].concat(r)}}),Object.keys(t).map(function(e){return t[e]})},e.prototype.build=function(){var e=this,t=this.opts;return this.files.length>0?Promise.all(this.files.map(function(t){return e._getAssemblyOptions(t)})).then(function(t){return e._dedupe(t)}):t.alwaysRunAssembly?Promise.resolve(t.getAssemblyOptions(null,t)).then(function(t){return Ca(t.params),[{fileIDs:e.files.map(function(e){return e.id}),options:t}]}):Promise.resolve([])},e}(),{validateParams:Ca}),Pa=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this));return o._uppy=n,o._assemblyIDs=r,o._remaining=r.length,o.promise=new Promise(function(e,t){o._resolve=e,o._reject=t}),o._onAssemblyComplete=o._onAssemblyComplete.bind(o),o._onAssemblyError=o._onAssemblyError.bind(o),o._onImportError=o._onImportError.bind(o),o._addListeners(),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype._watching=function(e){return-1!==this._assemblyIDs.indexOf(e)},t.prototype._onAssemblyComplete=function(e){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly finish "+e.assembly_id),this.emit("assembly-complete",e.assembly_id),this._checkAllComplete())},t.prototype._onAssemblyError=function(e,t){this._watching(e.assembly_id)&&(this._uppy.log("[Transloadit] AssemblyWatcher: Got Assembly error "+e.assembly_id),this._uppy.log(t),this.emit("assembly-error",e.assembly_id,t),this._checkAllComplete())},t.prototype._onImportError=function(e,t,n){this._watching(e.assembly_id)&&this._onAssemblyError(e,n)},t.prototype._checkAllComplete=function(){this._remaining-=1,0===this._remaining&&(this._removeListeners(),this._resolve())},t.prototype._removeListeners=function(){this._uppy.off("transloadit:complete",this._onAssemblyComplete),this._uppy.off("transloadit:assembly-error",this._onAssemblyError),this._uppy.off("transloadit:import-error",this._onImportError)},t.prototype._addListeners=function(){this._uppy.on("transloadit:complete",this._onAssemblyComplete),this._uppy.on("transloadit:assembly-error",this._onAssemblyError),this._uppy.on("transloadit:import-error",this._onImportError)},t}(yo),Ea=function(){function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.opts=t}return e.prototype.createAssembly=function(e){e.templateId;var t=e.params,n=e.fields,r=e.signature,o=e.expectedFiles,i=new FormData;return i.append("params","string"==typeof t?t:JSON.stringify(t)),r&&i.append("signature",r),Object.keys(n).forEach(function(e){i.append(e,n[e])}),i.append("num_expected_upload_files",o),fetch(this.opts.service+"/assemblies",{method:"post",body:i}).then(function(e){return e.json()}).then(function(e){if(e.error){var t=new Error(e.error);throw t.message=e.error,t.details=e.reason,t}return e})},e.prototype.reserveFile=function(e,t){var n=encodeURIComponent(t.size);return fetch(e.assembly_ssl_url+"/reserve_file?size="+n,{method:"post"}).then(function(e){return e.json()})},e.prototype.addFile=function(e,t){if(!t.uploadURL)return Promise.reject(new Error("File does not have an `uploadURL`."));var n=encodeURIComponent(t.size),r=encodeURIComponent(t.uploadURL),o="size="+n+"&filename="+encodeURIComponent(t.name)+"&fieldname=file&s3Url="+r;return fetch(e.assembly_ssl_url+"/add_file?"+o,{method:"post"}).then(function(e){return e.json()})},e.prototype.getAssemblyStatus=function(e){return fetch(e).then(function(e){return e.json()})},e}(),Fa={};Object.defineProperty(Fa,"__esModule",{value:!0}),Fa.setItem=function(e,t){if(ka)return localStorage.setItem(e,t)},Fa.getItem=function(e){if(ka)return localStorage.getItem(e)},Fa.removeItem=function(e){if(ka)return localStorage.removeItem(e)};var ka=!1;try{ka="localStorage"in window;var Aa="tusSupport";localStorage.setItem(Aa,localStorage.getItem(Aa))}catch(e){if(e.code!==e.SECURITY_ERR&&e.code!==e.QUOTA_EXCEEDED_ERR)throw e;ka=!1}Fa.canStoreURLs=ka;var Ta=Object.prototype.hasOwnProperty,Oa=Object.prototype.toString,Ua=function(e){return"function"==typeof Array.isArray?Array.isArray(e):"[object Array]"===Oa.call(e)},xa=function(e){if(!e||"[object Object]"!==Oa.call(e))return!1;var t,n=Ta.call(e,"constructor"),r=e.constructor&&e.constructor.prototype&&Ta.call(e.constructor.prototype,"isPrototypeOf");if(e.constructor&&!n&&!r)return!1;for(t in e);return void 0===t||Ta.call(e,t)},Ra={};Object.defineProperty(Ra,"__esModule",{value:!0}),Ra.encode=function(e){return Da(unescape(encodeURIComponent(e)))};var Da=window.btoa;Ra.isSupported="btoa"in window;var Ba={},ja=Object.prototype.hasOwnProperty;function Ia(e){return decodeURIComponent(e.replace(/\+/g," "))}Ba.stringify=function(e,t){t=t||"";var n,r,o=[];for(r in"string"!=typeof t&&(t="?"),e)ja.call(e,r)&&((n=e[r])||null!=n&&!isNaN(n)||(n=""),o.push(encodeURIComponent(r)+"="+encodeURIComponent(n)));return o.length?t+o.join("&"):""},Ba.parse=function(e){for(var t,n=/([^=?&]+)=?([^&]*)/g,r={};t=n.exec(e);){var o=Ia(t[1]),i=Ia(t[2]);o in r||(r[o]=i)}return r};var La=function(e,t){if(t=t.split(":")[0],!(e=+e))return!1;switch(t){case"http":case"ws":return 80!==e;case"https":case"wss":return 443!==e;case"ftp":return 21!==e;case"gopher":return 70!==e;case"file":return!1}return 0!==e},Ma={};(function(e){"use strict";var t=/^([a-z][a-z0-9.+-]*:)?(\/\/)?([\S\s]*)/i,n=/^[A-Za-z][A-Za-z0-9+-.]*:\/\//,r=[["#","hash"],["?","query"],function(e){return e.replace("\\","/")},["/","pathname"],["@","auth",1],[NaN,"host",void 0,1,1],[/:(\d+)$/,"port",void 0,1],[NaN,"hostname",void 0,1,1]],o={hash:1,query:1};function i(t){var r,i=("undefined"!=typeof window?window:void 0!==e?e:"undefined"!=typeof self?self:{}).location||{},s={},l=typeof(t=t||i);if("blob:"===t.protocol)s=new a(unescape(t.pathname),{});else if("string"===l)for(r in s=new a(t,{}),o)delete s[r];else if("object"===l){for(r in t)r in o||(s[r]=t[r]);void 0===s.slashes&&(s.slashes=n.test(t.href))}return s}function s(e){var n=t.exec(e);return{protocol:n[1]?n[1].toLowerCase():"",slashes:!!n[2],rest:n[3]}}function a(e,t,n){if(!(this instanceof a))return new a(e,t,n);var o,l,u,p,c,h,d=r.slice(),f=typeof t,y=this,g=0;for("object"!==f&&"string"!==f&&(n=t,t=null),n&&"function"!=typeof n&&(n=Ba.parse),t=i(t),o=!(l=s(e||"")).protocol&&!l.slashes,y.slashes=l.slashes||o&&t.slashes,y.protocol=l.protocol||t.protocol||"",e=l.rest,l.slashes||(d[3]=[/(.*)/,"pathname"]);g<d.length;g++)"function"!=typeof(p=d[g])?(u=p[0],h=p[1],u!=u?y[h]=e:"string"==typeof u?~(c=e.indexOf(u))&&("number"==typeof p[2]?(y[h]=e.slice(0,c),e=e.slice(c+p[2])):(y[h]=e.slice(c),e=e.slice(0,c))):(c=u.exec(e))&&(y[h]=c[1],e=e.slice(0,c.index)),y[h]=y[h]||o&&p[3]&&t[h]||"",p[4]&&(y[h]=y[h].toLowerCase())):e=p(e);n&&(y.query=n(y.query)),o&&t.slashes&&"/"!==y.pathname.charAt(0)&&(""!==y.pathname||""!==t.pathname)&&(y.pathname=function(e,n){for(var r=(t.pathname||"/").split("/").slice(0,-1).concat(e.split("/")),o=r.length,i=r[o-1],s=!1,a=0;o--;)"."===r[o]?r.splice(o,1):".."===r[o]?(r.splice(o,1),a++):a&&(0===o&&(s=!0),r.splice(o,1),a--);return s&&r.unshift(""),"."!==i&&".."!==i||r.push(""),r.join("/")}(y.pathname)),La(y.port,y.protocol)||(y.host=y.hostname,y.port=""),y.username=y.password="",y.auth&&(p=y.auth.split(":"),y.username=p[0]||"",y.password=p[1]||""),y.origin=y.protocol&&y.host&&"file:"!==y.protocol?y.protocol+"//"+y.host:"null",y.href=y.toString()}a.prototype={set:function(e,t,n){var o=this;switch(e){case"query":"string"==typeof t&&t.length&&(t=(n||Ba.parse)(t)),o[e]=t;break;case"port":o[e]=t,La(t,o.protocol)?t&&(o.host=o.hostname+":"+t):(o.host=o.hostname,o[e]="");break;case"hostname":o[e]=t,o.port&&(t+=":"+o.port),o.host=t;break;case"host":o[e]=t,/:\d+$/.test(t)?(t=t.split(":"),o.port=t.pop(),o.hostname=t.join(":")):(o.hostname=t,o.port="");break;case"protocol":o.protocol=t.toLowerCase(),o.slashes=!n;break;case"pathname":case"hash":if(t){var i="pathname"===e?"/":"#";o[e]=t.charAt(0)!==i?i+t:t}else o[e]=t;break;default:o[e]=t}for(var s=0;s<r.length;s++){var a=r[s];a[4]&&(o[a[1]]=o[a[1]].toLowerCase())}return o.origin=o.protocol&&o.host&&"file:"!==o.protocol?o.protocol+"//"+o.host:"null",o.href=o.toString(),o},toString:function(e){e&&"function"==typeof e||(e=Ba.stringify);var t,n=this,r=n.protocol;r&&":"!==r.charAt(r.length-1)&&(r+=":");var o=r+(n.slashes?"//":"");return n.username&&(o+=n.username,n.password&&(o+=":"+n.password),o+="@"),o+=n.host+n.pathname,(t="object"==typeof n.query?e(n.query):n.query)&&(o+="?"!==t.charAt(0)?"?"+t:t),n.hash&&(o+=n.hash),o}},a.extractProtocol=s,a.location=i,a.qs=Ba,Ma=a}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{});var Na={};Object.defineProperty(Na,"__esModule",{value:!0}),Na.newRequest=function(){return new window.XMLHttpRequest},Na.resolveUrl=function(e,t){return new qa.default(t,e).toString()};var za,qa=(za=Ma)&&za.__esModule?za:{default:za},Ha={},Wa=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(Ha,"__esModule",{value:!0}),Ha.getSource=function(e){if("function"==typeof e.slice&&void 0!==e.size)return new Xa(e);throw new Error("source object may only be an instance of File or Blob in this environment")};var Xa=function(){function e(t){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this._file=t,this.size=t.size}return Wa(e,[{key:"slice",value:function(e,t){return this._file.slice(e,t)}},{key:"close",value:function(){}}]),e}(),Ga={};Object.defineProperty(Ga,"__esModule",{value:!0});var Va=function(e){function t(e){var n=arguments.length<=1||void 0===arguments[1]?null:arguments[1],r=arguments.length<=2||void 0===arguments[2]?null:arguments[2];!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,Object.getPrototypeOf(t).call(this,e.message));o.originalRequest=r,o.causingError=n;var i=e.message;return null!=n&&(i+=", caused by "+n.toString()),null!=r&&(i+=", originated from request (response code: "+r.status+", response text: "+r.responseText+")"),o.message=i,o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,Error),t}();Ga.default=Va;var Ka={};Object.defineProperty(Ka,"__esModule",{value:!0}),Ka.default=function(e,t){return["tus",e.name,e.type,e.size,e.lastModified,t.endpoint].join("-")};var Ya={},Ja=function(){function e(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}return function(t,n,r){return n&&e(t.prototype,n),r&&e(t,r),t}}();Object.defineProperty(Ya,"__esModule",{value:!0});var $a=rl(Ka),Qa=rl(Ga),Za=rl(function e(){var t,n,r,o,i,s,a=arguments[0],l=1,u=arguments.length,p=!1;for("boolean"==typeof a&&(p=a,a=arguments[1]||{},l=2),(null==a||"object"!=typeof a&&"function"!=typeof a)&&(a={});l<u;++l)if(null!=(t=arguments[l]))for(n in t)r=a[n],a!==(o=t[n])&&(p&&o&&(xa(o)||(i=Ua(o)))?(i?(i=!1,s=r&&Ua(r)?r:[]):s=r&&xa(r)?r:{},a[n]=e(p,s,o)):void 0!==o&&(a[n]=o));return a}),el=nl(Ra),tl=nl(Fa);function nl(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t.default=e,t}function rl(e){return e&&e.__esModule?e:{default:e}}var ol={endpoint:null,fingerprint:$a.default,resume:!0,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,headers:{},chunkSize:1/0,withCredentials:!1,uploadUrl:null,uploadSize:null,overridePatchMethod:!1,retryDelays:null,removeFingerprintOnSuccess:!1},il=function(){function e(t,n){!function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.options=(0,Za.default)(!0,{},ol,n),this.file=t,this.url=null,this._xhr=null,this._fingerprint=null,this._offset=null,this._aborted=!1,this._size=null,this._source=null,this._retryAttempt=0,this._retryTimeout=null,this._offsetBeforeRetry=0}return Ja(e,[{key:"start",value:function(){var e=this,t=this.file;if(t)if(this.options.endpoint||this.options.uploadUrl){var n=this._source=(0,Ha.getSource)(t,this.options.chunkSize);if(null!=this.options.uploadSize){var r=+this.options.uploadSize;if(isNaN(r))throw new Error("tus: cannot convert `uploadSize` option into a number");this._size=r}else{if(null==(r=n.size))throw new Error("tus: cannot automatically derive upload's size from input and must be specified manually using the `uploadSize` option");this._size=r}var o,i=this.options.retryDelays;if(null!=i){if("[object Array]"!==Object.prototype.toString.call(i))throw new Error("tus: the `retryDelays` option must either be an array or null");o=e.options.onError,e.options.onError=function(t){e.options.onError=o,null!=e._offset&&e._offset>e._offsetBeforeRetry&&(e._retryAttempt=0);var n=!0;if("undefined"!=typeof window&&"navigator"in window&&!1===window.navigator.onLine&&(n=!1),e._retryAttempt<i.length&&null!=t.originalRequest&&!sl(t.originalRequest.status,400)&&n){var r=i[e._retryAttempt++];e._offsetBeforeRetry=e._offset,e.options.uploadUrl=e.url,e._retryTimeout=setTimeout(function(){e.start()},r)}else e._emitError(t)}}if(this._aborted=!1,null==this.url){if(null!=this.options.uploadUrl)return this.url=this.options.uploadUrl,void this._resumeUpload();if(this.options.resume){this._fingerprint=this.options.fingerprint(t,this.options);var s=tl.getItem(this._fingerprint);if(null!=s)return this.url=s,void this._resumeUpload()}this._createUpload()}else this._resumeUpload()}else this._emitError(new Error("tus: neither an endpoint or an upload URL is provided"));else this._emitError(new Error("tus: no file or stream to upload provided"))}},{key:"abort",value:function(){null!==this._xhr&&(this._xhr.abort(),this._source.close(),this._aborted=!0),null!=this._retryTimeout&&(clearTimeout(this._retryTimeout),this._retryTimeout=null)}},{key:"_emitXhrError",value:function(e,t,n){this._emitError(new Qa.default(t,n,e))}},{key:"_emitError",value:function(e){if("function"!=typeof this.options.onError)throw e;this.options.onError(e)}},{key:"_emitSuccess",value:function(){"function"==typeof this.options.onSuccess&&this.options.onSuccess()}},{key:"_emitProgress",value:function(e,t){"function"==typeof this.options.onProgress&&this.options.onProgress(e,t)}},{key:"_emitChunkComplete",value:function(e,t,n){"function"==typeof this.options.onChunkComplete&&this.options.onChunkComplete(e,t,n)}},{key:"_setupXHR",value:function(e){this._xhr=e,e.setRequestHeader("Tus-Resumable","1.0.0");var t=this.options.headers;for(var n in t)e.setRequestHeader(n,t[n]);e.withCredentials=this.options.withCredentials}},{key:"_createUpload",value:function(){var e=this;if(this.options.endpoint){var t=(0,Na.newRequest)();t.open("POST",this.options.endpoint,!0),t.onload=function(){if(sl(t.status,200)){var n=t.getResponseHeader("Location");if(null!=n){if(e.url=(0,Na.resolveUrl)(e.options.endpoint,n),0===e._size)return e._emitSuccess(),void e._source.close();e.options.resume&&tl.setItem(e._fingerprint,e.url),e._offset=0,e._startUpload()}else e._emitXhrError(t,new Error("tus: invalid or missing Location header"))}else e._emitXhrError(t,new Error("tus: unexpected response while creating upload"))},t.onerror=function(n){e._emitXhrError(t,new Error("tus: failed to create upload"),n)},this._setupXHR(t),t.setRequestHeader("Upload-Length",this._size);var n=function(e){if(!el.isSupported)return"";var t=[];for(var n in e)t.push(n+" "+el.encode(e[n]));return t.join(",")}(this.options.metadata);""!==n&&t.setRequestHeader("Upload-Metadata",n),t.send(null)}else this._emitError(new Error("tus: unable to create upload because no endpoint is provided"))}},{key:"_resumeUpload",value:function(){var e=this,t=(0,Na.newRequest)();t.open("HEAD",this.url,!0),t.onload=function(){if(!sl(t.status,200))return e.options.resume&&sl(t.status,400)&&tl.removeItem(e._fingerprint),423===t.status?void e._emitXhrError(t,new Error("tus: upload is currently locked; retry later")):e.options.endpoint?(e.url=null,void e._createUpload()):void e._emitXhrError(t,new Error("tus: unable to resume upload (new upload cannot be created without an endpoint)"));var n=parseInt(t.getResponseHeader("Upload-Offset"),10);if(isNaN(n))e._emitXhrError(t,new Error("tus: invalid or missing offset value"));else{var r=parseInt(t.getResponseHeader("Upload-Length"),10);if(isNaN(r))e._emitXhrError(t,new Error("tus: invalid or missing length value"));else{if(n===r)return e._emitProgress(r,r),void e._emitSuccess();e._offset=n,e._startUpload()}}},t.onerror=function(n){e._emitXhrError(t,new Error("tus: failed to resume upload"),n)},this._setupXHR(t),t.send(null)}},{key:"_startUpload",value:function(){var e=this;if(!this._aborted){var t=(0,Na.newRequest)();this.options.overridePatchMethod?(t.open("POST",this.url,!0),t.setRequestHeader("X-HTTP-Method-Override","PATCH")):t.open("PATCH",this.url,!0),t.onload=function(){if(sl(t.status,200)){var n=parseInt(t.getResponseHeader("Upload-Offset"),10);if(isNaN(n))e._emitXhrError(t,new Error("tus: invalid or missing offset value"));else{if(e._emitProgress(n,e._size),e._emitChunkComplete(n-e._offset,n,e._size),e._offset=n,n==e._size)return e.options.removeFingerprintOnSuccess&&e.options.resume&&tl.removeItem(e._fingerprint),e._emitSuccess(),void e._source.close();e._startUpload()}}else e._emitXhrError(t,new Error("tus: unexpected response while uploading chunk"))},t.onerror=function(n){e._aborted||e._emitXhrError(t,new Error("tus: failed to upload chunk at offset "+e._offset),n)},"upload"in t&&(t.upload.onprogress=function(t){t.lengthComputable&&e._emitProgress(n+t.loaded,e._size)}),this._setupXHR(t),t.setRequestHeader("Upload-Offset",this._offset),t.setRequestHeader("Content-Type","application/offset+octet-stream");var n=this._offset,r=this._offset+this.options.chunkSize;(r===1/0||r>this._size)&&(r=this._size),t.send(this._source.slice(n,r)),this._emitProgress(this._offset,this._size)}}}]),e}();function sl(e,t){return e>=t&&e<t+100}il.defaultOptions=ol,Ya.default=il;var al,ll=(al=Ya)&&al.__esModule?al:{default:al};ll.default.defaultOptions;if("undefined"!=typeof window){var ul=window,pl=ul.XMLHttpRequest,cl=ul.Blob;pl&&cl&&"function"==typeof cl.prototype.slice}else!0;var hl={Upload:ll.default},dl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},fl=d.Provider,yl=d.RequestClient,gl=d.Socket,ml={endpoint:"",resume:!0,onProgress:null,onChunkComplete:null,onSuccess:null,onError:null,headers:{},chunkSize:1/0,withCredentials:!1,uploadUrl:null,uploadSize:null,overridePatchMethod:!1,retryDelays:null};function vl(e){var t=[];return{on:function(n,r){return t.push([n,r]),e.on(n,r)},remove:function(){t.forEach(function(t){var n=t[0],r=t[1];e.off(n,r)})}}}var bl=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));return o.type="uploader",o.id="Tus",o.title="Tus",o.opts=dl({},{resume:!0,autoRetry:!0,useFastRemoteRetry:!0,limit:0,retryDelays:[0,1e3,3e3,5e3]},r),"number"==typeof o.opts.limit&&0!==o.opts.limit?o.limitUploads=oe(o.opts.limit):o.limitUploads=function(e){return e},o.uploaders=Object.create(null),o.uploaderEvents=Object.create(null),o.uploaderSockets=Object.create(null),o.handleResetProgress=o.handleResetProgress.bind(o),o.handleUpload=o.handleUpload.bind(o),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.handleResetProgress=function(){var e=dl({},this.uppy.getState().files);Object.keys(e).forEach(function(t){if(e[t].tus&&e[t].tus.uploadUrl){var n=dl({},e[t].tus);delete n.uploadUrl,e[t]=dl({},e[t],{tus:n})}}),this.uppy.setState({files:e})},t.prototype.resetUploaderReferences=function(e){this.uploaders[e]&&(this.uploaders[e].abort(),this.uploaders[e]=null),this.uploaderEvents[e]&&(this.uploaderEvents[e].remove(),this.uploaderEvents[e]=null),this.uploaderSockets[e]&&(this.uploaderSockets[e].close(),this.uploaderSockets[e]=null)},t.prototype.upload=function(e,t,n){var r=this;return this.resetUploaderReferences(e.id),new Promise(function(t,n){var o=dl({},ml,r.opts,e.tus||{});o.onError=function(t){r.uppy.log(t),r.uppy.emit("upload-error",e,t),t.message="Failed because: "+t.message,r.resetUploaderReferences(e.id),n(t)},o.onProgress=function(t,n){r.onReceiveUploadUrl(e,a.url),r.uppy.emit("upload-progress",e,{uploader:r,bytesUploaded:t,bytesTotal:n})},o.onSuccess=function(){r.uppy.emit("upload-success",e,a,a.url),a.url&&r.uppy.log("Download "+a.file.name+" from "+a.url),r.resetUploaderReferences(e.id),t(a)};var i=function(e,t,n){Object.prototype.hasOwnProperty.call(e,t)&&!Object.prototype.hasOwnProperty.call(e,n)&&(e[n]=e[t])},s=dl({},e.meta);i(s,"type","filetype"),i(s,"name","filename"),o.metadata=s;var a=new hl.Upload(e.data,o);r.uploaders[e.id]=a,r.uploaderEvents[e.id]=vl(r.uppy),r.onFileRemove(e.id,function(n){r.resetUploaderReferences(e.id),t("upload "+n+" was removed")}),r.onPause(e.id,function(e){e?a.abort():a.start()}),r.onPauseAll(e.id,function(){a.abort()}),r.onCancelAll(e.id,function(){r.resetUploaderReferences(e.id)}),r.onResumeAll(e.id,function(){e.error&&a.abort(),a.start()}),e.isPaused||a.start()})},t.prototype.uploadRemote=function(e,t,n){var r=this;this.resetUploaderReferences(e.id);var o=dl({},this.opts,e.tus||{});return new Promise(function(t,n){if(r.uppy.log(e.remote.url),e.serverToken)return r.connectToServerSocket(e).then(function(){return t()}).catch(n);r.uppy.emit("upload-started",e),new(e.remote.providerOptions.provider?fl:yl)(r.uppy,e.remote.providerOptions).post(e.remote.url,dl({},e.remote.body,{endpoint:o.endpoint,uploadUrl:o.uploadUrl,protocol:"tus",size:e.data.size,metadata:e.meta})).then(function(t){return r.uppy.setFileState(e.id,{serverToken:t.token}),e=r.uppy.getFile(e.id)}).then(function(e){return r.connectToServerSocket(e)}).then(function(){t()}).catch(function(e){n(new Error(e))})})},t.prototype.connectToServerSocket=function(e){var t=this;return new Promise(function(n,r){var o=e.serverToken,i=re(e.remote.serverUrl),s=new gl({target:i+"/api/"+o});t.uploaderSockets[e.id]=s,t.uploaderEvents[e.id]=vl(t.uppy),t.onFileRemove(e.id,function(){s.send("pause",{}),n("upload "+e.id+" was removed")}),t.onPause(e.id,function(e){e?s.send("pause",{}):s.send("resume",{})}),t.onPauseAll(e.id,function(){return s.send("pause",{})}),t.onCancelAll(e.id,function(){return s.send("pause",{})}),t.onResumeAll(e.id,function(){e.error&&s.send("pause",{}),s.send("resume",{})}),t.onRetry(e.id,function(){s.send("pause",{}),s.send("resume",{})}),t.onRetryAll(e.id,function(){s.send("pause",{}),s.send("resume",{})}),e.isPaused&&s.send("pause",{}),s.on("progress",function(n){return ne(t,n,e)}),s.on("error",function(n){var o=n.error.message,i=dl(new Error(o),{cause:n.error});t.opts.useFastRemoteRetry||(t.resetUploaderReferences(e.id),t.uppy.setFileState(e.id,{serverToken:null})),t.uppy.emit("upload-error",e,i),r(i)}),s.on("success",function(r){t.uppy.emit("upload-success",e,r,r.url),t.resetUploaderReferences(e.id),n()})})},t.prototype.onReceiveUploadUrl=function(e,t){var n=this.uppy.getFile(e.id);n&&(n.tus&&n.tus.uploadUrl===t||(this.uppy.log("[Tus] Storing upload url"),this.uppy.setFileState(n.id,{tus:dl({},n.tus,{uploadUrl:t})})))},t.prototype.onFileRemove=function(e,t){this.uploaderEvents[e].on("file-removed",function(n){e===n.id&&t(n.id)})},t.prototype.onPause=function(e,t){this.uploaderEvents[e].on("upload-pause",function(n,r){e===n&&t(r)})},t.prototype.onRetry=function(e,t){this.uploaderEvents[e].on("upload-retry",function(n){e===n&&t()})},t.prototype.onRetryAll=function(e,t){var n=this;this.uploaderEvents[e].on("retry-all",function(r){n.uppy.getFile(e)&&t()})},t.prototype.onPauseAll=function(e,t){var n=this;this.uploaderEvents[e].on("pause-all",function(){n.uppy.getFile(e)&&t()})},t.prototype.onCancelAll=function(e,t){var n=this;this.uploaderEvents[e].on("cancel-all",function(){n.uppy.getFile(e)&&t()})},t.prototype.onResumeAll=function(e,t){var n=this;this.uploaderEvents[e].on("resume-all",function(){n.uppy.getFile(e)&&t()})},t.prototype.uploadFiles=function(e){var t=this,n=e.map(function(n,r){var o=parseInt(r,10)+1,i=e.length;return n.error?function(){return Promise.reject(new Error(n.error))}:n.isRemote?(t.uppy.emit("upload-started",n),t.uploadRemote.bind(t,n,o,i)):(t.uppy.emit("upload-started",n),t.upload.bind(t,n,o,i))}).map(function(e){return t.limitUploads(e)()});return de(n)},t.prototype.handleUpload=function(e){var t=this;if(0===e.length)return this.uppy.log("Tus: no files to upload!"),Promise.resolve();this.uppy.log("Tus is uploading...");var n=e.map(function(e){return t.uppy.getFile(e)});return this.uploadFiles(n).then(function(){return null})},t.prototype.install=function(){this.uppy.setState({capabilities:dl({},this.uppy.getState().capabilities,{resumableUploads:!0})}),this.uppy.addUploader(this.handleUpload),this.uppy.on("reset-progress",this.handleResetProgress),this.opts.autoRetry&&this.uppy.on("back-online",this.uppy.retryAll)},t.prototype.uninstall=function(){this.uppy.setState({capabilities:dl({},this.uppy.getState().capabilities,{resumableUploads:!1})}),this.uppy.removeUploader(this.handleUpload),this.opts.autoRetry&&this.uppy.off("back-online",this.uppy.retryAll)},t}(Y.Plugin),wl={},Sl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function Cl(e,t){return{params:t.params,signature:t.signature,fields:t.fields}}var _l="https://api2.transloadit.com/companion",Pl=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/companion/,El=/https?:\/\/api2(?:-\w+)?\.transloadit\.com\/uppy-server/;(wl=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.type="uploader",o.id="Transloadit",o.title="Transloadit";var i={strings:{creatingAssembly:"Preparing upload...",creatingAssemblyFailed:"Transloadit: Could not create Assembly",encoding:"Encoding..."}},s={service:"https://api2.transloadit.com",waitForEncoding:!1,waitForMetadata:!1,alwaysRunAssembly:!1,importFromUploadURLs:!1,signature:null,params:null,fields:{},getAssemblyOptions:Cl,locale:i};o.opts=Sl({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o._prepareUpload=o._prepareUpload.bind(o),o._afterUpload=o._afterUpload.bind(o),o._handleError=o._handleError.bind(o),o._onFileUploadURLAvailable=o._onFileUploadURLAvailable.bind(o),o._onRestored=o._onRestored.bind(o),o._getPersistentData=o._getPersistentData.bind(o);var a=o.opts.getAssemblyOptions!==s.getAssemblyOptions;return o.opts.params?_a.validateParams(o.opts.params):a||_a.validateParams(null),o.client=new Ea({service:o.opts.service}),o.activeAssemblies={},o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype._attachAssemblyMetadata=function(e,t){var n=Sl({},e.meta,{assembly_url:t.assembly_url,filename:e.name,fieldname:"file"}),r=Sl({},e.tus,{endpoint:t.tus_url}),o=e.remote;if(e.remote&&El.test(e.remote.serverUrl)){var i=new Error("The https://api2.transloadit.com/uppy-server endpoint was renamed to https://api2.transloadit.com/companion, please update your `serverUrl` options accordingly.");throw this.uppy.log(i),i}if(e.remote&&Pl.test(e.remote.serverUrl)){var s=t.companion_url.replace(/\/$/,""),a=e.remote.url.replace(e.remote.serverUrl,"").replace(/^\//,"");o=Sl({},e.remote,{serverUrl:s,url:s+"/"+a})}var l=Sl({},e,{transloadit:{assembly:t.assembly_id}});return this.opts.importFromUploadURLs||Sl(l,{meta:n,tus:r,remote:o}),l},t.prototype._createAssembly=function(e,t,n){var r=this;return this.uppy.log("[Transloadit] create Assembly"),this.client.createAssembly({params:n.params,fields:n.fields,expectedFiles:e.length,signature:n.signature}).then(function(n){var o,i,s=new Sa(n),a=s.status,l=r.getPluginState(),u=l.assemblies,p=l.uploadsAssemblies;r.setPluginState({assemblies:Sl({},u,(o={},o[a.assembly_id]=a,o)),uploadsAssemblies:Sl({},p,(i={},i[t]=[].concat(p[t],[a.assembly_id]),i))});var c=r.uppy.getState().files,h={};return e.forEach(function(e){h[e]=r._attachAssemblyMetadata(r.uppy.getFile(e),a)}),r.uppy.setState({files:Sl({},c,h)}),r.uppy.emit("transloadit:assembly-created",a,e),r._connectAssembly(s),r.uppy.log("[Transloadit] Created Assembly "+a.assembly_id),s}).catch(function(e){throw e.message=r.i18n("creatingAssemblyFailed")+": "+e.message,e})},t.prototype._shouldWaitAfterUpload=function(){return this.opts.waitForEncoding||this.opts.waitForMetadata},t.prototype._reserveFiles=function(e,t){var n=this;return Promise.all(t.map(function(t){var r=n.uppy.getFile(t);return n.client.reserveFile(e,r)}))},t.prototype._onFileUploadURLAvailable=function(e){var t=this;if(e&&e.transloadit&&e.transloadit.assembly){var n=this.getPluginState().assemblies[e.transloadit.assembly];this.client.addFile(n,e).catch(function(r){t.uppy.log(r),t.uppy.emit("transloadit:import-error",n,e.id,r)})}},t.prototype._findFile=function(e){for(var t=this.uppy.getFiles(),n=0;n<t.length;n++){var r=t[n];if(r.uploadURL===e.tus_upload_url)return r;if(r.tus&&r.tus.uploadUrl===e.tus_upload_url)return r;if(!e.is_tus_file&&r.name===e.name&&r.size===e.size)return r}},t.prototype._onFileUploadComplete=function(e,t){var n,r=this.getPluginState(),o=this._findFile(t);o?(this.setPluginState({files:Sl({},r.files,(n={},n[t.id]={assembly:e,id:o.id,uploadedFile:t},n))}),this.uppy.emit("transloadit:upload",t,this.getAssembly(e))):this.uppy.log("[Transloadit] Couldn\u2019t file the file, it was likely removed in the process")},t.prototype._onResult=function(e,t,n){var r=this.getPluginState(),o=r.files[n.original_id];n.localId=o?o.id:null;var i={result:n,stepName:t,id:n.id,assembly:e};this.setPluginState({results:[].concat(r.results,[i])}),this.uppy.emit("transloadit:result",t,n,this.getAssembly(e))},t.prototype._onAssemblyFinished=function(e){var t=this,n=e.assembly_ssl_url;this.client.getAssemblyStatus(n).then(function(e){var n,r=t.getPluginState();t.setPluginState({assemblies:Sl({},r.assemblies,(n={},n[e.assembly_id]=e,n))}),t.uppy.emit("transloadit:complete",e)})},t.prototype._getPersistentData=function(e){var t,n=this.getPluginState(),r=n.assemblies,o=n.uploadsAssemblies;e(((t={})[this.id]={assemblies:r,uploadsAssemblies:o},t))},t.prototype._onRestored=function(e){var t=this,n=e&&e[this.id]?e[this.id]:{},r=n.assemblies||{},o=n.uploadsAssemblies||{};0!==Object.keys(o).length&&(this.restored=Promise.resolve().then(function(){var e,n,i;return e=r,n={},i=[],Object.keys(e).forEach(function(r){var o=e[r];o.uploads.forEach(function(e){var o=t._findFile(e);n[e.id]={id:o.id,assembly:r,uploadedFile:e}});var s=t.getPluginState();Object.keys(o.results).forEach(function(e){o.results[e].forEach(function(t){var n=s.files[t.original_id];t.localId=n?n.id:null,i.push({id:t.id,result:t,stepName:e,assembly:r})})})}),t.setPluginState({assemblies:e,files:n,results:i,uploadsAssemblies:o}),function(){var e=t.getPluginState().assemblies;Object.keys(e).forEach(function(n){var r=new Sa(e[n]);t._connectAssembly(r)})}(),function(){var e=t.getPluginState().assemblies;return Promise.all(Object.keys(e).map(function(e){return t.activeAssemblies[e].update()}))}()}),this.restored.then(function(){t.restored=null}))},t.prototype._connectAssembly=function(e){var t=this,n=e.status.assembly_id;return this.activeAssemblies[n]=e,e.on("status",function(e){var r,o=t.getPluginState().assemblies;t.setPluginState({assemblies:Sl({},o,(r={},r[n]=e,r))})}),e.on("upload",function(e){t._onFileUploadComplete(n,e)}),e.on("error",function(n){t.uppy.emit("transloadit:assembly-error",e.status,n)}),e.on("executing",function(){t.uppy.emit("transloadit:assembly-executing",e.status)}),this.opts.waitForEncoding&&e.on("result",function(e,r){t._onResult(n,e,r)}),this.opts.waitForEncoding?e.on("finished",function(){t._onAssemblyFinished(e.status)}):this.opts.waitForMetadata&&e.on("metadata",function(){t._onAssemblyFinished(e.status)}),"ASSEMBLY_COMPLETE"===e.ok?e:(new Promise(function(t,n){e.once("connect",t),e.once("status",t),e.once("error",n)}).then(function(){t.uppy.log("[Transloadit] Socket is ready")}),e.connect(),e)},t.prototype._prepareUpload=function(e,t){var n,r=this;(e=e.filter(function(e){return!e.error})).forEach(function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-progress",t,{mode:"indeterminate",message:r.i18n("creatingAssembly")})});var o=function(e){var n=e.fileIDs,o=e.options;return r._createAssembly(n,t,o).then(function(e){if(r.opts.importFromUploadURLs)return r._reserveFiles(e,n)}).then(function(){n.forEach(function(e){var t=r.uppy.getFile(e);r.uppy.emit("preprocess-complete",t)})}).catch(function(e){throw n.forEach(function(t){var n=r.uppy.getFile(t);r.uppy.emit("preprocess-complete",n),r.uppy.emit("upload-error",n,e)}),e})},i=this.getPluginState().uploadsAssemblies;this.setPluginState({uploadsAssemblies:Sl({},i,(n={},n[t]=[],n))});var s=e.map(function(e){return r.uppy.getFile(e)});return new _a(s,this.opts).build().then(function(e){return Promise.all(e.map(o))},function(t){throw e.forEach(function(e){var n=r.uppy.getFile(e);r.uppy.emit("preprocess-complete",n),r.uppy.emit("upload-error",n,t)}),t})},t.prototype._afterUpload=function(e,t){var n=this;e=e.filter(function(e){return!e.error});var r=this.getPluginState();if(this.restored)return this.restored.then(function(){return n._afterUpload(e,t)});var o=r.uploadsAssemblies[t];if(!this._shouldWaitAfterUpload()){o.forEach(function(e){n.activeAssemblies[e].close(),delete n.activeAssemblies[e]});var i=o.map(function(e){return n.getAssembly(e)});return this.uppy.addResultData(t,{transloadit:i}),Promise.resolve()}if(0===o.length)return this.uppy.addResultData(t,{transloadit:[]}),Promise.resolve();var s=new Pa(this.uppy,o);return e.forEach(function(e){var t=n.uppy.getFile(e);n.uppy.emit("postprocess-progress",t,{mode:"indeterminate",message:n.i18n("encoding")})}),s.on("assembly-complete",function(e){n.getAssemblyFiles(e).forEach(function(e){n.uppy.emit("postprocess-complete",e)})}),s.on("assembly-error",function(e,t){n.getAssemblyFiles(e).forEach(function(e){n.uppy.emit("upload-error",e,t),n.uppy.emit("postprocess-complete",e)})}),s.promise.then(function(){var e=o.map(function(e){return n.getAssembly(e)}),r=n.getPluginState(),i=Sl({},r.uploadsAssemblies);delete i[t],n.setPluginState({uploadsAssemblies:i}),n.uppy.addResultData(t,{transloadit:e})})},t.prototype._handleError=function(e,t){var n=this;this.uppy.log("[Transloadit] _handleError in upload "+t),this.uppy.log(e),this.getPluginState().uploadsAssemblies[t].forEach(function(e){n.activeAssemblies[e]&&n.activeAssemblies[e].close()})},t.prototype.install=function(){this.uppy.addPreProcessor(this._prepareUpload),this.uppy.addPostProcessor(this._afterUpload),this.uppy.on("error",this._handleError),this.opts.importFromUploadURLs?this.uppy.on("upload-success",this._onFileUploadURLAvailable):this.uppy.use(bl,{resume:!1,useFastRemoteRetry:!1,metaFields:["assembly_url","filename","fieldname"]}),this.uppy.on("restore:get-data",this._getPersistentData),this.uppy.on("restored",this._onRestored),this.setPluginState({assemblies:{},uploadsAssemblies:{},files:{},results:[]})},t.prototype.uninstall=function(){this.uppy.removePreProcessor(this._prepareUpload),this.uppy.removePostProcessor(this._afterUpload),this.uppy.off("error",this._handleError),this.opts.importFromUploadURLs&&this.uppy.off("upload-success",this._onFileUploadURLAvailable)},t.prototype.getAssembly=function(e){return this.getPluginState().assemblies[e]},t.prototype.getAssemblyFiles=function(e){return this.uppy.getFiles().filter(function(t){return t&&t.transloadit&&t.transloadit.assembly===e})},t}(Y.Plugin)).COMPANION=_l,wl.UPPY_SERVER=_l,wl.COMPANION_PATTERN=/\.transloadit\.com$/;var Fl=U.h,kl=function(e){function t(n){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var r=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n));return r.handleKeyPress=r.handleKeyPress.bind(r),r.handleClick=r.handleClick.bind(r),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){var e=this;this.input.value="",setTimeout(function(){e.input&&e.input.focus({preventScroll:!0})},150)},t.prototype.handleKeyPress=function(e){13===e.keyCode&&this.props.addFile(this.input.value)},t.prototype.handleClick=function(){this.props.addFile(this.input.value)},t.prototype.render=function(){var e=this;return Fl("div",{class:"uppy-Url"},Fl("input",{class:"uppy-c-textInput uppy-Url-input",type:"text","aria-label":this.props.i18n("enterUrlToImport"),placeholder:this.props.i18n("enterUrlToImport"),onkeyup:this.handleKeyPress,ref:function(t){e.input=t}}),Fl("button",{class:"uppy-u-reset uppy-c-btn uppy-c-btn-primary uppy-Url-importButton",type:"button",onclick:this.handleClick},this.props.i18n("import")))},t}(U.Component),Al=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Tl=Y.Plugin,Ol=U.h,Ul=d.RequestClient,xl=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.id=o.opts.id||"Url",o.title=o.opts.title||"Link",o.type="acquirer",o.icon=function(){return Ol("svg",{"aria-hidden":"true",width:"23",height:"23",viewBox:"0 0 23 23",xmlns:"http://www.w3.org/2000/svg"},Ol("path",{d:"M20.485 11.236l-2.748 2.737c-.184.182-.367.365-.642.547-1.007.73-2.107 1.095-3.298 1.095-1.65 0-3.298-.73-4.398-2.19-.275-.365-.183-1.003.183-1.277.367-.273 1.008-.182 1.283.183 1.191 1.642 3.482 1.915 5.13.73a.714.714 0 0 0 .367-.365l2.75-2.737c1.373-1.46 1.373-3.74-.093-5.108a3.72 3.72 0 0 0-5.13 0L12.33 6.4a.888.888 0 0 1-1.283 0 .88.88 0 0 1 0-1.277l1.558-1.55a5.38 5.38 0 0 1 7.605 0c2.29 2.006 2.382 5.564.274 7.662zm-8.979 6.294L9.95 19.081a3.72 3.72 0 0 1-5.13 0c-1.467-1.368-1.467-3.74-.093-5.108l2.75-2.737.366-.365c.824-.547 1.74-.82 2.748-.73 1.008.183 1.833.639 2.382 1.46.275.365.917.456 1.283.182.367-.273.458-.912.183-1.277-.916-1.186-2.199-1.915-3.573-2.098-1.374-.273-2.84.091-4.031 1.004l-.55.547-2.749 2.737c-2.107 2.189-2.015 5.655.092 7.753C4.727 21.453 6.101 22 7.475 22c1.374 0 2.749-.547 3.848-1.55l1.558-1.551a.88.88 0 0 0 0-1.278c-.367-.364-1.008-.456-1.375-.09z",fill:"#FF814F","fill-rule":"nonzero"}))};var i={strings:{import:"Import",enterUrlToImport:"Enter URL to import a file",failedToFetch:"Companion failed to fetch this URL, please make sure it\u2019s correct",enterCorrectUrl:"Incorrect URL: Please make sure you are entering a direct link to a file"}},s={locale:i};if(o.opts=Al({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.hostname=o.opts.serverUrl,!o.hostname)throw new Error("Companion hostname is required, please consult https://uppy.io/docs/companion");return o.getMeta=o.getMeta.bind(o),o.addFile=o.addFile.bind(o),o.handleDrop=o.handleDrop.bind(o),o.handleDragOver=o.handleDragOver.bind(o),o.handleDragLeave=o.handleDragLeave.bind(o),o.handlePaste=o.handlePaste.bind(o),o.client=new Ul(n,{serverUrl:o.opts.serverUrl,serverHeaders:o.opts.serverHeaders}),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.getFileNameFromUrl=function(e){return e.substring(e.lastIndexOf("/")+1)},t.prototype.checkIfCorrectURL=function(e){if(!e)return!1;var t=e.match(/^([a-z0-9]+):\/\//)[1];return"http"===t||"https"===t},t.prototype.addProtocolToURL=function(e){return/^[a-z0-9]+:\/\//.test(e)?e:"http://"+e},t.prototype.getMeta=function(e){var t=this;return this.client.post("url/meta",{url:e}).then(function(e){if(e.error)throw t.uppy.log("[URL] Error:"),t.uppy.log(e.error),new Error("Failed to fetch the file");return e})},t.prototype.addFile=function(e){var t=this;return e=this.addProtocolToURL(e),this.checkIfCorrectURL(e)?this.getMeta(e).then(function(n){return{source:t.id,name:t.getFileNameFromUrl(e),type:n.type,data:{size:n.size},isRemote:!0,body:{url:e},remote:{serverUrl:t.opts.serverUrl,url:t.hostname+"/url/get",body:{fileId:e,url:e},providerOptions:t.client.opts}}}).then(function(e){t.uppy.log("[Url] Adding remote file");try{t.uppy.addFile(e)}catch(e){}}).then(function(){}).catch(function(e){t.uppy.log(e),t.uppy.info({message:t.i18n("failedToFetch"),details:e},"error",4e3)}):(this.uppy.log("[URL] Incorrect URL entered: "+e),void this.uppy.info(this.i18n("enterCorrectUrl"),"error",4e3))},t.prototype.handleDrop=function(e){var t=this;e.preventDefault(),e.dataTransfer.items&&_n(e.dataTransfer.items).forEach(function(e){"string"===e.kind&&"text/uri-list"===e.type&&e.getAsString(function(e){t.uppy.log("[URL] Adding file from dropped url: "+e),t.addFile(e)})})},t.prototype.handleDragOver=function(e){e.preventDefault(),this.el.classList.add("drag")},t.prototype.handleDragLeave=function(e){e.preventDefault(),this.el.classList.remove("drag")},t.prototype.handlePaste=function(e){var t=this;if(e.clipboardData.items){var n=_n(e.clipboardData.items);n.filter(function(e){return"file"===e.kind}).length>0||n.forEach(function(e){"string"===e.kind&&"text/plain"===e.type&&e.getAsString(function(e){t.uppy.log("[URL] Adding file from pasted url: "+e),t.addFile(e)})})}},t.prototype.render=function(e){return Ol(kl,{i18n:this.i18n,addFile:this.addFile})},t.prototype.onMount=function(){this.el&&(this.el.addEventListener("drop",this.handleDrop),this.el.addEventListener("dragover",this.handleDragOver),this.el.addEventListener("dragleave",this.handleDragLeave),this.el.addEventListener("paste",this.handlePaste))},t.prototype.install=function(){var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.el&&(this.el.removeEventListener("drop",this.handleDrop),this.el.removeEventListener("dragover",this.handleDragOver),this.el.removeEventListener("dragleave",this.handleDragLeave),this.el.removeEventListener("paste",this.handlePaste)),this.unmount()},t}(Tl),Rl={"video/ogg":"ogv","audio/ogg":"ogg","video/webm":"webm","audio/webm":"webm","video/x-matroska":"mkv","video/mp4":"mp4","audio/mp3":"mp3"},Dl=U.h,Bl=function(e){return Dl("svg",{"aria-hidden":"true",fill:"#0097DC",width:"66",height:"55",viewBox:"0 0 66 55",xmlns:"http://www.w3.org/2000/svg"},Dl("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","fill-rule":"evenodd"}))},jl=U.h,Il=U.h,Ll=U.h;function Ml(e,t){return-1!==e.indexOf(t)}var Nl=function(e){function t(){return function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.apply(this,arguments))}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.componentDidMount=function(){this.props.onFocus(),this.btnContainer.firstChild.focus()},t.prototype.componentWillUnmount=function(){this.props.onStop()},t.prototype.render=function(){var e,t,n,r=this,o=this.props.supportsRecording&&(Ml(this.props.modes,"video-only")||Ml(this.props.modes,"audio-only")||Ml(this.props.modes,"video-audio")),i=Ml(this.props.modes,"picture");return Ll("div",{class:"uppy uppy-Webcam-container"},Ll("div",{class:"uppy-Webcam-videoContainer"},Ll("video",{class:"uppy-Webcam-video "+(this.props.mirror?"uppy-Webcam-video--mirrored":""),autoplay:!0,muted:!0,playsinline:!0,srcObject:this.props.src||""})),Ll("div",{class:"uppy-Webcam-buttonContainer",ref:function(e){r.btnContainer=e}},i?(e=this.props,t=e.onSnapshot,n=e.i18n,Il("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--picture",type:"button",title:n("takePicture"),"aria-label":n("takePicture"),onclick:t},Bl())):null," ",o?function(e){var t=e.recording,n=e.onStartRecording,r=e.onStopRecording,o=e.i18n;return console.log("is recording",t),t?jl("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video",type:"button",title:o("stopRecording"),"aria-label":o("stopRecording"),onclick:r},jl("svg",{"aria-hidden":"true",class:"UppyIcon",width:"100",height:"100",viewBox:"0 0 100 100"},jl("rect",{x:"15",y:"15",width:"70",height:"70"}))):jl("button",{class:"uppy-u-reset uppy-c-btn uppy-Webcam-button uppy-Webcam-button--video",type:"button",title:o("startRecording"),"aria-label":o("startRecording"),onclick:n},jl("svg",{"aria-hidden":"true",class:"UppyIcon",width:"100",height:"100",viewBox:"0 0 100 100"},jl("circle",{cx:"50",cy:"50",r:"40"})))}(this.props):null))},t}(U.Component),zl=U.h,ql=function(e){return zl("div",{class:"uppy-Webcam-permissons"},zl("div",{class:"uppy-Webcam-permissonsIcon"},e.icon()),zl("h1",{class:"uppy-Webcam-title"},e.i18n("allowAccessTitle")),zl("p",null,e.i18n("allowAccessDescription")))},Hl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wl=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xl=U.h,Gl=function(e){function t(n,r){!function(e,n){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this);var o=function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,n,r));o.mediaDevices=function(){if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)return navigator.mediaDevices;var e=navigator.mozGetUserMedia||navigator.webkitGetUserMedia;return e?{getUserMedia:function(t){return new Promise(function(n,r){e.call(navigator,t,n,r)})}}:null}(),o.supportsUserMedia=!!o.mediaDevices,o.protocol=location.protocol.match(/https/i)?"https":"http",o.id=o.opts.id||"Webcam",o.title=o.opts.title||"Camera",o.type="acquirer",o.icon=Bl;var i={strings:{smile:"Smile!",takePicture:"Take a picture",startRecording:"Begin video recording",stopRecording:"Stop video recording",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."}},s={onBeforeSnapshot:function(){return Promise.resolve()},countdown:!1,locale:i,modes:["video-audio","video-only","audio-only","picture"],mirror:!0,facingMode:"user"};return o.opts=Wl({},s,r),o.translator=new H([i,o.uppy.locale,o.opts.locale]),o.i18n=o.translator.translate.bind(o.translator),o.i18nArray=o.translator.translateArray.bind(o.translator),o.install=o.install.bind(o),o.setPluginState=o.setPluginState.bind(o),o.render=o.render.bind(o),o.start=o.start.bind(o),o.stop=o.stop.bind(o),o.takeSnapshot=o.takeSnapshot.bind(o),o.startRecording=o.startRecording.bind(o),o.stopRecording=o.stopRecording.bind(o),o.oneTwoThreeSmile=o.oneTwoThreeSmile.bind(o),o.focus=o.focus.bind(o),o.webcamActive=!1,o.opts.countdown&&(o.opts.onBeforeSnapshot=o.oneTwoThreeSmile),o}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}(t,e),t.prototype.isSupported=function(){return!!this.mediaDevices},t.prototype.getConstraints=function(){return{audio:-1!==this.opts.modes.indexOf("video-audio")||-1!==this.opts.modes.indexOf("audio-only"),video:!(-1===this.opts.modes.indexOf("video-audio")&&-1===this.opts.modes.indexOf("video-only")&&-1===this.opts.modes.indexOf("picture"))&&{facingMode:this.opts.facingMode}}},t.prototype.start=function(){var e=this;if(!this.isSupported())return Promise.reject(new Error("Webcam access not supported"));this.webcamActive=!0;var t=this.getConstraints();return this.mediaDevices.getUserMedia(t).then(function(t){e.stream=t,e.setPluginState({cameraReady:!0})}).catch(function(t){e.setPluginState({cameraError:t})})},t.prototype.startRecording=function(){var e=this;this.recorder=new MediaRecorder(this.stream),this.recordingChunks=[],this.recorder.addEventListener("dataavailable",function(t){e.recordingChunks.push(t.data)}),this.recorder.start(),this.setPluginState({isRecording:!0})},t.prototype.stopRecording=function(){var e=this;return new Promise(function(t,n){e.recorder.addEventListener("stop",function(){t()}),e.recorder.stop()}).then(function(){return e.setPluginState({isRecording:!1}),e.getVideo()}).then(function(t){try{e.uppy.addFile(t)}catch(e){}}).then(function(){e.recordingChunks=null,e.recorder=null},function(t){throw e.recordingChunks=null,e.recorder=null,t})},t.prototype.stop=function(){this.stream.getAudioTracks().forEach(function(e){e.stop()}),this.stream.getVideoTracks().forEach(function(e){e.stop()}),this.webcamActive=!1,this.stream=null},t.prototype.getVideoElement=function(){return this.el.querySelector(".uppy-Webcam-video")},t.prototype.oneTwoThreeSmile=function(){var e=this;return new Promise(function(t,n){var r=e.opts.countdown,o=setInterval(function(){if(!e.webcamActive)return clearInterval(o),e.captureInProgress=!1,n(new Error("Webcam is not active"));r>0?(e.uppy.info(r+"...","warning",800),r--):(clearInterval(o),e.uppy.info(e.i18n("smile"),"success",1500),setTimeout(function(){return t()},1500))},1e3)})},t.prototype.takeSnapshot=function(){var e=this;this.captureInProgress||(this.captureInProgress=!0,this.opts.onBeforeSnapshot().catch(function(t){var n="object"===(void 0===t?"undefined":Hl(t))?t.message:t;return e.uppy.info(n,"error",5e3),Promise.reject(new Error("onBeforeSnapshot: "+n))}).then(function(){return e.getImage()}).then(function(t){e.captureInProgress=!1;try{e.uppy.addFile(t)}catch(e){}},function(t){throw e.captureInProgress=!1,t}))},t.prototype.getImage=function(){var e=this,t=this.getVideoElement();if(!t)return Promise.reject(new Error("No video element found, likely due to the Webcam tab being closed."));var n="webcam-"+Date.now()+".jpg",r=t.videoWidth,o=t.videoHeight,i=document.createElement("canvas");return i.width=r,i.height=o,i.getContext("2d").drawImage(t,0,0),function(e,t,n){return e.toBlob?new Promise(function(r){e.toBlob(r,t,n)}):Promise.resolve().then(function(){return gn(e.toDataURL(t,n),{})})}(i,"image/jpeg").then(function(t){return{source:e.id,name:n,data:new Blob([t],{type:"image/jpeg"}),type:"image/jpeg"}})},t.prototype.getVideo=function(){var e=this.recordingChunks[0].type,t=function(e){return e=e.replace(/;.*$/,""),Rl[e]||null}(e);if(!t)return Promise.reject(new Error('Could not retrieve recording: Unsupported media type "'+e+'"'));var n="webcam-"+Date.now()+"."+t,r=new Blob(this.recordingChunks,{type:e}),o={source:this.id,name:n,data:new Blob([r],{type:e}),type:e};return Promise.resolve(o)},t.prototype.focus=function(){var e=this;this.opts.countdown||setTimeout(function(){e.uppy.info(e.i18n("smile"),"success",1500)},1e3)},t.prototype.render=function(e){this.webcamActive||this.start();var t=this.getPluginState();return t.cameraReady?Xl(Nl,Wl({},t,{onSnapshot:this.takeSnapshot,onStartRecording:this.startRecording,onStopRecording:this.stopRecording,onFocus:this.focus,onStop:this.stop,i18n:this.i18n,modes:this.opts.modes,supportsRecording:"function"==typeof MediaRecorder&&!!MediaRecorder.prototype&&"function"==typeof MediaRecorder.prototype.start,recording:t.isRecording,mirror:this.opts.mirror,src:this.stream})):Xl(ql,{icon:Bl,i18n:this.i18n})},t.prototype.install=function(){this.setPluginState({cameraReady:!1});var e=this.opts.target;e&&this.mount(e,this)},t.prototype.uninstall=function(){this.stream&&this.stop(),this.unmount()},t}(Y.Plugin),Vl={};return Vl.Core=Y,Vl.server=d,Vl.views={ProviderView:ir},Vl.DefaultStore=z,Vl.ReduxStore=Vr,Vl.Dashboard=Tn,Vl.DragDrop=Rn,Vl.FileInput=dr,Vl.Informer=Gt,Vl.ProgressBar=lo,Vl.StatusBar=yn,Vl.Dropbox=ur,Vl.GoogleDrive=eo,Vl.Instagram=oo,Vl.Url=xl,Vl.Webcam=Gl,Vl.AwsS3=Ae,Vl.AwsS3Multipart=ce,Vl.Transloadit=wl,Vl.Tus=bl,Vl.XHRUpload=ve,Vl.Form=kr,Vl.GoldenRetriever=Yr,Vl.ReduxDevTools=po,Vl.ThumbnailGenerator=wn,Vl});
|
2
|
+
//# sourceMappingURL=uppy.min.js.map
|