DomainDetail-C_ScJIVm.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-DNlqAiGO.js";import{G as s,i as c,kt as l,n as u,st as d,t as f}from"./jsx-runtime-dm82oUI8.js";import{a as ee,o as p}from"./grid-DcIFgt5N.js";import{t as m}from"./table-CHt5qwx3.js";import{n as h,r as te,t as g}from"./StatusPill-Bcw_ne6L.js";import{n as _,t as v}from"./row-Cmd9RpeX.js";import{t as y}from"./descriptions-vs1os_w7.js";import{t as b}from"./form-BRrMNJiX.js";import{t as x}from"./input-0_Xo22Fl.js";import{t as S}from"./list-B3SBzx24.js";import{t as C}from"./modal-BNBPl4Qp.js";import{t as w}from"./CopyOutlined-CjLq_nuP.js";import{n as ne,t as T}from"./EditOutlined-BjvG9r8B.js";import{t as re}from"./EllipsisOutlined-Bk3Ymyne.js";import{t as E}from"./ReloadOutlined-Cq8HKCaL.js";import{t as D}from"./ThunderboltOutlined-CMOzejTs.js";import{a as ie,h as ae,m as oe,n as se,p as ce,s as O,v as le,y as ue}from"./index-CBPGvhVC.js";import{t as k}from"./EmptyState-rI31ioMm.js";import{t as A}from"./CodeBlock-B-NIgQUI.js";import{i as j,n as de,t as fe}from"./domain-model-BLOrIAIx.js";import{t as M}from"./StatusTag-CBp0RCE4.js";var pe=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`}})),N=e(t()),P=e(pe());function F(){return F=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},F.apply(this,arguments)}var me=N.forwardRef((e,t)=>N.createElement(o,F({},e,{ref:t,icon:P.default}))),I=f();function he({record:e,loading:t,onCopy:n,onRecheck:i}){let{t:a}=r(),o=de(e);return(0,I.jsx)(h,{className:`dns-record-card`,title:(0,I.jsxs)(c,{wrap:!0,size:8,children:[(0,I.jsx)(`span`,{className:`dns-record-card__label`,children:e.label}),(0,I.jsx)(M,{record:e})]}),extra:(0,I.jsx)(u.Text,{code:!0,className:`dns-record-card__type`,children:e.type}),children:(0,I.jsxs)(c,{direction:`vertical`,size:14,className:`full-width`,children:[(0,I.jsx)(L,{label:a(`dnsRecord.hostname`),value:e.host,onCopy:n}),(0,I.jsx)(L,{label:a(`dnsRecord.targetValue`),value:e.value||`-`,onCopy:n}),(0,I.jsxs)(`div`,{children:[(0,I.jsx)(u.Text,{type:`secondary`,children:a(`dnsRecord.currentValue`)}),o.length?(0,I.jsx)(c,{direction:`vertical`,size:8,className:`full-width value-stack`,children:o.map(e=>(0,I.jsx)(A,{value:e,onCopy:n},e))}):(0,I.jsx)(u.Paragraph,{type:`secondary`,className:`dns-empty-value`,children:a(`dnsRecord.emptyCurrent`)})]}),e.key===`ptr`?(0,I.jsx)(p,{type:`info`,showIcon:!0,message:a(`dnsRecord.ptrHint`)}):null,(e.warnings||[]).map(e=>(0,I.jsx)(p,{type:`warning`,showIcon:!0,message:e},e)),(0,I.jsx)(l,{icon:(0,I.jsx)(E,{}),loading:t,onClick:i,children:a(`dnsRecord.recheck`)})]})})}function L({label:e,value:t,onCopy:n}){return(0,I.jsxs)(`div`,{className:`dns-value-row`,children:[(0,I.jsx)(u.Text,{type:`secondary`,children:e}),(0,I.jsx)(A,{value:t,onCopy:n})]})}var R=[`overview`,`dns`,`sending`,`inbound`,`activity`];function z(){let{id:e,section:t}=oe(),n=Number(e),o=Se(t)?t:`overview`,s=ce(),[f,m]=ae(),{config:_}=se(),{locale:v}=r(),y=v.startsWith(`en`)?we:Ce,{message:S}=i.useApp(),[w,O]=(0,N.useState)(null),[k,A]=(0,N.useState)(null),[j,de]=(0,N.useState)(void 0),[M,pe]=(0,N.useState)(null),[P,F]=(0,N.useState)(null),[he,L]=(0,N.useState)(!0),[R,z]=(0,N.useState)(!1),[B,H]=(0,N.useState)(``),[U,W]=(0,N.useState)(``),[K,Te]=(0,N.useState)({}),[Ee,De]=(0,N.useState)(!1),[Oe,q]=(0,N.useState)(!1),[ke,Ae]=(0,N.useState)(``),[je,Me]=(0,N.useState)(!1),[Ne]=b.useForm(),[J]=b.useForm(),Pe=(0,N.useCallback)(async()=>{L(!0),H(``);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){H(e instanceof Error?e.message:y.loadFailed)}finally{L(!1)}},[y.loadFailed,n]);(0,N.useEffect)(()=>{Pe()},[Pe]),(0,N.useEffect)(()=>{!t||Se(t)||s(`/domains/${e}/overview`,{replace:!0})},[e,s,t]),(0,N.useEffect)(()=>{f.get(`edit`)===`1`&&w?.domain&&$(w.domain)},[w?.domain?.id,f]);let Y=(0,N.useCallback)(async()=>{if(w?.domain&&!(o===`overview`||o===`dns`)&&!(o===`activity`&&k!==null)&&!(o===`sending`&&M!==null&&j!==void 0)&&!(o===`inbound`&&P!==null)){z(!0),W(``);try{if(o===`activity`){let e=await a.events({domainId:w.domain.id,page:1,pageSize:50});A(e.events)}else if(o===`sending`){let[e,t]=await Promise.all([a.smtpCredential(),a.apiTokens()]);de(e.credential),pe(t.tokens)}else if(o===`inbound`){let e=await a.inboundMailboxes();F(e.mailboxes.filter(e=>e.domainId===w.domain?.id))}}catch(e){W(e instanceof Error?e.message:y.sectionLoadFailed)}finally{z(!1)}}},[o,M,w?.domain,y.sectionLoadFailed,k,P,j]);(0,N.useEffect)(()=>{Y()},[Y]);let X=w?.domain||null,Z=(0,N.useMemo)(()=>X?fe(X):null,[X]);function Fe(e){O(t=>t&&{...t,domain:e})}async function Q(e,t){Te(t=>({...t,[e]:!0}));try{return await t()}finally{Te(t=>({...t,[e]:!1}))}}async function Ie(){if(X)try{Fe((await Q(`check`,()=>a.checkDomain(X.id))).domain),S.success(y.checked)}catch(e){S.error(G(e,y.actionFailed))}}async function Le(){if(X)try{let e=await Q(`apply`,()=>a.applyDns(X.id));Fe(e.domain),e.apply?.ok===!1?S.warning(y.dnsPartial):S.success(y.dnsApplied)}catch(e){S.error(G(e,y.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(),S.success(y.saved)}catch(e){S.error(G(e,y.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(),S.success(y.testQueued)}catch(e){S.error(G(e,y.actionFailed))}}async function Be(){if(!(!X||ke!==X.domain))try{await Q(`delete`,()=>a.deleteDomain(X.id)),S.success(y.deleted),s(`/domains`,{replace:!0})}catch(e){S.error(G(e,y.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}),De(!0)}function Ve(){if(De(!1),f.has(`edit`)){let e=new URLSearchParams(f);e.delete(`edit`),m(e,{replace:!0})}}function He(){if(!f.has(`setup`))return;let e=new URLSearchParams(f);e.delete(`setup`),m(e,{replace:!0})}function Ue(){X&&(J.setFieldsValue({subject:y.testSubject(X.domain),text:y.testBody(X.domain)}),Me(!0))}async function We(e){try{await navigator.clipboard.writeText(e),S.success(y.copied)}catch{S.error(y.copyFailed)}}if(he&&!w)return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,"aria-label":y.loading,children:[(0,I.jsx)(d,{active:!0,title:{width:`36%`},paragraph:{rows:3}}),(0,I.jsx)(h,{children:(0,I.jsx)(d,{active:!0,paragraph:{rows:10}})})]});if(B&&!w)return(0,I.jsx)(le,{status:`error`,title:y.loadFailed,subTitle:B,extra:(0,I.jsxs)(c,{children:[(0,I.jsx)(l,{onClick:()=>s(`/domains`),children:y.back}),(0,I.jsx)(l,{type:`primary`,onClick:()=>void Pe(),children:y.retry})]})});if(!Number.isInteger(n)||n<=0||w&&!X)return(0,I.jsx)(le,{status:`404`,title:y.notFound,subTitle:y.notFoundHint,extra:(0,I.jsx)(l,{type:`primary`,onClick:()=>s(`/domains`),children:y.backToDomains})});if(!X||!w||!Z)return null;let Ge=[{key:`check`,icon:(0,I.jsx)(E,{}),label:y.checkDns,onClick:()=>void Ie()},{key:`apply`,icon:(0,I.jsx)(D,{}),label:y.autoDns,disabled:!X.dnsCredentialId,onClick:()=>void Le()},{key:`edit`,icon:(0,I.jsx)(T,{}),label:y.edit,onClick:()=>$(X)},{type:`divider`},{key:`delete`,icon:(0,I.jsx)(ne,{}),danger:!0,label:y.delete,onClick:()=>{Ae(``),q(!0)}}];return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(me,{}),onClick:()=>s(`/domains`),style:{width:`fit-content`,minHeight:44},children:y.backToDomains}),(0,I.jsx)(te,{title:X.domain,subtitle:`${X.senderHost} · ${X.sendingIp}`,extra:(0,I.jsxs)(c,{children:[(0,I.jsxs)(g,{tone:Z.status===`success`?`success`:Z.status===`warning`?`warning`:`error`,children:[Z.passed,`/`,Z.total,` `,Z.status===`success`?y.dnsPassed:y.needsAttention]}),(0,I.jsx)(l,{type:`primary`,icon:(0,I.jsx)(ie,{}),style:{minHeight:44},onClick:Ue,children:y.testSend}),(0,I.jsx)(ue,{menu:{items:Ge},trigger:[`click`],children:(0,I.jsx)(l,{"aria-label":y.moreActions,icon:(0,I.jsx)(re,{}),style:{minHeight:44},loading:Object.values(K).some(Boolean)})})]})}),f.get(`setup`)===`partial`?(0,I.jsx)(p,{type:`warning`,showIcon:!0,closable:!0,message:y.setupPartialTitle,description:y.setupPartialDescription,onClose:He}):f.get(`setup`)===`complete`?(0,I.jsx)(p,{type:`success`,showIcon:!0,closable:!0,message:y.setupCompleteTitle,description:X.dnsCredentialId?y.setupAutomaticDescription:y.setupManualDescription,onClose:He}):null,(0,I.jsx)(ee,{activeKey:o,onChange:e=>s(`/domains/${X.id}/${e}`),className:`domain-detail-tabs`,items:[{key:`overview`,label:y.overview,children:(0,I.jsx)(ge,{domain:X,health:Z,dnsName:w.dnsCredentials.find(e=>e.id===X.dnsCredentialId)?.name,relayName:w.smtpRelays.find(e=>e.id===X.smtpRelayId)?.name,copy:y,onCheck:Ie,onReviewDns:()=>s(`/domains/${X.id}/dns`),onEdit:()=>$(X),onDelete:()=>q(!0),loading:K})},{key:`dns`,label:y.dnsAndVerification,children:(0,I.jsx)(_e,{domain:X,copy:y,onCopy:We,onCheck:Ie,onApply:Le,loading:K})},{key:`sending`,label:y.sendingConfiguration,children:(0,I.jsx)(V,{loading:R,error:U,retry:Y,copy:y,children:(0,I.jsx)(ve,{domain:X,config:_,credential:j,tokens:M||[],relayName:w.smtpRelays.find(e=>e.id===X.smtpRelayId)?.name,copy:y,onCopy:We,onEdit:()=>$(X)})})},{key:`inbound`,label:y.inboundConfiguration,children:(0,I.jsx)(V,{loading:R,error:U,retry:Y,copy:y,children:(0,I.jsx)(ye,{domain:X,config:_,mailboxes:P||[],copy:y,onNavigate:()=>s(`/inbox`),onEdit:()=>$(X)})})},{key:`activity`,label:y.activity,children:(0,I.jsx)(V,{loading:R,error:U,retry:Y,copy:y,children:(0,I.jsx)(be,{events:k||[],copy:y,onView:e=>s(`/activity/${e.id}?domainId=${X.id}`)})})}]}),(0,I.jsx)(xe,{open:Ee,domain:X,form:Ne,dnsCredentials:w.dnsCredentials,smtpRelays:w.smtpRelays,copy:y,loading:!!K.edit,onCancel:Ve,onSave:Re}),(0,I.jsx)(C,{title:y.deleteTitle,open:Oe,okText:y.delete,cancelText:y.cancel,okButtonProps:{danger:!0,disabled:ke!==X.domain,loading:!!K.delete},onCancel:()=>{q(!1),Ae(``)},onOk:()=>void Be(),children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsx)(p,{type:`error`,showIcon:!0,message:y.deleteWarning}),(0,I.jsxs)(u.Text,{children:[y.typeDomain,` `,(0,I.jsx)(u.Text,{code:!0,children:X.domain})]}),(0,I.jsx)(x,{value:ke,onChange:e=>Ae(e.target.value),"aria-label":y.deleteConfirmation,style:{minHeight:44}})]})}),(0,I.jsx)(C,{title:y.testSend,open:je,okText:y.queueTest,cancelText:y.cancel,confirmLoading:!!K.test,onCancel:()=>Me(!1),onOk:()=>void ze(),children:(0,I.jsxs)(b,{form:J,layout:`vertical`,children:[(0,I.jsx)(b.Item,{name:`to`,label:y.recipient,rules:[{required:!0,type:`email`,message:y.validRecipient}],children:(0,I.jsx)(x,{placeholder:`you@example.com`,style:{minHeight:44}})}),(0,I.jsx)(b.Item,{name:`subject`,label:y.subject,rules:[{required:!0}],children:(0,I.jsx)(x,{style:{minHeight:44}})}),(0,I.jsx)(b.Item,{name:`text`,label:y.body,rules:[{required:!0}],children:(0,I.jsx)(x.TextArea,{rows:5})})]})})]})}function ge({domain:e,health:t,dnsName:n,relayName:r,copy:i,onCheck:a,onReviewDns:o,onEdit:s,onDelete:d,loading:f}){return(0,I.jsxs)(c,{direction:`vertical`,size:20,className:`full-width`,children:[(0,I.jsxs)(v,{gutter:[16,16],children:[(0,I.jsx)(_,{xs:24,lg:15,children:(0,I.jsx)(h,{title:i.domainSummary,children:(0,I.jsxs)(y,{column:1,children:[(0,I.jsx)(y.Item,{label:i.domain,children:e.domain}),(0,I.jsx)(y.Item,{label:i.senderHost,children:e.senderHost}),(0,I.jsx)(y.Item,{label:i.sendingIp,children:e.sendingIp}),(0,I.jsx)(y.Item,{label:`DKIM selector`,children:e.selector}),(0,I.jsx)(y.Item,{label:i.dnsIntegration,children:n||i.manualDns}),(0,I.jsx)(y.Item,{label:i.relay,children:r||i.defaultDelivery}),(0,I.jsx)(y.Item,{label:i.createdAt,children:new Date(e.createdAt).toLocaleString()})]})})}),(0,I.jsx)(_,{xs:24,lg:9,children:(0,I.jsx)(h,{title:i.authenticationHealth,children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsxs)(u.Title,{level:2,style:{margin:0},children:[t.passed,`/`,t.total]}),(0,I.jsx)(u.Text,{type:`secondary`,children:i.recordsPassed}),(0,I.jsx)(g,{tone:t.status===`success`?`success`:t.status===`warning`?`warning`:`error`,children:t.status===`success`?i.ready:i.needsAttention}),(0,I.jsx)(l,{icon:(0,I.jsx)(E,{}),loading:f.check,onClick:a,children:i.checkDns})]})})})]}),(0,I.jsxs)(v,{gutter:[16,16],children:[(0,I.jsx)(_,{xs:24,lg:12,children:(0,I.jsx)(h,{title:i.nextActions,children:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(D,{}),onClick:o,children:i.reviewDns}),(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),onClick:s,children:i.edit})]})})}),(0,I.jsx)(_,{xs:24,lg:12,children:(0,I.jsx)(h,{title:i.dangerZone,className:`domain-danger-card`,children:(0,I.jsxs)(c,{direction:`vertical`,className:`full-width`,children:[(0,I.jsx)(u.Text,{type:`secondary`,children:i.dangerHint}),(0,I.jsx)(l,{danger:!0,icon:(0,I.jsx)(ne,{}),onClick:d,children:i.delete})]})})})]})]})}function _e({domain:e,copy:t,onCopy:n,onCheck:r,onApply:i,loading:a}){let o=j(e.status?.records||[]),s=o.map(e=>`${e.host}\t${e.type}\t${e.value||``}`).join(`
  2. `);return(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsx)(h,{title:t.dnsAndVerification,extra:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(l,{icon:(0,I.jsx)(E,{}),loading:a.check,onClick:r,children:t.recheck}),(0,I.jsx)(l,{icon:(0,I.jsx)(D,{}),disabled:!e.dnsCredentialId,loading:a.apply,onClick:i,children:t.autoDns}),(0,I.jsx)(l,{icon:(0,I.jsx)(w,{}),disabled:!s,onClick:()=>n(s),children:t.copyAll})]}),children:(0,I.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,I.jsx)(B,{apply:e.status?.apply,copy:t}),o.length?o.map(e=>(0,I.jsx)(he,{record:e,loading:a.check,onCopy:n,onRecheck:r},e.key)):(0,I.jsx)(h,{children:(0,I.jsx)(k,{description:t.noDnsRecords,action:(0,I.jsx)(l,{onClick:r,children:t.checkNow})})}),e.status?.warnings?.length?(0,I.jsx)(p,{type:`warning`,showIcon:!0,message:t.warnings,description:e.status.warnings.join(`
  3. `)}):null]})}function B({apply:e,copy:t}){return e?.results?.length?(0,I.jsx)(h,{title:t.applyResults,extra:(0,I.jsx)(g,{tone:e.ok?`success`:`warning`,children:e.ok?t.applyComplete:t.applyPartial}),children:(0,I.jsx)(S,{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,I.jsx)(S.Item,{children:(0,I.jsx)(S.Item.Meta,{title:(0,I.jsxs)(c,{wrap:!0,children:[(0,I.jsx)(g,{tone:n,children:r}),(0,I.jsx)(u.Text,{code:!0,children:e.type}),(0,I.jsx)(u.Text,{children:e.host})]}),description:(0,I.jsx)(u.Text,{type:e.ok?`secondary`:`danger`,children:i})})})}})}):null}function ve({domain:e,config:t,credential:n,tokens:r,relayName:i,copy:a,onCopy:o,onEdit:s}){let c=`${t?.appBaseUrl||window.location.origin}/api/send`;return(0,I.jsxs)(v,{gutter:[16,16],children:[(0,I.jsx)(_,{xs:24,xl:12,children:(0,I.jsx)(h,{title:`SMTP`,extra:(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),onClick:s,children:a.edit}),children:(0,I.jsxs)(y,{column:1,children:[(0,I.jsx)(y.Item,{label:a.host,children:H(t?.submission?.host||`-`,o)}),(0,I.jsx)(y.Item,{label:a.ports,children:t?.submission?.ports?.map(e=>`${e.port}/${e.protocol}`).join(`, `)||`-`}),(0,I.jsx)(y.Item,{label:a.username,children:n?.username||t?.submission?.username||`-`}),(0,I.jsx)(y.Item,{label:a.password,children:(0,I.jsx)(g,{tone:n?.passwordSet?`success`:`warning`,children:n?.passwordSet?a.configured:a.notConfigured})}),(0,I.jsx)(y.Item,{label:a.relay,children:i||a.defaultDelivery})]})})}),(0,I.jsx)(_,{xs:24,xl:12,children:(0,I.jsxs)(h,{title:`API`,extra:(0,I.jsx)(l,{href:`/integrations/api-keys`,children:a.manageKeys}),children:[(0,I.jsxs)(y,{column:1,children:[(0,I.jsx)(y.Item,{label:`Endpoint`,children:H(c,o)}),(0,I.jsx)(y.Item,{label:a.availableKeys,children:r.filter(e=>!e.revokedAt).length})]}),r.length?(0,I.jsx)(S,{size:`small`,dataSource:r.slice(0,4),renderItem:e=>(0,I.jsx)(S.Item,{children:(0,I.jsx)(S.Item.Meta,{title:e.name,description:(0,I.jsxs)(u.Text,{code:!0,children:[e.tokenPrefix,`••••`]})})})}):(0,I.jsx)(k,{description:a.noKeys})]})}),(0,I.jsx)(_,{span:24,children:(0,I.jsx)(h,{title:a.senderIdentity,children:(0,I.jsxs)(y,{column:1,children:[(0,I.jsx)(y.Item,{label:a.fromDomain,children:e.domain}),(0,I.jsx)(y.Item,{label:a.senderHost,children:e.senderHost}),(0,I.jsx)(y.Item,{label:a.verification,children:(0,I.jsx)(g,{tone:e.status?.verified?`success`:`warning`,children:e.status?.verified?a.verified:a.pending})})]})})})]})}function ye({domain:e,config:t,mailboxes:n,copy:r,onNavigate:i,onEdit:a}){return(0,I.jsxs)(v,{gutter:[16,16],children:[(0,I.jsx)(_,{xs:24,xl:9,children:(0,I.jsx)(h,{title:r.inboundStatus,children:(0,I.jsxs)(c,{direction:`vertical`,size:16,className:`full-width`,children:[(0,I.jsxs)(g,{tone:t?.submission?.inboundEnabled?`success`:`warning`,children:[(0,I.jsx)(O,{}),` `,t?.submission?.inboundEnabled?r.inboundEnabled:r.inboundDisabled]}),(0,I.jsx)(u.Text,{type:`secondary`,children:r.inboundHint}),(0,I.jsx)(l,{onClick:i,children:r.openMailboxRouting})]})})}),(0,I.jsx)(_,{xs:24,xl:15,children:(0,I.jsx)(h,{title:r.mailboxes,extra:(0,I.jsx)(u.Text,{type:`secondary`,children:n.length}),children:n.length?(0,I.jsx)(S,{dataSource:n,renderItem:e=>(0,I.jsxs)(S.Item,{children:[(0,I.jsx)(S.Item.Meta,{title:e.address,description:`${e.unreadCount} ${r.unread} · ${e.messageCount} ${r.messages}`}),(0,I.jsx)(g,{tone:e.status===`active`?`success`:`warning`,children:e.status})]})}):(0,I.jsx)(k,{description:r.noMailboxes,action:(0,I.jsx)(l,{onClick:i,children:r.configureMailbox})})})}),(0,I.jsx)(_,{span:24,children:(0,I.jsx)(h,{title:r.catchAll,extra:(0,I.jsx)(l,{icon:(0,I.jsx)(T,{}),onClick:a,children:r.edit}),children:(0,I.jsxs)(y,{column:1,children:[(0,I.jsx)(y.Item,{label:r.catchAllAddress,children:e.catchAllAddress||r.notConfigured}),(0,I.jsx)(y.Item,{label:`IMAP`,children:t?.mailAccess?.imap.enabled?t.mailAccess.imap.ports.map(e=>e.port).join(`, `):r.disabled}),(0,I.jsx)(y.Item,{label:`POP3`,children:t?.mailAccess?.pop3.enabled?t.mailAccess.pop3.ports.map(e=>e.port).join(`, `):r.disabled})]})})})]})}function be({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,I.jsx)(g,{tone:U(e),children:W(e,t)})}];return e.length?(0,I.jsx)(h,{children:(0,I.jsx)(m,{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,I.jsx)(h,{children:(0,I.jsx)(k,{description:t.noActivity})})}function V({loading:e,error:t,retry:n,copy:r,children:i}){return e?(0,I.jsx)(h,{children:(0,I.jsx)(d,{active:!0,paragraph:{rows:7}})}):t?(0,I.jsx)(le,{status:`error`,title:r.sectionLoadFailed,subTitle:t,extra:(0,I.jsx)(l,{type:`primary`,onClick:n,children:r.retry})}):(0,I.jsx)(I.Fragment,{children:i})}function xe({open:e,domain:t,form:n,dnsCredentials:r,smtpRelays:i,copy:a,loading:o,onCancel:c,onSave:l}){return(0,I.jsx)(C,{title:a.editTitle,open:e,width:640,confirmLoading:o,okText:a.save,cancelText:a.cancel,onCancel:c,onOk:l,children:(0,I.jsxs)(b,{form:n,layout:`vertical`,children:[(0,I.jsxs)(v,{gutter:16,children:[(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`dnsCredentialId`,label:a.dnsIntegration,children:(0,I.jsx)(s,{allowClear:!0,options:r.map(e=>({value:e.id,label:e.name}))})})}),(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`smtpRelayId`,label:a.relay,children:(0,I.jsx)(s,{allowClear:!0,options:i.map(e=>({value:e.id,label:e.name}))})})})]}),(0,I.jsxs)(v,{gutter:16,children:[(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`senderHost`,label:a.senderHost,rules:[{required:!0}],children:(0,I.jsx)(x,{})})}),(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`sendingIp`,label:a.sendingIp,rules:[{required:!0}],children:(0,I.jsx)(x,{})})})]}),(0,I.jsxs)(v,{gutter:16,children:[(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`selector`,label:`DKIM selector`,rules:[{required:!0}],children:(0,I.jsx)(x,{})})}),(0,I.jsx)(_,{xs:24,md:12,children:(0,I.jsx)(b.Item,{name:`dmarcPolicy`,label:`DMARC`,children:(0,I.jsx)(s,{options:[`none`,`quarantine`,`reject`].map(e=>({value:e,label:e}))})})})]}),(0,I.jsx)(b.Item,{name:`spfExtra`,label:`SPF`,children:(0,I.jsx)(x.TextArea,{rows:2})}),(0,I.jsx)(b.Item,{name:`dmarcRua`,label:`DMARC rua`,children:(0,I.jsx)(x,{})}),(0,I.jsx)(b.Item,{name:`catchAllAddress`,label:a.catchAllAddress,children:(0,I.jsx)(x,{placeholder:`inbox@${t.domain}`})})]})})}function H(e,t){return(0,I.jsxs)(c,{children:[(0,I.jsx)(u.Text,{code:!0,children:e}),(0,I.jsx)(l,{type:`text`,size:`small`,"aria-label":`Copy`,icon:(0,I.jsx)(w,{}),onClick:()=>t(e)})]})}function Se(e){return R.includes(e)}function U(e){return e===`sent`||e===`delivered`?`success`:e===`queued`?`info`:e===`deferred`||e===`pending`?`warning`:e===`failed`||e===`bounced`?`error`:`neutral`}function W(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 G(e,t){return e instanceof Error?e.message:t}var Ce={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 投递测试邮件。`},we={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{z as default};