loki-mode 9.22.4 → 9.22.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/README.md +18 -4
  2. package/SKILL.md +2 -2
  3. package/VERSION +1 -1
  4. package/autonomy/issue-parser.sh +112 -0
  5. package/autonomy/lib/proof-generator.py +88 -0
  6. package/autonomy/lib/proof-pr.sh +52 -0
  7. package/autonomy/loki +147 -3
  8. package/autonomy/quickstart.sh +342 -5
  9. package/autonomy/run.sh +26 -0
  10. package/dashboard/__init__.py +1 -1
  11. package/docs/EXECUTION-COCKPIT-PLAN.md +289 -0
  12. package/docs/HARNESS-INTELLIGENCE-PLAN.md +194 -0
  13. package/docs/ISSUE-TO-PR-GOLDEN-PATH-PLAN.md +257 -0
  14. package/loki-ts/dist/loki.js +299 -297
  15. package/mcp/__init__.py +1 -1
  16. package/package.json +1 -1
  17. package/plugins/loki-mode/.claude-plugin/plugin.json +1 -1
  18. package/web-app/dist/assets/{AdminPage-DNGNuAge.js → AdminPage-DLhWX6si.js} +1 -1
  19. package/web-app/dist/assets/{Avatar-CqAveJaT.js → Avatar-CqyDcUxl.js} +1 -1
  20. package/web-app/dist/assets/{Badge-BtMejA0Z.js → Badge-BKGSt1n2.js} +1 -1
  21. package/web-app/dist/assets/{Button-CikxmqSs.js → Button-DuuKHXre.js} +1 -1
  22. package/web-app/dist/assets/CockpitPage-DdClYERC.js +47 -0
  23. package/web-app/dist/assets/{ComparePage-BB8DJBWR.js → ComparePage-CUWlqBxv.js} +1 -1
  24. package/web-app/dist/assets/ErrorBoundary-RwfGKyRJ.js +16 -0
  25. package/web-app/dist/assets/{EvidenceReceiptPanel-6oquKEjd.js → EvidenceReceiptPanel-CzIgk9sg.js} +1 -1
  26. package/web-app/dist/assets/{GitHubIssuesPanel-5XLYWzWH.js → GitHubIssuesPanel-CsXVKuyJ.js} +3 -3
  27. package/web-app/dist/assets/{GitHubPRsPanel-DUfmFYeu.js → GitHubPRsPanel-CYRp1eKS.js} +3 -3
  28. package/web-app/dist/assets/{HomePage-DZ4MmOdH.js → HomePage-CVJcI5pQ.js} +3 -3
  29. package/web-app/dist/assets/LoginPage-BBJNV9Qb.js +1 -0
  30. package/web-app/dist/assets/{MagicPage-CFbX5gWg.js → MagicPage-CIi9P8jK.js} +1 -1
  31. package/web-app/dist/assets/{MetricsPage-DbL6xmRQ.js → MetricsPage-Bm34ipiy.js} +2 -2
  32. package/web-app/dist/assets/{NotFoundPage-BUrjXPAR.js → NotFoundPage-DpTbcC2P.js} +1 -1
  33. package/web-app/dist/assets/{ProjectPage-iP6dJihg.js → ProjectPage-CY2SMGx9.js} +65 -90
  34. package/web-app/dist/assets/{ProjectsPage-BibN9bHl.js → ProjectsPage-DSrXUUKJ.js} +2 -2
  35. package/web-app/dist/assets/{SettingsPage-C0WJp1hW.js → SettingsPage-jvDyOqYi.js} +3 -3
  36. package/web-app/dist/assets/{ShowcasePage-DUv0Njp8.js → ShowcasePage-C8tFWKau.js} +1 -1
  37. package/web-app/dist/assets/{SystemSettingsPage-BIaCB0Vn.js → SystemSettingsPage-DH4FTH3K.js} +2 -2
  38. package/web-app/dist/assets/{TeamsPage-BE0szv9r.js → TeamsPage-C1fQYauF.js} +2 -2
  39. package/web-app/dist/assets/{TemplatesPage-BzkA9kat.js → TemplatesPage-CSTFt-4P.js} +1 -1
  40. package/web-app/dist/assets/TerminalOutput-Cu4NsyN6.js +16 -0
  41. package/web-app/dist/assets/{activity-AbfFz38r.js → activity-CtjsDzmh.js} +1 -1
  42. package/web-app/dist/assets/{bell-DF6Z6y5U.js → bell-C5es1xAs.js} +1 -1
  43. package/web-app/dist/assets/{bot-DQ4np_3n.js → bot-DE04U5Lc.js} +1 -1
  44. package/web-app/dist/assets/{check-RWuguCwE.js → check-DSKKA9EU.js} +1 -1
  45. package/web-app/dist/assets/{chevron-left-VpbQPOkC.js → chevron-left-DJ13W5AR.js} +1 -1
  46. package/web-app/dist/assets/{circle-alert-DwT82lJx.js → circle-alert-CS0BfqAd.js} +1 -1
  47. package/web-app/dist/assets/{clock-BBlUa93G.js → clock-D1Y5nruk.js} +1 -1
  48. package/web-app/dist/assets/{cloud-Dgbz3VCA.js → cloud-nU6LBoZL.js} +1 -1
  49. package/web-app/dist/assets/{code-xml-r6qqION5.js → code-xml-BZfvIdFo.js} +1 -1
  50. package/web-app/dist/assets/{copy-DMHj52B8.js → copy-CK_2O1Xv.js} +1 -1
  51. package/web-app/dist/assets/{database-uJqHSHR1.js → database-DJiwznAm.js} +1 -1
  52. package/web-app/dist/assets/{dollar-sign-BZagljek.js → dollar-sign-pO20A3QY.js} +1 -1
  53. package/web-app/dist/assets/{file-code-corner-DMopmhu0.js → file-code-corner-Besy6vek.js} +1 -1
  54. package/web-app/dist/assets/{file-plus-DU_hT_3w.js → file-plus-DeaswxYY.js} +1 -1
  55. package/web-app/dist/assets/{folder-open-BP5TtQAW.js → folder-open-cr1UvQLI.js} +1 -1
  56. package/web-app/dist/assets/{git-commit-horizontal-zFk_IobS.js → git-commit-horizontal-BLxnfbSn.js} +1 -1
  57. package/web-app/dist/assets/{globe-mthCRtfp.js → globe-DrhG1NfX.js} +1 -1
  58. package/web-app/dist/assets/{hammer-BWaLBvSA.js → hammer-CeZtPBfE.js} +1 -1
  59. package/web-app/dist/assets/index-84JUN_aA.css +1 -0
  60. package/web-app/dist/assets/{index-BXA3UT6P.js → index-CLvjO22Z.js} +24 -24
  61. package/web-app/dist/assets/{layers-Q1LXV5fy.js → layers-fldADzyE.js} +1 -1
  62. package/web-app/dist/assets/{lightbulb-vRRNJ3dB.js → lightbulb-CznOfsPb.js} +1 -1
  63. package/web-app/dist/assets/{loader-circle-KgjeHEcV.js → loader-circle---lPB1Fs.js} +1 -1
  64. package/web-app/dist/assets/{lock-BerKqno7.js → lock-D5jVF-tO.js} +1 -1
  65. package/web-app/dist/assets/{mail-XAxTbprX.js → mail-D7HkLnlW.js} +1 -1
  66. package/web-app/dist/assets/minus-C-dT19Ct.js +6 -0
  67. package/web-app/dist/assets/{package-DLPKWAvW.js → package-Cm9B-cKE.js} +1 -1
  68. package/web-app/dist/assets/{plus-NMxxwHMn.js → plus-CQwOffLD.js} +1 -1
  69. package/web-app/dist/assets/{refresh-cw-Dt42kYtM.js → refresh-cw-CvWJZLbN.js} +1 -1
  70. package/web-app/dist/assets/{rotate-ccw-BCR4Tp9u.js → rotate-ccw-C2Q1LYgM.js} +1 -1
  71. package/web-app/dist/assets/{save-sR4MJd42.js → save-BP0MvpoQ.js} +1 -1
  72. package/web-app/dist/assets/{server-SXkchokx.js → server-4i4VZXix.js} +1 -1
  73. package/web-app/dist/assets/{shield-alert-Bvgp6_Dz.js → shield-alert-D2_bgb7j.js} +1 -1
  74. package/web-app/dist/assets/thumbs-up-vACbzeXj.js +26 -0
  75. package/web-app/dist/assets/{trash-2-D0IGudH7.js → trash-2-EYjdESLs.js} +1 -1
  76. package/web-app/dist/assets/trending-down-BWBdcvE3.js +6 -0
  77. package/web-app/dist/assets/{trending-up-DDrJKL5i.js → trending-up-Bix6V_-Y.js} +1 -1
  78. package/web-app/dist/assets/{upload-C54rjN8K.js → upload-B7hh6ERF.js} +1 -1
  79. package/web-app/dist/assets/{usePolling-D7fw4YSM.js → usePolling-b_e-k-IN.js} +1 -1
  80. package/web-app/dist/assets/{user-Cg7fbzdh.js → user-pmjZKWEg.js} +1 -1
  81. package/web-app/dist/index.html +2 -2
  82. package/web-app/dist/assets/LoginPage-VMzI6ROD.js +0 -1
  83. package/web-app/dist/assets/TerminalOutput-DBrdT_Fp.js +0 -31
  84. package/web-app/dist/assets/index-DgpUuqwR.css +0 -1
  85. package/web-app/dist/assets/trending-down-BbFFBq-v.js +0 -11
@@ -1,6 +1,6 @@
1
- import{c as X,r as v,j as e,b as Y,A as z,x as U,d as K,m as Z}from"./index-BXA3UT6P.js";import{G as W}from"./git-commit-horizontal-zFk_IobS.js";import{C as J}from"./chevron-left-VpbQPOkC.js";import{F as ee}from"./file-code-corner-DMopmhu0.js";import{P as te}from"./plus-NMxxwHMn.js";import{M as se,T as ne}from"./trending-down-BbFFBq-v.js";import{E as re}from"./EvidenceReceiptPanel-6oquKEjd.js";import{C as L}from"./clock-BBlUa93G.js";import{D as _}from"./dollar-sign-BZagljek.js";import{L as ae}from"./layers-Q1LXV5fy.js";import{T as le}from"./trending-up-DDrJKL5i.js";/**
1
+ import{c as X,r as v,j as e,b as Y,A as z,x as U,d as K,m as Z}from"./index-CLvjO22Z.js";import{G as W}from"./git-commit-horizontal-BLxnfbSn.js";import{C as J}from"./chevron-left-DJ13W5AR.js";import{F as ee}from"./file-code-corner-Besy6vek.js";import{P as te}from"./plus-CQwOffLD.js";import{M as se}from"./minus-C-dT19Ct.js";import{E as ne}from"./EvidenceReceiptPanel-CzIgk9sg.js";import{C as L}from"./clock-D1Y5nruk.js";import{D as _}from"./dollar-sign-pO20A3QY.js";import{L as re}from"./layers-fldADzyE.js";import{T as ae}from"./trending-up-Bix6V_-Y.js";import{T as le}from"./trending-down-BWBdcvE3.js";/**
2
2
  * @license lucide-react v0.577.0 - ISC
3
3
  *
4
4
  * This source code is licensed under the ISC license.
5
5
  * See the LICENSE file in the root directory of this source tree.
6
- */const ie=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],B=X("trophy",ie),k={top:20,right:20,bottom:40,left:50};function T(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:2)}function oe({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[o,u]=v.useState(!1),h=v.useRef(null);v.useEffect(()=>{const y=setTimeout(()=>u(!0),50);return()=>clearTimeout(y)},[]),v.useEffect(()=>{const y=h.current;if(!y)return;const g=y.getTotalLength();y.style.strokeDasharray=`${g}`,y.style.strokeDashoffset=o?"0":`${g}`},[o,t]);const p=r-k.left-k.right,f=a-k.top-k.bottom,{pathD:n,gradientPath:d,points:x,minVal:s,maxVal:i}=v.useMemo(()=>{if(t.length<2)return{pathD:"",gradientPath:"",points:[],minVal:0,maxVal:0};const y=t.map(C=>C.value),g=Math.min(...y),N=Math.max(...y),M=N-g||1,E=p/(t.length-1),A=t.map((C,S)=>({x:k.left+S*E,y:k.top+f-(C.value-g)/M*f}));let w=`M ${A[0].x},${A[0].y}`;for(let C=1;C<A.length;C++){const S=A[C-1],D=A[C],G=S.x+(D.x-S.x)*.4,Q=D.x-(D.x-S.x)*.4;w+=` C ${G},${S.y} ${Q},${D.y} ${D.x},${D.y}`}const $=w+` L ${A[A.length-1].x},${k.top+f} L ${A[0].x},${k.top+f} Z`;return{pathD:w,gradientPath:$,points:A,minVal:g,maxVal:N}},[t,p,f]);if(t.length<2)return e.jsx("svg",{width:r,height:a,children:e.jsx("text",{x:r/2,y:a/2,textAnchor:"middle",className:"fill-[#939084] text-sm",children:"Not enough data"})});const b=`line-grad-${l.replace("#","")}`;return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:b,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.25}),e.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:.02})]})}),e.jsx("text",{x:k.left-8,y:k.top+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(i)}),e.jsx("text",{x:k.left-8,y:k.top+f+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(s)}),e.jsx("line",{x1:k.left,y1:k.top,x2:k.left+p,y2:k.top,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f,x2:k.left+p,y2:k.top+f,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f/2,x2:k.left+p,y2:k.top+f/2,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("path",{d,fill:`url(#${b})`,style:{transition:"d 0.4s ease"}}),e.jsx("path",{ref:h,d:n,fill:"none",stroke:l,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke-dashoffset 1.2s ease-out, d 0.4s ease"}}),t.map((y,g)=>{const N=p/(t.length-1),M=k.left+g*N;return t.length<=6||g%Math.ceil(t.length/6)===0||g===t.length-1?e.jsx("text",{x:M,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:10},children:y.label},g):null}),x.map((y,g)=>e.jsxs("g",{children:[e.jsx("rect",{x:y.x-p/t.length/2,y:k.top,width:p/t.length,height:f,fill:"transparent",onMouseEnter:()=>m(g),onMouseLeave:()=>m(null),style:{cursor:"pointer"}}),e.jsx("circle",{cx:y.x,cy:y.y,r:c===g?5:3,fill:"white",stroke:l,strokeWidth:2,style:{opacity:c===g?1:0,transition:"opacity 0.15s, r 0.15s"}})]},g)),c!==null&&e.jsxs("g",{children:[e.jsx("line",{x1:x[c].x,y1:k.top,x2:x[c].x,y2:k.top+f,stroke:l,strokeWidth:.5,strokeDasharray:"3 3",opacity:.4}),e.jsx("rect",{x:x[c].x-30,y:x[c].y-28,width:60,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:x[c].x,y:x[c].y-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:T(t[c].value)})]})]})}function H(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString()}function ce({segments:t,size:r=200,thickness:a=32,live:l}){var d;const[j,c]=v.useState(null),[m,o]=v.useState(0);v.useEffect(()=>{const x=setTimeout(()=>o(1),50);return()=>clearTimeout(x)},[]);const u=v.useMemo(()=>t.reduce((x,s)=>x+s.value,0),[t]),h=r/2,p=(r-a)/2-4,f=v.useMemo(()=>{if(u===0)return[];let x=-90;return t.map(s=>{const i=s.value/u*360,b=x;x+=i;const y=x,g=b*Math.PI/180,N=y*Math.PI/180,M=h+p*Math.cos(g),E=h+p*Math.sin(g),A=h+p*Math.cos(N),w=h+p*Math.sin(N),$=i>180?1:0,C=`M ${M} ${E} A ${p} ${p} 0 ${$} 1 ${A} ${w}`,S=(s.value/u*100).toFixed(1);return{d:C,percentage:S,startAngle:b,endAngle:y}})},[t,u,h,p]),n=2*Math.PI*p;return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:"select-none",children:[e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:"#ECEAE3",strokeWidth:a,className:"dark:stroke-[#2A2A30]"}),f.map((x,s)=>{const i=t[s],y=i.value/u*360/360*n,g=n-y*m;let N=-90;for(let M=0;M<s;M++)N+=t[M].value/u*360;return e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:i.color,strokeWidth:j===s?a+6:a,strokeDasharray:`${y} ${n-y}`,strokeDashoffset:g,strokeLinecap:"butt",transform:`rotate(${N} ${h} ${h})`,style:{transition:"stroke-dashoffset 0.8s ease-out, stroke-width 0.15s ease",cursor:"pointer",opacity:j!==null&&j!==s?.5:1},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),e.jsx("text",{x:h,y:h-6,textAnchor:"middle",className:"fill-[#36342E] dark:fill-[#E8E6E3]",style:{fontSize:22,fontWeight:700},children:H(u)}),e.jsx("text",{x:h,y:h+14,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:11},children:j!==null?`${t[j].label} (${(d=f[j])==null?void 0:d.percentage}%)`:"Total"})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:t.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label}),e.jsx("span",{className:"text-[#36342E] dark:text-[#C5C0B8] font-medium",children:H(x.value)})]},s))})]})}const I={top:16,right:16,bottom:36,left:44};function R(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:1)}function de({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[o,u]=v.useState(0);v.useEffect(()=>{const s=setTimeout(()=>u(1),50);return()=>clearTimeout(s)},[]);const h=r-I.left-I.right,p=a-I.top-I.bottom,{maxVal:f,barWidth:n,gap:d}=v.useMemo(()=>{const s=Math.max(...t.map(g=>g.value),1),i=t.length,b=Math.max(4,Math.min(12,h/i*.2)),y=(h-b*(i+1))/i;return{maxVal:s,barWidth:Math.max(y,4),gap:b}},[t,h]),x=[0,.5,1].map(s=>({y:I.top+p*(1-s),label:R(f*s)}));return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[x.map((s,i)=>e.jsxs("g",{children:[e.jsx("line",{x1:I.left,y1:s.y,x2:I.left+h,y2:s.y,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:i===0?"none":"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("text",{x:I.left-6,y:s.y+3,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:s.label})]},i)),t.map((s,i)=>{const b=s.value/f*p*o,y=I.left+d+i*(n+d),g=I.top+p-b,N=s.color||l,M=c===i;return e.jsxs("g",{children:[e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:c!==null&&!M?.4:.85,style:{transition:"y 0.6s ease-out, height 0.6s ease-out, opacity 0.15s",cursor:"pointer"},onMouseEnter:()=>m(i),onMouseLeave:()=>m(null)}),M&&e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:1}),e.jsx("text",{x:y+n/2,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:t.length>10?8:10},children:s.label}),M&&e.jsxs("g",{children:[e.jsx("rect",{x:y+n/2-24,y:g-24,width:48,height:18,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:y+n/2,y:g-11,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:R(s.value)})]})]},i)})]})}function xe({value:t,label:r="Score",thresholds:a={warning:60,danger:30},size:l=180,live:j}){const[c,m]=v.useState(0);v.useEffect(()=>{const w=setTimeout(()=>m(Math.min(100,Math.max(0,t))),80);return()=>clearTimeout(w)},[t]);const o=l/2,u=l*.38,h=l*.09,p=180,f=0,n=180,{dangerEnd:d,warningEnd:x}=v.useMemo(()=>{const w=a.danger??30,$=a.warning??60;return{dangerEnd:w/100*n,warningEnd:$/100*n}},[a]),s=w=>{const $=w*Math.PI/180;return{x:o+u*Math.cos($),y:o-u*Math.sin($)}},i=(w,$)=>{const C=s(w),S=s($),D=w-$>180?1:0;return`M ${C.x} ${C.y} A ${u} ${u} 0 ${D} 1 ${S.x} ${S.y}`},b=p-c/100*n,y=s(b),g="#C07A5E",N="#D4A843",M="#1FC5A8",E=v.useMemo(()=>c<(a.danger??30)?g:c<(a.warning??60)?N:M,[c,a]),A=l*.6;return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("svg",{width:l,height:A,viewBox:`0 0 ${l} ${A}`,className:"select-none",children:[e.jsx("path",{d:i(p,p-d),fill:"none",stroke:g,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:i(p-d,p-x),fill:"none",stroke:N,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:i(p-x,f),fill:"none",stroke:M,strokeWidth:h,strokeLinecap:"round",opacity:.3}),c>0&&e.jsx("path",{d:i(p,b),fill:"none",stroke:E,strokeWidth:h,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("line",{x1:o,y1:o,x2:y.x,y2:y.y,stroke:E,strokeWidth:2.5,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("circle",{cx:o,cy:o,r:5,fill:E,style:{transition:"fill 0.3s"}}),e.jsx("circle",{cx:o,cy:o,r:2.5,fill:"white",className:"dark:fill-[#1A1A1E]"}),e.jsx("text",{x:o,y:o+u*.45,textAnchor:"middle",style:{fontSize:24,fontWeight:700,transition:"fill 0.3s"},fill:E,children:Math.round(c)}),e.jsx("text",{x:o-u-8,y:o+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"0"}),e.jsx("text",{x:o+u+8,y:o+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"100"})]}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] -mt-1",children:r})]})}function me({data:t,width:r=60,height:a=20,color:l="#553DE9",live:j}){const c=v.useMemo(()=>{if(t.length<2)return"";const m=Math.min(...t),u=Math.max(...t)-m||1,h=1,p=r-h*2,f=a-h*2,n=p/(t.length-1);return t.map((d,x)=>{const s=h+x*n,i=h+f-(d-m)/u*f;return`${s},${i}`}).join(" ")},[t,r,a]);return t.length<2?null:e.jsx("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"inline-block","aria-hidden":"true",children:e.jsx("polyline",{points:c,fill:"none",stroke:l,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"all 0.4s ease"}})})}function V(t,r){const a=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),j=parseInt(t.slice(5,7),16),c=.08,m=c+r*(1-c);return`rgba(${a}, ${l}, ${j}, ${m})`}function he({data:t,columns:r=7,rows:a=4,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),o=28,u=3,h=r*a,p=v.useMemo(()=>Math.max(...t.map(s=>s.count),1),[t]),f=r*(o+u)-u+16,n=a*(o+u)-u+16,d=v.useMemo(()=>{const s=[];for(let i=0;i<h;i++){const b=i%r,y=Math.floor(i/r),g=t[i],N=(g==null?void 0:g.count)??0,M=(g==null?void 0:g.date)??"",E=N/p;s.push({x:8+b*(o+u),y:8+y*(o+u),count:N,date:M,intensity:E})}return s},[t,h,r,p]),x=[0,.25,.5,.75,1];return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("svg",{width:f,height:n,viewBox:`0 0 ${f} ${n}`,className:"select-none",children:d.map((s,i)=>e.jsxs("g",{children:[e.jsx("rect",{x:s.x,y:s.y,width:o,height:o,rx:4,fill:s.count===0?"#F2F0EB":V(l,s.intensity),stroke:c===i?l:"transparent",strokeWidth:c===i?1.5:0,style:{transition:"fill 0.3s ease, stroke 0.15s",cursor:"pointer"},className:s.count===0?"dark:fill-[#222228]":"",onMouseEnter:()=>m(i),onMouseLeave:()=>m(null)}),c===i&&e.jsxs("g",{children:[e.jsx("rect",{x:s.x+o/2-40,y:s.y-26,width:80,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:s.x+o/2,y:s.y-13,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:s.date?`${s.date}: ${s.count}`:`${s.count} events`})]})]},i))}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#939084]",children:[e.jsx("span",{children:"Less"}),x.map((s,i)=>e.jsx("span",{className:"inline-block rounded",style:{width:12,height:12,backgroundColor:s===0?"#F2F0EB":V(l,s)}},i)),e.jsx("span",{children:"More"})]})]})}function ue({axes:t,datasets:r,size:a=260,live:l}){const[j,c]=v.useState(null),m=a/2,o=a*.34,u=a*.44,h=t.length,p=v.useMemo(()=>t.map((x,s)=>{const i=s*2*Math.PI/h-Math.PI/2;return{x:m+o*Math.cos(i),y:m+o*Math.sin(i),labelX:m+u*Math.cos(i),labelY:m+u*Math.sin(i)}}),[t,h,m,o,u]),f=[.25,.5,.75,1],n=v.useMemo(()=>f.map(x=>t.map((i,b)=>{const y=b*2*Math.PI/h-Math.PI/2,g=m+o*x*Math.cos(y),N=m+o*x*Math.sin(y);return`${g},${N}`}).join(" ")),[t,h,m,o]),d=v.useMemo(()=>r.map(x=>x.values.map((i,b)=>{const y=Math.min(Math.max(i,0),100)/100,g=b*2*Math.PI/h-Math.PI/2,N=m+o*y*Math.cos(g),M=m+o*y*Math.sin(g);return`${N},${M}`}).join(" ")),[r,h,m,o]);return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:"select-none",children:[n.map((x,s)=>e.jsx("polygon",{points:x,fill:"none",stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),p.map((x,s)=>e.jsx("line",{x1:m,y1:m,x2:x.x,y2:x.y,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),d.map((x,s)=>{const i=r[s],b=j===s,y=j!==null&&j!==s;return e.jsx("polygon",{points:x,fill:i.color,fillOpacity:b?.35:y?.08:.2,stroke:i.color,strokeWidth:b?2.5:1.5,strokeOpacity:y?.3:1,strokeLinejoin:"round",style:{transition:"fill-opacity 0.2s, stroke-width 0.2s, stroke-opacity 0.2s",cursor:"pointer"},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),r.map((x,s)=>{const i=j!==null&&j!==s;return x.values.map((b,y)=>{const g=Math.min(Math.max(b,0),100)/100,N=y*2*Math.PI/h-Math.PI/2,M=m+o*g*Math.cos(N),E=m+o*g*Math.sin(N);return e.jsx("circle",{cx:M,cy:E,r:3,fill:x.color,opacity:i?.3:1,style:{transition:"opacity 0.2s"}},`${s}-${y}`)})}),p.map((x,s)=>{let i="middle";return x.labelX>m+10?i="start":x.labelX<m-10&&(i="end"),e.jsx("text",{x:x.labelX,y:x.labelY+(x.labelY>m?8:-2),textAnchor:i,className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:11,fontWeight:500},children:t[s].label},s)})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:r.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label})]},s))})]})}function pe({phases:t,width:r=500,height:a=64,live:l}){const[j,c]=v.useState(null),m=v.useMemo(()=>t.reduce((n,d)=>n+d.duration,0),[t]),o=24,u=24,h=12,p=r-h*2,f=v.useMemo(()=>{if(m===0)return[];let n=h;return t.map((d,x)=>{const s=d.duration/m*p,i=n;return n+=s,{...d,x:i,width:s,index:x}})},[t,m,p,h]);return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("rect",{x:h,y:o,width:p,height:u,rx:6,fill:"#F2F0EB",className:"dark:fill-[#222228]"}),f.map((n,d)=>{const x=d===0,s=d===f.length-1,i=j===d;return e.jsxs("g",{children:[e.jsx("rect",{x:n.x,y:o,width:n.width,height:u,rx:x||s?6:0,fill:n.color,opacity:n.status==="pending"?.25:i?1:.75,style:{transition:"opacity 0.15s",cursor:"pointer"},className:n.status==="active"?"phase-active":"",onMouseEnter:()=>c(d),onMouseLeave:()=>c(null)}),n.status==="completed"&&n.width>18&&e.jsx("text",{x:n.x+n.width/2,y:o+u/2+4,textAnchor:"middle",fill:"white",style:{fontSize:12,fontWeight:700},children:"✓"}),n.status==="active"&&n.width>10&&e.jsx("circle",{cx:n.x+n.width/2,cy:o+u/2,r:4,fill:"white",opacity:.9}),n.width>30&&e.jsxs("text",{x:n.x+n.width/2,y:o-6,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:[n.duration,"s"]}),n.width>40&&e.jsx("text",{x:n.x+n.width/2,y:o+u+14,textAnchor:"middle",className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:10,fontWeight:500},children:n.name}),i&&e.jsxs("g",{children:[e.jsx("rect",{x:n.x+n.width/2-44,y:o-28,width:88,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsxs("text",{x:n.x+n.width/2,y:o-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:[n.name," (",n.duration,"s)"]})]})]},d)})]})}function O({additions:t,deletions:r}){const a=t+r;if(a===0)return null;const l=a>0?t/a*100:0;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[t>0&&e.jsxs("span",{className:"text-[11px] font-mono text-success flex items-center gap-0.5",children:[e.jsx(te,{size:10}),t]}),r>0&&e.jsxs("span",{className:"text-[11px] font-mono text-danger flex items-center gap-0.5",children:[e.jsx(se,{size:10}),r]})]}),e.jsxs("div",{className:"w-16 h-1.5 bg-border rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full bg-success",style:{width:`${l}%`}}),e.jsx("div",{className:"h-full bg-danger",style:{width:`${100-l}%`}})]})]})}function fe({change:t,isSelected:r,onClick:a}){t.files[0];const l=t.files.reduce((c,m)=>c+m.additions,0),j=t.files.reduce((c,m)=>c+m.deletions,0);return e.jsxs("button",{onClick:a,className:`flex-shrink-0 w-40 rounded-card border p-2.5 text-left transition-all cursor-pointer ${r?"border-primary bg-primary/5 shadow-sm":"border-border bg-card hover:border-primary/30 hover:bg-hover/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx(W,{size:12,className:r?"text-primary":"text-muted"}),e.jsxs("span",{className:`text-xs font-semibold ${r?"text-primary":"text-ink"}`,children:["Iteration ",t.iteration]})]}),t.description&&e.jsx("p",{className:"text-[11px] text-muted leading-relaxed truncate mb-1.5",children:t.description}),e.jsx(O,{additions:l,deletions:j}),e.jsxs("div",{className:"text-[11px] text-muted mt-1",children:[t.files.length," file",t.files.length!==1?"s":""," changed"]})]})}function je({filePath:t,iterations:r,className:a=""}){var p,f;const[l,j]=v.useState(r.length>0?r.length-1:0),c=v.useMemo(()=>t?r.filter(n=>n.files.some(d=>d.path===t||d.path.endsWith(t))):r,[r,t]),m=c[l],o=l<c.length-1,u=l>0;if(c.length===0)return e.jsxs("div",{className:`card p-4 ${a}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"})]}),e.jsxs("div",{className:"text-center py-6",children:[e.jsx("p",{className:"text-sm text-muted",children:"No iteration history available"}),e.jsx("p",{className:"text-xs text-muted/60 mt-1",children:"Changes will appear here as the AI iterates"})]})]});const h=c.filter(n=>n.files.some(d=>d.action==="modify"&&d.additions+d.deletions>20)).length;return e.jsxs("div",{className:`card overflow-hidden ${a}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"}),t&&e.jsx("span",{className:"text-[11px] text-muted font-mono truncate max-w-[200px]",children:t.split("/").pop()})]}),h>1&&e.jsxs("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill",children:[h," approaches tried"]})]}),e.jsxs("div",{className:"relative px-4 py-3 bg-hover/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>u&&j(l-1),disabled:!u,className:`p-1 rounded-card transition-colors flex-shrink-0 ${u?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(J,{size:16})}),e.jsx("div",{className:"flex gap-2 overflow-x-auto terminal-scroll flex-1 pb-1",children:c.map((n,d)=>e.jsx(fe,{change:n,isSelected:d===l,onClick:()=>j(d)},n.iteration))}),e.jsx("button",{onClick:()=>o&&j(l+1),disabled:!o,className:`p-1 rounded-card transition-colors flex-shrink-0 ${o?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(Y,{size:16})})]}),e.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:c.map((n,d)=>e.jsx("div",{className:`h-1 rounded-full transition-all ${d===l?"w-4 bg-primary":"w-1.5 bg-border"}`},d))})]}),m&&e.jsxs("div",{className:"px-4 py-3 border-t border-border",children:[m.description&&e.jsx("p",{className:"text-xs text-secondary mb-2",children:m.description}),e.jsx("div",{className:"space-y-1.5",children:m.files.map((n,d)=>e.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ee,{size:12,className:n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}),e.jsx("span",{className:"font-mono text-secondary truncate",children:n.path}),e.jsx("span",{className:`text-[11px] font-medium uppercase ${n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}`,children:n.action})]}),e.jsx(O,{additions:n.additions,deletions:n.deletions})]},`${n.path}-${d}`))}),u&&o&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mt-3 text-[11px] text-muted",children:[e.jsxs("span",{children:["Iteration ",(p=c[l-1])==null?void 0:p.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{className:"font-semibold text-ink",children:["Iteration ",m.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{children:["Iteration ",(f=c[l+1])==null?void 0:f.iteration]})]})]})]})}function q(){return[{provider:"claude",label:"Claude (Sonnet)",progress:0,phase:"planning",iteration:0,maxIterations:8,cost:0,qualityScore:0,finished:!1,color:"bg-primary"},{provider:"codex",label:"Codex (GPT-4o)",progress:0,phase:"planning",iteration:0,maxIterations:10,cost:0,qualityScore:0,finished:!1,color:"bg-teal"},{provider:"gemini",label:"Gemini Pro",progress:0,phase:"planning",iteration:0,maxIterations:12,cost:0,qualityScore:0,finished:!1,color:"bg-info"}]}const P=["planning","building","testing","reviewing","complete"];function ye(t){return{planning:"Plan",building:"Build",testing:"Test",reviewing:"Review",complete:"Done"}[t]||t}function ge({provider:t,winner:r}){const a=r===t.provider,l=r!==null&&!a&&t.finished;return e.jsxs("div",{className:`p-3 rounded-card border transition-all ${a?"border-success bg-success/5 shadow-sm":l?"border-border bg-hover/30 opacity-60":"border-border bg-card"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(B,{size:14,className:"text-success"}),e.jsx("span",{className:`text-xs font-semibold ${a?"text-success":"text-ink"}`,children:t.label})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted",children:[e.jsx("span",{className:"font-mono",children:ye(t.phase)}),e.jsxs("span",{className:"font-mono",children:[t.iteration,"/",t.maxIterations]})]})]}),e.jsxs("div",{className:"relative w-full h-3 bg-border rounded-full overflow-hidden mb-2",children:[e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${t.color}`,style:{width:`${t.progress}%`}}),!t.finished&&t.progress>0&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-shimmer"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(_,{size:10}),e.jsxs("span",{className:"font-mono",children:["$",t.cost.toFixed(2)]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(U,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.qualityScore,"%"]})]}),t.finishTime&&e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(L,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.finishTime,"s"]})]}),a&&e.jsxs("span",{className:"flex items-center gap-1 text-success font-medium ml-auto",children:[e.jsx(K,{size:10}),"Winner"]})]})]})}function ve({providers:t}){const r=t.filter(l=>l.finished);if(r.length<2)return null;const a=[...r].sort((l,j)=>Math.abs(l.qualityScore-j.qualityScore)>5?j.qualityScore-l.qualityScore:(l.finishTime||999)-(j.finishTime||999));return e.jsxs("div",{className:"mt-3 bg-hover/30 rounded-card p-3",children:[e.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider mb-2",children:"Comparison"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted text-left",children:[e.jsx("th",{className:"pb-1.5 font-medium",children:"Provider"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Speed"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Quality"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Cost"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Value"})]})}),e.jsx("tbody",{children:a.map((l,j)=>{const c=l.qualityScore/Math.max(l.cost,.01);return e.jsxs("tr",{className:j===0?"text-ink font-medium":"text-secondary",children:[e.jsx("td",{className:"py-1",children:l.label}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.finishTime||"--","s"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.qualityScore,"%"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:["$",l.cost.toFixed(2)]}),e.jsx("td",{className:"py-1 text-right font-mono",children:c.toFixed(0)})]},l.provider)})})]})})]})}function be({active:t,className:r=""}){var p;const[a,l]=v.useState(q),[j,c]=v.useState(null),[m,o]=v.useState(0),u=v.useRef(null);v.useEffect(()=>{if(t)return l(q()),c(null),o(0),u.current=setInterval(()=>{o(f=>f+1),l(f=>{const n=f.map(d=>{if(d.finished)return d;const x=d.provider==="claude"?1.3:d.provider==="codex"?1.1:.9,s=(Math.random()*3+1)*x,i=Math.min(d.progress+s,100),b=Math.min(Math.floor(i/100*P.length),P.length-1),y=P[b],g=Math.min(Math.ceil(i/100*d.maxIterations),d.maxIterations),N=d.provider==="claude"?.12:d.provider==="codex"?.08:.05,M=g*N,E=d.provider==="claude"?92:d.provider==="codex"?88:85,A=Math.floor(Math.random()*6-3),w=Math.min(Math.floor(i/100*(E+A)),E+3),$=i>=100;return{...d,progress:i,phase:$?"complete":y,iteration:g,cost:Number(M.toFixed(2)),qualityScore:w,finished:$,finishTime:$&&!d.finishTime?m+1:d.finishTime}});return n.find(d=>d.finished&&!d.finishTime),n})},1e3),()=>{u.current&&clearInterval(u.current)}},[t]),v.useEffect(()=>{if(j)return;const f=a.find(n=>n.finished);f&&(c(f.provider),setTimeout(()=>{u.current&&clearInterval(u.current)},1e4))},[a,j]);const h=a.every(f=>f.finished);return e.jsxs("div",{className:`card overflow-hidden ${r}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{size:14,className:"text-warning"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Provider Race"}),t&&!h&&e.jsx("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill animate-pulse",children:"LIVE"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[e.jsx(L,{size:12}),e.jsxs("span",{className:"font-mono",children:[m,"s"]})]})]}),e.jsx("div",{className:"px-4 py-2 bg-hover/30 border-b border-border",children:e.jsx("p",{className:"text-[11px] text-muted",children:t?"Multiple providers building simultaneously. First to finish with quality wins.":"Start a build to see providers race against each other."})}),e.jsx("div",{className:"p-4 space-y-2",children:a.map(f=>e.jsx(ge,{provider:f,winner:j},f.provider))}),h&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx(ve,{providers:a})}),j&&h&&e.jsx("div",{className:"px-4 pb-3 text-center",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-success/10 border border-success/20 rounded-pill",children:[e.jsx(B,{size:14,className:"text-success"}),e.jsxs("span",{className:"text-sm font-semibold text-success",children:[(p=a.find(f=>f.provider===j))==null?void 0:p.label," wins!"]})]})})]})}const Ne=[{label:"Mon",value:12.5},{label:"Tue",value:18.3},{label:"Wed",value:14.7},{label:"Thu",value:22.1},{label:"Fri",value:19.8},{label:"Sat",value:8.4},{label:"Sun",value:15.6}],ke=[{label:"Input",value:245e3,color:"#553DE9"},{label:"Output",value:128e3,color:"#1FC5A8"},{label:"Cached",value:89e3,color:"#6B8AFD"},{label:"System",value:42e3,color:"#D4A843"}],Me=[{label:"Mon",value:8},{label:"Tue",value:12},{label:"Wed",value:6},{label:"Thu",value:15},{label:"Fri",value:11},{label:"Sat",value:3},{label:"Sun",value:5}],Ee=Array.from({length:28},(t,r)=>({date:`Mar ${r+1}`,count:Math.floor(Math.random()*12)})),Ae=[{label:"Speed"},{label:"Quality"},{label:"Cost"},{label:"Reliability"},{label:"Coverage"}],we=[{label:"Claude",values:[85,92,65,88,78],color:"#553DE9"},{label:"Codex",values:[78,70,80,72,60],color:"#1FC5A8"}],$e=[{name:"Plan",duration:12,color:"#6B8AFD",status:"completed"},{name:"Build",duration:45,color:"#553DE9",status:"completed"},{name:"Test",duration:18,color:"#1FC5A8",status:"active"},{name:"Deploy",duration:8,color:"#D4A843",status:"pending"}],Ce=[{label:"Total Builds",value:142,trend:12.4,sparkline:[8,12,6,15,11,3,5,9,14,7],icon:ae,color:"#553DE9"},{label:"Success Rate",value:94.2,suffix:"%",trend:2.1,sparkline:[88,91,90,93,92,95,94,96,93,94],icon:Z,color:"#1FC5A8"},{label:"Avg Build Time",value:3.2,suffix:"min",trend:-8.5,sparkline:[4.1,3.8,3.5,3.9,3.4,3.2,3.6,3.1,3.3,3.2],icon:L,color:"#6B8AFD"},{label:"Total Cost",value:84.3,prefix:"$",trend:15.2,sparkline:[12,18,14,22,19,8,15,10,16,13],icon:_,color:"#D4A843"}],Se={"#553DE9":"text-[#553DE9]","#1FC5A8":"text-[#1FC5A8]","#6B8AFD":"text-[#6B8AFD]","#D4A843":"text-[#D4A843]"};function Ie({label:t,value:r,prefix:a,suffix:l,trend:j,sparkline:c,icon:m,color:o}){const u=j>=0,h=t==="Avg Build Time"?j<0:j>0,p=u?le:ne,f=Se[o]||"text-[#553DE9]";return e.jsxs("div",{className:"card p-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${o}14`},children:e.jsx(m,{size:16,className:f})}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] font-medium",children:t})]}),e.jsx(me,{data:c,color:o})]}),e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsxs("span",{className:"text-2xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:[a,typeof r=="number"&&r%1!==0?r.toFixed(1):r,l&&e.jsx("span",{className:"text-sm font-normal text-[#939084] ml-1",children:l})]}),e.jsxs("div",{className:`flex items-center gap-1 text-xs font-medium ${h?"text-[#1FC5A8]":"text-[#C07A5E]"}`,children:[e.jsx(p,{size:12}),e.jsxs("span",{children:[Math.abs(j).toFixed(1),"%"]})]})]})]})}function F({title:t,children:r}){return e.jsxs("div",{className:"card p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-4",children:t}),e.jsx("div",{className:"flex items-center justify-center",children:r})]})}function qe(){const[t,r]=v.useState(380),a=v.useMemo(()=>Math.min(t-40,420),[t]);return e.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] dark:bg-[#0F0F11] p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:"Metrics"}),e.jsx("p",{className:"text-sm text-[#6B6960] dark:text-[#8A8880] mt-1",children:"Build performance, cost tracking, and system health"})]}),e.jsx("div",{className:"mb-6 rounded-card border border-[#ECEAE3] dark:border-[#2A2A2E] bg-white dark:bg-[#18181B] p-4",children:e.jsx(re,{})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:Ce.map(l=>e.jsx(Ie,{...l},l.label))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6",ref:l=>{l&&new ResizeObserver(c=>{const m=c[0];if(m){const o=window.innerWidth>=1024?2:1;r(Math.floor(m.contentRect.width/o))}}).observe(l)},children:[e.jsx(F,{title:"Cost Trend (7 days)",children:e.jsx(oe,{data:Ne,width:a,height:220,color:"#553DE9"})}),e.jsx(F,{title:"Token Usage",children:e.jsx(ce,{segments:ke,size:190,thickness:28})}),e.jsx(F,{title:"Builds Per Day",children:e.jsx(de,{data:Me,width:a,height:220,color:"#6B8AFD"})}),e.jsx(F,{title:"Quality Score",children:e.jsx(xe,{value:87,label:"Overall Quality",size:200})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-6",children:[e.jsx(F,{title:"Agent Activity (28 days)",children:e.jsx(he,{data:Ee,columns:7,rows:4,color:"#553DE9"})}),e.jsx(F,{title:"Provider Comparison",children:e.jsx(ue,{axes:Ae,datasets:we,size:240})}),e.jsx(F,{title:"Current Pipeline",children:e.jsx(pe,{phases:$e,width:Math.min(a,360),height:72})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Code Evolution"}),e.jsx(je,{filePath:"",iterations:[{iteration:1,description:"Initial scaffolding",files:[{path:"src/index.ts",additions:120,deletions:0,action:"add"},{path:"package.json",additions:35,deletions:0,action:"add"}]},{iteration:2,description:"Add API routes",files:[{path:"src/routes.ts",additions:85,deletions:0,action:"add"},{path:"src/index.ts",additions:12,deletions:3,action:"modify"}]},{iteration:3,description:"Fix validation and add tests",files:[{path:"src/routes.ts",additions:15,deletions:8,action:"modify"},{path:"tests/routes.test.ts",additions:64,deletions:0,action:"add"}]}]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Provider Comparison"}),e.jsx(be,{active:!1})]})]})}export{qe as MetricsPage,qe as default};
6
+ */const oe=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],B=X("trophy",oe),k={top:20,right:20,bottom:40,left:50};function T(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:2)}function ie({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[i,u]=v.useState(!1),h=v.useRef(null);v.useEffect(()=>{const y=setTimeout(()=>u(!0),50);return()=>clearTimeout(y)},[]),v.useEffect(()=>{const y=h.current;if(!y)return;const g=y.getTotalLength();y.style.strokeDasharray=`${g}`,y.style.strokeDashoffset=i?"0":`${g}`},[i,t]);const p=r-k.left-k.right,f=a-k.top-k.bottom,{pathD:n,gradientPath:d,points:x,minVal:s,maxVal:o}=v.useMemo(()=>{if(t.length<2)return{pathD:"",gradientPath:"",points:[],minVal:0,maxVal:0};const y=t.map(C=>C.value),g=Math.min(...y),N=Math.max(...y),M=N-g||1,E=p/(t.length-1),A=t.map((C,S)=>({x:k.left+S*E,y:k.top+f-(C.value-g)/M*f}));let w=`M ${A[0].x},${A[0].y}`;for(let C=1;C<A.length;C++){const S=A[C-1],D=A[C],G=S.x+(D.x-S.x)*.4,Q=D.x-(D.x-S.x)*.4;w+=` C ${G},${S.y} ${Q},${D.y} ${D.x},${D.y}`}const $=w+` L ${A[A.length-1].x},${k.top+f} L ${A[0].x},${k.top+f} Z`;return{pathD:w,gradientPath:$,points:A,minVal:g,maxVal:N}},[t,p,f]);if(t.length<2)return e.jsx("svg",{width:r,height:a,children:e.jsx("text",{x:r/2,y:a/2,textAnchor:"middle",className:"fill-[#939084] text-sm",children:"Not enough data"})});const b=`line-grad-${l.replace("#","")}`;return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("defs",{children:e.jsxs("linearGradient",{id:b,x1:"0",y1:"0",x2:"0",y2:"1",children:[e.jsx("stop",{offset:"0%",stopColor:l,stopOpacity:.25}),e.jsx("stop",{offset:"100%",stopColor:l,stopOpacity:.02})]})}),e.jsx("text",{x:k.left-8,y:k.top+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(o)}),e.jsx("text",{x:k.left-8,y:k.top+f+4,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:T(s)}),e.jsx("line",{x1:k.left,y1:k.top,x2:k.left+p,y2:k.top,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f,x2:k.left+p,y2:k.top+f,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"}),e.jsx("line",{x1:k.left,y1:k.top+f/2,x2:k.left+p,y2:k.top+f/2,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("path",{d,fill:`url(#${b})`,style:{transition:"d 0.4s ease"}}),e.jsx("path",{ref:h,d:n,fill:"none",stroke:l,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"stroke-dashoffset 1.2s ease-out, d 0.4s ease"}}),t.map((y,g)=>{const N=p/(t.length-1),M=k.left+g*N;return t.length<=6||g%Math.ceil(t.length/6)===0||g===t.length-1?e.jsx("text",{x:M,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:10},children:y.label},g):null}),x.map((y,g)=>e.jsxs("g",{children:[e.jsx("rect",{x:y.x-p/t.length/2,y:k.top,width:p/t.length,height:f,fill:"transparent",onMouseEnter:()=>m(g),onMouseLeave:()=>m(null),style:{cursor:"pointer"}}),e.jsx("circle",{cx:y.x,cy:y.y,r:c===g?5:3,fill:"white",stroke:l,strokeWidth:2,style:{opacity:c===g?1:0,transition:"opacity 0.15s, r 0.15s"}})]},g)),c!==null&&e.jsxs("g",{children:[e.jsx("line",{x1:x[c].x,y1:k.top,x2:x[c].x,y2:k.top+f,stroke:l,strokeWidth:.5,strokeDasharray:"3 3",opacity:.4}),e.jsx("rect",{x:x[c].x-30,y:x[c].y-28,width:60,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:x[c].x,y:x[c].y-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:T(t[c].value)})]})]})}function H(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toString()}function ce({segments:t,size:r=200,thickness:a=32,live:l}){var d;const[j,c]=v.useState(null),[m,i]=v.useState(0);v.useEffect(()=>{const x=setTimeout(()=>i(1),50);return()=>clearTimeout(x)},[]);const u=v.useMemo(()=>t.reduce((x,s)=>x+s.value,0),[t]),h=r/2,p=(r-a)/2-4,f=v.useMemo(()=>{if(u===0)return[];let x=-90;return t.map(s=>{const o=s.value/u*360,b=x;x+=o;const y=x,g=b*Math.PI/180,N=y*Math.PI/180,M=h+p*Math.cos(g),E=h+p*Math.sin(g),A=h+p*Math.cos(N),w=h+p*Math.sin(N),$=o>180?1:0,C=`M ${M} ${E} A ${p} ${p} 0 ${$} 1 ${A} ${w}`,S=(s.value/u*100).toFixed(1);return{d:C,percentage:S,startAngle:b,endAngle:y}})},[t,u,h,p]),n=2*Math.PI*p;return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:r,height:r,viewBox:`0 0 ${r} ${r}`,className:"select-none",children:[e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:"#ECEAE3",strokeWidth:a,className:"dark:stroke-[#2A2A30]"}),f.map((x,s)=>{const o=t[s],y=o.value/u*360/360*n,g=n-y*m;let N=-90;for(let M=0;M<s;M++)N+=t[M].value/u*360;return e.jsx("circle",{cx:h,cy:h,r:p,fill:"none",stroke:o.color,strokeWidth:j===s?a+6:a,strokeDasharray:`${y} ${n-y}`,strokeDashoffset:g,strokeLinecap:"butt",transform:`rotate(${N} ${h} ${h})`,style:{transition:"stroke-dashoffset 0.8s ease-out, stroke-width 0.15s ease",cursor:"pointer",opacity:j!==null&&j!==s?.5:1},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),e.jsx("text",{x:h,y:h-6,textAnchor:"middle",className:"fill-[#36342E] dark:fill-[#E8E6E3]",style:{fontSize:22,fontWeight:700},children:H(u)}),e.jsx("text",{x:h,y:h+14,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:11},children:j!==null?`${t[j].label} (${(d=f[j])==null?void 0:d.percentage}%)`:"Total"})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:t.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label}),e.jsx("span",{className:"text-[#36342E] dark:text-[#C5C0B8] font-medium",children:H(x.value)})]},s))})]})}const I={top:16,right:16,bottom:36,left:44};function R(t){return t>=1e3?`${(t/1e3).toFixed(1)}k`:t.toFixed(t%1===0?0:1)}function de({data:t,width:r=400,height:a=240,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),[i,u]=v.useState(0);v.useEffect(()=>{const s=setTimeout(()=>u(1),50);return()=>clearTimeout(s)},[]);const h=r-I.left-I.right,p=a-I.top-I.bottom,{maxVal:f,barWidth:n,gap:d}=v.useMemo(()=>{const s=Math.max(...t.map(g=>g.value),1),o=t.length,b=Math.max(4,Math.min(12,h/o*.2)),y=(h-b*(o+1))/o;return{maxVal:s,barWidth:Math.max(y,4),gap:b}},[t,h]),x=[0,.5,1].map(s=>({y:I.top+p*(1-s),label:R(f*s)}));return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[x.map((s,o)=>e.jsxs("g",{children:[e.jsx("line",{x1:I.left,y1:s.y,x2:I.left+h,y2:s.y,stroke:"#ECEAE3",strokeWidth:.5,strokeDasharray:o===0?"none":"4 4",className:"dark:stroke-[#2A2A30]"}),e.jsx("text",{x:I.left-6,y:s.y+3,textAnchor:"end",className:"fill-[#939084]",style:{fontSize:10},children:s.label})]},o)),t.map((s,o)=>{const b=s.value/f*p*i,y=I.left+d+o*(n+d),g=I.top+p-b,N=s.color||l,M=c===o;return e.jsxs("g",{children:[e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:c!==null&&!M?.4:.85,style:{transition:"y 0.6s ease-out, height 0.6s ease-out, opacity 0.15s",cursor:"pointer"},onMouseEnter:()=>m(o),onMouseLeave:()=>m(null)}),M&&e.jsx("rect",{x:y,y:g,width:n,height:b,rx:3,fill:N,opacity:1}),e.jsx("text",{x:y+n/2,y:a-8,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:t.length>10?8:10},children:s.label}),M&&e.jsxs("g",{children:[e.jsx("rect",{x:y+n/2-24,y:g-24,width:48,height:18,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:y+n/2,y:g-11,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:11,fontWeight:600},children:R(s.value)})]})]},o)})]})}function xe({value:t,label:r="Score",thresholds:a={warning:60,danger:30},size:l=180,live:j}){const[c,m]=v.useState(0);v.useEffect(()=>{const w=setTimeout(()=>m(Math.min(100,Math.max(0,t))),80);return()=>clearTimeout(w)},[t]);const i=l/2,u=l*.38,h=l*.09,p=180,f=0,n=180,{dangerEnd:d,warningEnd:x}=v.useMemo(()=>{const w=a.danger??30,$=a.warning??60;return{dangerEnd:w/100*n,warningEnd:$/100*n}},[a]),s=w=>{const $=w*Math.PI/180;return{x:i+u*Math.cos($),y:i-u*Math.sin($)}},o=(w,$)=>{const C=s(w),S=s($),D=w-$>180?1:0;return`M ${C.x} ${C.y} A ${u} ${u} 0 ${D} 1 ${S.x} ${S.y}`},b=p-c/100*n,y=s(b),g="#C07A5E",N="#D4A843",M="#1FC5A8",E=v.useMemo(()=>c<(a.danger??30)?g:c<(a.warning??60)?N:M,[c,a]),A=l*.6;return e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsxs("svg",{width:l,height:A,viewBox:`0 0 ${l} ${A}`,className:"select-none",children:[e.jsx("path",{d:o(p,p-d),fill:"none",stroke:g,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:o(p-d,p-x),fill:"none",stroke:N,strokeWidth:h,strokeLinecap:"round",opacity:.3}),e.jsx("path",{d:o(p-x,f),fill:"none",stroke:M,strokeWidth:h,strokeLinecap:"round",opacity:.3}),c>0&&e.jsx("path",{d:o(p,b),fill:"none",stroke:E,strokeWidth:h,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("line",{x1:i,y1:i,x2:y.x,y2:y.y,stroke:E,strokeWidth:2.5,strokeLinecap:"round",style:{transition:"all 0.8s ease-out"}}),e.jsx("circle",{cx:i,cy:i,r:5,fill:E,style:{transition:"fill 0.3s"}}),e.jsx("circle",{cx:i,cy:i,r:2.5,fill:"white",className:"dark:fill-[#1A1A1E]"}),e.jsx("text",{x:i,y:i+u*.45,textAnchor:"middle",style:{fontSize:24,fontWeight:700,transition:"fill 0.3s"},fill:E,children:Math.round(c)}),e.jsx("text",{x:i-u-8,y:i+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"0"}),e.jsx("text",{x:i+u+8,y:i+4,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:"100"})]}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] -mt-1",children:r})]})}function me({data:t,width:r=60,height:a=20,color:l="#553DE9",live:j}){const c=v.useMemo(()=>{if(t.length<2)return"";const m=Math.min(...t),u=Math.max(...t)-m||1,h=1,p=r-h*2,f=a-h*2,n=p/(t.length-1);return t.map((d,x)=>{const s=h+x*n,o=h+f-(d-m)/u*f;return`${s},${o}`}).join(" ")},[t,r,a]);return t.length<2?null:e.jsx("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"inline-block","aria-hidden":"true",children:e.jsx("polyline",{points:c,fill:"none",stroke:l,strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round",style:{transition:"all 0.4s ease"}})})}function V(t,r){const a=parseInt(t.slice(1,3),16),l=parseInt(t.slice(3,5),16),j=parseInt(t.slice(5,7),16),c=.08,m=c+r*(1-c);return`rgba(${a}, ${l}, ${j}, ${m})`}function he({data:t,columns:r=7,rows:a=4,color:l="#553DE9",live:j}){const[c,m]=v.useState(null),i=28,u=3,h=r*a,p=v.useMemo(()=>Math.max(...t.map(s=>s.count),1),[t]),f=r*(i+u)-u+16,n=a*(i+u)-u+16,d=v.useMemo(()=>{const s=[];for(let o=0;o<h;o++){const b=o%r,y=Math.floor(o/r),g=t[o],N=(g==null?void 0:g.count)??0,M=(g==null?void 0:g.date)??"",E=N/p;s.push({x:8+b*(i+u),y:8+y*(i+u),count:N,date:M,intensity:E})}return s},[t,h,r,p]),x=[0,.25,.5,.75,1];return e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx("svg",{width:f,height:n,viewBox:`0 0 ${f} ${n}`,className:"select-none",children:d.map((s,o)=>e.jsxs("g",{children:[e.jsx("rect",{x:s.x,y:s.y,width:i,height:i,rx:4,fill:s.count===0?"#F2F0EB":V(l,s.intensity),stroke:c===o?l:"transparent",strokeWidth:c===o?1.5:0,style:{transition:"fill 0.3s ease, stroke 0.15s",cursor:"pointer"},className:s.count===0?"dark:fill-[#222228]":"",onMouseEnter:()=>m(o),onMouseLeave:()=>m(null)}),c===o&&e.jsxs("g",{children:[e.jsx("rect",{x:s.x+i/2-40,y:s.y-26,width:80,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsx("text",{x:s.x+i/2,y:s.y-13,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:s.date?`${s.date}: ${s.count}`:`${s.count} events`})]})]},o))}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-[#939084]",children:[e.jsx("span",{children:"Less"}),x.map((s,o)=>e.jsx("span",{className:"inline-block rounded",style:{width:12,height:12,backgroundColor:s===0?"#F2F0EB":V(l,s)}},o)),e.jsx("span",{children:"More"})]})]})}function ue({axes:t,datasets:r,size:a=260,live:l}){const[j,c]=v.useState(null),m=a/2,i=a*.34,u=a*.44,h=t.length,p=v.useMemo(()=>t.map((x,s)=>{const o=s*2*Math.PI/h-Math.PI/2;return{x:m+i*Math.cos(o),y:m+i*Math.sin(o),labelX:m+u*Math.cos(o),labelY:m+u*Math.sin(o)}}),[t,h,m,i,u]),f=[.25,.5,.75,1],n=v.useMemo(()=>f.map(x=>t.map((o,b)=>{const y=b*2*Math.PI/h-Math.PI/2,g=m+i*x*Math.cos(y),N=m+i*x*Math.sin(y);return`${g},${N}`}).join(" ")),[t,h,m,i]),d=v.useMemo(()=>r.map(x=>x.values.map((o,b)=>{const y=Math.min(Math.max(o,0),100)/100,g=b*2*Math.PI/h-Math.PI/2,N=m+i*y*Math.cos(g),M=m+i*y*Math.sin(g);return`${N},${M}`}).join(" ")),[r,h,m,i]);return e.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxs("svg",{width:a,height:a,viewBox:`0 0 ${a} ${a}`,className:"select-none",children:[n.map((x,s)=>e.jsx("polygon",{points:x,fill:"none",stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),p.map((x,s)=>e.jsx("line",{x1:m,y1:m,x2:x.x,y2:x.y,stroke:"#ECEAE3",strokeWidth:.5,className:"dark:stroke-[#2A2A30]"},s)),d.map((x,s)=>{const o=r[s],b=j===s,y=j!==null&&j!==s;return e.jsx("polygon",{points:x,fill:o.color,fillOpacity:b?.35:y?.08:.2,stroke:o.color,strokeWidth:b?2.5:1.5,strokeOpacity:y?.3:1,strokeLinejoin:"round",style:{transition:"fill-opacity 0.2s, stroke-width 0.2s, stroke-opacity 0.2s",cursor:"pointer"},onMouseEnter:()=>c(s),onMouseLeave:()=>c(null)},s)}),r.map((x,s)=>{const o=j!==null&&j!==s;return x.values.map((b,y)=>{const g=Math.min(Math.max(b,0),100)/100,N=y*2*Math.PI/h-Math.PI/2,M=m+i*g*Math.cos(N),E=m+i*g*Math.sin(N);return e.jsx("circle",{cx:M,cy:E,r:3,fill:x.color,opacity:o?.3:1,style:{transition:"opacity 0.2s"}},`${s}-${y}`)})}),p.map((x,s)=>{let o="middle";return x.labelX>m+10?o="start":x.labelX<m-10&&(o="end"),e.jsx("text",{x:x.labelX,y:x.labelY+(x.labelY>m?8:-2),textAnchor:o,className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:11,fontWeight:500},children:t[s].label},s)})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4 gap-y-1 justify-center",children:r.map((x,s)=>e.jsxs("div",{className:"flex items-center gap-1.5 text-xs cursor-pointer",onMouseEnter:()=>c(s),onMouseLeave:()=>c(null),style:{opacity:j!==null&&j!==s?.5:1},children:[e.jsx("span",{className:"w-2.5 h-2.5 rounded-full flex-shrink-0",style:{backgroundColor:x.color}}),e.jsx("span",{className:"text-[#6B6960] dark:text-[#8A8880]",children:x.label})]},s))})]})}function pe({phases:t,width:r=500,height:a=64,live:l}){const[j,c]=v.useState(null),m=v.useMemo(()=>t.reduce((n,d)=>n+d.duration,0),[t]),i=24,u=24,h=12,p=r-h*2,f=v.useMemo(()=>{if(m===0)return[];let n=h;return t.map((d,x)=>{const s=d.duration/m*p,o=n;return n+=s,{...d,x:o,width:s,index:x}})},[t,m,p,h]);return e.jsxs("svg",{width:r,height:a,viewBox:`0 0 ${r} ${a}`,className:"select-none",children:[e.jsx("rect",{x:h,y:i,width:p,height:u,rx:6,fill:"#F2F0EB",className:"dark:fill-[#222228]"}),f.map((n,d)=>{const x=d===0,s=d===f.length-1,o=j===d;return e.jsxs("g",{children:[e.jsx("rect",{x:n.x,y:i,width:n.width,height:u,rx:x||s?6:0,fill:n.color,opacity:n.status==="pending"?.25:o?1:.75,style:{transition:"opacity 0.15s",cursor:"pointer"},className:n.status==="active"?"phase-active":"",onMouseEnter:()=>c(d),onMouseLeave:()=>c(null)}),n.status==="completed"&&n.width>18&&e.jsx("text",{x:n.x+n.width/2,y:i+u/2+4,textAnchor:"middle",fill:"white",style:{fontSize:12,fontWeight:700},children:"✓"}),n.status==="active"&&n.width>10&&e.jsx("circle",{cx:n.x+n.width/2,cy:i+u/2,r:4,fill:"white",opacity:.9}),n.width>30&&e.jsxs("text",{x:n.x+n.width/2,y:i-6,textAnchor:"middle",className:"fill-[#939084]",style:{fontSize:9},children:[n.duration,"s"]}),n.width>40&&e.jsx("text",{x:n.x+n.width/2,y:i+u+14,textAnchor:"middle",className:"fill-[#6B6960] dark:fill-[#8A8880]",style:{fontSize:10,fontWeight:500},children:n.name}),o&&e.jsxs("g",{children:[e.jsx("rect",{x:n.x+n.width/2-44,y:i-28,width:88,height:20,rx:4,fill:"#36342E",className:"dark:fill-[#E8E6E3]"}),e.jsxs("text",{x:n.x+n.width/2,y:i-14,textAnchor:"middle",fill:"white",className:"dark:fill-[#1A1A1E]",style:{fontSize:10,fontWeight:500},children:[n.name," (",n.duration,"s)"]})]})]},d)})]})}function O({additions:t,deletions:r}){const a=t+r;if(a===0)return null;const l=a>0?t/a*100:0;return e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsxs("div",{className:"flex items-center gap-0.5",children:[t>0&&e.jsxs("span",{className:"text-[11px] font-mono text-success flex items-center gap-0.5",children:[e.jsx(te,{size:10}),t]}),r>0&&e.jsxs("span",{className:"text-[11px] font-mono text-danger flex items-center gap-0.5",children:[e.jsx(se,{size:10}),r]})]}),e.jsxs("div",{className:"w-16 h-1.5 bg-border rounded-full overflow-hidden flex",children:[e.jsx("div",{className:"h-full bg-success",style:{width:`${l}%`}}),e.jsx("div",{className:"h-full bg-danger",style:{width:`${100-l}%`}})]})]})}function fe({change:t,isSelected:r,onClick:a}){t.files[0];const l=t.files.reduce((c,m)=>c+m.additions,0),j=t.files.reduce((c,m)=>c+m.deletions,0);return e.jsxs("button",{onClick:a,className:`flex-shrink-0 w-40 rounded-card border p-2.5 text-left transition-all cursor-pointer ${r?"border-primary bg-primary/5 shadow-sm":"border-border bg-card hover:border-primary/30 hover:bg-hover/50"}`,children:[e.jsxs("div",{className:"flex items-center gap-1.5 mb-1.5",children:[e.jsx(W,{size:12,className:r?"text-primary":"text-muted"}),e.jsxs("span",{className:`text-xs font-semibold ${r?"text-primary":"text-ink"}`,children:["Iteration ",t.iteration]})]}),t.description&&e.jsx("p",{className:"text-[11px] text-muted leading-relaxed truncate mb-1.5",children:t.description}),e.jsx(O,{additions:l,deletions:j}),e.jsxs("div",{className:"text-[11px] text-muted mt-1",children:[t.files.length," file",t.files.length!==1?"s":""," changed"]})]})}function je({filePath:t,iterations:r,className:a=""}){var p,f;const[l,j]=v.useState(r.length>0?r.length-1:0),c=v.useMemo(()=>t?r.filter(n=>n.files.some(d=>d.path===t||d.path.endsWith(t))):r,[r,t]),m=c[l],i=l<c.length-1,u=l>0;if(c.length===0)return e.jsxs("div",{className:`card p-4 ${a}`,children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"})]}),e.jsxs("div",{className:"text-center py-6",children:[e.jsx("p",{className:"text-sm text-muted",children:"No iteration history available"}),e.jsx("p",{className:"text-xs text-muted/60 mt-1",children:"Changes will appear here as the AI iterates"})]})]});const h=c.filter(n=>n.files.some(d=>d.action==="modify"&&d.additions+d.deletions>20)).length;return e.jsxs("div",{className:`card overflow-hidden ${a}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(W,{size:14,className:"text-primary"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Code Evolution"}),t&&e.jsx("span",{className:"text-[11px] text-muted font-mono truncate max-w-[200px]",children:t.split("/").pop()})]}),h>1&&e.jsxs("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill",children:[h," approaches tried"]})]}),e.jsxs("div",{className:"relative px-4 py-3 bg-hover/30",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("button",{onClick:()=>u&&j(l-1),disabled:!u,className:`p-1 rounded-card transition-colors flex-shrink-0 ${u?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(J,{size:16})}),e.jsx("div",{className:"flex gap-2 overflow-x-auto terminal-scroll flex-1 pb-1",children:c.map((n,d)=>e.jsx(fe,{change:n,isSelected:d===l,onClick:()=>j(d)},n.iteration))}),e.jsx("button",{onClick:()=>i&&j(l+1),disabled:!i,className:`p-1 rounded-card transition-colors flex-shrink-0 ${i?"hover:bg-hover text-ink":"text-border cursor-not-allowed"}`,children:e.jsx(Y,{size:16})})]}),e.jsx("div",{className:"flex items-center justify-center gap-1 mt-2",children:c.map((n,d)=>e.jsx("div",{className:`h-1 rounded-full transition-all ${d===l?"w-4 bg-primary":"w-1.5 bg-border"}`},d))})]}),m&&e.jsxs("div",{className:"px-4 py-3 border-t border-border",children:[m.description&&e.jsx("p",{className:"text-xs text-secondary mb-2",children:m.description}),e.jsx("div",{className:"space-y-1.5",children:m.files.map((n,d)=>e.jsxs("div",{className:"flex items-center justify-between py-1 text-xs",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(ee,{size:12,className:n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}),e.jsx("span",{className:"font-mono text-secondary truncate",children:n.path}),e.jsx("span",{className:`text-[11px] font-medium uppercase ${n.action==="add"?"text-success":n.action==="delete"?"text-danger":"text-info"}`,children:n.action})]}),e.jsx(O,{additions:n.additions,deletions:n.deletions})]},`${n.path}-${d}`))}),u&&i&&e.jsxs("div",{className:"flex items-center justify-center gap-1.5 mt-3 text-[11px] text-muted",children:[e.jsxs("span",{children:["Iteration ",(p=c[l-1])==null?void 0:p.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{className:"font-semibold text-ink",children:["Iteration ",m.iteration]}),e.jsx(z,{size:10}),e.jsxs("span",{children:["Iteration ",(f=c[l+1])==null?void 0:f.iteration]})]})]})]})}function q(){return[{provider:"claude",label:"Claude (Sonnet)",progress:0,phase:"planning",iteration:0,maxIterations:8,cost:0,qualityScore:0,finished:!1,color:"bg-primary"},{provider:"codex",label:"Codex (GPT-4o)",progress:0,phase:"planning",iteration:0,maxIterations:10,cost:0,qualityScore:0,finished:!1,color:"bg-teal"},{provider:"gemini",label:"Gemini Pro",progress:0,phase:"planning",iteration:0,maxIterations:12,cost:0,qualityScore:0,finished:!1,color:"bg-info"}]}const P=["planning","building","testing","reviewing","complete"];function ye(t){return{planning:"Plan",building:"Build",testing:"Test",reviewing:"Review",complete:"Done"}[t]||t}function ge({provider:t,winner:r}){const a=r===t.provider,l=r!==null&&!a&&t.finished;return e.jsxs("div",{className:`p-3 rounded-card border transition-all ${a?"border-success bg-success/5 shadow-sm":l?"border-border bg-hover/30 opacity-60":"border-border bg-card"}`,children:[e.jsxs("div",{className:"flex items-center justify-between mb-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(B,{size:14,className:"text-success"}),e.jsx("span",{className:`text-xs font-semibold ${a?"text-success":"text-ink"}`,children:t.label})]}),e.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-muted",children:[e.jsx("span",{className:"font-mono",children:ye(t.phase)}),e.jsxs("span",{className:"font-mono",children:[t.iteration,"/",t.maxIterations]})]})]}),e.jsxs("div",{className:"relative w-full h-3 bg-border rounded-full overflow-hidden mb-2",children:[e.jsx("div",{className:`h-full rounded-full transition-all duration-500 ease-out ${t.color}`,style:{width:`${t.progress}%`}}),!t.finished&&t.progress>0&&e.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-transparent via-white/20 to-transparent animate-shimmer"})]}),e.jsxs("div",{className:"flex items-center gap-3 text-[11px]",children:[e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(_,{size:10}),e.jsxs("span",{className:"font-mono",children:["$",t.cost.toFixed(2)]})]}),e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(U,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.qualityScore,"%"]})]}),t.finishTime&&e.jsxs("span",{className:"flex items-center gap-1 text-muted",children:[e.jsx(L,{size:10}),e.jsxs("span",{className:"font-mono",children:[t.finishTime,"s"]})]}),a&&e.jsxs("span",{className:"flex items-center gap-1 text-success font-medium ml-auto",children:[e.jsx(K,{size:10}),"Winner"]})]})]})}function ve({providers:t}){const r=t.filter(l=>l.finished);if(r.length<2)return null;const a=[...r].sort((l,j)=>Math.abs(l.qualityScore-j.qualityScore)>5?j.qualityScore-l.qualityScore:(l.finishTime||999)-(j.finishTime||999));return e.jsxs("div",{className:"mt-3 bg-hover/30 rounded-card p-3",children:[e.jsx("div",{className:"text-[11px] font-semibold text-muted uppercase tracking-wider mb-2",children:"Comparison"}),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-xs",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"text-muted text-left",children:[e.jsx("th",{className:"pb-1.5 font-medium",children:"Provider"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Speed"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Quality"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Cost"}),e.jsx("th",{className:"pb-1.5 font-medium text-right",children:"Value"})]})}),e.jsx("tbody",{children:a.map((l,j)=>{const c=l.qualityScore/Math.max(l.cost,.01);return e.jsxs("tr",{className:j===0?"text-ink font-medium":"text-secondary",children:[e.jsx("td",{className:"py-1",children:l.label}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.finishTime||"--","s"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:[l.qualityScore,"%"]}),e.jsxs("td",{className:"py-1 text-right font-mono",children:["$",l.cost.toFixed(2)]}),e.jsx("td",{className:"py-1 text-right font-mono",children:c.toFixed(0)})]},l.provider)})})]})})]})}function be({active:t,className:r=""}){var p;const[a,l]=v.useState(q),[j,c]=v.useState(null),[m,i]=v.useState(0),u=v.useRef(null);v.useEffect(()=>{if(t)return l(q()),c(null),i(0),u.current=setInterval(()=>{i(f=>f+1),l(f=>{const n=f.map(d=>{if(d.finished)return d;const x=d.provider==="claude"?1.3:d.provider==="codex"?1.1:.9,s=(Math.random()*3+1)*x,o=Math.min(d.progress+s,100),b=Math.min(Math.floor(o/100*P.length),P.length-1),y=P[b],g=Math.min(Math.ceil(o/100*d.maxIterations),d.maxIterations),N=d.provider==="claude"?.12:d.provider==="codex"?.08:.05,M=g*N,E=d.provider==="claude"?92:d.provider==="codex"?88:85,A=Math.floor(Math.random()*6-3),w=Math.min(Math.floor(o/100*(E+A)),E+3),$=o>=100;return{...d,progress:o,phase:$?"complete":y,iteration:g,cost:Number(M.toFixed(2)),qualityScore:w,finished:$,finishTime:$&&!d.finishTime?m+1:d.finishTime}});return n.find(d=>d.finished&&!d.finishTime),n})},1e3),()=>{u.current&&clearInterval(u.current)}},[t]),v.useEffect(()=>{if(j)return;const f=a.find(n=>n.finished);f&&(c(f.provider),setTimeout(()=>{u.current&&clearInterval(u.current)},1e4))},[a,j]);const h=a.every(f=>f.finished);return e.jsxs("div",{className:`card overflow-hidden ${r}`,children:[e.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{size:14,className:"text-warning"}),e.jsx("h3",{className:"text-sm font-semibold text-ink uppercase tracking-wider",children:"Provider Race"}),t&&!h&&e.jsx("span",{className:"text-[11px] text-primary font-medium bg-primary/8 px-2 py-0.5 rounded-pill animate-pulse",children:"LIVE"})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted",children:[e.jsx(L,{size:12}),e.jsxs("span",{className:"font-mono",children:[m,"s"]})]})]}),e.jsx("div",{className:"px-4 py-2 bg-hover/30 border-b border-border",children:e.jsx("p",{className:"text-[11px] text-muted",children:t?"Multiple providers building simultaneously. First to finish with quality wins.":"Start a build to see providers race against each other."})}),e.jsx("div",{className:"p-4 space-y-2",children:a.map(f=>e.jsx(ge,{provider:f,winner:j},f.provider))}),h&&e.jsx("div",{className:"px-4 pb-4",children:e.jsx(ve,{providers:a})}),j&&h&&e.jsx("div",{className:"px-4 pb-3 text-center",children:e.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-success/10 border border-success/20 rounded-pill",children:[e.jsx(B,{size:14,className:"text-success"}),e.jsxs("span",{className:"text-sm font-semibold text-success",children:[(p=a.find(f=>f.provider===j))==null?void 0:p.label," wins!"]})]})})]})}const Ne=[{label:"Mon",value:12.5},{label:"Tue",value:18.3},{label:"Wed",value:14.7},{label:"Thu",value:22.1},{label:"Fri",value:19.8},{label:"Sat",value:8.4},{label:"Sun",value:15.6}],ke=[{label:"Input",value:245e3,color:"#553DE9"},{label:"Output",value:128e3,color:"#1FC5A8"},{label:"Cached",value:89e3,color:"#6B8AFD"},{label:"System",value:42e3,color:"#D4A843"}],Me=[{label:"Mon",value:8},{label:"Tue",value:12},{label:"Wed",value:6},{label:"Thu",value:15},{label:"Fri",value:11},{label:"Sat",value:3},{label:"Sun",value:5}],Ee=Array.from({length:28},(t,r)=>({date:`Mar ${r+1}`,count:Math.floor(Math.random()*12)})),Ae=[{label:"Speed"},{label:"Quality"},{label:"Cost"},{label:"Reliability"},{label:"Coverage"}],we=[{label:"Claude",values:[85,92,65,88,78],color:"#553DE9"},{label:"Codex",values:[78,70,80,72,60],color:"#1FC5A8"}],$e=[{name:"Plan",duration:12,color:"#6B8AFD",status:"completed"},{name:"Build",duration:45,color:"#553DE9",status:"completed"},{name:"Test",duration:18,color:"#1FC5A8",status:"active"},{name:"Deploy",duration:8,color:"#D4A843",status:"pending"}],Ce=[{label:"Total Builds",value:142,trend:12.4,sparkline:[8,12,6,15,11,3,5,9,14,7],icon:re,color:"#553DE9"},{label:"Success Rate",value:94.2,suffix:"%",trend:2.1,sparkline:[88,91,90,93,92,95,94,96,93,94],icon:Z,color:"#1FC5A8"},{label:"Avg Build Time",value:3.2,suffix:"min",trend:-8.5,sparkline:[4.1,3.8,3.5,3.9,3.4,3.2,3.6,3.1,3.3,3.2],icon:L,color:"#6B8AFD"},{label:"Total Cost",value:84.3,prefix:"$",trend:15.2,sparkline:[12,18,14,22,19,8,15,10,16,13],icon:_,color:"#D4A843"}],Se={"#553DE9":"text-[#553DE9]","#1FC5A8":"text-[#1FC5A8]","#6B8AFD":"text-[#6B8AFD]","#D4A843":"text-[#D4A843]"};function Ie({label:t,value:r,prefix:a,suffix:l,trend:j,sparkline:c,icon:m,color:i}){const u=j>=0,h=t==="Avg Build Time"?j<0:j>0,p=u?ae:le,f=Se[i]||"text-[#553DE9]";return e.jsxs("div",{className:"card p-4 flex flex-col gap-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${i}14`},children:e.jsx(m,{size:16,className:f})}),e.jsx("span",{className:"text-xs text-[#6B6960] dark:text-[#8A8880] font-medium",children:t})]}),e.jsx(me,{data:c,color:i})]}),e.jsxs("div",{className:"flex items-end justify-between",children:[e.jsxs("span",{className:"text-2xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:[a,typeof r=="number"&&r%1!==0?r.toFixed(1):r,l&&e.jsx("span",{className:"text-sm font-normal text-[#939084] ml-1",children:l})]}),e.jsxs("div",{className:`flex items-center gap-1 text-xs font-medium ${h?"text-[#1FC5A8]":"text-[#C07A5E]"}`,children:[e.jsx(p,{size:12}),e.jsxs("span",{children:[Math.abs(j).toFixed(1),"%"]})]})]})]})}function F({title:t,children:r}){return e.jsxs("div",{className:"card p-5",children:[e.jsx("h3",{className:"text-sm font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-4",children:t}),e.jsx("div",{className:"flex items-center justify-center",children:r})]})}function _e(){const[t,r]=v.useState(380),a=v.useMemo(()=>Math.min(t-40,420),[t]);return e.jsxs("div",{className:"min-h-screen bg-[#FAF9F6] dark:bg-[#0F0F11] p-6",children:[e.jsxs("div",{className:"mb-6",children:[e.jsx("h1",{className:"text-xl font-bold text-[#36342E] dark:text-[#E8E6E3]",children:"Metrics"}),e.jsx("p",{className:"text-sm text-[#6B6960] dark:text-[#8A8880] mt-1",children:"Build performance, cost tracking, and system health"})]}),e.jsx("div",{className:"mb-6 rounded-card border border-[#ECEAE3] dark:border-[#2A2A2E] bg-white dark:bg-[#18181B] p-4",children:e.jsx(ne,{})}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 mb-6",children:Ce.map(l=>e.jsx(Ie,{...l},l.label))}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 mb-6",ref:l=>{l&&new ResizeObserver(c=>{const m=c[0];if(m){const i=window.innerWidth>=1024?2:1;r(Math.floor(m.contentRect.width/i))}}).observe(l)},children:[e.jsx(F,{title:"Cost Trend (7 days)",children:e.jsx(ie,{data:Ne,width:a,height:220,color:"#553DE9"})}),e.jsx(F,{title:"Token Usage",children:e.jsx(ce,{segments:ke,size:190,thickness:28})}),e.jsx(F,{title:"Builds Per Day",children:e.jsx(de,{data:Me,width:a,height:220,color:"#6B8AFD"})}),e.jsx(F,{title:"Quality Score",children:e.jsx(xe,{value:87,label:"Overall Quality",size:200})})]}),e.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-4 mb-6",children:[e.jsx(F,{title:"Agent Activity (28 days)",children:e.jsx(he,{data:Ee,columns:7,rows:4,color:"#553DE9"})}),e.jsx(F,{title:"Provider Comparison",children:e.jsx(ue,{axes:Ae,datasets:we,size:240})}),e.jsx(F,{title:"Current Pipeline",children:e.jsx(pe,{phases:$e,width:Math.min(a,360),height:72})})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Code Evolution"}),e.jsx(je,{filePath:"",iterations:[{iteration:1,description:"Initial scaffolding",files:[{path:"src/index.ts",additions:120,deletions:0,action:"add"},{path:"package.json",additions:35,deletions:0,action:"add"}]},{iteration:2,description:"Add API routes",files:[{path:"src/routes.ts",additions:85,deletions:0,action:"add"},{path:"src/index.ts",additions:12,deletions:3,action:"modify"}]},{iteration:3,description:"Fix validation and add tests",files:[{path:"src/routes.ts",additions:15,deletions:8,action:"modify"},{path:"tests/routes.test.ts",additions:64,deletions:0,action:"add"}]}]})]}),e.jsxs("div",{className:"mb-6",children:[e.jsx("h2",{className:"text-base font-semibold text-[#36342E] dark:text-[#E8E6E3] mb-3",children:"Provider Comparison"}),e.jsx(be,{active:!1})]})]})}export{_e as MetricsPage,_e as default};
@@ -1 +1 @@
1
- import{j as e,J as t,a0 as s,a1 as o}from"./index-BXA3UT6P.js";function r(){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[60vh] p-8 text-center",children:[e.jsx("div",{className:"text-6xl font-heading font-bold text-primary/20 mb-4",children:"404"}),e.jsx("h1",{className:"text-h3 font-heading font-bold text-ink mb-2",children:"Page not found"}),e.jsx("p",{className:"text-sm text-muted-accessible mb-6 max-w-xs",children:"The page you are looking for does not exist or has been moved."}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>window.history.back(),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn border border-border text-secondary hover:bg-hover transition-colors",children:[e.jsx(t,{size:14}),"Go Back"]}),e.jsxs(s,{to:"/",className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-[#4432c4] transition-colors shadow-button",children:[e.jsx(o,{size:14}),"Home"]})]})]})}export{r as default};
1
+ import{j as e,J as t,a3 as s,a4 as o}from"./index-CLvjO22Z.js";function r(){return e.jsxs("div",{className:"flex flex-col items-center justify-center h-full min-h-[60vh] p-8 text-center",children:[e.jsx("div",{className:"text-6xl font-heading font-bold text-primary/20 mb-4",children:"404"}),e.jsx("h1",{className:"text-h3 font-heading font-bold text-ink mb-2",children:"Page not found"}),e.jsx("p",{className:"text-sm text-muted-accessible mb-6 max-w-xs",children:"The page you are looking for does not exist or has been moved."}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs("button",{onClick:()=>window.history.back(),className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn border border-border text-secondary hover:bg-hover transition-colors",children:[e.jsx(t,{size:14}),"Go Back"]}),e.jsxs(s,{to:"/",className:"inline-flex items-center gap-1.5 px-4 py-2 text-xs font-medium rounded-btn bg-primary text-white hover:bg-[#4432c4] transition-colors shadow-button",children:[e.jsx(o,{size:14}),"Home"]})]})]})}export{r as default};