import{r as l}from"./index-IcUiXVgY.js";var v=(t,i,m,o,n,r,d,u)=>{let s=document.documentElement,h=["light","dark"];function c(e){(Array.isArray(t)?t:[t]).forEach(a=>{let p=a==="class",S=p&&r?n.map(f=>r[f]||f):n;p?(s.classList.remove(...S),s.classList.add(r&&r[e]?r[e]:e)):s.setAttribute(a,e)}),y(e)}function y(e){u&&h.includes(e)&&(s.style.colorScheme=e)}function g(){return window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}if(o)c(o);else try{let e=localStorage.getItem(i)||m,a=d&&e==="system"?g():e;c(a)}catch{}},w=l.createContext(void 0),x={setTheme:t=>{},themes:[]},k=()=>{var t;return(t=l.useContext(w))!=null?t:x};l.memo(({forcedTheme:t,storageKey:i,attribute:m,enableSystem:o,enableColorScheme:n,defaultTheme:r,value:d,themes:u,nonce:s,scriptProps:h})=>{let c=JSON.stringify([m,i,r,t,u,d,o,n]).slice(1,-1);return l.createElement("script",{...h,suppressHydrationWarning:!0,nonce:typeof window>"u"?s:"",dangerouslySetInnerHTML:{__html:`(${v.toString()})(${c})`}})});export{k as z};