import{fj as N,fk as c,bL as d,j as i,fl as q,bE as w,fm as j,fn as C,fo as h,bj as P,bk as V,bn as E,fp as F,e as B}from"./index-BW07AEtf.js";function M({spacing:e,verticalSpacing:o,cols:t,selector:m}){var n;const a=w(),l=o===void 0?e:o,f=N({"--sg-spacing-x":d(c(e)),"--sg-spacing-y":d(c(l)),"--sg-cols":(n=c(t))==null?void 0:n.toString()}),u=j(a.breakpoints).reduce((s,r)=>(s[r]||(s[r]={}),typeof e=="object"&&e[r]!==void 0&&(s[r]["--sg-spacing-x"]=d(e[r])),typeof l=="object"&&l[r]!==void 0&&(s[r]["--sg-spacing-y"]=d(l[r])),typeof t=="object"&&t[r]!==void 0&&(s[r]["--sg-cols"]=t[r]),s),{}),y=C(j(u),a.breakpoints).filter(s=>j(u[s.value]).length>0).map(s=>({query:`(min-width: ${a.breakpoints[s.value]})`,styles:u[s.value]}));return i.jsx(q,{styles:f,media:y,selector:m})}function S(e){return typeof e=="object"&&e!==null?j(e):[]}function R(e){return e.sort((o,t)=>h(o)-h(t))}function A({spacing:e,verticalSpacing:o,cols:t}){const m=Array.from(new Set([...S(e),...S(o),...S(t)]));return R(m)}function I({spacing:e,verticalSpacing:o,cols:t,selector:m}){var y;const a=o===void 0?e:o,l=N({"--sg-spacing-x":d(c(e)),"--sg-spacing-y":d(c(a)),"--sg-cols":(y=c(t))==null?void 0:y.toString()}),f=A({spacing:e,verticalSpacing:o,cols:t}),u=f.reduce((n,s)=>(n[s]||(n[s]={}),typeof e=="object"&&e[s]!==void 0&&(n[s]["--sg-spacing-x"]=d(e[s])),typeof a=="object"&&a[s]!==void 0&&(n[s]["--sg-spacing-y"]=d(a[s])),typeof t=="object"&&t[s]!==void 0&&(n[s]["--sg-cols"]=t[s]),n),{}),g=f.map(n=>({query:`simple-grid (min-width: ${n})`,styles:u[n]}));return i.jsx(q,{styles:l,container:g,selector:m})}var G={container:"m_925c2d2c",root:"m_2415a157"};const L={cols:1,spacing:"md",type:"media"},_=P((e,o)=>{const t=V("SimpleGrid",L,e),{classNames:m,className:a,style:l,styles:f,unstyled:u,vars:g,cols:y,verticalSpacing:n,spacing:s,type:r,attributes:$,...v}=t,x=E({name:"SimpleGrid",classes:G,props:t,className:a,style:l,classNames:m,styles:f,unstyled:u,attributes:$,vars:g}),p=F();return r==="container"?i.jsxs(i.Fragment,{children:[i.jsx(I,{...t,selector:`.${p}`}),i.jsx("div",{...x("container"),children:i.jsx(B,{ref:o,...x("root",{className:p}),...v})})]}):i.jsxs(i.Fragment,{children:[i.jsx(M,{...t,selector:`.${p}`}),i.jsx(B,{ref:o,...x("root",{className:p}),...v})]})});_.classes=G;_.displayName="@mantine/core/SimpleGrid";export{_ as S};
