feffery_antd_components 0.3.0-a0 → 0.3.0-a2
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.
- package/DESCRIPTION +1 -1
- package/NAMESPACE +1 -0
- package/Project.toml +1 -1
- package/build/lib/feffery_antd_components/AntdDropdown.py +12 -3
- package/build/lib/feffery_antd_components/AntdQRCode.py +88 -0
- package/build/lib/feffery_antd_components/_imports_.py +2 -0
- package/build/lib/feffery_antd_components/async-antd_table.js +1 -1
- package/build/lib/feffery_antd_components/async-data_display.js +4 -4
- package/build/lib/feffery_antd_components/async-data_entry.js +25 -13
- package/build/lib/feffery_antd_components/async-upload.js +2 -2
- package/build/lib/feffery_antd_components/feffery_antd_components.min.js +34 -46
- package/build/lib/feffery_antd_components/metadata.json +292 -0
- package/build/lib/feffery_antd_components/package-info.json +1 -1
- package/feffery_antd_components/AntdDropdown.py +12 -3
- package/feffery_antd_components/AntdQRCode.py +88 -0
- package/feffery_antd_components/_imports_.py +2 -0
- package/feffery_antd_components/async-antd_table.js +1 -1
- package/feffery_antd_components/async-data_display.js +4 -4
- package/feffery_antd_components/async-data_entry.js +25 -13
- package/feffery_antd_components/async-upload.js +2 -2
- package/feffery_antd_components/feffery_antd_components.min.js +34 -46
- package/feffery_antd_components/metadata.json +292 -0
- package/feffery_antd_components/package-info.json +1 -1
- package/package.json +1 -1
- package/src/jl/'feffery'_antddropdown.jl +6 -1
- package/src/jl/'feffery'_antdqrcode.jl +49 -0
- package/src/lib/components/dataDisplay/AntdQRCode.react.js +148 -0
- package/src/lib/components/dataEntry/AntdColorPicker.react.js +10 -84
- package/src/lib/components/navigation/AntdDropdown.react.js +72 -55
- package/src/lib/fragments/dataDisplay/AntdQRCode.react.js +80 -0
- package/src/lib/fragments/dataEntry/AntdColorPicker.react.js +95 -0
- package/src/lib/index.js +3 -1
- package/usage.py +37 -14
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(window.webpackJsonpfeffery_antd_components=window.webpackJsonpfeffery_antd_components||[]).push([[3],{433:function(e,t,n){"use strict";n.r(t);var $=n(0),W=n.n($),H=n(400),o=n(686),B=n(483),G=n(13),X=n(451),Z=n(69),V=n(10),q=n(8),Y=n(55),J=n(47),n=n(239);function i(e){return(i="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 K(){return(K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function a(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function Q(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==i(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===i(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function ee(e,t){var n;if(e)return"string"==typeof e?te(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function r(e){var t,n=e.id,o=e.className,r=e.style,i=e.draggerClassName,a=e.draggerStyle,s=e.key,c=e.locale,l=e.apiUrl,u=e.apiUrlExtraParams,p=e.headers,d=e.withCredentials,f=e.downloadUrl,h=e.downloadUrlExtraParams,m=e.downloadUrlFromBackend,g=e.text,b=e.hint,v=e.uploadId,y=e.fileListMaxLength,w=e.fileTypes,O=e.fileMaxSize,x=e.showUploadList,j=e.multiple,S=e.directory,C=e.failedTooltipInfo,E=e.confirmBeforeDelete,k=e.showPercent,R=e.progressProps,N=e.showSuccessMessage,U=e.showErrorMessage,P=e.listUploadTaskRecord,z=e.defaultFileList,A=e.disabled,F=e.status,D=e.loading_state,T=e.setProps,c=(e=Object($.useContext)(J.a))&&e.locale||c,m=!f&&m,I=(M=P=P||[],t=new Map,M.forEach(function(e){t.set(e.uid,e.completeTimestamp)}),t);Object($.useEffect)(function(){v||(z&&0<z.length?T({uploadId:z[0].taskId||Object(H.a)()}):T({uploadId:Object(H.a)()}))},[]),M=Object($.useState)(z||P.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),L=2;var L=(M=function(e){if(Array.isArray(e))return e}(M)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(M,L)||ee(M,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],_=M[1],M={name:"file",action:l+"?uploadId=".concat(v),headers:p,data:Q({uploadId:v},u),withCredentials:d,beforeUpload:function(e){var t=e.size/1024/1024<O;return t||B.a.error("".concat(e.name).concat(Y.a.Upload[c].sizeError[0]).concat(O).concat(Y.a.Upload[c].sizeError[1])),w?(-1===w.indexOf(e.name.split(".")[e.name.split(".").length-1])&&B.a.error("".concat(Y.a.Upload[c].typeError[0]).concat(e.name).concat(Y.a.Upload[c].typeError[1])),t&&-1!==w.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-P.length,e=(j||S?"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):e.fileList.slice(-n).every(function(e){return"uploading"!==e.status})&&!e.fileList.slice(-n).every(function(e){return!e.status})&&0<n&&T({lastUploadTaskRecord:e.fileList.slice(-n).map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v},t),n)}),listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||T({lastUploadTaskRecord:Q(Q({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:v},m?e.file.response?{url:e.file.response.url}:{}:f&&"done"===e.file.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.file.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}),"done"===e.file.status&&N?B.a.success("".concat(e.file.name," ").concat(Y.a.Upload[c].uploadSuccess)):"error"===e.file.status&&U&&B.a.error("".concat(e.file.name," ").concat(Y.a.Upload[c].uploadFailed)),function(e){if(Array.isArray(e))return te(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());y&&(e=e.slice(-y)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=C||"上传失败"),e}))),_(f?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return Q(Q({},e),{},{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")},t)}):m?e.map(function(e){return e.response?Q(Q({},e),{},{url:e.response.url,uploadResponse:e.response}):Q({},e)}):e)}};return w&&0!=w.length&&Object.assign(M,{accept:"."+w.join(",.")}),W.a.createElement(G.a,{locale:Y.b.get(c)},W.a.createElement("div",{id:n,className:Object(q.isString)(o)?o:o?Object(V.a)(o):void 0,style:Q(Q({border:"1px solid transparent",transition:"border 0.3s"},oe.get(F)),r),key:s,"data-dash-is-loading":D&&D.is_loading||void 0},W.a.createElement(ne,K({draggerStyle:a,draggerClassName:Object(q.isString)(i)?i:i?Object(V.a)(i):void 0,fileList:L,showUploadList:x,multiple:j,directory:S,disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:A,progress:R||k?{strokeColor:R&&R.strokeColor,strokeWidth:R&&R.strokeWidth||2,format:k?function(e){return e&&"".concat(R&&R.prefix||"").concat(parseFloat(e.toFixed(1))).concat(R&&R.suffix||"%")}:void 0}:void 0,onRemove:E?function(){return new Promise(function(e,t){X.a.confirm({title:Y.a.AntdPictureUpload[c].confirmBeforeDeleteTitle,okText:Y.a.AntdPictureUpload[c].confirmBeforeDeleteOkText,cancelText:Y.a.AntdPictureUpload[c].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0},M),W.a.createElement("p",{className:"ant-upload-drag-icon"},W.a.createElement(Z.a,{icon:"antd-cloud-upload"})),W.a.createElement("p",{className:"ant-upload-text"},g),W.a.createElement("p",{className:"ant-upload-hint"},b))))}var ne=o.a.Dragger,oe=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}]]);(t.default=r).defaultProps=n.b,r.propTypes=n.c},457:function(h,e,t){"use strict";t.r(e);var X=t(0),Z=t.n(X),V=t(400),q=t(483),Y=t(13),J=t(686),K=t(451),ae=t(468),Q=t(55),ee=t(8),_=t(21),$=t(33),n=t(330);const m=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,o=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");var t=e.match(m);if(t)return t.shift(),t;throw new Error(`Invalid argument not valid semver ('${e}' received)`)},g=e=>"*"===e||"x"===e||"X"===e,b=e=>{var t=parseInt(e,10);return isNaN(t)?e:t},w=(t,n)=>{for(let e=0;e<Math.max(t.length,n.length);e++){o=t[e]||"0",r=n[e]||"0";o=g(o)||g(r)?0:([o,r]=(o=b(o),r=b(r),typeof o!=typeof r?[String(o),String(r)]:[o,r]),r<o?1:o<r?-1:0);if(0!=o)return o}var o,r;return 0};var P=t(63),k=t(688),O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},v=function(){return(v=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=(Object.create,Object.create,t(662)),x=t.n(r);function c(e,t,n,o,r){t=u(t.width,t.height,r=void 0===r?0:r),r=t.width,t=t.height;return{x:j(e.x,r,n.width,o),y:j(e.y,t,n.height,o)}}function j(e,t,n,o){t=t*o/2-n/2;return p(e,-t,t)}function S(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function C(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function E(e,t){return Math.min(e,Math.max(0,t))}function z(e,t){return t}function D(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function u(e,t,n){n=n*Math.PI/180;return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}function p(e,t,n){return Math.min(Math.max(e,t),n)}function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&0<e.length}).join(" ").trim()}i=Z.a.Component,O(a=s,r=i),a.prototype=null===r?Object.create(r):(I.prototype=r.prototype,new I),s.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef)&&this.props.setVideoRef(this.videoRef)},s.prototype.componentWillUnmount=function(){var e;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null!=(e=this.resizeObserver)&&e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&null!=(e=this.styleRef.parentNode)&&e.removeChild(this.styleRef),this.cleanEvents(),this.props.zoomWithScroll)&&this.clearScrollEvent()},s.prototype.componentDidUpdate=function(e){var t;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null==(t=e.cropSize)?void 0:t.height)!==(null==(t=this.props.cropSize)?void 0:t.height)||(null==(t=e.cropSize)?void 0:t.width)!==(null==(t=this.props.cropSize)?void 0:t.width)?this.computeSizes():(null==(t=e.crop)?void 0:t.x)===(null==(t=this.props.crop)?void 0:t.x)&&(null==(t=e.crop)?void 0:t.y)===(null==(t=this.props.crop)?void 0:t.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&null!=(t=this.videoRef.current)&&t.load()},s.prototype.getAspect=function(){var e=this.props,t=e.cropSize,e=e.aspect;return t?t.width/t.height:e},s.prototype.getObjectFit=function(){var e,t;return"cover"===this.props.objectFit?!this.imageRef.current&&!this.videoRef.current||!this.containerRef||(this.containerRect=this.containerRef.getBoundingClientRect(),t=this.containerRect.width/this.containerRect.height,((null==(e=this.imageRef.current)?void 0:e.naturalWidth)||(null==(e=this.videoRef.current)?void 0:e.videoWidth)||0)/((null==(e=this.imageRef.current)?void 0:e.naturalHeight)||(null==(e=this.videoRef.current)?void 0:e.videoHeight)||0)<t)?"horizontal-cover":"vertical-cover":this.props.objectFit},s.prototype.onPinchStart=function(e){var t=s.getTouchPoint(e.touches[0]),e=s.getTouchPoint(e.touches[1]);this.lastPinchDistance=S(t,e),this.lastPinchRotation=C(t,e),this.onDragStart(D(t,e))},s.prototype.onPinchMove=function(e){var n,o,r,i=this;this.currentDoc&&this.currentWindow&&(n=s.getTouchPoint(e.touches[0]),o=s.getTouchPoint(e.touches[1]),r=D(n,o),this.onDrag(r),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=S(n,o),t=i.props.zoom*(e/i.lastPinchDistance),t=(i.setNewZoom(t,r,{shouldUpdatePosition:!1}),i.lastPinchDistance=e,C(n,o)),e=i.props.rotation+(t-i.lastPinchRotation);i.props.onRotationChange&&i.props.onRotationChange(e),i.lastPinchRotation=t}))},s.prototype.render=function(){var t=this,e=this.props,n=e.image,o=e.video,r=e.mediaProps,i=e.transform,a=e.crop,s=a.x,a=a.y,c=e.rotation,l=e.zoom,u=e.cropShape,p=e.showGrid,d=e.style,f=d.containerStyle,h=d.cropAreaStyle,d=d.mediaStyle,e=e.classes,m=e.containerClassName,g=e.cropAreaClassName,e=e.mediaClassName,b=this.getObjectFit();return Z.a.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:f,className:y("reactEasyCrop_Container",m)},n?Z.a.createElement("img",v({alt:"",className:y("reactEasyCrop_Image","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical",e)},r,{src:n,ref:this.imageRef,style:v(v({},d),{transform:i||"translate(".concat(s,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(l,")")}),onLoad:this.onMediaLoad})):o&&Z.a.createElement("video",v({autoPlay:!0,loop:!0,muted:!0,className:y("reactEasyCrop_Video","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical",e)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:v(v({},d),{transform:i||"translate(".concat(s,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(l,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map(function(e){return Z.a.createElement("source",v({key:e.src},e))})),this.state.cropSize&&Z.a.createElement("div",{style:v(v({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:y("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",g)}))},s.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},s.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},s.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}};var i,a,T=s;function s(){var l=null!==i&&i.apply(this,arguments)||this;return l.imageRef=Z.a.createRef(),l.videoRef=Z.a.createRef(),l.containerPosition={x:0,y:0},l.containerRef=null,l.styleRef=null,l.containerRect=null,l.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},l.dragStartPosition={x:0,y:0},l.dragStartCrop={x:0,y:0},l.gestureZoomStart=0,l.gestureRotationStart=0,l.isTouching=!1,l.lastPinchDistance=0,l.lastPinchRotation=0,l.rafDragTimeout=null,l.rafPinchTimeout=null,l.wheelTimer=null,l.currentDoc="undefined"!=typeof document?document:null,l.currentWindow="undefined"!=typeof window?window:null,l.resizeObserver=null,l.state={cropSize:null,hasWheelJustStarted:!1},l.initResizeObserver=function(){var t;void 0!==window.ResizeObserver&&l.containerRef&&(t=!0,l.resizeObserver=new window.ResizeObserver(function(e){t?t=!1:l.computeSizes()}),l.resizeObserver.observe(l.containerRef))},l.preventZoomSafari=function(e){return e.preventDefault()},l.cleanEvents=function(){l.currentDoc&&(l.currentDoc.removeEventListener("mousemove",l.onMouseMove),l.currentDoc.removeEventListener("mouseup",l.onDragStopped),l.currentDoc.removeEventListener("touchmove",l.onTouchMove),l.currentDoc.removeEventListener("touchend",l.onDragStopped),l.currentDoc.removeEventListener("gesturemove",l.onGestureMove),l.currentDoc.removeEventListener("gestureend",l.onGestureEnd),l.currentDoc.removeEventListener("scroll",l.onScroll))},l.clearScrollEvent=function(){l.containerRef&&l.containerRef.removeEventListener("wheel",l.onWheel),l.wheelTimer&&clearTimeout(l.wheelTimer)},l.onMediaLoad=function(){var e=l.computeSizes();e&&(l.emitCropData(),l.setInitialCrop(e)),l.props.onMediaLoaded&&l.props.onMediaLoaded(l.mediaSize)},l.setInitialCrop=function(e){var t,n,o,r,i,a,s,c;l.props.initialCroppedAreaPercentages?(o=l.props.initialCroppedAreaPercentages,r=l.mediaSize,i=l.props.rotation,a=e,s=l.props.minZoom,c=l.props.maxZoom,r=u(r.width,r.height,i),c=(s={crop:{x:(i=p(a.width/r.width*(100/o.width),s,c))*r.width/2-a.width/2-r.width*i*(o.x/100),y:i*r.height/2-a.height/2-r.height*i*(o.y/100)},zoom:i}).zoom,l.props.onCropChange(s.crop),l.props.onZoomChange&&l.props.onZoomChange(c)):l.props.initialCroppedAreaPixels&&(t=l.props.initialCroppedAreaPixels,a=l.mediaSize,r=l.props.rotation,n=e,o=l.props.minZoom,i=l.props.maxZoom,r=u(a.naturalWidth,a.naturalHeight,r=void 0===r?0:r),a=p(function(e){e=e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight;return n.height>n.width?n.height/(t.height*e):n.width/(t.width*e)}(a),o,i),o=n.height>n.width?n.height/t.height:n.width/t.width,c=(s={crop:{x:((r.width-t.width)/2-t.x)*o,y:((r.height-t.height)/2-t.y)*o},zoom:a}).zoom,l.props.onCropChange(s.crop),l.props.onZoomChange)&&l.props.onZoomChange(c)},l.computeSizes=function(){var e,t,n,o=l.imageRef.current||l.videoRef.current;if(o&&l.containerRef){l.containerRect=l.containerRef.getBoundingClientRect(),l.saveContainerPosition();var r=l.containerRect.width/l.containerRect.height,i=(null==(i=l.imageRef.current)?void 0:i.naturalWidth)||(null==(i=l.videoRef.current)?void 0:i.videoWidth)||0,a=(null==(a=l.imageRef.current)?void 0:a.naturalHeight)||(null==(a=l.videoRef.current)?void 0:a.videoHeight)||0,s=i/a,c=void 0;if(o.offsetWidth<i||o.offsetHeight<a)switch(l.getObjectFit()){default:case"contain":c=s<r?{width:l.containerRect.height*s,height:l.containerRect.height}:{width:l.containerRect.width,height:l.containerRect.width/s};break;case"horizontal-cover":c={width:l.containerRect.width,height:l.containerRect.width/s};break;case"vertical-cover":c={width:l.containerRect.height*s,height:l.containerRect.height}}else c={width:o.offsetWidth,height:o.offsetHeight};l.mediaSize=v(v({},c),{naturalWidth:i,naturalHeight:a}),l.props.setMediaSize&&l.props.setMediaSize(l.mediaSize);a=l.props.cropSize||(o=l.mediaSize.width,i=l.mediaSize.height,a=l.containerRect.width,e=l.containerRect.height,t=l.props.aspect,n=l.props.rotation,o=u(o,i,n=void 0===n?0:n),i=o.width,n=o.height,o=Math.min(i,a),(i=Math.min(n,e))*t<o?{width:i*t,height:i}:{width:o,height:o/t});return(null==(n=l.state.cropSize)?void 0:n.height)===a.height&&(null==(e=l.state.cropSize)?void 0:e.width)===a.width||l.props.onCropSizeChange&&l.props.onCropSizeChange(a),l.setState({cropSize:a},l.recomputeCropPosition),l.props.setCropSize&&l.props.setCropSize(a),a}},l.saveContainerPosition=function(){var e;l.containerRef&&(e=l.containerRef.getBoundingClientRect(),l.containerPosition={x:e.left,y:e.top})},l.onMouseDown=function(e){l.currentDoc&&(e.preventDefault(),l.currentDoc.addEventListener("mousemove",l.onMouseMove),l.currentDoc.addEventListener("mouseup",l.onDragStopped),l.saveContainerPosition(),l.onDragStart(s.getMousePoint(e)))},l.onMouseMove=function(e){return l.onDrag(s.getMousePoint(e))},l.onScroll=function(e){l.currentDoc&&(e.preventDefault(),l.saveContainerPosition())},l.onTouchStart=function(e){l.currentDoc&&(l.isTouching=!0,l.props.onTouchRequest&&!l.props.onTouchRequest(e)||(l.currentDoc.addEventListener("touchmove",l.onTouchMove,{passive:!1}),l.currentDoc.addEventListener("touchend",l.onDragStopped),l.saveContainerPosition(),2===e.touches.length?l.onPinchStart(e):1===e.touches.length&&l.onDragStart(s.getTouchPoint(e.touches[0]))))},l.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?l.onPinchMove(e):1===e.touches.length&&l.onDrag(s.getTouchPoint(e.touches[0]))},l.onGestureStart=function(e){l.currentDoc&&(e.preventDefault(),l.currentDoc.addEventListener("gesturechange",l.onGestureMove),l.currentDoc.addEventListener("gestureend",l.onGestureEnd),l.gestureZoomStart=l.props.zoom,l.gestureRotationStart=l.props.rotation)},l.onGestureMove=function(e){var t,n;e.preventDefault(),l.isTouching||(t=s.getMousePoint(e),n=l.gestureZoomStart-1+e.scale,l.setNewZoom(n,t,{shouldUpdatePosition:!0}),l.props.onRotationChange&&(n=l.gestureRotationStart+e.rotation,l.props.onRotationChange(n)))},l.onGestureEnd=function(e){l.cleanEvents()},l.onDragStart=function(e){var t=e.x,e=e.y;l.dragStartPosition={x:t,y:e},l.dragStartCrop=v({},l.props.crop),null!=(e=(t=l.props).onInteractionStart)&&e.call(t)},l.onDrag=function(e){var n=e.x,o=e.y;l.currentWindow&&(l.rafDragTimeout&&l.currentWindow.cancelAnimationFrame(l.rafDragTimeout),l.rafDragTimeout=l.currentWindow.requestAnimationFrame(function(){var e,t;l.state.cropSize&&void 0!==n&&void 0!==o&&(e=n-l.dragStartPosition.x,t=o-l.dragStartPosition.y,e={x:l.dragStartCrop.x+e,y:l.dragStartCrop.y+t},t=l.props.restrictPosition?c(e,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):e,l.props.onCropChange(t))}))},l.onDragStopped=function(){var e,t;l.isTouching=!1,l.cleanEvents(),l.emitCropData(),null!=(t=(e=l.props).onInteractionEnd)&&t.call(e)},l.onWheel=function(e){var t;!l.currentWindow||l.props.onWheelRequest&&!l.props.onWheelRequest(e)||(e.preventDefault(),t=s.getMousePoint(e),e=x()(e).pixelY,e=l.props.zoom-e*l.props.zoomSpeed/200,l.setNewZoom(e,t,{shouldUpdatePosition:!0}),l.state.hasWheelJustStarted||l.setState({hasWheelJustStarted:!0},function(){var e,t;return null==(t=(e=l.props).onInteractionStart)?void 0:t.call(e)}),l.wheelTimer&&clearTimeout(l.wheelTimer),l.wheelTimer=l.currentWindow.setTimeout(function(){return l.setState({hasWheelJustStarted:!1},function(){var e,t;return null==(t=(e=l.props).onInteractionEnd)?void 0:t.call(e)})},250))},l.getPointOnContainer=function(e,t){var n=e.x,e=e.y;if(l.containerRect)return{x:l.containerRect.width/2-(n-t.x),y:l.containerRect.height/2-(e-t.y)};throw new Error("The Cropper is not mounted")},l.getPointOnMedia=function(e){var t=e.x,e=e.y,n=l.props,o=n.crop,n=n.zoom;return{x:(t+o.x)/n,y:(e+o.y)/n}},l.setNewZoom=function(e,t,n){var n=(void 0===n?{}:n).shouldUpdatePosition,n=void 0===n||n;l.state.cropSize&&l.props.onZoomChange&&(e=p(e,l.props.minZoom,l.props.maxZoom),n&&(n=l.getPointOnContainer(t,l.containerPosition),t={x:(t=l.getPointOnMedia(n)).x*e-n.x,y:t.y*e-n.y},n=l.props.restrictPosition?c(t,l.mediaSize,l.state.cropSize,e,l.props.rotation):t,l.props.onCropChange(n)),l.props.onZoomChange(e))},l.getCropData=function(){return l.state.cropSize?(e=l.props.restrictPosition?c(l.props.crop,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):l.props.crop,t=l.mediaSize,n=l.state.cropSize,o=l.getAspect(),r=l.props.zoom,i=l.props.rotation,a=(a=void 0===(a=l.props.restrictPosition)?!0:a)?E:z,s=u(t.width,t.height,i=void 0===i?0:i),t=u(t.naturalWidth,t.naturalHeight,i),i={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},e=Math.round(a(t.width,i.width*t.width/100)),n=Math.round(a(t.height,i.height*t.height/100)),s=t.width>=t.height*o?{width:Math.round(n*o),height:n}:{width:e,height:Math.round(e/o)},{croppedAreaPercentages:i,croppedAreaPixels:v(v({},s),{x:Math.round(a(t.width-s.width,i.x*t.width/100)),y:Math.round(a(t.height-s.height,i.y*t.height/100))})}):null;var e,t,n,o,r,i,a,s},l.emitCropData=function(){var e,t=l.getCropData();t&&(e=t.croppedAreaPercentages,t=t.croppedAreaPixels,l.props.onCropComplete&&l.props.onCropComplete(e,t),l.props.onCropAreaChange)&&l.props.onCropAreaChange(e,t)},l.emitCropAreaChange=function(){var e,t=l.getCropData();t&&(e=t.croppedAreaPercentages,t=t.croppedAreaPixels,l.props.onCropAreaChange)&&l.props.onCropAreaChange(e,t)},l.recomputeCropPosition=function(){var e;l.state.cropSize&&(e=l.props.restrictPosition?c(l.props.crop,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):l.props.crop,l.props.onCropChange(e),l.emitCropData())},l}function I(){this.constructor=a}const W="img-crop",L=Object(X.forwardRef)((e,t)=>{const{cropperRef:n,zoomSlider:o,rotationSlider:r,aspectSlider:i,showReset:a,resetBtnText:s,modalImage:c,aspect:l,minZoom:u,maxZoom:p,cropShape:d,showGrid:f,cropperProps:h}=e,[m,g]=Object(X.useState)(1),[b,v]=Object(X.useState)(0),[y,w]=Object(X.useState)(l),O=1!==m||0!==b||y!==l,x=()=>{g(1),v(0),w(l)},[j,S]=Object(X.useState)({x:0,y:0}),C=Object(X.useRef)({width:0,height:0,x:0,y:0}),E=Object(X.useCallback)((e,t)=>{C.current=t},[]);Object(X.useImperativeHandle)(t,()=>({rotation:b,cropPixelsRef:C,onReset:x}));e="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",t="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]";return Object($.jsxs)($.Fragment,{children:[Object($.jsx)(T,Object.assign({},h,{ref:n,image:c,crop:j,zoom:m,rotation:b,aspect:y,minZoom:u,maxZoom:p,zoomWithScroll:o,cropShape:d,showGrid:f,onCropChange:S,onZoomChange:g,onRotationChange:v,onCropComplete:E,classes:{containerClassName:W+"-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]",mediaClassName:W+"-media"}})),o&&Object($.jsxs)("section",{className:W+`-control ${W}-control-zoom `+e,children:[Object($.jsx)("button",{className:t,onClick:()=>g(m-.1),disabled:m-.1<u,children:"-"}),Object($.jsx)(k.a,{className:"[flex:1]",min:u,max:p,step:.1,value:m,onChange:g}),Object($.jsx)("button",{className:t,onClick:()=>g(m+.1),disabled:m+.1>p,children:"+"})]}),r&&Object($.jsxs)("section",{className:W+`-control ${W}-control-rotation `+e,children:[Object($.jsx)("button",{className:t+" [font-size:16px]",onClick:()=>v(b-1),disabled:-180===b,children:"↺"}),Object($.jsx)(k.a,{className:"[flex:1]",min:-180,max:180,step:1,value:b,onChange:v}),Object($.jsx)("button",{className:t+" [font-size:16px]",onClick:()=>v(b+1),disabled:180===b,children:"↻"})]}),i&&Object($.jsxs)("section",{className:W+`-control ${W}-control-aspect `+e,children:[Object($.jsx)("button",{className:t,onClick:()=>w(y-.01),disabled:y-.01<.5,children:"↕️"}),Object($.jsx)(k.a,{className:"[flex:1]",min:.5,max:2,step:.01,value:y,onChange:w}),Object($.jsx)("button",{className:t,onClick:()=>w(y+.01),disabled:2<y+.01,children:"↔️"})]}),a&&(o||r||i)&&Object($.jsx)(P.a,{className:"[bottom:20px] [position:absolute]",style:O?{}:{opacity:.3,pointerEvents:"none"},onClick:x,children:s})]})});var l,d,f,B=Object(X.memo)(L);r=".visible{visibility:visible}.grid{display:grid}.\\!\\[position\\:relative\\]{position:relative!important}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}",l=(l=void 0===(l={insertAt:"top"})?{}:l).insertAt,"undefined"!=typeof document&&(d=document.head||document.getElementsByTagName("head")[0],(f=document.createElement("style")).type="text/css","top"===l&&d.firstChild?d.insertBefore(f,d.firstChild):d.appendChild(f),f.styleSheet?f.styleSheet.cssText=r:f.appendChild(document.createTextNode(r)));const G=-1===(l=n.a,l=o(l),d=o("4.23.0"),f=l.pop(),r=d.pop(),0!==(l=w(l,d))?l:f&&r?w(f.split("."),r.split(".")):f||r?f?-1:1:0)?"visible":"open",H=(e,t,n)=>t in e?(console.error(`\`${t}\` is deprecated, please use \`${n}\` instead`),e[t]):e[n],se=Object(X.forwardRef)((e,t)=>{const{quality:l=.4,fillColor:g="white",aspectSlider:n=!1,showReset:o=!1,resetText:r,aspect:i=1,minZoom:a=1,maxZoom:s=3,cropperProps:c,modalClassName:u,modalTitle:p,modalWidth:d,modalOk:f,modalCancel:h,onModalOk:m,onModalCancel:b,modalProps:v,beforeCrop:y,children:w}=e,O=H(e,"zoom","zoomSlider")||!0,x=H(e,"rotate","rotationSlider")||!1,j=H(e,"shape","cropShape")||"rect",S=H(e,"grid","showGrid")||!1,C=("onUploadFail"in e&&console.error("`onUploadFail` is removed, because the only way it is called, is when the file is rejected by beforeUpload"),H(e,"modalMaskTransitionName","modalProps.maskTransitionName"),H(e,"modalTransitionName","modalProps.transitionName"),Object(X.useRef)({})),E=(C.current.onModalOk=m,C.current.onModalCancel=b,C.current.beforeCrop=y,Object(X.useRef)(null)),k=Object(X.useCallback)(e=>{var t,n=document.createElement("canvas"),o=n.getContext("2d"),r=((null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))||document).querySelector(`.${W}-media`),{width:i,height:a,x:s,y:c}=E.current.cropPixelsRef.current;if(x&&0!==E.current.rotation){const{naturalWidth:e,naturalHeight:t}=r,p=E.current.rotation*(Math.PI/180),d=Math.abs(Math.sin(p)),f=Math.abs(Math.cos(p)),h=e*f+t*d,m=t*f+e*d;n.width=h,n.height=m,o.fillStyle=g,o.fillRect(0,0,h,m);var l=h/2,u=m/2,l=(o.translate(l,u),o.rotate(p),o.translate(-l,-u),(h-e)/2),u=(m-t)/2,l=(o.drawImage(r,0,0,e,t,l,u,e,t),o.getImageData(0,0,h,m));n.width=i,n.height=a,o.putImageData(l,-s,-c)}else n.width=i,n.height=a,o.fillStyle=g,o.fillRect(0,0,i,a),o.drawImage(r,s,c,i,a,0,0,i,a);return n},[g,x]),[R,P]=Object(X.useState)(""),z=Object(X.useRef)(),D=Object(X.useRef)(),T=Object(X.useCallback)((t,n,o,r)=>Object(_.b)(void 0,void 0,void 0,function*(){var e=n;if("function"==typeof t)try{const r=yield t(n,[n]);o(!0!==r?r:e)}catch(e){r(e)}else o(e)}),[]),I=Object(X.useCallback)(c=>(s,t)=>new Promise((i,a)=>Object(_.b)(void 0,void 0,void 0,function*(){if("function"==typeof C.current.beforeCrop)try{if(!1===(yield C.current.beforeCrop(s,t)))return T(c,s,i,a)}catch(e){return T(c,s,i,a)}const e=new FileReader;e.addEventListener("load",()=>{"string"==typeof e.result&&P(e.result)}),e.readAsDataURL(s),z.current=()=>{var e,t;P(""),E.current.onReset(),i(J.a.LIST_IGNORE),null!=(t=(e=C.current).onModalCancel)&&t.call(e,i)},D.current=t=>Object(_.b)(void 0,void 0,void 0,function*(){P(""),E.current.onReset();const e=k(t.target),{type:n,name:o,uid:r}=s;e.toBlob(t=>Object(_.b)(void 0,void 0,void 0,function*(){var e=new File([t],o,{type:n});Object.assign(e,{uid:r}),T(c,e,e=>{var t,n;i(e),null!=(n=(t=C.current).onModalOk)&&n.call(t,e)},e=>{var t,n;a(e),null!=(n=(t=C.current).onModalOk)&&n.call(t,e)})}),n,l)})})),[k,l,T]),L=Object(X.useCallback)(e=>{var e=Array.isArray(e)?e[0]:e,t=e.props,{beforeUpload:n,accept:o}=t,t=Object(_.f)(t,["beforeUpload","accept"]);return Object.assign(Object.assign({},e),{props:Object.assign(Object.assign({},t),{accept:o||"image/*",beforeUpload:I(n)})})},[I]),N=Object(X.useMemo)(()=>{var e={};return void 0!==d&&(e.width=d),void 0!==f&&(e.okText=f),void 0!==h&&(e.cancelText=h),e},[h,f,d]),U=W+"-modal"+(u?" "+u:""),M="zh-CN"===("undefined"==typeof window?"":window.navigator.language),A=p||(M?"编辑图片":"Edit image"),F=r||(M?"重置":"Reset");return Object($.jsxs)($.Fragment,{children:[L(w),R&&Object($.jsx)(K.a,Object.assign({},v,N,{[G]:!0,title:A,onCancel:z.current,onOk:D.current,wrapClassName:U,maskClosable:!1,destroyOnClose:!0,children:Object($.jsx)(B,{ref:E,cropperRef:t,zoomSlider:O,rotationSlider:x,aspectSlider:n,showReset:o,resetBtnText:F,modalImage:R,aspect:i,minZoom:a,maxZoom:s,cropShape:j,showGrid:S,cropperProps:c})}))]})});var ce=t(47),le=t(10),n=t(238);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 te(){return(te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function M(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function ne(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==R(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==R(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===R(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function oe(){oe=function(){return a};var c,a={},e=Object.prototype,l=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(c){i=function(e,t,n){return e[t]=n}}function s(e,t,n,o){var r,i,a,s,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),o=new C(o||[]);return u(t,"_invoke",{value:(r=e,i=n,a=o,s=d,function(e,t){if(s===f)throw new Error("Generator is already running");if(s===h){if("throw"===e)throw t;return{value:c,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var o=n.method,r=t.iterator[o];if(r===c)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=c,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;o=p(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;r=o.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=c),n.delegate=null,m):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,a);if(n){if(n===m)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;n=p(r,i,a);if("normal"===n.type){if(s=a.done?h:"suspendedYield",n.arg===m)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s=h,a.method="throw",a.arg=n.arg)}})}),t}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var d="suspendedStart",f="executing",h="completed",m={};function g(){}function b(){}function v(){}var t={},y=(i(t,o,function(){return this}),Object.getPrototypeOf),y=y&&y(y(E([]))),w=(y&&y!==e&&l.call(y,o)&&(t=y),v.prototype=g.prototype=Object.create(t));function O(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,s){var t;u(this,"_invoke",{value:function(n,o){function e(){return new s(function(e,t){!function t(e,n,o,r){var i,e=p(a[e],a,n);if("throw"!==e.type)return(n=(i=e.arg).value)&&"object"==R(n)&&l.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,o,r)},function(e){t("throw",e,o,r)}):s.resolve(n).then(function(e){i.value=e,o(i)},function(e){return t("throw",e,o,r)});r(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=c,e.done=!0,e}).next=e}throw new TypeError(R(t)+" is not iterable")}return u(w,"constructor",{value:b.prototype=v,configurable:!0}),u(v,"constructor",{value:b,configurable:!0}),b.displayName=i(v,r,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,r,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},O(x.prototype),i(x.prototype,n,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,n,o,r){void 0===r&&(r=Promise);var i=new x(s(e,t,n,o),r);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},O(w),i(w,r,"Generator"),i(w,o,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),o=[];for(t in n)o.push(t);return o.reverse(),function e(){for(;o.length;){var t=o.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=E,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var o=this;function e(e,t){return i.type="throw",i.arg=n,o.next=e,t&&(o.method="next",o.arg=c),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var a=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(a&&s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}var i=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,o,r=this.tryEntries[t];if(r.tryLoc===e)return"throw"===(n=r.completion).type&&(o=n.arg,S(r)),o}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=c),m}},a}function ue(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(e){return n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||pe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e,t){var n;if(e)return"string"==typeof e?ie(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function N(e){function t(){return T(!1)}var n,o=e.id,r=e.className,i=e.style,a=e.key,s=e.locale,c=e.apiUrl,l=e.apiUrlExtraParams,N=e.headers,U=e.withCredentials,u=e.downloadUrl,p=e.downloadUrlExtraParams,d=e.downloadUrlFromBackend,A=e.editable,F=e.editConfig,f=e.uploadId,h=e.fileListMaxLength,m=e.buttonContent,g=e.fileTypes,b=e.fileMaxSize,_=e.failedTooltipInfo,v=e.showRemoveIcon,y=e.showPreviewIcon,w=e.confirmBeforeDelete,O=e.showPercent,x=e.progressProps,$=e.showSuccessMessage,W=e.showErrorMessage,j=e.listUploadTaskRecord,S=e.defaultFileList,C=e.disabled,E=e.status,k=e.loading_state,R=e.setProps,s=(e=Object(X.useContext)(ce.a))&&e.locale||s,d=!u&&d,P=(M=j=j||[],n=new Map,M.forEach(function(e){n.set(e.uid,e.completeTimestamp)}),n);Object(X.useEffect)(function(){f||(S&&0<S.length?R({uploadId:S[0].taskId||Object(V.a)()}):R({uploadId:Object(V.a)()}))},[]);var z=(M=re(Object(X.useState)(S||j.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),2))[0],H=M[1],D=(M=re(Object(X.useState)(!1),2))[0],T=M[1],I=(M=re(Object(X.useState)(""),2))[0],B=M[1],L=(M=re(Object(X.useState)(""),2))[0],G=M[1],M=function(){var s;s=oe().mark(function e(t){return oe().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.url||t.preview){e.next=4;break}e.next=3;var o=t.originFileObj;return new Promise(function(e,t){var n=new FileReader;n.readAsDataURL(o),n.onload=function(){return e(n.result)},n.onerror=function(e){return t(e)}});case 3:t.preview=e.sent;case 4:B(t.url||t.preview),T(!0),G(t.name||t.url.substring(t.url.lastIndexOf("/")+1));case 7:case"end":return e.stop()}},e)});return function(e){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=s.apply(e,a);function r(e){ue(o,t,n,r,i,"next",e)}function i(e){ue(o,t,n,r,i,"throw",e)}r(void 0)})}.apply(this,arguments)}}(),m=Z.a.createElement("div",null,Z.a.createElement(ae.a,null),Z.a.createElement("div",{style:{marginTop:8}},m)),c={name:"file",action:c+"?uploadId=".concat(f),headers:N,data:ne({uploadId:f},l),withCredentials:U,beforeUpload:function(e){var t=e.size/1024/1024<b;return t||q.a.error("".concat(e.name).concat(Q.a.Upload[s].sizeError[0]).concat(b).concat(Q.a.Upload[s].sizeError[1])),g?(-1===g.indexOf(e.name.split(".")[e.name.split(".").length-1])&&q.a.error("".concat(Q.a.Upload[s].typeError[0]).concat(e.name).concat(Q.a.Upload[s].typeError[1])),t&&-1!==g.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-j.length,e=("removed"===e.file.status?R({listUploadTaskRecord:e.fileList.map(function(e){var t=d?e.response?{url:e.response.url}:{}:u&&"done"===e.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return ne(ne({fileName:e.name,fileSize:e.size,completeTimestamp:P.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:f,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||R({lastUploadTaskRecord:ne(ne({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:f},d?e.file.response?{url:e.file.response.url}:{}:u&&"done"===e.file.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.file.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=d?e.response?{url:e.response.url}:{}:u&&"done"===e.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return ne(ne({fileName:e.name,fileSize:e.size,completeTimestamp:P.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:f,uid:e.uid},t),n)})}),"done"===e.file.status&&$?q.a.success("".concat(e.file.name," ").concat(Q.a.Upload[s].uploadSuccess)):"error"===e.file.status&&W&&q.a.error("".concat(e.file.name," ").concat(Q.a.Upload[s].uploadFailed)),function(e){if(Array.isArray(e))return ie(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||pe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());h&&(e=e.slice(-h)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=_||"上传失败"),e}))),H(u?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return ne(ne({},e),{},{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")},t)}):d?e.map(function(e){return e.response?ne(ne({},e),{},{url:e.response.url,uploadResponse:e.response}):ne({},e)}):e)}};return g&&0!=g.length&&Object.assign(c,{accept:"."+g.join(",.")}),A?Z.a.createElement(Y.a,{locale:Q.b.get(s)},Z.a.createElement("div",{id:o,className:Object(ee.isString)(r)?r:r?Object(le.a)(r):void 0,style:ne(ne({border:"1px solid transparent",transition:"border 0.3s"},de.get(E)),i),key:a},Z.a.createElement(se,te({modalOk:"zh-cn"===s?"确定":"OK",modalCancel:"zh-cn"===s?"取消":"Cancel"},F),Z.a.createElement(J.a,te({},c,{fileList:z,listType:"picture-card",disabled:e&&!Object(ee.isUndefined)(e.componentDisabled)?e.componentDisabled:C,progress:x||O?{strokeColor:x&&x.strokeColor,strokeWidth:x&&x.strokeWidth||2,format:O?function(e){return e&&"".concat(x&&x.prefix||"").concat(parseFloat(e.toFixed(1))).concat(x&&x.suffix||"%")}:void 0}:void 0,showUploadList:{showRemoveIcon:v,showPreviewIcon:y},onPreview:M,onRemove:w?function(){return new Promise(function(e,t){K.a.confirm({title:Q.a.AntdPictureUpload[s].confirmBeforeDeleteTitle,okText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteOkText,cancelText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":k&&k.is_loading||void 0}),m)),Z.a.createElement(K.a,{visible:D,title:L,footer:null,onCancel:t},Z.a.createElement("img",{alt:"",style:{width:"100%"},src:I})))):Z.a.createElement(Y.a,{locale:Q.b.get(s)},Z.a.createElement("div",{id:o,className:Object(ee.isString)(r)?r:r?Object(le.a)(r):void 0,style:ne(ne({border:"1px solid transparent",transition:"border 0.3s"},de.get(E)),i),key:a},Z.a.createElement(J.a,te({},c,{fileList:z,listType:"picture-card",disabled:e&&!Object(ee.isUndefined)(e.componentDisabled)?e.componentDisabled:C,progress:x||O?{strokeColor:x&&x.strokeColor,strokeWidth:x&&x.strokeWidth||2,format:O?function(e){return e&&"".concat(x&&x.prefix||"").concat(parseFloat(e.toFixed(1))).concat(x&&x.suffix||"%")}:void 0}:void 0,showUploadList:{showRemoveIcon:v,showPreviewIcon:y},onPreview:M,onRemove:w?function(){return new Promise(function(e,t){K.a.confirm({title:Q.a.AntdPictureUpload[s].confirmBeforeDeleteTitle,okText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteOkText,cancelText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":k&&k.is_loading||void 0}),m),Z.a.createElement(K.a,{visible:D,title:L,footer:null,onCancel:t},Z.a.createElement("img",{alt:"",style:{width:"100%"},src:I}))))}var de=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px 0 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px 0 10px",transition:"border 0.3s"}]]);(e.default=N).defaultProps=n.b,N.propTypes=n.c},460:function(e,t,n){"use strict";n.r(t);var F=n(0),_=n.n(F),$=(n(1),n(400)),W=n(483),H=n(13),B=n(686),G=n(451),X=n(63),o=n(2),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(3),Z=F.forwardRef(function(e,t){return F.createElement(i.a,Object(o.a)({},e,{ref:t,icon:r}))}),V=n(55),q=n(8),Y=n(10),J=n(47),n=n(240);function a(e){return(a="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 K(){return(K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function s(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function Q(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==a(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===a(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function ee(e,t){var n;if(e)return"string"==typeof e?te(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){var t,n=e.id,o=e.className,r=e.style,i=e.key,a=e.locale,s=e.apiUrl,c=e.apiUrlExtraParams,l=e.headers,u=e.withCredentials,p=e.downloadUrl,d=e.downloadUrlExtraParams,f=e.downloadUrlFromBackend,h=e.uploadId,m=e.fileListMaxLength,g=e.buttonContent,b=e.buttonProps,v=e.fileTypes,y=e.fileMaxSize,w=e.showUploadList,O=e.multiple,x=e.directory,j=e.failedTooltipInfo,S=e.confirmBeforeDelete,C=e.showPercent,E=e.progressProps,k=e.showSuccessMessage,N=e.showErrorMessage,R=e.listUploadTaskRecord,P=e.defaultFileList,z=e.disabled,U=e.status,D=e.loading_state,T=e.setProps,a=(e=Object(F.useContext)(J.a))&&e.locale||a,f=!p&&f,I=(M=R=R||[],t=new Map,M.forEach(function(e){t.set(e.uid,e.completeTimestamp)}),t);Object(F.useEffect)(function(){h||(P&&0<P.length?T({uploadId:P[0].taskId||Object($.a)()}):T({uploadId:Object($.a)()}))},[]),M=Object(F.useState)(P||R.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),L=2;var L=(M=function(e){if(Array.isArray(e))return e}(M)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(M,L)||ee(M,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],A=M[1],M={name:"file",action:s+"?uploadId=".concat(h),headers:l,data:Q({uploadId:h},c),withCredentials:u,beforeUpload:function(e){var t=e.size/1024/1024<y;return t||W.a.error("".concat(e.name).concat(V.a.Upload[a].sizeError[0]).concat(y).concat(V.a.Upload[a].sizeError[1])),v?(-1===v.indexOf(e.name.split(".")[e.name.split(".").length-1])&&W.a.error("".concat(V.a.Upload[a].typeError[0]).concat(e.name).concat(V.a.Upload[a].typeError[1])),t&&-1!==v.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-R.length,e=(O||x?"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):e.fileList.slice(-n).every(function(e){return"uploading"!==e.status})&&!e.fileList.slice(-n).every(function(e){return!e.status})&&0<n&&T({lastUploadTaskRecord:e.fileList.slice(-n).map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h},t),n)}),listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||T({lastUploadTaskRecord:Q(Q({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:h},f?e.file.response?{url:e.file.response.url}:{}:p&&"done"===e.file.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.file.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}),"done"===e.file.status&&k?W.a.success("".concat(e.file.name," ").concat(V.a.Upload[a].uploadSuccess)):"error"===e.file.status&&N&&W.a.error("".concat(e.file.name," ").concat(V.a.Upload[a].uploadFailed)),function(e){if(Array.isArray(e))return te(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m&&(e=e.slice(-m)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=j||"上传失败"),e}))),A(p?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return Q(Q({},e),{},{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")},t)}):f?e.map(function(e){return e.response?Q(Q({},e),{},{url:e.response.url,uploadResponse:e.response}):Q({},e)}):e)}};return v&&0!=v.length&&Object.assign(M,{accept:"."+v.join(",.")}),_.a.createElement(H.a,{locale:V.b.get(a)},_.a.createElement("div",{id:n,className:Object(q.isString)(o)?o:o?Object(Y.a)(o):void 0,style:Q(Q({border:"1px solid transparent",transition:"border 0.3s"},ne.get(U)),r),key:i},_.a.createElement(B.a,K({},M,{className:null!=b&&b.block?"ant-upload-button-block":void 0,fileList:L,multiple:O,showUploadList:w,directory:x,disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:z,progress:E||C?{strokeColor:E&&E.strokeColor,strokeWidth:E&&E.strokeWidth||2,format:C?function(e){return e&&"".concat(E&&E.prefix||"").concat(parseFloat(e.toFixed(1))).concat(E&&E.suffix||"%")}:void 0}:void 0,onRemove:S?function(){return new Promise(function(e,t){G.a.confirm({title:V.a.AntdPictureUpload[a].confirmBeforeDeleteTitle,okText:V.a.AntdPictureUpload[a].confirmBeforeDeleteOkText,cancelText:V.a.AntdPictureUpload[a].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":D&&D.is_loading||void 0}),_.a.createElement(X.a,K({icon:_.a.createElement(Z,null),disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:z},b),g||"点击上传文件"))))}var ne=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}]]);(t.default=c).defaultProps=n.b,c.propTypes=n.c},662:function(e,t,n){e.exports=n(663)},663:function(e,t,n){"use strict";var o=n(664),r=n(665);function i(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),((o="deltaX"in e?e.deltaX:o)||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),{spinX:t=o&&!t?o<1?-1:1:t,spinY:n=r&&!n?r<1?-1:1:n,pixelX:o,pixelY:r}}i.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},664:function(e,t){var r,i,a,s,c,l,u,p,d,f,h,m,g,b,v,y=!1;function n(){var e,t,n,o;y||(y=!0,e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e),m=/\b(iPhone|iP[ao]d)/.exec(e),g=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),b=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),h=!!/Win64/.exec(e),t?((r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(r=document.documentMode),o=/(?:Trident\/(\d+.\d+))/.exec(e),l=o?parseFloat(o[1])+4:r,i=t[2]?parseFloat(t[2]):NaN,a=t[3]?parseFloat(t[3]):NaN,c=(s=t[4]?parseFloat(t[4]):NaN)&&(t=/(?:Chrome\/(\d+\.\d+))/.exec(e))&&t[1]?parseFloat(t[1]):NaN):r=i=a=c=s=NaN,n?(u=!!n[1]&&(!(o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e))||parseFloat(o[1].replace("_","."))),p=!!n[2],d=!!n[3]):u=p=d=!1)}var o={ie:function(){return n(),r},ieCompatibilityMode:function(){return n(),r<l},ie64:function(){return o.ie()&&h},firefox:function(){return n(),i},opera:function(){return n(),a},webkit:function(){return n(),s},safari:function(){return o.webkit()},chrome:function(){return n(),c},windows:function(){return n(),p},osx:function(){return n(),u},linux:function(){return n(),d},iphone:function(){return n(),m},mobile:function(){return n(),m||g||f||v},nativeApp:function(){return n(),b},android:function(){return n(),f},ipad:function(){return n(),g}};e.exports=o},665:function(e,t,n){"use strict";var r,i=n(666);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){var n,o;return!(!i.canUseDOM||t&&!("addEventListener"in document))&&((n=(t="on"+e)in document)||((o=document.createElement("div")).setAttribute(t,"return;"),n="function"==typeof o[t]),!n&&r&&"wheel"===e?document.implementation.hasFeature("Events.wheel","3.0"):n)}},666:function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=o},686:function(j,S,e){"use strict";var ce=e(0),g=e.n(ce),le=e(9),ue=e(59),t=e(4),pe=e.n(t),b=e(2),r=e(31),t=e(32),n=e(57),o=e(56),v=e(5),C=e(12),p=e(60),E=e(14),k=e(88),R=e(50);function i(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function P(o){var r=new XMLHttpRequest,n=(o.onProgress&&r.upload&&(r.upload.onprogress=function(e){0<e.total&&(e.percent=e.loaded/e.total*100),o.onProgress(e)}),new FormData),t=(o.data&&Object.keys(o.data).forEach(function(t){var e=o.data[t];Array.isArray(e)?e.forEach(function(e){n.append("".concat(t,"[]"),e)}):n.append(t,e)}),o.file instanceof Blob?n.append(o.filename,o.file,o.file.name):n.append(o.filename,o.file),r.onerror=function(e){o.onError(e)},r.onload=function(){return r.status<200||300<=r.status?o.onError((t=r,n="cannot ".concat((e=o).method," ").concat(e.action," ").concat(t.status,"'"),(n=new Error(n)).status=t.status,n.method=e.method,n.url=e.action,n),i(r)):o.onSuccess(i(r),r);var e,t,n},r.open(o.method,o.action,!0),o.withCredentials&&"withCredentials"in r&&(r.withCredentials=!0),o.headers||{});return null!==t["X-Requested-With"]&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(t).forEach(function(e){null!==t[e]&&r.setRequestHeader(e,t[e])}),r.send(n),{abort:function(){r.abort()}}}var z=+new Date,D=0;function a(){return"rc-upload-".concat(z,"-").concat(++D)}function s(e,t){var o,r,i;return!e||!t||(t=Array.isArray(t)?t:t.split(","),o=e.name||"",r=e.type||"",i=r.replace(/\/.*$/,""),t.some(function(e){var t,n=e.trim();return!!/^\*(\/\*)?$/.test(e)||("."===n.charAt(0)?(t=o.toLowerCase(),(".jpg"!==(e=n.toLowerCase())&&".jpeg"!==e?[e]:[".jpg",".jpeg"]).some(function(e){return t.endsWith(e)})):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):r===n||!!/^\w+$/.test(n)&&(Object(I.a)(!1,"Upload takes an invalidate 'accept' type '".concat(n,"'.Skip for check.")),!0))}))}function T(e,t,i){function a(n,o){var e,r;n&&(n.path=o||"",n.isFile?n.file(function(e){i(e)&&(n.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))}):n.isDirectory&&(e=n.createReader(),r=[],function t(){e.readEntries(function(e){e=Array.prototype.slice.apply(e);r=r.concat(e),e.length?t():r.forEach(function(e){a(e,"".concat(o).concat(n.name,"/"))})})}()))}e.forEach(function(e){a(e.webkitGetAsEntry())})}var c,I=e(18),L=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],M=(m=ce.Component,Object(n.a)(l,m),c=Object(o.a)(l),Object(t.a)(l,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t,n,o,r,i,a,s=this,c=e.data,l=e.origin,u=e.action,p=e.parsedFile;this._isMounted&&(t=(e=this.props).onStart,a=e.customRequest,n=e.name,o=e.headers,r=e.withCredentials,e=e.method,i=l.uid,a=a||P,u={action:u,filename:n,data:c,file:p,headers:o,withCredentials:r,method:e||"post",onProgress:function(e){var t=s.props.onProgress;null!=t&&t(e,p)},onSuccess:function(e,t){var n=s.props.onSuccess;null!=n&&n(e,p,t),delete s.reqs[i]},onError:function(e,t){var n=s.props.onError;null!=n&&n(e,t,p),delete s.reqs[i]}},t(l),this.reqs[i]=a(u))}},{key:"reset",value:function(){this.setState({uid:a()})}},{key:"abort",value:function(e){var t=this.reqs;e?(e=e.uid||e,t[e]&&t[e].abort&&t[e].abort(),delete t[e]):Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e=this.props,t=e.component,n=e.prefixCls,o=e.className,r=e.disabled,i=e.id,a=e.style,s=e.multiple,c=e.accept,l=e.capture,u=e.children,p=e.directory,d=e.openFileDialogOnClick,f=e.onMouseEnter,h=e.onMouseLeave,e=Object(C.a)(e,L),n=pe()((m={},Object(v.a)(m,n,!0),Object(v.a)(m,"".concat(n,"-disabled"),r),Object(v.a)(m,o,o),m)),o=p?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},m=r?{}:{onClick:d?this.onClick:function(){},onKeyDown:d?this.onKeyDown:function(){},onMouseEnter:f,onMouseLeave:h,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return g.a.createElement(t,Object(b.a)({},m,{className:n,role:"button",style:a}),g.a.createElement("input",Object(b.a)({},Object(R.a)(e,{aria:!0,data:!0}),{id:i,disabled:r,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:c},o,{multiple:s,onChange:this.onChange},null!=l?{capture:l}:{})),u)}}]),l);function l(){var u;Object(r.a)(this,l);for(var n,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return(u=c.call.apply(c,[this].concat(t))).state={uid:a()},u.reqs={},u.fileInput=void 0,u._isMounted=void 0,u.onChange=function(e){var t=u.props,n=t.accept,o=t.directory,t=e.target.files,e=Object(le.a)(t).filter(function(e){return!o||s(e,n)});u.uploadFiles(e),u.reset()},u.onClick=function(e){var t,n,o=u.fileInput;o&&(n=(t=u.props).children,t=t.onClick,n&&"button"===n.type&&((n=o.parentNode).focus(),n.querySelector("button").blur()),o.click(),t)&&t(e)},u.onKeyDown=function(e){"Enter"===e.key&&u.onClick(e)},u.onFileDrop=function(e){var t=u.props.multiple;e.preventDefault(),"dragover"!==e.type&&(u.props.directory?T(Array.prototype.slice.call(e.dataTransfer.items),u.uploadFiles,function(e){return s(e,u.props.accept)}):(e=Object(le.a)(e.dataTransfer.files).filter(function(e){return s(e,u.props.accept)}),!1===t&&(e=e.slice(0,1)),u.uploadFiles(e)))},u.uploadFiles=function(e){var t=Object(le.a)(e),e=t.map(function(e){return e.uid=a(),u.processFile(e,t)});Promise.all(e).then(function(e){var t=u.props.onBatchStart;null!=t&&t(e.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),e.filter(function(e){return null!==e.parsedFile}).forEach(function(e){u.post(e)})})},u.processFile=(n=Object(k.a)(Object(p.a)().mark(function e(t,n){var o,r,i,a,s,c,l;return Object(p.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c=u.props.beforeUpload,o=t,c)return e.prev=3,e.next=6,c(t,n);e.next=14;break;case 6:o=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),o=!1;case 12:if(!1===o)return e.abrupt("return",{origin:t,parsedFile:null,action:null,data:null});e.next=14;break;case 14:if("function"==typeof(r=u.props.action))return e.next=18,r(t);e.next=21;break;case 18:i=e.sent,e.next=22;break;case 21:i=r;case 22:if("function"==typeof(a=u.props.data))return e.next=26,a(t);e.next=29;break;case 26:s=e.sent,e.next=30;break;case 29:s=a;case 30:return c="object"!==Object(E.a)(o)&&"string"!=typeof o||!o?t:o,l=c instanceof File?c:new File([c],t.name,{type:t.type}),(l=l).uid=t.uid,e.abrupt("return",{origin:t,data:s,parsedFile:l,action:i});case 35:case"end":return e.stop()}},e,null,[[3,9]])})),function(e,t){return n.apply(this,arguments)}),u.saveFileInput=function(e){u.fileInput=e},u}function u(){}m=ce.Component,Object(n.a)(f,m),d=Object(o.a)(f),Object(t.a)(f,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return g.a.createElement(M,Object(b.a)({},this.props,{ref:this.saveUploader}))}}]);var d,n=f;function f(){var t;Object(r.a)(this,f);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=d.call.apply(d,[this].concat(n))).uploader=void 0,t.saveUploader=function(e){t.uploader=e},t}n.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:u,onError:u,onSuccess:u,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var de=n,ve=e(28),fe=e(43),ye=e(61),we=e(125),Oe=e(64),h=e(11),N=e(477),m=e(149),_=e(80),o=e(15),$=e(201);const y=new o.a("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),w=new o.a("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var O=e(37),W=e(204);var xe=Object(m.a)("Upload",e=>{var{fontSizeHeading3:t,fontSize:n,lineHeight:o,lineWidth:r,controlHeightLG:i}=e,n=Math.round(n*o),o=Object(_.b)(e,{uploadThumbnailSize:2*t,uploadProgressOffset:n/2+r,uploadPicCardSize:2.55*i});return[(e=>{var{componentCls:t,colorTextDisabled:n}=e;return{[t+"-wrapper"]:Object.assign(Object.assign({},Object(h.f)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[t+"-select"]:{display:"inline-block"},[t+"-disabled"]:{color:n,cursor:"not-allowed"}})}})(o),(e=>{var{componentCls:t,iconCls:n}=e;return{[t+"-wrapper"]:{[t+"-drag"]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:e.lineWidth+"px dashed "+e.colorBorder,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color "+e.motionDurationSlow,[t]:{padding:e.padding+"px 0"},[t+"-btn"]:{display:"table",width:"100%",height:"100%",outline:"none"},[t+"-drag-container"]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
1
|
+
(window.webpackJsonpfeffery_antd_components=window.webpackJsonpfeffery_antd_components||[]).push([[3],{429:function(e,t,n){"use strict";n.r(t);var $=n(1),W=n.n($),H=n(395),o=n(689),B=n(485),G=n(12),X=n(448),Z=n(64),V=n(10),q=n(9),Y=n(50),J=n(43),n=n(235);function i(e){return(i="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 K(){return(K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function a(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function Q(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?a(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==i(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==i(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===i(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function ee(e,t){var n;if(e)return"string"==typeof e?te(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function r(e){var t,n=e.id,o=e.className,r=e.style,i=e.draggerClassName,a=e.draggerStyle,s=e.key,c=e.locale,l=e.apiUrl,u=e.apiUrlExtraParams,p=e.headers,d=e.withCredentials,f=e.downloadUrl,h=e.downloadUrlExtraParams,m=e.downloadUrlFromBackend,g=e.text,b=e.hint,v=e.uploadId,y=e.fileListMaxLength,w=e.fileTypes,O=e.fileMaxSize,x=e.showUploadList,j=e.multiple,S=e.directory,C=e.failedTooltipInfo,E=e.confirmBeforeDelete,k=e.showPercent,R=e.progressProps,N=e.showSuccessMessage,U=e.showErrorMessage,P=e.listUploadTaskRecord,z=e.defaultFileList,A=e.disabled,F=e.status,D=e.loading_state,T=e.setProps,c=(e=Object($.useContext)(J.a))&&e.locale||c,m=!f&&m,I=(M=P=P||[],t=new Map,M.forEach(function(e){t.set(e.uid,e.completeTimestamp)}),t);Object($.useEffect)(function(){v||(z&&0<z.length?T({uploadId:z[0].taskId||Object(H.a)()}):T({uploadId:Object(H.a)()}))},[]),M=Object($.useState)(z||P.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),L=2;var L=(M=function(e){if(Array.isArray(e))return e}(M)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(M,L)||ee(M,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],_=M[1],M={name:"file",action:l+"?uploadId=".concat(v),headers:p,data:Q({uploadId:v},u),withCredentials:d,beforeUpload:function(e){var t=e.size/1024/1024<O;return t||B.a.error("".concat(e.name).concat(Y.a.Upload[c].sizeError[0]).concat(O).concat(Y.a.Upload[c].sizeError[1])),w?(-1===w.indexOf(e.name.split(".")[e.name.split(".").length-1])&&B.a.error("".concat(Y.a.Upload[c].typeError[0]).concat(e.name).concat(Y.a.Upload[c].typeError[1])),t&&-1!==w.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-P.length,e=(j||S?"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):e.fileList.slice(-n).every(function(e){return"uploading"!==e.status})&&!e.fileList.slice(-n).every(function(e){return!e.status})&&0<n&&T({lastUploadTaskRecord:e.fileList.slice(-n).map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v},t),n)}),listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||T({lastUploadTaskRecord:Q(Q({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:v},m?e.file.response?{url:e.file.response.url}:{}:f&&"done"===e.file.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.file.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=m?e.response?{url:e.response.url}:{}:f&&"done"===e.status?{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:v,uid:e.uid},t),n)})}),"done"===e.file.status&&N?B.a.success("".concat(e.file.name," ").concat(Y.a.Upload[c].uploadSuccess)):"error"===e.file.status&&U&&B.a.error("".concat(e.file.name," ").concat(Y.a.Upload[c].uploadFailed)),function(e){if(Array.isArray(e))return te(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());y&&(e=e.slice(-y)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=C||"上传失败"),e}))),_(f?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return Q(Q({},e),{},{url:f+"?taskId=".concat(v,"&filename=").concat(e.name)+Object.keys(h).map(function(e){return"&".concat(e,"=").concat(h[e])}).join("")},t)}):m?e.map(function(e){return e.response?Q(Q({},e),{},{url:e.response.url,uploadResponse:e.response}):Q({},e)}):e)}};return w&&0!=w.length&&Object.assign(M,{accept:"."+w.join(",.")}),W.a.createElement(G.a,{locale:Y.b.get(c)},W.a.createElement("div",{id:n,className:Object(q.isString)(o)?o:o?Object(V.a)(o):void 0,style:Q(Q({border:"1px solid transparent",transition:"border 0.3s"},oe.get(F)),r),key:s,"data-dash-is-loading":D&&D.is_loading||void 0},W.a.createElement(ne,K({draggerStyle:a,draggerClassName:Object(q.isString)(i)?i:i?Object(V.a)(i):void 0,fileList:L,showUploadList:x,multiple:j,directory:S,disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:A,progress:R||k?{strokeColor:R&&R.strokeColor,strokeWidth:R&&R.strokeWidth||2,format:k?function(e){return e&&"".concat(R&&R.prefix||"").concat(parseFloat(e.toFixed(1))).concat(R&&R.suffix||"%")}:void 0}:void 0,onRemove:E?function(){return new Promise(function(e,t){X.a.confirm({title:Y.a.AntdPictureUpload[c].confirmBeforeDeleteTitle,okText:Y.a.AntdPictureUpload[c].confirmBeforeDeleteOkText,cancelText:Y.a.AntdPictureUpload[c].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0},M),W.a.createElement("p",{className:"ant-upload-drag-icon"},W.a.createElement(Z.a,{icon:"antd-cloud-upload"})),W.a.createElement("p",{className:"ant-upload-text"},g),W.a.createElement("p",{className:"ant-upload-hint"},b))))}var ne=o.a.Dragger,oe=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}]]);(t.default=r).defaultProps=n.b,r.propTypes=n.c},455:function(h,e,t){"use strict";t.r(e);var X=t(1),Z=t.n(X),V=t(395),q=t(485),Y=t(12),J=t(689),K=t(448),ae=t(469),Q=t(50),ee=t(9),_=t(21),$=t(30),n=t(327);const m=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,o=e=>{if("string"!=typeof e)throw new TypeError("Invalid argument expected string");var t=e.match(m);if(t)return t.shift(),t;throw new Error(`Invalid argument not valid semver ('${e}' received)`)},g=e=>"*"===e||"x"===e||"X"===e,b=e=>{var t=parseInt(e,10);return isNaN(t)?e:t},w=(t,n)=>{for(let e=0;e<Math.max(t.length,n.length);e++){o=t[e]||"0",r=n[e]||"0";o=g(o)||g(r)?0:([o,r]=(o=b(o),r=b(r),typeof o!=typeof r?[String(o),String(r)]:[o,r]),r<o?1:o<r?-1:0);if(0!=o)return o}var o,r;return 0};var P=t(65),k=t(691),O=function(e,t){return(O=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}))(e,t)},v=function(){return(v=Object.assign||function(e){for(var t,n=1,o=arguments.length;n<o;n++)for(var r in t=arguments[n])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},r=(Object.create,Object.create,t(665)),x=t.n(r);function c(e,t,n,o,r){t=u(t.width,t.height,r=void 0===r?0:r),r=t.width,t=t.height;return{x:j(e.x,r,n.width,o),y:j(e.y,t,n.height,o)}}function j(e,t,n,o){t=t*o/2-n/2;return p(e,-t,t)}function S(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function C(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function E(e,t){return Math.min(e,Math.max(0,t))}function z(e,t){return t}function D(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function u(e,t,n){n=n*Math.PI/180;return{width:Math.abs(Math.cos(n)*e)+Math.abs(Math.sin(n)*t),height:Math.abs(Math.sin(n)*e)+Math.abs(Math.cos(n)*t)}}function p(e,t,n){return Math.min(Math.max(e,t),n)}function y(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&0<e.length}).join(" ").trim()}i=Z.a.Component,O(a=s,r=i),a.prototype=null===r?Object.create(r):(I.prototype=r.prototype,new I),s.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n position: absolute;\n top: 0;\n left: 0;\n right: 0;\n bottom: 0;\n overflow: hidden;\n user-select: none;\n touch-action: none;\n cursor: move;\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n max-width: 100%;\n max-height: 100%;\n margin: auto;\n position: absolute;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n width: 100%;\n height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n width: auto;\n height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n position: absolute;\n left: 50%;\n top: 50%;\n transform: translate(-50%, -50%);\n border: 1px solid rgba(255, 255, 255, 0.5);\n box-sizing: border-box;\n box-shadow: 0 0 0 9999em;\n color: rgba(0, 0, 0, 0.5);\n overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 0;\n bottom: 0;\n left: 33.33%;\n right: 33.33%;\n border-top: 0;\n border-bottom: 0;\n}\n\n.reactEasyCrop_CropAreaGrid::after {\n content: ' ';\n box-sizing: border-box;\n position: absolute;\n border: 1px solid rgba(255, 255, 255, 0.5);\n top: 33.33%;\n bottom: 33.33%;\n left: 0;\n right: 0;\n border-left: 0;\n border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef)&&this.props.setVideoRef(this.videoRef)},s.prototype.componentWillUnmount=function(){var e;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null!=(e=this.resizeObserver)&&e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&null!=(e=this.styleRef.parentNode)&&e.removeChild(this.styleRef),this.cleanEvents(),this.props.zoomWithScroll)&&this.clearScrollEvent()},s.prototype.componentDidUpdate=function(e){var t;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null==(t=e.cropSize)?void 0:t.height)!==(null==(t=this.props.cropSize)?void 0:t.height)||(null==(t=e.cropSize)?void 0:t.width)!==(null==(t=this.props.cropSize)?void 0:t.width)?this.computeSizes():(null==(t=e.crop)?void 0:t.x)===(null==(t=this.props.crop)?void 0:t.x)&&(null==(t=e.crop)?void 0:t.y)===(null==(t=this.props.crop)?void 0:t.y)||this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&null!=(t=this.videoRef.current)&&t.load()},s.prototype.getAspect=function(){var e=this.props,t=e.cropSize,e=e.aspect;return t?t.width/t.height:e},s.prototype.getObjectFit=function(){var e,t;return"cover"===this.props.objectFit?!this.imageRef.current&&!this.videoRef.current||!this.containerRef||(this.containerRect=this.containerRef.getBoundingClientRect(),t=this.containerRect.width/this.containerRect.height,((null==(e=this.imageRef.current)?void 0:e.naturalWidth)||(null==(e=this.videoRef.current)?void 0:e.videoWidth)||0)/((null==(e=this.imageRef.current)?void 0:e.naturalHeight)||(null==(e=this.videoRef.current)?void 0:e.videoHeight)||0)<t)?"horizontal-cover":"vertical-cover":this.props.objectFit},s.prototype.onPinchStart=function(e){var t=s.getTouchPoint(e.touches[0]),e=s.getTouchPoint(e.touches[1]);this.lastPinchDistance=S(t,e),this.lastPinchRotation=C(t,e),this.onDragStart(D(t,e))},s.prototype.onPinchMove=function(e){var n,o,r,i=this;this.currentDoc&&this.currentWindow&&(n=s.getTouchPoint(e.touches[0]),o=s.getTouchPoint(e.touches[1]),r=D(n,o),this.onDrag(r),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=S(n,o),t=i.props.zoom*(e/i.lastPinchDistance),t=(i.setNewZoom(t,r,{shouldUpdatePosition:!1}),i.lastPinchDistance=e,C(n,o)),e=i.props.rotation+(t-i.lastPinchRotation);i.props.onRotationChange&&i.props.onRotationChange(e),i.lastPinchRotation=t}))},s.prototype.render=function(){var t=this,e=this.props,n=e.image,o=e.video,r=e.mediaProps,i=e.transform,a=e.crop,s=a.x,a=a.y,c=e.rotation,l=e.zoom,u=e.cropShape,p=e.showGrid,d=e.style,f=d.containerStyle,h=d.cropAreaStyle,d=d.mediaStyle,e=e.classes,m=e.containerClassName,g=e.cropAreaClassName,e=e.mediaClassName,b=this.getObjectFit();return Z.a.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef=e},"data-testid":"container",style:f,className:y("reactEasyCrop_Container",m)},n?Z.a.createElement("img",v({alt:"",className:y("reactEasyCrop_Image","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical",e)},r,{src:n,ref:this.imageRef,style:v(v({},d),{transform:i||"translate(".concat(s,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(l,")")}),onLoad:this.onMediaLoad})):o&&Z.a.createElement("video",v({autoPlay:!0,loop:!0,muted:!0,className:y("reactEasyCrop_Video","contain"===b&&"reactEasyCrop_Contain","horizontal-cover"===b&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===b&&"reactEasyCrop_Cover_Vertical",e)},r,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:v(v({},d),{transform:i||"translate(".concat(s,"px, ").concat(a,"px) rotate(").concat(c,"deg) scale(").concat(l,")")}),controls:!1}),(Array.isArray(o)?o:[{src:o}]).map(function(e){return Z.a.createElement("source",v({key:e.src},e))})),this.state.cropSize&&Z.a.createElement("div",{style:v(v({},h),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:y("reactEasyCrop_CropArea","round"===u&&"reactEasyCrop_CropAreaRound",p&&"reactEasyCrop_CropAreaGrid",g)}))},s.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},s.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},s.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}};var i,a,T=s;function s(){var l=null!==i&&i.apply(this,arguments)||this;return l.imageRef=Z.a.createRef(),l.videoRef=Z.a.createRef(),l.containerPosition={x:0,y:0},l.containerRef=null,l.styleRef=null,l.containerRect=null,l.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},l.dragStartPosition={x:0,y:0},l.dragStartCrop={x:0,y:0},l.gestureZoomStart=0,l.gestureRotationStart=0,l.isTouching=!1,l.lastPinchDistance=0,l.lastPinchRotation=0,l.rafDragTimeout=null,l.rafPinchTimeout=null,l.wheelTimer=null,l.currentDoc="undefined"!=typeof document?document:null,l.currentWindow="undefined"!=typeof window?window:null,l.resizeObserver=null,l.state={cropSize:null,hasWheelJustStarted:!1},l.initResizeObserver=function(){var t;void 0!==window.ResizeObserver&&l.containerRef&&(t=!0,l.resizeObserver=new window.ResizeObserver(function(e){t?t=!1:l.computeSizes()}),l.resizeObserver.observe(l.containerRef))},l.preventZoomSafari=function(e){return e.preventDefault()},l.cleanEvents=function(){l.currentDoc&&(l.currentDoc.removeEventListener("mousemove",l.onMouseMove),l.currentDoc.removeEventListener("mouseup",l.onDragStopped),l.currentDoc.removeEventListener("touchmove",l.onTouchMove),l.currentDoc.removeEventListener("touchend",l.onDragStopped),l.currentDoc.removeEventListener("gesturemove",l.onGestureMove),l.currentDoc.removeEventListener("gestureend",l.onGestureEnd),l.currentDoc.removeEventListener("scroll",l.onScroll))},l.clearScrollEvent=function(){l.containerRef&&l.containerRef.removeEventListener("wheel",l.onWheel),l.wheelTimer&&clearTimeout(l.wheelTimer)},l.onMediaLoad=function(){var e=l.computeSizes();e&&(l.emitCropData(),l.setInitialCrop(e)),l.props.onMediaLoaded&&l.props.onMediaLoaded(l.mediaSize)},l.setInitialCrop=function(e){var t,n,o,r,i,a,s,c;l.props.initialCroppedAreaPercentages?(o=l.props.initialCroppedAreaPercentages,r=l.mediaSize,i=l.props.rotation,a=e,s=l.props.minZoom,c=l.props.maxZoom,r=u(r.width,r.height,i),c=(s={crop:{x:(i=p(a.width/r.width*(100/o.width),s,c))*r.width/2-a.width/2-r.width*i*(o.x/100),y:i*r.height/2-a.height/2-r.height*i*(o.y/100)},zoom:i}).zoom,l.props.onCropChange(s.crop),l.props.onZoomChange&&l.props.onZoomChange(c)):l.props.initialCroppedAreaPixels&&(t=l.props.initialCroppedAreaPixels,a=l.mediaSize,r=l.props.rotation,n=e,o=l.props.minZoom,i=l.props.maxZoom,r=u(a.naturalWidth,a.naturalHeight,r=void 0===r?0:r),a=p(function(e){e=e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight;return n.height>n.width?n.height/(t.height*e):n.width/(t.width*e)}(a),o,i),o=n.height>n.width?n.height/t.height:n.width/t.width,c=(s={crop:{x:((r.width-t.width)/2-t.x)*o,y:((r.height-t.height)/2-t.y)*o},zoom:a}).zoom,l.props.onCropChange(s.crop),l.props.onZoomChange)&&l.props.onZoomChange(c)},l.computeSizes=function(){var e,t,n,o=l.imageRef.current||l.videoRef.current;if(o&&l.containerRef){l.containerRect=l.containerRef.getBoundingClientRect(),l.saveContainerPosition();var r=l.containerRect.width/l.containerRect.height,i=(null==(i=l.imageRef.current)?void 0:i.naturalWidth)||(null==(i=l.videoRef.current)?void 0:i.videoWidth)||0,a=(null==(a=l.imageRef.current)?void 0:a.naturalHeight)||(null==(a=l.videoRef.current)?void 0:a.videoHeight)||0,s=i/a,c=void 0;if(o.offsetWidth<i||o.offsetHeight<a)switch(l.getObjectFit()){default:case"contain":c=s<r?{width:l.containerRect.height*s,height:l.containerRect.height}:{width:l.containerRect.width,height:l.containerRect.width/s};break;case"horizontal-cover":c={width:l.containerRect.width,height:l.containerRect.width/s};break;case"vertical-cover":c={width:l.containerRect.height*s,height:l.containerRect.height}}else c={width:o.offsetWidth,height:o.offsetHeight};l.mediaSize=v(v({},c),{naturalWidth:i,naturalHeight:a}),l.props.setMediaSize&&l.props.setMediaSize(l.mediaSize);a=l.props.cropSize||(o=l.mediaSize.width,i=l.mediaSize.height,a=l.containerRect.width,e=l.containerRect.height,t=l.props.aspect,n=l.props.rotation,o=u(o,i,n=void 0===n?0:n),i=o.width,n=o.height,o=Math.min(i,a),(i=Math.min(n,e))*t<o?{width:i*t,height:i}:{width:o,height:o/t});return(null==(n=l.state.cropSize)?void 0:n.height)===a.height&&(null==(e=l.state.cropSize)?void 0:e.width)===a.width||l.props.onCropSizeChange&&l.props.onCropSizeChange(a),l.setState({cropSize:a},l.recomputeCropPosition),l.props.setCropSize&&l.props.setCropSize(a),a}},l.saveContainerPosition=function(){var e;l.containerRef&&(e=l.containerRef.getBoundingClientRect(),l.containerPosition={x:e.left,y:e.top})},l.onMouseDown=function(e){l.currentDoc&&(e.preventDefault(),l.currentDoc.addEventListener("mousemove",l.onMouseMove),l.currentDoc.addEventListener("mouseup",l.onDragStopped),l.saveContainerPosition(),l.onDragStart(s.getMousePoint(e)))},l.onMouseMove=function(e){return l.onDrag(s.getMousePoint(e))},l.onScroll=function(e){l.currentDoc&&(e.preventDefault(),l.saveContainerPosition())},l.onTouchStart=function(e){l.currentDoc&&(l.isTouching=!0,l.props.onTouchRequest&&!l.props.onTouchRequest(e)||(l.currentDoc.addEventListener("touchmove",l.onTouchMove,{passive:!1}),l.currentDoc.addEventListener("touchend",l.onDragStopped),l.saveContainerPosition(),2===e.touches.length?l.onPinchStart(e):1===e.touches.length&&l.onDragStart(s.getTouchPoint(e.touches[0]))))},l.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?l.onPinchMove(e):1===e.touches.length&&l.onDrag(s.getTouchPoint(e.touches[0]))},l.onGestureStart=function(e){l.currentDoc&&(e.preventDefault(),l.currentDoc.addEventListener("gesturechange",l.onGestureMove),l.currentDoc.addEventListener("gestureend",l.onGestureEnd),l.gestureZoomStart=l.props.zoom,l.gestureRotationStart=l.props.rotation)},l.onGestureMove=function(e){var t,n;e.preventDefault(),l.isTouching||(t=s.getMousePoint(e),n=l.gestureZoomStart-1+e.scale,l.setNewZoom(n,t,{shouldUpdatePosition:!0}),l.props.onRotationChange&&(n=l.gestureRotationStart+e.rotation,l.props.onRotationChange(n)))},l.onGestureEnd=function(e){l.cleanEvents()},l.onDragStart=function(e){var t=e.x,e=e.y;l.dragStartPosition={x:t,y:e},l.dragStartCrop=v({},l.props.crop),null!=(e=(t=l.props).onInteractionStart)&&e.call(t)},l.onDrag=function(e){var n=e.x,o=e.y;l.currentWindow&&(l.rafDragTimeout&&l.currentWindow.cancelAnimationFrame(l.rafDragTimeout),l.rafDragTimeout=l.currentWindow.requestAnimationFrame(function(){var e,t;l.state.cropSize&&void 0!==n&&void 0!==o&&(e=n-l.dragStartPosition.x,t=o-l.dragStartPosition.y,e={x:l.dragStartCrop.x+e,y:l.dragStartCrop.y+t},t=l.props.restrictPosition?c(e,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):e,l.props.onCropChange(t))}))},l.onDragStopped=function(){var e,t;l.isTouching=!1,l.cleanEvents(),l.emitCropData(),null!=(t=(e=l.props).onInteractionEnd)&&t.call(e)},l.onWheel=function(e){var t;!l.currentWindow||l.props.onWheelRequest&&!l.props.onWheelRequest(e)||(e.preventDefault(),t=s.getMousePoint(e),e=x()(e).pixelY,e=l.props.zoom-e*l.props.zoomSpeed/200,l.setNewZoom(e,t,{shouldUpdatePosition:!0}),l.state.hasWheelJustStarted||l.setState({hasWheelJustStarted:!0},function(){var e,t;return null==(t=(e=l.props).onInteractionStart)?void 0:t.call(e)}),l.wheelTimer&&clearTimeout(l.wheelTimer),l.wheelTimer=l.currentWindow.setTimeout(function(){return l.setState({hasWheelJustStarted:!1},function(){var e,t;return null==(t=(e=l.props).onInteractionEnd)?void 0:t.call(e)})},250))},l.getPointOnContainer=function(e,t){var n=e.x,e=e.y;if(l.containerRect)return{x:l.containerRect.width/2-(n-t.x),y:l.containerRect.height/2-(e-t.y)};throw new Error("The Cropper is not mounted")},l.getPointOnMedia=function(e){var t=e.x,e=e.y,n=l.props,o=n.crop,n=n.zoom;return{x:(t+o.x)/n,y:(e+o.y)/n}},l.setNewZoom=function(e,t,n){var n=(void 0===n?{}:n).shouldUpdatePosition,n=void 0===n||n;l.state.cropSize&&l.props.onZoomChange&&(e=p(e,l.props.minZoom,l.props.maxZoom),n&&(n=l.getPointOnContainer(t,l.containerPosition),t={x:(t=l.getPointOnMedia(n)).x*e-n.x,y:t.y*e-n.y},n=l.props.restrictPosition?c(t,l.mediaSize,l.state.cropSize,e,l.props.rotation):t,l.props.onCropChange(n)),l.props.onZoomChange(e))},l.getCropData=function(){return l.state.cropSize?(e=l.props.restrictPosition?c(l.props.crop,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):l.props.crop,t=l.mediaSize,n=l.state.cropSize,o=l.getAspect(),r=l.props.zoom,i=l.props.rotation,a=(a=void 0===(a=l.props.restrictPosition)?!0:a)?E:z,s=u(t.width,t.height,i=void 0===i?0:i),t=u(t.naturalWidth,t.naturalHeight,i),i={x:a(100,((s.width-n.width/r)/2-e.x/r)/s.width*100),y:a(100,((s.height-n.height/r)/2-e.y/r)/s.height*100),width:a(100,n.width/s.width*100/r),height:a(100,n.height/s.height*100/r)},e=Math.round(a(t.width,i.width*t.width/100)),n=Math.round(a(t.height,i.height*t.height/100)),s=t.width>=t.height*o?{width:Math.round(n*o),height:n}:{width:e,height:Math.round(e/o)},{croppedAreaPercentages:i,croppedAreaPixels:v(v({},s),{x:Math.round(a(t.width-s.width,i.x*t.width/100)),y:Math.round(a(t.height-s.height,i.y*t.height/100))})}):null;var e,t,n,o,r,i,a,s},l.emitCropData=function(){var e,t=l.getCropData();t&&(e=t.croppedAreaPercentages,t=t.croppedAreaPixels,l.props.onCropComplete&&l.props.onCropComplete(e,t),l.props.onCropAreaChange)&&l.props.onCropAreaChange(e,t)},l.emitCropAreaChange=function(){var e,t=l.getCropData();t&&(e=t.croppedAreaPercentages,t=t.croppedAreaPixels,l.props.onCropAreaChange)&&l.props.onCropAreaChange(e,t)},l.recomputeCropPosition=function(){var e;l.state.cropSize&&(e=l.props.restrictPosition?c(l.props.crop,l.mediaSize,l.state.cropSize,l.props.zoom,l.props.rotation):l.props.crop,l.props.onCropChange(e),l.emitCropData())},l}function I(){this.constructor=a}const W="img-crop",L=Object(X.forwardRef)((e,t)=>{const{cropperRef:n,zoomSlider:o,rotationSlider:r,aspectSlider:i,showReset:a,resetBtnText:s,modalImage:c,aspect:l,minZoom:u,maxZoom:p,cropShape:d,showGrid:f,cropperProps:h}=e,[m,g]=Object(X.useState)(1),[b,v]=Object(X.useState)(0),[y,w]=Object(X.useState)(l),O=1!==m||0!==b||y!==l,x=()=>{g(1),v(0),w(l)},[j,S]=Object(X.useState)({x:0,y:0}),C=Object(X.useRef)({width:0,height:0,x:0,y:0}),E=Object(X.useCallback)((e,t)=>{C.current=t},[]);Object(X.useImperativeHandle)(t,()=>({rotation:b,cropPixelsRef:C,onReset:x}));e="[display:flex] [align-items:center] [width:60%] [margin-inline:auto]",t="[display:flex] [align-items:center] [justify-content:center] [height:32px] [width:32px] [background:transparent] [border:0] [font-family:inherit] [font-size:18px] [cursor:pointer] disabled:[opacity:20%] disabled:[cursor:default]";return Object($.jsxs)($.Fragment,{children:[Object($.jsx)(T,Object.assign({},h,{ref:n,image:c,crop:j,zoom:m,rotation:b,aspect:y,minZoom:u,maxZoom:p,zoomWithScroll:o,cropShape:d,showGrid:f,onCropChange:S,onZoomChange:g,onRotationChange:v,onCropComplete:E,classes:{containerClassName:W+"-container ![position:relative] [width:100%] [height:40vh] [&~section:first-of-type]:[margin-top:16px] [&~section:last-of-type]:[margin-bottom:16px]",mediaClassName:W+"-media"}})),o&&Object($.jsxs)("section",{className:W+`-control ${W}-control-zoom `+e,children:[Object($.jsx)("button",{className:t,onClick:()=>g(m-.1),disabled:m-.1<u,children:"-"}),Object($.jsx)(k.a,{className:"[flex:1]",min:u,max:p,step:.1,value:m,onChange:g}),Object($.jsx)("button",{className:t,onClick:()=>g(m+.1),disabled:m+.1>p,children:"+"})]}),r&&Object($.jsxs)("section",{className:W+`-control ${W}-control-rotation `+e,children:[Object($.jsx)("button",{className:t+" [font-size:16px]",onClick:()=>v(b-1),disabled:-180===b,children:"↺"}),Object($.jsx)(k.a,{className:"[flex:1]",min:-180,max:180,step:1,value:b,onChange:v}),Object($.jsx)("button",{className:t+" [font-size:16px]",onClick:()=>v(b+1),disabled:180===b,children:"↻"})]}),i&&Object($.jsxs)("section",{className:W+`-control ${W}-control-aspect `+e,children:[Object($.jsx)("button",{className:t,onClick:()=>w(y-.01),disabled:y-.01<.5,children:"↕️"}),Object($.jsx)(k.a,{className:"[flex:1]",min:.5,max:2,step:.01,value:y,onChange:w}),Object($.jsx)("button",{className:t,onClick:()=>w(y+.01),disabled:2<y+.01,children:"↔️"})]}),a&&(o||r||i)&&Object($.jsx)(P.a,{className:"[bottom:20px] [position:absolute]",style:O?{}:{opacity:.3,pointerEvents:"none"},onClick:x,children:s})]})});var l,d,f,B=Object(X.memo)(L);r=".visible{visibility:visible}.grid{display:grid}.\\!\\[position\\:relative\\]{position:relative!important}.\\[align-items\\:center\\]{align-items:center}.\\[background\\:transparent\\]{background:transparent}.\\[border\\:0\\]{border:0}.\\[bottom\\:20px\\]{bottom:20px}.\\[cursor\\:pointer\\]{cursor:pointer}.\\[display\\:flex\\]{display:flex}.\\[flex\\:1\\]{flex:1}.\\[font-family\\:inherit\\]{font-family:inherit}.\\[font-size\\:16px\\]{font-size:16px}.\\[font-size\\:18px\\]{font-size:18px}.\\[height\\:32px\\]{height:32px}.\\[height\\:40vh\\]{height:40vh}.\\[justify-content\\:center\\]{justify-content:center}.\\[margin-inline\\:auto\\]{margin-inline:auto}.\\[position\\:absolute\\]{position:absolute}.\\[width\\:100\\%\\]{width:100%}.\\[width\\:32px\\]{width:32px}.\\[width\\:60\\%\\]{width:60%}.disabled\\:\\[cursor\\:default\\]:disabled{cursor:default}.disabled\\:\\[opacity\\:20\\%\\]:disabled{opacity:20%}.\\[\\&\\~section\\:first-of-type\\]\\:\\[margin-top\\:16px\\]~section:first-of-type{margin-top:16px}.\\[\\&\\~section\\:last-of-type\\]\\:\\[margin-bottom\\:16px\\]~section:last-of-type{margin-bottom:16px}",l=(l=void 0===(l={insertAt:"top"})?{}:l).insertAt,"undefined"!=typeof document&&(d=document.head||document.getElementsByTagName("head")[0],(f=document.createElement("style")).type="text/css","top"===l&&d.firstChild?d.insertBefore(f,d.firstChild):d.appendChild(f),f.styleSheet?f.styleSheet.cssText=r:f.appendChild(document.createTextNode(r)));const G=-1===(l=n.a,l=o(l),d=o("4.23.0"),f=l.pop(),r=d.pop(),0!==(l=w(l,d))?l:f&&r?w(f.split("."),r.split(".")):f||r?f?-1:1:0)?"visible":"open",H=(e,t,n)=>t in e?(console.error(`\`${t}\` is deprecated, please use \`${n}\` instead`),e[t]):e[n],se=Object(X.forwardRef)((e,t)=>{const{quality:l=.4,fillColor:g="white",aspectSlider:n=!1,showReset:o=!1,resetText:r,aspect:i=1,minZoom:a=1,maxZoom:s=3,cropperProps:c,modalClassName:u,modalTitle:p,modalWidth:d,modalOk:f,modalCancel:h,onModalOk:m,onModalCancel:b,modalProps:v,beforeCrop:y,children:w}=e,O=H(e,"zoom","zoomSlider")||!0,x=H(e,"rotate","rotationSlider")||!1,j=H(e,"shape","cropShape")||"rect",S=H(e,"grid","showGrid")||!1,C=("onUploadFail"in e&&console.error("`onUploadFail` is removed, because the only way it is called, is when the file is rejected by beforeUpload"),H(e,"modalMaskTransitionName","modalProps.maskTransitionName"),H(e,"modalTransitionName","modalProps.transitionName"),Object(X.useRef)({})),E=(C.current.onModalOk=m,C.current.onModalCancel=b,C.current.beforeCrop=y,Object(X.useRef)(null)),k=Object(X.useCallback)(e=>{var t,n=document.createElement("canvas"),o=n.getContext("2d"),r=((null==(t=null==e?void 0:e.getRootNode)?void 0:t.call(e))||document).querySelector(`.${W}-media`),{width:i,height:a,x:s,y:c}=E.current.cropPixelsRef.current;if(x&&0!==E.current.rotation){const{naturalWidth:e,naturalHeight:t}=r,p=E.current.rotation*(Math.PI/180),d=Math.abs(Math.sin(p)),f=Math.abs(Math.cos(p)),h=e*f+t*d,m=t*f+e*d;n.width=h,n.height=m,o.fillStyle=g,o.fillRect(0,0,h,m);var l=h/2,u=m/2,l=(o.translate(l,u),o.rotate(p),o.translate(-l,-u),(h-e)/2),u=(m-t)/2,l=(o.drawImage(r,0,0,e,t,l,u,e,t),o.getImageData(0,0,h,m));n.width=i,n.height=a,o.putImageData(l,-s,-c)}else n.width=i,n.height=a,o.fillStyle=g,o.fillRect(0,0,i,a),o.drawImage(r,s,c,i,a,0,0,i,a);return n},[g,x]),[R,P]=Object(X.useState)(""),z=Object(X.useRef)(),D=Object(X.useRef)(),T=Object(X.useCallback)((t,n,o,r)=>Object(_.b)(void 0,void 0,void 0,function*(){var e=n;if("function"==typeof t)try{const r=yield t(n,[n]);o(!0!==r?r:e)}catch(e){r(e)}else o(e)}),[]),I=Object(X.useCallback)(c=>(s,t)=>new Promise((i,a)=>Object(_.b)(void 0,void 0,void 0,function*(){if("function"==typeof C.current.beforeCrop)try{if(!1===(yield C.current.beforeCrop(s,t)))return T(c,s,i,a)}catch(e){return T(c,s,i,a)}const e=new FileReader;e.addEventListener("load",()=>{"string"==typeof e.result&&P(e.result)}),e.readAsDataURL(s),z.current=()=>{var e,t;P(""),E.current.onReset(),i(J.a.LIST_IGNORE),null!=(t=(e=C.current).onModalCancel)&&t.call(e,i)},D.current=t=>Object(_.b)(void 0,void 0,void 0,function*(){P(""),E.current.onReset();const e=k(t.target),{type:n,name:o,uid:r}=s;e.toBlob(t=>Object(_.b)(void 0,void 0,void 0,function*(){var e=new File([t],o,{type:n});Object.assign(e,{uid:r}),T(c,e,e=>{var t,n;i(e),null!=(n=(t=C.current).onModalOk)&&n.call(t,e)},e=>{var t,n;a(e),null!=(n=(t=C.current).onModalOk)&&n.call(t,e)})}),n,l)})})),[k,l,T]),L=Object(X.useCallback)(e=>{var e=Array.isArray(e)?e[0]:e,t=e.props,{beforeUpload:n,accept:o}=t,t=Object(_.f)(t,["beforeUpload","accept"]);return Object.assign(Object.assign({},e),{props:Object.assign(Object.assign({},t),{accept:o||"image/*",beforeUpload:I(n)})})},[I]),N=Object(X.useMemo)(()=>{var e={};return void 0!==d&&(e.width=d),void 0!==f&&(e.okText=f),void 0!==h&&(e.cancelText=h),e},[h,f,d]),U=W+"-modal"+(u?" "+u:""),M="zh-CN"===("undefined"==typeof window?"":window.navigator.language),A=p||(M?"编辑图片":"Edit image"),F=r||(M?"重置":"Reset");return Object($.jsxs)($.Fragment,{children:[L(w),R&&Object($.jsx)(K.a,Object.assign({},v,N,{[G]:!0,title:A,onCancel:z.current,onOk:D.current,wrapClassName:U,maskClosable:!1,destroyOnClose:!0,children:Object($.jsx)(B,{ref:E,cropperRef:t,zoomSlider:O,rotationSlider:x,aspectSlider:n,showReset:o,resetBtnText:F,modalImage:R,aspect:i,minZoom:a,maxZoom:s,cropShape:j,showGrid:S,cropperProps:c})}))]})});var ce=t(43),le=t(10),n=t(234);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 te(){return(te=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function M(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function ne(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?M(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==R(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==R(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===R(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):M(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function oe(){oe=function(){return a};var c,a={},e=Object.prototype,l=e.hasOwnProperty,u=Object.defineProperty||function(e,t,n){e[t]=n.value},t="function"==typeof Symbol?Symbol:{},o=t.iterator||"@@iterator",n=t.asyncIterator||"@@asyncIterator",r=t.toStringTag||"@@toStringTag";function i(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{i({},"")}catch(c){i=function(e,t,n){return e[t]=n}}function s(e,t,n,o){var r,i,a,s,t=t&&t.prototype instanceof g?t:g,t=Object.create(t.prototype),o=new C(o||[]);return u(t,"_invoke",{value:(r=e,i=n,a=o,s=d,function(e,t){if(s===f)throw new Error("Generator is already running");if(s===h){if("throw"===e)throw t;return{value:c,done:!0}}for(a.method=e,a.arg=t;;){var n=a.delegate;if(n){n=function e(t,n){var o=n.method,r=t.iterator[o];if(r===c)return n.delegate=null,"throw"===o&&t.iterator.return&&(n.method="return",n.arg=c,e(t,n),"throw"===n.method)||"return"!==o&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+o+"' method")),m;o=p(r,t.iterator,n.arg);if("throw"===o.type)return n.method="throw",n.arg=o.arg,n.delegate=null,m;r=o.arg;return r?r.done?(n[t.resultName]=r.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=c),n.delegate=null,m):r:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,m)}(n,a);if(n){if(n===m)continue;return n}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(s===d)throw s=h,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);s=f;n=p(r,i,a);if("normal"===n.type){if(s=a.done?h:"suspendedYield",n.arg===m)continue;return{value:n.arg,done:a.done}}"throw"===n.type&&(s=h,a.method="throw",a.arg=n.arg)}})}),t}function p(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}a.wrap=s;var d="suspendedStart",f="executing",h="completed",m={};function g(){}function b(){}function v(){}var t={},y=(i(t,o,function(){return this}),Object.getPrototypeOf),y=y&&y(y(E([]))),w=(y&&y!==e&&l.call(y,o)&&(t=y),v.prototype=g.prototype=Object.create(t));function O(e){["next","throw","return"].forEach(function(t){i(e,t,function(e){return this._invoke(t,e)})})}function x(a,s){var t;u(this,"_invoke",{value:function(n,o){function e(){return new s(function(e,t){!function t(e,n,o,r){var i,e=p(a[e],a,n);if("throw"!==e.type)return(n=(i=e.arg).value)&&"object"==R(n)&&l.call(n,"__await")?s.resolve(n.__await).then(function(e){t("next",e,o,r)},function(e){t("throw",e,o,r)}):s.resolve(n).then(function(e){i.value=e,o(i)},function(e){return t("throw",e,o,r)});r(e.arg)}(n,o,e,t)})}return t=t?t.then(e,e):e()}})}function j(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function C(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(j,this),this.reset(!0)}function E(t){if(t||""===t){var n,e=t[o];if(e)return e.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length))return n=-1,(e=function e(){for(;++n<t.length;)if(l.call(t,n))return e.value=t[n],e.done=!1,e;return e.value=c,e.done=!0,e}).next=e}throw new TypeError(R(t)+" is not iterable")}return u(w,"constructor",{value:b.prototype=v,configurable:!0}),u(v,"constructor",{value:b,configurable:!0}),b.displayName=i(v,r,"GeneratorFunction"),a.isGeneratorFunction=function(e){e="function"==typeof e&&e.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},a.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,v):(e.__proto__=v,i(e,r,"GeneratorFunction")),e.prototype=Object.create(w),e},a.awrap=function(e){return{__await:e}},O(x.prototype),i(x.prototype,n,function(){return this}),a.AsyncIterator=x,a.async=function(e,t,n,o,r){void 0===r&&(r=Promise);var i=new x(s(e,t,n,o),r);return a.isGeneratorFunction(t)?i:i.next().then(function(e){return e.done?e.value:i.next()})},O(w),i(w,r,"Generator"),i(w,o,function(){return this}),i(w,"toString",function(){return"[object Generator]"}),a.keys=function(e){var t,n=Object(e),o=[];for(t in n)o.push(t);return o.reverse(),function e(){for(;o.length;){var t=o.pop();if(t in n)return e.value=t,e.done=!1,e}return e.done=!0,e}},a.values=E,C.prototype={constructor:C,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=c,this.done=!1,this.delegate=null,this.method="next",this.arg=c,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&l.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=c)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(n){if(this.done)throw n;var o=this;function e(e,t){return i.type="throw",i.arg=n,o.next=e,t&&(o.method="next",o.arg=c),!!t}for(var t=this.tryEntries.length-1;0<=t;--t){var r=this.tryEntries[t],i=r.completion;if("root"===r.tryLoc)return e("end");if(r.tryLoc<=this.prev){var a=l.call(r,"catchLoc"),s=l.call(r,"finallyLoc");if(a&&s){if(this.prev<r.catchLoc)return e(r.catchLoc,!0);if(this.prev<r.finallyLoc)return e(r.finallyLoc)}else if(a){if(this.prev<r.catchLoc)return e(r.catchLoc,!0)}else{if(!s)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return e(r.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;0<=n;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&l.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var r=o;break}}var i=(r=r&&("break"===e||"continue"===e)&&r.tryLoc<=t&&t<=r.finallyLoc?null:r)?r.completion:{};return i.type=e,i.arg=t,r?(this.method="next",this.next=r.finallyLoc,m):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),m},finish:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),S(n),m}},catch:function(e){for(var t=this.tryEntries.length-1;0<=t;--t){var n,o,r=this.tryEntries[t];if(r.tryLoc===e)return"throw"===(n=r.completion).type&&(o=n.arg,S(r)),o}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:E(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=c),m}},a}function ue(e,t,n,o,r,i,a){try{var s=e[i](a),c=s.value}catch(e){return n(e)}s.done?t(c):Promise.resolve(c).then(o,r)}function re(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(e,t)||pe(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function pe(e,t){var n;if(e)return"string"==typeof e?ie(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?ie(e,t):void 0}function ie(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function N(e){function t(){return T(!1)}var n,o=e.id,r=e.className,i=e.style,a=e.key,s=e.locale,c=e.apiUrl,l=e.apiUrlExtraParams,N=e.headers,U=e.withCredentials,u=e.downloadUrl,p=e.downloadUrlExtraParams,d=e.downloadUrlFromBackend,A=e.editable,F=e.editConfig,f=e.uploadId,h=e.fileListMaxLength,m=e.buttonContent,g=e.fileTypes,b=e.fileMaxSize,_=e.failedTooltipInfo,v=e.showRemoveIcon,y=e.showPreviewIcon,w=e.confirmBeforeDelete,O=e.showPercent,x=e.progressProps,$=e.showSuccessMessage,W=e.showErrorMessage,j=e.listUploadTaskRecord,S=e.defaultFileList,C=e.disabled,E=e.status,k=e.loading_state,R=e.setProps,s=(e=Object(X.useContext)(ce.a))&&e.locale||s,d=!u&&d,P=(M=j=j||[],n=new Map,M.forEach(function(e){n.set(e.uid,e.completeTimestamp)}),n);Object(X.useEffect)(function(){f||(S&&0<S.length?R({uploadId:S[0].taskId||Object(V.a)()}):R({uploadId:Object(V.a)()}))},[]);var z=(M=re(Object(X.useState)(S||j.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),2))[0],H=M[1],D=(M=re(Object(X.useState)(!1),2))[0],T=M[1],I=(M=re(Object(X.useState)(""),2))[0],B=M[1],L=(M=re(Object(X.useState)(""),2))[0],G=M[1],M=function(){var s;s=oe().mark(function e(t){return oe().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t.url||t.preview){e.next=4;break}e.next=3;var o=t.originFileObj;return new Promise(function(e,t){var n=new FileReader;n.readAsDataURL(o),n.onload=function(){return e(n.result)},n.onerror=function(e){return t(e)}});case 3:t.preview=e.sent;case 4:B(t.url||t.preview),T(!0),G(t.name||t.url.substring(t.url.lastIndexOf("/")+1));case 7:case"end":return e.stop()}},e)});return function(e){return function(){var e=this,a=arguments;return new Promise(function(t,n){var o=s.apply(e,a);function r(e){ue(o,t,n,r,i,"next",e)}function i(e){ue(o,t,n,r,i,"throw",e)}r(void 0)})}.apply(this,arguments)}}(),m=Z.a.createElement("div",null,Z.a.createElement(ae.a,null),Z.a.createElement("div",{style:{marginTop:8}},m)),c={name:"file",action:c+"?uploadId=".concat(f),headers:N,data:ne({uploadId:f},l),withCredentials:U,beforeUpload:function(e){var t=e.size/1024/1024<b;return t||q.a.error("".concat(e.name).concat(Q.a.Upload[s].sizeError[0]).concat(b).concat(Q.a.Upload[s].sizeError[1])),g?(-1===g.indexOf(e.name.split(".")[e.name.split(".").length-1])&&q.a.error("".concat(Q.a.Upload[s].typeError[0]).concat(e.name).concat(Q.a.Upload[s].typeError[1])),t&&-1!==g.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-j.length,e=("removed"===e.file.status?R({listUploadTaskRecord:e.fileList.map(function(e){var t=d?e.response?{url:e.response.url}:{}:u&&"done"===e.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return ne(ne({fileName:e.name,fileSize:e.size,completeTimestamp:P.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:f,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||R({lastUploadTaskRecord:ne(ne({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:f},d?e.file.response?{url:e.file.response.url}:{}:u&&"done"===e.file.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.file.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=d?e.response?{url:e.response.url}:{}:u&&"done"===e.status?{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return ne(ne({fileName:e.name,fileSize:e.size,completeTimestamp:P.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:f,uid:e.uid},t),n)})}),"done"===e.file.status&&$?q.a.success("".concat(e.file.name," ").concat(Q.a.Upload[s].uploadSuccess)):"error"===e.file.status&&W&&q.a.error("".concat(e.file.name," ").concat(Q.a.Upload[s].uploadFailed)),function(e){if(Array.isArray(e))return ie(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||pe(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());h&&(e=e.slice(-h)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=_||"上传失败"),e}))),H(u?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return ne(ne({},e),{},{url:u+"?taskId=".concat(f,"&filename=").concat(e.name)+Object.keys(p).map(function(e){return"&".concat(e,"=").concat(p[e])}).join("")},t)}):d?e.map(function(e){return e.response?ne(ne({},e),{},{url:e.response.url,uploadResponse:e.response}):ne({},e)}):e)}};return g&&0!=g.length&&Object.assign(c,{accept:"."+g.join(",.")}),A?Z.a.createElement(Y.a,{locale:Q.b.get(s)},Z.a.createElement("div",{id:o,className:Object(ee.isString)(r)?r:r?Object(le.a)(r):void 0,style:ne(ne({border:"1px solid transparent",transition:"border 0.3s"},de.get(E)),i),key:a},Z.a.createElement(se,te({modalOk:"zh-cn"===s?"确定":"OK",modalCancel:"zh-cn"===s?"取消":"Cancel"},F),Z.a.createElement(J.a,te({},c,{fileList:z,listType:"picture-card",disabled:e&&!Object(ee.isUndefined)(e.componentDisabled)?e.componentDisabled:C,progress:x||O?{strokeColor:x&&x.strokeColor,strokeWidth:x&&x.strokeWidth||2,format:O?function(e){return e&&"".concat(x&&x.prefix||"").concat(parseFloat(e.toFixed(1))).concat(x&&x.suffix||"%")}:void 0}:void 0,showUploadList:{showRemoveIcon:v,showPreviewIcon:y},onPreview:M,onRemove:w?function(){return new Promise(function(e,t){K.a.confirm({title:Q.a.AntdPictureUpload[s].confirmBeforeDeleteTitle,okText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteOkText,cancelText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":k&&k.is_loading||void 0}),m)),Z.a.createElement(K.a,{visible:D,title:L,footer:null,onCancel:t},Z.a.createElement("img",{alt:"",style:{width:"100%"},src:I})))):Z.a.createElement(Y.a,{locale:Q.b.get(s)},Z.a.createElement("div",{id:o,className:Object(ee.isString)(r)?r:r?Object(le.a)(r):void 0,style:ne(ne({border:"1px solid transparent",transition:"border 0.3s"},de.get(E)),i),key:a},Z.a.createElement(J.a,te({},c,{fileList:z,listType:"picture-card",disabled:e&&!Object(ee.isUndefined)(e.componentDisabled)?e.componentDisabled:C,progress:x||O?{strokeColor:x&&x.strokeColor,strokeWidth:x&&x.strokeWidth||2,format:O?function(e){return e&&"".concat(x&&x.prefix||"").concat(parseFloat(e.toFixed(1))).concat(x&&x.suffix||"%")}:void 0}:void 0,showUploadList:{showRemoveIcon:v,showPreviewIcon:y},onPreview:M,onRemove:w?function(){return new Promise(function(e,t){K.a.confirm({title:Q.a.AntdPictureUpload[s].confirmBeforeDeleteTitle,okText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteOkText,cancelText:Q.a.AntdPictureUpload[s].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":k&&k.is_loading||void 0}),m),Z.a.createElement(K.a,{visible:D,title:L,footer:null,onCancel:t},Z.a.createElement("img",{alt:"",style:{width:"100%"},src:I}))))}var de=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px 0 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px 0 10px",transition:"border 0.3s"}]]);(e.default=N).defaultProps=n.b,N.propTypes=n.c},458:function(e,t,n){"use strict";n.r(t);var F=n(1),_=n.n(F),$=(n(0),n(395)),W=n(485),H=n(12),B=n(689),G=n(448),X=n(65),o=n(2),r={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M400 317.7h73.9V656c0 4.4 3.6 8 8 8h60c4.4 0 8-3.6 8-8V317.7H624c6.7 0 10.4-7.7 6.3-12.9L518.3 163a8 8 0 00-12.6 0l-112 141.7c-4.1 5.3-.4 13 6.3 13zM878 626h-60c-4.4 0-8 3.6-8 8v154H214V634c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v198c0 17.7 14.3 32 32 32h684c17.7 0 32-14.3 32-32V634c0-4.4-3.6-8-8-8z"}}]},name:"upload",theme:"outlined"},i=n(3),Z=F.forwardRef(function(e,t){return F.createElement(i.a,Object(o.a)({},e,{ref:t,icon:r}))}),V=n(50),q=n(9),Y=n(10),J=n(43),n=n(236);function a(e){return(a="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 K(){return(K=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n,o=arguments[t];for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(e[n]=o[n])}return e}).apply(this,arguments)}function s(t,e){var n,o=Object.keys(t);return Object.getOwnPropertySymbols&&(n=Object.getOwnPropertySymbols(t),e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),o.push.apply(o,n)),o}function Q(o){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?s(Object(r),!0).forEach(function(e){var t,n;t=o,e=r[n=e],(n=function(){var e=function(e){if("object"!==a(e)||null===e)return e;var t=e[Symbol.toPrimitive];if(void 0===t)return String(e);t=t.call(e,"string");if("object"!==a(t))return t;throw new TypeError("@@toPrimitive must return a primitive value.")}(n);return"symbol"===a(e)?e:String(e)}())in t?Object.defineProperty(t,n,{value:e,enumerable:!0,configurable:!0,writable:!0}):t[n]=e}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(e){Object.defineProperty(o,e,Object.getOwnPropertyDescriptor(r,e))})}return o}function ee(e,t){var n;if(e)return"string"==typeof e?te(e,t):"Map"===(n="Object"===(n=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:n)||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?te(e,t):void 0}function te(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,o=new Array(t);n<t;n++)o[n]=e[n];return o}function c(e){var t,n=e.id,o=e.className,r=e.style,i=e.key,a=e.locale,s=e.apiUrl,c=e.apiUrlExtraParams,l=e.headers,u=e.withCredentials,p=e.downloadUrl,d=e.downloadUrlExtraParams,f=e.downloadUrlFromBackend,h=e.uploadId,m=e.fileListMaxLength,g=e.buttonContent,b=e.buttonProps,v=e.fileTypes,y=e.fileMaxSize,w=e.showUploadList,O=e.multiple,x=e.directory,j=e.failedTooltipInfo,S=e.confirmBeforeDelete,C=e.showPercent,E=e.progressProps,k=e.showSuccessMessage,N=e.showErrorMessage,R=e.listUploadTaskRecord,P=e.defaultFileList,z=e.disabled,U=e.status,D=e.loading_state,T=e.setProps,a=(e=Object(F.useContext)(J.a))&&e.locale||a,f=!p&&f,I=(M=R=R||[],t=new Map,M.forEach(function(e){t.set(e.uid,e.completeTimestamp)}),t);Object(F.useEffect)(function(){h||(P&&0<P.length?T({uploadId:P[0].taskId||Object($.a)()}):T({uploadId:Object($.a)()}))},[]),M=Object(F.useState)(P||R.map(function(e){return{name:e.fileName,status:e.taskStatus,uid:e.uid,url:e.url,uploadResponse:e.uploadResponse,fileSize:e.fileSize}})),L=2;var L=(M=function(e){if(Array.isArray(e))return e}(M)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=n){var o,r,i,a,s=[],c=!0,l=!1;try{if(i=(n=n.call(e)).next,0===t){if(Object(n)!==n)return;c=!1}else for(;!(c=(o=i.call(n)).done)&&(s.push(o.value),s.length!==t);c=!0);}catch(e){l=!0,r=e}finally{try{if(!c&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(l)throw r}}return s}}(M,L)||ee(M,L)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}())[0],A=M[1],M={name:"file",action:s+"?uploadId=".concat(h),headers:l,data:Q({uploadId:h},c),withCredentials:u,beforeUpload:function(e){var t=e.size/1024/1024<y;return t||W.a.error("".concat(e.name).concat(V.a.Upload[a].sizeError[0]).concat(y).concat(V.a.Upload[a].sizeError[1])),v?(-1===v.indexOf(e.name.split(".")[e.name.split(".").length-1])&&W.a.error("".concat(V.a.Upload[a].typeError[0]).concat(e.name).concat(V.a.Upload[a].typeError[1])),t&&-1!==v.indexOf(e.name.split(".")[e.name.split(".").length-1])):t},onChange:function(e){var t,n="removed"===e.file.status?0:e.fileList.length-R.length,e=(O||x?"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):e.fileList.slice(-n).every(function(e){return"uploading"!==e.status})&&!e.fileList.slice(-n).every(function(e){return!e.status})&&0<n&&T({lastUploadTaskRecord:e.fileList.slice(-n).map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h},t),n)}),listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):"removed"===e.file.status?T({listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}):"done"!==e.file.status&&"error"!==e.file.status&&e.file.status||T({lastUploadTaskRecord:Q(Q({fileName:e.file.name,fileSize:e.file.size,completeTimestamp:(new Date).getTime(),taskStatus:"done"===e.file.status?"success":"failed",taskId:h},f?e.file.response?{url:e.file.response.url}:{}:p&&"done"===e.file.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.file.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{}),e.file.response?{uploadResponse:e.file.response}:{}),listUploadTaskRecord:e.fileList.map(function(e){var t=f?e.response?{url:e.response.url}:{}:p&&"done"===e.status?{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")}:{},n=e.response?{uploadResponse:e.response}:{};return Q(Q({fileName:e.name,fileSize:e.size,completeTimestamp:I.get(e.uid)||(new Date).getTime(),taskStatus:"done"===e.status?"success":"failed",taskId:h,uid:e.uid},t),n)})}),"done"===e.file.status&&k?W.a.success("".concat(e.file.name," ").concat(V.a.Upload[a].uploadSuccess)):"error"===e.file.status&&N&&W.a.error("".concat(e.file.name," ").concat(V.a.Upload[a].uploadFailed)),function(e){if(Array.isArray(e))return te(e)}(t=e.fileList)||function(){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}()||ee(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}());m&&(e=e.slice(-m)),0!=n&&(e=e.slice(0,e.length-n).concat(e.slice(-n).map(function(e){return"error"!==e.status&&e.status||(e.status="error",e.response=j||"上传失败"),e}))),A(p?e.map(function(e){var t=e.response?{uploadResponse:e.response}:{};return Q(Q({},e),{},{url:p+"?taskId=".concat(h,"&filename=").concat(e.name)+Object.keys(d).map(function(e){return"&".concat(e,"=").concat(d[e])}).join("")},t)}):f?e.map(function(e){return e.response?Q(Q({},e),{},{url:e.response.url,uploadResponse:e.response}):Q({},e)}):e)}};return v&&0!=v.length&&Object.assign(M,{accept:"."+v.join(",.")}),_.a.createElement(H.a,{locale:V.b.get(a)},_.a.createElement("div",{id:n,className:Object(q.isString)(o)?o:o?Object(Y.a)(o):void 0,style:Q(Q({border:"1px solid transparent",transition:"border 0.3s"},ne.get(U)),r),key:i},_.a.createElement(B.a,K({},M,{className:null!=b&&b.block?"ant-upload-button-block":void 0,fileList:L,multiple:O,showUploadList:w,directory:x,disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:z,progress:E||C?{strokeColor:E&&E.strokeColor,strokeWidth:E&&E.strokeWidth||2,format:C?function(e){return e&&"".concat(E&&E.prefix||"").concat(parseFloat(e.toFixed(1))).concat(E&&E.suffix||"%")}:void 0}:void 0,onRemove:S?function(){return new Promise(function(e,t){G.a.confirm({title:V.a.AntdPictureUpload[a].confirmBeforeDeleteTitle,okText:V.a.AntdPictureUpload[a].confirmBeforeDeleteOkText,cancelText:V.a.AntdPictureUpload[a].confirmBeforeDeleteCancelText,onOk:function(){e(!0)}})})}:void 0,"data-dash-is-loading":D&&D.is_loading||void 0}),_.a.createElement(X.a,K({icon:_.a.createElement(Z,null),disabled:e&&!Object(q.isUndefined)(e.componentDisabled)?e.componentDisabled:z},b),g||"点击上传文件"))))}var ne=new Map([["warning",{border:"1px solid #faad14",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}],["error",{border:"1px solid #ff4d4f",borderRadius:"2px",padding:"6px 10px",transition:"border 0.3s"}]]);(t.default=c).defaultProps=n.b,c.propTypes=n.c},665:function(e,t,n){e.exports=n(666)},666:function(e,t,n){"use strict";var o=n(667),r=n(668);function i(e){var t=0,n=0,o=0,r=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),o=10*t,r=10*n,"deltaY"in e&&(r=e.deltaY),((o="deltaX"in e?e.deltaX:o)||r)&&e.deltaMode&&(1==e.deltaMode?(o*=40,r*=40):(o*=800,r*=800)),{spinX:t=o&&!t?o<1?-1:1:t,spinY:n=r&&!n?r<1?-1:1:n,pixelX:o,pixelY:r}}i.getEventType=function(){return o.firefox()?"DOMMouseScroll":r("wheel")?"wheel":"mousewheel"},e.exports=i},667:function(e,t){var r,i,a,s,c,l,u,p,d,f,h,m,g,b,v,y=!1;function n(){var e,t,n,o;y||(y=!0,e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e),m=/\b(iPhone|iP[ao]d)/.exec(e),g=/\b(iP[ao]d)/.exec(e),f=/Android/i.exec(e),b=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),h=!!/Win64/.exec(e),t?((r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(r=document.documentMode),o=/(?:Trident\/(\d+.\d+))/.exec(e),l=o?parseFloat(o[1])+4:r,i=t[2]?parseFloat(t[2]):NaN,a=t[3]?parseFloat(t[3]):NaN,c=(s=t[4]?parseFloat(t[4]):NaN)&&(t=/(?:Chrome\/(\d+\.\d+))/.exec(e))&&t[1]?parseFloat(t[1]):NaN):r=i=a=c=s=NaN,n?(u=!!n[1]&&(!(o=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e))||parseFloat(o[1].replace("_","."))),p=!!n[2],d=!!n[3]):u=p=d=!1)}var o={ie:function(){return n(),r},ieCompatibilityMode:function(){return n(),r<l},ie64:function(){return o.ie()&&h},firefox:function(){return n(),i},opera:function(){return n(),a},webkit:function(){return n(),s},safari:function(){return o.webkit()},chrome:function(){return n(),c},windows:function(){return n(),p},osx:function(){return n(),u},linux:function(){return n(),d},iphone:function(){return n(),m},mobile:function(){return n(),m||g||f||v},nativeApp:function(){return n(),b},android:function(){return n(),f},ipad:function(){return n(),g}};e.exports=o},668:function(e,t,n){"use strict";var r,i=n(669);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),e.exports=function(e,t){var n,o;return!(!i.canUseDOM||t&&!("addEventListener"in document))&&((n=(t="on"+e)in document)||((o=document.createElement("div")).setAttribute(t,"return;"),n="function"==typeof o[t]),!n&&r&&"wheel"===e?document.implementation.hasFeature("Events.wheel","3.0"):n)}},669:function(e,t,n){"use strict";var o=!("undefined"==typeof window||!window.document||!window.document.createElement),o={canUseDOM:o,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:o&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:o&&!!window.screen,isInWorker:!o};e.exports=o},689:function(j,S,e){"use strict";var ce=e(1),g=e.n(ce),le=e(8),ue=e(52),t=e(4),pe=e.n(t),b=e(2),r=e(35),t=e(36),n=e(57),o=e(56),v=e(6),C=e(13),p=e(53),E=e(15),k=e(85),R=e(47);function i(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(e){return t}}function P(o){var r=new XMLHttpRequest,n=(o.onProgress&&r.upload&&(r.upload.onprogress=function(e){0<e.total&&(e.percent=e.loaded/e.total*100),o.onProgress(e)}),new FormData),t=(o.data&&Object.keys(o.data).forEach(function(t){var e=o.data[t];Array.isArray(e)?e.forEach(function(e){n.append("".concat(t,"[]"),e)}):n.append(t,e)}),o.file instanceof Blob?n.append(o.filename,o.file,o.file.name):n.append(o.filename,o.file),r.onerror=function(e){o.onError(e)},r.onload=function(){return r.status<200||300<=r.status?o.onError((t=r,n="cannot ".concat((e=o).method," ").concat(e.action," ").concat(t.status,"'"),(n=new Error(n)).status=t.status,n.method=e.method,n.url=e.action,n),i(r)):o.onSuccess(i(r),r);var e,t,n},r.open(o.method,o.action,!0),o.withCredentials&&"withCredentials"in r&&(r.withCredentials=!0),o.headers||{});return null!==t["X-Requested-With"]&&r.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(t).forEach(function(e){null!==t[e]&&r.setRequestHeader(e,t[e])}),r.send(n),{abort:function(){r.abort()}}}var z=+new Date,D=0;function a(){return"rc-upload-".concat(z,"-").concat(++D)}function s(e,t){var o,r,i;return!e||!t||(t=Array.isArray(t)?t:t.split(","),o=e.name||"",r=e.type||"",i=r.replace(/\/.*$/,""),t.some(function(e){var t,n=e.trim();return!!/^\*(\/\*)?$/.test(e)||("."===n.charAt(0)?(t=o.toLowerCase(),(".jpg"!==(e=n.toLowerCase())&&".jpeg"!==e?[e]:[".jpg",".jpeg"]).some(function(e){return t.endsWith(e)})):/\/\*$/.test(n)?i===n.replace(/\/.*$/,""):r===n||!!/^\w+$/.test(n)&&(Object(I.a)(!1,"Upload takes an invalidate 'accept' type '".concat(n,"'.Skip for check.")),!0))}))}function T(e,t,i){function a(n,o){var e,r;n&&(n.path=o||"",n.isFile?n.file(function(e){i(e)&&(n.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=n.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))}):n.isDirectory&&(e=n.createReader(),r=[],function t(){e.readEntries(function(e){e=Array.prototype.slice.apply(e);r=r.concat(e),e.length?t():r.forEach(function(e){a(e,"".concat(o).concat(n.name,"/"))})})}()))}e.forEach(function(e){a(e.webkitGetAsEntry())})}var c,I=e(18),L=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],M=(m=ce.Component,Object(n.a)(l,m),c=Object(o.a)(l),Object(t.a)(l,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t,n,o,r,i,a,s=this,c=e.data,l=e.origin,u=e.action,p=e.parsedFile;this._isMounted&&(t=(e=this.props).onStart,a=e.customRequest,n=e.name,o=e.headers,r=e.withCredentials,e=e.method,i=l.uid,a=a||P,u={action:u,filename:n,data:c,file:p,headers:o,withCredentials:r,method:e||"post",onProgress:function(e){var t=s.props.onProgress;null!=t&&t(e,p)},onSuccess:function(e,t){var n=s.props.onSuccess;null!=n&&n(e,p,t),delete s.reqs[i]},onError:function(e,t){var n=s.props.onError;null!=n&&n(e,t,p),delete s.reqs[i]}},t(l),this.reqs[i]=a(u))}},{key:"reset",value:function(){this.setState({uid:a()})}},{key:"abort",value:function(e){var t=this.reqs;e?(e=e.uid||e,t[e]&&t[e].abort&&t[e].abort(),delete t[e]):Object.keys(t).forEach(function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]})}},{key:"render",value:function(){var e=this.props,t=e.component,n=e.prefixCls,o=e.className,r=e.disabled,i=e.id,a=e.style,s=e.multiple,c=e.accept,l=e.capture,u=e.children,p=e.directory,d=e.openFileDialogOnClick,f=e.onMouseEnter,h=e.onMouseLeave,e=Object(C.a)(e,L),n=pe()((m={},Object(v.a)(m,n,!0),Object(v.a)(m,"".concat(n,"-disabled"),r),Object(v.a)(m,o,o),m)),o=p?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},m=r?{}:{onClick:d?this.onClick:function(){},onKeyDown:d?this.onKeyDown:function(){},onMouseEnter:f,onMouseLeave:h,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return g.a.createElement(t,Object(b.a)({},m,{className:n,role:"button",style:a}),g.a.createElement("input",Object(b.a)({},Object(R.a)(e,{aria:!0,data:!0}),{id:i,disabled:r,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:c},o,{multiple:s,onChange:this.onChange},null!=l?{capture:l}:{})),u)}}]),l);function l(){var u;Object(r.a)(this,l);for(var n,e=arguments.length,t=new Array(e),o=0;o<e;o++)t[o]=arguments[o];return(u=c.call.apply(c,[this].concat(t))).state={uid:a()},u.reqs={},u.fileInput=void 0,u._isMounted=void 0,u.onChange=function(e){var t=u.props,n=t.accept,o=t.directory,t=e.target.files,e=Object(le.a)(t).filter(function(e){return!o||s(e,n)});u.uploadFiles(e),u.reset()},u.onClick=function(e){var t,n,o=u.fileInput;o&&(n=(t=u.props).children,t=t.onClick,n&&"button"===n.type&&((n=o.parentNode).focus(),n.querySelector("button").blur()),o.click(),t)&&t(e)},u.onKeyDown=function(e){"Enter"===e.key&&u.onClick(e)},u.onFileDrop=function(e){var t=u.props.multiple;e.preventDefault(),"dragover"!==e.type&&(u.props.directory?T(Array.prototype.slice.call(e.dataTransfer.items),u.uploadFiles,function(e){return s(e,u.props.accept)}):(e=Object(le.a)(e.dataTransfer.files).filter(function(e){return s(e,u.props.accept)}),!1===t&&(e=e.slice(0,1)),u.uploadFiles(e)))},u.uploadFiles=function(e){var t=Object(le.a)(e),e=t.map(function(e){return e.uid=a(),u.processFile(e,t)});Promise.all(e).then(function(e){var t=u.props.onBatchStart;null!=t&&t(e.map(function(e){return{file:e.origin,parsedFile:e.parsedFile}})),e.filter(function(e){return null!==e.parsedFile}).forEach(function(e){u.post(e)})})},u.processFile=(n=Object(k.a)(Object(p.a)().mark(function e(t,n){var o,r,i,a,s,c,l;return Object(p.a)().wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(c=u.props.beforeUpload,o=t,c)return e.prev=3,e.next=6,c(t,n);e.next=14;break;case 6:o=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),o=!1;case 12:if(!1===o)return e.abrupt("return",{origin:t,parsedFile:null,action:null,data:null});e.next=14;break;case 14:if("function"==typeof(r=u.props.action))return e.next=18,r(t);e.next=21;break;case 18:i=e.sent,e.next=22;break;case 21:i=r;case 22:if("function"==typeof(a=u.props.data))return e.next=26,a(t);e.next=29;break;case 26:s=e.sent,e.next=30;break;case 29:s=a;case 30:return c="object"!==Object(E.a)(o)&&"string"!=typeof o||!o?t:o,l=c instanceof File?c:new File([c],t.name,{type:t.type}),(l=l).uid=t.uid,e.abrupt("return",{origin:t,data:s,parsedFile:l,action:i});case 35:case"end":return e.stop()}},e,null,[[3,9]])})),function(e,t){return n.apply(this,arguments)}),u.saveFileInput=function(e){u.fileInput=e},u}function u(){}m=ce.Component,Object(n.a)(f,m),d=Object(o.a)(f),Object(t.a)(f,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return g.a.createElement(M,Object(b.a)({},this.props,{ref:this.saveUploader}))}}]);var d,n=f;function f(){var t;Object(r.a)(this,f);for(var e=arguments.length,n=new Array(e),o=0;o<e;o++)n[o]=arguments[o];return(t=d.call.apply(d,[this].concat(n))).uploader=void 0,t.saveUploader=function(e){t.uploader=e},t}n.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:u,onError:u,onSuccess:u,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var de=n,ve=e(31),fe=e(42),ye=e(63),we=e(121),Oe=e(58),h=e(11),N=e(477),m=e(144),_=e(79),o=e(14),$=e(197);const y=new o.a("uploadAnimateInlineIn",{from:{width:0,height:0,margin:0,padding:0,opacity:0}}),w=new o.a("uploadAnimateInlineOut",{to:{width:0,height:0,margin:0,padding:0,opacity:0}});var O=e(37),W=e(200);var xe=Object(m.a)("Upload",e=>{var{fontSizeHeading3:t,fontSize:n,lineHeight:o,lineWidth:r,controlHeightLG:i}=e,n=Math.round(n*o),o=Object(_.b)(e,{uploadThumbnailSize:2*t,uploadProgressOffset:n/2+r,uploadPicCardSize:2.55*i});return[(e=>{var{componentCls:t,colorTextDisabled:n}=e;return{[t+"-wrapper"]:Object.assign(Object.assign({},Object(h.f)(e)),{[t]:{outline:0,"input[type='file']":{cursor:"pointer"}},[t+"-select"]:{display:"inline-block"},[t+"-disabled"]:{color:n,cursor:"not-allowed"}})}})(o),(e=>{var{componentCls:t,iconCls:n}=e;return{[t+"-wrapper"]:{[t+"-drag"]:{position:"relative",width:"100%",height:"100%",textAlign:"center",background:e.colorFillAlter,border:e.lineWidth+"px dashed "+e.colorBorder,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color "+e.motionDurationSlow,[t]:{padding:e.padding+"px 0"},[t+"-btn"]:{display:"table",width:"100%",height:"100%",outline:"none"},[t+"-drag-container"]:{display:"table-cell",verticalAlign:"middle"},[`
|
|
2
2
|
&:not(${t}-disabled):hover,
|
|
3
3
|
&-hover:not(${t}-disabled)
|
|
4
4
|
`]:{borderColor:e.colorPrimaryHover},[`p${t}-drag-icon`]:{marginBottom:e.margin,[n]:{color:e.colorPrimary,fontSize:e.uploadThumbnailSize}},[`p${t}-text`]:{margin:`0 0 ${e.marginXXS}px`,color:e.colorTextHeading,fontSize:e.fontSizeLG},[`p${t}-hint`]:{color:e.colorTextDescription,fontSize:e.fontSize},[`&${t}-disabled`]:{[`p${t}-drag-icon ${n},
|
|
@@ -14,4 +14,4 @@
|
|
|
14
14
|
`]:Object.assign(Object.assign({},Object(h.a)()),{display:"inline-block",width:"100%",[""+t+t+"-select"]:{width:s,height:s,marginInlineEnd:e.marginXS,marginBottom:e.marginXS,textAlign:"center",verticalAlign:"top",backgroundColor:e.colorFillAlter,border:e.lineWidth+"px dashed "+e.colorBorder,borderRadius:e.borderRadiusLG,cursor:"pointer",transition:"border-color "+e.motionDurationSlow,["> "+t]:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",textAlign:"center"},[`&:not(${t}-disabled):hover`]:{borderColor:e.colorPrimary}},[i+i+`-picture-card, ${i}${i}-picture-circle`]:{[i+"-item-container"]:{display:"inline-block",width:s,height:s,marginBlock:`0 ${e.marginXS}px`,marginInline:`0 ${e.marginXS}px`,verticalAlign:"top"},"&::after":{display:"none"},[a]:{height:"100%",margin:0,"&::before":{position:"absolute",zIndex:1,width:`calc(100% - ${2*e.paddingXS}px)`,height:`calc(100% - ${2*e.paddingXS}px)`,backgroundColor:e.colorBgMask,opacity:0,transition:"all "+e.motionDurationSlow,content:'" "'}},[a+":hover"]:{[`&::before, ${a}-actions`]:{opacity:1}},[a+"-actions"]:{position:"absolute",insetInlineStart:0,zIndex:10,width:"100%",whiteSpace:"nowrap",textAlign:"center",opacity:0,transition:"all "+e.motionDurationSlow,[n+`-eye, ${n}-download, ${n}-delete`]:{zIndex:10,width:o,margin:`0 ${e.marginXXS}px`,fontSize:o,cursor:"pointer",transition:"all "+e.motionDurationSlow,svg:{verticalAlign:"baseline"}}},[a+`-actions, ${a}-actions:hover`]:{[n+`-eye, ${n}-download, ${n}-delete`]:{color:new W.a(r).setAlpha(.65).toRgbString(),"&:hover":{color:r}}},[a+`-thumbnail, ${a}-thumbnail img`]:{position:"static",display:"block",width:"100%",height:"100%",objectFit:"contain"},[a+"-name"]:{display:"none",textAlign:"center"},[a+`-file + ${a}-name`]:{position:"absolute",bottom:e.margin,display:"block",width:`calc(100% - ${2*e.paddingXS}px)`},[a+"-uploading"]:{["&"+a]:{backgroundColor:e.colorFillAlter},[`&::before, ${n}-eye, ${n}-download, ${n}-delete`]:{display:"none"}},[a+"-progress"]:{bottom:e.marginXL,width:`calc(100% - ${2*e.paddingXS}px)`,paddingInlineStart:0}}}),[t+`-wrapper${t}-picture-circle-wrapper`]:{[""+t+t+"-select"]:{borderRadius:"50%"}}}})(o),(e=>{var{componentCls:t,antCls:n,iconCls:o,fontSize:r,lineHeight:i}=e,a=t+"-list-item",s=a+"-actions",c=a+"-action",l=Math.round(r*i);return{[t+"-wrapper"]:{[t+"-list"]:Object.assign(Object.assign({},Object(h.a)()),{lineHeight:e.lineHeight,[a]:{position:"relative",height:e.lineHeight*r,marginTop:e.marginXS,fontSize:r,display:"flex",alignItems:"center",transition:"background-color "+e.motionDurationSlow,"&:hover":{backgroundColor:e.controlItemBgHover},[a+"-name"]:Object.assign(Object.assign({},h.h),{padding:`0 ${e.paddingXS}px`,lineHeight:i,flex:"auto",transition:"all "+e.motionDurationSlow}),[s]:{[c]:{opacity:0},[c+n+"-btn-sm"]:{height:l,border:0,lineHeight:1,"> span":{transform:"scale(1)"}},[`
|
|
15
15
|
${c}:focus-visible,
|
|
16
16
|
&.picture ${c}
|
|
17
|
-
`]:{opacity:1},[o]:{color:e.actionsColor,transition:"all "+e.motionDurationSlow},["&:hover "+o]:{color:e.colorText}},[t+"-icon "+o]:{color:e.colorTextDescription,fontSize:r},[a+"-progress"]:{position:"absolute",bottom:-e.uploadProgressOffset,width:"100%",paddingInlineStart:r+e.paddingXS,fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[a+":hover "+c]:{opacity:1,color:e.colorText},[a+"-error"]:{color:e.colorError,[a+`-name, ${t}-icon `+o]:{color:e.colorError},[s]:{[o+`, ${o}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[t+"-list-item-container"]:{transition:`opacity ${e.motionDurationSlow}, height `+e.motionDurationSlow,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}})(o),[{[(t=(e=o).componentCls)+"-wrapper"]:{[(n=t+"-animate-inline")+`-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[n+`-appear, ${n}-enter`]:{animationName:y},[n+"-leave"]:{animationName:w}}},{[t+"-wrapper"]:Object($.a)(e)},y,w],(e=>{e=e.componentCls;return{[e+"-rtl"]:{direction:"rtl"}}})(o),Object(N.a)(o)]},e=>({actionsColor:e.colorTextDescription})),H={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},x=e(3),B=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:H}))}),U=e(101),G={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},X=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:G}))}),Z={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},V=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:Z}))}),A=e(34),q=e(156),Y=e(51),F=e(26),J=e(63);function he(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function me(t,e){var e=Object(le.a)(e),n=e.findIndex(e=>{e=e.uid;return e===t.uid});return-1===n?e.push(t):e[n]=t,e}function ge(t,e){const n=void 0!==t.uid?"uid":"name";return e.filter(e=>e[n]===t[n])[0]}const K=e=>0===e.indexOf("image/");var Q=e(410),ee=e(463),te=e(267),ne=e(298),oe=e(65),re=ce.forwardRef((e,t)=>{let{prefixCls:n,className:o,style:r,locale:i,listType:a,file:s,items:c,progress:l,iconRender:u,actionIconRender:p,itemRender:d,isImgUrl:f,showPreviewIcon:h,showRemoveIcon:m,showDownloadIcon:g,previewIcon:b,removeIcon:v,downloadIcon:y,onPreview:w,onDownload:O,onClose:x}=e;const j=s["status"],[S,C]=ce.useState(j),[E,k]=(ce.useEffect(()=>{"removed"!==j&&C(j)},[j]),ce.useState(!1));ce.useEffect(()=>{const e=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(e)}},[]);var R=u(s);let P=ce.createElement("div",{className:n+"-icon"},R);if("picture"===a||"picture-card"===a||"picture-circle"===a)if("uploading"===S||!s.thumbUrl&&!s.url){const e=pe()(n+"-list-item-thumbnail",{[n+"-list-item-file"]:"uploading"!==S});P=ce.createElement("div",{className:e},R)}else{const e=null!=f&&f(s)?ce.createElement("img",{src:s.thumbUrl||s.url,alt:s.name,className:n+"-list-item-image",crossOrigin:s.crossOrigin}):R,t=pe()(n+"-list-item-thumbnail",{[n+"-list-item-file"]:f&&!f(s)});P=ce.createElement("a",{className:t,onClick:e=>w(s,e),href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}var e=pe()(n+"-list-item",n+"-list-item-"+S),R="string"==typeof s.linkProps?JSON.parse(s.linkProps):s.linkProps,z=m?p(("function"==typeof v?v(s):v)||ce.createElement(Q.a,null),()=>x(s),n,i.removeFile):null,D=g&&"done"===S?p(("function"==typeof y?y(s):y)||ce.createElement(ee.a,null),()=>O(s),n,i.downloadFile):null,T="picture-card"!==a&&"picture-circle"!==a&&ce.createElement("span",{key:"download-delete",className:pe()(n+"-list-item-actions",{picture:"picture"===a})},D,z),I=pe()(n+"-list-item-name"),R=s.url?[ce.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:I,title:s.name},R,{href:s.url,onClick:e=>w(s,e)}),s.name),T]:[ce.createElement("span",{key:"view",className:I,onClick:e=>w(s,e),title:s.name},s.name),T],I=h?ce.createElement("a",{href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:s.url||s.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:e=>w(s,e),title:i.previewFile},"function"==typeof b?b(s):b||ce.createElement(te.a,null)):null,T=("picture-card"===a||"picture-circle"===a)&&"uploading"!==S&&ce.createElement("span",{className:n+"-list-item-actions"},I,"done"===S&&D,z),I=ce.useContext(fe.a)["getPrefixCls"],D=I(),z=ce.createElement("div",{className:e},P,R,T,E&&ce.createElement(A.c,{motionName:D+"-fade",visible:"uploading"===S,motionDeadline:2e3},e=>{var e=e["className"],t="percent"in s?ce.createElement(ne.a,Object.assign({},l,{type:"line",percent:s.percent,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"]})):null;return ce.createElement("div",{className:pe()(n+"-list-item-progress",e)},t)})),R=s.response&&"string"==typeof s.response?s.response:(null==(I=s.error)?void 0:I.statusText)||(null==(e=s.error)?void 0:e.message)||i.uploadError,T="error"===S?ce.createElement(oe.a,{title:R,getPopupContainer:e=>e.parentNode},z):z;return ce.createElement("div",{className:pe()(n+"-list-item-container",o),style:r,ref:t},d?d(T,s,c,{download:O.bind(null,s),preview:w.bind(null,s),remove:x.bind(null,s)}):T)}),je=ce.forwardRef((e,t)=>{const{listType:r="text",previewFile:n=function(e){return new Promise(a=>{if(e.type&&K(e.type)){const s=document.createElement("canvas"),c=(s.width=200,s.height=200,s.style.cssText="position: fixed; left: 0; top: 0; width: 200px; height: 200px; z-index: 9999; display: none;",document.body.appendChild(s),s.getContext("2d")),l=new Image;if(l.onload=()=>{var{width:e,height:t}=l;let n=200,o=200,r=0,i=0;t<e?(o=t*(200/e),i=-(o-n)/2):(n=e*(200/t),r=-(n-o)/2),c.drawImage(l,r,i,n,o);e=s.toDataURL();document.body.removeChild(s),window.URL.revokeObjectURL(l.src),a(e)},l.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&(l.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const s=new FileReader;s.onload=()=>{s.result&&a(s.result)},s.readAsDataURL(e)}else l.src=window.URL.createObjectURL(e)}else a("")})},onPreview:o,onDownload:i,onRemove:a,locale:s,iconRender:c,isImageUrl:l=e=>{var t;return e.type&&!e.thumbUrl?K(e.type):(t=function(e){e=(0<arguments.length&&void 0!==e?e:"").split("/"),e=e[e.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(e)||[""])[0]}(e=e.thumbUrl||e.url||""),!(!/^data:image\//.test(e)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(t))||!/^data:/.test(e)&&!t)},prefixCls:u,items:p=[],showPreviewIcon:d=!0,showRemoveIcon:f=!0,showDownloadIcon:h=!1,removeIcon:m,previewIcon:g,downloadIcon:b,progress:v={size:[-1,2],showInfo:!1},appendAction:y,appendActionVisible:w=!0,itemRender:O,disabled:x}=e,j=Object(q.a)(),[S,C]=ce.useState(!1),E=(ce.useEffect(()=>{"picture"!==r&&"picture-card"!==r&&"picture-circle"!==r||(p||[]).forEach(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="",n)&&n(t.originFileObj).then(e=>{t.thumbUrl=e||"",j()})})},[r,p,n]),ce.useEffect(()=>{C(!0)},[]),(e,t)=>{if(o)return null!=t&&t.preventDefault(),o(e)}),k=e=>{"function"==typeof i?i(e):e.url&&window.open(e.url)},R=e=>{null!=a&&a(e)},P=e=>{if(c)return c(e,r);var t="uploading"===e.status,e=l&&l(e)?ce.createElement(V,null):ce.createElement(B,null);let n=t?ce.createElement(U.a,null):ce.createElement(X,null);return"picture"===r?n=t?ce.createElement(U.a,null):e:"picture-card"!==r&&"picture-circle"!==r||(n=t?s.uploading:e),n},z=(t,n,e,o)=>{o={type:"text",size:"small",title:o,onClick:e=>{n(),Object(F.c)(t)&&t.props.onClick&&t.props.onClick(e)},className:e+"-list-item-action",disabled:x};if(Object(F.c)(t)){const n=Object(F.a)(t,Object.assign(Object.assign({},t.props),{onClick:()=>{}}));return ce.createElement(J.a,Object.assign({},o,{icon:n}))}return ce.createElement(J.a,Object.assign({},o),ce.createElement("span",null,t))},D=(ce.useImperativeHandle(t,()=>({handlePreview:E,handleDownload:k})),ce.useContext(fe.a))["getPrefixCls"],T=D("upload",u),I=D(),L=pe()(T+"-list",T+"-list-"+r),N=Object(le.a)(p.map(e=>({key:e.uid,file:e})));let M={motionDeadline:2e3,motionName:T+"-"+("picture-card"===r||"picture-circle"===r?"animate-inline":"animate"),keys:N,motionAppear:S};e=ce.useMemo(()=>{var e=Object.assign({},Object(Y.a)(I));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[I]);return"picture-card"!==r&&"picture-circle"!==r&&(M=Object.assign(Object.assign({},e),M)),ce.createElement("div",{className:L},ce.createElement(A.a,Object.assign({},M,{component:!1}),e=>{var{key:e,file:t,className:n,style:o}=e;return ce.createElement(re,{key:e,locale:s,prefixCls:T,className:n,style:o,file:t,items:p,progress:v,listType:r,isImgUrl:l,showPreviewIcon:d,showRemoveIcon:f,showDownloadIcon:h,removeIcon:m,previewIcon:g,downloadIcon:b,iconRender:P,actionIconRender:z,itemRender:O,onPreview:E,onDownload:k,onClose:R})}),y&&ce.createElement(A.c,Object.assign({},M,{visible:w,forceRender:!0}),e=>{let{className:t,style:n}=e;return Object(F.a)(y,e=>({className:pe()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))});const be=`__LIST_IGNORE_${Date.now()}__`;var ie=ce.forwardRef((i,e)=>{const{fileList:t,defaultFileList:n,onRemove:r,showUploadList:o=!0,listType:a="text",onPreview:s,onDownload:c,onChange:l,onDrop:u,previewFile:p,disabled:d,locale:f,iconRender:h,isImageUrl:m,progress:N,prefixCls:U,className:A,type:F="select",children:g,style:_,itemRender:$,maxCount:b,data:W={},multiple:H=!1,action:B="",accept:G="",supportServerRender:X=!0,rootClassName:Z}=i,V=ce.useContext(ye.b),v=null!=d?d:V,[y,q]=Object(ve.a)(n||[],{value:t,postState:e=>null!=e?e:[]}),[Y,J]=ce.useState("drop"),w=ce.useRef(null),O=(ce.useMemo(()=>{const n=Date.now();(t||[]).forEach((e,t)=>{e.uid||Object.isFrozen(e)||(e.uid=`__AUTO__${n}_${t}__`)})},[t]),(t,e,n)=>{let o=Object(le.a)(e),r=!1;1===b?o=o.slice(-1):b&&(r=o.length>b,o=o.slice(0,b)),Object(ue.flushSync)(()=>{q(o)});const i={file:t,fileList:o};n&&(i.event=n),r&&!o.some(e=>e.uid===t.uid)||Object(ue.flushSync)(()=>{null!=l&&l(i)})}),x=e=>{const r=e.filter(e=>!e.file[be]);if(r.length){e=r.map(e=>he(e.file));let o=Object(le.a)(y);e.forEach(e=>{o=me(e,o)}),e.forEach((t,e)=>{let n=t;if(r[e].parsedFile)t.status="uploading";else{const r=t["originFileObj"];let e;try{e=new File([r],r.name,{type:r.type})}catch(t){(e=new Blob([r],{type:r.type})).name=r.name,e.lastModifiedDate=new Date,e.lastModified=(new Date).getTime()}e.uid=t.uid,n=e}O(n,o)})}},j=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}ge(t,y)&&((t=he(t)).status="done",t.percent=100,t.response=e,t.xhr=n,n=me(t,y),O(t,n))},S=(e,t)=>{var n;ge(t,y)&&((t=he(t)).status="uploading",t.percent=e.percent,n=me(t,y),O(t,n,e))},C=(e,t,n)=>{ge(n,y)&&((n=he(n)).error=e,n.response=t,n.status="error",e=me(n,y),O(n,e))},K=n=>{let o;Promise.resolve("function"==typeof r?r(n):r).then(e=>{var t;!1!==e&&(e=function(t,e){const n=void 0!==t.uid?"uid":"name",o=e.filter(e=>e[n]!==t[n]);return o.length===e.length?null:o}(n,y))&&(o=Object.assign(Object.assign({},n),{status:"removed"}),null!=y&&y.forEach(e=>{var t=void 0!==o.uid?"uid":"name";e[t]!==o[t]||Object.isFrozen(e)||(e.status="removed")}),null!=(t=w.current)&&t.abort(o),O(o,e))})},E=e=>{J(e.type),"drop"!==e.type||null!=u&&u(e)},{getPrefixCls:Q,direction:k,upload:R}=(ce.useImperativeHandle(e,()=>({onBatchStart:x,onSuccess:j,onProgress:S,onError:C,fileList:y,upload:w.current})),ce.useContext(fe.a)),P=Q("upload",U),z=Object.assign(Object.assign({onBatchStart:x,onError:C,onProgress:S,onSuccess:j},i),{data:W,multiple:H,action:B,accept:G,supportServerRender:X,prefixCls:P,disabled:v,beforeUpload:(o,r)=>{return c=function*(){var{beforeUpload:e,transformFile:t}=i;let n=o;if(e){const i=yield e(o,r);if(!1===i)return!1;if(delete o[be],i===be)return Object.defineProperty(o,be,{value:!0,configurable:!0}),!1;"object"==typeof i&&i&&(n=i)}return n=t?yield t(n):n},new(s=(s=a=e=void 0)||Promise)(function(n,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function r(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(o,r)}i((c=c.apply(e,a||[])).next())});var e,a,s,c},onChange:void 0}),[D,T]=(delete z.className,delete z.style,g&&!v||delete z.id,xe(P)),[ee]=Object(we.a)("Upload",Oe.a.Upload),{showRemoveIcon:I,showPreviewIcon:te,showDownloadIcon:ne,removeIcon:oe,previewIcon:re,downloadIcon:ie}="boolean"==typeof o?{}:o,ae=void 0===I?!v:!!I,L=(e,t)=>o?ce.createElement(je,{prefixCls:P,listType:a,items:y,previewFile:p,onPreview:s,onDownload:c,onRemove:K,showRemoveIcon:ae,showPreviewIcon:te,showDownloadIcon:ne,removeIcon:oe,previewIcon:re,downloadIcon:ie,iconRender:h,locale:Object.assign(Object.assign({},ee),f),isImageUrl:m,progress:N,appendAction:e,appendActionVisible:t,itemRender:$,disabled:v}):e,M=pe()(P+"-wrapper",A,Z,T,null==R?void 0:R.className,{[P+"-rtl"]:"rtl"===k,[P+"-picture-card-wrapper"]:"picture-card"===a,[P+"-picture-circle-wrapper"]:"picture-circle"===a}),se=Object.assign(Object.assign({},null==R?void 0:R.style),_);if("drag"===F){const i=pe()(T,P,P+"-drag",{[P+"-drag-uploading"]:y.some(e=>"uploading"===e.status),[P+"-drag-hover"]:"dragover"===Y,[P+"-disabled"]:v,[P+"-rtl"]:"rtl"===k});return D(ce.createElement("span",{className:M},ce.createElement("div",{className:i,style:se,onDrop:E,onDragOver:E,onDragLeave:E},ce.createElement(de,Object.assign({},z,{ref:w,className:P+"-btn"}),ce.createElement("div",{className:P+"-drag-container"},g))),L()))}e=pe()(P,P+"-select",{[P+"-disabled"]:v}),e=ce.createElement("div",{className:e,style:g?void 0:{display:"none"}},ce.createElement(de,Object.assign({},z,{ref:w})));return D("picture-card"===a||"picture-circle"===a?ce.createElement("span",{className:M},L(e,!!g)):ce.createElement("span",{className:M},e,L()))}),t=ce.forwardRef((e,t)=>{var{style:n,height:o}=e,e=function(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,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}(e,["style","height"]);return ce.createElement(ie,Object.assign({ref:t},e,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))}),n=ie;n.Dragger=t,n.LIST_IGNORE=be,S.a=n}}]);
|
|
17
|
+
`]:{opacity:1},[o]:{color:e.actionsColor,transition:"all "+e.motionDurationSlow},["&:hover "+o]:{color:e.colorText}},[t+"-icon "+o]:{color:e.colorTextDescription,fontSize:r},[a+"-progress"]:{position:"absolute",bottom:-e.uploadProgressOffset,width:"100%",paddingInlineStart:r+e.paddingXS,fontSize:r,lineHeight:0,pointerEvents:"none","> div":{margin:0}}},[a+":hover "+c]:{opacity:1,color:e.colorText},[a+"-error"]:{color:e.colorError,[a+`-name, ${t}-icon `+o]:{color:e.colorError},[s]:{[o+`, ${o}:hover`]:{color:e.colorError},[c]:{opacity:1}}},[t+"-list-item-container"]:{transition:`opacity ${e.motionDurationSlow}, height `+e.motionDurationSlow,"&::before":{display:"table",width:0,height:0,content:'""'}}})}}})(o),[{[(t=(e=o).componentCls)+"-wrapper"]:{[(n=t+"-animate-inline")+`-appear, ${n}-enter, ${n}-leave`]:{animationDuration:e.motionDurationSlow,animationTimingFunction:e.motionEaseInOutCirc,animationFillMode:"forwards"},[n+`-appear, ${n}-enter`]:{animationName:y},[n+"-leave"]:{animationName:w}}},{[t+"-wrapper"]:Object($.a)(e)},y,w],(e=>{e=e.componentCls;return{[e+"-rtl"]:{direction:"rtl"}}})(o),Object(N.a)(o)]},e=>({actionsColor:e.colorTextDescription})),H={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M534 352V136H232v752h560V394H576a42 42 0 01-42-42z",fill:t}},{tag:"path",attrs:{d:"M854.6 288.6L639.4 73.4c-6-6-14.1-9.4-22.6-9.4H192c-17.7 0-32 14.3-32 32v832c0 17.7 14.3 32 32 32h640c17.7 0 32-14.3 32-32V311.3c0-8.5-3.4-16.7-9.4-22.7zM602 137.8L790.2 326H602V137.8zM792 888H232V136h302v216a42 42 0 0042 42h216v494z",fill:e}}]}},name:"file",theme:"twotone"},x=e(3),B=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:H}))}),U=e(100),G={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M779.3 196.6c-94.2-94.2-247.6-94.2-341.7 0l-261 260.8c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l261-260.8c32.4-32.4 75.5-50.2 121.3-50.2s88.9 17.8 121.2 50.2c32.4 32.4 50.2 75.5 50.2 121.2 0 45.8-17.8 88.8-50.2 121.2l-266 265.9-43.1 43.1c-40.3 40.3-105.8 40.3-146.1 0-19.5-19.5-30.2-45.4-30.2-73s10.7-53.5 30.2-73l263.9-263.8c6.7-6.6 15.5-10.3 24.9-10.3h.1c9.4 0 18.1 3.7 24.7 10.3 6.7 6.7 10.3 15.5 10.3 24.9 0 9.3-3.7 18.1-10.3 24.7L372.4 653c-1.7 1.7-2.6 4-2.6 6.4s.9 4.7 2.6 6.4l36.9 36.9a9 9 0 0012.7 0l215.6-215.6c19.9-19.9 30.8-46.3 30.8-74.4s-11-54.6-30.8-74.4c-41.1-41.1-107.9-41-149 0L463 364 224.8 602.1A172.22 172.22 0 00174 724.8c0 46.3 18.1 89.8 50.8 122.5 33.9 33.8 78.3 50.7 122.7 50.7 44.4 0 88.8-16.9 122.6-50.7l309.2-309C824.8 492.7 850 432 850 367.5c.1-64.6-25.1-125.3-70.7-170.9z"}}]},name:"paper-clip",theme:"outlined"},X=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:G}))}),Z={icon:function(e,t){return{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M928 160H96c-17.7 0-32 14.3-32 32v640c0 17.7 14.3 32 32 32h832c17.7 0 32-14.3 32-32V192c0-17.7-14.3-32-32-32zm-40 632H136v-39.9l138.5-164.3 150.1 178L658.1 489 888 761.6V792zm0-129.8L664.2 396.8c-3.2-3.8-9-3.8-12.2 0L424.6 666.4l-144-170.7c-3.2-3.8-9-3.8-12.2 0L136 652.7V232h752v430.2z",fill:e}},{tag:"path",attrs:{d:"M424.6 765.8l-150.1-178L136 752.1V792h752v-30.4L658.1 489z",fill:t}},{tag:"path",attrs:{d:"M136 652.7l132.4-157c3.2-3.8 9-3.8 12.2 0l144 170.7L652 396.8c3.2-3.8 9-3.8 12.2 0L888 662.2V232H136v420.7zM304 280a88 88 0 110 176 88 88 0 010-176z",fill:t}},{tag:"path",attrs:{d:"M276 368a28 28 0 1056 0 28 28 0 10-56 0z",fill:t}},{tag:"path",attrs:{d:"M304 456a88 88 0 100-176 88 88 0 000 176zm0-116c15.5 0 28 12.5 28 28s-12.5 28-28 28-28-12.5-28-28 12.5-28 28-28z",fill:e}}]}},name:"picture",theme:"twotone"},V=ce.forwardRef(function(e,t){return ce.createElement(x.a,Object(b.a)({},e,{ref:t,icon:Z}))}),A=e(32),q=e(153),Y=e(48),F=e(25),J=e(65);function he(e){return Object.assign(Object.assign({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function me(t,e){var e=Object(le.a)(e),n=e.findIndex(e=>{e=e.uid;return e===t.uid});return-1===n?e.push(t):e[n]=t,e}function ge(t,e){const n=void 0!==t.uid?"uid":"name";return e.filter(e=>e[n]===t[n])[0]}const K=e=>0===e.indexOf("image/");var Q=e(406),ee=e(464),te=e(398),ne=e(297),oe=e(59),re=ce.forwardRef((e,t)=>{let{prefixCls:n,className:o,style:r,locale:i,listType:a,file:s,items:c,progress:l,iconRender:u,actionIconRender:p,itemRender:d,isImgUrl:f,showPreviewIcon:h,showRemoveIcon:m,showDownloadIcon:g,previewIcon:b,removeIcon:v,downloadIcon:y,onPreview:w,onDownload:O,onClose:x}=e;const j=s["status"],[S,C]=ce.useState(j),[E,k]=(ce.useEffect(()=>{"removed"!==j&&C(j)},[j]),ce.useState(!1));ce.useEffect(()=>{const e=setTimeout(()=>{k(!0)},300);return()=>{clearTimeout(e)}},[]);var R=u(s);let P=ce.createElement("div",{className:n+"-icon"},R);if("picture"===a||"picture-card"===a||"picture-circle"===a)if("uploading"===S||!s.thumbUrl&&!s.url){const e=pe()(n+"-list-item-thumbnail",{[n+"-list-item-file"]:"uploading"!==S});P=ce.createElement("div",{className:e},R)}else{const e=null!=f&&f(s)?ce.createElement("img",{src:s.thumbUrl||s.url,alt:s.name,className:n+"-list-item-image",crossOrigin:s.crossOrigin}):R,t=pe()(n+"-list-item-thumbnail",{[n+"-list-item-file"]:f&&!f(s)});P=ce.createElement("a",{className:t,onClick:e=>w(s,e),href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer"},e)}var e=pe()(n+"-list-item",n+"-list-item-"+S),R="string"==typeof s.linkProps?JSON.parse(s.linkProps):s.linkProps,z=m?p(("function"==typeof v?v(s):v)||ce.createElement(Q.a,null),()=>x(s),n,i.removeFile):null,D=g&&"done"===S?p(("function"==typeof y?y(s):y)||ce.createElement(ee.a,null),()=>O(s),n,i.downloadFile):null,T="picture-card"!==a&&"picture-circle"!==a&&ce.createElement("span",{key:"download-delete",className:pe()(n+"-list-item-actions",{picture:"picture"===a})},D,z),I=pe()(n+"-list-item-name"),R=s.url?[ce.createElement("a",Object.assign({key:"view",target:"_blank",rel:"noopener noreferrer",className:I,title:s.name},R,{href:s.url,onClick:e=>w(s,e)}),s.name),T]:[ce.createElement("span",{key:"view",className:I,onClick:e=>w(s,e),title:s.name},s.name),T],I=h?ce.createElement("a",{href:s.url||s.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:s.url||s.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:e=>w(s,e),title:i.previewFile},"function"==typeof b?b(s):b||ce.createElement(te.a,null)):null,T=("picture-card"===a||"picture-circle"===a)&&"uploading"!==S&&ce.createElement("span",{className:n+"-list-item-actions"},I,"done"===S&&D,z),I=ce.useContext(fe.a)["getPrefixCls"],D=I(),z=ce.createElement("div",{className:e},P,R,T,E&&ce.createElement(A.c,{motionName:D+"-fade",visible:"uploading"===S,motionDeadline:2e3},e=>{var e=e["className"],t="percent"in s?ce.createElement(ne.a,Object.assign({},l,{type:"line",percent:s.percent,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"]})):null;return ce.createElement("div",{className:pe()(n+"-list-item-progress",e)},t)})),R=s.response&&"string"==typeof s.response?s.response:(null==(I=s.error)?void 0:I.statusText)||(null==(e=s.error)?void 0:e.message)||i.uploadError,T="error"===S?ce.createElement(oe.a,{title:R,getPopupContainer:e=>e.parentNode},z):z;return ce.createElement("div",{className:pe()(n+"-list-item-container",o),style:r,ref:t},d?d(T,s,c,{download:O.bind(null,s),preview:w.bind(null,s),remove:x.bind(null,s)}):T)}),je=ce.forwardRef((e,t)=>{const{listType:r="text",previewFile:n=function(e){return new Promise(a=>{if(e.type&&K(e.type)){const s=document.createElement("canvas"),c=(s.width=200,s.height=200,s.style.cssText="position: fixed; left: 0; top: 0; width: 200px; height: 200px; z-index: 9999; display: none;",document.body.appendChild(s),s.getContext("2d")),l=new Image;if(l.onload=()=>{var{width:e,height:t}=l;let n=200,o=200,r=0,i=0;t<e?(o=t*(200/e),i=-(o-n)/2):(n=e*(200/t),r=-(n-o)/2),c.drawImage(l,r,i,n,o);e=s.toDataURL();document.body.removeChild(s),window.URL.revokeObjectURL(l.src),a(e)},l.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){const a=new FileReader;a.onload=()=>{a.result&&(l.src=a.result)},a.readAsDataURL(e)}else if(e.type.startsWith("image/gif")){const s=new FileReader;s.onload=()=>{s.result&&a(s.result)},s.readAsDataURL(e)}else l.src=window.URL.createObjectURL(e)}else a("")})},onPreview:o,onDownload:i,onRemove:a,locale:s,iconRender:c,isImageUrl:l=e=>{var t;return e.type&&!e.thumbUrl?K(e.type):(t=function(e){e=(0<arguments.length&&void 0!==e?e:"").split("/"),e=e[e.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(e)||[""])[0]}(e=e.thumbUrl||e.url||""),!(!/^data:image\//.test(e)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(t))||!/^data:/.test(e)&&!t)},prefixCls:u,items:p=[],showPreviewIcon:d=!0,showRemoveIcon:f=!0,showDownloadIcon:h=!1,removeIcon:m,previewIcon:g,downloadIcon:b,progress:v={size:[-1,2],showInfo:!1},appendAction:y,appendActionVisible:w=!0,itemRender:O,disabled:x}=e,j=Object(q.a)(),[S,C]=ce.useState(!1),E=(ce.useEffect(()=>{"picture"!==r&&"picture-card"!==r&&"picture-circle"!==r||(p||[]).forEach(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="",n)&&n(t.originFileObj).then(e=>{t.thumbUrl=e||"",j()})})},[r,p,n]),ce.useEffect(()=>{C(!0)},[]),(e,t)=>{if(o)return null!=t&&t.preventDefault(),o(e)}),k=e=>{"function"==typeof i?i(e):e.url&&window.open(e.url)},R=e=>{null!=a&&a(e)},P=e=>{if(c)return c(e,r);var t="uploading"===e.status,e=l&&l(e)?ce.createElement(V,null):ce.createElement(B,null);let n=t?ce.createElement(U.a,null):ce.createElement(X,null);return"picture"===r?n=t?ce.createElement(U.a,null):e:"picture-card"!==r&&"picture-circle"!==r||(n=t?s.uploading:e),n},z=(t,n,e,o)=>{o={type:"text",size:"small",title:o,onClick:e=>{n(),Object(F.c)(t)&&t.props.onClick&&t.props.onClick(e)},className:e+"-list-item-action",disabled:x};if(Object(F.c)(t)){const n=Object(F.a)(t,Object.assign(Object.assign({},t.props),{onClick:()=>{}}));return ce.createElement(J.a,Object.assign({},o,{icon:n}))}return ce.createElement(J.a,Object.assign({},o),ce.createElement("span",null,t))},D=(ce.useImperativeHandle(t,()=>({handlePreview:E,handleDownload:k})),ce.useContext(fe.a))["getPrefixCls"],T=D("upload",u),I=D(),L=pe()(T+"-list",T+"-list-"+r),N=Object(le.a)(p.map(e=>({key:e.uid,file:e})));let M={motionDeadline:2e3,motionName:T+"-"+("picture-card"===r||"picture-circle"===r?"animate-inline":"animate"),keys:N,motionAppear:S};e=ce.useMemo(()=>{var e=Object.assign({},Object(Y.a)(I));return delete e.onAppearEnd,delete e.onEnterEnd,delete e.onLeaveEnd,e},[I]);return"picture-card"!==r&&"picture-circle"!==r&&(M=Object.assign(Object.assign({},e),M)),ce.createElement("div",{className:L},ce.createElement(A.a,Object.assign({},M,{component:!1}),e=>{var{key:e,file:t,className:n,style:o}=e;return ce.createElement(re,{key:e,locale:s,prefixCls:T,className:n,style:o,file:t,items:p,progress:v,listType:r,isImgUrl:l,showPreviewIcon:d,showRemoveIcon:f,showDownloadIcon:h,removeIcon:m,previewIcon:g,downloadIcon:b,iconRender:P,actionIconRender:z,itemRender:O,onPreview:E,onDownload:k,onClose:R})}),y&&ce.createElement(A.c,Object.assign({},M,{visible:w,forceRender:!0}),e=>{let{className:t,style:n}=e;return Object(F.a)(y,e=>({className:pe()(e.className,t),style:Object.assign(Object.assign(Object.assign({},n),{pointerEvents:t?"none":void 0}),e.style)}))}))});const be=`__LIST_IGNORE_${Date.now()}__`;var ie=ce.forwardRef((i,e)=>{const{fileList:t,defaultFileList:n,onRemove:r,showUploadList:o=!0,listType:a="text",onPreview:s,onDownload:c,onChange:l,onDrop:u,previewFile:p,disabled:d,locale:f,iconRender:h,isImageUrl:m,progress:N,prefixCls:U,className:A,type:F="select",children:g,style:_,itemRender:$,maxCount:b,data:W={},multiple:H=!1,action:B="",accept:G="",supportServerRender:X=!0,rootClassName:Z}=i,V=ce.useContext(ye.b),v=null!=d?d:V,[y,q]=Object(ve.a)(n||[],{value:t,postState:e=>null!=e?e:[]}),[Y,J]=ce.useState("drop"),w=ce.useRef(null),O=(ce.useMemo(()=>{const n=Date.now();(t||[]).forEach((e,t)=>{e.uid||Object.isFrozen(e)||(e.uid=`__AUTO__${n}_${t}__`)})},[t]),(t,e,n)=>{let o=Object(le.a)(e),r=!1;1===b?o=o.slice(-1):b&&(r=o.length>b,o=o.slice(0,b)),Object(ue.flushSync)(()=>{q(o)});const i={file:t,fileList:o};n&&(i.event=n),r&&!o.some(e=>e.uid===t.uid)||Object(ue.flushSync)(()=>{null!=l&&l(i)})}),x=e=>{const r=e.filter(e=>!e.file[be]);if(r.length){e=r.map(e=>he(e.file));let o=Object(le.a)(y);e.forEach(e=>{o=me(e,o)}),e.forEach((t,e)=>{let n=t;if(r[e].parsedFile)t.status="uploading";else{const r=t["originFileObj"];let e;try{e=new File([r],r.name,{type:r.type})}catch(t){(e=new Blob([r],{type:r.type})).name=r.name,e.lastModifiedDate=new Date,e.lastModified=(new Date).getTime()}e.uid=t.uid,n=e}O(n,o)})}},j=(e,t,n)=>{try{"string"==typeof e&&(e=JSON.parse(e))}catch(e){}ge(t,y)&&((t=he(t)).status="done",t.percent=100,t.response=e,t.xhr=n,n=me(t,y),O(t,n))},S=(e,t)=>{var n;ge(t,y)&&((t=he(t)).status="uploading",t.percent=e.percent,n=me(t,y),O(t,n,e))},C=(e,t,n)=>{ge(n,y)&&((n=he(n)).error=e,n.response=t,n.status="error",e=me(n,y),O(n,e))},K=n=>{let o;Promise.resolve("function"==typeof r?r(n):r).then(e=>{var t;!1!==e&&(e=function(t,e){const n=void 0!==t.uid?"uid":"name",o=e.filter(e=>e[n]!==t[n]);return o.length===e.length?null:o}(n,y))&&(o=Object.assign(Object.assign({},n),{status:"removed"}),null!=y&&y.forEach(e=>{var t=void 0!==o.uid?"uid":"name";e[t]!==o[t]||Object.isFrozen(e)||(e.status="removed")}),null!=(t=w.current)&&t.abort(o),O(o,e))})},E=e=>{J(e.type),"drop"!==e.type||null!=u&&u(e)},{getPrefixCls:Q,direction:k,upload:R}=(ce.useImperativeHandle(e,()=>({onBatchStart:x,onSuccess:j,onProgress:S,onError:C,fileList:y,upload:w.current})),ce.useContext(fe.a)),P=Q("upload",U),z=Object.assign(Object.assign({onBatchStart:x,onError:C,onProgress:S,onSuccess:j},i),{data:W,multiple:H,action:B,accept:G,supportServerRender:X,prefixCls:P,disabled:v,beforeUpload:(o,r)=>{return c=function*(){var{beforeUpload:e,transformFile:t}=i;let n=o;if(e){const i=yield e(o,r);if(!1===i)return!1;if(delete o[be],i===be)return Object.defineProperty(o,be,{value:!0,configurable:!0}),!1;"object"==typeof i&&i&&(n=i)}return n=t?yield t(n):n},new(s=(s=a=e=void 0)||Promise)(function(n,t){function o(e){try{i(c.next(e))}catch(e){t(e)}}function r(e){try{i(c.throw(e))}catch(e){t(e)}}function i(e){var t;e.done?n(e.value):((t=e.value)instanceof s?t:new s(function(e){e(t)})).then(o,r)}i((c=c.apply(e,a||[])).next())});var e,a,s,c},onChange:void 0}),[D,T]=(delete z.className,delete z.style,g&&!v||delete z.id,xe(P)),[ee]=Object(we.a)("Upload",Oe.a.Upload),{showRemoveIcon:I,showPreviewIcon:te,showDownloadIcon:ne,removeIcon:oe,previewIcon:re,downloadIcon:ie}="boolean"==typeof o?{}:o,ae=void 0===I?!v:!!I,L=(e,t)=>o?ce.createElement(je,{prefixCls:P,listType:a,items:y,previewFile:p,onPreview:s,onDownload:c,onRemove:K,showRemoveIcon:ae,showPreviewIcon:te,showDownloadIcon:ne,removeIcon:oe,previewIcon:re,downloadIcon:ie,iconRender:h,locale:Object.assign(Object.assign({},ee),f),isImageUrl:m,progress:N,appendAction:e,appendActionVisible:t,itemRender:$,disabled:v}):e,M=pe()(P+"-wrapper",A,Z,T,null==R?void 0:R.className,{[P+"-rtl"]:"rtl"===k,[P+"-picture-card-wrapper"]:"picture-card"===a,[P+"-picture-circle-wrapper"]:"picture-circle"===a}),se=Object.assign(Object.assign({},null==R?void 0:R.style),_);if("drag"===F){const i=pe()(T,P,P+"-drag",{[P+"-drag-uploading"]:y.some(e=>"uploading"===e.status),[P+"-drag-hover"]:"dragover"===Y,[P+"-disabled"]:v,[P+"-rtl"]:"rtl"===k});return D(ce.createElement("span",{className:M},ce.createElement("div",{className:i,style:se,onDrop:E,onDragOver:E,onDragLeave:E},ce.createElement(de,Object.assign({},z,{ref:w,className:P+"-btn"}),ce.createElement("div",{className:P+"-drag-container"},g))),L()))}e=pe()(P,P+"-select",{[P+"-disabled"]:v}),e=ce.createElement("div",{className:e,style:g?void 0:{display:"none"}},ce.createElement(de,Object.assign({},z,{ref:w})));return D("picture-card"===a||"picture-circle"===a?ce.createElement("span",{className:M},L(e,!!g)):ce.createElement("span",{className:M},e,L()))}),t=ce.forwardRef((e,t)=>{var{style:n,height:o}=e,e=function(e,t){var n={};for(r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var o=0,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}(e,["style","height"]);return ce.createElement(ie,Object.assign({ref:t},e,{type:"drag",style:Object.assign(Object.assign({},n),{height:o})}))}),n=ie;n.Dragger=t,n.LIST_IGNORE=be,S.a=n}}]);
|