(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/admin/settings-ui/list-languages"],{1142:(e,a,t)=>{"use strict";t.r(a);var n=t(144);(0,n.namespace)("AdminPanel.Server"),AdminPanel.Server.Languages={toggle(e,a){const t=a.active?"disable":"enable";new Ajax.Request((0,n.prepareUrl)("/settings-ui/".concat(t,"-languages")),{method:"post",parameters:{ids:[a.id]},onSuccess(){e.reload(),(0,n.clearStatusMessages)(),(0,n.addStatusMessage)("info",e.lmsg("".concat(t,"Done")))}})},renderDefault:(e,a)=>e.isDefault?"<b>".concat(a,"</b>"):a},a.default=({languagesList:e,urls:a})=>{const s=n.Locale.getSection("admin.components.lists.languages"),l=new n.List({...e,id:"languages-list",operations:[{componentType:n.SmallButton,id:"buttonDisable",title:s.lmsg("buttonDisable"),description:s.lmsg("buttonDisableDescription"),addCls:"sb-list-languages-disable-selected",handler(e){l.execGroupOperation({url:a.disable,mouseEvent:e,skipConfirmation:!0})}},{componentType:n.SmallButton,id:"buttonEnable",title:s.lmsg("buttonEnable"),description:s.lmsg("buttonEnableDescription"),addCls:"sb-list-languages-enable-selected",handler(e){l.execGroupOperation({url:a.enable,mouseEvent:e,skipConfirmation:!0})}},{componentType:n.SmallButton,id:"buttonMakeDefault",title:s.lmsg("buttonMakeDefault"),description:s.lmsg("buttonMakeDefaultDescription"),addCls:"sb-list-languages-make-default-selected",handler(e){l.execGroupOperation({url:a["make-default"],mouseEvent:e,skipConfirmation:!0,checkSelection(){l._hideItemsNotSelectedWarning();if(1===l.getSelectedItemsIds().length)return!0;const e=l._componentElement.querySelector("select-one-item-warning");return e?e.style.display="":(0,n.render)(l._componentElement.querySelector(".actions-box"),'<div class="actions-msg-container" id="select-one-item-warning"><span class="list-actions-msg">'+"<span>".concat(s.lmsg("makeDefaultSelectOne"),"</span>")+"</span></div>","top"),!1},onSuccess(e){"success"===e.status&&(l.getSelectedItems().forEach((e=>e.isDefault=!0)),l.redraw())}})}}],columns:[n.list.COLUMN_SELECTION,{header:s.lmsg("headerStatus"),sortable:!0,dataIndex:"active",headerCls:"icon",cls:"icon",renderer(e){let a,l,r,i;e.active?(a="on",e.isAvailable?(l=t(1027),r=s.lmsg("statusActive")):(l=t(1025),r=s.lmsg("statusActiveUnavailable")),i=s.lmsg("buttonHintStatusActive")):(a="off",l=t(783),r=s.lmsg("statusInactive"),i=s.lmsg("buttonHintStatusInactive")),e.isDefault&&(i=s.lmsg("buttonHintStatusDefaultLangugage"));const o='<img src="'.concat(l,'" alt="').concat(a,'" title="">');return'<span class="tooltipData">'+"".concat((0,n.escapeHtml)(r),"<br><br>")+"".concat((0,n.escapeHtml)(i))+"</span>"+"".concat(e.isDefault?o:'<a data-action-name="toggle">'.concat(o,"</a>"))}},{header:s.lmsg("headerCode"),sortable:!0,dataIndex:"id",headerParams:{width:"10%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,(0,n.escapeHtml)(e.id))},{header:s.lmsg("headerLanguage"),sortable:!0,dataIndex:"lang",headerParams:{width:"40%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,null===e.lang?s.lmsg("langUnknown"):(0,n.escapeHtml)(e.lang))},{header:s.lmsg("headerCountry"),sortable:!0,dataIndex:"country",headerParams:{width:"40%"},renderer:e=>AdminPanel.Server.Languages.renderDefault(e,null===e.country?s.lmsg("countryUnknown"):(0,n.escapeHtml)(e.country))},{header:s.lmsg("headerUsed"),sortable:!0,dataIndex:"used",noEscape:!0,headerParams:{width:"10%"},headerCls:"t-r",cls:"t-r number",renderer:e=>AdminPanel.Server.Languages.renderDefault(e,e.used)}],itemActions:{toggle(e){AdminPanel.Server.Languages.toggle(l,e)}},isDisabledItem:e=>e.isDefault});new n.Panel({cls:"list-box",renderTo:"main",items:[l]})}},1025:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/att.png?448a819f0c047a05dcdef17357707ab7"},783:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/off.png?84d64d1bd3267c21795505b7daa43800"},1027:e=>{e.exports=Jsw.skinUrl+"/icons/16/plesk/on.png?7f7c68cae29103cdfe0278b2fc8d1d9f"}}]);
//# sourceMappingURL=list-languages.js.map?937b87efc3ed89a03062