(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/profile/announcement-settings"],{1086:(e,n,t)=>{"use strict";t.r(n);var s=t(155),l=t(154),o=t(261),a=t.n(o);const c=({children:e,onClose:n})=>{const[t,o]=(0,l.useState)(!0);return t?(0,l.createElement)(s.StatusMessage,{intent:"info",onClose:()=>{n(),o(!1)}},e):null};c.propTypes={children:a().node.isRequired,onClose:a().func.isRequired},n.default=c},1085:(e,n,t)=>{"use strict";t.r(n);var s=t(155),l=t(154),o=t(144),a=t(1086);const c="send_personalized_announce",d="none";n.default=({id:e,email:n,infoClosed:t,dialogShown:i})=>{const r=o.Locale.getSection("admin.components.forms.admin.announcement-settings"),u=document.getElementById("".concat(e,"-loader")),y=document.getElementById("".concat(e)),p=document.getElementById("".concat(e,"-info")),m=document.getElementById("".concat(e,"-checkbox")),g=document.getElementById("".concat(e,"-checkbox-block")),f=document.getElementById("".concat(e,"-radio-block")),h=document.getElementById("".concat(e,"-warning")),v=document.getElementById("".concat(e,"-retry")),k=e=>e.some((e=>e.type===c)),E=async()=>{g.style.display="none",f.style.display="none",h.style.display="none",u.style.display="";try{const{consents:e,status:v}=await o.api.get((0,o.prepareUrl)("/my-profile/get-consent"),{email:n});if(u.style.display="none","error"!==v&&e){const n=e.filter((e=>e.enabled));(e=>{k(e)||(e.length>0?!t&&(0,l.render)((0,l.createElement)(a.default,{onClose:()=>o.api.post((0,o.prepareUrl)("/my-profile/close-consent-info"))},r.lmsg("consentGivenInfo")),p):i&&(0,l.render)((0,l.createElement)(s.StatusMessage,{intent:"info"},r.lmsg("consentNotGivenInfo")),p))})(n),(e=>{k(e)?(m.checked=!0,g.style.display="",y.value=c,m.addEventListener("change",(e=>{y.value=e.target.checked?c:d}))):e.length>0?(f.style.display="",y.value="send_announce",f.addEventListener("change",(e=>{y.value=e.target.value}))):(m.checked=!1,g.style.display="",y.value=d,m.addEventListener("change",(e=>{y.value=e.target.checked?c:d})))})(n)}else h.style.display=""}catch{u.style.display="none",h.style.display=""}};v.addEventListener("click",(e=>{e.preventDefault(),E()})),window.loadConsentStatus=E,E()}}}]);
//# sourceMappingURL=announcement-settings.js.map?c3b8f95ddae56ad375f8