DomainDetail-HdQk4-E6.js 30 KB

123
  1. import{a as e,n as t,r as n}from"./react-dom-stZKkA6x.js";import{a as r,d as i,r as a,u as o}from"./theme-CVfSdO4m.js";import{At as s,J as c,ct as l,i as u,n as d,t as f}from"./jsx-runtime-C5RSiriy.js";import{n as ee,r as p}from"./card-DMbCO2Fu.js";import{t as te}from"./table-DDUhevyo.js";import{n as m,r as ne,t as h}from"./StatusPill-BYj3zI1_.js";import{n as g,t as _}from"./row-Zz2thRPV.js";import{t as v}from"./descriptions-gniVz27W.js";import{t as y}from"./form-y5mvm6Rb.js";import{t as b}from"./input-7g-iBRng.js";import{t as x}from"./list-6VGU-0Wr.js";import{t as S}from"./modal-C7xDa6TW.js";import{t as C}from"./CopyOutlined-BbN7wZaI.js";import{t as re}from"./DeleteOutlined-J0odQPKG.js";import{t as w}from"./EditOutlined-CO1ElKoL.js";import{t as ie}from"./EllipsisOutlined-BF-4cC5U.js";import{t as T}from"./ReloadOutlined-By3LF9WE.js";import{t as E}from"./ThunderboltOutlined-C6K0mmNg.js";import{_ as D,f as ae,i as oe,m as se,o as O,p as ce,t as le,v as ue}from"./index-Dy4xV4t8.js";import{t as k}from"./EmptyState-CeUjt5Wb.js";import{t as de}from"./CodeBlock-Cehl-9Ci.js";import{i as A,n as fe,t as pe}from"./domain-model-BLOrIAIx.js";import{t as j}from"./StatusTag-BfusN1FN.js";var me=n((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.default={icon:{tag:`svg`,attrs:{viewBox:`64 64 896 896`,focusable:`false`},children:[{tag:`path`,attrs:{d:`M872 474H286.9l350.2-304c5.6-4.9 2.2-14-5.2-14h-88.5c-3.9 0-7.6 1.4-10.5 3.9L155 487.8a31.96 31.96 0 000 48.3L535.1 866c1.5 1.3 3.3 2 5.2 2h91.5c7.4 0 10.8-9.2 5.2-14L286.9 550H872c4.4 0 8-3.6 8-8v-60c0-4.4-3.6-8-8-8z`}}]},name:`arrow-left`,theme:`outlined`}})),M=e(t()),N=e(me());function P(){return P=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},P.apply(this,arguments)}var he=M.forwardRef((e,t)=>M.createElement(o,P({},e,{ref:t,icon:N.default}))),F=f();function ge({record:e,loading:t,onCopy:n,onRecheck:i}){let{t:a}=r(),o=fe(e);return(0,F.jsx)(m,{className:`dns-record-card`,title:(0,F.jsxs)(u,{wrap:!0,size:8,children:[(0,F.jsx)(`span`,{className:`dns-record-card__label`,children:e.label}),(0,F.jsx)(j,{record:e})]}),extra:(0,F.jsx)(d.Text,{code:!0,className:`dns-record-card__type`,children:e.type}),children:(0,F.jsxs)(u,{direction:`vertical`,size:14,className:`full-width`,children:[(0,F.jsx)(I,{label:a(`dnsRecord.hostname`),value:e.host,onCopy:n}),(0,F.jsx)(I,{label:a(`dnsRecord.targetValue`),value:e.value||`-`,onCopy:n}),(0,F.jsxs)(`div`,{children:[(0,F.jsx)(d.Text,{type:`secondary`,children:a(`dnsRecord.currentValue`)}),o.length?(0,F.jsx)(u,{direction:`vertical`,size:8,className:`full-width value-stack`,children:o.map(e=>(0,F.jsx)(de,{value:e,onCopy:n},e))}):(0,F.jsx)(d.Paragraph,{type:`secondary`,className:`dns-empty-value`,children:a(`dnsRecord.emptyCurrent`)})]}),e.key===`ptr`?(0,F.jsx)(p,{type:`info`,showIcon:!0,message:a(`dnsRecord.ptrHint`)}):null,(e.warnings||[]).map(e=>(0,F.jsx)(p,{type:`warning`,showIcon:!0,message:e},e)),(0,F.jsx)(s,{icon:(0,F.jsx)(T,{}),loading:t,onClick:i,children:a(`dnsRecord.recheck`)})]})})}function I({label:e,value:t,onCopy:n}){return(0,F.jsxs)(`div`,{className:`dns-value-row`,children:[(0,F.jsx)(d.Text,{type:`secondary`,children:e}),(0,F.jsx)(de,{value:t,onCopy:n})]})}var L=[`overview`,`dns`,`sending`,`inbound`,`activity`];function _e(){let{id:e,section:t}=ce(),n=Number(e),o=we(t)?t:`overview`,c=ae(),[f,te]=se(),{config:g}=le(),{locale:_}=r(),v=_.startsWith(`en`)?Ee:Te,{message:x}=i.useApp(),[C,O]=(0,M.useState)(null),[k,de]=(0,M.useState)(null),[A,fe]=(0,M.useState)(void 0),[j,me]=(0,M.useState)(null),[N,P]=(0,M.useState)(null),[ge,I]=(0,M.useState)(!0),[L,_e]=(0,M.useState)(!1),[R,B]=(0,M.useState)(``),[V,H]=(0,M.useState)(``),[W,De]=(0,M.useState)({}),[Oe,ke]=(0,M.useState)(!1),[Ae,G]=(0,M.useState)(!1),[K,q]=(0,M.useState)(``),[je,Me]=(0,M.useState)(!1),[Ne]=y.useForm(),[J]=y.useForm(),Pe=(0,M.useCallback)(async()=>{I(!0),B(``);try{let[e,t,r]=await Promise.all([a.domains(),a.dnsCredentials(),a.smtpRelays()]);O({domain:e.domains.find(e=>e.id===n)||null,dnsCredentials:t.credentials,smtpRelays:r.relays})}catch(e){B(e instanceof Error?e.message:v.loadFailed)}finally{I(!1)}},[v.loadFailed,n]);(0,M.useEffect)(()=>{Pe()},[Pe]),(0,M.useEffect)(()=>{!t||we(t)||c(`/domains/${e}/overview`,{replace:!0})},[e,c,t]),(0,M.useEffect)(()=>{f.get(`edit`)===`1`&&C?.domain&&$(C.domain)},[C?.domain?.id,f]);let Y=(0,M.useCallback)(async()=>{if(C?.domain&&!(o===`overview`||o===`dns`)&&!(o===`activity`&&k!==null)&&!(o===`sending`&&j!==null&&A!==void 0)&&!(o===`inbound`&&N!==null)){_e(!0),H(``);try{if(o===`activity`){let e=await a.events({domainId:C.domain.id,page:1,pageSize:50});de(e.events)}else if(o===`sending`){let[e,t]=await Promise.all([a.smtpCredential(),a.apiTokens()]);fe(e.credential),me(t.tokens)}else if(o===`inbound`){let e=await a.inboundMailboxes();P(e.mailboxes.filter(e=>e.domainId===C.domain?.id))}}catch(e){H(e instanceof Error?e.message:v.sectionLoadFailed)}finally{_e(!1)}}},[o,j,C?.domain,v.sectionLoadFailed,k,N,A]);(0,M.useEffect)(()=>{Y()},[Y]);let X=C?.domain||null,Z=(0,M.useMemo)(()=>X?pe(X):null,[X]);function Fe(e){O(t=>t&&{...t,domain:e})}async function Q(e,t){De(t=>({...t,[e]:!0}));try{return await t()}finally{De(t=>({...t,[e]:!1}))}}async function Ie(){if(X)try{Fe((await Q(`check`,()=>a.checkDomain(X.id))).domain),x.success(v.checked)}catch(e){x.error(U(e,v.actionFailed))}}async function Le(){if(X)try{let e=await Q(`apply`,()=>a.applyDns(X.id));Fe(e.domain),e.apply?.ok===!1?x.warning(v.dnsPartial):x.success(v.dnsApplied)}catch(e){x.error(U(e,v.actionFailed))}}async function Re(){if(!X)return;let e;try{e=await Ne.validateFields()}catch{return}try{Fe((await Q(`edit`,()=>a.patchDomain(X.id,{...e,dnsCredentialId:e.dnsCredentialId??null,smtpRelayId:e.smtpRelayId??null}))).domain),Ve(),x.success(v.saved)}catch(e){x.error(U(e,v.actionFailed))}}async function ze(){if(!X)return;let e;try{e=await J.validateFields()}catch{return}try{await Q(`test`,()=>a.sendTest(X.id,e)),Me(!1),J.resetFields(),x.success(v.testQueued)}catch(e){x.error(U(e,v.actionFailed))}}async function Be(){if(!(!X||K!==X.domain))try{await Q(`delete`,()=>a.deleteDomain(X.id)),x.success(v.deleted),c(`/domains`,{replace:!0})}catch(e){x.error(U(e,v.actionFailed))}}function $(e){Ne.setFieldsValue({selector:e.selector,dnsCredentialId:e.dnsCredentialId,smtpRelayId:e.smtpRelayId,senderHost:e.senderHost,sendingIp:e.sendingIp,spfExtra:e.spfExtra,dmarcPolicy:e.dmarcPolicy,dmarcRua:e.dmarcRua,catchAllAddress:e.catchAllAddress}),ke(!0)}function Ve(){if(ke(!1),f.has(`edit`)){let e=new URLSearchParams(f);e.delete(`edit`),te(e,{replace:!0})}}function He(){if(!f.has(`setup`))return;let e=new URLSearchParams(f);e.delete(`setup`),te(e,{replace:!0})}function Ue(){X&&(J.setFieldsValue({subject:v.testSubject(X.domain),text:v.testBody(X.domain)}),Me(!0))}async function We(e){try{await navigator.clipboard.writeText(e),x.success(v.copied)}catch{x.error(v.copyFailed)}}if(ge&&!C)return(0,F.jsxs)(u,{direction:`vertical`,size:20,className:`full-width`,"aria-label":v.loading,children:[(0,F.jsx)(l,{active:!0,title:{width:`36%`},paragraph:{rows:3}}),(0,F.jsx)(m,{children:(0,F.jsx)(l,{active:!0,paragraph:{rows:10}})})]});if(R&&!C)return(0,F.jsx)(D,{status:`error`,title:v.loadFailed,subTitle:R,extra:(0,F.jsxs)(u,{children:[(0,F.jsx)(s,{onClick:()=>c(`/domains`),children:v.back}),(0,F.jsx)(s,{type:`primary`,onClick:()=>void Pe(),children:v.retry})]})});if(!Number.isInteger(n)||n<=0||C&&!X)return(0,F.jsx)(D,{status:`404`,title:v.notFound,subTitle:v.notFoundHint,extra:(0,F.jsx)(s,{type:`primary`,onClick:()=>c(`/domains`),children:v.backToDomains})});if(!X||!C||!Z)return null;let Ge=[{key:`check`,icon:(0,F.jsx)(T,{}),label:v.checkDns,onClick:()=>void Ie()},{key:`apply`,icon:(0,F.jsx)(E,{}),label:v.autoDns,disabled:!X.dnsCredentialId,onClick:()=>void Le()},{key:`edit`,icon:(0,F.jsx)(w,{}),label:v.edit,onClick:()=>$(X)},{type:`divider`},{key:`delete`,icon:(0,F.jsx)(re,{}),danger:!0,label:v.delete,onClick:()=>{q(``),G(!0)}}];return(0,F.jsxs)(u,{direction:`vertical`,size:20,className:`full-width`,children:[(0,F.jsx)(s,{icon:(0,F.jsx)(he,{}),onClick:()=>c(`/domains`),style:{width:`fit-content`,minHeight:44},children:v.backToDomains}),(0,F.jsx)(ne,{title:X.domain,subtitle:`${X.senderHost} · ${X.sendingIp}`,extra:(0,F.jsxs)(u,{children:[(0,F.jsxs)(h,{tone:Z.status===`success`?`success`:Z.status===`warning`?`warning`:`error`,children:[Z.passed,`/`,Z.total,` `,Z.status===`success`?v.dnsPassed:v.needsAttention]}),(0,F.jsx)(s,{type:`primary`,icon:(0,F.jsx)(oe,{}),style:{minHeight:44},onClick:Ue,children:v.testSend}),(0,F.jsx)(ue,{menu:{items:Ge},trigger:[`click`],children:(0,F.jsx)(s,{"aria-label":v.moreActions,icon:(0,F.jsx)(ie,{}),style:{minHeight:44},loading:Object.values(W).some(Boolean)})})]})}),f.get(`setup`)===`partial`?(0,F.jsx)(p,{type:`warning`,showIcon:!0,closable:!0,message:v.setupPartialTitle,description:v.setupPartialDescription,onClose:He}):f.get(`setup`)===`complete`?(0,F.jsx)(p,{type:`success`,showIcon:!0,closable:!0,message:v.setupCompleteTitle,description:X.dnsCredentialId?v.setupAutomaticDescription:v.setupManualDescription,onClose:He}):null,(0,F.jsx)(ee,{activeKey:o,onChange:e=>c(`/domains/${X.id}/${e}`),className:`domain-detail-tabs`,items:[{key:`overview`,label:v.overview,children:(0,F.jsx)(ve,{domain:X,health:Z,dnsName:C.dnsCredentials.find(e=>e.id===X.dnsCredentialId)?.name,relayName:C.smtpRelays.find(e=>e.id===X.smtpRelayId)?.name,copy:v,onCheck:Ie,onReviewDns:()=>c(`/domains/${X.id}/dns`),onEdit:()=>$(X),onDelete:()=>G(!0),loading:W})},{key:`dns`,label:v.dnsAndVerification,children:(0,F.jsx)(ye,{domain:X,copy:v,onCopy:We,onCheck:Ie,onApply:Le,loading:W})},{key:`sending`,label:v.sendingConfiguration,children:(0,F.jsx)(z,{loading:L,error:V,retry:Y,copy:v,children:(0,F.jsx)(be,{domain:X,config:g,credential:A,tokens:j||[],relayName:C.smtpRelays.find(e=>e.id===X.smtpRelayId)?.name,copy:v,onCopy:We,onEdit:()=>$(X)})})},{key:`inbound`,label:v.inboundConfiguration,children:(0,F.jsx)(z,{loading:L,error:V,retry:Y,copy:v,children:(0,F.jsx)(xe,{domain:X,config:g,mailboxes:N||[],copy:v,onNavigate:()=>c(`/inbox`),onEdit:()=>$(X)})})},{key:`activity`,label:v.activity,children:(0,F.jsx)(z,{loading:L,error:V,retry:Y,copy:v,children:(0,F.jsx)(Se,{events:k||[],copy:v,onView:e=>c(`/activity/${e.id}?domainId=${X.id}`)})})}]}),(0,F.jsx)(Ce,{open:Oe,domain:X,form:Ne,dnsCredentials:C.dnsCredentials,smtpRelays:C.smtpRelays,copy:v,loading:!!W.edit,onCancel:Ve,onSave:Re}),(0,F.jsx)(S,{title:v.deleteTitle,open:Ae,okText:v.delete,cancelText:v.cancel,okButtonProps:{danger:!0,disabled:K!==X.domain,loading:!!W.delete},onCancel:()=>{G(!1),q(``)},onOk:()=>void Be(),children:(0,F.jsxs)(u,{direction:`vertical`,size:16,className:`full-width`,children:[(0,F.jsx)(p,{type:`error`,showIcon:!0,message:v.deleteWarning}),(0,F.jsxs)(d.Text,{children:[v.typeDomain,` `,(0,F.jsx)(d.Text,{code:!0,children:X.domain})]}),(0,F.jsx)(b,{value:K,onChange:e=>q(e.target.value),"aria-label":v.deleteConfirmation,style:{minHeight:44}})]})}),(0,F.jsx)(S,{title:v.testSend,open:je,okText:v.queueTest,cancelText:v.cancel,confirmLoading:!!W.test,onCancel:()=>Me(!1),onOk:()=>void ze(),children:(0,F.jsxs)(y,{form:J,layout:`vertical`,children:[(0,F.jsx)(y.Item,{name:`to`,label:v.recipient,rules:[{required:!0,type:`email`,message:v.validRecipient}],children:(0,F.jsx)(b,{placeholder:`you@example.com`,style:{minHeight:44}})}),(0,F.jsx)(y.Item,{name:`subject`,label:v.subject,rules:[{required:!0}],children:(0,F.jsx)(b,{style:{minHeight:44}})}),(0,F.jsx)(y.Item,{name:`text`,label:v.body,rules:[{required:!0}],children:(0,F.jsx)(b.TextArea,{rows:5})})]})})]})}function ve({domain:e,health:t,dnsName:n,relayName:r,copy:i,onCheck:a,onReviewDns:o,onEdit:c,onDelete:l,loading:f}){return(0,F.jsxs)(u,{direction:`vertical`,size:20,className:`full-width`,children:[(0,F.jsxs)(_,{gutter:[16,16],children:[(0,F.jsx)(g,{xs:24,lg:15,children:(0,F.jsx)(m,{title:i.domainSummary,children:(0,F.jsxs)(v,{column:1,children:[(0,F.jsx)(v.Item,{label:i.domain,children:e.domain}),(0,F.jsx)(v.Item,{label:i.senderHost,children:e.senderHost}),(0,F.jsx)(v.Item,{label:i.sendingIp,children:e.sendingIp}),(0,F.jsx)(v.Item,{label:`DKIM selector`,children:e.selector}),(0,F.jsx)(v.Item,{label:i.dnsIntegration,children:n||i.manualDns}),(0,F.jsx)(v.Item,{label:i.relay,children:r||i.defaultDelivery}),(0,F.jsx)(v.Item,{label:i.createdAt,children:new Date(e.createdAt).toLocaleString()})]})})}),(0,F.jsx)(g,{xs:24,lg:9,children:(0,F.jsx)(m,{title:i.authenticationHealth,children:(0,F.jsxs)(u,{direction:`vertical`,size:16,className:`full-width`,children:[(0,F.jsxs)(d.Title,{level:2,style:{margin:0},children:[t.passed,`/`,t.total]}),(0,F.jsx)(d.Text,{type:`secondary`,children:i.recordsPassed}),(0,F.jsx)(h,{tone:t.status===`success`?`success`:t.status===`warning`?`warning`:`error`,children:t.status===`success`?i.ready:i.needsAttention}),(0,F.jsx)(s,{icon:(0,F.jsx)(T,{}),loading:f.check,onClick:a,children:i.checkDns})]})})})]}),(0,F.jsxs)(_,{gutter:[16,16],children:[(0,F.jsx)(g,{xs:24,lg:12,children:(0,F.jsx)(m,{title:i.nextActions,children:(0,F.jsxs)(u,{wrap:!0,children:[(0,F.jsx)(s,{icon:(0,F.jsx)(E,{}),onClick:o,children:i.reviewDns}),(0,F.jsx)(s,{icon:(0,F.jsx)(w,{}),onClick:c,children:i.edit})]})})}),(0,F.jsx)(g,{xs:24,lg:12,children:(0,F.jsx)(m,{title:i.dangerZone,className:`domain-danger-card`,children:(0,F.jsxs)(u,{direction:`vertical`,className:`full-width`,children:[(0,F.jsx)(d.Text,{type:`secondary`,children:i.dangerHint}),(0,F.jsx)(s,{danger:!0,icon:(0,F.jsx)(re,{}),onClick:l,children:i.delete})]})})})]})]})}function ye({domain:e,copy:t,onCopy:n,onCheck:r,onApply:i,loading:a}){let o=A(e.status?.records||[]),c=o.map(e=>`${e.host}\t${e.type}\t${e.value||``}`).join(`
  2. `);return(0,F.jsxs)(u,{direction:`vertical`,size:16,className:`full-width`,children:[(0,F.jsx)(m,{title:t.dnsAndVerification,extra:(0,F.jsxs)(u,{wrap:!0,children:[(0,F.jsx)(s,{icon:(0,F.jsx)(T,{}),loading:a.check,onClick:r,children:t.recheck}),(0,F.jsx)(s,{icon:(0,F.jsx)(E,{}),disabled:!e.dnsCredentialId,loading:a.apply,onClick:i,children:t.autoDns}),(0,F.jsx)(s,{icon:(0,F.jsx)(C,{}),disabled:!c,onClick:()=>n(c),children:t.copyAll})]}),children:(0,F.jsx)(p,{type:e.status?.verified?`success`:`warning`,showIcon:!0,message:e.status?.verified?t.domainVerified:t.domainNotVerified,description:`${t.lastChecked}: ${e.status?.checkedAt?new Date(e.status.checkedAt).toLocaleString():t.never}`})}),(0,F.jsx)(R,{apply:e.status?.apply,copy:t}),o.length?o.map(e=>(0,F.jsx)(ge,{record:e,loading:a.check,onCopy:n,onRecheck:r},e.key)):(0,F.jsx)(m,{children:(0,F.jsx)(k,{description:t.noDnsRecords,action:(0,F.jsx)(s,{onClick:r,children:t.checkNow})})}),e.status?.warnings?.length?(0,F.jsx)(p,{type:`warning`,showIcon:!0,message:t.warnings,description:e.status.warnings.join(`
  3. `)}):null]})}function R({apply:e,copy:t}){return e?.results?.length?(0,F.jsx)(m,{title:t.applyResults,extra:(0,F.jsx)(h,{tone:e.ok?`success`:`warning`,children:e.ok?t.applyComplete:t.applyPartial}),children:(0,F.jsx)(x,{dataSource:e.results,renderItem:e=>{let n=e.skipped?`warning`:e.ok?`success`:`error`,r=e.skipped?t.applySkipped:e.ok?t.applySucceeded:t.applyFailed,i=e.ok?e.detail||t.applySucceededHint:e.error||t.applyFailedHint;return(0,F.jsx)(x.Item,{children:(0,F.jsx)(x.Item.Meta,{title:(0,F.jsxs)(u,{wrap:!0,children:[(0,F.jsx)(h,{tone:n,children:r}),(0,F.jsx)(d.Text,{code:!0,children:e.type}),(0,F.jsx)(d.Text,{children:e.host})]}),description:(0,F.jsx)(d.Text,{type:e.ok?`secondary`:`danger`,children:i})})})}})}):null}function be({domain:e,config:t,credential:n,tokens:r,relayName:i,copy:a,onCopy:o,onEdit:c}){let l=`${t?.appBaseUrl||window.location.origin}/api/send`;return(0,F.jsxs)(_,{gutter:[16,16],children:[(0,F.jsx)(g,{xs:24,xl:12,children:(0,F.jsx)(m,{title:`SMTP`,extra:(0,F.jsx)(s,{icon:(0,F.jsx)(w,{}),onClick:c,children:a.edit}),children:(0,F.jsxs)(v,{column:1,children:[(0,F.jsx)(v.Item,{label:a.host,children:B(t?.submission?.host||`-`,o)}),(0,F.jsx)(v.Item,{label:a.ports,children:t?.submission?.ports?.map(e=>`${e.port}/${e.protocol}`).join(`, `)||`-`}),(0,F.jsx)(v.Item,{label:a.username,children:n?.username||t?.submission?.username||`-`}),(0,F.jsx)(v.Item,{label:a.password,children:(0,F.jsx)(h,{tone:n?.passwordSet?`success`:`warning`,children:n?.passwordSet?a.configured:a.notConfigured})}),(0,F.jsx)(v.Item,{label:a.relay,children:i||a.defaultDelivery})]})})}),(0,F.jsx)(g,{xs:24,xl:12,children:(0,F.jsxs)(m,{title:`API`,extra:(0,F.jsx)(s,{href:`/integrations/api-keys`,children:a.manageKeys}),children:[(0,F.jsxs)(v,{column:1,children:[(0,F.jsx)(v.Item,{label:`Endpoint`,children:B(l,o)}),(0,F.jsx)(v.Item,{label:a.availableKeys,children:r.filter(e=>!e.revokedAt).length})]}),r.length?(0,F.jsx)(x,{size:`small`,dataSource:r.slice(0,4),renderItem:e=>(0,F.jsx)(x.Item,{children:(0,F.jsx)(x.Item.Meta,{title:e.name,description:(0,F.jsxs)(d.Text,{code:!0,children:[e.tokenPrefix,`••••`]})})})}):(0,F.jsx)(k,{description:a.noKeys})]})}),(0,F.jsx)(g,{span:24,children:(0,F.jsx)(m,{title:a.senderIdentity,children:(0,F.jsxs)(v,{column:1,children:[(0,F.jsx)(v.Item,{label:a.fromDomain,children:e.domain}),(0,F.jsx)(v.Item,{label:a.senderHost,children:e.senderHost}),(0,F.jsx)(v.Item,{label:a.verification,children:(0,F.jsx)(h,{tone:e.status?.verified?`success`:`warning`,children:e.status?.verified?a.verified:a.pending})})]})})})]})}function xe({domain:e,config:t,mailboxes:n,copy:r,onNavigate:i,onEdit:a}){return(0,F.jsxs)(_,{gutter:[16,16],children:[(0,F.jsx)(g,{xs:24,xl:9,children:(0,F.jsx)(m,{title:r.inboundStatus,children:(0,F.jsxs)(u,{direction:`vertical`,size:16,className:`full-width`,children:[(0,F.jsxs)(h,{tone:t?.submission?.inboundEnabled?`success`:`warning`,children:[(0,F.jsx)(O,{}),` `,t?.submission?.inboundEnabled?r.inboundEnabled:r.inboundDisabled]}),(0,F.jsx)(d.Text,{type:`secondary`,children:r.inboundHint}),(0,F.jsx)(s,{onClick:i,children:r.openMailboxRouting})]})})}),(0,F.jsx)(g,{xs:24,xl:15,children:(0,F.jsx)(m,{title:r.mailboxes,extra:(0,F.jsx)(d.Text,{type:`secondary`,children:n.length}),children:n.length?(0,F.jsx)(x,{dataSource:n,renderItem:e=>(0,F.jsxs)(x.Item,{children:[(0,F.jsx)(x.Item.Meta,{title:e.address,description:`${e.unreadCount} ${r.unread} · ${e.messageCount} ${r.messages}`}),(0,F.jsx)(h,{tone:e.status===`active`?`success`:`warning`,children:e.status})]})}):(0,F.jsx)(k,{description:r.noMailboxes,action:(0,F.jsx)(s,{onClick:i,children:r.configureMailbox})})})}),(0,F.jsx)(g,{span:24,children:(0,F.jsx)(m,{title:r.catchAll,extra:(0,F.jsx)(s,{icon:(0,F.jsx)(w,{}),onClick:a,children:r.edit}),children:(0,F.jsxs)(v,{column:1,children:[(0,F.jsx)(v.Item,{label:r.catchAllAddress,children:e.catchAllAddress||r.notConfigured}),(0,F.jsx)(v.Item,{label:`IMAP`,children:t?.mailAccess?.imap.enabled?t.mailAccess.imap.ports.map(e=>e.port).join(`, `):r.disabled}),(0,F.jsx)(v.Item,{label:`POP3`,children:t?.mailAccess?.pop3.enabled?t.mailAccess.pop3.ports.map(e=>e.port).join(`, `):r.disabled})]})})})]})}function Se({events:e,copy:t,onView:n}){let r=[{title:t.time,dataIndex:`createdAt`,width:190,render:e=>new Date(e).toLocaleString()},{title:t.recipient,dataIndex:`recipients`,ellipsis:!0,render:e=>e.join(`, `)},{title:t.subject,dataIndex:`subject`,ellipsis:!0},{title:t.status,dataIndex:`status`,width:130,render:e=>(0,F.jsx)(h,{tone:V(e),children:H(e,t)})}];return e.length?(0,F.jsx)(m,{children:(0,F.jsx)(te,{rowKey:`id`,columns:r,dataSource:e,pagination:{pageSize:20},scroll:{x:760},onRow:e=>({onClick:()=>n(e),style:{cursor:`pointer`},"aria-label":`${t.viewActivity} ${e.id}`})})}):(0,F.jsx)(m,{children:(0,F.jsx)(k,{description:t.noActivity})})}function z({loading:e,error:t,retry:n,copy:r,children:i}){return e?(0,F.jsx)(m,{children:(0,F.jsx)(l,{active:!0,paragraph:{rows:7}})}):t?(0,F.jsx)(D,{status:`error`,title:r.sectionLoadFailed,subTitle:t,extra:(0,F.jsx)(s,{type:`primary`,onClick:n,children:r.retry})}):(0,F.jsx)(F.Fragment,{children:i})}function Ce({open:e,domain:t,form:n,dnsCredentials:r,smtpRelays:i,copy:a,loading:o,onCancel:s,onSave:l}){return(0,F.jsx)(S,{title:a.editTitle,open:e,width:640,confirmLoading:o,okText:a.save,cancelText:a.cancel,onCancel:s,onOk:l,children:(0,F.jsxs)(y,{form:n,layout:`vertical`,children:[(0,F.jsxs)(_,{gutter:16,children:[(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`dnsCredentialId`,label:a.dnsIntegration,children:(0,F.jsx)(c,{allowClear:!0,options:r.map(e=>({value:e.id,label:e.name}))})})}),(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`smtpRelayId`,label:a.relay,children:(0,F.jsx)(c,{allowClear:!0,options:i.map(e=>({value:e.id,label:e.name}))})})})]}),(0,F.jsxs)(_,{gutter:16,children:[(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`senderHost`,label:a.senderHost,rules:[{required:!0}],children:(0,F.jsx)(b,{})})}),(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`sendingIp`,label:a.sendingIp,rules:[{required:!0}],children:(0,F.jsx)(b,{})})})]}),(0,F.jsxs)(_,{gutter:16,children:[(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`selector`,label:`DKIM selector`,rules:[{required:!0}],children:(0,F.jsx)(b,{})})}),(0,F.jsx)(g,{xs:24,md:12,children:(0,F.jsx)(y.Item,{name:`dmarcPolicy`,label:`DMARC`,children:(0,F.jsx)(c,{options:[`none`,`quarantine`,`reject`].map(e=>({value:e,label:e}))})})})]}),(0,F.jsx)(y.Item,{name:`spfExtra`,label:`SPF`,children:(0,F.jsx)(b.TextArea,{rows:2})}),(0,F.jsx)(y.Item,{name:`dmarcRua`,label:`DMARC rua`,children:(0,F.jsx)(b,{})}),(0,F.jsx)(y.Item,{name:`catchAllAddress`,label:a.catchAllAddress,children:(0,F.jsx)(b,{placeholder:`inbox@${t.domain}`})})]})})}function B(e,t){return(0,F.jsxs)(u,{children:[(0,F.jsx)(d.Text,{code:!0,children:e}),(0,F.jsx)(s,{type:`text`,size:`small`,"aria-label":`Copy`,icon:(0,F.jsx)(C,{}),onClick:()=>t(e)})]})}function we(e){return L.includes(e)}function V(e){return e===`sent`||e===`delivered`?`success`:e===`queued`?`info`:e===`deferred`||e===`pending`?`warning`:e===`failed`||e===`bounced`?`error`:`neutral`}function H(e,t){return{sent:t.sent,delivered:t.delivered,queued:t.queued,deferred:t.deferred,pending:t.pending,failed:t.failed,bounced:t.bounced}[e]||e}function U(e,t){return e instanceof Error?e.message:t}var Te={loading:`正在加载域名详情`,loadFailed:`域名详情加载失败`,sectionLoadFailed:`当前页签加载失败`,retry:`重试`,back:`返回`,backToDomains:`返回域名列表`,notFound:`未找到该域名`,notFoundHint:`域名不存在、已被删除,或当前账户没有访问权限。`,moreActions:`更多操作`,overview:`概览`,dnsAndVerification:`DNS 与验证`,sendingConfiguration:`发送配置`,inboundConfiguration:`收信配置`,activity:`活动`,domain:`域名`,senderHost:`发信主机`,sendingIp:`发信 IP`,dnsIntegration:`DNS 集成`,relay:`发送中继`,manualDns:`手动配置`,defaultDelivery:`系统默认投递`,createdAt:`创建时间`,dnsPassed:`DNS 已通过`,needsAttention:`需要处理`,testSend:`测试发送`,checkDns:`检查 DNS`,autoDns:`自动写入 DNS`,edit:`编辑配置`,delete:`删除域名`,checked:`DNS 检查已完成`,dnsApplied:`DNS 记录写入完成`,dnsPartial:`部分 DNS 记录写入失败`,saved:`配置已保存`,testQueued:`测试邮件已加入队列`,deleted:`域名已删除`,actionFailed:`操作失败`,copied:`已复制`,copyFailed:`复制失败`,setupPartialTitle:`域名已创建,但 DNS 后续操作需要处理`,setupPartialDescription:`自动写入或即时检查未完全成功。请查看下方逐条结果,修正后重新执行。`,setupCompleteTitle:`域名创建完成`,setupAutomaticDescription:`DNS 自动写入流程已执行,请核对逐条结果和当前验证状态。`,setupManualDescription:`请按下方记录完成手动 DNS 配置,并在记录生效后重新检查。`,domainSummary:`域名摘要`,authenticationHealth:`认证健康度`,recordsPassed:`项必需记录已通过`,ready:`发送就绪`,nextActions:`下一步操作`,reviewDns:`查看 DNS 记录`,dangerZone:`危险操作`,dangerHint:`删除域名会停止相关发信配置,且不可撤销。`,recheck:`重新检查`,copyAll:`复制全部`,domainVerified:`域名已验证,可用于发送`,domainNotVerified:`域名尚未完成验证`,lastChecked:`最近检查`,never:`从未检查`,noDnsRecords:`尚未生成 DNS 检查结果`,checkNow:`立即检查`,warnings:`需要注意`,applyResults:`DNS 写入结果`,applyComplete:`全部完成`,applyPartial:`部分失败`,applySucceeded:`成功`,applyFailed:`失败`,applySkipped:`已跳过`,applySucceededHint:`记录已写入或无需变更。`,applyFailedHint:`未返回具体错误,请重新执行或改为手动配置。`,host:`主机`,ports:`端口`,username:`用户名`,password:`密码`,configured:`已设置(不会返回明文)`,notConfigured:`未设置`,manageKeys:`管理 API 密钥`,availableKeys:`可用密钥`,noKeys:`尚无可用 API 密钥`,senderIdentity:`发件身份`,fromDomain:`发件域名`,verification:`验证状态`,verified:`已验证`,pending:`等待验证`,inboundStatus:`收信服务状态`,inboundEnabled:`收信服务已启用`,inboundDisabled:`收信服务未启用`,inboundHint:`邮箱、别名和路由在独立收件箱工作区管理。`,openMailboxRouting:`打开邮箱与路由`,mailboxes:`邮箱`,unread:`封未读`,messages:`封邮件`,noMailboxes:`该域名还没有邮箱`,configureMailbox:`配置邮箱`,catchAll:`默认收信路由`,catchAllAddress:`Catch-all 地址`,disabled:`未启用`,time:`时间`,recipient:`收件人`,subject:`主题`,body:`正文`,status:`状态`,noActivity:`该域名尚无发送活动`,viewActivity:`查看发送活动`,sent:`已发送`,delivered:`已送达`,queued:`已入队`,deferred:`已延迟`,failed:`失败`,bounced:`退信`,editTitle:`编辑域名配置`,save:`保存`,cancel:`取消`,deleteTitle:`删除域名`,deleteWarning:`此操作不可撤销,域名相关发送配置将立即不可用。`,typeDomain:`请输入域名以确认:`,deleteConfirmation:`域名删除确认`,queueTest:`加入发送队列`,validRecipient:`请输入有效的收件邮箱`,testSubject:e=>`MailHub ${e} 测试邮件`,testBody:e=>`这是一封来自 ${e} 的 MailHub 投递测试邮件。`},Ee={loading:`Loading domain details`,loadFailed:`Unable to load domain details`,sectionLoadFailed:`Unable to load this section`,retry:`Retry`,back:`Back`,backToDomains:`Back to domains`,notFound:`Domain not found`,notFoundHint:`The domain does not exist, was deleted, or is not available to this account.`,moreActions:`More actions`,overview:`Overview`,dnsAndVerification:`DNS & verification`,sendingConfiguration:`Sending`,inboundConfiguration:`Receiving`,activity:`Activity`,domain:`Domain`,senderHost:`Sending host`,sendingIp:`Sending IP`,dnsIntegration:`DNS integration`,relay:`Sending relay`,manualDns:`Manual`,defaultDelivery:`System delivery`,createdAt:`Created`,dnsPassed:`DNS passed`,needsAttention:`Needs attention`,testSend:`Send test`,checkDns:`Check DNS`,autoDns:`Apply DNS`,edit:`Edit configuration`,delete:`Delete domain`,checked:`DNS check completed`,dnsApplied:`DNS records applied`,dnsPartial:`Some DNS records could not be applied`,saved:`Configuration saved`,testQueued:`Test email queued`,deleted:`Domain deleted`,actionFailed:`Action failed`,copied:`Copied`,copyFailed:`Unable to copy`,setupPartialTitle:`Domain created, but DNS follow-up needs attention`,setupPartialDescription:`Automatic application or the immediate check did not fully complete. Review each result below, correct it, and retry.`,setupCompleteTitle:`Domain created`,setupAutomaticDescription:`The automatic DNS flow ran. Review each result and the current verification status.`,setupManualDescription:`Add the records below at your DNS provider, then recheck after they propagate.`,domainSummary:`Domain summary`,authenticationHealth:`Authentication health`,recordsPassed:`required records passed`,ready:`Ready to send`,nextActions:`Next actions`,reviewDns:`Review DNS records`,dangerZone:`Danger zone`,dangerHint:`Deleting the domain stops its sending configuration and cannot be undone.`,recheck:`Recheck`,copyAll:`Copy all`,domainVerified:`Domain verified and ready to send`,domainNotVerified:`Domain verification is incomplete`,lastChecked:`Last checked`,never:`Never`,noDnsRecords:`No DNS check results yet`,checkNow:`Check now`,warnings:`Attention needed`,applyResults:`DNS apply results`,applyComplete:`Complete`,applyPartial:`Partially failed`,applySucceeded:`Succeeded`,applyFailed:`Failed`,applySkipped:`Skipped`,applySucceededHint:`The record was written or already matched.`,applyFailedHint:`No detailed error was returned. Retry or configure this record manually.`,host:`Host`,ports:`Ports`,username:`Username`,password:`Password`,configured:`Set (never returned in plaintext)`,notConfigured:`Not set`,manageKeys:`Manage API keys`,availableKeys:`Available keys`,noKeys:`No API keys available`,senderIdentity:`Sender identity`,fromDomain:`From domain`,verification:`Verification`,verified:`Verified`,pending:`Pending`,inboundStatus:`Inbound service`,inboundEnabled:`Inbound service enabled`,inboundDisabled:`Inbound service disabled`,inboundHint:`Manage mailboxes, aliases, and routes in the dedicated Inbox workspace.`,openMailboxRouting:`Open mailboxes & routing`,mailboxes:`Mailboxes`,unread:`unread`,messages:`messages`,noMailboxes:`No mailboxes for this domain`,configureMailbox:`Configure mailbox`,catchAll:`Default inbound route`,catchAllAddress:`Catch-all address`,disabled:`Disabled`,time:`Time`,recipient:`Recipient`,subject:`Subject`,body:`Body`,status:`Status`,noActivity:`No sending activity for this domain`,viewActivity:`View sending activity`,sent:`Sent`,delivered:`Delivered`,queued:`Queued`,deferred:`Deferred`,failed:`Failed`,bounced:`Bounced`,editTitle:`Edit domain configuration`,save:`Save`,cancel:`Cancel`,deleteTitle:`Delete domain`,deleteWarning:`This cannot be undone. Sending configuration will stop immediately.`,typeDomain:`Type the domain to confirm:`,deleteConfirmation:`Domain deletion confirmation`,queueTest:`Queue test`,validRecipient:`Enter a valid recipient email`,testSubject:e=>`MailHub ${e} test email`,testBody:e=>`This is a MailHub delivery test from ${e}.`};export{_e as default};