"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/progress-dialog"],{2601:(e,s,t)=>{t.r(s),t.d(s,{default:()=>m});var r=t(271),n=t(270),o=t(272),a=t.n(o),i=t(89);const l="done",u="error",c="not_started",d="canceled",p="running";class g extends n.Component{renderErrors(e,s){if(!Array.isArray(s)||0===s.length)return null;const t=e===u?"danger":"warning";return(0,n.jsx)(r.Alert,{intent:t,"data-type":"errors",children:s.map((e=>(0,n.jsx)("div",{children:e},e)))})}renderStatusText({status:e,progress:s,progressStatus:t}){const o={[l]:"statusDone",[u]:"statusError",[c]:"statusNotStarted",[d]:"statusCanceled"};return e===p&&t?t:e===p&&-1!==s?(0,n.jsx)(r.Translate,{content:"percentCompleted",params:{percent:s}}):o[e]?(0,n.jsx)(r.Translate,{content:o[e]}):null}render(){const{title:e,steps:s,isOpen:t,onComplete:o,onHide:a,...l}=this.props;return(0,n.jsx)(r.ProgressDialog,{title:(0,n.jsx)("span",{dangerouslySetInnerHTML:{__html:e}}),actions:a?(0,n.jsx)(r.Button,{"aria-label":i.Locale.getSection("components.tasks.common").lmsg("minimize"),ghost:!0,size:"lg",icon:"minimize",onClick:a}):null,cancelTitle:(0,n.jsx)(r.Translate,{content:"close","data-type":"close-button"}),isOpen:t,onFinish:o,onClose:a,"data-type":"progress-dialog",...l,children:s.map((({title:e,icon:s,status:t,progress:o,progressStatus:a,errors:i=[],output:l=[]})=>{const u=Number(o);return(0,n.jsxs)(r.ProgressStep,{title:e,icon:{src:s},status:t,statusText:this.renderStatusText({status:t,progress:u,progressStatus:a}),progress:u,children:[this.renderErrors(t,i),l.length>0&&(0,n.jsx)(r.ConsoleOutput,{children:l})]},e)}))})}}g.propTypes={title:a().node.isRequired,steps:a().array.isRequired,isOpen:a().bool.isRequired,errors:a().array.isRequired,onComplete:a().func.isRequired,onHide:a().func.isRequired};const m=g},2600:(e,s,t)=>{t.r(s),t.d(s,{default:()=>a});var r=t(271),n=t(270),o=t(2601);const a=({locale:e,container:s,...t})=>{(0,n.render)((0,n.jsx)(r.LocaleProvider,{messages:e,children:(0,n.jsx)(o.default,{...t})}),s)}}}]);
//# sourceMappingURL=progress-dialog.js.map?bf54b56bc60a6d9771a7