| 12 |
- 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-CVfSdO4m.js";import{Ar as l,At as u,Bn as d,Dn as f,Dr as p,F as m,Hn as h,J as g,Kt as _,Mn as v,Mr as y,Mt as b,Nr as x,Or as S,U as C,Vn as w,Xt as T,Z as E,Zn as D,ar as O,cn as k,ct as A,er as j,i as M,ir as N,jr as P,kn as F,l as I,mn as L,n as R,nr as z,pn as B,t as V,wn as H,xn as ee,zn as U}from"./jsx-runtime-C5RSiriy.js";import{r as te,t as W}from"./card-DMbCO2Fu.js";import{n as ne,r as G,t as re}from"./table-DDUhevyo.js";import{a as ie,n as ae,r as oe,t as K}from"./StatusPill-BYj3zI1_.js";import{t as q}from"./descriptions-gniVz27W.js";import{t as J}from"./form-y5mvm6Rb.js";import{t as Y}from"./input-7g-iBRng.js";import{t as se}from"./list-6VGU-0Wr.js";import{t as ce}from"./modal-C7xDa6TW.js";import{t as le}from"./DeleteOutlined-J0odQPKG.js";import{t as ue}from"./EditOutlined-CO1ElKoL.js";import{t as de}from"./EllipsisOutlined-BF-4cC5U.js";import{t as fe}from"./ReloadOutlined-By3LF9WE.js";import{t as pe}from"./SearchOutlined-8ZUFC3UK.js";import{t as me}from"./ThunderboltOutlined-C6K0mmNg.js";import{_ as he,f as ge,i as _e,m as ve,s as ye,t as be,v as xe,y as Se}from"./index-Dy4xV4t8.js";import{t as Ce}from"./EmptyState-CeUjt5Wb.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=N();function Ae(){var e;return ke?(e=Oe,Oe+=1):e=`TEST_OR_SSR`,e}var je=(function(e){var t=O(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,u=e.size,d=e.gapDegree,f=r&&P(r)===`object`,p=f?`#FFF`:void 0,m=u/2,h=X.createElement(`circle`,{className:`${n}-circle-path`,r:a,cx:m,cy:m,stroke:p,strokeLinecap:c,strokeWidth:l,opacity:s===0?0:1,style:o,ref:t});if(!f)return h;var g=`${i}-conic`,_=d?`${180+d/2}deg`:`0deg`,v=Ne(r,(360-d)/360),y=Ne(r,1),b=`conic-gradient(from ${_}, ${v.join(`, `)})`,x=`linear-gradient(to ${d?`bottom`:`top`}, ${y.join(`, `)})`;return X.createElement(X.Fragment,null,X.createElement(`mask`,{id:g},h),X.createElement(`foreignObject`,{x:0,y:0,width:u,height:u,mask:`url(#${g})`},X.createElement(Me,{bg:x},X.createElement(Me,{bg:b}))))}),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=p(p({},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,u=t.trailColor,d=t.strokeLinecap,f=t.style,m=t.className,h=t.strokeColor,g=t.percent,_=z(t,Ie),v=100/2,b=`${je(n)}-gradient`,x=v-a/2,S=Math.PI*2*x,C=c>0?90+c/2:-90,w=S*((360-c)/360),T=P(i)===`object`?i:{count:i,gap:2},E=T.count,D=T.gap,O=Le(g),k=Le(h),A=k.find(function(e){return e&&P(e)===`object`}),j=A&&P(A)===`object`?`butt`:d,M=Fe(S,w,0,100,C,c,l,u,j,a),N=De();return X.createElement(`svg`,y({className:(0,Z.default)(`${r}-circle`,m),viewBox:`0 0 100 100`,style:f,id:n,role:`presentation`},_),!E&&X.createElement(`circle`,{className:`${r}-circle-trail`,r:x,cx:v,cy:v,stroke:u,strokeLinecap:j,strokeWidth:o||a,style:M}),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]:u,d=s&&P(s)===`object`?`url(#${b})`:void 0,f=Fe(S,w,n,t,C,c,l,s,`butt`,a,D);return n+=(w-f.strokeDashoffset+D)*100/w,X.createElement(`circle`,{key:o,className:`${r}-circle-path`,r:x,cx:v,cy:v,stroke:d,strokeWidth:a,opacity:1,style:f,ref:function(e){N[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){N[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||w.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:h}=e;h===void 0&&(h=Math.max(We(f),6));let g={width:f,height:p,fontSize:f*.15+6},_=X.useMemo(()=>{if(a||a===0)return a;if(s===`dashboard`)return 75},[a,s]),v=Be(e),y=i||s===`dashboard`&&`bottom`||void 0,b=Object.prototype.toString.call(e.strokeColor)===`[object Object]`,x=Ve({success:l,strokeColor:e.strokeColor}),S=(0,Z.default)(`${t}-inner`,{[`${t}-circle-gradient`]:b}),C=X.createElement(Re,{steps:d,percent:d?v[1]:v,strokeWidth:h,trailWidth:h,strokeColor:d?x[1]:x,strokeLinecap:r,trailColor:n,prefixCls:t,gapDegree:_,gapPosition:y}),w=f<=20,T=X.createElement(`div`,{className:S,style:g},C,!w&&c);return w?X.createElement(m,{title:c},T):T},Ke=`--progress-line-stroke-color`,qe=`--progress-percent`,Je=e=>{let t=e?`100%`:`-100%`;return new D(`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({},f(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 ${j(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=ee(`Progress`,e=>{let t=e.calc(e.marginXXS).div(2).equal(),n=v(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=w.blue,to:r=w.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:g={}}=e,_=at(e,[`prefixCls`,`className`,`rootClassName`,`steps`,`strokeColor`,`percent`,`size`,`showInfo`,`type`,`status`,`format`,`style`,`percentPosition`]),{align:v=`end`,type:y=`outer`}=g,b=Array.isArray(s)?s[0]:s,x=typeof s==`string`||Array.isArray(s)?s:void 0,S=X.useMemo(()=>b?new h(typeof b==`string`?b:Object.values(b)[0]).isLight():!1,[s]),C=X.useMemo(()=>{let t=ze(e);return Number.parseInt(t===void 0?(c??0)?.toString():(t??0)?.toString(),10)},[c,e.success,e.successPercent]),w=X.useMemo(()=>!ot.includes(f)&&C>=100?`success`:f||`normal`,[f,C]),{getPrefixCls:D,direction:O,progress:k}=X.useContext(U),A=D(`progress`,n),[j,M,N]=$e(A),P=d===`line`,F=P&&!o,I=X.useMemo(()=>{if(!u)return null;let t=ze(e),n,i=p||(e=>`${e}%`),a=P&&S&&y===`inner`;return y===`inner`||p||w!==`exception`&&w!==`success`?n=i(Q(c),Q(t)):w===`exception`?n=P?X.createElement(L,null):X.createElement(B,null):w===`success`&&(n=P?X.createElement(r,null):X.createElement(E,null)),X.createElement(`span`,{className:(0,Z.default)(`${A}-text`,{[`${A}-text-bright`]:a,[`${A}-text-${v}`]:F,[`${A}-text-${y}`]:F}),title:typeof n==`string`?n:void 0},n)},[u,c,C,w,d,A,p]),R;d===`line`?R=o?X.createElement(it,Object.assign({},e,{strokeColor:x,prefixCls:A,steps:typeof o==`object`?o.count:o}),I):X.createElement(rt,Object.assign({},e,{strokeColor:b,prefixCls:A,direction:O,percentPosition:{align:v,type:y}}),I):(d===`circle`||d===`dashboard`)&&(R=X.createElement(Ge,Object.assign({},e,{strokeColor:b,prefixCls:A,progressStatus:w}),I));let z=(0,Z.default)(A,`${A}-status-${w}`,{[`${A}-${d===`dashboard`&&`circle`||d}`]:d!==`line`,[`${A}-inline-circle`]:d===`circle`&&He(l,`circle`)[0]<=20,[`${A}-line`]:F,[`${A}-line-align-${v}`]:F,[`${A}-line-position-${y}`]:F,[`${A}-steps`]:o,[`${A}-show-info`]:u,[`${A}-${l}`]:typeof l==`string`,[`${A}-rtl`]:O===`rtl`},k?.className,i,a,M,N);return j(X.createElement(`div`,Object.assign({ref:t,style:Object.assign(Object.assign({},k?.style),m),className:z,role:`progressbar`,"aria-valuenow":C,"aria-valuemin":0,"aria-valuemax":100},T(_,[`trailColor`,`strokeWidth`,`width`,`gapDegree`,`gapPosition`,`strokeLinecap`,`success`,`successPercent`])),R))}),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,m=e.subTitle,h=e.progressDot,g=e.stepIcon,_=e.tailContent,v=e.icons,b=e.stepIndex,x=e.onStepClick,C=e.onClick,w=e.render,T=z(e,ct),E=!!x&&!u,D={};E&&(D.role=`button`,D.tabIndex=0,D.onClick=function(e){C?.(e),x(b)},D.onKeyDown=function(e){var t=e.which;(t===k.ENTER||t===k.SPACE)&&x(b)});var O=function(){var e,t,n=(0,Z.default)(`${r}-icon`,`${s}icon`,(e={},S(e,`${s}icon-${c}`,c&<(c)),S(e,`${s}icon-check`,!c&&o===`finish`&&(v&&!v.finish||!v)),S(e,`${s}icon-cross`,!c&&o===`error`&&(v&&!v.error||!v)),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):v&&v.finish&&o===`finish`?X.createElement(`span`,{className:`${r}-icon`},v.finish):v&&v.error&&o===`error`?X.createElement(`span`,{className:`${r}-icon`},v.error):c||o===`finish`||o===`error`?X.createElement(`span`,{className:n}):X.createElement(`span`,{className:`${r}-icon`},l),g&&(t=g({index:l-1,status:o,title:f,description:d,node:t})),t},A=o||`wait`,j=(0,Z.default)(`${r}-item`,`${r}-item-${A}`,n,(t={},S(t,`${r}-item-custom`,c),S(t,`${r}-item-active`,a),S(t,`${r}-item-disabled`,u===!0),t)),M=p({},i),N=X.createElement(`div`,y({},T,{className:j,style:M}),X.createElement(`div`,y({onClick:C},D,{className:`${r}-item-container`}),X.createElement(`div`,{className:`${r}-item-tail`},_),X.createElement(`div`,{className:`${r}-item-icon`},O()),X.createElement(`div`,{className:`${r}-item-content`},X.createElement(`div`,{className:`${r}-item-title`},f,m&&X.createElement(`div`,{title:typeof m==`string`?m:void 0,className:`${r}-item-subtitle`},m)),d&&X.createElement(`div`,{className:`${r}-item-description`},d))));return w&&(N=w(N)||null),N}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,m=e.iconPrefix,h=m===void 0?`rc`:m,g=e.status,_=g===void 0?`process`:g,v=e.size,b=e.current,x=b===void 0?0:b,C=e.progressDot,w=C===void 0?!1:C,T=e.stepIcon,E=e.initial,D=E===void 0?0:E,O=e.icons,k=e.onChange,A=e.itemRender,j=e.items,M=j===void 0?[]:j,N=z(e,dt),P=u===`navigation`,F=u===`inline`,I=F||w,L=F?`horizontal`:c,R=F?void 0:v,B=I?`vertical`:f,V=(0,Z.default)(r,`${r}-${L}`,o,(t={},S(t,`${r}-${R}`,R),S(t,`${r}-label-${B}`,L===`horizontal`),S(t,`${r}-dot`,!!I),S(t,`${r}-navigation`,P),S(t,`${r}-inline`,F),t)),H=function(e){k&&x!==e&&k(e)};return X.createElement(`div`,y({className:V,style:a},N),M.filter(function(e){return e}).map(function(e,t){var n=p({},e),i=D+t;return _===`error`&&t===x-1&&(n.className=`${r}-next-error`),n.status||(i===x?n.status=_:i<x?n.status=`finish`:n.status=`wait`),F&&(n.icon=void 0,n.subTitle=void 0),!n.render&&A&&(n.render=function(e){return A(n,e)}),X.createElement(ut,y({},n,{active:i===x,stepNumber:i+1,stepIndex:i,key:i,prefixCls:r,iconPrefix:h,wrapperStyle:a,progressDot:I,stepIcon:T,icons:O,onStepClick:k&&H}))}))}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:j(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:`${j(a)} ${j(e.paddingXXS)} 0`,margin:`0 ${j(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% - ${j(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:`${j(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:`${j(e.lineWidth)} ${e.lineType} ${i}`}},o),"&-error":o,"&-active, &-process":Object.assign({[`${t}-item-icon`]:{width:n,height:n,marginInlineStart:`calc(50% - ${j(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 ${j(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},F),{"&::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% - ${j(e.calc(e.paddingSM).div(2).equal())})`,insetInlineStart:`100%`,display:`inline-block`,width:e.fontSizeIcon,height:e.fontSizeIcon,borderTop:`${j(e.lineWidth)} ${e.lineType} ${r}`,borderBottom:`none`,borderInlineStart:`none`,borderInlineEnd:`${j(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% - ${j(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:l}=e,u=e.calc(r).add(e.calc(s).mul(4).equal()).equal(),d=e.calc(i).add(e.calc(e.lineWidth).mul(4).equal()).equal();return{[`&${n}-with-progress`]:{[`${n}-item`]:{paddingTop:l,[`&-process ${n}-item-container ${n}-item-icon ${n}-icon`]:{color:a}},[`&${n}-vertical > ${n}-item `]:{paddingInlineStart:l,[`> ${n}-item-container > ${n}-item-tail`]:{top:o,insetInlineStart:e.calc(r).div(2).sub(c).add(l).equal()}},[`&, &${n}-small`]:{[`&${n}-horizontal ${n}-item:first-child`]:{paddingBottom:l,paddingInlineStart:l}},[`&${n}-small${n}-vertical > ${n}-item > ${n}-item-container > ${n}-item-tail`]:{insetInlineStart:e.calc(i).div(2).sub(c).add(l).equal()},[`&${n}-label-vertical ${n}-item ${n}-item-tail`]:{top:e.calc(r).div(2).add(l).equal()},[`${n}-item-icon`]:{position:`relative`,[`${t}-progress`]:{position:`absolute`,insetInlineStart:`50%`,top:`50%`,transform:`translate(-50%, -50%)`,"&-inner":{width:`${j(u)} !important`,height:`${j(u)} !important`}}},[`&${n}-small`]:{[`&${n}-label-vertical ${n}-item ${n}-item-tail`]:{top:e.calc(i).div(2).add(l).equal()},[`${n}-item-icon ${t}-progress-inner`]:{width:`${j(d)} !important`,height:`${j(d)} !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:`${j(e.calc(n).div(2).equal())} 0`,padding:0,"&::after":{width:`calc(100% - ${j(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:j(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:j(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:`${j(e.calc(a).add(e.paddingXS).equal())} 0 ${j(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 ${j(e.marginXS)}`,fontSize:r,lineHeight:j(n),textAlign:`center`,borderRadius:n},[`${t}-item-title`]:{paddingInlineEnd:e.paddingSM,fontSize:i,lineHeight:j(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:j(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:j(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:`${j(e.calc(e.marginXXS).mul(1.5).add(r).equal())} 0 ${j(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:`${j(e.calc(e.marginXXS).mul(1.5).add(n).equal())} 0 ${j(e.calc(e.marginXXS).mul(1.5).equal())}`},[`${t}-item-title`]:{lineHeight:j(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}`]:H(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:j(e.iconSize),textAlign:`center`,borderRadius:e.iconSize,border:`${j(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:j(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({},f(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=ee(`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(v(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(l(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}=C(s),{getPrefixCls:h,direction:g,className:v,style:y}=d(`steps`),b=X.useMemo(()=>s&&p?`vertical`:a,[s,p,a]),x=_(n),S=h(`steps`,e.prefixCls),[w,T,D]=Mt(S),O=e.type===`inline`,k=h(``,e.iconPrefix),A=Pt(o,l),j=O?void 0:t,M=Object.assign(Object.assign({},y),u),N=(0,Z.default)(v,{[`${S}-rtl`]:g===`rtl`,[`${S}-with-progress`]:j!==void 0},r,i,T,D),P={finish:X.createElement(E,{className:`${S}-finish-icon`}),error:X.createElement(B,{className:`${S}-error-icon`})};return w(X.createElement(pt,Object.assign({icons:P},f,{style:M,current:c,size:x,items:A,itemRender:O?(e,t)=>e.description?X.createElement(m,{title:e.description},t):t:void 0,stepIcon:({node:e,status:t})=>{if(t===`process`&&j!==void 0){let t=x===`small`?32:40;return X.createElement(`div`,{className:`${S}-progress-icon`},X.createElement(st,{type:`circle`,percent:j,size:t,strokeWidth:4,format:()=>null}),e)}return e},direction:b,prefixCls:S,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(),d=l.startsWith(`en`)?tn:en,[f]=J.useForm(),[p,m]=(0,X.useState)(0),h=J.useWatch([],f),_=J.useWatch(`dnsMode`,f),v=(0,X.useMemo)(()=>[d.domainAndPurpose,d.dnsAndDelivery,d.reviewAndCreate],[d]);(0,X.useEffect)(()=>{e&&(f.resetFields(),f.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}),m(0))},[n,r,f,e]);async function y(){try{await f.validateFields(Xt(p))}catch{return}if(p===1&&_===`automatic`&&!f.getFieldValue(`dnsCredentialId`)){f.setFields([{name:`dnsCredentialId`,errors:[d.selectDnsCredential]}]);return}m(e=>Math.min(e+1,v.length-1))}async function x(){let e;try{e=await f.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}f.resetFields(),m(0)}return(0,$.jsx)(Se,{title:d.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)(u,{style:{minHeight:44},disabled:t,onClick:s,children:d.cancel}),(0,$.jsxs)(M,{size:8,children:[(0,$.jsx)(u,{style:{minHeight:44},disabled:p===0||t,onClick:()=>m(e=>e-1),children:d.previous}),p<v.length-1?(0,$.jsx)(u,{type:`primary`,style:{minHeight:44},onClick:()=>void y(),children:d.next}):(0,$.jsx)(u,{type:`primary`,style:{minHeight:44},icon:(0,$.jsx)(zt,{}),loading:t,onClick:()=>void x(),children:d.createAndVerify})]})]}),children:(0,$.jsxs)(M,{direction:`vertical`,size:24,className:`full-width`,children:[(0,$.jsx)(It,{current:p,items:v.map(e=>({title:e})),responsive:!0,"aria-label":d.progress}),(0,$.jsxs)(J,{form:f,layout:`vertical`,requiredMark:`optional`,preserve:!0,children:[(0,$.jsxs)(`section`,{hidden:p!==0,"aria-label":d.domainAndPurpose,children:[(0,$.jsx)(J.Item,{name:`domain`,label:d.domain,rules:[{required:!0,message:d.domainRequired},{pattern:/^(?!-)(?:[a-zA-Z0-9-]+\.)+[a-zA-Z]{2,}$/,message:d.domainInvalid}],extra:d.domainHint,children:(0,$.jsx)(Y,{placeholder:`example.com`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`purpose`,label:d.purpose,rules:[{required:!0}],children:(0,$.jsx)(G.Group,{style:{width:`100%`},children:(0,$.jsxs)(M,{direction:`vertical`,size:12,className:`full-width`,children:[(0,$.jsx)(G,{value:`sending`,children:(0,$.jsxs)(M,{children:[(0,$.jsx)(_e,{}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(R.Text,{strong:!0,children:d.sendingOnly}),(0,$.jsx)(`br`,{}),(0,$.jsx)(R.Text,{type:`secondary`,children:d.sendingOnlyHint})]})]})}),(0,$.jsx)(G,{value:`sending-receiving`,children:(0,$.jsxs)(M,{children:[(0,$.jsx)(a,{}),(0,$.jsxs)(`span`,{children:[(0,$.jsx)(R.Text,{strong:!0,children:d.sendAndReceive}),(0,$.jsx)(`br`,{}),(0,$.jsx)(R.Text,{type:`secondary`,children:d.sendAndReceiveHint})]})]})})]})})}),h?.purpose===`sending-receiving`?(0,$.jsx)(te,{type:`info`,showIcon:!0,message:d.receiveFollowUp}):null]}),(0,$.jsxs)(`section`,{hidden:p!==1,"aria-label":d.dnsAndDelivery,children:[(0,$.jsx)(J.Item,{name:`dnsMode`,label:d.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,{}),` `,d.automatic]}),(0,$.jsxs)(G.Button,{value:`manual`,children:[(0,$.jsx)(Gt,{}),` `,d.manual]})]})}),_===`automatic`?(0,$.jsx)(J.Item,{name:`dnsCredentialId`,label:d.dnsCredential,rules:[{required:!0,message:d.selectDnsCredential}],extra:d.autoDnsHint,children:(0,$.jsx)(g,{placeholder:d.selectDnsCredential,style:{minHeight:44},options:r.map(e=>({value:e.id,label:`${e.name} · ${Qt(e.provider)}`}))})}):(0,$.jsx)(te,{type:`info`,showIcon:!0,message:d.manualDnsTitle,description:d.manualDnsHint}),(0,$.jsx)(J.Item,{name:`smtpRelayId`,label:d.relay,extra:d.relayHint,style:{marginTop:20},children:(0,$.jsx)(g,{allowClear:!0,placeholder:d.defaultDelivery,style:{minHeight:44},options:o.map(e=>({value:e.id,label:$t(e,d.defaultLabel)}))})}),(0,$.jsx)(b,{ghost:!0,items:[{key:`advanced`,label:d.advanced,forceRender:!0,children:(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(J.Item,{name:`senderHost`,label:d.senderHost,rules:[{required:!0,message:d.senderHostRequired}],children:(0,$.jsx)(Y,{placeholder:`mail.example.com`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`sendingIp`,label:d.sendingIp,rules:[{required:!0,message:d.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:d.selectorRequired}],children:(0,$.jsx)(Y,{placeholder:`mh202607`,autoComplete:`off`,style:{minHeight:44}})}),(0,$.jsx)(J.Item,{name:`dmarcPolicy`,label:`DMARC`,children:(0,$.jsx)(g,{style:{minHeight:44},options:[`none`,`quarantine`,`reject`].map(e=>({value:e,label:e}))})}),(0,$.jsx)(J.Item,{name:`spfExtra`,label:d.spfExtra,children:(0,$.jsx)(Y.TextArea,{rows:3,placeholder:`include:spf.example.com`})})]})}]})]}),(0,$.jsxs)(`section`,{hidden:p!==2,"aria-label":d.reviewAndCreate,children:[(0,$.jsx)(te,{type:`info`,showIcon:!0,message:d.reviewHint,style:{marginBottom:20}}),(0,$.jsxs)(q,{bordered:!0,size:`small`,column:1,children:[(0,$.jsx)(q.Item,{label:d.domain,children:h?.domain||`-`}),(0,$.jsx)(q.Item,{label:d.purpose,children:h?.purpose===`sending-receiving`?d.sendAndReceive:d.sendingOnly}),(0,$.jsx)(q.Item,{label:d.dnsConfiguration,children:(0,$.jsx)(K,{tone:h?.dnsMode===`automatic`?`info`:`neutral`,children:h?.dnsMode===`automatic`?d.automatic:d.manual})}),(0,$.jsx)(q.Item,{label:d.dnsCredential,children:h?.dnsMode===`automatic`?r.find(e=>e.id===h?.dnsCredentialId)?.name||`-`:d.notApplicable}),(0,$.jsx)(q.Item,{label:d.relay,children:o.find(e=>e.id===h?.smtpRelayId)?.name||d.defaultDelivery}),(0,$.jsx)(q.Item,{label:`DKIM selector`,children:h?.selector||`-`}),(0,$.jsx)(q.Item,{label:`DMARC`,children:h?.dmarcPolicy||`none`})]}),(0,$.jsx)(J.Item,{name:`immediateCheck`,valuePropName:`checked`,style:{marginTop:20},children:(0,$.jsx)(ne,{children:d.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}=be(),{locale:t}=i(),n=t.startsWith(`en`)?gn:hn,r=ge(),[a,c]=ve(),l=I.useBreakpoint(),{message:d}=o.useApp(),[f,p]=(0,X.useState)(null),[h,_]=(0,X.useState)(!0),[v,y]=(0,X.useState)(``),[b,x]=(0,X.useState)(null),[S,C]=(0,X.useState)(``),[w,T]=(0,X.useState)(null),[E,D]=(0,X.useState)({}),[O]=J.useForm(),k=a.get(`q`)||``,j=a.get(`status`)||void 0,N=a.get(`create`)===`1`,{page:P,pageSize:F}=on(a),L=(0,X.useCallback)(async()=>{_(!0),y(``);try{let[e,t,n,r]=await Promise.all([s.domains(),s.dnsCredentials(),s.smtpRelays(),s.events({page:1,pageSize:100})]);p({domains:e.domains,dnsCredentials:t.credentials,smtpRelays:n.relays,events:r.events})}catch(e){y(e instanceof Error?e.message:n.loadFailed)}finally{_(!1)}},[n.loadFailed]);(0,X.useEffect)(()=>{L()},[L]);let z=(0,X.useMemo)(()=>{if(!f)return[];let e=k.trim().toLowerCase();return f.domains.filter(t=>{let n=Te(t);return(!e||t.domain.toLowerCase().includes(e)||t.senderHost.toLowerCase().includes(e))&&(!j||n.status===j)})},[f,k,j]),B=(0,X.useMemo)(()=>sn(z,P,F),[z,P,F]);(0,X.useEffect)(()=>{if(!f)return;let e=Math.max(nn,Math.ceil(z.length/F)),t=Math.min(P,e);if(a.get(`page`)===String(t)&&a.get(`pageSize`)===String(F))return;let n=new URLSearchParams(a);n.set(`page`,String(t)),n.set(`pageSize`,String(F)),c(n,{replace:!0})},[f,z.length,P,F,a,c]);let V=(0,X.useMemo)(()=>new Map(f?.dnsCredentials.map(e=>[e.id,e.name])||[]),[f?.dnsCredentials]),H=(0,X.useMemo)(()=>{let e=new Map;for(let t of f?.events||[])t.domain&&!e.has(t.domain)&&e.set(t.domain,t);return e},[f?.events]);function ee(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 te(e,t){let n=new URLSearchParams(a);n.set(`page`,String(t===F?e:nn)),n.set(`pageSize`,String(t)),c(n)}async function W(e,t,n){let r=`${e.id}:${t}`;D(e=>({...e,[r]:!0}));try{return await n()}finally{D(e=>({...e,[r]:!1}))}}async function ne(e){let t=`new:create`;D(e=>({...e,[t]:!0}));try{let t=await an(e,s);p(e=>e&&{...e,domains:[t.domain,...e.domains]}),U(!1),t.setup===`partial`?d.warning(t.error?`${n.createdPartial}:${t.error}`:n.createdPartial):d.success(n.created),r(`/domains/${t.domain.id}/dns?setup=${t.setup}`)}catch(e){throw d.error(e instanceof Error?e.message:n.createFailed),e}finally{D(e=>({...e,[t]:!1}))}}async function G(e){try{we((await W(e,`check`,()=>s.checkDomain(e.id))).domain),d.success(n.checked)}catch(e){d.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?d.warning(n.dnsPartiallyApplied):d.success(n.dnsApplied)}catch(e){d.error(e instanceof Error?e.message:n.actionFailed)}}async function ye(){if(!(!b||S!==b.domain))try{await W(b,`delete`,()=>s.deleteDomain(b.id)),p(e=>e&&{...e,domains:e.domains.filter(e=>e.id!==b.id)}),x(null),C(``),d.success(n.deleted)}catch(e){d.error(e instanceof Error?e.message:n.actionFailed)}}async function Se(){if(!w)return;let e;try{e=await O.validateFields()}catch{return}try{await W(w,`test`,()=>s.sendTest(w.id,e)),T(null),O.resetFields(),d.success(n.testQueued)}catch(e){d.error(e instanceof Error?e.message:n.actionFailed)}}function we(e){p(t=>t&&{...t,domains:t.domains.map(t=>t.id===e.id?e:t)})}function Ee(e){T(e),O.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)(_e,{}),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:()=>{x(e),C(``)}}]}if(h&&!f)return(0,$.jsxs)(M,{direction:`vertical`,size:20,className:`full-width`,"aria-label":n.loading,children:[(0,$.jsx)(A,{active:!0,title:{width:`28%`},paragraph:{rows:2}}),(0,$.jsx)(ae,{children:(0,$.jsx)(A,{active:!0,paragraph:{rows:9}})})]});if(v&&!f)return(0,$.jsx)(he,{status:`error`,title:n.loadFailed,subTitle:v,extra:(0,$.jsx)(u,{type:`primary`,onClick:()=>void L(),children:n.retry})});if(!f)return null;let Z=[{title:n.domain,dataIndex:`domain`,width:220,render:(e,t)=>(0,$.jsx)(u,{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:V.has(t.dnsCredentialId)?`info`:`warning`,children:V.get(t.dnsCredentialId)||n.credentialUnavailable}):(0,$.jsx)(K,{tone:`neutral`,children:n.manualDns})},{title:n.lastActivity,width:190,render:(e,t)=>{let r=H.get(t.domain);return r?(0,$.jsxs)(M,{direction:`vertical`,size:0,children:[(0,$.jsx)(R.Text,{children:new Date(r.createdAt).toLocaleString()}),(0,$.jsx)(R.Text,{type:`secondary`,children:r.subject||r.status})]}):(0,$.jsx)(R.Text,{type:`secondary`,children:n.noActivity})}},{title:n.actions,width:132,fixed:`right`,render:(e,t)=>(0,$.jsxs)(M,{size:4,children:[(0,$.jsx)(m,{title:n.view,children:(0,$.jsx)(u,{"aria-label":`${n.view} ${t.domain}`,icon:(0,$.jsx)(Jt,{}),onClick:()=>r(`/domains/${t.id}/overview`)})}),(0,$.jsx)(xe,{menu:{items:De(t)},trigger:[`click`],children:(0,$.jsx)(u,{"aria-label":`${n.moreActions} ${t.domain}`,icon:(0,$.jsx)(de,{}),loading:Object.entries(E).some(([e,n])=>e.startsWith(`${t.id}:`)&&n)})})]})}],Oe={current:P,pageSize:F,total:z.length,showSizeChanger:!0,pageSizeOptions:[10,20,50,100],onChange:te,showTotal:e=>n.paginationTotal(e)};return(0,$.jsxs)(M,{direction:`vertical`,size:20,className:`full-width`,children:[(0,$.jsx)(oe,{title:n.title,subtitle:n.subtitle,extra:(0,$.jsx)(u,{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)(M,{wrap:!0,children:[(0,$.jsx)(Y,{allowClear:!0,"aria-label":n.search,prefix:(0,$.jsx)(pe,{}),placeholder:n.searchPlaceholder,value:k,onChange:e=>ee(`q`,e.target.value),className:`toolbar-search`,style:{minHeight:44}}),(0,$.jsx)(g,{allowClear:!0,"aria-label":n.statusFilter,placeholder:n.statusFilter,value:j,onChange:e=>ee(`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)(R.Text,{type:`secondary`,children:n.resultCount(z.length,f.domains.length)})]})}),z.length?l.md?(0,$.jsx)(ae,{children:(0,$.jsx)(re,{rowKey:`id`,columns:Z,dataSource:B,pagination:Oe,scroll:{x:1120}})}):(0,$.jsxs)(M,{direction:`vertical`,size:16,className:`full-width`,children:[(0,$.jsx)(se,{dataSource:B,renderItem:e=>(0,$.jsx)(se.Item,{children:(0,$.jsx)(dn,{domain:e,credentialName:e.dnsCredentialId?V.get(e.dnsCredentialId):void 0,event:H.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:k||j?n.noMatches:n.noDomains,action:f.domains.length?void 0:(0,$.jsx)(u,{onClick:()=>U(!0),children:n.addFirstDomain})})}),(0,$.jsx)(Yt,{open:N,loading:!!E[`new:create`],config:e,dnsCredentials:f.dnsCredentials,smtpRelays:f.smtpRelays,onClose:()=>U(!1),onSubmit:ne}),(0,$.jsx)(ce,{title:n.deleteTitle,open:!!b,okText:n.delete,okButtonProps:{danger:!0,disabled:!b||S!==b.domain,loading:!!(b&&E[`${b.id}:delete`])},cancelText:n.cancel,onCancel:()=>{x(null),C(``)},onOk:()=>void ye(),children:(0,$.jsxs)(M,{direction:`vertical`,size:16,className:`full-width`,children:[(0,$.jsx)(R.Paragraph,{children:n.deleteWarning}),(0,$.jsxs)(R.Text,{children:[n.typeDomain,` `,(0,$.jsx)(R.Text,{code:!0,children:b?.domain})]}),(0,$.jsx)(Y,{autoFocus:!0,value:S,onChange:e=>C(e.target.value),"aria-label":n.deleteConfirmation,style:{minHeight:44}})]})}),(0,$.jsx)(ce,{title:w?n.testTitle(w.domain):n.sendTest,open:!!w,okText:n.queueTest,cancelText:n.cancel,confirmLoading:!!(w&&E[`${w.id}:test`]),onCancel:()=>{T(null),O.resetFields()},onOk:()=>void Se(),children:(0,$.jsxs)(J,{form:O,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)(m,{title:r.map(e=>`${e.toUpperCase()}: ${mn(n.find(t=>t.key===e),t)}`).join(`
- `),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)(M,{direction:`vertical`,size:4,children:[(0,$.jsxs)(K,{tone:e.status?.verified?`success`:`warning`,children:[(0,$.jsx)(_e,{}),` `,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)(W,{style:{width:`100%`},title:(0,$.jsxs)(M,{children:[(0,$.jsx)(ye,{}),(0,$.jsx)(R.Text,{strong:!0,children:e.domain})]}),extra:(0,$.jsx)(xe,{menu:{items:r},trigger:[`click`],children:(0,$.jsx)(u,{"aria-label":`${a.moreActions} ${e.domain}`,icon:(0,$.jsx)(de,{})})}),actions:[(0,$.jsx)(u,{type:`link`,icon:(0,$.jsx)(Jt,{}),onClick:i,children:a.view},`view`)],children:(0,$.jsxs)(M,{direction:`vertical`,size:12,className:`full-width`,children:[(0,$.jsx)(un,{domain:e,copy:a}),(0,$.jsxs)(M,{wrap:!0,children:[(0,$.jsx)(R.Text,{type:`secondary`,children:a.authentication}),(0,$.jsx)(ln,{domain:e,copy:a})]}),(0,$.jsxs)(M,{wrap:!0,children:[(0,$.jsx)(R.Text,{type:`secondary`,children:a.dnsIntegration}),(0,$.jsx)(K,{tone:t?`info`:`neutral`,children:t||a.manualDns})]}),(0,$.jsxs)(R.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};
|