import{cu as W,cv as F,cw as z,ct as n,cx as I,cy as $,cz as q}from"./index-c5c88b67.js";const B=["ownerState"],G=["variants"],H=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function J(e){return Object.keys(e).length===0}function K(e){return typeof e=="string"&&e.charCodeAt(0)>96}function A(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Q=I(),U=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function _({defaultTheme:e,theme:s,themeId:t}){return J(s)?e:s[t]||s}function X(e){return e?(s,t)=>t[e]:null}function x(e,s){let{ownerState:t}=s,d=F(s,B);const l=typeof e=="function"?e(n({ownerState:t},d)):e;if(Array.isArray(l))return l.flatMap(h=>x(h,n({ownerState:t},d)));if(l&&typeof l=="object"&&Array.isArray(l.variants)){const{variants:h=[]}=l;let m=F(l,G);return h.forEach(r=>{let i=!0;typeof r.props=="function"?i=r.props(n({ownerState:t},d,t)):Object.keys(r.props).forEach(p=>{(t==null?void 0:t[p])!==r.props[p]&&d[p]!==r.props[p]&&(i=!1)}),i&&(Array.isArray(m)||(m=[m]),m.push(typeof r.style=="function"?r.style(n({ownerState:t},d,t)):r.style))}),m}return l}function Z(e={}){const{themeId:s,defaultTheme:t=Q,rootShouldForwardProp:d=A,slotShouldForwardProp:l=A}=e,h=c=>$(n({},c,{theme:_(n({},c,{defaultTheme:t,themeId:s}))}));return h.__mui_systemSx=!0,(c,m={})=>{W(c,o=>o.filter(a=>!(a!=null&&a.__mui_systemSx)));const{name:r,slot:i,skipVariantsResolver:p,skipSx:b,overridesResolver:k=X(U(i))}=m,V=F(m,H),E=p!==void 0?p:i&&i!=="Root"&&i!=="root"||!1,N=b||!1;let L,v=A;i==="Root"||i==="root"?v=d:i?v=l:K(c)&&(v=void 0);const R=z(c,n({shouldForwardProp:v,label:L},V)),C=o=>typeof o=="function"&&o.__emotion_real!==o||q(o)?a=>x(o,n({},a,{theme:_({theme:a.theme,defaultTheme:t,themeId:s})})):o,P=(o,...a)=>{let O=C(o);const y=a?a.map(C):[];r&&k&&y.push(f=>{const u=_(n({},f,{defaultTheme:t,themeId:s}));if(!u.components||!u.components[r]||!u.components[r].styleOverrides)return null;const S=u.components[r].styleOverrides,w={};return Object.entries(S).forEach(([D,M])=>{w[D]=x(M,n({},f,{theme:u}))}),k(f,w)}),r&&!E&&y.push(f=>{var u;const S=_(n({},f,{defaultTheme:t,themeId:s})),w=S==null||(u=S.components)==null||(u=u[r])==null?void 0:u.variants;return x({variants:w},n({},f,{theme:S}))}),N||y.push(h);const j=y.length-a.length;if(Array.isArray(o)&&j>0){const f=new Array(j).fill("");O=[...o,...f],O.raw=[...o.raw,...f]}const T=R(O,...y);return c.muiName&&(T.muiName=c.muiName),T};return R.withConfig&&(P.withConfig=R.withConfig),P}}export{Z as c,A as s};
