text: !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.InputFile=t():e.InputFile=t()}("undefined"!=typeof self?self:this,function(){return function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=0)}([function(e,t,n){"use strict";function r(e){return(r="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})(e)}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function u(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)}}function i(e,t,n){return t&&u(e.prototype,t),n&&u(e,n),e}function l(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?p(e):t}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&f(e,t)}function f(e,t){return(f=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}Object.defineProperty(t,"__esModule",{value:!0});var s=n(1),y=n.n(s),d=n(4),m=n.n(d),b=n(7),h=n(8),v=function(e){function t(){var e;return o(this,t),e=l(this,a(t).call(this)),e.state={},e.onChange=e.onChange.bind(p(p(e))),e.onDrop=e.onDrop.bind(p(p(e))),e.onDragOver=e.onDragOver.bind(p(p(e))),e.output=e.output.bind(p(p(e))),e}return c(t,e),i(t,[{key:"onChange",value:function(e){var t=this,n=this.props,r=n.onComplete,o=n.multiple,u=n.output,i=n.onError,l=Array.from(e.target.files).filter(function(e){return"ANY"===u||e.type===h.a[u].mimeType});l.length?Promise.all(l.map(function(e){return t.readFile(e)})).then(function(e){return t.output(e)}).catch(function(e){return i(e)}):r(o?[]:null)}},{key:"onDrop",value:function(e){var t=this;e.preventDefault();var n=this.props,r=n.onComplete,o=n.multiple,u=n.output,i=n.onError,l=Array.from(e.dataTransfer.files).filter(function(e){return"ANY"===u||e.type===h.a[u].mimeType});l.length?Promise.all(l.map(function(e){return t.readFile(e)})).then(function(e){return t.output(e)}).catch(function(e){return i(e)}):r(o?[]:null)}},{key:"onDragOver",value:function(e){e.preventDefault()}},{key:"output",value:function(e){var t=this.props,n=t.onComplete,r=t.multiple,o=t.output,u=t.onError;try{var i=e.map(function(e){return h.a[o].transform(e)});n(r?i:i[0]||null)}catch(e){u(e)}}},{key:"readFile",value:function(e){var t=this.props,n=t.readAs,r=t.onProgress;return"NO_READ"===n?Promise.resolve(e):new Promise(function(t,o){var u=new FileReader;switch(u.onload=function(e){t(e.target.result)},u.onerror=function(e){u.abort(),o(new Error("Error loading file."))},u.onprogress=function(e){r({porcentage:e.lengthComputable?Math.round(e.loaded/e.total*100):0,bits:e.loaded})},n){case"ARRAY_BUFFER":u.readAsArrayBuffer(e);break;case"BINARY_STRING":u.readAsBinaryString(e);break;case"DATA_URL":u.readAsDataURL(e);break;default:u.readAsText(e)}})}},{key:"render",value:function(){var e=this.props,t=e.multiple,n=e.children,r=e.output,o=e.noDrop,u=e.noClick,i=Math.random(),l=t?"Upload files":"Upload file",a="ANY"!==r?h.a[r].accept:void 0;return y.a.createElement("label",{htmlFor:i,"aria-label":l,style:b.a.button({children:n,noClick:u}),onDragOver:o?null:this.onDragOver,onDrop:o?null:this.onDrop,onClick:function(e){return u&&e.preventDefault()}},n||l,y.a.createElement("input",{id:i,type:"file",multiple:t,style:b.a.input(),onChange:this.onChange,accept:a}))}}]),t}(s.PureComponent);v.propTypes={multiple:m.a.bool,children:m.a.object,onComplete:m.a.func.isRequired,onProgress:m.a.func,onError:m.a.func,output:m.a.oneOf(["ANY","JSON","IMG"]),readAs:m.a.oneOf(["TEXT","DATA_URL","BINARY_STRING","ARRAY_BUFFER"]),noDrop:m.a.bool,noClick:m.a.bool},v.defaultProps={multiple:!1,children:null,output:"ANY",readAs:"TEXT",noDrop:!1,noClick:!1,onError:function(e){return console.error(e)},onProgress:function(){}},t.default=v},function(e,t,n){"use strict";e.exports=n(2)},function(e,t,n){"use strict";function r(e,t,n,r,o,u,i,l){if(!e){if(e=void 0,void 0===t)e=Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=[n,r,o,u,i,l],c=0;e=Error(t.replace(/%s/g,function(){return a[c++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function o(e){for(var t=arguments.length-1,n="https://reactjs.org/docs/error-decoder.html?invariant="+e,o=0;o<t;o++)n+="&args[]="+encodeURIComponent(arguments[o+1]);r(!1,"Minified React error #"+e+"; visit %s for the full message or use the non-minified dev environment for full errors and additional helpful warnings. ",n)}function u(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||N}function i(){}function l(e,t,n){this.props=e,this.context=t,this.refs=F,this.updater=n||N}function a(e,t,n){var r=void 0,o={},u=null,i=null;if(null!=t)for(r in void 0!==t.ref&&(i=t.ref),void 0!==t.key&&(u=""+t.key),t)Y.call(t,r)&&!M.hasOwnProperty(r)&&(o[r]=t[r]);var l=arguments.length-2;if(1===l)o.children=n;else if(1<l){for(var a=Array(l),c=0;c<l;c++)a[c]=arguments[c+2];o.children=a}if(e&&e.defaultProps)for(r in l=e.defaultProps)void 0===o[r]&&(o[r]=l[r]);return{$$typeof:j,type:e,key:u,ref:i,props:o,_owner:U.current}}function c(e,t){return{$$typeof:j,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function f(e){return"object"==typeof e&&null!==e&&e.$$typeof===j}function p(e){var t={"=":"=0",":":"=2"};return"$"+(""+e).replace(/[=:]/g,function(e){return t[e]})}function s(e,t,n,r){if(B.length){var o=B.pop();return o.result=e,o.keyPrefix=t,o.func=n,o.context=r,o.count=0,o}return{result:e,keyPrefix:t,func:n,context:r,count:0}}function y(e){e.result=null,e.keyPrefix=null,e.func=null,e.context=null,e.count=0,10>B.length&&B.push(e)}function d(e,t,n,r){var u=typeof e;"undefined"!==u&&"boolean"!==u||(e=null);var i=!1;if(null===e)i=!0;else switch(u){case"string":case"number":i=!0;break;case"object":switch(e.$$typeof){case j:case k:i=!0}}if(i)return n(r,e,""===t?"."+b(e,0):t),1;if(i=0,t=""===t?".":t+":",Array.isArray(e))for(var l=0;l<e.length;l++){u=e[l];var a=t+b(u,l);i+=d(u,a,n,r)}else if(null===e||"object"!=typeof e?a=null:(a=$&&e[$]||e["@@iterator"],a="function"==typeof a?a:null),"function"==typeof a)for(e=a.call(e),l=0;!(u=e.next()).done;)u=u.value,a=t+b(u,l++),i+=d(u,a,n,r);else"object"===u&&(n=""+e,o("31","[object Object]"===n?"object with keys {"+Object.keys(e).join(", ")+"}":n,""));return i}function m(e,t,n){return null==e?0:d(e,"",t,n)}function b(e,t){return"object"==typeof e&&null!==e&&null!=e.key?p(e.key):t.toString(36)}function h(e,t){e.func.call(e.context,t,e.count++)}function v(e,t,n){var r=e.result,o=e.keyPrefix;e=e.func.call(e.context,t,e.count++),Array.isArray(e)?g(e,r,n,function(e){return e}):null!=e&&(f(e)&&(e=c(e,o+(!e.key||t&&t.key===e.key?"":(""+e.key).replace(q,"$&/")+"/")+n)),r.push(e))}function g(e,t,n,r,o){var u="";null!=n&&(u=(""+n).replace(q,"$&/")+"/"),t=s(t,u,r,o),m(e,v,t),y(t)}/** @license React v16.7.0
   * react.production.min.js
   *
   * Copyright (c) Facebook, Inc. and its affiliates.
   *
   * This source code is licensed under the MIT license found in the
   * LICENSE file in the root directory of this source tree.
   */
  var O=n(3),_="function"==typeof Symbol&&Symbol.for,j=_?Symbol.for("react.element"):60103,k=_?Symbol.for("react.portal"):60106,S=_?Symbol.for("react.fragment"):60107,P=_?Symbol.for("react.strict_mode"):60108,w=_?Symbol.for("react.profiler"):60114,E=_?Symbol.for("react.provider"):60109,x=_?Symbol.for("react.context"):60110,C=_?Symbol.for("react.concurrent_mode"):60111,A=_?Symbol.for("react.forward_ref"):60112,R=_?Symbol.for("react.suspense"):60113,T=_?Symbol.for("react.memo"):60115,D=_?Symbol.for("react.lazy"):60116,$="function"==typeof Symbol&&Symbol.iterator,N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F={};u.prototype.isReactComponent={},u.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&o("85"),this.updater.enqueueSetState(this,e,t,"setState")},u.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")},i.prototype=u.prototype;var I=l.prototype=new i;I.constructor=l,O(I,u.prototype),I.isPureReactComponent=!0;var U={current:null,currentDispatcher:null},Y=Object.prototype.hasOwnProperty,M={key:!0,ref:!0,__self:!0,__source:!0},q=/\/+/g,B=[],L={Children:{map:function(e,t,n){if(null==e)return e;var r=[];return g(e,r,null,t,n),r},forEach:function(e,t,n){if(null==e)return e;t=s(null,null,t,n),m(e,h,t),y(t)},count:function(e){return m(e,function(){return null},null)},toArray:function(e){var t=[];return g(e,t,null,function(e){return e}),t},only:function(e){return f(e)||o("143"),e}},createRef:function(){return{current:null}},Component:u,PureComponent:l,createContext:function(e,t){return void 0===t&&(t=null),e={$$typeof:x,_calculateChangedBits:t,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider={$$typeof:E,_context:e},e.Consumer=e},forwardRef:function(e){return{$$typeof:A,render:e}},lazy:function(e){return{$$typeof:D,_ctor:e,_status:-1,_result:null}},memo:function(e,t){return{$$typeof:T,type:e,compare:void 0===t?null:t}},Fragment:S,StrictMode:P,Suspense:R,createElement:a,cloneElement:function(e,t,n){(null===e||void 0===e)&&o("267",e);var r=void 0,u=O({},e.props),i=e.key,l=e.ref,a=e._owner;if(null!=t){void 0!==t.ref&&(l=t.ref,a=U.current),void 0!==t.key&&(i=""+t.key);var c=void 0;e.type&&e.type.defaultProps&&(c=e.type.defaultProps);for(r in t)Y.call(t,r)&&!M.hasOwnProperty(r)&&(u[r]=void 0===t[r]&&void 0!==c?c[r]:t[r])}if(1===(r=arguments.length-2))u.children=n;else if(1<r){c=Array(r);for(var f=0;f<r;f++)c[f]=arguments[f+2];u.children=c}return{$$typeof:j,type:e.type,key:i,ref:l,props:u,_owner:a}},createFactory:function(e){var t=a.bind(null,e);return t.type=e,t},isValidElement:f,version:"16.7.0",unstable_ConcurrentMode:C,unstable_Profiler:w,__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED:{ReactCurrentOwner:U,assign:O}},V={default:L},G=V&&L||V;e.exports=G.default||G},function(e,t,n){"use strict";function r(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}/*
  object-assign
  (c) Sindre Sorhus
  @license MIT
  */
  var o=Object.getOwnPropertySymbols,u=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,l,a=r(e),c=1;c<arguments.length;c++){n=Object(arguments[c]);for(var f in n)u.call(n,f)&&(a[f]=n[f]);if(o){l=o(n);for(var p=0;p<l.length;p++)i.call(n,l[p])&&(a[l[p]]=n[l[p]])}}return a}},function(e,t,n){e.exports=n(5)()},function(e,t,n){"use strict";function r(){}var o=n(6);e.exports=function(){function e(e,t,n,r,u,i){if(i!==o){var l=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw l.name="Invariant Violation",l}}function t(){return e}e.isRequired=e;var n={array:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t};return n.checkPropTypes=r,n.PropTypes=n,n}},function(e,t,n){"use strict";e.exports="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED"},function(e,t,n){"use strict";var r={button:function(e){if(e=Object.assign({children:null,noClick:!1},e),!e.noClick)return e.children?{cursor:"pointer"}:{display:"inline-block",fontFamily:"sans-serif",borderRadius:"5px",color:"#555",padding:"5px 10px",textAlign:"center",cursor:"pointer",backgroundColor:"#EEE"}},input:function(){return{display:"none"}}};t.a=r},function(e,t,n){"use strict";var r={ANY:{transform:function(e){return e},accept:null,mimeType:null},JSON:{transform:function(e){return JSON.parse(e)},accept:".json,application/json",mimeType:"application/json"},IMG:{transform:function(e){return e},accept:"image/*",mimeType:null}};t.a=r}])});