import{c as $e,a as n,l as ie,s as g,d as at,e as be,f as $,o as et}from"../chunks/BLoZk-4Q.js";import{o as _t}from"../chunks/C4C6gRQf.js";import{f as ce,P as _e,bo as gt,bp as xt,t as x,K as e,Q as ge,a7 as bt,X as H,L as $t,R as a,aI as ze,T as t,W as Z,Y as st,U as q,V as re,B as Ce}from"../chunks/CkWh75VR.js";import{l as Fe,s as je,p as f,i as V,a as we,b as K}from"../chunks/BIAtSU2q.js";import{s as wt}from"../chunks/CjJ88ejz.js";import{p as He,T as kt,C as qt}from"../chunks/TuDKvZ2x.js";import{I as Ie,s as Ye,a as D,c as xe,b as B,e as Re,i as Oe,t as ke}from"../chunks/Bmr4jBBJ.js";import{l as yt,e as lt,f as rt,g as zt,h as nt,j as Lt,k as Mt,m as Tt,c as At,a as tt,o as Et,n as St,s as Ct,p as Ht,q as Nt,d as Bt,i as Pt}from"../chunks/Cxgk6Ihq.js";import{s as ye,w as ot,t as Kt}from"../chunks/CLAQm0y3.js";import{c as Vt}from"../chunks/KAGS2ztk.js";import{S as Ft,t as jt}from"../chunks/BYua9gIY.js";import{i as It}from"../chunks/DnbEMVOy.js";import{Z as Yt}from"../chunks/BAcOv3e8.js";import{b as it}from"../chunks/_Q0si_gD.js";import{T as Rt}from"../chunks/D8HEO2Qd.js";import{C as Ot}from"../chunks/C7csppvN.js";function Wt(E,s){const o=Fe(s,["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 m=[["path",{d:"m18 15-6-6-6 6"}]];Ie(E,je({name:"chevron-up"},()=>o,{get iconNode(){return m},children:(v,y)=>{var i=$e(),_=ce(i);Ye(_,s,"default",{}),n(v,i)},$$slots:{default:!0}}))}function Ut(E,s){const o=Fe(s,["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 m=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2"}],["path",{d:"M9 3v18"}]];Ie(E,je({name:"panel-left"},()=>o,{get iconNode(){return m},children:(v,y)=>{var i=$e(),_=ce(i);Ye(_,s,"default",{}),n(v,i)},$$slots:{default:!0}}))}function Dt(E,s){const o=Fe(s,["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 m=[["polygon",{points:"6 3 20 12 6 21 6 3"}]];Ie(E,je({name:"play"},()=>o,{get iconNode(){return m},children:(v,y)=>{var i=$e(),_=ce(i);Ye(_,s,"default",{}),n(v,i)},$$slots:{default:!0}}))}var Gt=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-label="Layout grid"><rect class="q q1 svelte-1x28yo2" width="7" height="7" x="3" y="3" rx="1"></rect><rect class="q q2 svelte-1x28yo2" width="7" height="7" x="14" y="3" rx="1"></rect><rect class="q q3 svelte-1x28yo2" width="7" height="7" x="14" y="14" rx="1"></rect><rect class="q q4 svelte-1x28yo2" width="7" height="7" x="3" y="14" rx="1"></rect></svg>');function Zt(E,s){_e(s,!1);const o=bt();let m=f(s,"size",8,24),v=f(s,"speed",8,320),y=f(s,"active",8,!1);gt(()=>$t(v()),()=>{H(o,Math.max(0,Math.round(v()*.28)))}),xt();var i=Gt();x(()=>{D(i,0,`grid-spin ${y()?"is-active":""}`,"svelte-1x28yo2"),xe(i,`--speed:${v()}ms; --step:${e(o)}ms;`),B(i,"width",m()),B(i,"height",m())}),n(E,i),ge()}var Qt=ie('<title class="svelte-16shx1n"> </title>'),Xt=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img"><!><g class="doc svelte-16shx1n"><path class="paper folded svelte-16shx1n" d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z"></path><path class="paper flat svelte-16shx1n" d="M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2z"></path><path class="fold svelte-16shx1n" d="M14 2v5a1 1 0 0 0 1 1h5"></path><path class="corner svelte-16shx1n" pathLength="100" d="M14 2H18A2 2 0 0 1 20 4V8"></path><path class="line base svelte-16shx1n" d="M10 9H8"></path><path class="line base svelte-16shx1n" d="M16 13H8"></path><path class="line base svelte-16shx1n" d="M16 17H8"></path><path class="line anim a1 svelte-16shx1n" pathLength="100" d="M10 9H8"></path><path class="line anim a2 svelte-16shx1n" pathLength="100" d="M16 13H8"></path><path class="line anim a3 svelte-16shx1n" pathLength="100" d="M16 17H8"></path></g></svg>');function Jt(E,s){let o=f(s,"size",8,24),m=f(s,"speed",8,320),v=f(s,"active",8,!1),y=f(s,"ariaLabel",8,"File text"),i=f(s,"title",8,null),_=f(s,"className",8,"");var T=Xt(),l=a(T);{var z=u=>{var h=Qt(),d=a(h,!0);t(h),x(()=>g(d,i())),n(u,h)};V(l,u=>{i()&&u(z)})}ze(),t(T),x(()=>{D(T,0,`fileText ${v()?"is-active":""} ${_()}`,"svelte-16shx1n"),xe(T,`--ft-size:${o()}px; --ft-speed:${m()}ms;`),B(T,"width",o()),B(T,"height",o()),B(T,"aria-label",y())}),n(E,T)}var ea=ie("<title> </title>"),ta=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img"><!><path class="layer top svelte-15xiu9q" d="M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z"></path><path class="layer mid svelte-15xiu9q" d="M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12"></path><path class="layer bottom svelte-15xiu9q" d="M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17"></path></svg>');function aa(E,s){let o=f(s,"size",8,24),m=f(s,"speed",8,180),v=f(s,"spread",8,1.25),y=f(s,"active",8,!1),i=f(s,"ariaLabel",8,"Layers"),_=f(s,"title",8,null),T=f(s,"className",8,"");var l=ta(),z=a(l);{var u=h=>{var d=ea(),A=a(d,!0);t(d),x(()=>g(A,_())),n(h,d)};V(z,h=>{_()&&h(u)})}ze(3),t(l),x(()=>{D(l,0,`layersIco ${y()?"is-active":""} ${T()}`,"svelte-15xiu9q"),xe(l,`--li-size:${o()}px; --li-speed:${m()}ms; --li-spread:${v()}px;`),B(l,"width",o()),B(l,"height",o()),B(l,"aria-label",i())}),n(E,l)}var sa=ie("<title> </title>"),la=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img"><!><g class="edge e1 svelte-1mbtw9o"><path d="M3 6.618V19.381"></path><path class="seg s12 top svelte-1mbtw9o" d="M3 6.618H9"></path><path class="seg s12 bot svelte-1mbtw9o" d="M3 19.381H9"></path></g><g class="edge e2 svelte-1mbtw9o"><path d="M9 3.236V18.236"></path><path class="seg s23 top svelte-1mbtw9o" d="M9 3.236H15"></path><path class="seg s23 bot svelte-1mbtw9o" d="M9 18.236H15"></path></g><g class="edge e3 svelte-1mbtw9o"><path d="M15 5.764V20.764"></path><path class="seg s34 top svelte-1mbtw9o" d="M15 5.764H21"></path><path class="seg s34 bot svelte-1mbtw9o" d="M15 20.764H21"></path></g><g class="edge e4 svelte-1mbtw9o"><path d="M21 4.619V17.383"></path></g></svg>');function ra(E,s){let o=f(s,"size",8,24),m=f(s,"speed",8,180),v=f(s,"delta",8,1),y=f(s,"active",8,!1),i=f(s,"ariaLabel",8,"Map"),_=f(s,"title",8,null),T=f(s,"className",8,"");var l=la(),z=a(l);{var u=h=>{var d=sa(),A=a(d,!0);t(d),x(()=>g(A,_())),n(h,d)};V(z,h=>{_()&&h(u)})}ze(4),t(l),x(()=>{D(l,0,`mapFlip ${y()?"is-active":""} ${T()}`,"svelte-1mbtw9o"),xe(l,`--mf-size:${o()}px; --mf-speed:${m()}ms; --mf-delta:${v()}px;`),B(l,"width",o()),B(l,"height",o()),B(l,"aria-label",i())}),n(E,l)}var na=ie("<title> </title>"),oa=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img"><!><g class="state closed svelte-vg484q"><path d="M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z"></path><path d="M12 22V12"></path><polyline points="3.29 7 12 12 20.71 7"></polyline><path d="m7.5 4.27 9 5.15"></path></g><g class="state open svelte-vg484q"><path class="o o1 svelte-vg484q" pathLength="100" d="M12 22v-9"></path><path class="o o2 svelte-vg484q" pathLength="100" d="M15.17 2.21a1.67 1.67 0 0 1 1.63 0L21 4.57a1.93 1.93 0 0 1 0 3.36L8.82 14.79a1.655 1.655 0 0 1-1.64 0L3 12.43a1.93 1.93 0 0 1 0-3.36z"></path><path class="o o3 svelte-vg484q" pathLength="100" d="M20 13v3.87a2.06 2.06 0 0 1-1.11 1.83l-6 3.08a1.93 1.93 0 0 1-1.78 0l-6-3.08A2.06 2.06 0 0 1 4 16.87V13"></path><path class="o o4 svelte-vg484q" pathLength="100" d="M21 12.43a1.93 1.93 0 0 0 0-3.36L8.83 2.2a1.64 2 0 0 0-1.63 0L3 4.57a1.93 1.93 0 0 0 0 3.36l12.18 6.86a1.636 1.636 0 0 0 1.63 0z"></path></g></svg>');function ia(E,s){let o=f(s,"size",8,24),m=f(s,"fade",8,140),v=f(s,"draw",8,420),y=f(s,"active",8,!1),i=f(s,"ariaLabel",8,"Package"),_=f(s,"title",8,null),T=f(s,"className",8,"");var l=oa(),z=a(l);{var u=h=>{var d=na(),A=a(d,!0);t(d),x(()=>g(A,_())),n(h,d)};V(z,h=>{_()&&h(u)})}ze(2),t(l),x(()=>{D(l,0,`pkgAnim ${y()?"is-active":""} ${T()}`,"svelte-vg484q"),xe(l,`--pa-size:${o()}px; --pa-fade:${m()}ms; --pa-draw:${v()}ms;`),B(l,"width",o()),B(l,"height",o()),B(l,"aria-label",i())}),n(E,l)}var va=ie("<title> </title>"),ca=ie('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" role="img"><!><g class="state closed svelte-1f0qurd"><path d="M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"></path><path d="M2 10h20"></path></g><g class="state open svelte-1f0qurd"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></g></svg>');function da(E,s){let o=f(s,"size",8,24),m=f(s,"fade",8,180),v=f(s,"active",8,!1),y=f(s,"ariaLabel",8,"Folder"),i=f(s,"title",8,null),_=f(s,"className",8,""),T=f(s,"shiftY",8,.6),l=f(s,"scaleFrom",8,.99),z=f(s,"scaleTo",8,1.01);var u=ca(),h=a(u);{var d=A=>{var F=va(),O=a(F,!0);t(F),x(()=>g(O,i())),n(A,F)};V(h,A=>{i()&&A(d)})}ze(2),t(u),x(()=>{D(u,0,`folderAnim ${v()?"is-active":""} ${_()}`,"svelte-1f0qurd"),xe(u,`--fa-size:${o()}px; --fa-fade:${m()}ms; --fa-shiftY:${T()}px; --fa-scaleFrom:${l()}; --fa-scaleTo:${z()};`),B(u,"width",o()),B(u,"height",o()),B(u,"aria-label",y())}),n(E,u)}var pa=$('<div class="logo-area svelte-qe711u"><a href="/"><img alt="Skaro" class="logo-img svelte-qe711u"/></a></div>'),ua=$("<span> </span>"),ha=$('<span class="label svelte-qe711u"> </span> <!>',1),fa=$('<a data-sveltekit-noscroll=""><span class="icon svelte-qe711u"><!></span> <!></a>'),ma=$('<span class="label svelte-qe711u"> </span>'),_a=$('<nav><div class="sidebar-header svelte-qe711u"><!> <button class="toggle-btn svelte-qe711u"><!></button></div> <div class="nav svelte-qe711u"></div> <div class="nav-bottom svelte-qe711u"><a data-sveltekit-noscroll=""><span class="icon svelte-qe711u"><!></span> <!></a></div></nav>');function ga(E,s){_e(s,!0);const o=()=>K(He,"$page",i),m=()=>K(jt,"$theme",i),v=()=>K(ye,"$status",i),y=()=>K(ke,"$t",i),[i,_]=we(),T="skaro:sidebar-collapsed",l=[{id:"dashboard",icon:Zt,labelKey:"nav.dashboard"},{id:"constitution",icon:Jt,labelKey:"nav.constitution"},{id:"architecture",icon:aa,labelKey:"nav.architecture"},{id:"adr",icon:da,labelKey:"nav.adr"},{id:"devplan",icon:ra,labelKey:"nav.devplan"},{id:"tasks",icon:ia,labelKey:"nav.tasks"}],z={id:"settings",labelKey:"nav.settings"};function u(){try{return localStorage.getItem(T)==="1"}catch{return!1}}function h(C){try{localStorage.setItem(T,C?"1":"0")}catch{}}let d=Z(st(u())),A=re(()=>o().url.pathname),F=Z(""),O=re(()=>(m()==="light","/logo.svg"));function P(){H(d,!e(d)),h(e(d))}function N(C){return C==="dashboard"?e(A)==="/"||e(A)==="/dashboard":C==="constitution"?e(A)==="/constitution":e(A)==="/"+C||e(A).startsWith("/"+C+"/")}function p(C){var W;const k=v();return k?C==="constitution"?k.constitution_validated?{text:"✓",cls:"ok"}:null:C==="architecture"?k.architecture_reviewed?{text:"✓",cls:"ok"}:k.has_invariants?{text:"✓",cls:"ok"}:k.has_architecture?{text:"…",cls:"warn"}:null:C==="tasks"?(W=k.tasks)!=null&&W.length?{text:k.tasks.length,cls:""}:null:C==="adr"?k.adr_count?{text:k.adr_count,cls:""}:null:C==="devplan"&&k.has_devplan?{text:"✓",cls:"ok"}:null:null}var w=_a();let I;var j=a(w),r=a(j);{var b=C=>{var k=pa(),W=a(k),ae=a(W);B(ae,"src",e(O)),t(W),t(k),n(C,k)};V(r,C=>{e(d)||C(b)})}var S=q(r,2),Y=a(S);Ut(Y,{size:18,strokeWidth:1.5}),t(S),t(j);var J=q(j,2);Re(J,21,()=>l,Oe,(C,k)=>{const W=re(()=>p(e(k).id)),ae=re(()=>e(k).icon);var Q=fa();let de;var ue=a(Q),Le=a(ue);{let le=re(()=>e(F)===e(k).id);Vt(Le,()=>e(ae),(pe,he)=>{he(pe,{size:18,get active(){return e(le)}})})}t(ue);var Me=q(ue,2);{var Ne=le=>{var pe=ha(),he=ce(pe),Te=a(he,!0);t(he);var Be=q(he,2);{var Pe=fe=>{var ve=ua(),Ae=a(ve,!0);t(ve),x(()=>{D(ve,1,`badge ${e(W).cls??""}`,"svelte-qe711u"),g(Ae,e(W).text)}),n(fe,ve)};V(Be,fe=>{e(W)&&fe(Pe)})}x(fe=>g(Te,fe),[()=>y()(e(k).labelKey)]),n(le,pe)};V(Me,le=>{e(d)||le(Ne)})}t(Q),x((le,pe)=>{de=D(Q,1,"nav-item svelte-qe711u",null,de,le),B(Q,"href",`/${e(k).id??""}`),B(Q,"title",pe)},[()=>({active:N(e(k).id)}),()=>e(d)?y()(e(k).labelKey):void 0]),et("mouseenter",Q,()=>H(F,e(k).id,!0)),et("mouseleave",Q,()=>H(F,"")),n(C,Q)}),t(J);var U=q(J,2),ee=a(U);let te;var L=a(ee),M=a(L);Ft(M,{size:18,strokeWidth:1.5}),t(L);var R=q(L,2);{var G=C=>{var k=ma(),W=a(k,!0);t(k),x(ae=>g(W,ae),[()=>y()(z.labelKey)]),n(C,k)};V(R,C=>{e(d)||C(G)})}t(ee),t(U),t(w),x((C,k)=>{I=D(w,1,"sidebar svelte-qe711u",null,I,{collapsed:e(d)}),B(S,"title",e(d)?"Expand":"Collapse"),te=D(ee,1,"nav-item svelte-qe711u",null,te,C),B(ee,"href",`/${z.id}`),B(ee,"title",k)},[()=>({active:N(z.id)}),()=>e(d)?y()(z.labelKey):void 0]),be("click",S,P),n(E,w),ge(),_()}at(["click"]);var xa=$('<div class="project-title svelte-z1h6nd"> </div>'),ba=$("<span> </span>"),$a=$("<span>Skaro</span>"),wa=$('<span class="last svelte-z1h6nd"> </span>'),ka=$('<span class="last svelte-z1h6nd"> </span>'),qa=$('<span class="last svelte-z1h6nd"> </span>'),ya=$('<span class="sep svelte-z1h6nd">›</span><span class="last svelte-z1h6nd"> </span>',1),za=$("<span> </span> <!>",1),La=$('<span class="last svelte-z1h6nd"> </span>'),Ma=$('<span class="last svelte-z1h6nd"> </span>'),Ta=$('<div class="breadcrumb svelte-z1h6nd"><!> <span class="sep svelte-z1h6nd">›</span> <!></div>'),Aa=$('<div class="toolbar-strip svelte-z1h6nd"><!> <div class="tokens svelte-z1h6nd"><!> <span> </span></div></div>');function Ea(E,s){_e(s,!0);const o=()=>K(ye,"$status",y),m=()=>K(He,"$page",y),v=()=>K(ke,"$t",y),[y,i]=we();function _(p){return!p||p===0?"0":p>=1e6?(p/1e6).toFixed(1)+"M":p>=1e3?Math.round(p/1e3)+"k":String(p)}let T=re(()=>{var p;return((p=o())==null?void 0:p.project_name)||""}),l=re(()=>m().url.pathname.split("/").filter(Boolean)[0]||"dashboard"),z=re(()=>{const p=m().url.pathname.split("/").filter(Boolean);return p[0]==="tasks"&&p[1]?decodeURIComponent(p[1]):null});var u=Aa(),h=a(u);{var d=p=>{var w=xa(),I=a(w,!0);t(w),x(()=>g(I,e(T)||"Skaro")),n(p,w)},A=p=>{var w=Ta(),I=a(w);{var j=L=>{var M=ba(),R=a(M,!0);t(M),x(()=>g(R,e(T))),n(L,M)},r=L=>{var M=$a();n(L,M)};V(I,L=>{e(T)?L(j):L(r,!1)})}var b=q(I,4);{var S=L=>{var M=wa(),R=a(M,!0);t(M),x(G=>g(R,G),[()=>v()("nav.constitution")]),n(L,M)},Y=L=>{var M=ka(),R=a(M,!0);t(M),x(G=>g(R,G),[()=>v()("nav.architecture")]),n(L,M)},J=L=>{var M=qa(),R=a(M,!0);t(M),x(G=>g(R,G),[()=>v()("nav.adr")]),n(L,M)},U=L=>{var M=za(),R=ce(M);let G;var C=a(R,!0);t(R);var k=q(R,2);{var W=ae=>{var Q=ya(),de=q(ce(Q)),ue=a(de,!0);t(de),x(()=>g(ue,e(z))),n(ae,Q)};V(k,ae=>{e(z)&&ae(W)})}x(ae=>{G=D(R,1,"svelte-z1h6nd",null,G,{last:!e(z)}),g(C,ae)},[()=>v()("nav.tasks")]),n(L,M)},ee=L=>{var M=La(),R=a(M,!0);t(M),x(G=>g(R,G),[()=>v()("nav.settings")]),n(L,M)},te=L=>{var M=Ma(),R=a(M,!0);t(M),x(G=>g(R,G),[()=>v()("nav.devplan")]),n(L,M)};V(b,L=>{e(l)==="constitution"?L(S):e(l)==="architecture"?L(Y,1):e(l)==="adr"?L(J,2):e(l)==="tasks"?L(U,3):e(l)==="settings"?L(ee,4):e(l)==="devplan"&&L(te,5)})}t(w),n(p,w)};V(h,p=>{e(l)==="dashboard"?p(d):p(A,!1)})}var F=q(h,2),O=a(F);Yt(O,{size:11});var P=q(O,2),N=a(P);t(P),t(F),t(u),x(p=>g(N,`Tokens: ${p??""}`),[()=>{var p,w;return _((w=(p=o())==null?void 0:p.tokens)==null?void 0:w.total_tokens)}]),n(E,u),ge(),i()}var Sa=$('<span class="llm-dot svelte-10od7x6"></span>'),Ca=$('<div><div class="llm-header svelte-10od7x6"><!> <span class="llm-label svelte-10od7x6"> </span></div> <div class="llm-body svelte-10od7x6"><pre class="svelte-10od7x6"> </pre></div></div>'),Ha=$('<div class="empty svelte-10od7x6"> </div>'),Na=$('<div class="log-entry svelte-10od7x6"><span class="log-time svelte-10od7x6"> </span> <span class="log-text svelte-10od7x6"> </span></div>'),Ba=$('<div class="pane svelte-10od7x6"><!> <div class="log-list svelte-10od7x6"><!></div></div>');function Pa(E,s){_e(s,!0);const o=()=>K(yt,"$llmText",_),m=()=>K(lt,"$llmActive",_),v=()=>K(ke,"$t",_),y=()=>K(zt,"$llmPhase",_),i=()=>K(rt,"$logEntries",_),[_,T]=we();let l=Z(null);Ce(()=>{o()&&e(l)&&(e(l).scrollTop=e(l).scrollHeight)});var z=Ba(),u=a(z);{var h=P=>{var N=Ca();let p;var w=a(N),I=a(w);{var j=U=>{var ee=Sa();n(U,ee)};V(I,U=>{m()&&U(j)})}var r=q(I,2),b=a(r);t(r),t(w);var S=q(w,2),Y=a(S),J=a(Y,!0);t(Y),t(S),it(S,U=>H(l,U),()=>e(l)),t(N),x(U=>{p=D(N,1,"llm-stream svelte-10od7x6",null,p,{done:!m()}),g(b,`${U??""}${y()?` — ${y()}`:""}`),g(J,o()||"…")},[()=>v()("panel.llm_thinking")]),n(P,N)};V(u,P=>{(m()||o())&&P(h)})}var d=q(u,2),A=a(d);{var F=P=>{var N=Ha(),p=a(N,!0);t(N),x(w=>g(p,w),[()=>v()("panel.no_activity")]),n(P,N)},O=P=>{var N=$e(),p=ce(N);Re(p,1,i,Oe,(w,I)=>{var j=Na(),r=a(j),b=a(r,!0);t(r);var S=q(r,2),Y=a(S,!0);t(S),t(j),x(()=>{g(b,e(I).time),g(Y,e(I).text)}),n(w,j)}),n(P,N)};V(A,P=>{i().length===0&&!m()&&!o()?P(F):P(O,!1)})}t(d),t(z),n(E,z),ge(),T()}var Ka=$('<div class="empty svelte-1r2yd7q"> </div>'),Va=$('<span class="err-ctx svelte-1r2yd7q"> </span>'),Fa=$('<div class="error-entry svelte-1r2yd7q"><span class="err-time svelte-1r2yd7q"> </span> <span class="err-text svelte-1r2yd7q"> <!></span></div>'),ja=$('<div class="pane svelte-1r2yd7q"><!></div>');function Ia(E,s){_e(s,!1);const o=()=>K(nt,"$errorEntries",v),m=()=>K(ke,"$t",v),[v,y]=we();It();var i=ja(),_=a(i);{var T=z=>{var u=Ka(),h=a(u,!0);t(u),x(d=>g(h,d),[()=>m()("panel.no_problems")]),n(z,u)},l=z=>{var u=$e(),h=ce(u);Re(h,1,o,Oe,(d,A)=>{var F=Fa(),O=a(F),P=a(O,!0);t(O);var N=q(O,2),p=a(N),w=q(p);{var I=j=>{var r=Va(),b=a(r,!0);t(r),x(()=>g(b,e(A).context)),n(j,r)};V(w,j=>{e(A).context&&j(I)})}t(N),t(F),x(()=>{g(P,e(A).time),g(p,`${e(A).text??""} `)}),n(d,F)}),n(z,u)};V(_,z=>{o().length===0?z(T):z(l,!1)})}t(i),n(E,i),ge(),y()}var Ya=$('<span class="llm-dot svelte-1coqiht"></span>'),Ra=$('<span class="count svelte-1coqiht"> </span>'),Oa=$('<div class="panel-content svelte-1coqiht"><!></div>'),Wa=$('<div class="resize-handle svelte-1coqiht"></div> <div><div class="tabs-bar svelte-1coqiht"><span class="bp-info ws-status svelte-1coqiht"><span></span> <span class="svelte-1coqiht"> </span></span> <span class="bp-separator svelte-1coqiht"></span> <button><!> <!></button> <button><!> <span> </span></button> <button class="icon-btn svelte-1coqiht"><!></button> <div class="tab-actions svelte-1coqiht"><span class="bp-info model-info svelte-1coqiht"><!> <span class="svelte-1coqiht"> </span></span> <button class="icon-btn svelte-1coqiht"><!></button></div></div> <!></div>',1);function Ua(E,s){_e(s,!0);const o=()=>K(lt,"$llmActive",l),m=()=>K(He,"$page",l),v=()=>K(ke,"$t",l),y=()=>K(ot,"$wsConnected",l),i=()=>K(rt,"$logEntries",l),_=()=>K(nt,"$errorEntries",l),T=()=>K(ye,"$status",l),[l,z]=we(),u={constitution:null,architecture:"architect",adr:"architect",devplan:"architect",tasks:"coder",settings:null};let h=Z("run"),d=Z(null);const A="skaro:bottom-panel-collapsed";function F(){try{const c=sessionStorage.getItem(A);return c===null?!0:c==="1"}catch{return!0}}function O(c){try{sessionStorage.setItem(A,c?"1":"0")}catch{}}let P=Z(st(F())),N=Z(null),p=Z(200),w=Z(null),I=Z(!0),j=Z(!1),r=Z(!1),b=Z(null);function S(){H(r,!0),e(b)&&clearTimeout(e(b)),H(b,setTimeout(()=>{H(r,!1),H(b,null)},350),!0)}Ce(()=>{const c=o();c&&!e(j)?(H(I,e(te),!0),S(),H(w,!1),H(h,"run")):!c&&e(j)&&(e(I)?setTimeout(()=>{S(),H(w,null)},1500):H(w,null)),H(j,c,!0)});let Y=re(()=>m().url.pathname.split("/").filter(Boolean)[0]||"dashboard"),J=re(()=>e(Y)==="dashboard");function U(c,X){var se;if(!(c!=null&&c.config))return"—";const ne=u[X],oe=c.config;if(ne&&((se=oe.roles)!=null&&se[ne])){const Se=oe.roles[ne];return`${v()("settings.role_"+ne)}: ${Se.provider} / ${Se.model}`}return`${v()("status.role_default")}: ${oe.llm_provider} / ${oe.llm_model}`}let ee=Z("");Ce(()=>{e(Y)!==e(ee)&&(H(N,null),H(ee,e(Y),!0))});let te=re(()=>e(w)!==null?e(w):e(J)?e(N)!==null?e(N):!0:e(P));function L(c){var se;c.preventDefault();const X=c.clientY,ne=((se=e(d))==null?void 0:se.offsetHeight)??200;function oe(Se){const Xe=X-Se.clientY,Je=Math.min(Math.max(ne+Xe,80),window.innerHeight*.6);e(d)&&(e(d).style.height=Je+"px"),H(p,Je,!0)}function me(){document.removeEventListener("mousemove",oe),document.removeEventListener("mouseup",me)}document.addEventListener("mousemove",oe),document.addEventListener("mouseup",me)}function M(c){H(h,c,!0),e(te)&&(e(J)?H(N,!1):(H(P,!1),O(!1)))}function R(){H(w,null);const c=!e(te);e(J)?H(N,c):(H(P,c),O(c))}function G(){e(h)==="run"?Lt():Mt()}var C=Wa(),k=ce(C),W=q(k,2);let ae;var Q=a(W),de=a(Q),ue=a(de);let Le;var Me=q(ue,2),Ne=a(Me,!0);t(Me),t(de);var le=q(de,4);let pe;var he=a(le);Dt(he,{size:12});var Te=q(he),Be=q(Te);{var Pe=c=>{var X=Ya();n(c,X)},fe=c=>{var X=Ra(),ne=a(X,!0);t(X),x(()=>g(ne,i().length)),n(c,X)};V(Be,c=>{o()?c(Pe):c(fe,!1)})}t(le);var ve=q(le,2);let Ae;var We=a(ve);Rt(We,{size:12});var Ue=q(We),Ke=q(Ue);let De;var vt=a(Ke,!0);t(Ke),t(ve);var qe=q(ve,2),ct=a(qe);kt(ct,{size:13}),t(qe);var Ge=q(qe,2),Ve=a(Ge),Ze=a(Ve);Ot(Ze,{size:11});var Qe=q(Ze,2),dt=a(Qe,!0);t(Qe),t(Ve);var Ee=q(Ve,2),pt=a(Ee);{var ut=c=>{Wt(c,{size:14})},ht=c=>{qt(c,{size:14})};V(pt,c=>{e(te)?c(ut):c(ht,!1)})}t(Ee),t(Ge),t(Q);var ft=q(Q,2);{var mt=c=>{var X=Oa(),ne=a(X);{var oe=se=>{Pa(se,{})},me=se=>{Ia(se,{})};V(ne,se=>{e(h)==="run"?se(oe):se(me,!1)})}t(X),n(c,X)};V(ft,c=>{e(te)||c(mt)})}t(W),it(W,c=>H(d,c),()=>e(d)),x((c,X,ne,oe,me,se)=>{ae=D(W,1,"bottom-panel svelte-1coqiht",null,ae,{collapsed:e(te),animating:e(r)}),xe(W,`height: ${e(te)?"28px":e(p)+"px"}`),Le=D(ue,1,"status-dot svelte-1coqiht",null,Le,{off:!y()}),g(Ne,c),pe=D(le,1,"bp-tab svelte-1coqiht",null,pe,{active:e(h)==="run"}),g(Te,` ${X??""} `),Ae=D(ve,1,"bp-tab svelte-1coqiht",null,Ae,{active:e(h)==="errors"}),g(Ue,` ${ne??""} `),De=D(Ke,1,"count svelte-1coqiht",null,De,{"has-errors":_().length>0}),g(vt,_().length),B(qe,"title",oe),g(dt,me),B(Ee,"title",se)},[()=>y()?v()("status.connected"):v()("status.disconnected"),()=>v()("panel.run"),()=>v()("panel.problems"),()=>v()("panel.clear"),()=>U(T(),e(Y)),()=>v()("panel.minimize")]),be("mousedown",k,L),be("click",le,()=>M("run")),be("click",ve,()=>M("errors")),be("click",qe,G),be("click",Ee,R),n(E,C),ge(),z()}at(["mousedown","click"]);var Da=$('<div class="alert alert-warn"> </div>'),Ga=$('<div class="center-msg svelte-12qhfyh"> </div>'),Za=$('<div class="center-msg svelte-12qhfyh"><p> </p> <p><code> </code></p></div>'),Qa=$('<div class="app svelte-12qhfyh"><!> <div class="main-wrapper svelte-12qhfyh"><!> <main class="main svelte-12qhfyh"><!></main> <!></div></div>');function hs(E,s){_e(s,!0);const o=()=>K(He,"$page",v),m=()=>K(ke,"$t",v),[v,y]=we();let i=Z(""),_=Z(null),T=re(()=>{const r=o().url.pathname.split("/").filter(Boolean);return r[0]==="tasks"&&r[1]?decodeURIComponent(r[1]):null});const l={dashboard:"nav.dashboard",constitution:"nav.constitution",architecture:"nav.architecture",adr:"nav.adr",devplan:"nav.devplan",tasks:"nav.tasks",settings:"nav.settings"};let z=re(()=>{const r=o().url.pathname.split("/").filter(Boolean),b=r[0]||"dashboard",S=l[b],Y=S?m()(S):b;return b==="tasks"&&r[1]?`Skaro / ${Y} / ${decodeURIComponent(r[1])}`:`Skaro / ${Y}`});Ce(()=>{document.title=e(z)}),ye.subscribe(r=>{H(_,r,!0)}),_t(()=>{u(),Tt(),Et(r=>ot.set(r)),St(r=>{if(r.event==="llm:start"){Ct(r.phase||"");return}if(r.event==="llm:chunk"){Ht(r.text||"");return}if(r.event==="llm:complete"){Nt();return}r.event&&(Bt(`${r.event}${r.task?": "+r.task:""}${r.phase?" → "+r.phase:""}`),Pt("status"),u(),e(T)&&tt.getTask(e(T)).then(b=>Kt.set(b)).catch(()=>{}))})});async function u(){try{ye.set(await At("status",()=>tt.getStatus(),5e3)),H(i,"")}catch(r){H(i,r.message,!0)}}var h=Qa(),d=a(h);ga(d,{});var A=q(d,2),F=a(A);Ea(F,{});var O=q(F,2),P=a(O);{var N=r=>{var b=Da(),S=a(b,!0);t(b),x(()=>g(S,e(i))),n(r,b)},p=r=>{var b=Ga(),S=a(b,!0);t(b),x(Y=>g(S,Y),[()=>m()("app.loading")]),n(r,b)},w=r=>{var b=Za(),S=a(b),Y=a(S,!0);t(S);var J=q(S,2),U=a(J),ee=a(U,!0);t(U),t(J),t(b),x((te,L)=>{g(Y,te),g(ee,L)},[()=>m()("app.not_initialized"),()=>m()("app.not_initialized_cmd")]),n(r,b)},I=r=>{var b=$e(),S=ce(b);wt(S,()=>s.children),n(r,b)};V(P,r=>{e(i)?r(N):e(_)?e(_).initialized?r(I,!1):r(w,2):r(p,1)})}t(O);var j=q(O,2);Ua(j,{}),t(A),t(h),n(E,h),ge(),y()}export{hs as component};
