import{c as ot,a as p,o as $t,s as d,f as q,l as jt}from"./BLoZk-4Q.js";import{o as Et}from"./C4C6gRQf.js";import{f as st,P as it,R as s,U as l,t as R,K as e,X as rt,T as a,Q as nt,V as L,W as Mt,Z as Bt,aI as Tt}from"./CkWh75VR.js";import{l as _t,s as ft,p as at,i as Q,b as vt,a as ct}from"./BIAtSU2q.js";import{I as mt,s as xt,b as X,e as K,i as Y,a as ut,c as zt,t as dt}from"./Bmr4jBBJ.js";import{c as Dt,a as It,b as Rt}from"./Cxgk6Ihq.js";import{h as Nt}from"./CvI6nzPm.js";import"./DnbEMVOy.js";import{C as Ot,F as qt}from"./Bwyoybv3.js";import{c as St}from"./KAGS2ztk.js";import{P as Vt}from"./DTg57pEf.js";import{M as Ht,F as Gt}from"./D4o-w7gg.js";import{C as Jt}from"./D6PP_X6J.js";import{C as Xt}from"./DzYtD4Df.js";import{C as Kt}from"./CxSD3vMp.js";import{C as Yt}from"./SdiQyPyy.js";import{C as Ct}from"./C7csppvN.js";import{Z as Ut}from"./BAcOv3e8.js";function Wt(h,t){const r=_t(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16"}],["path",{d:"M18 17V9"}],["path",{d:"M13 17V5"}],["path",{d:"M8 17v-3"}]];mt(h,ft({name:"chart-column"},()=>r,{get iconNode(){return z},children:(I,b)=>{var _=ot(),g=st(_);xt(g,t,"default",{}),p(I,_)},$$slots:{default:!0}}))}function Zt(h,t){const r=_t(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["circle",{cx:"12",cy:"12",r:"10"}],["path",{d:"m9 12 2 2 4-4"}]];mt(h,ft({name:"circle-check"},()=>r,{get iconNode(){return z},children:(I,b)=>{var _=ot(),g=st(_);xt(g,t,"default",{}),p(I,_)},$$slots:{default:!0}}))}function Qt(h,t){const r=_t(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["circle",{cx:"12",cy:"12",r:"10"}]];mt(h,ft({name:"circle"},()=>r,{get iconNode(){return z},children:(I,b)=>{var _=ot(),g=st(_);xt(g,t,"default",{}),p(I,_)},$$slots:{default:!0}}))}function te(h,t){const r=_t(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["circle",{cx:"12",cy:"12",r:"10"}],["polyline",{points:"12 6 12 12 16 14"}]];mt(h,ft({name:"clock"},()=>r,{get iconNode(){return z},children:(I,b)=>{var _=ot(),g=st(_);xt(g,t,"default",{}),p(I,_)},$$slots:{default:!0}}))}function ee(h,t){const r=_t(t,["children","$$slots","$$events","$$legacy"]);/**
 * @license lucide-svelte v0.469.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const z=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}],["circle",{cx:"9",cy:"7",r:"4"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75"}]];mt(h,ft({name:"users"},()=>r,{get iconNode(){return z},children:(I,b)=>{var _=ot(),g=st(_);xt(g,t,"default",{}),p(I,_)},$$slots:{default:!0}}))}function ae(h,t){const r={python:`<path d="M11.8 2.4c-3.6 0-3.4 1.6-3.4 1.6v1.6h3.5v.5H6.3S3.2 5.8 3.2 9.5s2.7 3.5 2.7 3.5h1.6v-1.7s-.1-2.7 2.6-2.7h3.5s2.5 0 2.5-2.4V4.1s.4-1.7-4.3-1.7zm-2.3 1c.4 0 .8.3.8.8s-.4.8-.8.8-.8-.3-.8-.8.4-.8.8-.8z" fill="${t}"/><path d="M12.2 21.6c3.6 0 3.4-1.6 3.4-1.6v-1.6h-3.5v-.5h5.6s3.1.3 3.1-3.4-2.7-3.5-2.7-3.5h-1.6v1.7s.1 2.7-2.6 2.7H10.4s-2.5 0-2.5 2.4v2.1s-.4 1.7 4.3 1.7zm2.3-1c-.4 0-.8-.3-.8-.8s.4-.8.8-.8.8.3.8.8-.4.8-.8.8z" fill="${t}"/>`,js:`<rect x="3" y="3" width="18" height="18" rx="2" fill="${t}" opacity=".18"/><text x="12" y="17" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">JS</text>`,ts:`<rect x="3" y="3" width="18" height="18" rx="2" fill="${t}" opacity=".18"/><text x="12" y="17" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">TS</text>`,react:`<ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2"/><ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2" transform="rotate(60 12 12)"/><ellipse cx="12" cy="12" rx="10" ry="4" stroke="${t}" stroke-width="1.2" transform="rotate(120 12 12)"/><circle cx="12" cy="12" r="2" fill="${t}"/>`,svelte:`<path d="M17.6 5.2C15.7 2.7 12.2 2.1 9.9 3.9 7.5 5.6 6.9 8.8 8.4 11l.1.1c-1.4 2-1 5 1.4 6.6 2.4 1.7 5.6 1.1 7.3-1.2.6-.9 1-2 .9-3-.1-1.6-1-3-2.4-3.8l-.1-.1c1.4-2 .8-5-1.4-6.6z" fill="${t}" opacity=".9"/><path d="M10.3 15.8c-.8.3-1.8-.2-2-1.1-.1-.3-.1-.6 0-.9l.3-.8 1.3.9c.2.2.4.4.4.7 0 .5-.2 1.1-.7 1.2z" fill="none"/>`,vue:`<path d="M2 3h4l6 10.5L18 3h4L12 21z" fill="${t}" opacity=".5"/><path d="M7 3h3l2 3.5L14 3h3L12 14z" fill="${t}"/>`,css:`<path d="M4 2l1.5 17L12 22l6.5-3L20 2z" fill="${t}" opacity=".18"/><text x="12" y="16" text-anchor="middle" font-size="9" font-weight="900" font-family="system-ui" fill="${t}">CSS</text>`,html:`<path d="M4 2l1.5 17L12 22l6.5-3L20 2z" fill="${t}" opacity=".18"/><text x="12" y="15.5" text-anchor="middle" font-size="7.5" font-weight="900" font-family="system-ui" fill="${t}">&lt;/&gt;</text>`,json:`<text x="12" y="17" text-anchor="middle" font-size="15" font-weight="300" font-family="monospace" fill="${t}">{ }</text>`,yaml:`<text x="12" y="16" text-anchor="middle" font-size="8.5" font-weight="800" font-family="system-ui" fill="${t}">YML</text>`,md:`<rect x="2" y="5" width="20" height="14" rx="2" stroke="${t}" stroke-width="1.5" fill="none"/><path d="M5.5 15V9l2.5 3.5L10.5 9v6M17 15l-2.5-3M17 9v6M14.5 12H17" stroke="${t}" stroke-width="1.4" fill="none" stroke-linecap="round" stroke-linejoin="round"/>`,go:`<text x="12" y="17" text-anchor="middle" font-size="13" font-weight="900" font-family="system-ui" fill="${t}">Go</text>`,rust:`<circle cx="12" cy="12" r="5.5" stroke="${t}" stroke-width="1.8" fill="none"/><text x="12" y="15.5" text-anchor="middle" font-size="8" font-weight="900" font-family="system-ui" fill="${t}">R</text>`+[0,60,120,180,240,300].map(z=>`<line x1="${12+8.5*Math.cos(z*Math.PI/180)}" y1="${12+8.5*Math.sin(z*Math.PI/180)}" x2="${12+6.5*Math.cos(z*Math.PI/180)}" y2="${12+6.5*Math.sin(z*Math.PI/180)}" stroke="${t}" stroke-width="2" stroke-linecap="round"/>`).join(""),java:`<path d="M6 8h9v5.5c0 1.8-2 3.5-4.5 3.5S6 15.3 6 13.5z" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M15 10c1.5 0 2.5.8 2.5 2s-1 2-2.5 2" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M8.5 6.5c0-1 .5-1.8 1.2-1.8M11.5 6.5c0-1.2.5-2 1.2-2" stroke="${t}" stroke-width=".9" fill="none" stroke-linecap="round"/>`,ruby:`<polygon points="12,3 20,10 12,21 4,10" stroke="${t}" stroke-width="1.3" fill="${t}" fill-opacity=".15"/><polyline points="4,10 12,13 20,10" stroke="${t}" stroke-width="1" fill="none"/><line x1="12" y1="3" x2="12" y2="21" stroke="${t}" stroke-width="1"/>`,php:`<ellipse cx="12" cy="12" rx="10" ry="7" stroke="${t}" stroke-width="1.3" fill="none"/><text x="12" y="15.5" text-anchor="middle" font-size="8" font-weight="900" font-family="system-ui" fill="${t}">php</text>`,shell:`<rect x="2" y="4" width="20" height="16" rx="2.5" stroke="${t}" stroke-width="1.5" fill="none"/><polyline points="6,10 9.5,13 6,16" stroke="${t}" stroke-width="1.6" fill="none" stroke-linecap="round" stroke-linejoin="round"/><line x1="12" y1="16" x2="18" y2="16" stroke="${t}" stroke-width="1.6" stroke-linecap="round"/>`,sql:`<ellipse cx="12" cy="7" rx="7" ry="3" stroke="${t}" stroke-width="1.4" fill="none"/><path d="M5 7v10c0 1.7 3.1 3 7 3s7-1.3 7-3V7" stroke="${t}" stroke-width="1.4" fill="none"/><path d="M5 12.5c0 1.7 3.1 3 7 3s7-1.3 7-3" stroke="${t}" stroke-width=".8" fill="none" opacity=".5"/>`,cfg:`<circle cx="12" cy="12" r="3" stroke="${t}" stroke-width="1.5" fill="none"/><path d="M12 2v3M12 19v3M2 12h3M19 12h3M4.9 4.9l2.1 2.1M17 17l2.1 2.1M4.9 19.1l2.1-2.1M17 7l2.1-2.1" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/>`,txt:`<line x1="4" y1="6" x2="20" y2="6" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="10" x2="16" y2="10" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="14" x2="18" y2="14" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/><line x1="4" y1="18" x2="12" y2="18" stroke="${t}" stroke-width="1.5" stroke-linecap="round"/>`,img:`<rect x="3" y="5" width="18" height="14" rx="2" stroke="${t}" stroke-width="1.3" fill="none"/><circle cx="8" cy="10" r="1.8" fill="${t}"/><polyline points="3,17 8,13 11,15 15,10 21,17" stroke="${t}" stroke-width="1.3" fill="none" stroke-linejoin="round"/>`,lock:`<rect x="6" y="11" width="12" height="9" rx="2" stroke="${t}" stroke-width="1.3" fill="none"/><path d="M8 11V8a4 4 0 0 1 8 0v3" stroke="${t}" stroke-width="1.3" fill="none"/><circle cx="12" cy="15.5" r="1.3" fill="${t}"/>`,svg:`<text x="12" y="16" text-anchor="middle" font-size="8.5" font-weight="800" font-family="system-ui" fill="${t}">SVG</text>`,c:`<text x="12" y="17" text-anchor="middle" font-size="14" font-weight="900" font-family="system-ui" fill="${t}">C</text>`,cpp:`<text x="12" y="16.5" text-anchor="middle" font-size="10" font-weight="900" font-family="system-ui" fill="${t}">C++</text>`,csharp:`<text x="12" y="16.5" text-anchor="middle" font-size="11" font-weight="900" font-family="system-ui" fill="${t}">C#</text>`,swift:`<path d="M18 4c-4.5 3.5-8.5 5.5-11.5 6 2.5-.8 5.5-3 8-5.5-2.5 3-6 5.5-10 7 2.5.5 6-.3 9.5-3-2 2.5-5 4.2-8 4.7 2 1.2 5.8.4 9.5-2-1 1.7-3 3.4-6 4.3 3.8 0 7-1.7 8.7-4.5.8-1.3.4-4.2-.7-6z" fill="${t}"/>`,kotlin:`<polygon points="3,3 21,3 12,12 21,21 3,21" fill="${t}" opacity=".7"/>`,dart:`<path d="M4 12l3-9h10l4 4v10l-9 3z" stroke="${t}" stroke-width="1.3" fill="${t}" fill-opacity=".15"/>`,other:`<circle cx="6" cy="12" r="2" fill="${t}"/><circle cx="12" cy="12" r="2" fill="${t}"/><circle cx="18" cy="12" r="2" fill="${t}"/>`,generic:`<path d="M6 2h8l6 6v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2z" stroke="${t}" stroke-width="1.3" fill="none"/><polyline points="14,2 14,8 20,8" stroke="${t}" stroke-width="1.3" fill="none"/>`};return r[h]||r.generic}var se=jt('<path fill="none" stroke-linecap="butt" style="transition: all .15s ease; cursor: pointer;" role="img"></path>'),le=q('<div class="tip svelte-183lp39"><span class="tip-dot svelte-183lp39"></span> <b class="svelte-183lp39"> </b> <span class="tip-v svelte-183lp39"> </span></div>'),re=q('<button type="button"><span class="badge svelte-183lp39"><svg viewBox="0 0 24 24" width="15" height="15" fill="none" xmlns="http://www.w3.org/2000/svg" class="svelte-183lp39"><!></svg></span> <span class="leg-name svelte-183lp39"> </span> <span class="leg-cnt svelte-183lp39"> </span> <span class="bar-t svelte-183lp39"><span class="bar-f svelte-183lp39"></span> <span class="bar-val svelte-183lp39"> </span></span></button>'),oe=q('<div class="chart-wrap svelte-183lp39"><div class="donut-box svelte-183lp39"><svg viewBox="0 0 200 200" class="donut-svg svelte-183lp39"><circle fill="none" stroke="var(--bd)" opacity="0.25"></circle><!><text text-anchor="middle" dominant-baseline="central" class="c-num svelte-183lp39"> </text><text text-anchor="middle" dominant-baseline="central" class="c-lbl svelte-183lp39">files</text></svg> <!></div> <div class="legend svelte-183lp39"></div></div>');function ie(h,t){it(t,!0);let r=at(t,"files",19,()=>({})),z=at(t,"totalFiles",3,0);const I={".py":{color:"#3572A5",name:"Python",icon:"python"},".js":{color:"#F7DF1E",name:"JavaScript",icon:"js"},".ts":{color:"#3178C6",name:"TypeScript",icon:"ts"},".jsx":{color:"#61DAFB",name:"React JSX",icon:"react"},".tsx":{color:"#3178C6",name:"React TSX",icon:"react"},".svelte":{color:"#FF3E00",name:"Svelte",icon:"svelte"},".vue":{color:"#42B883",name:"Vue",icon:"vue"},".css":{color:"#563D7C",name:"CSS",icon:"css"},".scss":{color:"#CF649A",name:"SCSS",icon:"css"},".html":{color:"#E34F26",name:"HTML",icon:"html"},".json":{color:"#A0A0A0",name:"JSON",icon:"json"},".yaml":{color:"#CB171E",name:"YAML",icon:"yaml"},".yml":{color:"#CB171E",name:"YAML",icon:"yaml"},".md":{color:"#519ABA",name:"Markdown",icon:"md"},".go":{color:"#00ADD8",name:"Go",icon:"go"},".rs":{color:"#DEA584",name:"Rust",icon:"rust"},".java":{color:"#B07219",name:"Java",icon:"java"},".rb":{color:"#CC342D",name:"Ruby",icon:"ruby"},".php":{color:"#4F5D95",name:"PHP",icon:"php"},".sh":{color:"#89E051",name:"Shell",icon:"shell"},".bat":{color:"#C1F12E",name:"Batch",icon:"shell"},".sql":{color:"#E38C00",name:"SQL",icon:"sql"},".toml":{color:"#9C4121",name:"TOML",icon:"cfg"},".cfg":{color:"#7B7B7B",name:"Config",icon:"cfg"},".txt":{color:"#6E6E6E",name:"Text",icon:"txt"},".svg":{color:"#FFB13B",name:"SVG",icon:"svg"},".png":{color:"#5A9E6F",name:"PNG",icon:"img"},".jpg":{color:"#5A9E6F",name:"JPEG",icon:"img"},".lock":{color:"#555555",name:"Lock",icon:"lock"},".c":{color:"#555555",name:"C",icon:"c"},".cpp":{color:"#F34B7D",name:"C++",icon:"cpp"},".cs":{color:"#178600",name:"C#",icon:"csharp"},".swift":{color:"#F05138",name:"Swift",icon:"swift"},".kt":{color:"#A97BFF",name:"Kotlin",icon:"kotlin"},".dart":{color:"#00B4AB",name:"Dart",icon:"dart"}},b="#555";function _(i){return I[i.toLowerCase()]||{color:b,name:i,icon:"generic"}}let g=L(()=>{const i=Object.entries(r()||{}).sort((D,P)=>P[1]-D[1]),u=z()||i.reduce((D,P)=>D+P[1],0)||1,A=u*.02,m=[];let O=0;for(const[D,P]of i)if(P>=A&&m.length<12){const H=_(D);m.push({ext:D,count:P,pct:P/u*100,...H})}else O+=P;return O>0&&m.push({ext:"other",count:O,pct:O/u*100,color:b,name:"Other",icon:"other"}),m});const S=100,w=100,j=80,E=28;function B(i){const u=i.reduce((D,P)=>D+P.count,0)||1,A=[];let m=-90;const O=i.length>1?1.5:0;for(const D of i){const P=D.count/u*360-O;if(P<=0)continue;const H=m*Math.PI/180,G=(m+P)*Math.PI/180,Z=S+j*Math.cos(H),n=w+j*Math.sin(H),x=S+j*Math.cos(G),C=w+j*Math.sin(G),W=P>180?1:0;A.push({...D,d:`M ${Z} ${n} A ${j} ${j} 0 ${W} 1 ${x} ${C}`}),m+=P+O}return A}let F=L(()=>B(e(g))),k=Mt(null);function T(i){if(!i||i.length<7)return"#fff";const u=parseInt(i.slice(1,3),16),A=parseInt(i.slice(3,5),16),m=parseInt(i.slice(5,7),16);return(.299*u+.587*A+.114*m)/255>.55?"#111":"#fff"}var o=oe(),M=s(o),f=s(M),N=s(f);X(N,"cx",S),X(N,"cy",w),X(N,"r",j),X(N,"stroke-width",E);var J=l(N);K(J,17,()=>e(F),Y,(i,u,A)=>{var m=se();R(()=>{X(m,"d",e(u).d),X(m,"stroke",e(u).color),X(m,"stroke-width",e(k)===A?E+6:E),X(m,"opacity",e(k)!==null&&e(k)!==A?.3:1),X(m,"aria-label",e(u).name)}),$t("mouseenter",m,()=>rt(k,A,!0)),$t("mouseleave",m,()=>rt(k,null)),p(i,m)});var V=l(J);X(V,"x",S),X(V,"y",w-8);var U=s(V,!0);a(V);var y=l(V);X(y,"x",S),X(y,"y",w+14),a(f);var v=l(f,2);{var c=i=>{var u=le(),A=s(u),m=l(A,2),O=s(m,!0);a(m);var D=l(m,2),P=s(D);a(D),a(u),R(H=>{zt(A,`background:${e(F)[e(k)].color??""}`),d(O,e(F)[e(k)].name),d(P,`${e(F)[e(k)].count??""} (${H??""}%)`)},[()=>e(F)[e(k)].pct.toFixed(1)]),p(i,u)};Q(v,i=>{e(k)!==null&&e(F)[e(k)]&&i(c)})}a(M);var $=l(M,2);K($,21,()=>e(g),Y,(i,u,A)=>{var m=re();let O;var D=s(m),P=s(D),H=s(P);Nt(H,()=>ae(e(u).icon,T(e(u).color)),!0),a(P),a(D);var G=l(D,2),Z=s(G,!0);a(G);var n=l(G,2),x=s(n,!0);a(n);var C=l(n,2),W=s(C),et=l(W,2),lt=s(et);a(et),a(C),a(m),R(ht=>{O=ut(m,1,"leg-row svelte-183lp39",null,O,{dimmed:e(k)!==null&&e(k)!==A}),zt(D,`background:${e(u).color??""}`),d(Z,e(u).name),d(x,e(u).count),zt(W,`width:${e(u).pct??""}%; background:${e(u).color??""}`),d(lt,`${ht??""}%`)},[()=>e(u).pct.toFixed(1)]),$t("mouseenter",m,()=>rt(k,A,!0)),$t("mouseleave",m,()=>rt(k,null)),p(i,m)}),a($),a(o),R(()=>d(U,z())),p(h,o),nt()}function pt(h){return h?h>=1e6?(h/1e6).toFixed(1)+"M":h>=1e3?(h/1e3).toFixed(1)+"k":h.toLocaleString():"0"}function Ft(h){return((h==null?void 0:h.input_tokens)||0)+((h==null?void 0:h.output_tokens)||0)}function ne(h){return Object.entries(h||{}).sort((t,r)=>Ft(r[1])-Ft(t[1]))}var ve=q('<span class="pipe-arrow svelte-1lm0ncb"><!></span>'),ce=q('<a><span class="pipe-icon svelte-1lm0ncb"><!></span> <span class="pipe-label"> </span></a> <!>',1),de=q('<div class="widget lg pipeline-card card svelte-1lm0ncb"><h3> </h3> <div class="pipeline svelte-1lm0ncb"></div></div>');function he(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=L(()=>{var j,E,B;return(j=t.status)!=null&&j.initialized?[{id:"constitution",label:r()("dash.pipe_constitution"),done:t.status.constitution_validated,active:t.status.has_constitution&&!t.status.constitution_validated,href:"/constitution"},{id:"architecture",label:r()("dash.pipe_architecture"),done:t.status.architecture_reviewed,active:t.status.has_architecture&&!t.status.architecture_reviewed,href:"/architecture"},{id:"adr",label:r()("dash.pipe_adr"),done:t.status.architecture_reviewed&&(t.status.adr_count||0)>0,active:t.status.architecture_reviewed&&(t.status.adr_count||0)===0,href:"/adr"},{id:"devplan",label:r()("dash.pipe_devplan"),done:t.status.devplan_confirmed,active:t.status.has_devplan&&!t.status.devplan_confirmed,href:"/devplan"},{id:"tasks",label:r()("dash.pipe_tasks"),done:(((E=t.status.tasks)==null?void 0:E.length)||0)>0&&t.status.tasks.every(F=>F.current_phase==="review"),active:(((B=t.status.tasks)==null?void 0:B.length)||0)>0,href:"/tasks"}]:[]});var _=de(),g=s(_),S=s(g,!0);a(g);var w=l(g,2);K(w,21,()=>e(b),Y,(j,E,B)=>{var F=ce(),k=st(F);let T;var o=s(k),M=s(o);{var f=c=>{Zt(c,{size:20})},N=c=>{te(c,{size:20})},J=c=>{Qt(c,{size:20})};Q(M,c=>{e(E).done?c(f):e(E).active?c(N,1):c(J,!1)})}a(o);var V=l(o,2),U=s(V,!0);a(V),a(k);var y=l(k,2);{var v=c=>{var $=ve(),i=s($);Ot(i,{size:16}),a($),p(c,$)};Q(y,c=>{B<e(b).length-1&&c(v)})}R(()=>{T=ut(k,1,"pipe-step svelte-1lm0ncb",null,T,{done:e(E).done,active:e(E).active&&!e(E).done}),X(k,"href",e(E).href),d(U,e(E).label)}),p(j,F)}),a(w),a(_),R(j=>d(S,j),[()=>r()("dash.pipeline")]),p(h,_),nt(),I()}var ue=q('<div class="widget sm summary-card svelte-qwoahx"><div class="sc-value svelte-qwoahx"> </div> <div class="sc-label svelte-qwoahx"><!> </div></div>');function wt(h,t){var r=ue(),z=s(r),I=s(z,!0);a(z);var b=l(z,2),_=s(b);St(_,()=>t.icon,(S,w)=>{w(S,{size:16})});var g=l(_);a(b),a(r),R(()=>{d(I,t.value),d(g,` ${t.label??""}`)}),p(h,r)}var pe=q('<span class="tasks-stats svelte-100x0j8"> </span>'),_e=q("<div></div>"),fe=q('<div class="mp-cell svelte-100x0j8"><!> <div><!></div></div>'),me=q('<a class="feat-item svelte-100x0j8"><div class="feat-top svelte-100x0j8"><span class="feat-name svelte-100x0j8"> </span> <span class="feat-phase svelte-100x0j8"> </span></div> <div class="mini-phases svelte-100x0j8"></div></a>'),xe=q('<div class="feat-grid svelte-100x0j8"></div>'),ge=q('<p class="empty-hint"> </p>'),ke=q('<div class="widget lg card"><div class="section-head"><h3><!> <!></h3> <a class="sec-btn" href="/tasks"> </a></div> <!></div>');function ye(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=at(t,"tasks",19,()=>[]);const _=[{key:"clarify",icon:Ht},{key:"plan",icon:Jt},{key:"implement",icon:Xt},{key:"tests",icon:Gt},{key:"done",icon:Kt}];function g(y){return["clarify","plan","implement","tests"].every(v=>{var c;return((c=y.phases)==null?void 0:c[v])==="complete"})}let S=L(()=>b().filter(g).length),w=L(()=>b().length-e(S));function j(y,v){var $;if(v==="done")return g(y)?"ok":"";const c=(($=y.phases)==null?void 0:$[v])||"not_started";return c==="complete"?"ok":["in_progress","draft","awaiting_review"].includes(c)?"wip":""}var E=ke(),B=s(E),F=s(B),k=s(F);Vt(k,{size:16});var T=l(k),o=l(T);{var M=y=>{var v=pe(),c=s(v);a(v),R($=>d(c,`${e(S)??""} ✓ / ${e(w)??""} ○ / ${b().length??""} ${$??""}`),[()=>r()("dash.tasks_total")]),p(y,v)};Q(o,y=>{var v;(v=b())!=null&&v.length&&y(M)})}a(F);var f=l(F,2),N=s(f,!0);a(f),a(B);var J=l(B,2);{var V=y=>{var v=xe();K(v,21,b,Y,(c,$)=>{var i=me(),u=s(i),A=s(u),m=s(A,!0);a(A);var O=l(A,2),D=s(O,!0);a(O),a(u);var P=l(u,2);K(P,21,()=>_,Y,(H,G,Z)=>{const n=L(()=>j(e($),e(G).key)),x=L(()=>e(G).icon);var C=fe(),W=s(C);{var et=tt=>{const gt=L(()=>j(e($),_[Z+1].key));var kt=_e();let yt;R(()=>yt=ut(kt,1,"mp-line svelte-100x0j8",null,yt,{"mp-line-ok":e(n)==="ok","mp-line-half":e(n)==="ok"&&e(gt)!=="ok"})),p(tt,kt)};Q(W,tt=>{Z<_.length-1&&tt(et)})}var lt=l(W,2),ht=s(lt);{var At=tt=>{Yt(tt,{size:12,strokeWidth:2.5})},Pt=tt=>{var gt=ot(),kt=st(gt);St(kt,()=>e(x),(yt,Lt)=>{Lt(yt,{size:12,strokeWidth:1.5})}),p(tt,gt)};Q(ht,tt=>{e(n)==="ok"?tt(At):tt(Pt,!1)})}a(lt),a(C),R(()=>ut(lt,1,`mp-dot ${e(n)??""}`,"svelte-100x0j8")),p(H,C)}),a(P),a(i),R(H=>{X(i,"href",`/tasks/${H??""}`),d(m,e($).name),d(D,e($).milestone)},[()=>encodeURIComponent(e($).name)]),p(c,i)}),a(v),p(y,v)},U=y=>{var v=ge(),c=s(v,!0);a(v),R($=>d(c,$),[()=>r()("dash.no_data")]),p(y,v)};Q(J,y=>{var v;(v=b())!=null&&v.length?y(V):y(U,!1)})}a(E),R((y,v)=>{d(T,` ${y??""} `),d(N,v)},[()=>r()("dash.tasks_overview"),()=>r()("dash.view_all")]),p(h,E),nt(),I()}var $e=q('<div class="llm-item svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span> <span class="llm-val svelte-4yfdl2"> </span></div>'),we=q('<div class="llm-item hint svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span></div>'),be=q('<div class="widget lg card"><div class="section-head"><h3><!> </h3> <a class="sec-btn" href="/settings"> </a></div> <div class="llm-grid svelte-4yfdl2"><div class="llm-item default svelte-4yfdl2"><span class="llm-label svelte-4yfdl2"> </span> <span class="llm-val svelte-4yfdl2"> </span></div> <!> <!></div></div>');function Me(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=at(t,"config",19,()=>({})),_=at(t,"roles",19,()=>[]);var g=be(),S=s(g),w=s(S),j=s(w);Ct(j,{size:16});var E=l(j);a(w);var B=l(w,2),F=s(B,!0);a(B),a(S);var k=l(S,2),T=s(k),o=s(T),M=s(o,!0);a(o);var f=l(o,2),N=s(f);a(f),a(T);var J=l(T,2);K(J,17,_,Y,(y,v)=>{var c=$e(),$=s(c),i=s($,!0);a($);var u=l($,2),A=s(u);a(u),a(c),R(m=>{d(i,m),d(A,`${e(v).provider??""} / ${e(v).model??""}`)},[()=>r()("settings.role_"+e(v).name)]),p(y,c)});var V=l(J,2);{var U=y=>{var v=we(),c=s(v),$=s(c,!0);a(c),a(v),R(i=>d($,i),[()=>r()("dash.no_roles")]),p(y,v)};Q(V,y=>{_().length===0&&y(U)})}a(k),a(g),R((y,v,c)=>{var $,i;d(E,` ${y??""}`),d(F,v),d(M,c),d(N,`${((($=b())==null?void 0:$.llm_provider)||"—")??""} / ${(((i=b())==null?void 0:i.llm_model)||"—")??""}`)},[()=>r()("dash.llm_config"),()=>r()("dash.edit"),()=>r()("dash.default_model")]),p(h,g),nt(),I()}var Ce=q('<tr><td class="al name"> </td><td class="ar num"> </td><td class="ar num"> </td></tr>'),ze=q('<table class="stat-table"><thead><tr><th class="al"> </th><th class="ar"> </th><th class="ar"> </th></tr></thead><tbody></tbody></table>'),qe=q('<p class="empty-hint"> </p>'),Fe=q("<div><h3><!> </h3> <!></div>");function bt(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=at(t,"data",19,()=>({})),_=at(t,"size",3,"md"),g=L(()=>ne(b()));var S=Fe(),w=s(S),j=s(w);St(j,()=>t.icon,(T,o)=>{o(T,{size:16})});var E=l(j);a(w);var B=l(w,2);{var F=T=>{var o=ze(),M=s(o),f=s(M),N=s(f),J=s(N,!0);a(N);var V=l(N),U=s(V,!0);a(V);var y=l(V),v=s(y,!0);a(y),a(f),a(M);var c=l(M);K(c,21,()=>e(g),Y,($,i)=>{var u=L(()=>Bt(e(i),2));let A=()=>e(u)[0],m=()=>e(u)[1];var O=Ce(),D=s(O),P=s(D,!0);a(D);var H=l(D),G=s(H,!0);a(H);var Z=l(H),n=s(Z,!0);a(Z),a(O),R(x=>{d(P,A()),d(G,m().requests),d(n,x)},[()=>pt(Ft(m()))]),p($,O)}),a(c),a(o),R(($,i,u)=>{d(J,$),d(U,i),d(v,u)},[()=>r()("stats.col_name"),()=>r()("stats.col_requests"),()=>r()("stats.col_tokens")]),p(T,o)},k=T=>{var o=qe(),M=s(o,!0);a(o),R(f=>d(M,f),[()=>r()("dash.no_data")]),p(T,o)};Q(B,T=>{e(g).length?T(F):T(k,!1)})}a(S),R(()=>{ut(S,1,`widget ${_()??""} card`),d(E,` ${t.title??""}`)}),p(h,S),nt(),I()}var Se=q('<tr><td class="al mono"> </td><td class="al"> </td><td class="al"> </td><td class="al mono"> </td><td class="ar num"> </td><td class="ar num"> </td></tr>'),Ae=q('<div class="log-scroll"><table class="stat-table log-table"><thead><tr><th class="al"> </th><th class="al"> </th><th class="al"> </th><th class="al"> </th><th class="ar">In</th><th class="ar">Out</th></tr></thead><tbody></tbody></table></div>'),Pe=q('<p class="empty-hint"> </p>'),Le=q('<div class="widget lg card"><h3> </h3> <!></div>');function je(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=at(t,"entries",19,()=>[]);var _=Le(),g=s(_),S=s(g,!0);a(g);var w=l(g,2);{var j=B=>{var F=Ae(),k=s(F),T=s(k),o=s(T),M=s(o),f=s(M,!0);a(M);var N=l(M),J=s(N,!0);a(N);var V=l(N),U=s(V,!0);a(V);var y=l(V),v=s(y,!0);a(y),Tt(2),a(o),a(T);var c=l(T);K(c,21,b,Y,($,i)=>{var u=Se(),A=s(u),m=s(A,!0);a(A);var O=l(A),D=s(O,!0);a(O);var P=l(O),H=s(P,!0);a(P);var G=l(P),Z=s(G,!0);a(G);var n=l(G),x=s(n,!0);a(n);var C=l(n),W=s(C,!0);a(C),a(u),R((et,lt,ht)=>{d(m,et),d(D,e(i).phase),d(H,e(i).task||"—"),d(Z,e(i).model),d(x,lt),d(W,ht)},[()=>{var et;return((et=e(i).ts)==null?void 0:et.slice(11,19))||""},()=>pt(e(i).input_tokens),()=>pt(e(i).output_tokens)]),p($,u)}),a(c),a(k),a(F),R(($,i,u,A)=>{d(f,$),d(J,i),d(U,u),d(v,A)},[()=>r()("stats.col_time"),()=>r()("stats.col_phase"),()=>r()("stats.col_task"),()=>r()("stats.col_model")]),p(B,F)},E=B=>{var F=Pe(),k=s(F,!0);a(F),R(T=>d(k,T),[()=>r()("dash.no_data")]),p(B,F)};Q(w,B=>{var F;(F=b())!=null&&F.length?B(j):B(E,!1)})}a(_),R(B=>d(S,B),[()=>r()("stats.recent_log")]),p(h,_),nt(),I()}var Ee=q('<div class="skel-step svelte-1ophxaq"></div>'),Be=q('<div class="widget sm skel-card skel-summary svelte-1ophxaq"><div class="skel-line skel-big svelte-1ophxaq"></div> <div class="skel-line skel-label svelte-1ophxaq"></div></div>'),Te=q('<div class="skel-feat svelte-1ophxaq"></div>'),De=q('<div class="skel-line skel-leg-row svelte-1ophxaq"></div>'),Ie=q('<div class="skel-tag svelte-1ophxaq"></div>'),Re=q('<div class="skel-line skel-table-row svelte-1ophxaq"></div>'),Ne=q('<div class="skel-line skel-table-row svelte-1ophxaq"></div>'),Oe=q('<div class="dash-grid svelte-1ophxaq"><div class="widget lg skel-card skel-pipeline svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-steps svelte-1ophxaq"></div></div> <!> <div class="widget lg skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-feat-grid svelte-1ophxaq"></div></div> <div class="widget lg skel-card skel-chart svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-chart-row svelte-1ophxaq"><div class="skel-donut svelte-1ophxaq"></div> <div class="skel-legend svelte-1ophxaq"></div></div></div> <div class="widget lg skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <div class="skel-flex-row svelte-1ophxaq"></div></div> <div class="widget md skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <!></div> <div class="widget md skel-card svelte-1ophxaq"><div class="skel-line skel-h3 svelte-1ophxaq"></div> <!></div></div>');function Ve(h){var t=Oe(),r=s(t),z=l(s(r),2);K(z,4,()=>Array(5),Y,(o,M)=>{var f=Ee();p(o,f)}),a(z),a(r);var I=l(r,2);K(I,0,()=>Array(4),Y,(o,M)=>{var f=Be();p(o,f)});var b=l(I,2),_=l(s(b),2);K(_,4,()=>Array(4),Y,(o,M)=>{var f=Te();p(o,f)}),a(_),a(b);var g=l(b,2),S=l(s(g),2),w=l(s(S),2);K(w,4,()=>Array(5),Y,(o,M)=>{var f=De();p(o,f)}),a(w),a(S),a(g);var j=l(g,2),E=l(s(j),2);K(E,4,()=>Array(3),Y,(o,M)=>{var f=Ie();p(o,f)}),a(E),a(j);var B=l(j,2),F=l(s(B),2);K(F,0,()=>Array(3),Y,(o,M)=>{var f=Re();p(o,f)}),a(B);var k=l(B,2),T=l(s(k),2);K(T,0,()=>Array(3),Y,(o,M)=>{var f=Ne();p(o,f)}),a(k),a(t),p(h,t)}var He=q('<div class="card"><p style="color:var(--rd)"> </p></div>'),Ge=q('<p class="empty-hint"> </p>'),Je=q('<div class="dash-grid svelte-1o7g1bz"><!> <!> <!> <!> <!> <!> <div class="widget lg card"><h3><!> </h3> <!></div> <!> <!> <!> <!> <!> <!></div>');function da(h,t){it(t,!0);const r=()=>vt(dt,"$t",z),[z,I]=ct();let b=Mt(null),_=Mt(!0),g=Mt("");Et(async()=>{try{rt(b,await Dt("dashboard",()=>It.getDashboard()),!0)}catch(o){rt(g,o.message,!0),Rt(o.message,"dashboard")}rt(_,!1)});let S=L(()=>{var o;return(o=e(b))==null?void 0:o.status}),w=L(()=>{var o;return(o=e(b))==null?void 0:o.stats}),j=L(()=>{var o,M;return(M=(o=e(S))==null?void 0:o.config)!=null&&M.roles?Object.entries(e(S).config.roles).filter(([,f])=>f!==null).map(([f,N])=>({name:f,...N})):[]});var E=ot(),B=st(E);{var F=o=>{Ve(o)},k=o=>{var M=He(),f=s(M),N=s(f,!0);a(f),a(M),R(()=>d(N,e(g))),p(o,M)},T=o=>{var M=Je(),f=s(M);he(f,{get status(){return e(S)}});var N=l(f,2);{let n=L(()=>{var C,W;return pt((W=(C=e(w))==null?void 0:C.tokens)==null?void 0:W.total_tokens)}),x=L(()=>r()("stats.total_tokens"));wt(N,{get icon(){return Ut},get value(){return e(n)},get label(){return e(x)}})}var J=l(N,2);{let n=L(()=>{var C;return((C=e(w))==null?void 0:C.total_requests)||0}),x=L(()=>r()("stats.total_requests"));wt(J,{get icon(){return Ct},get value(){return e(n)},get label(){return e(x)}})}var V=l(J,2);{let n=L(()=>{var C;return((C=e(w))==null?void 0:C.total_files)||0}),x=L(()=>r()("stats.total_files"));wt(V,{get icon(){return qt},get value(){return e(n)},get label(){return e(x)}})}var U=l(V,2);{let n=L(()=>{var C;return pt((C=e(w))==null?void 0:C.total_lines)}),x=L(()=>r()("stats.total_lines"));wt(U,{get icon(){return Wt},get value(){return e(n)},get label(){return e(x)}})}var y=l(U,2);{let n=L(()=>{var x;return(x=e(S))==null?void 0:x.tasks});ye(y,{get tasks(){return e(n)}})}var v=l(y,2),c=s(v),$=s(c);qt($,{size:16});var i=l($);a(c);var u=l(c,2);{var A=n=>{ie(n,{get files(){return e(w).files},get totalFiles(){return e(w).total_files}})},m=n=>{var x=Ge(),C=s(x,!0);a(x),R(W=>d(C,W),[()=>r()("dash.no_data")]),p(n,x)};Q(u,n=>{var x;((x=e(w))==null?void 0:x.total_files)>0?n(A):n(m,!1)})}a(v);var O=l(v,2);{let n=L(()=>{var x;return(x=e(S))==null?void 0:x.config});Me(O,{get config(){return e(n)},get roles(){return e(j)}})}var D=l(O,2);{let n=L(()=>r()("stats.by_model")),x=L(()=>{var C;return(C=e(w))==null?void 0:C.by_model});bt(D,{get icon(){return Ct},get title(){return e(n)},get data(){return e(x)}})}var P=l(D,2);{let n=L(()=>r()("stats.by_role")),x=L(()=>{var C;return(C=e(w))==null?void 0:C.by_role});bt(P,{get icon(){return ee},get title(){return e(n)},get data(){return e(x)}})}var H=l(P,2);{let n=L(()=>{var x;return(x=e(w))==null?void 0:x.log_entries});je(H,{get entries(){return e(n)}})}var G=l(H,2);{let n=L(()=>r()("stats.by_phase")),x=L(()=>{var C;return(C=e(w))==null?void 0:C.by_phase});bt(G,{get icon(){return Ct},get title(){return e(n)},get data(){return e(x)}})}var Z=l(G,2);{let n=L(()=>r()("stats.by_task")),x=L(()=>{var C;return(C=e(w))==null?void 0:C.by_task});bt(Z,{get icon(){return qt},get title(){return e(n)},get data(){return e(x)}})}a(M),R(n=>d(i,` ${n??""}`),[()=>r()("stats.project_files")]),p(o,M)};Q(B,o=>{e(_)?o(F):e(g)?o(k,1):e(b)&&o(T,2)})}p(h,E),nt(),I()}export{da as D};
