import{a as ba,aa as g,U as ga,eQ as v,aR as va,J as c,j as a,bL as xa,aW as ha,cj as q,eR as ya,eg as ma}from"./index.bde7963b.js";import{T as H}from"./index.357d6afd.js";import{R as x,C as p}from"./index.b75cc0a1.js";var _a=H.TabPane,wa=function(){return{prefixCls:String,title:g.any,extra:g.any,bordered:{type:Boolean,default:!0},bodyStyle:{type:Object,default:void 0},headStyle:{type:Object,default:void 0},loading:{type:Boolean,default:!1},hoverable:{type:Boolean,default:!1},type:{type:String},size:{type:String},actions:g.any,tabList:{type:Array},tabBarExtraContent:g.any,activeTabKey:String,defaultActiveTabKey:String,cover:g.any,onTabChange:{type:Function}}},Ca=ba({name:"ACard",props:wa(),slots:["title","extra","tabBarExtraContent","actions","cover","customTab"],setup:function(n,X){var r=X.slots,m=ga("card",n),Y=m.prefixCls,Z=m.direction,B=m.size,aa=function(o){var i=o.map(function(l,f){return q(l)&&!ya(l)||!q(l)?a("li",{style:{width:"".concat(100/o.length,"%")},key:"action-".concat(f)},[a("span",null,[l])]):null});return i},ta=function(o){var i;(i=n.onTabChange)===null||i===void 0||i.call(n,o)},na=function(){var o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],i;return o.forEach(function(l){l&&ma(l.type)&&l.type.__ANT_CARD_GRID&&(i=!0)}),i};return function(){var d,o,i,l,f,_,w,C,E=n.headStyle,ea=E===void 0?{}:E,P=n.bodyStyle,k=P===void 0?{}:P,K=n.loading,$=n.bordered,ra=$===void 0?!0:$,j=n.type,u=n.tabList,da=n.hoverable,R=n.activeTabKey,oa=n.defaultActiveTabKey,L=n.tabBarExtraContent,D=L===void 0?v((i=r.tabBarExtraContent)===null||i===void 0?void 0:i.call(r)):L,G=n.title,T=G===void 0?v((l=r.title)===null||l===void 0?void 0:l.call(r)):G,I=n.extra,z=I===void 0?v((f=r.extra)===null||f===void 0?void 0:f.call(r)):I,N=n.actions,S=N===void 0?v((_=r.actions)===null||_===void 0?void 0:_.call(r)):N,O=n.cover,W=O===void 0?v((w=r.cover)===null||w===void 0?void 0:w.call(r)):O,h=va((C=r.default)===null||C===void 0?void 0:C.call(r)),t=Y.value,ia=(d={},c(d,"".concat(t),!0),c(d,"".concat(t,"-loading"),K),c(d,"".concat(t,"-bordered"),ra),c(d,"".concat(t,"-hoverable"),!!da),c(d,"".concat(t,"-contain-grid"),na(h)),c(d,"".concat(t,"-contain-tabs"),u&&u.length),c(d,"".concat(t,"-").concat(B.value),B.value),c(d,"".concat(t,"-type-").concat(j),!!j),c(d,"".concat(t,"-rtl"),Z.value==="rtl"),d),la=k.padding===0||k.padding==="0px"?{padding:"24px"}:void 0,s=a("div",{class:"".concat(t,"-loading-block")},null),ca=a("div",{class:"".concat(t,"-loading-content"),style:la},[a(x,{gutter:8},{default:function(){return[a(p,{span:22},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:8},{default:function(){return[s]}}),a(p,{span:15},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:6},{default:function(){return[s]}}),a(p,{span:18},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:13},{default:function(){return[s]}}),a(p,{span:9},{default:function(){return[s]}})]}}),a(x,{gutter:8},{default:function(){return[a(p,{span:4},{default:function(){return[s]}}),a(p,{span:3},{default:function(){return[s]}}),a(p,{span:16},{default:function(){return[s]}})]}})]),U=R!==void 0,sa=(o={size:"large"},c(o,U?"activeKey":"defaultActiveKey",U?R:oa),c(o,"onChange",ta),c(o,"class","".concat(t,"-head-tabs")),o),V,F=u&&u.length?a(H,sa,{default:function(){return[u.map(function(e){var J=e.tab,y=e.slots,Q=y==null?void 0:y.tab;xa(!y,"Card","tabList slots is deprecated, Please use `customTab` instead.");var A=J!==void 0?J:r[Q]?r[Q](e):null;return A=ha(r,"customTab",e,function(){return[A]}),a(_a,{tab:A,key:e.key,disabled:e.disabled},null)})]},rightExtra:D?function(){return D}:null}):null;(T||z||F)&&(V=a("div",{class:"".concat(t,"-head"),style:ea},[a("div",{class:"".concat(t,"-head-wrapper")},[T&&a("div",{class:"".concat(t,"-head-title")},[T]),z&&a("div",{class:"".concat(t,"-extra")},[z])]),F]));var pa=W?a("div",{class:"".concat(t,"-cover")},[W]):null,fa=a("div",{class:"".concat(t,"-body"),style:k},[K?ca:h]),ua=S&&S.length?a("ul",{class:"".concat(t,"-actions")},[aa(S)]):null;return a("div",{class:ia,ref:"cardContainerRef"},[V,pa,h&&h.length?fa:null,ua])}}}),Sa=Ca;export{Sa as C};
