(window.webpackJsonpPlesk=window.webpackJsonpPlesk||[]).push([["app/backup/restore"],{932:function(e,t,o){"use strict";o.r(t);var n=o(145);t.default=({urls:e,taskStatuses:t})=>{const o=n.Locale.getSection("controllers.backup.restore-status"),s=({id:t,status:s,message:c,downloadLog:r,viewLog:a,close:l,stop:d})=>{const i=[c];r&&i.push("&nbsp;",r),a&&i.push("&nbsp;",a),l&&i.push("&nbsp;",Object(n.createElement)("a",{onclick:()=>(async t=>{const{status:o}=await n.api.post(Object(n.addUrlParams)(e.closeStatus,{taskId:t}));if("success"===o){const e=document.getElementById("task-status-".concat(t));null==e||e.parentNode.removeChild(e)}})(t)},o.lmsg("closeMessage"))),d&&i.push("&nbsp;",Object(n.createElement)("a",{onclick:()=>{return o=t,void n.api.post(Object(n.addUrlParams)(e.stopTask,{taskId:o}));var o}},o.lmsg("stop"))),Object(n.addStatusMessage)(s,i,{id:"task-status-".concat(t)})},c=[];t.forEach(e=>{"backup"===e.type&&"progress"===e.status||("progress"===e.status?c.push(e):s(e))}),document.querySelectorAll(".msg-progress").forEach(e=>{c.some(t=>e.id==="task-status-".concat(t.id))||e.parentNode.removeChild(e)}),c.forEach(t=>{const{id:o}=t,c="task-status-".concat(o);if(document.getElementById(c))return;s(t);const r=()=>{n.api.get(Object(n.addUrlParams)(e.restoreStatus,{taskId:o})).then(e=>{const t=document.getElementById(c);t&&("progress"===e.status?(setTimeout(r,1e4),e.stop||(t.parentNode.removeChild(t),s(e))):(t.parentNode.removeChild(t),s(e),Object(n.getComponent)("backup-list").reload()))}).catch(()=>setTimeout(r,1e4))};setTimeout(r,1e4)})}},940:function(e,t,o){"use strict";o.r(t);var n=o(145),s=o(932);t.default=e=>(({type:e,disableRestore:t,...o})=>{const c=o=>{let s=!1;if("local"===e){const e=document.getElementById("restoreModifiedDump-restoreModifiedDumpCheckbox");s=s||e&&!e.checked}const r=document.getElementById("contentSelectSection-restoreType-full"),a=!r||r.checked,l=document.getElementById("contentSelectSection-restoreType-granular"),d=l&&l.checked,i=document.getElementById("restoreComponents");if(i&&(i.style.display=a?"":"none",a)){let e=!1;i.querySelectorAll("input").forEach(t=>{t.checked&&(e=!0)}),s=s||!e}const u=document.getElementById("contentSelectSection-restoreObjectType");u&&(u.closest(".form-row").style.display=d?"":"none",u.querySelectorAll("option").forEach(e=>{const t=document.getElementById("contentSelectSection-restoreObjects_".concat(e.value));let r=d&&e.selected;if(t){const a=document.getElementById("contentSelectSection-subscriptionLookup_".concat(e.value)),l=Object(n.getComponent)(t.id);if(a){a.closest(".form-row").style.display=r?"":"none";const e=Object(n.getComponent)(a.id);!0===o&&e.addEventObserver("dataavailable",()=>{if(e.isEmpty())return void c();const t=document.getElementById("contentSelectSection-restoreObjectType").value,o=document.getElementById("contentSelectSection-restoreObjects_".concat(t)),s=Object(n.getComponent)(o.id),r=JSON.parse(e.getValue()),a={"subscription-name":r.name,"subscription-guid":r.guid};s instanceof n.DoubleListSelector&&s.reload(a),s instanceof n.DynamicSubForm&&s.setDataUrlParams(a),c()}),r&&(s=s||e.isEmpty(),r=r&&!e.isEmpty())}l instanceof n.DoubleListSelector&&(t.closest(".form-row").style.display=r?"":"none",l.onChange=c,r?s=s||l.isEmpty():l.reset()),l instanceof n.DynamicSubForm&&(t.style.display=r?"":"none",l.onChange=c,r?s=s||l.isEmpty():l.reset())}}));const m=document.getElementById("restorationOptions-contentRestoreType-form-row");if(m){m.style.display=d?"":"none";const e=document.getElementById("restorationOptions");1===e.querySelectorAll(".form-row").length&&(e.style.display=d?"":"none")}const p=Object(n.getComponent)("btn-send");p&&(t||s?p.disable():p.enable())};[document.getElementById("restoreModifiedDump-restoreModifiedDumpCheckbox"),document.getElementById("contentSelectSection-restoreType-full"),document.getElementById("contentSelectSection-restoreType-granular"),document.getElementById("contentSelectSection-restoreObjectType")].concat(Array.prototype.slice.call(document.querySelectorAll("#restoreComponents input"))).forEach(e=>{e&&("SELECT"===e.tagName?e.addEventListener("change",c):e.addEventListener("click",c))});const r=document.getElementById("contentSelectSection-restoreType-granularNotSupported");r&&(r.disabled=!0);const a=document.getElementById("contentSelectSection-restoreType-fullNotSupportedInResellerPowerUser");a&&(a.disabled=!0),c(!0),Object(s.default)(o)})(e)}}]);
//# sourceMappingURL=restore.js.map?941011faab3982505fb5