import{t as P,v as b,z as m,w as k,d as v,x as _,c as i,U as f,a$ as $,D as p,N as q,ae as z,C as D,af as E,y as x,b0 as O,E as T,aH as V,a5 as w}from"./index.ffe80dbe.js";const[S,U]=P("grid"),j={square:Boolean,center:b,border:b,gutter:m,reverse:Boolean,iconSize:m,direction:String,clickable:Boolean,columnNum:k(4)},h=Symbol(S);var H=v({name:S,props:j,setup(e,{slots:t}){const{linkChildren:o}=_(h);return o({props:e}),()=>{var c;return i("div",{style:{paddingLeft:f(e.gutter)},class:[U(),{[$]:e.border&&!e.gutter}]},[(c=t.default)==null?void 0:c.call(t)])}}});const F=p(H),[K,l]=P("grid-item"),L=q({},z,{dot:Boolean,text:String,icon:String,badge:m,iconColor:String,iconPrefix:String,badgeProps:Object});var Y=v({name:K,props:L,setup(e,{slots:t}){const{parent:o,index:c}=D(h),y=E();if(!o){console.error("[Vant] must be a child component of .");return}const B=x(()=>{const{square:s,gutter:n,columnNum:r}=o.props,d=`${100/+r}%`,a={flexBasis:d};if(s)a.paddingTop=d;else if(n){const u=f(n);a.paddingRight=u,c.value>=r&&(a.marginTop=u)}return a}),C=x(()=>{const{square:s,gutter:n}=o.props;if(s&&n){const r=f(n);return{right:r,bottom:r,height:"auto"}}}),I=()=>{if(t.icon)return i(V,T({dot:e.dot,content:e.badge},e.badgeProps),{default:t.icon});if(e.icon)return i(w,{dot:e.dot,name:e.icon,size:o.props.iconSize,badge:e.badge,class:l("icon"),color:e.iconColor,badgeProps:e.badgeProps,classPrefix:e.iconPrefix},null)},R=()=>{if(t.text)return t.text();if(e.text)return i("span",{class:l("text")},[e.text])},G=()=>t.default?t.default():[I(),R()];return()=>{const{center:s,border:n,square:r,gutter:d,reverse:a,direction:u,clickable:g}=o.props,N=[l("content",[u,{center:s,square:r,reverse:a,clickable:g,surround:n&&d}]),{[O]:n}];return i("div",{class:[l({square:r})],style:B.value},[i("div",{role:g?"button":void 0,class:N,style:C.value,tabindex:g?0:void 0,onClick:y},[G()])])}}});const J=p(Y);export{F as G,J as a};