forgeplus/public/react/build/static/js/9.74545efc.chunk.js

1 line
32 KiB
JavaScript

(this.webpackJsonp=this.webpackJsonp||[]).push([[9],{"13Tz":function(e,t,n){},"2ajD":function(e,t){e.exports=function(e){return e!=e}},"7W5+":function(e,t,n){"use strict";n.r(t);n("SchZ"),n("13Tz"),n("D8SU"),n("TfFZ")},"8z0m":function(e,t,n){"use strict";n.r(t);var r=n("q1tI"),o=n.n(r),a=n("VCL8"),i=n("QbLZ"),l=n.n(i),c=n("iCc5"),s=n.n(c),u=n("V7oC"),f=n.n(u),p=n("FYw3"),d=n.n(p),m=n("mRg0"),h=n.n(m),y=n("17x9"),v=n.n(y),b=n("YEIV"),g=n.n(b),w=n("TSYQ"),O=n.n(w);function E(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function P(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach((function(t){var r=e.data[t];Array.isArray(r)?r.forEach((function(e){n.append(t+"[]",e)})):n.append(t,e.data[t])})),n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){if(t.status<200||t.status>=300)return e.onError(function(e,t){var n="cannot "+e.method+" "+e.action+" "+t.status+"'",r=new Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}(e,t),E(t));e.onSuccess(E(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};for(var o in null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),r)r.hasOwnProperty(o)&&null!==r[o]&&t.setRequestHeader(o,r[o]);return t.send(n),{abort:function(){t.abort()}}}var C=+new Date,k=0;function S(){return"rc-upload-"+C+"-"+ ++k}var j=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some((function(e){var t,n,i=e.trim();return"."===i.charAt(0)?(t=r.toLowerCase(),n=i.toLowerCase(),-1!==t.indexOf(n,t.length-n.length)):/\/\*$/.test(i)?a===i.replace(/\/.*$/,""):o===i}))}return!0};var D=function(e,t,n){var r=function e(r,o){o=o||"",r.isFile?r.file((function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))})):r.isDirectory&&function(e,t){var n=e.createReader(),r=[];!function e(){n.readEntries((function(n){var o=Array.prototype.slice.apply(n);r=r.concat(o),!o.length?t(r):e()}))}()}(r,(function(t){t.forEach((function(t){e(t,""+o+r.name+"/")}))}))},o=!0,a=!1,i=void 0;try{for(var l,c=e[Symbol.iterator]();!(o=(l=c.next()).done);o=!0){r(l.value.webkitGetAsEntry())}}catch(e){a=!0,i=e}finally{try{!o&&c.return&&c.return()}finally{if(a)throw i}}},U=function(e){function t(){var e,n,r,o;s()(this,t);for(var a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return n=r=d()(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={uid:S()},r.reqs={},r.onChange=function(e){var t=e.target.files;r.uploadFiles(t),r.reset()},r.onClick=function(){var e=r.fileInput;e&&e.click()},r.onKeyDown=function(e){"Enter"===e.key&&r.onClick()},r.onFileDrop=function(e){var t=r.props.multiple;if(e.preventDefault(),"dragover"!==e.type)if(r.props.directory)D(e.dataTransfer.items,r.uploadFiles,(function(e){return j(e,r.props.accept)}));else{var n=Array.prototype.slice.call(e.dataTransfer.files).filter((function(e){return j(e,r.props.accept)}));!1===t&&(n=n.slice(0,1)),r.uploadFiles(n)}},r.uploadFiles=function(e){var t=Array.prototype.slice.call(e);t.map((function(e){return e.uid=S(),e})).forEach((function(e){r.upload(e,t)}))},r.saveFileInput=function(e){r.fileInput=e},o=n,d()(r,o)}return h()(t,e),f()(t,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"upload",value:function(e,t){var n=this,r=this.props;if(!r.beforeUpload)return setTimeout((function(){return n.post(e)}),0);var o=r.beforeUpload(e,t);o&&o.then?o.then((function(t){var r=Object.prototype.toString.call(t);return"[object File]"===r||"[object Blob]"===r?n.post(t):n.post(e)})).catch((function(e){console&&console.log(e)})):!1!==o&&setTimeout((function(){return n.post(e)}),0)}},{key:"post",value:function(e){var t=this;if(this._isMounted){var n=this.props,r=n.data,o=n.onStart,a=n.onProgress,i=n.transformFile,l=void 0===i?function(e){return e}:i;new Promise((function(t){var r=n.action;if("function"==typeof r)return t(r(e));t(r)})).then((function(i){var c=e.uid,s=n.customRequest||P;Promise.resolve(l(e)).catch((function(e){console.error(e)})).then((function(l){"function"==typeof r&&(r=r(e));var u={action:i,filename:n.name,data:r,file:l,headers:n.headers,withCredentials:n.withCredentials,method:n.method||"post",onProgress:a?function(t){a(t,e)}:null,onSuccess:function(r,o){delete t.reqs[c],n.onSuccess(r,e,o)},onError:function(r,o){delete t.reqs[c],n.onError(r,o,e)}};t.reqs[c]=s(u),o(e)}))}))}}},{key:"reset",value:function(){this.setState({uid:S()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e;e&&e.uid&&(n=e.uid),t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach((function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]}))}},{key:"render",value:function(){var e,t=this.props,n=t.component,r=t.prefixCls,a=t.className,i=t.disabled,c=t.id,s=t.style,u=t.multiple,f=t.accept,p=t.children,d=t.directory,m=t.openFileDialogOnClick,h=O()((e={},g()(e,r,!0),g()(e,r+"-disabled",i),g()(e,a,a),e)),y=i?{}:{onClick:m?this.onClick:function(){},onKeyDown:m?this.onKeyDown:function(){},onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return o.a.createElement(n,l()({},y,{className:h,role:"button",style:s}),o.a.createElement("input",{id:c,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:f,directory:d?"directory":null,webkitdirectory:d?"webkitdirectory":null,multiple:u,onChange:this.onChange}),p)}}]),t}(r.Component);U.propTypes={id:v.a.string,component:v.a.string,style:v.a.object,prefixCls:v.a.string,className:v.a.string,multiple:v.a.bool,directory:v.a.bool,disabled:v.a.bool,accept:v.a.string,children:v.a.any,onStart:v.a.func,data:v.a.oneOfType([v.a.object,v.a.func]),action:v.a.oneOfType([v.a.string,v.a.func]),headers:v.a.object,beforeUpload:v.a.func,customRequest:v.a.func,onProgress:v.a.func,withCredentials:v.a.bool,openFileDialogOnClick:v.a.bool,transformFile:v.a.func};var x=U,I=n("i8i4"),L=n.n(I),R=n("2W6z"),F=n.n(R),N={position:"absolute",top:0,opacity:0,filter:"alpha(opacity=0)",left:0,zIndex:9999},T=function(e){function t(){var e,n,r,o;s()(this,t);for(var a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return n=r=d()(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={uploading:!1},r.file={},r.onLoad=function(){if(r.state.uploading){var e=r,t=e.props,n=e.file,o=void 0;try{var a=r.getIframeDocument(),i=a.getElementsByTagName("script")[0];i&&i.parentNode===a.body&&a.body.removeChild(i),o=a.body.innerHTML,t.onSuccess(o,n)}catch(e){F()(!1,"cross domain error for Upload. Maybe server should return document.domain script. see Note from https://github.com/react-component/upload"),o="cross-domain",t.onError(e,null,n)}r.endUpload()}},r.onChange=function(){var e=r.getFormInputNode(),t=r.file={uid:S(),name:e.value&&e.value.substring(e.value.lastIndexOf("\\")+1,e.value.length)};r.startUpload();var n=r.props;if(!n.beforeUpload)return r.post(t);var o=n.beforeUpload(t);o&&o.then?o.then((function(){r.post(t)}),(function(){r.endUpload()})):!1!==o?r.post(t):r.endUpload()},r.saveIframe=function(e){r.iframe=e},o=n,d()(r,o)}return h()(t,e),f()(t,[{key:"componentDidMount",value:function(){this.updateIframeWH(),this.initIframe()}},{key:"componentDidUpdate",value:function(){this.updateIframeWH()}},{key:"getIframeNode",value:function(){return this.iframe}},{key:"getIframeDocument",value:function(){return this.getIframeNode().contentDocument}},{key:"getFormNode",value:function(){return this.getIframeDocument().getElementById("form")}},{key:"getFormInputNode",value:function(){return this.getIframeDocument().getElementById("input")}},{key:"getFormDataNode",value:function(){return this.getIframeDocument().getElementById("data")}},{key:"getFileForMultiple",value:function(e){return this.props.multiple?[e]:e}},{key:"getIframeHTML",value:function(e){var t="",n="";if(e){t='<script>document.domain="'+e+'";<\/script>',n='<input name="_documentDomain" value="'+e+'" />'}return'\n <!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv="X-UA-Compatible" content="IE=edge" />\n <style>\n body,html {padding:0;margin:0;border:0;overflow:hidden;}\n </style>\n '+t+'\n </head>\n <body>\n <form method="post"\n encType="multipart/form-data"\n action="" id="form"\n style="display:block;height:9999px;position:relative;overflow:hidden;">\n <input id="input" type="file"\n name="'+this.props.name+'"\n style="position:absolute;top:0;right:0;height:9999px;font-size:9999px;cursor:pointer;"/>\n '+n+'\n <span id="data"></span>\n </form>\n </body>\n </html>\n '}},{key:"initIframeSrc",value:function(){this.domain&&(this.getIframeNode().src="javascript:void((function(){\n var d = document;\n d.open();\n d.domain='"+this.domain+"';\n d.write('');\n d.close();\n })())")}},{key:"initIframe",value:function(){var e=this.getIframeNode(),t=e.contentWindow,n=void 0;this.domain=this.domain||"",this.initIframeSrc();try{n=t.document}catch(r){this.domain=document.domain,this.initIframeSrc(),n=(t=e.contentWindow).document}n.open("text/html","replace"),n.write(this.getIframeHTML(this.domain)),n.close(),this.getFormInputNode().onchange=this.onChange}},{key:"endUpload",value:function(){this.state.uploading&&(this.file={},this.state.uploading=!1,this.setState({uploading:!1}),this.initIframe())}},{key:"startUpload",value:function(){this.state.uploading||(this.state.uploading=!0,this.setState({uploading:!0}))}},{key:"updateIframeWH",value:function(){var e=L.a.findDOMNode(this),t=this.getIframeNode();t.style.height=e.offsetHeight+"px",t.style.width=e.offsetWidth+"px"}},{key:"abort",value:function(e){if(e){var t=e;e&&e.uid&&(t=e.uid),t===this.file.uid&&this.endUpload()}else this.endUpload()}},{key:"post",value:function(e){var t=this,n=this.getFormNode(),r=this.getFormDataNode(),o=this.props.data,a=this.props.onStart;"function"==typeof o&&(o=o(e));var i=document.createDocumentFragment();for(var l in o)if(o.hasOwnProperty(l)){var c=document.createElement("input");c.setAttribute("name",l),c.value=o[l],i.appendChild(c)}r.appendChild(i),new Promise((function(n){var r=t.props.action;if("function"==typeof r)return n(r(e));n(r)})).then((function(t){n.setAttribute("action",t),n.submit(),r.innerHTML="",a(e)}))}},{key:"render",value:function(){var e,t=this.props,n=t.component,r=t.disabled,a=t.className,i=t.prefixCls,c=t.children,s=t.style,u=l()({},N,{display:this.state.uploading||r?"none":""}),f=O()((e={},g()(e,i,!0),g()(e,i+"-disabled",r),g()(e,a,a),e));return o.a.createElement(n,{className:f,style:l()({position:"relative",zIndex:0},s)},o.a.createElement("iframe",{ref:this.saveIframe,onLoad:this.onLoad,style:u}),c)}}]),t}(r.Component);T.propTypes={component:v.a.string,style:v.a.object,disabled:v.a.bool,prefixCls:v.a.string,className:v.a.string,accept:v.a.string,onStart:v.a.func,multiple:v.a.bool,children:v.a.any,data:v.a.oneOfType([v.a.object,v.a.func]),action:v.a.oneOfType([v.a.string,v.a.func]),name:v.a.string};var _=T;function M(){}var q=function(e){function t(){var e,n,r,o;s()(this,t);for(var a=arguments.length,i=Array(a),l=0;l<a;l++)i[l]=arguments[l];return n=r=d()(this,(e=t.__proto__||Object.getPrototypeOf(t)).call.apply(e,[this].concat(i))),r.state={Component:null},r.saveUploader=function(e){r.uploader=e},o=n,d()(r,o)}return h()(t,e),f()(t,[{key:"componentDidMount",value:function(){this.props.supportServerRender&&this.setState({Component:this.getComponent()},this.props.onReady)}},{key:"getComponent",value:function(){return"undefined"!=typeof File?x:_}},{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){if(this.props.supportServerRender){var e=this.state.Component;return e?o.a.createElement(e,l()({},this.props,{ref:this.saveUploader})):null}var t=this.getComponent();return o.a.createElement(t,l()({},this.props,{ref:this.saveUploader}))}}]),t}(r.Component);q.propTypes={component:v.a.string,style:v.a.object,prefixCls:v.a.string,action:v.a.oneOfType([v.a.string,v.a.func]),name:v.a.string,multipart:v.a.bool,directory:v.a.bool,onError:v.a.func,onSuccess:v.a.func,onProgress:v.a.func,onStart:v.a.func,data:v.a.oneOfType([v.a.object,v.a.func]),headers:v.a.object,accept:v.a.string,multiple:v.a.bool,disabled:v.a.bool,beforeUpload:v.a.func,customRequest:v.a.func,onReady:v.a.func,withCredentials:v.a.bool,supportServerRender:v.a.bool,openFileDialogOnClick:v.a.bool},q.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onReady:M,onStart:M,onError:M,onSuccess:M,supportServerRender:!1,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var W=q,A=n("qPyV"),H=n.n(A),Y=n("UfWW"),z=n.n(Y),X=n("MFj2");function Z(){return(Z=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}).apply(this,arguments)}function B(e){return Z(Z({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function Q(e,t){var n=void 0!==e.uid?"uid":"name";return t.filter((function(t){return t[n]===e[n]}))[0]}var G=function(e){return!!e&&0===e.indexOf("image/")},J=function(e){if(G(e.type))return!0;var t=e.thumbUrl||e.url,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=e.split("/"),n=t[t.length-1],r=n.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(r)||[""])[0]}(t);return!(!/^data:image\//.test(t)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico)$/i.test(n))||!/^data:/.test(t)&&!n};var K=n("CtXQ"),V=n("3S7+"),$=n("CFYs"),ee=n("H84U");function te(e){return(te="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 ne(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function re(){return(re=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}).apply(this,arguments)}function oe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ae(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 ie(e,t){return(ie=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function le(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=se(e);if(t){var o=se(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return ce(this,n)}}function ce(e,t){return!t||"object"!==te(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function se(e){return(se=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ue=function(e){!function(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&&ie(e,t)}(i,e);var t,n,o,a=le(i);function i(){var e;return oe(this,i),(e=a.apply(this,arguments)).handlePreview=function(t,n){var r=e.props.onPreview;if(r)return n.preventDefault(),r(t)},e.handleDownload=function(t){var n=e.props.onDownload;"function"==typeof n?n(t):t.url&&window.open(t.url)},e.handleClose=function(t){var n=e.props.onRemove;n&&n(t)},e.renderUploadList=function(t){var n,o=t.getPrefixCls,a=e.props,i=a.prefixCls,l=a.items,c=void 0===l?[]:l,s=a.listType,u=a.showPreviewIcon,f=a.showRemoveIcon,p=a.showDownloadIcon,d=a.locale,m=a.progressAttr,h=o("upload",i),y=c.map((function(t){var n,o,a,i=r.createElement(K.default,{type:"uploading"===t.status?"loading":"paper-clip"});if("picture"===s||"picture-card"===s)if("picture-card"===s&&"uploading"===t.status)i=r.createElement("div",{className:"".concat(h,"-list-item-uploading-text")},d.uploading);else if(t.thumbUrl||t.url){var l=J(t)?r.createElement("img",{src:t.thumbUrl||t.url,alt:t.name,className:"".concat(h,"-list-item-image")}):r.createElement(K.default,{type:"file",className:"".concat(h,"-list-item-icon"),theme:"twoTone"});i=r.createElement("a",{className:"".concat(h,"-list-item-thumbnail"),onClick:function(n){return e.handlePreview(t,n)},href:t.url||t.thumbUrl,target:"_blank",rel:"noopener noreferrer"},l)}else i=r.createElement(K.default,{className:"".concat(h,"-list-item-thumbnail"),type:"picture",theme:"twoTone"});if("uploading"===t.status){var c="percent"in t?r.createElement($.default,re({type:"line"},m,{percent:t.percent})):null;a=r.createElement("div",{className:"".concat(h,"-list-item-progress"),key:"progress"},c)}var y,v=O()((ne(n={},"".concat(h,"-list-item"),!0),ne(n,"".concat(h,"-list-item-").concat(t.status),!0),ne(n,"".concat(h,"-list-item-list-type-").concat(s),!0),n)),b="string"==typeof t.linkProps?JSON.parse(t.linkProps):t.linkProps,g=f?r.createElement(K.default,{type:"delete",title:d.removeFile,onClick:function(){return e.handleClose(t)}}):null,w=p&&"done"===t.status?r.createElement(K.default,{type:"download",title:d.downloadFile,onClick:function(){return e.handleDownload(t)}}):null,E="picture-card"!==s&&r.createElement("span",{key:"download-delete",className:"".concat(h,"-list-item-card-actions ").concat("picture"===s?"picture":"")},w&&r.createElement("a",{title:d.downloadFile},w),g&&r.createElement("a",{title:d.removeFile},g)),P=O()((ne(o={},"".concat(h,"-list-item-name"),!0),ne(o,"".concat(h,"-list-item-name-icon-count-").concat([w,g].filter((function(e){return e})).length),!0),o)),C=t.url?[r.createElement("a",re({key:"view",target:"_blank",rel:"noopener noreferrer",className:P,title:t.name},b,{href:t.url,onClick:function(n){return e.handlePreview(t,n)}}),t.name),E]:[r.createElement("span",{key:"view",className:P,onClick:function(n){return e.handlePreview(t,n)},title:t.name},t.name),E],k=u?r.createElement("a",{href:t.url||t.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:t.url||t.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:function(n){return e.handlePreview(t,n)},title:d.previewFile},r.createElement(K.default,{type:"eye-o"})):null,S="picture-card"===s&&"uploading"!==t.status&&r.createElement("span",{className:"".concat(h,"-list-item-actions")},k,"done"===t.status&&w,g);y=t.response&&"string"==typeof t.response?t.response:t.error&&t.error.statusText||d.uploadError;var j=r.createElement("span",null,i,C),D=r.createElement("div",{className:v},r.createElement("div",{className:"".concat(h,"-list-item-info")},j),S,r.createElement(X.a,{transitionName:"fade",component:""},a)),U=O()(ne({},"".concat(h,"-list-picture-card-container"),"picture-card"===s));return r.createElement("div",{key:t.uid,className:U},"error"===t.status?r.createElement(V.default,{title:y},D):r.createElement("span",null,D))})),v=O()((ne(n={},"".concat(h,"-list"),!0),ne(n,"".concat(h,"-list-").concat(s),!0),n)),b="picture-card"===s?"animate-inline":"animate";return r.createElement(X.a,{transitionName:"".concat(h,"-").concat(b),component:"div",className:v},y)},e}return t=i,(n=[{key:"componentDidUpdate",value:function(){var e=this,t=this.props,n=t.listType,r=t.items,o=t.previewFile;"picture"!==n&&"picture-card"!==n||(r||[]).forEach((function(t){"undefined"!=typeof document&&"undefined"!=typeof window&&window.FileReader&&window.File&&(t.originFileObj instanceof File||t.originFileObj instanceof Blob)&&void 0===t.thumbUrl&&(t.thumbUrl="",o&&o(t.originFileObj).then((function(n){t.thumbUrl=n||"",e.forceUpdate()})))}))}},{key:"render",value:function(){return r.createElement(ee.a,null,this.renderUploadList)}}])&&ae(t.prototype,n),o&&ae(t,o),i}(r.Component);ue.defaultProps={listType:"text",progressAttr:{strokeWidth:2,showInfo:!1},showRemoveIcon:!0,showDownloadIcon:!1,showPreviewIcon:!0,previewFile:function(e){return new Promise((function(t){if(G(e.type)){var n=document.createElement("canvas");n.width=200,n.height=200,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(200,"px; height: ").concat(200,"px; z-index: 9999; display: none;"),document.body.appendChild(n);var r=n.getContext("2d"),o=new Image;o.onload=function(){var e=o.width,a=o.height,i=200,l=200,c=0,s=0;e<a?s=-((l=a*(200/e))-i)/2:c=-((i=e*(200/a))-l)/2,r.drawImage(o,c,s,i,l);var u=n.toDataURL();document.body.removeChild(n),t(u)},o.src=window.URL.createObjectURL(e)}else t("")}))}};var fe=n("YMnH"),pe=n("ZvpZ"),de=n("6CfX");function me(e){return(me="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 he(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ye(){return(ye=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}).apply(this,arguments)}function ve(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 be(e,t){return(be=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ge(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Oe(e);if(t){var o=Oe(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return we(this,n)}}function we(e,t){return!t||"object"!==me(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Oe(e){return(Oe=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ee=function(e){!function(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&&be(e,t)}(i,e);var t,n,o,a=ge(i);function i(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),(t=a.call(this,e)).saveUpload=function(e){t.upload=e},t.onStart=function(e){var n=t.state.fileList,r=B(e);r.status="uploading";var o=n.concat(),a=z()(o,(function(e){return e.uid===r.uid}));-1===a?o.push(r):o[a]=r,t.onChange({file:r,fileList:o}),window.File&&!Object({NODE_ENV:"production",PUBLIC_URL:"/react/build/"}).TEST_IE||t.autoUpdateProgress(0,r)},t.onSuccess=function(e,n,r){t.clearProgressTimer();try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}var o=t.state.fileList,a=Q(n,o);a&&(a.status="done",a.response=e,a.xhr=r,t.onChange({file:ye({},a),fileList:o}))},t.onProgress=function(e,n){var r=t.state.fileList,o=Q(n,r);o&&(o.percent=e.percent,t.onChange({event:e,file:ye({},o),fileList:r}))},t.onError=function(e,n,r){t.clearProgressTimer();var o=t.state.fileList,a=Q(r,o);a&&(a.error=e,a.response=n,a.status="error",t.onChange({file:ye({},a),fileList:o}))},t.handleRemove=function(e){var n=t.props.onRemove,r=t.state.fileList;Promise.resolve("function"==typeof n?n(e):n).then((function(n){if(!1!==n){var o=function(e,t){var n=void 0!==e.uid?"uid":"name",r=t.filter((function(t){return t[n]!==e[n]}));return r.length===t.length?null:r}(e,r);o&&(e.status="removed",t.upload&&t.upload.abort(e),t.onChange({file:e,fileList:o}))}}))},t.onChange=function(e){"fileList"in t.props||t.setState({fileList:e.fileList});var n=t.props.onChange;n&&n(e)},t.onFileDrop=function(e){t.setState({dragState:e.type})},t.beforeUpload=function(e,n){var r=t.props.beforeUpload,o=t.state.fileList;if(!r)return!0;var a=r(e,n);return!1===a?(t.onChange({file:e,fileList:H()(o.concat(n.map(B)),(function(e){return e.uid}))}),!1):!a||!a.then||a},t.renderUploadList=function(e){var n=t.props,o=n.showUploadList,a=n.listType,i=n.onPreview,l=n.onDownload,c=n.previewFile,s=n.disabled,u=n.locale,f=o.showRemoveIcon,p=o.showPreviewIcon,d=o.showDownloadIcon,m=t.state.fileList;return r.createElement(ue,{listType:a,items:m,previewFile:c,onPreview:i,onDownload:l,onRemove:t.handleRemove,showRemoveIcon:!s&&f,showPreviewIcon:p,showDownloadIcon:d,locale:ye(ye({},e),u)})},t.renderUpload=function(e){var n,o=e.getPrefixCls,a=t.props,i=a.prefixCls,l=a.className,c=a.showUploadList,s=a.listType,u=a.type,f=a.disabled,p=a.children,d=a.style,m=t.state,h=m.fileList,y=m.dragState,v=o("upload",i),b=ye(ye({onStart:t.onStart,onError:t.onError,onProgress:t.onProgress,onSuccess:t.onSuccess},t.props),{prefixCls:v,beforeUpload:t.beforeUpload});delete b.className,delete b.style,p&&!f||delete b.id;var g=c?r.createElement(fe.a,{componentName:"Upload",defaultLocale:pe.a.Upload},t.renderUploadList):null;if("drag"===u){var w,E=O()(v,(he(w={},"".concat(v,"-drag"),!0),he(w,"".concat(v,"-drag-uploading"),h.some((function(e){return"uploading"===e.status}))),he(w,"".concat(v,"-drag-hover"),"dragover"===y),he(w,"".concat(v,"-disabled"),f),w),l);return r.createElement("span",null,r.createElement("div",{className:E,onDrop:t.onFileDrop,onDragOver:t.onFileDrop,onDragLeave:t.onFileDrop,style:d},r.createElement(W,ye({},b,{ref:t.saveUpload,className:"".concat(v,"-btn")}),r.createElement("div",{className:"".concat(v,"-drag-container")},p))),g)}var P=O()(v,(he(n={},"".concat(v,"-select"),!0),he(n,"".concat(v,"-select-").concat(s),!0),he(n,"".concat(v,"-disabled"),f),n)),C=r.createElement("div",{className:P,style:p?void 0:{display:"none"}},r.createElement(W,ye({},b,{ref:t.saveUpload})));return"picture-card"===s?r.createElement("span",{className:O()(l,"".concat(v,"-picture-card-wrapper"))},g,C):r.createElement("span",{className:l},C,g)},t.state={fileList:e.fileList||e.defaultFileList||[],dragState:"drop"},Object(de.a)("fileList"in e||!("value"in e),"Upload","`value` is not validate prop, do you mean `fileList`?"),t}return t=i,o=[{key:"getDerivedStateFromProps",value:function(e){return"fileList"in e?{fileList:e.fileList||[]}:null}}],(n=[{key:"componentWillUnmount",value:function(){this.clearProgressTimer()}},{key:"clearProgressTimer",value:function(){clearInterval(this.progressTimer)}},{key:"autoUpdateProgress",value:function(e,t){var n,r=this,o=(n=.1,function(e){var t=e;return t>=.98||(t+=n,(n-=.01)<.001&&(n=.001)),t}),a=0;this.clearProgressTimer(),this.progressTimer=setInterval((function(){a=o(a),r.onProgress({percent:100*a},t)}),200)}},{key:"render",value:function(){return r.createElement(ee.a,null,this.renderUpload)}}])&&ve(t.prototype,n),o&&ve(t,o),i}(r.Component);Ee.defaultProps={type:"select",multiple:!1,action:"",data:{},accept:"",beforeUpload:function(){return!0},showUploadList:!0,listType:"text",className:"",disabled:!1,supportServerRender:!0},Object(a.polyfill)(Ee);var Pe=Ee;function Ce(e){return(Ce="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 ke(){return(ke=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}).apply(this,arguments)}function Se(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function je(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 De(e,t){return(De=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ue(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Ie(e);if(t){var o=Ie(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return xe(this,n)}}function xe(e,t){return!t||"object"!==Ce(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function Ie(e){return(Ie=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Le=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n},Re=function(e){!function(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&&De(e,t)}(i,e);var t,n,o,a=Ue(i);function i(){return Se(this,i),a.apply(this,arguments)}return t=i,(n=[{key:"render",value:function(){var e=this.props,t=e.style,n=e.height,o=Le(e,["style","height"]);return r.createElement(Pe,ke({},o,{type:"drag",style:ke(ke({},t),{height:n})}))}}])&&je(t.prototype,n),o&&je(t,o),i}(r.Component);Pe.Dragger=Re;t.default=Pe},CZoQ:function(e,t){e.exports=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1}},KwMD:function(e,t){e.exports=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1}},LGYb:function(e,t,n){var r=n("1hJj"),o=n("jbM+"),a=n("Xt/L"),i=n("xYSL"),l=n("dQpi"),c=n("rEGp");e.exports=function(e,t,n){var s=-1,u=o,f=e.length,p=!0,d=[],m=d;if(n)p=!1,u=a;else if(f>=200){var h=t?null:l(e);if(h)return c(h);p=!1,u=i,m=new r}else m=t?[]:d;e:for(;++s<f;){var y=e[s],v=t?t(y):y;if(y=n||0!==y?y:0,p&&v==v){for(var b=m.length;b--;)if(m[b]===v)continue e;t&&m.push(v),d.push(y)}else u(m,v,n)||(m!==d&&m.push(v),d.push(y))}return d}},"R/W3":function(e,t,n){var r=n("KwMD"),o=n("2ajD"),a=n("CZoQ");e.exports=function(e,t,n){return t==t?a(e,t,n):r(e,o,n)}},Sxd8:function(e,t,n){var r=n("ZCgT");e.exports=function(e){var t=r(e),n=t%1;return t==t?n?t-n:t:0}},UfWW:function(e,t,n){var r=n("KwMD"),o=n("ut/Y"),a=n("Sxd8"),i=Math.max;e.exports=function(e,t,n){var l=null==e?0:e.length;if(!l)return-1;var c=null==n?0:a(n);return c<0&&(c=i(l+c,0)),r(e,o(t,3),c)}},"Xt/L":function(e,t){e.exports=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1}},ZCgT:function(e,t,n){var r=n("tLB3");e.exports=function(e){return e?(e=r(e))===1/0||e===-1/0?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0}},dQpi:function(e,t,n){var r=n("yGk4"),o=n("vN+2"),a=n("rEGp"),i=r&&1/a(new r([,-0]))[1]==1/0?function(e){return new r(e)}:o;e.exports=i},"jbM+":function(e,t,n){var r=n("R/W3");e.exports=function(e,t){return!!(null==e?0:e.length)&&r(e,t,0)>-1}},qPyV:function(e,t,n){var r=n("ut/Y"),o=n("LGYb");e.exports=function(e,t){return e&&e.length?o(e,r(t,2)):[]}},"vN+2":function(e,t){e.exports=function(){}}}]);