Files
owncast/static/web/_next/static/chunks/7916-e49972911f0f854a.js
T
2023-01-10 08:49:18 +00:00

2 lines
26 KiB
JavaScript

"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7916],{77916:function(e,t,n){n.d(t,{Z:function(){return Re}});var r=n(87462),o=n(67294),a=n(4942),i=n(74165),c=n(71002),l=n(74902),s=n(97685),u=n(94184),d=n.n(u),p=n(15671),f=n(43144),v=n(60136),m=n(33643),h=n(45987),w=n(15861),y=n(64217);function g(e){var t=e.responseText||e.response;if(!t)return t;try{return JSON.parse(t)}catch(n){return t}}function b(e){var t=new XMLHttpRequest;e.onProgress&&t.upload&&(t.upload.onprogress=function(t){t.total>0&&(t.percent=t.loaded/t.total*100),e.onProgress(t)});var n=new FormData;e.data&&Object.keys(e.data).forEach((function(t){var r=e.data[t];Array.isArray(r)?r.forEach((function(e){n.append("".concat(t,"[]"),e)})):n.append(t,r)})),e.file instanceof Blob?n.append(e.filename,e.file,e.file.name):n.append(e.filename,e.file),t.onerror=function(t){e.onError(t)},t.onload=function(){return t.status<200||t.status>=300?e.onError(function(e,t){var n="cannot ".concat(e.method," ").concat(e.action," ").concat(t.status,"'"),r=new Error(n);return r.status=t.status,r.method=e.method,r.url=e.action,r}(e,t),g(t)):e.onSuccess(g(t),t)},t.open(e.method,e.action,!0),e.withCredentials&&"withCredentials"in t&&(t.withCredentials=!0);var r=e.headers||{};return null!==r["X-Requested-With"]&&t.setRequestHeader("X-Requested-With","XMLHttpRequest"),Object.keys(r).forEach((function(e){null!==r[e]&&t.setRequestHeader(e,r[e])})),t.send(n),{abort:function(){t.abort()}}}var Z=+new Date,E=0;function k(){return"rc-upload-".concat(Z,"-").concat(++E)}var x=n(80334),C=function(e,t){if(e&&t){var n=Array.isArray(t)?t:t.split(","),r=e.name||"",o=e.type||"",a=o.replace(/\/.*$/,"");return n.some((function(e){var t=e.trim();if(/^\*(\/\*)?$/.test(e))return!0;if("."===t.charAt(0)){var n=r.toLowerCase(),i=t.toLowerCase(),c=[i];return".jpg"!==i&&".jpeg"!==i||(c=[".jpg",".jpeg"]),c.some((function(e){return n.endsWith(e)}))}return/\/\*$/.test(t)?a===t.replace(/\/.*$/,""):o===t||!!/^\w+$/.test(t)&&((0,x.ZP)(!1,"Upload takes an invalidate 'accept' type '".concat(t,"'.Skip for check.")),!0)}))}return!0};var I=function(e,t,n){var r=function e(r,o){r.path=o||"",r.isFile?r.file((function(e){n(e)&&(r.fullPath&&!e.webkitRelativePath&&(Object.defineProperties(e,{webkitRelativePath:{writable:!0}}),e.webkitRelativePath=r.fullPath.replace(/^\//,""),Object.defineProperties(e,{webkitRelativePath:{writable:!1}})),t([e]))})):r.isDirectory&&function(e,t){var n=e.createReader(),r=[];!function e(){n.readEntries((function(n){var o=Array.prototype.slice.apply(n);r=r.concat(o),o.length?e():t(r)}))}()}(r,(function(t){t.forEach((function(t){e(t,"".concat(o).concat(r.name,"/"))}))}))};e.forEach((function(e){r(e.webkitGetAsEntry())}))},R=["component","prefixCls","className","disabled","id","style","multiple","accept","capture","children","directory","openFileDialogOnClick","onMouseEnter","onMouseLeave"],N=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;(0,p.Z)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).state={uid:k()},e.reqs={},e.fileInput=void 0,e._isMounted=void 0,e.onChange=function(t){var n=e.props,r=n.accept,o=n.directory,a=t.target.files,i=(0,l.Z)(a).filter((function(e){return!o||C(e,r)}));e.uploadFiles(i),e.reset()},e.onClick=function(t){var n=e.fileInput;if(n){var r=e.props,o=r.children,a=r.onClick;if(o&&"button"===o.type){var i=n.parentNode;i.focus(),i.querySelector("button").blur()}n.click(),a&&a(t)}},e.onKeyDown=function(t){"Enter"===t.key&&e.onClick(t)},e.onFileDrop=function(t){var n=e.props.multiple;if(t.preventDefault(),"dragover"!==t.type)if(e.props.directory)I(Array.prototype.slice.call(t.dataTransfer.items),e.uploadFiles,(function(t){return C(t,e.props.accept)}));else{var r=(0,l.Z)(t.dataTransfer.files).filter((function(t){return C(t,e.props.accept)}));!1===n&&(r=r.slice(0,1)),e.uploadFiles(r)}},e.uploadFiles=function(t){var n=(0,l.Z)(t),r=n.map((function(t){return t.uid=k(),e.processFile(t,n)}));Promise.all(r).then((function(t){var n=e.props.onBatchStart;null===n||void 0===n||n(t.map((function(e){return{file:e.origin,parsedFile:e.parsedFile}}))),t.filter((function(e){return null!==e.parsedFile})).forEach((function(t){e.post(t)}))}))},e.processFile=function(){var t=(0,w.Z)((0,i.Z)().mark((function t(n,r){var o,a,l,s,u,d,p,f,v;return(0,i.Z)().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=e.props.beforeUpload,a=n,!o){t.next=14;break}return t.prev=3,t.next=6,o(n,r);case 6:a=t.sent,t.next=12;break;case 9:t.prev=9,t.t0=t.catch(3),a=!1;case 12:if(!1!==a){t.next=14;break}return t.abrupt("return",{origin:n,parsedFile:null,action:null,data:null});case 14:if("function"!==typeof(l=e.props.action)){t.next=21;break}return t.next=18,l(n);case 18:s=t.sent,t.next=22;break;case 21:s=l;case 22:if("function"!==typeof(u=e.props.data)){t.next=29;break}return t.next=26,u(n);case 26:d=t.sent,t.next=30;break;case 29:d=u;case 30:return p="object"!==(0,c.Z)(a)&&"string"!==typeof a||!a?n:a,f=p instanceof File?p:new File([p],n.name,{type:n.type}),(v=f).uid=n.uid,t.abrupt("return",{origin:n,data:d,parsedFile:v,action:s});case 35:case"end":return t.stop()}}),t,null,[[3,9]])})));return function(e,n){return t.apply(this,arguments)}}(),e.saveFileInput=function(t){e.fileInput=t},e}return(0,f.Z)(n,[{key:"componentDidMount",value:function(){this._isMounted=!0}},{key:"componentWillUnmount",value:function(){this._isMounted=!1,this.abort()}},{key:"post",value:function(e){var t=this,n=e.data,r=e.origin,o=e.action,a=e.parsedFile;if(this._isMounted){var i=this.props,c=i.onStart,l=i.customRequest,s=i.name,u=i.headers,d=i.withCredentials,p=i.method,f=r.uid,v=l||b,m={action:o,filename:s,data:n,file:a,headers:u,withCredentials:d,method:p||"post",onProgress:function(e){var n=t.props.onProgress;null===n||void 0===n||n(e,a)},onSuccess:function(e,n){var r=t.props.onSuccess;null===r||void 0===r||r(e,a,n),delete t.reqs[f]},onError:function(e,n){var r=t.props.onError;null===r||void 0===r||r(e,n,a),delete t.reqs[f]}};c(r),this.reqs[f]=v(m)}}},{key:"reset",value:function(){this.setState({uid:k()})}},{key:"abort",value:function(e){var t=this.reqs;if(e){var n=e.uid?e.uid:e;t[n]&&t[n].abort&&t[n].abort(),delete t[n]}else Object.keys(t).forEach((function(e){t[e]&&t[e].abort&&t[e].abort(),delete t[e]}))}},{key:"render",value:function(){var e,t=this.props,n=t.component,i=t.prefixCls,c=t.className,l=t.disabled,s=t.id,u=t.style,p=t.multiple,f=t.accept,v=t.capture,m=t.children,w=t.directory,g=t.openFileDialogOnClick,b=t.onMouseEnter,Z=t.onMouseLeave,E=(0,h.Z)(t,R),k=d()((e={},(0,a.Z)(e,i,!0),(0,a.Z)(e,"".concat(i,"-disabled"),l),(0,a.Z)(e,c,c),e)),x=w?{directory:"directory",webkitdirectory:"webkitdirectory"}:{},C=l?{}:{onClick:g?this.onClick:function(){},onKeyDown:g?this.onKeyDown:function(){},onMouseEnter:b,onMouseLeave:Z,onDrop:this.onFileDrop,onDragOver:this.onFileDrop,tabIndex:"0"};return o.createElement(n,(0,r.Z)({},C,{className:k,role:"button",style:u}),o.createElement("input",(0,r.Z)({},(0,y.Z)(E,{aria:!0,data:!0}),{id:s,type:"file",ref:this.saveFileInput,onClick:function(e){return e.stopPropagation()},key:this.state.uid,style:{display:"none"},accept:f},x,{multiple:p,onChange:this.onChange},null!=v?{capture:v}:{})),m)}}]),n}(o.Component),F=N;function P(){}var D=function(e){(0,v.Z)(n,e);var t=(0,m.Z)(n);function n(){var e;(0,p.Z)(this,n);for(var r=arguments.length,o=new Array(r),a=0;a<r;a++)o[a]=arguments[a];return(e=t.call.apply(t,[this].concat(o))).uploader=void 0,e.saveUploader=function(t){e.uploader=t},e}return(0,f.Z)(n,[{key:"abort",value:function(e){this.uploader.abort(e)}},{key:"render",value:function(){return o.createElement(F,(0,r.Z)({},this.props,{ref:this.saveUploader}))}}]),n}(o.Component);D.defaultProps={component:"span",prefixCls:"rc-upload",data:{},headers:{},name:"file",multipart:!1,onStart:P,onError:P,onSuccess:P,multiple:!1,beforeUpload:null,customRequest:null,withCredentials:!1,openFileDialogOnClick:!0};var O=D,L=n(21770),M=n(73935),U=n(53124),S=n(98866),_=n(23715),j=n(7734),z=n(1413),T={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"},A=n(42135),H=function(e,t){return o.createElement(A.Z,(0,z.Z)((0,z.Z)({},e),{},{ref:t,icon:T}))};H.displayName="FileTwoTone";var V=o.forwardRef(H),q=n(50888),B={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"},$=function(e,t){return o.createElement(A.Z,(0,z.Z)((0,z.Z)({},e),{},{ref:t,icon:B}))};$.displayName="PaperClipOutlined";var W=o.forwardRef($),X={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"},G=function(e,t){return o.createElement(A.Z,(0,z.Z)((0,z.Z)({},e),{},{ref:t,icon:X}))};G.displayName="PictureTwoTone";var J=o.forwardRef(G),K=n(62874),Q=n(71577),Y=n(57838),ee=n(33603),te=n(96159);function ne(e){return(0,r.Z)((0,r.Z)({},e),{lastModified:e.lastModified,lastModifiedDate:e.lastModifiedDate,name:e.name,size:e.size,type:e.type,uid:e.uid,percent:0,originFileObj:e})}function re(e,t){var n=(0,l.Z)(t),r=n.findIndex((function(t){return t.uid===e.uid}));return-1===r?n.push(e):n[r]=e,n}function oe(e,t){var n=void 0!==e.uid?"uid":"name";return t.filter((function(t){return t[n]===e[n]}))[0]}var ae=function(e){return 0===e.indexOf("image/")},ie=function(e){if(e.type&&!e.thumbUrl)return ae(e.type);var t=e.thumbUrl||e.url||"",n=function(){var e=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").split("/"),t=e[e.length-1].split(/#|\?/)[0];return(/\.[^./\\]*$/.exec(t)||[""])[0]}(t);return!(!/^data:image\//.test(t)&&!/(webp|svg|png|gif|jpg|jpeg|jfif|bmp|dpg|ico|heic|heif)$/i.test(n))||!/^data:/.test(t)&&!n},ce=200;function le(e){return new Promise((function(t){if(e.type&&ae(e.type)){var n=document.createElement("canvas");n.width=ce,n.height=ce,n.style.cssText="position: fixed; left: 0; top: 0; width: ".concat(ce,"px; height: ").concat(ce,"px; z-index: 9999; display: none;"),document.body.appendChild(n);var r=n.getContext("2d"),o=new Image;if(o.onload=function(){var e=o.width,a=o.height,i=ce,c=ce,l=0,s=0;e>a?s=-((c=a*(ce/e))-i)/2:l=-((i=e*(ce/a))-c)/2,r.drawImage(o,l,s,i,c);var u=n.toDataURL();document.body.removeChild(n),t(u)},o.crossOrigin="anonymous",e.type.startsWith("image/svg+xml")){var a=new FileReader;a.addEventListener("load",(function(){a.result&&(o.src=a.result)})),a.readAsDataURL(e)}else o.src=window.URL.createObjectURL(e)}else t("")}))}var se=n(48689),ue={icon:{tag:"svg",attrs:{viewBox:"64 64 896 896",focusable:"false"},children:[{tag:"path",attrs:{d:"M505.7 661a8 8 0 0012.6 0l112-141.7c4.1-5.2.4-12.9-6.3-12.9h-74.1V168c0-4.4-3.6-8-8-8h-60c-4.4 0-8 3.6-8 8v338.3H400c-6.7 0-10.4 7.7-6.3 12.9l112 141.8zM878 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:"download",theme:"outlined"},de=function(e,t){return o.createElement(A.Z,(0,z.Z)((0,z.Z)({},e),{},{ref:t,icon:ue}))};de.displayName="DownloadOutlined";var pe=o.forwardRef(de),fe=n(99611),ve=n(97910),me=n(94199),he=o.forwardRef((function(e,t){var n,i,c,l=e.prefixCls,u=e.className,p=e.style,f=e.locale,v=e.listType,m=e.file,h=e.items,w=e.progress,y=e.iconRender,g=e.actionIconRender,b=e.itemRender,Z=e.isImgUrl,E=e.showPreviewIcon,k=e.showRemoveIcon,x=e.showDownloadIcon,C=e.previewIcon,I=e.removeIcon,R=e.downloadIcon,N=e.onPreview,F=e.onDownload,P=e.onClose,D=m.status,O=o.useState(D),L=(0,s.Z)(O,2),M=L[0],S=L[1];o.useEffect((function(){"removed"!==D&&S(D)}),[D]);var _=o.useState(!1),j=(0,s.Z)(_,2),z=j[0],T=j[1],A=o.useRef(null);o.useEffect((function(){return A.current=setTimeout((function(){T(!0)}),300),function(){A.current&&clearTimeout(A.current)}}),[]);var H="".concat(l,"-span"),V=y(m),q=o.createElement("div",{className:"".concat(l,"-text-icon")},V);if("picture"===v||"picture-card"===v)if("uploading"===M||!m.thumbUrl&&!m.url){var B,$=d()((B={},(0,a.Z)(B,"".concat(l,"-list-item-thumbnail"),!0),(0,a.Z)(B,"".concat(l,"-list-item-file"),"uploading"!==M),B));q=o.createElement("div",{className:$},V)}else{var W,X=(null===Z||void 0===Z?void 0:Z(m))?o.createElement("img",{src:m.thumbUrl||m.url,alt:m.name,className:"".concat(l,"-list-item-image"),crossOrigin:m.crossOrigin}):V,G=d()((W={},(0,a.Z)(W,"".concat(l,"-list-item-thumbnail"),!0),(0,a.Z)(W,"".concat(l,"-list-item-file"),Z&&!Z(m)),W));q=o.createElement("a",{className:G,onClick:function(e){return N(m,e)},href:m.url||m.thumbUrl,target:"_blank",rel:"noopener noreferrer"},X)}var J,Q=d()((n={},(0,a.Z)(n,"".concat(l,"-list-item"),!0),(0,a.Z)(n,"".concat(l,"-list-item-").concat(M),!0),(0,a.Z)(n,"".concat(l,"-list-item-list-type-").concat(v),!0),n)),Y="string"===typeof m.linkProps?JSON.parse(m.linkProps):m.linkProps,ee=k?g(("function"===typeof I?I(m):I)||o.createElement(se.Z,null),(function(){return P(m)}),l,f.removeFile):null,te=x&&"done"===M?g(("function"===typeof R?R(m):R)||o.createElement(pe,null),(function(){return F(m)}),l,f.downloadFile):null,ne="picture-card"!==v&&o.createElement("span",{key:"download-delete",className:d()("".concat(l,"-list-item-card-actions"),{picture:"picture"===v})},te,ee),re=d()("".concat(l,"-list-item-name")),oe=m.url?[o.createElement("a",(0,r.Z)({key:"view",target:"_blank",rel:"noopener noreferrer",className:re,title:m.name},Y,{href:m.url,onClick:function(e){return N(m,e)}}),m.name),ne]:[o.createElement("span",{key:"view",className:re,onClick:function(e){return N(m,e)},title:m.name},m.name),ne],ae=E?o.createElement("a",{href:m.url||m.thumbUrl,target:"_blank",rel:"noopener noreferrer",style:m.url||m.thumbUrl?void 0:{pointerEvents:"none",opacity:.5},onClick:function(e){return N(m,e)},title:f.previewFile},"function"===typeof C?C(m):C||o.createElement(fe.Z,null)):null,ie="picture-card"===v&&"uploading"!==M&&o.createElement("span",{className:"".concat(l,"-list-item-actions")},ae,"done"===M&&te,ee);J=m.response&&"string"===typeof m.response?m.response:(null===(i=m.error)||void 0===i?void 0:i.statusText)||(null===(c=m.error)||void 0===c?void 0:c.message)||f.uploadError;var ce=o.createElement("span",{className:H},q,oe),le=(0,o.useContext(U.E_).getPrefixCls)(),ue=o.createElement("div",{className:Q},o.createElement("div",{className:"".concat(l,"-list-item-info")},ce),ie,z&&o.createElement(K.Z,{motionName:"".concat(le,"-fade"),visible:"uploading"===M,motionDeadline:2e3},(function(e){var t=e.className,n="percent"in m?o.createElement(ve.Z,(0,r.Z)({},w,{type:"line",percent:m.percent})):null;return o.createElement("div",{className:d()("".concat(l,"-list-item-progress"),t)},n)}))),de=d()("".concat(l,"-list-").concat(v,"-container"),u),he="error"===M?o.createElement(me.Z,{title:J,getPopupContainer:function(e){return e.parentNode}},ue):ue;return o.createElement("div",{className:de,style:p,ref:t},b?b(he,m,h,{download:F.bind(null,m),preview:N.bind(null,m),remove:P.bind(null,m)}):he)})),we=(0,r.Z)({},ee.ZP);delete we.onAppearEnd,delete we.onEnterEnd,delete we.onLeaveEnd;var ye=function(e,t){var n,i=e.listType,c=void 0===i?"text":i,u=e.previewFile,p=void 0===u?le:u,f=e.onPreview,v=e.onDownload,m=e.onRemove,h=e.locale,w=e.iconRender,y=e.isImageUrl,g=void 0===y?ie:y,b=e.prefixCls,Z=e.items,E=void 0===Z?[]:Z,k=e.showPreviewIcon,x=void 0===k||k,C=e.showRemoveIcon,I=void 0===C||C,R=e.showDownloadIcon,N=void 0!==R&&R,F=e.removeIcon,P=e.previewIcon,D=e.downloadIcon,O=e.progress,L=void 0===O?{strokeWidth:2,showInfo:!1}:O,M=e.appendAction,S=e.appendActionVisible,_=void 0===S||S,j=e.itemRender,z=(0,Y.Z)(),T=o.useState(!1),A=(0,s.Z)(T,2),H=A[0],B=A[1];o.useEffect((function(){"picture"!==c&&"picture-card"!==c||(E||[]).forEach((function(e){"undefined"!==typeof document&&"undefined"!==typeof window&&window.FileReader&&window.File&&(e.originFileObj instanceof File||e.originFileObj instanceof Blob)&&void 0===e.thumbUrl&&(e.thumbUrl="",p&&p(e.originFileObj).then((function(t){e.thumbUrl=t||"",z()})))}))}),[c,E,p]),o.useEffect((function(){B(!0)}),[]);var $=function(e,t){if(f)return null===t||void 0===t||t.preventDefault(),f(e)},X=function(e){"function"===typeof v?v(e):e.url&&window.open(e.url)},G=function(e){null===m||void 0===m||m(e)},ee=function(e){if(w)return w(e,c);var t="uploading"===e.status,n=g&&g(e)?o.createElement(J,null):o.createElement(V,null),r=t?o.createElement(q.Z,null):o.createElement(W,null);return"picture"===c?r=t?o.createElement(q.Z,null):n:"picture-card"===c&&(r=t?h.uploading:n),r},ne=function(e,t,n,a){var i={type:"text",size:"small",title:a,onClick:function(n){t(),(0,te.l$)(e)&&e.props.onClick&&e.props.onClick(n)},className:"".concat(n,"-list-item-card-actions-btn")};if((0,te.l$)(e)){var c=(0,te.Tm)(e,(0,r.Z)((0,r.Z)({},e.props),{onClick:function(){}}));return o.createElement(Q.Z,(0,r.Z)({},i,{icon:c}))}return o.createElement(Q.Z,(0,r.Z)({},i),o.createElement("span",null,e))};o.useImperativeHandle(t,(function(){return{handlePreview:$,handleDownload:X}}));var re=o.useContext(U.E_),oe=re.getPrefixCls,ae=re.direction,ce=oe("upload",b),se=d()((n={},(0,a.Z)(n,"".concat(ce,"-list"),!0),(0,a.Z)(n,"".concat(ce,"-list-").concat(c),!0),(0,a.Z)(n,"".concat(ce,"-list-rtl"),"rtl"===ae),n)),ue=(0,l.Z)(E.map((function(e){return{key:e.uid,file:e}}))),de="picture-card"===c?"animate-inline":"animate",pe={motionDeadline:2e3,motionName:"".concat(ce,"-").concat(de),keys:ue,motionAppear:H};return"picture-card"!==c&&(pe=(0,r.Z)((0,r.Z)({},we),pe)),o.createElement("div",{className:se},o.createElement(K.V,(0,r.Z)({},pe,{component:!1}),(function(e){var t=e.key,n=e.file,r=e.className,a=e.style;return o.createElement(he,{key:t,locale:h,prefixCls:ce,className:r,style:a,file:n,items:E,progress:L,listType:c,isImgUrl:g,showPreviewIcon:x,showRemoveIcon:I,showDownloadIcon:N,removeIcon:F,previewIcon:P,downloadIcon:D,iconRender:ee,actionIconRender:ne,itemRender:j,onPreview:$,onDownload:X,onClose:G})})),M&&o.createElement(K.Z,(0,r.Z)({},pe,{visible:_,forceRender:!0}),(function(e){var t=e.className,n=e.style;return(0,te.Tm)(M,(function(e){return{className:d()(e.className,t),style:(0,r.Z)((0,r.Z)((0,r.Z)({},n),{pointerEvents:t?"none":void 0}),e.style)}}))})))};var ge=o.forwardRef(ye),be=function(e,t,n,r){return new(n||(n=Promise))((function(o,a){function i(e){try{l(r.next(e))}catch(t){a(t)}}function c(e){try{l(r.throw(e))}catch(t){a(t)}}function l(e){var t;e.done?o(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(i,c)}l((r=r.apply(e,t||[])).next())}))},Ze="__LIST_IGNORE_".concat(Date.now(),"__"),Ee=function(e,t){var n,u=e.fileList,p=e.defaultFileList,f=e.onRemove,v=e.showUploadList,m=void 0===v||v,h=e.listType,w=void 0===h?"text":h,y=e.onPreview,g=e.onDownload,b=e.onChange,Z=e.onDrop,E=e.previewFile,k=e.disabled,x=e.locale,C=e.iconRender,I=e.isImageUrl,R=e.progress,N=e.prefixCls,F=e.className,P=e.type,D=void 0===P?"select":P,z=e.children,T=e.style,A=e.itemRender,H=e.maxCount,V=e.data,q=void 0===V?{}:V,B=e.multiple,$=void 0!==B&&B,W=e.action,X=void 0===W?"":W,G=e.accept,J=void 0===G?"":G,K=e.supportServerRender,Q=void 0===K||K,Y=o.useContext(S.Z),ee=null!==k&&void 0!==k?k:Y,te=(0,L.Z)(p||[],{value:u,postState:function(e){return null!==e&&void 0!==e?e:[]}}),ae=(0,s.Z)(te,2),ie=ae[0],ce=ae[1],le=o.useState("drop"),se=(0,s.Z)(le,2),ue=se[0],de=se[1],pe=o.useRef(null);o.useMemo((function(){var e=Date.now();(u||[]).forEach((function(t,n){t.uid||Object.isFrozen(t)||(t.uid="__AUTO__".concat(e,"_").concat(n,"__"))}))}),[u]);var fe=function(e,t,n){var r=(0,l.Z)(t);1===H?r=r.slice(-1):H&&(r=r.slice(0,H)),(0,M.flushSync)((function(){ce(r)}));var o={file:e,fileList:r};n&&(o.event=n),null===b||void 0===b||b(o)},ve=function(e){var t=e.filter((function(e){return!e.file[Ze]}));if(t.length){var n=t.map((function(e){return ne(e.file)})),r=(0,l.Z)(ie);n.forEach((function(e){r=re(e,r)})),n.forEach((function(e,n){var o=e;if(t[n].parsedFile)e.status="uploading";else{var a,i=e.originFileObj;try{a=new File([i],i.name,{type:i.type})}catch(c){(a=new Blob([i],{type:i.type})).name=i.name,a.lastModifiedDate=new Date,a.lastModified=(new Date).getTime()}a.uid=e.uid,o=a}fe(o,r)}))}},me=function(e,t,n){try{"string"===typeof e&&(e=JSON.parse(e))}catch(a){}if(oe(t,ie)){var r=ne(t);r.status="done",r.percent=100,r.response=e,r.xhr=n;var o=re(r,ie);fe(r,o)}},he=function(e,t){if(oe(t,ie)){var n=ne(t);n.status="uploading",n.percent=e.percent;var r=re(n,ie);fe(n,r,e)}},we=function(e,t,n){if(oe(n,ie)){var r=ne(n);r.error=e,r.response=t,r.status="error";var o=re(r,ie);fe(r,o)}},ye=function(e){var t;Promise.resolve("function"===typeof f?f(e):f).then((function(n){var o;if(!1!==n){var a=function(e,t){var n=void 0!==e.uid?"uid":"name",r=t.filter((function(t){return t[n]!==e[n]}));return r.length===t.length?null:r}(e,ie);a&&(t=(0,r.Z)((0,r.Z)({},e),{status:"removed"}),null===ie||void 0===ie||ie.forEach((function(e){var n=void 0!==t.uid?"uid":"name";e[n]!==t[n]||Object.isFrozen(e)||(e.status="removed")})),null===(o=pe.current)||void 0===o||o.abort(t),fe(t,a))}}))},Ee=function(e){de(e.type),"drop"===e.type&&(null===Z||void 0===Z||Z(e))};o.useImperativeHandle(t,(function(){return{onBatchStart:ve,onSuccess:me,onProgress:he,onError:we,fileList:ie,upload:pe.current}}));var ke=o.useContext(U.E_),xe=ke.getPrefixCls,Ce=ke.direction,Ie=xe("upload",N),Re=(0,r.Z)((0,r.Z)({onBatchStart:ve,onError:we,onProgress:he,onSuccess:me},e),{data:q,multiple:$,action:X,accept:J,supportServerRender:Q,prefixCls:Ie,disabled:ee,beforeUpload:function(t,n){return be(void 0,void 0,void 0,(0,i.Z)().mark((function r(){var o,a,l,s;return(0,i.Z)().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(o=e.beforeUpload,a=e.transformFile,l=t,!o){r.next=13;break}return r.next=5,o(t,n);case 5:if(!1!==(s=r.sent)){r.next=8;break}return r.abrupt("return",!1);case 8:if(delete t[Ze],s!==Ze){r.next=12;break}return Object.defineProperty(t,Ze,{value:!0,configurable:!0}),r.abrupt("return",!1);case 12:"object"===(0,c.Z)(s)&&s&&(l=s);case 13:if(!a){r.next=17;break}return r.next=16,a(l);case 16:l=r.sent;case 17:return r.abrupt("return",l);case 18:case"end":return r.stop()}}),r)})))},onChange:void 0});delete Re.className,delete Re.style,z&&!ee||delete Re.id;var Ne=function(e,t){return m?o.createElement(_.Z,{componentName:"Upload",defaultLocale:j.Z.Upload},(function(n){var a="boolean"===typeof m?{}:m,i=a.showRemoveIcon,c=a.showPreviewIcon,l=a.showDownloadIcon,s=a.removeIcon,u=a.previewIcon,d=a.downloadIcon;return o.createElement(ge,{prefixCls:Ie,listType:w,items:ie,previewFile:E,onPreview:y,onDownload:g,onRemove:ye,showRemoveIcon:!ee&&i,showPreviewIcon:c,showDownloadIcon:l,removeIcon:s,previewIcon:u,downloadIcon:d,iconRender:C,locale:(0,r.Z)((0,r.Z)({},n),x),isImageUrl:I,progress:R,appendAction:e,appendActionVisible:t,itemRender:A})})):e};if("drag"===D){var Fe,Pe=d()(Ie,(Fe={},(0,a.Z)(Fe,"".concat(Ie,"-drag"),!0),(0,a.Z)(Fe,"".concat(Ie,"-drag-uploading"),ie.some((function(e){return"uploading"===e.status}))),(0,a.Z)(Fe,"".concat(Ie,"-drag-hover"),"dragover"===ue),(0,a.Z)(Fe,"".concat(Ie,"-disabled"),ee),(0,a.Z)(Fe,"".concat(Ie,"-rtl"),"rtl"===Ce),Fe),F);return o.createElement("span",null,o.createElement("div",{className:Pe,onDrop:Ee,onDragOver:Ee,onDragLeave:Ee,style:T},o.createElement(O,(0,r.Z)({},Re,{ref:pe,className:"".concat(Ie,"-btn")}),o.createElement("div",{className:"".concat(Ie,"-drag-container")},z))),Ne())}var De,Oe=d()(Ie,(n={},(0,a.Z)(n,"".concat(Ie,"-select"),!0),(0,a.Z)(n,"".concat(Ie,"-select-").concat(w),!0),(0,a.Z)(n,"".concat(Ie,"-disabled"),ee),(0,a.Z)(n,"".concat(Ie,"-rtl"),"rtl"===Ce),n)),Le=(De=z?void 0:{display:"none"},o.createElement("div",{className:Oe,style:De},o.createElement(O,(0,r.Z)({},Re,{ref:pe}))));return"picture-card"===w?o.createElement("span",{className:d()("".concat(Ie,"-picture-card-wrapper"),F)},Ne(Le,!!z)):o.createElement("span",{className:F},Le,Ne())};var ke=o.forwardRef(Ee),xe=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"===typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};var Ce=o.forwardRef((function(e,t){var n=e.style,a=e.height,i=xe(e,["style","height"]);return o.createElement(ke,(0,r.Z)({ref:t},i,{type:"drag",style:(0,r.Z)((0,r.Z)({},n),{height:a})}))})),Ie=ke;Ie.Dragger=Ce,Ie.LIST_IGNORE=Ze;var Re=Ie}}]);
//# sourceMappingURL=7916-e49972911f0f854a.js.map