{"version":3,"file":"NetworkStatsOverrides.DX_rwTes.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/DtbN6tjqwQn9pdpdJiqk/6eyWLO2rfaYUCB6SY88D/NetworkStatsOverrides.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";// API endpoint for network stats (direct HTTPS)\nconst STATS_API=\"https://stats.autonomi.com/\";/**\n * Code Override for Nodes Online\n * Fetches ant_network_size and rounds to nearest hundred\n */export function NodesOnline(Component){return props=>{const[nodes,setNodes]=useState(\"Loading...\");useEffect(()=>{fetch(STATS_API).then(res=>res.json()).then(data=>{// Round to nearest hundred\nconst rounded=Math.round(data.ant_network_size/100)*100;// Format with commas\nconst formatted=new Intl.NumberFormat(\"en-US\").format(rounded);setNodes(formatted);}).catch(error=>{console.error(\"Error fetching nodes:\",error);setNodes(\"Error loading data\");});},[]);return /*#__PURE__*/_jsx(Component,{...props,text:nodes});};}/**\n * Code Override for Network Capacity in Petabytes\n * Converts ant_network_raw_capacity_bytes to PB\n */export function StorageOffered(Component){return props=>{const[capacity,setCapacity]=useState(\"Loading...\");useEffect(()=>{fetch(STATS_API).then(res=>res.json()).then(data=>{// Convert bytes to petabytes (1 PB = 1024^5 bytes)\nconst petabytes=data.ant_network_raw_capacity_bytes/1024**5;// Format to 2 decimal places\nconst formatted=petabytes.toFixed(2);setCapacity(`${formatted} PB`);}).catch(error=>{console.error(\"Error fetching capacity:\",error);setCapacity(\"Error loading data\");});},[]);return /*#__PURE__*/_jsx(Component,{...props,text:capacity});};}\nexport const __FramerMetadata__ = {\"exports\":{\"StorageOffered\":{\"type\":\"reactHoc\",\"name\":\"StorageOffered\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"NodesOnline\":{\"type\":\"reactHoc\",\"name\":\"NodesOnline\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./NetworkStatsOverrides.map"],"mappings":"yHAIG,SAAgB,EAAY,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAM,GAAUA,EAAS,aAAa,CAEoF,OAFnF,MAAc,CAAC,MAAM,EAAU,CAAC,KAAK,GAAK,EAAI,MAAM,CAAC,CAAC,KAAK,GAAM,CACvK,IAAM,EAAQ,KAAK,MAAM,EAAK,iBAAiB,IAAI,CAAC,IACW,EAA/C,IAAI,KAAK,aAAa,QAAQ,CAAC,OAAO,EAAQ,CAAoB,EAAG,CAAC,MAAM,GAAO,CAAC,QAAQ,MAAM,wBAAwB,EAAM,CAAC,EAAS,qBAAqB,EAAG,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAM,CAAC,EAG/O,SAAgB,EAAe,EAAU,CAAC,MAAO,IAAO,CAAC,GAAK,CAAC,EAAS,GAAaA,EAAS,aAAa,CAEkE,OAFjE,MAAc,CAAC,MAAM,EAAU,CAAC,KAAK,GAAK,EAAI,MAAM,CAAC,CAAC,KAAK,GAAM,CAE3I,EAAY,IADjC,EAAK,+BAA+B,MAAM,GAChC,QAAQ,EAAE,CAA0B,KAAK,EAAG,CAAC,MAAM,GAAO,CAAC,QAAQ,MAAM,2BAA2B,EAAM,CAAC,EAAY,qBAAqB,EAAG,EAAG,EAAE,CAAC,CAAqB,EAAK,EAAU,CAAC,GAAG,EAAM,KAAK,EAAS,CAAC,qBAXjM,IAAsC,CAC3E,EAAU"}