import{x as U,_ as T,p as W,y as G,q,z,A as H,B as M,D as A,E as J,G as K,H as Q,l as X,j as Y,h as Z,i as ee,b as te,I as B,s as oe,f as se}from"./styled-6f3628cf.js";import{_ as a}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-e1338cfd.js";import{r as E}from"./index-8ee6c85d.js";const re=["ownerState"],ne=["variants"],ie=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function ce(e){return Object.keys(e).length===0}function le(e){return typeof e=="string"&&e.charCodeAt(0)>96}function D(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const ae=G(),ue=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function F({defaultTheme:e,theme:s,themeId:t}){return ce(s)?e:s[t]||s}function pe(e){return e?(s,t)=>t[e]:null}function O(e,s){let{ownerState:t}=s,n=T(s,re);const c=typeof e=="function"?e(a({ownerState:t},n)):e;if(Array.isArray(c))return c.flatMap(i=>O(i,a({ownerState:t},n)));if(c&&typeof c=="object"&&Array.isArray(c.variants)){const{variants:i=[]}=c;let p=T(c,ne);return i.forEach(o=>{let r=!0;typeof o.props=="function"?r=o.props(a({ownerState:t},n,t)):Object.keys(o.props).forEach(f=>{(t==null?void 0:t[f])!==o.props[f]&&n[f]!==o.props[f]&&(r=!1)}),r&&(Array.isArray(p)||(p=[p]),p.push(typeof o.style=="function"?o.style(a({ownerState:t},n,t)):o.style))}),p}return c}function fe(e={}){const{themeId:s,defaultTheme:t=ae,rootShouldForwardProp:n=D,slotShouldForwardProp:c=D}=e,i=u=>q(a({},u,{theme:F(a({},u,{defaultTheme:t,themeId:s}))}));return i.__mui_systemSx=!0,(u,p={})=>{U(u,l=>l.filter(m=>!(m!=null&&m.__mui_systemSx)));const{name:o,slot:r,skipVariantsResolver:f,skipSx:S,overridesResolver:y=pe(ue(r))}=p,V=T(p,ie),b=f!==void 0?f:r&&r!=="Root"&&r!=="root"||!1,_=S||!1;let C,v=D;r==="Root"||r==="root"?v=n:r?v=c:le(u)&&(v=void 0);const k=W(u,a({shouldForwardProp:v,label:C},V)),P=l=>typeof l=="function"&&l.__emotion_real!==l||z(l)?m=>O(l,a({},m,{theme:F({theme:m.theme,defaultTheme:t,themeId:s})})):l,g=(l,...m)=>{let w=P(l);const x=m?m.map(P):[];o&&y&&x.push(h=>{const d=F(a({},h,{defaultTheme:t,themeId:s}));if(!d.components||!d.components[o]||!d.components[o].styleOverrides)return null;const R=d.components[o].styleOverrides,j={};return Object.entries(R).forEach(([L,I])=>{j[L]=O(I,a({},h,{theme:d}))}),y(h,j)}),o&&!b&&x.push(h=>{var d;const R=F(a({},h,{defaultTheme:t,themeId:s})),j=R==null||(d=R.components)==null||(d=d[o])==null?void 0:d.variants;return O({variants:j},a({},h,{theme:R}))}),_||x.push(i);const N=x.length-m.length;if(Array.isArray(l)&&N>0){const h=new Array(N).fill("");w=[...l,...h],w.raw=[...l.raw,...h]}const $=k(w,...x);return u.muiName&&($.muiName=u.muiName),$};return k.withConfig&&(g.withConfig=k.withConfig),g}}const de=fe(),me=de,he=["component","direction","spacing","divider","children","className","useFlexGap"],ye=G(),ve=me("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root});function Se(e){return H({props:e,name:"MuiStack",defaultTheme:ye})}function ke(e,s){const t=E.Children.toArray(e).filter(Boolean);return t.reduce((n,c,i)=>(n.push(c),i<t.length-1&&n.push(E.cloneElement(s,{key:`separator-${i}`})),n),[])}const xe=e=>({row:"Left","row-reverse":"Right",column:"Top","column-reverse":"Bottom"})[e],Re=({ownerState:e,theme:s})=>{let t=a({display:"flex",flexDirection:"column"},M({theme:s},A({values:e.direction,breakpoints:s.breakpoints.values}),n=>({flexDirection:n})));if(e.spacing){const n=J(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),{}),i=A({values:e.direction,base:c}),u=A({values:e.spacing,base:c});typeof i=="object"&&Object.keys(i).forEach((o,r,f)=>{if(!i[o]){const y=r>0?i[f[r-1]]:"column";i[o]=y}}),t=K(t,M({theme:s},u,(o,r)=>e.useFlexGap?{gap:B(n,o)}:{"& > :not(style):not(style)":{margin:0},"& > :not(style) ~ :not(style)":{[`margin${xe(r?i[r]:e.direction)}`]:B(n,o)}}))}return t=Q(s.breakpoints,t),t};function _e(e={}){const{createStyledComponent:s=ve,useThemeProps:t=Se,componentName:n="MuiStack"}=e,c=()=>ee({root:["root"]},o=>te(n,o),{}),i=s(Re);return E.forwardRef(function(o,r){const f=t(o),S=X(f),{component:y="div",direction:V="column",spacing:b=0,divider:_,children:C,className:v,useFlexGap:k=!1}=S,P=T(S,he),g={direction:V,spacing:b,useFlexGap:k},l=c();return Y(i,a({as:y,ownerState:g,ref:r,className:Z(l.root,v)},P,{children:_?ke(C,_):C}))})}const Ce=_e({createStyledComponent:oe("div",{name:"MuiStack",slot:"Root",overridesResolver:(e,s)=>s.root}),useThemeProps:e=>se({props:e,name:"MuiStack"})}),Fe=Ce;export{Fe as S};
