import e,{useState as t,useEffect as o}from"react";import"../node_modules/@cortexapps/react-plugin-ui/dist/index.css.js";import{CortexApi as s}from"../api/CortexApi.js";const n=({children:n})=>{const[c,r]=t(null),m=c?.style;o((()=>{(async()=>{const e=await s.getContext();r(e)})()}),[]);const d={};return m&&Object.entries(m).forEach((([e,t])=>{d[e]=t,document.body.style.setProperty(e,t),document.documentElement.style.setProperty(e,t),c?.theme&&(document.documentElement.classList.remove("light","dark"),document.documentElement.classList.add(c.theme))})),e.createElement("div",{style:d},n)};export{n as default};
//# sourceMappingURL=ThemeProvider.js.map
