PageSourceSearch

https://evrloot.com/_next/static/chunks/pages/admin/statistics-27e1c1a360ed1924.js

js evrloot.com collected 2026-10-06 07:56:54 UTC 21,940 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8910],{33929:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/statistics",function(){return n(97482)}])},32282:function(e,t,n){"use strict";n.d(t,{Z:function(){return d}});var r=n(85893),a=n(25675),s=n.n(a),i={src:"/_next/static/media/heading-star.adef37ad.svg",height:37,width:37,blurWidth:0,blurHeight:0},l=n(67294);let o=(0,l.forwardRef)((e,t)=>{let{className:n}=e;return(0,r.jsx)(s(),{priority:!0,src:i,alt:"Star",className:n,ref:t})});o.displayName="Star";var c=n(10990);function d(){let[e,t]=(0,l.useState)(!0),[n,a]=(0,l.useState)(!0),s=(0,l.useRef)(!1),i=(0,l.useRef)(null),d=(0,l.useRef)(null),u=()=>{window.scrollTo({top:0,left:0,behavior:"instant"});let e=i.current,t=d.current;c.p8.timeline().to(t,{scale:2,ease:"power1.out",duration:.4}).to(t,{scale:0,ease:"power1.in",duration:.4}).to(e,{opacity:0,duration:.2}).call(()=>{document.body.style.overflowY="scroll",document.dispatchEvent(new Event("loaded")),a(!1)})},h=()=>{document&&(s.current||"complete"!=document.readyState||(s.current=!0,t(!1),u()))};if((0,l.useEffect)(h,[]),(0,l.useEffect)(()=>(document.addEventListener("readystatechange",h),window.addEventListener("load",h),()=>{document.removeEventListener("readystatechange",h),window.removeEventListener("load",h)}),[]),n)return(0,r.jsx)("div",{ref:i,className:"background w-full h-screen fixed top-0 left-0 z-[100]",children:(0,r.jsx)("div",{className:"grid place-items-center w-screen h-svh",children:(0,r.jsxs)("div",{className:"flex flex-col items-center gap-4 translate-y-1/4",children:[(0,r.jsx)(o,{ref:d,className:e?"animate-spin":""}),(0,r.jsx)("p",{className:"text-text-secondary text-sm",style:{fontVariant:"small-caps"},children:e?"Loading...":"Loaded!"})]})})})}},48537:function(e,t,n){"use strict";n.d(t,{$:function(){return a}});var r=n(85893);function a(){return(0,r.jsx)("div",{className:"flex flex-col items-center justify-center min-h-screen bg-background",children:(0,r.jsxs)("div",{className:"text-center space-y-4",children:[(0,r.jsx)("h1",{className:"text-4xl font-bold text-primary",children:"401 - Unauthorized"}),(0,r.jsx)("p",{className:"text-xl text-muted-foreground",children:"Oops! You don't have permission to access this page."})]})})}},33999:function(e,t,n){"use strict";n.d(t,{c:function(){return f}});var r=n(44610),a=n(85893),s=n(48537),i=n(32282),l=n(67294),o=n(81617),c=n(85401);let d=()=>{let{socket:e}=(0,c.s)(),t=(0,o.Z)(),[n,r]=(0,l.useState)({checked:!1,isAuthorized:!1});return(0,l.useEffect)(()=>{if(!e||!t)return;let a=()=>{e.emit("getAdminAuthorization",{bearerToken:t},e=>{try{r({checked:!0,isAuthorized:e.authorized})}catch(e){console.error("Error in getAdminAuthorization",e)}})};a();let s=setTimeout(()=>{n.checked||a()},2e3);return()=>clearTimeout(s)},[e,t,n.checked]),{authState:n}};var u=n(68029),h=n(88329),x=n(90952),m=n(14114),p=n(25675),g=n.n(p),j=n(41664),v=n.n(j),y=()=>(0,a.jsx)(a.Fragment,{children:(0,a.jsx)(u.x,{as:"header",bg:"gray.100",py:4,px:6,bgColor:"rgb(175,64,64)",children:(0,a.jsxs)(h.k,{alignItems:"center",children:[(0,a.jsx)(g(),{src:"/logo32x32.png",alt:"Evrloot Logo",width:32,height:32}),(0,a.jsx)(x.X,{pl:2,as:"h2",size:"lg",fontFamily:"Gnellen",children:"Admin"}),(0,a.jsx)(m.L,{}),(0,a.jsxs)(h.k,{as:"nav",gap:6,fontFamily:"Gnellen",children:[(0,a.jsx)(v(),{href:"/admin",className:"text-primary hover:underline",children:"Home"}),(0,a.jsx)(v(),{href:"/admin/support",className:"text-primary hover:underline",children:"Support"}),(0,a.jsx)(v(),{href:"/admin/reset",className:"text-primary hover:underline",children:"Reset Stats"}),(0,a.jsx)(v(),{href:"/admin/game-state",className:"text-primary hover:underline",children:"Game State"}),(0,a.jsx)(v(),{href:"/admin/statistics",className:"text-primary hover:underline",children:"Statistics"}),(0,a.jsx)(v(),{href:"/admin/expeditions",className:"text-primary hover:underline",children:"Expedition Stress"})]})]})})}),b=n(44368);let f=e=>(0,b.b)(t=>{let{authState:n}=d();return(0,a.jsx)(a.Fragment,{children:n.checked?n.isAuthorized?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(y,{}),(0,a.jsx)(e,(0,r._)({},t))]}):(0,a.jsx)(s.$,{}):(0,a.jsx)(i.Z,{})})})},44368:function(e,t,n){"use strict";n.d(t,{b:function(){return u}});var r=n(44610),a=n(67462),s=n(85893),i=n(67294),l=n(45007),o=n(33476),c=n(65134),d=n(85401);let u=e=>function(t){let[n,u]=(0,i.useState)(!0),{removeLoading:h}=(0,o.r)(),{socket:x}=(0,d.s)(),m=(0,l.v9)(e=>{var t;return null===(t=e.web3Reducer.connectedWallet)||void 0===t?void 0:t.address}),{socket:p}=(0,d.s)();return((0,i.useEffect)(()=>{null==x||x.emit("ping",e=>{h("login"),h("loading"),u(!1)})},[x]),n)?(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(c.a,{})}):(0,s.jsx)(s.Fragment,{children:(0,s.jsx)(e,(0,a._)((0,r._)({},t),{account:m,socket:p}))})}},81617:function(e,t,n){"use strict";var r=n(45007);t.Z=()=>{let{connectedWallet:e}=(0,r.v9)(e=>e.web3Reducer),{bearerTokens:t}=(0,r.v9)(e=>e.authenticationReducer);return t[null==e?void 0:e.address]||""}},921:function(e,t,n){"use strict";n.d(t,{$:function(){return i}});var r=n(96596),a=n(67294),s=n(85401);let i=()=>{let e=(0,r.p)(),{socket:t}=(0,s.s)();(0,a.useEffect)(()=>(null==t||t.on("adminMessage",t=>{let{title:n,message:r,duration:a,status:s}=t;e({title:n,description:r,status:s||"info",duration:a||1e4,isClosable:!0})}),()=>{null==t||t.off("adminMessage")}),[t])}},97482:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return J}});var r=n(85893),a=n(33999),s=n(921),i=n(67294),l=n(68029),o=n(90952),c=n(43321),d=n(90092),u=n(73636),h=n(55436),x=n(74703),m=n(21901),p=n(57167),g=n(4476),j=n(6007
1),v=n(43416),y=n(74032),b=n(48899),f=n(8186),T=n(5152),D=n.n(T),C=n(23148);let w="https://api.evrloot.xyz",S="".concat(w,"/api/connection-stats"),k="".concat(w,"/api/connection-stats/timeseries"),A="".concat(w,"/api/connection-stats/events/search"),N="".concat(w,"/api/connection-stats/transactions/recent"),E="".concat(w,"/api/connection-stats/transactions/search");C.kL.register(C.uw,C.f$,C.od,C.jn,C.ZL,C.Dx,C.u,C.De);let M=D()(()=>n.e(6495).then(n.bind(n,26495)).then(e=>e.Chart),{loadableGenerated:{webpack:()=>[null]},ssr:!1}),z=e=>{let{stats:t}=e;return(0,r.jsxs)(l.x,{w:"100%",p:4,borderWidth:1,borderRadius:"lg",children:[(0,r.jsx)(o.X,{size:"md",mb:4,children:"Backend Connection Statistics"}),(0,r.jsxs)(c.M,{columns:[1,2,3],spacing:4,children:[(0,r.jsx)(I,{label:"Up-Time",value:t.systemStats.uptimeFormatted}),(0,r.jsx)(I,{label:"Current Connections",value:t.concurrentClients}),(0,r.jsx)(I,{label:"Peak Connections",value:t.peakConcurrentClients}),(0,r.jsx)(I,{label:"Total Unique Wallets (Up-Time)",value:t.historicalStats.uniqueWalletAddresses}),(0,r.jsx)(I,{label:"Avg Connection Time",value:t.averageConnectionTimeFormatted}),(0,r.jsx)(I,{label:"Max Connection Time",value:t.maxConnectionTimeFormatted}),(0,r.jsx)(I,{label:"Hist. Avg Connection Time",value:t.historicalStats.averageConnectionTimeFormatted}),(0,r.jsx)(I,{label:"Hist. Max Connection Time",value:t.historicalStats.maxConnectionTimeFormatted})]})]})},I=e=>{let{label:t,value:n}=e;return(0,r.jsxs)(l.x,{p:4,borderWidth:1,borderRadius:"md",children:[(0,r.jsx)(d.x,{fontSize:"sm",color:"gray.500",children:t}),(0,r.jsx)(d.x,{fontSize:"xl",fontWeight:"bold",children:n})]})},F=e=>{let{data:t,showConnections:n,showAppMemory:a,showSystemMemory:s,showLoadAverage:i,showNetworkTraffic:c=!0,setShowConnections:d,setShowAppMemory:h,setShowSystemMemory:x,setShowLoadAverage:m,setShowNetworkTraffic:p=()=>{}}=e,g={labels:t.map(e=>new Date(e.timestamp).toLocaleTimeString()),datasets:[...n?[{type:"line",label:"Connections",data:t.map(e=>e.connections),borderColor:"rgb(75, 192, 192)",tension:.1,yAxisID:"y3"}]:[],...a?[{type:"line",label:"App Memory %",data:t.map(e=>e.appMemoryPercent),borderColor:"rgb(255, 99, 132)",tension:.1,yAxisID:"y"}]:[],...s?[{type:"line",label:"System Memory %",data:t.map(e=>e.systemMemoryPercent),borderColor:"rgb(54, 162, 235)",tension:.1,yAxisID:"y"}]:[],...i?[{type:"bar",label:"Load Average",data:t.map(e=>e.loadAverage[0]),backgroundColor:"rgb(255, 159, 64, 0.5)",borderColor:"rgb(255, 159, 64)",borderWidth:1,yAxisID:"y2"}]:[],...c?[{type:"line",label:"Network In (KB/s)",data:t.map(e=>{var t;return((null===(t=e.network)||void 0===t?void 0:t.bytesReceivedPerSec)||0)/1024}),borderColor:"rgb(75, 192, 100)",borderDash:[5,5],tension:.1,yAxisID:"y1"},{type:"line",label:"Network Out (KB/s)",data:t.map(e=>{var t;return((null===(t=e.network)||void 0===t?void 0:t.bytesSentPerSec)||0)/1024}),borderColor:"rgb(75, 192, 100)",tension:.1,yAxisID:"y1"}]:[]]};return(0,r.jsxs)(l.x,{w:"100%",p:4,borderWidth:1,borderRadius:"lg",children:[(0,r.jsx)(o.X,{size:"md",mb:4,children:"System Metrics Over Time"}),(0,r.jsxs)(u.U,{mb:4,spacing:4,children:[(0,r.jsx)(L,{label:"Connections",isChecked:n,onChange:d}),(0,r.jsx)(L,{label:"App Memory",isChecked:a,onChange:h}),(0,r.jsx)(L,{label:"System Memory",isChecked:s,onChange:x}),(0,r.jsx)(L,{label:"Load Average",isChecked:i,onChange:m}),(0,r.jsx)(L,{label:"Network Traffic",isChecked:c,onChange:p})]}),(0,r.jsx)(l.x,{h:"400px",children:(0,r.jsx)(M,{type:"line",data:g,options:{maintainAspectRatio:!1,interaction:{mode:"index",intersect:!1},plugins:{tooltip:{callbacks:{label:function(e){let t=e.dataset.label||"";if(t){if(t.includes("Network"))return"".concat(t,": ").concat(e.parsed.y.toFixed(1)," KB/s");if(t.includes("Memory"))return"".concat(t,": ").concat(e.parsed.y.toFixed(1),"%");if("Connections"===t)return"".concat(t,": ").concat(Math.round(e.parsed.y));if("Load Average"===t)return"".concat(t,": ").concat(e.parsed.y.toFixed(2))}return t}}}},scales:{y3:{type:"linear",display:!0,position:"left",title:{display:!0,text:"Connections",color:"rgb(75, 192, 192)"},ticks:{color:"rgb(75, 192, 192)",precision:0},beginAtZero:!0},y:{type:"linear",display:!0,position:"right",title:{display:!0,text:"Memory %",color:"rgb(255, 99, 132)"},ticks:{color:"rgb(255, 99, 132)"},min:0,max:100,grid:{drawOnChartArea:!1}},y1:{type:"linear",display:!0,position:"right",title:{display:!0,text:"Network KB/s",color:"rgb(75, 192, 100)"},ticks:{color:"rgb(75, 192, 100)",callback:e=>"".concat(e," KB/s")},grid:{drawOnChartArea:!1},beginAtZero:!0},y2:{type:"linear",display:!0,position:"right",title:{display:!0,text:"Load Average",color:"rgb(255, 159, 64)"},ticks:{color:"rgb(255, 159, 64)"},grid:{drawOnChartArea:!1},offset:!0,beginAtZero:!0}}}})})]})},L=e=>{let{label:t,isChecked:n,onChange:a}=e;return(0,r.jsxs)(u.U,{children:[(0,r.jsx)(h.r,{isChecked:n,onChange:e=>a(e.target.checked)}),(0,r.jsx)(d.x,{children:t})]})},R=e=>{let{events:t}=e;return(0,r.jsxs)(l.x,{w:"100%",p:4,borderWidth:1,borderRadius:"lg",overflowX:"auto",children:[(0,r.jsx)(o.X,{size:"md",mb:4,children:"Connection 
1Events"}),(0,r.jsxs)(x.i,{variant:"simple",children:[(0,r.jsx)(m.h,{children:(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(g.Th,{children:"Timestamp"}),(0,r.jsx)(g.Th,{children:"Client ID"}),(0,r.jsx)(g.Th,{children:"Address"}),(0,r.jsx)(g.Th,{children:"Event Type"}),(0,r.jsx)(g.Th,{children:"Details"})]})}),(0,r.jsx)(j.p,{children:[...t].sort((e,t)=>new Date(t.timestamp).getTime()-new Date(e.timestamp).getTime()).map((e,t)=>(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(v.Td,{children:new Date(e.timestamp).toLocaleString()}),(0,r.jsx)(v.Td,{children:e.clientId}),(0,r.jsx)(v.Td,{children:e.address||"-"}),(0,r.jsx)(v.Td,{children:(0,r.jsx)(y.C,{colorScheme:"New Connection"===e.eventType?"green":"Disconnect"===e.eventType?"red":"Authentication"===e.eventType?"blue":"gray",children:e.eventType})}),(0,r.jsx)(v.Td,{children:e.details||"-"})]},t))})]})]})},_=e=>{let{connections:t}=e;return(0,r.jsxs)(l.x,{w:"100%",p:4,borderWidth:1,borderRadius:"lg",overflowX:"auto",children:[(0,r.jsx)(o.X,{size:"md",mb:4,children:"Active Connections"}),(0,r.jsxs)(x.i,{variant:"simple",children:[(0,r.jsx)(m.h,{children:(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(g.Th,{children:"Client ID"}),(0,r.jsx)(g.Th,{children:"Address"}),(0,r.jsx)(g.Th,{children:"Connection Time"}),(0,r.jsx)(g.Th,{children:"Connection Count"}),(0,r.jsx)(g.Th,{children:"Last Activity"}),(0,r.jsx)(g.Th,{children:"Region"})]})}),(0,r.jsx)(j.p,{children:t.map(e=>(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(v.Td,{children:e.clientId}),(0,r.jsx)(v.Td,{children:e.walletAddress}),(0,r.jsx)(v.Td,{children:e.durationFormatted}),(0,r.jsx)(v.Td,{isNumeric:!0,children:e.reconnectAttempts}),(0,r.jsx)(v.Td,{children:e.lastActivity}),(0,r.jsx)(v.Td,{children:e.region||"-"})]},e.clientId))})]})]})},O=()=>{let[e,t]=(0,i.useState)(),[n,a]=(0,i.useState)([]),[s,l]=(0,i.useState)([]),[o,c]=(0,i.useState)(!0),[u,h]=(0,i.useState)(),[x,m]=(0,i.useState)(!0),[p,g]=(0,i.useState)(!0),[j,v]=(0,i.useState)(!0),[y,T]=(0,i.useState)(!0),[D,C]=(0,i.useState)(!0),w=async()=>{c(!0);try{let[e,n,r]=await Promise.all([fetch(S),fetch(k),fetch(A)]);if(!e.ok||!n.ok||!r.ok)throw console.log("Failed to fetch data",e,n,r),Error("Failed to fetch data");let[s,i,o]=await Promise.all([e.json(),n.json(),r.json()]);t(s),a(i),l(o)}catch(e){h(e instanceof Error?e.message:"An error occurred")}finally{c(!1)}};return((0,i.useEffect)(()=>{w();let e=setInterval(w,12e4);return()=>clearInterval(e)},[]),o)?(0,r.jsx)(b.$,{size:"xl"}):u?(0,r.jsxs)(d.x,{color:"red.500",children:["Error: ",u]}):(0,r.jsxs)(f.g,{spacing:8,w:"100%",p:4,children:[e&&(0,r.jsx)(z,{stats:e}),(0,r.jsx)(F,{data:n,showConnections:x,showAppMemory:p,showSystemMemory:j,showLoadAverage:y,showNetworkTraffic:D,setShowConnections:m,setShowAppMemory:g,setShowSystemMemory:v,setShowLoadAverage:T,setShowNetworkTraffic:C}),e&&(0,r.jsx)(_,{connections:e.activeConnections}),(0,r.jsx)(R,{events:s})]})};var W=n(82206),X=n(38488),$=n(47714),P=n(42650),Z=n(48204),U=n(85105);let B=D()(()=>n.e(6495).then(n.bind(n,26495)).then(e=>e.Chart),{loadableGenerated:{webpack:()=>[null]},ssr:!1});var G=()=>{let[e,t]=(0,i.useState)([]),[n,a]=(0,i.useState)(!0),[s,c]=(0,i.useState)(),[h,y]=(0,i.useState)(""),[T,D]=(0,i.useState)(""),[C,w]=(0,i.useState)(""),[S,k]=(0,i.useState)(""),[A,M]=(0,i.useState)(new Set),[z,I]=(0,i.useState)("eventType"),[F,L]=(0,i.useState)("asc"),R=async()=>{a(!0),c(void 0);try{let e=await fetch(N);if(!e.ok)throw Error("Failed to fetch recent transactions");let n=await e.json();t(n)}catch(e){c(e instanceof Error?e.message:"An error occurred")}finally{a(!1)}},_=async()=>{a(!0),c(void 0);try{let e=new URLSearchParams;h&&e.append("clientId",h),T&&e.append("eventType",T),C&&e.append("startTime",C),S&&e.append("endTime",S);let n=await fetch(E+"?"+e.toString());if(!n.ok)throw Error("Failed to fetch filtered transactions");let r=await n.json();t(r)}catch(e){c(e instanceof Error?e.message:"An error occurred")}finally{a(!1)}};(0,i.useEffect)(()=>{R()},[]);let O=i.useMemo(()=>{let t=function(e){let t={};return e.forEach(e=>{let n=new Date(e.requestTimestamp);n.setSeconds(0,0);let r=n.toISOString();t[r]||(t[r]={count:0,totalDuration:0,maxDuration:0}),t[r].count++,t[r].totalDuration+=e.durationMs,e.durationMs>t[r].maxDuration&&(t[r].maxDuration=e.durationMs)}),Object.keys(t).sort().map(e=>
1({time:e,count:t[e].count,avgDuration:t[e].totalDuration/t[e].count,maxDuration:t[e].maxDuration}))}(e);return{labels:t.map(e=>new Date(e.time).toLocaleTimeString()),datasets:[{type:"bar",label:"Transaction Count",data:t.map(e=>e.count),backgroundColor:"rgba(75,192,192,0.5)",yAxisID:"y"},{type:"line",label:"Avg Duration (ms)",data:t.map(e=>e.avgDuration),borderColor:"rgba(255,99,132,1)",backgroundColor:"rgba(255,99,132,0.2)",yAxisID:"y1"},{type:"line",label:"Max Duration (ms)",data:t.map(e=>e.maxDuration),borderColor:"rgba(255,159,64,1)",backgroundColor:"rgba(255,159,64,0.2)",yAxisID:"y1"}]}},[e]);return(0,r.jsxs)(l.x,{p:4,children:[(0,r.jsx)(o.X,{size:"lg",mb:4,children:"WebSocket Transaction Tracking"}),(0,r.jsx)(f.g,{align:"start",spacing:4,mb:6,children:(0,r.jsxs)(u.U,{spacing:4,children:[(0,r.jsx)(W.I,{placeholder:"Client ID",value:h,onChange:e=>y(e.target.value),width:"200px"}),(0,r.jsx)(W.I,{placeholder:"Event Type (partial)",value:T,onChange:e=>D(e.target.value),width:"200px"}),(0,r.jsx)(W.I,{type:"datetime-local",value:C,onChange:e=>w(e.target.value),width:"220px",placeholder:"Start Time"}),(0,r.jsx)(W.I,{type:"datetime-local",value:S,onChange:e=>k(e.target.value),width:"220px",placeholder:"End Time"}),(0,r.jsx)(X.z,{colorScheme:"blue",onClick:_,children:"Search"}),(0,r.jsx)(X.z,{variant:"outline",onClick:()=>{y(""),D(""),w(""),k(""),R()},children:"Reset"})]})}),e.length>0&&(0,r.jsx)(l.x,{mb:8,h:"350px",p:4,borderWidth:1,borderRadius:"lg",children:(0,r.jsx)(B,{type:"bar",data:O,options:{maintainAspectRatio:!1,plugins:{legend:{display:!0},tooltip:{mode:"index",intersect:!1}},interaction:{mode:"index",intersect:!1},scales:{y:{type:"linear",display:!0,position:"left",title:{display:!0,text:"Transaction Count"},beginAtZero:!0},y1:{type:"linear",display:!0,position:"right",title:{display:!0,text:"Duration (ms)"},beginAtZero:!0,grid:{drawOnChartArea:!1}}}}})}),n?(0,r.jsx)(b.$,{size:"xl"}):s?(0,r.jsxs)(d.x,{color:"red.500",children:["Error: ",s]}):(0,r.jsxs)(l.x,{overflowX:"auto",children:[(0,r.jsx)(d.x,{mb:2,fontSize:"sm",color:"gray.600",children:"Tip: Click on the table headings to sort by that column."}),(0,r.jsxs)(x.i,{variant:"simple",children:[(0,r.jsx)(m.h,{children:(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(g.Th,{}),(0,r.jsxs)(g.Th,{cursor:"pointer",onClick:()=>{"eventType"===z?L(e=>"asc"===e?"desc":"asc"):(I("eventType"),L("asc"))},children:["Event Type"," ","eventType"===z&&("asc"===F?(0,r.jsx)($.$,{boxSize:3}):(0,r.jsx)(P.A,{boxSize:3}))]}),(0,r.jsx)(g.Th,{children:"Address"}),(0,r.jsxs)(g.Th,{isNumeric:!0,cursor:"pointer",onClick:()=>{"calls"===z?L(e=>"asc"===e?"desc":"asc"):(I("calls"),L("desc"))},children:["Calls"," ","calls"===z&&("asc"===F?(0,r.jsx)($.$,{boxSize:3}):(0,r.jsx)(P.A,{boxSize:3}))]}),(0,r.jsxs)(g.Th,{isNumeric:!0,cursor:"pointer",onClick:()=>{"avgDuration"===z?L(e=>"asc"===e?"desc":"asc"):(I("avgDuration"),L("desc"))},children:["Avg Duration (ms)"," ","avgDuration"===z&&("asc"===F?(0,r.jsx)($.$,{boxSize:3}):(0,r.jsx)(P.A,{boxSize:3}))]}),(0,r.jsx)(g.Th,{isNumeric:!0,children:"Min Duration (ms)"}),(0,r.jsxs)(g.Th,{isNumeric:!0,cursor:"pointer",onClick:()=>{"maxDuration"===z?L(e=>"asc"===e?"desc":"asc"):(I("maxDuration"),L("desc"))},children:["Max Duration (ms)"," ","maxDuration"===z&&("asc"===F?(0,r.jsx)($.$,{boxSize:3}):(0,r.jsx)(P.A,{boxSize:3}))]})]})}),(0,r.jsx)(j.p,{children:(function(e){let t={};return e.forEach(e=>{if(0===e.durationMs)return;let n=e.eventType,r=e.address||"-";t[n]||(t[n]={durations:[],addresses:{}}),t[n].durations.push(e.durationMs),t[n].addresses[r]||(t[n].addresses[r]=[]),t[n].addresses[r].push(e.durationMs)}),Object.entries(t).map(e=>{let[t,{durations:n,addresses:r}]=e,a=n.length>0?n.reduce((e,t)=>e+t,0)/n.length:null,s=n.length>0?Math.min(...n):null,i=n.length>0?Math.max(...n):null,l=n.length,o=Object.entries(r).map(e=>{let[n,r]=e,a=r.length>0?r.reduce((e,t)=>e+t,0)/r.length:null;return{type:"address",eventType:t,address:n,avgDuration:a,minDuration:r.length>0?Math.min(...r):null,maxDuration:r.length>0?Math.max(...r):null,calls:r.length}});return("avgDuration"===z||"maxDuration"===z||"calls"===z)&&(o=o.sort((e,t)=>
1{let n=null,r=null;return("avgDuration"===z?(n=e.avgDuration,r=t.avgDuration):"maxDuration"===z?(n=e.maxDuration,r=t.maxDuration):"calls"===z&&(n=e.calls,r=t.calls),null===n&&null===r)?0:null===n?1:null===r?-1:"asc"===F?n-r:r-n})),{type:"eventType",eventType:t,avgDuration:a,minDuration:s,maxDuration:i,calls:l,addresses:o}}).sort((e,t)=>"eventType"===z?"asc"===F?e.eventType.localeCompare(t.eventType):t.eventType.localeCompare(e.eventType):"avgDuration"===z?null===e.avgDuration&&null===t.avgDuration?0:null===e.avgDuration?1:null===t.avgDuration?-1:"asc"===F?e.avgDuration-t.avgDuration:t.avgDuration-e.avgDuration:"maxDuration"===z?null===e.maxDuration&&null===t.maxDuration?0:null===e.maxDuration?1:null===t.maxDuration?-1:"asc"===F?e.maxDuration-t.maxDuration:t.maxDuration-e.maxDuration:"calls"===z?"asc"===F?e.calls-t.calls:t.calls-e.calls:0)})(e).map((e,t)=>(0,r.jsxs)(i.Fragment,{children:[(0,r.jsxs)(p.Tr,{bg:"gray.50",children:[(0,r.jsx)(v.Td,{children:(0,r.jsx)(X.z,{size:"xs",variant:"ghost",onClick:()=>{M(t=>{let n=new Set(t);return n.has(e.eventType)?n.delete(e.eventType):n.add(e.eventType),n})},"aria-label":A.has(e.eventType)?"Collapse":"Expand",children:A.has(e.eventType)?(0,r.jsx)(Z.v,{}):(0,r.jsx)(U.X,{})})}),(0,r.jsx)(v.Td,{fontWeight:"bold",children:e.eventType}),(0,r.jsx)(v.Td,{fontStyle:"italic",color:"gray.500",children:"All"}),(0,r.jsx)(v.Td,{isNumeric:!0,children:e.calls}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==e.avgDuration?e.avgDuration.toFixed(2):"N/A"}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==e.minDuration?e.minDuration:"N/A"}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==e.maxDuration?e.maxDuration:"N/A"})]}),A.has(e.eventType)&&e.addresses.map((t,n)=>(0,r.jsxs)(p.Tr,{children:[(0,r.jsx)(v.Td,{}),(0,r.jsx)(v.Td,{}),(0,r.jsx)(v.Td,{children:t.address}),(0,r.jsx)(v.Td,{isNumeric:!0,children:t.calls}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==t.avgDuration?t.avgDuration.toFixed(2):"N/A"}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==t.minDuration?t.minDuration:"N/A"}),(0,r.jsx)(v.Td,{isNumeric:!0,children:null!==t.maxDuration?t.maxDuration:"N/A"})]},e.eventType+"-"+t.address))]},e.eventType))})]})]})]})},K=n(95478),H=n(59342),q=n(90573),Y=n(33229),V=n(8387),J=(0,a.c)(()=>((0,s.$)(),(0,r.jsx)("div",{className:"min-h-screen bg-gray-50",children:(0,r.jsx)("div",{className:"max-w-4xl mx-auto p-8",children:(0,r.jsxs)(K.m,{variant:"enclosed",colorScheme:"blue",children:[(0,r.jsxs)(H.t,{children:[(0,r.jsx)(q.O,{children:"Backend Stats"}),(0,r.jsx)(q.O,{children:"WebSocket Tracking"})]}),(0,r.jsxs)(Y.n,{children:[(0,r.jsx)(V.x,{children:(0,r.jsx)(O,{})}),(0,r.jsx)(V.x,{children:(0,r.jsx)(G,{})})]})]})})})))}},function(e){e.O(0,[8802,2196,533,5312,8143,9721,2888,9774,179],function(){return e(e.s=33929)}),_N_E=e.O()}]);

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.