Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

2 righe
23 KiB

  1. (self.webpackChunkant_design_pro=self.webpackChunkant_design_pro||[]).push([[1791],{63252:function(){},93009:function(nt,Be,d){"use strict";d.d(Be,{Z:function(){return Xt}});var g=d(22122),i=d(67294),P=d(96156),Ze=d(55507),xe=d(90484),_=d(85061),de=d(28481),rt=d(94184),z=d.n(rt),We=d(6610),Ke=d(5991),ze=d(10379),He=d(60446),at=d(81253),ot=d(92137),it=d(64217);function st(t,e){var o="cannot ".concat(t.method," ").concat(t.action," ").concat(e.status,"'"),n=new Error(o);return n.status=e.status,n.method=t.method,n.url=t.action,n}function Ge(t){var e=t.responseText||t.response;if(!e)return e;try{return JSON.parse(e)}catch(o){return e}}function lt(t){var e=new XMLHttpRequest;t.onProgress&&e.upload&&(e.upload.onprogress=function(s){s.total>0&&(s.percent=s.loaded/s.total*100),t.onProgress(s)});var o=new FormData;t.data&&Object.keys(t.data).forEach(function(a){var s=t.data[a];if(Array.isArray(s)){s.forEach(function(l){o.append("".concat(a,"[]"),l)});return}o.append(a,s)}),t.file instanceof Blob?o.append(t.filename,t.file,t.file.name):o.append(t.filename,t.file),e.onerror=function(s){t.onError(s)},e.onload=function(){return e.status<200||e.status>=300?t.onError(st(t,e),Ge(e)):t.onSuccess(Ge(e),e)},e.open(t.method,t.action,!0),t.withCredentials&&"withCredentials"in e&&(e.withCredentials=!0);var n=t.headers||{};return n["X-Requested-With"]!==null&&e.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(n).forEach(function(a){n[a]!==null&&e.setRequestHeader(a,n[a])}),e.send(o),{abort:function(){e.abort()}}}var ct=+new Date,ut=0;function Ne(){return"rc-upload-".concat(ct,"-").concat(++ut)}var dt=d(80334),Oe=function(t,e){if(t&&e){var o=Array.isArray(e)?e:e.split(","),n=t.name||"",a=t.type||"",s=a.replace(/\/.*$/,"");return o.some(function(l){var r=l.trim();if(/^\*(\/\*)?$/.test(l))return!0;if(r.charAt(0)==="."){var v=n.toLowerCase(),c=r.toLowerCase(),u=[c];return(c===".jpg"||c===".jpeg")&&(u=[".jpg",".jpeg"]),u.some(function(y){return v.endsWith(y)})}return/\/\*$/.test(r)?s===r.replace(/\/.*$/,""):a===r?!0:/^\w+$/.test(r)?((0,dt.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(r,"'.Skip for check.")),!0):!1})}return!0};function vt(t,e){var o=t.createReader(),n=[];function a(){o.readEntries(function(s){var l=Array.prototype.slice.apply(s);n=n.concat(l);var r=!l.length;r?e(n):a()})}a()}var ft=function(e,o,n){var a=function s(l,r){!l||(l.path=r||"",l.isFile?l.file(function(v){n(v)&&(l.fullPath&&!v.webkitRelativePath&&(Object.defineProperties(v,{webkitRelativePath:{writable:!0}}),v.webkitRelativePath=l.fullPath.replace(/^\//,""),Object.defineProperties(v,{webkitRelativePath:{writable:!1}})),o([v]))}):l.isDirectory&&vt(l,function(v){v.forEach(function(c){s(c,"".concat(r).concat(l.name,"/"))})}))};e.forEach(function(s){a(s.webkitGetAsEntry())})},pt=ft,mt=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],ht=function(t){(0,ze.Z)(o,t);var e=(0,He.Z)(o);function o(){var n;(0,We.Z)(this,o);for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return n=e.call.apply(e,[this].concat(s)),n.state={uid:Ne()},n.reqs={},n.fileInput=void 0,n._isMounted=void 0,n.onChange=function(r){var v=n.props,c=v.accept,u=v.directory,y=r.target.files,h=(0,_.Z)(y).filter(function(E){return!u||Oe(E,c)});n.uploadFiles(h),n.reset()},n.onClick=function(r){var v=n.fileInput;if(!!v){var c=r.target,u=n.props.onClick;if(c&&c.tagName==="BUTTON"){var y=v.parentNode;y.focus(),c.blur()}v.click(),u&&u(r)}},n.onKeyDown=function(r){r.key==="Enter"&&n.onClick(r)},n.onFileDrop=function(r){var v=n.props.multiple;if(r.preventDefault(),r.type!=="dragover")if(n.props.directory)pt(Array.prototype.slice.call(r.dataTransfer.items),n.uploadFiles,function(u){return Oe(u,n.props.accept)});else{var c=(0,_.Z)(r.dataTransfer.files).filter(function(u){return Oe(u,n.props.accept)});v===!1&&(c=c.slice(0,1)),n.uploadFiles(c)}},n.uploadFiles=function(r){var v=(0,_.Z)(r),c=v.map(function(u){return u.uid=Ne(),n.processFile(u,v)});Promise.all(c).then(function(u){var y=n.props.onBatchStart;y==null||y(u.map(function(h){var E=h.origin,T=h.parsedFile;return{file:E,parsedFile:T}})),u.filter(function(h){return h.parsedFile!==null}).forEach(function(h){n.post(h)})})},n.processFile=function(){var r=(0,ot.Z)((0,Ze.Z)().mark(function v(c,u){var y,h,E,T,L,x,U,$,O;return(0,Ze.Z)().wrap(function(f){for(;;)switch(f.prev=f.next){case 0:if(y=n.props.beforeUpload,h=c,!y){f.next=14;break}return f.prev=3,f.next=6,y(c,u);case 6:h=f.sent,f.next=12;break;case 9:f.prev=9,f.t0=f.catch(3),h=!1;case 12:if(h!==!1){f.next=14;break}return f.abrupt("return",{origin:c,parsedFile:null,action:null,data:null});case 14:if(E=n.props.action,typeof E!="function"){f.next=21;break}return f.next=18,E(c);case 18:T=f.sent,f.next=22;break;case 21:T=E;case 22:if(L=n.props.data,typeof L!="function"){f.next=29;break}return f.next=26,L(c);case 26:x=f.sent,f.next=30;break;case 29:x=L;case 30:return U=((0,xe.Z)(h)==="object"||typeof h=="string")&&h?h:c,U instanceof File?$=U:$=new File([U],c.name,{type:c.type}),O=$,O.uid=c.uid,f.abrupt("return",{origin:c,data:x,parsedFile:O,action:T});case 35:case"end":return f.stop()}},v,null,[[3,9]])}));return function(v,c){return r.apply(this,arguments)}}(),n.saveFileInput=function(r){n.fileInput=r},n}return(0,Ke.Z)(o,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(a){var s=this,l=a.data,r=a.origin,v=a.action,c=a.parsedFile;if(!!this._isMounted){var u=this.props,y=u.onStart,h=u.customRequest,E=u.name,T=u.headers,L=u.withCredentials,x=u.method,U=r.uid,$=h||lt,O={action:v,filename:E,data:l,file:c,headers:T,withCredentials:L,method:x||"post",onProgress:function(f){var N=s.props.onProgress;N==null||N(f,c)},onSuccess:function(f,N){var M=s.props.onSuccess;M==null||M(f,c,N),delete s.reqs[U]},onError:function(f,N){var M=s.props.onError;M==null||M(f,N,c),delete s.reqs[U]}};y(r),this.reqs[U]=$(O)}}},{key:"reset",value:function(){this.setState({uid:Ne()})}},{key:"abort",value:function(a){var s=this.reqs;if(a){var l=a.uid?a.uid:a;s[l]&&s[l].abort&&s[l].abort(),delete s[l]}else Object.keys(s).forEach(function(r){s[r]&&s[r].abort&&s[r].abort(),delete s[r]})}},{key:"render",value:function(){var a=this.props,s=a.component,l=a.prefixCls,r=a.className,v=a.disabled,c=a.id,u=a.style,y=a.multiple,h=a.accept,E=a.capture,T=a.children,L=a.directory,x=a.openFileDialogOnClick,U=a.onMouseEnter,$=a.onMouseLeave,O=(0,at.Z)(a,mt),A=z()((0,P.Z)((0,P.Z)((0,P.Z)({},l,!0),"".concat(l,"-disabled"),v),r,r)),f=L?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},N=v?{}:{onClick:x?this.onClick:function(){},onKeyDown:x?this.onKeyDown:function(){},onMouseEnter:U,onMouseLeave:$,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return i.createElement(s,(0,g.Z)({},N,{className:A,role:"button",style:u}),i.createElement("input",(0,g.Z)({},(0,it.Z)(O,{aria:!0,data:!0}),{id:c,disabled:v,type:"file",ref:this.saveFileInput,onClick:function(H){return H.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:h},f,{multiple:y,onChange:this.onChange},E!=null?{capture:E}:{})),T)}}]),o}(i.Component),gt=ht;function Me(){}var Ve=function(t){(0,ze.Z)(o,t);var e=(0,He.Z)(o);function o(){var n;(0,We.Z)(this,o);for(var a=arguments.length,s=new Array(a),l=0;l<a;l++)s[l]=arguments[l];return n=e.call.apply(e,[this].concat(s)),n.uploader=void 0,n.saveUploader=function(r){n.uploader=r},n}return(0,Ke.Z)(o,[{key:"abort",value:function(a){this.uploader.abort(a)}},{key:"render",value:function(){return i.createElement(gt,(0,g.Z)({},this.props,{ref:this.saveUploader}))}}]),o}(i.Component);Ve.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:Me,onError:Me,onSuccess:Me,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var yt=Ve,Xe=yt,wt=d(21770),Je=d(73935),Te=d(53124),Et=d(98866),It=d(42051),Ct=d(85636),Zt=d(20406),Ye=d(7085),Rt=d(74962),Pt=d(4810),$e=d(5461),Qe=d(71577),Dt=d(57838),bt=d(33603),Ue=d(96159);function Fe(t){return(0,g.Z)((0,g.Z)({},t),{lastModified:t.lastModified,lastModifiedDate:t.lastModifiedDate,name:t.name,size:t.size,type:t.type,uid:t.uid,percent:0,originFileObj:t})}function Se(t,e){var o=(0,_.Z)(e),n=o.findIndex(function(a){var s=a.uid;return s===t.uid});return n===-1?o.push(t):o[n]=t,o}function Ae(t,e){var o=t.uid!==void 0?"uid":"name";return e.filter(function(n){return n[o]===t[o]})[0]}function Ut(t,e){var o=t.uid!==void 0?"uid":"name",n=e.filter(function(a){return a[o]!==t[o]});return n.length===e.length?null:n}var Ft=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=e.split("/"),n=o[o.length-1],a=n.split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(a)||[""])[0]},qe=function(e){return e.indexOf("image/")===0},St=function(e){if(e.type&&!e.thumbUrl)return qe(e.type);var o=e.thumbUrl||e.url||"",n=Ft(o);return/^data:image\//.test(o)||/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n)?!0:!(/^data:/.test(o)||n)},ee=200;function Lt(t){return new Promise(function(e){if(!t.type||!qe(t.type)){e("");return}var o=document.createElement("canvas");o.width=ee,o.height=ee,o.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(ee,"px; height: ").concat(ee,"px; z-index: 9999; display: none;"),document.body.appendChild(o);var n=o.getContext("2d"),a=new Image;if(a.onload=function(){var r=a.width,v=a.height,c=ee,u=ee,y=0,h=0;r>v?(u=v*(ee/r),h=-(u-c)/2):(c=r*(ee/v),y=-(c-u)/2),n.drawImage(a,y,h,c,u);var E=o.toDataURL();document.body.removeChild(o),window.URL.revokeObjectURL(a.src),e(E)},a.crossOrigin="anonymous",t.type.startsWith("image/svg+xml")){var s=new FileReader;s.onload=function(){s.result&&(a.src=s.result)},s.readAsDataURL(t)}else if(t.type.startsWith("image/gif")){var l=new FileReader;l.onload=function(){l.result&&e(l.result)},l.readAsDataURL(t)}else a.src=window.URL.createObjectURL(t)})}var xt=d(73171),Nt=d(90631),Ot=d(95357),Mt=d(54458),Tt=d(45777),$t=i.forwardRef(function(t,e){var o=t.prefixCls,n=t.className,a=t.style,s=t.locale,l=t.listType,r=t.file,v=t.items,c=t.progress,u=t.iconRender,y=t.actionIconRender,h=t.itemRender,E=t.isImgUrl,T=t.showPreviewIcon,L=t.showRemoveIcon,x=t.showDownloadIcon,U=t.previewIcon,$=t.removeIcon,O=t.downloadIcon,A=t.onPreview,f=t.onDownload,N=t.onClose,M,H,te=r.status,ve=i.useState(te),ne=(0,de.Z)(ve,2),k=ne[0],fe=ne[1];i.useEffect(function(){te!=="removed"&&fe(te)},[te]);var pe=i.useState(!1),me=(0,de.Z)(pe,2),he=me[0],Pe=me[1],re=i.useRef(null);i.useEffect(function(){return re.current=setTimeout(function(){Pe(!0)},300),function(){re.current&&clearTimeout(re.current)}},[]);var ge="".concat(o,"-span"),ae=u(r),se=i.createElement("div",{className:"".concat(o,"-text-icon")},ae);if(l==="picture"||l==="picture-card")if(k==="uploading"||!r.thumbUrl&&!r.url){var ye=z()((0,P.Z)((0,P.Z)({},"".concat(o,"-list-item-thumbnail"),!0),"".concat(o,"-list-item-file"),k!=="uploading"));se=i.createElement("div",{className:ye},ae)}else{var G=(E==null?void 0:E(r))?i.createElement("img",{src:r.thumbUrl||r.url,alt:r.name,className:"".concat(o,"-list-item-image"),crossOrigin:r.crossOrigin}):ae,De=z()((0,P.Z)((0,P.Z)({},"".concat(o,"-list-item-thumbnail"),!0),"".concat(o,"-list-item-file"),E&&!E(r)));se=i.createElement("a",{className:De,onClick:function(C){return A(r,C)},href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer"},G)}var we=z()((0,P.Z)((0,P.Z)((0,P.Z)({},"".concat(o,"-list-item"),!0),"".concat(o,"-list-item-").concat(k),!0),"".concat(o,"-list-item-list-type-").concat(l),!0)),F=typeof r.linkProps=="string"?JSON.parse(r.linkProps):r.linkProps,le=L?y((typeof $=="function"?$(r):$)||i.createElement(xt.Z,null),function(){return N(r)},o,s.removeFile):null,Ee=x&&k==="done"?y((typeof O=="function"?O(r):O)||i.createElement(Nt.Z,null),function(){return f(r)},o,s.downloadFile):null,ce=l!=="picture-card"&&i.createElement("span",{key:"download-delete",className:z()("".concat(o,"-list-item-card-actions"),{picture:l==="picture"})},Ee,le),J=z()("".concat(o,"-list-item-name")),be=r.url?[i.createElement("a",(0,g.Z)({key:"view",target:"_blank",rel:"noopener noreferrer",className:J,title:r.name},F,{href:r.url,onClick:function(C){return A(r,C)}}),r.name),ce]:[i.createElement("span",{key:"view",className:J,onClick:function(C){return A(r,C)},title:r.name},r.name),ce],oe={pointerEvents:"none",opacity:.5},Y=T?i.createElement("a",{href:r.url||r.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:r.url||r.thumbUrl?void 0:oe,onClick:function(C){return A(r,C)},title:s.previewFile},typeof U=="function"?U(r):U||i.createElement(Ot.Z,null)):null,ie=l==="picture-card"&&k!=="uploading"&&i.createElement("span",{className:"".concat(o,"-list-item-actions")},Y,k==="done"&&Ee,le),I;r.response&&typeof r.response=="string"?I=r.response:I=((M=r.error)===null||M===void 0?void 0:M.statusText)||((H=r.error)===null||H===void 0?void 0:H.message)||s.uploadError;var w=i.createElement("span",{className:ge},se,be),S=i.useContext(Te.E_),j=S.getPrefixCls,V=j(),Q=i.createElement("div",{className:we},i.createElement("div",{className:"".concat(o,"-list-item-info")},w),ie,he&&i.createElement($e.ZP,{motionName:"".concat(V,"-fade"),visible:k==="uploading",motionDeadline:2e3},function(X){var C=X.className,ue="percent"in r?i.createElement(Mt.Z,(0,g.Z)({},c,{type:"line",percent:r.percent})):null;return i.createElement("div",{className:z()("".concat(o,"-list-item-progress"),C)},ue)})),Ie=z()("".concat(o,"-list-").concat(l,"-container"),n),Ce=k==="error"?i.createElement(Tt.Z,{title:I,getPopupContainer:function(C){return C.parentNode}},Q):Q;return i.createElement("div",{className:Ie,style:a,ref:e},h?h(Ce,r,v,{download:f.bind(null,r),preview:A.bind(null,r),remove:N.bind(null,r)}):Ce)}),At=$t,Le=(0,g.Z)({},bt.ZP);delete Le.onAppearEnd,delete Le.onEnterEnd,delete Le.onLeaveEnd;var kt=function(e,o){var n=e.listType,a=n===void 0?"text":n,s=e.previewFile,l=s===void 0?Lt:s,r=e.onPreview,v=e.onDownload,c=e.onRemove,u=e.locale,y=e.iconRender,h=e.isImageUrl,E=h===void 0?St:h,T=e.prefixCls,L=e.items,x=L===void 0?[]:L,U=e.showPreviewIcon,$=U===void 0?!0:U,O=e.showRemoveIcon,A=O===void 0?!0:O,f=e.showDownloadIcon,N=f===void 0?!1:f,M=e.removeIcon,H=e.previewIcon,te=e.downloadIcon,ve=e.progress,ne=ve===void 0?{strokeWidth:2,showInfo:!1}:ve,k=e.appendAction,fe=e.appendActionVisible,pe=fe===void 0?!0:fe,me=e.itemRender,he=e.disabled,Pe=(0,Dt.Z)(),re=i.useState(!1),ge=(0,de.Z)(re,2),ae=ge[0],se=ge[1];i.useEffect(function(){a!=="picture"&&a!=="picture-card"||(x||[]).forEach(function(I){typeof document=="undefined"||typeof window=="undefined"||!window.FileReader||!window.File||!(I.originFileObj instanceof File||I.originFileObj instanceof Blob)||I.thumbUrl!==void 0||(I.thumbUrl="",l&&l(I.originFileObj).then(function(w){I.thumbUrl=w||"",Pe()}))})},[a,x,l]),i.useEffect(function(){se(!0)},[]);var ye=function(w,S){if(!!r)return S==null||S.preventDefault(),r(w)},G=function(w){typeof v=="function"?v(w):w.url&&window.open(w.url)},De=function(w){c==null||c(w)},we=function(w){if(y)return y(w,a);var S=w.status==="uploading",j=E&&E(w)?i.createElement(Pt.Z,null):i.createElement(Zt.Z,null),V=S?i.createElement(Ye.Z,null):i.createElement(Rt.Z,null);return a==="picture"?V=S?i.createElement(Ye.Z,null):j:a==="picture-card"&&(V=S?u.uploading:j),V},F=function(w,S,j,V){var Q={type:"text",size:"small",title:V,disabled:he,onClick:function(X){S(),(0,Ue.l$)(w)&&w.props.onClick&&w.props.onClick(X)},className:"".concat(j,"-list-item-card-actions-btn")};if((0,Ue.l$)(w)){var Ie=(0,Ue.Tm)(w,(0,g.Z)((0,g.Z)({},w.props),{onClick:function(){}}));return i.createElement(Qe.Z,(0,g.Z)({},Q,{icon:Ie}))}return i.createElement(Qe.Z,(0,g.Z)({},Q),i.createElement("span",null,w))};i.useImperativeHandle(o,function(){return{handlePreview:ye,handleDownload:G}});var le=i.useContext(Te.E_),Ee=le.getPrefixCls,ce=le.direction,J=Ee("upload",T),be=z()((0,P.Z)((0,P.Z)((0,P.Z)({},"".concat(J,"-list"),!0),"".concat(J,"-list-").concat(a),!0),"".concat(J,"-list-rtl"),ce==="rtl")),oe=(0,_.Z)(x.map(function(I){return{key:I.uid,file:I}})),Y=a==="picture-card"?"animate-inline":"animate",ie={motionDeadline:2e3,motionName:"".concat(J,"-").concat(Y),keys:oe,motionAppear:ae};return a!=="picture-card"&&(ie=(0,g.Z)((0,g.Z)({},Le),ie)),i.createElement("div",{className:be},i.createElement($e.V4,(0,g.Z)({},ie,{component:!1}),function(I){var w=I.key,S=I.file,j=I.className,V=I.style;return i.createElement(At,{key:w,locale:u,prefixCls:J,className:j,style:V,file:S,items:x,progress:ne,listType:a,isImgUrl:E,showPreviewIcon:$,showRemoveIcon:A,showDownloadIcon:N,removeIcon:M,previewIcon:H,downloadIcon:te,iconRender:we,actionIconRender:F,itemRender:me,onPreview:ye,onDownload:G,onClose:De})}),k&&i.createElement($e.ZP,(0,g.Z)({},ie,{visible:pe,forceRender:!0}),function(I){var w=I.className,S=I.style;return(0,Ue.Tm)(k,function(j){return{className:z()(j.className,w),style:(0,g.Z)((0,g.Z)((0,g.Z)({},S),{pointerEvents:w?"none":void 0}),j.style)}})}))},jt=i.forwardRef(kt),Bt=jt,Wt=function(t,e,o,n){function a(s){return s instanceof o?s:new o(function(l){l(s)})}return new(o||(o=Promise))(function(s,l){function r(u){try{c(n.next(u))}catch(y){l(y)}}function v(u){try{c(n.throw(u))}catch(y){l(y)}}function c(u){u.done?s(u.value):a(u.value).then(r,v)}c((n=n.apply(t,e||[])).next())})},Re="__LIST_IGNORE_".concat(Date.now(),"__"),Kt=function(e,o){var n=e.fileList,a=e.defaultFileList,s=e.onRemove,l=e.showUploadList,r=l===void 0?!0:l,v=e.listType,c=v===void 0?"text":v,u=e.onPreview,y=e.onDownload,h=e.onChange,E=e.onDrop,T=e.previewFile,L=e.disabled,x=e.locale,U=e.iconRender,$=e.isImageUrl,O=e.progress,A=e.prefixCls,f=e.className,N=e.type,M=N===void 0?"select":N,H=e.children,te=e.style,ve=e.itemRender,ne=e.maxCount,k=e.data,fe=k===void 0?{}:k,pe=e.multiple,me=pe===void 0?!1:pe,he=e.action,Pe=he===void 0?"":he,re=e.accept,ge=re===void 0?"":re,ae=e.supportServerRender,se=ae===void 0?!0:ae,ye=i.useContext(Et.Z),G=L!=null?L:ye,De=(0,wt.Z)(a||[],{value:n,postState:function(m){return m!=null?m:[]}}),we=(0,de.Z)(De,2),F=we[0],le=we[1],Ee=i.useState("drop"),ce=(0,de.Z)(Ee,2),J=ce[0],be=ce[1],oe=i.useRef(null);i.useMemo(function(){var B=Date.now();(n||[]).forEach(function(m,R){!m.uid&&!Object.isFrozen(m)&&(m.uid="__AUTO__".concat(B,"_").concat(R,"__"))})},[n]);var Y=function(m,R,b){var p=(0,_.Z)(R);ne===1?p=p.slice(-1):ne&&(p=p.slice(0,ne)),(0,Je.flushSync)(function(){le(p)});var Z={file:m,fileList:p};b&&(Z.event=b),(0,Je.flushSync)(function(){h==null||h(Z)})},ie=function(m,R){return Wt(void 0,void 0,void 0,(0,Ze.Z)().mark(function b(){var p,Z,W,K;return(0,Ze.Z)().wrap(function(D){for(;;)switch(D.prev=D.next){case 0:if(p=e.beforeUpload,Z=e.transformFile,W=m,!p){D.next=13;break}return D.next=5,p(m,R);case 5:if(K=D.sent,K!==!1){D.next=8;break}return D.abrupt("return",!1);case 8:if(delete m[Re],K!==Re){D.next=12;break}return Object.defineProperty(m,Re,{value:!0,configurable:!0}),D.abrupt("return",!1);case 12:(0,xe.Z)(K)==="object"&&K&&(W=K);case 13:if(!Z){D.next=17;break}return D.next=16,Z(W);case 16:W=D.sent;case 17:return D.abrupt("return",W);case 18:case"end":return D.stop()}},b)}))},I=function(m){var R=m.filter(function(Z){return!Z.file[Re]});if(!!R.length){var b=R.map(function(Z){return Fe(Z.file)}),p=(0,_.Z)(F);b.forEach(function(Z){p=Se(Z,p)}),b.forEach(function(Z,W){var K=Z;if(R[W].parsedFile)Z.status="uploading";else{var q=Z.originFileObj,D;try{D=new File([q],q.name,{type:q.type})}catch(tt){D=new Blob([q],{type:q.type}),D.name=q.name,D.lastModifiedDate=new Date,D.lastModified=new Date().getTime()}D.uid=Z.uid,K=D}Y(K,p)})}},w=function(m,R,b){try{typeof m=="string"&&(m=JSON.parse(m))}catch(W){}if(!!Ae(R,F)){var p=Fe(R);p.status="done",p.percent=100,p.response=m,p.xhr=b;var Z=Se(p,F);Y(p,Z)}},S=function(m,R){if(!!Ae(R,F)){var b=Fe(R);b.status="uploading",b.percent=m.percent;var p=Se(b,F);Y(b,p,m)}},j=function(m,R,b){if(!!Ae(b,F)){var p=Fe(b);p.error=m,p.response=R,p.status="error";var Z=Se(p,F);Y(p,Z)}},V=function(m){var R;Promise.resolve(typeof s=="function"?s(m):s).then(function(b){var p;if(b!==!1){var Z=Ut(m,F);Z&&(R=(0,g.Z)((0,g.Z)({},m),{status:"removed"}),F==null||F.forEach(function(W){var K=R.uid!==void 0?"uid":"name";W[K]===R[K]&&!Object.isFrozen(W)&&(W.status="removed")}),(p=oe.current)===null||p===void 0||p.abort(R),Y(R,Z))}})},Q=function(m){be(m.type),m.type==="drop"&&(E==null||E(m))};i.useImperativeHandle(o,function(){return{onBatchStart:I,onSuccess:w,onProgress:S,onError:j,fileList:F,upload:oe.current}});var Ie=i.useContext(Te.E_),Ce=Ie.getPrefixCls,X=Ie.direction,C=Ce("upload",A),ue=(0,g.Z)((0,g.Z)({onBatchStart:I,onError:j,onProgress:S,onSuccess:w},e),{data:fe,multiple:me,action:Pe,accept:ge,supportServerRender:se,prefixCls:C,disabled:G,beforeUpload:ie,onChange:void 0});delete ue.className,delete ue.style,(!H||G)&&delete ue.id;var je=function(m,R){return r?i.createElement(It.Z,{componentName:"Upload",defaultLocale:Ct.Z.Upload},function(b){var p=typeof r=="boolean"?{}:r,Z=p.showRemoveIcon,W=p.showPreviewIcon,K=p.showDownloadIcon,q=p.removeIcon,D=p.previewIcon,tt=p.downloadIcon;return i.createElement(Bt,{prefixCls:C,listType:c,items:F,previewFile:T,onPreview:u,onDownload:y,onRemove:V,showRemoveIcon:!G&&Z,showPreviewIcon:W,showDownloadIcon:K,removeIcon:q,previewIcon:D,downloadIcon:tt,iconRender:U,locale:(0,g.Z)((0,g.Z)({},b),x),isImageUrl:$,progress:O,appendAction:m,appendActionVisible:R,itemRender:ve,disabled:G})}):m};if(M==="drag"){var Jt=z()(C,(0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)({},"".concat(C,"-drag"),!0),"".concat(C,"-drag-uploading"),F.some(function(B){return B.status==="uploading"})),"".concat(C,"-drag-hover"),J==="dragover"),"".concat(C,"-disabled"),G),"".concat(C,"-rtl"),X==="rtl"),f);return i.createElement("span",null,i.createElement("div",{className:Jt,onDrop:Q,onDragOver:Q,onDragLeave:Q,style:te},i.createElement(Xe,(0,g.Z)({},ue,{ref:oe,className:"".concat(C,"-btn")}),i.createElement("div",{className:"".concat(C,"-drag-container")},H))),je())}var Yt=z()(C,(0,P.Z)((0,P.Z)((0,P.Z)((0,P.Z)({},"".concat(C,"-select"),!0),"".concat(C,"-select-").concat(c),!0),"".concat(C,"-disabled"),G),"".concat(C,"-rtl"),X==="rtl")),Qt=function(m){return i.createElement("div",{className:Yt,style:m},i.createElement(Xe,(0,g.Z)({},ue,{ref:oe})))},et=Qt(H?void 0:{display:"none"});return c==="picture-card"?i.createElement("span",{className:z()("".concat(C,"-picture-card-wrapper"),f)},je(et,!!H)):i.createElement("span",{className:f},et,je())},zt=i.forwardRef(Kt),_e=zt,Ht=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var a=0,n=Object.getOwnPropertySymbols(t);a<n.length;a++)e.indexOf(n[a])<0&&Object.prototype.propertyIsEnumerable.call(t,n[a])&&(o[n[a]]=t[n[a]]);return o},Gt=i.forwardRef(function(t,e){var o=t.style,n=t.height,a=Ht(t,["style","height"]);return i.createElement(_e,(0,g.Z)({ref:e},a,{type:"drag",style:(0,g.Z)((0,g.Z)({},o),{height:n})}))}),Vt=Gt,ke=_e;ke.Dragger=Vt,ke.LIST_IGNORE=Re;var Xt=ke},43185:function(nt,Be,d){"use strict";var g=d(38663),i=d.n(g),P=d(63252),Ze=d.n(P),xe=d(57663),_=d(34669),de=d(22385)}}]);