Files
xin-procurement/public/assets/button-DsOd0cni.js
T
2026-10-30 10:51:09 +08:00

1 line
19 KiB
JavaScript

import{o as e}from"./request-xrnk7ZJV.js";import{$n as t,Bn as n,Ct as r,E as i,Ft as a,Hn as o,Jt as s,Kt as c,Ln as l,Or as u,Ot as d,P as f,Pr as ee,Q as te,Sn as p,Un as ne,Wn as m,Z as re,Zn as ie,Zt as ae,an as oe,at as se,ct as h,jt as g,kt as ce,nt as le,qt as ue,rn as _,rr as de,st as v,tn as fe,wn as y,wr as pe,wt as me,xn as b,yr as he}from"./jsx-runtime-OfKoVykY.js";import{i as ge,n as _e}from"./ColorPresets-BWkFn7Wc.js";var x=e(ee()),ve=x.createContext(void 0),ye=e=>{let{getPrefixCls:t,direction:r}=x.useContext(n),{prefixCls:i,size:a,className:o,...s}=e,c=t(`btn-group`,i),[,,l]=_(),u=x.useMemo(()=>{switch(a){case`large`:return`lg`;case`small`:return`sm`;default:return``}},[a]),d=m(c,{[`${c}-${u}`]:u,[`${c}-rtl`]:r===`rtl`},o,l);return x.createElement(ve.Provider,{value:a},x.createElement(`div`,{...s,className:d}))},S=/^[\u4E00-\u9FA5]{2}$/,C=S.test.bind(S);function w(e){return e===`danger`?{danger:!0}:{type:e}}function T(e){return e===`text`||e===`link`}function be(e,t,n,r){if(!de(e))return;let i=t?` `:``;return!g(e)&&!d(e)&&g(e.type)&&C(e.props.children)?v(e,e=>{let t=m(e.className,r)||void 0,a={...n,...e.style};return{...e,children:e.children.split(``).join(i),className:t,style:a}}):g(e)?x.createElement(`span`,{className:r,style:n},C(e)?e.split(``).join(i):e):h(e)?x.createElement(`span`,{className:r,style:n},e):v(e,e=>({...e,className:m(e.className,r)||void 0,style:{...e.style,...n}}))}function xe(e,t,n,r){let i=!1,a=[];return x.Children.forEach(e,e=>{let t=g(e)||d(e);if(i&&t){let t=a.length-1,n=a[t];a[t]=`${n}${e}`}else a.push(e);i=t}),x.Children.map(a,e=>be(e,t,n,r))}[`default`,`primary`,`danger`].concat(ne(p));var Se=(0,x.forwardRef)((e,t)=>{let{className:n,style:r,children:i,prefixCls:a}=e,o=m(`${a}-icon`,n);return x.createElement(`span`,{ref:t,className:o,style:r},i)}),E=(0,x.forwardRef)((e,t)=>{let{prefixCls:n,className:r,style:i,iconClassName:a}=e,o=m(`${n}-loading-icon`,r);return x.createElement(Se,{prefixCls:n,className:o,style:i,ref:t},x.createElement(le,{className:a}))}),D=()=>({width:0,opacity:0,transform:`scale(0)`}),O=e=>({width:e.scrollWidth,opacity:1,transform:`scale(1)`}),Ce=e=>{let{prefixCls:t,loading:n,existIcon:r,className:i,style:o,mount:s}=e,c=!!n;return r?x.createElement(E,{prefixCls:t,className:i,style:o}):x.createElement(a,{visible:c,motionName:`${t}-loading-icon-motion`,motionAppear:!s,motionEnter:!s,motionLeave:!s,removeOnLeave:!0,onAppearStart:D,onAppearActive:O,onEnterStart:D,onEnterActive:O,onLeaveStart:O,onLeaveActive:D},({className:e,style:n},r)=>{let a={...o,...n};return x.createElement(E,{prefixCls:t,className:m(i,e),style:a,ref:r})})},k=()=>({"@media (prefers-reduced-motion: reduce)":{"&, &::before, &::after":{transition:`none`,animation:`none`}}}),we=()=>({"@media (prefers-reduced-motion: reduce)":{transition:`none`,animation:`none`}}),A=(e,t)=>({[`> span, > ${e}`]:{"&:not(:last-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineEndColor:t}}},"&:not(:first-child)":{[`&, & > ${e}`]:{"&:not(:disabled)":{borderInlineStartColor:t}}}}}),Te=e=>{let{componentCls:t,fontSize:n,lineWidth:r,groupBorderColor:i,colorErrorHover:a}=e;return{[`${t}-group`]:[{position:`relative`,display:`inline-flex`,[`> span, > ${t}`]:{"&:not(:last-child)":{[`&, & > ${t}`]:{borderStartEndRadius:0,borderEndEndRadius:0}},"&:not(:first-child)":{marginInlineStart:e.calc(r).mul(-1).equal(),[`&, & > ${t}`]:{borderStartStartRadius:0,borderEndStartRadius:0}}},[t]:{position:`relative`,zIndex:1,"&:hover, &:focus, &:active":{zIndex:2},"&[disabled]":{zIndex:0}},[`${t}-icon-only`]:{fontSize:n}},A(`${t}-primary`,i),A(`${t}-danger`,a)]}},j=e=>{let{paddingInline:t,onlyIconSize:n,borderColorDisabled:r}=e;return y(e,{buttonPaddingHorizontal:t,buttonPaddingVertical:0,buttonIconOnlyFontSize:n,colorBorderDisabled:r})},M=e=>{let t=e.contentFontSize??e.fontSize,n=e.contentFontSizeSM??e.fontSize,r=e.contentFontSizeLG??e.fontSizeLG,i=e.contentLineHeight??b(t),a=e.contentLineHeightSM??b(n),o=e.contentLineHeightLG??b(r),s=_e(new f(e.colorBgSolid),`#fff`)?`#000`:`#fff`,c=p.reduce((t,n)=>({...t,[`${n}ShadowColor`]:`0 ${l(e.controlOutlineWidth)} 0 ${oe(e[`${n}1`],e.colorBgContainer)}`}),{}),u=e.colorBgContainerDisabled,d=e.colorBgContainerDisabled;return{...c,fontWeight:400,iconGap:e.marginXS,defaultShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlTmpOutline}`,primaryShadow:`0 ${e.controlOutlineWidth}px 0 ${e.controlOutline}`,dangerShadow:`0 ${e.controlOutlineWidth}px 0 ${e.colorErrorOutline}`,primaryColor:e.colorTextLightSolid,dangerColor:e.colorTextLightSolid,borderColorDisabled:e.colorBorderDisabled,defaultGhostColor:e.colorBgContainer,ghostBg:`transparent`,defaultGhostBorderColor:e.colorBgContainer,paddingInline:e.paddingContentHorizontal-e.lineWidth,paddingInlineLG:e.paddingContentHorizontal-e.lineWidth,paddingInlineSM:8-e.lineWidth,onlyIconSize:`inherit`,onlyIconSizeSM:`inherit`,onlyIconSizeLG:`inherit`,groupBorderColor:e.colorPrimaryHover,linkHoverBg:`transparent`,textTextColor:e.colorText,textTextHoverColor:e.colorText,textTextActiveColor:e.colorText,textHoverBg:e.colorFillTertiary,defaultColor:e.colorText,defaultBg:e.colorBgContainer,defaultBorderColor:e.colorBorder,defaultBorderColorDisabled:e.colorBorder,defaultHoverBg:e.colorBgContainer,defaultHoverColor:e.colorPrimaryHover,defaultHoverBorderColor:e.colorPrimaryHover,defaultActiveBg:e.colorBgContainer,defaultActiveColor:e.colorPrimaryActive,defaultActiveBorderColor:e.colorPrimaryActive,solidTextColor:s,contentFontSize:t,contentFontSizeSM:n,contentFontSizeLG:r,contentLineHeight:i,contentLineHeightSM:a,contentLineHeightLG:o,paddingBlock:Math.max((e.controlHeight-t*i)/2-e.lineWidth,0),paddingBlockSM:Math.max((e.controlHeightSM-n*a)/2-e.lineWidth,0),paddingBlockLG:Math.max((e.controlHeightLG-r*o)/2-e.lineWidth,0),defaultBgDisabled:u,dashedBgDisabled:d}},Ee=e=>{let{componentCls:t,antCls:n,lineWidth:r,lineType:i}=e,[a,o]=c(n,`btn`);return{[t]:[{[a(`border-width`)]:r,[a(`border-color`)]:`#000`,[a(`border-color-hover`)]:o(`border-color`),[a(`border-color-active`)]:o(`border-color`),[a(`border-color-disabled`)]:o(`border-color`),[a(`border-style`)]:i,[a(`text-color`)]:`#000`,[a(`text-color-hover`)]:o(`text-color`),[a(`text-color-active`)]:o(`text-color`),[a(`text-color-disabled`)]:o(`text-color`),[a(`bg-color`)]:`#ddd`,[a(`bg-color-hover`)]:o(`bg-color`),[a(`bg-color-active`)]:o(`bg-color`),[a(`bg-color-disabled`)]:e.colorBgContainerDisabled,[a(`bg-color-container`)]:e.colorBgContainer,[a(`shadow`)]:`none`},{border:[o(`border-width`),o(`border-style`),o(`border-color`)].join(` `),color:o(`text-color`),backgroundColor:o(`bg-color`),[`&:not(:disabled):not(${t}-disabled)`]:{"&:hover":{border:[o(`border-width`),o(`border-style`),o(`border-color-hover`)].join(` `),color:o(`text-color-hover`),backgroundColor:o(`bg-color-hover`)},"&:active":{border:[o(`border-width`),o(`border-style`),o(`border-color-active`)].join(` `),color:o(`text-color-active`),backgroundColor:o(`bg-color-active`)}}},{[`&${t}-variant-solid`]:{[a(`solid-bg-color`)]:o(`color-base`),[a(`solid-bg-color-hover`)]:o(`color-hover`),[a(`solid-bg-color-active`)]:o(`color-active`),[a(`border-color`)]:`transparent`,[a(`text-color`)]:e.colorTextLightSolid,[a(`bg-color`)]:o(`solid-bg-color`),[a(`bg-color-hover`)]:o(`solid-bg-color-hover`),[a(`bg-color-active`)]:o(`solid-bg-color-active`),boxShadow:o(`shadow`)},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[a(`border-color`)]:o(`color-base`),[a(`border-color-hover`)]:o(`color-hover`),[a(`border-color-active`)]:o(`color-active`),[a(`bg-color`)]:o(`bg-color-container`),[a(`text-color`)]:o(`color-base`),[a(`text-color-hover`)]:o(`color-hover`),[a(`text-color-active`)]:o(`color-active`),boxShadow:o(`shadow`)},[`&${t}-variant-dashed`]:{[a(`border-style`)]:`dashed`,[a(`bg-color-disabled`)]:e.dashedBgDisabled},[`&${t}-variant-filled`]:{[a(`border-color`)]:`transparent`,[a(`text-color`)]:o(`color-base`),[a(`bg-color`)]:o(`color-light`),[a(`bg-color-hover`)]:o(`color-light-hover`),[a(`bg-color-active`)]:o(`color-light-active`)},[`&${t}-variant-text, &${t}-variant-link`]:{[a(`border-color`)]:`transparent`,[a(`text-color`)]:o(`color-base`),[a(`text-color-hover`)]:o(`color-hover`),[a(`text-color-active`)]:o(`color-active`),[a(`bg-color`)]:`transparent`,[a(`bg-color-hover`)]:`transparent`,[a(`bg-color-active`)]:`transparent`,[`&:disabled, &${e.componentCls}-disabled`]:{background:`transparent`,borderColor:`transparent`}},[`&${t}-variant-text`]:{[a(`bg-color-hover`)]:o(`color-light`),[a(`bg-color-active`)]:o(`color-light-active`)}},{[`&${t}-variant-link`]:{[a(`color-base`)]:e.colorLink,[a(`color-hover`)]:e.colorLinkHover,[a(`color-active`)]:e.colorLinkActive,[a(`bg-color-hover`)]:e.linkHoverBg},[`&${t}-color-primary`]:{[a(`color-base`)]:e.colorPrimary,[a(`color-hover`)]:e.colorPrimaryHover,[a(`color-active`)]:e.colorPrimaryActive,[a(`color-light`)]:e.colorPrimaryBg,[a(`color-light-hover`)]:e.colorPrimaryBgHover,[a(`color-light-active`)]:e.colorPrimaryBorder,[a(`shadow`)]:e.primaryShadow,[`&${t}-variant-solid`]:{[a(`text-color`)]:e.primaryColor,[a(`text-color-hover`)]:o(`text-color`),[a(`text-color-active`)]:o(`text-color`)}},[`&${t}-color-dangerous`]:{[a(`color-base`)]:e.colorError,[a(`color-hover`)]:e.colorErrorHover,[a(`color-active`)]:e.colorErrorActive,[a(`color-light`)]:e.colorErrorBg,[a(`color-light-hover`)]:e.colorErrorBgFilledHover,[a(`color-light-active`)]:e.colorErrorBgActive,[a(`shadow`)]:e.dangerShadow,[`&${t}-variant-solid`]:{[a(`text-color`)]:e.dangerColor,[a(`text-color-hover`)]:o(`text-color`),[a(`text-color-active`)]:o(`text-color`)}},[`&${t}-color-default`]:{[a(`solid-bg-color`)]:e.colorBgSolid,[a(`solid-bg-color-hover`)]:e.colorBgSolidHover,[a(`solid-bg-color-active`)]:e.colorBgSolidActive,[a(`color-base`)]:e.defaultBorderColor,[a(`color-hover`)]:e.defaultHoverBorderColor,[a(`color-active`)]:e.defaultActiveBorderColor,[a(`color-light`)]:e.colorFillTertiary,[a(`color-light-hover`)]:e.colorFillSecondary,[a(`color-light-active`)]:e.colorFill,[a(`text-color`)]:e.defaultColor,[a(`text-color-hover`)]:e.defaultHoverColor,[a(`text-color-active`)]:e.defaultActiveColor,[a(`shadow`)]:e.defaultShadow,[`&${t}-variant-outlined`]:{[a(`bg-color-disabled`)]:e.defaultBgDisabled},[`&${t}-variant-solid`]:{[a(`text-color`)]:e.solidTextColor,[a(`text-color-hover`)]:o(`text-color`),[a(`text-color-active`)]:o(`text-color`)},[`&${t}-variant-filled, &${t}-variant-text`]:{[a(`text-color-hover`)]:o(`text-color`),[a(`text-color-active`)]:o(`text-color`)},[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[a(`text-color`)]:e.defaultColor,[a(`text-color-hover`)]:e.defaultHoverColor,[a(`text-color-active`)]:e.defaultActiveColor,[a(`bg-color-container`)]:e.defaultBg,[a(`bg-color-hover`)]:e.defaultHoverBg,[a(`bg-color-active`)]:e.defaultActiveBg},[`&${t}-variant-text`]:{[a(`text-color`)]:e.textTextColor,[a(`text-color-hover`)]:e.textTextHoverColor,[a(`text-color-active`)]:e.textTextActiveColor,[a(`bg-color-hover`)]:e.textHoverBg},[`&${t}-background-ghost`]:{[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[a(`text-color`)]:e.defaultGhostColor,[a(`border-color`)]:e.defaultGhostBorderColor}}}},p.map(n=>{let r=e[`${n}6`],i=e[`${n}1`],o=e[`${n}Hover`],s=e[`${n}2`],c=e[`${n}3`],l=e[`${n}Active`],u=e[`${n}ShadowColor`];return{[`&${t}-color-${n}`]:{[a(`color-base`)]:r,[a(`color-hover`)]:o,[a(`color-active`)]:l,[a(`color-light`)]:i,[a(`color-light-hover`)]:s,[a(`color-light-active`)]:c,[a(`shadow`)]:u}}}),{[`&:disabled, &${e.componentCls}-disabled`]:{cursor:`not-allowed`,borderColor:e.colorBorderDisabled,background:o(`bg-color-disabled`),color:e.colorTextDisabled,boxShadow:`none`}},{[`&${t}-background-ghost`]:{[a(`bg-color`)]:e.ghostBg,[a(`bg-color-hover`)]:e.ghostBg,[a(`bg-color-active`)]:e.ghostBg,[a(`shadow`)]:`none`,[`&${t}-variant-outlined, &${t}-variant-dashed`]:{[a(`bg-color-hover`)]:e.ghostBg,[a(`bg-color-active`)]:e.ghostBg}}}]}},N=e=>{let{componentCls:t,iconCls:n,fontWeight:r,opacityLoading:i,motionDurationSlow:a,motionEaseInOut:o,iconGap:s,calc:c}=e;return{[t]:{outline:`none`,position:`relative`,display:`inline-flex`,gap:s,alignItems:`center`,justifyContent:`center`,fontWeight:r,whiteSpace:`nowrap`,textAlign:`center`,backgroundImage:`none`,cursor:`pointer`,transition:`all ${e.motionDurationMid} ${e.motionEaseInOut}`,userSelect:`none`,touchAction:`manipulation`,...k(),"&:disabled > *":{pointerEvents:`none`},[`${t}-icon > svg`]:fe(),[`${t}-icon`]:{display:`inline-flex`,alignItems:`center`,[n]:{verticalAlign:`middle`,"&:before":{content:`"\\a0"`,display:`inline-block`,width:0}}},"> a":{color:`currentColor`},"&:not(:disabled)":ae(e),[`&${t}-two-chinese-chars::first-letter`]:{letterSpacing:`0.34em`},[`&${t}-two-chinese-chars > *:not(${n})`]:{marginInlineEnd:`-0.34em`,letterSpacing:`0.34em`},[`&${t}-icon-only`]:{paddingInline:0,[`&${t}-compact-item`]:{flex:`none`}},[`&${t}-loading`]:{opacity:i,cursor:`default`},[`${t}-loading-icon`]:{transition:[`width`,`opacity`,`margin`].map(e=>`${e} ${a} ${o}`).join(`,`)},[`&:not(${t}-icon-end)`]:{[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start, &-appear-prepare, &-enter-prepare":{marginInlineEnd:c(s).mul(-1).equal(),opacity:0},"&-appear-active, &-enter-active":{marginInlineEnd:0},"&-leave-start":{marginInlineEnd:0},"&-leave-active":{marginInlineEnd:c(s).mul(-1).equal()}}},"&-icon-end":{flexDirection:`row-reverse`,[`${t}-loading-icon-motion`]:{"&-appear-start, &-enter-start, &-appear-prepare, &-enter-prepare":{marginInlineStart:c(s).mul(-1).equal(),opacity:0},"&-appear-active, &-enter-active":{marginInlineStart:0},"&-leave-start":{marginInlineStart:0},"&-leave-active":{marginInlineStart:c(s).mul(-1).equal()}}}}}},P=e=>({minWidth:e.controlHeight,paddingInline:0,borderRadius:`50%`}),F=(e,t=``)=>{let{componentCls:n,controlHeight:r,fontSize:i,borderRadius:a,buttonPaddingHorizontal:o,iconCls:s,buttonPaddingVertical:c,buttonIconOnlyFontSize:u}=e;return[{[t]:{fontSize:i,height:r,padding:`${l(c)} ${l(o)}`,borderRadius:a,[`&${n}-icon-only`]:{width:r,[s]:{fontSize:u}}}},{[`${n}${n}-circle${t}`]:P(e)},{[`${n}${n}-round${t}`]:{borderRadius:e.controlHeight,[`&:not(${n}-icon-only)`]:{paddingInline:e.buttonPaddingHorizontal}}}]},I=e=>F(y(e,{fontSize:e.contentFontSize}),e.componentCls),L=e=>F(y(e,{controlHeight:e.controlHeightSM,fontSize:e.contentFontSizeSM,padding:e.paddingXS,buttonPaddingHorizontal:e.paddingInlineSM,buttonPaddingVertical:0,borderRadius:e.borderRadiusSM,buttonIconOnlyFontSize:e.onlyIconSizeSM}),`${e.componentCls}-sm`),R=e=>F(y(e,{controlHeight:e.controlHeightLG,fontSize:e.contentFontSizeLG,buttonPaddingHorizontal:e.paddingInlineLG,buttonPaddingVertical:0,borderRadius:e.borderRadiusLG,buttonIconOnlyFontSize:e.onlyIconSizeLG}),`${e.componentCls}-lg`),z=e=>{let{componentCls:t}=e;return{[t]:{[`&${t}-block`]:{width:`100%`}}}},De=ue(`Button`,e=>{let t=j(e);return[N(t),I(t),L(t),R(t),z(t),Ee(t),Te(t)]},M,{unitless:{fontWeight:!0,contentLineHeight:!0,contentLineHeightSM:!0,contentLineHeightLG:!0}});function Oe(e,t,n){return{[`&-item:not(${t}-last-item)`]:{marginBottom:e.calc(e.lineWidth).mul(-1).equal()},[`&-item:not(${n}-status-success)`]:{zIndex:2},"&-item":{"&:focus,&:active":{zIndex:3},"&:hover":{zIndex:4},"&[disabled]":{zIndex:0}}}}function B(e,t){return{[`&-item:not(${t}-first-item):not(${t}-last-item)`]:{borderRadius:0},[`&-item${t}-first-item:not(${t}-last-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderEndEndRadius:0,borderEndStartRadius:0}},[`&-item${t}-last-item:not(${t}-first-item)`]:{[`&, &${e}-sm, &${e}-lg`]:{borderStartStartRadius:0,borderStartEndRadius:0}}}}function V(e){let t=`${e.componentCls}-compact-vertical`;return{[t]:{...Oe(e,t,e.componentCls),...B(e.componentCls,t)}}}var H=e=>{let{antCls:t,componentCls:n,lineWidth:r,calc:i,colorBgContainer:a}=e,o=`${n}-variant-solid:not([disabled])`,s=i(r).mul(-1).equal(),[l,u]=c(t,`btn`),d=e=>({[`${n}-compact${e?`-vertical`:``}-item`]:{[l(`compact-connect-border-color`)]:u(`bg-color-hover`),[`&${o}`]:{transition:`none`,[`& + ${o}:before`]:[{position:`absolute`,backgroundColor:u(`compact-connect-border-color`),content:`""`},e?{top:s,insetInline:s,height:r}:{insetBlock:s,insetInlineStart:s,width:r}],"&:hover:before":{display:`none`}}}});return[d(),d(!0),{[`${o}${n}-color-default`]:{[l(`compact-connect-border-color`)]:`color-mix(in srgb, ${u(`bg-color-hover`)} 75%, ${a})`}}]},ke=s([`Button`,`compact`],e=>{let t=j(e);return[i(t),V(t),H(t)]},M);function Ae(e){if(ce(e)){let t=e?.delay;return t=d(t)?t:0,{loading:t<=0,delay:t}}return{loading:!!e,delay:0}}var je={default:[`default`,`outlined`],primary:[`primary`,`solid`],dashed:[`default`,`dashed`],link:[`link`,`link`],text:[`default`,`text`]},U=x.forwardRef((e,n)=>{let{_skipSemantic:i,loading:a=!1,prefixCls:s,color:c,variant:l,type:d,danger:f=!1,shape:ee,size:p,disabled:ne,className:ae,rootClassName:oe,children:h,icon:g,iconPosition:le,iconPlacement:ue,ghost:_=!1,block:v=!1,htmlType:fe=`button`,classNames:y,styles:b,style:_e,autoInsertSpace:ye,autoFocus:S,...w}=e,be=ie(h),E=d||`default`,{getPrefixCls:D,direction:O,autoInsertSpace:k,className:we,style:A,classNames:Te,styles:j,loadingIcon:M,shape:Ee,color:N,variant:P}=o(`button`),F=ee||Ee||`default`,[I,L]=(0,x.useMemo)(()=>{if(c&&l)return[c,l];if(d||f){let e=je[E]||[];return f?[`danger`,e[1]]:e}return l===`solid`?[`primary`,l]:N&&P?[N,P]:P===`solid`?[`primary`,P]:[`default`,`outlined`]},[c,l,d,f,N,P,E]),[R,z]=(0,x.useMemo)(()=>_&&L===`solid`?[I,`outlined`]:[I,L],[I,L,_]),Oe=R===`danger`,B=Oe?`dangerous`:R,V=ye??k??!0,H=D(`btn`,s),[U,Me]=De(H),Ne=(0,x.useContext)(se),W=ne??Ne,Pe=(0,x.useContext)(ve),G=(0,x.useMemo)(()=>Ae(a),[a]),[K,Fe]=pe(G.loading),[q,Ie]=(0,x.useState)(!1),J=(0,x.useRef)(null),Le=he(n,J),Re=be.length===1&&!g&&!T(z),Y=(0,x.useRef)(!0);x.useEffect(()=>(Y.current=!1,()=>{Y.current=!0}),[]),u(()=>{G.delay>0?Fe(!0,{ms:G.delay}):Fe(G.loading,!0)},[G.delay,G.loading]),(0,x.useEffect)(()=>{if(!J.current||!V)return;let e=J.current.textContent||``;Re&&C(e)?q||Ie(!0):q&&Ie(!1)}),(0,x.useEffect)(()=>{S&&J.current?.focus()},[]);let ze=x.useCallback(t=>{K||W?t.preventDefault():e.onClick?.((`href`in e,t))},[e.onClick,K,W]),{compactSize:Be,compactItemClassnames:Ve}=re(H,O),X=te(e=>p??Be??Pe??e),He=K?`loading`:g,Ue=ue??le??`start`,Z=t(w,[`navigate`]),We={...e,type:E,color:R,variant:z,danger:Oe,shape:F,size:X,disabled:W,loading:K,iconPlacement:Ue},Ge=me(A),Ke=me(_e),[Q,$]=r([i?void 0:Te,y],[i?void 0:j,Ge,b,Ke],{props:We}),qe=m(H,U,Me,{[`${H}-${F}`]:F!=="default"&&F!==`square`&&F,[`${H}-${E}`]:E,[`${H}-dangerous`]:f,[`${H}-color-${B}`]:B,[`${H}-variant-${z}`]:z,[`${H}-lg`]:X===`large`,[`${H}-sm`]:X===`small`,[`${H}-icon-only`]:!h&&h!==0&&!!He,[`${H}-background-ghost`]:_&&!T(z),[`${H}-loading`]:K,[`${H}-two-chinese-chars`]:q&&V&&!K,[`${H}-block`]:v,[`${H}-rtl`]:O===`rtl`,[`${H}-icon-end`]:Ue===`end`},Ve,ae,oe,we,Q.root),Je={className:Q.icon,style:$.icon},Ye=e=>x.createElement(Se,{prefixCls:H,...Je},e),Xe=x.createElement(Ce,{existIcon:!!g,prefixCls:H,loading:K,mount:Y.current,...Je}),Ze=ce(a)&&a.icon||M,Qe;Qe=g&&!K?Ye(g):K&&Ze?Ye(Ze):Xe;let $e=de(h)?xe(h,Re&&V,$.content,Q.content):null;if(Z.href!==void 0)return x.createElement(`a`,{...Z,className:m(qe,{[`${H}-disabled`]:W}),href:W?void 0:Z.href,style:$.root,onClick:ze,ref:Le,tabIndex:W?-1:0,"aria-disabled":W},Qe,$e);let et=x.createElement(`button`,{...w,type:fe,className:qe,style:$.root,onClick:ze,disabled:W,ref:Le},Qe,$e,Ve&&x.createElement(ke,{prefixCls:H}));return T(z)||(et=x.createElement(ge,{component:`Button`,disabled:K},et)),et});U.Group=ye,U.__ANT_BUTTON=!0;var Me=U;export{w as a,k as i,U as n,we as r,Me as t};