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