const e=require("../_util/warning.js"),t=require("../_util/props-util/index.js"),n=require("../config-provider/hooks/useConfigInject.js"),r=require("../_util/vue-types/index.js"),i=require("../_util/vnode.js"),a=require("../_util/responsiveObserve.js"),o=require("./Row.js"),s=require("./style/index.js");let c=require("vue");r.default.any;var l=(0,c.defineComponent)({compatConfig:{MODE:3},name:`ADescriptionsItem`,props:{prefixCls:String,label:r.default.any,labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0},span:{type:Number,default:1}},setup(e,{slots:t}){return()=>t.default?.()}}),u={xxxl:3,xxl:3,xl:3,lg:3,md:3,sm:2,xs:1};function d(e,t){if(typeof e==`number`)return e;if(typeof e==`object`)for(let n=0;n<a.responsiveArray.length;n++){let r=a.responsiveArray[n];if(t[r]&&e[r]!==void 0)return e[r]||u[r]}return 3}function f(t,n,r){let a=t;return(r===void 0||r>n)&&(a=i.cloneElement(t,{span:n}),e.default(r===void 0,`Descriptions`,"Sum of column `span` in a line not match `column` of Descriptions.")),a}function p(e,n){let r=t.flattenChildren(e),i=[],a=[],o=n;return r.forEach((e,t)=>{let s=e.props?.span,c=s||1;if(t===r.length-1){a.push(f(e,o,s)),i.push(a);return}c<o?(o-=c,a.push(e)):(a.push(f(e,o,c)),i.push(a),o=n,a=[])}),i}var m=()=>({prefixCls:String,bordered:{type:Boolean,default:void 0},size:{type:String,default:`default`},title:r.default.any,extra:r.default.any,column:{type:[Number,Object],default:()=>u},layout:String,colon:{type:Boolean,default:void 0},labelStyle:{type:Object,default:void 0},contentStyle:{type:Object,default:void 0}}),h=Symbol(`descriptionsContext`),g=(0,c.defineComponent)({compatConfig:{MODE:3},name:`ADescriptions`,inheritAttrs:!1,props:m(),slots:Object,Item:l,setup(e,{slots:t,attrs:r}){let{prefixCls:i,direction:l}=n.default(`descriptions`,e),u,f=(0,c.ref)({}),[m,g]=s.default(i),_=a.default();(0,c.onBeforeMount)(()=>{u=_.value.subscribe(t=>{typeof e.column==`object`&&(f.value=t)})}),(0,c.onBeforeUnmount)(()=>{_.value.unsubscribe(u)}),(0,c.provide)(h,{labelStyle:(0,c.toRef)(e,`labelStyle`),contentStyle:(0,c.toRef)(e,`contentStyle`)});let v=(0,c.computed)(()=>d(e.column,f.value));return()=>{let{size:n,bordered:a=!1,layout:s=`horizontal`,colon:u=!0,title:d=t.title?.(),extra:f=t.extra?.()}=e,h=t.default?.(),_=p(h,v.value);return m((0,c.createVNode)(`div`,{...r,class:[i.value,{[`${i.value}-${n}`]:n!=="default",[`${i.value}-bordered`]:!!a,[`${i.value}-rtl`]:l.value===`rtl`},r.class,g.value]},[(d||f)&&(0,c.createVNode)(`div`,{class:`${i.value}-header`},[d&&(0,c.createVNode)(`div`,{class:`${i.value}-title`},[d]),f&&(0,c.createVNode)(`div`,{class:`${i.value}-extra`},[f])]),(0,c.createVNode)(`div`,{class:`${i.value}-view`},[(0,c.createVNode)(`table`,null,[(0,c.createVNode)(`tbody`,null,[_.map((e,t)=>(0,c.createVNode)(o.default,{key:t,index:t,colon:u,prefixCls:i.value,vertical:s===`vertical`,bordered:a,row:e},null))])])])]))}}});g.install=function(e){return e.component(g.name,g),e.component(g.Item.name,g.Item),e},exports.DescriptionsItem=l,exports.default=g,exports.descriptionsContext=h,exports.descriptionsProps=m;