import{T as _e,d as Le,c as je,b as Re,g as Ae,a as Ne,s as Oe,u as Ve}from"./useThemeProps-dc4c84f8.js";import{j as E,r as a,a9 as m,aS as Ke,a7 as Se,aT as H,l as ue,aU as G,aM as Ue,ak as ze}from"./index-57016b76.js";import{u as Be,T as Fe}from"./ThemeProvider-af6b3ec5.js";import{u as We,c as Ge}from"./useSlot-7545b28c.js";const J="mode",Y="color-scheme",ge="data-color-scheme";function qe(o){const{defaultMode:e="light",defaultLightColorScheme:s="light",defaultDarkColorScheme:c="dark",modeStorageKey:x=J,colorSchemeStorageKey:d=Y,attribute:l=ge,colorSchemeNode:n="document.documentElement",nonce:h}=o||{};return E("script",{suppressHydrationWarning:!0,nonce:typeof window>"u"?h:"",dangerouslySetInnerHTML:{__html:`(function() {
try {
  var mode = localStorage.getItem('${x}') || '${e}';
  var colorScheme = '';
  if (mode === 'system') {
    // handle system mode
    var mql = window.matchMedia('(prefers-color-scheme: dark)');
    if (mql.matches) {
      colorScheme = localStorage.getItem('${d}-dark') || '${c}';
    } else {
      colorScheme = localStorage.getItem('${d}-light') || '${s}';
    }
  }
  if (mode === 'light') {
    colorScheme = localStorage.getItem('${d}-light') || '${s}';
  }
  if (mode === 'dark') {
    colorScheme = localStorage.getItem('${d}-dark') || '${c}';
  }
  if (colorScheme) {
    ${n}.setAttribute('${l}', colorScheme);
  }
} catch(e){}})();`}},"mui-color-scheme-init")}function fe(o){if(typeof window<"u"&&o==="system")return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function pe(o,e){if(o.mode==="light"||o.mode==="system"&&o.systemMode==="light")return e("light");if(o.mode==="dark"||o.mode==="system"&&o.systemMode==="dark")return e("dark")}function He(o){return pe(o,e=>{if(e==="light")return o.lightColorScheme;if(e==="dark")return o.darkColorScheme})}function q(o,e){if(typeof window>"u")return;let s;try{s=localStorage.getItem(o)||void 0,s||localStorage.setItem(o,e)}catch{}return s||e}function Je(o){const{defaultMode:e="light",defaultLightColorScheme:s,defaultDarkColorScheme:c,supportedColorSchemes:x=[],modeStorageKey:d=J,colorSchemeStorageKey:l=Y,storageWindow:n=typeof window>"u"?void 0:window}=o,h=x.join(","),[S,p]=a.useState(()=>{const r=q(d,e),t=q(`${l}-light`,s),i=q(`${l}-dark`,c);return{mode:r,systemMode:fe(r),lightColorScheme:t,darkColorScheme:i}}),M=He(S),$=a.useCallback(r=>{p(t=>{if(r===t.mode)return t;const i=r??e;try{localStorage.setItem(d,i)}catch{}return m({},t,{mode:i,systemMode:fe(i)})})},[d,e]),y=a.useCallback(r=>{r?typeof r=="string"?r&&!h.includes(r)?console.error(`\`${r}\` does not exist in \`theme.colorSchemes\`.`):p(t=>{const i=m({},t);return pe(t,u=>{try{localStorage.setItem(`${l}-${u}`,r)}catch{}u==="light"&&(i.lightColorScheme=r),u==="dark"&&(i.darkColorScheme=r)}),i}):p(t=>{const i=m({},t),u=r.light===null?s:r.light,I=r.dark===null?c:r.dark;if(u)if(!h.includes(u))console.error(`\`${u}\` does not exist in \`theme.colorSchemes\`.`);else{i.lightColorScheme=u;try{localStorage.setItem(`${l}-light`,u)}catch{}}if(I)if(!h.includes(I))console.error(`\`${I}\` does not exist in \`theme.colorSchemes\`.`);else{i.darkColorScheme=I;try{localStorage.setItem(`${l}-dark`,I)}catch{}}return i}):p(t=>{try{localStorage.setItem(`${l}-light`,s),localStorage.setItem(`${l}-dark`,c)}catch{}return m({},t,{lightColorScheme:s,darkColorScheme:c})})},[h,l,s,c]),T=a.useCallback(r=>{S.mode==="system"&&p(t=>{const i=r!=null&&r.matches?"dark":"light";return t.systemMode===i?t:m({},t,{systemMode:i})})},[S.mode]),w=a.useRef(T);return w.current=T,a.useEffect(()=>{const r=(...i)=>w.current(...i),t=window.matchMedia("(prefers-color-scheme: dark)");return t.addListener(r),r(t),()=>{t.removeListener(r)}},[]),a.useEffect(()=>{if(n){const r=t=>{const i=t.newValue;typeof t.key=="string"&&t.key.startsWith(l)&&(!i||h.match(i))&&(t.key.endsWith("light")&&y({light:i}),t.key.endsWith("dark")&&y({dark:i})),t.key===d&&(!i||["light","dark","system"].includes(i))&&$(i||e)};return n.addEventListener("storage",r),()=>{n.removeEventListener("storage",r)}}},[y,$,d,l,h,e,n]),m({},S,{colorScheme:M,setMode:$,setColorScheme:y})}const Ye=["colorSchemes","components","generateCssVars","cssVarPrefix"],Qe="*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}";function Xe(o){const{themeId:e,theme:s={},attribute:c=ge,modeStorageKey:x=J,colorSchemeStorageKey:d=Y,defaultMode:l="light",defaultColorScheme:n,disableTransitionOnChange:h=!1,resolveTheme:S,excludeVariablesFromRoot:p}=o;(!s.colorSchemes||typeof n=="string"&&!s.colorSchemes[n]||typeof n=="object"&&!s.colorSchemes[n==null?void 0:n.light]||typeof n=="object"&&!s.colorSchemes[n==null?void 0:n.dark])&&console.error(`MUI: \`${n}\` does not exist in \`theme.colorSchemes\`.`);const M=a.createContext(void 0),$=()=>{const t=a.useContext(M);if(!t)throw new Error(Ke(19));return t};function y(t){const{children:i,theme:u=s,modeStorageKey:I=x,colorSchemeStorageKey:A=d,attribute:P=c,defaultMode:L=l,defaultColorScheme:v=n,disableTransitionOnChange:Q=h,storageWindow:Ce=typeof window>"u"?void 0:window,documentNode:b=typeof document>"u"?void 0:document,colorSchemeNode:N=typeof document>"u"?void 0:document.documentElement,colorSchemeSelector:j=":root",disableNestedContext:ye=!1,disableStyleSheetGeneration:ke=!1}=t,O=a.useRef(!1),X=Be(),V=a.useContext(M),K=!!V&&!ye,Z=u[e],ee=Z||u,{colorSchemes:U={},components:De={},generateCssVars:oe=()=>({vars:{},css:{}}),cssVarPrefix:z}=ee,xe=Se(ee,Ye),B=Object.keys(U),te=typeof v=="string"?v:v.light,re=typeof v=="string"?v:v.dark,{mode:Ie,setMode:ie,systemMode:ne,lightColorScheme:se,darkColorScheme:le,colorScheme:Me,setColorScheme:ce}=Je({supportedColorSchemes:B,defaultLightColorScheme:te,defaultDarkColorScheme:re,modeStorageKey:I,colorSchemeStorageKey:A,defaultMode:L,storageWindow:Ce});let _=Ie,k=Me;K&&(_=V.mode,k=V.colorScheme);const $e=(()=>_||(L==="system"?l:L))(),be=(()=>k||($e==="dark"?re:te))(),{css:Ee,vars:ae}=oe(),g=m({},xe,{components:De,colorSchemes:U,cssVarPrefix:z,vars:ae,getColorSchemeSelector:f=>`[${P}="${f}"] &`}),F={},de={};Object.entries(U).forEach(([f,D])=>{const{css:R,vars:we}=oe(f);g.vars=H(g.vars,we),f===be&&(Object.keys(D).forEach(C=>{D[C]&&typeof D[C]=="object"?g[C]=m({},g[C],D[C]):g[C]=D[C]}),g.palette&&(g.palette.colorScheme=f));const Pe=(()=>typeof v=="string"?v:L==="dark"?v.dark:v.light)();if(f===Pe){if(p){const C={};p(z).forEach(W=>{C[W]=R[W],delete R[W]}),F[`[${P}="${f}"]`]=C}F[`${j}, [${P}="${f}"]`]=R}else de[`${j===":root"?"":j}[${P}="${f}"]`]=R}),g.vars=H(g.vars,ae),a.useEffect(()=>{k&&N&&N.setAttribute(P,k)},[k,P,N]),a.useEffect(()=>{let f;if(Q&&O.current&&b){const D=b.createElement("style");D.appendChild(b.createTextNode(Qe)),b.head.appendChild(D),window.getComputedStyle(b.body),f=setTimeout(()=>{b.head.removeChild(D)},1)}return()=>{clearTimeout(f)}},[k,Q,b]),a.useEffect(()=>(O.current=!0,()=>{O.current=!1}),[]);const Te=a.useMemo(()=>({allColorSchemes:B,colorScheme:k,darkColorScheme:le,lightColorScheme:se,mode:_,setColorScheme:ce,setMode:ie,systemMode:ne}),[B,k,le,se,_,ce,ie,ne]);let me=!0;(ke||K&&(X==null?void 0:X.cssVarPrefix)===z)&&(me=!1);const he=ue(a.Fragment,{children:[me&&ue(a.Fragment,{children:[E(G,{styles:{[j]:Ee}}),E(G,{styles:F}),E(G,{styles:de})]}),E(Fe,{themeId:Z?e:void 0,theme:S?S(g):g,children:i})]});return K?he:E(M.Provider,{value:Te,children:he})}const T=typeof n=="string"?n:n.light,w=typeof n=="string"?n:n.dark;return{CssVarsProvider:y,useColorScheme:$,getInitColorSchemeScript:t=>qe(m({attribute:c,colorSchemeStorageKey:d,defaultMode:l,defaultLightColorScheme:T,defaultDarkColorScheme:w,modeStorageKey:x},t))}}const{CssVarsProvider:lo,useColorScheme:co,getInitColorSchemeScript:ao}=Xe({themeId:_e,theme:Le,attribute:"data-joy-color-scheme",modeStorageKey:"joy-mode",colorSchemeStorageKey:"joy-color-scheme",defaultColorScheme:{light:"light",dark:"dark"},resolveTheme:o=>{const e=o.colorInversion;return o.colorInversion=H({soft:je(o),solid:Re(o)},typeof e=="function"?e(o):e,{clone:!1}),o}});function Ze(o){return Ae("MuiDivider",o)}Ne("MuiDivider",["root","horizontal","vertical","insetContext","insetNone"]);const eo=["className","children","component","inset","orientation","role","slots","slotProps"],oo=o=>{const{orientation:e,inset:s}=o,c={root:["root",e,s&&`inset${Ue(s)}`]};return ze(c,Ze,{})},to=Oe("hr",{name:"JoyDivider",slot:"Root",overridesResolver:(o,e)=>e.root})(({theme:o,ownerState:e})=>m({"--Divider-thickness":"1px","--Divider-lineColor":o.vars.palette.divider},e.inset==="none"&&{"--_Divider-inset":"0px"},e.inset==="context"&&{"--_Divider-inset":"var(--Divider-inset, 0px)"},{margin:"initial",marginInline:e.orientation==="vertical"?"initial":"var(--_Divider-inset)",marginBlock:e.orientation==="vertical"?"var(--_Divider-inset)":"initial",position:"relative",alignSelf:"stretch",flexShrink:0},e.children?m({"--Divider-gap":o.spacing(1),"--Divider-childPosition":"50%",display:"flex",flexDirection:e.orientation==="vertical"?"column":"row",alignItems:"center",whiteSpace:"nowrap",textAlign:"center",border:0},o.typography["body-sm"],{"&::before, &::after":{position:"relative",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)",backgroundColor:"var(--Divider-lineColor)",content:'""'},"&::before":{marginInlineEnd:e.orientation==="vertical"?"initial":"min(var(--Divider-childPosition) * 999, var(--Divider-gap))",marginBlockEnd:e.orientation==="vertical"?"min(var(--Divider-childPosition) * 999, var(--Divider-gap))":"initial",flexBasis:"var(--Divider-childPosition)"},"&::after":{marginInlineStart:e.orientation==="vertical"?"initial":"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))",marginBlockStart:e.orientation==="vertical"?"min((100% - var(--Divider-childPosition)) * 999, var(--Divider-gap))":"initial",flexBasis:"calc(100% - var(--Divider-childPosition))"}}):{border:"none",listStyle:"none",backgroundColor:"var(--Divider-lineColor)",inlineSize:e.orientation==="vertical"?"var(--Divider-thickness)":"initial",blockSize:e.orientation==="vertical"?"initial":"var(--Divider-thickness)"})),ve=a.forwardRef(function(e,s){const c=Ve({props:e,name:"JoyDivider"}),{className:x,children:d,component:l=d!=null?"div":"hr",inset:n,orientation:h="horizontal",role:S=l!=="hr"?"separator":void 0,slots:p={},slotProps:M={}}=c,$=Se(c,eo),y=m({},c,{inset:n,role:S,orientation:h,component:l}),T=oo(y),w=m({},$,{component:l,slots:p,slotProps:M}),[r,t]=We("root",{ref:s,className:Ge(T.root,x),elementType:to,externalForwardedProps:w,ownerState:y,additionalProps:m({as:l,role:S},S==="separator"&&h==="vertical"&&{"aria-orientation":"vertical"})});return E(r,m({},t,{children:d}))});ve.muiName="Divider";const mo=ve;export{lo as C,mo as D};
