"use strict";(globalThis.webpackChunkPlesk=globalThis.webpackChunkPlesk||[]).push([["app/domain/restriction"],{3196(e,t,o){o.r(t),o.d(t,{Toggles:()=>g,default:()=>a});var s=o(372),l=o(95),i=o(373),n=o(762),r=o.n(n);const g=({listToggleStatus:e,resolutionToggleStatus:t,resolutionToggleIsAllowed:o=!1})=>{const[n,r]=(0,s.useState)(e),[g,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)(()=>{r(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:g,children:S.lmsg("toggleResolution")}),(0,s.jsx)("br",{})]}),(0,s.jsx)(i.Switch,{id:"listToggle",onChange:e=>(e=>{r(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")})]})};g.propTypes={listToggleStatus:r().bool.isRequired,resolutionToggleStatus:r().bool.isRequired,resolutionToggleIsAllowed:r().bool};const a=g},3195(e,t,o){o.r(t),o.d(t,{default:()=>i});var s=o(372),l=o(3196);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))};(Object.getOwnPropertyDescriptor(i,"name")||{}).writable||Object.defineProperty(i,"name",{value:"default",configurable:!0})}}]);
//# sourceMappingURL=restriction.js.map?b5f8cfcc5255d0c984a8