(self.webpackChunkPlesk=self.webpackChunkPlesk||[]).push([["app/email-address/configure-client"],{1301:(e,t,s)=>{"use strict";s.r(t);var n=s(209),r=s(208),a=s(88),i=s(210),o=s.n(i),l=s(1302);const c=(e,t,s)=>{if(!t)return null;let a;switch(e){case"auto":return(0,r.jsx)(n.Translate,{content:"autoInstructions"});case"manual":return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Text,{fontSize:"sm",children:(0,r.jsx)(n.Translate,{content:"fieldUsername"})}),(0,r.jsx)("br",{}),t.userName]}),(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Text,{fontSize:"sm",children:(0,r.jsx)(n.Translate,{content:"fieldIncomingServer"})}),(0,r.jsx)("br",{}),t.incomingServer]}),(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Text,{fontSize:"sm",children:(0,r.jsx)(n.Translate,{content:"fieldOutgoingServer"})}),(0,r.jsx)("br",{}),t.outgoingServer,t.smtpAuth&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("br",{}),"(",(0,r.jsx)(n.Translate,{content:"smtpAuth"}),")"]})]}),(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Text,{fontSize:"sm",children:(0,r.jsx)(n.Translate,{content:"fieldIncomingProtocols"})}),(0,r.jsx)("br",{}),t.incomingProtocols]}),(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Text,{fontSize:"sm",children:(0,r.jsx)(n.Translate,{content:"fieldOutgoingProtocols"})}),(0,r.jsx)("br",{}),t.outgoingProtocols]}),(0,r.jsx)(n.Paragraph,{children:(0,r.jsx)(n.Text,{fontSize:"sm",children:t.hasCertificate?(0,r.jsx)(n.Translate,{content:"pop3PortEncrypted",params:{port:t.pop3Port}}):(0,r.jsx)(n.Translate,{content:"pop3PortNotEncrypted",params:{port:t.pop3Port}})})}),(0,r.jsx)(n.Paragraph,{children:(0,r.jsx)(n.Text,{fontSize:"sm",children:t.hasCertificate?(0,r.jsx)(n.Translate,{content:"imapPortEncrypted",params:{port:t.imapPort}}):(0,r.jsx)(n.Translate,{content:"imapPortNotEncrypted",params:{port:t.imapPort}})})}),(0,r.jsx)(n.Paragraph,{children:(0,r.jsx)(n.Text,{fontSize:"sm",children:t.hasCertificate?(0,r.jsx)(n.Translate,{content:"smtpPortEncrypted",params:{port:t.smtpPort}}):(0,r.jsx)(n.Translate,{content:"smtpPortNotEncrypted",params:{port:t.smtpPort}})})})]});case"ios":return(0,r.jsxs)(r.Fragment,{children:[s.ios&&(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Translate,{content:"iosInstructions"}),(0,r.jsx)("br",{}),(0,r.jsx)("img",{src:s.ios,width:"256",height:"256"})]}),(0,r.jsxs)(n.Paragraph,{children:[(0,r.jsx)(n.Translate,{content:s.ios?"iosLink":"iosLinkNoQrCode"}),(0,r.jsx)("br",{}),(0,r.jsx)("a",{target:"_blank",href:t.iosLink,rel:"noopener noreferrer",id:"ios-link",children:t.iosLink})," ",(0,r.jsx)(n.Toaster,{ref:e=>a=e}),(0,r.jsx)(n.Button,{ghost:!0,icon:"copy",onClick:()=>{(0,n.copyToClipboard)(t.iosLink),a.add({closable:!1,autoCloseTimeout:3e3,message:(0,r.jsx)(n.Translate,{content:"copied"})})},"data-type":"ios-copy-link"})]})]});default:return null}},d=e=>e&&!e.isValidCertificate&&!e.hideSslNote&&(0,r.jsx)(n.StatusMessage,{intent:"info",children:(0,r.jsx)(n.Translate,{content:"unsecureSslNote"})}),p=(e,t,s)=>(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Heading,{level:3,children:(0,r.jsx)(n.Translate,{content:`${e}Title`})}),c(e,t,s),d(t)]}),x=(e,t,a,i,o)=>{if(e)return(0,r.jsx)(n.ContentLoader,{});if(!a.autodiscoveryEnabled)return p("manual",a);const l={auto:s(1331),ios:s(1332),manual:s(1333)};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("p",{children:(0,r.jsx)(n.Translate,{content:"hint"})}),(0,r.jsx)(n.ItemList,{gap:"md",sm:2,selectable:!0,children:["auto","ios","manual"].map((e=>(0,r.jsx)(n.Item,{component:"a",value:e,icon:(0,r.jsx)(n.Icon,{size:32,src:l[e]}),title:(0,r.jsx)(n.Translate,{content:`${e}Title`}),view:"card",onClick:()=>i(e)},e)))}),t&&p(t,a,o)]})},m=({mailId:e,mailName:t,getConfigurationUrl:s})=>{const[i,o]=(0,r.useState)(!0),[c,d]=(0,r.useState)(null),[p,m]=(0,r.useState)(!0),[j,u]=(0,r.useState)(null),[h,g]=(0,r.useState)(null);return(0,r.useEffect)((()=>{m(!0),a.api.get(s,{id:e}).then((e=>{u(e),((e,t,s)=>{l.toDataURL(e,((e,n)=>t({[s]:n})))})(e.iosLink,g,"ios"),m(!1)}))}),[e,s]),(0,r.jsx)(n.Drawer,{title:t,size:"xs",isOpen:i,onClose:()=>o(!1),"data-type":"configure-email-client",children:x(p,c,j,d,h)})};m.propTypes={mailId:o().number.isRequired,mailName:o().string.isRequired,getConfigurationUrl:o().string.isRequired},m.contextTypes={locale:o().object},t.default=m},1300:(e,t,s)=>{"use strict";s.r(t);var n=s(209),r=s(208),a=s(88),i=s(1301);t.default=e=>{(0,r.render)((0,r.jsx)(n.LocaleProvider,{messages:a.Locale.getSection("smb.controllers.email-address.configuration").messages,children:(0,r.jsx)(i.default,{...e})}),document.createElement("div"))}},1331:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/email-client-auto.png?10f3ac74148a8205743053f3f437c01a"},1332:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/email-client-ios.png?1924b41f0a36f14455cdc4646bd5543b"},1333:e=>{e.exports=Jsw.skinUrl+"/icons/32/plesk/email-client-manual.png?d2d492eb7227419019870ac100f5fd20"}}]);
//# sourceMappingURL=configure-client.js.map?0eeb13d890e87ea4ce44