const e=require("../_virtual/_rolldown/runtime.js"),t=require("../_util/props-util/index.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/vue-types/index.js"),i=require("../vc-util/devWarning.js"),a=require("../_util/vnode.js"),o=require("../skeleton/index.js"),s=require("../tabs/index.js"),c=require("./style/index.js");let l=require("vue"),u=require("lodash-es/isPlainObject");u=e.__toESM(u,1);var{TabPane:d}=s.default,f=()=>({prefixCls:String,title:r.default.any,extra:r.default.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:r.default.any,tabList:{type:Array},tabBarExtraContent:r.default.any,activeTabKey:String,defaultActiveTabKey:String,cover:r.default.any,onTabChange:{type:Function}}),p=(0,l.defineComponent)({compatConfig:{MODE:3},name:`ACard`,inheritAttrs:!1,props:f(),slots:Object,setup(e,{slots:r,attrs:f}){let{prefixCls:p,direction:m,size:h}=n.default(`card`,e),[g,_]=c.default(p),v=e=>e.map((n,r)=>(0,l.isVNode)(n)&&!t.isEmptyElement(n)||!(0,l.isVNode)(n)?(0,l.createVNode)(`li`,{style:{width:`${100/e.length}%`},key:`action-${r}`},[(0,l.createVNode)(`span`,null,[n])]):null),y=t=>{e.onTabChange?.(t)},b=(e=[])=>{let t;return e.forEach(e=>{e&&(0,u.default)(e.type)&&e.type.__ANT_CARD_GRID&&(t=!0)}),t};return()=>{let{headStyle:n={},bodyStyle:c={},loading:u,bordered:x=!0,type:S,tabList:C,hoverable:w,activeTabKey:T,defaultActiveTabKey:E,tabBarExtraContent:D=t.filterEmptyWithUndefined(r.tabBarExtraContent?.()),title:O=t.filterEmptyWithUndefined(r.title?.()),extra:k=t.filterEmptyWithUndefined(r.extra?.()),actions:A=t.filterEmptyWithUndefined(r.actions?.()),cover:j=t.filterEmptyWithUndefined(r.cover?.())}=e,M=t.flattenChildren(r.default?.()),N=p.value,P={[`${N}`]:!0,[_.value]:!0,[`${N}-loading`]:u,[`${N}-bordered`]:x,[`${N}-hoverable`]:!!w,[`${N}-contain-grid`]:b(M),[`${N}-contain-tabs`]:C&&C.length,[`${N}-${h.value}`]:h.value,[`${N}-type-${S}`]:!!S,[`${N}-rtl`]:m.value===`rtl`},F=(0,l.createVNode)(o.default,{loading:!0,active:!0,paragraph:{rows:4},title:!1},{default:()=>[M]}),I=T!==void 0,L={size:`large`,[I?`activeKey`:`defaultActiveKey`]:I?T:E,onChange:y,class:`${N}-head-tabs`},R,z=C&&C.length?(0,l.createVNode)(s.default,L,{default:()=>[C.map(e=>{let{tab:t,slots:n}=e,o=n?.tab;i.default(!n,`Card`,"tabList slots is deprecated, Please use `customTab` instead.");let s=t===void 0?r[o]?r[o](e):null:t;return s=a.customRenderSlot(r,`customTab`,e,()=>[s]),(0,l.createVNode)(d,{tab:s,key:e.key,disabled:e.disabled},null)})],rightExtra:D?()=>D:null}):null;(O||k||z)&&(R=(0,l.createVNode)(`div`,{class:`${N}-head`,style:n},[(0,l.createVNode)(`div`,{class:`${N}-head-wrapper`},[O&&(0,l.createVNode)(`div`,{class:`${N}-head-title`},[O]),k&&(0,l.createVNode)(`div`,{class:`${N}-extra`},[k])]),z]));let B=j?(0,l.createVNode)(`div`,{class:`${N}-cover`},[j]):null,V=(0,l.createVNode)(`div`,{class:`${N}-body`,style:c},[u?F:M]),H=A&&A.length?(0,l.createVNode)(`ul`,{class:`${N}-actions`},[v(A)]):null;return g((0,l.createVNode)(`div`,{ref:`cardContainerRef`,...f,class:[P,f.class]},[R,B,M&&M.length?V:null,H]))}}});exports.cardProps=f,exports.default=p;