import{t as R,_ as T,b as k,d as D,an as v,ao as p,ap as F,a9 as B,aq as G,f as M,V as E,G as N,ar as h,s as _,c as O}from"./OdysseyThemeProvider-Bh0Bu-2o.js";import{r as d}from"./index-NdkWRN8K.js";import{c as U}from"./createStyled-D6bTcpHC.js";import{j as $}from"./jsx-runtime-CnH95YSl.js";import{u as A}from"./useThemeProps-DwvbKxez.js";const L=U(),q=["component","direction","spacing","divider","children","className","useFlexGap"],I=N(),W=L("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root});function z(e){return A({props:e,name:"MuiStack",defaultTheme:I})}function H(e,s){const n=d.Children.toArray(e).filter(Boolean);return n.reduce((a,c,t)=>(a.push(c),t<n.length-1&&a.push(d.cloneElement(s,{key:`separator-${t}`})),a),[])}const J=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],K=({ownerState:e,theme:s})=>{let n=k({display:"flex",flexDirection:"column"},v({theme:s},p({values:e.direction,breakpoints:s.breakpoints.values}),a=>({flexDirection:a})));if(e.spacing){const a=F(s),c=Object.keys(s.breakpoints.values).reduce((o,r)=>((typeof e.spacing=="object"&&e.spacing[r]!=null||typeof e.direction=="object"&&e.direction[r]!=null)&&(o[r]=!0),o),{}),t=p({values:e.direction,base:c}),m=p({values:e.spacing,base:c});typeof t=="object"&&Object.keys(t).forEach((o,r,i)=>{if(!t[o]){const u=r>0?t[i[r-1]]:"column";t[o]=u}}),n=B(n,v({theme:s},m,(o,r)=>e.useFlexGap?{gap:h(a,o)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${J(r?t[r]:e.direction)}`]:h(a,o)}}))}return n=G(s.breakpoints,n),n};function Q(e={}){const{createStyledComponent:s=W,useThemeProps:n=z,componentName:a="MuiStack"}=e,c=()=>M({root:["root"]},o=>E(a,o),{}),t=s(K);return d.forwardRef(function(o,r){const i=n(o),l=R(i),{component:u="div",direction:x="column",spacing:j=0,divider:y,children:g,className:P,useFlexGap:S=!1}=l,C=T(l,q),V={direction:x,spacing:j,useFlexGap:S},b=c();return $.jsx(t,k({as:u,ownerState:V,ref:r,className:D(b.root,P)},C,{children:y?H(g,y):g}))})}const se=Q({createStyledComponent:_("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root}),useThemeProps:e=>O({props:e,name:"MuiStack"})});export{se as S};
