(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["app/file-manager/upload-progress-dialog"],{1050:function(e,t,a){"use strict";a.r(t);var s=a(156),r=a(155),n=a(145),l=a(1051);t.default=({container:e,...t})=>{const a=n.Locale.getSection("smb.controllers.file-manager.upload").messages;a["ProgressDialog.closeButton"]=a.buttonClose,a["ProgressDialog.cancelButton"]=n.Locale.getSection("components.buttons").lmsg("cancel"),Object(r.render)(Object(r.createElement)(s.LocaleProvider,{messages:a},Object(r.createElement)(l.default,t)),e)}},1051:function(e,t,a){"use strict";a.r(t);var s=a(154),r=a.n(s),n=a(156),l=a(155),c=a(276),o=a.n(c);class i extends l.Component{renderItemStatus(e){switch(e.status){case"UPLOADING":return null===e.loaded?Object(l.createElement)("span",{className:"hint-wait"},Object(l.createElement)(n.Translate,{content:"statusUploading"})):this.renderItemProgress(e);case"ERROR":return Object(l.createElement)("span",{className:"hint-failed"},Object(l.createElement)(n.Translate,{content:"statusFailed"}));case"SUCCESS":return Object(l.createElement)("span",{className:"hint-ok"},Object(l.createElement)(n.Translate,{content:"statusCompleted"}));case"CANCELED":return Object(l.createElement)("span",{className:"hint-failed"},Object(l.createElement)(n.Translate,{content:"statusCanceled"}))}return Object(l.createElement)("span",{className:"hint-not-started"},Object(l.createElement)(n.Translate,{content:"statusNotStarted"}))}renderItemProgress(e){const t=e.total>0?Math.round(e.loaded/e.total*100):100;return Object(l.createElement)("div",{className:"progress progress-sm"},Object(l.createElement)("div",{className:"progress-bar",style:{width:"".concat(t,"%")}}))}getUploadProgressDescription(e){return null===e.loaded||e.loaded===e.total?this.getSize(e.total):Object(l.createElement)(n.Translate,{content:"progressText",params:{loaded:this.getSize(e.loaded),total:this.getSize(e.total)}})}getSize(e){let t=0;for(;e>=1024;)e/=1024,t++;return Object(l.createElement)(l.Fragment,null,t>0?e.toFixed(1):e," ",Object(l.createElement)(n.Translate,{content:["bytes","kbytes","mbytes","gbytes"][t]}))}render(){const{status:e,progress:t,items:a,uploadProgressSupported:s,...c}=this.props,o=a.filter(e=>"SUCCESS"===e.status).length,i=Object(l.createElement)(n.Translate,{content:"descriptionUploadProgress","data-id":"progressUploadTitle",params:{total:a.length,completed:o}}),d=t>-1?Object(l.createElement)(n.Translate,{content:"totalProgressText",params:{percent:"".concat(t,"%")}}):Object(l.createElement)("span",null);return Object(l.createElement)(n.ProgressDialog,r()({title:Object(l.createElement)(n.Translate,{content:"uploadDialogTitle"}),description:Object(l.createElement)(n.Translate,{content:"uploadDialogHint"}),cancelable:!0},c),Object(l.createElement)(n.ProgressStep,{title:i,status:e,statusText:d,progress:t},Object(l.createElement)("div",{className:"list"},Object(l.createElement)("table",{width:"100%",cellSpacing:"0",style:{wordBreak:"break-word"}},Object(l.createElement)("tbody",null,a.map((e,t)=>Object(l.createElement)("tr",{key:e.progressId,className:t%2==0?"odd":"even"},Object(l.createElement)("td",{className:"first"},Object(l.createElement)("span",{className:"type-".concat(e.type)},e.savedFileName)),s&&Object(l.createElement)("td",{className:"upload-progress nowrap t-r"},Object(l.createElement)("span",null,this.getUploadProgressDescription(e))),Object(l.createElement)("td",{style:{width:"100px"}},this.renderItemStatus(e)))))))))}}i.propTypes={status:o.a.string.isRequired,progress:o.a.number.isRequired,items:o.a.array.isRequired,uploadProgressSupported:o.a.bool.isRequired},t.default=i}}]);
//# sourceMappingURL=upload-progress-dialog.js.map?38c5ee9849d52cb4a48e