(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/convert-customers-to-resellers"],{1109:(e,t,s)=>{"use strict";s.r(t);var o=s(144);class a extends o.ConfirmationPopupManager.PopupForm{_initConfiguration(e){super._initConfiguration({locale:o.Locale.getSection("admin.components.confirmations.customer"),...e})}_onSuccessPreparePopup(e){this._clearMessages(),this._response=e,"success"===this._response.status?(document.getElementById(this._formBoxAreaId).innerHTML="",document.getElementById(this._formListAreaId).innerHTML='<table cellspacing="0" width="100%">'+'<tbody id="'.concat(this._formListItemsAreaId,'">')+"</tbody></table>",$H(this._response.customers).each((({value:e})=>{this.addCustomer(e)}))):this._addErrorMessage(this._response.message)}addCustomer(e){this._itemClass="odd"===this._itemClass?"even":"odd";const t='<tr class="'.concat(this._itemClass,'">')+"<td><b>".concat((0,o.escapeHtml)(e.name),"</b></td>")+"<td>".concat(this.getPlanSelectorHtml(e),"</td>")+"</tr>";(0,o.render)(document.getElementById(this._formListItemsAreaId),t)}getPlanSelectorHtml(e){let t='<select class="customers" name="customers['.concat(e.id,']" id="customers-select-').concat(e.id,'" title="').concat(e.id,'">');return $H(this._response.plans).each((({value:e})=>{t+='<option value="'.concat(e.id,'">').concat((0,o.escapeHtml)(e.name),"</option>")})),t+="</select>",t}_getAdditionalParams(e){return document.querySelectorAll(".customers").forEach((({title:t,value:s})=>{e.set("customers[".concat(t,"]"),s)})),e}}t.default=a}}]);
//# sourceMappingURL=convert-customers-to-resellers.js.map?87997e7fda6367cbc7c7