import{ac as q,r as G,a3 as F,j as I,c as J,a4 as Q,H as V,d as X,g as Y,aa as Z,w as v,b as ee,s as te}from"./render-D1ZqzUbP.js";import{i as ne}from"./isMuiElement-BcEQvMml.js";const re=(e,t)=>e.filter(n=>t.includes(n)),S=(e,t,n)=>{const o=e.keys[0];Array.isArray(t)?t.forEach((s,r)=>{n((u,d)=>{r<=e.keys.length-1&&(r===0?Object.assign(u,d):u[e.up(e.keys[r])]=d)},s)}):t&&typeof t=="object"?(Object.keys(t).length>e.keys.length?e.keys:re(e.keys,Object.keys(t))).forEach(r=>{if(e.keys.includes(r)){const u=t[r];u!==void 0&&n((d,h)=>{o===r?Object.assign(d,h):d[e.up(r)]=h},u)}}):(typeof t=="number"||typeof t=="string")&&n((s,r)=>{Object.assign(s,r)},t)};function $(e){return`--Grid-${e}Spacing`}function b(e){return`--Grid-parent-${e}Spacing`}const E="--Grid-columns",y="--Grid-parent-columns",se=({theme:e,ownerState:t})=>{const n={};return S(e.breakpoints,t.size,(o,s)=>{let r={};s==="grow"&&(r={flexBasis:0,flexGrow:1,maxWidth:"100%"}),s==="auto"&&(r={flexBasis:"auto",flexGrow:0,flexShrink:0,maxWidth:"none",width:"auto"}),typeof s=="number"&&(r={flexGrow:0,flexBasis:"auto",width:`calc(100% * ${s} / var(${y}) - (var(${y}) - ${s}) * (var(${b("column")}) / var(${y})))`}),o(n,r)}),n},oe=({theme:e,ownerState:t})=>{const n={};return S(e.breakpoints,t.offset,(o,s)=>{let r={};s==="auto"&&(r={marginLeft:"auto"}),typeof s=="number"&&(r={marginLeft:s===0?"0px":`calc(100% * ${s} / var(${y}) + var(${b("column")}) * ${s} / var(${y}))`}),o(n,r)}),n},ie=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={[E]:12};return S(e.breakpoints,t.columns,(o,s)=>{const r=s??12;o(n,{[E]:r,"> *":{[y]:r}})}),n},ce=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return S(e.breakpoints,t.rowSpacing,(o,s)=>{const r=typeof s=="string"?s:e.spacing?.(s);o(n,{[$("row")]:r,"> *":{[b("row")]:r}})}),n},ae=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return S(e.breakpoints,t.columnSpacing,(o,s)=>{const r=typeof s=="string"?s:e.spacing?.(s);o(n,{[$("column")]:r,"> *":{[b("column")]:r}})}),n},fe=({theme:e,ownerState:t})=>{if(!t.container)return{};const n={};return S(e.breakpoints,t.direction,(o,s)=>{o(n,{flexDirection:s})}),n},le=({ownerState:e})=>({minWidth:0,boxSizing:"border-box",...e.container&&{display:"flex",flexWrap:"wrap",...e.wrap&&e.wrap!=="wrap"&&{flexWrap:e.wrap},gap:`var(${$("row")}) var(${$("column")})`}}),ue=e=>{const t=[];return Object.entries(e).forEach(([n,o])=>{o!==!1&&o!==void 0&&t.push(`grid-${n}-${String(o)}`)}),t},me=(e,t="xs")=>{function n(o){return o===void 0?!1:typeof o=="string"&&!Number.isNaN(Number(o))||typeof o=="number"&&o>0}if(n(e))return[`spacing-${t}-${String(e)}`];if(typeof e=="object"&&!Array.isArray(e)){const o=[];return Object.entries(e).forEach(([s,r])=>{n(r)&&o.push(`spacing-${s}-${String(r)}`)}),o}return[]},de=e=>e===void 0?[]:typeof e=="object"?Object.entries(e).map(([t,n])=>`direction-${t}-${n}`):[`direction-xs-${String(e)}`];function pe(e,t){e.item!==void 0&&delete e.item,e.zeroMinWidth!==void 0&&delete e.zeroMinWidth,t.keys.forEach(n=>{e[n]!==void 0&&delete e[n]})}const ge=Z(),ye=Q("div",{name:"MuiGrid",slot:"Root"});function Se(e){return V({props:e,name:"MuiGrid",defaultTheme:ge})}function he(e={}){const{createStyledComponent:t=ye,useThemeProps:n=Se,useTheme:o=q,componentName:s="MuiGrid"}=e,r=(f,c)=>{const{container:p,direction:a,spacing:l,wrap:i,size:x}=f,w={root:["root",p&&"container",i!=="wrap"&&`wrap-xs-${String(i)}`,...de(a),...ue(x),...p?me(l,c.breakpoints.keys[0]):[]]};return X(w,k=>Y(s,k),{})};function u(f,c,p=()=>!0){const a={};return f===null||(Array.isArray(f)?f.forEach((l,i)=>{l!==null&&p(l)&&c.keys[i]&&(a[c.keys[i]]=l)}):typeof f=="object"?Object.keys(f).forEach(l=>{const i=f[l];i!=null&&p(i)&&(a[l]=i)}):a[c.keys[0]]=f),a}const d=t(ie,ae,ce,se,fe,le,oe),h=G.forwardRef(function(c,p){const a=o(),l=n(c),i=F(l);pe(i,a.breakpoints);const{className:x,children:w,columns:k=12,container:C=!1,component:P="div",direction:T="row",wrap:z="wrap",size:O={},offset:M={},spacing:j=0,rowSpacing:R=j,columnSpacing:W=j,unstable_level:g=0,...A}=i,B=u(O,a.breakpoints,m=>m!==!1),D=u(M,a.breakpoints),L=c.columns??(g?void 0:k),_=c.spacing??(g?void 0:j),H=c.rowSpacing??c.spacing??(g?void 0:R),K=c.columnSpacing??c.spacing??(g?void 0:W),N={...i,level:g,columns:L,container:C,direction:T,wrap:z,spacing:_,rowSpacing:H,columnSpacing:K,size:B,offset:D},U=r(N,a);return I.jsx(d,{ref:p,as:P,ownerState:N,className:J(U.root,x),...A,children:G.Children.map(w,m=>G.isValidElement(m)&&ne(m,["Grid"])&&C&&m.props.container?G.cloneElement(m,{unstable_level:m.props?.unstable_level??g+1}):m)})});return h.muiName="Grid",h}const be=he({createStyledComponent:te("div",{name:"MuiGrid",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.container&&t.container]}}),componentName:"MuiGrid",useThemeProps:e=>ee({props:e,name:"MuiGrid"}),useTheme:v});export{be as G};
//# sourceMappingURL=Grid-BihMtcd8.js.map
