"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/web-app-firewall/submit-handler"],{1805:(e,t,n)=>{n.r(t),n.d(t,{default:()=>l});var s=n(96);const o=s.Locale.getSection("components.forms.web-app-firewall"),c=s.Locale.getSection("components.buttons"),l=({currentWebServer:e,currentRuleSet:t,isCustomized:n,needPresetWarning:l})=>{const r=[];let i=!1;const u=document.getElementById("ruleSets-webServer")?.value;"nginx"===u&&e!==u&&n&&(r.push(o.lmsg("nginxIsIncompatible")),i=!0);const d=document.getElementById("ruleSets-ruleSet-crs")?.checked;d&&"crs"!==t&&r.push(o.lmsg("ruleSetCrsConfirmDescription"));const m=document.getElementById("ruleEngine-On"),g=document.getElementById("ruleEngine-DetectionOnly"),a=document.getElementById("config-configPreset-tradeoff"),p=document.getElementById("config-configPreset-thorough");if(!l||g&&!g.checked&&!m.checked||p&&!p.checked&&!a.checked||r.push(o.lmsg("tradeoffAndThoroughModeWarning")),!r.length)return!0;let h=r[0],f="p",b=e=>e;return r.length>1&&(h=r.map((e=>`<li>${e}</li>`)).join(""),f="ul"),i&&(b=e=>`${e}<div class="indent-box"><input type="checkbox" class="checkbox" id="resetBox" value="true"><div class="indent-box-content"><label for="resetBox">${o.lmsg("nginxResetCustomizations")}</label></div></div>`),new Promise((e=>{s.messageBox.show({type:s.messageBox.TYPE_YESNO,subtype:s.messageBox.SUBTYPE_CONFIRM,text:o.lmsg("ruleSetCrsConfirmTitle"),description:h,descriptionWrapperTag:f,descriptionDecorator:b,onYesClick:()=>{document.getElementById("resetBox")?.checked&&(document.getElementById("ruleSets-resetCustomizations").value="true"),e(!0)},onNoClick:()=>{e(!1)},buttonTitles:{yes:c.lmsg("yes"),no:c.lmsg("no")}})}))}}}]);
//# sourceMappingURL=submit-handler.js.map?46f104d1ad8adf7b670d