import{a as e,n as t}from"./preload-helper-DxX6f4wy.js";import{$ as n,E as r,F as i,I as a,P as o,R as s,Y as c,d as l,g as u,q as d,y as f}from"./Fade-Bj1YUcWe.js";var p=e(t()),m=p.createContext();function h(e){return i(`MuiGrid`,e)}var g=[0,1,2,3,4,5,6,7,8,9,10],_=[`column-reverse`,`column`,`row-reverse`,`row`],v=[`nowrap`,`wrap-reverse`,`wrap`],y=[`auto`,!0,1,2,3,4,5,6,7,8,9,10,11,12],b=o(`MuiGrid`,[`root`,`container`,`item`,`zeroMinWidth`,...g.map(e=>`spacing-xs-${e}`),..._.map(e=>`direction-xs-${e}`),...v.map(e=>`wrap-xs-${e}`),...y.map(e=>`grid-xs-${e}`),...y.map(e=>`grid-sm-${e}`),...y.map(e=>`grid-md-${e}`),...y.map(e=>`grid-lg-${e}`),...y.map(e=>`grid-xl-${e}`)]),x=n();function S({theme:e,ownerState:t}){let n;return e.breakpoints.keys.reduce((r,i)=>{let a={};if(t[i]&&(n=t[i]),!n)return r;if(n===!0)a={flexBasis:0,flexGrow:1,maxWidth:`100%`};else if(n===`auto`)a={flexBasis:`auto`,flexGrow:0,flexShrink:0,maxWidth:`none`,width:`auto`};else{let o=c({values:t.columns,breakpoints:e.breakpoints.values}),s=typeof o==`object`?o[i]:o;if(s==null)return r;let l=`${Math.round(n/s*1e8)/1e6}%`,u={};if(t.container&&t.item&&t.columnSpacing!==0){let n=e.spacing(t.columnSpacing);if(n!==`0px`){let e=`calc(${l} + ${n})`;u={flexBasis:e,maxWidth:e}}}a={flexBasis:l,flexGrow:0,maxWidth:l,...u}}return e.breakpoints.values[i]===0?Object.assign(r,a):r[e.breakpoints.up(i)]=a,r},{})}function C({theme:e,ownerState:t}){let n=c({values:t.direction,breakpoints:e.breakpoints.values});return d({theme:e},n,e=>{let t={flexDirection:e};return e.startsWith(`column`)&&(t[`& > .${b.item}`]={maxWidth:`none`}),t})}function w({breakpoints:e,values:t}){let n=``;Object.keys(t).forEach(e=>{n===``&&t[e]!==0&&(n=e)});let r=Object.keys(e).sort((t,n)=>e[t]-e[n]);return r.slice(0,r.indexOf(n))}function T({theme:e,ownerState:t}){let{container:n,rowSpacing:r}=t,i={};if(n&&r!==0){let t=c({values:r,breakpoints:e.breakpoints.values}),n;typeof t==`object`&&(n=w({breakpoints:e.breakpoints.values,values:t})),i=d({theme:e},t,(t,r)=>{let i=e.spacing(t);return i===`0px`?n?.includes(r)?{}:{marginTop:0,[`& > .${b.item}`]:{paddingTop:0}}:{marginTop:`calc(-1 * ${i})`,[`& > .${b.item}`]:{paddingTop:i}}})}return i}function E({theme:e,ownerState:t}){let{container:n,columnSpacing:r}=t,i={};if(n&&r!==0){let t=c({values:r,breakpoints:e.breakpoints.values}),n;typeof t==`object`&&(n=w({breakpoints:e.breakpoints.values,values:t})),i=d({theme:e},t,(t,r)=>{let i=e.spacing(t);if(i!==`0px`){let e=`calc(-1 * ${i})`;return{width:`calc(100% + ${i})`,marginLeft:e,[`& > .${b.item}`]:{paddingLeft:i}}}return n?.includes(r)?{}:{width:`100%`,marginLeft:0,[`& > .${b.item}`]:{paddingLeft:0}}})}return i}function D(e,t,n={}){if(!e||e<=0)return[];if(typeof e==`string`&&!Number.isNaN(Number(e))||typeof e==`number`)return[n[`spacing-xs-${String(e)}`]];let r=[];return t.forEach(t=>{let i=e[t];Number(i)>0&&r.push(n[`spacing-${t}-${String(i)}`])}),r}var O=u(`div`,{name:`MuiGrid`,slot:`Root`,overridesResolver:(e,t)=>{let{ownerState:n}=e,{container:r,direction:i,item:a,spacing:o,wrap:s,zeroMinWidth:c,breakpoints:l}=n,u=[];r&&(u=D(o,l,t));let d=[];return l.forEach(e=>{let r=n[e];r&&d.push(t[`grid-${e}-${String(r)}`])}),[t.root,r&&t.container,a&&t.item,c&&t.zeroMinWidth,...u,i!==`row`&&t[`direction-xs-${String(i)}`],s!==`wrap`&&t[`wrap-xs-${String(s)}`],...d]}})(({ownerState:e})=>({boxSizing:`border-box`,...e.container&&{display:`flex`,flexWrap:`wrap`,width:`100%`},...e.item&&{margin:0},...e.zeroMinWidth&&{minWidth:0},...e.wrap!==`wrap`&&{flexWrap:e.wrap}}),C,T,E,S);function k(e,t){if(!e||e<=0)return[];if(typeof e==`string`&&!Number.isNaN(Number(e))||typeof e==`number`)return[`spacing-xs-${String(e)}`];let n=[];return t.forEach(t=>{let r=e[t];if(Number(r)>0){let e=`spacing-${t}-${String(r)}`;n.push(e)}}),n}var A=e=>{let{classes:t,container:n,direction:i,item:a,spacing:o,wrap:s,zeroMinWidth:c,breakpoints:l}=e,u=[];n&&(u=k(o,l));let d=[];return l.forEach(t=>{let n=e[t];n&&d.push(`grid-${t}-${String(n)}`)}),r({root:[`root`,n&&`container`,a&&`item`,c&&`zeroMinWidth`,...u,i!==`row`&&`direction-xs-${String(i)}`,s!==`wrap`&&`wrap-xs-${String(s)}`,...d]},h,t)},j=p.forwardRef(function(e,t){let n=l({props:e,name:`MuiGrid`}),{breakpoints:r}=f(),i=s(n),{className:o,columns:c,columnSpacing:u,component:d=`div`,container:h=!1,direction:g=`row`,item:_=!1,rowSpacing:v,spacing:y=0,wrap:b=`wrap`,zeroMinWidth:S=!1,...C}=i,w=v||y,T=u||y,E=p.useContext(m),D=h?c||12:E,k={},j={...C};r.keys.forEach(e=>{C[e]!=null&&(k[e]=C[e],delete j[e])});let M={...i,columns:D,container:h,direction:g,item:_,rowSpacing:w,columnSpacing:T,wrap:b,zeroMinWidth:S,spacing:y,...k,breakpoints:r.keys},N=A(M);return(0,x.jsx)(m.Provider,{value:D,children:(0,x.jsx)(O,{ownerState:M,className:a(N.root,o),as:d,ref:t,...j})})});export{j as t};