import{defineComponent as w,createVNode as n}from"vue";import k from"../_util/classNames.mjs";import x from"../_util/props-util/initDefaultProps.mjs";import b from"../config-provider/hooks/useConfigInject.mjs";import j from"./Element.mjs";import N from"./Paragraph.mjs";import O from"./Title.mjs";import z from"./style/index.mjs";const D=()=>({active:{type:Boolean,default:void 0},loading:{type:Boolean,default:void 0},prefixCls:String,avatar:{type:[Boolean,Object],default:void 0},title:{type:[Boolean,Object],default:void 0},paragraph:{type:[Boolean,Object],default:void 0},round:{type:Boolean,default:void 0}});function d(e){return e&&typeof e=="object"?e:{}}function E(e,r){return e&&!r?{size:"large",shape:"square"}:{size:"large",shape:"circle"}}function I(e,r){return!e&&r?{width:"38%"}:e&&r?{width:"50%"}:{}}function T(e,r){const a={};return(!e||!r)&&(a.width="61%"),!e&&r?a.rows=3:a.rows=2,a}const J=w({compatConfig:{MODE:3},name:"ASkeleton",props:x(D(),{avatar:!1,title:!0,paragraph:!0}),setup(e,{slots:r}){const{prefixCls:a,direction:v}=b("skeleton",e),[P,$]=z(a);return()=>{const{loading:B,avatar:f,title:p,paragraph:u,active:C,round:y}=e,t=a.value;if(B||e.loading===void 0){const o=!!f||f==="",i=!!p||p==="",l=!!u||u==="";let m;if(o){const s={prefixCls:`${t}-avatar`,...E(i,l),...d(f)};m=n("div",{class:`${t}-header`},[n(j,s,null)])}let g;if(i||l){let s;if(i){const c={prefixCls:`${t}-title`,...I(o,l),...d(p)};s=n(O,c,null)}let h;if(l){const c={prefixCls:`${t}-paragraph`,...T(o,i),...d(u)};h=n(N,c,null)}g=n("div",{class:`${t}-content`},[s,h])}const S=k(t,{[`${t}-with-avatar`]:o,[`${t}-active`]:C,[`${t}-rtl`]:v.value==="rtl",[`${t}-round`]:y,[$.value]:!0});return P(n("div",{class:S},[m,g]))}return r.default?.()}}});export{J as default,D as skeletonProps};
