"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/convert-customers-to-resellers"],{2325:(e,s,t)=>{t.r(s),t.d(s,{default:()=>a});var o=t(89);class r 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="${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 s=`<tr class="${this._itemClass}"><td><b>${(0,o.escapeHtml)(e.name)}</b></td><td>${this.getPlanSelectorHtml(e)}</td></tr>`;(0,o.render)(document.getElementById(this._formListItemsAreaId),s)}getPlanSelectorHtml(e){let s=`<select class="customers" name="customers[${e.id}]" id="customers-select-${e.id}" title="${e.id}">`;return $H(this._response.plans).each((({value:e})=>{s+=`<option value="${e.id}">${(0,o.escapeHtml)(e.name)}</option>`})),s+="</select>",s}_getAdditionalParams(e){return document.querySelectorAll(".customers").forEach((({title:s,value:t})=>{e.set(`customers[${s}]`,t)})),e}}const a=r}}]);
//# sourceMappingURL=convert-customers-to-resellers.js.map?0ba3064b25fde7c43e6f