import{createContext as h,useCallback as k,useEffect as g,useState as c}from"react";import C from"axios";import{createContext as v,useMemo as D}from"react";import{jsx as N}from"react/jsx-runtime";var S=v(void 0),a="production";var i=a==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var s=async e=>{try{return(await C.get(`${i}/consumer`,{headers:{"X-API-KEY":e}})).data}catch(t){return{}}};import{jsx as o,jsxs as d}from"react/jsx-runtime";var b=()=>o("div",{style:{width:"100%",maxWidth:"1660px",margin:"0 auto",height:"630px",display:"flex",alignItems:"center",justifyContent:"center",background:"transparent"},children:d("svg",{viewBox:"0 0 50 50",width:"50",height:"50",children:[o("circle",{cx:"25",cy:"25",r:"20",stroke:"#b1b5c3",strokeWidth:"3",fill:"none"}),d("circle",{cx:"25",cy:"25",r:"10",stroke:"#777e90",strokeWidth:"3",fill:"none",children:[o("animate",{attributeName:"r",values:"10;20;10",dur:"1s",repeatCount:"indefinite"}),o("animate",{attributeName:"stroke-opacity",values:"1;0;1",dur:"1s",repeatCount:"indefinite"})]})]})}),l=b;import{jsx as p}from"react/jsx-runtime";var w=h(void 0),P={profile:{name:"",email:"",profileImage:""},type:"BASIC",domain:"",externalCurrencyEnabled:!1,config:{launchpadEnabled:!1,allowedChains:[],allowedMarketPlaces:[],links:{support:"",whitelist:"",submit:""},categoryFilterEnabled:!0,typeFilterEnabled:!0,zoraReferralAddress:""}},G=({accessKey:e,children:t})=>{let[u,m]=c(P),[n,r]=c(!0),f=k(async()=>{r(!0);let x=await s(e);m(x),r(!1)},[e]);return g(()=>{e&&f()},[e]),n?p(l,{}):p(w.Provider,{value:{...u,isConsumerLoading:n,accessKey:e},children:t})};export{w as ConsumerContext,G as ConsumerContextProvider};
