import{r as l,j as c,Z as i,aL as T,aM as x,aN as E,aO as P}from"./index-4e7882bc.js";const y=l.createContext(null),f=y;function d(){return l.useContext(f)}const _=typeof Symbol=="function"&&Symbol.for,g=_?Symbol.for("mui.nested"):"__THEME_NESTED__";function M(e,n){return typeof n=="function"?n(e):i({},e,n)}function S(e){const{children:n,theme:t}=e,o=d(),u=l.useMemo(()=>{const r=o===null?t:M(o,t);return r!=null&&(r[g]=o!==null),r},[t,o]);return c(f.Provider,{value:u,children:n})}const m={};function a(e,n,t,o=!1){return l.useMemo(()=>{const u=e&&n[e]||n;if(typeof t=="function"){const r=t(u),s=e?i({},n,{[e]:r}):r;return o?()=>s:s}return e?i({},n,{[e]:t}):i({},n,t)},[e,n,t,o])}function b(e){const{children:n,theme:t,themeId:o}=e,u=T(m),r=d()||m,s=a(o,u,t),h=a(o,r,t,!0),v=s.direction==="rtl";return c(S,{theme:h,children:c(x.Provider,{value:s,children:c(E,{value:v,children:c(P,{value:s==null?void 0:s.components,children:n})})})})}export{b as T,d as u};
