import{i as Tt,u as Y,R as at,P as Ct,L as it,l as xt,h as f,G as St,m as gt,d as L,W as kt}from"./default-1fc3bc07.js";import{w as rt,i as wt}from"./addEventListener-88586f3d.js";import{aa as V,h as bt,an as pt,a6 as yt,a9 as Nt,d as h,ae as At,r as R,c as G,z as Lt,aq as _t,am as Bt,ax as It}from"./index-f1c6abff.js";function Ft(n,t){for(var a=Tt({},n),i=0;i=0)){m=document.createElement("div"),m.className="".concat(l.value,"-click-animating-node");var r=I();if(e.removeAttribute(r),e.setAttribute(r,"true"),w=w||document.createElement("style"),u&&u!=="#ffffff"&&u!=="rgb(255, 255, 255)"&&Ot(u)&&!/rgba\(\d*, \d*, \d*, 0\)/.test(u)&&u!=="transparent"){var g;(g=s.value)!==null&&g!==void 0&&g.nonce&&(w.nonce=s.value.nonce),m.style.borderColor=u,w.innerHTML=` [`.concat(l.value,"-click-animating-without-extra-node='true']::after, .").concat(l.value,`-click-animating-node { --antd-wave-shadow-color: `).concat(u,`; }`),document.body.contains(w)||document.body.appendChild(w)}N&&e.appendChild(m),U.addStartEventListener(e,y),U.addEndEventListener(e,k)}},z=function(e){if(!(!e||e===m||!(e instanceof Element))){var u=t.insertExtraNode,N=I();e.setAttribute(N,"false"),w&&(w.innerHTML=""),u&&m&&e.contains(m)&&e.removeChild(m),U.removeStartEventListener(e,y),U.removeEndEventListener(e,k)}},P=function(e){if(!(!e||!e.getAttribute||e.getAttribute("disabled")||e.className.indexOf("disabled")>=0)){var u=function(o){if(!(o.target.tagName==="INPUT"||ut(o.target))){z(e);var r=getComputedStyle(e).getPropertyValue("border-top-color")||getComputedStyle(e).getPropertyValue("border-color")||getComputedStyle(e).getPropertyValue("background-color");C=setTimeout(function(){return M(e,r)},0),rt.cancel(O),x=!0,O=rt(function(){x=!1},10)}};return e.addEventListener("click",u,!0),{cancel:function(){e.removeEventListener("click",u,!0)}}}};return bt(function(){pt(function(){var c=at(v);c.nodeType===1&&(S=P(c))})}),yt(function(){S&&S.cancel(),clearTimeout(C),A=!0}),function(){var c;return(c=i.default)===null||c===void 0?void 0:c.call(i)[0]}}});function Vt(n){return n==="danger"?{danger:!0}:{type:n}}var Wt=function(){return{prefixCls:String,type:String,htmlType:{type:String,default:"button"},shape:{type:String},size:{type:String},loading:{type:[Boolean,Object],default:function(){return!1}},disabled:{type:Boolean,default:void 0},ghost:{type:Boolean,default:void 0},block:{type:Boolean,default:void 0},danger:{type:Boolean,default:void 0},icon:Ct.any,href:String,target:String,title:String,onClick:{type:Function},onMousedown:{type:Function}}};const jt=Wt;var st=function(t){t&&(t.style.width="0px",t.style.opacity="0",t.style.transform="scale(0)")},ct=function(t){pt(function(){t&&(t.style.width="".concat(t.scrollWidth,"px"),t.style.opacity="1",t.style.transform="scale(1)")})},ft=function(t){t&&t.style&&(t.style.width=null,t.style.opacity=null,t.style.transform=null)};const Dt=V({compatConfig:{MODE:3},name:"LoadingIcon",props:{prefixCls:String,loading:[Boolean,Object],existIcon:Boolean},setup:function(t){return function(){var a=t.existIcon,i=t.prefixCls,d=t.loading;if(a)return h("span",{class:"".concat(i,"-loading-icon")},[h(it,null,null)]);var v=!!d;return h(At,{name:"".concat(i,"-loading-icon-motion"),onBeforeEnter:st,onEnter:ct,onAfterEnter:ft,onBeforeLeave:ct,onLeave:function(s){setTimeout(function(){st(s)})},onAfterLeave:ft},{default:function(){return[v?h("span",{class:"".concat(i,"-loading-icon")},[h(it,null,null)]):null]}})}}});var dt=/^[\u4e00-\u9fa5]{2}$/,vt=dt.test.bind(dt);function $(n){return n==="text"||n==="link"}const F=V({compatConfig:{MODE:3},name:"AButton",inheritAttrs:!1,__ANT_BUTTON:!0,props:wt(jt(),{type:"default"}),slots:["icon"],setup:function(t,a){var i=a.slots,d=a.attrs,v=a.emit,p=a.expose,s=Y("btn",t),l=s.prefixCls,S=s.autoInsertSpaceInButton,C=s.direction,O=s.size,x=R(null),m=R(void 0),A=!1,y=R(!1),k=R(!1),I=G(function(){return S.value!==!1}),M=G(function(){return xt(t.loading)==="object"&&t.loading.delay?t.loading.delay||!0:!!t.loading});Lt(M,function(o){clearTimeout(m.value),typeof M.value=="number"?m.value=setTimeout(function(){y.value=o},M.value):y.value=o},{immediate:!0});var z=G(function(){var o,r=t.type,g=t.shape,E=g===void 0?"default":g,T=t.ghost,H=t.block,q=t.danger,b=l.value,W={large:"lg",small:"sm",middle:void 0},j=O.value,D=j&&W[j]||"";return o={},f(o,"".concat(b),!0),f(o,"".concat(b,"-").concat(r),r),f(o,"".concat(b,"-").concat(E),E!=="default"&&E),f(o,"".concat(b,"-").concat(D),D),f(o,"".concat(b,"-loading"),y.value),f(o,"".concat(b,"-background-ghost"),T&&!$(r)),f(o,"".concat(b,"-two-chinese-chars"),k.value&&I.value),f(o,"".concat(b,"-block"),H),f(o,"".concat(b,"-dangerous"),!!q),f(o,"".concat(b,"-rtl"),C.value==="rtl"),o}),P=function(){var r=x.value;if(!(!r||S.value===!1)){var g=r.textContent;A&&vt(g)?k.value||(k.value=!0):k.value&&(k.value=!1)}},c=function(r){if(y.value||t.disabled){r.preventDefault();return}v("click",r)},e=function(r,g){var E=g?" ":"";if(r.type===It){var T=r.children.trim();return vt(T)&&(T=T.split("").join(E)),h("span",null,[T])}return r};_t(function(){St(!(t.ghost&&$(t.type)),"Button","`link` or `text` button can't be a `ghost` button.")}),bt(P),Bt(P),yt(function(){m.value&&clearTimeout(m.value)});var u=function(){var r;(r=x.value)===null||r===void 0||r.focus()},N=function(){var r;(r=x.value)===null||r===void 0||r.blur()};return p({focus:u,blur:N}),function(){var o,r,g=t.icon,E=g===void 0?(o=i.icon)===null||o===void 0?void 0:o.call(i):g,T=gt((r=i.default)===null||r===void 0?void 0:r.call(i));A=T.length===1&&!E&&!$(t.type);var H=t.type,q=t.htmlType,b=t.disabled,W=t.href,j=t.title,D=t.target,Et=t.onMousedown,ht=y.value?"loading":E,J=L(L({},d),{},{title:j,disabled:b,class:[z.value,d.class,f({},"".concat(l.value,"-icon-only"),T.length===0&&!!ht)],onClick:c,onMousedown:Et});b||delete J.disabled;var Z=E&&!y.value?E:h(Dt,{existIcon:!!E,prefixCls:l.value,loading:!!y.value},null),tt=T.map(function(et){return e(et,A&&I.value)});if(W!==void 0)return h("a",L(L({},J),{},{href:W,target:D,ref:x}),[Z,tt]);var nt=h("button",L(L({},J),{},{ref:x,type:q}),[Z,tt]);return $(H)?nt:h(Pt,{ref:"wave",disabled:!!y.value},{default:function(){return[nt]}})}}});function mt(n,t){for(var a=0;a