"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/domain/restriction"],{3020:(e,t,o)=>{o.r(t),o.d(t,{default:()=>i});var s=o(295),l=o(3021);const i=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o,renderTo:i})=>{(0,s.render)((0,s.jsx)(l.Toggles,{listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o}),document.getElementById(i))}},3021:(e,t,o)=>{o.r(t),o.d(t,{Toggles:()=>r,default:()=>a});var s=o(295),l=o(90),i=o(296),n=o(667),g=o.n(n);const r=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o=!1})=>{const[n,g]=(0,s.useState)(e),[r,a]=(0,s.useState)(t),[u,d]=(0,s.useState)(!1),[c,T]=(0,s.useState)(!1),S=l.Locale.getSection("admin.components.lists.restricteddomains");(0,s.useEffect)(()=>{g(e),a(t)},[e,t]);return(0,s.jsxs)(s.Fragment,{children:[o&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.Switch,{id:"resolutionToggle",onChange:e=>(e=>{a(e=>!e),T(!0),l.api.post("/admin/domain-restriction/resolution-restriction",{toState:e}).finally(()=>T(!1))})(e),loading:c,checked:r,children:S.lmsg("toggleResolution")}),(0,s.jsx)("br",{})]}),(0,s.jsx)(i.Switch,{id:"listToggle",onChange:e=>(e=>{g(e=>!e),d(!0),l.api.post("/admin/domain-restriction/list-restriction",{toState:e}).finally(()=>d(!1))})(e),loading:u,checked:n,children:S.lmsg("toggleProhibitedList")})]})};r.propTypes={listToggleStatus:g().bool.isRequired,resolutionToggleStatus:g().bool.isRequired,resolutionToggleIsAllowed:g().bool};const a=r}}]);
//# sourceMappingURL=restriction.js.map?769c40ea669fbe5fde8c