PageSourceSearch

https://www.reca.lc/assets/themeProvider-jNablMls.js

js reca.lc collected 2026-10-01 23:49:42 UTC 1,086 bytes, 1 lines download raw bytes

1import{K as e,Y as t,t as n}from"./jsx-runtime-vrPXwdFF.js";var r=t(e(),1),i=n(),a=(0,r.createContext)({theme:`system`,setTheme:()=>{}});function o({children:e,defaultTheme:t=`system`,storageKey:n=`vite-ui-theme`}){let[o,s]=(0,r.useState)(()=>{if(typeof window>`u`)return t;let e=localStorage.getItem(n);return e&&[`light`,`dark`,`system`].includes(e)?e:t});(0,r.useEffect)(()=>{if(typeof window>`u`)return;let e=window.document.documentElement;if(e.classList.remove(`light`,`dark`),o===`system`){let t=window.matchMedia(`(prefers-color-scheme: dark)`).matches?`dark`:`light`;e.classList.add(t);return}e.classList.add(o)},[o]);let c=(0,r.useCallback)(e=>{typeof window<`u`&&localStorage.setItem(n,e),s(e)},[n]),l=(0,r.useMemo)(()=>({theme:o,setTheme:c}),[o,c]);return(0,i.jsx)(a.Provider,{value:l,children:e})}function s({children:e,defaultTheme:t=`system`,storageKey:n=`vite-ui-theme`}){return typeof window>`u`?(0,i.jsx)(a.Provider,{value:{theme:t,setTheme:()=>{}},children:e}):(0,i.jsx)(o,{defaultTheme:t,storageKey:n,children:e})}var c=()=>(0,r.useContext)(a);export{c as n,s as t};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.