Domains-CuwsXj6O.js 68 KB

12
  1. import{a as e,n as t,r as n}from"./react-dom-stZKkA6x.js";import{N as r,a as i,c as a,d as o,r as s,u as c}from"./theme-DjPzgo6g.js";import{$n as l,Ar as u,B as d,Bn as f,Cn as p,Dr as m,En as h,Er as g,G as _,Gt as v,J as y,M as b,Mr as x,On as S,Rn as C,Vn as w,Xn as T,Yt as E,bn as D,fn as O,i as k,ir as A,jn as j,jr as M,jt as N,kr as P,kt as F,n as I,pn as L,rr as R,sn as z,st as B,t as V,tr as H,zn as U}from"./jsx-runtime-dm82oUI8.js";import{i as ee,o as W,t as te}from"./grid-BmaFEMOO.js";import{n as ne,r as G,t as re}from"./table-CSW7F8Qw.js";import{a as ie,n as ae,r as oe,t as K}from"./StatusPill-IFsKXy8H.js";import{t as q}from"./descriptions-vs1os_w7.js";import{t as J}from"./form-CvEcrSb3.js";import{t as Y}from"./input-0_Xo22Fl.js";import{t as se}from"./list-HagL8Wla.js";import{t as ce}from"./modal-B8KcNGBa.js";import{t as le}from"./DeleteOutlined-B1WEjJYP.js";import{t as ue}from"./EditOutlined-_SvZHznu.js";import{t as de}from"./EllipsisOutlined-DHTs_FOL.js";import{t as fe}from"./ReloadOutlined-C3S2BDne.js";import{t as pe}from"./SearchOutlined-C_VWNehW.js";import{t as me}from"./ThunderboltOutlined-CbXdMhP9.js";import{a as he,b as ge,c as _e,h as ve,n as ye,p as be,v as xe,y as Se}from"./index-BCIgegZI.js";import{t as Ce}from"./EmptyState-rI31ioMm.js";import{r as we,t as Te}from"./domain-model-BLOrIAIx.js";var X=e(t()),Ee={percent:0,prefixCls:`rc-progress`,strokeColor:`#2db7f5`,strokeLinecap:`round`,strokeWidth:1,trailColor:`#D9D9D9`,trailWidth:1,gapPosition:`bottom`},De=function(){var e=(0,X.useRef)([]),t=(0,X.useRef)(null);return(0,X.useEffect)(function(){var n=Date.now(),r=!1;e.current.forEach(function(e){if(e){r=!0;var i=e.style;i.transitionDuration=`.3s, .3s, .3s, .06s`,t.current&&n-t.current<100&&(i.transitionDuration=`0s, 0s`)}}),r&&(t.current=Date.now())}),e.current},Z=e(x()),Oe=0,ke=R();function Ae(){var e;return ke?(e=Oe,Oe+=1):e=`TEST_OR_SSR`,e}var je=(function(e){var t=A(X.useState(),2),n=t[0],r=t[1];return X.useEffect(function(){r(`rc_progress_${Ae()}`)},[]),e||n}),Me=function(e){var t=e.bg,n=e.children;return X.createElement(`div`,{style:{width:`100%`,height:`100%`,background:t}},n)};function Ne(e,t){return Object.keys(e).map(function(n){var r=`${Math.floor(parseFloat(n)*t)}%`;return`${e[n]} ${r}`})}var Pe=X.forwardRef(function(e,t){var n=e.prefixCls,r=e.color,i=e.gradientId,a=e.radius,o=e.style,s=e.ptg,c=e.strokeLinecap,l=e.strokeWidth,d=e.size,f=e.gapDegree,p=r&&u(r)===`object`,m=p?`#FFF`:void 0,h=d/2,g=X.createElement(`circle`,{className:`${n}-circle-path`,r:a,cx:h,cy:h,stroke:m,strokeLinecap:c,strokeWidth:l,opacity:s===0?0:1,style:o,ref:t});if(!p)return g;var _=`${i}-conic`,v=f?`${180+f/2}deg`:`0deg`,y=Ne(r,(360-f)/360),b=Ne(r,1),x=`conic-gradient(from ${v}, ${y.join(`, `)})`,S=`linear-gradient(to ${f?`bottom`:`top`}, ${b.join(`, `)})`;return X.createElement(X.Fragment,null,X.createElement(`mask`,{id:_},g),X.createElement(`foreignObject`,{x:0,y:0,width:d,height:d,mask:`url(#${_})`},X.createElement(Me,{bg:S},X.createElement(Me,{bg:x}))))}),Fe=function(e,t,n,r,i,a,o,s,c,l){var u=arguments.length>10&&arguments[10]!==void 0?arguments[10]:0,d=n/100*360*((360-a)/360),f=a===0?0:{bottom:0,top:180,left:90,right:-90}[o],p=(100-r)/100*t;c===`round`&&r!==100&&(p+=l/2,p>=t&&(p=t-.01));var m=100/2;return{stroke:typeof s==`string`?s:void 0,strokeDasharray:`${t}px ${e}`,strokeDashoffset:p+u,transform:`rotate(${i+d+f}deg)`,transformOrigin:`${m}px ${m}px`,transition:`stroke-dashoffset .3s ease 0s, stroke-dasharray .3s ease 0s, stroke .3s, stroke-width .06s ease .3s, opacity .3s ease 0s`,fillOpacity:0}},Ie=[`id`,`prefixCls`,`steps`,`strokeWidth`,`trailWidth`,`gapDegree`,`gapPosition`,`trailColor`,`strokeLinecap`,`style`,`className`,`strokeColor`,`percent`];function Le(e){var t=e??[];return Array.isArray(t)?t:[t]}var Re=function(e){var t=g(g({},Ee),e),n=t.id,r=t.prefixCls,i=t.steps,a=t.strokeWidth,o=t.trailWidth,s=t.gapDegree,c=s===void 0?0:s,l=t.gapPosition,d=t.trailColor,f=t.strokeLinecap,p=t.style,m=t.className,h=t.strokeColor,_=t.percent,v=H(t,Ie),y=100/2,b=`${je(n)}-gradient`,x=y-a/2,S=Math.PI*2*x,C=c>0?90+c/2:-90,w=S*((360-c)/360),T=u(i)===`object`?i:{count:i,gap:2},E=T.count,D=T.gap,O=Le(_),k=Le(h),A=k.find(function(e){return e&&u(e)===`object`}),j=A&&u(A)===`object`?`butt`:f,N=Fe(S,w,0,100,C,c,l,d,j,a),P=De();return X.createElement(`svg`,M({className:(0,Z.default)(`${r}-circle`,m),viewBox:`0 0 100 100`,style:p,id:n,role:`presentation`},v),!E&&X.createElement(`circle`,{className:`${r}-circle-trail`,r:x,cx:y,cy:y,stroke:d,strokeLinecap:j,strokeWidth:o||a,style:N}),E?function(){var e=Math.round(E*(O[0]/100)),t=100/E,n=0;return Array(E).fill(null).map(function(i,o){var s=o<=e-1?k[0]:d,f=s&&u(s)===`object`?`url(#${b})`:void 0,p=Fe(S,w,n,t,C,c,l,s,`butt`,a,D);return n+=(w-p.strokeDashoffset+D)*100/w,X.createElement(`circle`,{key:o,className:`${r}-circle-path`,r:x,cx:y,cy:y,stroke:f,strokeWidth:a,opacity:1,style:p,ref:function(e){P[o]=e}})})}():function(){var e=0;return O.map(function(t,n){var i=k[n]||k[k.length-1],o=Fe(S,w,e,t,C,c,l,i,j,a);return e+=t,X.createElement(Pe,{key:n,color:i,ptg:t,radius:x,prefixCls:r,gradientId:b,style:o,strokeLinecap:j,strokeWidth:a,gapDegree:c,ref:function(e){P[n]=e},size:100})}).reverse()}())};function Q(e){return!e||e<0?0:e>100?100:e}function ze({success:e,successPercent:t}){let n=t;return e&&`progress`in e&&(n=e.progress),e&&`percent`in e&&(n=e.percent),n}var Be=({percent:e,success:t,successPercent:n})=>{let r=Q(ze({success:t,successPercent:n}));return[r,Q(Q(e)-r)]},Ve=({success:e={},strokeColor:t})=>{let{strokeColor:n}=e;return[n||f.green,t||null]},He=(e,t,n)=>{let r=-1,i=-1;if(t===`step`){let t=n.steps,a=n.strokeWidth;typeof e==`string`||e===void 0?(r=e===`small`?2:14,i=a??8):typeof e==`number`?[r,i]=[e,e]:[r=14,i=8]=Array.isArray(e)?e:[e.width,e.height],r*=t}else if(t===`line`){let t=n?.strokeWidth;typeof e==`string`||e===void 0?i=t||(e===`small`?6:8):typeof e==`number`?[r,i]=[e,e]:[r=-1,i=8]=Array.isArray(e)?e:[e.width,e.height]}else(t===`circle`||t===`dashboard`)&&(typeof e==`string`||e===void 0?[r,i]=e===`small`?[60,60]:[120,120]:typeof e==`number`?[r,i]=[e,e]:Array.isArray(e)&&(r=e[0]??e[1]??120,i=e[0]??e[1]??120));return[r,i]},Ue=3,We=e=>Ue/e*100,Ge=e=>{let{prefixCls:t,trailColor:n=null,strokeLinecap:r=`round`,gapPosition:i,gapDegree:a,width:o=120,type:s,children:c,success:l,size:u=o,steps:d}=e,[f,p]=He(u,`circle`),{strokeWidth:m}=e;m===void 0&&(m=Math.max(We(f),6));let h={width:f,height:p,fontSize:f*.15+6},g=X.useMemo(()=>{if(a||a===0)return a;if(s===`dashboard`)return 75},[a,s]),_=Be(e),v=i||s===`dashboard`&&`bottom`||void 0,y=Object.prototype.toString.call(e.strokeColor)===`[object Object]`,x=Ve({success:l,strokeColor:e.strokeColor}),S=(0,Z.default)(`${t}-inner`,{[`${t}-circle-gradient`]:y}),C=X.createElement(Re,{steps:d,percent:d?_[1]:_,strokeWidth:m,trailWidth:m,strokeColor:d?x[1]:x,strokeLinecap:r,trailColor:n,prefixCls:t,gapDegree:g,gapPosition:v}),w=f<=20,T=X.createElement(`div`,{className:S,style:h},C,!w&&c);return w?X.createElement(b,{title:c},T):T},Ke=`--progress-line-stroke-color`,qe=`--progress-percent`,Je=e=>{let t=e?`100%`:`-100%`;return new T(`antProgress${e?`RTL`:`LTR`}Active`,{"0%":{transform:`translateX(${t}) scaleX(0)`,opacity:.1},"20%":{transform:`translateX(${t}) scaleX(0)`,opacity:.5},to:{transform:`translateX(0) scaleX(1)`,opacity:0}})},Ye=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:Object.assign(Object.assign({},h(e)),{display:`inline-block`,"&-rtl":{direction:`rtl`},"&-line":{position:`relative`,width:`100%`,fontSize:e.fontSize},[`${t}-outer`]:{display:`inline-flex`,alignItems:`center`,width:`100%`},[`${t}-inner`]:{position:`relative`,display:`inline-block`,width:`100%`,flex:1,overflow:`hidden`,verticalAlign:`middle`,backgroundColor:e.remainingColor,borderRadius:e.lineBorderRadius},[`${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.defaultColor}},[`${t}-success-bg, ${t}-bg`]:{position:`relative`,background:e.defaultColor,borderRadius:e.lineBorderRadius,transition:`all ${e.motionDurationSlow} ${e.motionEaseInOutCirc}`},[`${t}-layout-bottom`]:{display:`flex`,flexDirection:`column`,alignItems:`center`,justifyContent:`center`,[`${t}-text`]:{width:`max-content`,marginInlineStart:0,marginTop:e.marginXXS}},[`${t}-bg`]:{overflow:`hidden`,"&::after":{content:`""`,background:{_multi_value_:!0,value:[`inherit`,`var(${Ke})`]},height:`100%`,width:`calc(1 / var(${qe}) * 100%)`,display:`block`},[`&${t}-bg-inner`]:{minWidth:`max-content`,"&::after":{content:`none`},[`${t}-text-inner`]:{color:e.colorWhite,[`&${t}-text-bright`]:{color:`rgba(0, 0, 0, 0.45)`}}}},[`${t}-success-bg`]:{position:`absolute`,insetBlockStart:0,insetInlineStart:0,backgroundColor:e.colorSuccess},[`${t}-text`]:{display:`inline-block`,marginInlineStart:e.marginXS,color:e.colorText,lineHeight:1,width:`2em`,whiteSpace:`nowrap`,textAlign:`start`,verticalAlign:`middle`,wordBreak:`normal`,[n]:{fontSize:e.fontSize},[`&${t}-text-outer`]:{width:`max-content`},[`&${t}-text-outer${t}-text-start`]:{width:`max-content`,marginInlineStart:0,marginInlineEnd:e.marginXS}},[`${t}-text-inner`]:{display:`flex`,justifyContent:`center`,alignItems:`center`,width:`100%`,height:`100%`,marginInlineStart:0,padding:`0 ${l(e.paddingXXS)}`,[`&${t}-text-start`]:{justifyContent:`start`},[`&${t}-text-end`]:{justifyContent:`end`}},[`&${t}-status-active`]:{[`${t}-bg::before`]:{position:`absolute`,inset:0,backgroundColor:e.colorBgContainer,borderRadius:e.lineBorderRadius,opacity:0,animationName:Je(),animationDuration:e.progressActiveMotionDuration,animationTimingFunction:e.motionEaseOutQuint,animationIterationCount:`infinite`,content:`""`}},[`&${t}-rtl${t}-status-active`]:{[`${t}-bg::before`]:{animationName:Je(!0)}},[`&${t}-status-exception`]:{[`${t}-bg`]:{backgroundColor:e.colorError},[`${t}-text`]:{color:e.colorError}},[`&${t}-status-exception ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorError}},[`&${t}-status-success`]:{[`${t}-bg`]:{backgroundColor:e.colorSuccess},[`${t}-text`]:{color:e.colorSuccess}},[`&${t}-status-success ${t}-inner:not(${t}-circle-gradient)`]:{[`${t}-circle-path`]:{stroke:e.colorSuccess}}})}},Xe=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-circle-trail`]:{stroke:e.remainingColor},[`&${t}-circle ${t}-inner`]:{position:`relative`,lineHeight:1,backgroundColor:`transparent`},[`&${t}-circle ${t}-text`]:{position:`absolute`,insetBlockStart:`50%`,insetInlineStart:0,width:`100%`,margin:0,padding:0,color:e.circleTextColor,fontSize:e.circleTextFontSize,lineHeight:1,whiteSpace:`normal`,textAlign:`center`,transform:`translateY(-50%)`,[n]:{fontSize:e.circleIconFontSize}},[`${t}-circle&-status-exception`]:{[`${t}-text`]:{color:e.colorError}},[`${t}-circle&-status-success`]:{[`${t}-text`]:{color:e.colorSuccess}}},[`${t}-inline-circle`]:{lineHeight:1,[`${t}-inner`]:{verticalAlign:`bottom`}}}},Ze=e=>{let{componentCls:t}=e;return{[t]:{[`${t}-steps`]:{display:`inline-block`,"&-outer":{display:`flex`,flexDirection:`row`,alignItems:`center`},"&-item":{flexShrink:0,minWidth:e.progressStepMinWidth,marginInlineEnd:e.progressStepMarginInlineEnd,backgroundColor:e.remainingColor,transition:`all ${e.motionDurationSlow}`,"&-active":{backgroundColor:e.defaultColor}}}}}},Qe=e=>{let{componentCls:t,iconCls:n}=e;return{[t]:{[`${t}-small&-line, ${t}-small&-line ${t}-text ${n}`]:{fontSize:e.fontSizeSM}}}},$e=D(`Progress`,e=>{let t=e.calc(e.marginXXS).div(2).equal(),n=j(e,{progressStepMarginInlineEnd:t,progressStepMinWidth:t,progressActiveMotionDuration:`2.4s`});return[Ye(n),Xe(n),Ze(n),Qe(n)]},e=>({circleTextColor:e.colorText,defaultColor:e.colorInfo,remainingColor:e.colorFillSecondary,lineBorderRadius:100,circleTextFontSize:`1em`,circleIconFontSize:`${e.fontSize/e.fontSizeSM}em`})),et=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},tt=e=>{let t=[];return Object.keys(e).forEach(n=>{let r=Number.parseFloat(n.replace(/%/g,``));Number.isNaN(r)||t.push({key:r,value:e[n]})}),t=t.sort((e,t)=>e.key-t.key),t.map(({key:e,value:t})=>`${t} ${e}%`).join(`, `)},nt=(e,t)=>{let{from:n=f.blue,to:r=f.blue,direction:i=t===`rtl`?`to left`:`to right`}=e,a=et(e,[`from`,`to`,`direction`]);if(Object.keys(a).length!==0){let e=`linear-gradient(${i}, ${tt(a)})`;return{background:e,[Ke]:e}}let o=`linear-gradient(${i}, ${n}, ${r})`;return{background:o,[Ke]:o}},rt=e=>{let{prefixCls:t,direction:n,percent:r,size:i,strokeWidth:a,strokeColor:o,strokeLinecap:s=`round`,children:c,trailColor:l=null,percentPosition:u,success:d}=e,{align:f,type:p}=u,m=o&&typeof o!=`string`?nt(o,n):{[Ke]:o,background:o},h=s===`square`||s===`butt`?0:void 0,[g,_]=He(i??[-1,a||(i===`small`?6:8)],`line`,{strokeWidth:a}),v={backgroundColor:l||void 0,borderRadius:h},y=Object.assign(Object.assign({width:`${Q(r)}%`,height:_,borderRadius:h},m),{[qe]:Q(r)/100}),b=ze(e),x={width:`${Q(b)}%`,height:_,borderRadius:h,backgroundColor:d?.strokeColor},S={width:g<0?`100%`:g},C=X.createElement(`div`,{className:`${t}-inner`,style:v},X.createElement(`div`,{className:(0,Z.default)(`${t}-bg`,`${t}-bg-${p}`),style:y},p===`inner`&&c),b!==void 0&&X.createElement(`div`,{className:`${t}-success-bg`,style:x})),w=p===`outer`&&f===`start`,T=p===`outer`&&f===`end`;return p===`outer`&&f===`center`?X.createElement(`div`,{className:`${t}-layout-bottom`},C,c):X.createElement(`div`,{className:`${t}-outer`,style:S},w&&c,C,T&&c)},it=e=>{let{size:t,steps:n,rounding:r=Math.round,percent:i=0,strokeWidth:a=8,strokeColor:o,trailColor:s=null,prefixCls:c,children:l}=e,u=r(i/100*n),[d,f]=He(t??[t===`small`?2:14,a],`step`,{steps:n,strokeWidth:a}),p=d/n,m=Array.from({length:n});for(let e=0;e<n;e++){let t=Array.isArray(o)?o[e]:o;m[e]=X.createElement(`div`,{key:e,className:(0,Z.default)(`${c}-steps-item`,{[`${c}-steps-item-active`]:e<=u-1}),style:{backgroundColor:e<=u-1?t:s,width:p,height:f}})}return X.createElement(`div`,{className:`${c}-steps-outer`},m,l)},at=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},ot=[`normal`,`exception`,`active`,`success`],st=X.forwardRef((e,t)=>{let{prefixCls:n,className:i,rootClassName:a,steps:o,strokeColor:s,percent:c=0,size:l=`default`,showInfo:u=!0,type:d=`line`,status:f,format:p,style:m,percentPosition:h={}}=e,g=at(e,[`prefixCls`,`className`,`rootClassName`,`steps`,`strokeColor`,`percent`,`size`,`showInfo`,`type`,`status`,`format`,`style`,`percentPosition`]),{align:_=`end`,type:v=`outer`}=h,b=Array.isArray(s)?s[0]:s,x=typeof s==`string`||Array.isArray(s)?s:void 0,S=X.useMemo(()=>b?new w(typeof b==`string`?b:Object.values(b)[0]).isLight():!1,[s]),T=X.useMemo(()=>{let t=ze(e);return Number.parseInt(t===void 0?(c??0)?.toString():(t??0)?.toString(),10)},[c,e.success,e.successPercent]),D=X.useMemo(()=>!ot.includes(f)&&T>=100?`success`:f||`normal`,[f,T]),{getPrefixCls:k,direction:A,progress:j}=X.useContext(C),M=k(`progress`,n),[N,P,F]=$e(M),I=d===`line`,R=I&&!o,z=X.useMemo(()=>{if(!u)return null;let t=ze(e),n,i=p||(e=>`${e}%`),a=I&&S&&v===`inner`;return v===`inner`||p||D!==`exception`&&D!==`success`?n=i(Q(c),Q(t)):D===`exception`?n=I?X.createElement(L,null):X.createElement(O,null):D===`success`&&(n=I?X.createElement(r,null):X.createElement(y,null)),X.createElement(`span`,{className:(0,Z.default)(`${M}-text`,{[`${M}-text-bright`]:a,[`${M}-text-${_}`]:R,[`${M}-text-${v}`]:R}),title:typeof n==`string`?n:void 0},n)},[u,c,T,D,d,M,p]),B;d===`line`?B=o?X.createElement(it,Object.assign({},e,{strokeColor:x,prefixCls:M,steps:typeof o==`object`?o.count:o}),z):X.createElement(rt,Object.assign({},e,{strokeColor:b,prefixCls:M,direction:A,percentPosition:{align:_,type:v}}),z):(d===`circle`||d===`dashboard`)&&(B=X.createElement(Ge,Object.assign({},e,{strokeColor:b,prefixCls:M,progressStatus:D}),z));let V=(0,Z.default)(M,`${M}-status-${D}`,{[`${M}-${d===`dashboard`&&`circle`||d}`]:d!==`line`,[`${M}-inline-circle`]:d===`circle`&&He(l,`circle`)[0]<=20,[`${M}-line`]:R,[`${M}-line-align-${_}`]:R,[`${M}-line-position-${v}`]:R,[`${M}-steps`]:o,[`${M}-show-info`]:u,[`${M}-${l}`]:typeof l==`string`,[`${M}-rtl`]:A===`rtl`},j?.className,i,a,P,F);return N(X.createElement(`div`,Object.assign({ref:t,style:Object.assign(Object.assign({},j?.style),m),className:V,role:`progressbar`,"aria-valuenow":T,"aria-valuemin":0,"aria-valuemax":100},E(g,[`trailColor`,`strokeWidth`,`width`,`gapDegree`,`gapPosition`,`strokeLinecap`,`success`,`successPercent`])),B))}),ct=[`className`,`prefixCls`,`style`,`active`,`status`,`iconPrefix`,`icon`,`wrapperStyle`,`stepNumber`,`disabled`,`description`,`title`,`subTitle`,`progressDot`,`stepIcon`,`tailContent`,`icons`,`stepIndex`,`onStepClick`,`onClick`,`render`];function lt(e){return typeof e==`string`}function ut(e){var t,n=e.className,r=e.prefixCls,i=e.style,a=e.active,o=e.status,s=e.iconPrefix,c=e.icon;e.wrapperStyle;var l=e.stepNumber,u=e.disabled,d=e.description,f=e.title,p=e.subTitle,h=e.progressDot,_=e.stepIcon,v=e.tailContent,y=e.icons,b=e.stepIndex,x=e.onStepClick,S=e.onClick,C=e.render,w=H(e,ct),T=!!x&&!u,E={};T&&(E.role=`button`,E.tabIndex=0,E.onClick=function(e){S?.(e),x(b)},E.onKeyDown=function(e){var t=e.which;(t===z.ENTER||t===z.SPACE)&&x(b)});var D=function(){var e,t,n=(0,Z.default)(`${r}-icon`,`${s}icon`,(e={},m(e,`${s}icon-${c}`,c&&lt(c)),m(e,`${s}icon-check`,!c&&o===`finish`&&(y&&!y.finish||!y)),m(e,`${s}icon-cross`,!c&&o===`error`&&(y&&!y.error||!y)),e)),i=X.createElement(`span`,{className:`${r}-icon-dot`});return t=h?typeof h==`function`?X.createElement(`span`,{className:`${r}-icon`},h(i,{index:l-1,status:o,title:f,description:d})):X.createElement(`span`,{className:`${r}-icon`},i):c&&!lt(c)?X.createElement(`span`,{className:`${r}-icon`},c):y&&y.finish&&o===`finish`?X.createElement(`span`,{className:`${r}-icon`},y.finish):y&&y.error&&o===`error`?X.createElement(`span`,{className:`${r}-icon`},y.error):c||o===`finish`||o===`error`?X.createElement(`span`,{className:n}):X.createElement(`span`,{className:`${r}-icon`},l),_&&(t=_({index:l-1,status:o,title:f,description:d,node:t})),t},O=o||`wait`,k=(0,Z.default)(`${r}-item`,`${r}-item-${O}`,n,(t={},m(t,`${r}-item-custom`,c),m(t,`${r}-item-active`,a),m(t,`${r}-item-disabled`,u===!0),t)),A=g({},i),j=X.createElement(`div`,M({},w,{className:k,style:A}),X.createElement(`div`,M({onClick:S},E,{className:`${r}-item-container`}),X.createElement(`div`,{className:`${r}-item-tail`},v),X.createElement(`div`,{className:`${r}-item-icon`},D()),X.createElement(`div`,{className:`${r}-item-content`},X.createElement(`div`,{className:`${r}-item-title`},f,p&&X.createElement(`div`,{title:typeof p==`string`?p:void 0,className:`${r}-item-subtitle`},p)),d&&X.createElement(`div`,{className:`${r}-item-description`},d))));return C&&(j=C(j)||null),j}var dt=[`prefixCls`,`style`,`className`,`children`,`direction`,`type`,`labelPlacement`,`iconPrefix`,`status`,`size`,`current`,`progressDot`,`stepIcon`,`initial`,`icons`,`onChange`,`itemRender`,`items`];function ft(e){var t,n=e.prefixCls,r=n===void 0?`rc-steps`:n,i=e.style,a=i===void 0?{}:i,o=e.className;e.children;var s=e.direction,c=s===void 0?`horizontal`:s,l=e.type,u=l===void 0?`default`:l,d=e.labelPlacement,f=d===void 0?`horizontal`:d,p=e.iconPrefix,h=p===void 0?`rc`:p,_=e.status,v=_===void 0?`process`:_,y=e.size,b=e.current,x=b===void 0?0:b,S=e.progressDot,C=S===void 0?!1:S,w=e.stepIcon,T=e.initial,E=T===void 0?0:T,D=e.icons,O=e.onChange,k=e.itemRender,A=e.items,j=A===void 0?[]:A,N=H(e,dt),P=u===`navigation`,F=u===`inline`,I=F||C,L=F?`horizontal`:c,R=F?void 0:y,z=I?`vertical`:f,B=(0,Z.default)(r,`${r}-${L}`,o,(t={},m(t,`${r}-${R}`,R),m(t,`${r}-label-${z}`,L===`horizontal`),m(t,`${r}-dot`,!!I),m(t,`${r}-navigation`,P),m(t,`${r}-inline`,F),t)),V=function(e){O&&x!==e&&O(e)};return X.createElement(`div`,M({className:B,style:a},N),j.filter(function(e){return e}).map(function(e,t){var n=g({},e),i=E+t;return v===`error`&&t===x-1&&(n.className=`${r}-next-error`),n.status||(i===x?n.status=v:i<x?n.status=`finish`:n.status=`wait`),F&&(n.icon=void 0,n.subTitle=void 0),!n.render&&k&&(n.render=function(e){return k(n,e)}),X.createElement(ut,M({},n,{active:i===x,stepNumber:i+1,stepIndex:i,key:i,prefixCls:r,iconPrefix:h,wrapperStyle:a,progressDot:I,stepIcon:w,icons:D,onStepClick:O&&V}))}))}ft.Step=ut;var pt=ft,mt=e=>{let{componentCls:t,customIconTop:n,customIconSize:r,customIconFontSize:i}=e;return{[`${t}-item-custom`]:{[`> ${t}-item-container > ${t}-item-icon`]:{height:`auto`,background:`none`,border:0,[`> ${t}-icon`]:{top:n,width:r,height:r,fontSize:i,lineHeight:l(r)}}},[`&:not(${t}-vertical)`]:{[`${t}-item-custom`]:{[`${t}-item-icon`]:{width:`auto`,background:`none`}}}}},ht=e=>{let{componentCls:t}=e,n=`${t}-item`;return{[`${t}-horizontal`]:{[`${n}-tail`]:{transform:`translateY(-50%)`}}}},gt=e=>{let{componentCls:t,inlineDotSize:n,inlineTitleColor:r,inlineTailColor:i}=e,a=e.calc(e.paddingXS).add(e.lineWidth).equal(),o={[`${t}-item-container ${t}-item-content ${t}-item-title`]:{color:r}};return{[`&${t}-inline`]:{width:`auto`,display:`inline-flex`,[`${t}-item`]:{flex:`none`,"&-container":{padding:`${l(a)} ${l(e.paddingXXS)} 0`,margin:`0 ${l(e.calc(e.marginXXS).div(2).equal())}`,borderRadius:e.borderRadiusSM,cursor:`pointer`,transition:`background-color ${e.motionDurationMid}`,"&:hover":{background:e.controlItemBgHover},"&[role='button']:hover":{opacity:1}},"&-icon":{width:n,height:n,marginInlineStart:`calc(50% - ${l(e.calc(n).div(2).equal())})`,[`> ${t}-icon`]:{top:0},[`${t}-icon-dot`]:{borderRadius:e.calc(e.fontSizeSM).div(4).equal(),"&::after":{display:`none`}}},"&-content":{width:`auto`,marginTop:e.calc(e.marginXS).sub(e.lineWidth).equal()},"&-title":{color:r,fontSize:e.fontSizeSM,lineHeight:e.lineHeightSM,fontWeight:`normal`,marginBottom:e.calc(e.marginXXS).div(2).equal()},"&-description":{display:`none`},"&-tail":{marginInlineStart:0,top:e.calc(n).div(2).add(a).equal(),transform:`translateY(-50%)`,"&:after":{width:`100%`,height:e.lineWidth,borderRadius:0,marginInlineStart:0,background:i}},[`&:first-child ${t}-item-tail`]:{width:`50%`,marginInlineStart:`50%`},[`&:last-child ${t}-item-tail`]:{display:`block`,width:`50%`},"&-wait":Object.assign({[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:e.colorBorderBg,border:`${l(e.lineWidth)} ${e.lineType} ${i}`}},o),"&-finish":Object.assign({[`${t}-item-tail::after`]:{backgroundColor:i},[`${t}-item-icon ${t}-icon ${t}-icon-dot`]:{backgroundColor:i,border:`${l(e.lineWidth)} ${e.lineType} ${i}`}},o),"&-error":o,"&-active, &-process":Object.assign({[`${t}-item-icon`]:{width:n,height:n,marginInlineStart:`calc(50% - ${l(e.calc(n).div(2).equal())})`,top:0}},o),[`&:not(${t}-item-active) > ${t}-item-container[role='button']:hover`]:{[`${t}-item-title`]:{color:r}}}}}},_t=e=>{let{componentCls:t,iconSize:n,lineHeight:r,iconSizeSM:i}=e;return{[`&${t}-label-vertical`]:{[`${t}-item`]:{overflow:`visible`,"&-tail":{marginInlineStart:e.calc(n).div(2).add(e.controlHeightLG).equal(),padding:`0 ${l(e.paddingLG)}`},"&-content":{display:`block`,width:e.calc(n).div(2).add(e.controlHeightLG).mul(2).equal(),marginTop:e.marginSM,textAlign:`center`},"&-icon":{display:`inline-block`,marginInlineStart:e.controlHeightLG},"&-title":{paddingInlineEnd:0,paddingInlineStart:0,"&::after":{display:`none`}},"&-subtitle":{display:`block`,marginBottom:e.marginXXS,marginInlineStart:0,lineHeight:r}},[`&${t}-small:not(${t}-dot)`]:{[`${t}-item`]:{"&-icon":{marginInlineStart:e.calc(n).sub(i).div(2).add(e.controlHeightLG).equal()}}}}}},vt=e=>{let{componentCls:t,navContentMaxWidth:n,navArrowColor:r,stepsNavActiveColor:i,motionDurationSlow:a}=e;return{[`&${t}-navigation`]:{paddingTop:e.paddingSM,[`&${t}-small`]:{[`${t}-item`]:{"&-container":{marginInlineStart:e.calc(e.marginSM).mul(-1).equal()}}},[`${t}-item`]:{overflow:`visible`,textAlign:`center`,"&-container":{display:`inline-block`,height:`100%`,marginInlineStart:e.calc(e.margin).mul(-1).equal(),paddingBottom:e.paddingSM,textAlign:`start`,transition:`opacity ${a}`,[`${t}-item-content`]:{maxWidth:n},[`${t}-item-title`]:Object.assign(Object.assign({maxWidth:`100%`,paddingInlineEnd:0},S),{"&::after":{display:`none`}})},[`&:not(${t}-item-active)`]:{[`${t}-item-container[role='button']`]:{cursor:`pointer`,"&:hover":{opacity:.85}}},"&:last-child":{flex:1,"&::after":{display:`none`}},"&::after":{position:`absolute`,top:`calc(50% - ${l(e.calc(e.paddingSM).div(2).equal())})`,insetInlineStart:`100%`,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${l(e.lineWidth)} ${e.lineType} ${r}`,borderBottom:`none`,borderInlineStart:`none`,borderInlineEnd:`${l(e.lineWidth)} ${e.lineType} ${r}`,transform:`translateY(-50%) translateX(-50%) rotate(45deg)`,content:`""`},"&::before":{position:`absolute`,bottom:0,insetInlineStart:`50%`,display:`inline-block`,width:0,height:e.lineWidthBold,backgroundColor:i,transition:`width ${a}, inset-inline-start ${a}`,transitionTimingFunction:`ease-out`,content:`""`}},[`${t}-item${t}-item-active::before`]:{insetInlineStart:0,width:`100%`}},[`&${t}-navigation${t}-vertical`]:{[`> ${t}-item`]:{marginInlineEnd:0,"&::before":{display:`none`},[`&${t}-item-active::before`]:{top:0,insetInlineEnd:0,insetInlineStart:`unset`,display:`block`,width:e.calc(e.lineWidth).mul(3).equal(),height:`calc(100% - ${l(e.marginLG)})`},"&::after":{position:`relative`,insetInlineStart:`50%`,display:`block`,width:e.calc(e.controlHeight).mul(.25).equal(),height:e.calc(e.controlHeight).mul(.25).equal(),marginBottom:e.marginXS,textAlign:`center`,transform:`translateY(-50%) translateX(-50%) rotate(135deg)`},"&:last-child":{"&::after":{display:`none`}},[`> ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}},[`&${t}-navigation${t}-horizontal`]:{[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{visibility:`hidden`}}}},yt=e=>{let{antCls:t,componentCls:n,iconSize:r,iconSizeSM:i,processIconColor:a,marginXXS:o,lineWidthBold:s,lineWidth:c,paddingXXS:u}=e,d=e.calc(r).add(e.calc(s).mul(4).equal()).equal(),f=e.calc(i).add(e.calc(e.lineWidth).mul(4).equal()).equal();return{[`&${n}-with-progress`]:{[`${n}-item`]:{paddingTop:u,[`&-process ${n}-item-container ${n}-item-icon ${n}-icon`]:{color:a}},[`&${n}-vertical > ${n}-item `]:{paddingInlineStart:u,[`> ${n}-item-container > ${n}-item-tail`]:{top:o,insetInlineStart:e.calc(r).div(2).sub(c).add(u).equal()}},[`&, &${n}-small`]:{[`&${n}-horizontal ${n}-item:first-child`]:{paddingBottom:u,paddingInlineStart:u}},[`&${n}-small${n}-vertical > ${n}-item > ${n}-item-container > ${n}-item-tail`]:{insetInlineStart:e.calc(i).div(2).sub(c).add(u).equal()},[`&${n}-label-vertical ${n}-item ${n}-item-tail`]:{top:e.calc(r).div(2).add(u).equal()},[`${n}-item-icon`]:{position:`relative`,[`${t}-progress`]:{position:`absolute`,insetInlineStart:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,"&-inner":{width:`${l(d)} !important`,height:`${l(d)} !important`}}},[`&${n}-small`]:{[`&${n}-label-vertical ${n}-item ${n}-item-tail`]:{top:e.calc(i).div(2).add(u).equal()},[`${n}-item-icon ${t}-progress-inner`]:{width:`${l(f)} !important`,height:`${l(f)} !important`}}}}},bt=e=>{let{componentCls:t,descriptionMaxWidth:n,lineHeight:r,dotCurrentSize:i,dotSize:a,motionDurationSlow:o}=e;return{[`&${t}-dot, &${t}-dot${t}-small`]:{[`${t}-item`]:{"&-title":{lineHeight:r},"&-tail":{top:e.calc(e.dotSize).sub(e.calc(e.lineWidth).mul(3).equal()).div(2).equal(),width:`100%`,marginTop:0,marginBottom:0,marginInline:`${l(e.calc(n).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${l(e.calc(e.marginSM).mul(2).equal())})`,height:e.calc(e.lineWidth).mul(3).equal(),marginInlineStart:e.marginSM}},"&-icon":{width:a,height:a,marginInlineStart:e.calc(e.descriptionMaxWidth).sub(a).div(2).equal(),paddingInlineEnd:0,lineHeight:l(a),background:`transparent`,border:0,[`${t}-icon-dot`]:{position:`relative`,float:`left`,width:`100%`,height:`100%`,borderRadius:100,transition:`all ${o}`,"&::after":{position:`absolute`,top:e.calc(e.marginSM).mul(-1).equal(),insetInlineStart:e.calc(a).sub(e.calc(e.controlHeightLG).mul(1.5).equal()).div(2).equal(),width:e.calc(e.controlHeightLG).mul(1.5).equal(),height:e.controlHeight,background:`transparent`,content:`""`}}},"&-content":{width:n},[`&-process ${t}-item-icon`]:{position:`relative`,top:e.calc(a).sub(i).div(2).equal(),width:i,height:i,lineHeight:l(i),background:`none`,marginInlineStart:e.calc(e.descriptionMaxWidth).sub(i).div(2).equal()},[`&-process ${t}-icon`]:{[`&:first-child ${t}-icon-dot`]:{insetInlineStart:0}}}},[`&${t}-vertical${t}-dot`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(a).div(2).equal(),marginInlineStart:0,background:`none`},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeight).sub(i).div(2).equal(),top:0,insetInlineStart:e.calc(a).sub(i).div(2).equal(),marginInlineStart:0},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeight).sub(a).div(2).equal(),insetInlineStart:0,margin:0,padding:`${l(e.calc(a).add(e.paddingXS).equal())} 0 ${l(e.paddingXS)}`,"&::after":{marginInlineStart:e.calc(a).sub(e.lineWidth).div(2).equal()}},[`&${t}-small`]:{[`${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(a).div(2).equal()},[`${t}-item-process ${t}-item-icon`]:{marginTop:e.calc(e.controlHeightSM).sub(i).div(2).equal()},[`${t}-item > ${t}-item-container > ${t}-item-tail`]:{top:e.calc(e.controlHeightSM).sub(a).div(2).equal()}},[`${t}-item:first-child ${t}-icon-dot`]:{insetInlineStart:0},[`${t}-item-content`]:{width:`inherit`}}}},xt=e=>{let{componentCls:t}=e;return{[`&${t}-rtl`]:{direction:`rtl`,[`${t}-item`]:{"&-subtitle":{float:`left`}},[`&${t}-navigation`]:{[`${t}-item::after`]:{transform:`rotate(-45deg)`}},[`&${t}-vertical`]:{[`> ${t}-item`]:{"&::after":{transform:`rotate(225deg)`},[`${t}-item-icon`]:{float:`right`}}},[`&${t}-dot`]:{[`${t}-item-icon ${t}-icon-dot, &${t}-small ${t}-item-icon ${t}-icon-dot`]:{float:`right`}}}}},St=e=>{let{componentCls:t,iconSizeSM:n,fontSizeSM:r,fontSize:i,colorTextDescription:a}=e;return{[`&${t}-small`]:{[`&${t}-horizontal:not(${t}-label-vertical) ${t}-item`]:{paddingInlineStart:e.paddingSM,"&:first-child":{paddingInlineStart:0}},[`${t}-item-icon`]:{width:n,height:n,marginTop:0,marginBottom:0,marginInline:`0 ${l(e.marginXS)}`,fontSize:r,lineHeight:l(n),textAlign:`center`,borderRadius:n},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:i,lineHeight:l(n),"&::after":{top:e.calc(n).div(2).equal()}},[`${t}-item-description`]:{color:a,fontSize:i},[`${t}-item-tail`]:{top:e.calc(n).div(2).sub(e.paddingXXS).equal()},[`${t}-item-custom ${t}-item-icon`]:{width:`inherit`,height:`inherit`,lineHeight:`inherit`,background:`none`,border:0,borderRadius:0,[`> ${t}-icon`]:{fontSize:n,lineHeight:l(n),transform:`none`}}}}},Ct=e=>{let{componentCls:t,iconSizeSM:n,iconSize:r}=e;return{[`&${t}-vertical`]:{display:`flex`,flexDirection:`column`,[`> ${t}-item`]:{display:`block`,flex:`1 0 auto`,paddingInlineStart:0,overflow:`visible`,[`${t}-item-icon`]:{float:`left`,marginInlineEnd:e.margin},[`${t}-item-content`]:{display:`block`,minHeight:e.calc(e.controlHeight).mul(1.5).equal(),overflow:`hidden`},[`${t}-item-title`]:{lineHeight:l(r)},[`${t}-item-description`]:{paddingBottom:e.paddingSM}},[`> ${t}-item > ${t}-item-container > ${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.calc(r).div(2).sub(e.lineWidth).equal(),width:e.lineWidth,height:`100%`,padding:`${l(e.calc(e.marginXXS).mul(1.5).add(r).equal())} 0 ${l(e.calc(e.marginXXS).mul(1.5).equal())}`,"&::after":{width:e.lineWidth,height:`100%`}},[`> ${t}-item:not(:last-child) > ${t}-item-container > ${t}-item-tail`]:{display:`block`},[` > ${t}-item > ${t}-item-container > ${t}-item-content > ${t}-item-title`]:{"&::after":{display:`none`}},[`&${t}-small ${t}-item-container`]:{[`${t}-item-tail`]:{position:`absolute`,top:0,insetInlineStart:e.calc(n).div(2).sub(e.lineWidth).equal(),padding:`${l(e.calc(e.marginXXS).mul(1.5).add(n).equal())} 0 ${l(e.calc(e.marginXXS).mul(1.5).equal())}`},[`${t}-item-title`]:{lineHeight:l(n)}}}}},wt=`wait`,Tt=`process`,Et=`finish`,Dt=`error`,Ot=(e,t)=>{let n=`${t.componentCls}-item`,r=`${e}IconColor`,i=`${e}TitleColor`,a=`${e}DescriptionColor`,o=`${e}TailColor`,s=`${e}IconBgColor`,c=`${e}IconBorderColor`,l=`${e}DotColor`;return{[`${n}-${e} ${n}-icon`]:{backgroundColor:t[s],borderColor:t[c],[`> ${t.componentCls}-icon`]:{color:t[r],[`${t.componentCls}-icon-dot`]:{background:t[l]}}},[`${n}-${e}${n}-custom ${n}-icon`]:{[`> ${t.componentCls}-icon`]:{color:t[l]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-title`]:{color:t[i],"&::after":{backgroundColor:t[o]}},[`${n}-${e} > ${n}-container > ${n}-content > ${n}-description`]:{color:t[a]},[`${n}-${e} > ${n}-container > ${n}-tail::after`]:{backgroundColor:t[o]}}},kt=e=>{let{componentCls:t,motionDurationSlow:n}=e,r=`${t}-item`,i=`${r}-icon`;return Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({[r]:{position:`relative`,display:`inline-block`,flex:1,overflow:`hidden`,verticalAlign:`top`,"&:last-child":{flex:`none`,[`> ${r}-container > ${r}-tail, > ${r}-container > ${r}-content > ${r}-title::after`]:{display:`none`}}},[`${r}-container`]:{outline:`none`,[`&:focus-visible ${i}`]:p(e)},[`${i}, ${r}-content`]:{display:`inline-block`,verticalAlign:`top`},[i]:{width:e.iconSize,height:e.iconSize,marginTop:0,marginBottom:0,marginInlineStart:0,marginInlineEnd:e.marginXS,fontSize:e.iconFontSize,fontFamily:e.fontFamily,lineHeight:l(e.iconSize),textAlign:`center`,borderRadius:e.iconSize,border:`${l(e.lineWidth)} ${e.lineType} transparent`,transition:`background-color ${n}, border-color ${n}`,[`${t}-icon`]:{position:`relative`,top:e.iconTop,color:e.colorPrimary,lineHeight:1}},[`${r}-tail`]:{position:`absolute`,top:e.calc(e.iconSize).div(2).equal(),insetInlineStart:0,width:`100%`,"&::after":{display:`inline-block`,width:`100%`,height:e.lineWidth,background:e.colorSplit,borderRadius:e.lineWidth,transition:`background ${n}`,content:`""`}},[`${r}-title`]:{position:`relative`,display:`inline-block`,paddingInlineEnd:e.padding,color:e.colorText,fontSize:e.fontSizeLG,lineHeight:l(e.titleLineHeight),"&::after":{position:`absolute`,top:e.calc(e.titleLineHeight).div(2).equal(),insetInlineStart:`100%`,display:`block`,width:9999,height:e.lineWidth,background:e.processTailColor,content:`""`}},[`${r}-subtitle`]:{display:`inline`,marginInlineStart:e.marginXS,color:e.colorTextDescription,fontWeight:`normal`,fontSize:e.fontSize},[`${r}-description`]:{color:e.colorTextDescription,fontSize:e.fontSize}},Ot(wt,e)),Ot(Tt,e)),{[`${r}-process > ${r}-container > ${r}-title`]:{fontWeight:e.fontWeightStrong}}),Ot(Et,e)),Ot(Dt,e)),{[`${r}${t}-next-error > ${t}-item-title::after`]:{background:e.colorError},[`${r}-disabled`]:{cursor:`not-allowed`}})},At=e=>{let{componentCls:t,motionDurationSlow:n}=e;return{[`& ${t}-item`]:{[`&:not(${t}-item-active)`]:{[`& > ${t}-item-container[role='button']`]:{cursor:`pointer`,[`${t}-item`]:{[`&-title, &-subtitle, &-description, &-icon ${t}-icon`]:{transition:`color ${n}`}},"&:hover":{[`${t}-item`]:{"&-title, &-subtitle, &-description":{color:e.colorPrimary}}}},[`&:not(${t}-item-process)`]:{[`& > ${t}-item-container[role='button']:hover`]:{[`${t}-item`]:{"&-icon":{borderColor:e.colorPrimary,[`${t}-icon`]:{color:e.colorPrimary}}}}}}},[`&${t}-horizontal:not(${t}-label-vertical)`]:{[`${t}-item`]:{paddingInlineStart:e.padding,whiteSpace:`nowrap`,"&:first-child":{paddingInlineStart:0},[`&:last-child ${t}-item-title`]:{paddingInlineEnd:0},"&-tail":{display:`none`},"&-description":{maxWidth:e.descriptionMaxWidth,whiteSpace:`normal`}}}}},jt=e=>{let{componentCls:t}=e;return{[t]:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},h(e)),{display:`flex`,width:`100%`,fontSize:0,textAlign:`initial`}),kt(e)),At(e)),mt(e)),St(e)),Ct(e)),ht(e)),_t(e)),bt(e)),vt(e)),xt(e)),yt(e)),gt(e))}},Mt=D(`Steps`,e=>{let{colorTextDisabled:t,controlHeightLG:n,colorTextLightSolid:r,colorText:i,colorPrimary:a,colorTextDescription:o,colorTextQuaternary:s,colorError:c,colorBorderSecondary:l,colorSplit:u}=e;return jt(j(e,{processIconColor:r,processTitleColor:i,processDescriptionColor:i,processIconBgColor:a,processIconBorderColor:a,processDotColor:a,processTailColor:u,waitTitleColor:o,waitDescriptionColor:o,waitTailColor:u,waitDotColor:t,finishIconColor:a,finishTitleColor:i,finishDescriptionColor:o,finishTailColor:a,finishDotColor:a,errorIconColor:r,errorTitleColor:c,errorDescriptionColor:c,errorTailColor:u,errorIconBgColor:c,errorIconBorderColor:c,errorDotColor:c,stepsNavActiveColor:a,stepsProgressSize:n,inlineDotSize:6,inlineTitleColor:s,inlineTailColor:l}))},e=>({titleLineHeight:e.controlHeight,customIconSize:e.controlHeight,customIconTop:0,customIconFontSize:e.controlHeightSM,iconSize:e.controlHeight,iconTop:-.5,iconFontSize:e.fontSize,iconSizeSM:e.fontSizeHeading3,dotSize:e.controlHeight/4,dotCurrentSize:e.controlHeightLG/4,navArrowColor:e.colorTextDisabled,navContentMaxWidth:`unset`,descriptionMaxWidth:140,waitIconColor:e.wireframe?e.colorTextDisabled:e.colorTextLabel,waitIconBgColor:e.wireframe?e.colorBgContainer:e.colorFillContent,waitIconBorderColor:e.wireframe?e.colorTextDisabled:`transparent`,finishIconBgColor:e.wireframe?e.colorBgContainer:e.controlItemBgActive,finishIconBorderColor:e.wireframe?e.colorPrimary:e.controlItemBgActive}));function Nt(e){return e.filter(e=>e)}function Pt(e,t){return e||Nt(P(t).map(e=>{if(X.isValidElement(e)){let{props:t}=e;return Object.assign({},t)}return null}))}var Ft=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n},It=e=>{let{percent:t,size:n,className:r,rootClassName:i,direction:a,items:o,responsive:s=!0,current:c=0,children:l,style:u}=e,f=Ft(e,[`percent`,`size`,`className`,`rootClassName`,`direction`,`items`,`responsive`,`current`,`children`,`style`]),{xs:p}=d(s),{getPrefixCls:m,direction:h,className:g,style:_}=U(`steps`),x=X.useMemo(()=>s&&p?`vertical`:a,[s,p,a]),S=v(n),C=m(`steps`,e.prefixCls),[w,T,E]=Mt(C),D=e.type===`inline`,k=m(``,e.iconPrefix),A=Pt(o,l),j=D?void 0:t,M=Object.assign(Object.assign({},_),u),N=(0,Z.default)(g,{[`${C}-rtl`]:h===`rtl`,[`${C}-with-progress`]:j!==void 0},r,i,T,E),P={finish:X.createElement(y,{className:`${C}-finish-icon`}),error:X.createElement(O,{className:`${C}-error-icon`})};return w(X.createElement(pt,Object.assign({icons:P},f,{style:M,current:c,size:S,items:A,itemRender:D?(e,t)=>e.description?X.createElement(b,{title:e.description},t):t:void 0,stepIcon:({node:e,status:t})=>{if(t===`process`&&j!==void 0){let t=S===`small`?32:40;return X.createElement(`div`,{className:`${C}-progress-icon`},X.createElement(st,{type:`circle`,percent:j,size:t,strokeWidth:4,format:()=>null}),e)}return e},direction:x,prefixCls:C,iconPrefix:k,className:N})))};It.Step=pt.Step;var Lt=e(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:`M912 190h-69.9c-9.8 0-19.1 4.5-25.1 12.2L404.7 724.5 207 474a32 32 0 00-25.1-12.2H112c-6.7 0-10.4 7.7-6.3 12.9l273.9 347c12.8 16.2 37.4 16.2 50.3 0l488.4-618.9c4.1-5.1.4-12.8-6.3-12.8z`}}]},name:`check`,theme:`outlined`}}))());function Rt(){return Rt=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},Rt.apply(this,arguments)}var zt=X.forwardRef((e,t)=>X.createElement(c,Rt({},e,{ref:t,icon:Lt.default}))),Bt=e(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:`M811.4 418.7C765.6 297.9 648.9 212 512.2 212S258.8 297.8 213 418.6C127.3 441.1 64 519.1 64 612c0 110.5 89.5 200 199.9 200h496.2C870.5 812 960 722.5 960 612c0-92.7-63.1-170.7-148.6-193.3zm36.3 281a123.07 123.07 0 01-87.6 36.3H263.9c-33.1 0-64.2-12.9-87.6-36.3A123.3 123.3 0 01140 612c0-28 9.1-54.3 26.2-76.3a125.7 125.7 0 0166.1-43.7l37.9-9.9 13.9-36.6c8.6-22.8 20.6-44.1 35.7-63.4a245.6 245.6 0 0152.4-49.9c41.1-28.9 89.5-44.2 140-44.2s98.9 15.3 140 44.2c19.9 14 37.5 30.8 52.4 49.9 15.1 19.3 27.1 40.7 35.7 63.4l13.8 36.5 37.8 10c54.3 14.5 92.1 63.8 92.1 120 0 33.1-12.9 64.3-36.3 87.7z`}}]},name:`cloud`,theme:`outlined`}}))());function Vt(){return Vt=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},Vt.apply(this,arguments)}var Ht=X.forwardRef((e,t)=>X.createElement(c,Vt({},e,{ref:t,icon:Bt.default}))),Ut=e(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:`M516 673c0 4.4 3.4 8 7.5 8h185c4.1 0 7.5-3.6 7.5-8v-48c0-4.4-3.4-8-7.5-8h-185c-4.1 0-7.5 3.6-7.5 8v48zm-194.9 6.1l192-161c3.8-3.2 3.8-9.1 0-12.3l-192-160.9A7.95 7.95 0 00308 351v62.7c0 2.4 1 4.6 2.9 6.1L420.7 512l-109.8 92.2a8.1 8.1 0 00-2.9 6.1V673c0 6.8 7.9 10.5 13.1 6.1zM880 112H144c-17.7 0-32 14.3-32 32v736c0 17.7 14.3 32 32 32h736c17.7 0 32-14.3 32-32V144c0-17.7-14.3-32-32-32zm-40 728H184V184h656v656z`}}]},name:`code`,theme:`outlined`}}))());function Wt(){return Wt=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},Wt.apply(this,arguments)}var Gt=X.forwardRef((e,t)=>X.createElement(c,Wt({},e,{ref:t,icon:Ut.default}))),Kt=e(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:`M942.2 486.2C847.4 286.5 704.1 186 512 186c-192.2 0-335.4 100.5-430.2 300.3a60.3 60.3 0 000 51.5C176.6 737.5 319.9 838 512 838c192.2 0 335.4-100.5 430.2-300.3 7.7-16.2 7.7-35 0-51.5zM512 766c-161.3 0-279.4-81.8-362.7-254C232.6 339.8 350.7 258 512 258c161.3 0 279.4 81.8 362.7 254C791.5 684.2 673.4 766 512 766zm-4-430c-97.2 0-176 78.8-176 176s78.8 176 176 176 176-78.8 176-176-78.8-176-176-176zm0 288c-61.9 0-112-50.1-112-112s50.1-112 112-112 112 50.1 112 112-50.1 112-112 112z`}}]},name:`eye`,theme:`outlined`}}))());function qt(){return qt=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},qt.apply(this,arguments)}var Jt=X.forwardRef((e,t)=>X.createElement(c,qt({},e,{ref:t,icon:Kt.default}))),$=V();function Yt({open:e,loading:t,config:n,dnsCredentials:r,smtpRelays:o,onClose:s,onSubmit:c}){let{locale:l}=i(),u=l.startsWith(`en`)?tn:en,[d]=J.useForm(),[f,p]=(0,X.useState)(0),m=J.useWatch([],d),h=J.useWatch(`dnsMode`,d),g=(0,X.useMemo)(()=>[u.domainAndPurpose,u.dnsAndDelivery,u.reviewAndCreate],[u]);(0,X.useEffect)(()=>{e&&(d.resetFields(),d.setFieldsValue({purpose:`sending`,dnsMode:r.length?`automatic`:`manual`,dnsCredentialId:r[0]?.id,smtpRelayId:void 0,senderHost:n?.mailHostname||``,sendingIp:n?.sendingIp||``,selector:Zt(),dmarcPolicy:n?.dmarcPolicy||`none`,spfExtra:n?.defaultSpfMechanisms||``,immediateCheck:!0}),p(0))},[n,r,d,e]);async function v(){try{await d.validateFields(Xt(f))}catch{return}if(f===1&&h===`automatic`&&!d.getFieldValue(`dnsCredentialId`)){d.setFields([{name:`dnsCredentialId`,errors:[u.selectDnsCredential]}]);return}p(e=>Math.min(e+1,g.length-1))}async function y(){let e;try{e=await d.validateFields()}catch{return}let t={domain:e.domain.trim().toLowerCase(),senderHost:e.senderHost?.trim(),sendingIp:e.sendingIp?.trim(),dnsCredentialId:e.dnsMode===`automatic`?e.dnsCredentialId:void 0,smtpRelayId:e.smtpRelayId||null,selector:e.selector?.trim(),dmarcPolicy:e.dmarcPolicy,spfExtra:e.spfExtra?.trim(),immediateCheck:e.immediateCheck};try{await c(t)}catch{return}d.resetFields(),p(0)}return(0,$.jsx)(ge,{title:u.title,width:`min(640px, 100vw)`,open:e,onClose:s,destroyOnHidden:!0,maskClosable:!t,className:`add-domain-drawer`,styles:{header:{padding:`16px 24px`},body:{padding:`20px 24px 28px`},footer:{padding:`12px 24px`}},footer:(0,$.jsxs)(`div`,{className:`drawer-footer`,children:[(0,$.jsx)(F,{style:{minHeight:44},disabled:t,onClick:s,children:u.cancel}),(0,$.jsxs)(k,{size:8,children:[(0,$.jsx)(F,{style:{minHeight:44},disabled:f===0||t,onClick:()=>p(e=>e-1),children:u.previous}),f<g.length-1?(0,$.jsx)(F,{type:`primary`,style:{minHeight:44},onClick:()=>void v(),children:u.next}):(0,$.jsx)(F,{type:`primary`,style:{minHeight:44},icon:(0,$.jsx)(zt,{}),loading:t,onClick:()=>void y(),children:u.createAndVerify})]})]}),children:(0,$.jsxs)(k,{direction:`vertical`,size:24,className:`full-width`,children:[(0,$.jsx)(It,{current:f,items:g.map(e=>({title:e})),responsive:!0,"aria-label":u.progress}),(0,$.jsxs)(J,{form:d,layout:`vertical`,requiredMark:`optional`,preserve:!0,children:[(0,$.jsxs)(`section`,{hidden:f!==0,"aria-label":u.domainAndPurpose,children:[(0,$.jsx)(J.Item,{name:`domain`,label:u.domain,rules:[{required:!0,message:u.domainRequired},{pattern:/^(?!-)(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:u.domainInvalid}],extra:u.domainHint,children:(0,$.jsx)(Y,{placeholder:`example.com`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`purpose`,label:u.purpose,rules:[{required:!0}],children:(0,$.jsx)(G.Group,{style:{width:`100%`},children:(0,$.jsxs)(k,{direction:`vertical`,size:12,className:`full-width`,children:[(0,$.jsx)(G,{value:`sending`,children:(0,$.jsxs)(k,{children:[(0,$.jsx)(he,{}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(I.Text,{strong:!0,children:u.sendingOnly}),(0,$.jsx)(`br`,{}),(0,$.jsx)(I.Text,{type:`secondary`,children:u.sendingOnlyHint})]})]})}),(0,$.jsx)(G,{value:`sending-receiving`,children:(0,$.jsxs)(k,{children:[(0,$.jsx)(a,{}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(I.Text,{strong:!0,children:u.sendAndReceive}),(0,$.jsx)(`br`,{}),(0,$.jsx)(I.Text,{type:`secondary`,children:u.sendAndReceiveHint})]})]})})]})})}),m?.purpose===`sending-receiving`?(0,$.jsx)(W,{type:`info`,showIcon:!0,message:u.receiveFollowUp}):null]}),(0,$.jsxs)(`section`,{hidden:f!==1,"aria-label":u.dnsAndDelivery,children:[(0,$.jsx)(J.Item,{name:`dnsMode`,label:u.dnsConfiguration,rules:[{required:!0}],children:(0,$.jsxs)(G.Group,{optionType:`button`,buttonStyle:`solid`,style:{minHeight:44},children:[(0,$.jsxs)(G.Button,{value:`automatic`,disabled:!r.length,children:[(0,$.jsx)(Ht,{}),` `,u.automatic]}),(0,$.jsxs)(G.Button,{value:`manual`,children:[(0,$.jsx)(Gt,{}),` `,u.manual]})]})}),h===`automatic`?(0,$.jsx)(J.Item,{name:`dnsCredentialId`,label:u.dnsCredential,rules:[{required:!0,message:u.selectDnsCredential}],extra:u.autoDnsHint,children:(0,$.jsx)(_,{placeholder:u.selectDnsCredential,style:{minHeight:44},options:r.map(e=>({value:e.id,label:`${e.name} · ${Qt(e.provider)}`}))})}):(0,$.jsx)(W,{type:`info`,showIcon:!0,message:u.manualDnsTitle,description:u.manualDnsHint}),(0,$.jsx)(J.Item,{name:`smtpRelayId`,label:u.relay,extra:u.relayHint,style:{marginTop:20},children:(0,$.jsx)(_,{allowClear:!0,placeholder:u.defaultDelivery,style:{minHeight:44},options:o.map(e=>({value:e.id,label:$t(e,u.defaultLabel)}))})}),(0,$.jsx)(N,{ghost:!0,items:[{key:`advanced`,label:u.advanced,forceRender:!0,children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J.Item,{name:`senderHost`,label:u.senderHost,rules:[{required:!0,message:u.senderHostRequired}],children:(0,$.jsx)(Y,{placeholder:`mail.example.com`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`sendingIp`,label:u.sendingIp,rules:[{required:!0,message:u.sendingIpRequired}],children:(0,$.jsx)(Y,{placeholder:`203.0.113.10`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`selector`,label:`DKIM selector`,rules:[{required:!0,message:u.selectorRequired}],children:(0,$.jsx)(Y,{placeholder:`mh202607`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`dmarcPolicy`,label:`DMARC`,children:(0,$.jsx)(_,{style:{minHeight:44},options:[`none`,`quarantine`,`reject`].map(e=>({value:e,label:e}))})}),(0,$.jsx)(J.Item,{name:`spfExtra`,label:u.spfExtra,children:(0,$.jsx)(Y.TextArea,{rows:3,placeholder:`include:spf.example.com`})})]})}]})]}),(0,$.jsxs)(`section`,{hidden:f!==2,"aria-label":u.reviewAndCreate,children:[(0,$.jsx)(W,{type:`info`,showIcon:!0,message:u.reviewHint,style:{marginBottom:20}}),(0,$.jsxs)(q,{bordered:!0,size:`small`,column:1,children:[(0,$.jsx)(q.Item,{label:u.domain,children:m?.domain||`-`}),(0,$.jsx)(q.Item,{label:u.purpose,children:m?.purpose===`sending-receiving`?u.sendAndReceive:u.sendingOnly}),(0,$.jsx)(q.Item,{label:u.dnsConfiguration,children:(0,$.jsx)(K,{tone:m?.dnsMode===`automatic`?`info`:`neutral`,children:m?.dnsMode===`automatic`?u.automatic:u.manual})}),(0,$.jsx)(q.Item,{label:u.dnsCredential,children:m?.dnsMode===`automatic`?r.find(e=>e.id===m?.dnsCredentialId)?.name||`-`:u.notApplicable}),(0,$.jsx)(q.Item,{label:u.relay,children:o.find(e=>e.id===m?.smtpRelayId)?.name||u.defaultDelivery}),(0,$.jsx)(q.Item,{label:`DKIM selector`,children:m?.selector||`-`}),(0,$.jsx)(q.Item,{label:`DMARC`,children:m?.dmarcPolicy||`none`})]}),(0,$.jsx)(J.Item,{name:`immediateCheck`,valuePropName:`checked`,style:{marginTop:20},children:(0,$.jsx)(ne,{children:u.verifyImmediately})})]})]})]})})}function Xt(e){return e===0?[`domain`,`purpose`]:e===1?[`dnsMode`,`dnsCredentialId`,`smtpRelayId`,`senderHost`,`sendingIp`,`selector`,`dmarcPolicy`,`spfExtra`]:[]}function Zt(){let e=new Date;return`mh${e.getUTCFullYear()}${String(e.getUTCMonth()+1).padStart(2,`0`)}`}function Qt(e){return{cloudflare:`Cloudflare`,aliyun:`Aliyun DNS`,dnspod:`Tencent DNSPod`}[e]||e}function $t(e,t){return`${e.name}${e.isDefault?` · ${t}`:``} · ${e.host}:${e.port}`}var en={title:`添加发信域名`,progress:`添加域名进度`,domainAndPurpose:`域名与用途`,dnsAndDelivery:`DNS 与投递`,reviewAndCreate:`检查并创建`,cancel:`取消`,previous:`上一步`,next:`下一步`,createAndVerify:`创建并验证`,domain:`域名`,domainRequired:`请输入域名`,domainInvalid:`请输入有效的根域名`,domainHint:`请输入用于发件地址的根域名,例如 example.com。`,purpose:`用途`,sendingOnly:`仅发送邮件`,sendingOnlyHint:`配置 SPF、DKIM、DMARC 和发信主机。`,sendAndReceive:`发送并接收邮件`,sendAndReceiveHint:`创建后继续配置邮箱与收信路由。`,receiveFollowUp:`域名创建后,可在“收信配置”页签中创建邮箱和路由。`,dnsConfiguration:`DNS 配置方式`,automatic:`自动配置`,manual:`手动配置`,dnsCredential:`DNS 凭据`,selectDnsCredential:`请选择 DNS 凭据`,autoDnsHint:`创建后将使用该凭据写入所需记录;你仍可先检查摘要。`,manualDnsTitle:`手动配置 DNS`,manualDnsHint:`创建后会展示每条记录的主机名、类型和值,便于复制到当前 DNS 服务商。`,relay:`发送中继`,relayHint:`留空时按系统默认解析顺序投递。`,defaultDelivery:`使用系统默认投递`,defaultLabel:`默认`,advanced:`高级选项`,senderHost:`发信主机`,senderHostRequired:`请输入发信主机`,sendingIp:`发信 IP`,sendingIpRequired:`请输入发信 IP`,selectorRequired:`请输入 DKIM selector`,spfExtra:`SPF 扩展机制`,reviewHint:`创建操作不会隐藏任何现有能力;DNS 自动写入和验证结果可在域名详情中继续处理。`,notApplicable:`不适用`,verifyImmediately:`创建后立即检查 DNS 生效状态`},tn={title:`Add sending domain`,progress:`Add domain progress`,domainAndPurpose:`Domain and purpose`,dnsAndDelivery:`DNS and delivery`,reviewAndCreate:`Review and create`,cancel:`Cancel`,previous:`Previous`,next:`Next`,createAndVerify:`Create and verify`,domain:`Domain`,domainRequired:`Enter a domain`,domainInvalid:`Enter a valid root domain`,domainHint:`Use the root domain for your From addresses, for example example.com.`,purpose:`Purpose`,sendingOnly:`Send email`,sendingOnlyHint:`Configure SPF, DKIM, DMARC, and the sending host.`,sendAndReceive:`Send and receive email`,sendAndReceiveHint:`Continue with mailbox and inbound routing after creation.`,receiveFollowUp:`After creation, configure mailboxes and routes from the Receiving tab.`,dnsConfiguration:`DNS configuration`,automatic:`Automatic`,manual:`Manual`,dnsCredential:`DNS credential`,selectDnsCredential:`Select a DNS credential`,autoDnsHint:`The credential can apply required records after creation; review them first if needed.`,manualDnsTitle:`Manual DNS configuration`,manualDnsHint:`The domain details will show each host, type, and value to copy into your DNS provider.`,relay:`Sending relay`,relayHint:`Leave empty to use the system delivery resolution order.`,defaultDelivery:`Use system delivery`,defaultLabel:`Default`,advanced:`Advanced options`,senderHost:`Sending host`,senderHostRequired:`Enter a sending host`,sendingIp:`Sending IP`,sendingIpRequired:`Enter a sending IP`,selectorRequired:`Enter a DKIM selector`,spfExtra:`Additional SPF mechanisms`,reviewHint:`Creation keeps all existing capabilities available. Continue DNS application and verification from domain details.`,notApplicable:`Not applicable`,verifyImmediately:`Check DNS status immediately after creation`},nn=1,rn=20;async function an(e,t){let n=await t.createDomain(e),r=Number(e.dnsCredentialId||0)>0?`apply`:e.immediateCheck?`check`:`none`;if(r===`none`)return{domain:n.domain,setup:`complete`,followUp:r};try{if(r===`apply`){let e=await t.applyDns(n.domain.id),i=e.apply||e.domain.status?.apply;return i?.ok===!1?{domain:e.domain,setup:`partial`,followUp:r,error:fn(i)}:{domain:e.domain,setup:`complete`,followUp:r}}return{domain:(await t.checkDomain(n.domain.id)).domain,setup:`complete`,followUp:r}}catch(e){return{domain:n.domain,setup:`partial`,followUp:r,error:e instanceof Error?e.message:void 0}}}function on(e){let t=pn(e.get(`pageSize`),rn);return{page:pn(e.get(`page`),nn),pageSize:[10,20,50,100].includes(t)?t:rn}}function sn(e,t,n){let r=(t-1)*n;return e.slice(r,r+n)}function cn(){let{config:e}=ye(),{locale:t}=i(),n=t.startsWith(`en`)?gn:hn,r=be(),[a,c]=ve(),l=te.useBreakpoint(),{message:u}=o.useApp(),[d,f]=(0,X.useState)(null),[p,m]=(0,X.useState)(!0),[h,g]=(0,X.useState)(``),[v,y]=(0,X.useState)(null),[x,S]=(0,X.useState)(``),[C,w]=(0,X.useState)(null),[T,E]=(0,X.useState)({}),[D]=J.useForm(),O=a.get(`q`)||``,A=a.get(`status`)||void 0,j=a.get(`create`)===`1`,{page:M,pageSize:N}=on(a),P=(0,X.useCallback)(async()=>{m(!0),g(``);try{let[e,t,n,r]=await Promise.all([s.domains(),s.dnsCredentials(),s.smtpRelays(),s.events({page:1,pageSize:100})]);f({domains:e.domains,dnsCredentials:t.credentials,smtpRelays:n.relays,events:r.events})}catch(e){g(e instanceof Error?e.message:n.loadFailed)}finally{m(!1)}},[n.loadFailed]);(0,X.useEffect)(()=>{P()},[P]);let L=(0,X.useMemo)(()=>{if(!d)return[];let e=O.trim().toLowerCase();return d.domains.filter(t=>{let n=Te(t);return(!e||t.domain.toLowerCase().includes(e)||t.senderHost.toLowerCase().includes(e))&&(!A||n.status===A)})},[d,O,A]),R=(0,X.useMemo)(()=>sn(L,M,N),[L,M,N]);(0,X.useEffect)(()=>{if(!d)return;let e=Math.max(nn,Math.ceil(L.length/N)),t=Math.min(M,e);if(a.get(`page`)===String(t)&&a.get(`pageSize`)===String(N))return;let n=new URLSearchParams(a);n.set(`page`,String(t)),n.set(`pageSize`,String(N)),c(n,{replace:!0})},[d,L.length,M,N,a,c]);let z=(0,X.useMemo)(()=>new Map(d?.dnsCredentials.map(e=>[e.id,e.name])||[]),[d?.dnsCredentials]),V=(0,X.useMemo)(()=>{let e=new Map;for(let t of d?.events||[])t.domain&&!e.has(t.domain)&&e.set(t.domain,t);return e},[d?.events]);function H(e,t){let n=new URLSearchParams(a);t?n.set(e,t):n.delete(e),n.set(`page`,String(nn)),c(n,{replace:e===`q`})}function U(e){let t=new URLSearchParams(a);e?t.set(`create`,`1`):t.delete(`create`),c(t,{replace:!e})}function ee(e,t){let n=new URLSearchParams(a);n.set(`page`,String(t===N?e:nn)),n.set(`pageSize`,String(t)),c(n)}async function W(e,t,n){let r=`${e.id}:${t}`;E(e=>({...e,[r]:!0}));try{return await n()}finally{E(e=>({...e,[r]:!1}))}}async function ne(e){let t=`new:create`;E(e=>({...e,[t]:!0}));try{let t=await an(e,s);f(e=>e&&{...e,domains:[t.domain,...e.domains]}),U(!1),t.setup===`partial`?u.warning(t.error?`${n.createdPartial}:${t.error}`:n.createdPartial):u.success(n.created),r(`/domains/${t.domain.id}/dns?setup=${t.setup}`)}catch(e){throw u.error(e instanceof Error?e.message:n.createFailed),e}finally{E(e=>({...e,[t]:!1}))}}async function G(e){try{we((await W(e,`check`,()=>s.checkDomain(e.id))).domain),u.success(n.checked)}catch(e){u.error(e instanceof Error?e.message:n.actionFailed)}}async function q(e){try{let t=await W(e,`dns`,()=>s.applyDns(e.id));we(t.domain),t.apply?.ok===!1?u.warning(n.dnsPartiallyApplied):u.success(n.dnsApplied)}catch(e){u.error(e instanceof Error?e.message:n.actionFailed)}}async function ge(){if(!(!v||x!==v.domain))try{await W(v,`delete`,()=>s.deleteDomain(v.id)),f(e=>e&&{...e,domains:e.domains.filter(e=>e.id!==v.id)}),y(null),S(``),u.success(n.deleted)}catch(e){u.error(e instanceof Error?e.message:n.actionFailed)}}async function _e(){if(!C)return;let e;try{e=await D.validateFields()}catch{return}try{await W(C,`test`,()=>s.sendTest(C.id,e)),w(null),D.resetFields(),u.success(n.testQueued)}catch(e){u.error(e instanceof Error?e.message:n.actionFailed)}}function we(e){f(t=>t&&{...t,domains:t.domains.map(t=>t.id===e.id?e:t)})}function Ee(e){w(e),D.setFieldsValue({to:``,subject:n.testSubject(e.domain),text:n.testBody(e.domain)})}function De(e){return[{key:`check`,icon:(0,$.jsx)(fe,{}),label:n.checkDns,onClick:()=>void G(e)},{key:`apply`,icon:(0,$.jsx)(me,{}),label:n.autoDns,disabled:!e.dnsCredentialId,onClick:()=>void q(e)},{key:`test`,icon:(0,$.jsx)(he,{}),label:n.sendTest,onClick:()=>Ee(e)},{key:`edit`,icon:(0,$.jsx)(ue,{}),label:n.edit,onClick:()=>r(`/domains/${e.id}/sending?edit=1`)},{type:`divider`},{key:`delete`,icon:(0,$.jsx)(le,{}),danger:!0,label:n.delete,onClick:()=>{y(e),S(``)}}]}if(p&&!d)return(0,$.jsxs)(k,{direction:`vertical`,size:20,className:`full-width`,"aria-label":n.loading,children:[(0,$.jsx)(B,{active:!0,title:{width:`28%`},paragraph:{rows:2}}),(0,$.jsx)(ae,{children:(0,$.jsx)(B,{active:!0,paragraph:{rows:9}})})]});if(h&&!d)return(0,$.jsx)(xe,{status:`error`,title:n.loadFailed,subTitle:h,extra:(0,$.jsx)(F,{type:`primary`,onClick:()=>void P(),children:n.retry})});if(!d)return null;let Z=[{title:n.domain,dataIndex:`domain`,width:220,render:(e,t)=>(0,$.jsx)(F,{type:`link`,className:`table-link`,onClick:()=>r(`/domains/${t.id}/overview`),children:e})},{title:n.capabilities,width:220,render:(e,t)=>(0,$.jsx)(un,{domain:t,copy:n})},{title:n.authentication,width:160,render:(e,t)=>(0,$.jsx)(ln,{domain:t,copy:n})},{title:n.dnsIntegration,width:180,render:(e,t)=>t.dnsCredentialId?(0,$.jsx)(K,{tone:z.has(t.dnsCredentialId)?`info`:`warning`,children:z.get(t.dnsCredentialId)||n.credentialUnavailable}):(0,$.jsx)(K,{tone:`neutral`,children:n.manualDns})},{title:n.lastActivity,width:190,render:(e,t)=>{let r=V.get(t.domain);return r?(0,$.jsxs)(k,{direction:`vertical`,size:0,children:[(0,$.jsx)(I.Text,{children:new Date(r.createdAt).toLocaleString()}),(0,$.jsx)(I.Text,{type:`secondary`,children:r.subject||r.status})]}):(0,$.jsx)(I.Text,{type:`secondary`,children:n.noActivity})}},{title:n.actions,width:132,fixed:`right`,render:(e,t)=>(0,$.jsxs)(k,{size:4,children:[(0,$.jsx)(b,{title:n.view,children:(0,$.jsx)(F,{"aria-label":`${n.view} ${t.domain}`,icon:(0,$.jsx)(Jt,{}),onClick:()=>r(`/domains/${t.id}/overview`)})}),(0,$.jsx)(Se,{menu:{items:De(t)},trigger:[`click`],children:(0,$.jsx)(F,{"aria-label":`${n.moreActions} ${t.domain}`,icon:(0,$.jsx)(de,{}),loading:Object.entries(T).some(([e,n])=>e.startsWith(`${t.id}:`)&&n)})})]})}],Oe={current:M,pageSize:N,total:L.length,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],onChange:ee,showTotal:e=>n.paginationTotal(e)};return(0,$.jsxs)(k,{direction:`vertical`,size:20,className:`full-width`,children:[(0,$.jsx)(oe,{title:n.title,subtitle:n.subtitle,extra:(0,$.jsx)(F,{type:`primary`,style:{minHeight:44},onClick:()=>U(!0),children:n.addDomain})}),(0,$.jsx)(ae,{className:`domains-toolbar-card`,children:(0,$.jsxs)(`div`,{className:`page-toolbar`,children:[(0,$.jsxs)(k,{wrap:!0,children:[(0,$.jsx)(Y,{allowClear:!0,"aria-label":n.search,prefix:(0,$.jsx)(pe,{}),placeholder:n.searchPlaceholder,value:O,onChange:e=>H(`q`,e.target.value),className:`toolbar-search`,style:{minHeight:44}}),(0,$.jsx)(_,{allowClear:!0,"aria-label":n.statusFilter,placeholder:n.statusFilter,value:A,onChange:e=>H(`status`,e),options:[{value:`success`,label:n.healthy},{value:`warning`,label:n.pending},{value:`error`,label:n.needsAction}],className:`toolbar-select`,style:{minHeight:44}})]}),(0,$.jsx)(I.Text,{type:`secondary`,children:n.resultCount(L.length,d.domains.length)})]})}),L.length?l.md?(0,$.jsx)(ae,{children:(0,$.jsx)(re,{rowKey:`id`,columns:Z,dataSource:R,pagination:Oe,scroll:{x:1120}})}):(0,$.jsxs)(k,{direction:`vertical`,size:16,className:`full-width`,children:[(0,$.jsx)(se,{dataSource:R,renderItem:e=>(0,$.jsx)(se.Item,{children:(0,$.jsx)(dn,{domain:e,credentialName:e.dnsCredentialId?z.get(e.dnsCredentialId):void 0,event:V.get(e.domain),menuItems:De(e),onView:()=>r(`/domains/${e.id}/overview`),copy:n})})}),(0,$.jsx)(ie,{...Oe,responsive:!0})]}):(0,$.jsx)(ae,{children:(0,$.jsx)(Ce,{description:O||A?n.noMatches:n.noDomains,action:d.domains.length?void 0:(0,$.jsx)(F,{onClick:()=>U(!0),children:n.addFirstDomain})})}),(0,$.jsx)(Yt,{open:j,loading:!!T[`new:create`],config:e,dnsCredentials:d.dnsCredentials,smtpRelays:d.smtpRelays,onClose:()=>U(!1),onSubmit:ne}),(0,$.jsx)(ce,{title:n.deleteTitle,open:!!v,okText:n.delete,okButtonProps:{danger:!0,disabled:!v||x!==v.domain,loading:!!(v&&T[`${v.id}:delete`])},cancelText:n.cancel,onCancel:()=>{y(null),S(``)},onOk:()=>void ge(),children:(0,$.jsxs)(k,{direction:`vertical`,size:16,className:`full-width`,children:[(0,$.jsx)(I.Paragraph,{children:n.deleteWarning}),(0,$.jsxs)(I.Text,{children:[n.typeDomain,` `,(0,$.jsx)(I.Text,{code:!0,children:v?.domain})]}),(0,$.jsx)(Y,{autoFocus:!0,value:x,onChange:e=>S(e.target.value),"aria-label":n.deleteConfirmation,style:{minHeight:44}})]})}),(0,$.jsx)(ce,{title:C?n.testTitle(C.domain):n.sendTest,open:!!C,okText:n.queueTest,cancelText:n.cancel,confirmLoading:!!(C&&T[`${C.id}:test`]),onCancel:()=>{w(null),D.resetFields()},onOk:()=>void _e(),children:(0,$.jsxs)(J,{form:D,layout:`vertical`,children:[(0,$.jsx)(J.Item,{name:`to`,label:n.recipient,rules:[{required:!0,type:`email`,message:n.validRecipient}],children:(0,$.jsx)(Y,{placeholder:`you@example.com`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`subject`,label:n.subject,rules:[{required:!0}],children:(0,$.jsx)(Y,{style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`text`,label:n.body,rules:[{required:!0}],children:(0,$.jsx)(Y.TextArea,{rows:5})})]})})]})}function ln({domain:e,copy:t}){let n=e.status?.records||[],r=[`spf`,`dkim`,`dmarc`],i=r.filter(e=>{let t=n.find(t=>t.key===e);return t&&we(t).key===`success`}).length,a=i===3?`success`:i?`warning`:`error`;return(0,$.jsx)(b,{title:r.map(e=>`${e.toUpperCase()}: ${mn(n.find(t=>t.key===e),t)}`).join(`
  2. `),children:(0,$.jsx)(`span`,{children:(0,$.jsxs)(K,{tone:a,children:[i,`/3 `,i===3?t.passed:t.incomplete]})})})}function un({domain:e,copy:t}){return(0,$.jsxs)(k,{direction:`vertical`,size:4,children:[(0,$.jsxs)(K,{tone:e.status?.verified?`success`:`warning`,children:[(0,$.jsx)(he,{}),` `,e.status?.verified?t.sendReady:t.sendPending]}),(0,$.jsxs)(K,{tone:e.catchAllAddress?`info`:`neutral`,children:[(0,$.jsx)(a,{}),` `,e.catchAllAddress?t.receiveRouted:t.receiveConfigurable]})]})}function dn({domain:e,credentialName:t,event:n,menuItems:r,onView:i,copy:a}){return(0,$.jsx)(ee,{style:{width:`100%`},title:(0,$.jsxs)(k,{children:[(0,$.jsx)(_e,{}),(0,$.jsx)(I.Text,{strong:!0,children:e.domain})]}),extra:(0,$.jsx)(Se,{menu:{items:r},trigger:[`click`],children:(0,$.jsx)(F,{"aria-label":`${a.moreActions} ${e.domain}`,icon:(0,$.jsx)(de,{})})}),actions:[(0,$.jsx)(F,{type:`link`,icon:(0,$.jsx)(Jt,{}),onClick:i,children:a.view},`view`)],children:(0,$.jsxs)(k,{direction:`vertical`,size:12,className:`full-width`,children:[(0,$.jsx)(un,{domain:e,copy:a}),(0,$.jsxs)(k,{wrap:!0,children:[(0,$.jsx)(I.Text,{type:`secondary`,children:a.authentication}),(0,$.jsx)(ln,{domain:e,copy:a})]}),(0,$.jsxs)(k,{wrap:!0,children:[(0,$.jsx)(I.Text,{type:`secondary`,children:a.dnsIntegration}),(0,$.jsx)(K,{tone:t?`info`:`neutral`,children:t||a.manualDns})]}),(0,$.jsxs)(I.Text,{type:`secondary`,children:[a.lastActivity,`: `,n?new Date(n.createdAt).toLocaleString():a.noActivity]})]})})}function fn(e){return e.results?.find(e=>!e.ok&&e.error)?.error}function pn(e,t){let n=Number(e);return Number.isInteger(n)&&n>0?n:t}function mn(e,t){if(!e)return t.missing;let n=we(e).key;return n===`success`?t.passed:n===`pending`?t.pending:t.needsAction}var hn={title:`发信域名`,subtitle:`统一管理域名认证、发送能力和最近投递状态。`,loading:`正在加载域名`,loadFailed:`域名列表加载失败`,retry:`重试`,domain:`域名`,capabilities:`发送 / 接收能力`,authentication:`认证健康度`,dnsIntegration:`DNS 集成`,lastActivity:`最近活动`,actions:`操作`,view:`查看`,moreActions:`更多操作`,addDomain:`添加域名`,addFirstDomain:`添加第一个域名`,search:`搜索域名`,searchPlaceholder:`搜索域名或发信主机`,statusFilter:`认证状态`,healthy:`健康`,pending:`等待生效`,needsAction:`需要处理`,noMatches:`没有符合当前条件的域名`,noDomains:`还没有发信域名`,resultCount:(e,t)=>`${e} / ${t} 个域名`,checkDns:`检查 DNS`,autoDns:`自动写入 DNS`,sendTest:`测试发送`,edit:`编辑配置`,delete:`删除域名`,manualDns:`手动配置`,credentialUnavailable:`凭据不可用`,noActivity:`尚无发送活动`,passed:`已通过`,incomplete:`未完整`,missing:`未配置`,sendReady:`发送可用`,sendPending:`发送待验证`,receiveRouted:`接收已路由`,receiveConfigurable:`接收可配置`,created:`域名已创建,后续 DNS 操作已完成`,createdPartial:`域名已创建,但后续 DNS 操作未完全成功,请在详情页继续处理`,createFailed:`创建域名失败`,checked:`DNS 检查已完成`,dnsApplied:`DNS 记录写入已完成`,dnsPartiallyApplied:`部分 DNS 记录写入失败,请查看详情`,deleted:`域名已删除`,testQueued:`测试邮件已加入队列`,actionFailed:`操作失败`,paginationTotal:e=>`共 ${e} 个域名`,deleteTitle:`删除域名`,deleteWarning:`删除后,该域名的发送配置将立即不可用。此操作不可撤销。`,typeDomain:`请输入域名以确认:`,deleteConfirmation:`域名删除确认`,cancel:`取消`,testTitle:e=>`通过 ${e} 测试发送`,queueTest:`加入发送队列`,recipient:`收件人`,validRecipient:`请输入有效的收件邮箱`,subject:`主题`,body:`正文`,testSubject:e=>`MailHub ${e} 测试邮件`,testBody:e=>`这是一封来自 ${e} 的 MailHub 投递测试邮件。`},gn={title:`Sending domains`,subtitle:`Manage authentication, sending capability, and recent delivery health.`,loading:`Loading domains`,loadFailed:`Unable to load domains`,retry:`Retry`,domain:`Domain`,capabilities:`Send / receive`,authentication:`Authentication`,dnsIntegration:`DNS integration`,lastActivity:`Last activity`,actions:`Actions`,view:`View`,moreActions:`More actions`,addDomain:`Add domain`,addFirstDomain:`Add your first domain`,search:`Search domains`,searchPlaceholder:`Search domain or sending host`,statusFilter:`Authentication status`,healthy:`Healthy`,pending:`Pending`,needsAction:`Needs action`,noMatches:`No domains match these filters`,noDomains:`No sending domains yet`,resultCount:(e,t)=>`${e} of ${t} domains`,checkDns:`Check DNS`,autoDns:`Apply DNS automatically`,sendTest:`Send test`,edit:`Edit configuration`,delete:`Delete domain`,manualDns:`Manual`,credentialUnavailable:`Credential unavailable`,noActivity:`No activity yet`,passed:`passed`,incomplete:`incomplete`,missing:`Missing`,sendReady:`Sending ready`,sendPending:`Sending pending`,receiveRouted:`Receiving routed`,receiveConfigurable:`Receiving available`,created:`Domain created and DNS follow-up completed`,createdPartial:`Domain created, but the DNS follow-up needs attention`,createFailed:`Unable to create domain`,checked:`DNS check completed`,dnsApplied:`DNS records applied`,dnsPartiallyApplied:`Some DNS records could not be applied`,deleted:`Domain deleted`,testQueued:`Test email queued`,actionFailed:`Action failed`,paginationTotal:e=>`${e} domains`,deleteTitle:`Delete domain`,deleteWarning:`Sending configuration for this domain will stop working immediately. This cannot be undone.`,typeDomain:`Type the domain to confirm:`,deleteConfirmation:`Domain deletion confirmation`,cancel:`Cancel`,testTitle:e=>`Test sending from ${e}`,queueTest:`Queue test`,recipient:`Recipient`,validRecipient:`Enter a valid recipient email`,subject:`Subject`,body:`Body`,testSubject:e=>`MailHub ${e} test email`,testBody:e=>`This is a MailHub delivery test from ${e}.`};export{an as createDomainWithSetup,cn as default,sn as paginateDomains,on as readDomainPagination};