(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/task-progress-bar"],{1106:(e,t,r)=>{"use strict";r.r(t),r.d(t,{TaskProgressBarItemContent:()=>p});var s=r(154),n=r(578),o=r.n(n),a=r(155),i=r(261),l=r.n(i),c=r(144);const p=({title:e,progress:t,output:r,errors:n,refresh:o})=>{const i=[];return e&&(e=(0,s.createElement)("span",{key:"title",dangerouslySetInnerHTML:{__html:e}})),t?i.push((0,s.createElement)(a.Progress,{key:"progress"},(0,s.createElement)(a.ProgressStep,{title:e,status:"running",progress:t.value,statusText:void 0!==t.value?"".concat(t.value,"%"):void 0},t.onClick&&(0,s.createElement)(a.Link,{onClick:t.onClick},(0,s.createElement)(a.Translate,{content:"progressDialogLink"}))))):(i.push(e),r&&i.push((0,s.createElement)(a.Text,{key:"output",component:"ul",intent:"muted",fontSize:"sm",className:"task-progress-bar-item__output"},r.map(((e,t)=>(0,s.createElement)("li",{key:t.toString()},e))))),n&&i.push((0,s.createElement)(a.Text,{key:"errors",component:"ul",intent:"muted",fontSize:"sm",className:"task-progress-bar-item__output"},n.map(((e,t)=>(0,s.createElement)("li",{key:t.toString()},e))))),o&&i.push((0,s.createElement)(a.Link,{key:"refresh",onClick:o.onClick,component:a.Text,fontSize:"sm"},o.title||(0,s.createElement)(a.Translate,{content:"refresh"})))),(0,s.createElement)("div",{className:"task-progress-bar-item__content"},i)};p.propTypes={title:l().string,progress:l().shape({value:l().number,onClick:l().func}),output:l().arrayOf(l().string),errors:l().arrayOf(l().string),refresh:l().shape({title:l().string,onClick:l().func.isRequired})},p.defaultProps={title:void 0,progress:void 0,output:void 0,errors:void 0,refresh:void 0};const u=({items:e,isOpen:t})=>{const r=[];return e.forEach((e=>{e instanceof c.Task.ProgressBar.Item&&r.push((e=>{const{key:t,intent:r,onClose:n,...a}=e.toToast();return{key:t,intent:r,onClose:n,message:(0,s.createElement)(p,a),closable:!a.progress,className:o()("task-progress-bar-item",{["task-progress-bar-item--".concat(r)]:r})}})(e))})),t?(0,s.createElement)(a.Toaster,{id:"asyncProgressBar",position:"bottom-end",toasts:r}):null};u.propTypes={items:l().array.isRequired,isOpen:l().bool.isRequired},t.default=u},1105:(e,t,r)=>{"use strict";r.r(t);var s=r(154),n=r(155),o=r(1106);t.default=({locale:e,container:t,...r})=>{(0,s.render)((0,s.createElement)(n.LocaleProvider,{messages:e},(0,s.createElement)(o.default,r)),t)}}}]);
//# sourceMappingURL=task-progress-bar.js.map?668aac52527d0d9fb25b