import{A as e,D as t,_ as n,d as r}from"./vue.runtime.esm-bundler-gHHLlCcd.js";import{T as i}from"./backend-BIDAMQu4.js";import{D as a,Jt as o,St as s,Yt as c,it as l,on as u,w as d}from"./_plugin-vue_export-helper-BgFcNt9i.js";import{t as f}from"./get-slot-Dnpg1BDa.js";import{i as p}from"./index-BBxzgjes.js";function m(){return p}var h={name:`Space`,self:m},g;function _(){if(!s)return!0;if(g===void 0){let e=document.createElement(`div`);e.style.display=`flex`,e.style.flexDirection=`column`,e.style.rowGap=`1px`,e.appendChild(document.createElement(`div`)),e.appendChild(document.createElement(`div`)),document.body.appendChild(e);let t=e.scrollHeight===1;return document.body.removeChild(e),g=t}return g}var v=t({name:`Space`,props:Object.assign(Object.assign({},d.props),{align:String,justify:{type:String,default:`start`},inline:Boolean,vertical:Boolean,reverse:Boolean,size:[String,Number,Array],wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),setup(e){let{mergedClsPrefixRef:t,mergedRtlRef:r,mergedComponentPropsRef:i}=l(e),s=n(()=>e.size||i?.value?.Space?.size||`medium`),f=d(`Space`,`-space`,void 0,h,e,t),p=a(`Space`,r,t);return{useGap:_(),rtlEnabled:p,mergedClsPrefix:t,margin:n(()=>{let e=s.value;if(Array.isArray(e))return{horizontal:e[0],vertical:e[1]};if(typeof e==`number`)return{horizontal:e,vertical:e};let{self:{[u(`gap`,e)]:t}}=f.value,{row:n,col:r}=c(t);return{horizontal:o(r),vertical:o(n)}})}},render(){let{vertical:t,reverse:n,align:a,inline:o,justify:s,itemClass:c,itemStyle:l,margin:u,wrap:d,mergedClsPrefix:p,rtlEnabled:m,useGap:h,wrapItem:g,internalUseGap:_}=this,v=i(f(this),!1);if(!v.length)return null;let y=`${u.horizontal}px`,b=`${u.horizontal/2}px`,x=`${u.vertical}px`,S=`${u.vertical/2}px`,C=v.length-1,w=s.startsWith(`space-`);return e(`div`,{role:`none`,class:[`${p}-space`,m&&`${p}-space--rtl`],style:{display:o?`inline-flex`:`flex`,flexDirection:t&&!n?`column`:t&&n?`column-reverse`:!t&&n?`row-reverse`:`row`,justifyContent:[`start`,`end`].includes(s)?`flex-${s}`:s,flexWrap:!d||t?`nowrap`:`wrap`,marginTop:h||t?``:`-${S}`,marginBottom:h||t?``:`-${S}`,alignItems:a,gap:h?`${u.vertical}px ${u.horizontal}px`:``}},!g&&(h||_)?v:v.map((n,i)=>n.type===r?n:e(`div`,{role:`none`,class:c,style:[l,{maxWidth:`100%`},h?``:t?{marginBottom:i===C?``:x}:m?{marginLeft:w?s===`space-between`&&i===C?``:b:i===C?``:y,marginRight:w?s===`space-between`&&i===0?``:b:``,paddingTop:S,paddingBottom:S}:{marginRight:w?s===`space-between`&&i===C?``:b:i===C?``:y,marginLeft:w?s===`space-between`&&i===0?``:b:``,paddingTop:S,paddingBottom:S}]},n)))}});export{v as t};