(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/dns-helper"],{1016:(e,t,n)=>{"use strict";n.r(t);var l=n(153),a=n.n(l),r=n(154),s=n(155),i=n(144),c=n(1017);const o=i.Locale.getTranslate("smb.components.dns-helper");t.default=e=>{const[t,n]=(0,r.useState)(!1);return(0,r.createElement)(r.Fragment,null,(0,r.createElement)(s.StatusMessage,{intent:"warning"},(0,r.createElement)(s.Paragraph,null,(0,r.createElement)(o,{content:"domainUnresolvedMessage"})),(0,r.createElement)(s.Paragraph,null,(0,r.createElement)(o,{content:"warningActionMessage",params:{warningActionLink:(0,r.createElement)(s.Text,{bold:!0},(0,r.createElement)(s.Link,{onClick:()=>n(!0)},(0,r.createElement)(o,{content:"warningActionLink"})))}})),(0,r.createElement)("br",null),(0,r.createElement)(s.Text,{italic:!0},(0,r.createElement)(o,{content:"changesLagWarning"}))),(0,r.createElement)(c.default,a()({isOpen:t,onClose:()=>n(!1)},e)))}},1017:(e,t,n)=>{"use strict";n.r(t);var l=n(155),a=n(154),r=n(261),s=n.n(r),i=n(144),c=n(302),o=n(405);const m=i.Locale.getTranslate("smb.components.dns-helper"),d=c.gql`
    query getDnsSettings($id: ID!) {
        node(id: $id) {
            ... on Domain {
                name(idn: false)
                ipAddresses {
                    ipAddress(publicIp: true)
                }    
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }        
            }
            ... on DomainAlias {
                name(idn: false)
                domain {
                    ipAddresses {
                        ipAddress
                    }                   
                }
                dnsZone {
                    nsRecords: records(filter: {type: [NS]}, orderBy: {value: asc}) {
                        host
                        value
                        type
                    }
                    aRecords: records(filter: {type: [A]}) {
                        host
                        value
                        type
                    }
                }               
            }
        }
        viewer {
            type
        }
        config {
            dns {
                enableResolveChecking
            }
        }
        dnsRegistrars {
            name
            url
        }
        dnsExtensions {
            name
            url
        }
        mode {
            isDnsServiceSupported
        }        
    }
`,u=({isOpen:e,onClose:t,id:n,isAlias:r})=>{var s,i,c,u;const{loading:p,data:E}=(0,o.useQuery)(d,{variables:{id:btoa(`${r?"DomainAlias":"Domain"}:${n}`)}});if(p)return null;const{dnsRegistrars:g,dnsExtensions:v}=E,k="ADMIN"===E.viewer.type,h=E.node.name,A=null!==(s=null===(i=E.node.dnsZone)||void 0===i?void 0:i.nsRecords)&&void 0!==s?s:[],b=null!==(c=null===(u=E.node.dnsZone)||void 0===u?void 0:u.aRecords)&&void 0!==c?c:[],f=A.map((e=>b.find((t=>t.host===e.value)))).filter((e=>!!e)),{ipv4:w,ipv6:y}=(r?E.node.domain.ipAddresses:E.node.ipAddresses).reduce(((e,{ipAddress:t})=>(e[t.includes(":")?"ipv6":"ipv4"]=t,e)),{}),x=E.config.dns.enableResolveChecking&&E.mode.isDnsServiceSupported;return(0,a.createElement)(l.Drawer,{title:(0,a.createElement)(m,{content:"drawerTitle",params:{domainName:h}}),size:"sm",isOpen:e,onClose:t,"data-type":"dns-helper"},x?(0,a.createElement)(a.Fragment,null,(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"pleskResolve"})),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"domainSetup0"})),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"domainSetup1"})),f.length>0?(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"domainSetup2",params:{glueLink:(0,a.createElement)(l.Link,{"data-action":"glueLink",href:"https://en.wikipedia.org/wiki/Domain_Name_System#Circular_dependencies_and_glue_records",target:"_blank"},(0,a.createElement)("b",null,(0,a.createElement)(m,{content:"glueRecords"})))}}),(0,a.createElement)(l.Alert,null,f.map((({host:e,value:t})=>(0,a.createElement)("div",{key:t},e," ",t))))):null,(0,a.createElement)("li",null,(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"domainSetup3"})),(0,a.createElement)(l.Alert,null,A.map((({value:e})=>(0,a.createElement)("div",{key:e},"NS"," ",e)))))),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"primaryDNS"})),(0,a.createElement)("p",null,(0,a.createElement)(m,{content:"forExample"})),w?(0,a.createElement)(l.Alert,null,`A @ ${w}`,(0,a.createElement)("br",null),`A www ${w}`):null,y?(0,a.createElement)(l.Alert,null,`AAAA @ ${y}`,(0,a.createElement)("br",null),`AAAA www ${y}`):null):null,(0,a.createElement)(l.Paragraph,null,(0,a.createElement)(m,{content:"chooseRegistrar"})),(0,a.createElement)(l.Text,{italic:!0,bold:!0},(0,a.createElement)(l.Link,{"data-action":"chooseRegistrar",href:"https://www.icann.org/resources/pages/who-2013-05-03-en",target:"_blank"},(0,a.createElement)(m,{content:"chooseRegistrarLink"}))),(0,a.createElement)("br",null),(0,a.createElement)("br",null),(0,a.createElement)(l.Cuttable,{maxHeight:160},(()=>{const e=[...g,{name:(0,a.createElement)(m,{content:"registrarSurveyLink"}),url:"https://pt-research.typeform.com/to/FkcDot10"}];return(0,a.createElement)(l.ItemList,{minColumnWidth:250,gap:"xs"},e.map((({name:e,url:t})=>(0,a.createElement)(l.Item,{"data-action":e,key:e,icon:(0,a.createElement)(l.Icon,{name:"chevron-right",size:"12"}),title:(0,a.createElement)("span",null,(0,a.createElement)(l.Link,{href:t,target:"_blank"},e))}))))})()),k&&x?(0,a.createElement)(l.Alert,{intent:"default"},(0,a.createElement)(l.Status,{intent:"warning"},(0,a.createElement)(m,{content:"adminHintTitle"}),(0,a.createElement)("ol",null,(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"addIpOption",params:{useIpLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"addSecondIpGuide",href:"http://docs.plesk.com/en-US/obsidian/administrator-guide/dns/providing-redundant-dns-servers.74239/#configure-at-least-two-ip-addresses-on-your-plesk-server",target:"_blank"},(0,a.createElement)(m,{content:"useIpLink"})))}}),(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(m,{content:"example"})),(0,a.createElement)("ul",null,(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns1.example.com 123.123.123.123")),(0,a.createElement)("li",null,(0,a.createElement)(l.Text,{italic:!0},"ns2.example.com 124.124.124.124")))),(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"slaveDnsOption",params:{slaveExtensionLink:(0,a.createElement)(l.Text,{bold:!0},(0,a.createElement)(l.Link,{"data-action":"slaveDnsExtension",href:"https://www.plesk.com/extensions/slave-dns-manager/",target:"_blank"},(0,a.createElement)(m,{content:"slaveExtensionLink"})))}})),(0,a.createElement)("li",null,(0,a.createElement)(m,{content:"extensionOption",params:{extensions:(0,a.createElement)(a.Fragment,null,v.map((({name:e,url:t},n)=>(0,a.createElement)(a.Fragment,{key:e},(0,a.createElement)(l.Link,{href:t,target:"_blank","data-action":e},e),n<v.length-1?", ":""))))}}))))):null)};u.propTypes={isOpen:s().bool.isRequired,onClose:s().func.isRequired,id:s().number.isRequired,isAlias:s().bool},u.defaultProps={isAlias:!1},t.default=u},1015:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>l.default});var l=n(1016)}}]);
//# sourceMappingURL=dns-helper.js.map?5156b6fabbbc213a879c