Files
xin-procurement/public/assets/button-BILozH6U.js
T
2026-08-20 16:54:34 +08:00

1 line
19 KiB
JavaScript

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