import{r as o,j as d,b9 as p,b7 as c,e8 as C,e7 as w,d as y,bm as $}from"./index-d2b25495.js";import{T as g}from"./Tabs-e137570a.js";import{u as E}from"./useThemeProps-1a6bc781.js";import{c as M}from"./composeClasses-b42b2e69.js";const b=o.createContext(null);function j(){const[e,t]=o.useState(null);return o.useEffect(()=>{t(`mui-p-${Math.round(Math.random()*1e5)}`)},[]),e}function z(e){const{children:t,value:n}=e,s=j(),i=o.useMemo(()=>({idPrefix:s,value:n}),[s,n]);return d.jsx(b.Provider,{value:i,children:t})}function x(){return o.useContext(b)}function T(e,t){const{idPrefix:n}=e;return n===null?null:`${e.idPrefix}-P-${t}`}function m(e,t){const{idPrefix:n}=e;return n===null?null:`${e.idPrefix}-T-${t}`}const R=["children"],N=o.forwardRef(function(t,n){const{children:s}=t,i=p(t,R),r=x();if(r===null)throw new TypeError("No TabContext provided");const a=o.Children.map(s,l=>o.isValidElement(l)?o.cloneElement(l,{"aria-controls":T(r,l.props.value),id:m(r,l.props.value)}):null);return d.jsx(g,c({},i,{ref:n,value:r.value,children:a}))}),A=N;function U(e){return C("MuiTabPanel",e)}w("MuiTabPanel",["root"]);const I=["children","className","value"],L=e=>{const{classes:t}=e;return M({root:["root"]},U,t)},_=y("div",{name:"MuiTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({padding:e.spacing(3)})),S=o.forwardRef(function(t,n){const s=E({props:t,name:"MuiTabPanel"}),{children:i,className:r,value:a}=s,l=p(s,I),f=c({},s),P=L(f),u=x();if(u===null)throw new TypeError("No TabContext provided");const h=T(u,a),v=m(u,a);return d.jsx(_,c({"aria-labelledby":v,className:$(P.root,r),hidden:a!==u.value,id:h,ref:n,role:"tabpanel",ownerState:f},l,{children:a===u.value&&i}))}),B=S;export{z as T,A as a,B as b};
