spec-cat 0.1.19 → 0.1.21

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.
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./Bd9QEY7i.js","./Dr-08407.js","./entry.DLBgeD7S.css","./BKqdCRS3.js"])))=>i.map(i=>d[i]);
2
- import{y as O,z as b,A as d,d as Be,C as te,G as p,P as Ue,R as hr,Q as ot,S as ye,E as Le,B as _,O as X,g as E,U as Ne,V as qn,k as N,W as xr,H as Ce,L as ge,o as zt,X as Ht,Y as Xm,K as ze,Z as tn,T as hn,_ as ai,M as Un,D as kt,N as Gt,$ as zm,I as hh,a0 as Me,a1 as Bs,a2 as qr,a3 as Ws,a4 as Gc,a5 as Bv,c as Lv,a6 as _d,a7 as Nm,a8 as Dv,q as Zv,a9 as Iv,x as Xv}from"./Dr-08407.js";import{r as ir,c as Gn,b as Tl,a as Zs}from"./BXrSICHP.js";import{_ as ki}from"./DlAUqK2U.js";import{S as ja,i as zv,c as Nv,P as Vv,W as Rd,M as Ed,d as Bd,e as Ld,g as Dd,f as Wv,D as Vm,h as Wm,j as jv,b as wi,u as Ro,k as Ri,l as qv,a as Hc,m as Us,n as Ho,_ as Yv}from"./Bd9QEY7i.js";function Fv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"})])}function Uv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function Kc(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function Gv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"})])}function Hv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})])}function Kv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})])}function jm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"})])}function qm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})])}function Ym(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"})])}function Fm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})])}function Um(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})])}function Gm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function Jv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5"})])}function Hm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})])}function eb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"})])}function tb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"})])}function rb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})])}function nb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})])}function Ml(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function dh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function sb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})])}function fh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function ph(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})])}function ib(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function mh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})])}function li(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})])}function Km(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Jm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"})])}function Jc(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function eg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function ob(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function tg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function ab(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"})])}function lb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function cb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})])}function ci(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})])}function Si(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function fs(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function ub(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})])}function rg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function hb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})])}function eu(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function db(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})])}function fb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"})])}function pb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})])}function mb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})])}function ng(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})])}function Ls(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})])}function gb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14"})])}function Ob(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function vb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})])}function gh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}function sg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function bb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})])}function Zd(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})])}function Oh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})])}function ig(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})])}function vh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"})])}function Al(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})])}function xb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function bh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"})])}function tu(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function yb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})])}const kb={class:"flex items-center gap-1.5 px-2 py-1.5 bg-retro-panel border-b border-retro-border"},wb={class:"relative flex-1 min-w-0"},Sb={key:0,class:"text-[11px] text-retro-muted flex-shrink-0 min-w-[60px] text-center"},$b=["disabled"],Cb=["disabled"],Qb=Be({__name:"GitFindWidget",props:{resultCount:{},currentIndex:{}},emits:["search","next","prev","close"],setup(r,{expose:e,emit:t}){const n=t,s=E(""),i=E(null);let o=null;function a(){o&&clearTimeout(o),o=setTimeout(()=>{n("search",s.value)},200)}function l(u){u.key==="Escape"?(u.preventDefault(),n("close")):u.key==="Enter"&&(u.preventDefault(),u.shiftKey?n("prev"):n("next"))}function c(){i.value?.focus(),i.value?.select()}return e({focus:c}),(u,h)=>(O(),b("div",kb,[te(p(Ls),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("div",wb,[Ue(d("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=f=>ot(s)?s.value=f:null),type:"text",placeholder:"Find in commits...","aria-label":"Search commits",class:"w-full px-2 py-1 text-sm bg-retro-dark border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onInput:a,onKeydown:l},null,544),[[hr,p(s)]])]),p(s)?(O(),b("span",Sb,[r.resultCount>0?(O(),b(ye,{key:0},[Le(_(r.currentIndex+1)+" of "+_(r.resultCount),1)],64)):(O(),b(ye,{key:1},[Le(" No results ")],64))])):X("",!0),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:r.resultCount===0,"aria-label":"Previous result",title:"Previous (Shift+Enter)",onClick:h[1]||(h[1]=f=>n("prev"))},[te(p(ib),{class:"w-4 h-4"})],8,$b),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:r.resultCount===0,"aria-label":"Next result",title:"Next (Enter)",onClick:h[2]||(h[2]=f=>n("next"))},[te(p(sb),{class:"w-4 h-4"})],8,Cb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors","aria-label":"Close find widget",title:"Close (Escape)",onClick:h[3]||(h[3]=f=>n("close"))},[te(p(ir),{class:"w-4 h-4"})])]))}}),Pb={class:"flex flex-col bg-retro-dark border border-retro-border rounded shadow-lg max-w-md w-full"},Tb={class:"flex items-center justify-between px-3 py-2 border-b border-retro-border"},Mb={class:"flex-1 overflow-auto max-h-[300px]"},Ab={class:"font-semibold text-retro-cyan flex-shrink-0 min-w-[60px]"},_b=["onKeyup"],Rb=["onClick"],Eb={class:"text-retro-muted truncate flex-1 font-mono"},Bb=["onClick"],Lb=["onClick"],Db={key:0,class:"px-3 py-4 text-center text-retro-muted text-xs"},Zb={key:0,class:"px-3 py-2 border-t border-retro-border space-y-2"},Ib={class:"flex gap-2 justify-end"},Xb=["disabled"],zb={key:1,class:"px-3 py-2 border-t border-retro-border"},Nb=Be({__name:"GitRemoteManager",props:{remotes:{},loading:{type:Boolean}},emits:["add","edit","delete","close"],setup(r,{emit:e}){const t=e,n=E(!1),s=E(""),i=E(""),o=E(null),a=E("");function l(){n.value=!0,s.value="",i.value=""}function c(){!s.value.trim()||!i.value.trim()||(t("add",{name:s.value.trim(),url:i.value.trim()}),n.value=!1)}function u(m){o.value=m.name,a.value=m.fetchUrl}function h(m){a.value.trim()&&(t("edit",{name:m,newUrl:a.value.trim()}),o.value=null)}function f(){o.value=null}return(m,g)=>(O(),b("div",Pb,[d("div",Tb,[g[5]||(g[5]=d("h3",{class:"text-sm font-semibold text-retro-text"},"Remote Repositories",-1)),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",onClick:g[0]||(g[0]=v=>t("close"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",Mb,[(O(!0),b(ye,null,Ne(r.remotes,v=>(O(),b("div",{key:v.name,class:"flex items-center gap-2 px-3 py-2 border-b border-retro-border/50 text-xs"},[d("span",Ab,_(v.name),1),p(o)===v.name?(O(),b(ye,{key:0},[Ue(d("input",{"onUpdate:modelValue":g[1]||(g[1]=y=>ot(a)?a.value=y:null),type:"text",class:"flex-1 px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan",onKeyup:[qn(y=>h(v.name),["enter"]),qn(f,["escape"])]},null,40,_b),[[hr,p(a)]]),d("button",{class:"p-0.5 text-retro-green hover:text-retro-green/80",onClick:y=>h(v.name)},[te(p(dh),{class:"w-3.5 h-3.5"})],8,Rb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",onClick:f},[te(p(ir),{class:"w-3.5 h-3.5"})])],64)):(O(),b(ye,{key:1},[d("span",Eb,_(v.fetchUrl),1),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",title:"Edit",onClick:y=>u(v)},[te(p(gh),{class:"w-3.5 h-3.5"})],8,Bb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-red",title:"Delete",onClick:y=>t("delete",v.name)},[te(p(Gn),{class:"w-3.5 h-3.5"})],8,Lb)],64))]))),128)),r.remotes.length===0?(O(),b("div",Db," No remotes configured ")):X("",!0)]),p(n)?(O(),b("div",Zb,[Ue(d("input",{"onUpdate:modelValue":g[2]||(g[2]=v=>ot(s)?s.value=v:null),type:"text",placeholder:"Remote name (e.g., origin)",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[hr,p(s)]]),Ue(d("input",{"onUpdate:modelValue":g[3]||(g[3]=v=>ot(i)?i.value=v:null),type:"text",placeholder:"Remote URL",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onKeyup:qn(c,["enter"])},null,544),[[hr,p(i)]]),d("div",Ib,[d("button",{class:"px-2 py-1 text-xs text-retro-muted hover:text-retro-text transition-colors",onClick:g[4]||(g[4]=v=>n.value=!1)}," Cancel "),d("button",{class:"px-2 py-1 text-xs bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40 rounded hover:bg-retro-cyan/30 transition-colors",disabled:!p(s).trim()||!p(i).trim(),onClick:c}," Add Remote ",8,Xb)])])):X("",!0),p(n)?X("",!0):(O(),b("div",zb,[d("button",{class:"flex items-center gap-1 text-xs text-retro-cyan hover:text-retro-cyan/80 transition-colors",onClick:l},[te(p(Tl),{class:"w-3.5 h-3.5"}),g[6]||(g[6]=Le(" Add Remote ",-1))])]))]))}}),_l={NODE_RADIUS:4,ROW_HEIGHT:32,COLUMN_WIDTH:20,PADDING:10,VISIBLE_BUFFER:10},Ko=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#06B6D4","#84CC16","#F43F5E","#A855F7"],ui={A:{label:"Added",colorClass:"text-retro-green"},M:{label:"Modified",colorClass:"text-retro-yellow"},D:{label:"Deleted",colorClass:"text-retro-red"},R:{label:"Renamed",colorClass:"text-retro-blue"},C:{label:"Copied",colorClass:"text-retro-purple"},U:{label:"Unmerged",colorClass:"text-retro-cyan"}},Vb=["width","height"],Wb=["d","stroke","stroke-dasharray"],jb={key:0},qb=["cx","r"],Yb=["cx","r","fill"],Fb=["cx","r","stroke"],Ub=["cx","r","fill"],Gb=["cx","r","stroke"],Hb=["cx","r","fill"],Kb=["cx","r"],Jb=["cx","r","fill"],og=Be({__name:"GitGraphSvg",props:{rowData:{},maxLane:{default:4},highlightBranches:{},tooltipText:{}},setup(r){const e=r,{COLUMN_WIDTH:t,ROW_HEIGHT:n,NODE_RADIUS:s,PADDING:i}=_l,o=N(()=>i*2+(e.maxLane+1)*t),a=n,l=n/2;function c(f){return i+f*t}function u(f){const m=c(f.fromLane),g=c(f.toLane);if(f.type==="vertical")return`M ${m} 0 L ${g} ${a}`;if(f.type==="vertical-top")return`M ${m} 0 L ${m} ${l}`;if(f.type==="vertical-bottom")return`M ${m} ${l} L ${m} ${a}`;if(f.style==="rounded")return`M ${m} ${l} C ${m} ${a}, ${g} ${a}, ${g} ${a}`;{const v=a*.75;return`M ${m} ${l} L ${m} ${v} L ${g} ${a}`}}const h=N(()=>e.rowData?c(e.rowData.lane):i);return(f,m)=>(O(),b("svg",{width:p(o),height:p(a),class:"block flex-shrink-0","aria-hidden":"true"},[r.rowData?(O(),b(ye,{key:0},[(O(!0),b(ye,null,Ne(r.rowData.connections,(g,v)=>(O(),b("path",{key:v,d:u(g),stroke:g.color,"stroke-width":"2",fill:"none","stroke-dasharray":g.type.startsWith("merge")?"4 3":"none"},null,8,Wb))),128)),d("g",null,[r.tooltipText?(O(),b("title",jb,_(r.tooltipText),1)):X("",!0),r.rowData.nodeType==="head"?(O(),b(ye,{key:1},[d("circle",{cx:p(h),cy:l,r:p(s)+2,fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-cyan"},null,8,qb),d("circle",{cx:p(h),cy:l,r:p(s),fill:r.rowData.color},null,8,Yb)],64)):r.rowData.nodeType==="merge"?(O(),b(ye,{key:2},[d("circle",{cx:p(h),cy:l,r:p(s)+1,fill:"none",stroke:r.rowData.color,"stroke-width":"1.5"},null,8,Fb),d("circle",{cx:p(h),cy:l,r:p(s)-1,fill:r.rowData.color},null,8,Ub)],64)):r.rowData.nodeType==="stash"?(O(),b(ye,{key:3},[d("circle",{cx:p(h),cy:l,r:p(s),fill:"none",stroke:r.rowData.color,"stroke-width":"2"},null,8,Gb),d("circle",{cx:p(h),cy:l,r:p(s)-2,fill:r.rowData.color},null,8,Hb)],64)):r.rowData.nodeType==="uncommitted"?(O(),b("circle",{key:4,cx:p(h),cy:l,r:p(s),fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-yellow","stroke-dasharray":"3 2"},null,8,Kb)):(O(),b("circle",{key:5,cx:p(h),cy:l,r:p(s),fill:r.rowData.color},null,8,Jb))])],64)):X("",!0)],8,Vb))}}),ex=["aria-selected","aria-label"],tx={key:1,class:"flex gap-1 flex-shrink-0"},rx=["title","onContextmenu"],nx={key:2,class:"flex gap-1 flex-shrink-0"},sx=["onContextmenu"],ix={class:"text-retro-text text-xs truncate flex-1"},ox={key:5,class:"flex-shrink-0 text-retro-muted text-[10px] hidden sm:inline"},ax={key:6,class:"flex-shrink-0 text-retro-muted text-[10px]"},lx=Be({__name:"GitCommitRow",props:{commit:{},index:{},isSelected:{type:Boolean},isHighlighted:{type:Boolean},isBranchHighlighted:{type:Boolean},isFeatureHighlighted:{type:Boolean},isPreviewHighlighted:{type:Boolean},isMuted:{type:Boolean},currentBranchName:{},localBranchNames:{},graphRowData:{},maxLane:{},columnVisibility:{}},emits:["click","keydown","branchContextMenu","commitContextMenu","tagContextMenu"],setup(r,{emit:e}){const t=r,n=e,s=N(()=>{const f=t.commit.branches;if(f.length===0)return[];const m=t.localBranchNames,g=[],v=[];for(const A of f)m.has(A)?g.push(A):v.push(A);const y=new Set(g),k=new Map,$=[];for(const A of v){const Z=A.indexOf("/");if(Z>0){const Y=A.substring(Z+1),V=A.substring(0,Z);y.has(Y)?(k.has(Y)||k.set(Y,[]),k.get(Y).push(V)):$.push(A)}else $.push(A)}const T=[];for(const A of g){const Z=k.get(A)||[];Z.length>0?T.push({displayName:`${A}/${Z.join(",")}`,originalBranches:[A,...Z.map(Y=>`${Y}/${A}`)],isLocal:!0}):T.push({displayName:A,originalBranches:[A],isLocal:!0})}for(const A of $)T.push({displayName:A,originalBranches:[A],isLocal:!1});return T});function i(f,m){f.preventDefault(),f.stopPropagation();const g=m.originalBranches[0];n("branchContextMenu",{branch:g,x:f.clientX,y:f.clientY,isCurrentBranch:m.isLocal&&m.originalBranches.includes(t.currentBranchName??""),isLocal:m.isLocal})}function o(f,m){f.preventDefault(),f.stopPropagation(),n("tagContextMenu",{tag:m,x:f.clientX,y:f.clientY})}function a(f){f.preventDefault(),f.stopPropagation(),n("commitContextMenu",{x:f.clientX,y:f.clientY})}const{ROW_HEIGHT:l}=_l,c=N(()=>{const f=[t.commit.shortHash];return t.commit.branches.length>0&&f.push(t.commit.branches.join(", ")),t.commit.tags.length>0&&f.push(t.commit.tags.map(m=>`tag: ${m}`).join(", ")),f.join(" — ")});function u(f){const g=Date.now()/1e3-f;return g<60?"just now":g<3600?`${Math.floor(g/60)}m ago`:g<86400?`${Math.floor(g/3600)}h ago`:g<604800?`${Math.floor(g/86400)}d ago`:g<2592e3?`${Math.floor(g/604800)}w ago`:new Date(f*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function h(f){const m=f.split(`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./ddKcAgQK.js","./DUodkQcr.js","./entry.DLBgeD7S.css","./DqNujSig.js"])))=>i.map(i=>d[i]);
2
+ import{y as O,z as b,A as d,d as Be,C as te,G as p,P as Ue,R as hr,Q as ot,S as ye,E as Le,B as _,O as X,g as E,U as Ne,V as qn,k as N,W as xr,H as Ce,L as ge,o as zt,X as Ht,Y as Xm,K as ze,Z as tn,T as hn,_ as ai,M as Un,D as kt,N as Gt,$ as zm,I as hh,a0 as Me,a1 as Bs,a2 as qr,a3 as Ws,a4 as Gc,a5 as Bv,c as Lv,a6 as _d,a7 as Nm,a8 as Dv,q as Zv,a9 as Iv,x as Xv}from"./DUodkQcr.js";import{r as ir,c as Gn,b as Tl,a as Zs}from"./K5rMM4le.js";import{_ as ki}from"./DlAUqK2U.js";import{S as ja,i as zv,c as Nv,P as Vv,W as Rd,M as Ed,d as Bd,e as Ld,g as Dd,f as Wv,D as Vm,h as Wm,j as jv,b as wi,u as Ro,k as Ri,l as qv,a as Hc,m as Us,n as Ho,_ as Yv}from"./ddKcAgQK.js";function Fv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 6h9.75M10.5 6a1.5 1.5 0 1 1-3 0m3 0a1.5 1.5 0 1 0-3 0M3.75 6H7.5m3 12h9.75m-9.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-3.75 0H7.5m9-6h3.75m-3.75 0a1.5 1.5 0 0 1-3 0m3 0a1.5 1.5 0 0 0-3 0m-9.75 0h9.75"})])}function Uv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5m8.25 3v6.75m0 0-3-3m3 3 3-3M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function Kc(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m20.25 7.5-.625 10.632a2.25 2.25 0 0 1-2.247 2.118H6.622a2.25 2.25 0 0 1-2.247-2.118L3.75 7.5M10 11.25h4M3.375 7.5h17.25c.621 0 1.125-.504 1.125-1.125v-1.5c0-.621-.504-1.125-1.125-1.125H3.375c-.621 0-1.125.504-1.125 1.125v1.5c0 .621.504 1.125 1.125 1.125Z"})])}function Gv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 8.25H7.5a2.25 2.25 0 0 0-2.25 2.25v9a2.25 2.25 0 0 0 2.25 2.25h9a2.25 2.25 0 0 0 2.25-2.25v-9a2.25 2.25 0 0 0-2.25-2.25H15M9 12l3 3m0 0 3-3m-3 3V2.25"})])}function Hv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5M16.5 12 12 16.5m0 0L7.5 12m4.5 4.5V3"})])}function Kv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.5 19.5 3 12m0 0 7.5-7.5M3 12h18"})])}function jm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 12c0-1.232-.046-2.453-.138-3.662a4.006 4.006 0 0 0-3.7-3.7 48.678 48.678 0 0 0-7.324 0 4.006 4.006 0 0 0-3.7 3.7c-.017.22-.032.441-.046.662M19.5 12l3-3m-3 3-3-3m-12 3c0 1.232.046 2.453.138 3.662a4.006 4.006 0 0 0 3.7 3.7 48.656 48.656 0 0 0 7.324 0 4.006 4.006 0 0 0 3.7-3.7c.017-.22.032-.441.046-.662M4.5 12l3 3m-3-3-3 3"})])}function qm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3 16.5v2.25A2.25 2.25 0 0 0 5.25 21h13.5A2.25 2.25 0 0 0 21 18.75V16.5m-13.5-9L12 3m0 0 4.5 4.5M12 3v13.5"})])}function Ym(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 15 3 9m0 0 6-6M3 9h12a6 6 0 0 1 0 12h-3"})])}function Fm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 9V4.5M9 9H4.5M9 9 3.75 3.75M9 15v4.5M9 15H4.5M9 15l-5.25 5.25M15 9h4.5M15 9V4.5M15 9l5.25-5.25M15 15h4.5M15 15v4.5m0-4.5 5.25 5.25"})])}function Um(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 3.75v4.5m0-4.5h4.5m-4.5 0L9 9M3.75 20.25v-4.5m0 4.5h4.5m-4.5 0L9 15M20.25 3.75h-4.5m4.5 0v4.5m0-4.5L15 9m5.25 11.25h-4.5m4.5 0v-4.5m0 4.5L15 15"})])}function Gm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 21 3 16.5m0 0L7.5 12M3 16.5h13.5m0-13.5L21 7.5m0 0L16.5 12M21 7.5H7.5"})])}function Jv(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.75 3.104v5.714a2.25 2.25 0 0 1-.659 1.591L5 14.5M9.75 3.104c-.251.023-.501.05-.75.082m.75-.082a24.301 24.301 0 0 1 4.5 0m0 0v5.714c0 .597.237 1.17.659 1.591L19.8 15.3M14.25 3.104c.251.023.501.05.75.082M19.8 15.3l-1.57.393A9.065 9.065 0 0 1 12 15a9.065 9.065 0 0 0-6.23-.693L5 14.5m14.8.8 1.402 1.402c1.232 1.232.65 3.318-1.067 3.611A48.309 48.309 0 0 1 12 21c-2.773 0-5.491-.235-8.135-.687-1.718-.293-2.3-2.379-1.067-3.61L5 14.5"})])}function Hm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m3.75 13.5 10.5-11.25L12 10.5h8.25L9.75 21.75 12 13.5H3.75Z"})])}function eb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 12.75c1.148 0 2.278.08 3.383.237 1.037.146 1.866.966 1.866 2.013 0 3.728-2.35 6.75-5.25 6.75S6.75 18.728 6.75 15c0-1.046.83-1.867 1.866-2.013A24.204 24.204 0 0 1 12 12.75Zm0 0c2.883 0 5.647.508 8.207 1.44a23.91 23.91 0 0 1-1.152 6.06M12 12.75c-2.883 0-5.647.508-8.208 1.44.125 2.104.52 4.136 1.153 6.06M12 12.75a2.25 2.25 0 0 0 2.248-2.354M12 12.75a2.25 2.25 0 0 1-2.248-2.354M12 8.25c.995 0 1.971-.08 2.922-.236.403-.066.74-.358.795-.762a3.778 3.778 0 0 0-.399-2.25M12 8.25c-.995 0-1.97-.08-2.922-.236-.402-.066-.74-.358-.795-.762a3.734 3.734 0 0 1 .4-2.253M12 8.25a2.25 2.25 0 0 0-2.248 2.146M12 8.25a2.25 2.25 0 0 1 2.248 2.146M8.683 5a6.032 6.032 0 0 1-1.155-1.002c.07-.63.27-1.222.574-1.747m.581 2.749A3.75 3.75 0 0 1 15.318 5m0 0c.427-.283.815-.62 1.155-.999a4.471 4.471 0 0 0-.575-1.752M4.921 6a24.048 24.048 0 0 0-.392 3.314c1.668.546 3.416.914 5.223 1.082M19.08 6c.205 1.08.337 2.187.392 3.314a23.882 23.882 0 0 1-5.223 1.082"})])}function tb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M7.5 14.25v2.25m3-4.5v4.5m3-6.75v6.75m3-9v9M6 20.25h12A2.25 2.25 0 0 0 20.25 18V6A2.25 2.25 0 0 0 18 3.75H6A2.25 2.25 0 0 0 3.75 6v12A2.25 2.25 0 0 0 6 20.25Z"})])}function rb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M20.25 8.511c.884.284 1.5 1.128 1.5 2.097v4.286c0 1.136-.847 2.1-1.98 2.193-.34.027-.68.052-1.02.072v3.091l-3-3c-1.354 0-2.694-.055-4.02-.163a2.115 2.115 0 0 1-.825-.242m9.345-8.334a2.126 2.126 0 0 0-.476-.095 48.64 48.64 0 0 0-8.048 0c-1.131.094-1.976 1.057-1.976 2.192v4.286c0 .837.46 1.58 1.155 1.951m9.345-8.334V6.637c0-1.621-1.152-3.026-2.76-3.235A48.455 48.455 0 0 0 11.25 3c-2.115 0-4.198.137-6.24.402-1.608.209-2.76 1.614-2.76 3.235v6.226c0 1.621 1.152 3.026 2.76 3.235.577.075 1.157.14 1.74.194V21l4.155-4.155"})])}function nb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.76c0 1.6 1.123 2.994 2.707 3.227 1.087.16 2.185.283 3.293.369V21l4.076-4.076a1.526 1.526 0 0 1 1.037-.443 48.282 48.282 0 0 0 5.68-.494c1.584-.233 2.707-1.626 2.707-3.228V6.741c0-1.602-1.123-2.995-2.707-3.228A48.394 48.394 0 0 0 12 3c-2.392 0-4.744.175-7.043.513C3.373 3.746 2.25 5.14 2.25 6.741v6.018Z"})])}function Ml(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function dh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 12.75 6 6 9-13.5"})])}function sb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"})])}function fh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m8.25 4.5 7.5 7.5-7.5 7.5"})])}function ph(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 15 12 18.75 15.75 15m-7.5-6L12 5.25 15.75 9"})])}function ib(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"})])}function mh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12h3.75M9 15h3.75M9 18h3.75m3 .75H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08m-5.801 0c-.065.21-.1.433-.1.664 0 .414.336.75.75.75h4.5a.75.75 0 0 0 .75-.75 2.25 2.25 0 0 0-.1-.664m-5.8 0A2.251 2.251 0 0 1 13.5 2.25H15c1.012 0 1.867.668 2.15 1.586m-5.8 0c-.376.023-.75.05-1.124.08C9.095 4.01 8.25 4.973 8.25 6.108V8.25m0 0H4.875c-.621 0-1.125.504-1.125 1.125v11.25c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V9.375c0-.621-.504-1.125-1.125-1.125H8.25ZM6.75 12h.008v.008H6.75V12Zm0 3h.008v.008H6.75V15Zm0 3h.008v.008H6.75V18Z"})])}function li(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 7.5V6.108c0-1.135.845-2.098 1.976-2.192.373-.03.748-.057 1.123-.08M15.75 18H18a2.25 2.25 0 0 0 2.25-2.25V6.108c0-1.135-.845-2.098-1.976-2.192a48.424 48.424 0 0 0-1.123-.08M15.75 18.75v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5A3.375 3.375 0 0 0 6.375 7.5H5.25m11.9-3.664A2.251 2.251 0 0 0 15 2.25h-1.5a2.251 2.251 0 0 0-2.15 1.586m5.8 0c.065.21.1.433.1.664v.75h-6V4.5c0-.231.035-.454.1-.664M6.75 7.5H4.875c-.621 0-1.125.504-1.125 1.125v12c0 .621.504 1.125 1.125 1.125h9.75c.621 0 1.125-.504 1.125-1.125V16.5a9 9 0 0 0-9-9Z"})])}function Km(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 6v6h4.5m4.5 0a9 9 0 1 1-18 0 9 9 0 0 1 18 0Z"})])}function Jm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9.75v6.75m0 0-3-3m3 3 3-3m-8.25 6a4.5 4.5 0 0 1-1.41-8.775 5.25 5.25 0 0 1 10.233-2.33 3 3 0 0 1 3.758 3.848A3.752 3.752 0 0 1 18 19.5H6.75Z"})])}function Jc(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M17.25 6.75 22.5 12l-5.25 5.25m-10.5 0L1.5 12l5.25-5.25m7.5-3-4.5 16.5"})])}function eg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.594 3.94c.09-.542.56-.94 1.11-.94h2.593c.55 0 1.02.398 1.11.94l.213 1.281c.063.374.313.686.645.87.074.04.147.083.22.127.325.196.72.257 1.075.124l1.217-.456a1.125 1.125 0 0 1 1.37.49l1.296 2.247a1.125 1.125 0 0 1-.26 1.431l-1.003.827c-.293.241-.438.613-.43.992a7.723 7.723 0 0 1 0 .255c-.008.378.137.75.43.991l1.004.827c.424.35.534.955.26 1.43l-1.298 2.247a1.125 1.125 0 0 1-1.369.491l-1.217-.456c-.355-.133-.75-.072-1.076.124a6.47 6.47 0 0 1-.22.128c-.331.183-.581.495-.644.869l-.213 1.281c-.09.543-.56.94-1.11.94h-2.594c-.55 0-1.019-.398-1.11-.94l-.213-1.281c-.062-.374-.312-.686-.644-.87a6.52 6.52 0 0 1-.22-.127c-.325-.196-.72-.257-1.076-.124l-1.217.456a1.125 1.125 0 0 1-1.369-.49l-1.297-2.247a1.125 1.125 0 0 1 .26-1.431l1.004-.827c.292-.24.437-.613.43-.991a6.932 6.932 0 0 1 0-.255c.007-.38-.138-.751-.43-.992l-1.004-.827a1.125 1.125 0 0 1-.26-1.43l1.297-2.247a1.125 1.125 0 0 1 1.37-.491l1.216.456c.356.133.751.072 1.076-.124.072-.044.146-.086.22-.128.332-.183.582-.495.644-.869l.214-1.28Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function ob(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m6.75 7.5 3 2.25-3 2.25m4.5 0h3m-9 8.25h13.5A2.25 2.25 0 0 0 21 18V6a2.25 2.25 0 0 0-2.25-2.25H5.25A2.25 2.25 0 0 0 3 6v12a2.25 2.25 0 0 0 2.25 2.25Z"})])}function tg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 3v1.5M4.5 8.25H3m18 0h-1.5M4.5 12H3m18 0h-1.5m-15 3.75H3m18 0h-1.5M8.25 19.5V21M12 3v1.5m0 15V21m3.75-18v1.5m0 15V21m-9-1.5h10.5a2.25 2.25 0 0 0 2.25-2.25V6.75a2.25 2.25 0 0 0-2.25-2.25H6.75A2.25 2.25 0 0 0 4.5 6.75v10.5a2.25 2.25 0 0 0 2.25 2.25Zm.75-12h9v9h-9v-9Z"})])}function ab(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M10.125 2.25h-4.5c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125v-9M10.125 2.25h.375a9 9 0 0 1 9 9v.375M10.125 2.25A3.375 3.375 0 0 1 13.5 5.625v1.5c0 .621.504 1.125 1.125 1.125h1.5a3.375 3.375 0 0 1 3.375 3.375M9 15l2.25 2.25L15 12"})])}function lb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75a1.125 1.125 0 0 1-1.125-1.125V7.875c0-.621.504-1.125 1.125-1.125H6.75a9.06 9.06 0 0 1 1.5.124m7.5 10.376h3.375c.621 0 1.125-.504 1.125-1.125V11.25c0-4.46-3.243-8.161-7.5-8.876a9.06 9.06 0 0 0-1.5-.124H9.375c-.621 0-1.125.504-1.125 1.125v3.5m7.5 10.375H9.375a1.125 1.125 0 0 1-1.125-1.125v-9.25m12 6.625v-1.875a3.375 3.375 0 0 0-3.375-3.375h-1.5a1.125 1.125 0 0 1-1.125-1.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H9.75"})])}function cb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m5.231 13.481L15 17.25m-4.5-15H5.625c-.621 0-1.125.504-1.125 1.125v16.5c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Zm3.75 11.625a2.625 2.625 0 1 1-5.25 0 2.625 2.625 0 0 1 5.25 0Z"})])}function ci(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M19.5 14.25v-2.625a3.375 3.375 0 0 0-3.375-3.375h-1.5A1.125 1.125 0 0 1 13.5 7.125v-1.5a3.375 3.375 0 0 0-3.375-3.375H8.25m0 12.75h7.5m-7.5 3H12M10.5 2.25H5.625c-.621 0-1.125.504-1.125 1.125v17.25c0 .621.504 1.125 1.125 1.125h12.75c.621 0 1.125-.504 1.125-1.125V11.25a9 9 0 0 0-9-9Z"})])}function Si(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m9-.75a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 3.75h.008v.008H12v-.008Z"})])}function fs(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m-9.303 3.376c-.866 1.5.217 3.374 1.948 3.374h14.71c1.73 0 2.813-1.874 1.948-3.374L13.949 3.378c-.866-1.5-3.032-1.5-3.898 0L2.697 16.126ZM12 15.75h.007v.008H12v-.008Z"})])}function ub(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.98 8.223A10.477 10.477 0 0 0 1.934 12C3.226 16.338 7.244 19.5 12 19.5c.993 0 1.953-.138 2.863-.395M6.228 6.228A10.451 10.451 0 0 1 12 4.5c4.756 0 8.773 3.162 10.065 7.498a10.522 10.522 0 0 1-4.293 5.774M6.228 6.228 3 3m3.228 3.228 3.65 3.65m7.894 7.894L21 21m-3.228-3.228-3.65-3.65m0 0a3 3 0 1 0-4.243-4.243m4.242 4.242L9.88 9.88"})])}function rg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.036 12.322a1.012 1.012 0 0 1 0-.639C3.423 7.51 7.36 4.5 12 4.5c4.638 0 8.573 3.007 9.963 7.178.07.207.07.431 0 .639C20.577 16.49 16.64 19.5 12 19.5c-4.638 0-8.573-3.007-9.963-7.178Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})])}function hb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M3.75 9.776c.112-.017.227-.026.344-.026h15.812c.117 0 .232.009.344.026m-16.5 0a2.25 2.25 0 0 0-1.883 2.542l.857 6a2.25 2.25 0 0 0 2.227 1.932H19.05a2.25 2.25 0 0 0 2.227-1.932l.857-6a2.25 2.25 0 0 0-1.883-2.542m-16.5 0V6A2.25 2.25 0 0 1 6 3.75h3.879a1.5 1.5 0 0 1 1.06.44l2.122 2.12a1.5 1.5 0 0 0 1.06.44H18A2.25 2.25 0 0 1 20.25 9v.776"})])}function eu(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M2.25 12.75V12A2.25 2.25 0 0 1 4.5 9.75h15A2.25 2.25 0 0 1 21.75 12v.75m-8.69-6.44-2.12-2.12a1.5 1.5 0 0 0-1.061-.44H4.5A2.25 2.25 0 0 0 2.25 6v12a2.25 2.25 0 0 0 2.25 2.25h15A2.25 2.25 0 0 0 21.75 18V9a2.25 2.25 0 0 0-2.25-2.25h-5.379a1.5 1.5 0 0 1-1.06-.44Z"})])}function db(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3c2.755 0 5.455.232 8.083.678.533.09.917.556.917 1.096v1.044a2.25 2.25 0 0 1-.659 1.591l-5.432 5.432a2.25 2.25 0 0 0-.659 1.591v2.927a2.25 2.25 0 0 1-1.244 2.013L9.75 21v-6.568a2.25 2.25 0 0 0-.659-1.591L3.659 7.409A2.25 2.25 0 0 1 3 5.818V4.774c0-.54.384-1.006.917-1.096A48.32 48.32 0 0 1 12 3Z"})])}function fb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 8.25h15m-16.5 7.5h15m-1.8-13.5-3.9 19.5m-2.1-19.5-3.9 19.5"})])}function pb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m11.25 11.25.041-.02a.75.75 0 0 1 1.063.852l-.708 2.836a.75.75 0 0 0 1.063.853l.041-.021M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9-3.75h.008v.008H12V8.25Z"})])}function mb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 18v-5.25m0 0a6.01 6.01 0 0 0 1.5-.189m-1.5.189a6.01 6.01 0 0 1-1.5-.189m3.75 7.478a12.06 12.06 0 0 1-4.5 0m3.75 2.383a14.406 14.406 0 0 1-3 0M14.25 18v-.192c0-.983.658-1.823 1.508-2.316a7.5 7.5 0 1 0-7.517 0c.85.493 1.509 1.333 1.509 2.316V18"})])}function ng(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M8.25 6.75h12M8.25 12h12m-12 5.25h12M3.75 6.75h.007v.008H3.75V6.75Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0ZM3.75 12h.007v.008H3.75V12Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm-.375 5.25h.007v.008H3.75v-.008Zm.375 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Z"})])}function Ls(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"})])}function gb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5 12h14"})])}function Ob(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M21.752 15.002A9.72 9.72 0 0 1 18 15.75c-5.385 0-9.75-4.365-9.75-9.75 0-1.33.266-2.597.748-3.752A9.753 9.753 0 0 0 3 11.25C3 16.635 7.365 21 12.75 21a9.753 9.753 0 0 0 9.002-5.998Z"})])}function vb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m18.375 12.739-7.693 7.693a4.5 4.5 0 0 1-6.364-6.364l10.94-10.94A3 3 0 1 1 19.5 7.372L8.552 18.32m.009-.01-.01.01m5.699-9.941-7.81 7.81a1.5 1.5 0 0 0 2.112 2.13"})])}function gh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"})])}function sg(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L6.832 19.82a4.5 4.5 0 0 1-1.897 1.13l-2.685.8.8-2.685a4.5 4.5 0 0 1 1.13-1.897L16.863 4.487Zm0 0L19.5 7.125"})])}function bb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M5.25 5.653c0-.856.917-1.398 1.667-.986l11.54 6.347a1.125 1.125 0 0 1 0 1.972l-11.54 6.347a1.125 1.125 0 0 1-1.667-.986V5.653Z"})])}function Zd(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M14.25 6.087c0-.355.186-.676.401-.959.221-.29.349-.634.349-1.003 0-1.036-1.007-1.875-2.25-1.875s-2.25.84-2.25 1.875c0 .369.128.713.349 1.003.215.283.401.604.401.959v0a.64.64 0 0 1-.657.643 48.39 48.39 0 0 1-4.163-.3c.186 1.613.293 3.25.315 4.907a.656.656 0 0 1-.658.663v0c-.355 0-.676-.186-.959-.401a1.647 1.647 0 0 0-1.003-.349c-1.036 0-1.875 1.007-1.875 2.25s.84 2.25 1.875 2.25c.369 0 .713-.128 1.003-.349.283-.215.604-.401.959-.401v0c.31 0 .555.26.532.57a48.039 48.039 0 0 1-.642 5.056c1.518.19 3.058.309 4.616.354a.64.64 0 0 0 .657-.643v0c0-.355-.186-.676-.401-.959a1.647 1.647 0 0 1-.349-1.003c0-1.035 1.008-1.875 2.25-1.875 1.243 0 2.25.84 2.25 1.875 0 .369-.128.713-.349 1.003-.215.283-.4.604-.4.959v0c0 .333.277.599.61.58a48.1 48.1 0 0 0 5.427-.63 48.05 48.05 0 0 0 .582-4.717.532.532 0 0 0-.533-.57v0c-.355 0-.676.186-.959.401-.29.221-.634.349-1.003.349-1.035 0-1.875-1.007-1.875-2.25s.84-2.25 1.875-2.25c.37 0 .713.128 1.003.349.283.215.604.401.96.401v0a.656.656 0 0 0 .658-.663 48.422 48.422 0 0 0-.37-5.36c-1.886.342-3.81.574-5.766.689a.578.578 0 0 1-.61-.58v0Z"})])}function Oh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.879 7.519c1.171-1.025 3.071-1.025 4.242 0 1.172 1.025 1.172 2.687 0 3.712-.203.179-.43.326-.67.442-.745.361-1.45.999-1.45 1.827v.75M21 12a9 9 0 1 1-18 0 9 9 0 0 1 18 0Zm-9 5.25h.008v.008H12v-.008Z"})])}function ig(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9 12.75 11.25 15 15 9.75m-3-7.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.749c0 5.592 3.824 10.29 9 11.623 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.571-.598-3.751h-.152c-3.196 0-6.1-1.248-8.25-3.285Z"})])}function vh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 9v3.75m0-10.036A11.959 11.959 0 0 1 3.598 6 11.99 11.99 0 0 0 3 9.75c0 5.592 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.31-.21-2.57-.598-3.75h-.152c-3.196 0-6.1-1.25-8.25-3.286Zm0 13.036h.008v.008H12v-.008Z"})])}function Al(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.813 15.904 9 18.75l-.813-2.846a4.5 4.5 0 0 0-3.09-3.09L2.25 12l2.846-.813a4.5 4.5 0 0 0 3.09-3.09L9 5.25l.813 2.846a4.5 4.5 0 0 0 3.09 3.09L15.75 12l-2.846.813a4.5 4.5 0 0 0-3.09 3.09ZM18.259 8.715 18 9.75l-.259-1.035a3.375 3.375 0 0 0-2.455-2.456L14.25 6l1.036-.259a3.375 3.375 0 0 0 2.455-2.456L18 2.25l.259 1.035a3.375 3.375 0 0 0 2.456 2.456L21.75 6l-1.035.259a3.375 3.375 0 0 0-2.456 2.456ZM16.894 20.567 16.5 21.75l-.394-1.183a2.25 2.25 0 0 0-1.423-1.423L13.5 18.75l1.183-.394a2.25 2.25 0 0 0 1.423-1.423l.394-1.183.394 1.183a2.25 2.25 0 0 0 1.423 1.423l1.183.394-1.183.394a2.25 2.25 0 0 0-1.423 1.423Z"})])}function xb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M12 3v2.25m6.364.386-1.591 1.591M21 12h-2.25m-.386 6.364-1.591-1.591M12 18.75V21m-4.773-4.227-1.591 1.591M5.25 12H3m4.227-4.773L5.636 5.636M15.75 12a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z"})])}function bh(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M9.568 3H5.25A2.25 2.25 0 0 0 3 5.25v4.318c0 .597.237 1.17.659 1.591l9.581 9.581c.699.699 1.78.872 2.607.33a18.095 18.095 0 0 0 5.223-5.223c.542-.827.369-1.908-.33-2.607L11.16 3.66A2.25 2.25 0 0 0 9.568 3Z"}),d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M6 6h.008v.008H6V6Z"})])}function tu(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M15.75 6a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0ZM4.501 20.118a7.5 7.5 0 0 1 14.998 0A17.933 17.933 0 0 1 12 21.75c-2.676 0-5.216-.584-7.499-1.632Z"})])}function yb(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24","stroke-width":"1.5",stroke:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"stroke-linecap":"round","stroke-linejoin":"round",d:"M11.42 15.17 17.25 21A2.652 2.652 0 0 0 21 17.25l-5.877-5.877M11.42 15.17l2.496-3.03c.317-.384.74-.626 1.208-.766M11.42 15.17l-4.655 5.653a2.548 2.548 0 1 1-3.586-3.586l6.837-5.63m5.108-.233c.55-.164 1.163-.188 1.743-.14a4.5 4.5 0 0 0 4.486-6.336l-3.276 3.277a3.004 3.004 0 0 1-2.25-2.25l3.276-3.276a4.5 4.5 0 0 0-6.336 4.486c.091 1.076-.071 2.264-.904 2.95l-.102.085m-1.745 1.437L5.909 7.5H4.5L2.25 3.75l1.5-1.5L7.5 4.5v1.409l4.26 4.26m-1.745 1.437 1.745-1.437m6.615 8.206L15.75 15.75M4.867 19.125h.008v.008h-.008v-.008Z"})])}const kb={class:"flex items-center gap-1.5 px-2 py-1.5 bg-retro-panel border-b border-retro-border"},wb={class:"relative flex-1 min-w-0"},Sb={key:0,class:"text-[11px] text-retro-muted flex-shrink-0 min-w-[60px] text-center"},$b=["disabled"],Cb=["disabled"],Qb=Be({__name:"GitFindWidget",props:{resultCount:{},currentIndex:{}},emits:["search","next","prev","close"],setup(r,{expose:e,emit:t}){const n=t,s=E(""),i=E(null);let o=null;function a(){o&&clearTimeout(o),o=setTimeout(()=>{n("search",s.value)},200)}function l(u){u.key==="Escape"?(u.preventDefault(),n("close")):u.key==="Enter"&&(u.preventDefault(),u.shiftKey?n("prev"):n("next"))}function c(){i.value?.focus(),i.value?.select()}return e({focus:c}),(u,h)=>(O(),b("div",kb,[te(p(Ls),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("div",wb,[Ue(d("input",{ref_key:"inputRef",ref:i,"onUpdate:modelValue":h[0]||(h[0]=f=>ot(s)?s.value=f:null),type:"text",placeholder:"Find in commits...","aria-label":"Search commits",class:"w-full px-2 py-1 text-sm bg-retro-dark border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onInput:a,onKeydown:l},null,544),[[hr,p(s)]])]),p(s)?(O(),b("span",Sb,[r.resultCount>0?(O(),b(ye,{key:0},[Le(_(r.currentIndex+1)+" of "+_(r.resultCount),1)],64)):(O(),b(ye,{key:1},[Le(" No results ")],64))])):X("",!0),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:r.resultCount===0,"aria-label":"Previous result",title:"Previous (Shift+Enter)",onClick:h[1]||(h[1]=f=>n("prev"))},[te(p(ib),{class:"w-4 h-4"})],8,$b),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text disabled:opacity-30 disabled:cursor-not-allowed transition-colors",disabled:r.resultCount===0,"aria-label":"Next result",title:"Next (Enter)",onClick:h[2]||(h[2]=f=>n("next"))},[te(p(sb),{class:"w-4 h-4"})],8,Cb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors","aria-label":"Close find widget",title:"Close (Escape)",onClick:h[3]||(h[3]=f=>n("close"))},[te(p(ir),{class:"w-4 h-4"})])]))}}),Pb={class:"flex flex-col bg-retro-dark border border-retro-border rounded shadow-lg max-w-md w-full"},Tb={class:"flex items-center justify-between px-3 py-2 border-b border-retro-border"},Mb={class:"flex-1 overflow-auto max-h-[300px]"},Ab={class:"font-semibold text-retro-cyan flex-shrink-0 min-w-[60px]"},_b=["onKeyup"],Rb=["onClick"],Eb={class:"text-retro-muted truncate flex-1 font-mono"},Bb=["onClick"],Lb=["onClick"],Db={key:0,class:"px-3 py-4 text-center text-retro-muted text-xs"},Zb={key:0,class:"px-3 py-2 border-t border-retro-border space-y-2"},Ib={class:"flex gap-2 justify-end"},Xb=["disabled"],zb={key:1,class:"px-3 py-2 border-t border-retro-border"},Nb=Be({__name:"GitRemoteManager",props:{remotes:{},loading:{type:Boolean}},emits:["add","edit","delete","close"],setup(r,{emit:e}){const t=e,n=E(!1),s=E(""),i=E(""),o=E(null),a=E("");function l(){n.value=!0,s.value="",i.value=""}function c(){!s.value.trim()||!i.value.trim()||(t("add",{name:s.value.trim(),url:i.value.trim()}),n.value=!1)}function u(m){o.value=m.name,a.value=m.fetchUrl}function h(m){a.value.trim()&&(t("edit",{name:m,newUrl:a.value.trim()}),o.value=null)}function f(){o.value=null}return(m,g)=>(O(),b("div",Pb,[d("div",Tb,[g[5]||(g[5]=d("h3",{class:"text-sm font-semibold text-retro-text"},"Remote Repositories",-1)),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",onClick:g[0]||(g[0]=v=>t("close"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",Mb,[(O(!0),b(ye,null,Ne(r.remotes,v=>(O(),b("div",{key:v.name,class:"flex items-center gap-2 px-3 py-2 border-b border-retro-border/50 text-xs"},[d("span",Ab,_(v.name),1),p(o)===v.name?(O(),b(ye,{key:0},[Ue(d("input",{"onUpdate:modelValue":g[1]||(g[1]=y=>ot(a)?a.value=y:null),type:"text",class:"flex-1 px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan",onKeyup:[qn(y=>h(v.name),["enter"]),qn(f,["escape"])]},null,40,_b),[[hr,p(a)]]),d("button",{class:"p-0.5 text-retro-green hover:text-retro-green/80",onClick:y=>h(v.name)},[te(p(dh),{class:"w-3.5 h-3.5"})],8,Rb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",onClick:f},[te(p(ir),{class:"w-3.5 h-3.5"})])],64)):(O(),b(ye,{key:1},[d("span",Eb,_(v.fetchUrl),1),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-text",title:"Edit",onClick:y=>u(v)},[te(p(gh),{class:"w-3.5 h-3.5"})],8,Bb),d("button",{class:"p-0.5 text-retro-muted hover:text-retro-red",title:"Delete",onClick:y=>t("delete",v.name)},[te(p(Gn),{class:"w-3.5 h-3.5"})],8,Lb)],64))]))),128)),r.remotes.length===0?(O(),b("div",Db," No remotes configured ")):X("",!0)]),p(n)?(O(),b("div",Zb,[Ue(d("input",{"onUpdate:modelValue":g[2]||(g[2]=v=>ot(s)?s.value=v:null),type:"text",placeholder:"Remote name (e.g., origin)",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[hr,p(s)]]),Ue(d("input",{"onUpdate:modelValue":g[3]||(g[3]=v=>ot(i)?i.value=v:null),type:"text",placeholder:"Remote URL",class:"w-full px-2 py-1 text-xs bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",onKeyup:qn(c,["enter"])},null,544),[[hr,p(i)]]),d("div",Ib,[d("button",{class:"px-2 py-1 text-xs text-retro-muted hover:text-retro-text transition-colors",onClick:g[4]||(g[4]=v=>n.value=!1)}," Cancel "),d("button",{class:"px-2 py-1 text-xs bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40 rounded hover:bg-retro-cyan/30 transition-colors",disabled:!p(s).trim()||!p(i).trim(),onClick:c}," Add Remote ",8,Xb)])])):X("",!0),p(n)?X("",!0):(O(),b("div",zb,[d("button",{class:"flex items-center gap-1 text-xs text-retro-cyan hover:text-retro-cyan/80 transition-colors",onClick:l},[te(p(Tl),{class:"w-3.5 h-3.5"}),g[6]||(g[6]=Le(" Add Remote ",-1))])]))]))}}),_l={NODE_RADIUS:4,ROW_HEIGHT:32,COLUMN_WIDTH:20,PADDING:10,VISIBLE_BUFFER:10},Ko=["#3B82F6","#EF4444","#10B981","#F59E0B","#8B5CF6","#EC4899","#14B8A6","#F97316","#06B6D4","#84CC16","#F43F5E","#A855F7"],ui={A:{label:"Added",colorClass:"text-retro-green"},M:{label:"Modified",colorClass:"text-retro-yellow"},D:{label:"Deleted",colorClass:"text-retro-red"},R:{label:"Renamed",colorClass:"text-retro-blue"},C:{label:"Copied",colorClass:"text-retro-purple"},U:{label:"Unmerged",colorClass:"text-retro-cyan"}},Vb=["width","height"],Wb=["d","stroke","stroke-dasharray"],jb={key:0},qb=["cx","r"],Yb=["cx","r","fill"],Fb=["cx","r","stroke"],Ub=["cx","r","fill"],Gb=["cx","r","stroke"],Hb=["cx","r","fill"],Kb=["cx","r"],Jb=["cx","r","fill"],og=Be({__name:"GitGraphSvg",props:{rowData:{},maxLane:{default:4},highlightBranches:{},tooltipText:{}},setup(r){const e=r,{COLUMN_WIDTH:t,ROW_HEIGHT:n,NODE_RADIUS:s,PADDING:i}=_l,o=N(()=>i*2+(e.maxLane+1)*t),a=n,l=n/2;function c(f){return i+f*t}function u(f){const m=c(f.fromLane),g=c(f.toLane);if(f.type==="vertical")return`M ${m} 0 L ${g} ${a}`;if(f.type==="vertical-top")return`M ${m} 0 L ${m} ${l}`;if(f.type==="vertical-bottom")return`M ${m} ${l} L ${m} ${a}`;if(f.style==="rounded")return`M ${m} ${l} C ${m} ${a}, ${g} ${a}, ${g} ${a}`;{const v=a*.75;return`M ${m} ${l} L ${m} ${v} L ${g} ${a}`}}const h=N(()=>e.rowData?c(e.rowData.lane):i);return(f,m)=>(O(),b("svg",{width:p(o),height:p(a),class:"block flex-shrink-0","aria-hidden":"true"},[r.rowData?(O(),b(ye,{key:0},[(O(!0),b(ye,null,Ne(r.rowData.connections,(g,v)=>(O(),b("path",{key:v,d:u(g),stroke:g.color,"stroke-width":"2",fill:"none","stroke-dasharray":g.type.startsWith("merge")?"4 3":"none"},null,8,Wb))),128)),d("g",null,[r.tooltipText?(O(),b("title",jb,_(r.tooltipText),1)):X("",!0),r.rowData.nodeType==="head"?(O(),b(ye,{key:1},[d("circle",{cx:p(h),cy:l,r:p(s)+2,fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-cyan"},null,8,qb),d("circle",{cx:p(h),cy:l,r:p(s),fill:r.rowData.color},null,8,Yb)],64)):r.rowData.nodeType==="merge"?(O(),b(ye,{key:2},[d("circle",{cx:p(h),cy:l,r:p(s)+1,fill:"none",stroke:r.rowData.color,"stroke-width":"1.5"},null,8,Fb),d("circle",{cx:p(h),cy:l,r:p(s)-1,fill:r.rowData.color},null,8,Ub)],64)):r.rowData.nodeType==="stash"?(O(),b(ye,{key:3},[d("circle",{cx:p(h),cy:l,r:p(s),fill:"none",stroke:r.rowData.color,"stroke-width":"2"},null,8,Gb),d("circle",{cx:p(h),cy:l,r:p(s)-2,fill:r.rowData.color},null,8,Hb)],64)):r.rowData.nodeType==="uncommitted"?(O(),b("circle",{key:4,cx:p(h),cy:l,r:p(s),fill:"none",stroke:"currentColor","stroke-width":"2",class:"text-retro-yellow","stroke-dasharray":"3 2"},null,8,Kb)):(O(),b("circle",{key:5,cx:p(h),cy:l,r:p(s),fill:r.rowData.color},null,8,Jb))])],64)):X("",!0)],8,Vb))}}),ex=["aria-selected","aria-label"],tx={key:1,class:"flex gap-1 flex-shrink-0"},rx=["title","onContextmenu"],nx={key:2,class:"flex gap-1 flex-shrink-0"},sx=["onContextmenu"],ix={class:"text-retro-text text-xs truncate flex-1"},ox={key:5,class:"flex-shrink-0 text-retro-muted text-[10px] hidden sm:inline"},ax={key:6,class:"flex-shrink-0 text-retro-muted text-[10px]"},lx=Be({__name:"GitCommitRow",props:{commit:{},index:{},isSelected:{type:Boolean},isHighlighted:{type:Boolean},isBranchHighlighted:{type:Boolean},isFeatureHighlighted:{type:Boolean},isPreviewHighlighted:{type:Boolean},isMuted:{type:Boolean},currentBranchName:{},localBranchNames:{},graphRowData:{},maxLane:{},columnVisibility:{}},emits:["click","keydown","branchContextMenu","commitContextMenu","tagContextMenu"],setup(r,{emit:e}){const t=r,n=e,s=N(()=>{const f=t.commit.branches;if(f.length===0)return[];const m=t.localBranchNames,g=[],v=[];for(const A of f)m.has(A)?g.push(A):v.push(A);const y=new Set(g),k=new Map,$=[];for(const A of v){const Z=A.indexOf("/");if(Z>0){const Y=A.substring(Z+1),V=A.substring(0,Z);y.has(Y)?(k.has(Y)||k.set(Y,[]),k.get(Y).push(V)):$.push(A)}else $.push(A)}const T=[];for(const A of g){const Z=k.get(A)||[];Z.length>0?T.push({displayName:`${A}/${Z.join(",")}`,originalBranches:[A,...Z.map(Y=>`${Y}/${A}`)],isLocal:!0}):T.push({displayName:A,originalBranches:[A],isLocal:!0})}for(const A of $)T.push({displayName:A,originalBranches:[A],isLocal:!1});return T});function i(f,m){f.preventDefault(),f.stopPropagation();const g=m.originalBranches[0];n("branchContextMenu",{branch:g,x:f.clientX,y:f.clientY,isCurrentBranch:m.isLocal&&m.originalBranches.includes(t.currentBranchName??""),isLocal:m.isLocal})}function o(f,m){f.preventDefault(),f.stopPropagation(),n("tagContextMenu",{tag:m,x:f.clientX,y:f.clientY})}function a(f){f.preventDefault(),f.stopPropagation(),n("commitContextMenu",{x:f.clientX,y:f.clientY})}const{ROW_HEIGHT:l}=_l,c=N(()=>{const f=[t.commit.shortHash];return t.commit.branches.length>0&&f.push(t.commit.branches.join(", ")),t.commit.tags.length>0&&f.push(t.commit.tags.map(m=>`tag: ${m}`).join(", ")),f.join(" — ")});function u(f){const g=Date.now()/1e3-f;return g<60?"just now":g<3600?`${Math.floor(g/60)}m ago`:g<86400?`${Math.floor(g/3600)}h ago`:g<604800?`${Math.floor(g/86400)}d ago`:g<2592e3?`${Math.floor(g/604800)}w ago`:new Date(f*1e3).toLocaleDateString("en-US",{month:"short",day:"numeric",year:"numeric"})}function h(f){const m=f.split(`
3
3
  `)[0];return m.length>72?m.substring(0,69)+"...":m}return(f,m)=>{const g=og;return O(),b("div",{class:Ce(["flex items-center cursor-pointer group focus:outline-none focus:ring-1 focus:ring-retro-cyan/50 focus:ring-inset",{"opacity-40":r.isMuted,"bg-retro-red/10":r.isPreviewHighlighted,"bg-retro-yellow/20":r.isFeatureHighlighted&&!r.isPreviewHighlighted}]),style:xr({height:`${p(l)}px`}),role:"row",tabindex:"0","aria-selected":r.isSelected,"aria-label":`Commit ${r.commit.shortHash} by ${r.commit.author}: ${r.commit.message.split(`
4
4
  `)[0]}`,onClick:m[0]||(m[0]=v=>n("click",v)),onKeydown:m[1]||(m[1]=v=>n("keydown",v)),onContextmenu:a},[te(g,{rowData:r.graphRowData,maxLane:r.maxLane,tooltipText:p(c)},null,8,["rowData","maxLane","tooltipText"]),d("div",{class:Ce(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-red/10 border-l-2 border-retro-red/40":r.isPreviewHighlighted,"bg-retro-yellow/30 border-l-2 border-retro-yellow":r.isFeatureHighlighted&&!r.isPreviewHighlighted,"bg-retro-cyan/15":r.isSelected&&!r.isFeatureHighlighted&&!r.isPreviewHighlighted,"bg-retro-yellow/10":r.isHighlighted&&!r.isSelected&&!r.isFeatureHighlighted&&!r.isPreviewHighlighted,"bg-retro-cyan/5":r.isBranchHighlighted&&!r.isSelected&&!r.isHighlighted&&!r.isFeatureHighlighted&&!r.isPreviewHighlighted,"group-hover:bg-retro-panel/50":!r.isSelected&&!r.isHighlighted&&!r.isFeatureHighlighted&&!r.isPreviewHighlighted&&!r.isBranchHighlighted}]),style:xr({height:`${p(l)-4}px`})},[!r.columnVisibility||r.columnVisibility.commit!==!1?(O(),b("span",{key:0,class:Ce(["flex-shrink-0 font-mono text-[11px]",r.commit.isHead?"text-retro-cyan font-semibold":"text-retro-muted"])},_(r.commit.shortHash),3)):X("",!0),p(s).length>0?(O(),b("div",tx,[(O(!0),b(ye,null,Ne(p(s),v=>(O(),b("span",{key:v.displayName,class:Ce(["px-1.5 py-0.5 text-[10px] rounded font-semibold leading-none cursor-context-menu hover:ring-1 hover:ring-retro-cyan/50",r.commit.isHead&&v.isLocal?"bg-retro-cyan/20 text-retro-cyan border border-retro-cyan/40":r.isPreviewHighlighted?"bg-retro-red/10 text-retro-red border border-retro-red/40":r.isFeatureHighlighted?"bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/30":r.isBranchHighlighted?"bg-retro-cyan/15 text-retro-cyan/80 border border-retro-cyan/30":v.isLocal?"bg-retro-green/15 text-retro-green border border-retro-green/30":"bg-retro-orange/15 text-retro-orange border border-retro-orange/30"]),title:v.originalBranches.join(", "),onContextmenu:y=>i(y,v)},_(v.displayName),43,rx))),128))])):X("",!0),r.commit.tags.length>0?(O(),b("div",nx,[(O(!0),b(ye,null,Ne(r.commit.tags,v=>(O(),b("span",{key:v,class:"px-1 py-0.5 text-[10px] rounded-sm bg-retro-yellow/15 text-retro-yellow border border-retro-yellow/25 flex items-center gap-0.5 leading-none cursor-context-menu hover:ring-1 hover:ring-retro-yellow/50",onContextmenu:y=>o(y,v)},[te(p(bh),{class:"w-2.5 h-2.5"}),Le(" "+_(v),1)],40,sx))),128))])):X("",!0),d("span",ix,_(h(r.commit.message)),1),r.commit.signatureStatus==="good"?(O(),ge(p(ig),{key:3,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-green",title:"Verified signature"})):r.commit.signatureStatus==="bad"?(O(),ge(p(vh),{key:4,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-red",title:"Bad signature"})):X("",!0),!r.columnVisibility||r.columnVisibility.author!==!1?(O(),b("span",ox,_(r.commit.author),1)):X("",!0),!r.columnVisibility||r.columnVisibility.date!==!1?(O(),b("span",ax,_(u(r.commit.timestamp)),1)):X("",!0)],6)],46,ex)}}});function cx(){const{COLUMN_WIDTH:r,ROW_HEIGHT:e,NODE_RADIUS:t,PADDING:n}=_l;function s(l){let c=0;for(let u=0;u<l.length;u++){const h=l.charCodeAt(u);c=(c<<5)-c+h,c=c&c}return Math.abs(c)}function i(l){const c=s(l)%Ko.length;return Ko[c]}function o(l,c="rounded"){const u=new Map;if(l.length===0)return u;const h=new Set,f=new Map;for(const T of l)f.set(T.hash,T);const m=l.find(T=>T.isHead)||l[0];if(m){let T=m;for(;T;){h.add(T.hash);const A=T.parents?.[0];T=A?f.get(A):void 0}}const g=new Map,v=new Map,y=new Map,k=new Map,$=new Map;for(let T=0;T<l.length;T++){const A=l[T];$.set(A.hash,T);const Z=h.has(A.hash);let Y,V;if(k.has(A.hash)){const z=k.get(A.hash);Y=z.lane,V=z.color,k.delete(A.hash)}else if(Z)Y=0,V=Ko[0];else{for(Y=1;y.has(Y);)Y++;V=i(A.hash.substring(0,7))}g.set(A.hash,Y),v.set(A.hash,V),y.set(Y,A.hash);const re=A.isMerge||A.parents&&A.parents.length>1;let me="regular";A.isHead?me="head":re&&(me="merge"),u.set(A.hash,{commitHash:A.hash,lane:Y,color:V,nodeType:me,isMainline:h.has(A.hash),connections:[]});const J=A.parents||[];for(let z=0;z<J.length;z++){const L=J[z];if(g.has(L)||k.has(L))continue;const q=h.has(L);let w,x;if(z===0)w=Y,x=V;else if(q)w=0,x=Ko[0];else{for(w=1;y.has(w)||w===Y;)w++;x=i(L.substring(0,7))}k.set(L,{lane:w,color:x,childHash:A.hash})}const W=J[0];if(!W)y.delete(Y);else{const z=g.get(W),L=k.get(W),q=z??L?.lane;q!==void 0&&q!==Y&&y.delete(Y)}}for(let T=0;T<l.length;T++){const A=l[T],Z=u.get(A.hash);if(!Z)continue;const Y=A.parents||[];for(let V=0;V<Y.length;V++){const re=Y[V],me=g.get(re),J=$.get(re);if(me===void 0)continue;const W=Z.lane,z=me,L=V===0?Z.color:v.get(re)||i(re.substring(0,7));if(W===z?Z.connections.push({type:"vertical-bottom",fromLane:W,toLane:z,color:L,style:c}):V>0?Z.connections.push({type:W<z?"merge-out":"merge-in",fromLane:W,toLane:z,color:L,style:c}):Z.connections.push({type:W<z?"branch-out":"branch-in",fromLane:W,toLane:z,color:L,style:c}),J!==void 0&&J>T+1)for(let q=T+1;q<J;q++){const w=l[q],x=u.get(w.hash);x&&x.connections.push({type:"vertical",fromLane:z,toLane:z,color:L,style:c})}if(J!==void 0){const q=u.get(re);q&&q.connections.push({type:"vertical-top",fromLane:z,toLane:z,color:L,style:c})}}}return u}function a(l){let c=0;for(const u of l.values()){u.lane>c&&(c=u.lane);for(const h of u.connections)h.fromLane>c&&(c=h.fromLane),h.toLane>c&&(c=h.toLane)}return c}return{computeGraphRows:o,computeMaxLane:a,getBranchColor:i,COLUMN_WIDTH:r,ROW_HEIGHT:e,NODE_RADIUS:t,PADDING:n}}const ux=["aria-selected"],hx={class:"text-retro-yellow text-xs font-medium"},dx={key:1,class:"flex items-center justify-center gap-2 p-2 text-retro-muted text-sm"},fx={key:2,class:"p-2 text-center text-retro-muted/50 text-xs"},px=Be({__name:"GitCommitList",props:{commits:{},stashes:{},selectedCommit:{},hasMore:{type:Boolean},loading:{type:Boolean},loadingMore:{type:Boolean},searchQuery:{},uncommittedChangesCount:{},isUncommittedChangesSelected:{type:Boolean},highlightBranches:{},featureHighlightBranches:{},featureMergeBases:{},previewHighlightBranches:{},previewMergeBases:{},currentBranchName:{},localBranchNames:{},graphStyle:{default:"rounded"},muteNonAncestral:{type:Boolean},columnVisibility:{}},emits:["select","compareSelect","loadMore","branchContextMenu","commitContextMenu","tagContextMenu","stashContextMenu","selectUncommittedChanges","scrollStart","scrollEnd"],setup(r,{expose:e,emit:t}){const n=r,s=t;function i(){s("selectUncommittedChanges")}function o(ce){(ce.key==="Enter"||ce.key===" ")&&(ce.preventDefault(),s("selectUncommittedChanges"))}const a=N(()=>n.searchQuery?.toLowerCase()??""),l=N(()=>new Set(n.highlightBranches??[])),c=N(()=>l.value.size>0),u=N(()=>{const ce=a.value;if(!ce)return new Set;const K=new Set;for(const oe of n.commits)(oe.message.toLowerCase().includes(ce)||oe.author.toLowerCase().includes(ce)||oe.shortHash.toLowerCase().includes(ce)||oe.hash.toLowerCase().includes(ce)||oe.branches.some(ae=>ae.toLowerCase().includes(ce))||oe.tags.some(ae=>ae.toLowerCase().includes(ce)))&&K.add(oe.hash);return K}),h=N(()=>{if(!c.value)return new Set;const ce=new Set;for(const K of n.commits)K.branches.some(oe=>l.value.has(oe))&&ce.add(K.hash);return ce}),f=N(()=>{if(!n.featureHighlightBranches||n.featureHighlightBranches.length===0)return new Set;const ce=n.featureMergeBases??{},K=new Map;for(const ae of n.commits)K.set(ae.hash,ae);const oe=new Set;for(const ae of n.featureHighlightBranches){const ee=n.commits.find(Xe=>Xe.branches.includes(ae));if(!ee)continue;const ue=ce[ae]??null;if(!ue)continue;let pe=ee;for(;pe&&pe.hash!==ue;)oe.add(pe.hash),pe=pe.parents?.[0]?K.get(pe.parents[0]):void 0}return oe}),m=N(()=>{if(!n.previewHighlightBranches||n.previewHighlightBranches.length===0)return new Set;const ce=n.previewMergeBases??{},K=new Map;for(const ae of n.commits)K.set(ae.hash,ae);const oe=new Set;for(const ae of n.previewHighlightBranches){const ee=n.commits.find(Xe=>Xe.branches.includes(ae));if(!ee)continue;const ue=ce[ae]??null;if(!ue)continue;let pe=ee;for(;pe&&pe.hash!==ue;)oe.add(pe.hash),pe=pe.parents?.[0]?K.get(pe.parents[0]):void 0}return oe});function g(ce,K){s("branchContextMenu",{...K,commitHash:ce.hash})}function v(ce,K){s("commitContextMenu",{commit:ce,...K})}function y(ce,K){s("tagContextMenu",{...K,commitHash:ce.hash})}const{ROW_HEIGHT:k,VISIBLE_BUFFER:$}=_l,{computeGraphRows:T,computeMaxLane:A}=cx(),Z=N(()=>T([...n.commits],n.graphStyle)),Y=N(()=>A(Z.value)),V=N(()=>{const ce=n.stashes||[];if(ce.length===0)return n.commits.map((ee,ue)=>({type:"commit",commit:ee,commitIndex:ue}));const K=[],oe=[...ce].sort((ee,ue)=>new Date(ue.date).getTime()-new Date(ee.date).getTime());let ae=0;for(let ee=0;ee<n.commits.length;ee++){const ue=n.commits[ee],pe=ue.timestamp*1e3;for(;ae<oe.length&&new Date(oe[ae].date).getTime()>=pe;)K.push({type:"stash",stash:oe[ae]}),ae++;K.push({type:"commit",commit:ue,commitIndex:ee})}for(;ae<oe.length;)K.push({type:"stash",stash:oe[ae]}),ae++;return K}),re=E(null),me=E(0),J=E(400);let W=null;const z=N(()=>{const ce=$,K=V.value.length,oe=Math.max(0,Math.floor(me.value/k)-ce),ae=Math.min(K,Math.ceil((me.value+J.value)/k)+ce);return{startIndex:oe,endIndex:ae}}),L=N(()=>{const{startIndex:ce,endIndex:K}=z.value;return V.value.slice(ce,K).map((oe,ae)=>({row:oe,index:ce+ae,graphRow:oe.type==="commit"&&Z.value.get(oe.commit.hash)||null,isHighlighted:oe.type==="commit"?u.value.has(oe.commit.hash):!1,isBranchHighlighted:oe.type==="commit"?h.value.has(oe.commit.hash):!1,isFeatureHighlighted:oe.type==="commit"?f.value.has(oe.commit.hash):!1,isPreviewHighlighted:oe.type==="commit"?m.value.has(oe.commit.hash):!1,isMuted:oe.type==="commit"&&n.muteNonAncestral?!(Z.value.get(oe.commit.hash)?.isMainline??!1):!1}))}),q=N(()=>V.value.length*k),w=N(()=>z.value.startIndex*k);function x(ce){const K=ce.target;me.value=K.scrollTop,W||s("scrollStart"),W&&clearTimeout(W),W=setTimeout(()=>{W=null,s("scrollEnd")},150),n.hasMore&&!n.loading&&!n.loadingMore&&K.scrollTop+K.clientHeight>=K.scrollHeight-200&&s("loadMore")}function S(ce,K){K.ctrlKey||K.metaKey?s("compareSelect",ce):s("select",ce)}function Q(ce,K,oe){if(ce.key==="Enter"||ce.key===" ")ce.preventDefault(),s("select",K);else if(ce.key==="ArrowDown"){ce.preventDefault();for(let ae=oe+1;ae<V.value.length;ae++){const ee=V.value[ae];if(ee.type==="commit"){s("select",ee.commit),G(ae);break}}}else if(ce.key==="ArrowUp"){ce.preventDefault();for(let ae=oe-1;ae>=0;ae--){const ee=V.value[ae];if(ee.type==="commit"){s("select",ee.commit),G(ae);break}}}}function G(ce){if(!re.value)return;const K=ce*k,oe=re.value.scrollTop,ae=oe+re.value.clientHeight;K<oe?re.value.scrollTop=K:K+k>ae&&(re.value.scrollTop=K+k-re.value.clientHeight)}zt(()=>{if(re.value){J.value=re.value.clientHeight;const ce=new ResizeObserver(K=>{for(const oe of K)J.value=oe.contentRect.height});ce.observe(re.value),Ht(()=>ce.disconnect())}});function H(){return re.value?.scrollTop??0}function fe(ce){re.value&&(re.value.scrollTop=ce)}return e({getScrollPosition:H,setScrollPosition:fe,scrollToIndex:G}),(ce,K)=>{const oe=og,ae=lx;return O(),b("div",{ref_key:"containerRef",ref:re,class:"h-full overflow-auto",role:"list","aria-label":"Commit history",onScroll:x},[r.uncommittedChangesCount&&r.uncommittedChangesCount>0?(O(),b("div",{key:0,class:"flex items-center cursor-pointer group sticky top-0 z-10 bg-retro-dark border-b border-retro-border",style:xr({height:`${p(k)}px`}),role:"button",tabindex:"0","aria-selected":r.isUncommittedChangesSelected,onClick:i,onKeydown:o},[te(oe,{rowData:{commitHash:"uncommitted",lane:0,color:"#F59E0B",nodeType:"uncommitted",isMainline:!1,connections:[]},maxLane:p(Y)},null,8,["maxLane"]),d("div",{class:Ce(["flex-1 flex items-center gap-2 px-2 min-w-0 rounded-r transition-colors",{"bg-retro-yellow/15":r.isUncommittedChangesSelected,"group-hover:bg-retro-panel/50":!r.isUncommittedChangesSelected}]),style:xr({height:`${p(k)-4}px`})},[te(p(Si),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),d("span",hx," Uncommitted Changes ("+_(r.uncommittedChangesCount)+") ",1),K[1]||(K[1]=d("span",{class:"flex-1"},null,-1)),K[2]||(K[2]=d("span",{class:"text-retro-muted text-[10px]"},"Working tree",-1))],6)],44,ux)):X("",!0),d("div",{class:"relative",style:xr({height:`${p(q)}px`})},[d("div",{class:"absolute left-0 right-0",style:xr({transform:`translateY(${p(w)}px)`})},[(O(!0),b(ye,null,Ne(p(L),({row:ee,index:ue,graphRow:pe,isHighlighted:Xe,isBranchHighlighted:nt,isFeatureHighlighted:$t,isPreviewHighlighted:Ot,isMuted:Pt})=>(O(),b(ye,{key:ee.type==="commit"?ee.commit.hash:`stash-${ee.stash.index}`},[ee.type==="commit"?Xm([ee.commit.hash,ee.commit.message,ee.commit.timestamp,ee.commit.branches.join("|"),ee.commit.tags.join("|"),r.selectedCommit?.hash===ee.commit.hash,Xe,nt,$t,Ot,Pt,n.currentBranchName||"",n.columnVisibility?.date!==!1,n.columnVisibility?.author!==!1,n.columnVisibility?.commit!==!1],()=>(O(),ge(ae,{key:0,commit:ee.commit,index:ee.commitIndex,isSelected:r.selectedCommit?.hash===ee.commit.hash,isHighlighted:Xe,isBranchHighlighted:nt,isFeatureHighlighted:$t,isPreviewHighlighted:Ot,isMuted:Pt,currentBranchName:n.currentBranchName,localBranchNames:n.localBranchNames,graphRowData:pe,maxLane:p(Y),columnVisibility:n.columnVisibility,onClick:vt=>S(ee.commit,vt),onKeydown:vt=>Q(vt,ee.commit,ue),onBranchContextMenu:vt=>g(ee.commit,vt),onCommitContextMenu:vt=>v(ee.commit,vt),onTagContextMenu:vt=>y(ee.commit,vt)},null,8,["commit","index","isSelected","isHighlighted","isBranchHighlighted","isFeatureHighlighted","isPreviewHighlighted","isMuted","currentBranchName","localBranchNames","graphRowData","maxLane","columnVisibility","onClick","onKeydown","onBranchContextMenu","onCommitContextMenu","onTagContextMenu"])),K,0):X("",!0)],64))),128))],4)],4),(r.loading||r.loadingMore)&&r.commits.length>0?(O(),b("div",dx,[...K[3]||(K[3]=[d("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),Le(" Loading more commits... ",-1)])])):X("",!0),!r.hasMore&&r.commits.length>0&&!r.loading?(O(),b("div",fx,_(r.commits.length)+" commits loaded ",1)):X("",!0)],544)}}});function mx(r){const e=r.charAt(0).toUpperCase();return e in ui?e:"M"}function Jo(r,e){if(r&&typeof r=="object"){const t=r;if(typeof t.data?.message=="string"&&t.data.message.trim())return t.data.message;if(typeof t.statusMessage=="string"&&t.statusMessage.trim())return t.statusMessage;if(typeof t.message=="string"&&t.message.trim())return t.message}return r instanceof Error&&r.message?r.message:e}function Id(r,e){const t=e.trim().toLowerCase();return t?r.filter(n=>n.message.toLowerCase().includes(t)||n.author.toLowerCase().includes(t)||n.shortHash.includes(t)||n.hash.includes(t)||n.branches.some(s=>s.toLowerCase().includes(t))||n.tags.some(s=>s.toLowerCase().includes(t))):[...r]}function gx(r,e){return e.size===0?[...r]:r.filter(t=>t.branches.some(n=>e.has(n)))}const Ox={class:"flex flex-col h-full border-t border-retro-border bg-retro-dark"},vx={class:"flex items-center justify-between p-2 border-b border-retro-border flex-shrink-0"},bx={class:"flex items-center gap-2 text-xs min-w-0"},xx={class:"font-mono text-retro-cyan"},yx={class:"font-mono text-retro-cyan"},kx={key:0,class:"px-3 py-1.5 text-xs text-retro-muted border-b border-retro-border flex-shrink-0"},wx={class:"text-retro-green"},Sx={class:"text-retro-red"},$x={key:1,class:"flex-1 flex items-center justify-center"},Cx={key:2,class:"flex-1 overflow-auto"},Qx={class:"text-retro-text truncate flex-1"},Px={class:"text-retro-muted"},Tx={key:0,class:"flex-shrink-0 text-[10px] font-mono"},Mx={key:0,class:"text-retro-green"},Ax={key:1,class:"text-retro-red ml-1"},_x={key:1,class:"flex-shrink-0 text-[10px] text-retro-muted italic"},Rx={key:3,class:"flex-1 flex items-center justify-center text-retro-muted text-sm"},Ex=Be({__name:"GitComparisonView",props:{fromCommit:{},toCommit:{},files:{},stats:{},loading:{type:Boolean}},emits:["close"],setup(r,{emit:e}){const t=e;function n(s){const i=mx(s);return ui[i]||ui.M}return(s,i)=>(O(),b("div",Ox,[d("div",vx,[d("div",bx,[i[1]||(i[1]=d("span",{class:"text-retro-muted"},"Comparing",-1)),d("span",xx,_(r.fromCommit.shortHash),1),i[2]||(i[2]=d("span",{class:"text-retro-muted"},"→",-1)),d("span",yx,_(r.toCommit.shortHash),1)]),d("button",{class:"p-1 text-retro-muted hover:text-retro-text transition-colors flex-shrink-0","aria-label":"Close comparison",onClick:i[0]||(i[0]=o=>t("close"))},[te(p(ir),{class:"w-4 h-4"})])]),r.stats?(O(),b("div",kx,[Le(_(r.stats.filesChanged)+" file"+_(r.stats.filesChanged!==1?"s":"")+" changed, ",1),d("span",wx,"+"+_(r.stats.additions),1),d("span",Sx," -"+_(r.stats.deletions),1)])):X("",!0),r.loading?(O(),b("div",$x,[...i[3]||(i[3]=[d("div",{class:"flex items-center gap-2 text-retro-muted text-sm"},[d("div",{class:"w-4 h-4 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"}),Le(" Loading comparison... ")],-1)])])):r.files&&r.files.length>0?(O(),b("div",Cx,[(O(!0),b(ye,null,Ne(r.files,o=>(O(),b("div",{key:o.path,class:"flex items-center gap-2 px-3 py-1.5 hover:bg-retro-panel/50 text-xs border-b border-retro-border/50"},[d("span",{class:Ce(["flex-shrink-0 w-4 text-center font-semibold text-[10px]",n(o.status).colorClass])},_(o.status.charAt(0)),3),d("span",Qx,[o.oldPath&&o.status.startsWith("R")?(O(),b(ye,{key:0},[d("span",Px,_(o.oldPath),1),i[4]||(i[4]=d("span",{class:"text-retro-muted mx-1"},"→",-1))],64)):X("",!0),Le(" "+_(o.path),1)]),o.binary?(O(),b("span",_x,"binary")):(O(),b("span",Tx,[o.additions>0?(O(),b("span",Mx,"+"+_(o.additions),1)):X("",!0),o.deletions>0?(O(),b("span",Ax,"-"+_(o.deletions),1)):X("",!0)]))]))),128))])):r.files&&r.files.length===0?(O(),b("div",Rx," No differences between these commits ")):X("",!0)]))}});function xh(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var js=xh();function ag(r){js=r}var eo={exec:()=>null};function pt(r,e=""){let t=typeof r=="string"?r:r.source;const n={replace:(s,i)=>{let o=typeof i=="string"?i:i.source;return o=o.replace(yr.caret,"$1"),t=t.replace(s,o),n},getRegex:()=>new RegExp(t,e)};return n}var yr={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceTabs:/^\t+/,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] /,listReplaceTask:/^\[[ xX]\] +/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,unescapeTest:/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:r=>new RegExp(`^( {0,3}${r})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`),hrRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`),fencesBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}(?:\`\`\`|~~~)`),headingBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}#`),htmlBeginRegex:r=>new RegExp(`^ {0,${Math.min(3,r-1)}}<(?:[a-z].*>|!--)`,"i")},Bx=/^(?:[ \t]*(?:\n|$))+/,Lx=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,Dx=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,Eo=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,Zx=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,yh=/(?:[*+-]|\d{1,9}[.)])/,lg=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,cg=pt(lg).replace(/bull/g,yh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),Ix=pt(lg).replace(/bull/g,yh).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),kh=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/,Xx=/^[^\n]+/,wh=/(?!\s*\])(?:\\.|[^\[\]\\])+/,zx=pt(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",wh).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),Nx=pt(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g,yh).getRegex(),Rl="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Sh=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,Vx=pt("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Sh).replace("tag",Rl).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),ug=pt(kh).replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Rl).getRegex(),Wx=pt(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",ug).getRegex(),$h={blockquote:Wx,code:Lx,def:zx,fences:Dx,heading:Zx,hr:Eo,html:Vx,lheading:cg,list:Nx,newline:Bx,paragraph:ug,table:eo,text:Xx},Xd=pt("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Rl).getRegex(),jx={...$h,lheading:Ix,table:Xd,paragraph:pt(kh).replace("hr",Eo).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Xd).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Rl).getRegex()},qx={...$h,html:pt(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Sh).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:eo,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:pt(kh).replace("hr",Eo).replace("heading",` *#{1,6} *[^
5
5
  ]`).replace("lheading",cg).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Yx=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Fx=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,hg=/^( {2,}|\\)\n(?!\s*$)/,Ux=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,El=/[\p{P}\p{S}]/u,Ch=/[\s\p{P}\p{S}]/u,dg=/[^\s\p{P}\p{S}]/u,Gx=pt(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,Ch).getRegex(),fg=/(?!~)[\p{P}\p{S}]/u,Hx=/(?!~)[\s\p{P}\p{S}]/u,Kx=/(?:[^\s\p{P}\p{S}]|~)/u,Jx=/\[[^[\]]*?\]\((?:\\.|[^\\\(\)]|\((?:\\.|[^\\\(\)])*\))*\)|`[^`]*?`|<[^<>]*?>/g,pg=/^(?:\*+(?:((?!\*)punct)|[^\s*]))|^_+(?:((?!_)punct)|([^\s_]))/,ey=pt(pg,"u").replace(/punct/g,El).getRegex(),ty=pt(pg,"u").replace(/punct/g,fg).getRegex(),mg="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",ry=pt(mg,"gu").replace(/notPunctSpace/g,dg).replace(/punctSpace/g,Ch).replace(/punct/g,El).getRegex(),ny=pt(mg,"gu").replace(/notPunctSpace/g,Kx).replace(/punctSpace/g,Hx).replace(/punct/g,fg).getRegex(),sy=pt("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,dg).replace(/punctSpace/g,Ch).replace(/punct/g,El).getRegex(),iy=pt(/\\(punct)/,"gu").replace(/punct/g,El).getRegex(),oy=pt(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),ay=pt(Sh).replace("(?:-->|$)","-->").getRegex(),ly=pt("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",ay).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),qa=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,cy=pt(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]*(?:\n[ \t]*)?)(title))?\s*\)/).replace("label",qa).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]*/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),gg=pt(/^!?\[(label)\]\[(ref)\]/).replace("label",qa).replace("ref",wh).getRegex(),Og=pt(/^!?\[(ref)\](?:\[\])?/).replace("ref",wh).getRegex(),uy=pt("reflink|nolink(?!\\()","g").replace("reflink",gg).replace("nolink",Og).getRegex(),Qh={_backpedal:eo,anyPunctuation:iy,autolink:oy,blockSkip:Jx,br:hg,code:Fx,del:eo,emStrongLDelim:ey,emStrongRDelimAst:ry,emStrongRDelimUnd:sy,escape:Yx,link:cy,nolink:Og,punctuation:Gx,reflink:gg,reflinkSearch:uy,tag:ly,text:Ux,url:eo},hy={...Qh,link:pt(/^!?\[(label)\]\((.*?)\)/).replace("label",qa).getRegex(),reflink:pt(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",qa).getRegex()},ru={...Qh,emStrongRDelimAst:ny,emStrongLDelim:ty,url:pt(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,"i").replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\.|[^\\])*?(?:\\.|[^\s~\\]))\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/},dy={...ru,br:pt(hg).replace("{2,}","*").getRegex(),text:pt(ru.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},ea={normal:$h,gfm:jx,pedantic:qx},Ei={normal:Qh,gfm:ru,breaks:dy,pedantic:hy},fy={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},zd=r=>fy[r];function Sn(r,e){if(e){if(yr.escapeTest.test(r))return r.replace(yr.escapeReplace,zd)}else if(yr.escapeTestNoEncode.test(r))return r.replace(yr.escapeReplaceNoEncode,zd);return r}function Nd(r){try{r=encodeURI(r).replace(yr.percentDecode,"%")}catch{return null}return r}function Vd(r,e){const t=r.replace(yr.findPipe,(i,o,a)=>{let l=!1,c=o;for(;--c>=0&&a[c]==="\\";)l=!l;return l?"|":" |"}),n=t.split(yr.splitPipe);let s=0;if(n[0].trim()||n.shift(),n.length>0&&!n.at(-1)?.trim()&&n.pop(),e)if(n.length>e)n.splice(e);else for(;n.length<e;)n.push("");for(;s<n.length;s++)n[s]=n[s].trim().replace(yr.slashPipe,"|");return n}function Bi(r,e,t){const n=r.length;if(n===0)return"";let s=0;for(;s<n&&r.charAt(n-s-1)===e;)s++;return r.slice(0,n-s)}function py(r,e){if(r.indexOf(e[1])===-1)return-1;let t=0;for(let n=0;n<r.length;n++)if(r[n]==="\\")n++;else if(r[n]===e[0])t++;else if(r[n]===e[1]&&(t--,t<0))return n;return t>0?-2:-1}function Wd(r,e,t,n,s){const i=e.href,o=e.title||null,a=r[1].replace(s.other.outputLinkReplace,"$1");n.state.inLink=!0;const l={type:r[0].charAt(0)==="!"?"image":"link",raw:t,href:i,title:o,text:a,tokens:n.inlineTokens(a)};return n.state.inLink=!1,l}function my(r,e,t){const n=r.match(t.other.indentCodeCompensation);if(n===null)return e;const s=n[1];return e.split(`
@@ -61,8 +61,8 @@ Please report this to https://github.com/markedjs/marked.`,r){const n="<p>An err
61
61
  `)[0]),1)]),d("div",Yy,[d("button",{onClick:me,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":r.detailPosition==="inline"?"Dock detail to bottom":"Show detail inline",title:r.detailPosition==="inline"?"Dock to bottom":"Show inline"},[r.detailPosition==="inline"?(O(),ge(p(Um),{key:0,class:"w-4 h-4 text-retro-muted hover:text-retro-text"})):(O(),ge(p(Fm),{key:1,class:"w-4 h-4 text-retro-muted hover:text-retro-text"}))],8,Fy),d("button",{onClick:V,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close commit details"},[te(p(ir),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])])]),d("div",Uy,[d("div",Gy,[d("div",Hy,[z[2]||(z[2]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Hash:",-1)),d("code",Ky,_(r.commit.hash),1)]),d("div",Jy,[te(p(tu),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",ek,_(r.commit.author),1),d("span",tk,"<"+_(r.commit.email)+">",1)]),a.value?(O(),b("div",rk,[te(p(tu),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),z[3]||(z[3]=d("span",{class:"text-retro-muted text-xs uppercase mr-1"},"Committer:",-1)),d("span",nk,_(r.committer),1),d("span",sk,"<"+_(r.committerEmail)+">",1)])):X("",!0),d("div",ik,[te(p(Km),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",ok,_(T(r.commit.timestamp)),1)]),r.commit.parents?.length>0?(O(),b("div",ak,[z[4]||(z[4]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Parents:",-1)),d("div",lk,[(O(!0),b(ye,null,Ne(r.commit.parents,L=>(O(),b("button",{key:L,onClick:q=>re(L),class:"text-retro-cyan font-mono text-xs bg-retro-panel px-2 py-0.5 rounded hover:bg-retro-dark hover:text-retro-text transition-colors cursor-pointer focus:outline-none focus:ring-2 focus:ring-retro-cyan",title:`Navigate to parent ${L.substring(0,7)}`},_(L.substring(0,7)),9,ck))),128))])])):X("",!0),r.commit.branches?.length>0?(O(),b("div",uk,[z[5]||(z[5]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Branches:",-1)),d("div",hk,[(O(!0),b(ye,null,Ne(r.commit.branches,L=>(O(),b("span",{key:L,class:"text-retro-green font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},_(L),1))),128))])])):X("",!0),r.commit.tags?.length>0?(O(),b("div",dk,[z[6]||(z[6]=d("span",{class:"text-retro-muted w-20 flex-shrink-0"},"Tags:",-1)),d("div",fk,[(O(!0),b(ye,null,Ne(r.commit.tags,L=>(O(),b("span",{key:L,class:"text-retro-yellow font-mono text-xs bg-retro-panel px-2 py-0.5 rounded"},_(L),1))),128))])])):X("",!0)]),d("div",pk,[z[7]||(z[7]=d("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Message ",-1)),d("div",mk,_(r.commit.message.split(`
62
62
  `)[0]),1)]),r.commit.body?(O(),b("div",gk,[z[8]||(z[8]=d("h4",{class:"text-retro-muted text-xs uppercase tracking-wide"}," Body ",-1)),d("div",{class:"text-retro-text text-sm font-mono bg-retro-panel p-3 rounded commit-body-rendered",innerHTML:l.value},null,8,Ok)])):X("",!0),r.stats?(O(),b("div",vk,[d("div",bk,[d("span",xk,_(c.value),1)]),r.stats.additions>0||r.stats.deletions>0?(O(),b("div",yk,[d("span",kk,"+"+_(r.stats.additions),1),d("div",wk,[d("div",{class:"bg-retro-green h-full transition-all",style:xr({width:Z.value.addPct+"%"})},null,4),d("div",{class:"bg-retro-red h-full transition-all",style:xr({width:Z.value.delPct+"%"})},null,4)]),d("span",Sk,"-"+_(r.stats.deletions),1)])):X("",!0)])):X("",!0),r.files?(O(),b("div",$k,[d("div",Ck,[d("h4",Qk," Files Changed ("+_(r.files.length)+") ",1),d("div",Pk,[d("button",{onClick:z[0]||(z[0]=L=>i.value="flat"),class:Ce(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",i.value==="flat"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Flat file list",title:"Flat file list"},[te(p(ng),{class:"w-4 h-4"})],2),d("button",{onClick:z[1]||(z[1]=L=>i.value="tree"),class:Ce(["p-1 rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan",i.value==="tree"?"bg-retro-panel text-retro-cyan":"text-retro-muted hover:text-retro-text"]),"aria-label":"Tree file view",title:"Tree file view"},[te(p(eu),{class:"w-4 h-4"})],2)])]),r.files.length===0?(O(),b("div",Tk," No files changed in this commit. ")):i.value==="flat"?(O(),b("ul",Mk,[(O(!0),b(ye,null,Ne(r.files,L=>(O(),b("li",{key:L.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group cursor-pointer",onClick:q=>J(L)},[d("span",{class:Ce(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",A(L.status).colorClass]),title:A(L.status).label},_(L.status),11,_k),te(p(ci),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",Rk,[L.status==="R"&&L.oldPath?(O(),b(ye,{key:0},[d("span",Ek,_(L.oldPath),1),z[9]||(z[9]=d("span",{class:"text-retro-yellow mx-1"},"→",-1)),d("span",Bk,_(L.path),1)],64)):(O(),b(ye,{key:1},[Le(_(L.path),1)],64))]),!L.binary&&(L.additions>0||L.deletions>0)?(O(),b("span",Lk,[L.additions>0?(O(),b("span",Dk,"+"+_(L.additions),1)):X("",!0),L.deletions>0?(O(),b("span",Zk,"-"+_(L.deletions),1)):X("",!0)])):L.binary?(O(),b("span",Ik,"binary")):X("",!0)],8,Ak))),128))])):(O(),b("div",Xk,[d("div",{class:"flex items-center gap-2 mb-1"},[d("button",{onClick:k,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Expand all "),z[10]||(z[10]=d("span",{class:"text-retro-muted text-xs"},"|",-1)),d("button",{onClick:$,class:"text-xs text-retro-muted hover:text-retro-text transition-colors"}," Collapse all ")]),(O(!0),b(ye,null,Ne(v.value,L=>(O(),b("div",{key:L.key,class:Ce(["flex items-center gap-1 py-0.5 px-1 hover:bg-retro-panel rounded text-sm cursor-pointer",{"select-none":L.isDirectory}]),style:xr({paddingLeft:L.depth*16+4+"px"}),onClick:q=>L.isDirectory?y(L.fullPath):L.file?J(L.file):void 0},[L.isDirectory?(O(),b(ye,{key:0},[te(p(fh),{class:Ce(["w-3 h-3 text-retro-muted transition-transform flex-shrink-0",{"rotate-90":L.expanded}])},null,8,["class"]),te(p(eu),{class:"w-4 h-4 text-retro-yellow flex-shrink-0"}),d("span",Nk,_(L.name),1)],64)):L.file?(O(),b(ye,{key:1},[d("span",{class:Ce(["flex-shrink-0 w-5 h-5 flex items-center justify-center text-xs font-bold rounded",A(L.file.status).colorClass]),title:A(L.file.status).label},_(L.file.status),11,Vk),te(p(ci),{class:"w-4 h-4 text-retro-muted flex-shrink-0"}),d("span",Wk,[L.file.status==="R"&&L.file.oldPath?(O(),b(ye,{key:0},[d("span",jk,_(L.file.oldPath.split("/").pop()),1),z[11]||(z[11]=d("span",{class:"text-retro-yellow mx-1"},"→",-1)),d("span",qk,_(L.name),1)],64)):(O(),b(ye,{key:1},[Le(_(L.name),1)],64))]),!L.file.binary&&(L.file.additions>0||L.file.deletions>0)?(O(),b("span",Yk,[L.file.additions>0?(O(),b("span",Fk,"+"+_(L.file.additions),1)):X("",!0),L.file.deletions>0?(O(),b("span",Uk,"-"+_(L.file.deletions),1)):X("",!0)])):L.file.binary?(O(),b("span",Gk,"binary")):X("",!0)],64)):X("",!0)],14,zk))),128))]))])):r.loading?(O(),b("div",Hk,[...z[12]||(z[12]=[d("div",{class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),Le(" Loading file changes... ",-1)])])):(O(),b("div",Kk," Failed to load file changes. "))])],544))}}),ew=ki(Jk,[["__scopeId","data-v-29f450ea"]]),tw={class:"flex-1 min-h-0 flex flex-col border-t border-retro-border bg-retro-dark","aria-label":"Uncommitted changes details"},rw={class:"flex-shrink-0 flex items-center justify-between px-4 py-2 border-b border-retro-border bg-retro-panel"},nw={class:"flex items-center gap-2 min-w-0"},sw={class:"text-retro-muted text-sm"},iw={key:0,class:"w-3 h-3 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin",title:"Staging..."},ow={class:"flex-1 overflow-auto p-4 space-y-3"},aw={class:"space-y-2"},lw=["disabled"],cw={class:"space-y-1"},uw={class:"flex items-center justify-between"},hw={class:"text-retro-green text-xs uppercase tracking-wide font-semibold"},dw={key:0,class:"text-retro-muted text-xs py-1"},fw={key:1,class:"space-y-0.5"},pw=["aria-label","onClick"],mw={class:"text-retro-text font-mono text-xs truncate"},gw={class:"space-y-1"},Ow={class:"flex items-center justify-between"},vw={class:"text-retro-yellow text-xs uppercase tracking-wide font-semibold"},bw={key:0,class:"text-retro-muted text-xs py-1"},xw={key:1,class:"space-y-0.5"},yw=["aria-label","onClick"],kw={class:"text-retro-text font-mono text-xs truncate"},ww=Be({__name:"GitUncommittedDetail",props:{stagedFiles:{default:()=>[]},unstagedFiles:{default:()=>[]},isStaging:{type:Boolean,default:!1},isCommitting:{type:Boolean,default:!1}},emits:["close","stageFiles","unstageFiles","stageAll","unstageAll","commit"],setup(r,{emit:e}){const t=r,n=e,s=E(""),i=E(!1),o=N(()=>s.value.trim().length>0&&t.stagedFiles.length>0&&!i.value&&!t.isCommitting);function a(v){return ui[v]||{label:v,colorClass:"text-retro-muted"}}function l(){n("close")}function c(v){n("stageFiles",[v.path])}function u(v){n("unstageFiles",[v.path])}function h(){n("stageAll")}function f(){n("unstageAll")}async function m(){o.value&&(i.value=!0,n("commit",s.value.trim()),s.value="",i.value=!1)}function g(v){(v.metaKey||v.ctrlKey)&&v.key==="Enter"&&(v.preventDefault(),m())}return(v,y)=>(O(),b("section",tw,[d("div",rw,[d("div",nw,[te(p(Si),{class:"w-4 h-4 text-retro-yellow"}),y[1]||(y[1]=d("span",{class:"text-retro-yellow font-semibold text-sm"},"Uncommitted Changes",-1)),d("span",sw,"("+_(r.stagedFiles.length+r.unstagedFiles.length)+" files)",1),t.isStaging?(O(),b("div",iw)):X("",!0)]),d("button",{onClick:l,class:"p-1 hover:bg-retro-dark rounded transition-colors focus:outline-none focus:ring-2 focus:ring-retro-cyan","aria-label":"Close uncommitted changes details"},[te(p(ir),{class:"w-4 h-4 text-retro-muted hover:text-retro-text"})])]),d("div",ow,[d("div",aw,[Ue(d("textarea",{"onUpdate:modelValue":y[0]||(y[0]=k=>ot(s)?s.value=k:null),placeholder:"Commit message...",rows:"3",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none font-mono",onKeydown:g},null,544),[[hr,p(s)]]),d("button",{disabled:!p(o),class:Ce(["w-full px-3 py-1.5 text-sm font-semibold rounded transition-colors disabled:opacity-40 disabled:cursor-not-allowed",p(o)?"bg-retro-green text-retro-dark hover:bg-retro-green/90":"bg-retro-green/30 text-retro-dark"]),onClick:m},_(p(i)||t.isCommitting?"Committing...":`Commit (${r.stagedFiles.length} staged)`),11,lw)]),d("div",cw,[d("div",uw,[d("h4",hw," Staged Changes ("+_(r.stagedFiles.length)+") ",1),r.stagedFiles.length>0?(O(),b("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:f}," Unstage All ")):X("",!0)]),r.stagedFiles.length===0?(O(),b("div",dw," No staged files. Stage files below to commit. ")):(O(),b("ul",fw,[(O(!0),b(ye,null,Ne(r.stagedFiles,k=>(O(),b("li",{key:"staged-"+k.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[d("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-red/20 transition-colors opacity-60 group-hover:opacity-100",title:"Unstage file","aria-label":`Unstage ${k.path}`,onClick:$=>u(k)},[te(p(gb),{class:"w-3.5 h-3.5 text-retro-red"})],8,pw),d("span",{class:Ce(["flex-shrink-0 w-4 text-center text-xs font-bold",a(k.status).colorClass])},_(k.status),3),te(p(ci),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),d("span",mw,_(k.oldPath?`${k.oldPath} → ${k.path}`:k.path),1)]))),128))]))]),d("div",gw,[d("div",Ow,[d("h4",vw," Unstaged Changes ("+_(r.unstagedFiles.length)+") ",1),r.unstagedFiles.length>0?(O(),b("button",{key:0,class:"text-[11px] text-retro-muted hover:text-retro-text transition-colors",onClick:h}," Stage All ")):X("",!0)]),r.unstagedFiles.length===0?(O(),b("div",bw," No unstaged changes. ")):(O(),b("ul",xw,[(O(!0),b(ye,null,Ne(r.unstagedFiles,k=>(O(),b("li",{key:"unstaged-"+k.path,class:"flex items-center gap-2 text-sm py-1 px-2 hover:bg-retro-panel rounded group"},[d("button",{class:"flex-shrink-0 w-5 h-5 flex items-center justify-center rounded hover:bg-retro-green/20 transition-colors opacity-60 group-hover:opacity-100",title:"Stage file","aria-label":`Stage ${k.path}`,onClick:$=>c(k)},[te(p(Tl),{class:"w-3.5 h-3.5 text-retro-green"})],8,yw),d("span",{class:Ce(["flex-shrink-0 w-4 text-center text-xs font-bold",a(k.status).colorClass])},_(k.status),3),te(p(ci),{class:"w-3.5 h-3.5 text-retro-muted flex-shrink-0"}),d("span",kw,_(k.oldPath?`${k.oldPath} → ${k.path}`:k.path),1)]))),128))]))])])]))}}),Sw=["aria-label"],$w={key:0,class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border truncate font-mono"},Cw={key:0,class:"my-1 border-t border-retro-border",role:"separator"},Qw=["aria-disabled","onClick","onMouseenter"],Pw={key:1,class:"w-4 h-4 flex-shrink-0"},Bo=Be({__name:"GitContextMenu",props:{items:{},x:{},y:{},title:{}},emits:["close","action"],setup(r,{emit:e}){const t=r,n=e,s=E(null),i=E(-1),o=N(()=>t.items.map((m,g)=>({item:m,i:g})).filter(({item:m})=>!m.disabled).map(({i:m})=>m));let a=!1;function l(m){a&&s.value&&!s.value.contains(m.target)&&n("close")}zt(()=>{requestAnimationFrame(()=>{a=!0}),document.addEventListener("mousedown",l),document.addEventListener("contextmenu",l),tn(()=>{s.value?.focus()})}),Ht(()=>{a=!1,document.removeEventListener("mousedown",l),document.removeEventListener("contextmenu",l)});function c(m){const g=o.value;if(g.length===0)return;if(i.value===-1){i.value=m===1?g[0]:g[g.length-1];return}const v=g.indexOf(i.value);if(v===-1){i.value=m===1?g[0]:g[g.length-1];return}const y=v+m;y>=0&&y<g.length&&(i.value=g[y])}function u(m){switch(m.key){case"Escape":m.preventDefault(),n("close");break;case"ArrowDown":m.preventDefault(),c(1);break;case"ArrowUp":m.preventDefault(),c(-1);break;case"Enter":{m.preventDefault();const g=t.items[i.value];g&&!g.disabled&&(n("action",g.key),n("close"));break}}}function h(m){m.disabled||(n("action",m.key),n("close"))}const f=N(()=>{const g=t.title?29:0,v=t.items.filter(Z=>Z.separator).length,y=t.items.length*36+v*9+8,k=g+y,$=8;let T=t.x,A=t.y;return typeof window<"u"&&(T+220>window.innerWidth-$&&(T=window.innerWidth-220-$),T<$&&(T=$),A+k>window.innerHeight-$&&(A=window.innerHeight-k-$),A<$&&(A=$)),{left:`${T}px`,top:`${A}px`}});return(m,g)=>(O(),ge(hn,{to:"body"},[d("div",{ref_key:"menuRef",ref:s,class:"fixed z-50 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px]",style:xr(p(f)),role:"menu","aria-label":r.title??"Context menu",tabindex:"-1",onKeydown:u},[r.title?(O(),b("div",$w,_(r.title),1)):X("",!0),(O(!0),b(ye,null,Ne(r.items,(v,y)=>(O(),b(ye,{key:v.key},[v.separator?(O(),b("div",Cw)):X("",!0),d("button",{class:Ce(["w-full flex items-center gap-2 px-3 py-2 text-sm transition-colors focus:outline-none",[v.disabled?"text-retro-muted/50 cursor-not-allowed":v.danger?["text-retro-red hover:bg-retro-red/10 focus:bg-retro-red/10",p(i)===y?"bg-retro-red/10":""]:["text-retro-text hover:bg-retro-cyan/10 focus:bg-retro-cyan/10",p(i)===y?"bg-retro-cyan/10":""]]]),role:"menuitem","aria-disabled":v.disabled||void 0,tabindex:-1,onClick:k=>h(v),onMouseenter:k=>i.value=v.disabled?p(i):y,onMouseleave:g[0]||(g[0]=k=>i.value=-1)},[v.icon?(O(),ge(ai(v.icon),{key:0,class:Ce(["w-4 h-4 flex-shrink-0",v.disabled?"opacity-50":v.danger?"":"text-retro-muted"])},null,8,["class"])):(O(),b("span",Pw)),Le(" "+_(v.label),1)],42,Qw)],64))),128))],44,Sw)]))}}),Tw=Be({__name:"GitBranchMenu",props:{branchName:{},isCurrentBranch:{type:Boolean},isLocal:{type:Boolean},x:{},y:{}},emits:["close","checkout","createBranch","deleteBranch","rename","merge","rebase","push","pull","fetch","copyName"],setup(r,{emit:e}){const t=r,n=e,s=N(()=>[{key:"checkout",label:"Checkout",icon:Zs,disabled:t.isCurrentBranch},{key:"rename",label:"Rename",icon:sg,separator:!0},{key:"deleteBranch",label:"Delete",icon:Gn,danger:!0,disabled:t.isCurrentBranch},{key:"merge",label:"Merge into Current",icon:Gm,separator:!0,disabled:t.isCurrentBranch},{key:"rebase",label:"Rebase Current Onto",icon:jm,disabled:t.isCurrentBranch},{key:"push",label:"Push",icon:qm,separator:!0},{key:"copyName",label:"Copy Branch Name",icon:li,separator:!0}]),i=N(()=>[{key:"checkout",label:"Checkout",icon:Zs},{key:"deleteBranch",label:"Delete Remote Branch",icon:Gn,separator:!0,danger:!0},{key:"fetch",label:"Fetch",icon:Jm,separator:!0},{key:"pull",label:"Pull into Current",icon:Hv},{key:"copyName",label:"Copy Branch Name",icon:li,separator:!0}]),o=N(()=>t.isLocal?s.value:i.value),a={checkout:()=>n("checkout"),createBranch:()=>n("createBranch"),deleteBranch:()=>n("deleteBranch"),rename:()=>n("rename"),merge:()=>n("merge"),rebase:()=>n("rebase"),push:()=>n("push"),pull:()=>n("pull"),fetch:()=>n("fetch"),copyName:()=>n("copyName")};function l(c){const u=a[c];u&&u(),n("close")}return(c,u)=>{const h=Bo;return O(),ge(h,{items:p(o),x:r.x,y:r.y,title:r.branchName,onAction:l,onClose:u[0]||(u[0]=f=>n("close"))},null,8,["items","x","y","title"])}}}),Mw=Be({__name:"GitCommitMenu",props:{commit:{},x:{},y:{}},emits:["close","addTag","createBranch","checkout","cherryPick","revert","mergeInto","reset","copyHash","copySubject"],setup(r,{emit:e}){const t=e,n=N(()=>[{key:"addTag",label:"Add Tag",icon:bh},{key:"createBranch",label:"Create Branch",icon:Tl},{key:"checkout",label:"Checkout (detached HEAD)",icon:Zs,separator:!0},{key:"cherryPick",label:"Cherry Pick",icon:lb},{key:"revert",label:"Revert",icon:Ym},{key:"mergeInto",label:"Merge into Current",icon:Gm,separator:!0},{key:"reset",label:"Reset Current Branch to Here",icon:jm,danger:!0},{key:"copyHash",label:"Copy Commit Hash",icon:li,separator:!0},{key:"copySubject",label:"Copy Commit Subject",icon:li}]),s={addTag:()=>t("addTag"),createBranch:()=>t("createBranch"),checkout:()=>t("checkout"),cherryPick:()=>t("cherryPick"),revert:()=>t("revert"),mergeInto:()=>t("mergeInto"),reset:()=>t("reset"),copyHash:()=>t("copyHash"),copySubject:()=>t("copySubject")};function i(o){const a=s[o];a&&a(),t("close")}return(o,a)=>{const l=Bo;return O(),ge(l,{items:p(n),x:r.x,y:r.y,title:r.commit.shortHash,onAction:i,onClose:a[0]||(a[0]=c=>t("close"))},null,8,["items","x","y","title"])}}}),Aw=Be({__name:"GitTagMenu",props:{tagName:{},x:{},y:{}},emits:["close","viewDetails","deleteTag","pushTag","copyName"],setup(r,{emit:e}){const t=e,n=[{key:"viewDetails",label:"View Details",icon:bh},{key:"deleteTag",label:"Delete Tag",icon:Gn,separator:!0,danger:!0},{key:"pushTag",label:"Push Tag",icon:qm},{key:"copyName",label:"Copy Tag Name",icon:li,separator:!0}];function s(i){switch(i){case"viewDetails":t("viewDetails");break;case"deleteTag":t("deleteTag");break;case"pushTag":t("pushTag");break;case"copyName":t("copyName");break}}return(i,o)=>{const a=Bo;return O(),ge(a,{items:n,x:r.x,y:r.y,title:r.tagName,onClose:o[0]||(o[0]=l=>t("close")),onAction:s},null,8,["x","y","title"])}}}),_w=Be({__name:"GitStashMenu",props:{stashIndex:{},stashMessage:{},x:{},y:{}},emits:["close","apply","pop","drop","createBranch","copyName","copyHash"],setup(r,{emit:e}){const t=e,n=[{key:"apply",label:"Apply Stash",icon:Gv},{key:"pop",label:"Pop Stash",icon:Ym},{key:"createBranch",label:"Create Branch from Stash",icon:Jc,separator:!0},{key:"drop",label:"Drop Stash",icon:Gn,separator:!0,danger:!0},{key:"copyName",label:"Copy Stash Reference",icon:li,separator:!0},{key:"copyHash",label:"Copy Stash Hash",icon:fb}];function s(i){switch(i){case"apply":t("apply");break;case"pop":t("pop");break;case"drop":t("drop");break;case"createBranch":t("createBranch");break;case"copyName":t("copyName");break;case"copyHash":t("copyHash");break}}return(i,o)=>{const a=Bo;return O(),ge(a,{items:n,x:r.x,y:r.y,title:r.stashMessage,onClose:o[0]||(o[0]=l=>t("close")),onAction:s},null,8,["x","y","title"])}}}),Rw=Be({__name:"GitUncommittedMenu",props:{x:{},y:{}},emits:["close","stash","reset","clean"],setup(r,{emit:e}){const t=e,n=[{key:"stash",label:"Stash Uncommitted Changes",icon:Uv},{key:"reset",label:"Reset Working Directory",icon:Zs,separator:!0,danger:!0},{key:"clean",label:"Clean Untracked Files",icon:Gn,danger:!0}];function s(i){switch(i){case"stash":t("stash");break;case"reset":t("reset");break;case"clean":t("clean");break}}return(i,o)=>{const a=Bo;return O(),ge(a,{items:n,x:r.x,y:r.y,title:"Uncommitted Changes",onClose:o[0]||(o[0]=l=>t("close")),onAction:s},null,8,["x","y"])}}}),Ew={class:"w-full max-w-md mx-4 bg-retro-dark border border-retro-border rounded-lg shadow-xl"},Bw={class:"flex items-center justify-between px-4 py-3 border-b border-retro-border"},Lw={class:"text-sm font-mono text-retro-text"},Dw={class:"p-4"},Zw={key:0,class:"mb-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},Iw={class:"flex justify-end gap-2 px-4 py-3 border-t border-retro-border"},Xw=["disabled"],zw=["disabled"],$r=Be({__name:"GitDialog",props:{title:{},visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null},confirmLabel:{default:"Confirm"},confirmDanger:{type:Boolean,default:!1},cancelLabel:{default:"Cancel"}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e;function s(i){i.key==="Escape"&&n("close"),i.key==="Enter"&&!t.loading&&(i.preventDefault(),n("confirm"))}return ze(()=>t.visible,i=>{i?document.addEventListener("keydown",s):document.removeEventListener("keydown",s)}),Ht(()=>{document.removeEventListener("keydown",s)}),(i,o)=>(O(),ge(hn,{to:"body"},[te(Un,{"enter-active-class":"transition-opacity duration-200","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition-opacity duration-200","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:kt(()=>[r.visible?(O(),b("div",{key:0,class:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",role:"dialog","aria-modal":"true",onClick:o[3]||(o[3]=Gt(a=>n("close"),["self"]))},[d("div",Ew,[d("div",Bw,[d("h3",Lw,_(r.title),1),d("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close",onClick:o[0]||(o[0]=a=>n("close"))},[te(p(ir),{class:"h-4 w-4"})])]),d("div",Dw,[r.error?(O(),b("div",Zw,_(r.error),1)):X("",!0),zm(i.$slots,"default")]),d("div",Iw,[d("button",{type:"button",class:"px-3 py-1.5 text-xs font-mono text-retro-muted hover:text-retro-text bg-retro-panel hover:bg-retro-border rounded transition-colors",disabled:r.loading,onClick:o[1]||(o[1]=a=>n("close"))},_(r.cancelLabel),9,Xw),d("button",{type:"button",class:Ce(["px-3 py-1.5 text-xs font-mono rounded transition-colors disabled:opacity-50 disabled:cursor-not-allowed",[r.confirmDanger?"text-retro-red bg-retro-red/10 border border-retro-red/30 hover:bg-retro-red/20":"text-retro-black bg-retro-cyan hover:bg-retro-cyan/80"]]),disabled:r.loading,onClick:o[2]||(o[2]=a=>n("confirm"))},_(r.loading?"Loading...":r.confirmLabel),11,zw)])])])):X("",!0)]),_:3})]))}}),Bl=hh("gitGraph",()=>{const r=E([]),e=E([]),t=E([]),n=E(new Set),s=E([]),i=E([]),o=E(0),a=E(!1),l=E(null),c=E(null),u=E(null),h=E(!1),f=E(null),m=E(!1),g=E(0),v=E(""),y=E([]),k=E(null),$=E(!1),T=E(!1),A=E(!1),Z=E(!1),Y=E(null);let V=null;function re(j){Y.value=j,V&&clearTimeout(V),V=setTimeout(()=>{Y.value=null},8e3)}function me(){Y.value=null,V&&(clearTimeout(V),V=null)}async function J(j,ne,Ae,ar){if(!k.value)return{success:!1,error:"No working directory set"};try{const bn=await $fetch(j,{method:ar?.method??"POST",body:{workingDirectory:k.value,...ne}});return(ar?.reloadGraph??!0)&&await Or(k.value),{success:!0,data:bn}}catch(bn){const xn=Jo(bn,Ae);return re(xn),{success:!1,error:xn}}}const W=E(null),z=E(!1),L=E(!1),q=E(null),w=E([]),x=E([]),S=E(null),Q=E(null),G=E(null),H=E("inline"),fe=E("list"),ce=E("rounded"),K=E(!1),oe=E({date:!0,author:!0,commit:!0}),ae=E(0),ee=E(0),ue=E(null),pe=E(null),Xe=E(null),nt=E(null),$t=E(null),Ot=E(null),Pt=E(null),vt=E(null),Oe=E(null),de=E(null),_e=E(null),Ze=E(!1),je=new Map,Ge=10,Vt=N(()=>{if(!v.value&&y.value.length===0)return r.value;let j=r.value;if(v.value){const ne=v.value.toLowerCase(),Ae=`${ne}:${r.value.length}`;if(je.has(Ae))j=je.get(Ae);else{if(j=Id(j,ne),je.size>=Ge){const ar=je.keys().next().value;ar&&je.delete(ar)}je.set(Ae,j)}}if(y.value.length>0){const ne=new Set(y.value);j=gx(j,ne)}return j}),ut=N(()=>e.value.find(j=>j.isHead)||null);async function Or(j){k.value=j,h.value=!0,f.value=null;try{const[ne,Ae,ar,bn,xn]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:j}}),$fetch("/api/git/status",{query:{workingDirectory:j}}),$fetch("/api/git/stash",{query:{workingDirectory:j}}).then(is=>is.stashes).catch(()=>[]),$fetch("/api/git/remotes",{query:{workingDirectory:j}}).then(is=>is.remotes).catch(()=>[]),$fetch("/api/git/state",{query:{workingDirectory:j}}).then(is=>is.state).catch(()=>null)]);r.value=ne.commits,e.value=ne.branches,t.value=ne.tags,n.value=new Set(ne.localBranches??[]),m.value=ne.hasMore,g.value=ne.totalCount,s.value=Ae.stagedFiles??[],i.value=Ae.unstagedFiles??[],o.value=(Ae.stagedCount??0)+(Ae.unstagedCount??0),w.value=ar,x.value=bn,q.value=xn,W.value=Date.now(),await I()}catch(ne){const Ae=ne instanceof Error?ne.message:"Failed to load git graph";f.value=Ae,r.value=[],e.value=[],t.value=[],s.value=[],i.value=[],o.value=0,w.value=[],x.value=[]}finally{h.value=!1}}async function Jt(){if(k.value)try{const j=await $fetch("/api/git/status",{query:{workingDirectory:k.value}});s.value=j.stagedFiles??[],i.value=j.unstagedFiles??[],o.value=(j.stagedCount??0)+(j.unstagedCount??0)}catch(j){console.error("Failed to refresh uncommitted changes:",j)}}const er=E(!1);async function Cr(){if(!(!k.value||!m.value||h.value||er.value)){er.value=!0;try{const j=await $fetch("/api/git/log",{query:{workingDirectory:k.value,offset:r.value.length}});r.value=[...r.value,...j.commits],m.value=j.hasMore}catch(j){console.error("Failed to load more commits:",j)}finally{er.value=!1}}}async function Wt(j){if(l.value=j,c.value=null,u.value=null,a.value=!1,$.value=!0,!k.value){$.value=!1;return}try{const ne=await $fetch("/api/git/show",{query:{workingDirectory:k.value,hash:j.hash}});c.value=ne.files,u.value=ne.stats}catch(ne){console.error("Failed to load commit details:",ne),c.value=[],u.value={additions:0,deletions:0,filesChanged:0},re("Failed to load commit details")}finally{$.value=!1}}function Lr(){l.value=null,c.value=null,u.value=null,a.value=!1}function Qr(){l.value=null,u.value=null,c.value=null,a.value=!0}function Dr(j){v.value=j,ae.value=0,fr()}const tr=N(()=>v.value?Id(r.value,v.value).map(j=>j.hash):[]);function fr(){ee.value=tr.value.length}function Zr(){tr.value.length!==0&&(ae.value=(ae.value+1)%tr.value.length,fr(),le())}function F(){tr.value.length!==0&&(ae.value=ae.value<=0?tr.value.length-1:ae.value-1,fr(),le())}function le(){const j=tr.value[ae.value];if(j){const ne=r.value.find(Ae=>Ae.hash===j);ne&&Wt(ne)}}function ie(j){const ne=y.value.indexOf(j);ne===-1?y.value.push(j):y.value.splice(ne,1)}function be(){v.value="",y.value=[]}async function Te(j){if(!k.value)return{success:!1,error:"No working directory set"};Z.value=!0;try{const ne=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:k.value,branchName:j}});return ne.success&&await Or(k.value),{success:ne.success,error:ne.error}}catch(ne){const Ae=ne instanceof Error?ne.message:"Failed to checkout branch";return re(Ae),{success:!1,error:Ae}}finally{Z.value=!1}}async function qe(j,ne){if(!k.value)return{success:!1,error:"No working directory set"};try{const Ae=await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:k.value,branchName:j,createBranch:!0,fromCommit:ne}});return Ae.success&&await Or(k.value),{success:Ae.success,error:Ae.error}}catch(Ae){return{success:!1,error:Ae instanceof Error?Ae.message:"Failed to create branch"}}}async function Ve(j,ne=!1){return J("/api/git/branch",{branchName:j,force:ne},"Failed to delete branch",{method:"DELETE"})}async function st(j){return J("/api/git/branch",{branchName:j,remote:!0},"Failed to delete remote branch",{method:"DELETE"})}async function ws(j){if(!k.value)return{success:!1,error:"No working directory set"};T.value=!0;try{return await $fetch("/api/git/stage",{method:"POST",body:{workingDirectory:k.value,files:j}}),await Jt(),{success:!0}}catch(ne){const Ae=ne instanceof Error?ne.message:"Failed to stage files";return re(Ae),{success:!1,error:Ae}}finally{T.value=!1}}async function an(j){if(!k.value)return{success:!1,error:"No working directory set"};T.value=!0;try{return await $fetch("/api/git/unstage",{method:"POST",body:{workingDirectory:k.value,files:j}}),await Jt(),{success:!0}}catch(ne){const Ae=ne instanceof Error?ne.message:"Failed to unstage files";return re(Ae),{success:!1,error:Ae}}finally{T.value=!1}}async function Zt(j){if(!k.value)return{success:!1,error:"No working directory set"};A.value=!0;try{return await $fetch("/api/git/commit",{method:"POST",body:{workingDirectory:k.value,message:j}}),await Or(k.value),{success:!0}}catch(ne){const Ae=ne instanceof Error?ne.message:"Failed to commit changes";return re(Ae),{success:!1,error:Ae}}finally{A.value=!1}}async function Ss(j,ne){return J("/api/git/branch-rename",{oldName:j,newName:ne},"Failed to rename branch")}async function He(j,ne){return J("/api/git/merge",{branch:j,...ne},"Failed to merge branch")}async function Fr(j){return J("/api/git/rebase",{onto:j},"Failed to rebase branch")}async function Rt(j,ne,Ae,ar){return J("/api/git/push",{branch:j,remote:ne,force:Ae,forceWithLease:ar},"Failed to push branch")}async function rs(j,ne,Ae,ar){return J("/api/git/pull",{branch:j,remote:ne,noFastForward:Ae,squash:ar},"Failed to pull branch")}async function bt(j,ne,Ae){return J("/api/git/fetch",{branch:j,remote:ne,...Ae},"Failed to fetch")}async function Zn(j,ne,Ae){return J("/api/git/cherry-pick",{hash:j,recordOrigin:ne,noCommit:Ae},"Failed to cherry-pick commit")}async function Et(j){return J("/api/git/revert",{hash:j},"Failed to revert commit")}async function rr(j,ne){return J("/api/git/reset",{hash:j,mode:ne},"Failed to reset to commit")}async function et(j){if(!k.value)return{success:!1,error:"No working directory set"};try{return await $fetch("/api/git/checkout",{method:"POST",body:{workingDirectory:k.value,branchName:j}}),await Or(k.value),{success:!0}}catch(ne){const Ae=ne?.data?.message||ne?.statusMessage||ne?.message||"Failed to checkout commit";return re(Ae),{success:!1,error:Ae}}}async function Pr(j){try{const ne=j.message.split(`
63
63
  `)[0];return await Mi(ne),{success:!0}}catch(ne){const Ae=ne?.message||"Failed to copy commit subject";return re(Ae),{success:!1,error:Ae}}}async function Mt(j,ne,Ae,ar,bn){return J("/api/git/tag",{name:j,hash:ne,annotated:Ae,message:ar,pushToRemote:bn},"Failed to create tag")}async function On(j,ne){return J("/api/git/tag",{name:j,deleteFromRemote:ne},"Failed to delete tag",{method:"DELETE"})}async function At(j,ne){return J("/api/git/tag-push",{name:j,remote:ne},"Failed to push tag")}async function In(j){if(!k.value)return{success:!1,error:"No working directory set"};try{return{success:!0,data:await $fetch(`/api/git/tag/${encodeURIComponent(j)}`,{query:{workingDirectory:k.value}})}}catch(ne){const Ae=Jo(ne,"Failed to get tag detail");return re(Ae),{success:!1,error:Ae}}}async function mt(j){try{return await Mi(j),{success:!0}}catch(ne){const Ae=ne?.message||"Failed to copy tag name";return re(Ae),{success:!1,error:Ae}}}async function ns(){if(!k.value)return{success:!1,error:"No working directory set"};try{const j=await $fetch("/api/git/stash",{query:{workingDirectory:k.value}});return w.value=j.stashes,{success:!0}}catch(j){const ne=Jo(j,"Failed to load stashes");return re(ne),{success:!1,error:ne}}}async function Bt(j,ne){return J("/api/git/stash-apply",{index:j,reinstateIndex:ne},"Failed to apply stash")}async function vn(j,ne){return J("/api/git/stash-pop",{index:j,reinstateIndex:ne},"Failed to pop stash")}async function Lt(j){return J("/api/git/stash-drop",{index:j},"Failed to drop stash")}async function $s(j,ne){return J("/api/git/stash-branch",{index:j,branchName:ne},"Failed to create branch from stash")}async function $e(j,ne){return J("/api/git/stash",{message:j,includeUntracked:ne},"Failed to stash changes")}async function D(){if(!k.value)return{success:!1,error:"No working directory set"};try{const j=await $fetch("/api/git/remotes",{query:{workingDirectory:k.value}});return x.value=j.remotes,{success:!0}}catch(j){const ne=Jo(j,"Failed to load remotes");return re(ne),{success:!1,error:ne}}}async function he(j,ne){return J("/api/git/remote",{name:j,url:ne},"Failed to add remote")}async function ke(j,ne){return J("/api/git/remote",{name:j,newUrl:ne},"Failed to edit remote",{method:"PUT"})}async function lt(j){return J("/api/git/remote",{name:j},"Failed to delete remote",{method:"DELETE"})}async function tt(j,ne){return J("/api/git/fetch",{all:!0,prune:j,pruneTags:ne},"Failed to fetch all")}function ht(){H.value=H.value==="inline"?"bottom":"inline"}function It(){fe.value=fe.value==="list"?"tree":"list"}function Ct(j){ce.value=j}function Tr(){K.value=!K.value}function jt(j){oe.value={...oe.value,[j]:!oe.value[j]}}async function _t(j){if(ue.value=j,pe.value=null,j&&k.value)try{const ne=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:j}});pe.value=ne.mergeBase}catch{pe.value=null}}async function Ur(j,ne){if(Xe.value=j,nt.value=null,$t.value=ne??null,j&&k.value)try{const Ae=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:j,baseBranch:ne??void 0}});nt.value=Ae.mergeBase}catch{nt.value=null}}async function R(j,ne){if(Ot.value=j,Pt.value=null,vt.value=ne??null,j&&k.value)try{const Ae=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:j,baseBranch:ne??void 0}});Pt.value=Ae.mergeBase}catch{Pt.value=null}}async function I(){if(!k.value)return;const j=[];ue.value&&j.push((async()=>{try{const ne=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:ue.value}});pe.value=ne.mergeBase}catch{pe.value=null}})()),Xe.value&&j.push((async()=>{try{const ne=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:Xe.value,baseBranch:$t.value??void 0}});nt.value=ne.mergeBase}catch{nt.value=null}})()),Ot.value&&j.push((async()=>{try{const ne=await $fetch("/api/git/merge-base",{params:{workingDirectory:k.value,branch:Ot.value,baseBranch:vt.value??void 0}});Pt.value=ne.mergeBase}catch{Pt.value=null}})()),j.length>0&&await Promise.all(j)}function B(j){const ne=r.value.find(Ae=>Ae.hash===j||Ae.shortHash===j);ne&&Wt(ne)}async function U(j){return J("/api/git/reset",{hash:"HEAD",mode:j},"Failed to reset working directory")}async function C(){return J("/api/git/clean",{},"Failed to clean untracked files")}function P(j){Q.value=j}function ve(){Q.value=null}function Re(j){G.value=j}function Fe(){G.value=null}const xt=E(null),Ft=E(null),ss=E(!1),Xn=N(()=>!!S.value&&!!l.value);function Kl(j){S.value=j,j&&l.value&&Uo()}function Jl(){S.value=null,xt.value=null,Ft.value=null,ss.value=!1}async function Uo(){if(!(!k.value||!l.value||!S.value)){ss.value=!0;try{const j=S.value.hash,ne=l.value.hash,Ae=await $fetch("/api/git/diff",{query:{workingDirectory:k.value,from:j,to:ne}});xt.value=Ae.files,Ft.value=Ae.stats}catch(j){console.error("Failed to load comparison:",j),re("Failed to load commit comparison"),xt.value=null,Ft.value=null}finally{ss.value=!1}}}async function Mi(j){navigator?.clipboard&&await navigator.clipboard.writeText(j)}async function Ai(j,ne){Oe.value=ne,de.value=j,_e.value=null,Ze.value=!0,await _i()}function Ie(){Oe.value=null,de.value=null,_e.value=null,Ze.value=!1}async function _i(){if(!k.value||!de.value||!Oe.value){Ze.value=!1;return}Ze.value=!0;try{const j=await $fetch("/api/git/file-diff",{query:{workingDirectory:k.value,commitHash:de.value,filePath:Oe.value.path}});_e.value=j}catch(j){console.error("Failed to load file diff:",j),re("Failed to load file diff"),_e.value=null}finally{Ze.value=!1}}function qs(){r.value=[],e.value=[],t.value=[],n.value=new Set,s.value=[],i.value=[],o.value=0,a.value=!1,l.value=null,c.value=null,u.value=null,h.value=!1,f.value=null,m.value=!1,g.value=0,v.value="",y.value=[],k.value=null,W.value=null,z.value=!1,L.value=!1,q.value=null,er.value=!1,$.value=!1,T.value=!1,A.value=!1,Z.value=!1,w.value=[],x.value=[],S.value=null,xt.value=null,Ft.value=null,ss.value=!1,Q.value=null,G.value=null,H.value="inline",fe.value="list",ce.value="rounded",K.value=!1,oe.value={date:!0,author:!0,commit:!0},ae.value=0,ee.value=0,ue.value=null,Xe.value=null,nt.value=null,$t.value=null,Ot.value=null,Pt.value=null,vt.value=null,Oe.value=null,de.value=null,_e.value=null,Ze.value=!1,me(),je.clear()}async function Ad(){if(!k.value||L.value||h.value)return!1;L.value=!0;try{const j=(await $fetch("/api/git/state",{query:{workingDirectory:k.value}})).state,ne=q.value;if(q.value=j,W.value=Date.now(),!ne)return!1;const Ae=ne.headCommit!==j.headCommit||ne.branchListHash!==j.branchListHash,ar=ne.workingTreeHash!==j.workingTreeHash,bn=ne.stashListHash!==j.stashListHash;if(Ae){const[os,Go,Rv]=await Promise.all([$fetch("/api/git/log",{query:{workingDirectory:k.value}}),$fetch("/api/git/status",{query:{workingDirectory:k.value}}),$fetch("/api/git/stash",{query:{workingDirectory:k.value}}).then(Ev=>Ev.stashes).catch(()=>[])]);return r.value=os.commits,e.value=os.branches,t.value=os.tags,n.value=new Set(os.localBranches??[]),m.value=os.hasMore,g.value=os.totalCount,s.value=Go.stagedFiles??[],i.value=Go.unstagedFiles??[],o.value=(Go.stagedCount??0)+(Go.unstagedCount??0),w.value=Rv,await I(),!0}if(!ar&&!bn)return!1;const[xn,is]=await Promise.all([ar?$fetch("/api/git/status",{query:{workingDirectory:k.value}}):Promise.resolve(null),bn?$fetch("/api/git/stash",{query:{workingDirectory:k.value}}).then(os=>os.stashes).catch(()=>[]):Promise.resolve(null)]);return xn&&(s.value=xn.stagedFiles??[],i.value=xn.unstagedFiles??[],o.value=(xn.stagedCount??0)+(xn.unstagedCount??0)),is&&(w.value=is),!0}catch(j){return console.error("Failed to refresh git graph:",j),!1}finally{L.value=!1}}function Av(){z.value=!0}function _v(){z.value=!1}return{commits:Me(r),branches:Me(e),tags:Me(t),localBranchNames:Me(n),stagedFiles:Me(s),unstagedFiles:Me(i),uncommittedChangesCount:Me(o),isUncommittedChangesSelected:Me(a),selectedCommit:Me(l),selectedCommitFiles:Me(c),selectedCommitStats:Me(u),loading:Me(h),loadingMore:Me(er),error:Me(f),hasMore:Me(m),totalCount:Me(g),searchQuery:Me(v),filteredBranches:Me(y),workingDirectory:Me(k),stashes:Me(w),remotes:Me(x),comparisonCommit:Me(S),comparisonFiles:Me(xt),comparisonStats:Me(Ft),comparisonLoading:Me(ss),isComparing:Xn,activeDialog:Me(Q),activeContextMenu:Me(G),detailViewPosition:Me(H),fileViewMode:Me(fe),graphStyle:Me(ce),muteNonAncestral:Me(K),columnVisibility:Me(oe),searchResultIndex:Me(ae),searchResultCount:Me(ee),selectedFeatureId:Me(ue),featureMergeBase:Me(pe),conversationBranch:Me(Xe),conversationMergeBase:Me(nt),conversationBaseBranch:Me($t),previewBranch:Me(Ot),previewMergeBase:Me(Pt),previewBaseBranch:Me(vt),diffViewerFile:Me(Oe),diffViewerCommitHash:Me(de),diffViewerContent:Me(_e),diffViewerLoading:Me(Ze),lastRefreshTime:Me(W),isPollingActive:Me(z),isRefreshing:Me(L),isLoadingDetails:Me($),isStaging:Me(T),isCommitting:Me(A),isCheckingOut:Me(Z),operationError:Me(Y),filteredCommits:Vt,currentBranch:ut,searchResultHashes:tr,loadGitGraph:Or,loadMoreCommits:Cr,refreshUncommittedChanges:Jt,selectCommit:Wt,selectUncommittedChanges:Qr,clearSelection:Lr,setSearchQuery:Dr,toggleBranchFilter:ie,clearFilters:be,nextSearchResult:Zr,prevSearchResult:F,checkoutBranch:Te,createBranch:qe,deleteLocalBranch:Ve,deleteRemoteBranch:st,stageFiles:ws,unstageFiles:an,commitChanges:Zt,reset:qs,clearOperationError:me,renameBranch:Ss,mergeBranch:He,rebaseBranch:Fr,pushBranch:Rt,pullBranch:rs,fetchBranch:bt,cherryPickCommit:Zn,revertCommit:Et,resetToCommit:rr,checkoutCommit:et,copyCommitSubject:Pr,createTag:Mt,deleteTag:On,pushTag:At,getTagDetail:In,copyTagName:mt,loadStashes:ns,applyStash:Bt,popStash:vn,dropStash:Lt,stashBranch:$s,stashChanges:$e,loadRemotes:D,addRemote:he,editRemote:ke,deleteRemote:lt,fetchAll:tt,setActiveDialog:P,clearActiveDialog:ve,setActiveContextMenu:Re,clearActiveContextMenu:Fe,selectComparisonCommit:Kl,clearComparison:Jl,loadComparisonData:Uo,copyToClipboard:Mi,toggleDetailViewPosition:ht,toggleFileViewMode:It,setGraphStyle:Ct,toggleMuteNonAncestral:Tr,toggleColumnVisibility:jt,navigateToCommit:B,resetWorking:U,cleanUntracked:C,setSelectedFeatureId:_t,setConversationBranch:Ur,setPreviewBranch:R,openFileDiff:Ai,closeFileDiff:Ie,checkAndRefresh:Ad,startPolling:Av,stopPolling:_v}});async function Nw(){if(typeof window>"u")return{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};try{const r=await $fetch("/api/conversations");if(!r||!Array.isArray(r.conversations))return console.warn("[conversationStorage] Invalid data structure from server"),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0};r.version!==ja&&console.warn(`[conversationStorage] Storage version mismatch: ${r.version} vs ${ja}`);const e=r.conversations.map(l=>{if(!l||typeof l!="object")return l;const c=l;return"claudeSessionId"in c&&!("providerSessionId"in c)?{...c,providerSessionId:c.claudeSessionId}:l}),n=(Array.isArray(r.archivedConversations)?r.archivedConversations:[]).map(l=>{if(!l||typeof l!="object")return l;const c=l;return"claudeSessionId"in c&&!("providerSessionId"in c)?{...c,providerSessionId:c.claudeSessionId}:l}),s=e.filter(zv),i=n.filter(Nv),o=e.length-s.length,a=n.length-i.length;return o>0&&console.warn(`[conversationStorage] Discarded ${o} corrupted active conversation(s)`),a>0&&console.warn(`[conversationStorage] Discarded ${a} corrupted archive conversation(s)`),{conversations:s,archivedConversations:i,discardedConversations:o,discardedArchives:a}}catch(r){return console.error("[conversationStorage] Failed to load conversations:",r),{conversations:[],archivedConversations:[],discardedConversations:0,discardedArchives:0}}}async function Vw(r,e=[]){if(typeof window>"u")return!1;try{return await $fetch("/api/conversations",{method:"POST",body:{version:ja,conversations:r,archivedConversations:e}}),!0}catch(t){return console.error("Failed to save conversations:",t),!1}}async function Jd(r){if(typeof window>"u")return!1;try{return await $fetch("/api/conversations/update",{method:"POST",body:{version:ja,conversation:r}}),!0}catch(e){return console.error("Failed to save conversation:",e),!1}}function Ww(r){return r?r.map(e=>{switch(e.type){case"text":return e.text;case"tool_use":return`[${e.name}] ${e.inputSummary}`;case"tool_result":return e.isError?`Error: ${e.content.slice(0,100)}`:"";case"thinking":case"result_summary":case"session_init":return"";default:return""}}).filter(Boolean).join(`
64
- `):""}const pn=hh("chat",()=>{const r=E(!1),e=E(Vv),t=E("ask"),n=E(""),s=E([]),i=E([]),o=E(null),a=E("active"),l=E(new Set),c=new Map,u=E(!1),h=E(0),f=new Map,m=1200,g=E(null),v=E(null);function y(R){return R?c.get(R)??null:null}function k(R){let I=c.get(R);return I||(I={session:null,pendingPermission:null,pendingPlanApproval:null,lastError:null,debugEvents:[]},c.set(R,I)),I}const $=N(()=>s.value.find(R=>R.id===o.value)||null),T=N(()=>$.value?.messages??[]),A=N(()=>(h.value,y(o.value)?.session??null)),Z=N(()=>(h.value,y(o.value)?.pendingPermission??null)),Y=N(()=>(h.value,y(o.value)?.pendingPlanApproval??null)),V=N(()=>(h.value,y(o.value)?.lastError??null)),re=N(()=>(h.value,y(o.value)?.debugEvents??[])),me=N(()=>A.value?.status==="streaming"),J=N(()=>$.value?.providerSessionId??""),W=N(()=>T.value.length>0),z=N(()=>T.value[T.value.length-1]||null);function L(R){return l.value.has(R)}const q=N(()=>o.value?l.value.has(o.value):!1),w=N(()=>s.value.length>0),x=N(()=>i.value.length>0),S=N(()=>s.value.length),Q=N(()=>S.value>=Rd),G=N(()=>s.value),H=N(()=>i.value),fe=N(()=>g.value&&s.value.find(R=>R.id===g.value)||null);function ce(R){return g.value===R}function K(R){a.value=R}async function oe(R){if(!(!R?.previewBranch||!R.worktreePath))try{const I=await $fetch("/api/chat/preview-sync",{method:"POST",body:{previewBranch:R.previewBranch,worktreePath:R.worktreePath}});if(!I.success)throw new Error(I.error||"Unknown preview sync failure")}catch(I){console.warn("[chat] Failed to sync preview branch after worktree update",{conversationId:R.id,previewBranch:R.previewBranch,worktreePath:R.worktreePath,error:I instanceof Error?I.message:String(I)})}}async function ae(R){if(L(R))return{success:!1,error:"Cannot archive while this conversation is streaming"};if(s.value.findIndex(B=>B.id===R)===-1)return{success:!1,error:"Conversation not found"};try{const B=await $fetch(`/api/conversations/${R}/archive`,{method:"POST"});if(B.success&&B.archived){const U=f.get(R);return U&&(clearTimeout(U),f.delete(R)),c.delete(R),s.value=Array.isArray(B.conversations)?B.conversations:s.value.filter(C=>C.id!==R),i.value=Array.isArray(B.archivedConversations)?B.archivedConversations:[B.archived,...i.value],On(),g.value===R&&(g.value=null),o.value===R&&(o.value=s.value[0]?.id??null),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:o.value}}).catch(C=>{console.error("Failed to save active conversation:",C)}),{success:!0}}return{success:!1,error:"Failed to archive conversation"}}catch(B){return{success:!1,error:B instanceof Error?B.message:"Failed to archive conversation"}}}async function ee(R,I){if(Tr().atLimit)return{success:!1,error:`Cannot restore. Active conversations reached ${Ed}.`};if(!i.value.some(U=>U.id===R))return{success:!1,error:"Archived conversation not found"};try{const U=await $fetch(`/api/conversations/archives/${R}/restore`,{method:"POST",body:{baseBranch:I}});return U.success&&U.conversation?(s.value=Array.isArray(U.conversations)?U.conversations:[U.conversation,...s.value],Array.isArray(U.archivedConversations)?i.value=U.archivedConversations:i.value=i.value.filter(C=>C.id!==R),a.value="active",In(U.conversation.id),Mt(),rr(),{success:!0,conversationId:U.conversation.id}):{success:!1,error:"Failed to restore archived conversation"}}catch(U){return{success:!1,error:U instanceof Error?U.message:"Failed to restore archived conversation"}}}async function ue(R){const I=i.value.findIndex(B=>B.id===R);if(I===-1)return{success:!1,error:"Archived conversation not found"};try{const B=await $fetch(`/api/conversations/archives/${R}`,{method:"DELETE"});return B.success?(Array.isArray(B.archivedConversations)?i.value=B.archivedConversations:i.value.splice(I,1),On(),{success:!0}):{success:!1,error:"Failed to delete archived conversation"}}catch{return i.value.splice(I,1),rr(),{success:!0}}}async function pe(){if(!(typeof window>"u"))try{const R=await $fetch("/api/settings");if(R){if(typeof R.panelWidth=="number"){const U=R.panelWidth;U>=Bd&&U<=Ld&&(e.value=U)}typeof R.isPanelOpen=="boolean"&&(r.value=R.isPanelOpen),typeof R.activeConversationId=="string"&&(o.value=R.activeConversationId);const{useSettingsStore:I}=await Bs(async()=>{const{useSettingsStore:U}=await import("./Bd9QEY7i.js").then(C=>C.s);return{useSettingsStore:U}},__vite__mapDeps([0,1,2]),import.meta.url),B=I();await B.hydrate(),t.value=B.permissionMode}}catch(R){console.error("Failed to load chat settings:",R)}}function Xe(R){t.value=R,typeof window<"u"&&Bs(async()=>{const{useSettingsStore:I}=await import("./Bd9QEY7i.js").then(B=>B.s);return{useSettingsStore:I}},__vite__mapDeps([0,1,2]),import.meta.url).then(({useSettingsStore:I})=>{I().setPermissionMode(R)})}function nt(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.pendingPermission=R,h.value++}function $t(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.pendingPermission=null,h.value++)}function Ot(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.pendingPlanApproval=R,h.value++}function Pt(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.pendingPlanApproval=null,h.value++)}function vt(){r.value=!r.value,_e()}function Oe(){r.value=!0,_e()}function de(){r.value=!1,_e()}function _e(){typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{isPanelOpen:r.value}}).catch(R=>{console.error("Failed to save panel state:",R)})}function Ze(R){const I=Math.max(Bd,Math.min(Ld,R));e.value=I,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{panelWidth:I}}).catch(B=>{console.error("Failed to save panel width:",B)})}function je(R){n.value=R}function Ge(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(C=>C.id===B);U&&(U.providerSessionId=R)}function Vt(R,I){const B=s.value.find(U=>U.id===R);B&&(B.worktreeBranch=I,B.lastCommitTime=new Date().toISOString())}async function ut(R){const I=s.value.find(U=>U.id===R);if(!I?.worktreeBranch)return null;const B=I.worktreeBranch.trim();if(!B)return null;try{const C=(await $fetch("/api/specs/features")).features.find(P=>P.id===B);return C?(I.featureId!==C.id&&(I.featureId=C.id,I.updatedAt=new Date().toISOString(),rr()),C.id):null}catch(U){return console.warn("[chat] Failed to map branch to feature",{conversationId:R,branchName:B,error:U instanceof Error?U.message:String(U)}),null}}function Or(R,I,B){const U=s.value.find(C=>C.id===R);U&&(U.providerId=I,U.providerModelKey=B)}function Jt(R){const I=R??o.value;if(!I)return;const B=s.value.find(U=>U.id===I);B&&(B.providerSessionId="")}function er(R){return s.value.find(B=>B.id===R)?.providerSessionId??""}function Cr(R){l.value.add(R)}function Wt(R){l.value.delete(R)}function Lr(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(C=>C.id===B);U&&U.messages.push(R)}function Qr(R,I,B){const U={id:Dd(),role:"user",content:R,attachments:B&&B.length>0?B:void 0,timestamp:new Date().toISOString()};return Lr(U,I),U}function Dr(R){const I={id:Dd(),role:"assistant",content:"",timestamp:new Date().toISOString(),status:"streaming"};return Lr(I,R),I}function tr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);P!==-1&&(C.messages[P]={...C.messages[P],...I})}function fr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);P!==-1&&(C.messages[P].content+=I)}function Zr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);if(P!==-1){const ve=C.messages[P],Re=ve.tools?[...ve.tools,I]:[I];C.messages[P]={...ve,tools:Re}}}function F(R,I,B,U){const C=U??o.value;if(!C)return;const P=s.value.find(Re=>Re.id===C);if(!P)return;const ve=P.messages.findIndex(Re=>Re.id===R);if(ve!==-1){const Re=P.messages[ve];if(Re.tools){const Fe=Re.tools.findIndex(xt=>xt.id===I);if(Fe!==-1){const xt=[...Re.tools];xt[Fe]={...xt[Fe],...B},P.messages[ve]={...Re,tools:xt}}}}et(C,!1)}function le(R){R.contentBlocks&&(R.content=Ww(R.contentBlocks))}function ie(R,I){if(R.type!==I.type)return!0;switch(I.type){case"text":return R.text!==I.text;case"tool_use":{const B=R;return B.name!==I.name||B.inputSummary!==I.inputSummary}case"tool_result":{const B=R;return B.content!==I.content||B.isError!==I.isError}default:return!1}}function be(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(P=>P.id===B);if(!U)return;const C=U.messages.find(P=>P.id===R);C&&!C.contentBlocks&&(C.contentBlocks=[])}function Te(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.find(ve=>ve.id===R);P&&(P.contentBlocks||(P.contentBlocks=[]),P.contentBlocks.push(I),le(P))}function qe(R,I,B,U){const C=U??o.value;if(!C)return;const P=s.value.find(Ft=>Ft.id===C);if(!P)return;const ve=P.messages.find(Ft=>Ft.id===R);if(!ve?.contentBlocks)return;const Re=ve.contentBlocks.findIndex(Ft=>Ft.id===I);if(Re===-1)return;const xt={...ve.contentBlocks[Re]};B(xt),ve.contentBlocks[Re]=xt}function Ve(R,I,B,U,C){const P=U??o.value;if(!P)return;const ve=s.value.find(Xn=>Xn.id===P);if(!ve)return;const Re=ve.messages.find(Xn=>Xn.id===R);if(!Re?.contentBlocks)return;const Fe=Re.contentBlocks.findIndex(Xn=>Xn.id===I);if(Fe===-1)return;const xt=Re.contentBlocks[Fe],Ft={...xt};B(Ft),Re.contentBlocks[Fe]=Ft,C?.syncContent!==!1&&ie(xt,Ft)&&le(Re),et(P,!1)}function st(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.find(ve=>ve.id===R);P&&(P.contentBlocks||(P.contentBlocks=[]),P.contentBlocks.push(I),le(P),et(U,!1))}function ws(R,I,B){const U=B??o.value;if(!U)return null;const C=s.value.find(ve=>ve.id===U);if(!C)return null;const P=C.messages.find(ve=>ve.id===R);return P?.contentBlocks?P.contentBlocks.find(ve=>ve.type==="tool_use"&&ve.toolUseId===I)??null:null}function an(R,I){const B=I??o.value;if(!B)return;const U=c.get(B);U?.session&&(U.session.status=R,h.value++)}function Zt(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.session={sessionId:R,cwd:n.value,status:"streaming",startedAt:new Date().toISOString()},U.lastError=null,h.value++}function Ss(R){const I=R??o.value;if(!I)return;const B=c.get(I);B?.session&&(B.session.status="idle",h.value++)}function He(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.session&&(U.session.status="error",U.session.error=R),U.lastError=R,h.value++}function Fr(R,I){if(!u.value)return;const B=I??o.value;if(!B)return;const U=k(B),C=(()=>{if(typeof R.payload=="string")return R.payload;try{return JSON.stringify(R.payload,null,2)}catch{return String(R.payload)}})(),P=8e3,ve=300,Re=C.length>P?`${C.slice(0,P)}
65
- ... (truncated)`:C;U.debugEvents.push({id:`dbg-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,timestamp:new Date().toISOString(),direction:R.direction,channel:R.channel,eventType:R.eventType||"unknown",payload:Re}),U.debugEvents.length>ve&&U.debugEvents.splice(0,U.debugEvents.length-ve),h.value++}function Rt(R){u.value=R}function rs(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.debugEvents=[],h.value++)}function bt(){if(!o.value)return;const R=s.value.find(B=>B.id===o.value);R&&(R.messages=[]);const I=o.value;c.delete(I),h.value++}function Zn(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.lastError=null,B.session&&(B.session.error=void 0),h.value++)}async function Et(){const R=await Nw();if(s.value=R.conversations,i.value=R.archivedConversations,R.discardedArchives>0&&console.warn(`[chat] Skipped ${R.discardedArchives} corrupted archived conversation(s)`),Mt(),On(),!g.value){const I=s.value.find(B=>!!B.previewBranch&&!B.finalized);I&&(g.value=I.id)}if(o.value){const I=s.value.find(B=>B.id===o.value);I&&I.cwd?n.value=I.cwd:I||(o.value=null,r.value=!1)}}function rr(){Vw(s.value,i.value)}function et(R,I=!1){const B=s.value.find(U=>U.id===R);if(B)if(I){const U=f.get(R);U&&(clearTimeout(U),f.delete(R)),B.updatedAt=new Date().toISOString(),Jd(B)}else{if(f.get(R))return;const C=setTimeout(()=>{B.updatedAt=new Date().toISOString(),Jd(B),f.delete(R)},m);f.set(R,C)}}function Pr(R=!1){o.value&&et(o.value,R)}function Mt(){const R=I=>{const B=new Date(I.updatedAt).getTime();return Number.isFinite(B)&&B>0?B:new Date(I.createdAt).getTime()};s.value.sort((I,B)=>R(B)-R(I))}function On(){i.value.sort((R,I)=>new Date(I.archivedAt).getTime()-new Date(R.archivedAt).getTime())}async function At(R){if(Tr().atLimit)return"";const B=Wv();let U=null;if(R?.featureId){const Re=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:B,featureId:R.featureId,baseBranch:R.baseBranch}});if(!Re.success&&Re.error)throw new Error(Re.error);U=Re}let C=null;if(typeof window<"u")try{const{useSettingsStore:Re}=await Bs(async()=>{const{useSettingsStore:xt}=await import("./Bd9QEY7i.js").then(Ft=>Ft.s);return{useSettingsStore:xt}},__vite__mapDeps([0,1,2]),import.meta.url),Fe=Re();await Fe.hydrate(),C=Fe.providerSelection}catch(Re){console.warn("[chat] Failed to load provider selection for new conversation",Re)}const P=C||{providerId:Wm,modelKey:Vm},ve={id:B,title:"New Conversation",messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),cwd:n.value||process.cwd?.()||"",featureId:R?.featureId,providerId:P.providerId,providerModelKey:P.modelKey};if(U?.success&&U.worktreePath&&U.branch&&(ve.worktreePath=U.worktreePath,ve.worktreeBranch=U.branch,ve.cwd=U.worktreePath,ve.hasWorktree=!0,U.baseBranch&&(ve.baseBranch=U.baseBranch)),s.value.unshift(ve),o.value=B,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:B}}).catch(Re=>{console.error("Failed to save active conversation:",Re)}),!R?.featureId)try{const Re=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:B,baseBranch:R?.baseBranch}});if(Re.success&&Re.worktreePath&&Re.branch){const Fe=s.value.find(xt=>xt.id===B);Fe&&(Fe.worktreePath=Re.worktreePath,Fe.worktreeBranch=Re.branch,Fe.cwd=Re.worktreePath,Fe.hasWorktree=!0,Re.baseBranch&&(Fe.baseBranch=Re.baseBranch))}}catch(Re){console.warn("[chat] Failed to create worktree for conversation",B,Re)}return et(B,!0),B}function In(R){const I=s.value.find(B=>B.id===R);I&&(o.value=R,r.value=!0,I.cwd&&(n.value=I.cwd),!I.featureId&&I.worktreeBranch&&ut(R),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:R,isPanelOpen:!0}}).catch(B=>{console.error("Failed to save active conversation:",B)}))}async function mt(R){const I=s.value.findIndex(C=>C.id===R);if(I===-1)return;const B=s.value[I];if(g.value===R&&(g.value=null),B.hasWorktree&&B.worktreePath&&B.worktreeBranch)try{await $fetch("/api/chat/worktree",{method:"DELETE",body:{worktreePath:B.worktreePath,branch:B.worktreeBranch}})}catch(C){console.warn("[chat] Failed to clean up worktree for conversation",R,C)}s.value.splice(I,1),c.delete(R);const U=f.get(R);U&&(clearTimeout(U),f.delete(R)),o.value===R&&(o.value=null,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:null}}).catch(C=>{console.error("Failed to clear active conversation:",C)})),rr()}async function ns(R,I,B){const U=s.value.find(P=>P.id===R);if(!U)return{success:!1,error:"Conversation not found"};if(!U.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const C=B||U.baseBranch;try{const P=await $fetch("/api/chat/finalize",{method:"POST",body:{conversationId:R,commitMessage:I,baseBranch:C,worktreePath:U.worktreePath,worktreeBranch:U.worktreeBranch,previewBranch:U.previewBranch}});return P.success?(g.value===R&&(g.value=null),U.worktreePath=void 0,U.worktreeBranch=void 0,U.hasWorktree=!1,U.baseBranch=void 0,U.previewBranch=void 0,U.finalized=!0,U.updatedAt=new Date().toISOString(),rr()):P.rebaseInProgress&&await vn(R,U.worktreePath,C||"main",I),P}catch(P){return{success:!1,error:P instanceof Error?P.message:String(P)}}}async function Bt(R,I){const B=s.value.find(C=>C.id===R);if(!B)return{success:!1,error:"Conversation not found"};if(!B.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const U=I||B.baseBranch;try{const C=await $fetch("/api/chat/rebase",{method:"POST",body:{conversationId:R,baseBranch:U,worktreePath:B.worktreePath}});return C.rebaseInProgress?await vn(R,B.worktreePath,U||"main","","sync"):C.success&&(await oe(B),B.baseBranch=U,rr()),C}catch(C){return{success:!1,error:C instanceof Error?C.message:String(C)}}}async function vn(R,I,B,U,C="finalize"){v.value={conversationId:R,worktreePath:I,baseBranch:B,commitMessage:U,files:[],resolvedFiles:new Set,loading:!0,error:null,mode:C};try{const P=await $fetch("/api/rebase/conflicts",{params:{worktreePath:I}});v.value&&(v.value.files=P.files,v.value.loading=!1)}catch(P){v.value&&(v.value.error=P instanceof Error?P.message:String(P),v.value.loading=!1)}}async function Lt(R,I){if(!v.value)return!1;try{const B=await $fetch("/api/rebase/resolve",{method:"PUT",body:{worktreePath:v.value.worktreePath,filePath:R,content:I}});return B.success&&v.value&&v.value.resolvedFiles.add(R),B.success}catch{return!1}}async function $s(){if(!v.value)return{success:!1,error:"No conflict resolution in progress"};const{conversationId:R,commitMessage:I,baseBranch:B,mode:U,worktreePath:C}=v.value,P=U==="sync"?"/api/rebase/continue-sync":"/api/rebase/continue";try{const ve=s.value.find(Fe=>Fe.id===R),Re=await $fetch(P,{method:"POST",body:{conversationId:R,commitMessage:I,baseBranch:B,worktreePath:C,worktreeBranch:ve?.worktreeBranch,previewBranch:ve?.previewBranch}});if(Re.success){if(U==="finalize"){g.value===R&&(g.value=null);const Fe=s.value.find(xt=>xt.id===R);Fe&&(Fe.worktreePath=void 0,Fe.worktreeBranch=void 0,Fe.hasWorktree=!1,Fe.baseBranch=void 0,Fe.previewBranch=void 0,Fe.finalized=!0,Fe.updatedAt=new Date().toISOString(),rr())}else if(U==="sync"){const Fe=s.value.find(xt=>xt.id===R);Fe&&(await oe(Fe),Fe.baseBranch=B,Fe.updatedAt=new Date().toISOString(),rr())}v.value=null}else Re.rebaseInProgress&&await vn(R,C,B,I,U);return Re}catch(ve){return{success:!1,error:ve instanceof Error?ve.message:String(ve)}}}async function $e(){if(!v.value)return!1;try{const R=await $fetch("/api/rebase/abort",{method:"POST",body:{worktreePath:v.value.worktreePath}});return v.value=null,R.success}catch{return v.value=null,!1}}async function D(R){if(!v.value)return!1;const I=v.value.files.find(B=>B.path===R);if(!I)return!1;try{const B=await $fetch("/api/rebase/ai-resolve",{method:"POST",body:{worktreePath:v.value.worktreePath,filePath:R,conflictContent:I.content}});return B.success&&B.resolvedContent!==void 0?(I.content=B.resolvedContent,await Lt(R,B.resolvedContent)):!1}catch{return!1}}async function he(){if(!v.value)return;const R=v.value.files.filter(I=>!v.value.resolvedFiles.has(I.path));for(const I of R)await D(I.path)}async function ke(R){const I=s.value.find(B=>B.id===R);if(!I)return{success:!1,error:"Conversation not found"};if(!I.hasWorktree||!I.worktreePath||!I.baseBranch)return{success:!1,error:"No worktree to preview"};try{const B=await $fetch("/api/chat/preview",{method:"POST",body:{conversationId:R,worktreePath:I.worktreePath,baseBranch:I.baseBranch}});return B.success&&B.previewBranch&&(I.previewBranch=B.previewBranch,g.value=R,I.updatedAt=new Date().toISOString(),rr()),{success:B.success,error:B.error}}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}async function lt(R){const I=s.value.find(B=>B.id===R);if(!I)return{success:!1,error:"Conversation not found"};if(!I.previewBranch||!I.baseBranch)return g.value=null,{success:!1,error:"No active preview"};try{const B=await $fetch("/api/chat/preview",{method:"DELETE",body:{previewBranch:I.previewBranch,baseBranch:I.baseBranch}});return B.success&&(I.previewBranch=void 0,g.value=null,I.updatedAt=new Date().toISOString(),rr()),{success:B.success,error:B.error}}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}async function tt(R){if(g.value===R)return await lt(R);if(g.value){const I=await lt(g.value);if(!I.success)return{success:!1,error:`Failed to end previous preview: ${I.error}`}}return await ke(R)}function ht(R){const I=R.trim();if(!I)return null;const B=s.value.filter(U=>U.featureId===I?!0:U.worktreeBranch?.trim()===I);return B.length===0?null:B.sort((U,C)=>new Date(C.updatedAt).getTime()-new Date(U.updatedAt).getTime())[0]||null}function It(R,I){const B=s.value.find(U=>U.id===R);B&&(B.title=I.trim(),B.updatedAt=new Date().toISOString(),Mt(),rr())}function Ct(R){const I=o.value;if(!I)return;const B=s.value.find(C=>C.id===I);if(!B||B.title!=="New Conversation")return;const U=B.messages.find(C=>C.role==="user");U&&(U.content.trim().length>0?B.title=jv(U.content):U.attachments&&U.attachments.length>0&&(B.title=U.attachments.length===1?"[Image] New Conversation":`[${U.attachments.length} Images] New Conversation`))}function Tr(){const R=s.value.length;return{atLimit:R>=Ed,nearLimit:R>=Rd,count:R}}async function jt(R,I){o.value||await At();const B=Qr(R,void 0,I);return Ct(),Pr(!0),B}function _t(R,I,B){const U=B??o.value;fr(R,I,U??void 0),U&&et(U,!1)}function Ur(R,I){const B=I??o.value;tr(R,{status:"complete"},B??void 0),B&&et(B,!0)}return{messages:T,session:A,isPanelOpen:r,panelWidth:Me(e),permissionMode:Me(t),pendingPermission:Z,pendingPlanApproval:Y,cwd:Me(n),lastError:V,debugEvents:re,debugStreamEnabled:Me(u),providerSessionId:J,conversations:Me(s),archivedConversations:Me(i),activeConversationId:Me(o),conversationViewMode:Me(a),conflictState:Me(v),previewingConversationId:Me(g),isStreaming:me,hasMessages:W,lastMessage:z,isActiveConversationStreaming:q,hasConversations:w,hasArchivedConversations:x,activeConversation:$,conversationCount:S,isNearStorageLimit:Q,sortedConversations:G,sortedArchivedConversations:H,previewingConversation:fe,streamingConversations:Me(l),initialize:pe,togglePanel:vt,openPanel:Oe,closePanel:de,setPanelWidth:Ze,setPermissionMode:Xe,setPendingPermission:nt,clearPendingPermission:$t,setPendingPlanApproval:Ot,clearPendingPlanApproval:Pt,setCwd:je,setProviderSessionId:Ge,clearProviderSession:Jt,getProviderSessionId:er,updateWorktreeBranch:Vt,setConversationProviderSelection:Or,startConversationStreaming:Cr,endConversationStreaming:Wt,isConversationStreaming:L,addMessage:Lr,addUserMessage:Qr,addAssistantMessage:Dr,updateMessage:tr,appendToMessage:fr,addToolToMessage:Zr,updateToolInMessage:F,initContentBlocks:be,appendContentBlock:Te,appendContentBlockWithSave:st,updateBlockById:qe,updateBlockWithSave:Ve,findToolUseBlock:ws,syncContentFromBlocks:le,setSessionStatus:an,startSession:Zt,endSession:Ss,setSessionError:He,setDebugStreamEnabled:Rt,pushDebugEvent:Fr,clearDebugEvents:rs,clearMessages:bt,clearError:Zn,loadConversations:Et,saveAllConversations:rr,saveCurrentConversation:Pr,saveConversation:et,createConversation:At,selectConversation:In,deleteConversation:mt,archiveConversation:ae,restoreArchivedConversation:ee,deleteArchivedConversation:ue,setConversationViewMode:K,findConversationByFeature:ht,syncConversationFeatureFromBranch:ut,renameConversation:It,checkStorageLimits:Tr,finalizeConversation:ns,rebaseConversation:Bt,resolveConflictFile:Lt,continueRebase:$s,abortRebase:$e,aiResolveConflictFile:D,aiResolveAllConflicts:he,previewConversation:ke,unpreviewConversation:lt,togglePreview:tt,isConversationPreviewing:ce,addUserMessageWithConversation:jt,appendToMessageWithSave:_t,completeMessageWithSave:Ur}});function jw(r={}){const e=Bl(),t=300,n=5e3,s=250;let i=null,o=null,a=null,l=null,c=null,u=!1,h=!1;const f=E(!1),m=E(!1);let g=r;function v(z){g=z}async function y(){const z=g.getScrollPosition?.()??0,L=await e.checkAndRefresh();return L&&g.setScrollPosition&&(await tn(),g.setScrollPosition(z)),L}function k(){return f.value||!!e.activeContextMenu||!!e.activeDialog}async function $(){if(k()){m.value=!0;return}A()}async function T(){if(u){h=!0;return}u=!0;try{await y()}finally{u=!1,h&&(h=!1,A())}}function A(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,T()},s)}function Z(z){if(typeof window>"u")return;if(a&&a.readyState===WebSocket.OPEN){a.send(JSON.stringify({type:"watch",workingDirectory:z}));return}l&&(clearTimeout(l),l=null);const q=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/git-watcher-ws`;a=new WebSocket(q),a.onopen=()=>{a.send(JSON.stringify({type:"watch",workingDirectory:z}))},a.onmessage=w=>{try{JSON.parse(w.data).type==="git_changed"&&$()}catch{}},a.onclose=()=>{a=null,e.isPollingActive&&c&&(l=setTimeout(()=>{c&&Z(c)},n))},a.onerror=()=>{}}function Y(){l&&(clearTimeout(l),l=null),a&&(a.close(),a=null)}function V(z){z&&(c=z),!e.isPollingActive&&(e.startPolling(),c&&Z(c))}function re(){Y(),e.stopPolling()}function me(){f.value=!0,i&&(clearTimeout(i),i=null)}function J(){i&&clearTimeout(i),i=setTimeout(async()=>{f.value=!1,m.value&&(m.value=!1,A())},t)}function W(){re(),i&&(clearTimeout(i),i=null),o&&(clearTimeout(o),o=null),u=!1,h=!1,c=null}return ze(()=>[e.activeContextMenu,e.activeDialog],()=>{!e.activeContextMenu&&!e.activeDialog&&m.value&&!f.value&&(m.value=!1,A())}),{isUserInteracting:Me(f),isDeferredRefresh:Me(m),startPolling:V,stopPolling:re,startInteraction:me,endInteraction:J,cleanup:W,setScrollCallbacks:v}}function qw(r){function e(s){if((s.ctrlKey||s.metaKey)&&s.key==="h"){s.preventDefault(),r.onScrollToHead();return}if(s.key==="Escape"){s.preventDefault(),r.onEscape();return}}function t(){document.addEventListener("keydown",e)}function n(){document.removeEventListener("keydown",e)}return{start:t,stop:n}}const Yw={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Fw={class:"text-sm font-mono text-retro-cyan"},Uw={class:"text-xs font-mono text-retro-text mt-1 truncate"},Gw={class:"space-y-3"},Hw={class:"flex items-start gap-2 cursor-pointer group"},Kw={class:"flex items-start gap-2 cursor-pointer group"},Jw=Be({__name:"CherryPickDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e,n=E(!1),s=E(!1);function i(){t("confirm",{recordOrigin:n.value,noCommit:s.value})}function o(){n.value=!1,s.value=!1,t("close")}return(a,l)=>(O(),ge($r,{title:"Cherry-Pick Commit",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Cherry-Pick",onClose:o,onConfirm:i},{default:kt(()=>[d("div",Yw,[l[2]||(l[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Commit",-1)),d("div",Fw,_(r.commitHash.slice(0,7)),1),d("div",Uw,_(r.commitMessage.split(`
64
+ `):""}const pn=hh("chat",()=>{const r=E(!1),e=E(Vv),t=E("ask"),n=E(""),s=E([]),i=E([]),o=E(null),a=E("active"),l=E(new Set),c=new Map,u=E(!1),h=E(0),f=new Map,m=1200,g=E(null),v=E(null);function y(R){return R?c.get(R)??null:null}function k(R){let I=c.get(R);return I||(I={session:null,pendingPermission:null,pendingPlanApproval:null,lastError:null,debugEvents:[]},c.set(R,I)),I}const $=N(()=>s.value.find(R=>R.id===o.value)||null),T=N(()=>$.value?.messages??[]),A=N(()=>(h.value,y(o.value)?.session??null)),Z=N(()=>(h.value,y(o.value)?.pendingPermission??null)),Y=N(()=>(h.value,y(o.value)?.pendingPlanApproval??null)),V=N(()=>(h.value,y(o.value)?.lastError??null)),re=N(()=>(h.value,y(o.value)?.debugEvents??[])),me=N(()=>A.value?.status==="streaming"),J=N(()=>$.value?.providerSessionId??""),W=N(()=>T.value.length>0),z=N(()=>T.value[T.value.length-1]||null);function L(R){return l.value.has(R)}const q=N(()=>o.value?l.value.has(o.value):!1),w=N(()=>s.value.length>0),x=N(()=>i.value.length>0),S=N(()=>s.value.length),Q=N(()=>S.value>=Rd),G=N(()=>s.value),H=N(()=>i.value),fe=N(()=>g.value&&s.value.find(R=>R.id===g.value)||null);function ce(R){return g.value===R}function K(R){a.value=R}async function oe(R){if(!(!R?.previewBranch||!R.worktreePath))try{const I=await $fetch("/api/chat/preview-sync",{method:"POST",body:{previewBranch:R.previewBranch,worktreePath:R.worktreePath}});if(!I.success)throw new Error(I.error||"Unknown preview sync failure")}catch(I){console.warn("[chat] Failed to sync preview branch after worktree update",{conversationId:R.id,previewBranch:R.previewBranch,worktreePath:R.worktreePath,error:I instanceof Error?I.message:String(I)})}}async function ae(R){if(L(R))return{success:!1,error:"Cannot archive while this conversation is streaming"};if(s.value.findIndex(B=>B.id===R)===-1)return{success:!1,error:"Conversation not found"};try{const B=await $fetch(`/api/conversations/${R}/archive`,{method:"POST"});if(B.success&&B.archived){const U=f.get(R);return U&&(clearTimeout(U),f.delete(R)),c.delete(R),s.value=Array.isArray(B.conversations)?B.conversations:s.value.filter(C=>C.id!==R),i.value=Array.isArray(B.archivedConversations)?B.archivedConversations:[B.archived,...i.value],On(),g.value===R&&(g.value=null),o.value===R&&(o.value=s.value[0]?.id??null),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:o.value}}).catch(C=>{console.error("Failed to save active conversation:",C)}),{success:!0}}return{success:!1,error:"Failed to archive conversation"}}catch(B){return{success:!1,error:B instanceof Error?B.message:"Failed to archive conversation"}}}async function ee(R,I){if(Tr().atLimit)return{success:!1,error:`Cannot restore. Active conversations reached ${Ed}.`};if(!i.value.some(U=>U.id===R))return{success:!1,error:"Archived conversation not found"};try{const U=await $fetch(`/api/conversations/archives/${R}/restore`,{method:"POST",body:{baseBranch:I}});return U.success&&U.conversation?(s.value=Array.isArray(U.conversations)?U.conversations:[U.conversation,...s.value],Array.isArray(U.archivedConversations)?i.value=U.archivedConversations:i.value=i.value.filter(C=>C.id!==R),a.value="active",In(U.conversation.id),Mt(),rr(),{success:!0,conversationId:U.conversation.id}):{success:!1,error:"Failed to restore archived conversation"}}catch(U){return{success:!1,error:U instanceof Error?U.message:"Failed to restore archived conversation"}}}async function ue(R){const I=i.value.findIndex(B=>B.id===R);if(I===-1)return{success:!1,error:"Archived conversation not found"};try{const B=await $fetch(`/api/conversations/archives/${R}`,{method:"DELETE"});return B.success?(Array.isArray(B.archivedConversations)?i.value=B.archivedConversations:i.value.splice(I,1),On(),{success:!0}):{success:!1,error:"Failed to delete archived conversation"}}catch{return i.value.splice(I,1),rr(),{success:!0}}}async function pe(){if(!(typeof window>"u"))try{const R=await $fetch("/api/settings");if(R){if(typeof R.panelWidth=="number"){const U=R.panelWidth;U>=Bd&&U<=Ld&&(e.value=U)}typeof R.isPanelOpen=="boolean"&&(r.value=R.isPanelOpen),typeof R.activeConversationId=="string"&&(o.value=R.activeConversationId);const{useSettingsStore:I}=await Bs(async()=>{const{useSettingsStore:U}=await import("./ddKcAgQK.js").then(C=>C.s);return{useSettingsStore:U}},__vite__mapDeps([0,1,2]),import.meta.url),B=I();await B.hydrate(),t.value=B.permissionMode}}catch(R){console.error("Failed to load chat settings:",R)}}function Xe(R){t.value=R,typeof window<"u"&&Bs(async()=>{const{useSettingsStore:I}=await import("./ddKcAgQK.js").then(B=>B.s);return{useSettingsStore:I}},__vite__mapDeps([0,1,2]),import.meta.url).then(({useSettingsStore:I})=>{I().setPermissionMode(R)})}function nt(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.pendingPermission=R,h.value++}function $t(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.pendingPermission=null,h.value++)}function Ot(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.pendingPlanApproval=R,h.value++}function Pt(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.pendingPlanApproval=null,h.value++)}function vt(){r.value=!r.value,_e()}function Oe(){r.value=!0,_e()}function de(){r.value=!1,_e()}function _e(){typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{isPanelOpen:r.value}}).catch(R=>{console.error("Failed to save panel state:",R)})}function Ze(R){const I=Math.max(Bd,Math.min(Ld,R));e.value=I,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{panelWidth:I}}).catch(B=>{console.error("Failed to save panel width:",B)})}function je(R){n.value=R}function Ge(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(C=>C.id===B);U&&(U.providerSessionId=R)}function Vt(R,I){const B=s.value.find(U=>U.id===R);B&&(B.worktreeBranch=I,B.lastCommitTime=new Date().toISOString())}async function ut(R){const I=s.value.find(U=>U.id===R);if(!I?.worktreeBranch)return null;const B=I.worktreeBranch.trim();if(!B)return null;try{const C=(await $fetch("/api/specs/features")).features.find(P=>P.id===B);return C?(I.featureId!==C.id&&(I.featureId=C.id,I.updatedAt=new Date().toISOString(),rr()),C.id):null}catch(U){return console.warn("[chat] Failed to map branch to feature",{conversationId:R,branchName:B,error:U instanceof Error?U.message:String(U)}),null}}function Or(R,I,B){const U=s.value.find(C=>C.id===R);U&&(U.providerId=I,U.providerModelKey=B)}function Jt(R){const I=R??o.value;if(!I)return;const B=s.value.find(U=>U.id===I);B&&(B.providerSessionId="")}function er(R){return s.value.find(B=>B.id===R)?.providerSessionId??""}function Cr(R){l.value.add(R)}function Wt(R){l.value.delete(R)}function Lr(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(C=>C.id===B);U&&U.messages.push(R)}function Qr(R,I,B){const U={id:Dd(),role:"user",content:R,attachments:B&&B.length>0?B:void 0,timestamp:new Date().toISOString()};return Lr(U,I),U}function Dr(R){const I={id:Dd(),role:"assistant",content:"",timestamp:new Date().toISOString(),status:"streaming"};return Lr(I,R),I}function tr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);P!==-1&&(C.messages[P]={...C.messages[P],...I})}function fr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);P!==-1&&(C.messages[P].content+=I)}function Zr(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.findIndex(ve=>ve.id===R);if(P!==-1){const ve=C.messages[P],Re=ve.tools?[...ve.tools,I]:[I];C.messages[P]={...ve,tools:Re}}}function F(R,I,B,U){const C=U??o.value;if(!C)return;const P=s.value.find(Re=>Re.id===C);if(!P)return;const ve=P.messages.findIndex(Re=>Re.id===R);if(ve!==-1){const Re=P.messages[ve];if(Re.tools){const Fe=Re.tools.findIndex(xt=>xt.id===I);if(Fe!==-1){const xt=[...Re.tools];xt[Fe]={...xt[Fe],...B},P.messages[ve]={...Re,tools:xt}}}}et(C,!1)}function le(R){R.contentBlocks&&(R.content=Ww(R.contentBlocks))}function ie(R,I){if(R.type!==I.type)return!0;switch(I.type){case"text":return R.text!==I.text;case"tool_use":{const B=R;return B.name!==I.name||B.inputSummary!==I.inputSummary}case"tool_result":{const B=R;return B.content!==I.content||B.isError!==I.isError}default:return!1}}function be(R,I){const B=I??o.value;if(!B)return;const U=s.value.find(P=>P.id===B);if(!U)return;const C=U.messages.find(P=>P.id===R);C&&!C.contentBlocks&&(C.contentBlocks=[])}function Te(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.find(ve=>ve.id===R);P&&(P.contentBlocks||(P.contentBlocks=[]),P.contentBlocks.push(I),le(P))}function qe(R,I,B,U){const C=U??o.value;if(!C)return;const P=s.value.find(Ft=>Ft.id===C);if(!P)return;const ve=P.messages.find(Ft=>Ft.id===R);if(!ve?.contentBlocks)return;const Re=ve.contentBlocks.findIndex(Ft=>Ft.id===I);if(Re===-1)return;const xt={...ve.contentBlocks[Re]};B(xt),ve.contentBlocks[Re]=xt}function Ve(R,I,B,U,C){const P=U??o.value;if(!P)return;const ve=s.value.find(Xn=>Xn.id===P);if(!ve)return;const Re=ve.messages.find(Xn=>Xn.id===R);if(!Re?.contentBlocks)return;const Fe=Re.contentBlocks.findIndex(Xn=>Xn.id===I);if(Fe===-1)return;const xt=Re.contentBlocks[Fe],Ft={...xt};B(Ft),Re.contentBlocks[Fe]=Ft,C?.syncContent!==!1&&ie(xt,Ft)&&le(Re),et(P,!1)}function st(R,I,B){const U=B??o.value;if(!U)return;const C=s.value.find(ve=>ve.id===U);if(!C)return;const P=C.messages.find(ve=>ve.id===R);P&&(P.contentBlocks||(P.contentBlocks=[]),P.contentBlocks.push(I),le(P),et(U,!1))}function ws(R,I,B){const U=B??o.value;if(!U)return null;const C=s.value.find(ve=>ve.id===U);if(!C)return null;const P=C.messages.find(ve=>ve.id===R);return P?.contentBlocks?P.contentBlocks.find(ve=>ve.type==="tool_use"&&ve.toolUseId===I)??null:null}function an(R,I){const B=I??o.value;if(!B)return;const U=c.get(B);U?.session&&(U.session.status=R,h.value++)}function Zt(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.session={sessionId:R,cwd:n.value,status:"streaming",startedAt:new Date().toISOString()},U.lastError=null,h.value++}function Ss(R){const I=R??o.value;if(!I)return;const B=c.get(I);B?.session&&(B.session.status="idle",h.value++)}function He(R,I){const B=I??o.value;if(!B)return;const U=k(B);U.session&&(U.session.status="error",U.session.error=R),U.lastError=R,h.value++}function Fr(R,I){if(!u.value)return;const B=I??o.value;if(!B)return;const U=k(B),C=(()=>{if(typeof R.payload=="string")return R.payload;try{return JSON.stringify(R.payload,null,2)}catch{return String(R.payload)}})(),P=8e3,ve=300,Re=C.length>P?`${C.slice(0,P)}
65
+ ... (truncated)`:C;U.debugEvents.push({id:`dbg-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,timestamp:new Date().toISOString(),direction:R.direction,channel:R.channel,eventType:R.eventType||"unknown",payload:Re}),U.debugEvents.length>ve&&U.debugEvents.splice(0,U.debugEvents.length-ve),h.value++}function Rt(R){u.value=R}function rs(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.debugEvents=[],h.value++)}function bt(){if(!o.value)return;const R=s.value.find(B=>B.id===o.value);R&&(R.messages=[]);const I=o.value;c.delete(I),h.value++}function Zn(R){const I=R??o.value;if(!I)return;const B=c.get(I);B&&(B.lastError=null,B.session&&(B.session.error=void 0),h.value++)}async function Et(){const R=await Nw();if(s.value=R.conversations,i.value=R.archivedConversations,R.discardedArchives>0&&console.warn(`[chat] Skipped ${R.discardedArchives} corrupted archived conversation(s)`),Mt(),On(),!g.value){const I=s.value.find(B=>!!B.previewBranch&&!B.finalized);I&&(g.value=I.id)}if(o.value){const I=s.value.find(B=>B.id===o.value);I&&I.cwd?n.value=I.cwd:I||(o.value=null,r.value=!1)}}function rr(){Vw(s.value,i.value)}function et(R,I=!1){const B=s.value.find(U=>U.id===R);if(B)if(I){const U=f.get(R);U&&(clearTimeout(U),f.delete(R)),B.updatedAt=new Date().toISOString(),Jd(B)}else{if(f.get(R))return;const C=setTimeout(()=>{B.updatedAt=new Date().toISOString(),Jd(B),f.delete(R)},m);f.set(R,C)}}function Pr(R=!1){o.value&&et(o.value,R)}function Mt(){const R=I=>{const B=new Date(I.updatedAt).getTime();return Number.isFinite(B)&&B>0?B:new Date(I.createdAt).getTime()};s.value.sort((I,B)=>R(B)-R(I))}function On(){i.value.sort((R,I)=>new Date(I.archivedAt).getTime()-new Date(R.archivedAt).getTime())}async function At(R){if(Tr().atLimit)return"";const B=Wv();let U=null;if(R?.featureId){const Re=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:B,featureId:R.featureId,baseBranch:R.baseBranch}});if(!Re.success&&Re.error)throw new Error(Re.error);U=Re}let C=null;if(typeof window<"u")try{const{useSettingsStore:Re}=await Bs(async()=>{const{useSettingsStore:xt}=await import("./ddKcAgQK.js").then(Ft=>Ft.s);return{useSettingsStore:xt}},__vite__mapDeps([0,1,2]),import.meta.url),Fe=Re();await Fe.hydrate(),C=Fe.providerSelection}catch(Re){console.warn("[chat] Failed to load provider selection for new conversation",Re)}const P=C||{providerId:Wm,modelKey:Vm},ve={id:B,title:"New Conversation",messages:[],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),cwd:n.value||process.cwd?.()||"",featureId:R?.featureId,providerId:P.providerId,providerModelKey:P.modelKey};if(U?.success&&U.worktreePath&&U.branch&&(ve.worktreePath=U.worktreePath,ve.worktreeBranch=U.branch,ve.cwd=U.worktreePath,ve.hasWorktree=!0,U.baseBranch&&(ve.baseBranch=U.baseBranch)),s.value.unshift(ve),o.value=B,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:B}}).catch(Re=>{console.error("Failed to save active conversation:",Re)}),!R?.featureId)try{const Re=await $fetch("/api/chat/worktree",{method:"POST",body:{conversationId:B,baseBranch:R?.baseBranch}});if(Re.success&&Re.worktreePath&&Re.branch){const Fe=s.value.find(xt=>xt.id===B);Fe&&(Fe.worktreePath=Re.worktreePath,Fe.worktreeBranch=Re.branch,Fe.cwd=Re.worktreePath,Fe.hasWorktree=!0,Re.baseBranch&&(Fe.baseBranch=Re.baseBranch))}}catch(Re){console.warn("[chat] Failed to create worktree for conversation",B,Re)}return et(B,!0),B}function In(R){const I=s.value.find(B=>B.id===R);I&&(o.value=R,r.value=!0,I.cwd&&(n.value=I.cwd),!I.featureId&&I.worktreeBranch&&ut(R),typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:R,isPanelOpen:!0}}).catch(B=>{console.error("Failed to save active conversation:",B)}))}async function mt(R){const I=s.value.findIndex(C=>C.id===R);if(I===-1)return;const B=s.value[I];if(g.value===R&&(g.value=null),B.hasWorktree&&B.worktreePath&&B.worktreeBranch)try{await $fetch("/api/chat/worktree",{method:"DELETE",body:{worktreePath:B.worktreePath,branch:B.worktreeBranch}})}catch(C){console.warn("[chat] Failed to clean up worktree for conversation",R,C)}s.value.splice(I,1),c.delete(R);const U=f.get(R);U&&(clearTimeout(U),f.delete(R)),o.value===R&&(o.value=null,typeof window<"u"&&$fetch("/api/settings",{method:"POST",body:{activeConversationId:null}}).catch(C=>{console.error("Failed to clear active conversation:",C)})),rr()}async function ns(R,I,B){const U=s.value.find(P=>P.id===R);if(!U)return{success:!1,error:"Conversation not found"};if(!U.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const C=B||U.baseBranch;try{const P=await $fetch("/api/chat/finalize",{method:"POST",body:{conversationId:R,commitMessage:I,baseBranch:C,worktreePath:U.worktreePath,worktreeBranch:U.worktreeBranch,previewBranch:U.previewBranch}});return P.success?(g.value===R&&(g.value=null),U.worktreePath=void 0,U.worktreeBranch=void 0,U.hasWorktree=!1,U.baseBranch=void 0,U.previewBranch=void 0,U.finalized=!0,U.updatedAt=new Date().toISOString(),rr()):P.rebaseInProgress&&await vn(R,U.worktreePath,C||"main",I),P}catch(P){return{success:!1,error:P instanceof Error?P.message:String(P)}}}async function Bt(R,I){const B=s.value.find(C=>C.id===R);if(!B)return{success:!1,error:"Conversation not found"};if(!B.hasWorktree)return{success:!1,error:"No worktree associated with this conversation"};const U=I||B.baseBranch;try{const C=await $fetch("/api/chat/rebase",{method:"POST",body:{conversationId:R,baseBranch:U,worktreePath:B.worktreePath}});return C.rebaseInProgress?await vn(R,B.worktreePath,U||"main","","sync"):C.success&&(await oe(B),B.baseBranch=U,rr()),C}catch(C){return{success:!1,error:C instanceof Error?C.message:String(C)}}}async function vn(R,I,B,U,C="finalize"){v.value={conversationId:R,worktreePath:I,baseBranch:B,commitMessage:U,files:[],resolvedFiles:new Set,loading:!0,error:null,mode:C};try{const P=await $fetch("/api/rebase/conflicts",{params:{worktreePath:I}});v.value&&(v.value.files=P.files,v.value.loading=!1)}catch(P){v.value&&(v.value.error=P instanceof Error?P.message:String(P),v.value.loading=!1)}}async function Lt(R,I){if(!v.value)return!1;try{const B=await $fetch("/api/rebase/resolve",{method:"PUT",body:{worktreePath:v.value.worktreePath,filePath:R,content:I}});return B.success&&v.value&&v.value.resolvedFiles.add(R),B.success}catch{return!1}}async function $s(){if(!v.value)return{success:!1,error:"No conflict resolution in progress"};const{conversationId:R,commitMessage:I,baseBranch:B,mode:U,worktreePath:C}=v.value,P=U==="sync"?"/api/rebase/continue-sync":"/api/rebase/continue";try{const ve=s.value.find(Fe=>Fe.id===R),Re=await $fetch(P,{method:"POST",body:{conversationId:R,commitMessage:I,baseBranch:B,worktreePath:C,worktreeBranch:ve?.worktreeBranch,previewBranch:ve?.previewBranch}});if(Re.success){if(U==="finalize"){g.value===R&&(g.value=null);const Fe=s.value.find(xt=>xt.id===R);Fe&&(Fe.worktreePath=void 0,Fe.worktreeBranch=void 0,Fe.hasWorktree=!1,Fe.baseBranch=void 0,Fe.previewBranch=void 0,Fe.finalized=!0,Fe.updatedAt=new Date().toISOString(),rr())}else if(U==="sync"){const Fe=s.value.find(xt=>xt.id===R);Fe&&(await oe(Fe),Fe.baseBranch=B,Fe.updatedAt=new Date().toISOString(),rr())}v.value=null}else Re.rebaseInProgress&&await vn(R,C,B,I,U);return Re}catch(ve){return{success:!1,error:ve instanceof Error?ve.message:String(ve)}}}async function $e(){if(!v.value)return!1;try{const R=await $fetch("/api/rebase/abort",{method:"POST",body:{worktreePath:v.value.worktreePath}});return v.value=null,R.success}catch{return v.value=null,!1}}async function D(R){if(!v.value)return!1;const I=v.value.files.find(B=>B.path===R);if(!I)return!1;try{const B=await $fetch("/api/rebase/ai-resolve",{method:"POST",body:{worktreePath:v.value.worktreePath,filePath:R,conflictContent:I.content}});return B.success&&B.resolvedContent!==void 0?(I.content=B.resolvedContent,await Lt(R,B.resolvedContent)):!1}catch{return!1}}async function he(){if(!v.value)return;const R=v.value.files.filter(I=>!v.value.resolvedFiles.has(I.path));for(const I of R)await D(I.path)}async function ke(R){const I=s.value.find(B=>B.id===R);if(!I)return{success:!1,error:"Conversation not found"};if(!I.hasWorktree||!I.worktreePath||!I.baseBranch)return{success:!1,error:"No worktree to preview"};try{const B=await $fetch("/api/chat/preview",{method:"POST",body:{conversationId:R,worktreePath:I.worktreePath,baseBranch:I.baseBranch}});return B.success&&B.previewBranch&&(I.previewBranch=B.previewBranch,g.value=R,I.updatedAt=new Date().toISOString(),rr()),{success:B.success,error:B.error}}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}async function lt(R){const I=s.value.find(B=>B.id===R);if(!I)return{success:!1,error:"Conversation not found"};if(!I.previewBranch||!I.baseBranch)return g.value=null,{success:!1,error:"No active preview"};try{const B=await $fetch("/api/chat/preview",{method:"DELETE",body:{previewBranch:I.previewBranch,baseBranch:I.baseBranch}});return B.success&&(I.previewBranch=void 0,g.value=null,I.updatedAt=new Date().toISOString(),rr()),{success:B.success,error:B.error}}catch(B){return{success:!1,error:B instanceof Error?B.message:String(B)}}}async function tt(R){if(g.value===R)return await lt(R);if(g.value){const I=await lt(g.value);if(!I.success)return{success:!1,error:`Failed to end previous preview: ${I.error}`}}return await ke(R)}function ht(R){const I=R.trim();if(!I)return null;const B=s.value.filter(U=>U.featureId===I?!0:U.worktreeBranch?.trim()===I);return B.length===0?null:B.sort((U,C)=>new Date(C.updatedAt).getTime()-new Date(U.updatedAt).getTime())[0]||null}function It(R,I){const B=s.value.find(U=>U.id===R);B&&(B.title=I.trim(),B.updatedAt=new Date().toISOString(),Mt(),rr())}function Ct(R){const I=o.value;if(!I)return;const B=s.value.find(C=>C.id===I);if(!B||B.title!=="New Conversation")return;const U=B.messages.find(C=>C.role==="user");U&&(U.content.trim().length>0?B.title=jv(U.content):U.attachments&&U.attachments.length>0&&(B.title=U.attachments.length===1?"[Image] New Conversation":`[${U.attachments.length} Images] New Conversation`))}function Tr(){const R=s.value.length;return{atLimit:R>=Ed,nearLimit:R>=Rd,count:R}}async function jt(R,I){o.value||await At();const B=Qr(R,void 0,I);return Ct(),Pr(!0),B}function _t(R,I,B){const U=B??o.value;fr(R,I,U??void 0),U&&et(U,!1)}function Ur(R,I){const B=I??o.value;tr(R,{status:"complete"},B??void 0),B&&et(B,!0)}return{messages:T,session:A,isPanelOpen:r,panelWidth:Me(e),permissionMode:Me(t),pendingPermission:Z,pendingPlanApproval:Y,cwd:Me(n),lastError:V,debugEvents:re,debugStreamEnabled:Me(u),providerSessionId:J,conversations:Me(s),archivedConversations:Me(i),activeConversationId:Me(o),conversationViewMode:Me(a),conflictState:Me(v),previewingConversationId:Me(g),isStreaming:me,hasMessages:W,lastMessage:z,isActiveConversationStreaming:q,hasConversations:w,hasArchivedConversations:x,activeConversation:$,conversationCount:S,isNearStorageLimit:Q,sortedConversations:G,sortedArchivedConversations:H,previewingConversation:fe,streamingConversations:Me(l),initialize:pe,togglePanel:vt,openPanel:Oe,closePanel:de,setPanelWidth:Ze,setPermissionMode:Xe,setPendingPermission:nt,clearPendingPermission:$t,setPendingPlanApproval:Ot,clearPendingPlanApproval:Pt,setCwd:je,setProviderSessionId:Ge,clearProviderSession:Jt,getProviderSessionId:er,updateWorktreeBranch:Vt,setConversationProviderSelection:Or,startConversationStreaming:Cr,endConversationStreaming:Wt,isConversationStreaming:L,addMessage:Lr,addUserMessage:Qr,addAssistantMessage:Dr,updateMessage:tr,appendToMessage:fr,addToolToMessage:Zr,updateToolInMessage:F,initContentBlocks:be,appendContentBlock:Te,appendContentBlockWithSave:st,updateBlockById:qe,updateBlockWithSave:Ve,findToolUseBlock:ws,syncContentFromBlocks:le,setSessionStatus:an,startSession:Zt,endSession:Ss,setSessionError:He,setDebugStreamEnabled:Rt,pushDebugEvent:Fr,clearDebugEvents:rs,clearMessages:bt,clearError:Zn,loadConversations:Et,saveAllConversations:rr,saveCurrentConversation:Pr,saveConversation:et,createConversation:At,selectConversation:In,deleteConversation:mt,archiveConversation:ae,restoreArchivedConversation:ee,deleteArchivedConversation:ue,setConversationViewMode:K,findConversationByFeature:ht,syncConversationFeatureFromBranch:ut,renameConversation:It,checkStorageLimits:Tr,finalizeConversation:ns,rebaseConversation:Bt,resolveConflictFile:Lt,continueRebase:$s,abortRebase:$e,aiResolveConflictFile:D,aiResolveAllConflicts:he,previewConversation:ke,unpreviewConversation:lt,togglePreview:tt,isConversationPreviewing:ce,addUserMessageWithConversation:jt,appendToMessageWithSave:_t,completeMessageWithSave:Ur}});function jw(r={}){const e=Bl(),t=300,n=5e3,s=250;let i=null,o=null,a=null,l=null,c=null,u=!1,h=!1;const f=E(!1),m=E(!1);let g=r;function v(z){g=z}async function y(){const z=g.getScrollPosition?.()??0,L=await e.checkAndRefresh();return L&&g.setScrollPosition&&(await tn(),g.setScrollPosition(z)),L}function k(){return f.value||!!e.activeContextMenu||!!e.activeDialog}async function $(){if(k()){m.value=!0;return}A()}async function T(){if(u){h=!0;return}u=!0;try{await y()}finally{u=!1,h&&(h=!1,A())}}function A(){o&&clearTimeout(o),o=setTimeout(()=>{o=null,T()},s)}function Z(z){if(typeof window>"u")return;if(a&&a.readyState===WebSocket.OPEN){a.send(JSON.stringify({type:"watch",workingDirectory:z}));return}l&&(clearTimeout(l),l=null);const q=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/git-watcher-ws`;a=new WebSocket(q),a.onopen=()=>{a.send(JSON.stringify({type:"watch",workingDirectory:z}))},a.onmessage=w=>{try{JSON.parse(w.data).type==="git_changed"&&$()}catch{}},a.onclose=()=>{a=null,e.isPollingActive&&c&&(l=setTimeout(()=>{c&&Z(c)},n))},a.onerror=()=>{}}function Y(){l&&(clearTimeout(l),l=null),a&&(a.close(),a=null)}function V(z){z&&(c=z),!e.isPollingActive&&(e.startPolling(),c&&Z(c))}function re(){Y(),e.stopPolling()}function me(){f.value=!0,i&&(clearTimeout(i),i=null)}function J(){i&&clearTimeout(i),i=setTimeout(async()=>{f.value=!1,m.value&&(m.value=!1,A())},t)}function W(){re(),i&&(clearTimeout(i),i=null),o&&(clearTimeout(o),o=null),u=!1,h=!1,c=null}return ze(()=>[e.activeContextMenu,e.activeDialog],()=>{!e.activeContextMenu&&!e.activeDialog&&m.value&&!f.value&&(m.value=!1,A())}),{isUserInteracting:Me(f),isDeferredRefresh:Me(m),startPolling:V,stopPolling:re,startInteraction:me,endInteraction:J,cleanup:W,setScrollCallbacks:v}}function qw(r){function e(s){if((s.ctrlKey||s.metaKey)&&s.key==="h"){s.preventDefault(),r.onScrollToHead();return}if(s.key==="Escape"){s.preventDefault(),r.onEscape();return}}function t(){document.addEventListener("keydown",e)}function n(){document.removeEventListener("keydown",e)}return{start:t,stop:n}}const Yw={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},Fw={class:"text-sm font-mono text-retro-cyan"},Uw={class:"text-xs font-mono text-retro-text mt-1 truncate"},Gw={class:"space-y-3"},Hw={class:"flex items-start gap-2 cursor-pointer group"},Kw={class:"flex items-start gap-2 cursor-pointer group"},Jw=Be({__name:"CherryPickDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e,n=E(!1),s=E(!1);function i(){t("confirm",{recordOrigin:n.value,noCommit:s.value})}function o(){n.value=!1,s.value=!1,t("close")}return(a,l)=>(O(),ge($r,{title:"Cherry-Pick Commit",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Cherry-Pick",onClose:o,onConfirm:i},{default:kt(()=>[d("div",Yw,[l[2]||(l[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Commit",-1)),d("div",Fw,_(r.commitHash.slice(0,7)),1),d("div",Uw,_(r.commitMessage.split(`
66
66
  `)[0]),1)]),d("div",Gw,[d("label",Hw,[Ue(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>ot(n)?n.value=c:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[qr,p(n)]]),l[3]||(l[3]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Record origin (-x) "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"},' Append "(cherry picked from commit ...)" to the commit message ')],-1))]),d("label",Kw,[Ue(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>ot(s)?s.value=c:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[qr,p(s)]]),l[4]||(l[4]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," No commit "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Apply changes to the working directory without committing ")],-1))])])]),_:1},8,["visible","loading","error"]))}}),eS={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},tS={class:"text-sm font-mono text-retro-cyan"},rS={class:"mb-4"},nS={class:"flex items-start gap-2 cursor-pointer group"},sS=Be({__name:"CreateBranchDialog",props:{visible:{type:Boolean},fromCommit:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e,n=E(""),s=E(!0),i=N(()=>n.value.trim().length>0);function o(){i.value&&t("confirm",{name:n.value.trim(),checkout:s.value})}function a(){n.value="",s.value=!0,t("close")}return(l,c)=>(O(),ge($r,{title:"Create Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Create Branch",onClose:a,onConfirm:o},{default:kt(()=>[d("div",eS,[c[2]||(c[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"From",-1)),d("div",tS,_(r.fromCommit.slice(0,7)),1)]),d("div",rS,[c[3]||(c[3]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Branch name",-1)),Ue(d("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>ot(n)?n.value=u:null),type:"text",placeholder:"feature/my-branch",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[hr,p(n)]])]),d("label",nS,[Ue(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>ot(s)?s.value=u:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[qr,p(s)]]),c[4]||(c[4]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Switch to new branch "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Checkout the branch after creating it ")],-1))])]),_:1},8,["visible","loading","error"]))}}),iS=Be({__name:"CleanUntrackedDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e;return(n,s)=>(O(),ge($r,{title:"Clean Untracked Files",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Clean","confirm-danger":"",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("confirm"))},{default:kt(()=>[...s[2]||(s[2]=[d("div",{class:"space-y-3"},[d("p",{class:"text-retro-text text-sm font-mono"}," Remove all untracked files and directories from the working tree. "),d("p",{class:"text-retro-muted text-xs font-mono"},[Le(" This runs "),d("code",null,"git clean -fd"),Le(" and cannot be undone. ")])],-1)])]),_:1},8,["visible","loading","error"]))}}),oS={class:"text-retro-text text-sm font-mono mb-2"},aS={class:"text-retro-cyan"},lS={class:"space-y-3 mt-4"},cS={class:"flex items-center gap-2 cursor-pointer"},uS=Be({__name:"DeleteBranchDialog",props:{visible:{type:Boolean},branchName:{},isLocal:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E(!1);function i(){n("confirm",{force:s.value})}return ze(()=>t.visible,o=>{o&&(s.value=!1)}),(o,a)=>(O(),ge($r,{title:"Delete Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Delete","confirm-danger":!0,onClose:a[1]||(a[1]=l=>n("close")),onConfirm:i},{default:kt(()=>[a[4]||(a[4]=d("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),d("p",oS,[Le(" Delete "+_(r.isLocal?"local":"remote")+" branch ",1),d("span",aS,_(r.branchName),1),a[2]||(a[2]=Le("? ",-1))]),d("div",lS,[d("label",cS,[Ue(d("input",{"onUpdate:modelValue":a[0]||(a[0]=l=>ot(s)?s.value=l:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(s)]]),a[3]||(a[3]=d("span",{class:"text-retro-muted text-sm"},"Force delete (even if not fully merged)",-1))])])]),_:1},8,["visible","loading","error"]))}}),hS={class:"text-retro-text text-sm font-mono mb-4"},dS={class:"text-retro-cyan"},fS={class:"space-y-3"},pS={class:"flex items-center gap-2 cursor-pointer"},mS={class:"flex items-center gap-2 cursor-pointer"},gS={class:"flex items-center gap-2 cursor-pointer"},OS=Be({__name:"MergeDialog",props:{visible:{type:Boolean},branchName:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E(!1),i=E(!1),o=E(!1);function a(){n("confirm",{noCommit:s.value,noFastForward:i.value,squash:o.value})}return ze(()=>t.visible,l=>{l&&(s.value=!1,i.value=!1,o.value=!1)}),(l,c)=>(O(),ge($r,{title:"Merge Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Merge",onClose:c[3]||(c[3]=u=>n("close")),onConfirm:a},{default:kt(()=>[d("p",hS,[c[4]||(c[4]=Le(" Merge ",-1)),d("span",dS,_(r.branchName),1),c[5]||(c[5]=Le(" into current branch ",-1))]),d("div",fS,[d("label",pS,[Ue(d("input",{"onUpdate:modelValue":c[0]||(c[0]=u=>ot(s)?s.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(s)]]),c[6]||(c[6]=d("span",{class:"text-retro-muted text-sm"},"No commit (stage changes only)",-1))]),d("label",mS,[Ue(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>ot(i)?i.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(i)]]),c[7]||(c[7]=d("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),d("label",gS,[Ue(d("input",{"onUpdate:modelValue":c[2]||(c[2]=u=>ot(o)?o.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(o)]]),c[8]||(c[8]=d("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),vS={class:"text-retro-text text-sm font-mono mb-4"},bS={class:"text-retro-cyan"},xS={class:"space-y-3"},yS=["value"],kS={class:"flex items-center gap-2 cursor-pointer"},wS={class:"flex items-center gap-2 cursor-pointer"},SS=Be({__name:"PullDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E("origin"),i=E(!1),o=E(!1);function a(){n("confirm",{remote:s.value,noFastForward:i.value,squash:o.value})}return ze(()=>t.visible,l=>{l&&(s.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",i.value=!1,o.value=!1)}),(l,c)=>(O(),ge($r,{title:"Pull Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Pull",onClose:c[3]||(c[3]=u=>n("close")),onConfirm:a},{default:kt(()=>[d("p",vS,[c[4]||(c[4]=Le(" Pull ",-1)),d("span",bS,_(r.branchName),1),c[5]||(c[5]=Le(" from remote ",-1))]),d("div",xS,[d("div",null,[c[6]||(c[6]=d("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),Ue(d("select",{"onUpdate:modelValue":c[0]||(c[0]=u=>ot(s)?s.value=u:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(O(!0),b(ye,null,Ne(r.remotes,u=>(O(),b("option",{key:u,value:u},_(u),9,yS))),128))],512),[[Ws,p(s)]])]),d("label",kS,[Ue(d("input",{"onUpdate:modelValue":c[1]||(c[1]=u=>ot(i)?i.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(i)]]),c[7]||(c[7]=d("span",{class:"text-retro-muted text-sm"},"No fast-forward (always create merge commit)",-1))]),d("label",wS,[Ue(d("input",{"onUpdate:modelValue":c[2]||(c[2]=u=>ot(o)?o.value=u:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(o)]]),c[8]||(c[8]=d("span",{class:"text-retro-muted text-sm"},"Squash (combine all commits into one)",-1))])])]),_:1},8,["visible","loading","error"]))}}),$S={class:"text-retro-text text-sm font-mono mb-4"},CS={class:"text-retro-cyan"},QS={class:"space-y-3"},PS=["value"],TS={class:"flex items-center gap-2 cursor-pointer"},MS=["checked"],AS={class:"flex items-center gap-2 cursor-pointer"},_S=["checked"],RS={key:0,class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},ES=Be({__name:"PushDialog",props:{visible:{type:Boolean},branchName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E("origin"),i=E(!1),o=E(!1);function a(u){i.value=u,u&&(o.value=!1)}function l(u){o.value=u,u&&(i.value=!1)}function c(){n("confirm",{remote:s.value,force:i.value,forceWithLease:o.value})}return ze(()=>t.visible,u=>{u&&(s.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin",i.value=!1,o.value=!1)}),(u,h)=>(O(),ge($r,{title:"Push Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Push",onClose:h[3]||(h[3]=f=>n("close")),onConfirm:c},{default:kt(()=>[d("p",$S,[h[4]||(h[4]=Le(" Push ",-1)),d("span",CS,_(r.branchName),1),h[5]||(h[5]=Le(" to remote ",-1))]),d("div",QS,[d("div",null,[h[6]||(h[6]=d("label",{class:"text-retro-muted text-sm block mb-1"},"Remote",-1)),Ue(d("select",{"onUpdate:modelValue":h[0]||(h[0]=f=>ot(s)?s.value=f:null),class:"w-full bg-retro-panel border border-retro-border rounded text-retro-text text-sm px-2 py-1.5 font-mono focus:outline-none focus:border-retro-cyan"},[(O(!0),b(ye,null,Ne(r.remotes,f=>(O(),b("option",{key:f,value:f},_(f),9,PS))),128))],512),[[Ws,p(s)]])]),d("label",TS,[d("input",{checked:p(i),type:"checkbox",class:"accent-retro-cyan",onChange:h[1]||(h[1]=f=>a(f.target.checked))},null,40,MS),h[7]||(h[7]=d("span",{class:"text-retro-muted text-sm"},"Force push",-1))]),d("label",AS,[d("input",{checked:p(o),type:"checkbox",class:"accent-retro-cyan",onChange:h[2]||(h[2]=f=>l(f.target.checked))},null,40,_S),h[8]||(h[8]=d("span",{class:"text-retro-muted text-sm"},"Force with lease (safer force push)",-1))]),p(i)||p(o)?(O(),b("div",RS,_(p(i)?"Force push will overwrite remote history. Use with caution.":"Force with lease will reject the push if the remote has been updated since your last fetch."),1)):X("",!0)])]),_:1},8,["visible","loading","error"]))}}),BS={class:"text-retro-text text-sm font-mono mb-4"},LS={class:"text-retro-cyan"},DS={class:"text-retro-cyan"},ZS={class:"p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"},IS={class:"text-retro-cyan"},XS={class:"text-retro-cyan"},zS=Be({__name:"RebaseDialog",props:{visible:{type:Boolean},branchName:{},ontoBranch:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e;return(n,s)=>(O(),ge($r,{title:"Rebase Branch",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Rebase",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("confirm"))},{default:kt(()=>[d("p",BS,[s[2]||(s[2]=Le(" Rebase ",-1)),d("span",LS,_(r.branchName),1),s[3]||(s[3]=Le(" onto ",-1)),d("span",DS,_(r.ontoBranch),1)]),d("div",ZS,[s[4]||(s[4]=Le(" This will rewrite commit history. Commits from ",-1)),d("span",IS,_(r.branchName),1),s[5]||(s[5]=Le(" will be replayed on top of ",-1)),d("span",XS,_(r.ontoBranch),1),s[6]||(s[6]=Le(". ",-1))])]),_:1},8,["visible","loading","error"]))}}),NS={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},VS={class:"text-sm font-mono text-retro-cyan"},WS={class:"text-xs font-mono text-retro-text mt-1 truncate"},jS={class:"space-y-2"},qS=["value"],YS={key:0,class:"mt-3 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},FS=Be({__name:"ResetDialog",props:{visible:{type:Boolean},commitHash:{},commitMessage:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e,n=E("mixed"),s=[{value:"soft",label:"Soft",description:"Move HEAD, keep staged changes and working directory"},{value:"mixed",label:"Mixed",description:"Move HEAD, reset staging area, keep working directory"},{value:"hard",label:"Hard",description:"Move HEAD, reset staging area and working directory (DESTRUCTIVE)"}];function i(){t("confirm",{mode:n.value})}function o(){n.value="mixed",t("close")}return(a,l)=>(O(),ge($r,{title:"Reset to Commit",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Reset","confirm-danger":p(n)==="hard",onClose:o,onConfirm:i},{default:kt(()=>[d("div",NS,[l[1]||(l[1]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"Reset to",-1)),d("div",VS,_(r.commitHash.slice(0,7)),1),d("div",WS,_(r.commitMessage.split(`
67
67
  `)[0]),1)]),d("div",jS,[l[2]||(l[2]=d("div",{class:"text-xs font-mono text-retro-muted mb-2"},"Reset mode",-1)),(O(),b(ye,null,Ne(s,c=>d("label",{key:c.value,class:Ce(["flex items-start gap-2 p-2 rounded cursor-pointer group border transition-colors",[p(n)===c.value?"border-retro-cyan bg-retro-cyan/5":"border-transparent hover:bg-retro-panel"]])},[Ue(d("input",{"onUpdate:modelValue":l[0]||(l[0]=u=>ot(n)?n.value=u:null),type:"radio",name:"reset-mode",value:c.value,class:"mt-0.5 accent-retro-cyan"},null,8,qS),[[Gc,p(n)]]),d("div",null,[d("span",{class:Ce(["text-sm font-mono transition-colors",[c.value==="hard"?"text-retro-red":"text-retro-text",p(n)===c.value?"text-retro-cyan":""]])},_(c.label),3),d("p",{class:Ce(["text-xs font-mono mt-0.5",c.value==="hard"?"text-retro-red/70":"text-retro-muted"])},_(c.description),3)])],2)),64))]),p(n)==="hard"?(O(),b("div",YS," Warning: Hard reset will permanently discard all uncommitted changes in your working directory and staging area. This action cannot be undone. ")):X("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),US={class:"space-y-3"},GS={class:"flex items-start gap-2 cursor-pointer"},HS={class:"flex items-start gap-2 cursor-pointer"},KS={key:0,class:"mt-4 p-2 text-xs font-mono text-retro-red bg-retro-red/10 border border-retro-red/30 rounded"},JS=Be({__name:"ResetWorkingDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E("mixed"),i=N(()=>s.value==="hard");function o(){n("confirm",{mode:s.value})}return ze(()=>t.visible,a=>{a&&(s.value="mixed")}),(a,l)=>(O(),ge($r,{title:"Reset Working Directory",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Reset","confirm-danger":p(i),onClose:l[2]||(l[2]=c=>n("close")),onConfirm:o},{default:kt(()=>[l[5]||(l[5]=d("p",{class:"text-retro-text text-sm font-mono mb-4"}," Reset the working directory to HEAD. ",-1)),d("div",US,[d("label",GS,[Ue(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>ot(s)?s.value=c:null),type:"radio",value:"mixed",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[Gc,p(s)]]),l[3]||(l[3]=d("div",null,[d("span",{class:"text-retro-text text-sm font-mono"},"Mixed"),d("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area, keep working directory ")],-1))]),d("label",HS,[Ue(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>ot(s)?s.value=c:null),type:"radio",value:"hard",name:"reset-mode",class:"accent-retro-cyan mt-0.5"},null,512),[[Gc,p(s)]]),l[4]||(l[4]=d("div",null,[d("span",{class:"text-retro-text text-sm font-mono"},"Hard"),d("p",{class:"text-retro-muted text-xs font-mono mt-0.5"}," Reset staging area AND working directory (DESTRUCTIVE) ")],-1))])]),p(i)?(O(),b("div",KS," WARNING: Hard reset will permanently discard all uncommitted changes. This cannot be undone. ")):X("",!0)]),_:1},8,["visible","loading","error","confirm-danger"]))}}),e2={class:"space-y-4"},t2={class:"flex items-center gap-2 cursor-pointer"},r2=Be({__name:"StashDialog",props:{visible:{type:Boolean},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E(""),i=E(!1);function o(){n("confirm",{message:s.value.trim()||void 0,includeUntracked:i.value})}return ze(()=>t.visible,a=>{a&&(s.value="",i.value=!1)}),(a,l)=>(O(),ge($r,{title:"Stash Changes",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Stash",onClose:l[2]||(l[2]=c=>n("close")),onConfirm:o},{default:kt(()=>[l[5]||(l[5]=d("p",{class:"text-retro-text text-sm font-mono mb-4"}," Save uncommitted changes to the stash. ",-1)),d("div",e2,[d("div",null,[l[3]||(l[3]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message (optional)",-1)),Ue(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>ot(s)?s.value=c:null),type:"text",placeholder:"Stash description...",class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted/50 focus:outline-none focus:border-retro-cyan"},null,512),[[hr,p(s)]])]),d("label",t2,[Ue(d("input",{"onUpdate:modelValue":l[1]||(l[1]=c=>ot(i)?i.value=c:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(i)]]),l[4]||(l[4]=d("span",{class:"text-retro-muted text-sm"},"Include untracked files",-1))])])]),_:1},8,["visible","loading","error"]))}}),n2={class:"mb-4 p-3 bg-retro-panel border border-retro-border rounded"},s2={class:"text-sm font-mono text-retro-cyan"},i2={class:"mb-4"},o2={class:"mb-3"},a2={class:"flex items-start gap-2 cursor-pointer group"},l2={key:0,class:"mb-4"},c2={class:"space-y-2"},u2={class:"flex items-start gap-2 cursor-pointer group"},h2=["disabled"],d2={key:0,class:"ml-6"},f2=["value"],p2=Be({__name:"TagCreateDialog",props:{visible:{type:Boolean},commitHash:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=e,n=E(""),s=E(!1),i=E(""),o=E(!1),a=E(""),l=N(()=>n.value.trim().length>0);function c(){if(!l.value)return;const h={name:n.value.trim(),annotated:s.value};s.value&&i.value.trim()&&(h.message=i.value.trim()),o.value&&a.value&&(h.pushToRemote=a.value),t("confirm",h)}function u(){n.value="",s.value=!1,i.value="",o.value=!1,a.value="",t("close")}return ze(()=>s.value,h=>{h||(i.value="")}),(h,f)=>(O(),ge($r,{title:"Create Tag",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Create Tag",onClose:u,onConfirm:c},{default:kt(()=>[d("div",n2,[f[5]||(f[5]=d("div",{class:"text-xs font-mono text-retro-muted mb-1"},"At commit",-1)),d("div",s2,_(r.commitHash.slice(0,7)),1)]),d("div",i2,[f[6]||(f[6]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag name",-1)),Ue(d("input",{"onUpdate:modelValue":f[0]||(f[0]=m=>ot(n)?n.value=m:null),type:"text",placeholder:"v1.0.0",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan"},null,512),[[hr,p(n)]])]),d("div",o2,[d("label",a2,[Ue(d("input",{"onUpdate:modelValue":f[1]||(f[1]=m=>ot(s)?s.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan"},null,512),[[qr,p(s)]]),f[7]||(f[7]=d("div",null,[d("span",{class:"text-sm font-mono text-retro-text group-hover:text-retro-cyan transition-colors"}," Annotated tag "),d("p",{class:"text-xs font-mono text-retro-muted mt-0.5"}," Create a full tag object with message and tagger info ")],-1))])]),p(s)?(O(),b("div",l2,[f[8]||(f[8]=d("label",{class:"block text-xs font-mono text-retro-muted mb-1.5"},"Tag message",-1)),Ue(d("textarea",{"onUpdate:modelValue":f[2]||(f[2]=m=>ot(i)?i.value=m:null),rows:"3",placeholder:"Release description...",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan resize-none"},null,512),[[hr,p(i)]])])):X("",!0),d("div",c2,[d("label",u2,[Ue(d("input",{"onUpdate:modelValue":f[3]||(f[3]=m=>ot(o)?o.value=m:null),type:"checkbox",class:"mt-0.5 accent-retro-cyan",disabled:r.remotes.length===0},null,8,h2),[[qr,p(o)]]),d("div",null,[d("span",{class:Ce(["text-sm font-mono transition-colors",r.remotes.length===0?"text-retro-muted":"text-retro-text group-hover:text-retro-cyan"])}," Push to remote ",2)])]),p(o)&&r.remotes.length>0?(O(),b("div",d2,[Ue(d("select",{"onUpdate:modelValue":f[4]||(f[4]=m=>ot(a)?a.value=m:null),class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[f[9]||(f[9]=d("option",{value:"",disabled:"",class:"text-retro-muted"},"Select remote",-1)),(O(!0),b(ye,null,Ne(r.remotes,m=>(O(),b("option",{key:m,value:m},_(m),9,f2))),128))],512),[[Ws,p(a)]])])):X("",!0)])]),_:1},8,["visible","loading","error"]))}}),m2={class:"text-retro-text text-sm font-mono mb-2"},g2={class:"text-retro-cyan"},O2={class:"space-y-3 mt-4"},v2={class:"flex items-center gap-2 cursor-pointer"},b2={key:0,class:"ml-6"},x2=["value"],y2=Be({__name:"TagDeleteDialog",props:{visible:{type:Boolean},tagName:{},remotes:{},loading:{type:Boolean,default:!1},error:{default:null}},emits:["close","confirm"],setup(r,{emit:e}){const t=r,n=e,s=E(!1),i=E("origin");function o(){n("confirm",{deleteFromRemote:s.value,remote:s.value?i.value:void 0})}return ze(()=>t.visible,a=>{a&&(s.value=!1,i.value=t.remotes.includes("origin")?"origin":t.remotes[0]??"origin")}),(a,l)=>(O(),ge($r,{title:"Delete Tag",visible:r.visible,loading:r.loading,error:r.error,"confirm-label":"Delete","confirm-danger":!0,onClose:l[2]||(l[2]=c=>n("close")),onConfirm:o},{default:kt(()=>[l[7]||(l[7]=d("div",{class:"mb-4 p-2 text-xs font-mono text-retro-yellow bg-retro-yellow/10 border border-retro-yellow/30 rounded"}," This action is permanent and cannot be undone. ",-1)),d("p",m2,[l[3]||(l[3]=Le(" Delete tag ",-1)),d("span",g2,_(r.tagName),1),l[4]||(l[4]=Le("? ",-1))]),d("div",O2,[d("label",v2,[Ue(d("input",{"onUpdate:modelValue":l[0]||(l[0]=c=>ot(s)?s.value=c:null),type:"checkbox",class:"accent-retro-cyan"},null,512),[[qr,p(s)]]),l[5]||(l[5]=d("span",{class:"text-retro-muted text-sm"},"Also delete from remote",-1))]),p(s)?(O(),b("div",b2,[l[6]||(l[6]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Remote",-1)),Ue(d("select",{"onUpdate:modelValue":l[1]||(l[1]=c=>ot(i)?i.value=c:null),class:"w-full px-2 py-1.5 text-sm font-mono bg-retro-panel border border-retro-border rounded text-retro-text focus:outline-none focus:border-retro-cyan"},[(O(!0),b(ye,null,Ne(r.remotes,c=>(O(),b("option",{key:c,value:c},_(c),9,x2))),128))],512),[[Ws,p(i)]])])):X("",!0)])]),_:1},8,["visible","loading","error"]))}}),k2={class:"mb-4"},w2={class:"text-retro-cyan text-sm font-mono"},S2={class:"mb-4"},$2={class:"text-retro-text text-sm font-mono"},C2={class:"mb-4"},Q2={class:"text-retro-text text-sm font-mono break-all select-all"},P2={class:"mb-4"},T2={class:"text-retro-text text-sm font-mono"},M2={class:"text-retro-muted"},A2={class:"mb-4"},_2={class:"text-retro-text text-sm font-mono"},R2={key:1,class:"mb-2"},E2={class:"p-2 text-sm font-mono text-retro-text bg-retro-panel border border-retro-border rounded whitespace-pre-wrap"},B2={key:1,class:"text-retro-muted text-sm font-mono text-center py-4"},L2=Be({__name:"TagDetailDialog",props:{visible:{type:Boolean},tagName:{},tagDetail:{},loading:{type:Boolean,default:!1}},emits:["close"],setup(r,{emit:e}){const t=e;return(n,s)=>(O(),ge($r,{title:"Tag Details",visible:r.visible,loading:r.loading,"confirm-label":"Close","cancel-label":"Close",onClose:s[0]||(s[0]=i=>t("close")),onConfirm:s[1]||(s[1]=i=>t("close"))},{default:kt(()=>[d("div",k2,[s[2]||(s[2]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tag",-1)),d("p",w2,_(r.tagName),1)]),r.tagDetail?(O(),b(ye,{key:0},[d("div",S2,[s[3]||(s[3]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Type",-1)),d("p",$2,_(r.tagDetail.isAnnotated?"Annotated":"Lightweight"),1)]),d("div",C2,[s[4]||(s[4]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Hash",-1)),d("p",Q2,_(r.tagDetail.hash),1)]),r.tagDetail.tagger?(O(),b(ye,{key:0},[d("div",P2,[s[5]||(s[5]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Tagger",-1)),d("p",T2,[Le(_(r.tagDetail.tagger.name)+" ",1),d("span",M2,"<"+_(r.tagDetail.tagger.email)+">",1)])]),d("div",A2,[s[6]||(s[6]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Date",-1)),d("p",_2,_(r.tagDetail.tagger.date),1)])],64)):X("",!0),r.tagDetail.message?(O(),b("div",R2,[s[7]||(s[7]=d("label",{class:"block text-retro-muted text-xs font-mono mb-1"},"Message",-1)),d("div",E2,_(r.tagDetail.message),1)])):X("",!0)],64)):r.loading?(O(),b("div",B2," Loading tag details... ")):X("",!0)]),_:1},8,["visible","loading"]))}}),Th=globalThis.setInterval,D2={class:"h-full flex flex-col bg-retro-dark",role:"region","aria-label":"Git Graph"},Z2={key:0,class:"flex-1 flex flex-col items-center justify-center gap-3"},I2={key:1,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},X2={key:2,class:"flex-1 flex flex-col items-center justify-center p-8 text-center"},z2={class:"text-retro-red text-sm mb-4"},N2={key:3,class:"flex-1 flex items-center justify-center p-4"},V2={class:"flex-shrink-0 flex items-center gap-2 p-2 border-b border-retro-border"},W2={class:"relative"},j2={key:0,class:"absolute left-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-2 min-w-[200px]"},q2={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},Y2=["checked"],F2={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},U2=["checked"],G2={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},H2=["checked"],K2={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},J2=["checked"],e$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},t$=["checked"],r$={class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},n$=["checked"],s$={class:"relative"},i$=["aria-expanded"],o$={key:0,class:"text-xs"},a$={key:0,class:"absolute right-0 top-full mt-1 z-10 bg-retro-panel border border-retro-border rounded shadow-lg py-1 min-w-[220px] max-h-[400px] overflow-auto"},l$=["checked","onChange"],c$={class:"text-sm text-retro-text truncate"},u$={key:0,class:"text-[10px] text-retro-cyan"},h$={class:"px-3 py-1 text-[10px] text-retro-orange font-semibold uppercase tracking-wider mt-1"},d$=["checked","onChange"],f$={class:"text-sm text-retro-text truncate"},p$={class:"relative"},m$={key:0,class:"absolute right-0 top-full mt-1 z-20"},g$=["title"],O$={class:"text-retro-muted text-sm"},v$={class:"text-retro-cyan font-mono"},b$={class:"space-y-3"},x$={class:"text-retro-muted text-sm"},y$={class:"text-retro-cyan font-mono"},k$={class:"space-y-3"},w$={class:"text-retro-muted text-sm"},S$={class:"text-retro-magenta font-mono"},$$={key:0,class:"fixed bottom-4 right-4 z-50 flex items-center gap-2 px-4 py-2.5 text-sm bg-retro-red/90 text-white rounded-lg shadow-lg max-w-sm",role:"alert"},C$={class:"flex-1"},Q$=Be({__name:"GitGraph",props:{workingDirectory:{},isActive:{type:Boolean,default:!0}},setup(r){const e=r,t=Bl(),n=pn(),s=jw(),i=N(()=>{const C=n.activeConversation?.worktreeBranch;return C?[C]:[]}),o=N(()=>{const C=[],P=t.selectedFeatureId;P&&C.push(P);const ve=t.conversationBranch;return ve&&!C.includes(ve)&&C.push(ve),C});ze(()=>[n.activeConversation?.worktreeBranch,n.activeConversation?.baseBranch],([C,P])=>{t.setConversationBranch(C??null,P??null)},{immediate:!0});const a=N(()=>{const C=t.previewBranch;return C?[C]:[]});ze(()=>[n.previewingConversation?.worktreeBranch,n.previewingConversation?.baseBranch],([C,P])=>{t.setPreviewBranch(C??null,P??null)},{immediate:!0});const l=N(()=>{const C={};return t.previewBranch&&t.previewMergeBase&&(C[t.previewBranch]=t.previewMergeBase),C}),c=N(()=>{const C={};return t.selectedFeatureId&&t.featureMergeBase&&(C[t.selectedFeatureId]=t.featureMergeBase),t.conversationBranch&&t.conversationMergeBase&&(C[t.conversationBranch]=t.conversationMergeBase),C}),u=N(()=>t.remotes.map(C=>C.name)),h=E(null);ze(()=>e.workingDirectory,async C=>{if(C){await t.loadGitGraph(C);const P=n.previewingConversation?.worktreeBranch;P&&await t.setPreviewBranch(P,n.previewingConversation?.baseBranch??null);const ve=n.activeConversation?.worktreeBranch;ve&&await t.setConversationBranch(ve,n.activeConversation?.baseBranch??null)}},{immediate:!0}),ze(()=>e.isActive,C=>{C&&t.commits.length>0&&!t.error?s.startPolling(e.workingDirectory):s.stopPolling()},{immediate:!0}),ze(()=>t.commits.length,C=>{C>0&&e.isActive&&!t.error&&s.startPolling(e.workingDirectory)}),ze(()=>h.value,C=>{C&&s.setScrollCallbacks({getScrollPosition:()=>C.getScrollPosition(),setScrollPosition:P=>C.setScrollPosition(P)})}),Ht(()=>{s.cleanup(),t.reset()});const f=N(()=>t.error?.includes("Not a Git repository")),m=E(Date.now());let g=null;const v=()=>{g||(g=Th(()=>{m.value=Date.now()},5e3))},y=()=>{g&&(clearInterval(g),g=null)};zt(()=>{ze(()=>e.isActive,C=>{C?(m.value=Date.now(),v()):y()},{immediate:!0})}),Ht(()=>{y()});const k=N(()=>{const C=t.lastRefreshTime;if(!C)return null;const P=Math.floor((m.value-C)/1e3);return t.isRefreshing?"Syncing...":P<5?"Just now":P<60?`${P}s ago`:`${Math.floor(P/60)}m ago`}),$=E(!1),T=E(!1),A=E(null);function Z(){$.value=!0,tn(()=>A.value?.focus())}function Y(){$.value=!1,t.setSearchQuery("")}function V(C){t.setSearchQuery(C)}const re=qw({onScrollToHead:()=>{const C=t.commits.find(P=>P.isHead);C&&t.selectCommit(C)},onEscape:()=>{me.value?me.value=!1:T.value?T.value=!1:J.value?J.value=!1:$.value?Y():t.isComparing?t.clearComparison():(t.selectedCommit||t.isUncommittedChangesSelected)&&t.clearSelection()}});zt(()=>{re.start()}),Ht(()=>{re.stop()});const me=E(!1),J=E(!1);async function W(){await t.fetchAll(!0)}async function z(C){await t.addRemote(C.name,C.url)}async function L(C){await t.editRemote(C.name,C.newUrl)}async function q(C){await t.deleteRemote(C)}const w=N(()=>{const C=[],P={};for(const ve of t.branches)if(t.localBranchNames.has(ve.name))C.push(ve);else{const Re=ve.name.indexOf("/");if(Re>0){const Fe=ve.name.substring(0,Re);P[Fe]||(P[Fe]=[]),P[Fe].push(ve)}else C.push(ve)}return{local:C,remotes:P}}),x=E({visible:!1,branch:"",x:0,y:0,isCurrentBranch:!1,isLocal:!0,commitHash:""});function S(C){x.value={visible:!0,...C},t.setActiveContextMenu({type:"branch",props:C,position:{x:C.x,y:C.y}})}function Q(){x.value.visible=!1,t.clearActiveContextMenu()}function G(){Q(),Zt.value={visible:!0,branchName:x.value.branch,loading:!1,error:null}}function H(){const C=x.value.branch;Q(),bt.value={visible:!0,branchName:C,newName:C,loading:!1,error:null}}function fe(){const{branch:C,isLocal:P}=x.value;Q(),Rt.value={visible:!0,branchName:C,isLocal:P,force:!1,loading:!1,error:null}}function ce(){const C=x.value.branch;Q(),Et.value={visible:!0,branchName:C,loading:!1,error:null}}function K(){const C=x.value.branch;Q(),et.value={visible:!0,branchName:C,loading:!1,error:null}}function oe(){const C=x.value.branch;Q(),Mt.value={visible:!0,branchName:C,loading:!1,error:null}}function ae(){const C=x.value.branch;Q(),At.value={visible:!0,branchName:C,loading:!1,error:null}}async function ee(){const C=x.value.branch;Q(),await t.fetchBranch(C)}async function ue(){const C=x.value.branch;Q(),await t.copyToClipboard(C),R(x.value.x,x.value.y)}function pe(){Q(),He.value={visible:!0,fromCommit:x.value.commitHash,loading:!1,error:null}}const Xe=E({visible:!1,commit:null,x:0,y:0});function nt(C){Xe.value={visible:!0,commit:C.commit,x:C.x,y:C.y},t.setActiveContextMenu({type:"commit",props:C,position:{x:C.x,y:C.y}})}function $t(){Xe.value.visible=!1,t.clearActiveContextMenu()}function Ot(C){const P=Xe.value.commit;if(!P)return!1;$t();const ve=C(P);return ve&&typeof ve.then=="function"?ve.then(()=>!0):!0}function Pt(){Ot(C=>{Lt.value={visible:!0,commitHash:C.hash,loading:!1,error:null}})}function vt(){Ot(C=>{He.value={visible:!0,fromCommit:C.hash,loading:!1,error:null}})}function Oe(){Ot(C=>{Zt.value={visible:!0,branchName:C.hash,loading:!1,error:null}})}function de(){Ot(C=>{mt.value={visible:!0,commitHash:C.hash,commitMessage:C.message,loading:!1,error:null}})}async function _e(){await Ot(C=>t.revertCommit(C.hash))}function Ze(){Ot(C=>{Et.value={visible:!0,branchName:C.shortHash,loading:!1,error:null}})}function je(){Ot(C=>{Bt.value={visible:!0,commitHash:C.hash,commitMessage:C.message,loading:!1,error:null}})}async function Ge(){const{x:C,y:P}=Xe.value;await Ot(Re=>t.copyToClipboard(Re.hash))&&R(C,P)}async function Vt(){await Ot(C=>t.copyCommitSubject(C))}const ut=E({visible:!1,tag:"",x:0,y:0,commitHash:""});function Or(C){ut.value={visible:!0,...C},t.setActiveContextMenu({type:"tag",props:C,position:{x:C.x,y:C.y}})}function Jt(){ut.value.visible=!1,t.clearActiveContextMenu()}async function er(){const C=ut.value.tag;Jt(),he.value={visible:!0,tagName:C,loading:!0,tagDetail:null};const P=await t.getTagDetail(C);he.value.loading=!1,P.success&&P.data&&(he.value.tagDetail=P.data)}function Cr(){const C=ut.value.tag;Jt(),$e.value={visible:!0,tagName:C,loading:!1,error:null}}async function Wt(){const C=ut.value.tag;Jt(),await t.pushTag(C)}async function Lr(){const C=ut.value.tag;Jt(),await t.copyToClipboard(C),R(ut.value.x,ut.value.y)}const Qr=E({visible:!1,x:0,y:0});function Dr(){Qr.value.visible=!1,t.clearActiveContextMenu()}function tr(){Dr(),ke.value={visible:!0,loading:!1,error:null}}function fr(){Dr(),Ct.value={visible:!0,loading:!1,error:null}}async function Zr(){Dr(),jt.value={visible:!0,loading:!1,error:null}}const F=E({visible:!1,stash:null,x:0,y:0});function le(C){F.value={visible:!0,stash:C.stash,x:C.x,y:C.y},t.setActiveContextMenu({type:"stash",props:C,position:{x:C.x,y:C.y}})}function ie(){F.value.visible=!1,t.clearActiveContextMenu()}function be(C){const P=F.value.stash;if(!P)return!1;ie();const ve=C(P);return ve&&typeof ve.then=="function"?ve.then(()=>!0):!0}async function Te(){await be(C=>t.applyStash(C.index))}async function qe(){await be(C=>t.popStash(C.index))}async function Ve(){await be(C=>t.dropStash(C.index))}function st(){be(C=>{tt.value={visible:!0,stashIndex:C.index,loading:!1,error:null}})}async function ws(){const{x:C,y:P}=F.value;await be(Re=>t.copyToClipboard(`stash@{${Re.index}}`))&&R(C,P)}async function an(){const{x:C,y:P}=F.value;await be(Re=>t.copyToClipboard(Re.hash))&&R(C,P)}const Zt=E({visible:!1,branchName:"",loading:!1,error:null});async function Ss(){Zt.value.loading=!0,Zt.value.error=null;const C=await t.checkoutBranch(Zt.value.branchName);Zt.value.loading=!1,C.success?Zt.value.visible=!1:Zt.value.error=C.error||"Unknown error"}const He=E({visible:!1,fromCommit:"",loading:!1,error:null});async function Fr(C){He.value.loading=!0,He.value.error=null;const P=await t.createBranch(C.name,He.value.fromCommit);He.value.loading=!1,P.success?(C.checkout&&await t.checkoutBranch(C.name),He.value.visible=!1):He.value.error=P.error||"Unknown error"}const Rt=E({visible:!1,branchName:"",isLocal:!0,force:!1,loading:!1,error:null});async function rs(C){Rt.value.loading=!0,Rt.value.error=null;const{branchName:P,isLocal:ve}=Rt.value,Re=C?.force??Rt.value.force,Fe=ve?await t.deleteLocalBranch(P,Re):await t.deleteRemoteBranch(P);Rt.value.loading=!1,Fe.success?Rt.value.visible=!1:Rt.value.error=Fe.error||"Unknown error"}const bt=E({visible:!1,branchName:"",newName:"",loading:!1,error:null});async function Zn(){if(!bt.value.newName.trim()){bt.value.error="Branch name is required";return}bt.value.loading=!0,bt.value.error=null;const C=await t.renameBranch(bt.value.branchName,bt.value.newName.trim());bt.value.loading=!1,C.success?bt.value.visible=!1:bt.value.error=C.error||"Unknown error"}const Et=E({visible:!1,branchName:"",loading:!1,error:null});async function rr(C){Et.value.loading=!0,Et.value.error=null;const P=await t.mergeBranch(Et.value.branchName,C);Et.value.loading=!1,P.success?Et.value.visible=!1:Et.value.error=P.error||"Unknown error"}const et=E({visible:!1,branchName:"",loading:!1,error:null});async function Pr(){et.value.loading=!0,et.value.error=null;const C=await t.rebaseBranch(et.value.branchName);et.value.loading=!1,C.success?et.value.visible=!1:et.value.error=C.error||"Unknown error"}const Mt=E({visible:!1,branchName:"",loading:!1,error:null});async function On(C){Mt.value.loading=!0,Mt.value.error=null;const P=await t.pushBranch(Mt.value.branchName,C.remote,C.force,C.forceWithLease);Mt.value.loading=!1,P.success?Mt.value.visible=!1:Mt.value.error=P.error||"Unknown error"}const At=E({visible:!1,branchName:"",loading:!1,error:null});async function In(C){At.value.loading=!0,At.value.error=null;const P=await t.pullBranch(At.value.branchName,C.remote,C.noFastForward,C.squash);At.value.loading=!1,P.success?At.value.visible=!1:At.value.error=P.error||"Unknown error"}const mt=E({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function ns(C){mt.value.loading=!0,mt.value.error=null;const P=await t.cherryPickCommit(mt.value.commitHash,C.recordOrigin,C.noCommit);mt.value.loading=!1,P.success?mt.value.visible=!1:mt.value.error=P.error||"Unknown error"}const Bt=E({visible:!1,commitHash:"",commitMessage:"",loading:!1,error:null});async function vn(C){Bt.value.loading=!0,Bt.value.error=null;const P=await t.resetToCommit(Bt.value.commitHash,C.mode);Bt.value.loading=!1,P.success?Bt.value.visible=!1:Bt.value.error=P.error||"Unknown error"}const Lt=E({visible:!1,commitHash:"",loading:!1,error:null});async function $s(C){Lt.value.loading=!0,Lt.value.error=null;const P=await t.createTag(C.name,Lt.value.commitHash,C.annotated,C.message,C.pushToRemote);Lt.value.loading=!1,P.success?Lt.value.visible=!1:Lt.value.error=P.error||"Unknown error"}const $e=E({visible:!1,tagName:"",loading:!1,error:null});async function D(C){$e.value.loading=!0,$e.value.error=null;const P=await t.deleteTag($e.value.tagName,C.deleteFromRemote?C.remote||"origin":void 0);$e.value.loading=!1,P.success?$e.value.visible=!1:$e.value.error=P.error||"Unknown error"}const he=E({visible:!1,tagName:"",loading:!1,tagDetail:null}),ke=E({visible:!1,loading:!1,error:null});async function lt(C){ke.value.loading=!0,ke.value.error=null;const P=await t.stashChanges(C.message,C.includeUntracked);ke.value.loading=!1,P.success?ke.value.visible=!1:ke.value.error=P.error||"Unknown error"}const tt=E({visible:!1,stashIndex:0,loading:!1,error:null}),ht=E("");async function It(C){tt.value.loading=!0,tt.value.error=null;const P=await t.stashBranch(tt.value.stashIndex,C);tt.value.loading=!1,P.success?tt.value.visible=!1:tt.value.error=P.error||"Unknown error"}const Ct=E({visible:!1,loading:!1,error:null});async function Tr(C){Ct.value.loading=!0,Ct.value.error=null;const P=await t.resetWorking(C.mode);Ct.value.loading=!1,P.success?Ct.value.visible=!1:Ct.value.error=P.error||"Unknown error"}const jt=E({visible:!1,loading:!1,error:null});async function _t(){jt.value.loading=!0,jt.value.error=null;const C=await t.cleanUntracked();jt.value.loading=!1,C.success?jt.value.visible=!1:jt.value.error=C.error||"Unknown error"}const Ur=E({visible:!1,x:0,y:0});function R(C,P){Ur.value={visible:!0,x:C,y:P},setTimeout(()=>{Ur.value.visible=!1},1500)}const I=N(()=>Zt.value.visible||He.value.visible||Rt.value.visible||bt.value.visible||Et.value.visible||et.value.visible||Mt.value.visible||At.value.visible||mt.value.visible||Bt.value.visible||Lt.value.visible||$e.value.visible||he.value.visible||ke.value.visible||tt.value.visible||Ct.value.visible||jt.value.visible);ze(I,C=>{C?t.setActiveDialog({type:"generic",props:{}}):t.clearActiveDialog()});function B(C){t.selectedCommit?t.selectComparisonCommit(C):t.selectCommit(C)}function U(C){t.navigateToCommit(C)}return(C,P)=>{const ve=Qb,Re=Nb,Fe=px,xt=Ex,Ft=ew,ss=ww,Xn=Tw,Kl=Mw,Jl=Aw,Uo=_w,Mi=Rw,Ai=$r;return O(),b("div",D2,[p(t).loading&&p(t).commits.length===0?(O(),b("div",Z2,[...P[42]||(P[42]=[d("div",{class:"w-6 h-6 border-2 border-retro-muted border-t-retro-cyan rounded-full animate-spin"},null,-1),d("div",{class:"text-retro-muted text-sm"},"Loading git history...",-1)])])):p(f)?(O(),b("div",I2,[te(p(fs),{class:"w-12 h-12 text-retro-yellow mb-4"}),P[43]||(P[43]=d("h3",{class:"text-retro-text font-semibold mb-2"},"Not a Git Repository",-1)),P[44]||(P[44]=d("p",{class:"text-retro-muted text-sm max-w-xs"},[Le(" This directory is not initialized as a Git repository. Run "),d("code",{class:"text-retro-cyan"},"git init"),Le(" to get started. ")],-1))])):p(t).error?(O(),b("div",X2,[te(p(fs),{class:"w-10 h-10 text-retro-red mb-3"}),d("p",z2,_(p(t).error),1),d("button",{class:"flex items-center gap-2 px-3 py-1.5 text-sm text-retro-text border border-retro-border rounded hover:border-retro-cyan hover:text-retro-cyan transition-colors",onClick:P[0]||(P[0]=Ie=>p(t).loadGitGraph(e.workingDirectory))},[te(p(Zs),{class:"w-4 h-4"}),P[45]||(P[45]=Le(" Retry ",-1))])])):p(t).commits.length===0?(O(),b("div",N2,[...P[46]||(P[46]=[d("div",{class:"text-retro-muted text-center"},[d("p",null,"No commits found in this repository.")],-1)])])):(O(),b(ye,{key:4},[p($)?(O(),ge(ve,{key:0,ref_key:"findWidgetRef",ref:A,resultCount:p(t).searchResultHashes.length,currentIndex:p(t).searchResultIndex,onSearch:V,onNext:p(t).nextSearchResult,onPrev:p(t).prevSearchResult,onClose:Y},null,8,["resultCount","currentIndex","onNext","onPrev"])):X("",!0),d("div",V2,[d("button",{class:Ce(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p($)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Find",title:"Find",onClick:P[1]||(P[1]=Ie=>p($)?Y():Z())},[te(p(Ls),{class:"w-4 h-4"})],2),d("div",W2,[d("button",{class:Ce(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(me)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Graph settings",title:"Settings",onClick:P[2]||(P[2]=Ie=>me.value=!p(me))},[te(p(Fv),{class:"w-4 h-4"})],2),p(me)?(O(),b("div",j2,[P[53]||(P[53]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mb-1"}," Graph Style ",-1)),d("label",q2,[d("input",{type:"radio",name:"graphStyle",value:"rounded",checked:p(t).graphStyle==="rounded",class:"accent-retro-cyan",onChange:P[3]||(P[3]=Ie=>p(t).setGraphStyle("rounded"))},null,40,Y2),P[47]||(P[47]=d("span",{class:"text-sm text-retro-text"},"Rounded",-1))]),d("label",F2,[d("input",{type:"radio",name:"graphStyle",value:"angular",checked:p(t).graphStyle==="angular",class:"accent-retro-cyan",onChange:P[4]||(P[4]=Ie=>p(t).setGraphStyle("angular"))},null,40,U2),P[48]||(P[48]=d("span",{class:"text-sm text-retro-text"},"Angular",-1))]),P[54]||(P[54]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Display ",-1)),d("label",G2,[d("input",{type:"checkbox",checked:p(t).muteNonAncestral,class:"accent-retro-cyan",onChange:P[5]||(P[5]=Ie=>p(t).toggleMuteNonAncestral())},null,40,H2),P[49]||(P[49]=d("span",{class:"text-sm text-retro-text"},"Mute non-ancestral",-1))]),P[55]||(P[55]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border mt-2 mb-1"}," Columns ",-1)),d("label",K2,[d("input",{type:"checkbox",checked:p(t).columnVisibility.commit!==!1,class:"accent-retro-cyan",onChange:P[6]||(P[6]=Ie=>p(t).toggleColumnVisibility("commit"))},null,40,J2),P[50]||(P[50]=d("span",{class:"text-sm text-retro-text"},"Hash",-1))]),d("label",e$,[d("input",{type:"checkbox",checked:p(t).columnVisibility.author!==!1,class:"accent-retro-cyan",onChange:P[7]||(P[7]=Ie=>p(t).toggleColumnVisibility("author"))},null,40,t$),P[51]||(P[51]=d("span",{class:"text-sm text-retro-text"},"Author",-1))]),d("label",r$,[d("input",{type:"checkbox",checked:p(t).columnVisibility.date!==!1,class:"accent-retro-cyan",onChange:P[8]||(P[8]=Ie=>p(t).toggleColumnVisibility("date"))},null,40,n$),P[52]||(P[52]=d("span",{class:"text-sm text-retro-text"},"Date",-1))])])):X("",!0)]),P[58]||(P[58]=d("span",{class:"flex-1"},null,-1)),d("div",s$,[d("button",{class:Ce(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(T)||p(t).filteredBranches.length>0?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Filter by branch","aria-expanded":p(T),onClick:P[9]||(P[9]=Ie=>T.value=!p(T))},[te(p(db),{class:"w-4 h-4"}),p(t).filteredBranches.length>0?(O(),b("span",o$," ("+_(p(t).filteredBranches.length)+") ",1)):X("",!0)],10,i$),p(T)?(O(),b("div",a$,[P[57]||(P[57]=d("div",{class:"px-3 py-1 text-xs text-retro-muted border-b border-retro-border"}," Filter by Branch ",-1)),p(t).filteredBranches.length>0?(O(),b("button",{key:0,class:"w-full text-left px-3 py-1.5 text-sm text-retro-cyan hover:bg-retro-cyan/10",onClick:P[10]||(P[10]=Ie=>p(t).clearFilters())}," Clear All Filters ")):X("",!0),p(w).local.length>0?(O(),b(ye,{key:1},[P[56]||(P[56]=d("div",{class:"px-3 py-1 text-[10px] text-retro-green font-semibold uppercase tracking-wider mt-1"}," Local ",-1)),(O(!0),b(ye,null,Ne(p(w).local,Ie=>(O(),b("label",{key:Ie.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[d("input",{type:"checkbox",checked:p(t).filteredBranches.includes(Ie.name),class:"accent-retro-cyan",onChange:_i=>p(t).toggleBranchFilter(Ie.name)},null,40,l$),d("span",c$,_(Ie.name),1),Ie.isHead?(O(),b("span",u$,"(HEAD)")):X("",!0)]))),128))],64)):X("",!0),(O(!0),b(ye,null,Ne(p(w).remotes,(Ie,_i)=>(O(),b(ye,{key:_i},[d("div",h$,_(_i),1),(O(!0),b(ye,null,Ne(Ie,qs=>(O(),b("label",{key:qs.name,class:"flex items-center gap-2 px-3 py-1 hover:bg-retro-panel/50 cursor-pointer"},[d("input",{type:"checkbox",checked:p(t).filteredBranches.includes(qs.name),class:"accent-retro-cyan",onChange:Ad=>p(t).toggleBranchFilter(qs.name)},null,40,d$),d("span",f$,_(qs.name),1)]))),128))],64))),128))])):X("",!0)]),d("button",{class:Ce(["flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors",{"animate-spin":p(t).isRefreshing}]),"aria-label":"Refresh",title:"Refresh",onClick:P[11]||(P[11]=Ie=>p(t).loadGitGraph(e.workingDirectory))},[te(p(Zs),{class:"w-4 h-4"})],2),d("button",{class:"flex items-center gap-1 px-2 py-1.5 text-sm border border-retro-border text-retro-muted rounded hover:text-retro-text hover:border-retro-text transition-colors","aria-label":"Fetch all remotes",title:"Fetch All",onClick:W},[te(p(Jm),{class:"w-4 h-4"})]),d("div",p$,[d("button",{class:Ce(["flex items-center gap-1 px-2 py-1.5 text-sm border rounded transition-colors",p(J)?"border-retro-cyan text-retro-cyan bg-retro-cyan/10":"border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text"]),"aria-label":"Manage remotes",title:"Remotes",onClick:P[12]||(P[12]=Ie=>J.value=!p(J))},[te(p(eg),{class:"w-4 h-4"})],2),p(J)?(O(),b("div",m$,[te(Re,{remotes:p(t).remotes,onAdd:z,onEdit:L,onDelete:q,onClose:P[13]||(P[13]=Ie=>J.value=!1)},null,8,["remotes"])])):X("",!0)]),p(k)&&e.isActive?(O(),b("div",{key:0,class:Ce(["flex items-center text-[10px] text-retro-muted",{"text-retro-cyan":p(t).isRefreshing}]),title:p(t).lastRefreshTime?`Last checked: ${new Date(p(t).lastRefreshTime).toLocaleTimeString()}`:"","aria-live":"polite","aria-atomic":"true"},[d("span",{class:Ce(["inline-block w-1.5 h-1.5 rounded-full mr-1",p(t).isRefreshing?"bg-retro-cyan animate-pulse":"bg-retro-muted/50"]),"aria-hidden":"true"},null,2),Le(" "+_(p(k)),1)],10,g$)):X("",!0)]),d("div",{class:Ce(["flex-1 min-h-0 overflow-hidden",{"max-h-[50%]":p(t).selectedCommit||p(t).isUncommittedChangesSelected}])},[te(Fe,{ref_key:"commitListRef",ref:h,commits:p(t).filteredCommits,stashes:p(t).stashes,selectedCommit:p(t).selectedCommit,hasMore:p(t).hasMore,loading:p(t).loading,loadingMore:p(t).loadingMore,searchQuery:p(t).searchQuery,uncommittedChangesCount:p(t).uncommittedChangesCount,isUncommittedChangesSelected:p(t).isUncommittedChangesSelected,highlightBranches:p(i),featureHighlightBranches:p(o),featureMergeBases:p(c),previewHighlightBranches:p(a),previewMergeBases:p(l),currentBranchName:p(t).currentBranch?.name,localBranchNames:p(t).localBranchNames,graphStyle:p(t).graphStyle,muteNonAncestral:p(t).muteNonAncestral,columnVisibility:p(t).columnVisibility,onSelect:p(t).selectCommit,onLoadMore:p(t).loadMoreCommits,onBranchContextMenu:S,onCommitContextMenu:nt,onTagContextMenu:Or,onStashContextMenu:le,onCompareSelect:B,onSelectUncommittedChanges:p(t).selectUncommittedChanges,onScrollStart:p(s).startInteraction,onScrollEnd:p(s).endInteraction},null,8,["commits","stashes","selectedCommit","hasMore","loading","loadingMore","searchQuery","uncommittedChangesCount","isUncommittedChangesSelected","highlightBranches","featureHighlightBranches","featureMergeBases","previewHighlightBranches","previewMergeBases","currentBranchName","localBranchNames","graphStyle","muteNonAncestral","columnVisibility","onSelect","onLoadMore","onSelectUncommittedChanges","onScrollStart","onScrollEnd"])],2),p(t).isComparing&&p(t).selectedCommit&&p(t).comparisonCommit?(O(),ge(xt,{key:1,fromCommit:p(t).comparisonCommit,toCommit:p(t).selectedCommit,files:p(t).comparisonFiles,stats:p(t).comparisonStats,loading:p(t).comparisonLoading,onClose:p(t).clearComparison},null,8,["fromCommit","toCommit","files","stats","loading","onClose"])):p(t).selectedCommit?(O(),ge(Ft,{key:2,commit:p(t).selectedCommit,files:p(t).selectedCommitFiles,stats:p(t).selectedCommitStats,loading:p(t).isLoadingDetails,detailPosition:p(t).detailViewPosition,onClose:p(t).clearSelection,onNavigateToCommit:U,onTogglePosition:p(t).toggleDetailViewPosition,onOpenFileDiff:P[14]||(P[14]=Ie=>p(t).selectedCommit&&p(t).openFileDiff(p(t).selectedCommit.hash,Ie))},null,8,["commit","files","stats","loading","detailPosition","onClose","onTogglePosition"])):X("",!0),p(t).isUncommittedChangesSelected?(O(),ge(ss,{key:3,stagedFiles:p(t).stagedFiles,unstagedFiles:p(t).unstagedFiles,isStaging:p(t).isStaging,isCommitting:p(t).isCommitting,onClose:p(t).clearSelection,onStageFiles:P[15]||(P[15]=Ie=>p(t).stageFiles(Ie)),onUnstageFiles:P[16]||(P[16]=Ie=>p(t).unstageFiles(Ie)),onStageAll:P[17]||(P[17]=()=>p(t).stageFiles([])),onUnstageAll:P[18]||(P[18]=()=>p(t).unstageFiles([])),onCommit:P[19]||(P[19]=Ie=>p(t).commitChanges(Ie))},null,8,["stagedFiles","unstagedFiles","isStaging","isCommitting","onClose"])):X("",!0)],64)),p(x).visible?(O(),ge(Xn,{key:5,branchName:p(x).branch,isCurrentBranch:p(x).isCurrentBranch,isLocal:p(x).isLocal,x:p(x).x,y:p(x).y,onClose:Q,onCheckout:G,onCreateBranch:pe,onDeleteBranch:fe,onRename:H,onMerge:ce,onRebase:K,onPush:oe,onPull:ae,onFetch:ee,onCopyName:ue},null,8,["branchName","isCurrentBranch","isLocal","x","y"])):X("",!0),p(Xe).visible&&p(Xe).commit?(O(),ge(Kl,{key:6,commit:p(Xe).commit,x:p(Xe).x,y:p(Xe).y,onClose:$t,onAddTag:Pt,onCreateBranch:vt,onCheckout:Oe,onCherryPick:de,onRevert:_e,onMergeInto:Ze,onReset:je,onCopyHash:Ge,onCopySubject:Vt},null,8,["commit","x","y"])):X("",!0),p(ut).visible?(O(),ge(Jl,{key:7,tagName:p(ut).tag,x:p(ut).x,y:p(ut).y,onClose:Jt,onViewDetails:er,onDeleteTag:Cr,onPushTag:Wt,onCopyName:Lr},null,8,["tagName","x","y"])):X("",!0),p(F).visible&&p(F).stash?(O(),ge(Uo,{key:8,stashIndex:p(F).stash.index,stashMessage:p(F).stash.message,x:p(F).x,y:p(F).y,onClose:ie,onApply:Te,onPop:qe,onDrop:Ve,onCreateBranch:st,onCopyName:ws,onCopyHash:an},null,8,["stashIndex","stashMessage","x","y"])):X("",!0),p(Qr).visible?(O(),ge(Mi,{key:9,x:p(Qr).x,y:p(Qr).y,onClose:Dr,onStash:tr,onReset:fr,onClean:Zr},null,8,["x","y"])):X("",!0),p(Zt).visible?(O(),ge(Ai,{key:10,title:"Checkout",visible:p(Zt).visible,loading:p(Zt).loading,error:p(Zt).error,confirmLabel:"Checkout",onClose:P[20]||(P[20]=Ie=>p(Zt).visible=!1),onConfirm:Ss},{default:kt(()=>[d("p",O$,[P[59]||(P[59]=Le(" Are you sure you want to checkout ",-1)),d("span",v$,_(p(Zt).branchName),1),P[60]||(P[60]=Le("? ",-1))])]),_:1},8,["visible","loading","error"])):X("",!0),p(bt).visible?(O(),ge(Ai,{key:11,title:"Rename Branch",visible:p(bt).visible,loading:p(bt).loading,error:p(bt).error,confirmLabel:"Rename",onClose:P[22]||(P[22]=Ie=>p(bt).visible=!1),onConfirm:Zn},{default:kt(()=>[d("div",b$,[d("p",x$,[P[61]||(P[61]=Le(" Rename ",-1)),d("span",y$,_(p(bt).branchName),1)]),Ue(d("input",{"onUpdate:modelValue":P[21]||(P[21]=Ie=>p(bt).newName=Ie),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"New branch name",onKeyup:qn(Zn,["enter"])},null,544),[[hr,p(bt).newName]])])]),_:1},8,["visible","loading","error"])):X("",!0),p(Et).visible?(O(),ge(OS,{key:12,visible:p(Et).visible,branchName:p(Et).branchName,loading:p(Et).loading,error:p(Et).error,onClose:P[23]||(P[23]=Ie=>p(Et).visible=!1),onConfirm:rr},null,8,["visible","branchName","loading","error"])):X("",!0),p(Rt).visible?(O(),ge(uS,{key:13,visible:p(Rt).visible,branchName:p(Rt).branchName,isLocal:p(Rt).isLocal,loading:p(Rt).loading,error:p(Rt).error,onClose:P[24]||(P[24]=Ie=>p(Rt).visible=!1),onConfirm:rs},null,8,["visible","branchName","isLocal","loading","error"])):X("",!0),p(Mt).visible?(O(),ge(ES,{key:14,visible:p(Mt).visible,branchName:p(Mt).branchName,remotes:p(u),loading:p(Mt).loading,error:p(Mt).error,onClose:P[25]||(P[25]=Ie=>p(Mt).visible=!1),onConfirm:On},null,8,["visible","branchName","remotes","loading","error"])):X("",!0),p(At).visible?(O(),ge(SS,{key:15,visible:p(At).visible,branchName:p(At).branchName,remotes:p(u),loading:p(At).loading,error:p(At).error,onClose:P[26]||(P[26]=Ie=>p(At).visible=!1),onConfirm:In},null,8,["visible","branchName","remotes","loading","error"])):X("",!0),p(et).visible?(O(),ge(zS,{key:16,visible:p(et).visible,branchName:p(t).currentBranch?.name||"HEAD",ontoBranch:p(et).branchName,loading:p(et).loading,error:p(et).error,onClose:P[27]||(P[27]=Ie=>p(et).visible=!1),onConfirm:Pr},null,8,["visible","branchName","ontoBranch","loading","error"])):X("",!0),p(mt).visible?(O(),ge(Jw,{key:17,visible:p(mt).visible,commitHash:p(mt).commitHash,commitMessage:p(mt).commitMessage,loading:p(mt).loading,error:p(mt).error,onClose:P[28]||(P[28]=Ie=>p(mt).visible=!1),onConfirm:ns},null,8,["visible","commitHash","commitMessage","loading","error"])):X("",!0),p(Bt).visible?(O(),ge(FS,{key:18,visible:p(Bt).visible,commitHash:p(Bt).commitHash,commitMessage:p(Bt).commitMessage,loading:p(Bt).loading,error:p(Bt).error,onClose:P[29]||(P[29]=Ie=>p(Bt).visible=!1),onConfirm:vn},null,8,["visible","commitHash","commitMessage","loading","error"])):X("",!0),p(Lt).visible?(O(),ge(p2,{key:19,visible:p(Lt).visible,commitHash:p(Lt).commitHash,remotes:p(u),loading:p(Lt).loading,error:p(Lt).error,onClose:P[30]||(P[30]=Ie=>p(Lt).visible=!1),onConfirm:$s},null,8,["visible","commitHash","remotes","loading","error"])):X("",!0),p($e).visible?(O(),ge(y2,{key:20,visible:p($e).visible,tagName:p($e).tagName,remotes:p(u),loading:p($e).loading,error:p($e).error,onClose:P[31]||(P[31]=Ie=>p($e).visible=!1),onConfirm:D},null,8,["visible","tagName","remotes","loading","error"])):X("",!0),p(he).visible?(O(),ge(L2,{key:21,visible:p(he).visible,tagName:p(he).tagName,tagDetail:p(he).tagDetail,loading:p(he).loading,onClose:P[32]||(P[32]=Ie=>p(he).visible=!1)},null,8,["visible","tagName","tagDetail","loading"])):X("",!0),p(He).visible?(O(),ge(sS,{key:22,visible:p(He).visible,fromCommit:p(He).fromCommit,loading:p(He).loading,error:p(He).error,onClose:P[33]||(P[33]=Ie=>p(He).visible=!1),onConfirm:Fr},null,8,["visible","fromCommit","loading","error"])):X("",!0),p(tt).visible?(O(),ge(Ai,{key:23,title:"Create Branch from Stash",visible:p(tt).visible,loading:p(tt).loading,error:p(tt).error,confirmLabel:"Create Branch",onClose:P[36]||(P[36]=Ie=>p(tt).visible=!1),onConfirm:P[37]||(P[37]=Ie=>It(p(ht)))},{default:kt(()=>[d("div",k$,[d("p",w$,[P[62]||(P[62]=Le(" Create a new branch from ",-1)),d("span",S$,"stash@"+_("{")+_(p(tt).stashIndex)+_("}"),1)]),Ue(d("input",{"onUpdate:modelValue":P[34]||(P[34]=Ie=>ot(ht)?ht.value=Ie:null),type:"text",class:"w-full px-3 py-2 text-sm bg-retro-panel border border-retro-border rounded text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan",placeholder:"Branch name",onKeyup:P[35]||(P[35]=qn(Ie=>It(p(ht)),["enter"]))},null,544),[[hr,p(ht)]])])]),_:1},8,["visible","loading","error"])):X("",!0),p(ke).visible?(O(),ge(r2,{key:24,visible:p(ke).visible,loading:p(ke).loading,error:p(ke).error,onClose:P[38]||(P[38]=Ie=>p(ke).visible=!1),onConfirm:lt},null,8,["visible","loading","error"])):X("",!0),p(Ct).visible?(O(),ge(JS,{key:25,visible:p(Ct).visible,loading:p(Ct).loading,error:p(Ct).error,onClose:P[39]||(P[39]=Ie=>p(Ct).visible=!1),onConfirm:Tr},null,8,["visible","loading","error"])):X("",!0),p(jt).visible?(O(),ge(iS,{key:26,visible:p(jt).visible,loading:p(jt).loading,error:p(jt).error,onClose:P[40]||(P[40]=Ie=>p(jt).visible=!1),onConfirm:_t},null,8,["visible","loading","error"])):X("",!0),(O(),ge(hn,{to:"body"},[te(Un,{name:"fade"},{default:kt(()=>[p(Ur).visible?(O(),b("div",{key:0,class:"fixed z-50 px-3 py-1.5 text-sm bg-retro-green text-retro-dark rounded shadow-lg",style:xr({left:`${p(Ur).x}px`,top:`${p(Ur).y-40}px`})}," Copied! ",4)):X("",!0)]),_:1})])),(O(),ge(hn,{to:"body"},[te(Un,{name:"fade"},{default:kt(()=>[p(t).operationError?(O(),b("div",$$,[te(p(fs),{class:"w-4 h-4 flex-shrink-0"}),d("span",C$,_(p(t).operationError),1),d("button",{class:"flex-shrink-0 p-0.5 hover:bg-white/20 rounded transition-colors",onClick:P[41]||(P[41]=Ie=>p(t).clearOperationError()),"aria-label":"Dismiss error"},[te(p(ir),{class:"w-3.5 h-3.5"})])])):X("",!0)]),_:1})]))])}}}),P$=ki(Q$,[["__scopeId","data-v-7f64563b"]]),T$=Bv("/app-logo.svg"),M$={class:"flex items-start justify-between gap-2"},A$={class:"flex-1 min-w-0"},_$={class:"flex items-center gap-2"},R$={class:"font-mono text-sm text-retro-text truncate"},E$={class:"text-xs font-mono text-retro-muted mt-1 truncate"},B$={class:"flex items-center gap-1 flex-shrink-0"},L$={key:0,class:"inline-flex items-center gap-1 text-[10px] font-mono text-retro-red",title:"Critical traceability gaps"},D$={key:1,class:"inline-flex items-center gap-1 text-[10px] font-mono text-retro-yellow",title:"Major traceability gaps"},Z$={key:2,class:"text-[10px] font-mono text-retro-muted mr-1",title:"Completed tasks / total tasks"},I$={key:3,class:"w-2 h-2 rounded-full bg-retro-green",title:"spec"},X$={key:4,class:"w-2 h-2 rounded-full bg-retro-cyan",title:"plan"},z$={key:5,class:"w-2 h-2 rounded-full bg-retro-yellow",title:"tasks"},N$={class:"flex flex-wrap items-center justify-between gap-1 mt-2"},V$={key:0,class:"flex items-center gap-1"},W$=["title","disabled","onClick"],j$=Be({__name:"FeatureCard",props:{feature:{},skills:{},isActive:{type:Boolean},criticalAlerts:{},majorAlerts:{}},emits:["select","cascade","openChat","skill"],setup(r,{emit:e}){const t={DocumentCheckIcon:ab,PuzzlePieceIcon:Zd,DocumentMagnifyingGlassIcon:cb,WrenchScrewdriverIcon:yb,SparklesIcon:Al,BeakerIcon:Jv,ShieldCheckIcon:ig,CommandLineIcon:ob,CpuChipIcon:tg,LightBulbIcon:mb},n=r,s=e,i=pn();function o(f){return t[f]||Zd}function a(f){return f.prerequisites.every(m=>n.feature.files.some(g=>g.filename===m))}function l(f){return f.prerequisites.filter(m=>!n.feature.files.some(g=>g.filename===m))}function c(f){return a(f)?`${f.name} (Shift+click: new conversation)`:`Requires: ${l(f).join(", ")}`}const u=N(()=>{const f=i.findConversationByFeature(n.feature.id);return f?i.isConversationStreaming(f.id):!1}),h=N(()=>n.isActive?["border-retro-cyan shadow-retro","feature-card-active","dark:bg-gradient-to-br dark:from-retro-cyan/10 dark:via-retro-panel dark:to-retro-magenta/5"]:["border-retro-border","feature-card-light","hover:border-retro-muted","dark:bg-gradient-to-br","dark:from-retro-panel dark:via-retro-panel dark:to-retro-cyan/5","dark:hover:from-retro-cyan/5 dark:hover:via-retro-panel dark:hover:to-retro-magenta/5"]);return(f,m)=>(O(),b("button",{type:"button",class:Ce(["w-full p-3 text-left rounded-lg border transition-all duration-200 group",p(h)]),onClick:m[5]||(m[5]=g=>s("select",r.feature.id))},[d("div",M$,[d("div",A$,[d("div",_$,[te(p(ci),{class:Ce(["h-4 w-4 flex-shrink-0 transition-colors duration-200",r.isActive?"text-retro-cyan":"text-retro-muted group-hover:text-retro-cyan"])},null,8,["class"]),d("span",R$,_(r.feature.id),1)]),d("p",E$,_(r.feature.name),1)]),d("div",B$,[r.criticalAlerts>0?(O(),b("span",L$,[m[6]||(m[6]=d("span",{class:"w-1.5 h-1.5 rounded-full bg-retro-red"},null,-1)),Le(" "+_(r.criticalAlerts),1)])):X("",!0),r.majorAlerts>0?(O(),b("span",D$,[m[7]||(m[7]=d("span",{class:"w-1.5 h-1.5 rounded-full bg-retro-yellow"},null,-1)),Le(" "+_(r.majorAlerts),1)])):X("",!0),r.feature.hasTasks?(O(),b("span",Z$,_(r.feature.completedTasks)+"/"+_(r.feature.totalTasks),1)):X("",!0),r.feature.hasSpec?(O(),b("span",I$)):X("",!0),r.feature.hasPlan?(O(),b("span",X$)):X("",!0),r.feature.hasTasks?(O(),b("span",z$)):X("",!0)])]),d("div",N$,[r.feature.hasSpec?(O(),b("div",V$,[d("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Clarify spec (Shift+click: new conversation)",onClick:m[0]||(m[0]=Gt(g=>s("cascade",g,r.feature.id,"clarify"),["stop"]))},[te(p(Oh),{class:"h-3.5 w-3.5"})]),d("button",{type:"button",class:"flex items-center justify-center p-1 bg-retro-cyan/20 text-retro-cyan rounded hover:bg-retro-cyan/30 transition-colors",title:"Plan → Tasks → Implement (Shift+click: new conversation)",onClick:m[1]||(m[1]=Gt(g=>s("cascade",g,r.feature.id,"plan"),["stop"]))},[te(p(mh),{class:"h-3.5 w-3.5"})]),r.feature.hasPlan?(O(),b("button",{key:0,type:"button",class:"flex items-center justify-center p-1 bg-retro-yellow/20 text-retro-yellow rounded hover:bg-retro-yellow/30 transition-colors",title:"Tasks → Implement (Shift+click: new conversation)",onClick:m[2]||(m[2]=Gt(g=>s("cascade",g,r.feature.id,"tasks"),["stop"]))},[te(p(ng),{class:"h-3.5 w-3.5"})])):X("",!0),r.feature.hasTasks?(O(),b("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-magenta/20 text-retro-magenta rounded hover:bg-retro-magenta/30 transition-colors",title:"Implement (Shift+click: new conversation)",onClick:m[3]||(m[3]=Gt(g=>s("cascade",g,r.feature.id,"implement"),["stop"]))},[te(p(bb),{class:"h-3.5 w-3.5"})])):X("",!0),r.skills.length>0?(O(),b(ye,{key:2},[m[8]||(m[8]=d("div",{class:"w-px h-4 bg-retro-border mx-0.5"},null,-1)),(O(!0),b(ye,null,Ne(r.skills,g=>(O(),b("button",{key:g.id,type:"button",class:Ce(["flex items-center justify-center p-1 rounded transition-colors",[a(g)&&!p(u)?"bg-retro-pink/20 text-retro-pink hover:bg-retro-pink/30":"bg-retro-subtle/10 text-retro-subtle cursor-not-allowed",p(u)?"animate-pulse":""]]),title:c(g),disabled:!a(g)||p(u),onClick:Gt(v=>s("skill",v,r.feature.id,g.id),["stop"])},[(O(),ge(ai(o(g.icon)),{class:"h-3.5 w-3.5"}))],10,W$))),128))],64)):X("",!0)])):X("",!0),r.feature.hasSpec?(O(),b("button",{key:1,type:"button",class:"flex items-center justify-center p-1 bg-retro-green/20 text-retro-green rounded hover:bg-retro-green/30 transition-colors",title:"Open new chat linked to this spec",onClick:m[4]||(m[4]=Gt(g=>s("openChat",g,r.feature.id),["stop"]))},[te(p(nb),{class:"h-3.5 w-3.5"})])):X("",!0)])],2))}});let lu=[],wg=[];(()=>{let r="lc,34,7n,7,7b,19,,,,2,,2,,,20,b,1c,l,g,,2t,7,2,6,2,2,,4,z,,u,r,2j,b,1m,9,9,,o,4,,9,,3,,5,17,3,3b,f,,w,1j,,,,4,8,4,,3,7,a,2,t,,1m,,,,2,4,8,,9,,a,2,q,,2,2,1l,,4,2,4,2,2,3,3,,u,2,3,,b,2,1l,,4,5,,2,4,,k,2,m,6,,,1m,,,2,,4,8,,7,3,a,2,u,,1n,,,,c,,9,,14,,3,,1l,3,5,3,,4,7,2,b,2,t,,1m,,2,,2,,3,,5,2,7,2,b,2,s,2,1l,2,,,2,4,8,,9,,a,2,t,,20,,4,,2,3,,,8,,29,,2,7,c,8,2q,,2,9,b,6,22,2,r,,,,,,1j,e,,5,,2,5,b,,10,9,,2u,4,,6,,2,2,2,p,2,4,3,g,4,d,,2,2,6,,f,,jj,3,qa,3,t,3,t,2,u,2,1s,2,,7,8,,2,b,9,,19,3,3b,2,y,,3a,3,4,2,9,,6,3,63,2,2,,1m,,,7,,,,,2,8,6,a,2,,1c,h,1r,4,1c,7,,,5,,14,9,c,2,w,4,2,2,,3,1k,,,2,3,,,3,1m,8,2,2,48,3,,d,,7,4,,6,,3,2,5i,1m,,5,ek,,5f,x,2da,3,3x,,2o,w,fe,6,2x,2,n9w,4,,a,w,2,28,2,7k,,3,,4,,p,2,5,,47,2,q,i,d,,12,8,p,b,1a,3,1c,,2,4,2,2,13,,1v,6,2,2,2,2,c,,8,,1b,,1f,,,3,2,2,5,2,,,16,2,8,,6m,,2,,4,,fn4,,kh,g,g,g,a6,2,gt,,6a,,45,5,1ae,3,,2,5,4,14,3,4,,4l,2,fx,4,ar,2,49,b,4w,,1i,f,1k,3,1d,4,2,2,1x,3,10,5,,8,1q,,c,2,1g,9,a,4,2,,2n,3,2,,,2,6,,4g,,3,8,l,2,1l,2,,,,,m,,e,7,3,5,5f,8,2,3,,,n,,29,,2,6,,,2,,,2,,2,6j,,2,4,6,2,,2,r,2,2d,8,2,,,2,2y,,,,2,6,,,2t,3,2,4,,5,77,9,,2,6t,,a,2,,,4,,40,4,2,2,4,,w,a,14,6,2,4,8,,9,6,2,3,1a,d,,2,ba,7,,6,,,2a,m,2,7,,2,,2,3e,6,3,,,2,,7,,,20,2,3,,,,9n,2,f0b,5,1n,7,t4,,1r,4,29,,f5k,2,43q,,,3,4,5,8,8,2,7,u,4,44,3,1iz,1j,4,1e,8,,e,,m,5,,f,11s,7,,h,2,7,,2,,5,79,7,c5,4,15s,7,31,7,240,5,gx7k,2o,3k,6o".split(",").map(e=>e?parseInt(e,36):1);for(let e=0,t=0;e<r.length;e++)(e%2?wg:lu).push(t=t+r[e])})();function q$(r){if(r<768)return!1;for(let e=0,t=lu.length;;){let n=e+t>>1;if(r<lu[n])t=n;else if(r>=wg[n])e=n+1;else return!0;if(e==t)return!1}}function ef(r){return r>=127462&&r<=127487}const tf=8205;function Y$(r,e,t=!0,n=!0){return(t?Sg:F$)(r,e,n)}function Sg(r,e,t){if(e==r.length)return e;e&&$g(r.charCodeAt(e))&&Cg(r.charCodeAt(e-1))&&e--;let n=oc(r,e);for(e+=rf(n);e<r.length;){let s=oc(r,e);if(n==tf||s==tf||t&&q$(s))e+=rf(s),n=s;else if(ef(s)){let i=0,o=e-2;for(;o>=0&&ef(oc(r,o));)i++,o-=2;if(i%2==0)break;e+=2}else break}return e}function F$(r,e,t){for(;e>0;){let n=Sg(r,e-2,t);if(n<e)return n;e--}return 0}function oc(r,e){let t=r.charCodeAt(e);if(!Cg(t)||e+1==r.length)return t;let n=r.charCodeAt(e+1);return $g(n)?(t-55296<<10)+(n-56320)+65536:t}function $g(r){return r>=56320&&r<57344}function Cg(r){return r>=55296&&r<56320}function rf(r){return r<65536?1:2}class at{lineAt(e){if(e<0||e>this.length)throw new RangeError(`Invalid position ${e} in document of length ${this.length}`);return this.lineInner(e,!1,1,0)}line(e){if(e<1||e>this.lines)throw new RangeError(`Invalid line number ${e} in ${this.lines}-line document`);return this.lineInner(e,!0,1,0)}replace(e,t,n){[e,t]=hi(this,e,t);let s=[];return this.decompose(0,e,s,2),n.length&&n.decompose(0,n.length,s,3),this.decompose(t,this.length,s,1),Qn.from(s,this.length-(t-e)+n.length)}append(e){return this.replace(this.length,this.length,e)}slice(e,t=this.length){[e,t]=hi(this,e,t);let n=[];return this.decompose(e,t,n,0),Qn.from(n,t-e)}eq(e){if(e==this)return!0;if(e.length!=this.length||e.lines!=this.lines)return!1;let t=this.scanIdentical(e,1),n=this.length-this.scanIdentical(e,-1),s=new to(this),i=new to(e);for(let o=t,a=t;;){if(s.next(o),i.next(o),o=0,s.lineBreak!=i.lineBreak||s.done!=i.done||s.value!=i.value)return!1;if(a+=s.value.length,s.done||a>=n)return!0}}iter(e=1){return new to(this,e)}iterRange(e,t=this.length){return new Qg(this,e,t)}iterLines(e,t){let n;if(e==null)n=this.iter();else{t==null&&(t=this.lines+1);let s=this.line(e).from;n=this.iterRange(s,Math.max(s,t==this.lines+1?this.length:t<=1?0:this.line(t-1).to))}return new Pg(n)}toString(){return this.sliceString(0)}toJSON(){let e=[];return this.flatten(e),e}constructor(){}static of(e){if(e.length==0)throw new RangeError("A document must have at least one line");return e.length==1&&!e[0]?at.empty:e.length<=32?new Xt(e):Qn.from(Xt.split(e,[]))}}class Xt extends at{constructor(e,t=U$(e)){super(),this.text=e,this.length=t}get lines(){return this.text.length}get children(){return null}lineInner(e,t,n,s){for(let i=0;;i++){let o=this.text[i],a=s+o.length;if((t?n:a)>=e)return new G$(s,a,n,o);s=a+1,n++}}decompose(e,t,n,s){let i=e<=0&&t>=this.length?this:new Xt(nf(this.text,e,t),Math.min(t,this.length)-Math.max(0,e));if(s&1){let o=n.pop(),a=Aa(i.text,o.text.slice(),0,i.length);if(a.length<=32)n.push(new Xt(a,o.length+i.length));else{let l=a.length>>1;n.push(new Xt(a.slice(0,l)),new Xt(a.slice(l)))}}else n.push(i)}replace(e,t,n){if(!(n instanceof Xt))return super.replace(e,t,n);[e,t]=hi(this,e,t);let s=Aa(this.text,Aa(n.text,nf(this.text,0,e)),t),i=this.length+n.length-(t-e);return s.length<=32?new Xt(s,i):Qn.from(Xt.split(s,[]),i)}sliceString(e,t=this.length,n=`
68
68
  `){[e,t]=hi(this,e,t);let s="";for(let i=0,o=0;i<=t&&o<this.text.length;o++){let a=this.text[o],l=i+a.length;i>e&&o&&(s+=n),e<l&&t>i&&(s+=a.slice(Math.max(0,e-i),t-i)),i=l+1}return s}flatten(e){for(let t of this.text)e.push(t)}scanIdentical(){return 0}static split(e,t){let n=[],s=-1;for(let i of e)n.push(i),s+=i.length+1,n.length==32&&(t.push(new Xt(n,s)),n=[],s=-1);return s>-1&&t.push(new Xt(n,s)),t}}class Qn extends at{constructor(e,t){super(),this.children=e,this.length=t,this.lines=0;for(let n of e)this.lines+=n.lines}lineInner(e,t,n,s){for(let i=0;;i++){let o=this.children[i],a=s+o.length,l=n+o.lines-1;if((t?l:a)>=e)return o.lineInner(e,t,n,s);s=a+1,n=l+1}}decompose(e,t,n,s){for(let i=0,o=0;o<=t&&i<this.children.length;i++){let a=this.children[i],l=o+a.length;if(e<=l&&t>=o){let c=s&((o<=e?1:0)|(l>=t?2:0));o>=e&&l<=t&&!c?n.push(a):a.decompose(e-o,t-o,n,c)}o=l+1}}replace(e,t,n){if([e,t]=hi(this,e,t),n.lines<this.lines)for(let s=0,i=0;s<this.children.length;s++){let o=this.children[s],a=i+o.length;if(e>=i&&t<=a){let l=o.replace(e-i,t-i,n),c=this.lines-o.lines+l.lines;if(l.lines<c>>4&&l.lines>c>>6){let u=this.children.slice();return u[s]=l,new Qn(u,this.length-(t-e)+n.length)}return super.replace(i,a,l)}i=a+1}return super.replace(e,t,n)}sliceString(e,t=this.length,n=`
@@ -92,7 +92,7 @@ Please report this to https://github.com/markedjs/marked.`,r){const n="<p>An err
92
92
  constructor(\${params}) {
93
93
  \${}
94
94
  }
95
- }`,{label:"class",detail:"definition",type:"keyword"}),Mr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Mr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],z_=iv.concat([Mr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Mr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Mr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),km=new GO,ov=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Yi(r){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,r),!0}}const N_=["FunctionDeclaration"],V_={FunctionDeclaration:Yi("function"),ClassDeclaration:Yi("class"),ClassExpression:()=>!0,EnumDeclaration:Yi("constant"),TypeAliasDeclaration:Yi("type"),NamespaceDeclaration:Yi("namespace"),VariableDefinition(r,e){r.matchContext(N_)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function av(r,e){let t=km.get(e);if(t)return t;let n=[],s=!0;function i(o,a){let l=r.sliceString(o.from,o.to);n.push({label:l,type:a})}return e.cursor(dt.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let a=V_[o.name];if(a&&a(o,i)||ov.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of av(r,o.node))n.push(a);return!1}}),km.set(e,n),n}const wm=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lv=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function W_(r){let e=St(r.state).resolveInner(r.pos,-1);if(lv.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&wm.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let n=[];for(let s=e;s;s=s.parent)ov.has(s.name)&&(n=n.concat(av(r.state.doc,s)));return{options:n,from:t?e.from:r.pos,validFor:wm}}const Bn=mi.define({name:"javascript",parser:X_.configure({props:[Vo.add({IfStatement:Ia({except:/^\s*({|else\b)/}),TryStatement:Ia({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:RP,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:n?1:2)*r.unit},Block:_P({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ia({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),Ci.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":s0,BlockComment(r){return{from:r.from+2,to:r.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),cv={test:r=>/^JSX/.test(r.name),facet:Jh({commentTokens:{block:{open:"{/*",close:"*/}"}}})},uv=Bn.configure({dialect:"ts"},"typescript"),hv=Bn.configure({dialect:"jsx",props:[ed.add(r=>r.isTop?[cv]:void 0)]}),dv=Bn.configure({dialect:"jsx ts",props:[ed.add(r=>r.isTop?[cv]:void 0)]},"typescript");let fv=r=>({label:r,type:"keyword"});const pv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fv),j_=pv.concat(["declare","implements","private","protected","public"].map(fv));function q_(r={}){let e=r.jsx?r.typescript?dv:hv:r.typescript?uv:Bn,t=r.typescript?z_.concat(j_):iv.concat(pv);return new yo(e,[Bn.data.of({autocomplete:eM(lv,s1(t))}),Bn.data.of({autocomplete:W_}),r.jsx?U_:[]])}function Y_(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function Sm(r,e,t=r.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return r.sliceString(n.from,Math.min(n.to,t));return""}const F_=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),U_=Se.inputHandler.of((r,e,t,n,s)=>{if((F_?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||n!=">"&&n!="/"||!Bn.isActiveAt(r.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c;let{head:u}=l,h=St(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=n||h.name=="JSXAttributeValue"&&h.to>u)){if(n==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(n=="/"&&h.name=="JSXStartCloseTag"){let m=h.parent,g=m.parent;if(g&&m.from==u-2&&((f=Sm(o.doc,g.firstChild,u))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let v=`${f}>`;return{range:se.cursor(u+v.length,-1),changes:{from:u,insert:v}}}}else if(n==">"){let m=Y_(h);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Sm(o.doc,m,u)))return{range:l,changes:{from:u,insert:`</${f}>`}}}}return{range:l}});return a.changes.empty?!1:(r.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Fi=["_blank","_self","_top","_parent"],Vc=["ascii","utf-8","utf-16","latin1","latin1"],Wc=["get","post","put","delete"],jc=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],zr=["true","false"],Ee={},G_={a:{attrs:{href:null,ping:null,type:null,media:null,target:Fi,hreflang:null}},abbr:Ee,address:Ee,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ee,aside:Ee,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ee,base:{attrs:{href:null,target:Fi}},bdi:Ee,bdo:Ee,blockquote:{attrs:{cite:null}},body:Ee,br:Ee,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:jc,formmethod:Wc,formnovalidate:["novalidate"],formtarget:Fi,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ee,center:Ee,cite:Ee,code:Ee,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ee,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ee,div:Ee,dl:Ee,dt:Ee,em:Ee,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ee,figure:Ee,footer:Ee,form:{attrs:{action:null,name:null,"accept-charset":Vc,autocomplete:["on","off"],enctype:jc,method:Wc,novalidate:["novalidate"],target:Fi}},h1:Ee,h2:Ee,h3:Ee,h4:Ee,h5:Ee,h6:Ee,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ee,hgroup:Ee,hr:Ee,html:{attrs:{manifest:null}},i:Ee,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:jc,formmethod:Wc,formnovalidate:["novalidate"],formtarget:Fi,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ee,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ee,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ee,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Vc,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ee,noscript:Ee,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ee,param:{attrs:{name:null,value:null}},pre:Ee,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ee,rt:Ee,ruby:Ee,samp:Ee,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Vc}},section:Ee,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ee,source:{attrs:{src:null,type:null,media:null}},span:Ee,strong:Ee,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ee,summary:Ee,sup:Ee,table:Ee,tbody:Ee,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ee,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ee,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ee,time:{attrs:{datetime:null}},title:Ee,tr:Ee,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ee,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ee},mv={accesskey:null,class:null,contenteditable:zr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:zr,autocorrect:zr,autocapitalize:zr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":zr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":zr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":zr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":zr,"aria-hidden":zr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":zr,"aria-multiselectable":zr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":zr,"aria-relevant":null,"aria-required":zr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},gv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(r=>"on"+r);for(let r of gv)mv[r]=null;class _o{constructor(e,t){this.tags={...G_,...e},this.globalAttrs={...mv,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}_o.default=new _o;function xi(r,e,t=r.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?r.sliceString(s.from,Math.min(s.to,t)):""}function yi(r,e=!1){for(;r;r=r.parent)if(r.name=="Element")if(e)e=!1;else return r;return null}function Ov(r,e,t){let n=t.tags[xi(r,yi(e))];return n?.children||t.allTags}function Qd(r,e){let t=[];for(let n=yi(e);n&&!n.type.isTop;n=yi(n.parent)){let s=xi(r,n);if(s&&n.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(s)}return t}const vv=/^[:\-\.\w\u00b7-\uffff]*$/;function $m(r,e,t,n,s){let i=/\s*>/.test(r.sliceDoc(s,s+5))?"":">",o=yi(t,t.name=="StartTag"||t.name=="TagName");return{from:n,to:s,options:Ov(r.doc,o,e).map(a=>({label:a,type:"type"})).concat(Qd(r.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+i,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Cm(r,e,t,n){let s=/\s*>/.test(r.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Qd(r.doc,e).map((i,o)=>({label:i,apply:i+s,type:"type",boost:99-o})),validFor:vv}}function H_(r,e,t,n){let s=[],i=0;for(let o of Ov(r.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of Qd(r.doc,t))s.push({label:"</"+o+">",type:"type",boost:99-i++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function K_(r,e,t,n,s){let i=yi(t),o=i?e.tags[xi(r.doc,i)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:l.map(c=>({label:c,type:"property"})),validFor:vv}}function J_(r,e,t,n,s){var i;let o=(i=t.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),a=[],l;if(o){let c=r.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=yi(t),f=h?e.tags[xi(r.doc,h)]:null;u=f?.attrs&&f.attrs[c]}if(u){let h=r.sliceDoc(n,s).toLowerCase(),f='"',m='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",m=r.sliceDoc(s,s+1)==h[0]?"":h[0],h=h.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of u)a.push({label:g,apply:f+g+m,type:"constant"})}}return{from:n,to:s,options:a,validFor:l}}function bv(r,e){let{state:t,pos:n}=e,s=St(t).resolveInner(n,-1),i=s.resolve(n);for(let o=n,a;i==s&&(a=s.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;i=s=a,o=l.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Cm(t,s,s.from,n):$m(t,r,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?$m(t,r,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Cm(t,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?K_(t,r,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?J_(t,r,s,s.name=="Is"?n:s.from,n):e.explicit&&(i.name=="Element"||i.name=="Text"||i.name=="Document")?H_(t,r,s,n):null}function eR(r){return bv(_o.default,r)}function tR(r){let{extraTags:e,extraGlobalAttributes:t}=r,n=t||e?new _o(e,t):_o.default;return s=>bv(n,s)}const rR=Bn.parser.configure({top:"SingleExpression"}),xv=[{tag:"script",attrs:r=>r.type=="text/typescript"||r.lang=="ts",parser:uv.parser},{tag:"script",attrs:r=>r.type=="text/babel"||r.type=="text/jsx",parser:hv.parser},{tag:"script",attrs:r=>r.type=="text/typescript-jsx",parser:dv.parser},{tag:"script",attrs(r){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(r.type)},parser:rR},{tag:"script",attrs(r){return!r.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(r.type)},parser:Bn.parser},{tag:"style",attrs(r){return(!r.lang||r.lang=="css")&&(!r.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(r.type))},parser:Ql.parser}],yv=[{name:"style",parser:Ql.parser.configure({top:"Styles"})}].concat(gv.map(r=>({name:r,parser:Bn.parser}))),kv=mi.define({name:"html",parser:Q4.configure({props:[Vo.add({Element(r){let e=/^(\s*)(<\/)?/.exec(r.textAfter);return r.node.to<=r.pos+e[0].length?r.continue():r.lineIndent(r.node.from)+(e[2]?0:r.unit)},"OpenTag CloseTag SelfClosingTag"(r){return r.column(r.node.from)+r.unit},Document(r){if(r.pos+/\s*/.exec(r.textAfter)[0].length<r.node.to)return r.continue();let e=null,t;for(let n=r.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;e=n=s}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?r.lineIndent(e.from)+r.unit:null}}),Ci.add({Element(r){let e=r.firstChild,t=r.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:r.to}}}),O0.add({"OpenTag CloseTag":r=>r.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Na=kv.configure({wrap:K1(xv,yv)});function nR(r={}){let e="",t;r.matchClosingTags===!1&&(e="noMatch"),r.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(r.nestedLanguages&&r.nestedLanguages.length||r.nestedAttributes&&r.nestedAttributes.length)&&(t=K1((r.nestedLanguages||[]).concat(xv),(r.nestedAttributes||[]).concat(yv)));let n=t?kv.configure({wrap:t,dialect:e}):e?Na.configure({dialect:e}):Na;return new yo(n,[Na.data.of({autocomplete:tR(r)}),r.autoCloseTags!==!1?sR:[],q_().support,c_().support])}const Qm=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),sR=Se.inputHandler.of((r,e,t,n,s)=>{if(r.composing||r.state.readOnly||e!=t||n!=">"&&n!="/"||!Na.isActiveAt(r.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c,u,h;let f=o.doc.sliceString(l.from-1,l.to)==n,{head:m}=l,g=St(o).resolveInner(m,-1),v;if(f&&n==">"&&g.name=="EndTag"){let y=g.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(v=xi(o.doc,y.parent,m))&&!Qm.has(v)){let k=m+(o.doc.sliceString(m,m+1)===">"?1:0),$=`</${v}>`;return{range:l,changes:{from:m,to:k,insert:$}}}}else if(f&&n=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==m-2&&((h=y.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(v=xi(o.doc,y,m))&&!Qm.has(v)){let k=m+(o.doc.sliceString(m,m+1)===">"?1:0),$=`${v}>`;return{range:se.cursor(m+$.length,-1),changes:{from:m,to:k,insert:$}}}}return{range:l}});return a.changes.empty?!1:(r.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),wv=Jh({commentTokens:{block:{open:"<!--",close:"-->"}}}),Sv=new Ye,$v=yA.configure({props:[Ci.add(r=>!r.is("Block")||r.is("Document")||lh(r)!=null||iR(r)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Sv.add(lh),Vo.add({Document:()=>null}),Rs.add({Document:wv})]});function lh(r){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(r.name);return e?+e[1]:void 0}function iR(r){return r.name=="OrderedList"||r.name=="BulletList"}function oR(r,e){let t=r;for(;;){let n=t.nextSibling,s;if(!n||(s=lh(n.type))!=null&&s<=e)break;t=n}return t.to}const aR=n0.of((r,e,t)=>{for(let n=St(r).resolveInner(t,-1);n&&!(n.from<e);n=n.parent){let s=n.type.prop(Sv);if(s==null)continue;let i=oR(n,s);if(i>t)return{from:t,to:i}}return null});function Pd(r){return new Kr(wv,r,[],"markdown")}const lR=Pd($v),cR=$v.configure([_A,EA,RA,BA,{props:[Ci.add({Table:(r,e)=>({from:e.doc.lineAt(r.from).to,to:r.to})})]}]),Pl=Pd(cR);function uR(r,e){return t=>{if(t&&r){let n=null;if(t=/\S*/.exec(t)[0],typeof r=="function"?n=r(t):n=cl.matchLanguageName(r,t,!0),n instanceof cl)return n.support?n.support.language.parser:xo.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class qc{constructor(e,t,n,s,i,o,a){this.node=e,this.from=t,this.to=n,this.spaceBefore=s,this.spaceAfter=i,this.type=o,this.item=a}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+Qv(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Cv(r,e){let t=[],n=[];for(let s=r;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&t.push(s)}for(let s=t.length-1;s>=0;s--){let i=t[s],o,a=e.lineAt(i.from),l=i.from-a.from;if(i.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))n.push(new qc(i,l,l+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new qc(i.parent,l,l+u,o[1],c,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new qc(i.parent,l,l+u,o[1],c,h,i))}}return n}function Qv(r,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(r.from,r.from+10))}function Yc(r,e,t,n=0){for(let s=-1,i=r;;){if(i.name=="ListItem"){let a=Qv(i,e),l=+a[2];if(s>=0){if(l!=s+1)return;t.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(s+2+n)})}s=l}let o=i.nextSibling;if(!o)break;i=o}}function Td(r,e){let t=/^[ \t]*/.exec(r)[0].length;if(!t||e.facet(No)!=" ")return r;let n=dn(r,4,t),s="";for(let i=n;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+r.slice(t)}const hR=(r={})=>({state:e,dispatch:t})=>{let n=St(e),{doc:s}=e,i=null,o=e.changeByRange(a=>{if(!a.empty||!Pl.isActiveAt(e,a.from,-1)&&!Pl.isActiveAt(e,a.from,1))return i={range:a};let l=a.from,c=s.lineAt(l),u=Cv(n.resolveInner(l,-1),s);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return i={range:a};let h=u[u.length-1];if(h.to-h.spaceAfter.length>l-c.from)return i={range:a};let f=l>=h.to-h.spaceAfter.length&&!/\S/.test(c.text.slice(h.to));if(h.item&&f){let k=h.node.firstChild,$=h.node.getChild("ListItem","ListItem");if(k.to>=l||$&&$.to<l||c.from>0&&!/[^\s>]/.test(s.lineAt(c.from-1).text)||r.nonTightLists===!1){let T=u.length>1?u[u.length-2]:null,A,Z="";T&&T.item?(A=c.from+T.from,Z=T.marker(s,1)):A=c.from+(T?T.to:0);let Y=[{from:A,to:l,insert:Z}];return h.node.name=="OrderedList"&&Yc(h.item,s,Y,-2),T&&T.node.name=="OrderedList"&&Yc(T.item,s,Y),{range:se.cursor(A+Z.length),changes:Y}}else{let T=Tm(u,e,c);return{range:se.cursor(l+T.length+1),changes:{from:c.from,insert:T+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&c.from){let k=s.lineAt(c.from-1),$=/>\s*$/.exec(k.text);if($&&$.index==h.from){let T=e.changes([{from:k.from+$.index,to:k.to},{from:c.from+h.from,to:c.to}]);return{range:a.map(T),changes:T}}}let m=[];h.node.name=="OrderedList"&&Yc(h.item,s,m);let g=h.item&&h.item.from<c.from,v="";if(!g||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=h.to)for(let k=0,$=u.length-1;k<=$;k++)v+=k==$&&!g?u[k].marker(s,1):u[k].blank(k<$?dn(c.text,4,u[k+1].from)-v.length:null);let y=l;for(;y>c.from&&/\s/.test(c.text.charAt(y-c.from-1));)y--;return v=Td(v,e),fR(h.node,e.doc)&&(v=Tm(u,e,c)+e.lineBreak+v),m.push({from:y,to:l,insert:e.lineBreak+v}),{range:se.cursor(y+v.length+1),changes:m}});return i?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},dR=hR();function Pm(r){return r.name=="QuoteMark"||r.name=="ListMark"}function fR(r,e){if(r.name!="OrderedList"&&r.name!="BulletList")return!1;let t=r.firstChild,n=r.getChild("ListItem","ListItem");if(!n)return!1;let s=e.lineAt(t.to),i=e.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}function Tm(r,e,t){let n="";for(let s=0,i=r.length-2;s<=i;s++)n+=r[s].blank(s<i?dn(t.text,4,r[s+1].from)-n.length:null,s<i);return Td(n,e)}function pR(r,e){let t=r.resolveInner(e,-1),n=e;Pm(t)&&(n=t.from,t=t.parent);for(let s;s=t.childBefore(n);)if(Pm(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")t=s.lastChild,n=t.to;else break;return t}const mR=({state:r,dispatch:e})=>{let t=St(r),n=null,s=r.changeByRange(i=>{let o=i.from,{doc:a}=r;if(i.empty&&Pl.isActiveAt(r,i.from)){let l=a.lineAt(o),c=Cv(pR(t,o),a);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:se.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let m=u.blank(dn(l.text,4,u.to)-dn(l.text,4,u.from));return f==l.from&&(m=Td(m,r)),{range:se.cursor(f+m.length),changes:{from:f,to:l.from+u.to,insert:m}}}if(f<o)return{range:se.cursor(f),changes:{from:f,to:o}}}}}return n={range:i}});return n?!1:(e(r.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},gR=[{key:"Enter",run:dR},{key:"Backspace",run:mR}],Pv=nR({matchClosingTags:!1});function OR(r={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:n=!0,base:{parser:s}=lR,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=Pv}=r;if(!(s instanceof Gl))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=r.extensions?[r.extensions]:[],c=[a.support,aR],u;o&&c.push(yR),t instanceof yo?(c.push(t.support),u=t.language):t&&(u=t);let h=e||u?uR(e,u):void 0;l.push(wA({codeParser:h,htmlParser:a.language.parser})),n&&c.push(es.high(Io.of(gR)));let f=Pd(s.configure(l));return i&&c.push(f.data.of({autocomplete:vR})),new yo(f,c)}function vR(r){let{state:e,pos:t}=r,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!n)return null;let s=St(e).resolveInner(t,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:t-n[0].length,to:t,options:bR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Fc=null;function bR(){if(Fc)return Fc;let r=eR(new ud(rt.create({extensions:Pv}),0,!0));return Fc=r?r.options:[]}const xR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,yR=Se.domEventHandlers({paste:(r,e)=>{var t;let{main:n}=e.state.selection;if(n.empty)return!1;let s=(t=r.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!Pl.isActiveAt(e.state,n.from,1)))return!1;let i=St(e.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:a=>{(a.from>n.from||xR.test(a.name))&&(o=!0)},leave:a=>{a.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),kR="#e5c07b",Mm="#e06c75",wR="#56b6c2",SR="#ffffff",Va="#abb2bf",ch="#7d8799",$R="#61afef",CR="#98c379",Am="#d19a66",QR="#c678dd",PR="#21252b",_m="#2c313a",Rm="#282c34",Uc="#353a42",TR="#3E4451",Em="#528bff",MR=Se.theme({"&":{color:Va,backgroundColor:Rm},".cm-content":{caretColor:Em},".cm-cursor, .cm-dropCursor":{borderLeftColor:Em},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:TR},".cm-panels":{backgroundColor:PR,color:Va},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Rm,color:ch,border:"none"},".cm-activeLineGutter":{backgroundColor:_m},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Uc},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Uc,borderBottomColor:Uc},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:_m,color:Va}}},{dark:!0}),AR=jo.define([{tag:M.keyword,color:QR},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:Mm},{tag:[M.function(M.variableName),M.labelName],color:$R},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:Am},{tag:[M.definition(M.name),M.separator],color:Va},{tag:[M.typeName,M.className,M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:kR},{tag:[M.operator,M.operatorKeyword,M.url,M.escape,M.regexp,M.link,M.special(M.string)],color:wR},{tag:[M.meta,M.comment],color:ch},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.link,color:ch,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:Mm},{tag:[M.atom,M.bool,M.special(M.variableName)],color:Am},{tag:[M.processingInstruction,M.string,M.inserted],color:CR},{tag:M.invalid,color:SR}]),_R=[MR,f0(AR)],RR=Be({__name:"MarkdownCodeEditor",props:{modelValue:{},readOnly:{type:Boolean,default:!1},lineToReveal:{default:null}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,s=E(null);let i=null,o=!1,a=null;const l=We.define(),c=We.define(),u=or.define({create(){return De.none},update(g,v){let y=g.map(v.changes);for(const k of v.effects)if(k.is(c)&&(y=De.none),k.is(l)){const $=Math.max(1,Math.min(k.value,v.state.doc.lines)),T=v.state.doc.line($);y=De.set([De.line({class:"cm-target-line"}).range(T.from)])}return y},provide:g=>Se.decorations.from(g)});function h(){i&&(a&&clearTimeout(a),a=setTimeout(()=>{i&&i.dispatch({effects:c.of(void 0)})},1600))}function f(g){if(!i)return;const v=Math.max(1,Math.min(g,i.state.doc.lines)),y=i.state.doc.line(v);i.dispatch({selection:{anchor:y.from},effects:[Se.scrollIntoView(y.from,{y:"center"}),l.of(v)]}),i.focus(),h()}function m(g,v){return rt.create({doc:g,extensions:[cA,OR(),_R,Se.lineWrapping,u,Se.updateListener.of(y=>{!y.docChanged||o||n("update:modelValue",y.state.doc.toString())}),Se.theme({"&":{height:"100%",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",fontSize:"13px",backgroundColor:"rgb(var(--color-retro-black))",color:"rgb(var(--color-retro-text))"},".cm-scroller":{overflow:"auto",lineHeight:"1.6"},".cm-gutters":{backgroundColor:"rgb(var(--color-retro-dark))",color:"rgb(var(--color-retro-subtle))",borderRight:"1px solid rgb(var(--color-retro-border))"},".cm-content":{caretColor:"rgb(var(--color-retro-cyan))",padding:"12px 0"},".cm-activeLine":{backgroundColor:"rgba(34, 211, 238, 0.08)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(34, 211, 238, 0.22)"}}),rt.readOnly.of(v)]})}return zt(()=>{s.value&&(i=new Se({state:m(t.modelValue,t.readOnly),parent:s.value}),t.lineToReveal&&f(t.lineToReveal))}),ze(()=>t.modelValue,g=>{if(!i)return;const v=i.state.doc.toString();v!==g&&(o=!0,i.dispatch({changes:{from:0,to:v.length,insert:g}}),o=!1)}),ze(()=>t.lineToReveal,g=>{g&&f(g)}),Lv(()=>{a&&clearTimeout(a),i&&(i.destroy(),i=null)}),(g,v)=>(O(),b("div",{ref_key:"rootRef",ref:s,class:"h-full w-full"},null,512))}}),ER=ki(RR,[["__scopeId","data-v-d77d4160"]]);function Hl(){function r(e){const t=ft.parse(e);return kg.sanitize(t)}return{renderMarkdown:r}}const BR={class:"fixed inset-0 z-50 flex items-center justify-center"},LR={class:"relative w-[96vw] h-[94vh] bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},DR={class:"flex-shrink-0 flex items-center justify-between px-4 h-12 border-b border-retro-border bg-retro-dark"},ZR={class:"flex items-center gap-3 min-w-0"},IR={class:"text-sm font-mono font-bold text-retro-cyan truncate"},XR={class:"text-xs font-mono text-retro-subtle"},zR={class:"flex items-center gap-2"},NR=["disabled"],VR={class:"flex-shrink-0 flex items-center gap-0 border-b border-retro-border bg-retro-dark overflow-x-auto"},WR=["onClick"],jR={class:"flex-1 min-h-0 overflow-y-auto"},qR={key:0,class:"p-5 max-w-6xl mx-auto"},YR={key:0,class:"flex items-center justify-center py-12"},FR={key:1,class:"flex flex-col items-center justify-center py-12 text-center px-4"},UR={class:"text-sm font-mono text-retro-red"},GR={key:2,class:"space-y-4"},HR={key:0,class:"rounded border border-retro-cyan/40 bg-retro-cyan/10 px-3 py-2 text-xs font-mono text-retro-cyan"},KR={class:"grid grid-cols-2 lg:grid-cols-5 gap-2"},JR={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},eE={class:"text-sm font-mono text-retro-text"},tE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},rE={class:"text-sm font-mono text-retro-cyan"},nE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},sE={class:"text-sm font-mono text-retro-yellow"},iE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},oE={class:"text-sm font-mono text-retro-green"},aE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},lE={class:"text-sm font-mono text-retro-text"},cE={class:"rounded border border-retro-border bg-retro-panel px-3 py-3"},uE={class:"flex items-center justify-between gap-2 mb-2"},hE={class:"text-[11px] font-mono text-retro-subtle"},dE={key:0,class:"text-xs font-mono text-retro-green"},fE={key:1,class:"space-y-2"},pE={class:"uppercase tracking-wide mr-2"},mE={class:"rounded border border-retro-border bg-retro-panel p-3 overflow-x-auto"},gE={class:"min-w-[760px]"},OE={class:"text-retro-text"},vE=["disabled","onClick"],bE=["disabled","onClick"],xE=["disabled","onClick"],yE={class:"text-retro-muted"},kE={key:1,class:"flex items-center justify-center py-12"},wE={key:2,class:"flex flex-col items-center justify-center py-12 text-center px-4"},SE={class:"text-sm font-mono text-retro-red"},$E={key:3,class:"flex flex-col items-center justify-center py-12 text-center"},CE={key:4,class:"h-full flex flex-col"},QE=["innerHTML"],PE=Be({__name:"SpecViewerModal",props:{feature:{}},emits:["close"],setup(r,{emit:e}){const t=r,n=e,s=wi(),{renderMarkdown:i}=Hl(),o=E(t.feature.files[0]?.filename||""),a=E("document"),l=E(""),c=E(!1),u=E(null),h=E(!1),f=E(""),m=E(!1),g=E(null),v=E(null),y=E(!1),k=E(null),$=E(null),T=N(()=>{const S={critical:0,major:1,minor:2};return[...$.value?.alerts??[]].sort((Q,G)=>S[Q.severity]-S[G.severity])});function A(S){return S.status==="covered"?"text-retro-green border-retro-green/40 bg-retro-green/10":S.status==="partial"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-red border-retro-red/40 bg-retro-red/10"}function Z(S){return S.severity==="critical"?"text-retro-red border-retro-red/40 bg-retro-red/10":S.severity==="major"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10"}async function Y(){y.value=!0,k.value=null;try{$.value=await $fetch(`/api/specs/traceability/${t.feature.id}`)}catch{k.value="Failed to load traceability data",$.value=null}finally{y.value=!1}}async function V(S=o.value){if(S){c.value=!0,u.value=null;try{const Q=`/api/specs/${t.feature.id}/${S}`,G=await $fetch(Q);l.value=G.content}catch{u.value="Failed to load file",l.value=""}finally{c.value=!1}}}function re(){V()}const me=N(()=>l.value?i(l.value):"");function J(S){v.value=null,a.value="document",h.value&&(h.value=!1),o.value=S,V()}function W(){h.value&&q(),a.value="traceability",!$.value&&!y.value&&Y()}async function z(S,Q,G){Q&&(o.value!==S?(o.value=S,await V(S)):l.value||await V(S),a.value="document",h.value=!0,f.value=l.value,g.value=null,v.value={filename:S,line:Q,requirementId:G},await tn(),g.value=Q)}function L(){f.value=l.value,g.value=null,h.value=!0}function q(){h.value=!1,f.value=""}async function w(){m.value=!0;try{const S=`/api/specs/${t.feature.id}/${o.value}`;await $fetch(S,{method:"PUT",body:{content:f.value}}),l.value=f.value,h.value=!1,s.success("Saved")}catch{s.error("Failed to save")}finally{m.value=!1}}function x(S){S.key==="Escape"&&(h.value?q():n("close"))}return zt(()=>{window.addEventListener("keydown",x),V(),Y()}),Ht(()=>{window.removeEventListener("keydown",x)}),(S,Q)=>{const G=ER;return O(),ge(hn,{to:"body"},[d("div",BR,[d("div",{class:"absolute inset-0 bg-black/80",onClick:Q[0]||(Q[0]=H=>n("close"))}),d("div",LR,[d("div",DR,[d("div",ZR,[d("span",IR,_(r.feature.name),1),d("span",XR,_(r.feature.id),1)]),d("div",zR,[p(h)?(O(),b(ye,{key:0},[d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-muted transition-colors",onClick:q}," Cancel "),d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-cyan text-retro-cyan hover:bg-retro-cyan/10 transition-colors disabled:opacity-50",disabled:p(m),onClick:w},_(p(m)?"Saving...":"Save"),9,NR)],64)):p(a)==="document"&&p(l)&&!p(c)&&!p(u)?(O(),b("button",{key:1,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Edit",onClick:L},[te(p(gh),{class:"h-4 w-4"})])):X("",!0),d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (ESC)",onClick:Q[1]||(Q[1]=H=>n("close"))},[te(p(ir),{class:"h-4 w-4"})])])]),d("div",VR,[d("button",{type:"button",class:Ce(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap flex items-center gap-1",[p(a)==="traceability"?"border-retro-magenta text-retro-magenta bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:W},[te(p(tb),{class:"h-3.5 w-3.5"}),Q[3]||(Q[3]=Le(" Traceability ",-1))],2),(O(!0),b(ye,null,Ne(r.feature.files,H=>(O(),b("button",{key:H.filename,type:"button",class:Ce(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap",[p(a)==="document"&&p(o)===H.filename?"border-retro-cyan text-retro-cyan bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:fe=>J(H.filename)},_(H.label),11,WR))),128))]),d("div",jR,[p(a)==="traceability"?(O(),b("div",qR,[p(y)?(O(),b("div",YR,[...Q[4]||(Q[4]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading traceability...",-1)])])):p(k)?(O(),b("div",FR,[d("p",UR,_(p(k)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:Y}," Retry ")])):p($)?(O(),b("div",GR,[p(v)?(O(),b("div",HR," Jump target: "+_(p(v).requirementId)+" → "+_(p(v).filename)+":"+_(p(v).line),1)):X("",!0),d("div",KR,[d("div",JR,[Q[5]||(Q[5]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"FR total",-1)),d("p",eE,_(p($).summary.frTotal),1)]),d("div",tE,[Q[6]||(Q[6]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Plan coverage",-1)),d("p",rE,_(p($).summary.frWithPlan)+"/"+_(p($).summary.frTotal),1)]),d("div",nE,[Q[7]||(Q[7]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task mapping",-1)),d("p",sE,_(p($).summary.frWithTasks)+"/"+_(p($).summary.frTotal),1)]),d("div",iE,[Q[8]||(Q[8]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Fully covered",-1)),d("p",oE,_(p($).summary.frFullyCovered)+"/"+_(p($).summary.frTotal),1)]),d("div",aE,[Q[9]||(Q[9]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task progress",-1)),d("p",lE,_(p($).summary.taskCompleted)+"/"+_(p($).summary.taskTotal),1)])]),d("div",cE,[d("div",uE,[Q[10]||(Q[10]=d("h3",{class:"text-xs font-mono text-retro-text"},"Gap Alerts",-1)),d("span",hE,_(p(T).length)+" issues",1)]),p(T).length===0?(O(),b("div",dE," No traceability gaps detected. ")):(O(),b("div",fE,[(O(!0),b(ye,null,Ne(p(T),H=>(O(),b("div",{key:H.id,class:Ce(["rounded border px-2.5 py-2 text-xs font-mono",Z(H)])},[d("span",pE,_(H.severity),1),d("span",null,_(H.message),1)],2))),128))]))]),d("div",mE,[d("div",gE,[Q[11]||(Q[11]=d("div",{class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 text-[11px] font-mono text-retro-subtle px-2 pb-2 border-b border-retro-border"},[d("span",null,"Requirement"),d("span",null,"Spec"),d("span",null,"Plan"),d("span",null,"Tasks"),d("span",null,"Progress")],-1)),(O(!0),b(ye,null,Ne(p($).requirements,H=>(O(),b("div",{key:H.id,class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 items-center px-2 py-2 border-b border-retro-border/60 text-xs font-mono"},[d("span",OE,_(H.id),1),d("button",{type:"button",class:"h-6 rounded border border-retro-green/40 bg-retro-green/10 flex items-center px-2 text-retro-green disabled:opacity-50 disabled:cursor-not-allowed",disabled:!H.locations.specLine,onClick:fe=>z("spec.md",H.locations.specLine,H.id)},[d("span",null,_(H.locations.specLine?`L${H.locations.specLine}`:"Defined"),1)],8,vE),d("button",{type:"button",class:Ce(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",H.inPlan?"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10":"text-retro-subtle border-retro-border bg-retro-black/50"]),disabled:!H.locations.planLine,onClick:fe=>z("plan.md",H.locations.planLine,H.id)},[d("span",null,_(H.locations.planLine?`L${H.locations.planLine}`:H.inPlan?"Linked":"Missing"),1)],10,bE),d("button",{type:"button",class:Ce(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",A(H)]),disabled:H.locations.taskLines.length===0,onClick:fe=>z("tasks.md",H.locations.taskLines[0],H.id)},[d("span",null,_(H.locations.taskLines.length>0?`L${H.locations.taskLines[0]}`:H.inTasks?"Mapped":"Missing"),1)],10,xE),d("span",yE,_(H.taskCompleted)+"/"+_(H.taskTotal),1)]))),128))])])])):X("",!0)])):p(c)?(O(),b("div",kE,[...Q[12]||(Q[12]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading...",-1)])])):p(u)?(O(),b("div",wE,[d("p",SE,_(p(u)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:re}," Retry ")])):r.feature.files.length===0?(O(),b("div",$E,[...Q[13]||(Q[13]=[d("p",{class:"text-sm font-mono text-retro-muted"},"No spec files found",-1),d("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," This feature directory has no .md files ",-1)])])):p(h)?(O(),b("div",CE,[te(G,{modelValue:p(f),"onUpdate:modelValue":Q[2]||(Q[2]=H=>ot(f)?f.value=H:null),"line-to-reveal":p(g),class:"flex-1"},null,8,["modelValue","line-to-reveal"])])):(O(),b("div",{key:5,class:"spec-markdown p-6 text-sm font-mono text-retro-text max-w-4xl mx-auto",innerHTML:p(me)},null,8,QE))])])])])}}}),TE={class:"w-full max-w-2xl rounded-xl border border-retro-border/80 bg-retro-black shadow-[0_24px_70px_rgba(0,0,0,0.55)] overflow-hidden"},ME={class:"flex items-center justify-between px-4 py-2 border-b border-retro-border/60 bg-retro-dark/70"},AE={class:"flex items-center gap-2 px-4 py-3 border-b border-retro-border/60"},_E={class:"flex items-center justify-between px-4 py-1.5 border-b border-retro-border/40 bg-retro-dark/30 text-[10px] font-mono text-retro-subtle"},RE={class:"flex items-center gap-3"},EE={class:"inline-flex items-center gap-1"},BE={key:0},LE={key:0,class:"truncate max-w-[42%]"},DE={class:"max-h-[58vh] overflow-y-auto"},ZE={key:0,class:"px-4 py-3 text-xs font-mono text-retro-subtle animate-pulse"},IE={key:1,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},XE={key:2,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},zE={key:3,class:"px-4 py-3 text-xs font-mono text-retro-red"},NE={key:4,class:"py-2 px-2 space-y-2"},VE=["onMouseenter","onClick"],WE={class:"flex items-center justify-between gap-3 text-[10px] font-mono"},jE={class:"text-retro-cyan/90"},qE={class:"text-retro-subtle truncate"},YE=["innerHTML"],FE={key:5,class:"px-4 py-3 text-xs font-mono text-retro-subtle"},UE={class:"flex items-center justify-between gap-3 px-4 py-2 border-t border-retro-border/60 bg-retro-dark/50 text-[11px] font-mono text-retro-subtle"},GE={key:0,class:"text-retro-yellow"},HE={key:0,class:"px-4 pb-3 text-xs font-mono text-retro-red flex items-center gap-2"},KE=400,JE=Be({__name:"FeatureSearchModal",props:{availableFeatureIds:{}},emits:["close","select"],setup(r,{emit:e}){const t=r,n=e,{renderMarkdown:s}=Hl(),i=E(""),o=E(!1),a=E(!1),l=E(null),c=E(null),u=E(null),h=E(null),f=E([]),m=E(-1),g=E(null),v=E([]);let y=null,k=0;const $=N(()=>i.value.trim()),T=N(()=>{const w=$.value.toLowerCase().split(/\s+/).map(x=>x.trim()).filter(x=>x.length>=2);return Array.from(new Set(w)).slice(0,8)}),A=N(()=>l.value||c.value?"error":!$.value&&a.value?"empty-query":f.value.length>0?"results":a.value&&!o.value?"no-results":"idle");function Z(w){return{featureId:w.chunk.featureId,sourcePath:w.chunk.sourcePath,headingHierarchy:w.chunk.headingHierarchy,snippet:w.chunk.content,matchType:w.matchType,score:w.score,lineStart:w.chunk.lineStart,lineEnd:w.chunk.lineEnd}}async function Y(){const w=$.value;if(c.value=null,!w){a.value=!0,u.value=null,h.value=null,l.value=null,f.value=[],m.value=-1;return}const x=++k;a.value=!0,l.value=null,o.value=!0;try{const S=await $fetch("/api/specs/search",{query:{q:w,mode:"keyword",limit:20}});if(x!==k)return;u.value=S.warning??null,h.value=S.searchTime,f.value=S.results.map(Z),m.value=f.value.length>0?0:-1}catch(S){if(x!==k)return;const Q=S instanceof Error?S.message:"Failed to search specs";l.value=Q,h.value=null,f.value=[],m.value=-1}finally{x===k&&(o.value=!1)}}ze(i,()=>{l.value=null,c.value=null,y&&clearTimeout(y),y=setTimeout(()=>{Y()},KE)}),ze(f,()=>{v.value=[]}),ze(m,async w=>{w<0||(await tn(),v.value[w]?.scrollIntoView({block:"nearest"}))});function V(){n("close")}function re(w){const x=f.value[w];if(x){if(!t.availableFeatureIds.includes(x.featureId)){c.value="Feature unavailable";return}n("select",x.featureId),n("close")}}function me(w){if(f.value.length===0)return;if(m.value<0){m.value=0;return}const x=m.value+w;if(x<0){m.value=f.value.length-1;return}if(x>=f.value.length){m.value=0;return}m.value=x}function J(w){if(w.key==="ArrowDown"){w.preventDefault(),me(1);return}if(w.key==="ArrowUp"){w.preventDefault(),me(-1);return}if(w.key==="Enter"){w.preventDefault(),m.value>=0&&re(m.value);return}w.key==="Escape"&&(w.preventDefault(),V())}function W(w){w.target===w.currentTarget&&V()}function z(w,x){if(!x){v.value[w]=null;return}if(x instanceof HTMLElement){v.value[w]=x;return}const S=x.$el;v.value[w]=S instanceof HTMLElement?S:null}function L(){Y()}function q(w){const x=w.trim();if(!x)return"";const S=x.length>700?`${x.slice(0,700)}...`:x,Q=s(S);if(T.value.length===0)return Q;const G=T.value.map(fe=>fe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),H=new RegExp(`(${G.join("|")})`,"gi");return Q.split(/(<[^>]+>)/g).map(fe=>fe.startsWith("<")?fe:fe.replace(H,"<mark>$1</mark>")).join("")}return zt(()=>{tn(()=>{g.value?.focus()})}),Ht(()=>{y&&clearTimeout(y)}),(w,x)=>(O(),ge(hn,{to:"body"},[te(Un,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:kt(()=>[d("div",{class:"fixed inset-0 z-50 flex items-start justify-center pt-16 px-4 bg-black/75 backdrop-blur-[1px]",onClick:W},[te(Un,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0 translate-y-2 scale-[0.99]","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-1 scale-[0.995]"},{default:kt(()=>[d("div",TE,[d("div",ME,[x[1]||(x[1]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"inline-flex items-center rounded px-2 py-0.5 text-[10px] font-mono border border-retro-cyan/50 text-retro-cyan bg-retro-cyan/10"}," Command Palette "),d("span",{class:"text-[10px] font-mono text-retro-subtle"},"Global spec search")],-1)),d("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (Escape)",onClick:V},[te(p(ir),{class:"h-4 w-4"})])]),d("div",AE,[te(p(Ls),{class:"h-4 w-4 text-retro-cyan"}),Ue(d("input",{ref_key:"inputRef",ref:g,"onUpdate:modelValue":x[0]||(x[0]=S=>ot(i)?i.value=S:null),type:"text",placeholder:"Search specs across all features...",class:"flex-1 bg-transparent text-sm font-mono text-retro-text placeholder:text-retro-subtle focus:outline-none",onKeydown:J},null,544),[[hr,p(i)]]),x[2]||(x[2]=d("span",{class:"text-[10px] font-mono text-retro-subtle border border-retro-border/60 rounded px-1.5 py-0.5"},"400ms",-1))]),d("div",_E,[d("div",RE,[d("span",EE,[te(p(ci),{class:"h-3.5 w-3.5"}),Le(" "+_(p(f).length)+" results ",1)]),p(h)!==null?(O(),b("span",BE,_(p(h))+"ms",1)):X("",!0)]),p($)?(O(),b("span",LE,"“"+_(p($))+"”",1)):X("",!0)]),d("div",DE,[p(o)?(O(),b("div",ZE," Searching... ")):p(A)==="empty-query"?(O(),b("div",IE," Enter a search term to search across all feature specs. ")):p(A)==="no-results"?(O(),b("div",XE," No matching features found. ")):p(A)==="error"?(O(),b("div",zE,[d("p",null,_(p(c)||p(l)),1),p(l)?(O(),b("button",{key:0,type:"button",class:"mt-2 px-2 py-1 rounded border border-retro-border text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:L}," Retry ")):X("",!0)])):p(f).length>0?(O(),b("ul",NE,[(O(!0),b(ye,null,Ne(p(f),(S,Q)=>(O(),b("li",{key:`${S.featureId}:${S.sourcePath}:${Q}`},[d("button",{type:"button",ref_for:!0,ref:G=>z(Q,G),class:Ce(["w-full text-left px-4 py-3 min-h-[132px] rounded-lg border border-retro-border/40 border-l-2 transition-colors",Q===p(m)?"border-retro-cyan bg-retro-panel/95 text-retro-text shadow-[0_0_0_1px_rgba(34,211,238,0.18)]":"text-retro-muted hover:text-retro-text hover:bg-retro-panel/90"]),onMouseenter:G=>m.value=Q,onClick:G=>re(Q)},[d("div",WE,[d("span",jE,_(S.featureId),1),d("span",qE,_(S.sourcePath)+":"+_(S.lineStart)+"-"+_(S.lineEnd),1)]),d("div",{class:"snippet-markdown mt-2 max-h-20 overflow-hidden text-xs text-retro-text",innerHTML:q(S.snippet)},null,8,YE),x[3]||(x[3]=d("div",{class:"mt-2 text-[10px] font-mono text-retro-subtle"}," Select feature ",-1))],42,VE)]))),128))])):(O(),b("div",FE," Start typing to search. "))]),d("div",UE,[x[4]||(x[4]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"↑↓ move"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Enter select"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Esc close")],-1)),p(u)?(O(),b("span",GE,_(p(u)),1)):X("",!0)]),p(c)?(O(),b("div",HE,[te(p(fs),{class:"h-3.5 w-3.5"}),d("span",null,_(p(c)),1)])):X("",!0)])]),_:1})])]),_:1})]))}}),e7=ki(JE,[["__scopeId","data-v-5199b408"]]);function t7(r){return/^\/speckit\.(clarify|plan|tasks|implement)(\s|$)/.test(r)}function r7(r=Date.now,e=Math.random){return`req-${r()}-${e().toString(36).slice(2,8)}`}function Bm(r=Date.now){return`session-${r()}`}function Wa(r,e=!1){const t={};return(!e||r?.hasWorktree)&&r?.worktreePath&&(t.cwd=r.worktreePath,t.worktreeBranch=r.worktreeBranch),r?.featureId&&(t.featureId=r.featureId),Object.keys(t).length>0?t:void 0}function n7(r){if(r.file_path)return String(r.file_path);if(r.path)return String(r.path);if(r.command)return String(r.command).slice(0,50);if(r.pattern)return String(r.pattern);for(const e of Object.values(r))if(typeof e=="string"&&e.length<100)return e;return""}function Lm(r,e="Permission"){const t=r||"",n=t.match(/write to (.+?)(?:[\s,?]|$)/i),s=t.match(/read (.+?)(?:[\s,?]|$)/i),i=t.match(/run (.+?)(?:[?,]|$)/i);return n?.[1]?{tool:"Write",description:t,filePath:n[1].trim()}:s?.[1]?{tool:"Read",description:t,filePath:s[1].trim()}:i?.[1]?{tool:"Bash",description:t,command:i[1].trim()}:{tool:e,description:t}}const Dt=new Map,ls=new Map,Pa=new Set,s7=3e4,Tv=5e4,i7=Math.round(Tv/1e3);function o7(r){switch(r){case 1e3:return"Normal closure";case 1001:return"Endpoint is going away (server shutdown or page navigation)";case 1002:return"Protocol error";case 1003:return"Unsupported data";case 1005:return"No status code received from peer (close frame had no code)";case 1006:return"Abnormal closure (connection dropped without close frame)";case 1007:return"Invalid payload data";case 1008:return"Policy violation";case 1009:return"Message too big";case 1010:return"Missing required extension";case 1011:return"Internal server error";case 1012:return"Service restart";case 1013:return"Try again later (temporary overload)";case 1015:return"TLS handshake failure";default:return r>=4e3&&r<=4999?"Application-specific close code":"Unknown close code"}}function a7(r,e){const t=[];return r.reason?t.push(r.reason):t.push(o7(r.code)),e?.lastServerError?t.push(`Last server error: ${e.lastServerError}`):e?.lastSocketError&&t.push(`Last socket error: ${e.lastSocketError}`),t.push(`wasClean: ${r.wasClean?"yes":"no"}`),t.join(" | ")}function Md(){const r=pn(),e=Ro();function t(){return typeof document>"u"||typeof document.hasFocus!="function"?!1:document.visibilityState==="visible"&&document.hasFocus()}function n(w){const S=r.conversations.find(Q=>Q.id===w)?.title?.trim()||"Chat";return new Notification("Spec Cat",{body:`${S} response completed.`,tag:`chat-complete-${w}`})}async function s(w){if(!(typeof window>"u"||typeof Notification>"u")&&!t()){if(Notification.permission==="granted"){n(w);return}if(Notification.permission==="default")try{await Notification.requestPermission()==="granted"&&n(w)}catch(x){console.warn("[useChatStream] Failed to request browser notification permission:",x)}}}function i(){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws`}function o(w){w.healthCheckInterval&&(clearInterval(w.healthCheckInterval),w.healthCheckInterval=null)}function a(w){o(w),w.lastMessageTime=Date.now(),w.healthCheckInterval=Th(()=>{const x=w.conversationId;if(w.ws.readyState!==WebSocket.OPEN){console.warn(`[useChatStream] Health check: WebSocket not open for ${x}`),o(w),r.isConversationStreaming(x)&&(h(w.currentMessageId,x,"error"),r.updateMessage(w.currentMessageId,{status:"error"},x),r.setSessionError("Connection lost during streaming",x),r.endSession(x),r.endConversationStreaming(x)),Dt.delete(x);return}if(r.isConversationStreaming(x)){const S=Date.now()-w.lastMessageTime;S>Tv&&(console.warn(`[useChatStream] Health check: streaming timeout for ${x} (${Math.round(S/1e3)}s)`),o(w),h(w.currentMessageId,x,"error"),r.updateMessage(w.currentMessageId,{status:"error"},x),r.setSessionError(`Streaming timed out — no response from server for ${i7} seconds`,x),r.endSession(x),r.endConversationStreaming(x),w.ws.close(),Dt.delete(x))}},s7)}function l(w,x){return r.conversations.find(Q=>Q.id===w)?.messages.find(Q=>Q.id===x)?.status}function c(w,x=!0){const S=Dt.get(w);S&&(o(S),x&&S.ws.readyState===WebSocket.OPEN&&S.ws.close(),Dt.delete(w))}function u(w,x,S){!S||!w.currentTextBlockId||(r.updateBlockWithSave(w.currentMessageId,w.currentTextBlockId,Q=>{Q.type==="text"&&(Q.text+=S)},x,{syncContent:!1}),r.appendToMessage(w.currentMessageId,S,x))}function h(w,x,S){const G=r.conversations.find(H=>H.id===x)?.messages.find(H=>H.id===w);if(G?.contentBlocks)for(const H of G.contentBlocks)H.type==="tool_use"&&(H.status==="running"||H.status==="pending")&&r.updateBlockById(w,H.id,fe=>{fe.type==="tool_use"&&(fe.status=S)},x)}async function f(w){try{(await m(w)).send(JSON.stringify({type:"reset_context"})),r.clearProviderSession(w),console.log("[useChatStream] Context reset requested for conversation:",w)}catch(x){throw console.error("[useChatStream] Failed to reset context:",x),x}}function m(w){return new Promise((x,S)=>{let Q=!1;const G=ae=>{Q||(Q=!0,x(ae))},H=ae=>{Q||(Q=!0,S(ae))},fe=Dt.get(w);if(fe&&fe.ws.readyState===WebSocket.OPEN){G(fe.ws);return}fe&&(fe.ws.close(),Dt.delete(w));const ce=i(),K=new WebSocket(ce),oe={ws:K,currentMessageId:"",conversationId:w,activeTools:new Map,currentTextBlockId:null,currentThinkingBlockId:null,healthCheckInterval:null,lastMessageTime:Date.now(),lastServerError:null,lastSocketError:null};Dt.set(w,oe),K.onopen=()=>{G(K)},K.onerror=ae=>{console.error(`[useChatStream] WebSocket error for conversation ${w}:`,ae);const ee=Dt.get(w);ee&&ee.ws!==K||(ee&&(ee.lastSocketError="Browser reported a WebSocket transport error (network/proxy/server)"),r.isConversationStreaming(w)&&(ee?.currentMessageId&&(h(ee.currentMessageId,w,"error"),r.updateMessage(ee.currentMessageId,{status:"error"},w)),r.setSessionError("Connection error during streaming",w),r.endSession(w),r.endConversationStreaming(w)),Dt.delete(w),H(new Error("WebSocket connection failed. Server may be unavailable.")))},K.onclose=ae=>{const ee=Dt.get(w);if(!(ee&&ee.ws!==K)){if(ee&&o(ee),Dt.delete(w),ls.delete(w),!Q){H(new Error(`WebSocket closed before connection was established (code: ${ae.code})`));return}if(r.isConversationStreaming(w)){ee?.currentMessageId&&(h(ee.currentMessageId,w,"error"),r.updateMessage(ee.currentMessageId,{status:"error"},w));const ue=a7(ae,ee);r.setSessionError(`Connection closed: ${ue} (code: ${ae.code})`,w),r.endSession(w),r.endConversationStreaming(w)}}},K.onmessage=ae=>{const ee=Dt.get(w);ee&&ee.ws!==K||k(ae.data,w)}})}async function g(w,x=3){for(let S=0;S<x;S++){const Q=r.conversations.find(G=>G.id===w);if(Q)return Q;S<x-1&&await new Promise(G=>setTimeout(G,100))}console.error("[useChatStream] Conversation not found after retries:",w)}function v(w,x){return`${w}:${x}`}function y(w,x){const S=r.conversations.find(G=>G.id===w);if(!S)return null;const Q=S.messages.findIndex(G=>G.id===x);if(Q<=0)return null;for(let G=Q-1;G>=0;G--){const H=S.messages[G];if(H.role==="user"&&H.content.trim().length>0)return H.content}return null}async function k(w,x){const S=Dt.get(x);if(S){S.lastMessageTime=Date.now();try{r.pushDebugEvent({direction:"in",channel:"ws",eventType:"ws.raw",payload:w},x);const Q=JSON.parse(w);if(r.pushDebugEvent({direction:"in",channel:"ws",eventType:Q.type,payload:Q},x),Q.type==="error"){console.error(`[useChatStream] Server error for ${x}:`,Q.error);const G=Q.error||"Unknown server error";S.lastServerError=G;const H=/codex cannot access session files|failed to clean up stale arg0 temp dirs: Permission denied|failed to initialize rollout recorder: Permission denied|failed to create session: Permission denied|\/\.codex\/.*permission denied/i.test(G);if(/state db missing rollout path for thread/i.test(G)&&!H){const ce=v(x,S.currentMessageId);if(!Pa.has(ce)){const K=y(x,S.currentMessageId);if(K){Pa.add(ce),r.setProviderSessionId("",x),A(S.currentMessageId,`
95
+ }`,{label:"class",detail:"definition",type:"keyword"}),Mr('import {${names}} from "${module}"\n${}',{label:"import",detail:"named",type:"keyword"}),Mr('import ${name} from "${module}"\n${}',{label:"import",detail:"default",type:"keyword"})],z_=iv.concat([Mr("interface ${name} {\n ${}\n}",{label:"interface",detail:"definition",type:"keyword"}),Mr("type ${name} = ${type}",{label:"type",detail:"definition",type:"keyword"}),Mr("enum ${name} {\n ${}\n}",{label:"enum",detail:"definition",type:"keyword"})]),km=new GO,ov=new Set(["Script","Block","FunctionExpression","FunctionDeclaration","ArrowFunction","MethodDeclaration","ForStatement"]);function Yi(r){return(e,t)=>{let n=e.node.getChild("VariableDefinition");return n&&t(n,r),!0}}const N_=["FunctionDeclaration"],V_={FunctionDeclaration:Yi("function"),ClassDeclaration:Yi("class"),ClassExpression:()=>!0,EnumDeclaration:Yi("constant"),TypeAliasDeclaration:Yi("type"),NamespaceDeclaration:Yi("namespace"),VariableDefinition(r,e){r.matchContext(N_)||e(r,"variable")},TypeDefinition(r,e){e(r,"type")},__proto__:null};function av(r,e){let t=km.get(e);if(t)return t;let n=[],s=!0;function i(o,a){let l=r.sliceString(o.from,o.to);n.push({label:l,type:a})}return e.cursor(dt.IncludeAnonymous).iterate(o=>{if(s)s=!1;else if(o.name){let a=V_[o.name];if(a&&a(o,i)||ov.has(o.name))return!1}else if(o.to-o.from>8192){for(let a of av(r,o.node))n.push(a);return!1}}),km.set(e,n),n}const wm=/^[\w$\xa1-\uffff][\w$\d\xa1-\uffff]*$/,lv=["TemplateString","String","RegExp","LineComment","BlockComment","VariableDefinition","TypeDefinition","Label","PropertyDefinition","PropertyName","PrivatePropertyDefinition","PrivatePropertyName","JSXText","JSXAttributeValue","JSXOpenTag","JSXCloseTag","JSXSelfClosingTag",".","?."];function W_(r){let e=St(r.state).resolveInner(r.pos,-1);if(lv.indexOf(e.name)>-1)return null;let t=e.name=="VariableName"||e.to-e.from<20&&wm.test(r.state.sliceDoc(e.from,e.to));if(!t&&!r.explicit)return null;let n=[];for(let s=e;s;s=s.parent)ov.has(s.name)&&(n=n.concat(av(r.state.doc,s)));return{options:n,from:t?e.from:r.pos,validFor:wm}}const Bn=mi.define({name:"javascript",parser:X_.configure({props:[Vo.add({IfStatement:Ia({except:/^\s*({|else\b)/}),TryStatement:Ia({except:/^\s*({|catch\b|finally\b)/}),LabeledStatement:RP,SwitchBody:r=>{let e=r.textAfter,t=/^\s*\}/.test(e),n=/^\s*(case|default)\b/.test(e);return r.baseIndent+(t?0:n?1:2)*r.unit},Block:_P({closing:"}"}),ArrowFunction:r=>r.baseIndent+r.unit,"TemplateString BlockComment":()=>null,"Statement Property":Ia({except:/^\s*{/}),JSXElement(r){let e=/^\s*<\//.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},JSXEscape(r){let e=/\s*\}/.test(r.textAfter);return r.lineIndent(r.node.from)+(e?0:r.unit)},"JSXOpenTag JSXSelfClosingTag"(r){return r.column(r.node.from)+r.unit}}),Ci.add({"Block ClassBody SwitchBody EnumBody ObjectExpression ArrayExpression ObjectType":s0,BlockComment(r){return{from:r.from+2,to:r.to-2}}})]}),languageData:{closeBrackets:{brackets:["(","[","{","'",'"',"`"]},commentTokens:{line:"//",block:{open:"/*",close:"*/"}},indentOnInput:/^\s*(?:case |default:|\{|\}|<\/)$/,wordChars:"$"}}),cv={test:r=>/^JSX/.test(r.name),facet:Jh({commentTokens:{block:{open:"{/*",close:"*/}"}}})},uv=Bn.configure({dialect:"ts"},"typescript"),hv=Bn.configure({dialect:"jsx",props:[ed.add(r=>r.isTop?[cv]:void 0)]}),dv=Bn.configure({dialect:"jsx ts",props:[ed.add(r=>r.isTop?[cv]:void 0)]},"typescript");let fv=r=>({label:r,type:"keyword"});const pv="break case const continue default delete export extends false finally in instanceof let new return static super switch this throw true typeof var yield".split(" ").map(fv),j_=pv.concat(["declare","implements","private","protected","public"].map(fv));function q_(r={}){let e=r.jsx?r.typescript?dv:hv:r.typescript?uv:Bn,t=r.typescript?z_.concat(j_):iv.concat(pv);return new yo(e,[Bn.data.of({autocomplete:eM(lv,s1(t))}),Bn.data.of({autocomplete:W_}),r.jsx?U_:[]])}function Y_(r){for(;;){if(r.name=="JSXOpenTag"||r.name=="JSXSelfClosingTag"||r.name=="JSXFragmentTag")return r;if(r.name=="JSXEscape"||!r.parent)return null;r=r.parent}}function Sm(r,e,t=r.length){for(let n=e?.firstChild;n;n=n.nextSibling)if(n.name=="JSXIdentifier"||n.name=="JSXBuiltin"||n.name=="JSXNamespacedName"||n.name=="JSXMemberExpression")return r.sliceString(n.from,Math.min(n.to,t));return""}const F_=typeof navigator=="object"&&/Android\b/.test(navigator.userAgent),U_=Se.inputHandler.of((r,e,t,n,s)=>{if((F_?r.composing:r.compositionStarted)||r.state.readOnly||e!=t||n!=">"&&n!="/"||!Bn.isActiveAt(r.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c;let{head:u}=l,h=St(o).resolveInner(u-1,-1),f;if(h.name=="JSXStartTag"&&(h=h.parent),!(o.doc.sliceString(u-1,u)!=n||h.name=="JSXAttributeValue"&&h.to>u)){if(n==">"&&h.name=="JSXFragmentTag")return{range:l,changes:{from:u,insert:"</>"}};if(n=="/"&&h.name=="JSXStartCloseTag"){let m=h.parent,g=m.parent;if(g&&m.from==u-2&&((f=Sm(o.doc,g.firstChild,u))||((c=g.firstChild)===null||c===void 0?void 0:c.name)=="JSXFragmentTag")){let v=`${f}>`;return{range:se.cursor(u+v.length,-1),changes:{from:u,insert:v}}}}else if(n==">"){let m=Y_(h);if(m&&m.name=="JSXOpenTag"&&!/^\/?>|^<\//.test(o.doc.sliceString(u,u+2))&&(f=Sm(o.doc,m,u)))return{range:l,changes:{from:u,insert:`</${f}>`}}}}return{range:l}});return a.changes.empty?!1:(r.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),Fi=["_blank","_self","_top","_parent"],Vc=["ascii","utf-8","utf-16","latin1","latin1"],Wc=["get","post","put","delete"],jc=["application/x-www-form-urlencoded","multipart/form-data","text/plain"],zr=["true","false"],Ee={},G_={a:{attrs:{href:null,ping:null,type:null,media:null,target:Fi,hreflang:null}},abbr:Ee,address:Ee,area:{attrs:{alt:null,coords:null,href:null,target:null,ping:null,media:null,hreflang:null,type:null,shape:["default","rect","circle","poly"]}},article:Ee,aside:Ee,audio:{attrs:{src:null,mediagroup:null,crossorigin:["anonymous","use-credentials"],preload:["none","metadata","auto"],autoplay:["autoplay"],loop:["loop"],controls:["controls"]}},b:Ee,base:{attrs:{href:null,target:Fi}},bdi:Ee,bdo:Ee,blockquote:{attrs:{cite:null}},body:Ee,br:Ee,button:{attrs:{form:null,formaction:null,name:null,value:null,autofocus:["autofocus"],disabled:["autofocus"],formenctype:jc,formmethod:Wc,formnovalidate:["novalidate"],formtarget:Fi,type:["submit","reset","button"]}},canvas:{attrs:{width:null,height:null}},caption:Ee,center:Ee,cite:Ee,code:Ee,col:{attrs:{span:null}},colgroup:{attrs:{span:null}},command:{attrs:{type:["command","checkbox","radio"],label:null,icon:null,radiogroup:null,command:null,title:null,disabled:["disabled"],checked:["checked"]}},data:{attrs:{value:null}},datagrid:{attrs:{disabled:["disabled"],multiple:["multiple"]}},datalist:{attrs:{data:null}},dd:Ee,del:{attrs:{cite:null,datetime:null}},details:{attrs:{open:["open"]}},dfn:Ee,div:Ee,dl:Ee,dt:Ee,em:Ee,embed:{attrs:{src:null,type:null,width:null,height:null}},eventsource:{attrs:{src:null}},fieldset:{attrs:{disabled:["disabled"],form:null,name:null}},figcaption:Ee,figure:Ee,footer:Ee,form:{attrs:{action:null,name:null,"accept-charset":Vc,autocomplete:["on","off"],enctype:jc,method:Wc,novalidate:["novalidate"],target:Fi}},h1:Ee,h2:Ee,h3:Ee,h4:Ee,h5:Ee,h6:Ee,head:{children:["title","base","link","style","meta","script","noscript","command"]},header:Ee,hgroup:Ee,hr:Ee,html:{attrs:{manifest:null}},i:Ee,iframe:{attrs:{src:null,srcdoc:null,name:null,width:null,height:null,sandbox:["allow-top-navigation","allow-same-origin","allow-forms","allow-scripts"],seamless:["seamless"]}},img:{attrs:{alt:null,src:null,ismap:null,usemap:null,width:null,height:null,crossorigin:["anonymous","use-credentials"]}},input:{attrs:{alt:null,dirname:null,form:null,formaction:null,height:null,list:null,max:null,maxlength:null,min:null,name:null,pattern:null,placeholder:null,size:null,src:null,step:null,value:null,width:null,accept:["audio/*","video/*","image/*"],autocomplete:["on","off"],autofocus:["autofocus"],checked:["checked"],disabled:["disabled"],formenctype:jc,formmethod:Wc,formnovalidate:["novalidate"],formtarget:Fi,multiple:["multiple"],readonly:["readonly"],required:["required"],type:["hidden","text","search","tel","url","email","password","datetime","date","month","week","time","datetime-local","number","range","color","checkbox","radio","file","submit","image","reset","button"]}},ins:{attrs:{cite:null,datetime:null}},kbd:Ee,keygen:{attrs:{challenge:null,form:null,name:null,autofocus:["autofocus"],disabled:["disabled"],keytype:["RSA"]}},label:{attrs:{for:null,form:null}},legend:Ee,li:{attrs:{value:null}},link:{attrs:{href:null,type:null,hreflang:null,media:null,sizes:["all","16x16","16x16 32x32","16x16 32x32 64x64"]}},map:{attrs:{name:null}},mark:Ee,menu:{attrs:{label:null,type:["list","context","toolbar"]}},meta:{attrs:{content:null,charset:Vc,name:["viewport","application-name","author","description","generator","keywords"],"http-equiv":["content-language","content-type","default-style","refresh"]}},meter:{attrs:{value:null,min:null,low:null,high:null,max:null,optimum:null}},nav:Ee,noscript:Ee,object:{attrs:{data:null,type:null,name:null,usemap:null,form:null,width:null,height:null,typemustmatch:["typemustmatch"]}},ol:{attrs:{reversed:["reversed"],start:null,type:["1","a","A","i","I"]},children:["li","script","template","ul","ol"]},optgroup:{attrs:{disabled:["disabled"],label:null}},option:{attrs:{disabled:["disabled"],label:null,selected:["selected"],value:null}},output:{attrs:{for:null,form:null,name:null}},p:Ee,param:{attrs:{name:null,value:null}},pre:Ee,progress:{attrs:{value:null,max:null}},q:{attrs:{cite:null}},rp:Ee,rt:Ee,ruby:Ee,samp:Ee,script:{attrs:{type:["text/javascript"],src:null,async:["async"],defer:["defer"],charset:Vc}},section:Ee,select:{attrs:{form:null,name:null,size:null,autofocus:["autofocus"],disabled:["disabled"],multiple:["multiple"]}},slot:{attrs:{name:null}},small:Ee,source:{attrs:{src:null,type:null,media:null}},span:Ee,strong:Ee,style:{attrs:{type:["text/css"],media:null,scoped:null}},sub:Ee,summary:Ee,sup:Ee,table:Ee,tbody:Ee,td:{attrs:{colspan:null,rowspan:null,headers:null}},template:Ee,textarea:{attrs:{dirname:null,form:null,maxlength:null,name:null,placeholder:null,rows:null,cols:null,autofocus:["autofocus"],disabled:["disabled"],readonly:["readonly"],required:["required"],wrap:["soft","hard"]}},tfoot:Ee,th:{attrs:{colspan:null,rowspan:null,headers:null,scope:["row","col","rowgroup","colgroup"]}},thead:Ee,time:{attrs:{datetime:null}},title:Ee,tr:Ee,track:{attrs:{src:null,label:null,default:null,kind:["subtitles","captions","descriptions","chapters","metadata"],srclang:null}},ul:{children:["li","script","template","ul","ol"]},var:Ee,video:{attrs:{src:null,poster:null,width:null,height:null,crossorigin:["anonymous","use-credentials"],preload:["auto","metadata","none"],autoplay:["autoplay"],mediagroup:["movie"],muted:["muted"],controls:["controls"]}},wbr:Ee},mv={accesskey:null,class:null,contenteditable:zr,contextmenu:null,dir:["ltr","rtl","auto"],draggable:["true","false","auto"],dropzone:["copy","move","link","string:","file:"],hidden:["hidden"],id:null,inert:["inert"],itemid:null,itemprop:null,itemref:null,itemscope:["itemscope"],itemtype:null,lang:["ar","bn","de","en-GB","en-US","es","fr","hi","id","ja","pa","pt","ru","tr","zh"],spellcheck:zr,autocorrect:zr,autocapitalize:zr,style:null,tabindex:null,title:null,translate:["yes","no"],rel:["stylesheet","alternate","author","bookmark","help","license","next","nofollow","noreferrer","prefetch","prev","search","tag"],role:"alert application article banner button cell checkbox complementary contentinfo dialog document feed figure form grid gridcell heading img list listbox listitem main navigation region row rowgroup search switch tab table tabpanel textbox timer".split(" "),"aria-activedescendant":null,"aria-atomic":zr,"aria-autocomplete":["inline","list","both","none"],"aria-busy":zr,"aria-checked":["true","false","mixed","undefined"],"aria-controls":null,"aria-describedby":null,"aria-disabled":zr,"aria-dropeffect":null,"aria-expanded":["true","false","undefined"],"aria-flowto":null,"aria-grabbed":["true","false","undefined"],"aria-haspopup":zr,"aria-hidden":zr,"aria-invalid":["true","false","grammar","spelling"],"aria-label":null,"aria-labelledby":null,"aria-level":null,"aria-live":["off","polite","assertive"],"aria-multiline":zr,"aria-multiselectable":zr,"aria-owns":null,"aria-posinset":null,"aria-pressed":["true","false","mixed","undefined"],"aria-readonly":zr,"aria-relevant":null,"aria-required":zr,"aria-selected":["true","false","undefined"],"aria-setsize":null,"aria-sort":["ascending","descending","none","other"],"aria-valuemax":null,"aria-valuemin":null,"aria-valuenow":null,"aria-valuetext":null},gv="beforeunload copy cut dragstart dragover dragleave dragenter dragend drag paste focus blur change click load mousedown mouseenter mouseleave mouseup keydown keyup resize scroll unload".split(" ").map(r=>"on"+r);for(let r of gv)mv[r]=null;class _o{constructor(e,t){this.tags={...G_,...e},this.globalAttrs={...mv,...t},this.allTags=Object.keys(this.tags),this.globalAttrNames=Object.keys(this.globalAttrs)}}_o.default=new _o;function xi(r,e,t=r.length){if(!e)return"";let n=e.firstChild,s=n&&n.getChild("TagName");return s?r.sliceString(s.from,Math.min(s.to,t)):""}function yi(r,e=!1){for(;r;r=r.parent)if(r.name=="Element")if(e)e=!1;else return r;return null}function Ov(r,e,t){let n=t.tags[xi(r,yi(e))];return n?.children||t.allTags}function Qd(r,e){let t=[];for(let n=yi(e);n&&!n.type.isTop;n=yi(n.parent)){let s=xi(r,n);if(s&&n.lastChild.name=="CloseTag")break;s&&t.indexOf(s)<0&&(e.name=="EndTag"||e.from>=n.firstChild.to)&&t.push(s)}return t}const vv=/^[:\-\.\w\u00b7-\uffff]*$/;function $m(r,e,t,n,s){let i=/\s*>/.test(r.sliceDoc(s,s+5))?"":">",o=yi(t,t.name=="StartTag"||t.name=="TagName");return{from:n,to:s,options:Ov(r.doc,o,e).map(a=>({label:a,type:"type"})).concat(Qd(r.doc,t).map((a,l)=>({label:"/"+a,apply:"/"+a+i,type:"type",boost:99-l}))),validFor:/^\/?[:\-\.\w\u00b7-\uffff]*$/}}function Cm(r,e,t,n){let s=/\s*>/.test(r.sliceDoc(n,n+5))?"":">";return{from:t,to:n,options:Qd(r.doc,e).map((i,o)=>({label:i,apply:i+s,type:"type",boost:99-o})),validFor:vv}}function H_(r,e,t,n){let s=[],i=0;for(let o of Ov(r.doc,t,e))s.push({label:"<"+o,type:"type"});for(let o of Qd(r.doc,t))s.push({label:"</"+o+">",type:"type",boost:99-i++});return{from:n,to:n,options:s,validFor:/^<\/?[:\-\.\w\u00b7-\uffff]*$/}}function K_(r,e,t,n,s){let i=yi(t),o=i?e.tags[xi(r.doc,i)]:null,a=o&&o.attrs?Object.keys(o.attrs):[],l=o&&o.globalAttrs===!1?a:a.length?a.concat(e.globalAttrNames):e.globalAttrNames;return{from:n,to:s,options:l.map(c=>({label:c,type:"property"})),validFor:vv}}function J_(r,e,t,n,s){var i;let o=(i=t.parent)===null||i===void 0?void 0:i.getChild("AttributeName"),a=[],l;if(o){let c=r.sliceDoc(o.from,o.to),u=e.globalAttrs[c];if(!u){let h=yi(t),f=h?e.tags[xi(r.doc,h)]:null;u=f?.attrs&&f.attrs[c]}if(u){let h=r.sliceDoc(n,s).toLowerCase(),f='"',m='"';/^['"]/.test(h)?(l=h[0]=='"'?/^[^"]*$/:/^[^']*$/,f="",m=r.sliceDoc(s,s+1)==h[0]?"":h[0],h=h.slice(1),n++):l=/^[^\s<>='"]*$/;for(let g of u)a.push({label:g,apply:f+g+m,type:"constant"})}}return{from:n,to:s,options:a,validFor:l}}function bv(r,e){let{state:t,pos:n}=e,s=St(t).resolveInner(n,-1),i=s.resolve(n);for(let o=n,a;i==s&&(a=s.childBefore(o));){let l=a.lastChild;if(!l||!l.type.isError||l.from<l.to)break;i=s=a,o=l.from}return s.name=="TagName"?s.parent&&/CloseTag$/.test(s.parent.name)?Cm(t,s,s.from,n):$m(t,r,s,s.from,n):s.name=="StartTag"||s.name=="IncompleteTag"?$m(t,r,s,n,n):s.name=="StartCloseTag"||s.name=="IncompleteCloseTag"?Cm(t,s,n,n):s.name=="OpenTag"||s.name=="SelfClosingTag"||s.name=="AttributeName"?K_(t,r,s,s.name=="AttributeName"?s.from:n,n):s.name=="Is"||s.name=="AttributeValue"||s.name=="UnquotedAttributeValue"?J_(t,r,s,s.name=="Is"?n:s.from,n):e.explicit&&(i.name=="Element"||i.name=="Text"||i.name=="Document")?H_(t,r,s,n):null}function eR(r){return bv(_o.default,r)}function tR(r){let{extraTags:e,extraGlobalAttributes:t}=r,n=t||e?new _o(e,t):_o.default;return s=>bv(n,s)}const rR=Bn.parser.configure({top:"SingleExpression"}),xv=[{tag:"script",attrs:r=>r.type=="text/typescript"||r.lang=="ts",parser:uv.parser},{tag:"script",attrs:r=>r.type=="text/babel"||r.type=="text/jsx",parser:hv.parser},{tag:"script",attrs:r=>r.type=="text/typescript-jsx",parser:dv.parser},{tag:"script",attrs(r){return/^(importmap|speculationrules|application\/(.+\+)?json)$/i.test(r.type)},parser:rR},{tag:"script",attrs(r){return!r.type||/^(?:text|application)\/(?:x-)?(?:java|ecma)script$|^module$|^$/i.test(r.type)},parser:Bn.parser},{tag:"style",attrs(r){return(!r.lang||r.lang=="css")&&(!r.type||/^(text\/)?(x-)?(stylesheet|css)$/i.test(r.type))},parser:Ql.parser}],yv=[{name:"style",parser:Ql.parser.configure({top:"Styles"})}].concat(gv.map(r=>({name:r,parser:Bn.parser}))),kv=mi.define({name:"html",parser:Q4.configure({props:[Vo.add({Element(r){let e=/^(\s*)(<\/)?/.exec(r.textAfter);return r.node.to<=r.pos+e[0].length?r.continue():r.lineIndent(r.node.from)+(e[2]?0:r.unit)},"OpenTag CloseTag SelfClosingTag"(r){return r.column(r.node.from)+r.unit},Document(r){if(r.pos+/\s*/.exec(r.textAfter)[0].length<r.node.to)return r.continue();let e=null,t;for(let n=r.node;;){let s=n.lastChild;if(!s||s.name!="Element"||s.to!=n.to)break;e=n=s}return e&&!((t=e.lastChild)&&(t.name=="CloseTag"||t.name=="SelfClosingTag"))?r.lineIndent(e.from)+r.unit:null}}),Ci.add({Element(r){let e=r.firstChild,t=r.lastChild;return!e||e.name!="OpenTag"?null:{from:e.to,to:t.name=="CloseTag"?t.from:r.to}}}),O0.add({"OpenTag CloseTag":r=>r.getChild("TagName")})]}),languageData:{commentTokens:{block:{open:"<!--",close:"-->"}},indentOnInput:/^\s*<\/\w+\W$/,wordChars:"-_"}}),Na=kv.configure({wrap:K1(xv,yv)});function nR(r={}){let e="",t;r.matchClosingTags===!1&&(e="noMatch"),r.selfClosingTags===!0&&(e=(e?e+" ":"")+"selfClosing"),(r.nestedLanguages&&r.nestedLanguages.length||r.nestedAttributes&&r.nestedAttributes.length)&&(t=K1((r.nestedLanguages||[]).concat(xv),(r.nestedAttributes||[]).concat(yv)));let n=t?kv.configure({wrap:t,dialect:e}):e?Na.configure({dialect:e}):Na;return new yo(n,[Na.data.of({autocomplete:tR(r)}),r.autoCloseTags!==!1?sR:[],q_().support,c_().support])}const Qm=new Set("area base br col command embed frame hr img input keygen link meta param source track wbr menuitem".split(" ")),sR=Se.inputHandler.of((r,e,t,n,s)=>{if(r.composing||r.state.readOnly||e!=t||n!=">"&&n!="/"||!Na.isActiveAt(r.state,e,-1))return!1;let i=s(),{state:o}=i,a=o.changeByRange(l=>{var c,u,h;let f=o.doc.sliceString(l.from-1,l.to)==n,{head:m}=l,g=St(o).resolveInner(m,-1),v;if(f&&n==">"&&g.name=="EndTag"){let y=g.parent;if(((u=(c=y.parent)===null||c===void 0?void 0:c.lastChild)===null||u===void 0?void 0:u.name)!="CloseTag"&&(v=xi(o.doc,y.parent,m))&&!Qm.has(v)){let k=m+(o.doc.sliceString(m,m+1)===">"?1:0),$=`</${v}>`;return{range:l,changes:{from:m,to:k,insert:$}}}}else if(f&&n=="/"&&g.name=="IncompleteCloseTag"){let y=g.parent;if(g.from==m-2&&((h=y.lastChild)===null||h===void 0?void 0:h.name)!="CloseTag"&&(v=xi(o.doc,y,m))&&!Qm.has(v)){let k=m+(o.doc.sliceString(m,m+1)===">"?1:0),$=`${v}>`;return{range:se.cursor(m+$.length,-1),changes:{from:m,to:k,insert:$}}}}return{range:l}});return a.changes.empty?!1:(r.dispatch([i,o.update(a,{userEvent:"input.complete",scrollIntoView:!0})]),!0)}),wv=Jh({commentTokens:{block:{open:"<!--",close:"-->"}}}),Sv=new Ye,$v=yA.configure({props:[Ci.add(r=>!r.is("Block")||r.is("Document")||lh(r)!=null||iR(r)?void 0:(e,t)=>({from:t.doc.lineAt(e.from).to,to:e.to})),Sv.add(lh),Vo.add({Document:()=>null}),Rs.add({Document:wv})]});function lh(r){let e=/^(?:ATX|Setext)Heading(\d)$/.exec(r.name);return e?+e[1]:void 0}function iR(r){return r.name=="OrderedList"||r.name=="BulletList"}function oR(r,e){let t=r;for(;;){let n=t.nextSibling,s;if(!n||(s=lh(n.type))!=null&&s<=e)break;t=n}return t.to}const aR=n0.of((r,e,t)=>{for(let n=St(r).resolveInner(t,-1);n&&!(n.from<e);n=n.parent){let s=n.type.prop(Sv);if(s==null)continue;let i=oR(n,s);if(i>t)return{from:t,to:i}}return null});function Pd(r){return new Kr(wv,r,[],"markdown")}const lR=Pd($v),cR=$v.configure([_A,EA,RA,BA,{props:[Ci.add({Table:(r,e)=>({from:e.doc.lineAt(r.from).to,to:r.to})})]}]),Pl=Pd(cR);function uR(r,e){return t=>{if(t&&r){let n=null;if(t=/\S*/.exec(t)[0],typeof r=="function"?n=r(t):n=cl.matchLanguageName(r,t,!0),n instanceof cl)return n.support?n.support.language.parser:xo.getSkippingParser(n.load());if(n)return n.parser}return e?e.parser:null}}class qc{constructor(e,t,n,s,i,o,a){this.node=e,this.from=t,this.to=n,this.spaceBefore=s,this.spaceAfter=i,this.type=o,this.item=a}blank(e,t=!0){let n=this.spaceBefore+(this.node.name=="Blockquote"?">":"");if(e!=null){for(;n.length<e;)n+=" ";return n}else{for(let s=this.to-this.from-n.length-this.spaceAfter.length;s>0;s--)n+=" ";return n+(t?this.spaceAfter:"")}}marker(e,t){let n=this.node.name=="OrderedList"?String(+Qv(this.item,e)[2]+t):"";return this.spaceBefore+n+this.type+this.spaceAfter}}function Cv(r,e){let t=[],n=[];for(let s=r;s;s=s.parent){if(s.name=="FencedCode")return n;(s.name=="ListItem"||s.name=="Blockquote")&&t.push(s)}for(let s=t.length-1;s>=0;s--){let i=t[s],o,a=e.lineAt(i.from),l=i.from-a.from;if(i.name=="Blockquote"&&(o=/^ *>( ?)/.exec(a.text.slice(l))))n.push(new qc(i,l,l+o[0].length,"",o[1],">",null));else if(i.name=="ListItem"&&i.parent.name=="OrderedList"&&(o=/^( *)\d+([.)])( *)/.exec(a.text.slice(l)))){let c=o[3],u=o[0].length;c.length>=4&&(c=c.slice(0,c.length-4),u-=4),n.push(new qc(i.parent,l,l+u,o[1],c,o[2],i))}else if(i.name=="ListItem"&&i.parent.name=="BulletList"&&(o=/^( *)([-+*])( {1,4}\[[ xX]\])?( +)/.exec(a.text.slice(l)))){let c=o[4],u=o[0].length;c.length>4&&(c=c.slice(0,c.length-4),u-=4);let h=o[2];o[3]&&(h+=o[3].replace(/[xX]/," ")),n.push(new qc(i.parent,l,l+u,o[1],c,h,i))}}return n}function Qv(r,e){return/^(\s*)(\d+)(?=[.)])/.exec(e.sliceString(r.from,r.from+10))}function Yc(r,e,t,n=0){for(let s=-1,i=r;;){if(i.name=="ListItem"){let a=Qv(i,e),l=+a[2];if(s>=0){if(l!=s+1)return;t.push({from:i.from+a[1].length,to:i.from+a[0].length,insert:String(s+2+n)})}s=l}let o=i.nextSibling;if(!o)break;i=o}}function Td(r,e){let t=/^[ \t]*/.exec(r)[0].length;if(!t||e.facet(No)!=" ")return r;let n=dn(r,4,t),s="";for(let i=n;i>0;)i>=4?(s+=" ",i-=4):(s+=" ",i--);return s+r.slice(t)}const hR=(r={})=>({state:e,dispatch:t})=>{let n=St(e),{doc:s}=e,i=null,o=e.changeByRange(a=>{if(!a.empty||!Pl.isActiveAt(e,a.from,-1)&&!Pl.isActiveAt(e,a.from,1))return i={range:a};let l=a.from,c=s.lineAt(l),u=Cv(n.resolveInner(l,-1),s);for(;u.length&&u[u.length-1].from>l-c.from;)u.pop();if(!u.length)return i={range:a};let h=u[u.length-1];if(h.to-h.spaceAfter.length>l-c.from)return i={range:a};let f=l>=h.to-h.spaceAfter.length&&!/\S/.test(c.text.slice(h.to));if(h.item&&f){let k=h.node.firstChild,$=h.node.getChild("ListItem","ListItem");if(k.to>=l||$&&$.to<l||c.from>0&&!/[^\s>]/.test(s.lineAt(c.from-1).text)||r.nonTightLists===!1){let T=u.length>1?u[u.length-2]:null,A,Z="";T&&T.item?(A=c.from+T.from,Z=T.marker(s,1)):A=c.from+(T?T.to:0);let Y=[{from:A,to:l,insert:Z}];return h.node.name=="OrderedList"&&Yc(h.item,s,Y,-2),T&&T.node.name=="OrderedList"&&Yc(T.item,s,Y),{range:se.cursor(A+Z.length),changes:Y}}else{let T=Tm(u,e,c);return{range:se.cursor(l+T.length+1),changes:{from:c.from,insert:T+e.lineBreak}}}}if(h.node.name=="Blockquote"&&f&&c.from){let k=s.lineAt(c.from-1),$=/>\s*$/.exec(k.text);if($&&$.index==h.from){let T=e.changes([{from:k.from+$.index,to:k.to},{from:c.from+h.from,to:c.to}]);return{range:a.map(T),changes:T}}}let m=[];h.node.name=="OrderedList"&&Yc(h.item,s,m);let g=h.item&&h.item.from<c.from,v="";if(!g||/^[\s\d.)\-+*>]*/.exec(c.text)[0].length>=h.to)for(let k=0,$=u.length-1;k<=$;k++)v+=k==$&&!g?u[k].marker(s,1):u[k].blank(k<$?dn(c.text,4,u[k+1].from)-v.length:null);let y=l;for(;y>c.from&&/\s/.test(c.text.charAt(y-c.from-1));)y--;return v=Td(v,e),fR(h.node,e.doc)&&(v=Tm(u,e,c)+e.lineBreak+v),m.push({from:y,to:l,insert:e.lineBreak+v}),{range:se.cursor(y+v.length+1),changes:m}});return i?!1:(t(e.update(o,{scrollIntoView:!0,userEvent:"input"})),!0)},dR=hR();function Pm(r){return r.name=="QuoteMark"||r.name=="ListMark"}function fR(r,e){if(r.name!="OrderedList"&&r.name!="BulletList")return!1;let t=r.firstChild,n=r.getChild("ListItem","ListItem");if(!n)return!1;let s=e.lineAt(t.to),i=e.lineAt(n.from),o=/^[\s>]*$/.test(s.text);return s.number+(o?0:1)<i.number}function Tm(r,e,t){let n="";for(let s=0,i=r.length-2;s<=i;s++)n+=r[s].blank(s<i?dn(t.text,4,r[s+1].from)-n.length:null,s<i);return Td(n,e)}function pR(r,e){let t=r.resolveInner(e,-1),n=e;Pm(t)&&(n=t.from,t=t.parent);for(let s;s=t.childBefore(n);)if(Pm(s))n=s.from;else if(s.name=="OrderedList"||s.name=="BulletList")t=s.lastChild,n=t.to;else break;return t}const mR=({state:r,dispatch:e})=>{let t=St(r),n=null,s=r.changeByRange(i=>{let o=i.from,{doc:a}=r;if(i.empty&&Pl.isActiveAt(r,i.from)){let l=a.lineAt(o),c=Cv(pR(t,o),a);if(c.length){let u=c[c.length-1],h=u.to-u.spaceAfter.length+(u.spaceAfter?1:0);if(o-l.from>h&&!/\S/.test(l.text.slice(h,o-l.from)))return{range:se.cursor(l.from+h),changes:{from:l.from+h,to:o}};if(o-l.from==h&&(!u.item||l.from<=u.item.from||!/\S/.test(l.text.slice(0,u.to)))){let f=l.from+u.from;if(u.item&&u.node.from<u.item.from&&/\S/.test(l.text.slice(u.from,u.to))){let m=u.blank(dn(l.text,4,u.to)-dn(l.text,4,u.from));return f==l.from&&(m=Td(m,r)),{range:se.cursor(f+m.length),changes:{from:f,to:l.from+u.to,insert:m}}}if(f<o)return{range:se.cursor(f),changes:{from:f,to:o}}}}}return n={range:i}});return n?!1:(e(r.update(s,{scrollIntoView:!0,userEvent:"delete"})),!0)},gR=[{key:"Enter",run:dR},{key:"Backspace",run:mR}],Pv=nR({matchClosingTags:!1});function OR(r={}){let{codeLanguages:e,defaultCodeLanguage:t,addKeymap:n=!0,base:{parser:s}=lR,completeHTMLTags:i=!0,pasteURLAsLink:o=!0,htmlTagLanguage:a=Pv}=r;if(!(s instanceof Gl))throw new RangeError("Base parser provided to `markdown` should be a Markdown parser");let l=r.extensions?[r.extensions]:[],c=[a.support,aR],u;o&&c.push(yR),t instanceof yo?(c.push(t.support),u=t.language):t&&(u=t);let h=e||u?uR(e,u):void 0;l.push(wA({codeParser:h,htmlParser:a.language.parser})),n&&c.push(es.high(Io.of(gR)));let f=Pd(s.configure(l));return i&&c.push(f.data.of({autocomplete:vR})),new yo(f,c)}function vR(r){let{state:e,pos:t}=r,n=/<[:\-\.\w\u00b7-\uffff]*$/.exec(e.sliceDoc(t-25,t));if(!n)return null;let s=St(e).resolveInner(t,-1);for(;s&&!s.type.isTop;){if(s.name=="CodeBlock"||s.name=="FencedCode"||s.name=="ProcessingInstructionBlock"||s.name=="CommentBlock"||s.name=="Link"||s.name=="Image")return null;s=s.parent}return{from:t-n[0].length,to:t,options:bR(),validFor:/^<[:\-\.\w\u00b7-\uffff]*$/}}let Fc=null;function bR(){if(Fc)return Fc;let r=eR(new ud(rt.create({extensions:Pv}),0,!0));return Fc=r?r.options:[]}const xR=/code|horizontalrule|html|link|comment|processing|escape|entity|image|mark|url/i,yR=Se.domEventHandlers({paste:(r,e)=>{var t;let{main:n}=e.state.selection;if(n.empty)return!1;let s=(t=r.clipboardData)===null||t===void 0?void 0:t.getData("text/plain");if(!s||!/^(https?:\/\/|mailto:|xmpp:|www\.)/.test(s)||(/^www\./.test(s)&&(s="https://"+s),!Pl.isActiveAt(e.state,n.from,1)))return!1;let i=St(e.state),o=!1;return i.iterate({from:n.from,to:n.to,enter:a=>{(a.from>n.from||xR.test(a.name))&&(o=!0)},leave:a=>{a.to<n.to&&(o=!0)}}),o?!1:(e.dispatch({changes:[{from:n.from,insert:"["},{from:n.to,insert:`](${s})`}],userEvent:"input.paste",scrollIntoView:!0}),!0)}}),kR="#e5c07b",Mm="#e06c75",wR="#56b6c2",SR="#ffffff",Va="#abb2bf",ch="#7d8799",$R="#61afef",CR="#98c379",Am="#d19a66",QR="#c678dd",PR="#21252b",_m="#2c313a",Rm="#282c34",Uc="#353a42",TR="#3E4451",Em="#528bff",MR=Se.theme({"&":{color:Va,backgroundColor:Rm},".cm-content":{caretColor:Em},".cm-cursor, .cm-dropCursor":{borderLeftColor:Em},"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground, .cm-selectionBackground, .cm-content ::selection":{backgroundColor:TR},".cm-panels":{backgroundColor:PR,color:Va},".cm-panels.cm-panels-top":{borderBottom:"2px solid black"},".cm-panels.cm-panels-bottom":{borderTop:"2px solid black"},".cm-searchMatch":{backgroundColor:"#72a1ff59",outline:"1px solid #457dff"},".cm-searchMatch.cm-searchMatch-selected":{backgroundColor:"#6199ff2f"},".cm-activeLine":{backgroundColor:"#6699ff0b"},".cm-selectionMatch":{backgroundColor:"#aafe661a"},"&.cm-focused .cm-matchingBracket, &.cm-focused .cm-nonmatchingBracket":{backgroundColor:"#bad0f847"},".cm-gutters":{backgroundColor:Rm,color:ch,border:"none"},".cm-activeLineGutter":{backgroundColor:_m},".cm-foldPlaceholder":{backgroundColor:"transparent",border:"none",color:"#ddd"},".cm-tooltip":{border:"none",backgroundColor:Uc},".cm-tooltip .cm-tooltip-arrow:before":{borderTopColor:"transparent",borderBottomColor:"transparent"},".cm-tooltip .cm-tooltip-arrow:after":{borderTopColor:Uc,borderBottomColor:Uc},".cm-tooltip-autocomplete":{"& > ul > li[aria-selected]":{backgroundColor:_m,color:Va}}},{dark:!0}),AR=jo.define([{tag:M.keyword,color:QR},{tag:[M.name,M.deleted,M.character,M.propertyName,M.macroName],color:Mm},{tag:[M.function(M.variableName),M.labelName],color:$R},{tag:[M.color,M.constant(M.name),M.standard(M.name)],color:Am},{tag:[M.definition(M.name),M.separator],color:Va},{tag:[M.typeName,M.className,M.number,M.changed,M.annotation,M.modifier,M.self,M.namespace],color:kR},{tag:[M.operator,M.operatorKeyword,M.url,M.escape,M.regexp,M.link,M.special(M.string)],color:wR},{tag:[M.meta,M.comment],color:ch},{tag:M.strong,fontWeight:"bold"},{tag:M.emphasis,fontStyle:"italic"},{tag:M.strikethrough,textDecoration:"line-through"},{tag:M.link,color:ch,textDecoration:"underline"},{tag:M.heading,fontWeight:"bold",color:Mm},{tag:[M.atom,M.bool,M.special(M.variableName)],color:Am},{tag:[M.processingInstruction,M.string,M.inserted],color:CR},{tag:M.invalid,color:SR}]),_R=[MR,f0(AR)],RR=Be({__name:"MarkdownCodeEditor",props:{modelValue:{},readOnly:{type:Boolean,default:!1},lineToReveal:{default:null}},emits:["update:modelValue"],setup(r,{emit:e}){const t=r,n=e,s=E(null);let i=null,o=!1,a=null;const l=We.define(),c=We.define(),u=or.define({create(){return De.none},update(g,v){let y=g.map(v.changes);for(const k of v.effects)if(k.is(c)&&(y=De.none),k.is(l)){const $=Math.max(1,Math.min(k.value,v.state.doc.lines)),T=v.state.doc.line($);y=De.set([De.line({class:"cm-target-line"}).range(T.from)])}return y},provide:g=>Se.decorations.from(g)});function h(){i&&(a&&clearTimeout(a),a=setTimeout(()=>{i&&i.dispatch({effects:c.of(void 0)})},1600))}function f(g){if(!i)return;const v=Math.max(1,Math.min(g,i.state.doc.lines)),y=i.state.doc.line(v);i.dispatch({selection:{anchor:y.from},effects:[Se.scrollIntoView(y.from,{y:"center"}),l.of(v)]}),i.focus(),h()}function m(g,v){return rt.create({doc:g,extensions:[cA,OR(),_R,Se.lineWrapping,u,Se.updateListener.of(y=>{!y.docChanged||o||n("update:modelValue",y.state.doc.toString())}),Se.theme({"&":{height:"100%",fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace",fontSize:"13px",backgroundColor:"rgb(var(--color-retro-black))",color:"rgb(var(--color-retro-text))"},".cm-scroller":{overflow:"auto",lineHeight:"1.6"},".cm-gutters":{backgroundColor:"rgb(var(--color-retro-dark))",color:"rgb(var(--color-retro-subtle))",borderRight:"1px solid rgb(var(--color-retro-border))"},".cm-content":{caretColor:"rgb(var(--color-retro-cyan))",padding:"12px 0"},".cm-activeLine":{backgroundColor:"rgba(34, 211, 238, 0.08)"},".cm-selectionBackground, &.cm-focused .cm-selectionBackground":{backgroundColor:"rgba(34, 211, 238, 0.22)"}}),rt.readOnly.of(v)]})}return zt(()=>{s.value&&(i=new Se({state:m(t.modelValue,t.readOnly),parent:s.value}),t.lineToReveal&&f(t.lineToReveal))}),ze(()=>t.modelValue,g=>{if(!i)return;const v=i.state.doc.toString();v!==g&&(o=!0,i.dispatch({changes:{from:0,to:v.length,insert:g}}),o=!1)}),ze(()=>t.lineToReveal,g=>{g&&f(g)}),Lv(()=>{a&&clearTimeout(a),i&&(i.destroy(),i=null)}),(g,v)=>(O(),b("div",{ref_key:"rootRef",ref:s,class:"h-full w-full"},null,512))}}),ER=ki(RR,[["__scopeId","data-v-d77d4160"]]);function Hl(){function r(e){const t=ft.parse(e);return kg.sanitize(t)}return{renderMarkdown:r}}const BR={class:"fixed inset-0 z-50 flex items-center justify-center"},LR={class:"relative w-[96vw] h-[94vh] bg-retro-black border border-retro-border rounded-lg shadow-2xl flex flex-col overflow-hidden"},DR={class:"flex-shrink-0 flex items-center justify-between px-4 h-12 border-b border-retro-border bg-retro-dark"},ZR={class:"flex items-center gap-3 min-w-0"},IR={class:"text-sm font-mono font-bold text-retro-cyan truncate"},XR={class:"text-xs font-mono text-retro-subtle"},zR={class:"flex items-center gap-2"},NR=["disabled"],VR={class:"flex-shrink-0 flex items-center gap-0 border-b border-retro-border bg-retro-dark overflow-x-auto"},WR=["onClick"],jR={class:"flex-1 min-h-0 overflow-y-auto"},qR={key:0,class:"p-5 max-w-6xl mx-auto"},YR={key:0,class:"flex items-center justify-center py-12"},FR={key:1,class:"flex flex-col items-center justify-center py-12 text-center px-4"},UR={class:"text-sm font-mono text-retro-red"},GR={key:2,class:"space-y-4"},HR={key:0,class:"rounded border border-retro-cyan/40 bg-retro-cyan/10 px-3 py-2 text-xs font-mono text-retro-cyan"},KR={class:"grid grid-cols-2 lg:grid-cols-5 gap-2"},JR={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},eE={class:"text-sm font-mono text-retro-text"},tE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},rE={class:"text-sm font-mono text-retro-cyan"},nE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},sE={class:"text-sm font-mono text-retro-yellow"},iE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},oE={class:"text-sm font-mono text-retro-green"},aE={class:"rounded border border-retro-border bg-retro-panel px-3 py-2"},lE={class:"text-sm font-mono text-retro-text"},cE={class:"rounded border border-retro-border bg-retro-panel px-3 py-3"},uE={class:"flex items-center justify-between gap-2 mb-2"},hE={class:"text-[11px] font-mono text-retro-subtle"},dE={key:0,class:"text-xs font-mono text-retro-green"},fE={key:1,class:"space-y-2"},pE={class:"uppercase tracking-wide mr-2"},mE={class:"rounded border border-retro-border bg-retro-panel p-3 overflow-x-auto"},gE={class:"min-w-[760px]"},OE={class:"text-retro-text"},vE=["disabled","onClick"],bE=["disabled","onClick"],xE=["disabled","onClick"],yE={class:"text-retro-muted"},kE={key:1,class:"flex items-center justify-center py-12"},wE={key:2,class:"flex flex-col items-center justify-center py-12 text-center px-4"},SE={class:"text-sm font-mono text-retro-red"},$E={key:3,class:"flex flex-col items-center justify-center py-12 text-center"},CE={key:4,class:"h-full flex flex-col"},QE=["innerHTML"],PE=Be({__name:"SpecViewerModal",props:{feature:{}},emits:["close"],setup(r,{emit:e}){const t=r,n=e,s=wi(),{renderMarkdown:i}=Hl(),o=E(t.feature.files[0]?.filename||""),a=E("document"),l=E(""),c=E(!1),u=E(null),h=E(!1),f=E(""),m=E(!1),g=E(null),v=E(null),y=E(!1),k=E(null),$=E(null),T=N(()=>{const S={critical:0,major:1,minor:2};return[...$.value?.alerts??[]].sort((Q,G)=>S[Q.severity]-S[G.severity])});function A(S){return S.status==="covered"?"text-retro-green border-retro-green/40 bg-retro-green/10":S.status==="partial"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-red border-retro-red/40 bg-retro-red/10"}function Z(S){return S.severity==="critical"?"text-retro-red border-retro-red/40 bg-retro-red/10":S.severity==="major"?"text-retro-yellow border-retro-yellow/40 bg-retro-yellow/10":"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10"}async function Y(){y.value=!0,k.value=null;try{$.value=await $fetch(`/api/specs/traceability/${t.feature.id}`)}catch{k.value="Failed to load traceability data",$.value=null}finally{y.value=!1}}async function V(S=o.value){if(S){c.value=!0,u.value=null;try{const Q=`/api/specs/${t.feature.id}/${S}`,G=await $fetch(Q);l.value=G.content}catch{u.value="Failed to load file",l.value=""}finally{c.value=!1}}}function re(){V()}const me=N(()=>l.value?i(l.value):"");function J(S){v.value=null,a.value="document",h.value&&(h.value=!1),o.value=S,V()}function W(){h.value&&q(),a.value="traceability",!$.value&&!y.value&&Y()}async function z(S,Q,G){Q&&(o.value!==S?(o.value=S,await V(S)):l.value||await V(S),a.value="document",h.value=!0,f.value=l.value,g.value=null,v.value={filename:S,line:Q,requirementId:G},await tn(),g.value=Q)}function L(){f.value=l.value,g.value=null,h.value=!0}function q(){h.value=!1,f.value=""}async function w(){m.value=!0;try{const S=`/api/specs/${t.feature.id}/${o.value}`;await $fetch(S,{method:"PUT",body:{content:f.value}}),l.value=f.value,h.value=!1,s.success("Saved")}catch{s.error("Failed to save")}finally{m.value=!1}}function x(S){S.key==="Escape"&&(h.value?q():n("close"))}return zt(()=>{window.addEventListener("keydown",x),V(),Y()}),Ht(()=>{window.removeEventListener("keydown",x)}),(S,Q)=>{const G=ER;return O(),ge(hn,{to:"body"},[d("div",BR,[d("div",{class:"absolute inset-0 bg-black/80",onClick:Q[0]||(Q[0]=H=>n("close"))}),d("div",LR,[d("div",DR,[d("div",ZR,[d("span",IR,_(r.feature.name),1),d("span",XR,_(r.feature.id),1)]),d("div",zR,[p(h)?(O(),b(ye,{key:0},[d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-muted transition-colors",onClick:q}," Cancel "),d("button",{type:"button",class:"px-3 py-1 text-xs font-mono rounded border border-retro-cyan text-retro-cyan hover:bg-retro-cyan/10 transition-colors disabled:opacity-50",disabled:p(m),onClick:w},_(p(m)?"Saving...":"Save"),9,NR)],64)):p(a)==="document"&&p(l)&&!p(c)&&!p(u)?(O(),b("button",{key:1,type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-cyan hover:bg-retro-panel transition-colors",title:"Edit",onClick:L},[te(p(gh),{class:"h-4 w-4"})])):X("",!0),d("button",{type:"button",class:"p-1.5 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (ESC)",onClick:Q[1]||(Q[1]=H=>n("close"))},[te(p(ir),{class:"h-4 w-4"})])])]),d("div",VR,[d("button",{type:"button",class:Ce(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap flex items-center gap-1",[p(a)==="traceability"?"border-retro-magenta text-retro-magenta bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:W},[te(p(tb),{class:"h-3.5 w-3.5"}),Q[3]||(Q[3]=Le(" Traceability ",-1))],2),(O(!0),b(ye,null,Ne(r.feature.files,H=>(O(),b("button",{key:H.filename,type:"button",class:Ce(["px-4 py-2 text-xs font-mono border-b-2 transition-colors whitespace-nowrap",[p(a)==="document"&&p(o)===H.filename?"border-retro-cyan text-retro-cyan bg-retro-black":"border-transparent text-retro-muted hover:text-retro-text hover:bg-retro-panel"]]),onClick:fe=>J(H.filename)},_(H.label),11,WR))),128))]),d("div",jR,[p(a)==="traceability"?(O(),b("div",qR,[p(y)?(O(),b("div",YR,[...Q[4]||(Q[4]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading traceability...",-1)])])):p(k)?(O(),b("div",FR,[d("p",UR,_(p(k)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:Y}," Retry ")])):p($)?(O(),b("div",GR,[p(v)?(O(),b("div",HR," Jump target: "+_(p(v).requirementId)+" → "+_(p(v).filename)+":"+_(p(v).line),1)):X("",!0),d("div",KR,[d("div",JR,[Q[5]||(Q[5]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"FR total",-1)),d("p",eE,_(p($).summary.frTotal),1)]),d("div",tE,[Q[6]||(Q[6]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Plan coverage",-1)),d("p",rE,_(p($).summary.frWithPlan)+"/"+_(p($).summary.frTotal),1)]),d("div",nE,[Q[7]||(Q[7]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task mapping",-1)),d("p",sE,_(p($).summary.frWithTasks)+"/"+_(p($).summary.frTotal),1)]),d("div",iE,[Q[8]||(Q[8]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Fully covered",-1)),d("p",oE,_(p($).summary.frFullyCovered)+"/"+_(p($).summary.frTotal),1)]),d("div",aE,[Q[9]||(Q[9]=d("p",{class:"text-[11px] font-mono text-retro-subtle"},"Task progress",-1)),d("p",lE,_(p($).summary.taskCompleted)+"/"+_(p($).summary.taskTotal),1)])]),d("div",cE,[d("div",uE,[Q[10]||(Q[10]=d("h3",{class:"text-xs font-mono text-retro-text"},"Gap Alerts",-1)),d("span",hE,_(p(T).length)+" issues",1)]),p(T).length===0?(O(),b("div",dE," No traceability gaps detected. ")):(O(),b("div",fE,[(O(!0),b(ye,null,Ne(p(T),H=>(O(),b("div",{key:H.id,class:Ce(["rounded border px-2.5 py-2 text-xs font-mono",Z(H)])},[d("span",pE,_(H.severity),1),d("span",null,_(H.message),1)],2))),128))]))]),d("div",mE,[d("div",gE,[Q[11]||(Q[11]=d("div",{class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 text-[11px] font-mono text-retro-subtle px-2 pb-2 border-b border-retro-border"},[d("span",null,"Requirement"),d("span",null,"Spec"),d("span",null,"Plan"),d("span",null,"Tasks"),d("span",null,"Progress")],-1)),(O(!0),b(ye,null,Ne(p($).requirements,H=>(O(),b("div",{key:H.id,class:"grid grid-cols-[140px_1fr_1fr_1fr_120px] gap-2 items-center px-2 py-2 border-b border-retro-border/60 text-xs font-mono"},[d("span",OE,_(H.id),1),d("button",{type:"button",class:"h-6 rounded border border-retro-green/40 bg-retro-green/10 flex items-center px-2 text-retro-green disabled:opacity-50 disabled:cursor-not-allowed",disabled:!H.locations.specLine,onClick:fe=>z("spec.md",H.locations.specLine,H.id)},[d("span",null,_(H.locations.specLine?`L${H.locations.specLine}`:"Defined"),1)],8,vE),d("button",{type:"button",class:Ce(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",H.inPlan?"text-retro-cyan border-retro-cyan/40 bg-retro-cyan/10":"text-retro-subtle border-retro-border bg-retro-black/50"]),disabled:!H.locations.planLine,onClick:fe=>z("plan.md",H.locations.planLine,H.id)},[d("span",null,_(H.locations.planLine?`L${H.locations.planLine}`:H.inPlan?"Linked":"Missing"),1)],10,bE),d("button",{type:"button",class:Ce(["h-6 rounded border flex items-center px-2 disabled:opacity-50 disabled:cursor-not-allowed",A(H)]),disabled:H.locations.taskLines.length===0,onClick:fe=>z("tasks.md",H.locations.taskLines[0],H.id)},[d("span",null,_(H.locations.taskLines.length>0?`L${H.locations.taskLines[0]}`:H.inTasks?"Mapped":"Missing"),1)],10,xE),d("span",yE,_(H.taskCompleted)+"/"+_(H.taskTotal),1)]))),128))])])])):X("",!0)])):p(c)?(O(),b("div",kE,[...Q[12]||(Q[12]=[d("span",{class:"text-sm font-mono text-retro-muted animate-pulse"},"Loading...",-1)])])):p(u)?(O(),b("div",wE,[d("p",SE,_(p(u)),1),d("button",{type:"button",class:"mt-3 px-3 py-1.5 text-xs font-mono bg-retro-panel border border-retro-border rounded text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:re}," Retry ")])):r.feature.files.length===0?(O(),b("div",$E,[...Q[13]||(Q[13]=[d("p",{class:"text-sm font-mono text-retro-muted"},"No spec files found",-1),d("p",{class:"mt-1 text-xs font-mono text-retro-subtle"}," This feature directory has no .md files ",-1)])])):p(h)?(O(),b("div",CE,[te(G,{modelValue:p(f),"onUpdate:modelValue":Q[2]||(Q[2]=H=>ot(f)?f.value=H:null),"line-to-reveal":p(g),class:"flex-1"},null,8,["modelValue","line-to-reveal"])])):(O(),b("div",{key:5,class:"spec-markdown p-6 text-sm font-mono text-retro-text max-w-4xl mx-auto",innerHTML:p(me)},null,8,QE))])])])])}}}),TE={class:"w-full max-w-2xl rounded-xl border border-retro-border/80 bg-retro-black shadow-[0_24px_70px_rgba(0,0,0,0.55)] overflow-hidden"},ME={class:"flex items-center justify-between px-4 py-2 border-b border-retro-border/60 bg-retro-dark/70"},AE={class:"flex items-center gap-2 px-4 py-3 border-b border-retro-border/60"},_E={class:"flex items-center justify-between px-4 py-1.5 border-b border-retro-border/40 bg-retro-dark/30 text-[10px] font-mono text-retro-subtle"},RE={class:"flex items-center gap-3"},EE={class:"inline-flex items-center gap-1"},BE={key:0},LE={key:0,class:"truncate max-w-[42%]"},DE={class:"max-h-[58vh] overflow-y-auto"},ZE={key:0,class:"px-4 py-3 text-xs font-mono text-retro-subtle animate-pulse"},IE={key:1,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},XE={key:2,class:"px-4 py-4 text-xs font-mono text-retro-subtle"},zE={key:3,class:"px-4 py-3 text-xs font-mono text-retro-red"},NE={key:4,class:"py-2 px-2 space-y-2"},VE=["onMouseenter","onClick"],WE={class:"flex items-center justify-between gap-3 text-[10px] font-mono"},jE={class:"text-retro-cyan/90"},qE={class:"text-retro-subtle truncate"},YE=["innerHTML"],FE={key:5,class:"px-4 py-3 text-xs font-mono text-retro-subtle"},UE={class:"flex items-center justify-between gap-3 px-4 py-2 border-t border-retro-border/60 bg-retro-dark/50 text-[11px] font-mono text-retro-subtle"},GE={key:0,class:"text-retro-yellow"},HE={key:0,class:"px-4 pb-3 text-xs font-mono text-retro-red flex items-center gap-2"},KE=400,JE=Be({__name:"FeatureSearchModal",props:{availableFeatureIds:{}},emits:["close","select"],setup(r,{emit:e}){const t=r,n=e,{renderMarkdown:s}=Hl(),i=E(""),o=E(!1),a=E(!1),l=E(null),c=E(null),u=E(null),h=E(null),f=E([]),m=E(-1),g=E(null),v=E([]);let y=null,k=0;const $=N(()=>i.value.trim()),T=N(()=>{const w=$.value.toLowerCase().split(/\s+/).map(x=>x.trim()).filter(x=>x.length>=2);return Array.from(new Set(w)).slice(0,8)}),A=N(()=>l.value||c.value?"error":!$.value&&a.value?"empty-query":f.value.length>0?"results":a.value&&!o.value?"no-results":"idle");function Z(w){return{featureId:w.chunk.featureId,sourcePath:w.chunk.sourcePath,headingHierarchy:w.chunk.headingHierarchy,snippet:w.chunk.content,matchType:w.matchType,score:w.score,lineStart:w.chunk.lineStart,lineEnd:w.chunk.lineEnd}}async function Y(){const w=$.value;if(c.value=null,!w){a.value=!0,u.value=null,h.value=null,l.value=null,f.value=[],m.value=-1;return}const x=++k;a.value=!0,l.value=null,o.value=!0;try{const S=await $fetch("/api/specs/search",{query:{q:w,mode:"keyword",limit:20}});if(x!==k)return;u.value=S.warning??null,h.value=S.searchTime,f.value=S.results.map(Z),m.value=f.value.length>0?0:-1}catch(S){if(x!==k)return;const Q=S instanceof Error?S.message:"Failed to search specs";l.value=Q,h.value=null,f.value=[],m.value=-1}finally{x===k&&(o.value=!1)}}ze(i,()=>{l.value=null,c.value=null,y&&clearTimeout(y),y=setTimeout(()=>{Y()},KE)}),ze(f,()=>{v.value=[]}),ze(m,async w=>{w<0||(await tn(),v.value[w]?.scrollIntoView({block:"nearest"}))});function V(){n("close")}function re(w){const x=f.value[w];if(x){if(!t.availableFeatureIds.includes(x.featureId)){c.value="Feature unavailable";return}n("select",x.featureId),n("close")}}function me(w){if(f.value.length===0)return;if(m.value<0){m.value=0;return}const x=m.value+w;if(x<0){m.value=f.value.length-1;return}if(x>=f.value.length){m.value=0;return}m.value=x}function J(w){if(w.key==="ArrowDown"){w.preventDefault(),me(1);return}if(w.key==="ArrowUp"){w.preventDefault(),me(-1);return}if(w.key==="Enter"){w.preventDefault(),m.value>=0&&re(m.value);return}w.key==="Escape"&&(w.preventDefault(),V())}function W(w){w.target===w.currentTarget&&V()}function z(w,x){if(!x){v.value[w]=null;return}if(x instanceof HTMLElement){v.value[w]=x;return}const S=x.$el;v.value[w]=S instanceof HTMLElement?S:null}function L(){Y()}function q(w){const x=w.trim();if(!x)return"";const S=x.length>700?`${x.slice(0,700)}...`:x,Q=s(S);if(T.value.length===0)return Q;const G=T.value.map(fe=>fe.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")),H=new RegExp(`(${G.join("|")})`,"gi");return Q.split(/(<[^>]+>)/g).map(fe=>fe.startsWith("<")?fe:fe.replace(H,"<mark>$1</mark>")).join("")}return zt(()=>{tn(()=>{g.value?.focus()})}),Ht(()=>{y&&clearTimeout(y)}),(w,x)=>(O(),ge(hn,{to:"body"},[te(Un,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0","enter-to-class":"opacity-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100","leave-to-class":"opacity-0"},{default:kt(()=>[d("div",{class:"fixed inset-0 z-50 flex items-start justify-center pt-16 px-4 bg-black/75 backdrop-blur-[1px]",onClick:W},[te(Un,{appear:"","enter-active-class":"transition duration-150 ease-out","enter-from-class":"opacity-0 translate-y-2 scale-[0.99]","enter-to-class":"opacity-100 translate-y-0 scale-100","leave-active-class":"transition duration-120 ease-in","leave-from-class":"opacity-100 translate-y-0 scale-100","leave-to-class":"opacity-0 translate-y-1 scale-[0.995]"},{default:kt(()=>[d("div",TE,[d("div",ME,[x[1]||(x[1]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"inline-flex items-center rounded px-2 py-0.5 text-[10px] font-mono border border-retro-cyan/50 text-retro-cyan bg-retro-cyan/10"}," Command Palette "),d("span",{class:"text-[10px] font-mono text-retro-subtle"},"Global spec search")],-1)),d("button",{type:"button",class:"p-1 rounded text-retro-muted hover:text-retro-text hover:bg-retro-panel transition-colors",title:"Close (Escape)",onClick:V},[te(p(ir),{class:"h-4 w-4"})])]),d("div",AE,[te(p(Ls),{class:"h-4 w-4 text-retro-cyan"}),Ue(d("input",{ref_key:"inputRef",ref:g,"onUpdate:modelValue":x[0]||(x[0]=S=>ot(i)?i.value=S:null),type:"text",placeholder:"Search specs across all features...",class:"flex-1 bg-transparent text-sm font-mono text-retro-text placeholder:text-retro-subtle focus:outline-none",onKeydown:J},null,544),[[hr,p(i)]]),x[2]||(x[2]=d("span",{class:"text-[10px] font-mono text-retro-subtle border border-retro-border/60 rounded px-1.5 py-0.5"},"400ms",-1))]),d("div",_E,[d("div",RE,[d("span",EE,[te(p(ci),{class:"h-3.5 w-3.5"}),Le(" "+_(p(f).length)+" results ",1)]),p(h)!==null?(O(),b("span",BE,_(p(h))+"ms",1)):X("",!0)]),p($)?(O(),b("span",LE,"“"+_(p($))+"”",1)):X("",!0)]),d("div",DE,[p(o)?(O(),b("div",ZE," Searching... ")):p(A)==="empty-query"?(O(),b("div",IE," Enter a search term to search across all feature specs. ")):p(A)==="no-results"?(O(),b("div",XE," No matching features found. ")):p(A)==="error"?(O(),b("div",zE,[d("p",null,_(p(c)||p(l)),1),p(l)?(O(),b("button",{key:0,type:"button",class:"mt-2 px-2 py-1 rounded border border-retro-border text-retro-muted hover:text-retro-cyan hover:border-retro-cyan transition-colors",onClick:L}," Retry ")):X("",!0)])):p(f).length>0?(O(),b("ul",NE,[(O(!0),b(ye,null,Ne(p(f),(S,Q)=>(O(),b("li",{key:`${S.featureId}:${S.sourcePath}:${Q}`},[d("button",{type:"button",ref_for:!0,ref:G=>z(Q,G),class:Ce(["w-full text-left px-4 py-3 min-h-[132px] rounded-lg border border-retro-border/40 border-l-2 transition-colors",Q===p(m)?"border-retro-cyan bg-retro-panel/95 text-retro-text shadow-[0_0_0_1px_rgba(34,211,238,0.18)]":"text-retro-muted hover:text-retro-text hover:bg-retro-panel/90"]),onMouseenter:G=>m.value=Q,onClick:G=>re(Q)},[d("div",WE,[d("span",jE,_(S.featureId),1),d("span",qE,_(S.sourcePath)+":"+_(S.lineStart)+"-"+_(S.lineEnd),1)]),d("div",{class:"snippet-markdown mt-2 max-h-20 overflow-hidden text-xs text-retro-text",innerHTML:q(S.snippet)},null,8,YE),x[3]||(x[3]=d("div",{class:"mt-2 text-[10px] font-mono text-retro-subtle"}," Select feature ",-1))],42,VE)]))),128))])):(O(),b("div",FE," Start typing to search. "))]),d("div",UE,[x[4]||(x[4]=d("div",{class:"flex items-center gap-2"},[d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"↑↓ move"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Enter select"),d("span",{class:"border border-retro-border/70 rounded px-1.5 py-0.5"},"Esc close")],-1)),p(u)?(O(),b("span",GE,_(p(u)),1)):X("",!0)]),p(c)?(O(),b("div",HE,[te(p(fs),{class:"h-3.5 w-3.5"}),d("span",null,_(p(c)),1)])):X("",!0)])]),_:1})])]),_:1})]))}}),e7=ki(JE,[["__scopeId","data-v-5199b408"]]);function t7(r){return/^\/speckit\.(clarify|plan|tasks|implement)(\s|$)/.test(r)}function r7(r=Date.now,e=Math.random){return`req-${r()}-${e().toString(36).slice(2,8)}`}function Bm(r=Date.now){return`session-${r()}`}function Wa(r,e=!1){const t={};return(!e||r?.hasWorktree)&&r?.worktreePath&&(t.cwd=r.worktreePath,t.worktreeBranch=r.worktreeBranch),r?.featureId&&(t.featureId=r.featureId),Object.keys(t).length>0?t:void 0}function n7(r){if(r.file_path)return String(r.file_path);if(r.path)return String(r.path);if(r.command)return String(r.command).slice(0,50);if(r.pattern)return String(r.pattern);for(const e of Object.values(r))if(typeof e=="string"&&e.length<100)return e;return""}function Lm(r,e="Permission"){const t=r||"",n=t.match(/write to (.+?)(?:[\s,?]|$)/i),s=t.match(/read (.+?)(?:[\s,?]|$)/i),i=t.match(/run (.+?)(?:[?,]|$)/i);return n?.[1]?{tool:"Write",description:t,filePath:n[1].trim()}:s?.[1]?{tool:"Read",description:t,filePath:s[1].trim()}:i?.[1]?{tool:"Bash",description:t,command:i[1].trim()}:{tool:e,description:t}}const Dt=new Map,ls=new Map,Pa=new Set,s7=3e4,Tv=18e4,i7=Math.round(Tv/1e3);function o7(r){switch(r){case 1e3:return"Normal closure";case 1001:return"Endpoint is going away (server shutdown or page navigation)";case 1002:return"Protocol error";case 1003:return"Unsupported data";case 1005:return"No status code received from peer (close frame had no code)";case 1006:return"Abnormal closure (connection dropped without close frame)";case 1007:return"Invalid payload data";case 1008:return"Policy violation";case 1009:return"Message too big";case 1010:return"Missing required extension";case 1011:return"Internal server error";case 1012:return"Service restart";case 1013:return"Try again later (temporary overload)";case 1015:return"TLS handshake failure";default:return r>=4e3&&r<=4999?"Application-specific close code":"Unknown close code"}}function a7(r,e){const t=[];return r.reason?t.push(r.reason):t.push(o7(r.code)),e?.lastServerError?t.push(`Last server error: ${e.lastServerError}`):e?.lastSocketError&&t.push(`Last socket error: ${e.lastSocketError}`),t.push(`wasClean: ${r.wasClean?"yes":"no"}`),t.join(" | ")}function Md(){const r=pn(),e=Ro();function t(){return typeof document>"u"||typeof document.hasFocus!="function"?!1:document.visibilityState==="visible"&&document.hasFocus()}function n(w){const S=r.conversations.find(Q=>Q.id===w)?.title?.trim()||"Chat";return new Notification("Spec Cat",{body:`${S} response completed.`,tag:`chat-complete-${w}`})}async function s(w){if(!(typeof window>"u"||typeof Notification>"u")&&!t()){if(Notification.permission==="granted"){n(w);return}if(Notification.permission==="default")try{await Notification.requestPermission()==="granted"&&n(w)}catch(x){console.warn("[useChatStream] Failed to request browser notification permission:",x)}}}function i(){return typeof window>"u"?"":`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/_ws`}function o(w){w.healthCheckInterval&&(clearInterval(w.healthCheckInterval),w.healthCheckInterval=null)}function a(w){o(w),w.lastMessageTime=Date.now(),w.healthCheckInterval=Th(()=>{const x=w.conversationId;if(w.ws.readyState!==WebSocket.OPEN){console.warn(`[useChatStream] Health check: WebSocket not open for ${x}`),o(w),r.isConversationStreaming(x)&&(h(w.currentMessageId,x,"error"),r.updateMessage(w.currentMessageId,{status:"error"},x),r.setSessionError("Connection lost during streaming",x),r.endSession(x),r.endConversationStreaming(x)),Dt.delete(x);return}if(r.isConversationStreaming(x)){const S=Date.now()-w.lastMessageTime;S>Tv&&(console.warn(`[useChatStream] Health check: streaming timeout for ${x} (${Math.round(S/1e3)}s)`),o(w),h(w.currentMessageId,x,"error"),r.updateMessage(w.currentMessageId,{status:"error"},x),r.setSessionError(`Streaming timed out — no response from server for ${i7} seconds`,x),r.endSession(x),r.endConversationStreaming(x),w.ws.close(),Dt.delete(x))}},s7)}function l(w,x){return r.conversations.find(Q=>Q.id===w)?.messages.find(Q=>Q.id===x)?.status}function c(w,x=!0){const S=Dt.get(w);S&&(o(S),x&&S.ws.readyState===WebSocket.OPEN&&S.ws.close(),Dt.delete(w))}function u(w,x,S){!S||!w.currentTextBlockId||(r.updateBlockWithSave(w.currentMessageId,w.currentTextBlockId,Q=>{Q.type==="text"&&(Q.text+=S)},x,{syncContent:!1}),r.appendToMessage(w.currentMessageId,S,x))}function h(w,x,S){const G=r.conversations.find(H=>H.id===x)?.messages.find(H=>H.id===w);if(G?.contentBlocks)for(const H of G.contentBlocks)H.type==="tool_use"&&(H.status==="running"||H.status==="pending")&&r.updateBlockById(w,H.id,fe=>{fe.type==="tool_use"&&(fe.status=S)},x)}async function f(w){try{(await m(w)).send(JSON.stringify({type:"reset_context"})),r.clearProviderSession(w),console.log("[useChatStream] Context reset requested for conversation:",w)}catch(x){throw console.error("[useChatStream] Failed to reset context:",x),x}}function m(w){return new Promise((x,S)=>{let Q=!1;const G=ae=>{Q||(Q=!0,x(ae))},H=ae=>{Q||(Q=!0,S(ae))},fe=Dt.get(w);if(fe&&fe.ws.readyState===WebSocket.OPEN){G(fe.ws);return}fe&&(fe.ws.close(),Dt.delete(w));const ce=i(),K=new WebSocket(ce),oe={ws:K,currentMessageId:"",conversationId:w,activeTools:new Map,currentTextBlockId:null,currentThinkingBlockId:null,healthCheckInterval:null,lastMessageTime:Date.now(),lastServerError:null,lastSocketError:null};Dt.set(w,oe),K.onopen=()=>{G(K)},K.onerror=ae=>{console.error(`[useChatStream] WebSocket error for conversation ${w}:`,ae);const ee=Dt.get(w);ee&&ee.ws!==K||(ee&&(ee.lastSocketError="Browser reported a WebSocket transport error (network/proxy/server)"),r.isConversationStreaming(w)&&(ee?.currentMessageId&&(h(ee.currentMessageId,w,"error"),r.updateMessage(ee.currentMessageId,{status:"error"},w)),r.setSessionError("Connection error during streaming",w),r.endSession(w),r.endConversationStreaming(w)),Dt.delete(w),H(new Error("WebSocket connection failed. Server may be unavailable.")))},K.onclose=ae=>{const ee=Dt.get(w);if(!(ee&&ee.ws!==K)){if(ee&&o(ee),Dt.delete(w),ls.delete(w),!Q){H(new Error(`WebSocket closed before connection was established (code: ${ae.code})`));return}if(r.isConversationStreaming(w)){ee?.currentMessageId&&(h(ee.currentMessageId,w,"error"),r.updateMessage(ee.currentMessageId,{status:"error"},w));const ue=a7(ae,ee);r.setSessionError(`Connection closed: ${ue} (code: ${ae.code})`,w),r.endSession(w),r.endConversationStreaming(w)}}},K.onmessage=ae=>{const ee=Dt.get(w);ee&&ee.ws!==K||k(ae.data,w)}})}async function g(w,x=3){for(let S=0;S<x;S++){const Q=r.conversations.find(G=>G.id===w);if(Q)return Q;S<x-1&&await new Promise(G=>setTimeout(G,100))}console.error("[useChatStream] Conversation not found after retries:",w)}function v(w,x){return`${w}:${x}`}function y(w,x){const S=r.conversations.find(G=>G.id===w);if(!S)return null;const Q=S.messages.findIndex(G=>G.id===x);if(Q<=0)return null;for(let G=Q-1;G>=0;G--){const H=S.messages[G];if(H.role==="user"&&H.content.trim().length>0)return H.content}return null}async function k(w,x){const S=Dt.get(x);if(S){S.lastMessageTime=Date.now();try{r.pushDebugEvent({direction:"in",channel:"ws",eventType:"ws.raw",payload:w},x);const Q=JSON.parse(w);if(r.pushDebugEvent({direction:"in",channel:"ws",eventType:Q.type,payload:Q},x),Q.type==="error"){console.error(`[useChatStream] Server error for ${x}:`,Q.error);const G=Q.error||"Unknown server error";S.lastServerError=G;const H=/codex cannot access session files|failed to clean up stale arg0 temp dirs: Permission denied|failed to initialize rollout recorder: Permission denied|failed to create session: Permission denied|\/\.codex\/.*permission denied/i.test(G);if(/state db missing rollout path for thread/i.test(G)&&!H){const ce=v(x,S.currentMessageId);if(!Pa.has(ce)){const K=y(x,S.currentMessageId);if(K){Pa.add(ce),r.setProviderSessionId("",x),A(S.currentMessageId,`
96
96
 
97
97
  > **Session Reset**: Codex resume state was corrupted. Retrying once with a fresh session...
98
98
 
@@ -127,12 +127,12 @@ Please report this to https://github.com/markedjs/marked.`,r){const n="<p>An err
127
127
  `)),G=N(()=>n.value?Q.value:Q.value.slice(0,6)),H=N(()=>!w.value||!/^diff --git\s|\+\+\+\s|---\s|@@\s/m.test(w.value)?!1:/^[+\- ]/.test(Q.value.find(ue=>ue.length>0)||"")||Q.value.some(ue=>ue.startsWith("@@"))),fe=N(()=>{if(!H.value)return{added:0,removed:0};let ee=0,ue=0;for(const pe of Q.value)pe.startsWith("+++")||pe.startsWith("---")||(pe.startsWith("+")&&(ee+=1),pe.startsWith("-")&&(ue+=1));return{added:ee,removed:ue}}),ce=N(()=>w.value?w.value.split(`
128
128
  `).slice(0,3).join(`
129
129
  `):""),K=N(()=>w.value?Q.value.length>6||w.value.length>320:!1),oe=N(()=>w.value.trim().length>0);function ae(ee){return ee.startsWith("@@")?"text-retro-cyan bg-retro-cyan/10":ee.startsWith("+")&&!ee.startsWith("+++")?"text-retro-green bg-retro-green/10":ee.startsWith("-")&&!ee.startsWith("---")?"text-retro-red bg-retro-red/10":ee.startsWith("diff --git")||ee.startsWith("index ")||ee.startsWith("---")||ee.startsWith("+++")?"text-retro-yellow":"text-retro-muted"}return ze(()=>e.block.id,()=>{t.value=g.value,n.value=!1},{immediate:!0}),ze(()=>e.block.status,ee=>{(ee==="running"||ee==="error")&&(t.value=!0)}),(ee,ue)=>(O(),b("div",MB,[d("button",{class:"flex items-center gap-2 w-full px-3 py-2 text-xs font-mono hover:bg-retro-dark/40 transition-colors text-left",onClick:ue[0]||(ue[0]=pe=>t.value=!p(t))},[r.block.status==="running"?(O(),b("span",AB)):r.block.status==="pending"?(O(),ge(p(Km),{key:1,class:"w-3.5 h-3.5 flex-shrink-0 text-retro-muted animate-pulse"})):r.block.status==="complete"?(O(),ge(p(Ml),{key:2,class:Ce(["w-3.5 h-3.5 flex-shrink-0",p(q)])},null,8,["class"])):(O(),ge(p(Si),{key:3,class:Ce(["w-3.5 h-3.5 flex-shrink-0",p(q)])},null,8,["class"])),d("span",_B,_(p(z)),1),d("span",RB,_(r.block.name),1),d("span",EB,_(p(W)||r.block.inputSummary),1),te(p(fh),{class:Ce(["w-3 h-3 ml-auto transition-transform text-retro-muted flex-shrink-0",{"rotate-90":p(t)}])},null,8,["class"])]),p(t)?(O(),b("div",BB,[p(L).length>0?(O(),b("div",LB,[ue[5]||(ue[5]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Args",-1)),d("pre",DB,_(p(L).join(`
130
- `)),1)])):X("",!0),d("div",ZB,[p($)?(O(),b("div",IB,[ue[6]||(ue[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",XB,_(p($)),1)])):X("",!0),p(m)&&p(V)?(O(),b("div",zB,[ue[7]||(ue[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",NB,_(p(V)),1)])):X("",!0),p(u)&&p(T)?(O(),b("div",VB,[ue[8]||(ue[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,_(p(T)),1)])):X("",!0)]),p(h)&&p(re).text?(O(),b("div",WB,[ue[9]||(ue[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",jB,_(p(re).text),1),p(re).truncated?(O(),b("div",qB,"Truncated preview")):X("",!0)])):X("",!0),p(f)&&p(me).text?(O(),b("div",YB,[ue[10]||(ue[10]=d("div",{class:"text-[11px] font-mono text-retro-yellow mb-1"},"Before",-1)),d("pre",FB,_(p(me).text),1),p(me).truncated?(O(),b("div",UB,"Truncated preview")):X("",!0)])):X("",!0),p(f)&&p(J).text?(O(),b("div",GB,[ue[11]||(ue[11]=d("div",{class:"text-[11px] font-mono text-retro-green mb-1"},"After",-1)),d("pre",HB,_(p(J).text),1),p(J).truncated?(O(),b("div",KB,"Truncated preview")):X("",!0)])):X("",!0),d("details",JB,[ue[12]||(ue[12]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",eL,_(JSON.stringify(r.block.input,null,2)),1)]),p(c)&&p(v).length>0?(O(),b("div",tL,[ue[13]||(ue[13]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",rL,[(O(!0),b(ye,null,Ne(p(v),(pe,Xe)=>(O(),b("div",{key:`${pe.id||"q"}-${Xe}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[pe.header?(O(),b("div",nL,_(pe.header),1)):X("",!0),pe.question||pe.prompt||pe.message?(O(),b("div",sL,_(pe.question||pe.prompt||pe.message),1)):X("",!0),Array.isArray(pe.options)&&pe.options.length>0?(O(),b("div",iL,[(O(!0),b(ye,null,Ne(pe.options,(nt,$t)=>(O(),b("div",{key:`${pe.id||"q"}-opt-${$t}`,class:"text-xs font-mono text-retro-muted"},[Le(_(nt.label||`Option ${$t+1}`)+" ",1),nt.description?(O(),b("span",oL," - "+_(nt.description),1)):X("",!0)]))),128))])):X("",!0)]))),128))])])):X("",!0)])):X("",!0),p(oe)?(O(),b("div",aL,[d("div",{class:Ce(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",p(x)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:xr(p(n)?"max-height: 20rem":"")},[p(H)?(O(),b(ye,{key:0},[d("div",lL,[ue[14]||(ue[14]=Le(" Diff · ",-1)),d("span",cL,"+"+_(p(fe).added),1),ue[15]||(ue[15]=Le(" / ",-1)),d("span",uL,"-"+_(p(fe).removed),1)]),d("div",hL,[(O(!0),b(ye,null,Ne(p(G),(pe,Xe)=>(O(),b("div",{key:`diff-${Xe}`,class:Ce(["px-1 rounded whitespace-pre-wrap break-all",ae(pe)])},_(pe||" "),3))),128))]),!p(n)&&p(K)?(O(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[1]||(ue[1]=Gt(pe=>n.value=!0,["stop"]))}," Show full diff ("+_(p(S))+" chars) ",1)):p(K)?(O(),b("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[2]||(ue[2]=Gt(pe=>n.value=!1,["stop"]))}," Collapse diff ")):X("",!0)],64)):!p(n)&&p(K)?(O(),b(ye,{key:1},[d("pre",dL,_(p(ce)),1),d("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[3]||(ue[3]=Gt(pe=>n.value=!0,["stop"]))}," Show full ("+_(p(S))+" chars) ",1)],64)):(O(),b(ye,{key:2},[d("pre",fL,_(p(w)),1),p(K)?(O(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[4]||(ue[4]=Gt(pe=>n.value=!1,["stop"]))}," Collapse ")):X("",!0)],64))],6)])):X("",!0)]))}}),mL={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},gL={class:"flex items-center gap-1"},OL={class:"flex items-center gap-1"},vL=Be({__name:"ChatResultSummary",props:{block:{}},setup(r){const e=r,t=N(()=>{const i=Math.round(e.block.durationMs/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}),n=N(()=>`$${e.block.totalCostUsd.toFixed(4)}`),s=N(()=>{const{inputTokens:i,outputTokens:o}=e.block.usage;return`${i.toLocaleString()} in / ${o.toLocaleString()} out`});return(i,o)=>(O(),b("div",mL,[d("span",gL,[o[0]||(o[0]=d("span",{class:"text-retro-muted/60"},"time",-1)),Le(" "+_(p(t)),1)]),d("span",OL,[o[1]||(o[1]=d("span",{class:"text-retro-muted/60"},"cost",-1)),Le(" "+_(p(n)),1)]),d("span",null,_(p(s)),1),d("span",null,_(r.block.numTurns)+" turn"+_(r.block.numTurns!==1?"s":""),1)]))}}),bL={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},xL={class:"text-retro-cyan"},yL={key:0,class:"text-retro-border"},kL={key:1},wL=Be({__name:"ChatSessionInit",props:{block:{}},setup(r){return(e,t)=>(O(),b("div",bL,[d("span",xL,_(r.block.model),1),t[0]||(t[0]=d("span",{class:"text-retro-border"},"|",-1)),d("span",null,_(r.block.tools.length)+" tools",1),r.block.permissionMode?(O(),b("span",yL,"|")):X("",!0),r.block.permissionMode?(O(),b("span",kL,_(r.block.permissionMode),1)):X("",!0)]))}}),SL=Be({__name:"ChatContentBlock",props:{block:{},toolResultsByUseId:{}},setup(r){const e=r,t=N(()=>{if(e.block.type==="tool_use")return e.toolResultsByUseId.get(e.block.toolUseId)});return(n,s)=>{const i=SB,o=TB,a=pL,l=vL,c=wL;return r.block.type==="text"?(O(),ge(i,{key:0,block:r.block},null,8,["block"])):r.block.type==="thinking"?(O(),ge(o,{key:1,block:r.block},null,8,["block"])):r.block.type==="tool_use"?(O(),ge(a,{key:2,block:r.block,result:p(t)},null,8,["block","result"])):r.block.type==="result_summary"?(O(),ge(l,{key:3,block:r.block},null,8,["block"])):r.block.type==="session_init"?(O(),ge(c,{key:4,block:r.block},null,8,["block"])):X("",!0)}}}),$L={class:"flex-1 min-w-0"},CL={class:"flex items-center gap-2 mb-1"},QL={class:"text-xs font-mono text-retro-muted"},PL={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},TL={key:1,class:"text-xs font-mono text-retro-muted"},ML={key:2,class:"text-xs font-mono text-retro-red"},AL={key:1,class:"mb-2 flex flex-wrap gap-2"},_L=["href","download"],RL=["src","alt"],EL={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},BL=["innerHTML"],LL={key:3,class:"text-xs font-mono text-retro-muted italic"},DL={key:4,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},ZL=Be({__name:"ChatMessage",props:{message:{}},setup(r){const e=r,{renderMarkdown:t}=Hl(),n=N(()=>e.message.role==="user"),s=N(()=>e.message.status==="streaming"),i=N(()=>e.message.status==="error"),o=N(()=>e.message.status==="stopped"),a=N(()=>qv(e.message)),l=N(()=>{const v=new Map;for(const y of e.message.contentBlocks??[])y.type==="tool_result"&&v.set(y.toolUseId,y);return v}),c=N(()=>{if(!e.message.contentBlocks)return[];const v=e.message.contentBlocks.filter(k=>k.type!=="tool_result"),y=[];for(const k of v){const $=y.length>0?y[y.length-1]:null;if($?.type==="text"&&k.type==="text"){const T=$.text||"",A=k.text||"";$.text=`${T}${A}`;continue}if($?.type==="thinking"&&k.type==="thinking"){const T=$.thinking||"",A=k.thinking||"";$.thinking=`${T}${A}`;continue}y.push({...k})}return y}),u=N(()=>a.value&&c.value.length>0),h=N(()=>e.message.content.trim().length>0),f=N(()=>e.message.attachments??[]),m=v=>new Date(v).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),g=N(()=>t(e.message.content));return(v,y)=>{const k=SL;return O(),b("div",{class:Ce(["flex gap-3 p-3",[p(n)?"bg-retro-dark/50":"bg-transparent",p(i)?"border-l-2 border-retro-red":""]])},[d("div",{class:Ce(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",p(n)?"bg-retro-cyan/20":"bg-retro-green/20"])},[p(n)?(O(),ge(p(tu),{key:0,class:"w-4 h-4 text-retro-cyan"})):(O(),ge(p(tg),{key:1,class:"w-4 h-4 text-retro-green"}))],2),d("div",$L,[d("div",CL,[d("span",{class:Ce(["text-xs font-mono",p(n)?"text-retro-cyan":"text-retro-green"])},_(p(n)?"You":"Assistant"),3),d("span",QL,_(m(r.message.timestamp)),1),p(s)?(O(),b("span",PL," typing... ")):X("",!0),p(o)?(O(),b("span",TL," (stopped) ")):X("",!0),p(i)?(O(),b("span",ML," (error) ")):X("",!0)]),p(u)?(O(!0),b(ye,{key:0},Ne(p(c),$=>(O(),ge(k,{key:$.id,block:$,"tool-results-by-use-id":p(l)},null,8,["block","tool-results-by-use-id"]))),128)):X("",!0),p(n)&&p(f).length>0?(O(),b("div",AL,[(O(!0),b(ye,null,Ne(p(f),$=>(O(),b("a",{key:$.id,href:$.dataUrl,download:$.name,target:"_blank",rel:"noopener noreferrer",class:"w-28 rounded border border-retro-border/70 bg-retro-black/70 p-1 hover:border-retro-cyan/60"},[d("img",{src:$.dataUrl,alt:$.name,class:"h-20 w-full rounded object-cover"},null,8,RL),d("div",EL,_($.name),1)],8,_L))),128))])):X("",!0),!p(u)&&p(h)?(O(),b("div",{key:2,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:p(g)},null,8,BL)):X("",!0),!p(u)&&!p(h)&&!p(n)&&!p(s)?(O(),b("div",LL," (no visible response content) ")):X("",!0),p(s)?(O(),b("span",DL)):X("",!0)])],2)}}}),IL={key:0,class:"flex flex-col items-center justify-center h-full p-8 text-center"},XL={key:1,class:"relative"},zL={class:"sticky bottom-0"},NL={key:0,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50 backdrop-blur-sm"},VL={key:1,class:"px-4 py-2.5 bg-retro-red/20 border-t border-retro-red/50"},WL={class:"flex items-start gap-2"},jL={class:"flex-1 min-w-0"},qL={class:"flex items-center justify-between gap-2 mb-0.5"},YL={class:"text-xs font-mono text-retro-red/80 break-words whitespace-pre-wrap"},FL={key:2,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50"},UL=Be({__name:"ChatMessages",setup(r){const e=pn(),{containerRef:t,onScroll:n,maybeScrollToBottom:s,scrollToBottom:i,forceScrollToBottom:o}=xB(),{visibleItems:a,totalHeight:l,onVirtualScroll:c,setItemRef:u}=kB({allMessages:N(()=>e.messages),containerRef:t});function h(){n(),c()}const f=N(()=>e.isActiveConversationStreaming),m=N(()=>{const $=e.lastMessage;return!$||$.role!=="assistant"?null:$.status}),g=E(!1);function v($){const T=$.contentBlocks;return!T||T.length===0?"":T.map(A=>{switch(A.type){case"tool_use":return`u:${A.id}:${A.status}:${A.inputSummary}`;case"tool_result":return`r:${A.id}:${A.toolUseId}:${A.isError?1:0}:${A.content.length}`;case"text":return`t:${A.id}:${A.text.length}`;case"thinking":return`k:${A.id}:${A.thinking.length}`;case"result_summary":return`s:${A.id}:${A.numTurns}:${A.durationMs}`;case"session_init":return`i:${A.id}:${A.model}:${A.tools.length}`;default:return""}}).join("|")}const y=E(null);function k(){if(y.value&&(y.value(),y.value=null),!t.value||typeof ResizeObserver>"u")return;const $=new ResizeObserver(()=>{s("instant")});$.observe(t.value),y.value=()=>{$.disconnect()}}return zt(()=>{i("instant"),k()}),Ht(()=>{y.value&&y.value()}),ze(()=>e.activeConversationId,()=>{g.value=!1,i("instant")}),ze(t,()=>{k()}),ze(()=>[e.activeConversationId,e.messages.length],([$,T])=>{!$||T===0||g.value||(g.value=!0,o("instant"))},{immediate:!0}),ze(()=>e.messages.length,()=>{s("instant")}),ze(()=>e.lastMessage?.content,()=>{s("instant")}),ze([f,()=>e.lastError],()=>{s("instant")}),ze(l,()=>{s("instant")}),($,T)=>(O(),b("div",{ref_key:"containerRef",ref:t,class:"flex-1 overflow-y-auto",onScroll:h},[p(e).hasMessages?(O(),b("div",XL,[d("div",{class:"relative",style:xr({height:`${p(l)}px`})},[(O(!0),b(ye,null,Ne(p(a),A=>(O(),b("div",{key:A.message.id,class:"absolute left-0 right-0 border-b border-retro-border/30",style:xr({transform:`translateY(${A.top}px)`})},[d("div",{ref_for:!0,ref:Z=>p(u)(A.message.id,Z)},[Xm([A.message.id,A.message.status,A.message.content,A.message.contentBlocks?.length||0,v(A.message),A.message.tools?.length||0],()=>te(ZL,{message:A.message},null,8,["message"]),T,0)],512)],4))),128))],4)])):(O(),b("div",IL,[...T[2]||(T[2]=[d("div",{class:"text-retro-muted text-sm font-mono mb-2"}," No messages yet ",-1),d("div",{class:"text-retro-muted text-xs font-mono"}," Send a message to start chatting ",-1)])])),d("div",zL,[p(f)&&!p(e).lastError?(O(),b("div",NL,[...T[3]||(T[3]=[Nm('<div class="flex items-center gap-2"><div class="flex gap-1"><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:0ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:150ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:300ms;"></span></div><span class="text-xs font-mono text-retro-muted">Processing...</span></div>',1)])])):X("",!0),p(e).lastError?(O(),b("div",VL,[d("div",WL,[te(p(Si),{class:"w-4 h-4 text-retro-red flex-shrink-0 mt-0.5"}),d("div",jL,[d("div",qL,[T[4]||(T[4]=d("p",{class:"text-xs font-mono font-semibold text-retro-red"},"Error",-1)),d("button",{class:"text-xs font-mono text-retro-red/60 hover:text-retro-red underline",onClick:T[1]||(T[1]=A=>p(e).clearError())}," Dismiss ")]),d("p",YL,_(p(e).lastError),1),T[5]||(T[5]=d("p",{class:"text-xs font-mono text-retro-muted mt-1"}," Check browser console (F12) for more details ",-1))])])])):p(m)==="stopped"?(O(),b("div",FL,[...T[6]||(T[6]=[d("div",{class:"flex items-center gap-2"},[d("span",{class:"w-2 h-2 rounded-full bg-retro-muted"}),d("span",{class:"text-xs font-mono text-retro-muted"},"Stopped")],-1)])])):X("",!0)])],544))}});function GL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z","clip-rule":"evenodd"})])}function Dm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z","clip-rule":"evenodd"})])}function HL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function KL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd"})])}const JL={class:"flex-shrink-0 flex-grow-0 border-t border-retro-border bg-retro-dark p-3"},e8={class:"flex items-center gap-2 mb-2"},t8={class:"relative min-w-0 flex-1 max-w-[154px] model-selector"},r8=["disabled"],n8={class:"truncate text-left"},s8={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[220px] max-w-[280px]"},i8={key:0,class:"px-3 py-1.5 text-xs font-mono text-retro-muted"},o8={class:"px-3 py-1 text-[11px] font-mono uppercase tracking-wide text-retro-cyan/80 select-none"},a8=["disabled","onClick"],l8={class:"truncate"},c8={class:"relative mode-selector"},u8={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[140px]"},h8=["onClick"],d8={class:"text-xs font-mono text-retro-muted"},f8={key:0,class:"mb-3 p-3 bg-retro-yellow/10 border border-retro-yellow/50 rounded"},p8={class:"flex items-center justify-between gap-3"},m8={class:"flex-1 min-w-0"},g8={class:"text-xs font-mono text-retro-text truncate"},O8={class:"text-retro-cyan"},v8={key:0,class:"text-retro-muted"},b8={key:1,class:"text-retro-muted"},x8={key:1,class:"mb-3 p-3 bg-retro-cyan/10 border border-retro-cyan/50 rounded"},y8={key:2,class:"mb-2 flex flex-wrap gap-2"},k8=["src","alt"],w8={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},S8={class:"truncate text-[10px] font-mono text-retro-muted/80"},$8=["onClick"],C8={class:"flex gap-2 items-start"},Q8=["disabled"],P8={class:"flex-1 relative min-h-[40px]"},T8=["disabled","placeholder"],M8=["disabled"],Zm=4,A8=5*1024*1024,_8=Be({__name:"ChatInput",props:{disabled:{type:Boolean}},setup(r){const e=r,t=pn(),n=Ro(),{sendMessage:s,sendPermissionResponse:i,approvePlan:o,rejectPlan:a,abort:l,resetContext:c}=Md(),u=E(""),h=E(null),f=E(null),m=E(!1),g=E(!1),v=E(!1),y=E([]);let k=null;const $=E(null),{data:T,pending:A}=Hc("chat-input-ai-providers",()=>$fetch("/api/ai/providers"),{server:!1,default:()=>({providers:[]})}),Z=N(()=>T.value?.providers??[]),Y=N(()=>t.permissionMode==="ask"||t.permissionMode==="plan"),V=N(()=>{const F=new Map;for(const ie of Z.value)for(const be of ie.models)F.set(be.label,(F.get(be.label)??0)+1);return Z.value.flatMap(ie=>ie.models.map(be=>{const Te=ie.capabilities.streaming&&(!Y.value||ie.capabilities.permissions),qe=(F.get(be.label)??0)>1;return{key:`${ie.id}::${be.key}`,providerId:ie.id,providerName:ie.name,modelKey:be.key,modelLabel:be.label,label:qe?`${be.label} · ${ie.name}`:be.label,compatible:Te}})).sort((ie,be)=>ie.modelLabel.localeCompare(be.modelLabel,void 0,{sensitivity:"base"})||ie.providerName.localeCompare(be.providerName,void 0,{sensitivity:"base"}))}),re=N(()=>{const F=new Map;for(const be of V.value){const Te=F.get(be.providerId);if(Te){Te.options.push(be);continue}F.set(be.providerId,{providerId:be.providerId,providerName:be.providerName,options:[be]})}const le=new Map([["codex",0],["claude",1]]),ie=Array.from(F.values());return ie.sort((be,Te)=>{const qe=le.get(be.providerId)??99,Ve=le.get(Te.providerId)??99;return qe!==Ve?qe-Ve:be.providerName.localeCompare(Te.providerName,void 0,{sensitivity:"base"})}),ie});function me(F){return`${F.providerId}::${F.modelKey}`}const J=N(()=>{const F=t.activeConversation;return F?.providerId&&F.providerModelKey?{providerId:F.providerId,modelKey:F.providerModelKey}:$.value?$.value:n.providerSelection}),W=N(()=>me(J.value)),z=N(()=>V.value.find(F=>F.key===W.value)||null),L=N(()=>z.value?.label||"Select model");function q(F,le){t.setConversationProviderSelection(F,le.providerId,le.modelKey),t.clearProviderSession(F),t.saveConversation(F,!0)}function w(F){$.value&&(q(F,$.value),$.value=null)}function x(F){if(!F||!F.compatible)return;const le={providerId:F.providerId,modelKey:F.modelKey},ie=t.activeConversationId;if(ie){q(ie,le),$.value=null,v.value=!1;return}$.value=le,v.value=!1}const S={plan:mh,ask:Oh,auto:Hm,bypass:vh},Q={plan:"text-retro-cyan",ask:"text-retro-green",auto:"text-retro-yellow",bypass:"text-retro-red"};function G(F){t.setPermissionMode(F),g.value=!1}function H(F){const le=F.target;le.closest(".mode-selector")||(g.value=!1),le.closest(".model-selector")||(v.value=!1)}zt(()=>{document.addEventListener("click",H),n.hydrate()}),Ht(()=>{document.removeEventListener("click",H),k!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(k),k=null)});const fe=N(()=>(u.value.trim().length>0||y.value.length>0)&&!t.isActiveConversationStreaming&&!m.value&&!t.pendingPermission&&!oe.value),ce=N(()=>t.isActiveConversationStreaming&&!t.pendingPermission),K=N(()=>t.pendingPermission!==null),oe=N(()=>t.pendingPlanApproval!==null);function ae(){i(!0,t.activeConversationId)}function ee(){i(!1,t.activeConversationId)}function ue(){o(t.activeConversationId)}function pe(){a(t.activeConversationId)}function Xe(){y.value=[],f.value&&(f.value.value="")}function nt(F){y.value=y.value.filter(le=>le.id!==F)}function $t(F){return F<1024?`${F} B`:F<1024*1024?`${(F/1024).toFixed(1)} KB`:`${(F/(1024*1024)).toFixed(1)} MB`}function Ot(F){return new Promise((le,ie)=>{const be=new FileReader;be.onload=()=>{typeof be.result=="string"?le(be.result):ie(new Error("Failed to read image"))},be.onerror=()=>ie(be.error||new Error("Failed to read image")),be.readAsDataURL(F)})}async function Pt(F){const le=F.target,ie=le.files?Array.from(le.files):[];if(ie.length===0)return;const{useToast:be}=await Bs(async()=>{const{useToast:Ve}=await import("./Bd9QEY7i.js").then(st=>st.o);return{useToast:Ve}},__vite__mapDeps([0,1,2]),import.meta.url),Te=be();let qe=Zm-y.value.length;if(qe<=0){Te.warning(`You can attach up to ${Zm} images per message.`),le.value="";return}for(const Ve of ie){if(qe<=0)break;if(!Ve.type.startsWith("image/")){Te.warning(`Skipped "${Ve.name}": only image files are supported.`);continue}if(Ve.size>A8){Te.warning(`Skipped "${Ve.name}": max size is 5 MB.`);continue}try{const st=await Ot(Ve);y.value.push({id:`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:Ve.name,mimeType:Ve.type,size:Ve.size,dataUrl:st}),qe--}catch{Te.error(`Failed to attach "${Ve.name}".`)}}le.value=""}const vt=N(()=>{if(t.isActiveConversationStreaming||m.value)return!1;const F=t.lastMessage;return F?.role==="assistant"&&F?.status==="error"});function Oe(F){const le=F.instructionFiles.length>0?F.instructionFiles.map(be=>{const Te=be.source==="cwd"?"cwd":"ancestor",qe=be.mtime?` (mtime: ${be.mtime})`:"";return`- \`${be.path}\` [${Te}] - ${be.hint}${qe}`}):["- (none detected from current cwd ancestry)"],ie=F.specContext.files.length>0?F.specContext.files.map(be=>`- \`${be}\``):["- (none)"];return["## Context Snapshot","",`- Time: ${F.generatedAt}`,`- Session state: **${F.sessionState}**`,`- Provider session ID: \`${F.providerSessionId??"(empty)"}\``,`- Provider: \`${F.providerId}\` / \`${F.providerModelKey}\``,`- Permission mode: \`${F.permissionMode}\``,`- CWD (requested): \`${F.requestedCwd}\``,`- CWD (effective): \`${F.effectiveCwd}\``,`- Feature: \`${F.featureId??"(none)"}\``,"","### Spec Context Injection",`- Active on next turn: **${F.specContext.active?"yes":"no"}**`,`- Reason: ${F.specContext.reason}`,...ie,"","### Detected Instruction Files",...le].join(`
130
+ `)),1)])):X("",!0),d("div",ZB,[p($)?(O(),b("div",IB,[ue[6]||(ue[6]=d("span",{class:"text-retro-muted/80 min-w-12"},"File",-1)),d("code",XB,_(p($)),1)])):X("",!0),p(m)&&p(V)?(O(),b("div",zB,[ue[7]||(ue[7]=d("span",{class:"text-retro-muted/80 min-w-12"},"Cmd",-1)),d("code",NB,_(p(V)),1)])):X("",!0),p(u)&&p(T)?(O(),b("div",VB,[ue[8]||(ue[8]=d("span",{class:"text-retro-muted/80 min-w-12"},"Range",-1)),d("span",null,_(p(T)),1)])):X("",!0)]),p(h)&&p(re).text?(O(),b("div",WB,[ue[9]||(ue[9]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"New Content",-1)),d("pre",jB,_(p(re).text),1),p(re).truncated?(O(),b("div",qB,"Truncated preview")):X("",!0)])):X("",!0),p(f)&&p(me).text?(O(),b("div",YB,[ue[10]||(ue[10]=d("div",{class:"text-[11px] font-mono text-retro-yellow mb-1"},"Before",-1)),d("pre",FB,_(p(me).text),1),p(me).truncated?(O(),b("div",UB,"Truncated preview")):X("",!0)])):X("",!0),p(f)&&p(J).text?(O(),b("div",GB,[ue[11]||(ue[11]=d("div",{class:"text-[11px] font-mono text-retro-green mb-1"},"After",-1)),d("pre",HB,_(p(J).text),1),p(J).truncated?(O(),b("div",KB,"Truncated preview")):X("",!0)])):X("",!0),d("details",JB,[ue[12]||(ue[12]=d("summary",{class:"text-[11px] font-mono text-retro-muted cursor-pointer hover:text-retro-cyan"},"Raw input JSON",-1)),d("pre",eL,_(JSON.stringify(r.block.input,null,2)),1)]),p(c)&&p(v).length>0?(O(),b("div",tL,[ue[13]||(ue[13]=d("div",{class:"text-[11px] font-mono text-retro-cyan mb-1"},"Clarification Prompt",-1)),d("div",rL,[(O(!0),b(ye,null,Ne(p(v),(pe,Xe)=>(O(),b("div",{key:`${pe.id||"q"}-${Xe}`,class:"rounded border border-retro-border/30 bg-retro-panel/40 p-2"},[pe.header?(O(),b("div",nL,_(pe.header),1)):X("",!0),pe.question||pe.prompt||pe.message?(O(),b("div",sL,_(pe.question||pe.prompt||pe.message),1)):X("",!0),Array.isArray(pe.options)&&pe.options.length>0?(O(),b("div",iL,[(O(!0),b(ye,null,Ne(pe.options,(nt,$t)=>(O(),b("div",{key:`${pe.id||"q"}-opt-${$t}`,class:"text-xs font-mono text-retro-muted"},[Le(_(nt.label||`Option ${$t+1}`)+" ",1),nt.description?(O(),b("span",oL," - "+_(nt.description),1)):X("",!0)]))),128))])):X("",!0)]))),128))])])):X("",!0)])):X("",!0),p(oe)?(O(),b("div",aL,[d("div",{class:Ce(["text-xs font-mono rounded p-2 mt-1 overflow-y-auto scrollbar-custom border",p(x)?"text-retro-red bg-retro-red/5 border-retro-red/40":"text-retro-muted bg-retro-panel/60 border-retro-border/30"]),style:xr(p(n)?"max-height: 20rem":"")},[p(H)?(O(),b(ye,{key:0},[d("div",lL,[ue[14]||(ue[14]=Le(" Diff · ",-1)),d("span",cL,"+"+_(p(fe).added),1),ue[15]||(ue[15]=Le(" / ",-1)),d("span",uL,"-"+_(p(fe).removed),1)]),d("div",hL,[(O(!0),b(ye,null,Ne(p(G),(pe,Xe)=>(O(),b("div",{key:`diff-${Xe}`,class:Ce(["px-1 rounded whitespace-pre-wrap break-all",ae(pe)])},_(pe||" "),3))),128))]),!p(n)&&p(K)?(O(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[1]||(ue[1]=Gt(pe=>n.value=!0,["stop"]))}," Show full diff ("+_(p(S))+" chars) ",1)):p(K)?(O(),b("button",{key:1,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[2]||(ue[2]=Gt(pe=>n.value=!1,["stop"]))}," Collapse diff ")):X("",!0)],64)):!p(n)&&p(K)?(O(),b(ye,{key:1},[d("pre",dL,_(p(ce)),1),d("button",{class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[3]||(ue[3]=Gt(pe=>n.value=!0,["stop"]))}," Show full ("+_(p(S))+" chars) ",1)],64)):(O(),b(ye,{key:2},[d("pre",fL,_(p(w)),1),p(K)?(O(),b("button",{key:0,class:"text-retro-cyan hover:underline mt-1 text-[10px]",onClick:ue[4]||(ue[4]=Gt(pe=>n.value=!1,["stop"]))}," Collapse ")):X("",!0)],64))],6)])):X("",!0)]))}}),mL={class:"mt-2 pt-2 border-t border-retro-border/20 flex flex-wrap items-center gap-x-4 gap-y-1 text-[10px] font-mono text-retro-muted"},gL={class:"flex items-center gap-1"},OL={class:"flex items-center gap-1"},vL=Be({__name:"ChatResultSummary",props:{block:{}},setup(r){const e=r,t=N(()=>{const i=Math.round(e.block.durationMs/1e3);return i<60?`${i}s`:`${Math.floor(i/60)}m ${i%60}s`}),n=N(()=>`$${e.block.totalCostUsd.toFixed(4)}`),s=N(()=>{const{inputTokens:i,outputTokens:o}=e.block.usage;return`${i.toLocaleString()} in / ${o.toLocaleString()} out`});return(i,o)=>(O(),b("div",mL,[d("span",gL,[o[0]||(o[0]=d("span",{class:"text-retro-muted/60"},"time",-1)),Le(" "+_(p(t)),1)]),d("span",OL,[o[1]||(o[1]=d("span",{class:"text-retro-muted/60"},"cost",-1)),Le(" "+_(p(n)),1)]),d("span",null,_(p(s)),1),d("span",null,_(r.block.numTurns)+" turn"+_(r.block.numTurns!==1?"s":""),1)]))}}),bL={class:"px-2 py-1 text-[10px] font-mono text-retro-muted border-b border-retro-border/20 mb-1 flex items-center gap-2"},xL={class:"text-retro-cyan"},yL={key:0,class:"text-retro-border"},kL={key:1},wL=Be({__name:"ChatSessionInit",props:{block:{}},setup(r){return(e,t)=>(O(),b("div",bL,[d("span",xL,_(r.block.model),1),t[0]||(t[0]=d("span",{class:"text-retro-border"},"|",-1)),d("span",null,_(r.block.tools.length)+" tools",1),r.block.permissionMode?(O(),b("span",yL,"|")):X("",!0),r.block.permissionMode?(O(),b("span",kL,_(r.block.permissionMode),1)):X("",!0)]))}}),SL=Be({__name:"ChatContentBlock",props:{block:{},toolResultsByUseId:{}},setup(r){const e=r,t=N(()=>{if(e.block.type==="tool_use")return e.toolResultsByUseId.get(e.block.toolUseId)});return(n,s)=>{const i=SB,o=TB,a=pL,l=vL,c=wL;return r.block.type==="text"?(O(),ge(i,{key:0,block:r.block},null,8,["block"])):r.block.type==="thinking"?(O(),ge(o,{key:1,block:r.block},null,8,["block"])):r.block.type==="tool_use"?(O(),ge(a,{key:2,block:r.block,result:p(t)},null,8,["block","result"])):r.block.type==="result_summary"?(O(),ge(l,{key:3,block:r.block},null,8,["block"])):r.block.type==="session_init"?(O(),ge(c,{key:4,block:r.block},null,8,["block"])):X("",!0)}}}),$L={class:"flex-1 min-w-0"},CL={class:"flex items-center gap-2 mb-1"},QL={class:"text-xs font-mono text-retro-muted"},PL={key:0,class:"text-xs font-mono text-retro-yellow animate-pulse"},TL={key:1,class:"text-xs font-mono text-retro-muted"},ML={key:2,class:"text-xs font-mono text-retro-red"},AL={key:1,class:"mb-2 flex flex-wrap gap-2"},_L=["href","download"],RL=["src","alt"],EL={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},BL=["innerHTML"],LL={key:3,class:"text-xs font-mono text-retro-muted italic"},DL={key:4,class:"inline-block w-2 h-4 bg-retro-cyan animate-pulse ml-0.5"},ZL=Be({__name:"ChatMessage",props:{message:{}},setup(r){const e=r,{renderMarkdown:t}=Hl(),n=N(()=>e.message.role==="user"),s=N(()=>e.message.status==="streaming"),i=N(()=>e.message.status==="error"),o=N(()=>e.message.status==="stopped"),a=N(()=>qv(e.message)),l=N(()=>{const v=new Map;for(const y of e.message.contentBlocks??[])y.type==="tool_result"&&v.set(y.toolUseId,y);return v}),c=N(()=>{if(!e.message.contentBlocks)return[];const v=e.message.contentBlocks.filter(k=>k.type!=="tool_result"),y=[];for(const k of v){const $=y.length>0?y[y.length-1]:null;if($?.type==="text"&&k.type==="text"){const T=$.text||"",A=k.text||"";$.text=`${T}${A}`;continue}if($?.type==="thinking"&&k.type==="thinking"){const T=$.thinking||"",A=k.thinking||"";$.thinking=`${T}${A}`;continue}y.push({...k})}return y}),u=N(()=>a.value&&c.value.length>0),h=N(()=>e.message.content.trim().length>0),f=N(()=>e.message.attachments??[]),m=v=>new Date(v).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit"}),g=N(()=>t(e.message.content));return(v,y)=>{const k=SL;return O(),b("div",{class:Ce(["flex gap-3 p-3",[p(n)?"bg-retro-dark/50":"bg-transparent",p(i)?"border-l-2 border-retro-red":""]])},[d("div",{class:Ce(["flex-shrink-0 w-6 h-6 rounded flex items-center justify-center",p(n)?"bg-retro-cyan/20":"bg-retro-green/20"])},[p(n)?(O(),ge(p(tu),{key:0,class:"w-4 h-4 text-retro-cyan"})):(O(),ge(p(tg),{key:1,class:"w-4 h-4 text-retro-green"}))],2),d("div",$L,[d("div",CL,[d("span",{class:Ce(["text-xs font-mono",p(n)?"text-retro-cyan":"text-retro-green"])},_(p(n)?"You":"Assistant"),3),d("span",QL,_(m(r.message.timestamp)),1),p(s)?(O(),b("span",PL," typing... ")):X("",!0),p(o)?(O(),b("span",TL," (stopped) ")):X("",!0),p(i)?(O(),b("span",ML," (error) ")):X("",!0)]),p(u)?(O(!0),b(ye,{key:0},Ne(p(c),$=>(O(),ge(k,{key:$.id,block:$,"tool-results-by-use-id":p(l)},null,8,["block","tool-results-by-use-id"]))),128)):X("",!0),p(n)&&p(f).length>0?(O(),b("div",AL,[(O(!0),b(ye,null,Ne(p(f),$=>(O(),b("a",{key:$.id,href:$.dataUrl,download:$.name,target:"_blank",rel:"noopener noreferrer",class:"w-28 rounded border border-retro-border/70 bg-retro-black/70 p-1 hover:border-retro-cyan/60"},[d("img",{src:$.dataUrl,alt:$.name,class:"h-20 w-full rounded object-cover"},null,8,RL),d("div",EL,_($.name),1)],8,_L))),128))])):X("",!0),!p(u)&&p(h)?(O(),b("div",{key:2,class:"text-sm font-mono text-retro-text break-words chat-markdown",innerHTML:p(g)},null,8,BL)):X("",!0),!p(u)&&!p(h)&&!p(n)&&!p(s)?(O(),b("div",LL," (no visible response content) ")):X("",!0),p(s)?(O(),b("span",DL)):X("",!0)])],2)}}}),IL={key:0,class:"flex flex-col items-center justify-center h-full p-8 text-center"},XL={key:1,class:"relative"},zL={class:"sticky bottom-0"},NL={key:0,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50 backdrop-blur-sm"},VL={key:1,class:"px-4 py-2.5 bg-retro-red/20 border-t border-retro-red/50"},WL={class:"flex items-start gap-2"},jL={class:"flex-1 min-w-0"},qL={class:"flex items-center justify-between gap-2 mb-0.5"},YL={class:"text-xs font-mono text-retro-red/80 break-words whitespace-pre-wrap"},FL={key:2,class:"px-4 py-2 bg-retro-dark/90 border-t border-retro-border/50"},UL=Be({__name:"ChatMessages",setup(r){const e=pn(),{containerRef:t,onScroll:n,maybeScrollToBottom:s,scrollToBottom:i,forceScrollToBottom:o}=xB(),{visibleItems:a,totalHeight:l,onVirtualScroll:c,setItemRef:u}=kB({allMessages:N(()=>e.messages),containerRef:t});function h(){n(),c()}const f=N(()=>e.isActiveConversationStreaming),m=N(()=>{const $=e.lastMessage;return!$||$.role!=="assistant"?null:$.status}),g=E(!1);function v($){const T=$.contentBlocks;return!T||T.length===0?"":T.map(A=>{switch(A.type){case"tool_use":return`u:${A.id}:${A.status}:${A.inputSummary}`;case"tool_result":return`r:${A.id}:${A.toolUseId}:${A.isError?1:0}:${A.content.length}`;case"text":return`t:${A.id}:${A.text.length}`;case"thinking":return`k:${A.id}:${A.thinking.length}`;case"result_summary":return`s:${A.id}:${A.numTurns}:${A.durationMs}`;case"session_init":return`i:${A.id}:${A.model}:${A.tools.length}`;default:return""}}).join("|")}const y=E(null);function k(){if(y.value&&(y.value(),y.value=null),!t.value||typeof ResizeObserver>"u")return;const $=new ResizeObserver(()=>{s("instant")});$.observe(t.value),y.value=()=>{$.disconnect()}}return zt(()=>{i("instant"),k()}),Ht(()=>{y.value&&y.value()}),ze(()=>e.activeConversationId,()=>{g.value=!1,i("instant")}),ze(t,()=>{k()}),ze(()=>[e.activeConversationId,e.messages.length],([$,T])=>{!$||T===0||g.value||(g.value=!0,o("instant"))},{immediate:!0}),ze(()=>e.messages.length,()=>{s("instant")}),ze(()=>e.lastMessage?.content,()=>{s("instant")}),ze([f,()=>e.lastError],()=>{s("instant")}),ze(l,()=>{s("instant")}),($,T)=>(O(),b("div",{ref_key:"containerRef",ref:t,class:"flex-1 overflow-y-auto",onScroll:h},[p(e).hasMessages?(O(),b("div",XL,[d("div",{class:"relative",style:xr({height:`${p(l)}px`})},[(O(!0),b(ye,null,Ne(p(a),A=>(O(),b("div",{key:A.message.id,class:"absolute left-0 right-0 border-b border-retro-border/30",style:xr({transform:`translateY(${A.top}px)`})},[d("div",{ref_for:!0,ref:Z=>p(u)(A.message.id,Z)},[Xm([A.message.id,A.message.status,A.message.content,A.message.contentBlocks?.length||0,v(A.message),A.message.tools?.length||0],()=>te(ZL,{message:A.message},null,8,["message"]),T,0)],512)],4))),128))],4)])):(O(),b("div",IL,[...T[2]||(T[2]=[d("div",{class:"text-retro-muted text-sm font-mono mb-2"}," No messages yet ",-1),d("div",{class:"text-retro-muted text-xs font-mono"}," Send a message to start chatting ",-1)])])),d("div",zL,[p(f)&&!p(e).lastError?(O(),b("div",NL,[...T[3]||(T[3]=[Nm('<div class="flex items-center gap-2"><div class="flex gap-1"><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:0ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:150ms;"></span><span class="w-1.5 h-1.5 rounded-full bg-retro-cyan animate-bounce" style="animation-delay:300ms;"></span></div><span class="text-xs font-mono text-retro-muted">Processing...</span></div>',1)])])):X("",!0),p(e).lastError?(O(),b("div",VL,[d("div",WL,[te(p(Si),{class:"w-4 h-4 text-retro-red flex-shrink-0 mt-0.5"}),d("div",jL,[d("div",qL,[T[4]||(T[4]=d("p",{class:"text-xs font-mono font-semibold text-retro-red"},"Error",-1)),d("button",{class:"text-xs font-mono text-retro-red/60 hover:text-retro-red underline",onClick:T[1]||(T[1]=A=>p(e).clearError())}," Dismiss ")]),d("p",YL,_(p(e).lastError),1),T[5]||(T[5]=d("p",{class:"text-xs font-mono text-retro-muted mt-1"}," Check browser console (F12) for more details ",-1))])])])):p(m)==="stopped"?(O(),b("div",FL,[...T[6]||(T[6]=[d("div",{class:"flex items-center gap-2"},[d("span",{class:"w-2 h-2 rounded-full bg-retro-muted"}),d("span",{class:"text-xs font-mono text-retro-muted"},"Stopped")],-1)])])):X("",!0)])],544))}});function GL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.755 10.059a7.5 7.5 0 0 1 12.548-3.364l1.903 1.903h-3.183a.75.75 0 1 0 0 1.5h4.992a.75.75 0 0 0 .75-.75V4.356a.75.75 0 0 0-1.5 0v3.18l-1.9-1.9A9 9 0 0 0 3.306 9.67a.75.75 0 1 0 1.45.388Zm15.408 3.352a.75.75 0 0 0-.919.53 7.5 7.5 0 0 1-12.548 3.364l-1.902-1.903h3.183a.75.75 0 0 0 0-1.5H2.984a.75.75 0 0 0-.75.75v4.992a.75.75 0 0 0 1.5 0v-3.18l1.9 1.9a9 9 0 0 0 15.059-4.035.75.75 0 0 0-.53-.918Z","clip-rule":"evenodd"})])}function Dm(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M12.53 16.28a.75.75 0 0 1-1.06 0l-7.5-7.5a.75.75 0 0 1 1.06-1.06L12 14.69l6.97-6.97a.75.75 0 1 1 1.06 1.06l-7.5 7.5Z","clip-rule":"evenodd"})])}function HL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{d:"M3.478 2.404a.75.75 0 0 0-.926.941l2.432 7.905H13.5a.75.75 0 0 1 0 1.5H4.984l-2.432 7.905a.75.75 0 0 0 .926.94 60.519 60.519 0 0 0 18.445-8.986.75.75 0 0 0 0-1.218A60.517 60.517 0 0 0 3.478 2.404Z"})])}function KL(r,e){return O(),b("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon"},[d("path",{"fill-rule":"evenodd",d:"M4.5 7.5a3 3 0 0 1 3-3h9a3 3 0 0 1 3 3v9a3 3 0 0 1-3 3h-9a3 3 0 0 1-3-3v-9Z","clip-rule":"evenodd"})])}const JL={class:"flex-shrink-0 flex-grow-0 border-t border-retro-border bg-retro-dark p-3"},e8={class:"flex items-center gap-2 mb-2"},t8={class:"relative min-w-0 flex-1 max-w-[154px] model-selector"},r8=["disabled"],n8={class:"truncate text-left"},s8={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[220px] max-w-[280px]"},i8={key:0,class:"px-3 py-1.5 text-xs font-mono text-retro-muted"},o8={class:"px-3 py-1 text-[11px] font-mono uppercase tracking-wide text-retro-cyan/80 select-none"},a8=["disabled","onClick"],l8={class:"truncate"},c8={class:"relative mode-selector"},u8={key:0,class:"absolute bottom-full left-0 mb-1 py-1 bg-retro-dark border border-retro-border rounded shadow-lg z-10 min-w-[140px]"},h8=["onClick"],d8={class:"text-xs font-mono text-retro-muted"},f8={key:0,class:"mb-3 p-3 bg-retro-yellow/10 border border-retro-yellow/50 rounded"},p8={class:"flex items-center justify-between gap-3"},m8={class:"flex-1 min-w-0"},g8={class:"text-xs font-mono text-retro-text truncate"},O8={class:"text-retro-cyan"},v8={key:0,class:"text-retro-muted"},b8={key:1,class:"text-retro-muted"},x8={key:1,class:"mb-3 p-3 bg-retro-cyan/10 border border-retro-cyan/50 rounded"},y8={key:2,class:"mb-2 flex flex-wrap gap-2"},k8=["src","alt"],w8={class:"mt-1 truncate text-[10px] font-mono text-retro-muted"},S8={class:"truncate text-[10px] font-mono text-retro-muted/80"},$8=["onClick"],C8={class:"flex gap-2 items-start"},Q8=["disabled"],P8={class:"flex-1 relative min-h-[40px]"},T8=["disabled","placeholder"],M8=["disabled"],Zm=4,A8=5*1024*1024,_8=Be({__name:"ChatInput",props:{disabled:{type:Boolean}},setup(r){const e=r,t=pn(),n=Ro(),{sendMessage:s,sendPermissionResponse:i,approvePlan:o,rejectPlan:a,abort:l,resetContext:c}=Md(),u=E(""),h=E(null),f=E(null),m=E(!1),g=E(!1),v=E(!1),y=E([]);let k=null;const $=E(null),{data:T,pending:A}=Hc("chat-input-ai-providers",()=>$fetch("/api/ai/providers"),{server:!1,default:()=>({providers:[]})}),Z=N(()=>T.value?.providers??[]),Y=N(()=>t.permissionMode==="ask"||t.permissionMode==="plan"),V=N(()=>{const F=new Map;for(const ie of Z.value)for(const be of ie.models)F.set(be.label,(F.get(be.label)??0)+1);return Z.value.flatMap(ie=>ie.models.map(be=>{const Te=ie.capabilities.streaming&&(!Y.value||ie.capabilities.permissions),qe=(F.get(be.label)??0)>1;return{key:`${ie.id}::${be.key}`,providerId:ie.id,providerName:ie.name,modelKey:be.key,modelLabel:be.label,label:qe?`${be.label} · ${ie.name}`:be.label,compatible:Te}})).sort((ie,be)=>ie.modelLabel.localeCompare(be.modelLabel,void 0,{sensitivity:"base"})||ie.providerName.localeCompare(be.providerName,void 0,{sensitivity:"base"}))}),re=N(()=>{const F=new Map;for(const be of V.value){const Te=F.get(be.providerId);if(Te){Te.options.push(be);continue}F.set(be.providerId,{providerId:be.providerId,providerName:be.providerName,options:[be]})}const le=new Map([["codex",0],["claude",1]]),ie=Array.from(F.values());return ie.sort((be,Te)=>{const qe=le.get(be.providerId)??99,Ve=le.get(Te.providerId)??99;return qe!==Ve?qe-Ve:be.providerName.localeCompare(Te.providerName,void 0,{sensitivity:"base"})}),ie});function me(F){return`${F.providerId}::${F.modelKey}`}const J=N(()=>{const F=t.activeConversation;return F?.providerId&&F.providerModelKey?{providerId:F.providerId,modelKey:F.providerModelKey}:$.value?$.value:n.providerSelection}),W=N(()=>me(J.value)),z=N(()=>V.value.find(F=>F.key===W.value)||null),L=N(()=>z.value?.label||"Select model");function q(F,le){t.setConversationProviderSelection(F,le.providerId,le.modelKey),t.clearProviderSession(F),t.saveConversation(F,!0)}function w(F){$.value&&(q(F,$.value),$.value=null)}function x(F){if(!F||!F.compatible)return;const le={providerId:F.providerId,modelKey:F.modelKey},ie=t.activeConversationId;if(ie){q(ie,le),$.value=null,v.value=!1;return}$.value=le,v.value=!1}const S={plan:mh,ask:Oh,auto:Hm,bypass:vh},Q={plan:"text-retro-cyan",ask:"text-retro-green",auto:"text-retro-yellow",bypass:"text-retro-red"};function G(F){t.setPermissionMode(F),g.value=!1}function H(F){const le=F.target;le.closest(".mode-selector")||(g.value=!1),le.closest(".model-selector")||(v.value=!1)}zt(()=>{document.addEventListener("click",H),n.hydrate()}),Ht(()=>{document.removeEventListener("click",H),k!==null&&typeof window<"u"&&typeof window.cancelAnimationFrame=="function"&&(window.cancelAnimationFrame(k),k=null)});const fe=N(()=>(u.value.trim().length>0||y.value.length>0)&&!t.isActiveConversationStreaming&&!m.value&&!t.pendingPermission&&!oe.value),ce=N(()=>t.isActiveConversationStreaming&&!t.pendingPermission),K=N(()=>t.pendingPermission!==null),oe=N(()=>t.pendingPlanApproval!==null);function ae(){i(!0,t.activeConversationId)}function ee(){i(!1,t.activeConversationId)}function ue(){o(t.activeConversationId)}function pe(){a(t.activeConversationId)}function Xe(){y.value=[],f.value&&(f.value.value="")}function nt(F){y.value=y.value.filter(le=>le.id!==F)}function $t(F){return F<1024?`${F} B`:F<1024*1024?`${(F/1024).toFixed(1)} KB`:`${(F/(1024*1024)).toFixed(1)} MB`}function Ot(F){return new Promise((le,ie)=>{const be=new FileReader;be.onload=()=>{typeof be.result=="string"?le(be.result):ie(new Error("Failed to read image"))},be.onerror=()=>ie(be.error||new Error("Failed to read image")),be.readAsDataURL(F)})}async function Pt(F){const le=F.target,ie=le.files?Array.from(le.files):[];if(ie.length===0)return;const{useToast:be}=await Bs(async()=>{const{useToast:Ve}=await import("./ddKcAgQK.js").then(st=>st.o);return{useToast:Ve}},__vite__mapDeps([0,1,2]),import.meta.url),Te=be();let qe=Zm-y.value.length;if(qe<=0){Te.warning(`You can attach up to ${Zm} images per message.`),le.value="";return}for(const Ve of ie){if(qe<=0)break;if(!Ve.type.startsWith("image/")){Te.warning(`Skipped "${Ve.name}": only image files are supported.`);continue}if(Ve.size>A8){Te.warning(`Skipped "${Ve.name}": max size is 5 MB.`);continue}try{const st=await Ot(Ve);y.value.push({id:`att-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,name:Ve.name,mimeType:Ve.type,size:Ve.size,dataUrl:st}),qe--}catch{Te.error(`Failed to attach "${Ve.name}".`)}}le.value=""}const vt=N(()=>{if(t.isActiveConversationStreaming||m.value)return!1;const F=t.lastMessage;return F?.role==="assistant"&&F?.status==="error"});function Oe(F){const le=F.instructionFiles.length>0?F.instructionFiles.map(be=>{const Te=be.source==="cwd"?"cwd":"ancestor",qe=be.mtime?` (mtime: ${be.mtime})`:"";return`- \`${be.path}\` [${Te}] - ${be.hint}${qe}`}):["- (none detected from current cwd ancestry)"],ie=F.specContext.files.length>0?F.specContext.files.map(be=>`- \`${be}\``):["- (none)"];return["## Context Snapshot","",`- Time: ${F.generatedAt}`,`- Session state: **${F.sessionState}**`,`- Provider session ID: \`${F.providerSessionId??"(empty)"}\``,`- Provider: \`${F.providerId}\` / \`${F.providerModelKey}\``,`- Permission mode: \`${F.permissionMode}\``,`- CWD (requested): \`${F.requestedCwd}\``,`- CWD (effective): \`${F.effectiveCwd}\``,`- Feature: \`${F.featureId??"(none)"}\``,"","### Spec Context Injection",`- Active on next turn: **${F.specContext.active?"yes":"no"}**`,`- Reason: ${F.specContext.reason}`,...ie,"","### Detected Instruction Files",...le].join(`
131
131
  `)}function de(F){return(F.match(/"[^"]*"|'[^']*'|\S+/g)??[]).map(ie=>ie.startsWith('"')&&ie.endsWith('"')||ie.startsWith("'")&&ie.endsWith("'")?ie.slice(1,-1):ie)}function _e(F){const le=F.match(/^\/(?:spec-search|specsearch)\b(.*)$/i);if(!le)return null;const ie=de(le[1]?.trim()??""),be=[],Te={q:""};for(let qe=0;qe<ie.length;qe++){const Ve=ie[qe];if(Ve==="--mode"&&ie[qe+1]){const st=ie[++qe];(st==="keyword"||st==="semantic"||st==="hybrid")&&(Te.mode=st);continue}if(Ve.startsWith("--mode=")){const st=Ve.slice(7);(st==="keyword"||st==="semantic"||st==="hybrid")&&(Te.mode=st);continue}if(Ve==="--feature"&&ie[qe+1]){Te.featureId=ie[++qe];continue}if(Ve.startsWith("--feature=")){Te.featureId=Ve.slice(10);continue}if(Ve==="--file-type"&&ie[qe+1]){Te.fileType=ie[++qe];continue}if(Ve.startsWith("--file-type=")){Te.fileType=Ve.slice(12);continue}if(Ve==="--limit"&&ie[qe+1]){const st=Number.parseInt(ie[++qe],10);Number.isFinite(st)&&st>0&&(Te.limit=st);continue}if(Ve.startsWith("--limit=")){const st=Number.parseInt(Ve.slice(8),10);Number.isFinite(st)&&st>0&&(Te.limit=st);continue}be.push(Ve)}return Te.q=be.join(" ").trim(),Te}function Ze(F,le=1400){const ie=F.trim();return ie.length<=le?ie:`${ie.slice(0,le)}
132
132
  ...`}function je(F,le){const ie=[];if(ie.push("## Spec Search Results"),ie.push(""),ie.push(`- Query: \`${F.q}\``),ie.push(`- Mode: \`${le.mode}\``),F.featureId&&ie.push(`- Feature filter: \`${F.featureId}\``),F.fileType&&ie.push(`- File type filter: \`${F.fileType}\``),ie.push(`- Hits: **${le.totalCount}** (${le.searchTime}ms)`),le.warning&&ie.push(`- Warning: ${le.warning}`),le.results.length===0)return ie.push(""),ie.push("No matching indexed chunks were found."),ie.join(`
133
133
  `);ie.push("");for(const[be,Te]of le.results.entries()){const qe=Te.chunk;ie.push(`### ${be+1}. \`${qe.sourcePath}:${qe.lineStart}\``),ie.push(`- Match: \`${Te.matchType}\` (score: ${Te.score.toFixed(3)})`),qe.headingHierarchy.length>0&&ie.push(`- Headings: ${qe.headingHierarchy.join(" > ")}`),ie.push(""),ie.push(Ze(qe.content)),ie.push("")}return ie.join(`
134
134
  `)}async function Ge(F){const le=t.activeConversationId??await t.createConversation(),ie=t.addAssistantMessage(le);if(!F.q){t.updateMessage(ie.id,{content:["Usage: `/spec-search <query> [--mode keyword|semantic|hybrid] [--feature <feature-id>] [--file-type <type>] [--limit <n>]`","","Examples:","- `/spec-search FR-001`",'- `/spec-search "indexing indicator" --mode hybrid --feature 008-spec-search --limit 5`'].join(`
135
- `),status:"complete"},le);return}const be=t.activeConversation,Te={q:F.q,mode:F.mode??"hybrid",featureId:F.featureId??be?.featureId,fileType:F.fileType,limit:String(F.limit??5)};try{const qe=await $fetch("/api/specs/search",{query:Te});t.updateMessage(ie.id,{content:je({...F,mode:Te.mode,featureId:Te.featureId},qe),status:"complete"},le)}catch(qe){const Ve=qe instanceof Error?qe.message:"Failed to run spec search";t.updateMessage(ie.id,{content:`Spec search failed: ${Ve}`,status:"error"},le)}}async function Vt(){const F=t.activeConversation,le={permissionMode:t.permissionMode};F?.hasWorktree&&F.worktreePath?le.cwd=F.worktreePath:F?.cwd&&(le.cwd=F.cwd),F?.featureId&&(le.featureId=F.featureId),F?.providerId&&(le.providerId=F.providerId),F?.providerModelKey&&(le.providerModelKey=F.providerModelKey),F?.providerSessionId&&(le.providerSessionId=F.providerSessionId);const ie=await $fetch("/api/chat/context",{query:le}),be=t.activeConversationId??await t.createConversation(),Te=t.addAssistantMessage(be);t.updateMessage(Te.id,{content:Oe(ie),status:"complete"},be)}function ut(F=[]){const le=Wa(t.activeConversation,!0)??{};return F.length>0?{...le,attachments:F}:Object.keys(le).length>0?le:void 0}function Or(F){const le=t.addAssistantMessage(F);return t.startSession(`session-${Date.now()}`,F),t.startConversationStreaming(F),le}function Jt(F,le,ie,be){const Te=ie instanceof Error?ie.message:be;t.setSessionError(Te,F),t.updateMessage(le,{status:"error"},F),t.endSession(F),t.endConversationStreaming(F)}async function er(){const F=u.value.trim(),le=[...y.value];if(F.length===0&&le.length===0||t.isActiveConversationStreaming||m.value||e.disabled)return;const ie=!!t.activeConversationId;let be=null,Te=null;if(F==="/reset"||F==="/reset-context"){await Wt();return}if(F==="/context"||F==="/ctx"){await Vt(),u.value="",Xe(),fr();return}const qe=_e(F);if(qe){await Ge(qe),u.value="",Xe(),fr();return}m.value=!0,u.value="",Xe(),fr();try{if(await t.addUserMessageWithConversation(F,le),be=t.activeConversationId,!be)throw new Error("Failed to create or select a conversation");ie||w(be);const Ve=Or(be);Te=Ve.id,await s(F,Ve.id,be,ut(le))}catch(Ve){if(be&&Te)Jt(be,Te,Ve,"Failed to send message");else{const st=Ve instanceof Error?Ve.message:"Failed to send message";t.setSessionError(st)}}finally{m.value=!1}}async function Cr(){try{l(t.activeConversationId)}catch{}}async function Wt(){if(t.activeConversationId){u.value="",Xe(),fr(),m.value=!0;try{await c(t.activeConversationId);const F=t.addAssistantMessage(t.activeConversationId);t.updateMessage(F.id,{content:"✨ **Context cleared** — The AI conversation context has been reset. Starting fresh from here.",status:"complete"},t.activeConversationId);const{useToast:le}=await Bs(async()=>{const{useToast:be}=await import("./Bd9QEY7i.js").then(Te=>Te.o);return{useToast:be}},__vite__mapDeps([0,1,2]),import.meta.url);le().success("AI context has been reset. The conversation will start fresh.")}catch(F){console.error("Failed to reset context:",F);const{useToast:le}=await Bs(async()=>{const{useToast:be}=await import("./Bd9QEY7i.js").then(Te=>Te.o);return{useToast:be}},__vite__mapDeps([0,1,2]),import.meta.url);le().error("Failed to reset context. Please try again.")}finally{m.value=!1}}}async function Lr(){const F=t.messages;let le=null;for(let Te=F.length-1;Te>=0;Te--)if(F[Te].role==="user"){le={content:F[Te].content,attachments:F[Te].attachments??[]};break}if(!le||!t.activeConversationId)return;const ie=t.activeConversationId;t.clearError(),m.value=!0;let be=null;try{const Te=Or(ie);be=Te.id,await s(le.content,Te.id,ie,ut(le.attachments))}catch(Te){if(be)Jt(ie,be,Te,"Failed to retry message");else{const qe=Te instanceof Error?Te.message:"Failed to retry message";t.setSessionError(qe,ie)}}finally{m.value=!1}}function Qr(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),er())}function Dr(){const F=h.value;if(F){if(!u.value.trim()){F.style.height="";return}F.style.height="auto",F.style.height=Math.min(F.scrollHeight,200)+"px"}}function tr(){if(k!==null)return;k=(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):le=>setTimeout(()=>le(Date.now()),16))(()=>{k=null,Dr()})}function fr(){const F=h.value;F&&(F.style.height="")}function Zr(){tn(()=>{h.value?.focus()})}return ze(u,tr),ze(()=>t.isActiveConversationStreaming,(F,le)=>{le&&!F&&Zr()}),ze(()=>t.activeConversationId,()=>{t.activeConversationId&&($.value=null),Xe(),Zr()}),(F,le)=>(O(),b("div",JL,[d("div",e8,[d("div",t8,[d("button",{disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe)||p(A)||p(V).length===0,class:"flex items-center justify-between gap-1.5 w-full px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono text-retro-muted transition-colors disabled:opacity-60 disabled:cursor-not-allowed",onClick:le[0]||(le[0]=ie=>v.value=!p(v))},[d("span",n8,_(p(L)),1),te(p(Dm),{class:"w-3 h-3 flex-shrink-0"})],8,r8),p(v)?(O(),b("div",s8,[p(V).length===0?(O(),b("div",i8," Loading models... ")):X("",!0),(O(!0),b(ye,null,Ne(p(re),ie=>(O(),b("div",{key:ie.providerId,class:"py-0.5"},[d("div",o8,_(ie.providerName),1),(O(!0),b(ye,null,Ne(ie.options,be=>(O(),b("button",{key:be.key,disabled:!be.compatible,class:Ce(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors disabled:opacity-50 disabled:cursor-not-allowed",p(W)===be.key?"bg-retro-panel text-retro-text":"text-retro-muted"]),onClick:Te=>x(be)},[d("span",l8,_(be.modelLabel)+_(be.compatible?"":" (unsupported for current permission mode)"),1)],10,a8))),128))]))),128))])):X("",!0)]),d("div",c8,[d("button",{class:Ce(["flex items-center gap-1.5 px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono transition-colors",Q[p(t).permissionMode]]),onClick:le[1]||(le[1]=ie=>g.value=!p(g))},[(O(),ge(ai(S[p(t).permissionMode]),{class:"w-4 h-4"})),d("span",null,_(p(Us)[p(t).permissionMode]),1),te(p(Dm),{class:"w-3 h-3"})],2),p(g)?(O(),b("div",u8,[(O(),b(ye,null,Ne(["plan","ask","auto","bypass"],ie=>d("button",{key:ie,class:Ce(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors",[Q[ie],p(t).permissionMode===ie?"bg-retro-panel":""]]),onClick:be=>G(ie)},[(O(),ge(ai(S[ie]),{class:"w-4 h-4"})),d("span",null,_(p(Us)[ie]),1)],10,h8)),64))])):X("",!0)]),d("span",d8,_(p(t).permissionMode==="plan"?"Plan only":p(t).permissionMode==="ask"?"Ask before actions":p(t).permissionMode==="auto"?"Auto approve":"All permissions"),1)]),p(K)?(O(),b("div",f8,[d("div",p8,[d("div",m8,[le[4]||(le[4]=d("div",{class:"text-xs font-mono text-retro-yellow font-bold mb-1"}," Permission Required ",-1)),d("div",g8,[d("span",O8,_(p(t).pendingPermission?.tool),1),p(t).pendingPermission?.filePath?(O(),b("span",v8," - "+_(p(t).pendingPermission.filePath),1)):p(t).pendingPermission?.command?(O(),b("span",b8," - "+_(p(t).pendingPermission.command),1)):X("",!0)])]),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:ae}," Allow "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:ee}," Deny ")])])])):X("",!0),p(oe)?(O(),b("div",x8,[d("div",{class:"flex items-center justify-between gap-3"},[le[5]||(le[5]=d("div",{class:"flex-1 min-w-0"},[d("div",{class:"text-xs font-mono text-retro-cyan font-bold mb-1"}," Plan Ready for Review "),d("div",{class:"text-xs font-mono text-retro-muted"}," Approve to switch to Auto mode and start implementation. ")],-1)),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:ue}," Approve & Implement "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:pe}," Reject ")])])])):X("",!0),p(y).length>0?(O(),b("div",y8,[(O(!0),b(ye,null,Ne(p(y),ie=>(O(),b("div",{key:ie.id,class:"relative w-24 rounded border border-retro-border/70 bg-retro-black/80 p-1"},[d("img",{src:ie.dataUrl,alt:ie.name,class:"h-16 w-full rounded object-cover"},null,8,k8),d("div",w8,_(ie.name),1),d("div",S8,_($t(ie.size)),1),d("button",{class:"absolute -right-2 -top-2 rounded-full border border-retro-border bg-retro-panel p-0.5 text-retro-red hover:bg-retro-red/20",type:"button",onClick:be=>nt(ie.id)},[te(p(ir),{class:"h-3 w-3"})],8,$8)]))),128))])):X("",!0),d("div",C8,[d("input",{ref_key:"fileInputRef",ref:f,type:"file",accept:"image/*",multiple:"",class:"hidden",onChange:Pt},null,544),d("button",{class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-panel/70 text-retro-muted hover:text-retro-cyan hover:bg-retro-panel disabled:opacity-50 disabled:cursor-not-allowed transition-colors",type:"button",title:"Attach images",disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe),onClick:le[2]||(le[2]=ie=>p(f)?.click())},[te(p(vb),{class:"w-5 h-5"})],8,Q8),d("div",P8,[Ue(d("textarea",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":le[3]||(le[3]=ie=>ot(u)?u.value=ie:null),disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe),placeholder:r.disabled?"This conversation is finalized (read-only)":"Type a message...",rows:"1",class:"w-full h-full min-h-[40px] px-3 py-2 bg-retro-black border border-retro-border rounded text-sm font-mono text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan disabled:opacity-50 disabled:cursor-not-allowed resize-none overflow-hidden",onKeydown:Qr},null,40,T8),[[hr,p(u)]])]),p(vt)?(O(),b("button",{key:0,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-yellow/20 text-retro-yellow hover:bg-retro-yellow/30 transition-colors",title:"Retry last message",onClick:Lr},[te(p(GL),{class:"w-5 h-5"})])):X("",!0),!p(ce)&&!p(K)?(O(),b("button",{key:1,disabled:!p(fe),class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-cyan/20 text-retro-cyan hover:bg-retro-cyan/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:er},[te(p(HL),{class:"w-5 h-5"})],8,M8)):p(ce)?(O(),b("button",{key:2,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-red/20 text-retro-red hover:bg-retro-red/30 transition-colors",onClick:Cr},[te(p(KL),{class:"w-5 h-5"})])):X("",!0)]),le[6]||(le[6]=d("div",{class:"mt-1 text-xs font-mono text-retro-muted"}," Press Enter to send, Shift+Enter for new line. Slash commands: `/context`, `/reset`, `/spec-search`. You can attach up to 4 images (5 MB each). ",-1))]))}}),R8={class:"h-64 border-t border-retro-border bg-retro-dark/50 flex flex-col"},E8={class:"h-9 flex items-center justify-between px-3 border-b border-retro-border/40"},B8={key:0,class:"flex-1 flex items-center justify-center text-xs font-mono text-retro-muted"},L8={key:1,class:"flex-1 overflow-y-auto scrollbar-custom"},D8={class:"flex items-center gap-2 text-[10px] font-mono"},Z8={class:"text-retro-muted"},I8={class:"text-retro-muted"},X8={class:"text-retro-green truncate"},z8={class:"mt-1 text-[11px] font-mono text-retro-text whitespace-pre-wrap break-words"},N8=Be({__name:"ChatDebugPanel",setup(r){const e=pn(),{debugEvents:t}=Dv(e);function n(i){return new Date(i).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function s(i){return i==="in"?"text-retro-cyan":i==="out"?"text-retro-yellow":"text-retro-muted"}return(i,o)=>(O(),b("div",R8,[d("div",E8,[o[1]||(o[1]=d("div",{class:"text-[11px] font-mono text-retro-text"}," Debug Stream (CLI/Provider) ",-1)),d("button",{class:"p-1 rounded hover:bg-retro-panel transition-colors",title:"Clear debug events",onClick:o[0]||(o[0]=a=>p(e).clearDebugEvents())},[te(p(Gn),{class:"w-3.5 h-3.5 text-retro-muted"})])]),p(t).length===0?(O(),b("div",B8," No debug events yet ")):(O(),b("div",L8,[(O(!0),b(ye,null,Ne(p(t),a=>(O(),b("div",{key:a.id,class:"px-3 py-2 border-b border-retro-border/20"},[d("div",D8,[d("span",Z8,_(n(a.timestamp)),1),d("span",{class:Ce(s(a.direction))},_(a.direction.toUpperCase()),3),d("span",I8,_(a.channel),1),d("span",X8,_(a.eventType),1)]),d("pre",z8,_(a.payload),1)]))),128))]))]))}}),V8={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},W8={class:"flex items-center justify-between"},j8={class:"space-y-1 text-xs font-mono"},q8={class:"flex items-center gap-2"},Y8={class:"relative"},F8=["disabled"],U8=["value"],G8=["value"],H8={class:"flex items-center gap-2"},K8={class:"text-retro-text"},J8={class:"relative"},eD=["disabled"],tD=["disabled"],rD={class:"flex items-center gap-2"},nD=["disabled"],sD=["disabled"],iD=Be({__name:"FinalizeConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(r,{emit:e}){const t=r,n=e,s=E(""),i=E(null),o=E(!1),a=E(!1),l=E(t.baseBranch),c=E([]),u=E(!1);async function h(){a.value=!0;try{const m=await $fetch("/api/chat/generate-commit-message",{method:"POST",body:{conversationId:t.worktreePath.split("/").pop()?.replace("sc-","")||"",worktreePath:t.worktreePath}});m.success&&m.message&&(s.value=m.message)}catch{}finally{a.value=!1}}zt(async()=>{const m=(async()=>{try{const v=t.worktreePath.split("/").pop()||"",y=await $fetch(`/api/commits/${encodeURIComponent(v)}`,{params:{workingDirectory:t.worktreePath}});i.value=y.aheadCount}catch{i.value=null}})(),g=(async()=>{u.value=!0;try{const v=await $fetch("/api/git/branches");c.value=v.branches.filter(y=>!y.isRemote&&!y.name.startsWith("sc/")).map(y=>y.name),c.value.length>0&&!c.value.includes(l.value)&&(l.value=c.value.includes("main")?"main":c.value.includes("master")?"master":c.value[0])}catch{c.value=[]}finally{u.value=!1}})();await Promise.all([m,g])});function f(){s.value.trim()&&(o.value=!0,n("confirm",s.value.trim(),l.value))}return(m,g)=>(O(),b("div",V8,[d("div",W8,[g[4]||(g[4]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Finalize ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:g[0]||(g[0]=v=>n("cancel"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",j8,[d("div",q8,[g[5]||(g[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",Y8,[Ue(d("select",{"onUpdate:modelValue":g[1]||(g[1]=v=>l.value=v),disabled:o.value||u.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[u.value?(O(),b("option",{key:0,value:r.baseBranch},_(r.baseBranch),9,U8)):X("",!0),(O(!0),b(ye,null,Ne(c.value,v=>(O(),b("option",{key:v,value:v},_(v),9,G8))),128))],8,F8),[[Ws,l.value]]),te(p(ph),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",H8,[g[6]||(g[6]=d("span",{class:"text-retro-muted"},"commits:",-1)),d("span",K8,_(i.value!==null?i.value:"..."),1)])]),d("div",J8,[Ue(d("textarea",{"onUpdate:modelValue":g[2]||(g[2]=v=>s.value=v),placeholder:"Squash commit message...",rows:"2",class:"w-full px-2 py-1.5 pr-8 text-xs font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan resize-none",disabled:o.value||a.value},null,8,eD),[[hr,s.value]]),d("button",{type:"button",disabled:o.value||a.value,class:"absolute right-1.5 top-1.5 p-0.5 rounded text-retro-muted hover:text-retro-cyan transition-colors disabled:opacity-40",title:"Generate commit message",onClick:h},[te(p(Al),{class:Ce(["w-4 h-4",{"animate-spin":a.value}])},null,8,["class"])],8,tD)]),d("div",rD,[d("button",{type:"button",disabled:!s.value.trim()||o.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:f},[te(p(dh),{class:"w-3.5 h-3.5"}),Le(" "+_(o.value?"Finalizing...":"Confirm"),1)],8,nD),d("button",{type:"button",disabled:o.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:g[3]||(g[3]=v=>n("cancel"))}," Cancel ",8,sD)])]))}}),oD={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},aD={class:"flex items-center justify-between"},lD={class:"space-y-1 text-xs font-mono"},cD={class:"flex items-center gap-2"},uD={class:"text-retro-cyan"},hD={class:"flex items-center gap-2"},dD={class:"relative"},fD=["disabled"],pD=["value"],mD=["value"],gD={class:"flex items-center gap-2"},OD={class:"text-retro-text"},vD={class:"flex items-center gap-2"},bD=["disabled"],xD=["disabled"],yD=Be({__name:"RebaseConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(r,{emit:e}){const t=r,n=e,s=E(null),i=E(!1),o=E(t.baseBranch),a=E([]),l=E(!1);async function c(h){try{const f=await $fetch("/api/chat/compare",{params:{worktreePath:t.worktreePath,baseBranch:h}});s.value=f.ahead}catch{s.value=null}}zt(async()=>{const h=c(o.value),f=(async()=>{l.value=!0;try{const m=await $fetch("/api/git/branches");a.value=m.branches.filter(g=>!g.isRemote&&!g.name.startsWith("sc/")).map(g=>g.name),a.value.length>0&&!a.value.includes(o.value)&&(o.value=a.value.includes("main")?"main":a.value.includes("master")?"master":a.value[0])}catch{a.value=[]}finally{l.value=!1}})();await Promise.all([h,f])}),ze(o,h=>{c(h)});function u(){i.value=!0,n("confirm",o.value)}return(h,f)=>(O(),b("div",oD,[d("div",aD,[f[3]||(f[3]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Rebase Worktree ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:f[0]||(f[0]=m=>n("cancel"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",lD,[d("div",cD,[f[4]||(f[4]=d("span",{class:"text-retro-muted"},"worktree:",-1)),d("span",uD,_(r.worktreeBranch),1)]),d("div",hD,[f[5]||(f[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",dD,[Ue(d("select",{"onUpdate:modelValue":f[1]||(f[1]=m=>o.value=m),disabled:i.value||l.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[l.value?(O(),b("option",{key:0,value:r.baseBranch},_(r.baseBranch),9,pD)):X("",!0),(O(!0),b(ye,null,Ne(a.value,m=>(O(),b("option",{key:m,value:m},_(m),9,mD))),128))],8,fD),[[Ws,o.value]]),te(p(ph),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",gD,[f[6]||(f[6]=d("span",{class:"text-retro-muted"},"commits ahead:",-1)),d("span",OD,_(s.value!==null?s.value:"..."),1)])]),d("div",vD,[d("button",{type:"button",disabled:i.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:u},[te(p(dh),{class:"w-3.5 h-3.5"}),Le(" "+_(i.value?"Rebasing...":"Confirm"),1)],8,bD),d("button",{type:"button",disabled:i.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:f[2]||(f[2]=m=>n("cancel"))}," Cancel ",8,xD)])]))}}),kD={class:"flex-1 flex flex-col overflow-hidden"},wD={class:"flex-shrink-0 px-4 py-2 border-b border-retro-border flex items-center justify-between bg-retro-dark"},SD={class:"text-xs font-mono text-retro-text truncate"},$D={class:"flex items-center gap-2 flex-shrink-0"},CD=["title"],QD=["disabled"],PD=["disabled"],TD={key:5,class:"text-xs font-mono text-retro-green"},MD={key:6,class:"text-[11px] font-mono text-retro-muted"},AD={key:0,class:"flex items-center justify-center h-full text-retro-muted text-xs font-mono"},_D=["innerHTML"],RD=["value","readonly"],ED={key:2,class:"flex-shrink-0 px-4 py-2 border-t border-retro-border bg-retro-yellow/10 text-retro-yellow text-xs font-mono"},BD=Be({__name:"ConflictFileEditor",props:{file:{},resolved:{type:Boolean},aiResolving:{type:Boolean}},emits:["resolve","aiResolve"],setup(r,{emit:e}){const t=r,n=e,s=E(t.file.content),i=E(!1),o=E(""),a=E(!1);ze(()=>t.file.path,()=>{s.value=t.file.content,i.value=!1,m()}),ze(()=>t.file.content,()=>{i.value||(s.value=t.file.content,m())});const l=/^<{7}\s.*\n([\s\S]*?)^={7}\n([\s\S]*?)^>{7}\s.*\n/gm,c=/^<{7}[^\n]*\n([\s\S]*?)^={7}[^\n]*\n([\s\S]*?)^>{7}[^\n]*\n?/gm,u=N(()=>/^<{7}\s/m.test(s.value)),h=N(()=>k(s.value).length);function f(J){const W=J.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",sh:"bash",zsh:"bash",sql:"sql",graphql:"graphql",xml:"xml",svg:"xml",toml:"toml",ini:"ini",dockerfile:"dockerfile"}[W]||"text"}async function m(){a.value=!0;try{const{codeToHtml:J}=await Bs(async()=>{const{codeToHtml:G}=await import("./BKqdCRS3.js");return{codeToHtml:G}},__vite__mapDeps([3,1,2]),import.meta.url),W=f(t.file.path),L=s.value.split(`
135
+ `),status:"complete"},le);return}const be=t.activeConversation,Te={q:F.q,mode:F.mode??"hybrid",featureId:F.featureId??be?.featureId,fileType:F.fileType,limit:String(F.limit??5)};try{const qe=await $fetch("/api/specs/search",{query:Te});t.updateMessage(ie.id,{content:je({...F,mode:Te.mode,featureId:Te.featureId},qe),status:"complete"},le)}catch(qe){const Ve=qe instanceof Error?qe.message:"Failed to run spec search";t.updateMessage(ie.id,{content:`Spec search failed: ${Ve}`,status:"error"},le)}}async function Vt(){const F=t.activeConversation,le={permissionMode:t.permissionMode};F?.hasWorktree&&F.worktreePath?le.cwd=F.worktreePath:F?.cwd&&(le.cwd=F.cwd),F?.featureId&&(le.featureId=F.featureId),F?.providerId&&(le.providerId=F.providerId),F?.providerModelKey&&(le.providerModelKey=F.providerModelKey),F?.providerSessionId&&(le.providerSessionId=F.providerSessionId);const ie=await $fetch("/api/chat/context",{query:le}),be=t.activeConversationId??await t.createConversation(),Te=t.addAssistantMessage(be);t.updateMessage(Te.id,{content:Oe(ie),status:"complete"},be)}function ut(F=[]){const le=Wa(t.activeConversation,!0)??{};return F.length>0?{...le,attachments:F}:Object.keys(le).length>0?le:void 0}function Or(F){const le=t.addAssistantMessage(F);return t.startSession(`session-${Date.now()}`,F),t.startConversationStreaming(F),le}function Jt(F,le,ie,be){const Te=ie instanceof Error?ie.message:be;t.setSessionError(Te,F),t.updateMessage(le,{status:"error"},F),t.endSession(F),t.endConversationStreaming(F)}async function er(){const F=u.value.trim(),le=[...y.value];if(F.length===0&&le.length===0||t.isActiveConversationStreaming||m.value||e.disabled)return;const ie=!!t.activeConversationId;let be=null,Te=null;if(F==="/reset"||F==="/reset-context"){await Wt();return}if(F==="/context"||F==="/ctx"){await Vt(),u.value="",Xe(),fr();return}const qe=_e(F);if(qe){await Ge(qe),u.value="",Xe(),fr();return}m.value=!0,u.value="",Xe(),fr();try{if(await t.addUserMessageWithConversation(F,le),be=t.activeConversationId,!be)throw new Error("Failed to create or select a conversation");ie||w(be);const Ve=Or(be);Te=Ve.id,await s(F,Ve.id,be,ut(le))}catch(Ve){if(be&&Te)Jt(be,Te,Ve,"Failed to send message");else{const st=Ve instanceof Error?Ve.message:"Failed to send message";t.setSessionError(st)}}finally{m.value=!1}}async function Cr(){try{l(t.activeConversationId)}catch{}}async function Wt(){if(t.activeConversationId){u.value="",Xe(),fr(),m.value=!0;try{await c(t.activeConversationId);const F=t.addAssistantMessage(t.activeConversationId);t.updateMessage(F.id,{content:"✨ **Context cleared** — The AI conversation context has been reset. Starting fresh from here.",status:"complete"},t.activeConversationId);const{useToast:le}=await Bs(async()=>{const{useToast:be}=await import("./ddKcAgQK.js").then(Te=>Te.o);return{useToast:be}},__vite__mapDeps([0,1,2]),import.meta.url);le().success("AI context has been reset. The conversation will start fresh.")}catch(F){console.error("Failed to reset context:",F);const{useToast:le}=await Bs(async()=>{const{useToast:be}=await import("./ddKcAgQK.js").then(Te=>Te.o);return{useToast:be}},__vite__mapDeps([0,1,2]),import.meta.url);le().error("Failed to reset context. Please try again.")}finally{m.value=!1}}}async function Lr(){const F=t.messages;let le=null;for(let Te=F.length-1;Te>=0;Te--)if(F[Te].role==="user"){le={content:F[Te].content,attachments:F[Te].attachments??[]};break}if(!le||!t.activeConversationId)return;const ie=t.activeConversationId;t.clearError(),m.value=!0;let be=null;try{const Te=Or(ie);be=Te.id,await s(le.content,Te.id,ie,ut(le.attachments))}catch(Te){if(be)Jt(ie,be,Te,"Failed to retry message");else{const qe=Te instanceof Error?Te.message:"Failed to retry message";t.setSessionError(qe,ie)}}finally{m.value=!1}}function Qr(F){F.key==="Enter"&&!F.shiftKey&&(F.preventDefault(),er())}function Dr(){const F=h.value;if(F){if(!u.value.trim()){F.style.height="";return}F.style.height="auto",F.style.height=Math.min(F.scrollHeight,200)+"px"}}function tr(){if(k!==null)return;k=(typeof window<"u"&&typeof window.requestAnimationFrame=="function"?window.requestAnimationFrame.bind(window):le=>setTimeout(()=>le(Date.now()),16))(()=>{k=null,Dr()})}function fr(){const F=h.value;F&&(F.style.height="")}function Zr(){tn(()=>{h.value?.focus()})}return ze(u,tr),ze(()=>t.isActiveConversationStreaming,(F,le)=>{le&&!F&&Zr()}),ze(()=>t.activeConversationId,()=>{t.activeConversationId&&($.value=null),Xe(),Zr()}),(F,le)=>(O(),b("div",JL,[d("div",e8,[d("div",t8,[d("button",{disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe)||p(A)||p(V).length===0,class:"flex items-center justify-between gap-1.5 w-full px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono text-retro-muted transition-colors disabled:opacity-60 disabled:cursor-not-allowed",onClick:le[0]||(le[0]=ie=>v.value=!p(v))},[d("span",n8,_(p(L)),1),te(p(Dm),{class:"w-3 h-3 flex-shrink-0"})],8,r8),p(v)?(O(),b("div",s8,[p(V).length===0?(O(),b("div",i8," Loading models... ")):X("",!0),(O(!0),b(ye,null,Ne(p(re),ie=>(O(),b("div",{key:ie.providerId,class:"py-0.5"},[d("div",o8,_(ie.providerName),1),(O(!0),b(ye,null,Ne(ie.options,be=>(O(),b("button",{key:be.key,disabled:!be.compatible,class:Ce(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors disabled:opacity-50 disabled:cursor-not-allowed",p(W)===be.key?"bg-retro-panel text-retro-text":"text-retro-muted"]),onClick:Te=>x(be)},[d("span",l8,_(be.modelLabel)+_(be.compatible?"":" (unsupported for current permission mode)"),1)],10,a8))),128))]))),128))])):X("",!0)]),d("div",c8,[d("button",{class:Ce(["flex items-center gap-1.5 px-2 py-1 rounded border border-retro-border/50 hover:border-retro-border text-xs font-mono transition-colors",Q[p(t).permissionMode]]),onClick:le[1]||(le[1]=ie=>g.value=!p(g))},[(O(),ge(ai(S[p(t).permissionMode]),{class:"w-4 h-4"})),d("span",null,_(p(Us)[p(t).permissionMode]),1),te(p(Dm),{class:"w-3 h-3"})],2),p(g)?(O(),b("div",u8,[(O(),b(ye,null,Ne(["plan","ask","auto","bypass"],ie=>d("button",{key:ie,class:Ce(["flex items-center gap-2 w-full px-3 py-1.5 text-xs font-mono text-left hover:bg-retro-panel transition-colors",[Q[ie],p(t).permissionMode===ie?"bg-retro-panel":""]]),onClick:be=>G(ie)},[(O(),ge(ai(S[ie]),{class:"w-4 h-4"})),d("span",null,_(p(Us)[ie]),1)],10,h8)),64))])):X("",!0)]),d("span",d8,_(p(t).permissionMode==="plan"?"Plan only":p(t).permissionMode==="ask"?"Ask before actions":p(t).permissionMode==="auto"?"Auto approve":"All permissions"),1)]),p(K)?(O(),b("div",f8,[d("div",p8,[d("div",m8,[le[4]||(le[4]=d("div",{class:"text-xs font-mono text-retro-yellow font-bold mb-1"}," Permission Required ",-1)),d("div",g8,[d("span",O8,_(p(t).pendingPermission?.tool),1),p(t).pendingPermission?.filePath?(O(),b("span",v8," - "+_(p(t).pendingPermission.filePath),1)):p(t).pendingPermission?.command?(O(),b("span",b8," - "+_(p(t).pendingPermission.command),1)):X("",!0)])]),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:ae}," Allow "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:ee}," Deny ")])])])):X("",!0),p(oe)?(O(),b("div",x8,[d("div",{class:"flex items-center justify-between gap-3"},[le[5]||(le[5]=d("div",{class:"flex-1 min-w-0"},[d("div",{class:"text-xs font-mono text-retro-cyan font-bold mb-1"}," Plan Ready for Review "),d("div",{class:"text-xs font-mono text-retro-muted"}," Approve to switch to Auto mode and start implementation. ")],-1)),d("div",{class:"flex gap-2 flex-shrink-0"},[d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-green/20 text-retro-green border border-retro-green/50 hover:bg-retro-green/30 transition-colors",onClick:ue}," Approve & Implement "),d("button",{class:"px-3 py-1.5 text-xs font-mono rounded bg-retro-red/20 text-retro-red border border-retro-red/50 hover:bg-retro-red/30 transition-colors",onClick:pe}," Reject ")])])])):X("",!0),p(y).length>0?(O(),b("div",y8,[(O(!0),b(ye,null,Ne(p(y),ie=>(O(),b("div",{key:ie.id,class:"relative w-24 rounded border border-retro-border/70 bg-retro-black/80 p-1"},[d("img",{src:ie.dataUrl,alt:ie.name,class:"h-16 w-full rounded object-cover"},null,8,k8),d("div",w8,_(ie.name),1),d("div",S8,_($t(ie.size)),1),d("button",{class:"absolute -right-2 -top-2 rounded-full border border-retro-border bg-retro-panel p-0.5 text-retro-red hover:bg-retro-red/20",type:"button",onClick:be=>nt(ie.id)},[te(p(ir),{class:"h-3 w-3"})],8,$8)]))),128))])):X("",!0),d("div",C8,[d("input",{ref_key:"fileInputRef",ref:f,type:"file",accept:"image/*",multiple:"",class:"hidden",onChange:Pt},null,544),d("button",{class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-panel/70 text-retro-muted hover:text-retro-cyan hover:bg-retro-panel disabled:opacity-50 disabled:cursor-not-allowed transition-colors",type:"button",title:"Attach images",disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe),onClick:le[2]||(le[2]=ie=>p(f)?.click())},[te(p(vb),{class:"w-5 h-5"})],8,Q8),d("div",P8,[Ue(d("textarea",{ref_key:"inputRef",ref:h,"onUpdate:modelValue":le[3]||(le[3]=ie=>ot(u)?u.value=ie:null),disabled:r.disabled||p(t).isActiveConversationStreaming||p(K)||p(oe),placeholder:r.disabled?"This conversation is finalized (read-only)":"Type a message...",rows:"1",class:"w-full h-full min-h-[40px] px-3 py-2 bg-retro-black border border-retro-border rounded text-sm font-mono text-retro-text placeholder-retro-muted focus:outline-none focus:border-retro-cyan disabled:opacity-50 disabled:cursor-not-allowed resize-none overflow-hidden",onKeydown:Qr},null,40,T8),[[hr,p(u)]])]),p(vt)?(O(),b("button",{key:0,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-yellow/20 text-retro-yellow hover:bg-retro-yellow/30 transition-colors",title:"Retry last message",onClick:Lr},[te(p(GL),{class:"w-5 h-5"})])):X("",!0),!p(ce)&&!p(K)?(O(),b("button",{key:1,disabled:!p(fe),class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-cyan/20 text-retro-cyan hover:bg-retro-cyan/30 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",onClick:er},[te(p(HL),{class:"w-5 h-5"})],8,M8)):p(ce)?(O(),b("button",{key:2,class:"flex-shrink-0 h-10 w-10 inline-flex items-center justify-center p-0 rounded bg-retro-red/20 text-retro-red hover:bg-retro-red/30 transition-colors",onClick:Cr},[te(p(KL),{class:"w-5 h-5"})])):X("",!0)]),le[6]||(le[6]=d("div",{class:"mt-1 text-xs font-mono text-retro-muted"}," Press Enter to send, Shift+Enter for new line. Slash commands: `/context`, `/reset`, `/spec-search`. You can attach up to 4 images (5 MB each). ",-1))]))}}),R8={class:"h-64 border-t border-retro-border bg-retro-dark/50 flex flex-col"},E8={class:"h-9 flex items-center justify-between px-3 border-b border-retro-border/40"},B8={key:0,class:"flex-1 flex items-center justify-center text-xs font-mono text-retro-muted"},L8={key:1,class:"flex-1 overflow-y-auto scrollbar-custom"},D8={class:"flex items-center gap-2 text-[10px] font-mono"},Z8={class:"text-retro-muted"},I8={class:"text-retro-muted"},X8={class:"text-retro-green truncate"},z8={class:"mt-1 text-[11px] font-mono text-retro-text whitespace-pre-wrap break-words"},N8=Be({__name:"ChatDebugPanel",setup(r){const e=pn(),{debugEvents:t}=Dv(e);function n(i){return new Date(i).toLocaleTimeString("en-US",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit"})}function s(i){return i==="in"?"text-retro-cyan":i==="out"?"text-retro-yellow":"text-retro-muted"}return(i,o)=>(O(),b("div",R8,[d("div",E8,[o[1]||(o[1]=d("div",{class:"text-[11px] font-mono text-retro-text"}," Debug Stream (CLI/Provider) ",-1)),d("button",{class:"p-1 rounded hover:bg-retro-panel transition-colors",title:"Clear debug events",onClick:o[0]||(o[0]=a=>p(e).clearDebugEvents())},[te(p(Gn),{class:"w-3.5 h-3.5 text-retro-muted"})])]),p(t).length===0?(O(),b("div",B8," No debug events yet ")):(O(),b("div",L8,[(O(!0),b(ye,null,Ne(p(t),a=>(O(),b("div",{key:a.id,class:"px-3 py-2 border-b border-retro-border/20"},[d("div",D8,[d("span",Z8,_(n(a.timestamp)),1),d("span",{class:Ce(s(a.direction))},_(a.direction.toUpperCase()),3),d("span",I8,_(a.channel),1),d("span",X8,_(a.eventType),1)]),d("pre",z8,_(a.payload),1)]))),128))]))]))}}),V8={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},W8={class:"flex items-center justify-between"},j8={class:"space-y-1 text-xs font-mono"},q8={class:"flex items-center gap-2"},Y8={class:"relative"},F8=["disabled"],U8=["value"],G8=["value"],H8={class:"flex items-center gap-2"},K8={class:"text-retro-text"},J8={class:"relative"},eD=["disabled"],tD=["disabled"],rD={class:"flex items-center gap-2"},nD=["disabled"],sD=["disabled"],iD=Be({__name:"FinalizeConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(r,{emit:e}){const t=r,n=e,s=E(""),i=E(null),o=E(!1),a=E(!1),l=E(t.baseBranch),c=E([]),u=E(!1);async function h(){a.value=!0;try{const m=await $fetch("/api/chat/generate-commit-message",{method:"POST",body:{conversationId:t.worktreePath.split("/").pop()?.replace("sc-","")||"",worktreePath:t.worktreePath}});m.success&&m.message&&(s.value=m.message)}catch{}finally{a.value=!1}}zt(async()=>{const m=(async()=>{try{const v=t.worktreePath.split("/").pop()||"",y=await $fetch(`/api/commits/${encodeURIComponent(v)}`,{params:{workingDirectory:t.worktreePath}});i.value=y.aheadCount}catch{i.value=null}})(),g=(async()=>{u.value=!0;try{const v=await $fetch("/api/git/branches");c.value=v.branches.filter(y=>!y.isRemote&&!y.name.startsWith("sc/")).map(y=>y.name),c.value.length>0&&!c.value.includes(l.value)&&(l.value=c.value.includes("main")?"main":c.value.includes("master")?"master":c.value[0])}catch{c.value=[]}finally{u.value=!1}})();await Promise.all([m,g])});function f(){s.value.trim()&&(o.value=!0,n("confirm",s.value.trim(),l.value))}return(m,g)=>(O(),b("div",V8,[d("div",W8,[g[4]||(g[4]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Finalize ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:g[0]||(g[0]=v=>n("cancel"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",j8,[d("div",q8,[g[5]||(g[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",Y8,[Ue(d("select",{"onUpdate:modelValue":g[1]||(g[1]=v=>l.value=v),disabled:o.value||u.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[u.value?(O(),b("option",{key:0,value:r.baseBranch},_(r.baseBranch),9,U8)):X("",!0),(O(!0),b(ye,null,Ne(c.value,v=>(O(),b("option",{key:v,value:v},_(v),9,G8))),128))],8,F8),[[Ws,l.value]]),te(p(ph),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",H8,[g[6]||(g[6]=d("span",{class:"text-retro-muted"},"commits:",-1)),d("span",K8,_(i.value!==null?i.value:"..."),1)])]),d("div",J8,[Ue(d("textarea",{"onUpdate:modelValue":g[2]||(g[2]=v=>s.value=v),placeholder:"Squash commit message...",rows:"2",class:"w-full px-2 py-1.5 pr-8 text-xs font-mono bg-retro-black border border-retro-border rounded text-retro-text placeholder-retro-subtle focus:outline-none focus:border-retro-cyan resize-none",disabled:o.value||a.value},null,8,eD),[[hr,s.value]]),d("button",{type:"button",disabled:o.value||a.value,class:"absolute right-1.5 top-1.5 p-0.5 rounded text-retro-muted hover:text-retro-cyan transition-colors disabled:opacity-40",title:"Generate commit message",onClick:h},[te(p(Al),{class:Ce(["w-4 h-4",{"animate-spin":a.value}])},null,8,["class"])],8,tD)]),d("div",rD,[d("button",{type:"button",disabled:!s.value.trim()||o.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-green/10 border-retro-green/50 text-retro-green hover:bg-retro-green/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:f},[te(p(dh),{class:"w-3.5 h-3.5"}),Le(" "+_(o.value?"Finalizing...":"Confirm"),1)],8,nD),d("button",{type:"button",disabled:o.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:g[3]||(g[3]=v=>n("cancel"))}," Cancel ",8,sD)])]))}}),oD={class:"px-4 py-3 border-b border-retro-border bg-retro-dark/80 space-y-3"},aD={class:"flex items-center justify-between"},lD={class:"space-y-1 text-xs font-mono"},cD={class:"flex items-center gap-2"},uD={class:"text-retro-cyan"},hD={class:"flex items-center gap-2"},dD={class:"relative"},fD=["disabled"],pD=["value"],mD=["value"],gD={class:"flex items-center gap-2"},OD={class:"text-retro-text"},vD={class:"flex items-center gap-2"},bD=["disabled"],xD=["disabled"],yD=Be({__name:"RebaseConfirm",props:{baseBranch:{},worktreeBranch:{},worktreePath:{}},emits:["confirm","cancel"],setup(r,{emit:e}){const t=r,n=e,s=E(null),i=E(!1),o=E(t.baseBranch),a=E([]),l=E(!1);async function c(h){try{const f=await $fetch("/api/chat/compare",{params:{worktreePath:t.worktreePath,baseBranch:h}});s.value=f.ahead}catch{s.value=null}}zt(async()=>{const h=c(o.value),f=(async()=>{l.value=!0;try{const m=await $fetch("/api/git/branches");a.value=m.branches.filter(g=>!g.isRemote&&!g.name.startsWith("sc/")).map(g=>g.name),a.value.length>0&&!a.value.includes(o.value)&&(o.value=a.value.includes("main")?"main":a.value.includes("master")?"master":a.value[0])}catch{a.value=[]}finally{l.value=!1}})();await Promise.all([h,f])}),ze(o,h=>{c(h)});function u(){i.value=!0,n("confirm",o.value)}return(h,f)=>(O(),b("div",oD,[d("div",aD,[f[3]||(f[3]=d("span",{class:"text-xs font-mono text-retro-text font-semibold uppercase tracking-wide"}," Rebase Worktree ",-1)),d("button",{type:"button",class:"p-0.5 text-retro-muted hover:text-retro-text transition-colors",title:"Cancel",onClick:f[0]||(f[0]=m=>n("cancel"))},[te(p(ir),{class:"w-4 h-4"})])]),d("div",lD,[d("div",cD,[f[4]||(f[4]=d("span",{class:"text-retro-muted"},"worktree:",-1)),d("span",uD,_(r.worktreeBranch),1)]),d("div",hD,[f[5]||(f[5]=d("span",{class:"text-retro-muted"},"target:",-1)),d("div",dD,[Ue(d("select",{"onUpdate:modelValue":f[1]||(f[1]=m=>o.value=m),disabled:i.value||l.value,class:"appearance-none bg-retro-black border border-retro-border rounded px-2 py-0.5 pr-6 text-xs font-mono text-retro-cyan focus:outline-none focus:border-retro-cyan cursor-pointer disabled:opacity-40"},[l.value?(O(),b("option",{key:0,value:r.baseBranch},_(r.baseBranch),9,pD)):X("",!0),(O(!0),b(ye,null,Ne(a.value,m=>(O(),b("option",{key:m,value:m},_(m),9,mD))),128))],8,fD),[[Ws,o.value]]),te(p(ph),{class:"absolute right-1 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-retro-muted pointer-events-none"})])]),d("div",gD,[f[6]||(f[6]=d("span",{class:"text-retro-muted"},"commits ahead:",-1)),d("span",OD,_(s.value!==null?s.value:"..."),1)])]),d("div",vD,[d("button",{type:"button",disabled:i.value,class:"flex items-center gap-1 px-3 py-1 text-xs font-mono rounded border transition-colors bg-retro-cyan/10 border-retro-cyan/50 text-retro-cyan hover:bg-retro-cyan/20 disabled:opacity-40 disabled:cursor-not-allowed",onClick:u},[te(p(dh),{class:"w-3.5 h-3.5"}),Le(" "+_(i.value?"Rebasing...":"Confirm"),1)],8,bD),d("button",{type:"button",disabled:i.value,class:"px-3 py-1 text-xs font-mono rounded border border-retro-border text-retro-muted hover:text-retro-text hover:border-retro-text/30 transition-colors disabled:opacity-40",onClick:f[2]||(f[2]=m=>n("cancel"))}," Cancel ",8,xD)])]))}}),kD={class:"flex-1 flex flex-col overflow-hidden"},wD={class:"flex-shrink-0 px-4 py-2 border-b border-retro-border flex items-center justify-between bg-retro-dark"},SD={class:"text-xs font-mono text-retro-text truncate"},$D={class:"flex items-center gap-2 flex-shrink-0"},CD=["title"],QD=["disabled"],PD=["disabled"],TD={key:5,class:"text-xs font-mono text-retro-green"},MD={key:6,class:"text-[11px] font-mono text-retro-muted"},AD={key:0,class:"flex items-center justify-center h-full text-retro-muted text-xs font-mono"},_D=["innerHTML"],RD=["value","readonly"],ED={key:2,class:"flex-shrink-0 px-4 py-2 border-t border-retro-border bg-retro-yellow/10 text-retro-yellow text-xs font-mono"},BD=Be({__name:"ConflictFileEditor",props:{file:{},resolved:{type:Boolean},aiResolving:{type:Boolean}},emits:["resolve","aiResolve"],setup(r,{emit:e}){const t=r,n=e,s=E(t.file.content),i=E(!1),o=E(""),a=E(!1);ze(()=>t.file.path,()=>{s.value=t.file.content,i.value=!1,m()}),ze(()=>t.file.content,()=>{i.value||(s.value=t.file.content,m())});const l=/^<{7}\s.*\n([\s\S]*?)^={7}\n([\s\S]*?)^>{7}\s.*\n/gm,c=/^<{7}[^\n]*\n([\s\S]*?)^={7}[^\n]*\n([\s\S]*?)^>{7}[^\n]*\n?/gm,u=N(()=>/^<{7}\s/m.test(s.value)),h=N(()=>k(s.value).length);function f(J){const W=J.split(".").pop()?.toLowerCase()||"";return{ts:"typescript",tsx:"tsx",js:"javascript",jsx:"jsx",vue:"vue",html:"html",css:"css",scss:"scss",less:"less",json:"json",yaml:"yaml",yml:"yaml",md:"markdown",py:"python",rb:"ruby",go:"go",rs:"rust",java:"java",kt:"kotlin",swift:"swift",sh:"bash",zsh:"bash",sql:"sql",graphql:"graphql",xml:"xml",svg:"xml",toml:"toml",ini:"ini",dockerfile:"dockerfile"}[W]||"text"}async function m(){a.value=!0;try{const{codeToHtml:J}=await Bs(async()=>{const{codeToHtml:G}=await import("./DqNujSig.js");return{codeToHtml:G}},__vite__mapDeps([3,1,2]),import.meta.url),W=f(t.file.path),L=s.value.split(`
136
136
  `);let q="",w=!1,x=!1,S=0,Q=-1;for(const G of L){S++;const H=/^<{7}\s/.test(G),fe=/^={7}$/.test(G),ce=/^>{7}\s/.test(G);if(H){Q++,w=!0,x=!1,q+=`<div class="conflict-line conflict-marker-line" data-line="${S}"><span class="line-number">${S}</span><span class="line-content conflict-marker">${g(G)}</span></div>
137
137
  `,t.resolved||(q+=A(Q));continue}if(fe&&w){w=!1,x=!0,q+=`<div class="conflict-line conflict-marker-line" data-line="${S}"><span class="line-number">${S}</span><span class="line-content conflict-marker">${g(G)}</span></div>
138
138
  `;continue}if(ce){x=!1,q+=`<div class="conflict-line conflict-marker-line" data-line="${S}"><span class="line-number">${S}</span><span class="line-content conflict-marker">${g(G)}</span></div>