(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["views/smb/app/progress"],{1120:function(e,s,t){"use strict";t.r(s);var r=t(149),o=t.n(r),n=t(145);class i extends n.Component{constructor(...e){super(...e),o()(this,"STATUS_STARTED",0),o()(this,"STATUS_NOT_STARTED",1),o()(this,"STATUS_DONE",2),o()(this,"STATUS_ERROR",3)}_initConfiguration(e){super._initConfiguration({locale:n.Locale.getSection("smb.components.elements.download"),...e}),setTimeout(()=>{this.updateProgress()},1e3)}_initComponentElement(){this._progressTextElement=new Element("div",{class:"progress-label"}),this._progressBarElement=new Element("div",{class:"progress"}),this._progressBarElement.innerHTML='<div class="progress-bar"></div>',this._componentElement=new Element("div",{class:"progress-box app-progress-panel"}),this._componentElement.appendChild(this._progressTextElement),this._componentElement.appendChild(this._progressBarElement),this._update(0)}_update(e){e=Math.max(e,1),this._progressTextElement.innerHTML=this.lmsg("progress",{percents:e}),this._progressBarElement.querySelectorAll("div.progress-bar").forEach(s=>{s.style.width="".concat(e,"%")})}updateProgress(){new Ajax.Request(this._getConfigParam("requestUrl"),{method:"get",onSuccess:e=>{try{const s=JSON.parse(e.responseText);if(s.progress&&this._update(s.progress),s.status===this.STATUS_STARTED||s.status===this.STATUS_NOT_STARTED)return void setTimeout(()=>{this.updateProgress()},this._getConfigParam("timeout",1e3));s.url=s.url?s.url:this._getConfigParam("redirectUrl").replace("%packageId%",s.packageId).replace("%resourceId%",s.resourceId),s.method=this._getConfigParam("redirectMethod","get"),Object(n.redirect)(s)}catch(e){}}})}}s.default=e=>{new i(e)}}}]);
//# sourceMappingURL=progress.js.map?dbf75156398c4a9f1ef2