import{r as _,Y as s,W as g,a2 as W}from"./index-7ecf457b.js";const j=_.createContext(void 0),T=e=>{const n=_.useContext(j);return{getColor:(o,t)=>n&&e&&n.includes(e)?o||"context":o||t}};function L(e){return typeof e=="string"}function Z(e,n,o){return e===void 0||L(e)?n:s({},n,{ownerState:s({},n.ownerState,o)})}function Y(e,n=[]){if(e===void 0)return{};const o={};return Object.keys(e).filter(t=>t.match(/^on[A-Z]/)&&typeof e[t]=="function"&&!n.includes(t)).forEach(t=>{o[t]=e[t]}),o}function q(e,n,o){return typeof e=="function"?e(n,o):e}function b(e){var n,o,t="";if(typeof e=="string"||typeof e=="number")t+=e;else if(typeof e=="object")if(Array.isArray(e))for(n=0;n<e.length;n++)e[n]&&(o=b(e[n]))&&(t&&(t+=" "),t+=o);else for(n in e)e[n]&&(t&&(t+=" "),t+=n);return t}function E(){for(var e,n,o=0,t="";o<arguments.length;)(e=arguments[o++])&&(n=b(e))&&(t&&(t+=" "),t+=n);return t}function F(e){if(e===void 0)return{};const n={};return Object.keys(e).filter(o=>!(o.match(/^on[A-Z]/)&&typeof e[o]=="function")).forEach(o=>{n[o]=e[o]}),n}function z(e){const{getSlotProps:n,additionalProps:o,externalSlotProps:t,externalForwardedProps:r,className:u}=e;if(!n){const f=E(r==null?void 0:r.className,t==null?void 0:t.className,u,o==null?void 0:o.className),i=s({},o==null?void 0:o.style,r==null?void 0:r.style,t==null?void 0:t.style),c=s({},o,r,t);return f.length>0&&(c.className=f),Object.keys(i).length>0&&(c.style=i),{props:c,internalRef:void 0}}const v=Y(s({},r,t)),y=F(t),x=F(r),l=n(v),a=E(l==null?void 0:l.className,o==null?void 0:o.className,u,r==null?void 0:r.className,t==null?void 0:t.className),m=s({},l==null?void 0:l.style,o==null?void 0:o.style,r==null?void 0:r.style,t==null?void 0:t.style),d=s({},l,o,x,y);return a.length>0&&(d.className=a),Object.keys(m).length>0&&(d.style=m),{props:d,internalRef:l.ref}}const B=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],D=["component","slots","slotProps"],G=["component"],J=["disableColorInversion"];function M(e,n){const{className:o,elementType:t,ownerState:r,externalForwardedProps:u,getSlotOwnerState:v,internalForwardedProps:y}=n,x=g(n,B),{component:l,slots:a={[e]:void 0},slotProps:m={[e]:void 0}}=u,d=g(u,D),f=a[e]||t,i=q(m[e],r),c=z(s({className:o},x,{externalForwardedProps:e==="root"?d:void 0,externalSlotProps:i})),{props:{component:P},internalRef:k}=c,S=g(c.props,G),H=W(k,i==null?void 0:i.ref,n.ref),C=v?v(S):{},{disableColorInversion:A=!1}=C,w=g(C,J),p=s({},r,w),{getColor:I}=T(p.variant);if(e==="root"){var h;p.color=(h=S.color)!=null?h:r.color}else A||(p.color=I(S.color,p.color));const N=e==="root"?P||l:P,O=Z(f,s({},e==="root"&&!l&&!a[e]&&y,e!=="root"&&!a[e]&&y,S,N&&{as:N},{ref:H}),p);return Object.keys(w).forEach(R=>{delete O[R]}),[f,O]}export{j as C,T as a,Z as b,E as c,Y as e,z as m,q as r,M as u};
