"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/dns/records/dns-zone-sync"],{953:(e,n,s)=>{s.r(n),s.d(n,{default:()=>a});var o=s(270),t=s(581),c=s(272),l=s.n(c),r=s(271);const u=({onClose:e,isOpen:n,closeOnFormSuccess:s,closeUrl:c,...l})=>{const u=(0,t.useNavigate)(),[a,i]=(0,o.useState)(n),f=(0,o.useRef)(null),p=(0,o.useCallback)(((...n)=>{const s=e??(()=>u(c,{preventScrollReset:!0}));i(!1),f.current=setTimeout((()=>{s(...n),f.current=null}),300)}),[c,u,e]);(0,o.useEffect)((()=>()=>clearTimeout(f.current)),[]),(0,o.useEffect)((()=>{n?f.current&&clearTimeout(f.current):i(n)}),[n]);const d=(0,o.useMemo)((()=>{const{form:e}=l;if(e&&s){if((0,o.isValidElement)(e))return(0,o.cloneElement)(e,{onSuccess:()=>{e.props.onSuccess?.(),p()}});if("object"==typeof e)return{...e,onSuccess:()=>{e.onSuccess?.(),p()}}}return e}),[s,p,l]);return(0,o.jsx)(r.Drawer,{...l,form:d,onClose:p,isOpen:a})};u.propTypes={onClose:l().func,isOpen:l().bool,form:l().oneOfType([l().object,l().node]),closeOnFormSuccess:l().bool,closeUrl:l().string},u.defaultProps={onClose:void 0,form:void 0,isOpen:!0,closeOnFormSuccess:!0,closeUrl:".."};const a=u},1747:(e,n,s)=>{s.r(n),s.d(n,{default:()=>d});var o=s(496),t=s(619),c=s(271),l=s(615),r=s(953),u=s(827),a=s(89),i=s(270);const f=a.Locale.getTranslate("admin.controllers.dns.sync"),p=o.gql`
    mutation SyncDnsZone($input: SyncDnsZoneInput!) {
        syncDnsZone(input: $input) {
            task {
                id
            }
        }
    }
`,d=()=>{const[e]=(0,t.useMutation)(p);return(0,i.jsx)(r.default,{component:l.default,dataType:"dns-zone-sync",isOpen:!0,title:(0,i.jsx)(f,{content:"title"}),form:(0,i.jsx)(u.default,{applyButton:!1,mutation:e,onSubmit:({sync:e})=>({forced:"forced"===e}),submitButton:{"data-type":"dns-sync-apply"},values:{sync:"safe"},children:(0,i.jsx)(c.FormFieldRadioButtons,{label:(0,i.jsx)(f,{content:"type-option"}),name:"sync",options:[{value:"safe",label:(0,i.jsx)(f,{content:"safe"})},{value:"forced",label:(0,i.jsx)(f,{content:"force"})}]})})})}}}]);
//# sourceMappingURL=dns-zone-sync.js.map?5e015e0ce0276b13b4fe