import{fA as G,bC as R,g as j,b7 as E,Q as w,fB as _,a4 as A,X as S,a8 as I,C as M,ah as P,bt as T,bu as C}from"./Czresmtb.js";import{g as L}from"./Bk_rJcZu.js";function O(){return G}const W={self:O};let h;function D(){if(!R)return!0;if(h===void 0){const 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);const n=e.scrollHeight===1;return document.body.removeChild(e),h=n}return h}const F=Object.assign(Object.assign({},S.props),{align:String,justify:{type:String,default:"start"},inline:Boolean,vertical:Boolean,reverse:Boolean,size:{type:[String,Number,Array],default:"medium"},wrapItem:{type:Boolean,default:!0},itemClass:String,itemStyle:[String,Object],wrap:{type:Boolean,default:!0},internalUseGap:{type:Boolean,default:void 0}}),V=j({name:"Space",props:F,setup(e){const{mergedClsPrefixRef:n,mergedRtlRef:m}=A(e),d=S("Space","-space",void 0,W,e,n),t=I("Space",m,n);return{useGap:D(),rtlEnabled:t,mergedClsPrefix:n,margin:M(()=>{const{size:r}=e;if(Array.isArray(r))return{horizontal:r[0],vertical:r[1]};if(typeof r=="number")return{horizontal:r,vertical:r};const{self:{[P("gap",r)]:f}}=d.value,{row:a,col:g}=T(f);return{horizontal:C(g),vertical:C(a)}})}},render(){const{vertical:e,reverse:n,align:m,inline:d,justify:t,itemClass:r,itemStyle:f,margin:a,wrap:g,mergedClsPrefix:v,rtlEnabled:b,useGap:o,wrapItem:B,internalUseGap:$}=this,p=E(L(this),!1);if(!p.length)return null;const x=`${a.horizontal}px`,c=`${a.horizontal/2}px`,z=`${a.vertical}px`,i=`${a.vertical/2}px`,l=p.length-1,u=t.startsWith("space-");return w("div",{role:"none",class:[`${v}-space`,b&&`${v}-space--rtl`],style:{display:d?"inline-flex":"flex",flexDirection:e&&!n?"column":e&&n?"column-reverse":!e&&n?"row-reverse":"row",justifyContent:["start","end"].includes(t)?`flex-${t}`:t,flexWrap:!g||e?"nowrap":"wrap",marginTop:o||e?"":`-${i}`,marginBottom:o||e?"":`-${i}`,alignItems:m,gap:o?`${a.vertical}px ${a.horizontal}px`:""}},!B&&(o||$)?p:p.map((y,s)=>y.type===_?y:w("div",{role:"none",class:r,style:[f,{maxWidth:"100%"},o?"":e?{marginBottom:s!==l?z:""}:b?{marginLeft:u?t==="space-between"&&s===l?"":c:s!==l?x:"",marginRight:u?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}:{marginRight:u?t==="space-between"&&s===l?"":c:s!==l?x:"",marginLeft:u?t==="space-between"&&s===0?"":c:"",paddingTop:i,paddingBottom:i}]},y)))}});export{V as _};
