import t,{useEffect as e}from"react";import{CortexApi as o}from"../api/CortexApi.js";import n from"../node_modules/lodash/noop.js";const r=t.createContext({context:void 0,setContext:n}),a=async(t,e)=>await o.proxyFetch(t,e),c=({children:n})=>{const[c,i]=t.useState(!0),[s,d]=t.useState();return e((()=>{(async()=>{try{const t=await o.getContext();d(t)}finally{i(!1)}})()}),[]),e((()=>{const t=window.fetch;return window.fetch=a,window.rawFetch=t,()=>{window.fetch=t}}),[]),c?null:t.createElement(r.Provider,{value:{context:s,setContext:d}},n)};export{r as PluginContext,c as default};
//# sourceMappingURL=PluginContextProvider.js.map
