"use strict";(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["views/server/mail"],{1037:(e,t,s)=>{s.r(t),s.d(t,{SORT_ASC:()=>c,SORT_DESC:()=>m,default:()=>x});var i=s(270),n=s(272),a=s.n(n),l=s(271),o=s(89);const r=o.Locale.getTranslate("components.list"),d=o.Locale.getSection("components.list"),c="ASC",m="DESC",u="all",p={set(e,t){localStorage.setItem(e,JSON.stringify(t))},get(e){const t=localStorage.getItem(e);return JSON.parse(t)}},g=e=>`list-sort_${e}`,b=e=>`list-page_${e}`,h=({id:e,data:t,columns:s,itemsPerPage:n=25,itemsPerPageOptions:a=[10,25,100,u],sortColumn:o,sortDirection:m=c,searchField:h,locale:x={},emptyView:j,emptyFilteredView:v,toolbar:S,selection:y=[],onSelectionChange:f,searchBarInputProps:F,rowKey:L="key",...M})=>{const{sortColumn:w,sortDirection:T,setSortState:k}=((e,{sortColumn:t,sortDirection:s})=>{const[{sortColumn:n,sortDirection:a},l]=(0,i.useState)({sortColumn:p.get(g(e))?.sortColumn??t,sortDirection:p.get(g(e))?.sortDirection??s});return{sortColumn:n,sortDirection:a,setSortState:t=>{l((e=>({...e,...t}))),p.set(g(e),{...p.get(g(e)),...t})}}})(e,{sortColumn:o??s.find((({sortable:e})=>e))?.key,sortDirection:m}),{page:R,itemsPerPage:E,searchPattern:I,setPageState:C}=((e,{itemsPerPage:t})=>{const[{page:s,itemsPerPage:n,searchPattern:a},l]=(0,i.useState)({page:p.get(b(e))?.page??1,itemsPerPage:p.get(b(e))?.itemsPerPage??t,searchPattern:p.get(b(e))?.searchPattern??""});return{page:s,itemsPerPage:n,searchPattern:a,setPageState:t=>{l((e=>({...e,...t}))),p.set(b(e),{...p.get(b(e)),...t})}}})(e,{itemsPerPage:a.includes(n)?n:a[0]}),P=(0,i.useMemo)((()=>I?v??(0,i.jsx)(l.ListEmptyView,{reason:"filtered",title:(0,i.jsx)(r,{content:"emptyViewFilteredTitle"}),description:(0,i.jsx)(r,{content:"emptyViewFilteredDescription"})}):j??(0,i.jsx)(l.ListEmptyView,{title:(0,i.jsx)(r,{content:"emptyViewTitle"})})),[I,j,v]),A=(0,i.useMemo)((()=>s.map((({sortDataField:e,...t})=>t))),[s]),q=(0,i.useMemo)((()=>h&&I?t.filter((e=>(Array.isArray(h)?h:[h]).some((t=>e[t]&&String(e[t]).toLowerCase().includes(I.toLowerCase()))))):t),[t,I,h]),D=(0,i.useMemo)((()=>{if(!w)return q;const e=s.find((({key:e})=>e===w))?.sortDataField??w,t=s.find((({key:e})=>e===w))?.sort??((t,s)=>t[e]<s[e]?-1:t[e]>s[e]?1:0);return[...q].sort(((e,s)=>c===T?t(e,s):t(s,e)))}),[q,w,T,s]),N=(0,i.useMemo)((()=>{if(E===u)return D;const e=E*(R-1),t=e+E;return D.slice(e,t)}),[R,D,E]),B=(0,i.useCallback)((e=>{C({searchPattern:e}),e!==I&&C({page:1})}),[I]),H=(0,i.useCallback)((e=>{C({itemsPerPage:e});(e===u?1:Math.ceil(q.length/e))<R&&C({page:1})}),[q.length,R]);return(0,i.useEffect)((()=>{if("function"==typeof f&&y.length){const e=q.map((e=>{return t=e,"function"==typeof(s=L)?s(t):t[s];var t,s})).filter((e=>y.includes(e)));f(e)}}),[q]),(0,i.jsx)(l.List,{pagination:(0,i.jsx)(l.Pagination,{current:R,total:E===u?1:Math.ceil(q.length/E),onSelect:e=>C({page:e}),itemsPerPage:E,itemsPerPageOptions:a,onItemsPerPageChange:H}),toolbar:(S||h)&&(0,i.jsxs)(l.Toolbar,{children:[S,h&&(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(l.ToolbarExpander,{}),(0,i.jsx)(l.ToolbarGroup,{title:"",children:(0,i.jsx)(l.SearchBar,{inputProps:{placeholder:d.lmsg("searchPlaceholder"),"data-testid":"list-searchbar",value:I,...F??{}},onTyping:B})})]})]}),totalRows:q.length,sortColumn:w,sortDirection:T,onSortChange:k,columns:A,data:N,filtered:!!I,locale:{totalRows:({totalRows:e})=>d.formatMessage("recordsTotal",{total:e}),...x},emptyView:P,onSelectionChange:f,selection:y,rowKey:L,...M})};h.propTypes={id:a().string.isRequired,data:a().array.isRequired,columns:a().array.isRequired,itemsPerPage:a().number,itemsPerPageOptions:a().array,sortColumn:a().string,sortDirection:a().string,searchField:a().oneOfType([a().string,a().arrayOf(a().string.isRequired)]),locale:a().object,emptyView:a().node,emptyFilteredView:a().node,toolbar:a().node,onSelectionChange:a().func,selection:a().array,rowKey:a().oneOfType([a().string,a().func]),searchBarInputProps:a().object};const x=h},1993:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var i=s(272),n=s(271),a=s(89),l=s(270),o=s(495),r=s(616),d=s(530);const c=a.Locale.getTranslate("admin.components.forms.server-mail-black-list"),m=a.Locale.getTranslate("components.buttons"),u=o.gql`
    mutation AddBlackListedDomain($input: AddBlackListedDomainInput!) {
        addBlackListedDomain(input: $input) {
            errors
        }
    }
`,p=({isWindows:e=!1,isOpen:t=!1,onClose:i})=>{const[a,o]=(0,l.useState)(null),[p,g]=(0,l.useState)(null),[b,h]=(0,l.useState)({});(0,l.useEffect)((()=>{o({name:[""],action:e?"DELETE":null}),g(null),h({})}),[t,e]);const[x]=(0,r.useMutation)(u,{refetchQueries:[{query:s(806)}],awaitRefetchQueries:!0});return(0,l.jsxs)(n.Drawer,{"data-type":"add-black-listed-domain",title:(0,l.jsx)(c,{content:"title"}),isOpen:t,onClose:i,size:"sm",form:{state:p,errors:b,applyButton:!1,onSubmit:async({name:e,action:t})=>{g("submit"),h({});const{data:{addBlackListedDomain:{errors:s}}}=await x({variables:{input:{name:e.map((e=>(e??"").trim())),action:t}}});g(null),s?h({name:s}):((0,d.addToast)({intent:"success",message:(0,l.jsx)(c,{content:"success"})}),i())},values:a,submitButton:{id:"btn-ok",name:"ok",children:(0,l.jsx)(m,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,l.jsx)(m,{content:"cancel"}),onClick:i}},children:[(0,l.jsx)(n.FormFieldText,{label:(0,l.jsx)(c,{content:e?"emailAddress":"domainName"}),description:e&&(0,l.jsx)(c,{content:"emailAddressHint"}),name:"name",size:"md",multi:!0,required:!0}),e&&(0,l.jsx)(n.FormFieldRadioButtons,{label:(0,l.jsx)(c,{content:"action"}),name:"action",options:[{value:"DELETE",label:(0,l.jsx)(c,{content:"actionDelete"})},{value:"SPAM",label:(0,l.jsx)(c,{content:"actionSpam"})}]})]})};p.propTypes={isWindows:i.PropTypes.bool,isOpen:i.PropTypes.bool,onClose:i.PropTypes.func.isRequired};const g=p},1996:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var i=s(272),n=s(271),a=s(89),l=s(270),o=s(495),r=s(616),d=s(530);const c=a.Locale.getTranslate("admin.components.forms.server-mail-white-list"),m=a.Locale.getTranslate("components.buttons"),u=o.gql`
    mutation AddWhiteListedNetwork($input: AddWhiteListedNetworkInput!) {
        addWhiteListedNetwork(input: $input) {
            errors
        }
    }
`,p=({isWindows:e=!1,mailServer:{isSmtpWhiteListSupported:t,isSmtpWhiteListWithWildcardSupported:i,isSmtpWhiteListWithCIDRSupported:a},isOpen:o=!1,onClose:p})=>{const[g,b]=(0,l.useState)(null),[h,x]=(0,l.useState)(null),[j,v]=(0,l.useState)({});(0,l.useEffect)((()=>{b({name:[""]}),x(null),v({})}),[o,e]);const[S]=(0,r.useMutation)(u,{refetchQueries:[{query:s(807)}],awaitRefetchQueries:!0});return(0,l.jsxs)(n.Drawer,{"data-type":"add-white-listed-network",title:(0,l.jsx)(c,{content:"title"}),isOpen:o,onClose:p,size:"sm",form:{state:h,errors:j,applyButton:!1,onSubmit:async({name:e})=>{x("submit"),v({});const{data:{addWhiteListedNetwork:{errors:t}}}=await S({variables:{input:{name:e.map((e=>(e??"").trim()))}}});x(null),t?v({name:t}):((0,d.addToast)({intent:"success",message:(0,l.jsx)(c,{content:"success"})}),p())},values:g,submitButton:{id:"btn-ok",name:"ok",children:(0,l.jsx)(m,{content:"save"})},cancelButton:{id:"btn-cancel",name:"cancel",children:(0,l.jsx)(m,{content:"cancel"}),onClick:p}},children:[e&&(0,l.jsxs)("p",{children:[(0,l.jsx)(c,{content:"descEmailAddress"}),t&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("br",{}),(0,l.jsx)(c,{content:"descIpAddress"})]})]}),(0,l.jsx)(n.FormFieldText,{label:(0,l.jsx)(c,{content:e?t?"emailAddressOrIp":"emailAddress":"ipAddress"}),description:(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(c,{content:e?"emailAddressHint":"ipAddressHint"}),e&&t&&i&&(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(c,{content:"wildcardPattern"})]}),e&&t&&a&&(0,l.jsxs)(l.Fragment,{children:[" ",(0,l.jsx)(c,{content:"cidrPattern"})]})]}),name:"name",size:"md",multi:!0,required:!0})]})};p.propTypes={isWindows:i.PropTypes.bool,mailServer:i.PropTypes.shape({isSmtpWhiteListSupported:i.PropTypes.bool.isRequired,isSmtpWhiteListWithWildcardSupported:i.PropTypes.bool.isRequired,isSmtpWhiteListWithCIDRSupported:i.PropTypes.bool.isRequired}).isRequired,isOpen:i.PropTypes.bool,onClose:i.PropTypes.func.isRequired};const g=p},1998:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var i=s(271),n=s(847),a=s(270),l=s(89),o=s(633),r=s(272),d=s.n(r),c=s(495),m=s(616),u=s(574),p=s(530);const g=l.Locale.getTranslate("admin.components.forms.server-mail-antivirus"),b=l.Locale.getTranslate("components.buttons"),h=c.gql`
    mutation UpdateServerMailAntivirus($input: UpdateServerMailAntivirusInput!) {
        updateServerMailAntivirus(input: $input) {
            query {
                serverMail {
                    antivirus {
                        key
                        name
                        isActive
                    }
                    antivirusPolicy {
                        policy
                        isAppliedToIncoming
                        isAppliedToOutgoing
                    }
                }
            }
        }
    }
`,x=({serverMail:{antivirus:e,antivirusPolicy:t}})=>{const s=(0,u.useNavigate)(),[l]=(0,m.useMutation)(h),r=(0,i.useTranslate)("admin.components.forms.server-mail-antivirus"),d="/admin/server/tools",[c,x]=(0,a.useState)({});(0,a.useEffect)((()=>{x({antivirus:0===e.length?null:e.find((({isActive:e})=>e))?.key??"",policy:t?.policy,isAppliedToIncoming:t?.isAppliedToIncoming,isAppliedToOutgoing:t?.isAppliedToOutgoing})}),[e,t]);return(0,a.jsxs)(n.default,{id:"server-mail-antivirus",mutation:l,values:c,onFieldChange:(e,t)=>x((s=>(0,i.setIn)(s,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,a.jsx)(b,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,a.jsx)(b,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,a.jsx)(b,{content:"cancel"}),component:o.default,to:d},onSuccess:(e,t)=>{(0,p.addToast)({intent:"success",message:(0,a.jsx)(g,{content:"success"})}),t?s(window.location.pathname,{replace:!0}):s(d)},children:[1===e.length&&(0,a.jsx)(i.FormField,{label:(0,a.jsx)(g,{content:"used"}),children:e[0].name}),e.length>1&&(0,a.jsx)(i.FormFieldRadioButtons,{label:(0,a.jsx)(g,{content:"used"}),name:"antivirus",options:e.map((({key:e,name:t})=>({value:e,label:t})))}),t&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(i.FormFieldSelect,{label:(0,a.jsx)(g,{content:"policy"}),name:"policy",children:[(0,a.jsx)("option",{value:"any",children:r("policyAny")}),(0,a.jsx)("option",{value:"from",children:r("policyFrom")}),(0,a.jsx)("option",{value:"to",children:r("policyTo")}),(0,a.jsx)("option",{value:"",children:r("policyOff")})]}),(0,a.jsxs)(i.FormField,{label:(0,a.jsx)(g,{content:"allowPersonalSettings"}),description:(0,a.jsx)(g,{content:"allowPersonalSettingsDesc"}),children:[(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"incoming"}),name:"isAppliedToIncoming",disabled:null===(0,i.getIn)(c,"isAppliedToIncoming")}),(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(g,{content:"outgoing"}),name:"isAppliedToOutgoing",disabled:null===(0,i.getIn)(c,"isAppliedToOutgoing")})]})]})]})};x.propTypes={serverMail:d().shape({antivirus:d().array.isRequired,antivirusPolicy:d().shape({policy:d().string.isRequired,isAppliedToIncoming:d().bool,isAppliedToOutgoing:d().bool})}).isRequired};const j=x},1988:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.auto-reply-headers"),d=({isMailUiDisabled:e=!1})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)("p",{children:(0,o.jsx)(r,{content:"description"})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"extra"}),name:"settings[autoReplyHeaders]",multi:{max:10},className:"server-mail-settings-form-field-multi",disabled:e,children:({getValue:t,setValue:s,getName:n})=>{const{name:a,value:l}=t({name:"",value:""});return(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Input,{name:`${n()}[name]`,size:"lg",value:a,onChange:({target:e})=>s({name:e.value,value:l}),maxLength:"75",disabled:e})," : ",(0,o.jsx)(i.Input,{name:`${n()}[value]`,value:l,onChange:({target:e})=>s({name:a,value:e.value}),maxLength:"75",disabled:e})]})}})]});d.propTypes={isMailUiDisabled:l().bool};const c=d},1982:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.autodiscover"),d=({isMailUiDisabled:e=!1,values:t,isEnabled:s=!1,customServer:n,isDnsEnabled:a=!0})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)("p",{children:(0,o.jsx)(r,{content:"description",params:{link:(0,o.jsx)(i.Link,{href:"https://support.plesk.com/hc/en-us/articles/12387742719639",target:"_blank",children:(0,o.jsx)(r,{content:"link"})})}})}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"enabled"}),name:"autodiscover[isEnabled]",description:(0,o.jsx)(r,{content:"enabledHint"}),disabled:e}),(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"customServer"}),name:"autodiscover[customServer]",description:(0,o.jsx)(r,{content:"customServerHint"}),size:"xl",disabled:e||!(0,i.getIn)(t,"autodiscover[isEnabled]")}),a&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"reconfigureDns"}),name:"autodiscover[reconfigureDns]",description:(0,o.jsx)(r,{content:"reconfigureDnsHint"}),disabled:e||!((0,i.getIn)(t,"autodiscover[isEnabled]")&&((0,i.getIn)(t,"autodiscover[isEnabled]")!==s||(0,i.getIn)(t,"autodiscover[customServer]")!==n))})]});d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isEnabled:l().bool,customServer:l().string.isRequired,isDnsEnabled:l().bool};const c=d},1981:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.general"),d=({isMailUiDisabled:e=!1,values:t,mailServerName:s,imapServerName:n,isWindows:a=!1,ipAddresses:l,isMaxLetterSizeChangeable:d=!1,isMessageSubmissionDedicatedIPSupported:c=!1,isMessageSubmissionAllIPSupported:m=!1,handleFieldChange:u})=>{const p=(0,i.useTranslate)("admin.components.forms.server-mail-settings.general"),g=a?"/cp/server/components/default/mailserver":"/admin/update/add-components",b=l.filter((({isIPv6:e})=>!e)),h=l.filter((({isIPv6:e})=>e));return(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"mailUiEnabled"}),name:"settings[isMailUiEnabled]"}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"serverName"}),description:(0,o.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,o.jsx)(i.Link,{href:g,target:"_blank",children:(0,o.jsx)(r,{content:"changeServerName"})})}}),children:s}),n&&n!==s&&(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"imapServerName"}),description:(0,o.jsx)(r,{content:"changeServerHint",params:{serverChangeLink:(0,o.jsx)(i.Link,{href:g,target:"_blank",children:(0,o.jsx)(r,{content:"changeImapServerName"})})}}),children:n}),null!==(0,i.getIn)(t,"settings[maxMessageSize]")&&(0,o.jsx)(i.FormField,{name:"settings[maxMessageSize]",label:(0,o.jsx)(r,{content:"maxMessageSize"}),description:(0,o.jsx)(r,{content:"maxMessageSizeHint",params:{kbLink:(0,o.jsx)(i.Link,{href:"https://support.plesk.com/hc/en-us/articles/12377276881559",target:"_blank",children:(0,o.jsx)(r,{content:"maxMessageSizeHintLink"})})}}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"7",disabled:e||!d}),"  ",(0,o.jsx)(r,{content:"kbytes"})]})}),null!==(0,i.getIn)(t,"settings[maxConnections]")&&(0,o.jsx)(i.FormField,{name:"settings[maxConnections]",label:(0,o.jsx)(r,{content:"maxConnections"}),description:(0,o.jsx)(r,{content:`maxConnectionsHint${n}`}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"10",disabled:e})}),null!==(0,i.getIn)(t,"settings[maxConnectionsPerIp]")&&(0,o.jsx)(i.FormField,{name:"settings[maxConnectionsPerIp]",label:(0,o.jsx)(r,{content:`maxConnectionsPerIp${n}`}),description:(0,o.jsx)(r,{content:`maxConnectionsPerIpHint${n}`}),children:({getValue:t,setValue:s,getName:n})=>(0,o.jsx)(i.Input,{name:n(),size:8,value:t(),onChange:e=>s(e.target.value),maxLength:"10",disabled:e})}),null!==(0,i.getIn)(t,"settings[outgoingEmailMode]")&&(0,o.jsx)(i.FormFieldRadioButtons,{label:(0,o.jsx)(r,{content:"outgoingEmailMode"}),name:"settings[outgoingEmailMode]",disabled:e,options:[{value:"domain-ip",label:(0,o.jsx)(r,{content:"outgoingEmailModeDomainIp"})},{value:"domain-name",label:(0,o.jsx)(r,{content:"outgoingEmailModeDomainName"})},{value:"explicit-ip",label:(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIp"}),indentFields:[b.length&&(0,o.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIpV4"})," ",(0,o.jsxs)(i.Select,{name:"settings[outgoingEmailModeIpV4]",id:"settings-outgoingEmailModeIpV4",size:"sm",value:(0,i.getIn)(t,"settings[outgoingEmailModeIpV4]"),onChange:e=>u("settings[outgoingEmailModeIpV4]",e),disabled:e||"explicit-ip"!==(0,i.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,o.jsx)(i.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),b.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]}),h.length&&(0,o.jsxs)("div",{style:{marginBlockStart:"8px"},children:[(0,o.jsx)(r,{content:"outgoingEmailModeExplicitIpV6"})," ",(0,o.jsxs)(i.Select,{name:"settings[outgoingEmailModeIpV6]",id:"settings-outgoingEmailModeIpV6",size:"sm",value:(0,i.getIn)(t,"settings[outgoingEmailModeIpV6]"),onChange:e=>u("settings[outgoingEmailModeIpV6]",e),disabled:e||"explicit-ip"!==(0,i.getIn)(t,"settings[outgoingEmailMode]"),children:[(0,o.jsx)(i.SelectOption,{value:"",children:p("outgoingEmailModeExplicitIpNone")}),h.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]})].filter(Boolean)}]}),null!==(0,i.getIn)(t,"settings[isMessageSubmissionEnabled]")&&(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:c?"messageSubmission":"messageSubmissionOnAllIp"}),name:"settings[isMessageSubmissionEnabled]",disabled:e}),(0,i.getIn)(t,"settings[isMessageSubmissionEnabled]")&&c&&(0,o.jsxs)(i.Section,{collapsible:!0,children:[(0,o.jsx)(r,{content:"messageSubmissionBindTo"})," ",(0,o.jsxs)(i.Select,{name:"settings[messageSubmissionIp]",value:(0,i.getIn)(t,"settings[messageSubmissionIp]"),disabled:e,onChange:e=>u("settings[messageSubmissionIp]",e),children:[m&&(0,o.jsx)(i.SelectOption,{value:"",children:p("messageSubmissionAllIpAddresses")}),l.map((({ipAddress:e})=>(0,o.jsx)(i.SelectOption,{value:e,children:e},e)))]})]})]}),null!==(0,i.getIn)(t,"settings[isEmailSubaddressingEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"subaddressing"}),name:"settings[isEmailSubaddressingEnabled]",description:(0,o.jsx)(r,{content:"subaddressingHint",params:{verpStyleLink:(0,o.jsx)(i.Link,{href:"https://en.wikipedia.org/wiki/Variable_envelope_return_path",target:"_blank",children:(0,o.jsx)(r,{content:"verpStyleLink"})})}}),disabled:e}),null!==(0,i.getIn)(t,"settings[isMboxQuotaWarningEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"mboxQuotaWarning"}),name:"settings[isMboxQuotaWarningEnabled]",description:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"mboxQuotaWarningHint"}),(0,o.jsx)("br",{}),(0,o.jsx)(i.Link,{href:"/admin/mail-settings/customize-mailbox-quota-warning",children:(0,o.jsx)(r,{content:"mboxQuotaWarningChange"})})]}),disabled:e}),null!==(0,i.getIn)(t,"settings[isFixSenderEnabled]")&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"fixSender"}),name:"settings[isFixSenderEnabled]",description:(0,o.jsx)(r,{content:"fixSenderHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,mailServerName:l().string.isRequired,imapServerName:l().string.isRequired,isWindows:l().bool,ipAddresses:l().array.isRequired,isMaxLetterSizeChangeable:l().bool,isMessageSubmissionDedicatedIPSupported:l().bool,isMessageSubmissionAllIPSupported:l().bool,handleFieldChange:l().func.isRequired};const c=d},1986:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.mailman"),d=({isMailUiDisabled:e=!1,hasLocalhostRelayingAddressesIpV4:t=!1,hasLocalhostRelayingAddressesIpV6:s=!1})=>(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[!t&&!s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhost"})}),!t&&s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhostIpv4"})}),t&&!s&&(0,o.jsx)(i.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"noLocalhostIpv6"})}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"secureLinks"}),name:"settings[isListSecureLinksEnabled]",description:(0,o.jsx)(r,{content:"secureLinksHint"}),disabled:e})]});d.propTypes={isMailUiDisabled:l().bool,hasLocalhostRelayingAddressesIpV4:l().bool,hasLocalhostRelayingAddressesIpV6:l().bool};const c=d},1985:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(270),l=s(272),o=s.n(l);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),d=({value:e,name:t,isUnlimited:s,warnings:n=[],isDisabled:l=!1})=>{const[o,d]=(0,a.useState)("");return(0,a.useEffect)((()=>{d(s(e)?"":e)}),[e,s]),(0,a.jsx)(i.FormField,{label:(0,a.jsx)(r,{content:t}),name:`outgoingMessages[${t}]`,children:({getValue:e,setValue:c})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"server-mail-settings-form-field-complex",style:{gap:8},children:[(0,a.jsx)(i.Input,{name:`outgoingMessages[${t}]`,size:8,value:o,onChange:e=>{c(e.target.value),d(e.target.value)},maxLength:"9",disabled:l||s(e())}),(0,a.jsx)(i.Checkbox,{name:`outgoingMessages[${t}Unlimited]`,checked:s(e()),onChange:e=>c(e?-1:o),disabled:l,children:(0,a.jsx)(r,{content:"unlimited"})})]}),n.map((e=>(0,a.jsx)(i.Status,{intent:"warning",children:e},e)))]})})};d.propTypes={value:o().number.isRequired,name:o().string.isRequired,isUnlimited:o().func.isRequired,warnings:o().array,isDisabled:o().bool};const c=d},1984:(e,t,s)=>{s.r(t),s.d(t,{default:()=>m});var i=s(271),n=s(89),a=s(270),l=s(1985),o=s(272),r=s.n(o);const d=n.Locale.getTranslate("admin.components.forms.server-mail-settings.outgoing"),c=({isMailUiDisabled:e=!1,values:t,allowedReportPeriods:s,allowedNotificationPeriods:n})=>{const o=(0,i.useTranslate)("admin.components.forms.server-mail-settings.outgoing"),r=!e&&(0,i.getIn)(t,"outgoingMessages[isEnabled]"),[c,m]=(0,a.useState)([]),[u,p]=(0,a.useState)([]),g=(0,i.getIn)(t,"outgoingMessages[mailboxLimit]"),b=(0,i.getIn)(t,"outgoingMessages[domainLimit]"),h=(0,i.getIn)(t,"outgoingMessages[subscriptionLimit]"),x=(0,a.useCallback)((e=>-1===e),[]);return(0,a.useEffect)((()=>{const e=e=>x(e)?(0,a.jsx)(d,{content:"unlimited"}):+e,t=e=>null!==e&&""!==e,s=[],i=[];r&&(t(g)&&t(b)&&!x(b)&&(+g>+b||x(g))&&s.push((0,a.jsx)(d,{content:"mailboxLimitExceedsDomainLimit",params:{value:e(g),highLevelLimitValue:e(b)}})),t(g)&&t(h)&&!x(h)&&(+g>+h||x(g))&&s.push((0,a.jsx)(d,{content:"mailboxLimitExceedsSubscriptionLimit",params:{value:e(g),highLevelLimitValue:e(h)}})),t(b)&&t(h)&&!x(h)&&(+b>+h||x(b))&&i.push((0,a.jsx)(d,{content:"domainLimitExceedsSubscriptionLimit",params:{value:e(b),highLevelLimitValue:e(h)}}))),m(s),p(i)}),[r,g,b,h,x]),(0,a.jsxs)(i.Section,{title:(0,a.jsx)(d,{content:"title"}),children:[r&&0!==((0,i.getIn)(t,"relay[noRelayNetworks]")??[]).length&&(0,a.jsx)(i.StatusMessage,{intent:"warning",children:(0,a.jsx)(d,{content:"whiteListNotEmpty"})}),r&&"open"===(0,i.getIn)(t,"relay[type]")&&(0,a.jsx)(i.StatusMessage,{intent:"warning",children:(0,a.jsx)(d,{content:"relayIsOpen"})}),(0,a.jsx)("p",{children:(0,a.jsx)(d,{content:"description",params:{link:(0,a.jsx)(i.Link,{href:"/smb/help/redirect/controller-name/mail-settings/action-name/outgoing-messages",target:"_blank",children:(0,a.jsx)(d,{content:"learnMore"})})}})}),(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"enabled"}),name:"outgoingMessages[isEnabled]",disabled:e}),null!==(0,i.getIn)(t,"outgoingMessages[isCountRecipientsEnabled]")&&(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"countRecipients"}),name:"outgoingMessages[isCountRecipientsEnabled]",description:(0,a.jsx)(d,{content:"countRecipientsHint"}),disabled:!r}),null!==g&&(0,a.jsx)(l.default,{value:g,name:"mailboxLimit",isUnlimited:x,warnings:c,isDisabled:!r}),null!==b&&(0,a.jsx)(l.default,{value:b,name:"domainLimit",isUnlimited:x,warnings:u,isDisabled:!r}),null!==h&&(0,a.jsx)(l.default,{value:h,name:"subscriptionLimit",isUnlimited:x,isDisabled:!r}),null!==(0,i.getIn)(t,"outgoingMessages[isSendmailEnabled]")&&(0,a.jsx)(i.FormFieldCheckbox,{label:(0,a.jsx)(d,{content:"sendmail"}),name:"outgoingMessages[isSendmailEnabled]",description:(0,a.jsx)(d,{content:"sendmailHint"}),disabled:!r}),(0,a.jsx)(i.FormFieldSelect,{label:(0,a.jsx)(d,{content:"reportPeriod"}),name:"outgoingMessages[reportPeriod]",description:(0,a.jsx)(d,{content:"reportPeriodHint"}),size:"sm",disabled:!r,children:s.map((e=>(0,a.jsx)("option",{value:e,children:o(`period${e}`)},e)))}),(0,a.jsx)(i.FormFieldSelect,{label:(0,a.jsx)(d,{content:"notificationPeriod"}),name:"outgoingMessages[notificationPeriod]",description:(0,a.jsx)(d,{content:"notificationPeriodHint"}),size:"sm",disabled:!r,children:n.map((e=>(0,a.jsx)("option",{value:e,children:o(`period${e}`)},e)))})]})};c.propTypes={isMailUiDisabled:r().bool,values:r().object.isRequired,allowedReportPeriods:r().array.isRequired,allowedNotificationPeriods:r().array.isRequired};const m=c},1989:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.pop3-names"),d=({isMailUiDisabled:e=!1})=>(0,o.jsx)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:(0,o.jsx)(i.FormFieldRadioButtons,{label:null,name:"settings[isShortPop3NameEnabled]",disabled:e,options:[{value:"true",label:(0,o.jsx)(r,{content:"enabled"})},{value:"false",label:(0,o.jsx)(r,{content:"disabled"})}]})});d.propTypes={isMailUiDisabled:l().bool};const c=d},1983:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.relay"),d=({isMailUiDisabled:e=!1,values:t,isOpenRelayAllowed:s=!1,isWindows:n=!1,isRelayLockTimeSupported:a=!1,isRelayTypeOpenSupported:l=!1,isRelayTypeClosedSupported:d=!1,isRelayTypeAuthSupported:c=!1,isRelayTypeAuthPop3Supported:m=!1,isRelayTypeAuthSmtpSupported:u=!1,isRelayTypeAuthBothSupported:p=!1,handleFieldChange:g})=>{const b=(e,t)=>p&&e&&t||m&&e&&!t||u&&!e&&t;return(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(i.FormFieldRadioButtons,{label:(0,o.jsx)(r,{content:"type"}),name:"relay[type]",disabled:e,description:"open"===(0,i.getIn)(t,"relay[type]")&&(0,o.jsxs)(i.Status,{intent:"danger",children:[(0,o.jsx)(r,{content:"openSpamWarning"}),(0,o.jsx)("br",{}),(0,o.jsx)(r,{content:"openSpamChange"})]}),options:[s&&{value:"open",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"open"}),!l&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!l},{value:"closed",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"closed"}),!d&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!d,description:n&&(0,o.jsx)(r,{content:"change",params:{changeLink:(0,o.jsx)(i.Link,{href:"/admin/mail-gate",children:(0,o.jsx)(r,{content:"changeLink"})})}})},{value:"auth",label:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(r,{content:"auth"}),!c&&(0,o.jsxs)(o.Fragment,{children:[" ","(",(0,o.jsx)(r,{content:"notSupported"}),")"]})]}),disabled:!c,indentFields:[(0,o.jsx)(i.FormField,{label:null,style:{marginBlockEnd:0},children:(0,o.jsxs)("div",{className:"server-mail-settings-form-field-complex",children:[(0,o.jsx)(i.Checkbox,{name:"relay[isPopAuthEnabled]",checked:(0,i.getIn)(t,"relay[isPopAuthEnabled]"),onChange:e=>{const s=(0,i.getIn)(t,"relay[isSmtpAuthEnabled]");if(!b(e,s))return s||e||!b(e,!0)?void g("relay[isPopAuthEnabled]",!e):(g("relay[isSmtpAuthEnabled]",!0),void g("relay[isPopAuthEnabled]",e));g("relay[isPopAuthEnabled]",e)},disabled:e||"auth"!==(0,i.getIn)(t,"relay[type]")||!(m||p),children:(0,o.jsx)(r,{content:"pop3"})}),(0,o.jsx)(r,{content:"lockTime"}),(0,o.jsx)(i.Input,{name:"relay[lockTime]",size:"sm",value:(0,i.getIn)(t,"relay[lockTime]"),onChange:e=>g("relay[lockTime]",e.target.value),maxLength:"5",disabled:e||"auth"!==(0,i.getIn)(t,"relay[type]")||!(0,i.getIn)(t,"relay[isPopAuthEnabled]")||!a||!(m||p)}),(0,o.jsx)(r,{content:"min"})]})},"popAuth"),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"smtp"}),name:"relay[isSmtpAuthEnabled]",onChange:e=>{const s=(0,i.getIn)(t,"relay[isPopAuthEnabled]");if(!b(s,e))return s||e||!b(!0,e)?void g("relay[isSmtpAuthEnabled]",!e):(g("relay[isPopAuthEnabled]",!0),void g("relay[isSmtpAuthEnabled]",e));g("relay[isSmtpAuthEnabled]",e)},disabled:e||!(u||p)},"smtp")]}].filter(Boolean)}),n&&t?.relay?.noRelayNetworks&&(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"noRelayNetworks"}),name:"relay[noRelayNetworks]",multi:!0,size:"xl",description:(0,o.jsx)(r,{content:"noRelayNetworksHint"}),disabled:e})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isOpenRelayAllowed:l().bool,isWindows:l().bool,isRelayLockTimeSupported:l().bool,isRelayTypeOpenSupported:l().bool,isRelayTypeClosedSupported:l().bool,isRelayTypeAuthSupported:l().bool,isRelayTypeAuthPop3Supported:l().bool,isRelayTypeAuthSmtpSupported:l().bool,isRelayTypeAuthBothSupported:l().bool,handleFieldChange:l().func.isRequired};const c=d},1987:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(271),n=s(89),a=s(272),l=s.n(a),o=s(270);const r=n.Locale.getTranslate("admin.components.forms.server-mail-settings.spam-filter"),d=({isMailUiDisabled:e=!1,values:t,isRBLInstalled:s=!1})=>{const n=(0,i.useTranslate)("admin.components.forms.server-mail-settings.spam-filter"),a=null!==(0,i.getIn)(t,"spamFilter[isDmarcEnabled]"),l=null!==(0,i.getIn)(t,"spamFilter[isSigningOutgoingMailEnabled]"),d=null!==(0,i.getIn)(t,"spamFilter[isSpfEnabled]");return(0,o.jsxs)(o.Fragment,{children:[a&&(0,o.jsx)(i.Section,{title:(0,o.jsx)(r,{content:"dmarc"}),children:(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"dmarcEnabled"}),name:"spamFilter[isDmarcEnabled]",description:l&&d&&(0,o.jsx)(r,{content:"dmarcHint"}),disabled:e||!1===(0,i.getIn)(t,"spamFilter[isVerifyingIncomingMailEnabled]")||!1===(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),l&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"dkim"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"singOutgoing"}),name:"spamFilter[isSigningOutgoingMailEnabled]",disabled:e}),a&&(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"verifyIncoming"}),name:"spamFilter[isVerifyingIncomingMailEnabled]",description:(0,o.jsx)(r,{content:"verifyIncomingHint"}),disabled:e||(0,i.getIn)(t,"spamFilter[isDmarcEnabled]")})]}),d&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"spf"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"spfEnabled"}),name:"spamFilter[isSpfEnabled]",description:a&&(0,o.jsx)(r,{content:"spfEnabledHint"}),disabled:e||(0,i.getIn)(t,"spamFilter[isDmarcEnabled]")}),(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"ignoreErrors"}),name:"spamFilter[isErrorIgnored]",description:(0,o.jsx)(r,{content:"ignoreErrorsHint"}),disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")||+(0,i.getIn)(t,"spamFilter[behavior]")<=2}),(0,o.jsxs)(i.FormFieldSelect,{label:(0,o.jsx)(r,{content:"behavior"}),name:"spamFilter[behavior]",description:(0,o.jsx)(r,{content:"behaviorHint"}),disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]"),children:[(0,o.jsx)("option",{value:"1",children:n("behaviorCreateHeadersNoBlock")}),(0,o.jsx)("option",{value:"2",children:n("behaviorUseTmpErrors")}),(0,o.jsx)("option",{value:"3",children:n("behaviorRejectIfFail")}),(0,o.jsx)("option",{value:"4",children:n("behaviorRejectIfSoftfail")}),(0,o.jsx)("option",{value:"5",children:n("behaviorRejectIfNeutral")}),(0,o.jsx)("option",{value:"6",children:n("behaviorRejectIfNoPass")})]}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"localRules"}),name:"spamFilter[localRules]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"guessRules"}),name:"spamFilter[guessRules]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})}),(0,o.jsx)(i.FormField,{label:(0,o.jsx)(r,{content:"explanationText"}),name:"spamFilter[explanationText]",children:({getValue:s,setValue:n,getName:a})=>(0,o.jsx)(i.Input,{name:a(),size:50,value:s(),onChange:e=>n(e.target.value),maxLength:"255",disabled:e||!(0,i.getIn)(t,"spamFilter[isSpfEnabled]")})})]}),null!==(0,i.getIn)(t,"spamFilter[isRblEnabled]")&&(0,o.jsxs)(i.Section,{title:(0,o.jsx)(r,{content:"rbl"}),children:[(0,o.jsx)(i.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"rblEnabled"}),name:"spamFilter[isRblEnabled]",disabled:e||!s}),(0,o.jsx)(i.FormFieldText,{label:(0,o.jsx)(r,{content:"rblServer"}),name:"spamFilter[rblServer]",size:"xl",description:(0,o.jsx)(r,{content:"rblServerHint"}),disabled:e||!s||!(0,i.getIn)(t,"spamFilter[isRblEnabled]")})]})]})};d.propTypes={isMailUiDisabled:l().bool,values:l().object.isRequired,isRBLInstalled:l().bool};const c=d},1980:(e,t,s)=>{s.r(t),s.d(t,{default:()=>k});var i=s(270),n=s(574),a=s(271),l=s(847),o=s(1981),r=s(1982),d=s(1983),c=s(1984),m=s(1986),u=s(1987),p=s(1988),g=s(1989),b=s(272),h=s.n(b),x=s(495),j=s(616),v=s(530),S=s(633),y=s(89);const f=y.Locale.getTranslate("admin.components.forms.server-mail-settings"),F=y.Locale.getTranslate("components.buttons"),L=x.gql`
    mutation UpdateServerMail($input: UpdateServerMailInput!) {
        updateServerMail(input: $input) {
            warnings
        }
    }

`,M=e=>null===e?null:`${e}`,w=e=>null===e||""===`${e}`.trim()?null:+e,T=({serverMail:{isMailUiEnabled:e,settings:t,autodiscover:b,relay:h,outgoingMessages:x,spamFilter:y},os:{isWindows:T},capability:{mailServer:{isMaxLetterSizeChangeable:k,isMessageSubmissionDedicatedIPSupported:R,isMessageSubmissionAllIPSupported:E,isRelayLockTimeSupported:I,isRelayTypeOpenSupported:C,isRelayTypeClosedSupported:P,isRelayTypeAuthSupported:A,isRelayTypeAuthPop3Supported:q,isRelayTypeAuthSmtpSupported:D,isRelayTypeAuthBothSupported:N},packages:{isRBLInstalled:B}},server:{ipAddresses:{nodes:H}}})=>{const V=(0,n.useNavigate)(),[W]=(0,j.useMutation)(L,{refetchQueries:[{query:s(804)}],awaitRefetchQueries:!0}),U="/admin/server/tools",[O,z]=(0,i.useState)({});(0,i.useEffect)((()=>{const{mailServerName:s,imapServerName:i,outgoingEmailModeIps:n,hasLocalhostRelayingAddressesIpV4:a,hasLocalhostRelayingAddressesIpV6:l,...o}=t||{},{isDnsEnabled:r,...d}=b||{},{isOpenRelayAllowed:c,...m}=h||{},{allowedReportPeriods:u,allowedNotificationPeriods:p,...g}=x||{};z({settings:t?{...o,isMailUiEnabled:e,maxMessageSize:null===t.maxMessageSize?null:Math.max(Math.ceil(t.maxMessageSize/1024),0),messageSubmissionIp:R?t.messageSubmissionIp?.ipAddress??"":null,outgoingEmailModeIpV4:n?.find((({isIPv6:e})=>!e))?.ipAddress??"",outgoingEmailModeIpV6:n?.find((({isIPv6:e})=>e))?.ipAddress??"",isShortPop3NameEnabled:M(t.isShortPop3NameEnabled)}:null,autodiscover:b?d:null,relay:h?m:null,outgoingMessages:x?g:null,spamFilter:y?{...y,behavior:M(y.behavior)}:null})}),[e,t,b,h,x,y,R]);const $=(0,i.useCallback)(((e,t)=>z((s=>(0,a.setIn)(s,e,t)))),[]),Q=t?!1===(0,a.getIn)(O,"settings[isMailUiEnabled]"):!e;return(0,i.jsxs)(l.default,{id:"main-settings-content",mutation:W,values:O,onFieldChange:$,submitButton:{id:"buttonid-ok",name:"ok",children:(0,i.jsx)(F,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,i.jsx)(F,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,i.jsx)(F,{content:"cancel"}),component:S.default,to:U},onSubmit:e=>Object.entries(e).reduce(((e,[t,s])=>{if(null!==s&&"object"==typeof s){const{__typename:i,...n}=s;switch(t){case"settings":return{...e,settings:{...n,maxMessageSize:w(n.maxMessageSize),maxConnections:w(n.maxConnections),maxConnectionsPerIp:w(n.maxConnectionsPerIp),isShortPop3NameEnabled:null===n.isShortPop3NameEnabled?null:"true"===n.isShortPop3NameEnabled,autoReplyHeaders:null===n.autoReplyHeaders?null:n.autoReplyHeaders.map((e=>{if(!e)return null;const{name:t,value:s}=e;return{name:t,value:s}}))}};case"relay":return{...e,relay:{...n,lockTime:w(n.lockTime)}};case"outgoingMessages":return{...e,outgoingMessages:{...n,mailboxLimit:""===n.mailboxLimit?null:w(n.mailboxLimit),domainLimit:""===n.domainLimit?null:w(n.domainLimit),subscriptionLimit:""===n.subscriptionLimit?null:w(n.subscriptionLimit)}};case"spamFilter":return{...e,spamFilter:{...n,behavior:null===n.behavior?null:+n.behavior}}}return{...e,[t]:n}}return{...e,[t]:s}}),{}),onSuccess:({updateServerMail:{warnings:e}},t)=>{e.forEach((e=>(0,v.addToast)({intent:"warning",message:e}))),(0,v.addToast)({intent:"success",message:(0,i.jsx)(f,{content:"success"})}),t?V(window.location.pathname,{replace:!0}):V(U)},children:[t&&(0,i.jsx)(o.default,{...t,isMailUiDisabled:Q,values:O,isWindows:T,ipAddresses:H,isMaxLetterSizeChangeable:k,isMessageSubmissionDedicatedIPSupported:R,isMessageSubmissionAllIPSupported:E,handleFieldChange:$}),b&&(0,i.jsx)(r.default,{...b,isMailUiDisabled:Q,values:O}),h&&(0,i.jsx)(d.default,{...h,isMailUiDisabled:Q,values:O,isWindows:T,isRelayLockTimeSupported:I,isRelayTypeOpenSupported:C,isRelayTypeClosedSupported:P,isRelayTypeAuthSupported:A,isRelayTypeAuthPop3Supported:q,isRelayTypeAuthSmtpSupported:D,isRelayTypeAuthBothSupported:N,handleFieldChange:$}),x&&(0,i.jsx)(c.default,{...x,isMailUiDisabled:Q,values:O}),null!==(t?.isListSecureLinksEnabled??null)&&(0,i.jsx)(m.default,{...t,isMailUiDisabled:Q}),y&&(0,i.jsx)(u.default,{isMailUiDisabled:Q,values:O,isRBLInstalled:B}),null!==(t?.autoReplyHeaders??null)&&(0,i.jsx)(p.default,{isMailUiDisabled:Q}),null!==(t?.isShortPop3NameEnabled??null)&&(0,i.jsx)(g.default,{isMailUiDisabled:Q})]})};T.propTypes={serverMail:h().shape({isMailUiEnabled:h().bool.isRequired,settings:h().object,autodiscover:h().object,relay:h().object,outgoingMessages:h().object,spamFilter:h().object}).isRequired,os:h().shape({isWindows:h().bool.isRequired}).isRequired,capability:h().shape({mailServer:h().object.isRequired,packages:h().object.isRequired}).isRequired,server:h().shape({ipAddresses:h().shape({nodes:h().array.isRequired}).isRequired}).isRequired};const k=T},2003:(e,t,s)=>{s.r(t),s.d(t,{default:()=>S});var i=s(847),n=s(2004),a=s(2005),l=s(272),o=s.n(l),r=s(270),d=s(89),c=s(495),m=s(616),u=s(271),p=s(633),g=s(530),b=s(574);const h=c.gql`
    mutation UpdateSmarthost($input: UpdateSmarthostInput!) {
        updateSmarthost(input: $input)
    }
`,x=d.Locale.getTranslate("admin.components.forms.server-mail-smarthost"),j=d.Locale.getTranslate("components.buttons"),v=({serverMail:{smarthost:{smarthostEncryptionOptions:e,isServerEnabled:t,host:l,port:o,isAuthenticationRequired:d,username:c,encryption:v}},os:{isWindows:S}})=>{const y=(0,b.useNavigate)(),[f,{loading:F}]=(0,m.useMutation)(h,{refetchQueries:[{query:s(810)}],awaitRefetchQueries:!0}),[L,M]=(0,r.useState)({}),[w,T]=(0,r.useState)({}),k="/admin/server/tools";return(0,r.useEffect)((()=>{M({settings:{isServerEnabled:t},configuration:{host:l,port:o.toString(),username:c,isAuthenticationRequired:d,password:"",encryption:v}})}),[t,l,o,d,c,v]),(0,r.jsxs)(i.default,{id:"smarthost-form",mutation:f,values:L,errors:w,onFieldChange:(e,t)=>{M((s=>(0,u.setIn)(s,e,t)))},onSuccess:(e,t)=>{(0,g.addToast)({intent:"success",message:(0,r.jsx)(x,{content:"success"})}),t||y(k)},submitButton:{id:"buttonid-ok",name:"ok",children:(0,r.jsx)(j,{content:"save"}),disabled:F},applyButton:{id:"buttonid-apply",name:"apply",children:(0,r.jsx)(j,{content:"apply"}),disabled:F},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,r.jsx)(j,{content:"cancel"}),component:p.default,to:k,disabled:F},children:[(0,r.jsx)(n.default,{disabled:F}),(0,r.jsx)(a.default,{encryptionOptions:e,isWindows:S,isAuthenticationRequired:(0,u.getIn)(L,"configuration[isAuthenticationRequired]"),onDryRun:async()=>{try{T({}),await f({variables:{input:{...L,checkConnection:!0}},refetchQueries:[]}),(0,g.addToast)({intent:"success",message:(0,r.jsx)(x,{content:"configuration.checkConnection.success"})})}catch(e){const{graphQLErrors:t}=e;if("validate"===t[0]?.extensions?.category){const e=t[0].extensions.messages;T(e)}else(0,g.addToast)({intent:"danger",message:t[0].extensions?.debugMessage||t[0].message})}},disabled:F||!(0,u.getIn)(L,"settings[isServerEnabled]")})]})};v.propTypes={serverMail:o().shape({smarthost:o().shape({smarthostEncryptionOptions:o().array.isRequired,isServerEnabled:o().bool.isRequired,host:o().string.isRequired,port:o().number.isRequired,isAuthenticationRequired:o().bool.isRequired,username:o().string.isRequired,encryption:o().string}).isRequired}).isRequired,os:o().shape({isWindows:o().bool.isRequired}).isRequired};const S=v},2005:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(89),n=s(271),a=s(272),l=s.n(a),o=s(270);const r=i.Locale.getTranslate("admin.components.forms.server-mail-smarthost.configuration"),d=({encryptionOptions:e,isWindows:t,isAuthenticationRequired:s,onDryRun:i,disabled:a})=>{const l=t?"Windows":"Unix",[d,c]=(0,o.useState)(!1),m=async()=>{c(!0),await i(),c(!1)};return(0,o.jsxs)(n.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(n.FormField,{name:"configuration[host]",label:(0,o.jsx)(r,{content:"hostnameOrIP"}),required:!0,description:t?"":(0,o.jsx)(r,{content:"hostnameOrIP.unixHint"}),children:({getValue:e,setValue:t,getName:s})=>(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.Input,{name:s(),id:"configuration-host",size:45,value:e(),onChange:e=>t(e.target.value),disabled:a}),"  ",(0,o.jsx)(n.Button,{size:"md",state:d?"loading":null,id:"checkConnection",onClick:m,disabled:a,children:(0,o.jsx)(r,{content:"checkConnection"})})]})}),(0,o.jsx)(n.FormFieldText,{name:"configuration[port]",label:(0,o.jsx)(r,{content:"port"}),inputProps:{size:5},required:!0,disabled:a}),(0,o.jsx)(n.FormFieldCheckbox,{name:"configuration[isAuthenticationRequired]",label:(0,o.jsx)(r,{content:"authRequired"}),disabled:a}),(0,o.jsxs)(n.Section,{collapsible:!0,children:[(0,o.jsx)(n.FormFieldText,{name:"configuration[username]",label:(0,o.jsx)(r,{content:"username"}),size:"md",disabled:!s||a}),(0,o.jsx)(n.FormFieldPassword,{name:"configuration[password]",label:(0,o.jsx)(r,{content:"password"}),size:"md",hideGenerateButton:!0,hidePasswordMeter:!0,disabled:!s||a})]}),e.length>0&&(0,o.jsx)(n.FormFieldRadioButtons,{name:"configuration[encryption]",label:(0,o.jsx)(r,{content:"encryption"}),options:e.map((e=>({value:e,label:(0,o.jsx)(r,{content:`encryption.${l}.${e}`})}))),disabled:a})]})};d.propTypes={encryptionOptions:l().array.isRequired,isWindows:l().bool.isRequired,isAuthenticationRequired:l().bool.isRequired,onDryRun:l().func.isRequired,disabled:l().bool.isRequired};const c=d},2004:(e,t,s)=>{s.r(t),s.d(t,{default:()=>c});var i=s(89),n=s(271),a=s(272),l=s.n(a),o=s(270);const r=i.Locale.getTranslate("admin.components.forms.server-mail-smarthost.settings"),d=({disabled:e})=>(0,o.jsxs)(n.Section,{title:(0,o.jsx)(r,{content:"title"}),children:[(0,o.jsx)(n.StatusMessage,{intent:"warning",children:(0,o.jsx)(r,{content:"note",params:{title:(0,o.jsx)("b",{children:(0,o.jsx)(r,{content:"noteTitle"})}),link:(0,o.jsx)("a",{href:"https://docs.plesk.com/en-US/obsidian/administrator-guide/mail/configuring-a-smarthost-or-relayhost.80030",children:(0,o.jsx)(r,{content:"noteLinkTitle"})})}})}),(0,o.jsx)(n.FormFieldCheckbox,{label:(0,o.jsx)(r,{content:"useSmarthost"}),name:"settings[isServerEnabled]",disabled:e})]});d.propTypes={disabled:l().bool.isRequired};const c=d},2002:(e,t,s)=>{s.r(t),s.d(t,{default:()=>i.default});var i=s(2003)},2e3:(e,t,s)=>{s.r(t),s.d(t,{default:()=>j});var i=s(270),n=s(574),a=s(495),l=s(616),o=s(271),r=s(272),d=s.n(r),c=s(89),m=s(847),u=s(633),p=s(530);const g=c.Locale.getTranslate("admin.components.forms.server-mail-spam-filter"),b=c.Locale.getTranslate("components.buttons"),h=a.gql`
    mutation UpdateSpamAssassin($input: UpdateSpamAssassinInput!) {
        updateSpamAssassin(input: $input) {
            result
        }
    }
`,x=({serverMail:{spamAssassin:{settings:{isEnabled:e,isUserSettingsEnabled:t,isUserSettingsAllowed:a,requiredHits:r,maxMailLimit:d,maxThreadsLimit:c,tag:x,alarmMessage:j,languages:v,locales:S,isGreylistingProtectionEnabled:y,maxChildren:f,maxChildrenLimit:F}}},capability:{mailServer:{isUserSettingsSupported:L}},os:{isWindows:M}})=>{const w=(0,n.useNavigate)(),T="/admin/server/tools",[k]=(0,l.useMutation)(h,{refetchQueries:[{query:s(809)}],awaitRefetchQueries:!0}),[R,E]=(0,i.useState)({}),[I,C]=(0,i.useState)(""),P=M&&(!L||!a),A=!M;(0,i.useEffect)((()=>{E({isEnabled:e,isUserSettingsEnabled:t,isGreylistingProtectionEnabled:y,maxChildren:f,requiredHits:null===r?null:`${r}`,maxMailLimit:null===d?null:`${d}`,maxThreadsLimit:c,alarmMessage:j,tag:x,languages:v.filter((({isTrusted:e})=>e)).map((({key:e})=>e)),locales:S.filter((({isTrusted:e})=>e)).map((({key:e})=>e))})}),[e,t,y,f,r,d,c,x,j,v,S]),(0,i.useEffect)((()=>{C(d??"")}),[d]);return(0,i.jsxs)(m.default,{id:"server-mail-spam-assassin",mutation:k,values:R,onFieldChange:(e,t)=>E((s=>(0,o.setIn)(s,e,t))),submitButton:{id:"buttonid-ok",name:"ok",children:(0,i.jsx)(b,{content:"save"})},applyButton:{id:"buttonid-apply",name:"apply",children:(0,i.jsx)(b,{content:"apply"})},cancelButton:{id:"buttonid-cancel",name:"cancel",children:(0,i.jsx)(b,{content:"cancel"}),component:u.default,to:T},onSuccess:(e,t)=>{(0,p.addToast)({intent:"success",message:(0,i.jsx)(g,{content:"success"})}),t?w(window.location.pathname,{replace:!0}):w(T)},children:[(0,i.jsxs)(o.Section,{title:(0,i.jsx)(g,{content:"general"}),children:[(0,i.jsx)(o.FormFieldCheckbox,{label:(0,i.jsx)(g,{content:"isEnabled"}),name:"isEnabled",disabled:null===R.isEnabled,description:A&&null===R.isEnabled?(0,i.jsx)(g,{content:"notInstalled"}):""}),A&&(0,i.jsx)(o.FormFieldCheckbox,{label:(0,i.jsx)(g,{content:"greylistingSpamProtection"}),name:"isGreylistingProtectionEnabled"}),(0,i.jsx)(o.FormFieldCheckbox,{label:(0,i.jsx)(g,{content:"isUserSettingsEnabled"}),name:"isUserSettingsEnabled",disabled:P,description:P&&(0,i.jsx)(g,{content:"isUserSettingsEnabledHint"})})]}),null!==e&&(0,i.jsxs)(o.Section,{title:(0,i.jsx)(g,{content:"settings"}),children:[A&&(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"maxChildrenTitle"}),description:(0,i.jsx)(g,{content:"maxChildrenDescription"}),name:"maxChildren",children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsx)(o.InputNumber,{name:s(),value:e(),onChange:t,min:1,max:F,disabled:n(),"data-cy-limit":F})}),(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"requiredHitsTitle"}),description:(0,i.jsx)(g,{content:"requiredHitsDescription"}),name:"requiredHits",required:!0,children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsx)(o.Input,{name:s(),value:e(),onChange:e=>t(e.target.value),size:"sm",maxLength:"4",disabled:n()})}),M&&(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"maxMailLimit"}),name:"maxMailLimit",children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsxs)("div",{className:"server-mail-spam-filter-form-field-complex",children:[(0,i.jsx)(o.Checkbox,{name:`${s()}Enabled`,checked:null!==e(),onChange:e=>t(e?I:null),disabled:n(),children:(0,i.jsx)(g,{content:"maxMailLimitText"})}),(0,i.jsx)(o.Input,{name:s,value:I,onChange:e=>{C(e.target.value),t(e.target.value)},size:10,maxLength:"9",disabled:null===e()||n()}),(0,i.jsx)(g,{content:"kbytes"})]})}),null!==c&&(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"maxThreadsLimit"}),name:"maxThreadsLimit",children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsx)(o.InputNumber,{name:s(),value:e(),onChange:t,min:1,max:32,disabled:n()})}),(0,i.jsx)(o.FormFieldText,{label:(0,i.jsx)(g,{content:"tagTitle"}),description:(0,i.jsx)(g,{content:"tagDescription"}),name:"tag",size:"xl",inputProps:{maxLength:"50"}}),M&&null!==j&&(0,i.jsx)(o.FormFieldText,{label:(0,i.jsx)(g,{content:"alarmMessage"}),name:"alarmMessage",multiline:!0,size:"xl"})]}),M&&(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"languages"}),name:"languages",children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsx)(o.Select,{name:s(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",disabled:n(),children:v.map((({key:e,name:t})=>(0,i.jsx)(o.SelectOption,{value:e,children:t},e)))})}),M&&(0,i.jsx)(o.FormField,{label:(0,i.jsx)(g,{content:"locales"}),name:"locales",children:({getValue:e,setValue:t,getName:s,isDisabled:n})=>(0,i.jsx)(o.Select,{name:s(),multiple:!0,searchable:!0,value:e(),onChange:t,size:"xl",disabled:n(),children:S.map((({key:e,name:t})=>(0,i.jsx)(o.SelectOption,{value:e,children:t},e)))})})]})};x.propTypes={serverMail:d().shape({spamAssassin:d().shape({settings:d().shape({isEnabled:d().bool.isRequired,isUserSettingsEnabled:d().bool.isRequired,isUserSettingsAllowed:d().bool.isRequired,requiredHits:d().number.isRequired,maxMailLimit:d().number,maxThreadsLimit:d().number,maxChildren:d().number,maxChildrenLimit:d().number,tag:d().string.isRequired,alarmMessage:d().string,languages:d().array.isRequired,locales:d().array.isRequired,isGreylistingProtectionEnabled:d().bool})}).isRequired}).isRequired,capability:d().shape({mailServer:d().shape({isUserSettingsSupported:d().bool.isRequired}).isRequired,packages:d().shape({isSpamAssassinInstalled:d().bool.isRequired}).isRequired}).isRequired,os:d().shape({isWindows:d().bool}).isRequired};const j=x},1992:(e,t,s)=>{s.r(t),s.d(t,{default:()=>h});var i=s(272),n=s(271),a=s(89),l=s(1037),o=s(270),r=s(495),d=s(616),c=s(530);const m=a.Locale.getTranslate("admin.components.lists.servermailblacklist"),u=a.Locale.getTranslate("components.buttons"),p=a.Locale.getSection("admin.components.lists.servermailblacklist"),g=r.gql`
    mutation DeleteBlackListedDomain($ids: [ID!]!) {
        deleteBlackListedDomain(input: { ids: $ids }) {
            ids
        }
    }
`,b=({blackList:e,showDisabledWarning:t=!1,isWindows:i=!1,onAddDomain:a})=>{const[r,b]=(0,o.useState)([]),[h,x]=(0,o.useState)([]),j=(0,o.useMemo)((()=>e.filter((({id:e})=>r.includes(e)))),[e,r]),[v]=(0,d.useMutation)(g,{refetchQueries:[{query:s(806)}],awaitRefetchQueries:!0});return(0,o.jsxs)(o.Fragment,{children:[t&&(0,o.jsx)(n.StatusMessage,{intent:"warning",children:(0,o.jsx)(m,{content:"spamAssassinDisabled"})}),(0,o.jsx)(l.default,{id:"server-mail-black-list",toolbar:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,o.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",icon:"plus",tooltip:(0,o.jsx)(m,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:a})}),(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,o.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,o.jsx)(m,{content:"removeEmptySelection"}),confirmationText:p.formatMessage("removeConfirmation",{name:(0,o.jsx)("b",{children:j[0]?.name}),count:j.length}),actionButtonText:(0,o.jsx)(u,{content:"yesRemove"}),cancelButtonText:(0,o.jsx)(u,{content:"cancel"}),children:(0,o.jsx)(n.Button,{id:"removeBlackListedDomain",onClick:async()=>{x(r);try{const{data:{deleteBlackListedDomain:{ids:e}}}=await v({variables:{ids:r}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,o.jsx)(m,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{b([]),x([])}},children:(0,o.jsx)(m,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,o.jsx)(m,{content:"entries"}),type:"title",sortable:!0},i&&{key:"action",title:(0,o.jsx)(m,{content:"action"}),sortable:!0,render:({action:e})=>p.lmsg(`${e.toLowerCase()}Action`)}].filter(Boolean),rowKey:"id",data:e,searchField:"name",selection:r,onSelectionChange:e=>b(e),loadingRows:h,emptyView:(0,o.jsx)(n.ListEmptyView,{actions:(0,o.jsx)(n.Button,{id:"addBlackListedDomain",intent:"primary",tooltip:(0,o.jsx)(m,{content:"buttonAddHint"}),onClick:a,children:(0,o.jsx)(m,{content:"buttonAdd"})})})})]})};b.propTypes={blackList:i.PropTypes.array.isRequired,showDisabledWarning:i.PropTypes.bool,isWindows:i.PropTypes.bool,onAddDomain:i.PropTypes.func.isRequired};const h=b},1995:(e,t,s)=>{s.r(t),s.d(t,{default:()=>h});var i=s(272),n=s(271),a=s(89),l=s(1037),o=s(270),r=s(495),d=s(616),c=s(530);const m=a.Locale.getTranslate("admin.components.lists.servermailwhitelist"),u=a.Locale.getTranslate("components.buttons"),p=a.Locale.getSection("admin.components.lists.servermailwhitelist"),g=r.gql`
    mutation DeleteWhiteListedNetwork($ids: [ID!]!) {
        deleteWhiteListedNetwork(input: { ids: $ids }) {
            ids
        }
    }
`,b=({whiteList:e,outgoingMessages:t,relay:i,isWindows:a=!1,onAddNetwork:r})=>{const[b,h]=(0,o.useState)([]),[x,j]=(0,o.useState)([]),v=(0,o.useMemo)((()=>e.filter((({id:e})=>b.includes(e)))),[e,b]),S=(0,o.useMemo)((()=>v.filter((({name:e})=>{if(a)return!1;const[t,s]=e.split("/");return"127"===t.substring(0,3)&&+s>=8})).map((({name:e})=>e))),[v,a]),[y]=(0,d.useMutation)(g,{refetchQueries:[{query:s(807)}],awaitRefetchQueries:!0});return(0,o.jsxs)(o.Fragment,{children:[t?.isEnabled&&0!==(i?.noRelayNetworks??[]).length&&(0,o.jsx)(n.StatusMessage,{intent:"warning",children:(0,o.jsx)(m,{content:"whiteListNotEmpty"})}),(0,o.jsx)(l.default,{id:"server-mail-white-list",toolbar:(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupAdd"),children:(0,o.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",icon:"plus",tooltip:(0,o.jsx)(m,{content:"buttonAddHint"}),"aria-label":p.lmsg("buttonAddHint"),onClick:r})}),(0,o.jsx)(n.ToolbarGroup,{title:p.lmsg("groupActions"),children:(0,o.jsx)(n.ListOperation,{critical:!0,noSelectionText:(0,o.jsx)(m,{content:"removeEmptySelection"}),confirmationText:(0,o.jsxs)(o.Fragment,{children:[S.length?(0,o.jsx)(n.StatusMessage,{intent:"warning",children:p.formatMessage(1===v.length?"webmailAffectedSingle":"webmailAffected",{count:S.length,list:S.join(", ")})}):null,p.formatMessage("removeConfirmation",{name:(0,o.jsx)("b",{children:v[0]?.name}),count:v.length})]}),actionButtonText:(0,o.jsx)(u,{content:"yesRemove"}),cancelButtonText:(0,o.jsx)(u,{content:"cancel"}),children:(0,o.jsx)(n.Button,{id:"removeWhiteListedNetwork",onClick:async()=>{j(b);try{const{data:{deleteWhiteListedNetwork:{ids:e}}}=await y({variables:{ids:b}});e.length>0&&(0,c.addToast)({intent:"success",message:(0,o.jsx)(m,{content:"removeSuccess"})})}catch({graphQLErrors:e}){e.forEach((({message:e,debugMessage:t})=>{(0,c.addToast)({intent:"danger",message:t||e})}))}finally{h([]),j([])}},children:(0,o.jsx)(m,{content:"buttonRemove"})})})})]}),columns:[{key:"name",title:(0,o.jsx)(m,{content:"entries"}),type:"title",sortable:!0}],rowKey:"id",data:e,searchField:"name",selection:b,onSelectionChange:e=>h(e),loadingRows:x,emptyView:(0,o.jsx)(n.ListEmptyView,{actions:(0,o.jsx)(n.Button,{id:"addWhiteListedNetwork",intent:"primary",tooltip:(0,o.jsx)(m,{content:"buttonAddHint"}),onClick:r,children:(0,o.jsx)(m,{content:"buttonAdd"})})})})]})};b.propTypes={whiteList:i.PropTypes.array.isRequired,outgoingMessages:i.PropTypes.shape({isEnabled:i.PropTypes.bool}),relay:i.PropTypes.shape({noRelayNetworks:i.PropTypes.array}),isWindows:i.PropTypes.bool,onAddNetwork:i.PropTypes.func.isRequired};const h=b},1997:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g});var i=s(270),n=s(89),a=s(271),l=s(313),o=s(590),r=s(1998),d=s(1990),c=s(579),m=s(808),u=s.n(m);const p=(0,i.lazy)((()=>Promise.all([s.e("vendors"),s.e("components/common/ServerMailAntivirusPromo")]).then(s.bind(s,2527)))),g=(0,o.withPageLayout)((0,d.withServerMailTabs)((()=>{const{data:e}=(0,c.useQuery)(u()),{serverMail:t}=e;return t.antivirus.length<=1&&!t.antivirusPolicy?(0,i.jsx)(i.Suspense,{fallback:(0,i.jsx)(a.Skeleton,{height:100}),children:(0,i.jsx)(p,{})}):(0,i.jsx)(r.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,l.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_antivirus"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-antivirus").lmsg("title"),href:"/cp/server/mail/antivirus"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1991:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var i=s(270),n=s(89),a=s(313),l=s(590),o=s(1992),r=s(1993),d=s(1990),c=s(579),m=s(806),u=s.n(m);const p=(0,l.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,i.useState)(!1),{data:{serverMail:{blackList:s,spamAssassin:{settings:n}},os:{isWindows:a}}}=(0,c.useQuery)(u());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.default,{isWindows:a,isOpen:e,onClose:()=>t(!1)}),(0,i.jsx)(o.default,{isWindows:a,blackList:s,showDisabledWarning:a&&n&&!n.isEnabled,onAddDomain:()=>t(!0)})]})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,a.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_blocked_domains"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-black-list").lmsg("title"),href:"/cp/server/mail/black-list"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1979:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var i=s(89),n=s(313),a=s(590),l=s(1980),o=s(1990),r=s(579),d=s(804),c=s.n(d),m=s(270);const u=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(l.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:i.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:i.Locale.getSection("components.pages.server-mail-settings").lmsg("title"),url:"/cp/server/mail/settings"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},2001:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var i=s(89),n=s(313),a=s(590),l=s(1990),o=s(2002),r=s(579),d=s(810),c=s.n(d),m=s(270);const u=(0,a.withPageLayout)((0,l.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(o.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_smarthost"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:i.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:i.Locale.getSection("components.pages.server-mail-smarthost").lmsg("title"),href:"/cp/server/mail/smarthost"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1999:(e,t,s)=>{s.r(t),s.d(t,{default:()=>u});var i=s(89),n=s(313),a=s(590),l=s(2e3),o=s(1990),r=s(579),d=s(809),c=s.n(d),m=s(270);const u=(0,a.withPageLayout)((0,o.withServerMailTabs)((()=>{const{data:e}=(0,r.useQuery)(c());return(0,m.jsx)(l.default,{...e})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,n.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"spamassassin"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:i.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:i.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:i.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:i.Locale.getSection("components.pages.server-mail-spam-filter").lmsg("title"),href:"/cp/server/mail/spam-filter"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1994:(e,t,s)=>{s.r(t),s.d(t,{default:()=>p});var i=s(270),n=s(89),a=s(313),l=s(590),o=s(1995),r=s(1996),d=s(1990),c=s(579),m=s(807),u=s.n(m);const p=(0,l.withPageLayout)((0,d.withServerMailTabs)((()=>{const[e,t]=(0,i.useState)(!1),{data:{serverMail:s,os:{isWindows:n},capability:a}}=(0,c.useQuery)(u());return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(r.default,{...a,isWindows:n,isOpen:e,onClose:()=>t(!1)}),(0,i.jsx)(o.default,{...s,isWindows:n,onAddNetwork:()=>t(!0)})]})})),(()=>{const{showFrames:e,pageHeader:t,pageSidebar:s}=(0,a.default)();return{showFrames:e,pageHeader:{...t,helpMenu:{...t.helpMenu,helpContext:"mail_white_list"}},pageSidebar:s,pageContentHeader:{breadcrumbs:[s.isPowerUserPanel?null:{title:n.Locale.getSection("components.pages.home").lmsg("title"),href:"/admin/home"},{title:n.Locale.getSection("admin.controllers.server.tools").lmsg("title"),href:"/admin/server/tools"},{title:n.Locale.getSection("admin.controllers.mail-settings.index").lmsg("title"),href:"/cp/server/mail"},{title:n.Locale.getSection("components.pages.server-mail-white-list").lmsg("title"),href:"/cp/server/mail/white-list"}].filter(Boolean),tabs:[],tabsHasRootPage:!0}}}))},1990:(e,t,s)=>{s.r(t),s.d(t,{default:()=>g,withServerMailTabs:()=>p});var i=s(270),n=s(574),a=s(575),l=s(579),o=s(271),r=s(89),d=s(613),c=s(805),m=s.n(c);const u=()=>{const{pathname:e}=(0,n.useLocation)(),t=(0,d.default)(),{data:{viewer:{permissions:{manageServerMail:s,manageServerVirusProtection:c,manageServerSpamFilter:u,manageServerMailAutodiscover:p,manageServerMailBlackWhiteLists:g}},capability:{mailServer:{isDomainsBlacklistSupported:b,isSmtpWhiteListSupported:h,isSmarthostAvailable:x},packages:{isAntiVirusInstalled:j,isSpamAssassinInstalled:v}},os:{isWindows:S},primaryKey:{keyDrWeb:y,keyQmailQueue:f}}}=(0,l.useQuery)(m()),F=(0,i.useMemo)((()=>[(s||u||p)&&{title:r.Locale.getSection("components.pages.server-mail-settings").lmsg("title"),url:"/cp/server/mail/settings",id:"tabSettings"},S&&u&&v&&{title:r.Locale.getSection("components.pages.server-mail-spam-filter").lmsg("title"),url:"/cp/server/mail/spam-filter",id:"tabSpamFilter"},c&&{title:r.Locale.getSection("components.pages.server-mail-antivirus").lmsg("title"),url:"/cp/server/mail/antivirus",id:"tabAntivirus"},g&&b&&{title:r.Locale.getSection("components.pages.server-mail-black-list").lmsg("title"),url:"/cp/server/mail/black-list",id:"tabBlackList"},g&&(!S||v||h)&&{title:r.Locale.getSection("components.pages.server-mail-white-list").lmsg("title"),url:"/cp/server/mail/white-list",id:"tabWhiteList"},!S&&s&&f&&{title:r.Locale.getSection("components.pages.server-mail-queue").lmsg("title"),url:"/admin/mail-settings/queue",id:"tabQueue"},S&&s&&(u&&v||c&&j&&y)&&{title:r.Locale.getSection("components.pages.server-mail-statistics").lmsg("title"),url:"/plesk/server/mail/statistics/",id:"tabStatistics"},x&&{title:r.Locale.getSection("components.pages.server-mail-smarthost").lmsg("title"),url:"/cp/server/mail/smarthost",id:"tabSmarthost"}].filter(Boolean)),[s,c,u,p,g,v,j,y,f,b,h,S,x]),L=(0,i.useMemo)((()=>F.findIndex((({url:t})=>(0,a.matchPath)(t,e)))+1),[F,e]);return(0,i.jsx)(o.Tabs,{active:L,children:F.map((({url:e,...s})=>(0,i.jsx)(o.Tab,{onActivate:()=>t(e),...s},e)))})},p=e=>{const t=t=>(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(u,{}),(0,i.jsx)(e,{...t})]});return t.displayName=`withServerMailTabs(${e.displayName||e.name||"Component"})`,t.WrappedComponent=e,t},g=u}}]);
//# sourceMappingURL=mail.js.map?9742a66b1d52f44f9298