UNPKG

pulse-dashboard

Version:

A Next.js Dashboard application for real-time monitoring and historical analysis of Playwright test executions. This component provides the UI for visualizing Playwright test results and can be run as a standalone CLI tool.

1 lines 26 kB
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[966],{5966:(e,t,s)=>{s.r(t),s.d(t,{DashboardOverviewCharts:()=>Q});var a=s(95155),l=s(66695),r=s(68856),n=s(55365),d=s(77283),i=s(83540),o=s(8782),c=s(34e3),u=s(54811),m=s(94517),x=s(24026),h=s(3401),f=s(94754),p=s(96025),g=s(16238),j=s(83394),v=s(36079),N=s(99036),w=s(81710),y=s(57679),b=s(7270),k=s(50594),S=s(8376),z=s(50286),T=s(75074),F=s(63587),A=s(8531),C=s(59434),R=s(12115),I=s(62523),D=s(59409),K=s(30285),Z=s(48698),M=s(73158),B=s(10518),O=s(70154);let W=Z.bL,E=Z.l9;Z.YJ,Z.ZL,Z.Pb,Z.z6,R.forwardRef((e,t)=>{let{className:s,inset:l,children:r,...n}=e;return(0,a.jsxs)(Z.ZP,{ref:t,className:(0,C.cn)("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",l&&"pl-8",s),...n,children:[r,(0,a.jsx)(M.A,{className:"ml-auto"})]})}).displayName=Z.ZP.displayName,R.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(Z.G5,{ref:t,className:(0,C.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...l})}).displayName=Z.G5.displayName;let L=R.forwardRef((e,t)=>{let{className:s,sideOffset:l=4,...r}=e;return(0,a.jsx)(Z.ZL,{children:(0,a.jsx)(Z.UC,{ref:t,sideOffset:l,className:(0,C.cn)("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",s),...r})})});L.displayName=Z.UC.displayName,R.forwardRef((e,t)=>{let{className:s,inset:l,...r}=e;return(0,a.jsx)(Z.q7,{ref:t,className:(0,C.cn)("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",l&&"pl-8",s),...r})}).displayName=Z.q7.displayName;let P=R.forwardRef((e,t)=>{let{className:s,children:l,checked:r,...n}=e;return(0,a.jsxs)(Z.H_,{ref:t,className:(0,C.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),checked:r,...n,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(Z.VF,{children:(0,a.jsx)(B.A,{className:"h-4 w-4"})})}),l]})});P.displayName=Z.H_.displayName,R.forwardRef((e,t)=>{let{className:s,children:l,...r}=e;return(0,a.jsxs)(Z.hN,{ref:t,className:(0,C.cn)("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",s),...r,children:[(0,a.jsx)("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:(0,a.jsx)(Z.VF,{children:(0,a.jsx)(O.A,{className:"h-2 w-2 fill-current"})})}),l]})}).displayName=Z.hN.displayName;let _=R.forwardRef((e,t)=>{let{className:s,inset:l,...r}=e;return(0,a.jsx)(Z.JU,{ref:t,className:(0,C.cn)("px-2 py-1.5 text-sm font-semibold",l&&"pl-8",s),...r})});_.displayName=Z.JU.displayName;let U=R.forwardRef((e,t)=>{let{className:s,...l}=e;return(0,a.jsx)(Z.wv,{ref:t,className:(0,C.cn)("-mx-1 my-1 h-px bg-muted",s),...l})});U.displayName=Z.wv.displayName;var q=s(46102);let V=e=>{let{children:t,placeholderHeight:s="300px"}=e,[l,n]=(0,R.useState)(!1),d=(0,R.useRef)(null);return(0,R.useEffect)(()=>{let e=new IntersectionObserver(t=>{let[s]=t;s.isIntersecting&&(n(!0),e.disconnect())},{rootMargin:"0px 0px 200px 0px"}),t=d.current;return t&&e.observe(t),()=>{t&&e.unobserve(t)}},[]),(0,a.jsx)("div",{ref:d,style:{minHeight:l?void 0:s},children:l?t:(0,a.jsx)(r.E,{className:"w-full rounded-lg",style:{height:s}})})},H={passed:"hsl(var(--chart-3))",failed:"hsl(var(--destructive))",skipped:"hsl(var(--accent))",timedOut:"hsl(var(--destructive))",pending:"hsl(var(--muted-foreground))",default1:"hsl(var(--chart-1))",default2:"hsl(var(--chart-2))",default3:"hsl(var(--chart-4))",default4:"hsl(var(--chart-5))",default5:"hsl(var(--chart-3))"};function J(e){if(0===e)return"0s";let t=parseFloat((e/1e3).toFixed(1));return"".concat(t,"s")}function $(e){if(!e)return"";let t=e.split(" > ");return t[t.length-1]||e}let G=e=>{let{active:t,payload:s,label:l}=e;if(t&&s&&s.length){var r;let e;let t=s[0].payload,n=t&&void 0!==t.total&&s.length>0,d=t&&void 0!==t.percentage&&t.name;return"undefined"===(e=d&&(null==t?void 0:t.name)?t.name:(null==t?void 0:t.fullTestName)?$(t.fullTestName):String(l))&&(null===(r=s[0])||void 0===r?void 0:r.name)!==void 0&&(e=String(s[0].name)),"undefined"===e&&(e="Details"),(0,a.jsxs)("div",{className:"bg-card p-3 border border-border rounded-md shadow-lg",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground truncate max-w-xs",title:e,children:e}),s.map((e,s)=>{var l,r;return(0,a.jsxs)("p",{style:{color:e.color||(null===(l=e.payload)||void 0===l?void 0:l.fill)},className:"text-xs",children:["".concat(e.name||"Value",": ").concat(null===(r=e.value)||void 0===r?void 0:r.toLocaleString()).concat(e.unit||""),d&&t&&e.name===t.name&&" (".concat(t.percentage,"%)")]},"item-".concat(s))}),n&&t&&(0,a.jsxs)("p",{className:"text-xs font-bold mt-1 text-foreground",children:["Total: ",t.total.toLocaleString()]})]})}return null},X=e=>{let{browserName:t,className:s}=e,l=function(e){if(!e)return"Unknown";let t=e.toLowerCase();return(t.includes("chrome")||t.includes("chromium"))&&(t.includes("mobile")||t.includes("android"))?"Chrome Mobile":t.includes("safari")&&t.includes("mobile")?"Mobile Safari":t.includes("chrome")||t.includes("chromium")?"Chrome":t.includes("firefox")?"Firefox":t.includes("msedge")||t.includes("edge")?"Edge":t.includes("safari")||t.includes("webkit")?"Safari":"Unknown"}(t);return"Chrome"===l||"Chrome Mobile"===l?(0,a.jsx)(N.A,{className:(0,C.cn)("h-4 w-4",s)}):"Safari"===l||"Mobile Safari"===l?(0,a.jsx)(w.A,{className:(0,C.cn)("h-4 w-4",s)}):(0,a.jsx)(y.A,{className:(0,C.cn)("h-4 w-4",s)})},Y=e=>{let t=Math.PI/180,{cx:s,cy:l,midAngle:r,innerRadius:n=0,outerRadius:i=0,startAngle:o=0,endAngle:c=0,fill:u,payload:m,percent:x,value:h=0}=e,f=Math.sin(-t*(null!=r?r:0)),p=Math.cos(-t*(null!=r?r:0)),g=(null!=s?s:0)+(i+10)*p,j=(null!=l?l:0)+(i+10)*f,v=(null!=s?s:0)+(i+30)*p,N=(null!=l?l:0)+(i+30)*f,w=v+(p>=0?1:-1)*22,y=p>=0?"start":"end",b=(null==m?void 0:m.name)==="Passed"?H.passed:"hsl(var(--foreground))";return(0,a.jsxs)("g",{children:[(0,a.jsx)("text",{x:s,y:l,dy:8,textAnchor:"middle",fill:b,className:"text-lg font-bold",children:null==m?void 0:m.name}),(0,a.jsx)(d.h,{cx:s,cy:l,innerRadius:n,outerRadius:i,startAngle:o,endAngle:c,fill:u}),(0,a.jsx)(d.h,{cx:s,cy:l,startAngle:o,endAngle:c,innerRadius:i+6,outerRadius:i+10,fill:u}),(0,a.jsx)("path",{d:"M".concat(g,",").concat(j,"L").concat(v,",").concat(N,"L").concat(w,",").concat(N),stroke:u,fill:"none"}),(0,a.jsx)("circle",{cx:w,cy:N,r:2,fill:u,stroke:"none"}),(0,a.jsx)("text",{x:w+(p>=0?1:-1)*12,y:N,textAnchor:y,fill:"hsl(var(--foreground))",className:"text-xs",children:"".concat(h)}),(0,a.jsx)("text",{x:w+(p>=0?1:-1)*12,y:N,dy:18,textAnchor:y,fill:"hsl(var(--muted-foreground))",className:"text-xs",children:"(Rate ".concat(((null!=x?x:0)*100).toFixed(2),"%)")})]})};function Q(e){let{currentRun:t,loading:s,error:d}=e,[N,w]=(0,R.useState)(""),[y,C]=(0,R.useState)("all"),[Z,M]=(0,R.useState)([]),B=(0,R.useMemo)(()=>(null==t?void 0:t.results)?Array.from(new Set(t.results.map(e=>e.suiteName).filter(e=>e))).sort():[],[null==t?void 0:t.results]),O=(0,R.useMemo)(()=>(null==t?void 0:t.results)?Array.from(new Set(t.results.map(e=>e.workerId).filter(e=>null!=e&&""!==e&&"-1"!==String(e)).map(e=>String(e)))).sort((e,t)=>e.localeCompare(t,void 0,{numeric:!0})):[],[null==t?void 0:t.results]);(0,R.useEffect)(()=>{O.length>0&&M(O)},[O]);let Q=(0,R.useMemo)(()=>(null==t?void 0:t.results)?Object.entries(t.results.filter(e=>{let t=null!=e.workerId?String(e.workerId):"";return(!(Z.length>0)||!!Z.includes(t))&&("all"===y||e.suiteName===y)&&(!N||!!e.name.toLowerCase().includes(N.toLowerCase()))&&"-1"!==t&&""!==t&&e.startTime&&"number"==typeof e.duration}).reduce((e,t)=>{let s=null!=t.workerId?String(t.workerId):"unknown";return e[s]||(e[s]=[]),e[s].push(t),e},{})).map(e=>{let[t,s]=e;return{workerId:t,tests:s.sort((e,t)=>new Date(e.startTime).getTime()-new Date(t.startTime).getTime()),totalDuration:s.reduce((e,t)=>e+t.duration,0)}}).sort((e,t)=>e.workerId.localeCompare(t.workerId,void 0,{numeric:!0})):[],[null==t?void 0:t.results,N,y,Z]),[ee,et]=(0,R.useState)(0),es=(0,R.useCallback)((e,t)=>{et(t)},[]),ea=(0,R.useCallback)(()=>{et(0)},[]),el=(0,R.useMemo)(()=>""!==N||"all"!==y||Z.length!==O.length,[N,y,Z,O]),er=(0,R.useCallback)(()=>{w(""),C("all"),M(O)},[O]);if(s)return(0,a.jsx)("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3 mt-6",children:[void 0,void 0,void 0,void 0,void 0].map((e,t)=>(0,a.jsxs)(l.Zp,{className:"shadow-md rounded-xl",children:[(0,a.jsxs)(l.aR,{children:[(0,a.jsx)(r.E,{className:"h-5 w-3/4 rounded-md"}),(0,a.jsx)(r.E,{className:"h-4 w-1/2 mt-1 rounded-md"})]}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)(r.E,{className:"h-48 w-full rounded-lg"})})]},t))});if(d)return(0,a.jsxs)(n.Fc,{variant:"destructive",className:"mt-6 rounded-lg",children:[(0,a.jsx)(b.A,{className:"h-4 w-4"}),(0,a.jsx)(n.XL,{children:"Error Loading Chart Data"}),(0,a.jsx)(n.TN,{children:d})]});if(!t||!t.run||!t.results)return(0,a.jsxs)(n.Fc,{className:"mt-6 rounded-lg",children:[(0,a.jsx)(k.A,{className:"h-4 w-4"}),(0,a.jsx)(n.XL,{children:"No Data for Charts"}),(0,a.jsx)(n.TN,{children:"Current run data is not available to display charts."})]});let{passed:en,failed:ed,skipped:ei,timedOut:eo=0,pending:ec=0}=t.run,eu=en+ed+ei+eo+ec,em=[{name:"Passed",value:en,fill:H.passed},{name:"Failed",value:ed+eo,fill:H.failed},{name:"Skipped",value:ei,fill:H.skipped},...ec>0?[{name:"Pending",value:ec,fill:H.pending}]:[]].filter(e=>e.value>0).map(e=>({...e,name:e.name,value:e.value,fill:e.fill,percentage:eu>0?(e.value/eu*100).toFixed(1):"0.0"})),ex=Object.values(t.results.reduce((e,t)=>{let s=t.browser||"Unknown";return e[s]||(e[s]={name:s,passed:0,failed:0,skipped:0,pending:0,total:0}),"passed"===t.status?e[s].passed++:"failed"===t.status||"timedOut"===t.status?e[s].failed++:"skipped"===t.status?e[s].skipped++:"pending"===t.status&&e[s].pending++,e[s].total++,e},{})).sort((e,t)=>t.total-e.total),eh=t.results.filter(e=>"failed"===e.status||"timedOut"===e.status).map(e=>{let t=$(e.name);return{name:t.length>50?t.substring(0,47)+"...":t,duration:e.duration,durationFormatted:J(e.duration),fullTestName:e.name}}).sort((e,t)=>t.duration-e.duration).slice(0,10),ef=Object.values(t.results.reduce((e,t)=>{let s=t.suiteName||"Unknown Suite";return e[s]||(e[s]={name:s,passed:0,failed:0,skipped:0,pending:0,total:0}),"passed"===t.status?e[s].passed++:"failed"===t.status||"timedOut"===t.status?e[s].failed++:"skipped"===t.status?e[s].skipped++:"pending"===t.status&&e[s].pending++,e[s].total++,e},{})).sort((e,t)=>t.total-e.total),ep=[...t.results].sort((e,t)=>t.duration-e.duration).slice(0,5).map(e=>({name:$(e.name),duration:e.duration,durationFormatted:J(e.duration),fullTestName:e.name,status:e.status})),eg=ex.some(e=>e.pending>0),ej=ef.some(e=>e.pending>0);return(0,a.jsxs)("div",{className:"grid gap-6 md:grid-cols-1 lg:grid-cols-2 mt-6",children:[(0,a.jsxs)(l.Zp,{className:"lg:col-span-1 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsx)(l.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.ZB,{className:"text-lg font-semibold text-foreground",children:"Test Distribution"}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Passed, Failed, Skipped for the current run."})]})}),(0,a.jsx)(l.Wu,{className:"flex justify-center items-center min-h-[280px]",children:(0,a.jsx)("div",{className:"w-full h-[280px]",children:em.length>0?(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(o.r,{margin:{top:0,right:0,bottom:0,left:0},onMouseLeave:ea,children:[(0,a.jsx)(c.F,{activeIndex:ee,activeShape:Y,data:em,cx:"50%",cy:"50%",innerRadius:60,outerRadius:90,dataKey:"value",nameKey:"name",onMouseEnter:es,paddingAngle:2,stroke:"hsl(var(--card))",children:em.map((e,t)=>(0,a.jsx)(u.f,{fill:e.fill},"cell-".concat(t)))}),(0,a.jsx)(m.m,{content:(0,a.jsx)(G,{})}),(0,a.jsx)(x.s,{iconSize:10,layout:"horizontal",verticalAlign:"bottom",align:"center",wrapperStyle:{fontSize:"12px",paddingTop:"10px"}})]})}):(0,a.jsx)("div",{className:"text-center text-muted-foreground",children:"No test distribution data."})})})]}),(0,a.jsxs)(l.Zp,{className:"lg:col-span-1 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsx)(l.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.ZB,{className:"text-lg font-semibold text-foreground",children:"Tests by Browser"}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Breakdown of test outcomes per browser."})]})}),(0,a.jsxs)(l.Wu,{children:[(0,a.jsx)("div",{className:"w-full h-[250px]",children:ex.length>0?(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(h.E,{data:ex,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[(0,a.jsx)(f.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(p.W,{type:"number",stroke:"hsl(var(--muted-foreground))",fontSize:10}),(0,a.jsx)(g.h,{dataKey:"name",type:"category",stroke:"hsl(var(--muted-foreground))",fontSize:10,width:150,tickFormatter:e=>e.length>20?e.substring(0,17)+"...":e,interval:0}),(0,a.jsx)(m.m,{content:(0,a.jsx)(G,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.3}}),(0,a.jsx)(x.s,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,a.jsx)(j.y,{dataKey:"passed",name:"Passed",stackId:"a",fill:H.passed,barSize:20}),(0,a.jsx)(j.y,{dataKey:"failed",name:"Failed",stackId:"a",fill:H.failed,barSize:20}),(0,a.jsx)(j.y,{dataKey:"skipped",name:"Skipped",stackId:"a",fill:H.skipped,barSize:20}),eg&&(0,a.jsx)(j.y,{dataKey:"pending",name:"Pending",stackId:"a",fill:H.pending,barSize:20})]})}):(0,a.jsx)("div",{className:"text-center text-muted-foreground h-[250px] flex items-center justify-center",children:"No browser data."})}),(0,a.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-2 mt-3 text-xs text-muted-foreground",children:ex.map(e=>(0,a.jsxs)("div",{className:"flex items-center gap-1",title:e.name,children:[(0,a.jsx)(X,{browserName:e.name,className:"mr-1"}),(0,a.jsx)("span",{className:"truncate max-w-[150px]",children:e.name})]},e.name))}),(0,a.jsx)("p",{className:"text-xs text-muted-foreground mt-2",children:"Note: Icons are representative. Full browser name (including version) is shown in tooltip."})]})]}),(0,a.jsxs)(l.Zp,{className:"lg:col-span-1 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsx)(l.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.ZB,{className:"text-lg font-semibold text-foreground",children:"Failed Tests Duration"}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Duration of failed or timed out tests (Top 10)."})]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"w-full h-[250px]",children:eh.length>0?(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(h.E,{data:eh,margin:{top:5,right:5,left:5,bottom:60},children:[(0,a.jsx)(f.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(p.W,{dataKey:"name",stroke:"hsl(var(--muted-foreground))",fontSize:10,angle:-40,textAnchor:"end",interval:0}),(0,a.jsx)(g.h,{stroke:"hsl(var(--muted-foreground))",fontSize:10,tickFormatter:e=>J(e),domain:[0,e=>e>0?Math.round(1.2*e):100]}),(0,a.jsx)(m.m,{content:e=>{let{active:t,payload:s,label:l}=e;if(t&&s&&s.length){let e=s[0].payload;return(0,a.jsxs)("div",{className:"bg-card p-3 border border-border rounded-md shadow-lg",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground truncate max-w-xs",title:e.fullTestName,children:$(e.fullTestName)}),(0,a.jsxs)("p",{className:"text-xs",style:{color:H.failed},children:["Duration: ",J(e.duration)]})]})}return null},cursor:{fill:"hsl(var(--muted))",fillOpacity:.3}}),(0,a.jsx)(j.y,{dataKey:"duration",name:"Duration",fill:H.failed,barSize:20,children:(0,a.jsx)(v.Z,{dataKey:"durationFormatted",position:"top",style:{fontSize:"10px",fill:"hsl(var(--destructive))"}})})]})}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-[250px] text-center",children:[(0,a.jsx)(S.A,{className:"h-12 w-12 text-green-500 mb-2"}),(0,a.jsx)("p",{className:"text-muted-foreground",children:"No failed tests in this run!"})]})})})]}),(0,a.jsxs)(l.Zp,{className:"lg:col-span-1 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsx)(l.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.ZB,{className:"text-lg font-semibold text-foreground",children:"Slowest Tests (Top 5)"}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Top 5 longest running tests in this run. Full names in tooltip."})]})}),(0,a.jsx)(l.Wu,{children:(0,a.jsx)("div",{className:"w-full h-[250px]",children:ep.length>0?(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(h.E,{data:ep,margin:{top:5,right:5,left:5,bottom:30},children:[(0,a.jsx)(f.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(p.W,{dataKey:"name",tickLine:!1,tickFormatter:()=>"",stroke:"hsl(var(--muted-foreground))"}),(0,a.jsx)(g.h,{stroke:"hsl(var(--muted-foreground))",fontSize:10,tickFormatter:e=>J(e),domain:[0,e=>e>0?Math.round(1.2*e):100]}),(0,a.jsx)(m.m,{content:e=>{let{active:t,payload:s,label:l}=e;if(t&&s&&s.length){let e=s[0].payload;return(0,a.jsxs)("div",{className:"bg-card p-3 border border-border rounded-md shadow-lg",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground truncate max-w-xs",title:e.fullTestName,children:$(e.fullTestName)}),(0,a.jsxs)("p",{className:"text-xs",style:{color:"passed"===e.status?H.passed:"failed"===e.status||"timedOut"===e.status?H.failed:H.skipped},children:["Duration: ",J(e.duration)," (Status: ",e.status,")"]})]})}return null},cursor:{fill:"hsl(var(--muted))",fillOpacity:.3}}),(0,a.jsxs)(j.y,{dataKey:"duration",name:"Duration",barSize:20,children:[ep.map((e,t)=>(0,a.jsx)(u.f,{fill:"passed"===e.status?H.passed:"failed"===e.status||"timedOut"===e.status?H.failed:H.skipped},"cell-".concat(t))),(0,a.jsx)(v.Z,{dataKey:"durationFormatted",position:"top",style:{fontSize:"10px",fill:"hsl(var(--foreground))"}})]})]})}):(0,a.jsx)("p",{className:"text-muted-foreground h-[250px] flex items-center justify-center",children:"No test data to display for slowest tests."})})})]}),(0,a.jsxs)(l.Zp,{className:"lg:col-span-2 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsx)(l.aR,{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)("div",{children:[(0,a.jsx)(l.ZB,{className:"text-lg font-semibold text-foreground",children:"Tests per Suite"}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Breakdown of test outcomes per suite."})]})}),(0,a.jsx)(l.Wu,{className:"max-h-[400px] overflow-y-auto",children:(0,a.jsx)("div",{className:"w-full",style:{height:Math.max(250,45*ef.length+60)},children:ef.length>0?(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(h.E,{data:ef,layout:"vertical",margin:{top:5,right:30,left:20,bottom:5},children:[(0,a.jsx)(f.d,{strokeDasharray:"3 3",stroke:"hsl(var(--border))"}),(0,a.jsx)(p.W,{type:"number",stroke:"hsl(var(--muted-foreground))",fontSize:10}),(0,a.jsx)(g.h,{dataKey:"name",type:"category",stroke:"hsl(var(--muted-foreground))",fontSize:10,width:150,tickFormatter:e=>e.length>20?e.substring(0,17)+"...":e,interval:0}),(0,a.jsx)(m.m,{content:(0,a.jsx)(G,{}),cursor:{fill:"hsl(var(--muted))",fillOpacity:.3}}),(0,a.jsx)(x.s,{wrapperStyle:{fontSize:"12px",paddingTop:"10px"}}),(0,a.jsx)(j.y,{dataKey:"passed",name:"Passed",stackId:"suiteStack",fill:H.passed,barSize:15}),(0,a.jsx)(j.y,{dataKey:"failed",name:"Failed",stackId:"suiteStack",fill:H.failed,barSize:15}),(0,a.jsx)(j.y,{dataKey:"skipped",name:"Skipped",stackId:"suiteStack",fill:H.skipped,barSize:15}),ej&&(0,a.jsx)(j.y,{dataKey:"pending",name:"Pending",stackId:"suiteStack",fill:H.pending,barSize:15})]})}):(0,a.jsx)("div",{className:"text-center text-muted-foreground h-[250px] flex items-center justify-center",children:"No suite data."})})})]}),(0,a.jsxs)(l.Zp,{className:"lg:col-span-2 shadow-lg hover:shadow-xl transition-shadow duration-300 rounded-xl",children:[(0,a.jsxs)(l.aR,{children:[(0,a.jsx)("div",{className:"flex flex-row items-center justify-between",children:(0,a.jsxs)(l.ZB,{className:"text-lg font-semibold text-primary flex items-center",children:[(0,a.jsx)(z.A,{className:"h-5 w-5 mr-2"})," Worker Utilization"]})}),(0,a.jsx)(l.BT,{className:"text-xs",children:"Filter and inspect tests chronologically for each worker. Slice size represents test duration."})]}),(0,a.jsxs)(l.Wu,{children:[(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mb-6",children:[(0,a.jsxs)("div",{className:"relative w-full sm:max-w-xs",children:[(0,a.jsx)(T.A,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),(0,a.jsx)(I.p,{placeholder:"Filter by test name...",value:N,onChange:e=>w(e.target.value),className:"pl-8 w-full"})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-end gap-2",children:[(0,a.jsxs)(D.l6,{value:y,onValueChange:C,children:[(0,a.jsx)(D.bq,{className:"w-full sm:w-[180px]",children:(0,a.jsx)(D.yv,{placeholder:"Filter by suite"})}),(0,a.jsxs)(D.gC,{children:[(0,a.jsx)(D.eb,{value:"all",children:"All Suites"}),B.map(e=>(0,a.jsx)(D.eb,{value:e,children:e},e))]})]}),(0,a.jsxs)(W,{children:[(0,a.jsx)(E,{asChild:!0,children:(0,a.jsxs)(K.$,{variant:"outline",className:"w-full sm:w-[180px] justify-between",children:[(0,a.jsxs)("span",{children:["Workers (",Z.length,"/",O.length,")"]}),(0,a.jsx)(F.A,{className:"h-4 w-4"})]})}),(0,a.jsxs)(L,{className:"w-56",align:"end",children:[(0,a.jsx)(_,{children:"Visible Workers"}),(0,a.jsx)(U,{}),O.length>0?O.map(e=>(0,a.jsxs)(P,{checked:Z.includes(e),onCheckedChange:t=>{M(s=>t?[...s,e]:s.filter(t=>t!==e))},children:["Worker ",e]},e)):(0,a.jsx)(_,{className:"font-normal text-muted-foreground",children:"No workers found"})]})]}),el&&(0,a.jsx)(q.Bc,{children:(0,a.jsxs)(q.m_,{children:[(0,a.jsx)(q.k$,{asChild:!0,children:(0,a.jsxs)(K.$,{variant:"ghost",size:"icon",onClick:er,children:[(0,a.jsx)(A.A,{className:"h-4 w-4"}),(0,a.jsx)("span",{className:"sr-only",children:"Reset Filters"})]})}),(0,a.jsx)(q.ZI,{children:(0,a.jsx)("p",{children:"Reset Filters"})})]})})]})]}),Q.length>0?(0,a.jsx)("div",{className:"grid gap-8 md:grid-cols-2 lg:grid-cols-3",children:Q.map(e=>{let{workerId:t,tests:s,totalDuration:l}=e;return(0,a.jsx)(V,{children:(0,a.jsxs)("div",{className:"flex flex-col items-center",children:[(0,a.jsxs)("h4",{className:"font-semibold text-center mb-2",children:["Worker ",t]}),(0,a.jsxs)("div",{className:"w-full h-[250px] relative",children:[(0,a.jsx)(i.u,{width:"100%",height:"100%",children:(0,a.jsxs)(o.r,{children:[(0,a.jsx)(c.F,{data:s,dataKey:"duration",nameKey:"name",cx:"50%",cy:"50%",innerRadius:60,outerRadius:80,paddingAngle:2,stroke:"hsl(var(--card))",children:s.map((e,t)=>(0,a.jsx)(u.f,{fill:H[e.status]||H.default1},"cell-".concat(t)))}),(0,a.jsx)(m.m,{content:e=>{let{active:t,payload:s}=e;if(t&&s&&s.length){let e=s[0].payload;return(0,a.jsxs)("div",{className:"bg-background p-3 border border-border rounded-md shadow-lg max-w-sm",children:[(0,a.jsx)("p",{className:"label text-sm font-semibold text-foreground truncate",title:e.name,children:$(e.name)}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground mt-1",children:["Suite: ",e.suiteName||"N/A"]}),(0,a.jsxs)("p",{className:"text-xs",style:{color:s[0].color||H.default1},children:["Status: ",e.status]}),(0,a.jsxs)("p",{className:"text-xs text-muted-foreground",children:["Duration: ",J(e.duration)]})]})}return null}}),(0,a.jsx)(x.s,{iconSize:10,layout:"horizontal",verticalAlign:"bottom",align:"center",wrapperStyle:{fontSize:"12px",paddingTop:"10px"},payload:[{value:"Passed",type:"square",id:"ID01",color:H.passed},{value:"Failed",type:"square",id:"ID02",color:H.failed},{value:"Skipped",type:"square",id:"ID03",color:H.skipped}]})]})}),(0,a.jsxs)("div",{className:"absolute top-1/2 left-1/2 z-10 -translate-x-1/2 -translate-y-1/2 text-center pointer-events-none",style:{marginTop:"-20px"},children:[(0,a.jsx)("div",{className:"text-xs text-muted-foreground",children:"Total"}),(0,a.jsx)("div",{className:"text-lg font-bold text-foreground",children:J(l)})]})]})]})},t)})}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-[200px] text-center p-4 rounded-lg bg-muted/60",children:[(0,a.jsx)(k.A,{className:"h-8 w-8 text-muted-foreground mb-3"}),(0,a.jsx)("p",{className:"font-semibold text-foreground",children:"No Matching Data"}),(0,a.jsx)("p",{className:"text-muted-foreground text-sm mt-1",children:"Adjust your filters or verify the run data."})]})]})]})]})}}}]);