var pe=Object.defineProperty,ve=Object.defineProperties;var ye=Object.getOwnPropertyDescriptors;var le=Object.getOwnPropertySymbols;var me=Object.prototype.hasOwnProperty,be=Object.prototype.propertyIsEnumerable;var oe=(t,e,n)=>e in t?pe(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,w=(t,e)=>{for(var n in e||(e={}))me.call(e,n)&&oe(t,n,e[n]);if(le)for(var n of le(e))be.call(e,n)&&oe(t,n,e[n]);return t},V=(t,e)=>ve(t,ye(e));import{p as a,X as L,a0 as Se,s as M,F as Ce,dE as ge,g7 as xe,g8 as he,_ as P,ak as z,a as q,a5 as we,br as Pe,aw as ae,S as ue,ah as _e,a1 as $e,bF as re,f as k,ax as se,aK as De,cn as je,au as Oe,b as Ie,dR as Ee,k as p,aD as ke,de as Re,g9 as Le,cD as Me,aB as K,be as Ne,az as Ae,dg as Be,L as ze}from"./index.96e740c6.js";import{g as Fe}from"./get.f812c6f0.js";function B(t){return t!=null}var Ue=function(e){var n=e.itemPrefixCls,l=e.component,r=e.span,o=e.labelStyle,c=e.contentStyle,y=e.bordered,i=e.label,d=e.content,u=e.colon,_=l;if(y){var x;return a(_,{class:[(x={},L(x,"".concat(n,"-item-label"),B(i)),L(x,"".concat(n,"-item-content"),B(d)),x)],colSpan:r},{default:function(){return[B(i)&&a("span",{style:o},[i]),B(d)&&a("span",{style:c},[d])]}})}return a(_,{class:["".concat(n,"-item")],colSpan:r},{default:function(){return[a("div",{class:"".concat(n,"-item-container")},[i&&a("span",{class:["".concat(n,"-item-label"),L({},"".concat(n,"-item-no-colon"),!u)],style:o},[i]),d&&a("span",{class:"".concat(n,"-item-content"),style:c},[d])])]}})},X=Ue,We=function(e){var n=function(x,m,b){var E=m.colon,N=m.prefixCls,s=m.bordered,S=b.component,v=b.type,h=b.showLabel,D=b.showContent,j=b.labelStyle,$=b.contentStyle;return x.map(function(C,O){var I,g,f=C.props||{},A=f.prefixCls,F=A===void 0?N:A,G=f.span,H=G===void 0?1:G,J=f.labelStyle,Q=J===void 0?f["label-style"]:J,Y=f.contentStyle,Z=Y===void 0?f["content-style"]:Y,ee=f.label,te=ee===void 0?(I=C.children)===null||I===void 0||(g=I.label)===null||g===void 0?void 0:g.call(I):ee,ne=ge(C),U=xe(C),W=he(C),T=C.key;return typeof S=="string"?a(X,{key:"".concat(v,"-").concat(String(T)||O),class:U,style:W,labelStyle:P(P({},j),Q),contentStyle:P(P({},$),Z),span:H,colon:E,component:S,itemPrefixCls:F,bordered:s,label:h?te:null,content:D?ne:null},null):[a(X,{key:"label-".concat(String(T)||O),class:U,style:P(P(P({},j),W),Q),span:1,colon:E,component:S[0],itemPrefixCls:F,bordered:s,label:te},null),a(X,{key:"content-".concat(String(T)||O),class:U,style:P(P(P({},$),W),Z),span:H*2-1,component:S[1],itemPrefixCls:F,bordered:s,content:ne},null)]})},l=e.prefixCls,r=e.vertical,o=e.row,c=e.index,y=e.bordered,i=Se(fe,{labelStyle:M({}),contentStyle:M({})}),d=i.labelStyle,u=i.contentStyle;return r?a(Ce,null,[a("tr",{key:"label-".concat(c),class:"".concat(l,"-row")},[n(o,e,{component:"th",type:"label",showLabel:!0,labelStyle:d.value,contentStyle:u.value})]),a("tr",{key:"content-".concat(c),class:"".concat(l,"-row")},[n(o,e,{component:"td",type:"content",showContent:!0,labelStyle:d.value,contentStyle:u.value})])]):a("tr",{key:c,class:"".concat(l,"-row")},[n(o,e,{component:y?["th","td"]:"td",type:"item",showLabel:!0,showContent:!0,labelStyle:d.value,contentStyle:u.value})])},Te=We;z.any;var Ve=function(){return{prefixCls:String,label:z.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}}},Ke=q({compatConfig:{MODE:3},name:"ADescriptionsItem",props:Ve(),slots:["label"],setup:function(e,n){var l=n.slots;return function(){var r;return(r=l.default)===null||r===void 0?void 0:r.call(l)}}}),de={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function Xe(t,e){if(typeof t=="number")return t;if(ue(t)==="object")for(var n=0;nn)&&(l=je(t,{span:n}),Oe(e===void 0,"Descriptions","Sum of column `span` in a line not match `column` of Descriptions.")),l}function qe(t,e){var n=De(t),l=[],r=[],o=e;return n.forEach(function(c,y){var i,d=(i=c.props)===null||i===void 0?void 0:i.span,u=d||1;if(y===n.length-1){r.push(ce(c,d,o)),l.push(r);return}u["small","default","middle",void 0].includes(t),default:"small"},bordered:{type:Boolean,default:!0},column:{type:[Number,Object],default:()=>({xxl:4,xl:3,lg:3,md:3,sm:2,xs:1})},collapseOptions:{type:Object,default:null},schema:{type:Array,default:()=>[]},data:{type:Object}};var Qe=q({name:"Description",props:Je,emits:["register"],setup(t,{slots:e,emit:n}){const l=M(null),{prefixCls:r}=Ie("description"),o=Ee(),c=k(()=>w(w({},t),p(l))),y=k(()=>V(w({},p(c)),{title:void 0})),i=k(()=>!!p(c).title),d=k(()=>w({canExpand:!1},p(y).collapseOptions)),u=k(()=>w(w({},p(o)),p(y)));function _(s){l.value=w(w({},p(l)),s)}function x({label:s,labelMinWidth:S,labelStyle:v}){if(!v&&!S)return s;const h=V(w({},v),{minWidth:`${S}px `});return a("div",{style:h},[s])}function m(){const{schema:s,data:S}=p(y);return p(s).map(v=>{const{render:h,field:D,span:j,show:$,contentMinWidth:C}=v;if($&&K($)&&!$(S))return null;const O=()=>{var A;const g=(A=p(y))==null?void 0:A.data;if(!g)return null;const f=Fe(g,D);return f&&!Ne(g).hasOwnProperty(D)?K(h)?h("",g):"":K(h)?h(f,g):f!=null?f:""},I=C;return a(ie.Item,{label:x(v),key:D,span:j},{default:()=>{if(!C)return O();const g={minWidth:`${I}px`};return a("div",{style:g},[O()])}})}).filter(v=>!!v)}const b=()=>{let s;return a(ie,ke({class:`${r}`},p(u)),He(s=m())?s:{default:()=>[s]})},E=()=>{const s=t.useCollapse?b():a("div",null,[b()]);if(!t.useCollapse)return s;const{canExpand:S,helpMessage:v}=p(d),{title:h}=p(c);return a(Le,{title:h,canExpan:S,helpMessage:v},{default:()=>s,action:()=>Re(e,"action")})};return n("register",{setDescProps:_}),()=>p(i)?E():b()}});function tt(t){if(!Ae())throw new Error("useDescription() can only be used inside setup() or functional components!");const e=M(null),n=M(!1);function l(o){p(n)&&Be()||(e.value=o,t&&o.setDescProps(t),n.value=!0)}return[l,{setDescProps:o=>{var c;(c=p(e))==null||c.setDescProps(o)}}]}const nt=ze(Qe);export{nt as D,tt as u};