@intent-hq/web 2.313.0 → 2.313.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{B-agcRbG.js → 1wCbR4ud.js} +1 -1
  3. package/web/app/immutable/chunks/{CNMS2KOf.js → 4wFlAApS.js} +1 -1
  4. package/web/app/immutable/chunks/{BNHRvqeQ.js → 6rzwTXJx.js} +1 -1
  5. package/web/app/immutable/chunks/{Bops7MsY.js → A3beYjJS.js} +4 -4
  6. package/web/app/immutable/chunks/{hcpthRFf.js → AF5xKPfV.js} +1 -1
  7. package/web/app/immutable/chunks/{V553m0MO.js → AHQMxoVk.js} +1 -1
  8. package/web/app/immutable/chunks/{tuNJ429u.js → B1YnvfKo.js} +1 -1
  9. package/web/app/immutable/chunks/{C5c-LdLT.js → B2st7VbN.js} +1 -1
  10. package/web/app/immutable/chunks/{Cw6SlTJ6.js → B3W2oJ3u.js} +1 -1
  11. package/web/app/immutable/chunks/{BFETMHTz.js → B6Eksue8.js} +2 -2
  12. package/web/app/immutable/chunks/{BEVpCf6b.js → B6QJA3k0.js} +1 -1
  13. package/web/app/immutable/chunks/{CxPdVa60.js → B88eFHaH.js} +1 -1
  14. package/web/app/immutable/chunks/{h4HcKsDl.js → BAssmU5H.js} +1 -1
  15. package/web/app/immutable/chunks/{n2a_8s79.js → BESrHe_0.js} +1 -1
  16. package/web/app/immutable/chunks/{C5EEwI0-.js → BIZcuYRW.js} +2 -2
  17. package/web/app/immutable/chunks/{C2L4VLjE.js → BOQCK4ni.js} +1 -1
  18. package/web/app/immutable/chunks/{CYtxGPAf.js → BRIkzo-E.js} +1 -1
  19. package/web/app/immutable/chunks/{B_ifqSee.js → BW6fyv0T.js} +6 -6
  20. package/web/app/immutable/chunks/{C3X16aYc.js → B_-1t0b5.js} +1 -1
  21. package/web/app/immutable/chunks/{BfxxnTgV.js → Bc3_ahSr.js} +1 -1
  22. package/web/app/immutable/chunks/{04XFWhBd.js → Bfc094Ub.js} +1 -1
  23. package/web/app/immutable/chunks/{28aV1Wzl.js → BjqGlL_Y.js} +1 -1
  24. package/web/app/immutable/chunks/{DhXr1ZqD.js → BssmMBl2.js} +1 -1
  25. package/web/app/immutable/chunks/{CHtSQ3Rg.js → Bu6sHonm.js} +1 -1
  26. package/web/app/immutable/chunks/{CnfYogWn.js → By8e6LYt.js} +1 -1
  27. package/web/app/immutable/chunks/{DuRHazc8.js → C-fnz5X4.js} +1 -1
  28. package/web/app/immutable/chunks/{CPzgXxXu.js → C-li4cfO.js} +1 -1
  29. package/web/app/immutable/chunks/{Cnihm-Nc.js → C2Cq4c9l.js} +1 -1
  30. package/web/app/immutable/chunks/{jvw1Fn3k.js → C2m8Iivv.js} +1 -1
  31. package/web/app/immutable/chunks/{CAK2j9T_.js → C6XSZJri.js} +1 -1
  32. package/web/app/immutable/chunks/{2bp47GFs.js → C6aPQebU.js} +1 -1
  33. package/web/app/immutable/chunks/{DBfJXlLJ.js → C6gBBEr6.js} +1 -1
  34. package/web/app/immutable/chunks/{DwdStl3H.js → C6krgOsR.js} +4 -4
  35. package/web/app/immutable/chunks/{BiMGZT5w.js → C80u9j_3.js} +1 -1
  36. package/web/app/immutable/chunks/{B9F8nd-t.js → C8PuI333.js} +1 -1
  37. package/web/app/immutable/chunks/{BwK5Bace.js → CA7UZgrf.js} +1 -1
  38. package/web/app/immutable/chunks/{DvExZ34Y.js → CAn8DYJP.js} +1 -1
  39. package/web/app/immutable/chunks/{B1Rrvp0b.js → CBTot2K1.js} +1 -1
  40. package/web/app/immutable/chunks/{i92hRJko.js → CCCBFmfe.js} +3 -3
  41. package/web/app/immutable/chunks/{CM7ZaQP_.js → CE8vXfAM.js} +1 -1
  42. package/web/app/immutable/chunks/{CJCZCJxO.js → CG-371Y6.js} +1 -1
  43. package/web/app/immutable/chunks/{okmbexJZ.js → CICEz2Qq.js} +1 -1
  44. package/web/app/immutable/chunks/{DeBw56y4.js → CJtH5G9P.js} +1 -1
  45. package/web/app/immutable/chunks/{DZuInc-o.js → CKH-l4ig.js} +1 -1
  46. package/web/app/immutable/chunks/{sLnx1Tu5.js → CKWaKOqs.js} +1 -1
  47. package/web/app/immutable/chunks/{CPfTSiRI.js → CMvHzajx.js} +1 -1
  48. package/web/app/immutable/chunks/{Dt9TrzFG.js → CN_VK1iL.js} +1 -1
  49. package/web/app/immutable/chunks/{B3nB6DWs.js → COpjcilg.js} +1 -1
  50. package/web/app/immutable/chunks/{6uLD17LP.js → CP06IBS7.js} +1 -1
  51. package/web/app/immutable/chunks/{LoSFphII.js → CQMd4GmI.js} +1 -1
  52. package/web/app/immutable/chunks/{X-W6j8OD.js → CQbq623l.js} +1 -1
  53. package/web/app/immutable/chunks/{B721JIop.js → CTX5Fuc9.js} +2 -2
  54. package/web/app/immutable/chunks/{DaWdrOD0.js → CTfHCA2Y.js} +1 -1
  55. package/web/app/immutable/chunks/{CgAzfuNr.js → CUPAS0zd.js} +1 -1
  56. package/web/app/immutable/chunks/{DKhv0I45.js → CW1tBVLY.js} +1 -1
  57. package/web/app/immutable/chunks/{C_73TJPq.js → CWaCCzEn.js} +1 -1
  58. package/web/app/immutable/chunks/{C8reKsm7.js → CXNySl0c.js} +1 -1
  59. package/web/app/immutable/chunks/{DPcbMgdd.js → CYmZhCDN.js} +1 -1
  60. package/web/app/immutable/chunks/{DEfnfMIS.js → C_KYY7ZK.js} +1 -1
  61. package/web/app/immutable/chunks/{DgJXm20t.js → Cb6WrSKY.js} +1 -1
  62. package/web/app/immutable/chunks/{DiVHUgRZ.js → Cbh1BCiS.js} +2 -2
  63. package/web/app/immutable/chunks/{DZ64qqlL.js → CbpiaYyP.js} +1 -1
  64. package/web/app/immutable/chunks/{BXMFG8vW.js → CcGPnEzl.js} +1 -1
  65. package/web/app/immutable/chunks/{B6oQfzis.js → CelhKzDn.js} +1 -1
  66. package/web/app/immutable/chunks/{BDICjj7k.js → ClfTOQ5L.js} +1 -1
  67. package/web/app/immutable/chunks/{CVvtz86e.js → CsTPrgDm.js} +3 -3
  68. package/web/app/immutable/chunks/{DJCJ21BX.js → Ctl9Ux7T.js} +1 -1
  69. package/web/app/immutable/chunks/{B7-651e2.js → CxO_9nE4.js} +1 -1
  70. package/web/app/immutable/chunks/{BCDWZbwh.js → CzrG_lpv.js} +1 -1
  71. package/web/app/immutable/chunks/{CDE88Tgk.js → D-8WC0DU.js} +1 -1
  72. package/web/app/immutable/chunks/{B-rSL5ZP.js → D2uybU7F.js} +2 -2
  73. package/web/app/immutable/chunks/{OS5fDMId.js → D47PZJI_.js} +1 -1
  74. package/web/app/immutable/chunks/{D_uOXHFE.js → D4qqUzAr.js} +1 -1
  75. package/web/app/immutable/chunks/{kRmfkT9J.js → D5XH3yqM.js} +1 -1
  76. package/web/app/immutable/chunks/{77JHYRqp.js → D62gE1G0.js} +1 -1
  77. package/web/app/immutable/chunks/{D0NG9Gzz.js → D84mJH5u.js} +1 -1
  78. package/web/app/immutable/chunks/{BGYaMCAp.js → DAtBKOQq.js} +1 -1
  79. package/web/app/immutable/chunks/{ldCNaZ5F.js → DBUJXdXR.js} +1 -1
  80. package/web/app/immutable/chunks/{2g3BKwo_.js → DChetNRi.js} +2 -2
  81. package/web/app/immutable/chunks/{BN6Sv1MY.js → DESxr5Rj.js} +1 -1
  82. package/web/app/immutable/chunks/{Cpw4G06I.js → DL9BUVq-.js} +1 -1
  83. package/web/app/immutable/chunks/{xlntbOPQ.js → DNYGh_FV.js} +1 -1
  84. package/web/app/immutable/chunks/{CKJYXvLT.js → DOnT_3WY.js} +1 -1
  85. package/web/app/immutable/chunks/{C4XQStEU.js → DPG0D59v.js} +1 -1
  86. package/web/app/immutable/chunks/{D0tEEJ7X.js → DQNmQX9F.js} +1 -1
  87. package/web/app/immutable/chunks/{B9pAuhbK.js → DSOeLuN2.js} +1 -1
  88. package/web/app/immutable/chunks/{BKTydVIY.js → DUdpP1ED.js} +1 -1
  89. package/web/app/immutable/chunks/{YH3VI7O_.js → DUrqH6OL.js} +1 -1
  90. package/web/app/immutable/chunks/{BgUzpkp7.js → DWccAyE3.js} +1 -1
  91. package/web/app/immutable/chunks/{DPiGMYKs.js → DYrH45vr.js} +1 -1
  92. package/web/app/immutable/chunks/{Dxpr5NqS.js → DgfdSIWo.js} +1 -1
  93. package/web/app/immutable/chunks/{DqTygHNa.js → DkI_jPOw.js} +4 -4
  94. package/web/app/immutable/chunks/{DqLOhjhM.js → DlKVdWHt.js} +1 -1
  95. package/web/app/immutable/chunks/{gqVNwlAV.js → DulsjrO4.js} +1 -1
  96. package/web/app/immutable/chunks/{DfTvRpFp.js → Dvil1FCS.js} +1 -1
  97. package/web/app/immutable/chunks/{DuVelotc.js → DwPGocEY.js} +2 -2
  98. package/web/app/immutable/chunks/{BM7ZHc1t.js → DwgP_YcK.js} +1 -1
  99. package/web/app/immutable/chunks/{BAQDI3wv.js → DxZSyekB.js} +1 -1
  100. package/web/app/immutable/chunks/{BLDT4lze.js → Dz6YK0K2.js} +1 -1
  101. package/web/app/immutable/chunks/{BBRz8JFJ.js → HWP1BG2L.js} +1 -1
  102. package/web/app/immutable/chunks/{C58wlt4Q.js → LSDVwgG8.js} +2 -2
  103. package/web/app/immutable/chunks/{BZ90Gl9e.js → MED7rLah.js} +1 -1
  104. package/web/app/immutable/chunks/{BlfjnWuH.js → MgJqQwQp.js} +1 -1
  105. package/web/app/immutable/chunks/{DCcgbj-g.js → NYwlcfYt.js} +1 -1
  106. package/web/app/immutable/chunks/{CRgLy9Dv.js → OpYhygEs.js} +1 -1
  107. package/web/app/immutable/chunks/{BFpzDysH.js → TP4sXUzS.js} +1 -1
  108. package/web/app/immutable/chunks/{IB-HmS7d.js → ZUZF8K3P.js} +1 -1
  109. package/web/app/immutable/chunks/{BR8jrnEs.js → _bllxFVr.js} +1 -1
  110. package/web/app/immutable/chunks/{KFwqetYG.js → a6K5_NPk.js} +1 -1
  111. package/web/app/immutable/chunks/{P4NanOkc.js → dX_oN6Xt.js} +1 -1
  112. package/web/app/immutable/chunks/{cUCU_6OD.js → gsqPz4Y0.js} +1 -1
  113. package/web/app/immutable/chunks/{CCIxcA5l.js → jnmyog2T.js} +1 -1
  114. package/web/app/immutable/chunks/{BkKnMUvE.js → jq7ACadW.js} +1 -1
  115. package/web/app/immutable/chunks/{um4u3A9l.js → kdf0l6Z-.js} +1 -1
  116. package/web/app/immutable/chunks/{CEWfqweJ.js → nHQ6ExVj.js} +1 -1
  117. package/web/app/immutable/chunks/{Bpy6Muvw.js → q4Mp6azq.js} +4 -4
  118. package/web/app/immutable/chunks/{CatH1hIe.js → qIh42_HI.js} +1 -1
  119. package/web/app/immutable/chunks/{D6DsI_Sr.js → qcgLBz2O.js} +1 -1
  120. package/web/app/immutable/chunks/{DE32xZOO.js → qr2Z9jBR.js} +1 -1
  121. package/web/app/immutable/chunks/{DFzMoFQx.js → sg8Cer3T.js} +3 -3
  122. package/web/app/immutable/chunks/{BdetxH0g.js → tSV1knJu.js} +1 -1
  123. package/web/app/immutable/chunks/{PTzYQcOR.js → usUeYWMe.js} +1 -1
  124. package/web/app/immutable/chunks/{CYlqp1HL.js → x8WBzABF.js} +6 -6
  125. package/web/app/immutable/chunks/{DKPwGUzq.js → xfGEIVf6.js} +1 -1
  126. package/web/app/immutable/chunks/{CCxcLQdk.js → y_yPvfwh.js} +1 -1
  127. package/web/app/immutable/entry/{app.Co8E4L03.js → app.BlqNT7Cr.js} +2 -2
  128. package/web/app/immutable/entry/start.DaNUqzZq.js +1 -0
  129. package/web/app/immutable/nodes/{0.BucKx3Zo.js → 0.ShO9PneW.js} +1 -1
  130. package/web/app/immutable/nodes/{1.-v_Vj9ip.js → 1.CWY9gUhn.js} +1 -1
  131. package/web/app/immutable/nodes/{10.BnlxMSMI.js → 10.BPcvGGhE.js} +1 -1
  132. package/web/app/immutable/nodes/{14.Ca9GXwJ0.js → 14.C46jjudj.js} +1 -1
  133. package/web/app/immutable/nodes/{16.Dk1EKS3B.js → 16.DxDrMp3A.js} +2 -2
  134. package/web/app/immutable/nodes/{2.Bazc0fR2.js → 2.BY4xMtJS.js} +3 -3
  135. package/web/app/immutable/nodes/{3.CCsh91Fv.js → 3.RPzUk4Sw.js} +1 -1
  136. package/web/app/immutable/nodes/{4.C_FHoeDU.js → 4.ZFgOw7Ux.js} +1 -1
  137. package/web/app/immutable/nodes/{5.DegIKxsI.js → 5.BKaPpN7j.js} +1 -1
  138. package/web/app/immutable/nodes/{6.F6OlLFwi.js → 6.BqCf3vb3.js} +1 -1
  139. package/web/app/immutable/nodes/{7.quuP6x8b.js → 7.CJYSYpjI.js} +1 -1
  140. package/web/app/immutable/nodes/{8.xtRgDwRj.js → 8.B_FmoLB7.js} +2 -2
  141. package/web/app/immutable/nodes/{9.DFsNNJdd.js → 9.p1SC8ote.js} +1 -1
  142. package/web/app/version.json +1 -1
  143. package/web/index.html +9 -9
  144. package/web/app/immutable/entry/start.CBL0QUZV.js +0 -1
@@ -1 +1 @@
1
- import{t as le,bq as u,a_ as D,by as ce,b as de}from"./BAqR9jtB.js";import{bs as ve,ca as fe,aD as e,a5 as H,bS as ue,bA as L,bH as K,b_ as S,W as T,bn as ge,bV as P,c9 as x,aA as g,a7 as me,ay as he,bl as pe,bO as be,aB as F}from"./DYhIMPy1.js";import{k as X,s as c,h as _e,l as R}from"./BPk16bSc.js";import{s as ke}from"./DiCMHWTR.js";import{b as we}from"./BaIAhI85.js";import{t as j}from"./Bl_iEh1f.js";import{A as xe}from"./Bops7MsY.js";import{y as ye}from"./BFETMHTz.js";function We(y){const{itemCount:a,maxVisible:d,availableWidth:r,surface:s,overlap:b,overflowOverlap:v}=y;if(r<=0)return 0;const _=s-b,m=Math.min(a,Math.max(0,d)),I=i=>i===0?0:s+(i-1)*_;if(a<=m&&I(a)<=r)return a;for(let i=m;i>=0;i-=1){const A=a-i;if(I(i)+(A>0?y.measureOverflowText(A)-(i>0?v:0):0)<=r)return i}return 0}function Ie(y,a=r=>requestAnimationFrame(r),d=r=>cancelAnimationFrame(r)){let r,s;return{set(b){if(r=b,s!==void 0)return;let v=!1;const _=a(()=>{v=!0,s=void 0;const m=r;r=void 0,y(m)});v||(s=_)},cancel(){s!==void 0&&(d(s),s=void 0),r=void 0}}}const Ae=20,Ce=12;let O,J;const Q=new Map;var Te=F('<span data-agent-avatar-stack-item=""><!></span>'),Oe=F('<span class="agent-avatar-stack-track svelte-1nk9fhe"></span>'),Ve=F('<span class="agent-avatar-stack-overflow svelte-1nk9fhe" data-agent-avatar-overflow=""> </span>'),Me=F('<span data-agent-avatar-stack="" data-agent-avatar-stack-overlap="later-on-top"><!> <!></span>');function Se(y,a){if(new.target)return le({component:Se,...y});ve(a,!0);let d=u(a,"items",7),r=u(a,"maxVisible",7,3),s=u(a,"adaptive",7,!1),b=u(a,"align",7,"end"),v=u(a,"variant",7,"card-stack"),_=u(a,"interactive",7,!1),m=u(a,"overflowId",7),I=u(a,"overflowTestId",7),i=u(a,"itemContent",7),A=u(a,"class",7,""),W=P(void 0),z=P(void 0);const h=x(()=>ye[v()]),U=x(()=>s()&&e(z)!==void 0?We({itemCount:d().length,maxVisible:r(),availableWidth:e(z),surface:e(h).surface,overlap:e(h).overlap,overflowOverlap:e(h).overlap,measureOverflowText:t=>Math.max(e(h).surface,$(t)+Ce)}):void 0),Y=x(()=>Math.min(d().length,Math.max(0,s()?e(U)??r():r()))),k=x(()=>d().slice(0,e(Y))),E=x(()=>Math.max(0,d().length-e(k).length)),q=x(()=>e(h).surface-e(h).overlap),Z=x(()=>e(k).length===0?0:e(h).surface+(e(k).length-1)*e(q));function $(t){const n=`+${j(t)}`,o=Q.get(n);if(o!==void 0)return o;if(O===void 0&&(O=document.createElement("canvas").getContext("2d")),!O||!e(W))return Ae;J??=`500 12px ${getComputedStyle(e(W)).fontFamily}`,O.font=J;const l=O.measureText(n).width;return Q.set(n,l),l}fe(()=>{if(!s()||!e(W)||typeof ResizeObserver>"u")return;const t=Ie(o=>{K(z,o,!0)}),n=new ResizeObserver(o=>{const l=o[o.length-1];t.set(l.borderBoxSize?.[0]?.inlineSize??l.contentRect.width)});return n.observe(e(W)),()=>{n.disconnect(),t.cancel()}});var ee={get items(){return d()},set items(t){d(t),g()},get maxVisible(){return r()},set maxVisible(t=3){r(t),g()},get adaptive(){return s()},set adaptive(t=!1){s(t),g()},get align(){return b()},set align(t="end"){b(t),g()},get variant(){return v()},set variant(t="card-stack"){v(t),g()},get interactive(){return _()},set interactive(t=!1){_(t),g()},get overflowId(){return m()},set overflowId(t){m(t),g()},get overflowTestId(){return I()},set overflowTestId(t){I(t),g()},get itemContent(){return i()},set itemContent(t){i(t),g()},get class(){return A()},set class(t=""){A(t),g()},$set:ce,$on:(t,n)=>de(a,t,n)},p=Me();let N;var B=H(p);{var te=t=>{var n=Oe();let o;_e(n,23,()=>e(k),l=>l.key,(l,w,V)=>{var f=Te();let G;var re=H(f);{var se=C=>{var M=me(),oe=he(M);ke(oe,i,()=>e(w)),T(C,M)},ie=C=>{{let M=x(()=>e(w).state??"idle");xe(C,{get agentId(){return e(w).agentId},get specialist(){return e(w).specialist},get icon(){return e(w).icon},get state(){return e(M)},get variant(){return v()},class:"agent-avatar-stack-surface"})}};D(re,C=>{i()?C(se):C(ie,-1)})}L(f),S(()=>{G=X(f,1,"agent-avatar-stack-item svelte-1nk9fhe",null,G,{"agent-avatar-stack-item--before-overflow":e(E)>0&&e(V)===e(k).length-1}),R(f,`inset-inline-start: ${e(V)*e(q)}px; z-index: ${e(V)+1};`),c(f,"data-agent-avatar-stack-index",e(V)),c(f,"data-agent-avatar-stack-key",e(w).key),c(f,"data-agent-avatar-stack-agent-id",e(w).agentId),c(f,"data-agent-avatar-stack-specialist",e(w).specialist??void 0),c(f,"aria-hidden",_()?void 0:"true")}),T(l,f)}),L(n),S(()=>o=R(n,"",o,{width:`${e(Z)}px`})),T(t,n)};D(B,t=>{e(k).length>0&&t(te)})}var ae=ue(B,2);{var ne=t=>{var n=Ve(),o=pe(n);S(l=>{c(n,"id",m()),R(n,`margin-inline-start: ${e(k).length>0?-e(h).overlap:0}px; z-index: ${e(k).length+1};`),c(n,"data-testid",I()),be(o,`+${l??""}`)},[()=>j(e(E))]),T(t,n)};D(ae,t=>{e(E)>0&&t(ne)})}return L(p),we(p,t=>K(W,t),()=>e(W)),S(()=>{N=X(p,1,`agent-avatar-stack ${A()??""}`,"svelte-1nk9fhe",N,{"agent-avatar-stack--adaptive":s(),"agent-avatar-stack--start":b()==="start"}),c(p,"data-agent-avatar-stack-align",b()),c(p,"data-avatar-variant",v()),c(p,"data-agent-avatar-stack-clear-space",e(h).ring),c(p,"aria-hidden",!_()&&!m()?"true":void 0)}),T(y,p),ge(ee)}export{Se as A};
1
+ import{t as le,bq as u,a_ as D,by as ce,b as de}from"./BAqR9jtB.js";import{bs as ve,ca as fe,aD as e,a5 as H,bS as ue,bA as L,bH as K,b_ as S,W as T,bn as ge,bV as P,c9 as x,aA as g,a7 as me,ay as he,bl as pe,bO as be,aB as F}from"./DYhIMPy1.js";import{k as X,s as c,h as _e,l as R}from"./BPk16bSc.js";import{s as ke}from"./DiCMHWTR.js";import{b as we}from"./BaIAhI85.js";import{t as j}from"./Bl_iEh1f.js";import{A as xe}from"./A3beYjJS.js";import{y as ye}from"./B6Eksue8.js";function We(y){const{itemCount:a,maxVisible:d,availableWidth:r,surface:s,overlap:b,overflowOverlap:v}=y;if(r<=0)return 0;const _=s-b,m=Math.min(a,Math.max(0,d)),I=i=>i===0?0:s+(i-1)*_;if(a<=m&&I(a)<=r)return a;for(let i=m;i>=0;i-=1){const A=a-i;if(I(i)+(A>0?y.measureOverflowText(A)-(i>0?v:0):0)<=r)return i}return 0}function Ie(y,a=r=>requestAnimationFrame(r),d=r=>cancelAnimationFrame(r)){let r,s;return{set(b){if(r=b,s!==void 0)return;let v=!1;const _=a(()=>{v=!0,s=void 0;const m=r;r=void 0,y(m)});v||(s=_)},cancel(){s!==void 0&&(d(s),s=void 0),r=void 0}}}const Ae=20,Ce=12;let O,J;const Q=new Map;var Te=F('<span data-agent-avatar-stack-item=""><!></span>'),Oe=F('<span class="agent-avatar-stack-track svelte-1nk9fhe"></span>'),Ve=F('<span class="agent-avatar-stack-overflow svelte-1nk9fhe" data-agent-avatar-overflow=""> </span>'),Me=F('<span data-agent-avatar-stack="" data-agent-avatar-stack-overlap="later-on-top"><!> <!></span>');function Se(y,a){if(new.target)return le({component:Se,...y});ve(a,!0);let d=u(a,"items",7),r=u(a,"maxVisible",7,3),s=u(a,"adaptive",7,!1),b=u(a,"align",7,"end"),v=u(a,"variant",7,"card-stack"),_=u(a,"interactive",7,!1),m=u(a,"overflowId",7),I=u(a,"overflowTestId",7),i=u(a,"itemContent",7),A=u(a,"class",7,""),W=P(void 0),z=P(void 0);const h=x(()=>ye[v()]),U=x(()=>s()&&e(z)!==void 0?We({itemCount:d().length,maxVisible:r(),availableWidth:e(z),surface:e(h).surface,overlap:e(h).overlap,overflowOverlap:e(h).overlap,measureOverflowText:t=>Math.max(e(h).surface,$(t)+Ce)}):void 0),Y=x(()=>Math.min(d().length,Math.max(0,s()?e(U)??r():r()))),k=x(()=>d().slice(0,e(Y))),E=x(()=>Math.max(0,d().length-e(k).length)),q=x(()=>e(h).surface-e(h).overlap),Z=x(()=>e(k).length===0?0:e(h).surface+(e(k).length-1)*e(q));function $(t){const n=`+${j(t)}`,o=Q.get(n);if(o!==void 0)return o;if(O===void 0&&(O=document.createElement("canvas").getContext("2d")),!O||!e(W))return Ae;J??=`500 12px ${getComputedStyle(e(W)).fontFamily}`,O.font=J;const l=O.measureText(n).width;return Q.set(n,l),l}fe(()=>{if(!s()||!e(W)||typeof ResizeObserver>"u")return;const t=Ie(o=>{K(z,o,!0)}),n=new ResizeObserver(o=>{const l=o[o.length-1];t.set(l.borderBoxSize?.[0]?.inlineSize??l.contentRect.width)});return n.observe(e(W)),()=>{n.disconnect(),t.cancel()}});var ee={get items(){return d()},set items(t){d(t),g()},get maxVisible(){return r()},set maxVisible(t=3){r(t),g()},get adaptive(){return s()},set adaptive(t=!1){s(t),g()},get align(){return b()},set align(t="end"){b(t),g()},get variant(){return v()},set variant(t="card-stack"){v(t),g()},get interactive(){return _()},set interactive(t=!1){_(t),g()},get overflowId(){return m()},set overflowId(t){m(t),g()},get overflowTestId(){return I()},set overflowTestId(t){I(t),g()},get itemContent(){return i()},set itemContent(t){i(t),g()},get class(){return A()},set class(t=""){A(t),g()},$set:ce,$on:(t,n)=>de(a,t,n)},p=Me();let N;var B=H(p);{var te=t=>{var n=Oe();let o;_e(n,23,()=>e(k),l=>l.key,(l,w,V)=>{var f=Te();let G;var re=H(f);{var se=C=>{var M=me(),oe=he(M);ke(oe,i,()=>e(w)),T(C,M)},ie=C=>{{let M=x(()=>e(w).state??"idle");xe(C,{get agentId(){return e(w).agentId},get specialist(){return e(w).specialist},get icon(){return e(w).icon},get state(){return e(M)},get variant(){return v()},class:"agent-avatar-stack-surface"})}};D(re,C=>{i()?C(se):C(ie,-1)})}L(f),S(()=>{G=X(f,1,"agent-avatar-stack-item svelte-1nk9fhe",null,G,{"agent-avatar-stack-item--before-overflow":e(E)>0&&e(V)===e(k).length-1}),R(f,`inset-inline-start: ${e(V)*e(q)}px; z-index: ${e(V)+1};`),c(f,"data-agent-avatar-stack-index",e(V)),c(f,"data-agent-avatar-stack-key",e(w).key),c(f,"data-agent-avatar-stack-agent-id",e(w).agentId),c(f,"data-agent-avatar-stack-specialist",e(w).specialist??void 0),c(f,"aria-hidden",_()?void 0:"true")}),T(l,f)}),L(n),S(()=>o=R(n,"",o,{width:`${e(Z)}px`})),T(t,n)};D(B,t=>{e(k).length>0&&t(te)})}var ae=ue(B,2);{var ne=t=>{var n=Ve(),o=pe(n);S(l=>{c(n,"id",m()),R(n,`margin-inline-start: ${e(k).length>0?-e(h).overlap:0}px; z-index: ${e(k).length+1};`),c(n,"data-testid",I()),be(o,`+${l??""}`)},[()=>j(e(E))]),T(t,n)};D(ae,t=>{e(E)>0&&t(ne)})}return L(p),we(p,t=>K(W,t),()=>e(W)),S(()=>{N=X(p,1,`agent-avatar-stack ${A()??""}`,"svelte-1nk9fhe",N,{"agent-avatar-stack--adaptive":s(),"agent-avatar-stack--start":b()==="start"}),c(p,"data-agent-avatar-stack-align",b()),c(p,"data-avatar-variant",v()),c(p,"data-agent-avatar-stack-clear-space",e(h).ring),c(p,"aria-hidden",!_()&&!m()?"true":void 0)}),T(y,p),ge(ee)}export{Se as A};
@@ -1 +1 @@
1
- import{t as ht,bq as S,by as $t,bs as It,b as yt,bu as d}from"./BAqR9jtB.js";import{bs as bt,ca as k,aD as t,c9 as s,a7 as Ct,ay as Rt,W as kt,bn as wt,bH as q,bV as N,aA as U}from"./DYhIMPy1.js";import{E as At}from"./UuiGcpAE.js";import{b as Dt}from"./BaIAhI85.js";import{Hp as a,er as Et,es as Pt,ns as St,yn as Ut,nw as _t,nx as xt,HW as Ft,Ia as Ht,H$ as Tt,ua as Wt,ts as Lt}from"./BSwWMzab.js";import{aZ as qt}from"./Bops7MsY.js";import{g as Nt}from"./DfN8_dcw.js";import{dl as Ot,bL as vt,bA as Bt,bE as Kt,bC as Mt}from"./DY6JypjK.js";import{ah as Gt}from"./DFzMoFQx.js";import{C as Vt}from"./IB-HmS7d.js";import{V as jt}from"./CeQYwwry.js";import{bN as Jt,bK as Zt,b5 as zt}from"./BCDWZbwh.js";import{i as Qt}from"./H2jLkRRS.js";function Xt(_,f){if(new.target)return ht({component:Xt,..._});bt(f,!0);const O=()=>d(Y,"$gitRoots$",n),x=()=>d(X,"$workspace",n),v=()=>d(st,"$ftCommits$",n),B=()=>d(ot,"$ftOlderCommits$",n),b=()=>d(tt,"$commitRead$",n),K=()=>d(z,"$foldUnchanged",n),M=()=>d(Z,"$lineWrapping",n),G=()=>d(Q,"$diffSideBySide",n),V=()=>d(at,"$ftLoading$",n),[n,j]=It(),J=e=>{jt(e,{embedded:!0,showExpand:!0,get expanded(){return t(C)},onToggleExpand:()=>{q(C,!t(C)),t(C)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return K()},onToggleFold:()=>a.dispatch(Tt()),get wrapEnabled(){return M()},onToggleWrap:()=>a.dispatch(Ht()),get splitEnabled(){return G()},onToggleSplit:()=>a.dispatch(Ft())})},Z=Jt(),z=Zt(),Q=zt();let h=S(f,"tab",7),i=S(f,"workspaceId",7),$=S(f,"isActive",7);const F=Nt(),g=qt(()=>i()),X=Ot(g),Y=Gt(g),w=crypto.randomUUID(),tt=vt(g,w),c=s(()=>h().data?.commitHash||""),H=s(()=>h().data?.commitMessage||"");k(()=>{const e=i();if(!(!$()||!e||t(r)))return a.dispatch(Et(e,"history")),()=>a.dispatch(Pt(e,"history"))});const r=s(()=>h().data?.gitRootId||""),T=s(()=>t(r)&&O().find(e=>e.id===t(r))?.path||""),et=s(()=>t(T)||x()?.worktreePath||x()?.repositoryPath||""),st=Bt(g),ot=Kt(g),at=Mt(g),nt=s(()=>v()||[]),it=s(()=>B()||[]),p=s(()=>t(r)?void 0:t(nt).find(e=>e.hash===t(c))||t(it).find(e=>e.hash===t(c))),A=s(()=>t(p)?.files||[]),D=s(()=>b()?.request.kind==="commitDetails"&&b().request.commitHash===t(c)&&(b().request.gitRootId??"")===t(r)?b():void 0),l=s(()=>t(D)?.result?.kind==="commitDetails"?t(D).result.details:null),rt=s(()=>t(l)?t(l).fileDetails.length>0?t(l).fileDetails:t(l).files.map(e=>({path:e,additions:0,deletions:0})):[]),dt=s(()=>t(D)?.loading??!1);k(()=>{const e=t(c),o=i(),I=t(r);if(!e||!o||t(A).length>0)return;const u=crypto.randomUUID();return a.dispatch(St(o,w,u,{kind:"commitDetails",commitHash:e,gitRootId:I||void 0})),()=>a.dispatch(Ut(o,w,u))});const ct=s(()=>t(A).length>0?t(A):t(rt));let C=N(!0),R=N(null);const lt=s(()=>t(ct).map(e=>{const o=typeof e=="string"?e:e.path||"",I=typeof e=="string"?0:e.additions||0,u=typeof e=="string"?0:e.deletions||0;return{filePath:Qt(o)?o:`${t(et)}/${o}`,action:"modify",additions:I,deletions:u,toolName:"local",toolCallId:`commit-${t(c)}-${o}`,staged:!1,category:"committed",commitHash:t(c),commitMessage:t(H)}}));k(()=>{!F||!$()||F.registerActions({display:J})});const W=crypto.randomUUID();k(()=>{const e=i();if(!(!($()&&t(r))||!e))return a.dispatch(_t(e,W)),()=>a.dispatch(xt(e,W))});var mt={get tab(){return h()},set tab(e){h(e),U()},get workspaceId(){return i()},set workspaceId(e){i(e),U()},get isActive(){return $()},set isActive(e){$(e),U()},$set:$t,$on:(e,o)=>yt(f,e,o)},L=Ct(),gt=Rt(L);At(gt,()=>JSON.stringify([i(),t(r),t(c)]),e=>{{let o=s(()=>V()||t(dt)),I=s(()=>t(r)||void 0),u=s(()=>t(T)||void 0),ut=s(()=>({hash:t(c),message:t(H),author:t(p)?.author||t(l)?.author,authorEmail:t(p)?.authorEmail||t(l)?.authorEmail,date:t(p)?.date||t(l)?.date,agentId:t(p)?.agentId,linkedNoteId:t(p)?.linkedNoteId}));Dt(Vt(e,{get isLoading(){return t(o)},get changes(){return t(lt)},get gitRootId(){return t(I)},get gitRootPath(){return t(u)},get commitInfo(){return t(ut)},onOpenAgent:(y,m)=>{const E=m?.metaKey||m?.ctrlKey||!1,P=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Lt(i(),{agentId:y,openInAdjacentPanel:E,sourcePanelId:P}))},onOpenNote:(y,m)=>{const E=m?.metaKey||m?.ctrlKey||!1,P=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Wt(i(),y,{openInAdjacentPanel:E,sourcePanelId:P}))}}),y=>q(R,y,!0),()=>t(R))}}),kt(_,L);var pt=wt(mt);return j(),pt}export{Xt as default};
1
+ import{t as ht,bq as S,by as $t,bs as It,b as yt,bu as d}from"./BAqR9jtB.js";import{bs as bt,ca as k,aD as t,c9 as s,a7 as Ct,ay as Rt,W as kt,bn as wt,bH as q,bV as N,aA as U}from"./DYhIMPy1.js";import{E as At}from"./UuiGcpAE.js";import{b as Dt}from"./BaIAhI85.js";import{Hp as a,er as Et,es as Pt,ns as St,yn as Ut,nw as _t,nx as xt,HW as Ft,Ia as Ht,H$ as Tt,ua as Wt,ts as Lt}from"./BSwWMzab.js";import{aZ as qt}from"./A3beYjJS.js";import{g as Nt}from"./DfN8_dcw.js";import{dl as Ot,bL as vt,bA as Bt,bE as Kt,bC as Mt}from"./DY6JypjK.js";import{ah as Gt}from"./sg8Cer3T.js";import{C as Vt}from"./ZUZF8K3P.js";import{V as jt}from"./CeQYwwry.js";import{bN as Jt,bK as Zt,b5 as zt}from"./CzrG_lpv.js";import{i as Qt}from"./H2jLkRRS.js";function Xt(_,f){if(new.target)return ht({component:Xt,..._});bt(f,!0);const O=()=>d(Y,"$gitRoots$",n),x=()=>d(X,"$workspace",n),v=()=>d(st,"$ftCommits$",n),B=()=>d(ot,"$ftOlderCommits$",n),b=()=>d(tt,"$commitRead$",n),K=()=>d(z,"$foldUnchanged",n),M=()=>d(Z,"$lineWrapping",n),G=()=>d(Q,"$diffSideBySide",n),V=()=>d(at,"$ftLoading$",n),[n,j]=It(),J=e=>{jt(e,{embedded:!0,showExpand:!0,get expanded(){return t(C)},onToggleExpand:()=>{q(C,!t(C)),t(C)?t(R)?.expandAll():t(R)?.collapseAll()},get foldEnabled(){return K()},onToggleFold:()=>a.dispatch(Tt()),get wrapEnabled(){return M()},onToggleWrap:()=>a.dispatch(Ht()),get splitEnabled(){return G()},onToggleSplit:()=>a.dispatch(Ft())})},Z=Jt(),z=Zt(),Q=zt();let h=S(f,"tab",7),i=S(f,"workspaceId",7),$=S(f,"isActive",7);const F=Nt(),g=qt(()=>i()),X=Ot(g),Y=Gt(g),w=crypto.randomUUID(),tt=vt(g,w),c=s(()=>h().data?.commitHash||""),H=s(()=>h().data?.commitMessage||"");k(()=>{const e=i();if(!(!$()||!e||t(r)))return a.dispatch(Et(e,"history")),()=>a.dispatch(Pt(e,"history"))});const r=s(()=>h().data?.gitRootId||""),T=s(()=>t(r)&&O().find(e=>e.id===t(r))?.path||""),et=s(()=>t(T)||x()?.worktreePath||x()?.repositoryPath||""),st=Bt(g),ot=Kt(g),at=Mt(g),nt=s(()=>v()||[]),it=s(()=>B()||[]),p=s(()=>t(r)?void 0:t(nt).find(e=>e.hash===t(c))||t(it).find(e=>e.hash===t(c))),A=s(()=>t(p)?.files||[]),D=s(()=>b()?.request.kind==="commitDetails"&&b().request.commitHash===t(c)&&(b().request.gitRootId??"")===t(r)?b():void 0),l=s(()=>t(D)?.result?.kind==="commitDetails"?t(D).result.details:null),rt=s(()=>t(l)?t(l).fileDetails.length>0?t(l).fileDetails:t(l).files.map(e=>({path:e,additions:0,deletions:0})):[]),dt=s(()=>t(D)?.loading??!1);k(()=>{const e=t(c),o=i(),I=t(r);if(!e||!o||t(A).length>0)return;const u=crypto.randomUUID();return a.dispatch(St(o,w,u,{kind:"commitDetails",commitHash:e,gitRootId:I||void 0})),()=>a.dispatch(Ut(o,w,u))});const ct=s(()=>t(A).length>0?t(A):t(rt));let C=N(!0),R=N(null);const lt=s(()=>t(ct).map(e=>{const o=typeof e=="string"?e:e.path||"",I=typeof e=="string"?0:e.additions||0,u=typeof e=="string"?0:e.deletions||0;return{filePath:Qt(o)?o:`${t(et)}/${o}`,action:"modify",additions:I,deletions:u,toolName:"local",toolCallId:`commit-${t(c)}-${o}`,staged:!1,category:"committed",commitHash:t(c),commitMessage:t(H)}}));k(()=>{!F||!$()||F.registerActions({display:J})});const W=crypto.randomUUID();k(()=>{const e=i();if(!(!($()&&t(r))||!e))return a.dispatch(_t(e,W)),()=>a.dispatch(xt(e,W))});var mt={get tab(){return h()},set tab(e){h(e),U()},get workspaceId(){return i()},set workspaceId(e){i(e),U()},get isActive(){return $()},set isActive(e){$(e),U()},$set:$t,$on:(e,o)=>yt(f,e,o)},L=Ct(),gt=Rt(L);At(gt,()=>JSON.stringify([i(),t(r),t(c)]),e=>{{let o=s(()=>V()||t(dt)),I=s(()=>t(r)||void 0),u=s(()=>t(T)||void 0),ut=s(()=>({hash:t(c),message:t(H),author:t(p)?.author||t(l)?.author,authorEmail:t(p)?.authorEmail||t(l)?.authorEmail,date:t(p)?.date||t(l)?.date,agentId:t(p)?.agentId,linkedNoteId:t(p)?.linkedNoteId}));Dt(Vt(e,{get isLoading(){return t(o)},get changes(){return t(lt)},get gitRootId(){return t(I)},get gitRootPath(){return t(u)},get commitInfo(){return t(ut)},onOpenAgent:(y,m)=>{const E=m?.metaKey||m?.ctrlKey||!1,P=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Lt(i(),{agentId:y,openInAdjacentPanel:E,sourcePanelId:P}))},onOpenNote:(y,m)=>{const E=m?.metaKey||m?.ctrlKey||!1,P=m?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;a.dispatch(Wt(i(),y,{openInAdjacentPanel:E,sourcePanelId:P}))}}),y=>q(R,y,!0),()=>t(R))}}),kt(_,L);var pt=wt(mt);return j(),pt}export{Xt as default};
@@ -1 +1 @@
1
- import{g as o,r as l,d as t}from"./B1Rrvp0b.js";import{p as m}from"./CM7ZaQP_.js";import{b as n,ay as s}from"./Bpy6Muvw.js";import{M as p,d as u}from"./BxiJOwnz.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),y=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),g={parse:n(e=>{t.clear(),s.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const i=r.value;s.debug("[Railroad Parser] Parsed rules:",i.rules.length),y(i),s.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},h={parser:g,db:t,renderer:l,styles:o};export{h as diagram};
1
+ import{g as o,r as l,d as t}from"./CBTot2K1.js";import{p as m}from"./CE8vXfAM.js";import{b as n,ay as s}from"./q4Mp6azq.js";import{M as p,d as u}from"./BxiJOwnz.js";var d=u().Railroad.parser.LangiumParser,a=n(e=>{switch(e.$type){case"RailroadTerminalExpr":return{type:"terminal",value:e.value};case"RailroadNonTerminalExpr":return{type:"nonterminal",name:e.name};case"RailroadSpecialExpr":return{type:"special",text:e.text};case"RailroadSequenceExpr":{const r=e.elements.map(a);return r.length===1?r[0]:{type:"sequence",elements:r}}case"RailroadChoiceExpr":{const r=e.alternatives.map(a);return r.length===1?r[0]:{type:"choice",alternatives:r}}case"RailroadOptionalExpr":return{type:"optional",element:a(e.element)};case"RailroadOneOrMoreExpr":return{type:"repetition",element:a(e.element),min:1,max:1/0};case"RailroadZeroOrMoreExpr":return{type:"repetition",element:a(e.element),min:0,max:1/0};default:throw new Error(`Unsupported railroad expression: ${e.$type}`)}},"transformExpression"),c=n(e=>({name:e.name,definition:a(e.definition)}),"transformRule"),y=n(e=>{m(e,t),e.title&&t.setTitle(e.title),e.rules.map(r=>t.addRule(c(r)))},"populateDb"),g={parse:n(e=>{t.clear(),s.debug("[Railroad Parser] Starting Langium parse");const r=d.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new p(r);const i=r.value;s.debug("[Railroad Parser] Parsed rules:",i.rules.length),y(i),s.debug("[Railroad Parser] Parse complete")},"parse"),parser:{yy:t}},h={parser:g,db:t,renderer:l,styles:o};export{h as diagram};
@@ -1,5 +1,5 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BFETMHTz.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/Cop9b2dY.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/XzWc0fs1.js","/app/immutable/chunks/BRNfUSNR.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DO2cS8JO.js","/app/immutable/chunks/7IyNIHph.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DH9gMPGd.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/assets/observe-overflow.CJJmE3_P.css","/app/immutable/chunks/-URcs0EB.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/C5Nz-crT.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/BgyuoEGq.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BMkc6ng0.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/BiMGZT5w.js","/app/immutable/chunks/BHqHNrOT.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/B-rSL5ZP.js","/app/immutable/chunks/C2L4VLjE.js","/app/immutable/chunks/B_ifqSee.js","/app/immutable/chunks/DeBw56y4.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/B7-651e2.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css"])))=>i.map(i=>d[i]);
2
- import{bo as v,t as Ht,bq as _,a_ as D,by as jt,b as Wt,br as Lf,bu as Mt,bs as oa,bt as ci,b7 as tl,ba as Mf,bl as Nf,bb as Of,bm as Df,a$ as Bf,b9 as Ff,b8 as zf,b2 as Hf,bf as jf,bg as Wf,bk as Uf,be as qf,bn as Vf,b0 as Kf,b4 as Gf,bi as Jf,bh as Yf,b6 as Xf,b5 as Zf,b3 as Qf,bd as $f,bc as ep,bj as tp,b1 as rp,_ as np}from"./BAqR9jtB.js";import{bI as ap,bj as hs,aG as sp,bs as Ut,aD as e,a5 as I,bS as m,bA as w,W as d,bn as qt,c9 as u,aA as x,a7 as wt,ay as Ue,be as ar,b$ as At,aC as ha,bl as L,b_ as k,bO as y,aB as S,bo as bs,ca as kt,bH as M,bV as _e,br as qr,bk as ys,c0 as Jn,ai as Pa,cd as is,aw as Cn,a as op,aj as Rr,c7 as ip,c6 as rl,c5 as Nn,bf as Bs,bz as qc}from"./DYhIMPy1.js";import{E as Fs,I as lp,x as cp}from"./UuiGcpAE.js";import{c as dp,s as ae,a as On,l as Pn,f as En,d as ur,k as mt,I as _s,h as Pt,i as Tr,o as up,j as fp,g as pp,m as gp}from"./BPk16bSc.js";import{s as fn}from"./DiCMHWTR.js";import{c as Zr}from"./B2RRuLl5.js";import{H as Bo,t as lr,n as vp,i as nl,u as al}from"./Bl_iEh1f.js";import{b as gr}from"./BaIAhI85.js";import{h as Vc,bt as mp,cI as hp,dB as bp,dm as yp,aw as _p,cs as xp,a1 as wp,cO as kp,dl as ls,aB as Xs,c1 as Sp,H as Ip,c as Cp,$ as sl,cU as Ep,bR as Pp,L as Ap,di as Tp,V as Rp,ds as Lp,ae as Mp,as as Np,f as Op,t as Dp}from"./DY6JypjK.js";import{c as Bp}from"./D-62MVd3.js";import{n as Qn,w as Fp,C as Kc,M as zp,R as Hp}from"./Bc-8qHYh.js";import{f as yt,ap as Ua,ai as jp,am as Fo,bc as Wp}from"./C9gP-gRX.js";import{am as Up,aa as ol,_ as qp,az as Vp,ab as Kp,i as Gp,aR as Jp,I as Yp,R as Xp,ar as Zp,af as Qp,$ as $p,b as il,as as eg,s as tg,o as rg,aX as ng,n as ag,aZ as zo,A as ll,ae as sg,aY as og,ao as Gc,T as Jc,a6 as ig,a5 as cl,L as dl}from"./Bops7MsY.js";import{c$ as lg,F as Tt,bh as Ho,bL as cg,ap as dg,aQ as ug,cL as fg,bl as di,bB as pg,aG as Yc,aL as ui,c_ as zs,ac as jo,cn as gg,cd as vg,ci as fi,cF as Xc,bs as mg,e as hg,b$ as ul,c9 as bg,cl as yg,cW as Zc,bV as fl,b8 as ho,be as ns,aF as _g,aA as Wo,av as Qc,bc as $c,bC as xg,B as wg,bv as kg,a7 as ed,ch as Sg,am as td,cN as rd,cJ as pl,at as nd,aK as gl,a1 as Ig,cv as Cg,cU as Eg,bO as ad,bn as Pg,c5 as vl,ao as sd,az as Ag,aa as Tg,a8 as Rg}from"./DKXEy5Lq.js";import{c as od}from"./ChTqQfQN.js";import{h as Lg}from"./7ZJvg7ev.js";import{Hp as Nt,bP as Mg,re as ml,rQ as Ng,Ic as Og,Ii as Dg,g as id,Hb as Bg,n3 as ld,nj as cd,ni as dd,mY as Zs,pz as pi,x4 as Fg,u8 as Rs,ts as Uo,ua as zg,mM as ud,Hu as Hg,sm as jg,o7 as fd,qD as gi,lt as hl,a6 as bl,qa as Wg,q6 as Ug,qb as qg,q2 as Vg,q8 as Kg,t_ as Gg,zC as pd,zG as gd,nk as yl,bi as qo,FW as Jg,H7 as Yg,ne as Xg,vb as Zg,vc as Qg,va as _l,AD as Kn,cu as $g,ci as ev,d4 as tv,db as rv,zM as nv}from"./BSwWMzab.js";import{bv as av,bD as sv,i as ov,w as iv,bG as lv,a5 as cv,a7 as dv,a9 as uv}from"./-URcs0EB.js";import{m as fv,l as pv,t as Vo,c8 as gv,K as vv,c7 as mv,c2 as hv,aA as xl,c4 as bv,bE as Ko,aK as yv,r as _v,bo as xv,w as wv}from"./BiMGZT5w.js";import{cd as kv,cf as Sv,ce as Iv,b0 as Cv,a_ as Ev,a$ as Pv,a3 as Av,ak as Cs,aj as Tv,az as wl,aH as Rv,ai as Lv,C as Mv,i as Nv,E as Ls,cO as Ov,aV as kl,cT as Dv,af as Bv,a7 as Fv,r as zv,p as Hv,aE as jv,cW as Wv,cF as Uv,cy as qv,cp as Vv,bO as Kv}from"./BCDWZbwh.js";import{s as Gv,j as Jv,i as Yv,I as Va,c as Sl}from"./XzWc0fs1.js";import"./BRNfUSNR.js";import{k as vd,f as Il,K as Cl,M as Xv,r as Zv,q as Qv,N as md,J as Go,e as cs,a0 as El,i as $v}from"./BFETMHTz.js";import"./DH9gMPGd.js";import{J as vi,P as em,s as tm,k as rm,G as nm,o as am,l as sm,M as om,H as im,w as ja,a as lm,K as cm,n as dm,R as um}from"./DO2cS8JO.js";import{t as ds,n as fm,O as pm,M as gm,S as va}from"./7IyNIHph.js";import{C as Jo}from"./BGGxKX5q.js";import{aQ as vm,aY as mm,aB as hm,b0 as bm,aO as ym,aU as _m,a7 as Ga,b3 as Pl,aK as xm,aR as wm,aX as mi,aS as hi,W as bo,aq as km,X as Sm,a_ as Im,aJ as Cm,aT as Em,aW as Pm,b6 as Am,b4 as Tm,ay as hd,p as Rm,n as Lm,aV as Mm,_ as Nm,ao as Om,aD as Dm,z as Bm,aC as Fm,a8 as zm}from"./i92hRJko.js";import{s as Yo}from"./CAK2j9T_.js";import{M as Hm}from"./AGSVFpXc.js";import{u as bi,w as jm,v as Qs,I as Wm,A as Al,e as us,d as ma,J as Tl,c as Um,f as qm,g as Rl,i as Vm,b as Km,o as bd,j as Gm,O as Jm,x as Ym,k as yd,S as Xm,N as Zm,q as Ll,p as Qm,n as Ml,z as $m,s as eh}from"./DEfnfMIS.js";import{o as Nl,a as Ol,T as yo,b as th}from"./C58wlt4Q.js";import{ag as rh,a6 as nh,M as ah,J as sh,aj as oh}from"./C8_w7W1W.js";import{D as fs}from"./DuRHazc8.js";import"./3V4Tx4nH.js";import{C as $n}from"./BNHRvqeQ.js";import{M as ih}from"./Bpy6Muvw.js";import{g as yi}from"./Cop9b2dY.js";import{f as Dl}from"./C2L4VLjE.js";import{c as Ms}from"./CZI4_vlI.js";import{handleIntentLink as lh}from"./DiVHUgRZ.js";import{s as ch,a as dh,f as uh,d as fh,r as ph,h as gh,w as as,g as vh,W as mh,H as hh,c as bh,M as _d}from"./DqTygHNa.js";import{e as yh,q as _h}from"./C0VJEx2v.js";import{showAssistantContent as xh}from"./C5EEwI0-.js";import{o as Hs,c as wh,n as kh}from"./B7-651e2.js";import{p as Sh}from"./C4XQStEU.js";import{m as Ih}from"./7k5ozo9c.js";import{h as Es}from"./BDGDJyji.js";import{i as xd}from"./BHqHNrOT.js";import{g as Ch,e as Eh,f as Ph,h as Ah}from"./BvFAWM27.js";import{T as _o}from"./BDXCy3lH.js";import{i as Th,r as Bl}from"./DfTvRpFp.js";import{a as Rh}from"./BMkc6ng0.js";import{a as Lh}from"./BJzHxIyr.js";import{p as Mh}from"./BwK5Bace.js";const Nh="intent:inline-visual-draft";function xI(r,t){const n=t.title.replace(/\s+/g," ").trim(),a=JSON.stringify({inputs:t.inputs,results:t.results},null,2),s=(a.match(/`+/g)??[]).reduce((c,l)=>Math.max(c,l.length),0),o="`".repeat(Math.max(3,s+1));return`${r}${r?`
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/B6Eksue8.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/Cop9b2dY.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/XzWc0fs1.js","/app/immutable/chunks/BRNfUSNR.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/DO2cS8JO.js","/app/immutable/chunks/7IyNIHph.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DH9gMPGd.js","/app/immutable/assets/dialog.BtQTVchw.css","/app/immutable/assets/observe-overflow.CJJmE3_P.css","/app/immutable/chunks/-URcs0EB.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/assets/pending-agent-deletions.UE5obH5A.css","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/chunks/BeP4UORy.js","/app/immutable/chunks/C5Nz-crT.js","/app/immutable/assets/SettingsPage.D8u26cHZ.css","/app/immutable/chunks/BgyuoEGq.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/BMkc6ng0.js","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/C80u9j_3.js","/app/immutable/chunks/BHqHNrOT.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/D2uybU7F.js","/app/immutable/chunks/BOQCK4ni.js","/app/immutable/chunks/BW6fyv0T.js","/app/immutable/chunks/CJtH5G9P.js","/app/immutable/chunks/B0Z-1lwJ.js","/app/immutable/chunks/CxO_9nE4.js","/app/immutable/assets/directory-picker-service.CzNEA6Ot.css"])))=>i.map(i=>d[i]);
2
+ import{bo as v,t as Ht,bq as _,a_ as D,by as jt,b as Wt,br as Lf,bu as Mt,bs as oa,bt as ci,b7 as tl,ba as Mf,bl as Nf,bb as Of,bm as Df,a$ as Bf,b9 as Ff,b8 as zf,b2 as Hf,bf as jf,bg as Wf,bk as Uf,be as qf,bn as Vf,b0 as Kf,b4 as Gf,bi as Jf,bh as Yf,b6 as Xf,b5 as Zf,b3 as Qf,bd as $f,bc as ep,bj as tp,b1 as rp,_ as np}from"./BAqR9jtB.js";import{bI as ap,bj as hs,aG as sp,bs as Ut,aD as e,a5 as I,bS as m,bA as w,W as d,bn as qt,c9 as u,aA as x,a7 as wt,ay as Ue,be as ar,b$ as At,aC as ha,bl as L,b_ as k,bO as y,aB as S,bo as bs,ca as kt,bH as M,bV as _e,br as qr,bk as ys,c0 as Jn,ai as Pa,cd as is,aw as Cn,a as op,aj as Rr,c7 as ip,c6 as rl,c5 as Nn,bf as Bs,bz as qc}from"./DYhIMPy1.js";import{E as Fs,I as lp,x as cp}from"./UuiGcpAE.js";import{c as dp,s as ae,a as On,l as Pn,f as En,d as ur,k as mt,I as _s,h as Pt,i as Tr,o as up,j as fp,g as pp,m as gp}from"./BPk16bSc.js";import{s as fn}from"./DiCMHWTR.js";import{c as Zr}from"./B2RRuLl5.js";import{H as Bo,t as lr,n as vp,i as nl,u as al}from"./Bl_iEh1f.js";import{b as gr}from"./BaIAhI85.js";import{h as Vc,bt as mp,cI as hp,dB as bp,dm as yp,aw as _p,cs as xp,a1 as wp,cO as kp,dl as ls,aB as Xs,c1 as Sp,H as Ip,c as Cp,$ as sl,cU as Ep,bR as Pp,L as Ap,di as Tp,V as Rp,ds as Lp,ae as Mp,as as Np,f as Op,t as Dp}from"./DY6JypjK.js";import{c as Bp}from"./D-62MVd3.js";import{n as Qn,w as Fp,C as Kc,M as zp,R as Hp}from"./Bc-8qHYh.js";import{f as yt,ap as Ua,ai as jp,am as Fo,bc as Wp}from"./C9gP-gRX.js";import{am as Up,aa as ol,_ as qp,az as Vp,ab as Kp,i as Gp,aR as Jp,I as Yp,R as Xp,ar as Zp,af as Qp,$ as $p,b as il,as as eg,s as tg,o as rg,aX as ng,n as ag,aZ as zo,A as ll,ae as sg,aY as og,ao as Gc,T as Jc,a6 as ig,a5 as cl,L as dl}from"./A3beYjJS.js";import{c$ as lg,F as Tt,bh as Ho,bL as cg,ap as dg,aQ as ug,cL as fg,bl as di,bB as pg,aG as Yc,aL as ui,c_ as zs,ac as jo,cn as gg,cd as vg,ci as fi,cF as Xc,bs as mg,e as hg,b$ as ul,c9 as bg,cl as yg,cW as Zc,bV as fl,b8 as ho,be as ns,aF as _g,aA as Wo,av as Qc,bc as $c,bC as xg,B as wg,bv as kg,a7 as ed,ch as Sg,am as td,cN as rd,cJ as pl,at as nd,aK as gl,a1 as Ig,cv as Cg,cU as Eg,bO as ad,bn as Pg,c5 as vl,ao as sd,az as Ag,aa as Tg,a8 as Rg}from"./DKXEy5Lq.js";import{c as od}from"./ChTqQfQN.js";import{h as Lg}from"./7ZJvg7ev.js";import{Hp as Nt,bP as Mg,re as ml,rQ as Ng,Ic as Og,Ii as Dg,g as id,Hb as Bg,n3 as ld,nj as cd,ni as dd,mY as Zs,pz as pi,x4 as Fg,u8 as Rs,ts as Uo,ua as zg,mM as ud,Hu as Hg,sm as jg,o7 as fd,qD as gi,lt as hl,a6 as bl,qa as Wg,q6 as Ug,qb as qg,q2 as Vg,q8 as Kg,t_ as Gg,zC as pd,zG as gd,nk as yl,bi as qo,FW as Jg,H7 as Yg,ne as Xg,vb as Zg,vc as Qg,va as _l,AD as Kn,cu as $g,ci as ev,d4 as tv,db as rv,zM as nv}from"./BSwWMzab.js";import{bv as av,bD as sv,i as ov,w as iv,bG as lv,a5 as cv,a7 as dv,a9 as uv}from"./-URcs0EB.js";import{m as fv,l as pv,t as Vo,c8 as gv,K as vv,c7 as mv,c2 as hv,aA as xl,c4 as bv,bE as Ko,aK as yv,r as _v,bo as xv,w as wv}from"./C80u9j_3.js";import{cd as kv,cf as Sv,ce as Iv,b0 as Cv,a_ as Ev,a$ as Pv,a3 as Av,ak as Cs,aj as Tv,az as wl,aH as Rv,ai as Lv,C as Mv,i as Nv,E as Ls,cO as Ov,aV as kl,cT as Dv,af as Bv,a7 as Fv,r as zv,p as Hv,aE as jv,cW as Wv,cF as Uv,cy as qv,cp as Vv,bO as Kv}from"./CzrG_lpv.js";import{s as Gv,j as Jv,i as Yv,I as Va,c as Sl}from"./XzWc0fs1.js";import"./BRNfUSNR.js";import{k as vd,f as Il,K as Cl,M as Xv,r as Zv,q as Qv,N as md,J as Go,e as cs,a0 as El,i as $v}from"./B6Eksue8.js";import"./DH9gMPGd.js";import{J as vi,P as em,s as tm,k as rm,G as nm,o as am,l as sm,M as om,H as im,w as ja,a as lm,K as cm,n as dm,R as um}from"./DO2cS8JO.js";import{t as ds,n as fm,O as pm,M as gm,S as va}from"./7IyNIHph.js";import{C as Jo}from"./BGGxKX5q.js";import{aQ as vm,aY as mm,aB as hm,b0 as bm,aO as ym,aU as _m,a7 as Ga,b3 as Pl,aK as xm,aR as wm,aX as mi,aS as hi,W as bo,aq as km,X as Sm,a_ as Im,aJ as Cm,aT as Em,aW as Pm,b6 as Am,b4 as Tm,ay as hd,p as Rm,n as Lm,aV as Mm,_ as Nm,ao as Om,aD as Dm,z as Bm,aC as Fm,a8 as zm}from"./CCCBFmfe.js";import{s as Yo}from"./C6XSZJri.js";import{M as Hm}from"./AGSVFpXc.js";import{u as bi,w as jm,v as Qs,I as Wm,A as Al,e as us,d as ma,J as Tl,c as Um,f as qm,g as Rl,i as Vm,b as Km,o as bd,j as Gm,O as Jm,x as Ym,k as yd,S as Xm,N as Zm,q as Ll,p as Qm,n as Ml,z as $m,s as eh}from"./C_KYY7ZK.js";import{o as Nl,a as Ol,T as yo,b as th}from"./LSDVwgG8.js";import{ag as rh,a6 as nh,M as ah,J as sh,aj as oh}from"./C8_w7W1W.js";import{D as fs}from"./C-fnz5X4.js";import"./3V4Tx4nH.js";import{C as $n}from"./6rzwTXJx.js";import{M as ih}from"./q4Mp6azq.js";import{g as yi}from"./Cop9b2dY.js";import{f as Dl}from"./BOQCK4ni.js";import{c as Ms}from"./CZI4_vlI.js";import{handleIntentLink as lh}from"./Cbh1BCiS.js";import{s as ch,a as dh,f as uh,d as fh,r as ph,h as gh,w as as,g as vh,W as mh,H as hh,c as bh,M as _d}from"./DkI_jPOw.js";import{e as yh,q as _h}from"./C0VJEx2v.js";import{showAssistantContent as xh}from"./BIZcuYRW.js";import{o as Hs,c as wh,n as kh}from"./CxO_9nE4.js";import{p as Sh}from"./DPG0D59v.js";import{m as Ih}from"./7k5ozo9c.js";import{h as Es}from"./BDGDJyji.js";import{i as xd}from"./BHqHNrOT.js";import{g as Ch,e as Eh,f as Ph,h as Ah}from"./BvFAWM27.js";import{T as _o}from"./BDXCy3lH.js";import{i as Th,r as Bl}from"./Dvil1FCS.js";import{a as Rh}from"./BMkc6ng0.js";import{a as Lh}from"./BJzHxIyr.js";import{p as Mh}from"./CA7UZgrf.js";const Nh="intent:inline-visual-draft";function xI(r,t){const n=t.title.replace(/\s+/g," ").trim(),a=JSON.stringify({inputs:t.inputs,results:t.results},null,2),s=(a.match(/`+/g)??[]).reduce((c,l)=>Math.max(c,l.length),0),o="`".repeat(Math.max(3,s+1));return`${r}${r?`
3
3
 
4
4
  `:""}${n}
5
5
 
@@ -260,7 +260,7 @@ ${r.content}`:a.content=r.content,a):r.old_text!==void 0&&r.new_text!==void 0?(a
260
260
  `,q1=["background","foreground","card","card-foreground","primary","primary-ink","primary-foreground","secondary","secondary-foreground","muted","muted-foreground","border","input","ring","danger","danger-background","info","info-foreground","success","success-foreground","warning","warning-foreground","font-ui","font-code","text-body-size","text-body-line-height","text-body-weight","text-body-tracking","radius-small","radius-medium","radius-large","app-background","sidebar","sidebar-accent","agent-avatar-surface-active","agent-avatar-foreground","diagram-host-surface","diagram-canvas","diagram-label-surface","diagram-node-surface","diagram-node-hover-surface","diagram-node-outline","diagram-node-title","diagram-metadata","diagram-group-outline","diagram-connector","diagram-connector-hover","diagram-connector-muted","diagram-connector-inactive","diagram-connector-danger","diagram-connector-success","diagram-connector-warning","diagram-connector-active","diagram-accent","diagram-accent-foreground","diagram-node-radius","diagram-group-radius","diagram-connector-width","text-caption-size","text-caption-line-height","text-caption-weight","text-caption-tracking","text-body-strong-size","text-body-strong-line-height","text-body-strong-weight","text-body-strong-tracking","space-1","space-2","space-3","space-4","space-5","space-6","space-7","control-height-compact","control-height-small","control-height-medium","control-height-large","radius-full","spring-fast","spring-fast-exit","spring-fast-ease","spring-moderate","spring-moderate-exit","spring-moderate-ease","spring-slow","spring-slow-exit","spring-slow-ease","spring-exit-ease","motion-fast","motion-standard","motion-slow","ease-standard","ease-emphasized-out","motion-reduced"],Mo=96,Cc=2e4,V1=480,Pu=512,K1=["default-src 'none'","script-src 'unsafe-inline'","style-src 'unsafe-inline'","img-src data:","connect-src 'none'","font-src data:","media-src 'none'","object-src 'none'","frame-src 'none'","child-src 'none'","worker-src 'none'","manifest-src 'none'","base-uri 'none'","form-action 'none'"].join("; ");function G1(r,t,n,a,s,o){const c=new MessageChannel,l=MessagePort.prototype.postMessage.bind(c.port1);window.parent.postMessage({channel:r,type:"scroll-port"},"*",[c.port2]);const f=(C,z={})=>{window.parent.postMessage({channel:r,type:C,...z},"*")};let i=s?.state??null,p=null,g=!1;Object.defineProperty(window,"intentVisual",{configurable:!1,writable:!1,value:Object.freeze({get state(){return i},publish(C){try{if(!o(C))return!1;const z=JSON.parse(JSON.stringify(C));return i=z.state,p=z,g||(g=!0,requestAnimationFrame(()=>{g=!1,p&&f("snapshot",{snapshot:p}),p=null})),!0}catch{return!1}}})});let R=!1,b=-1,h=innerHeight,P=Number.NaN,T=0,B=0;const F=()=>{if(R=!1,!document.body)return;let C=Math.ceil(Math.max(document.body.scrollHeight,document.body.getBoundingClientRect().height));const z=innerHeight,J=C-z;if(z>h+1&&J>1&&Math.abs(J-P)<=1?T+=1:(z!==h||J<=1)&&(T=0),h=z,P=J,!B&&T>=3){B=Math.max(a,z);const Y="Page height follows the frame (vh units or height: 100%); frame height held.";console.warn(Y),f("layout",{message:Y})}B&&(C=Math.min(C,B)),C!==b&&(b=C,f("resize",{height:C}))},O=()=>{R||(R=!0,requestAnimationFrame(F))},N=C=>{if(!C||typeof C.dark!="boolean"||!C.variables)return;const z=document.documentElement;z.classList.toggle("dark",C.dark),z.style.colorScheme=C.dark?"dark":"light";const J=C.variables["--inline-html-root-font-size"];"--inline-html-root-font-size"in t.variables&&typeof J=="string"&&J.length<512&&z.style.setProperty("--inline-html-root-font-size",J);for(const Y of Object.keys(t.variables)){if(Y==="--inline-html-root-font-size")continue;const re=C.variables[Y];typeof re=="string"&&re.length<512&&z.style.setProperty(Y,re)}O()};window.addEventListener("message",C=>{C.source!==window.parent||!C.data||C.data.channel!==r||C.data.type==="theme"&&N(C.data.theme)});const W=C=>{if(C.defaultPrevented||!C.isTrusted||C.ctrlKey||C.metaKey||C.shiftKey||!C.deltaY||Math.abs(C.deltaX)>Math.abs(C.deltaY))return;const z=re=>{const xe=getComputedStyle(re);if(re!==document.scrollingElement&&!/^(auto|scroll|overlay)$/.test(xe.overflowY)||/^(hidden|clip)$/.test(xe.overflowY))return!1;const ie=re.scrollHeight-re.clientHeight;return ie>1&&(C.deltaY<0?re.scrollTop>1:re.scrollTop<ie-1)};if(C.composedPath().some(re=>re instanceof Element&&z(re))||document.scrollingElement&&z(document.scrollingElement))return;const J=C.deltaMode===WheelEvent.DOM_DELTA_LINE?parseFloat(getComputedStyle(document.body).lineHeight)||16:C.deltaMode===WheelEvent.DOM_DELTA_PAGE?innerHeight:1,Y=Math.max(-n,Math.min(n,C.deltaY*J));Number.isFinite(Y)&&(C.preventDefault(),l({deltaY:Y}))};window.addEventListener("wheel",()=>{window.removeEventListener("wheel",W),window.addEventListener("wheel",W,{passive:!1})},{capture:!0,passive:!1}),window.addEventListener("error",C=>{C.message&&f("error",{message:C.message.slice(0,300)})}),window.addEventListener("unhandledrejection",C=>{const z=C.reason;f("error",{message:String(z instanceof Error?z.message:z).slice(0,300)})}),window.addEventListener("click",C=>{const z=C.target instanceof Element?C.target.closest("a, area"):null;if(!z)return;(z.getAttribute("href")??z.getAttribute("xlink:href"))?.startsWith("#")||C.preventDefault()},!0),window.addEventListener("submit",C=>C.preventDefault(),!0),N(t),window.addEventListener("DOMContentLoaded",()=>{new ResizeObserver(O).observe(document.body),new MutationObserver(O).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0}),window.addEventListener("resize",O),document.addEventListener("load",O,!0),document.fonts.ready.then(O),f("ready"),O()},{once:!0})}function J1(r,t,n,a,s){const o=document.createElement("iframe");o.setAttribute("sandbox","allow-scripts"),o.setAttribute("referrerpolicy","no-referrer"),o.title=n,o.style.cssText="display:block;width:100%;height:100%;border:0;";let c;const l=f=>{const i=f.data?.deltaY;typeof i=="number"&&Number.isFinite(i)&&i!==0&&Math.abs(i)<=a&&window.parent.postMessage({channel:r,type:"wheel",deltaY:i},"*")};window.addEventListener("message",f=>{const i=f.data;if(!(!i||typeof i!="object"||i.channel!==r)){if(f.source===window.parent&&i.type==="theme"){o.contentWindow?.postMessage({channel:r,type:"theme",theme:i.theme},"*");return}if(!(f.source!==o.contentWindow||f.origin!=="null")){if(i.type==="scroll-port"&&!c&&f.ports.length===1){c=f.ports[0],c.onmessage=l;return}i.type==="resize"&&typeof i.height=="number"&&Number.isFinite(i.height)&&i.height>=0?window.parent.postMessage({channel:r,type:"resize",height:i.height},"*"):i.type==="ready"?window.parent.postMessage({channel:r,type:"ready"},"*"):(i.type==="error"||i.type==="layout")&&typeof i.message=="string"?window.parent.postMessage({channel:r,type:i.type,message:i.message.slice(0,300)},"*"):i.type==="snapshot"&&s(i.snapshot)&&window.parent.postMessage({channel:r,type:"snapshot",snapshot:i.snapshot},"*")}}}),window.addEventListener("DOMContentLoaded",()=>{o.srcdoc=t,document.body.append(o)},{once:!0})}function Y1(r,t,n,a,s,o,c,l){const f=document.implementation.createHTMLDocument(""),i=f.createElement("template");i.innerHTML=n,f.body.append(i.content);const p=Y=>{Y.querySelectorAll("meta, base, link, iframe, frame, frameset, object, embed").forEach(re=>re.remove()),Y.querySelectorAll("template").forEach(re=>p(re.content)),Y.querySelectorAll("a, area").forEach(re=>{for(const xe of["href","xlink:href"])re.getAttribute(xe)?.startsWith("#")||re.removeAttribute(xe);re.removeAttribute("target"),re.removeAttribute("ping"),re.removeAttribute("download")})};p(f);const g=Y=>JSON.stringify(Y).replace(/</g,"\\u003c"),R=f.createElement("meta");R.httpEquiv="Content-Security-Policy",R.content=r.csp;const b=f.createElement("meta");b.setAttribute("charset","utf-8");const h=f.createElement("style"),P=/^data:[\w.+/-]+;base64,[A-Za-z0-9+/=]+$/.test(l)?`@font-face { font-family: 'Inter'; font-style: normal; font-weight: 100 900;
261
261
  font-display: swap; src: url('${l}') format('woff2'); }`:"";h.textContent=`${P}${r.styles}`;const T=f.createElement("script"),B=g([a,s,r.maxScrollDelta,r.lockHeight,t(c)?c:null]);T.textContent=`(${r.bridge})(...${B}, (${r.validate}));`,f.head.prepend(R,b,h,T);const F=`<!doctype html>${f.documentElement.outerHTML}`,O=document.implementation.createHTMLDocument(""),N=O.createElement("meta");N.httpEquiv="Content-Security-Policy",N.content=r.csp.replace("frame-src 'none'","frame-src about:");const W=O.createElement("meta");W.setAttribute("charset","utf-8");const C=O.createElement("style");C.textContent="html, body { margin: 0; width: 100%; height: 100%; overflow: hidden; }";const z=O.createElement("script"),J=g([a,F,o,r.maxScrollDelta]);return z.textContent=`(${r.shell})(...${J}, (${r.validate}));`,O.head.prepend(N,W,C,z),`<!doctype html>${O.documentElement.outerHTML}`}const X1=()=>({csp:K1,styles:U1,maxScrollDelta:Pu,lockHeight:V1,bridge:G1.toString(),shell:J1.toString(),validate:gi.toString()});function Z1(r,t,n,a,s=null,o=""){return Y1(X1(),gi,r,t,n,a,s,o)}function Ec(r){const t=getComputedStyle(r);return{dark:document.documentElement.classList.contains("dark"),variables:{...Object.fromEntries(q1.map(n=>[`--${n}`,t.getPropertyValue(`--${n}`).trim()])),"--inline-html-root-font-size":getComputedStyle(document.documentElement).fontSize}}}function Q1(r,t,n,a,s=null){return Z1(r,t,n,a,s,W1)}var $1=S('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground"> </p>'),e0=S('<div class="type-body flex items-center justify-between gap-3 px-4 py-2" role="status"><span class="text-danger"> </span> <!></div> <!>',1),t0=S('<p class="sr-only" role="status"> </p>'),r0=S('<p class="type-body m-0 px-4 py-3 text-muted-foreground" role="status"> </p>'),n0=S('<div class="type-body px-4 py-2 text-danger" role="status"><p class="m-0"> </p> <p class="type-code m-0 break-words"> </p></div>'),a0=S('<iframe sandbox="allow-scripts" referrerpolicy="no-referrer"></iframe>'),s0=S('<div class="space-y-4 p-4" aria-hidden="true"><div class="space-y-2"><!> <!></div> <!> <div class="flex items-center gap-4"><!> <!> <!></div></div>'),o0=S('<span class="type-caption ml-auto text-muted-foreground" role="status"> </span>'),i0=S('<p class="type-caption m-0 break-words px-4 pb-2 text-muted-foreground" role="status"> <!></p>'),l0=S('<th class="min-w-40 px-2 pb-3 align-top font-normal"><!> <div class="mt-1 flex gap-1"><!> <!></div></th>'),c0=S('<td class="max-w-56 px-2 py-2 align-top break-words tabular-nums"> </td>'),d0=S('<tr><th class="max-w-48 py-2 pr-4 align-top font-normal break-words text-muted-foreground"> </th><!></tr>'),u0=S('<div class="overflow-x-auto px-4 pb-4" data-inline-visual-comparison=""><table class="type-body w-full border-separate border-spacing-0 text-left"><thead><tr><th class="min-w-28 pr-4 pb-3 font-normal text-muted-foreground"> </th><th class="min-w-32 px-2 pb-3 align-top font-medium"> </th><!></tr></thead><tbody></tbody></table></div>'),f0=S('<div class="flex flex-wrap items-center gap-1 px-4 py-2" data-inline-visual-actions=""><!> <!> <!> <!> <!></div> <!> <!>',1),p0=S('<div data-inline-html="" class="my-3 min-w-0 overflow-hidden rounded-lg bg-background text-foreground"><div class="flex min-w-0 items-center justify-end gap-1 p-1"><!> <!></div> <!> <!> <div class="relative min-w-0"><!> <!></div> <!></div>');function Au(r,t){if(new.target)return Ht({component:Au,...r});Ut(t,!0);const n=720;let a=_(t,"source",7),s=_(t,"isStreaming",7,!1),o=_(t,"isComplete",7,!0),c=_(t,"record",7),l=_(t,"storageStatus",7,"ready"),f=_(t,"onRecordChange",7),i=_(t,"onUseConfiguration",7),p=_(t,"onExport",7),g=_(t,"onRetry",7),R=_(t,"storageError",7),b=_(t,"exportStatus",7),h=_(t,"exportPath",7),P=_(t,"exportError",7),T,B=_e(void 0),F=_e(!1),O=_e(!1),N=_e(0),W=_e(""),C=_e(""),z=_e(!1),J=_e(""),Y=_e(qr(Mo)),re=_e(n),xe=_e(""),ie=_e(hl()),ne=_e(void 0),ge,Ne=_e(void 0),V=_e(!1);const pe=u(()=>c()??e(ie)),ce=u(()=>l()!=="loading"&&(l()!=="error"||!!e(pe).current)),Te=u(()=>!s()&&o()&&!!a().trim()&&e(ce)),Oe=u(()=>Math.min(Cc,Math.max(Mo,e(Y)))),we=u(()=>s()||l()==="loading"?"loading":o()?a().trim()?e(J)?"error":e(z)?"ready":"loading":"empty":"incomplete"),Qe=u(()=>s()||l()==="loading"||e(Te)&&!e(z)&&!e(J));function qe(Q){const Ce={...Q,current:e(ne)??Q.current};M(ie,Ce),f()?.(Ce)}function et(){const Q=e(ne);!Q||e(pe).scenarios.length>=bl||(qe({...e(pe),scenarios:[...e(pe).scenarios,{id:crypto.randomUUID(),name:Uf({number:al(e(pe).scenarios.length+1)}),snapshot:structuredClone(Q)}]}),M(V,!0))}function de(Q,Ce){const $e=Ce.trim().slice(0,120);$e&&qe({...e(pe),scenarios:e(pe).scenarios.map(tt=>tt.id===Q?{...tt,name:$e}:tt)})}function $(Q){const Ce=structuredClone(Q);M(ne,Ce),M(Ne,Ce),qe({...e(pe),current:Ce}),M(N,e(N)+1)}function Re(Q){return typeof Q=="number"?al(Q):typeof Q=="string"?Q:JSON.stringify(Q)}function G(){!e(B)?.contentWindow||!e(C)||e(B).contentWindow.postMessage({channel:e(C),type:"theme",theme:Ec(T)},"*")}function K(Q){let Ce=T.parentElement;for(;Ce;){const $e=getComputedStyle(Ce),tt=Ce.scrollHeight-Ce.clientHeight;if(/^(auto|scroll|overlay)$/.test($e.overflowY)&&tt>1){if(Q<0?Ce.scrollTop>0:Ce.scrollTop<tt){Ce.dispatchEvent(new WheelEvent("wheel",{deltaY:Q,bubbles:!0})),Ce.scrollTop+=Q;return}if(/^(contain|none)$/.test($e.overscrollBehaviorY))return}Ce=Ce.parentElement}window.scrollBy({top:Q,behavior:"instant"})}kt(()=>{if(!e(F))return;const Q=a(),Ce=e(Te);e(N),Nn(()=>{ge!==Q&&(M(ie,hl()),M(ne,void 0),M(V,!1),M(Ne,void 0),ge=Q),M(z,!1),M(J,""),M(xe,""),M(Y,Mo,!0),M(C,crypto.randomUUID(),!0),M(W,Ce?Q1(Q,e(C),Ec(T),tl(),e(Ne)??e(ne)??e(pe).current):"",!0),M(Ne,void 0)})}),ys(()=>{M(F,!0);const Q=ft=>{if(ft.source!==e(B)?.contentWindow||ft.origin!=="null")return;const Fe=ft.data;if(!(!Fe||typeof Fe!="object"||Fe.channel!==e(C)))if(Fe.type==="resize"&&typeof Fe.height=="number"&&Number.isFinite(Fe.height)&&Fe.height>=0)M(Y,Math.min(Cc,Math.ceil(Fe.height)),!0);else if(Fe.type==="ready")M(z,!0),G();else if(Fe.type==="error"&&typeof Fe.message=="string")M(J,Fe.message.slice(0,300),!0);else if(Fe.type==="layout"&&typeof Fe.message=="string")M(xe,Fe.message.slice(0,300),!0);else if(Fe.type==="snapshot"&&e(Te)&&gi(Fe.snapshot)){const ht=Fe.snapshot;M(ne,ht),qe({...e(pe),current:ht})}else Fe.type==="wheel"&&e(z)&&e(Te)&&!e(O)&&!e(Qe)&&typeof Fe.deltaY=="number"&&Number.isFinite(Fe.deltaY)&&Fe.deltaY!==0&&Math.abs(Fe.deltaY)<=Pu&&K(Fe.deltaY)},Ce=()=>{M(re,Math.min(n,Math.max(160,Math.floor(window.innerHeight*.8))),!0)},$e=new MutationObserver(G);$e.observe(document.documentElement,{attributes:!0,attributeFilter:["class","style","data-theme"]});const tt=window.matchMedia("(prefers-color-scheme: dark)");return tt.addEventListener("change",G),window.addEventListener("message",Q),window.addEventListener("resize",Ce),Ce(),()=>{$e.disconnect(),tt.removeEventListener("change",G),window.removeEventListener("message",Q),window.removeEventListener("resize",Ce)}});var U={get source(){return a()},set source(Q){a(Q),x()},get isStreaming(){return s()},set isStreaming(Q=!1){s(Q),x()},get isComplete(){return o()},set isComplete(Q=!0){o(Q),x()},get record(){return c()},set record(Q){c(Q),x()},get storageStatus(){return l()},set storageStatus(Q="ready"){l(Q),x()},get onRecordChange(){return f()},set onRecordChange(Q){f(Q),x()},get onUseConfiguration(){return i()},set onUseConfiguration(Q){i(Q),x()},get onExport(){return p()},set onExport(Q){p(Q),x()},get onRetry(){return g()},set onRetry(Q){g(Q),x()},get storageError(){return R()},set storageError(Q){R(Q),x()},get exportStatus(){return b()},set exportStatus(Q){b(Q),x()},get exportPath(){return h()},set exportPath(Q){h(Q),x()},get exportError(){return P()},set exportError(Q){P(Q),x()},$set:jt,$on:(Q,Ce)=>Wt(t,Q,Ce)},oe=p0(),he=I(oe),X=I(he);yt(X,{variant:"ghost",size:"sm",get active(){return e(O)},get"aria-pressed"(){return e(O)},onclick:()=>{M(O,!e(O))},children:(Q,Ce)=>{ar();var $e=At();k(tt=>y($e,tt),[()=>e(O)?Mf():Nf()]),d(Q,$e)},$$slots:{default:!0}});var fe=m(X,2);{let Q=u(()=>!e(Te));yt(fe,{variant:"ghost",size:"sm",get disabled(){return e(Q)},onclick:()=>{M(N,e(N)+1)},children:(Ce,$e)=>{ar();var tt=At();k(ft=>y(tt,ft),[()=>Of()]),d(Ce,tt)},$$slots:{default:!0}})}w(he);var Le=m(he,2);{var ze=Q=>{var Ce=e0(),$e=Ue(Ce),tt=I($e),ft=L(tt,!0),Fe=m(tt,2);{var ht=vt=>{yt(vt,{variant:"ghost",size:"sm",get onclick(){return g()},children:(Ct,Rt)=>{ar();var Zt=At();k(_t=>y(Zt,_t),[()=>qf()]),d(Ct,Zt)},$$slots:{default:!0}})};D(Fe,vt=>{g()&&vt(ht)})}w($e);var lt=m($e,2);{var gt=vt=>{var Ct=$1(),Rt=L(Ct,!0);k(()=>y(Rt,R())),d(vt,Ct)};D(lt,vt=>{R()&&vt(gt)})}k(vt=>y(ft,vt),[()=>Df()]),d(Q,Ce)};D(Le,Q=>{l()==="error"&&Q(ze)})}var nt=m(Le,2);{var me=Q=>{var Ce=t0(),$e=L(Ce,!0);k(tt=>y($e,tt),[()=>s()?Bf():Ff()]),d(Q,Ce)},Ee=Q=>{var Ce=r0(),$e=L(Ce,!0);k(tt=>y($e,tt),[()=>o()?Hf():zf()]),d(Q,Ce)},q=Q=>{var Ce=n0(),$e=I(Ce),tt=L($e,!0),ft=m($e,2),Fe=L(ft,!0);w(Ce),k(ht=>{y(tt,ht),y(Fe,e(J))},[()=>jf()]),d(Q,Ce)};D(nt,Q=>{e(Qe)?Q(me):e(Te)?e(J)&&Q(q,2):Q(Ee,1)})}var Se=m(nt,2),ue=I(Se);{var A=Q=>{var Ce=a0();let $e,tt;gr(Ce,ft=>M(B,ft),()=>e(B)),k(ft=>{ae(Ce,"title",ft),ae(Ce,"srcdoc",e(W)),$e=mt(Ce,1,"block w-full border-0 svelte-1kkow1d",null,$e,{"preview-hidden":e(O)||e(Qe)}),ae(Ce,"aria-hidden",e(O)||e(Qe)),tt=Pn(Ce,"",tt,{height:`${e(Oe)}px`})},[()=>tl()]),d(Q,Ce)};D(ue,Q=>{e(Te)&&e(W)&&Q(A)})}var H=m(ue,2);{var ye=Q=>{$n(Q,{get code(){return a()},language:"html",noBorder:!0,noMargin:!0,get maxHeight(){return e(re)}})},Ze=Q=>{var Ce=s0(),$e=I(Ce),tt=I($e);ja(tt,{class:"h-4 w-32 max-w-1/2"});var ft=m(tt,2);ja(ft,{class:"h-3 w-2/3"}),w($e);var Fe=m($e,2);ja(Fe,{class:"aspect-video max-h-60 w-full rounded-lg"});var ht=m(Fe,2),lt=I(ht);ja(lt,{class:"h-3 w-16"});var gt=m(lt,2);ja(gt,{class:"h-2 min-w-0 flex-1"});var vt=m(gt,2);ja(vt,{class:"h-3 w-10"}),w(ht),w(Ce),d(Q,Ce)};D(H,Q=>{e(O)?Q(ye):e(Qe)&&Q(Ze,1)})}w(Se);var Pe=m(Se,2);{var He=Q=>{var Ce=f0(),$e=Ue(Ce),tt=I($e);{var ft=Et=>{{let Jt=u(()=>!e(z)||!!e(J));yt(Et,{size:"sm",get disabled(){return e(Jt)},onclick:()=>e(ne)&&i()(e(ne)),children:(Ot,ve)=>{ar();var ee=At();k(Ve=>y(ee,Ve),[()=>Vf()]),d(Ot,ee)},$$slots:{default:!0}})}};D(tt,Et=>{i()&&Et(ft)})}var Fe=m(tt,2);{let Et=u(()=>!e(z)||!!e(J)||e(pe).scenarios.length>=bl);yt(Fe,{variant:"ghost",size:"sm",get disabled(){return e(Et)},onclick:et,children:(Jt,Ot)=>{ar();var ve=At();k(ee=>y(ve,ee),[()=>Wf()]),d(Jt,ve)},$$slots:{default:!0}})}var ht=m(Fe,2);{var lt=Et=>{yt(Et,{variant:"ghost",size:"sm",get active(){return e(V)},get"aria-expanded"(){return e(V)},onclick:()=>M(V,!e(V)),children:(Jt,Ot)=>{ar();var ve=At();k(ee=>y(ve,ee),[()=>Kf()]),d(Jt,ve)},$$slots:{default:!0}})};D(ht,Et=>{e(pe).scenarios.length&&Et(lt)})}var gt=m(ht,2);{var vt=Et=>{{let Jt=u(()=>!e(z)||b()==="saving");yt(Et,{variant:"ghost",size:"sm",get disabled(){return e(Jt)},onclick:()=>p()({...e(pe),current:e(ne)??null}),children:(Ot,ve)=>{ar();var ee=At();k(Ve=>y(ee,Ve),[()=>Gf()]),d(Ot,ee)},$$slots:{default:!0}})}};D(gt,Et=>{p()&&Et(vt)})}var Ct=m(gt,2);{var Rt=Et=>{var Jt=o0(),Ot=L(Jt,!0);k(ve=>y(Ot,ve),[()=>l()==="saving"?Jf():l()==="ready"?Yf():""]),d(Et,Jt)};D(Ct,Et=>{f()&&Et(Rt)})}w($e);var Zt=m($e,2);{var _t=Et=>{var Jt=i0(),Ot=I(Jt),ve=m(Ot);{var ee=Ve=>{var at=At();k(()=>y(at,P())),d(Ve,at)};D(ve,Ve=>{b()==="error"&&P()&&Ve(ee)})}w(Jt),k(Ve=>y(Ot,`${Ve??""} `),[()=>b()==="saving"?Xf():b()==="saved"?Zf({path:h()??""}):Qf()]),d(Et,Jt)};D(Zt,Et=>{b()&&Et(_t)})}var Vt=m(Zt,2);{var er=Et=>{var Jt=u0(),Ot=I(Jt),ve=I(Ot),ee=I(ve),Ve=I(ee),at=L(Ve,!0),dt=m(Ve),We=L(dt,!0),Z=m(dt);Pt(Z,17,()=>e(pe).scenarios,le=>le.id,(le,ke)=>{var Ae=l0(),Be=I(Ae);{let Ie=u(()=>tp());Va(Be,{get value(){return e(ke).name},get"aria-label"(){return e(Ie)},maxlength:120,onblur:Ye=>{Ye.currentTarget.value.trim()||(Ye.currentTarget.value=e(ke).name),de(e(ke).id,Ye.currentTarget.value)},onkeydown:Ye=>{Ye.key==="Enter"&&Ye.currentTarget.blur(),Ye.key==="Escape"&&(Ye.currentTarget.value=e(ke).name,Ye.currentTarget.blur())}})}var je=m(Be,2),Je=I(je);yt(Je,{variant:"ghost",size:"sm",onclick:()=>$(e(ke).snapshot),children:(Ie,Ye)=>{ar();var Ge=At();k(rt=>y(Ge,rt),[()=>$f()]),d(Ie,Ge)},$$slots:{default:!0}});var Ke=m(Je,2);yt(Ke,{variant:"ghost",size:"sm",onclick:()=>qe({...e(pe),scenarios:e(pe).scenarios.filter(Ie=>Ie.id!==e(ke).id)}),children:(Ie,Ye)=>{ar();var Ge=At();k(rt=>y(Ge,rt),[()=>ep()]),d(Ie,Ge)},$$slots:{default:!0}}),w(je),w(Ae),d(le,Ae)}),w(ee),w(ve);var se=m(ve);Pt(se,20,()=>["inputs","results"],Tr,(le,ke)=>{const Ae=u(()=>ke),Be=u(()=>Array.from(new Set([...Object.keys(e(ne)[e(Ae)]),...e(pe).scenarios.flatMap(Ke=>Object.keys(Ke.snapshot[e(Ae)]))])));var je=wt(),Je=Ue(je);Pt(Je,16,()=>e(Be),Ke=>Ke,(Ke,Ie)=>{var Ye=d0(),Ge=I(Ye),rt=L(Ge,!0),ot=m(Ge);Pt(ot,17,()=>[e(ne),...e(pe).scenarios.map(it=>it.snapshot)],Tr,(it,ut)=>{var St=c0(),bt=L(St,!0);k(Lt=>y(bt,Lt),[()=>Object.hasOwn(e(ut)[e(Ae)],Ie)?Re(e(ut)[e(Ae)][Ie]):"—"]),d(it,St)}),w(Ye),k(()=>y(rt,Ie)),d(Ke,Ye)}),d(le,je)}),w(se),w(Ot),w(Jt),k(le=>{y(at,e(ne).title),y(We,le)},[()=>rp()]),d(Et,Jt)};D(Vt,Et=>{e(V)&&e(pe).scenarios.length&&Et(er)})}d(Q,Ce)};D(Pe,Q=>{e(ne)&&e(Te)&&Q(He)})}return w(oe),gr(oe,Q=>T=Q,()=>T),k(()=>{ae(oe,"data-inline-html-status",e(we)),ae(oe,"data-inline-html-layout",e(xe)?"viewport-locked":void 0),ae(oe,"aria-busy",e(Qe))}),d(r,oe),qt(U)}var g0=S('<div class="w-full min-w-0"><!></div>');function v0(r,t){if(new.target)return Ht({component:v0,...r});Ut(t,!0);const n=()=>Mt(e(b),"$agent$",s),a=()=>Mt(e(B),"$entry$",s),[s,o]=oa();let c=_(t,"block",7),l=_(t,"role",7),f=_(t,"workspaceId",7),i=_(t,"agentId",7),p=_(t,"messageId",7),g=_(t,"contentBlockKey",7,""),R=_e(void 0);const b=u(()=>Xs(i()??"")),h=u(()=>l()==="assistant"&&f()&&i()&&p()&&c().metadata?.fenceClosed&&!c().metadata?.isStreaming&&n()&&!fd(n())?{workspaceId:f(),agentId:i(),messageId:p(),blockKey:JSON.stringify([g(),c().metadata?.fenceStart??0]),source:c().content}:void 0),P=u(()=>!!(f()&&i()&&p()&&c().metadata?.fenceClosed&&!n())),T=u(()=>e(h)?Kg(e(h)):""),B=u(()=>ym(e(T)));kt(()=>{e(h)&&Nt.dispatch(Wg(e(h)))});function F(Y){!f()||!i()||n()?.retiredAt||e(R)?.dispatchEvent(new CustomEvent(Nh,{bubbles:!0,detail:{workspaceId:f(),agentId:i(),snapshot:Y}}))}var O={get block(){return c()},set block(Y){c(Y),x()},get role(){return l()},set role(Y){l(Y),x()},get workspaceId(){return f()},set workspaceId(Y){f(Y),x()},get agentId(){return i()},set agentId(Y){i(Y),x()},get messageId(){return p()},set messageId(Y){p(Y),x()},get contentBlockKey(){return g()},set contentBlockKey(Y=""){g(Y),x()},$set:jt,$on:(Y,re)=>Wt(t,Y,re)},N=wt(),W=Ue(N);{var C=Y=>{var re=g0(),xe=I(re);{let ie=u(()=>c().metadata?.isStreaming??!1),ne=u(()=>c().metadata?.fenceClosed??!1),ge=u(()=>a()?.record),Ne=u(()=>e(h)?a()?.status??"loading":e(P)?"loading":"ready"),V=u(()=>a()?.error),pe=u(()=>e(h)?et=>Nt.dispatch(Vg(e(T),et)):void 0),ce=u(()=>f()&&i()&&n()&&!n().retiredAt?F:void 0),Te=u(()=>e(h)?()=>Nt.dispatch(qg(e(T))):void 0),Oe=u(()=>e(h)?et=>Nt.dispatch(Ug(e(T),crypto.randomUUID(),et)):void 0),we=u(()=>a()?.export?.status),Qe=u(()=>a()?.export?.path),qe=u(()=>a()?.export?.error);Au(xe,{get source(){return c().content},get isStreaming(){return e(ie)},get isComplete(){return e(ne)},get record(){return e(ge)},get storageStatus(){return e(Ne)},get storageError(){return e(V)},get onRecordChange(){return e(pe)},get onUseConfiguration(){return e(ce)},get onRetry(){return e(Te)},get onExport(){return e(Oe)},get exportStatus(){return e(we)},get exportPath(){return e(Qe)},get exportError(){return e(qe)}})}w(re),gr(re,ie=>M(R,ie),()=>e(R)),d(Y,re)},z=Y=>{$n(Y,{get code(){return c().content},language:"html"})};D(W,Y=>{l()==="assistant"?Y(C):Y(z,-1)})}d(r,N);var J=qt(O);return o(),J}var m0=S('<div class="digest-card flex items-start gap-2.5 py-5 px-6 my-4 shadow-xs text-base leading-normal border border-border"> </div>');function h0(r,t){if(new.target)return Ht({component:h0,...r});Ut(t,!0);let n=_(t,"digest",7);var a={get digest(){return n()},set digest(c){n(c),x()},$set:jt,$on:(c,l)=>Wt(t,c,l)},s=m0(),o=L(s,!0);return k(()=>y(o,n())),d(r,s),qt(a)}var b0=S('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-blue-500/15 text-blue-600 dark:text-blue-400"> </span>'),y0=S('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-muted text-muted-foreground"> </span>'),_0=S('<span class="inline-flex items-center px-1.5 py-0.5 rounded text-xs font-medium bg-primary/10 text-primary/80"> </span>'),x0=S('<div class="flex items-start gap-3 px-4 py-2.5"><div class="flex-1 min-w-0"><div class="flex items-center gap-2 flex-wrap"><span class="text-sm font-semibold text-foreground"> </span> <!> <!></div> <div class="mt-0.5 text-xs font-mono text-muted-foreground truncate"> </div></div></div>'),w0=S('<div class="detected-scripts-card my-3 rounded-lg border border-border bg-muted/30 overflow-hidden"><div class="flex items-center gap-2 px-4 py-2.5 border-b border-border bg-muted/40"><!> <span class="text-sm font-semibold text-foreground"> </span></div> <div class="divide-y divide-border"></div> <div class="px-4 py-2 border-t border-border bg-muted/20"><span class="text-xs text-muted-foreground"> </span></div></div>');function k0(r,t){if(new.target)return Ht({component:k0,...r});Ut(t,!0);let n=_(t,"scripts",7);var a={get scripts(){return n()},set scripts(b){n(b),x()},$set:jt,$on:(b,h)=>Wt(t,b,h)},s=w0(),o=I(s),c=I(o);Tt(c,{get icon(){return Zc},size:"sm",class:"text-primary-ink/70"});var l=m(c,2),f=L(l,!0);w(o);var i=m(o,2);Pt(i,21,n,b=>b.name+b.command,(b,h)=>{var P=x0(),T=I(P),B=I(T),F=I(B),O=L(F,!0),N=m(F,2);{var W=xe=>{var ie=b0(),ne=L(ie,!0);k(ge=>y(ne,ge),[()=>v.chat_detectedScripts_service_badge()]),d(xe,ie)},C=xe=>{var ie=y0(),ne=L(ie,!0);k(ge=>y(ne,ge),[()=>v.chat_detectedScripts_command_badge()]),d(xe,ie)};D(N,xe=>{e(h).mode==="service"?xe(W):xe(C,-1)})}var z=m(N,2);{var J=xe=>{var ie=_0(),ne=L(ie,!0);k(()=>y(ne,e(h).category)),d(xe,ie)};D(z,xe=>{e(h).category&&e(h).category!=="other"&&xe(J)})}w(B);var Y=m(B,2),re=L(Y,!0);w(T),w(P),k(()=>{y(O,e(h).name),y(re,e(h).command)}),d(b,P)}),w(i);var p=m(i,2),g=I(p),R=L(g,!0);return w(p),w(s),k((b,h)=>{y(f,b),y(R,h)},[()=>v.chat_detectedScripts_title(),()=>n().length===1?v.chat_detectedScripts_count_one({count:lr(n().length)}):v.chat_detectedScripts_count_many({count:lr(n().length)})]),d(r,s),qt(a)}function S0(r,t){if(new.target)return Ht({component:S0,...r});Ut(t,!0);let n=_(t,"diff",7),a=_(t,"filePath",7),s=_(t,"language",7),o=_(t,"onApply",7),c=_(t,"onReject",7);function l(){o()?.(),Qn.success(v.chat_diffViewer_applied_toast())}function f(){c()?.(),Qn.info(v.chat_diffViewer_rejected_toast())}const i=u(()=>{const g=[];return o()&&g.push({label:v.chat_diffViewer_apply_label(),variant:"success",onClick:l}),c()&&g.push({label:v.chat_diffViewer_reject_label(),variant:"danger",onClick:f}),g});var p={get diff(){return n()},set diff(g){n(g),x()},get filePath(){return a()},set filePath(g){a(g),x()},get language(){return s()},set language(g){s(g),x()},get onApply(){return o()},set onApply(g){o(g),x()},get onReject(){return c()},set onReject(g){c(g),x()},$set:jt,$on:(g,R)=>Wt(t,g,R)};{let g=u(()=>a()||v.chat_diffViewer_suggestedChanges_fallback());fs(r,{get patch(){return n()},get fileName(){return e(g)},get language(){return s()},get actions(){return e(i)},collapsible:!0,initialCollapsed:!1,maxHeight:"500px"})}return qt(p)}var I0=ha('<circle fill="none" style="transition: stroke-dasharray 0.3s ease-out"></circle>'),Pc=ha("<circle></circle>"),C0=ha('<svg class="absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 fill-background" viewBox="0 0 8 6"><path fill-rule="evenodd" clip-rule="evenodd" d="M7.69471 1.69471C7.87687 1.50611 7.97766 1.25351 7.97539 0.991311C7.97311 0.729114 7.86794 0.478302 7.68253 0.292894C7.49712 0.107485 7.24631 0.00231622 6.98411 3.78025e-05C6.72192 -0.00224062 6.46931 0.0985542 6.28071 0.280712L2.98771 3.57371L1.69471 2.28071C1.50611 2.09855 1.25351 1.99776 0.991311 2.00004C0.729114 2.00232 0.478302 2.10749 0.292894 2.29289C0.107485 2.4783 0.00231622 2.72911 3.78025e-05 2.99131C-0.00224062 3.25351 0.0985542 3.50611 0.280712 3.69471L2.28071 5.69471C2.46824 5.88218 2.72255 5.9875 2.98771 5.9875C3.25288 5.9875 3.50718 5.88218 3.69471 5.69471L7.69471 1.69471Z"></path></svg>'),E0=S('<div class="relative"><svg fill="none" xmlns="http://www.w3.org/2000/svg"><circle fill="none"></circle><!></svg> <!></div>');function Ds(r,t){if(new.target)return Ht({component:Ds,...r});Ut(t,!0);let n=_(t,"phase",7),a=_(t,"progress",7,0),s=_(t,"size",7,16),o=_(t,"class",7,""),c=u(()=>s()/2),l=u(()=>e(c)),f=u(()=>e(c)),i=u(()=>s()*.12),p=u(()=>e(c)-e(i)/2),g=u(()=>e(c)*.35),R=u(()=>2*Math.PI*e(g)),b=u(()=>Math.max(0,Math.min(1,a()))*e(R));const h={planning:"#99999999",building:"#54B1F3",reviewing:"#6D7FF5",shipped:"var(--color-foreground)"};let P=u(()=>h[n()]||"currentColor");var T={get phase(){return n()},set phase(ie){n(ie),x()},get progress(){return a()},set progress(ie=0){a(ie),x()},get size(){return s()},set size(ie=16){s(ie),x()},get class(){return o()},set class(ie=""){o(ie),x()},$set:jt,$on:(ie,ne)=>Wt(t,ie,ne)},B=E0(),F=I(B),O=I(F),N=m(O);{var W=ie=>{},C=ie=>{var ne=I0();k(()=>{ae(ne,"cx",e(l)),ae(ne,"cy",e(f)),ae(ne,"r",e(g)*.8),ae(ne,"stroke",e(P)),ae(ne,"stroke-width",e(g)*1.5),ae(ne,"stroke-dasharray",`${e(b)??""} ${e(R)??""}`),ae(ne,"stroke-dashoffset",e(R)*.25),ae(ne,"transform",`rotate(-90 ${e(l)??""} ${e(f)??""})`)}),d(ie,ne)},z=ie=>{var ne=Pc();k(()=>{ae(ne,"cx",e(l)),ae(ne,"cy",e(f)),ae(ne,"r",e(p)*.6),ae(ne,"fill",e(P))}),d(ie,ne)},J=ie=>{var ne=Pc();k(()=>{ae(ne,"cx",e(l)),ae(ne,"cy",e(f)),ae(ne,"r",e(p)),ae(ne,"fill",e(P))}),d(ie,ne)};D(N,ie=>{n()==="planning"?ie(W):n()==="building"?ie(C,1):n()==="reviewing"?ie(z,2):n()==="shipped"&&ie(J,3)})}w(F);var Y=m(F,2);{var re=ie=>{},xe=ie=>{var ne=C0();k(()=>ae(ne,"width",s()*.5)),d(ie,ne)};D(Y,ie=>{n()==="reviewing"?ie(re):n()==="shipped"&&ie(xe,1)})}return w(B),k(()=>{ae(F,"width",s()),ae(F,"height",s()),ae(F,"viewBox",`0 0 ${s()??""} ${s()??""}`),mt(F,0,ur(o())),ae(O,"cx",e(l)),ae(O,"cy",e(f)),ae(O,"r",e(p)),ae(O,"stroke",e(P)),ae(O,"stroke-width",e(i))}),d(r,B),qt(T)}var Ac=S('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full"></span> </span>'),P0=S('<span class="flex items-center gap-1"><span class="size-1.5 rounded-full bg-border"></span> </span>'),Tc=S('<span class="text-ui text-subtle truncate"> </span>'),Rc=S('<div class="flex items-center gap-1 mt-0.5"><!> <!></div>'),Lc=S('<div class="flex items-start gap-2"><div class="shrink-0 mt-0.5"><!></div> <div class="flex-1 min-w-0"><div class="text-xs leading-snug truncate"> </div> <!></div></div>'),A0=S('<div class="flex items-center gap-2"><div class="shrink-0"><!></div> <span class="text-ui text-subtle truncate line-through"> </span></div>'),T0=S('<span class="text-ui text-subtle pl-4"> </span>'),R0=S('<div class="flex flex-col gap-0.5 pt-1 border-t border-border"><!> <!></div>'),L0=S('<div class="text-ui text-subtle"> </div>'),M0=S("<!> <!> <!> <!>",1),N0=S('<div class="flex flex-col py-2 px-3 gap-2 max-h-80 overflow-y-auto"><div class="flex items-center justify-between gap-3"><span class="text-xs font-semibold text-foreground"> </span> <div class="flex items-center gap-3 text-ui text-subtle"><!> <!> <!></div></div> <!></div>'),O0=S('<div class="rounded-[0.5px]"></div>');function Tu(r,t){if(new.target)return Ht({component:Tu,...r});Ut(t,!0);let n=_(t,"stats",7),a=_(t,"tasks",23,()=>[]),s=_(t,"maxBars",7,20),o=_(t,"barWidth",7,"1px"),c=_(t,"barHeight",7,"16px"),l=_(t,"gap",7,"1px"),f=_(t,"class",7);const i={completed:"#22c55e",inProgress:"#4F7BF7",notStarted:"var(--border)"};let p=u(()=>{const{completed:N,inProgress:W,notStarted:C,total:z}=n();if(z===0)return[];const J=[...Array(N).fill("completed"),...Array(W).fill("inProgress"),...Array(Math.max(0,C)).fill("notStarted")];return J.length<=s()?J:J.slice(J.length-s())}),g=u(()=>a().filter(N=>N.status==="complete")),R=u(()=>a().filter(N=>N.status==="in_progress"||N.status==="review_required")),b=u(()=>a().filter(N=>N.status!=="complete"&&N.status!=="in_progress"&&N.status!=="review_required"&&N.status!=="cancelled")),h=u(()=>a().filter(N=>N.status==="cancelled")),P=u(()=>a().length>0);var T={get stats(){return n()},set stats(N){n(N),x()},get tasks(){return a()},set tasks(N=[]){a(N),x()},get maxBars(){return s()},set maxBars(N=20){s(N),x()},get barWidth(){return o()},set barWidth(N="1px"){o(N),x()},get barHeight(){return c()},set barHeight(N="16px"){c(N),x()},get gap(){return l()},set gap(N="1px"){l(N),x()},get class(){return f()},set class(N){f(N),x()},$set:jt,$on:(N,W)=>Wt(t,N,W)},B=wt(),F=Ue(B);{var O=N=>{Fo(N,{side:"top",align:"start",sideOffset:6,contentClass:"max-w-xs p-0",delayDuration:200,disableHoverableContent:!1,content:C=>{var z=N0(),J=I(z),Y=I(J),re=L(Y,!0),xe=m(Y,2),ie=I(xe);{var ne=Oe=>{var we=Ac(),Qe=I(we);Pn(Qe,"",{},{"background-color":"#22c55e"});var qe=m(Qe);w(we),k(()=>y(qe,` ${n().completed??""}`)),d(Oe,we)};D(ie,Oe=>{n().completed>0&&Oe(ne)})}var ge=m(ie,2);{var Ne=Oe=>{var we=Ac(),Qe=I(we);Pn(Qe,"",{},{"background-color":"#4F7BF7"});var qe=m(Qe);w(we),k(()=>y(qe,` ${n().inProgress??""}`)),d(Oe,we)};D(ge,Oe=>{n().inProgress>0&&Oe(Ne)})}var V=m(ge,2);{var pe=Oe=>{var we=P0(),Qe=m(I(we));w(we),k(()=>y(Qe,` ${n().notStarted??""}`)),d(Oe,we)};D(V,Oe=>{n().notStarted>0&&Oe(pe)})}w(xe),w(J);var ce=m(J,2);{var Te=Oe=>{var we=M0(),Qe=Ue(we);Pt(Qe,17,()=>e(R),Tr,(G,K)=>{var U=Lc(),oe=I(U),he=I(oe);yo(he,{get status(){return e(K).status},size:14}),w(oe);var X=m(oe,2),fe=I(X),Le=L(fe,!0),ze=m(fe,2);{var nt=me=>{var Ee=Rc(),q=I(Ee);{let A=u(()=>e(K).agentState||"idle");ll(q,{get agentId(){return e(K).agentId},get state(){return e(A)},size:12,get specialist(){return e(K).agentSpecialist}})}var Se=m(q,2);{var ue=A=>{var H=Tc(),ye=L(H,!0);k(()=>y(ye,e(K).agentName)),d(A,H)};D(Se,A=>{e(K).agentName&&A(ue)})}w(Ee),d(me,Ee)};D(ze,me=>{e(K).agentId&&me(nt)})}w(X),w(U),k(()=>y(Le,e(K).title)),d(G,U)});var qe=m(Qe,2);Pt(qe,17,()=>e(b),Tr,(G,K)=>{var U=Lc(),oe=I(U),he=I(oe);yo(he,{get status(){return e(K).status},size:14}),w(oe);var X=m(oe,2),fe=I(X),Le=L(fe,!0),ze=m(fe,2);{var nt=me=>{var Ee=Rc(),q=I(Ee);{let A=u(()=>e(K).agentState||"idle");ll(q,{get agentId(){return e(K).agentId},get state(){return e(A)},size:12,get specialist(){return e(K).agentSpecialist}})}var Se=m(q,2);{var ue=A=>{var H=Tc(),ye=L(H,!0);k(()=>y(ye,e(K).agentName)),d(A,H)};D(Se,A=>{e(K).agentName&&A(ue)})}w(Ee),d(me,Ee)};D(ze,me=>{e(K).agentId&&me(nt)})}w(X),w(U),k(()=>y(Le,e(K).title)),d(G,U)});var et=m(qe,2);{var de=G=>{var K=R0(),U=I(K);Pt(U,17,()=>e(g).slice(0,3),Tr,(X,fe)=>{var Le=A0(),ze=I(Le),nt=I(ze);yo(nt,{status:"complete",size:12}),w(ze);var me=m(ze,2),Ee=L(me,!0);w(Le),k(()=>y(Ee,e(fe).title)),d(X,Le)});var oe=m(U,2);{var he=X=>{var fe=T0(),Le=L(fe,!0);k(ze=>y(Le,ze),[()=>v.workspace_taskProgressBar_moreCompleted_label({count:lr(e(g).length-3)})]),d(X,fe)};D(oe,X=>{e(g).length>3&&X(he)})}w(K),d(G,K)};D(et,G=>{e(g).length>0&&G(de)})}var $=m(et,2);{var Re=G=>{var K=L0(),U=L(K,!0);k(oe=>y(U,oe),[()=>v.workspace_taskProgressBar_cancelled_label({count:lr(e(h).length)})]),d(G,K)};D($,G=>{e(h).length>0&&G(Re)})}d(Oe,we)};D(ce,Oe=>{e(P)&&Oe(Te)})}w(z),k(Oe=>y(re,Oe),[()=>v.workspace_taskProgressBar_tasksRatio_label({completed:lr(n().completed),total:lr(n().total)})]),d(C,z)},children:(C,z)=>{{let J=u(()=>En("flex h-auto min-w-0 shrink items-end justify-start cursor-default rounded-none border-0",f())),Y=u(()=>`gap: ${l()}`),re=u(()=>v.workspace_taskProgressBar_tasksRatio_label({completed:lr(n().completed),total:lr(n().total)}));yt(C,{variant:"plain",type:"button",wrapContent:!1,get class(){return e(J)},get style(){return e(Y)},get"aria-label"(){return e(re)},"data-task-progress-trigger":!0,children:(xe,ie)=>{var ne=wt(),ge=Ue(ne);Pt(ge,17,()=>e(p),Tr,(Ne,V)=>{var pe=O0();let ce;k(()=>ce=Pn(pe,"",ce,{width:o(),height:c(),"background-color":i[e(V)]})),d(Ne,pe)}),d(xe,ne)},$$slots:{default:!0}})}},$$slots:{content:!0,default:!0}})};D(F,N=>{n().total>0&&N(O)})}return d(r,B),qt(T)}function Li(r,t){if(new.target)return Ht({component:Li,...r});Ut(t,!0);let n=_(t,"items",7),a=_(t,"ariaLabel",7),s=_(t,"open",15,!1),o=_(t,"orientation",7,"vertical"),c=_(t,"selection",7),l=_(t,"class",7,"");const f=u(()=>og(n(),c(),a()));var i={get items(){return n()},set items(p){n(p),x()},get ariaLabel(){return a()},set ariaLabel(p){a(p),x()},get open(){return s()},set open(p=!1){s(p),x()},get orientation(){return o()},set orientation(p="vertical"){o(p),x()},get selection(){return c()},set selection(p){c(p),x()},get class(){return l()},set class(p=""){l(p),x()},$set:jt,$on:(p,g)=>Wt(t,p,g)};return lm(r,{get actions(){return e(f)},align:"end",get ariaLabel(){return a()},onAction:g=>sg(n(),g)?.onClick(),get open(){return s()},set open(g){s(g)},trigger:(g,R)=>{let b=()=>(R?.()).props;yt(g,ci(b,{variant:"plain",size:"icon-compact",iconOnly:!0,type:"button",get class(){return l()},get"aria-label"(){return a()},onclick:h=>{h.stopPropagation(),b().onclick?.(h)},oncontextmenu:h=>{h.preventDefault(),h.stopPropagation()},children:(h,P)=>{cm(h,{get orientation(){return o()},class:"size-3.5"})},$$slots:{default:!0}}))},$$slots:{trigger:!0}}),qt(i)}var D0=S('<span class="contents"><!></span>'),B0=S("<!> <!>",1);function Ru(r,t){if(new.target)return Ht({component:Ru,...r});Ut(t,!0);let n=_(t,"workspaceId",7),a=_(t,"slot",7);const s=u(()=>Lg(a()));let o=_e(null);kt(()=>{e(o)&&e(o).workspaceId!==n()&&M(o,null)});function c(h){const P=Gc(h);P&&M(o,{...P,workspaceId:n()},!0)}function l(h){h.preventDefault(),h.stopPropagation();const P=h.currentTarget.getBoundingClientRect();M(o,{x:P.left,y:P.bottom+2,returnFocus:h.currentTarget,workspaceId:n()},!0)}function f(){M(o,null)}var i={get workspaceId(){return n()},set workspaceId(h){n(h),x()},get slot(){return a()},set slot(h){a(h),x()},$set:jt,$on:(h,P)=>Wt(t,h,P)},p=B0(),g=Ue(p);{let h=u(()=>v.workspace_microKeyBadge_ariaLabel({number:lr(a()+1)})),P=u(()=>v.workspace_microKeyBadge_tooltip({number:lr(a()+1)})),T=u(()=>e(o)!==null);yt(g,{variant:"ghost",size:"icon",type:"button",class:"micro-key-slot-badge size-4 min-w-0 shrink-0 cursor-pointer rounded-[3px] p-0 a11y-ignore",get"aria-label"(){return e(h)},get title(){return e(P)},onclick:l,oncontextmenu:c,onkeydown:c,"aria-haspopup":"menu",get"aria-expanded"(){return e(T)},children:(B,F)=>{var O=D0(),N=I(O);zp(N,{get slot(){return a()},get class(){return`transition-colors ${e(s)??""}`}}),w(O),d(B,O)},$$slots:{default:!0}})}var R=m(g,2);{var b=h=>{{let P=u(()=>e(o)?.x??0),T=u(()=>e(o)?.y??0),B=u(()=>e(o)?.returnFocus),F=u(()=>v.workspace_card_assignMicroKey_label()),O=u(()=>uh(n(),f));Jc(h,{get x(){return e(P)},get y(){return e(T)},get returnFocus(){return e(B)},selection:"single",get ariaLabel(){return e(F)},get items(){return e(O)},onClickOutside:f})}};D(R,h=>{e(o)&&h(b)})}return d(r,p),qt(i)}var F0=S('<span class="flex size-4 shrink-0 items-center justify-center"><!></span>'),z0=S('<span data-workspace-card-pin-indicator="" aria-hidden="true"><!></span> <span class="sr-only"> </span>',1),H0=S('<span class="type-caption shrink-0 rounded-sm bg-muted-foreground/10 px-1.5 font-normal text-muted-foreground" data-workspace-card-trailing-label=""> </span>'),j0=S('<span data-workspace-card-pr-item=""><!></span>'),W0=S('<span class="flex shrink-0 items-center" data-workspace-card-pr-list=""><!></span>'),U0=S('<span data-workspace-card-time=""><!></span>'),q0=S('<span aria-hidden="true"><!></span>'),V0=S("<div><!> <!> <!> <!></div>"),K0=S('<div data-workspace-card-hover-surface=""><!></div>'),G0=S('<div role="group" data-workspace-card-row=""><!> <div class="relative z-10 flex shrink-0 items-center gap-1.5"><!> <!> <span class="sr-only"> </span></div> <div class="relative z-10 flex min-w-0 flex-1 items-center gap-2"><span class="flex min-w-0 flex-1 items-center gap-1" data-workspace-card-title-group=""><span dir="ltr" data-workspace-card-title=""><span class="wc-title-text svelte-1ct56pd"> </span></span> <!></span> <!> <!> <!></div> <!></div> <!> <!>',1),J0=S('<div class="relative z-10 flex shrink-0 items-center"><!></div>'),Y0=S('<div><!> <!> <span class="font-medium truncate"> </span> <span class="shrink-0 text-muted-foreground">·</span> <span class="truncate text-xs text-muted-foreground"> </span> <!></div>'),X0=S('<div class="text-sm font-semibold truncate"> </div>'),Mc=S('<span class="truncate"> </span>'),Z0=S('<span class="text-muted-foreground">·</span>'),Q0=S('<div class="flex items-center gap-1 truncate text-xs text-muted-foreground"><!> <!> <!></div>'),$0=S('<div><!> <!> <div class="flex items-center gap-2 text-xs"><!> <span class="truncate text-muted-foreground"> </span> <span> </span></div> <!></div>'),ek=S('<div class="flex items-center gap-2"><!> <span class="text-ui shrink-0 tabular-nums text-muted-foreground"> </span></div>'),tk=S('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span> <span class="tabular-nums"><span class="text-success"> </span> <span class="ml-1 text-danger"> </span></span></div>'),rk=S('<div class="flex items-center justify-between text-ui"><span class="text-muted-foreground"> </span></div>'),nk=S('<div class="flex items-center text-ui"><span> </span></div>'),ak=S('<div class="flex flex-col gap-1 px-3 pb-2.5"><!> <!> <!> <!></div>'),sk=S('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!></div>'),ok=S('<div class="relative z-10 flex items-center gap-1.5 px-2 pb-2"><!> <!></div>'),ik=S('<div role="group"><!> <div class="flex items-start gap-2.5 px-3 pt-3 pb-2"><!> <div class="flex-1 min-w-0"><div class="text-sm font-medium"> </div> <div class="mt-0.5 line-clamp-2 text-xs leading-snug text-muted-foreground"> </div></div></div> <!> <!></div>');function Lu(r,t){if(new.target)return Ht({component:Lu,...r});Ut(t,!0);const n=()=>Mt(qe,"$prMonitors$",c),a=()=>Mt(et,"$microConnected$",c),s=()=>Mt($,"$hidesOwnerActions$",c),o=()=>Mt(de,"$workspaceKeySlot$",c),[c,l]=oa();let f=_(t,"workspace",7),i=_(t,"phase",7),p=_(t,"stats",7),g=_(t,"variant",7,"compact"),R=_(t,"showTime",7,!0),b=_(t,"isRunning",7,!1),h=_(t,"isUnread",7,!1),P=_(t,"isWaiting",7),T=_(t,"isPinned",7,!1),B=_(t,"streamingAgentIds",23,()=>[]),F=_(t,"hasSpec",7,!1),O=_(t,"isAgentRunning",7,!1),N=_(t,"agentDigest",7),W=_(t,"trailingLabel",7),C=_(t,"title",7),z=_(t,"repoName",7),J=_(t,"branch",7),Y=_(t,"onClick",7),re=_(t,"onAction",7),xe=_(t,"onTogglePin",7),ie=_(t,"onMarkAsRead",7),ne=_(t,"onOpenInNewWindow",7),ge=_(t,"onHover",7),Ne=_(t,"highlighted",7,!1),V=_(t,"selected",7,!1),pe=_(t,"highlightId",7),ce=_(t,"suppressHover",7,!1),Te=_(t,"isolateHoverReveal",7,!1),Oe=_(t,"class",7),we=_(t,"actions",7);const Qe=is("");kt(()=>{Qe.set(f()?.id??"")});const qe=Ep(Qe),et=Ih(),de=lv(Qe),$=Pp(Qe),Re=u(()=>ph(f()??{})),G=u(()=>gh(e(Re)));let K=u(()=>f()?Sh.url.pathname===`/workspace/${f().id}`:!1),U=u(()=>f()?`workspace-hover-card-${f().id}`:void 0),oe=_e(!1),he=_e(null),X=_e(null);kt(()=>{if(!e(X))return;const te=Es(e(X),{id:pe()});return()=>te.destroy()});let fe=_e(null),Le=_e(null),ze=_e(null),nt=_e(0),me=_e(0),Ee=u(()=>e(nt)+(e(me)>0?e(me)+4:0));function q(){const te=e(fe),pt=e(ze);M(nt,te?Math.max(0,te.scrollWidth-te.clientWidth):0,!0),M(me,te&&pt&&pt.getClientRects().length>0?Math.max(0,te.getBoundingClientRect().right-pt.getBoundingClientRect().left):0,!0)}kt(()=>{const te=e(fe),pt=e(Le),Bt=e(ze);if(!te||!pt||(q(),typeof ResizeObserver>"u"))return;const hr=new ResizeObserver(q);return hr.observe(te),hr.observe(pt),Bt&&hr.observe(Bt),()=>hr.disconnect()});let Se=null,ue=null,A=!1,H=!1,ye=!1,Ze=!1,Pe=!1,He=!1,Q=_e(!1),Ce=!1,$e=null,tt=_e(null),ft=null,Fe;function ht(){Se!==null&&(clearTimeout(Se),Se=null)}function lt(){ue!==null&&(clearTimeout(ue),ue=null),ft?.(),ft=null}function gt(){lt(),M(Q,!0),M(oe,!0),!Pe&&(Pe=!0,as.notifyOpened())}function vt(){lt(),clearTimeout(Fe),M(Q,!1),M(oe,!1),H=!1,Ze=!1,Pe&&(Pe=!1,as.notifyClosed())}function Ct(){return A||H||ye||Ze}function Rt(){if(!e(oe)){vt();return}lt(),ue=setTimeout(()=>{ue=null,Ct()||vt()},mh),ft=as.deferClose(vt)}function Zt(){H=!0,lt()}function _t(){H=!1,!ye&&!Ze&&Rt()}function Vt(){Ze=!0,clearTimeout(Fe),lt()}function er(te){const pt=te.relatedTarget instanceof Node?te.relatedTarget:null;if(pt&&se()?.contains(pt)||(Ze=!1,pt&&e(he)?.contains(pt)))return;if(pt){!A&&!H&&vt();return}const Bt=te.target;clearTimeout(Fe),Fe=setTimeout(()=>{const hr=document.activeElement,Cr=se()?.contains(hr)||e(he)?.contains(hr);hr&&hr!==Bt&&Cr||!A&&!H&&vt()},0)}function Et(){$e!==null&&clearTimeout($e),Ce=!0,$e=setTimeout(()=>{Ce=!1,$e=null},0)}function Jt(te){const pt=te.target,Bt=se();pt instanceof Node&&Bt?.contains(pt)||te.type==="scroll"&&e(he)&&pt instanceof Node&&!pt.contains(e(he))||(te.type==="pointerdown"&&Et(),ht(),vt())}kt(()=>{if(e(Q))return window.addEventListener("pointerdown",Jt,!0),window.addEventListener("scroll",Jt,!0),()=>{window.removeEventListener("pointerdown",Jt,!0),window.removeEventListener("scroll",Jt,!0)}});function Ot(te){if(te.key!=="Escape")return;const pt=te.target;pt instanceof Node&&se()?.contains(pt)||(te.preventDefault(),te.stopPropagation(),He=ye,ht(),vt())}kt(()=>{if(e(oe))return window.addEventListener("keydown",Ot,!0),()=>window.removeEventListener("keydown",Ot,!0)});const ve=u(()=>f()?Tp.select(Nt.state,f().id):null),ee=u(()=>e(ve)?e(ve):f()?.activePullRequest?f().activePullRequest:!f()?.prStatus||f().prNumber==null?null:{id:`legacy-pr-${f().prNumber}`,number:f().prNumber,url:f().prUrl??"",title:v.workspace_hoverCard_pullRequest_label(),status:f().prStatus,createdAt:f().updatedAt,updatedAt:f().updatedAt}),Ve=u(()=>Ap(f())),at=u(()=>{if(!f()||e(Ve))return[];const te=f(),pt=te.repositoryOwner&&te.repositoryName?`${te.repositoryOwner}/${te.repositoryName}`:void 0;return ig({workspacePRs:te.pullRequests,activePR:e(ee),monitors:n(),workspaceRepo:pt,buildPrUrl:(Bt,hr)=>Hv(Bt,te.repositoryOwner,te.repositoryName,hr),getDisplayTitle:Bt=>Bt.title})}),dt=u(()=>e(at)[0]);function We(te){const pt=te.resource?.repository.provider==="gitlab"?`${te.repo} !${te.number}`:te.repo?v.workspace_card_prBadge_repoLine_tooltip({repo:te.repo,number:te.number}):v.workspace_card_prBadge_label({number:` #${te.number}`});return[Rp(pt,te),te.title,te.details].filter(Boolean).join(`
262
262
  `)}function Z(te){te.key==="Enter"&&Y()?.(te)}function se(){return e(U)?document.getElementById(e(U)):null}function le(){return Array.from(se()?.querySelectorAll("button:not(:disabled), a[href]")??[])}function ke(){const te=e(he)?.querySelector("[data-workspace-card-trigger]"),pt=se();if(!te||!pt)return null;const Bt=Array.from(document.querySelectorAll('button:not(:disabled), a[href], input:not(:disabled), select:not(:disabled), textarea:not(:disabled), [tabindex]:not([tabindex="-1"])')).filter(Cr=>Cr.tabIndex>=0&&!pt.contains(Cr)),hr=Bt.indexOf(te);return hr>=0?Bt[hr+1]:null}function Ae(te){He=!!e(he)?.contains(te),vt(),te.focus({preventScroll:!0})}function Be(){const te=e(he)?.querySelector("[data-workspace-card-trigger]");te&&Ae(te)}async function je(te){if(te.key==="Escape"&&e(oe)){te.preventDefault(),te.stopPropagation(),vt();return}te.key!=="ArrowDown"||ce()||!f()||(te.preventDefault(),te.stopPropagation(),M(Q,!0),M(oe,!0),await Jn(),le()[0]?.focus({preventScroll:!0}))}function Je(te){const pt=le(),Bt=te.key==="Tab"&&te.shiftKey&&te.currentTarget===pt[0],Cr=te.key==="Tab"&&!te.shiftKey&&te.currentTarget===pt.at(-1)?ke():null;te.key!=="Escape"&&!Bt&&!Cr||(te.preventDefault(),te.stopPropagation(),Cr?Ae(Cr):Be())}function Ke(){A=!0,lt(),as.settleDeferredCloses(),q(),ge()?.(),f()&&!ce()&&!ye&&(ht(),M(Q,!0),Se=setTimeout(()=>{Se=null,gt()},as.currentOpenDelay))}function Ie(){A=!1,ht(),!ye&&!Ze&&Rt()}function Ye(){ye=!0,ht(),lt(),!He&&(Ce||f()&&!ce()&&(M(Q,!0),M(oe,!0)))}function Ge(te){const pt=te.relatedTarget instanceof Node?te.relatedTarget:null;pt&&e(he)?.contains(pt)||(He=!1,ye=!1,!(pt&&se()?.contains(pt))&&!A&&!H&&vt())}kt(()=>{ce()&&(ht(),lt(),vt())});let rt=_e(null),ot=_e(!1),it;kt(()=>{const te=f()?.id;it!==te&&(it=te,M(ot,!1)),e(rt)&&e(rt).workspaceId!==f()?.id&&St()});function ut(te){if(!f())return;const pt=Gc(te);if(pt){if(M(ot,!1),bt().length===0){M(rt,null);return}M(rt,{...pt,returnFocus:te.target instanceof HTMLElement?te.target.closest("button")??e(he)?.querySelector("button")??null:null,workspaceId:f().id},!0)}}function St(){M(rt,null),M(ot,!1)}kt(()=>{e(ot)&&M(rt,null)}),hs(()=>{ht(),lt(),$e!==null&&(clearTimeout($e),$e=null),vt()});function bt(){if(!f())return[];const te=[];return ne()&&te.push({id:"open-new-window",label:v.workspace_card_openNewWindow_label(),icon:ed,onClick:()=>{ne()?.(),St()}}),te.push(...vh(f().id,{connected:a(),onClose:St})),s()||(e(Ve)||te.push({id:"transfer",label:v.workspace_card_transfer_label(),icon:Sg,onClick:()=>{Nt.dispatch(Gg({workspaceId:f().id,workspaceTitle:f().title})),St()}}),te.push({id:"archive",label:v.workspace_card_archive_label(),icon:td,onClick:()=>{Nt.dispatch(pd(f().id)),St()}}),te.push({id:"delete",label:v.workspace_card_deleteSpace_label(),icon:rd,destructive:!0,onClick:()=>{Nt.dispatch(gd(f().id)),St()}})),te}let Lt=u(()=>O()&&N()?N():i()?.subtitle??""),Yt=u(()=>p()&&p().tasks.total>0?p().tasks.completed/p().tasks.total:0),$t=u(()=>!!p()&&(p().tasks.total>0||p().files.changed>0||p().commits.total>0||p().pr.hasOpen||p().pr.hasMerged)),Kt=u(()=>e(Ve)?void 0:J()),Lr=u(()=>!p()||e(Ve)?"":p().pr.hasMerged?v.workspace_card_prMerged_label({number:p().pr.number??""}):p().pr.hasOpen?v.workspace_card_prOpen_label({number:p().pr.number?`#${p().pr.number}`:""}):""),Qr=u(()=>i()?.phase==="planning"?O()?{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_pause_label(),action:"pause"}}:F()||(p()?.tasks.total??0)>0?{primary:{label:v.workspace_card_approveStart_label(),action:"approve"},secondary:{label:v.workspace_card_viewSpec_label(),action:"view-spec"}}:{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_viewSpec_label(),action:"view-spec"}}:i()?.phase==="building"?{primary:{label:v.workspace_card_showCoordinator_label(),action:"show-coordinator"},secondary:{label:v.workspace_card_pause_label(),action:"pause"}}:i()?.phase==="reviewing"?{primary:{label:v.workspace_card_createPr_label(),action:"create-pr"},secondary:{label:v.workspace_card_showChanges_label(),action:"show-changes"}}:{primary:{label:v.workspace_card_archive_label(),action:"archive"},secondary:{label:v.workspace_card_showChanges_label(),action:"show-changes"}});const pn={planning:"bg-muted/20 text-muted-foreground",building:"bg-info/15 text-info",reviewing:"bg-primary/15 text-primary",shipped:"bg-foreground/10 text-foreground"};var Dn={get workspace(){return f()},set workspace(te){f(te),x()},get phase(){return i()},set phase(te){i(te),x()},get stats(){return p()},set stats(te){p(te),x()},get variant(){return g()},set variant(te="compact"){g(te),x()},get showTime(){return R()},set showTime(te=!0){R(te),x()},get isRunning(){return b()},set isRunning(te=!1){b(te),x()},get isUnread(){return h()},set isUnread(te=!1){h(te),x()},get isWaiting(){return P()},set isWaiting(te){P(te),x()},get isPinned(){return T()},set isPinned(te=!1){T(te),x()},get streamingAgentIds(){return B()},set streamingAgentIds(te=[]){B(te),x()},get hasSpec(){return F()},set hasSpec(te=!1){F(te),x()},get isAgentRunning(){return O()},set isAgentRunning(te=!1){O(te),x()},get agentDigest(){return N()},set agentDigest(te){N(te),x()},get trailingLabel(){return W()},set trailingLabel(te){W(te),x()},get title(){return C()},set title(te){C(te),x()},get repoName(){return z()},set repoName(te){z(te),x()},get branch(){return J()},set branch(te){J(te),x()},get onClick(){return Y()},set onClick(te){Y(te),x()},get onAction(){return re()},set onAction(te){re(te),x()},get onTogglePin(){return xe()},set onTogglePin(te){xe(te),x()},get onMarkAsRead(){return ie()},set onMarkAsRead(te){ie(te),x()},get onOpenInNewWindow(){return ne()},set onOpenInNewWindow(te){ne(te),x()},get onHover(){return ge()},set onHover(te){ge(te),x()},get highlighted(){return Ne()},set highlighted(te=!1){Ne(te),x()},get selected(){return V()},set selected(te=!1){V(te),x()},get highlightId(){return pe()},set highlightId(te){pe(te),x()},get suppressHover(){return ce()},set suppressHover(te=!1){ce(te),x()},get isolateHoverReveal(){return Te()},set isolateHoverReveal(te=!1){Te(te),x()},get class(){return Oe()},set class(te){Oe(te),x()},get actions(){return we()},set actions(te){we(te),x()},$set:jt,$on:(te,pt)=>Wt(t,te,pt)},ln=wt(),Yn=Ue(ln);{var An=te=>{var pt=G0(),Bt=Ue(pt);let hr;var Cr=I(Bt);{let Me=u(()=>f().title||v.workspace_links_untitled_label()),st=u(()=>`workspace-status-state-${f().id}${T()?` workspace-pinned-state-${f().id}`:""}${e(oe)?` ${e(U)}`:""}`),Qt=u(()=>e(K)?"page":void 0);yt(Cr,{variant:"plain",class:"absolute inset-0 z-0 h-auto w-auto rounded-md focus-visible:border-transparent focus-visible:bg-background/50 focus-visible:ring-0",get"aria-label"(){return e(Me)},get"aria-describedby"(){return e(st)},get"aria-current"(){return e(Qt)},"data-workspace-card-trigger":!0,onkeydown:je,onclick:Dt=>{Dt.stopPropagation(),Y()?.(Dt)}})}var Tn=m(Cr,2),kr=I(Tn);{var Bn=Me=>{var st=F0(),Qt=I(st);{var Dt=tr=>{Ru(tr,{get workspaceId(){return f().id},get slot(){return o()}})};D(Qt,tr=>{o()!==null&&tr(Dt)})}w(st),d(Me,st)};D(kr,Me=>{a()&&Me(Bn)})}var Fn=m(kr,2);Fo(Fn,{get content(){return e(G).tooltip},side:"bottom",sideOffset:4,children:(Me,st)=>{fh(Me,{get status(){return e(Re)},size:14,decorative:!0,class:"justify-start"})},$$slots:{default:!0}});var Xn=m(Fn,2),zn=L(Xn,!0);w(Tn);var Vr=m(Tn,2),gn=I(Vr),sr=I(gn),Kr=I(sr),ra=L(Kr,!0);gr(Kr,Me=>M(Le,Me),()=>e(Le)),w(sr),gr(sr,Me=>M(fe,Me),()=>e(fe));var Sr=m(sr,2);{var Er=Me=>{var st=z0(),Qt=Ue(st),Dt=I(Qt);Tt(Dt,{get icon(){return pl},size:"xs"}),w(Qt);var tr=m(Qt,2),vr=L(tr,!0);k(cn=>{mt(Qt,1,`wc-pin-indicator inline-flex shrink-0 items-center text-muted-foreground transition-opacity
263
- ${xe()?Ne()?"opacity-0":ce()?"":Te()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),ae(tr,"id",`workspace-pinned-state-${f().id??""}`),y(vr,cn)},[()=>v.layout_activeCard_pinned_header()]),d(Me,st)};D(Sr,Me=>{T()&&Me(Er)})}w(gn);var $r=m(gn,2);{var la=Me=>{var st=H0(),Qt=L(st,!0);k(()=>y(Qt,W())),d(Me,st)};D($r,Me=>{W()&&Me(la)})}var Gr=m($r,2);{var en=Me=>{const st=u(()=>e(dt));var Qt=W0(),Dt=I(Qt);{let tr=u(()=>We(e(st)));Fo(Dt,{get content(){return e(tr)},side:"bottom",sideOffset:4,children:(vr,cn)=>{var xn=wt(),dn=Ue(xn);{var fr=Mr=>{{let yr=u(()=>We(e(st)));yt(Mr,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(st).foregroundClass??""}`},get"aria-label"(){return e(yr)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(st).identity},get"data-pr-status"(){return e(st).status},onclick:Or=>{Or.stopPropagation();const Pr=f().id;np(async()=>{const{handleLink:an}=await import("./BFETMHTz.js").then(na=>na.Q);return{handleLink:an}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url).then(({handleLink:an})=>an(e(st).url,{workspaceId:Pr,event:Or}))},children:(Or,Pr)=>{Tt(Or,{get icon(){return e(st).statusIcon},size:14})},$$slots:{default:!0}})}},jr=Mr=>{var yr=j0(),Or=I(yr);Tt(Or,{get icon(){return e(st).statusIcon},size:14}),w(yr),k(Pr=>{mt(yr,1,`inline-flex size-5 shrink-0 items-center justify-center rounded-sm ${e(st).foregroundClass??""}`,"svelte-1ct56pd"),ae(yr,"aria-label",Pr),ae(yr,"data-pr-identity",e(st).identity),ae(yr,"data-pr-status",e(st).status)},[()=>We(e(st))]),d(Mr,yr)};D(dn,Mr=>{e(st).url?Mr(fr):Mr(jr,-1)})}d(vr,xn)},$$slots:{default:!0}})}w(Qt),k(tr=>ae(Qt,"aria-label",tr),[()=>e(st).resource?.repository.provider==="gitlab"?v.workspace_hoverCard_mergeRequest_label():v.workspace_hoverCard_pullRequest_label()]),d(Me,Qt)};D(Gr,Me=>{e(dt)&&Me(en)})}var Jr=m(Gr,2);{var ca=Me=>{var st=U0(),Qt=I(st);{var Dt=vr=>{{let cn=u(()=>yl(f()));Hp(vr,{get date(){return e(cn)},class:"type-caption whitespace-nowrap tabular-nums text-muted-foreground",compact:!0})}},tr=u(()=>yl(f())>0);D(Qt,vr=>{e(tr)&&vr(Dt)})}w(st),k(()=>mt(st,1,`wc-secondary shrink-0 ${we()||xe()||h()&&ie()?Ne()?"opacity-0":ce()?"":Te()?"group-hover/wc:opacity-0 group-hover/message:opacity-0":"group-hover:opacity-0 group-hover/message:opacity-0":""}`,"svelte-1ct56pd")),d(Me,st)};D(Jr,Me=>{R()&&Me(ca)})}w(Vr);var Ta=m(Vr,2);{var Ra=Me=>{var st=V0(),Qt=I(st);{var Dt=fr=>{{let jr=u(()=>T()?"text-primary-ink":"text-muted-foreground"),Mr=u(()=>T()?v.workspace_card_unpin_ariaLabel():v.workspace_card_pin_ariaLabel()),yr=u(()=>T()?v.workspace_card_unpin_tooltip():v.workspace_card_pin_tooltip());yt(fr,{variant:"plain",size:"icon-xs",iconOnly:!0,get class(){return`transition-all hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0
263
+ ${xe()?Ne()?"opacity-0":ce()?"":Te()?"group-hover/wc:opacity-0 group-focus-within/wc:opacity-0":"group-hover:opacity-0 group-focus-within:opacity-0":""}`,"svelte-1ct56pd"),ae(tr,"id",`workspace-pinned-state-${f().id??""}`),y(vr,cn)},[()=>v.layout_activeCard_pinned_header()]),d(Me,st)};D(Sr,Me=>{T()&&Me(Er)})}w(gn);var $r=m(gn,2);{var la=Me=>{var st=H0(),Qt=L(st,!0);k(()=>y(Qt,W())),d(Me,st)};D($r,Me=>{W()&&Me(la)})}var Gr=m($r,2);{var en=Me=>{const st=u(()=>e(dt));var Qt=W0(),Dt=I(Qt);{let tr=u(()=>We(e(st)));Fo(Dt,{get content(){return e(tr)},side:"bottom",sideOffset:4,children:(vr,cn)=>{var xn=wt(),dn=Ue(xn);{var fr=Mr=>{{let yr=u(()=>We(e(st)));yt(Mr,{variant:"plain",size:"icon-compact",iconOnly:!0,get class(){return`size-5 shrink-0 rounded-sm ${e(st).foregroundClass??""}`},get"aria-label"(){return e(yr)},"data-workspace-card-pr-item":!0,get"data-pr-identity"(){return e(st).identity},get"data-pr-status"(){return e(st).status},onclick:Or=>{Or.stopPropagation();const Pr=f().id;np(async()=>{const{handleLink:an}=await import("./B6Eksue8.js").then(na=>na.Q);return{handleLink:an}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56]),import.meta.url).then(({handleLink:an})=>an(e(st).url,{workspaceId:Pr,event:Or}))},children:(Or,Pr)=>{Tt(Or,{get icon(){return e(st).statusIcon},size:14})},$$slots:{default:!0}})}},jr=Mr=>{var yr=j0(),Or=I(yr);Tt(Or,{get icon(){return e(st).statusIcon},size:14}),w(yr),k(Pr=>{mt(yr,1,`inline-flex size-5 shrink-0 items-center justify-center rounded-sm ${e(st).foregroundClass??""}`,"svelte-1ct56pd"),ae(yr,"aria-label",Pr),ae(yr,"data-pr-identity",e(st).identity),ae(yr,"data-pr-status",e(st).status)},[()=>We(e(st))]),d(Mr,yr)};D(dn,Mr=>{e(st).url?Mr(fr):Mr(jr,-1)})}d(vr,xn)},$$slots:{default:!0}})}w(Qt),k(tr=>ae(Qt,"aria-label",tr),[()=>e(st).resource?.repository.provider==="gitlab"?v.workspace_hoverCard_mergeRequest_label():v.workspace_hoverCard_pullRequest_label()]),d(Me,Qt)};D(Gr,Me=>{e(dt)&&Me(en)})}var Jr=m(Gr,2);{var ca=Me=>{var st=U0(),Qt=I(st);{var Dt=vr=>{{let cn=u(()=>yl(f()));Hp(vr,{get date(){return e(cn)},class:"type-caption whitespace-nowrap tabular-nums text-muted-foreground",compact:!0})}},tr=u(()=>yl(f())>0);D(Qt,vr=>{e(tr)&&vr(Dt)})}w(st),k(()=>mt(st,1,`wc-secondary shrink-0 ${we()||xe()||h()&&ie()?Ne()?"opacity-0":ce()?"":Te()?"group-hover/wc:opacity-0 group-hover/message:opacity-0":"group-hover:opacity-0 group-hover/message:opacity-0":""}`,"svelte-1ct56pd")),d(Me,st)};D(Jr,Me=>{R()&&Me(ca)})}w(Vr);var Ta=m(Vr,2);{var Ra=Me=>{var st=V0(),Qt=I(st);{var Dt=fr=>{{let jr=u(()=>T()?"text-primary-ink":"text-muted-foreground"),Mr=u(()=>T()?v.workspace_card_unpin_ariaLabel():v.workspace_card_pin_ariaLabel()),yr=u(()=>T()?v.workspace_card_unpin_tooltip():v.workspace_card_pin_tooltip());yt(fr,{variant:"plain",size:"icon-xs",iconOnly:!0,get class(){return`transition-all hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0
264
264
  ${e(jr)??""}`},onclick:Or=>{Or.stopPropagation(),xe()?.(Or)},get"aria-label"(){return e(Mr)},get title(){return e(yr)},children:(Or,Pr)=>{var an=q0(),na=I(an);Tt(na,{get icon(){return pl},size:"xs"}),w(an),d(Or,an)},$$slots:{default:!0}})}};D(Qt,fr=>{xe()&&fr(Dt)})}var tr=m(Qt,2);{var vr=fr=>{{let jr=u(()=>v.workspace_card_markAsRead_label()),Mr=u(()=>v.workspace_card_markAsRead_label());yt(fr,{variant:"plain",size:"icon-xs",iconOnly:!0,class:"text-muted-foreground hover:bg-muted/50 hover:text-foreground focus-visible:border-transparent focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:ring-0",onclick:yr=>{yr.stopPropagation(),ie()?.(yr)},get"aria-label"(){return e(jr)},get title(){return e(Mr)},children:(yr,Or)=>{Tt(yr,{get icon(){return nd},size:"xs"})},$$slots:{default:!0}})}};D(tr,fr=>{h()&&ie()&&fr(vr)})}var cn=m(tr,2);fn(cn,()=>we()??Bs);var xn=m(cn,2);{var dn=fr=>{{let jr=u(bt),Mr=u(()=>v.workspace_progressCard_actions_ariaLabel());Li(fr,{get items(){return e(jr)},get ariaLabel(){return e(Mr)},class:"flex size-5 cursor-pointer items-center justify-center rounded text-muted-foreground transition-colors hover:bg-muted/50 hover:text-foreground focus-visible:bg-muted/50 focus-visible:text-foreground focus-visible:outline-none",get open(){return e(ot)},set open(yr){M(ot,yr,!0)}})}};D(xn,fr=>{ne()&&fr(dn)})}w(st),gr(st,fr=>M(ze,fr),()=>e(ze)),k(()=>mt(st,1,`wc-actions absolute right-1 top-1/2 z-20 flex -translate-y-1/2 items-center gap-0.5 rounded-md bg-accent/95 px-0.5 focus-within:opacity-100
265
265
  ${Te()?"group-focus-within/wc:opacity-100":"group-focus-within:opacity-100"}
266
266
  ${Ne()?"opacity-100":ce()?"opacity-0":Te()?"opacity-0 group-hover/wc:opacity-100":"opacity-0 group-hover:opacity-100"}`,"svelte-1ct56pd")),d(Me,st)};D(Ta,Me=>{(we()||ne()||xe()||h()&&ie())&&Me(Ra)})}w(Bt),gr(Bt,Me=>M(he,Me),()=>e(he)),On(Bt,(Me,st)=>Es?.(Me,st),()=>({id:pe()}));var Yr=m(Bt,2);{var tn=Me=>{hh(Me,{get id(){return e(U)},get anchor(){return`--workspace-list-${f().id??""}`},position:"right",get anchorElement(){return e(he)},class:"w-auto overflow-visible! rounded-lg border-0! bg-background! shadow-none!",onmouseenter:Zt,onmouseleave:_t,onfocusin:Vt,onfocusout:er,children:(st,Qt)=>{var Dt=K0(),tr=I(Dt);bh(tr,{get workspace(){return f()},get activeAgentIds(){return B()},onkeydown:Je}),w(Dt),gr(Dt,vr=>M(tt,vr),()=>e(tt)),Cn("pointerenter",Dt,Zt),Cn("pointerleave",Dt,_t),Rr("focusin",Dt,Vt),Rr("focusout",Dt,er),d(st,Dt)},$$slots:{default:!0}})};D(Yr,Me=>{e(oe)&&!ce()&&Me(tn)})}var j=m(Yr,2);{var De=Me=>{const st=u(bt);var Qt=wt(),Dt=Ue(Qt);{var tr=vr=>{{let cn=u(()=>e(rt)?.x??0),xn=u(()=>e(rt)?.y??0),dn=u(()=>e(rt)?.returnFocus),fr=u(()=>v.workspace_progressCard_actions_ariaLabel());Jc(vr,{get x(){return e(cn)},get y(){return e(xn)},get returnFocus(){return e(dn)},get ariaLabel(){return e(fr)},get items(){return e(st)},onClickOutside:St})}};D(Dt,vr=>{e(st).length>0&&vr(tr)})}d(Me,Qt)};D(j,Me=>{e(rt)&&Me(De)})}k((Me,st,Qt)=>{mt(Bt,1,Me,"svelte-1ct56pd"),ae(Bt,"data-pinned",T()),ae(Bt,"data-highlight-id",pe()),hr=Pn(Bt,"",hr,{"anchor-name":`--workspace-list-${f().id??""}`}),ae(Xn,"id",`workspace-status-state-${f().id??""}`),y(zn,e(G).accessibleName),mt(sr,1,`wc-title type-body min-w-0 truncate font-normal!
@@ -1,4 +1,4 @@
1
- import{c as t,s as r}from"./okmbexJZ.js";import{b as a}from"./Bpy6Muvw.js";var s=a(e=>`${r(e)}
1
+ import{c as t,s as r}from"./CICEz2Qq.js";import{b as a}from"./q4Mp6azq.js";var s=a(e=>`${r(e)}
2
2
  .swimlane.cluster:not([data-color-id]) rect {
3
3
  stroke: ${e.clusterBorder} !important;
4
4
  }
@@ -1 +1 @@
1
- import{d as l,v as h,t as T}from"./WFvSJ9zU.js";import{Hp as c,ub as w}from"./BSwWMzab.js";import{i as W,c as s,n as u,b as m}from"./B-rSL5ZP.js";const E=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||E.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function A(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function N(n,t){return t.length>0&&A(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function I(n,t){return t?u(n,{state:t}):u(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const i=I(t,e),r={workspaceId:n,epoch:s(),startTabId:a};return await i,r}function b(n){return!n||W()}function y(n,t){if(s()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function v(n,t,e){if(b(n))return!1;const a=await S(n,t,e,o(c.state));return y(a,o(c.state))?(c.dispatch(R(n,e)),!0):!1}function*k(n,t,e){if(b(n))return!1;const a=o(yield*h(r=>r)),i=yield*l(S,n,t,e,a);return y(i,o(yield*h(r=>r)))?(yield*T(R(n,e)),!0):!1}function P(){m();const n=s(),t=o(c.state),e=p();return()=>s()===n&&o(c.state)===t&&p()===e}function _(n,t={}){return v(n,d(n,t.query),t.state)}function O(n,t={}){return k(n,d(n,t.query),t.state)}async function $(n){const t=f(n);t?await v(t,n,void 0):await u(n)}function*j(n){const t=f(n);t?yield*l(k,t,n,void 0):yield*l(u,n)}const U=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:P,navigateToAppRoute:$,navigateToAppRouteSaga:j,openAndShowWorkspace:_,showWorkspaceSaga:O,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,j as b,P as c,O as d,d as e,N as i,$ as n,_ as o,f as p,U as s,A as w};
1
+ import{d as l,v as h,t as T}from"./WFvSJ9zU.js";import{Hp as c,ub as w}from"./BSwWMzab.js";import{i as W,c as s,n as u,b as m}from"./D2uybU7F.js";const E=new Set(["new","creating"]);function g(n){let t;try{t=decodeURIComponent(n)}catch{return null}return t.length===0||E.has(t)?null:t}function f(n){const t=/^\/workspace\/([^/?#]+)\/?(?:[?#].*)?$/.exec(n);return t?g(t[1]):null}function A(n){const t=/^\/workspace\/([^/?#]+)(?:[/?#].*)?$/.exec(n);return t?g(t[1]):null}function N(n,t){return t.length>0&&A(n)===t}function p(){return typeof window>"u"?null:window.location?.pathname??null}function d(n,t){const e=`/workspace/${encodeURIComponent(n)}`,a=t?new URLSearchParams(t).toString():"";return a?`${e}?${a}`:e}function R(n,t){const e=t?.presenceFollowRequestId;return e?w(n,e):w(n)}function I(n,t){return t?u(n,{state:t}):u(n)}function o(n){return n?.tabState?.currentTabId??null}async function S(n,t,e,a){m();const i=I(t,e),r={workspaceId:n,epoch:s(),startTabId:a};return await i,r}function b(n){return!n||W()}function y(n,t){if(s()!==n.epoch||t!==n.startTabId&&t!==n.workspaceId)return!1;const e=p();return e===null||f(e)===n.workspaceId}async function v(n,t,e){if(b(n))return!1;const a=await S(n,t,e,o(c.state));return y(a,o(c.state))?(c.dispatch(R(n,e)),!0):!1}function*k(n,t,e){if(b(n))return!1;const a=o(yield*h(r=>r)),i=yield*l(S,n,t,e,a);return y(i,o(yield*h(r=>r)))?(yield*T(R(n,e)),!0):!1}function P(){m();const n=s(),t=o(c.state),e=p();return()=>s()===n&&o(c.state)===t&&p()===e}function _(n,t={}){return v(n,d(n,t.query),t.state)}function O(n,t={}){return k(n,d(n,t.query),t.state)}async function $(n){const t=f(n);t?await v(t,n,void 0):await u(n)}function*j(n){const t=f(n);t?yield*l(k,t,n,void 0):yield*l(u,n)}const U=Object.freeze(Object.defineProperty({__proto__:null,claimNavigation:P,navigateToAppRoute:$,navigateToAppRouteSaga:j,openAndShowWorkspace:_,showWorkspaceSaga:O,workspaceRoute:d},Symbol.toStringTag,{value:"Module"}));export{p as a,j as b,P as c,O as d,d as e,N as i,$ as n,_ as o,f as p,U as s,A as w};
@@ -1,4 +1,4 @@
1
- var Ju=Object.defineProperty;var e1=(t,e,r)=>e in t?Ju(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>e1(t,typeof e!="symbol"?e+"":e,r);import{cA as Gt,aS as t1,dm as Rl,Z as z0,X as va,Y as r1,W as n1,a0 as a1,aa as i1,S as s1,dO as o1,L as l1,b8 as Dl,cD as o0,dl as Nl,aR as c1,aV as u1,cl as h1,c7 as d1,dh as Va,dI as m1,dB as p1,ax as Bn,ak as f1,as as Si,dy as g1,dD as _l,dA as v1}from"./DY6JypjK.js";import{D as Ns,bo as b1,bE as y1,aV as w1}from"./BiMGZT5w.js";import{K as k1,D as n0}from"./UuiGcpAE.js";import{xJ as fn,Hp as E,n5 as ve,n4 as Se,aQ as x1,g as Ll,y as Re,bi as l0,jK as Ai,lo as gn,an as Vt,ln as _s,lx as Ls,lu as Os,jh as Ol,gg as Ka,FW as S1,sg as A1,z3 as T1,o8 as E1,ma as vn,AE as M1,iq as C1,lH as I1,li as z1}from"./BSwWMzab.js";import{bo as ne}from"./BAqR9jtB.js";import{t as rt}from"./Bl_iEh1f.js";import{T as R1,x as xr,y as Sr}from"./C8_w7W1W.js";import{a as c0}from"./BJzHxIyr.js";import{o as me,r as jt,e as u0,s as V,_ as Ye,l as h0,g as D1,n as Le,c as lr,b as He,u as N1,d as _1}from"./UyBYtOpv.js";import{j as Pl}from"./BlOn95cv.js";import{r as L1}from"./Ccf4dYFA.js";import{b as O1}from"./C0VJEx2v.js";import{i as je}from"./BHqHNrOT.js";import{l as ba,c as P1}from"./ChTqQfQN.js";import{ax as d0}from"./C9gP-gRX.js";import{i as Ps}from"./CzRl1R1n.js";import{f as Ti,x as $l,y as Bl,j as $1,v as ql,o as B1,r as q1}from"./-URcs0EB.js";const We=[];for(let t=0;t<256;++t)We.push((t+256).toString(16).slice(1));function F1(t,e=0){return(We[t[e+0]]+We[t[e+1]]+We[t[e+2]]+We[t[e+3]]+"-"+We[t[e+4]]+We[t[e+5]]+"-"+We[t[e+6]]+We[t[e+7]]+"-"+We[t[e+8]]+We[t[e+9]]+"-"+We[t[e+10]]+We[t[e+11]]+We[t[e+12]]+We[t[e+13]]+We[t[e+14]]+We[t[e+15]]).toLowerCase()}const H1=new Uint8Array(16);function U1(){return crypto.getRandomValues(H1)}function Ei(t,e,r){return crypto.randomUUID?crypto.randomUUID():W1(t)}function W1(t,e,r){t=t||{};const n=t.random??t.rng?.()??U1();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,F1(n)}function Mi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=Mi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?k1(r.replace(/\.git\/?$/,""),e):null}function m5(t,e){return t.type==="local"?t.plainFolder?"folder":"local":Mi(t,e)?.provider==="gitlab"?"gitlab":"github"}function Fl(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function p5(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=Fl(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function f5(t){return t.type==="local"&&t.path?t.path:void 0}const G1=["/.clones/","/.repo-cache/"];function g5(t){const e=t.replaceAll("\\","/");return G1.some(r=>e.includes(r))}function v5(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function j1(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function b5(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??j1(r)}}function y5(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,Fl(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const V1="known-repos",K1=6e4;function Y1({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=fn(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(fn(s),s);for(const s of e.repos)a.set(fn(s),s)}const i=[...a.values()].filter(s=>!r[fn(s)]);return n==="all"?i:i.slice(0,9)}function w5(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function k5({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<K1?"skip":"load"}function x5(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=Mi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function X1({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ns)?Ns:null;return s===null||!i(s)?null:s}const S5=E.createSelector(t=>t.workspaceInitializer.hydrated),A5=E.createSelector(t=>t.workspaceInitializer.compactFormState),T5=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),E5=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),M5=E.createSelector(t=>t.workspaceInitializer.branchByRepo),C5=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),I5=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),z5=E.createSelector((t,e)=>Se(t.workspaceInitializer.recentRepoRefreshes,e)),R5=E.createSelector((t,e)=>Se(t.workspaceInitializer.directoryStatusChecks,e)),D5=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),N5=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),_5=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),L5=E.createSelector(t=>t.workspaceInitializer.agentByRepo),O5=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),P5=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),$5=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),B5=E.createSelector((t,e)=>({restore:Se(t.workspaceInitializer.draftRestores,e),clear:Se(t.workspaceInitializer.draftClears,e)})),q5=E.createSelector((t,e,r)=>{const n=Se(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),F5=E.createSelector((t,e)=>Se(t.workspaceInitializer.initializationOutcomes,e)),H5=E.createSelector((t,e)=>Se(t.workspaceInitializer.initializationResumes,e)),U5=E.createSelector(t=>X1({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:y1.select(t),orchestratorId:b1.select(t)?.id??null})),Z1=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Gt.select(t);return e&&r&&t1.select(t)?JSON.stringify([r,e]):null}),W5=E.createSelector(t=>{const e=Z1.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Q1=E.createSelector(t=>{const e=Se(t.workspaceInitializer.recentRepoRefreshes,V1),r=Gt.select(t);return Y1({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),G5=E.createSelector(t=>Rl.select(t)?Q1.select(t):[]),j5=E.createSelector(t=>w1.select(t)||void 0),$s="workspace-debug-flags",bn={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class J1{constructor(){se(this,"flags");se(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return bn;try{const e=localStorage.getItem($s);if(e)return{...bn,...JSON.parse(e)}}catch(e){ba.error("Failed to load debug flags:",e)}return bn}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem($s,JSON.stringify(this.flags))}catch(e){ba.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...bn},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),ba.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const ya=new J1;function V5(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function eh(t){return t.charAt(0).toUpperCase()+t.slice(1)}function K5(t){if(!t||t.trim().length===0)return ne.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ne.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ne.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ne.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ne.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ne.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ne.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ne.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ne.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ne.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ne.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ne.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ne.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ne.workspace_sidebarHeader_branchTooLong_error()}function Y5(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function Ya(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function X5(t,e){return`${e}:${t.agentId??"manual"}`}function th(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function rh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function nh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function Z5(t,e,r,n){const a=th(t,e),i=n?` (origin/${n})`:"";return r?a===1?ne.workspace_sidebarChanges_addToPr_one({suffix:i}):ne.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ne.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ne.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function Q5(t,e,r){const n=rh(t,e),a=r?` (origin/${r})`:"";return n===1?ne.workspace_sidebarChanges_undoPush_one({suffix:a}):ne.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function J5(t,e){const r=nh(t,e);return r===1?ne.workspace_sidebarChanges_undoCommit_one():ne.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function e3(t,e){return e===0&&t.length>0}function t3(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function r3(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function n3(t,e,r){return r?.path===t&&r?.staged===e}function a3(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function i3(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function ah(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function s3(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=ah(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:Ya(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Ci(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:Ya(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function o3(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??x1.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function ih(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function wa(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=z0(i),c=o.toLowerCase(),h=a.find(m=>!!o&&m.url.toLowerCase()===c||(i.resource||i.monitorAvailability?m.monitorIdentity===va(i):!m.resource&&!m.monitorAvailability&&(s?!m.crossRepo&&m.number===i.prNumber:m.crossRepo===i.repo&&m.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?va(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${r1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?va(i):void 0,url:o,htmlUrl:o,status:ih(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Ci(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Ci(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function l3(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const S of n)S.repoOwner&&S.repoName&&s.add(`${S.repoOwner}/${S.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(S=>S.crossRepo)){o=[];for(const S of t)S.crossRepo?s.has(S.crossRepo.toLowerCase())?c.push(S):h.push(S):o.push(S)}const m=[],g=[],v=[];for(const S of e){const C=S.repo.toLowerCase();z0(S)&&o.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&(!i||C===i)?m.push(S):z0(S)&&c.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&s.has(C)?g.push(S):v.push(S)}const w=wa(o,m,r),A=r?.split("/")[0],M=new Set([...w,...c,...h].map(S=>`${(S.crossRepo??r??"").toLowerCase()}#${S.number}`)),D=[...c];for(const S of n){if(!S.repoOwner||!S.repoName)continue;const C=`${S.repoOwner}/${S.repoName}`;for(const W of S.pullRequests??[]){const X=`${C.toLowerCase()}#${W.number}`;if(M.has(X))continue;M.add(X);const Y=W.url||`https://github.com/${C}/pull/${W.number}`,T=i!==void 0&&C.toLowerCase()===i;D.push({number:W.number,title:a(W),url:Y,htmlUrl:Y,status:Ya(W.status),createdAt:W.createdAt,updatedAt:W.updatedAt,crossRepo:T?void 0:C,crossRepoDisplay:T?void 0:Ci(C,A)})}}return{own:w,otherRoots:wa(D,g,r),otherTracked:wa(h,v,r)}}function Bs(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function c3(t){const e=t.status==="merged"?ne.workspace_prSection_merged_label():t.status==="closed"?ne.workspace_prSection_closed_label():t.status==="draft"?ne.workspace_prSection_statusDraft_label():Bs(t)?ne.workspace_prSection_statusQueued_label():ne.workspace_prSection_statusOpen_label(),r=[n1(t)??e],n=Bs(t)?R1(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ne.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ne.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ne.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ne.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ne.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ne.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ne.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(eh(a.mergeBlockedReason))),r.join(`
1
+ var Ju=Object.defineProperty;var e1=(t,e,r)=>e in t?Ju(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var se=(t,e,r)=>e1(t,typeof e!="symbol"?e+"":e,r);import{cA as Gt,aS as t1,dm as Rl,Z as z0,X as va,Y as r1,W as n1,a0 as a1,aa as i1,S as s1,dO as o1,L as l1,b8 as Dl,cD as o0,dl as Nl,aR as c1,aV as u1,cl as h1,c7 as d1,dh as Va,dI as m1,dB as p1,ax as Bn,ak as f1,as as Si,dy as g1,dD as _l,dA as v1}from"./DY6JypjK.js";import{D as Ns,bo as b1,bE as y1,aV as w1}from"./C80u9j_3.js";import{K as k1,D as n0}from"./UuiGcpAE.js";import{xJ as fn,Hp as E,n5 as ve,n4 as Se,aQ as x1,g as Ll,y as Re,bi as l0,jK as Ai,lo as gn,an as Vt,ln as _s,lx as Ls,lu as Os,jh as Ol,gg as Ka,FW as S1,sg as A1,z3 as T1,o8 as E1,ma as vn,AE as M1,iq as C1,lH as I1,li as z1}from"./BSwWMzab.js";import{bo as ne}from"./BAqR9jtB.js";import{t as rt}from"./Bl_iEh1f.js";import{T as R1,x as xr,y as Sr}from"./C8_w7W1W.js";import{a as c0}from"./BJzHxIyr.js";import{o as me,r as jt,e as u0,s as V,_ as Ye,l as h0,g as D1,n as Le,c as lr,b as He,u as N1,d as _1}from"./UyBYtOpv.js";import{j as Pl}from"./BlOn95cv.js";import{r as L1}from"./Ccf4dYFA.js";import{b as O1}from"./C0VJEx2v.js";import{i as je}from"./BHqHNrOT.js";import{l as ba,c as P1}from"./ChTqQfQN.js";import{ax as d0}from"./C9gP-gRX.js";import{i as Ps}from"./CzRl1R1n.js";import{f as Ti,x as $l,y as Bl,j as $1,v as ql,o as B1,r as q1}from"./-URcs0EB.js";const We=[];for(let t=0;t<256;++t)We.push((t+256).toString(16).slice(1));function F1(t,e=0){return(We[t[e+0]]+We[t[e+1]]+We[t[e+2]]+We[t[e+3]]+"-"+We[t[e+4]]+We[t[e+5]]+"-"+We[t[e+6]]+We[t[e+7]]+"-"+We[t[e+8]]+We[t[e+9]]+"-"+We[t[e+10]]+We[t[e+11]]+We[t[e+12]]+We[t[e+13]]+We[t[e+14]]+We[t[e+15]]).toLowerCase()}const H1=new Uint8Array(16);function U1(){return crypto.getRandomValues(H1)}function Ei(t,e,r){return crypto.randomUUID?crypto.randomUUID():W1(t)}function W1(t,e,r){t=t||{};const n=t.random??t.rng?.()??U1();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,F1(n)}function Mi(t,e){if(t.repositoryIdentity===null)return null;if(t.repositoryIdentity){const{provider:a,instanceBaseUrl:i,projectPath:s}=t.repositoryIdentity,o=Mi({...t,repositoryIdentity:void 0,githubUrl:`${i}/${s}`},a==="gitlab"?i:void 0);return o?.provider===a?o:null}const r=t.githubUrl;if(!r)return null;const n=/^(?:https:\/\/github\.com\/|git@github\.com:)([A-Za-z0-9_.-]+)\/([A-Za-z0-9_.-]+?)(?:\.git)?\/?$/i.exec(r);return n&&!n.slice(1).some(a=>a==="."||a==="..")?{provider:"github",instanceBaseUrl:"https://github.com",projectPath:`${n[1]}/${n[2]}`}:e?k1(r.replace(/\.git\/?$/,""),e):null}function m5(t,e){return t.type==="local"?t.plainFolder?"folder":"local":Mi(t,e)?.provider==="gitlab"?"gitlab":"github"}function Fl(t){const e=t.split(/[\\/]/).filter(Boolean);return e[e.length-1]??""}function p5(t){if(t.type!=="local")return{ownerPrefix:t.owner,primary:t.name};const e=Fl(t.path)||t.name,r=t.owner?`${t.owner}/${t.name}`:void 0;return{primary:e,suffix:r}}function f5(t){return t.type==="local"&&t.path?t.path:void 0}const G1=["/.clones/","/.repo-cache/"];function g5(t){const e=t.replaceAll("\\","/");return G1.some(r=>e.includes(r))}function v5(t){const e=new Set;for(const r of t){const{repositoryPath:n,worktreePath:a}=r;n&&a&&n===a&&e.add(n)}return e}function j1(t){return t.includes("\\")||t.includes(":")||t.startsWith("/")?void 0:/^([^/]+)\/[^/]+$/.exec(t)?.[1]}function b5(t,e){const{selectedValue:r,selectedRepoType:n,confirmedGithubUrl:a}=t;if(!(n!=="github"||!r)){if(a){const i=e(a)?.owner;if(i)return i}return e(r)?.owner??j1(r)}}function y5(t,e){const r=e.trim().toLowerCase();return r===""?!0:[t.name,t.path,Fl(t.path),t.owner,t.owner?`${t.owner}/${t.name}`:void 0].some(a=>a?.toLowerCase().includes(r)??!1)}const V1="known-repos",K1=6e4;function Y1({saved:t,source:e,dismissed:r,mode:n}){if(!e)return[...t];const a=new Map;if(n==="all")for(const s of[...e.repos,...t]){const o=fn(s);a.has(o)||a.set(o,s)}else{for(const s of t)a.set(fn(s),s);for(const s of e.repos)a.set(fn(s),s)}const i=[...a.values()].filter(s=>!r[fn(s)]);return n==="all"?i:i.slice(0,9)}function w5(t){const e=t.lastUsedAt?Date.parse(t.lastUsedAt):NaN;return Number.isFinite(e)?e:0}function k5({visible:t,admission:e,entry:r,readyAt:n,now:a}){return!t||!e?"skip":!r||r.admission!==e?"load":r.status==="pending"?"reuse":r.status==="ready"&&n?.requestId===r.requestId&&a-n.at<K1?"skip":"load"}function x5(t,e){if(t.type==="local")return t.plainFolder?{repoPath:t.path,plainFolder:!0}:{repoPath:t.path};const r=Mi(t,e);return r?.provider==="gitlab"?{repositoryCheckoutDraft:{instanceBaseUrl:r.instanceBaseUrl,projectPath:r.projectPath}}:r?{githubUrl:`https://github.com/${r.projectPath}`,exactRemote:!0}:{githubUrl:t.githubUrl||`https://github.com/${t.path}`,exactRemote:!0}}function X1({compactFormState:t,lastSubmittedAgent:e,specialists:r,orchestratorId:n}){if(t?.isTeamMode??e?.isTeamMode??!1)return n;const i=o=>r.some(c=>c.id===o),s=t?.selectedSpecialist!==void 0?t.selectedSpecialist:e?.selectedSpecialist!==void 0?e.selectedSpecialist:i(Ns)?Ns:null;return s===null||!i(s)?null:s}const S5=E.createSelector(t=>t.workspaceInitializer.hydrated),A5=E.createSelector(t=>t.workspaceInitializer.compactFormState),T5=E.createSelector(t=>t.workspaceInitializer.onboardingFormState),E5=E.createSelector(t=>t.workspaceInitializer.lastSelectedRepo),M5=E.createSelector(t=>t.workspaceInitializer.branchByRepo),C5=E.createSelector(t=>t.workspaceInitializer.defaultParentPath),I5=E.createSelector(t=>ve(t.workspaceInitializer.recentRepos)),z5=E.createSelector((t,e)=>Se(t.workspaceInitializer.recentRepoRefreshes,e)),R5=E.createSelector((t,e)=>Se(t.workspaceInitializer.directoryStatusChecks,e)),D5=E.createSelector(t=>t.workspaceInitializer.dismissedRecentRepoKeys),N5=E.createSelector(t=>ve(t.workspaceInitializer.remoteSetups)),_5=E.createSelector(t=>t.workspaceInitializer.lastSubmittedAgent),L5=E.createSelector(t=>t.workspaceInitializer.agentByRepo),O5=E.createSelector(t=>t.workspaceInitializer.recentSpecialistIds),P5=E.createSelector((t,e)=>t.workspaceInitializer.agentByRepo[e]??null),$5=E.createSelector(t=>t.workspaceInitializer.pendingGitHubPrefill),B5=E.createSelector((t,e)=>({restore:Se(t.workspaceInitializer.draftRestores,e),clear:Se(t.workspaceInitializer.draftClears,e)})),q5=E.createSelector((t,e,r)=>{const n=Se(t.workspaceInitializer.initializationOutcomes,e);return n?.resourceId===r?n:void 0}),F5=E.createSelector((t,e)=>Se(t.workspaceInitializer.initializationOutcomes,e)),H5=E.createSelector((t,e)=>Se(t.workspaceInitializer.initializationResumes,e)),U5=E.createSelector(t=>X1({compactFormState:t.workspaceInitializer.compactFormState,lastSubmittedAgent:t.workspaceInitializer.lastSubmittedAgent,specialists:y1.select(t),orchestratorId:b1.select(t)?.id??null})),Z1=E.createSelector(t=>{const e=t.workspaceInitializer.gitCheckRequest,r=Gt.select(t);return e&&r&&t1.select(t)?JSON.stringify([r,e]):null}),W5=E.createSelector(t=>{const e=Z1.select(t),r=t.workspaceInitializer.gitCheck;return e&&r?.context===e?r.available:null}),Q1=E.createSelector(t=>{const e=Se(t.workspaceInitializer.recentRepoRefreshes,V1),r=Gt.select(t);return Y1({saved:ve(t.workspaceInitializer.recentRepos),source:e&&r&&e.admission===r?e:null,dismissed:t.workspaceInitializer.dismissedRecentRepoKeys,mode:"all"})}),G5=E.createSelector(t=>Rl.select(t)?Q1.select(t):[]),j5=E.createSelector(t=>w1.select(t)||void 0),$s="workspace-debug-flags",bn={enableCreationAnimation:!0,animationDuration:300,enablePageTransitions:!0,enableComponentTransitions:!0,showDebugInfo:!1,showPerformanceMetrics:!1,logStateChanges:!1,enableAutofocus:!0,enableBranchCaching:!0,enableFormPersistence:!0,simulateSlowNetwork:!1,simulateErrors:!1,networkDelay:0};class J1{constructor(){se(this,"flags");se(this,"listeners",new Set);this.flags=this.loadFlags()}loadFlags(){if(typeof localStorage>"u")return bn;try{const e=localStorage.getItem($s);if(e)return{...bn,...JSON.parse(e)}}catch(e){ba.error("Failed to load debug flags:",e)}return bn}saveFlags(){if(!(typeof localStorage>"u")){try{localStorage.setItem($s,JSON.stringify(this.flags))}catch(e){ba.error("Failed to save debug flags:",e)}this.listeners.forEach(e=>e(this.flags))}}get(e){return this.flags[e]}set(e,r){this.flags[e]=r,this.saveFlags()}toggle(e){typeof this.flags[e]=="boolean"&&(this.flags[e]=!this.flags[e],this.saveFlags())}reset(){this.flags={...bn},this.saveFlags()}getAll(){return{...this.flags}}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}toggleDebugPanel(){this.toggle("showDebugInfo"),ba.info("Debug panel:",this.flags.showDebugInfo?"ON":"OFF")}async simulateDelay(e){return this.flags.simulateSlowNetwork&&this.flags.networkDelay>0&&await new Promise(r=>setTimeout(r,this.flags.networkDelay)),e}}const ya=new J1;function V5(t){if(!t)return"";let e=t;return e=e.replace(/\*\*(.+?)\*\*/g,"$1"),e=e.replace(/__(.+?)__/g,"$1"),e=e.replace(/(?<!\*)\*(?!\*)(.+?)(?<!\*)\*(?!\*)/g,"$1"),e=e.replace(/(?<!_)_(?!_)(.+?)(?<!_)_(?!_)/g,"$1"),e=e.replace(/~~(.+?)~~/g,"$1"),e=e.replace(/`([^`]+)`/g,"$1"),e=e.replace(/\[([^\]]+)\]\([^)]+\)/g,"$1"),e=e.replace(/^#{1,6}\s+/gm,""),e=e.replace(/^\*+\s*/gm,""),e=e.replace(/\s*\*+$/gm,""),e.trim()}function eh(t){return t.charAt(0).toUpperCase()+t.slice(1)}function K5(t){if(!t||t.trim().length===0)return ne.workspace_sidebarHeader_branchEmpty_error();if(/[\s~^:\\?*\[\\]/.test(t))return ne.workspace_sidebarHeader_branchInvalidChars_error();if(t.includes("@{"))return ne.workspace_sidebarChanges_branchAtBrace_error({seq:"@{"});if(t==="@")return ne.workspace_sidebarChanges_branchAt_error({symbol:"@"});if(t.startsWith("."))return ne.workspace_sidebarHeader_branchStartsDot_error();if(t.endsWith(".lock"))return ne.workspace_sidebarHeader_branchEndsLock_error();if(t.includes(".."))return ne.workspace_sidebarHeader_branchDoubleDot_error();if(t.startsWith("/")||t.endsWith("/"))return ne.workspace_sidebarHeader_branchSlashEnds_error();if(t.includes("//"))return ne.workspace_sidebarHeader_branchDoubleSlash_error();if(t.startsWith("-"))return ne.workspace_sidebarHeader_branchStartsDash_error();if(t.endsWith("."))return ne.workspace_sidebarChanges_branchEndsPeriod_error();const e=t.split("/");for(const r of e){if(r.startsWith("."))return ne.workspace_sidebarChanges_branchComponentStartsDot_error();if(r.endsWith(".lock"))return ne.workspace_sidebarChanges_branchComponentEndsLock_error()}if(t.length>250)return ne.workspace_sidebarHeader_branchTooLong_error()}function Y5(t,e,r,n){return e&&r?`https://github.com/${e}/${r}/pull/${t}`:n||""}function Ya(t){return t==="Open"?"open":t==="Merged"?"merged":t==="Draft"?"draft":"closed"}function X5(t,e){return`${e}:${t.agentId??"manual"}`}function th(t,e){if(t.length===0||e>=t.length)return 0;const r=Math.max(0,e);let n=0;for(let a=r;a<t.length;a++)t[a].isPushed||n++;return n}function rh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed&&n++;return n}function nh(t,e){if(t.length===0||e<0)return 0;const r=Math.min(e,t.length-1);let n=0;for(let a=0;a<=r;a++)t[a].isPushed||n++;return n}function Z5(t,e,r,n){const a=th(t,e),i=n?` (origin/${n})`:"";return r?a===1?ne.workspace_sidebarChanges_addToPr_one({suffix:i}):ne.workspace_sidebarChanges_addToPr_many({count:rt(a),suffix:i}):a===1?ne.workspace_sidebarChanges_pushToRemote_one({suffix:i}):ne.workspace_sidebarChanges_pushToRemote_many({count:rt(a),suffix:i})}function Q5(t,e,r){const n=rh(t,e),a=r?` (origin/${r})`:"";return n===1?ne.workspace_sidebarChanges_undoPush_one({suffix:a}):ne.workspace_sidebarChanges_undoPush_many({count:rt(n),suffix:a})}function J5(t,e){const r=nh(t,e);return r===1?ne.workspace_sidebarChanges_undoCommit_one():ne.workspace_sidebarChanges_undoCommit_many({count:rt(r)})}function e3(t,e){return e===0&&t.length>0}function t3(t,e,r,n){return!r||n==null?!1:t===r&&e===n}function r3(t,e,r){const n=`${e?"staged":"unstaged"}:${t}`;return r.has(n)}function n3(t,e,r){return r?.path===t&&r?.staged===e}function a3(t){if(t.length===0)return[];const e=new Map,r=[...t].sort((n,a)=>n.timestamp-a.timestamp);for(const n of r)for(const a of n.files??[]){const i=e.get(a.path);i?e.set(a.path,{additions:i.additions+(a.additions||0),deletions:i.deletions+(a.deletions||0)}):e.set(a.path,{additions:a.additions||0,deletions:a.deletions||0})}return Array.from(e.entries()).map(([n,a])=>({path:n,additions:a.additions,deletions:a.deletions,staged:!1}))}function i3(t,e,r){const n=new Set;let a=0,i=0;for(const s of t)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of e)n.add(s.relativePath),a+=s.stats?.additions||0,i+=s.stats?.deletions||0;for(const s of r)for(const o of s.files||[])n.add(o.path),a+=o.additions||0,i+=o.deletions||0;return{totalFilesChanged:n.size,totalAdditions:a,totalDeletions:i}}function ah(t){const e=t?.match(/^https?:\/\/github\.com\/([^/]+)\/([^/]+)\/pull\/\d+/i);return e?`${e[1]}/${e[2]}`:void 0}function s3(t,e,r,n,a){if(t&&t.length>0){const i=a?.split("/")[0];return t.map(s=>{const o=s.url||r(s.number),c=ah(s.url),h=c!==void 0&&c.toLowerCase()!==a?.toLowerCase()?c:void 0;return{number:s.number,title:n(s),url:o,htmlUrl:o,status:Ya(s.status),createdAt:s.createdAt,updatedAt:s.updatedAt,isInMergeQueue:s.isDraft?void 0:s.isInMergeQueue,crossRepo:h,crossRepoDisplay:h?Ci(h,i):void 0}})}return e?[{number:e.number,title:n(e),url:r(e.number,e.url),htmlUrl:r(e.number,e.url),status:Ya(e.status),createdAt:e.createdAt,updatedAt:e.updatedAt,isInMergeQueue:e.isDraft?void 0:e.isInMergeQueue}]:[]}function o3(t){const{prNumber:e,prUrl:r}=t;return e==null||!r?null:{id:`legacy-pr-${e}`,number:e,url:r,title:"",status:t.prStatus??x1.Open,createdAt:t.updatedAt,updatedAt:t.updatedAt}}function ih(t){const e=t.lastSnapshot?.state?.toLowerCase();return e==="merged"?"merged":e==="closed"?"closed":t.lastSnapshot?.isDraft?"draft":t.state==="completed"?"closed":"open"}function wa(t,e,r){if(e.length===0)return t;const n=r?.split("/")[0],a=t.map(i=>({...i}));for(const i of e){const s=!i.resource&&!i.monitorAvailability&&(!r||i.repo===r),o=z0(i),c=o.toLowerCase(),h=a.find(m=>!!o&&m.url.toLowerCase()===c||(i.resource||i.monitorAvailability?m.monitorIdentity===va(i):!m.resource&&!m.monitorAvailability&&(s?!m.crossRepo&&m.number===i.prNumber:m.crossRepo===i.repo&&m.number===i.prNumber)));if(h){h.monitorAgentId=i.agentId,h.resource=i.resource,h.monitorAvailability=i.monitorAvailability,h.monitorIdentity=i.resource||i.monitorAvailability?va(i):void 0,h.monitorSnapshot=i.lastSnapshot??h.monitorSnapshot;continue}a.push({number:i.prNumber,title:i.title??`${i.repo}${r1(i,i.prNumber)}`,resource:i.resource,monitorAvailability:i.monitorAvailability,monitorIdentity:i.resource||i.monitorAvailability?va(i):void 0,url:o,htmlUrl:o,status:ih(i),createdAt:i.createdAt,updatedAt:i.updatedAt,monitorAgentId:i.agentId,crossRepo:s?void 0:i.repo,crossRepoDisplay:s?void 0:Ci(i.repo,n),monitorSnapshot:i.lastSnapshot,monitorOnly:!0})}return a}function Ci(t,e){return e&&t.toLowerCase().startsWith(`${e.toLowerCase()}/`)?t.slice(e.length+1):t}function l3(t,e,r,n,a){const i=r?.toLowerCase(),s=new Set;for(const S of n)S.repoOwner&&S.repoName&&s.add(`${S.repoOwner}/${S.repoName}`.toLowerCase());let o=t;const c=[],h=[];if(t.some(S=>S.crossRepo)){o=[];for(const S of t)S.crossRepo?s.has(S.crossRepo.toLowerCase())?c.push(S):h.push(S):o.push(S)}const m=[],g=[],v=[];for(const S of e){const C=S.repo.toLowerCase();z0(S)&&o.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&(!i||C===i)?m.push(S):z0(S)&&c.some(W=>W.url===z0(S))||!S.resource&&!S.monitorAvailability&&s.has(C)?g.push(S):v.push(S)}const w=wa(o,m,r),A=r?.split("/")[0],M=new Set([...w,...c,...h].map(S=>`${(S.crossRepo??r??"").toLowerCase()}#${S.number}`)),D=[...c];for(const S of n){if(!S.repoOwner||!S.repoName)continue;const C=`${S.repoOwner}/${S.repoName}`;for(const W of S.pullRequests??[]){const X=`${C.toLowerCase()}#${W.number}`;if(M.has(X))continue;M.add(X);const Y=W.url||`https://github.com/${C}/pull/${W.number}`,T=i!==void 0&&C.toLowerCase()===i;D.push({number:W.number,title:a(W),url:Y,htmlUrl:Y,status:Ya(W.status),createdAt:W.createdAt,updatedAt:W.updatedAt,crossRepo:T?void 0:C,crossRepoDisplay:T?void 0:Ci(C,A)})}}return{own:w,otherRoots:wa(D,g,r),otherTracked:wa(h,v,r)}}function Bs(t){return t.status!=="open"?!1:t.monitorSnapshot?t.monitorSnapshot.isInMergeQueue===!0:t.isInMergeQueue===!0}function c3(t){const e=t.status==="merged"?ne.workspace_prSection_merged_label():t.status==="closed"?ne.workspace_prSection_closed_label():t.status==="draft"?ne.workspace_prSection_statusDraft_label():Bs(t)?ne.workspace_prSection_statusQueued_label():ne.workspace_prSection_statusOpen_label(),r=[n1(t)??e],n=Bs(t)?R1(t.monitorSnapshot?.mergeQueue):null;n&&r.push(n);const a=t.status==="merged"||t.status==="closed"?void 0:t.monitorSnapshot;return a&&(a.checks.total===null||a.checks.passed===null||a.checks.failed===null||a.checks.pending===null||a.availability&&a.availability.checks!=="available"?r.push(ne.chat_monitoredPrs_hover_checksUnknown_label()):a.checks.total>0&&r.push(ne.workspace_prSection_statusChecks_tooltip({passed:rt(a.checks.passed),failed:rt(a.checks.failed),pending:rt(a.checks.pending)})),r.push(a.approvals.have===null||a.availability&&a.availability.approvals!=="available"?ne.chat_monitoredPrs_hover_approvalsUnknown_label():a.approvals.needed!=null?ne.workspace_prSection_statusApprovalsOfNeeded_tooltip({count:rt(a.approvals.have),needed:rt(a.approvals.needed)}):ne.workspace_prSection_statusApprovals_tooltip({count:rt(a.approvals.have)})),a.approvals.changesRequested!==null&&a.approvals.changesRequested>0&&r.push(ne.workspace_prSection_statusChangesRequested_tooltip({count:rt(a.approvals.changesRequested)})),a.availability&&a.availability.discussions!=="available"?r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()):typeof a.threads.unresolved=="number"?a.threads.unresolved>0&&r.push(ne.workspace_prSection_statusUnresolvedThreads_tooltip({count:rt(a.threads.unresolved)})):a.threads.resolutionRequired&&r.push(ne.workspace_prSection_statusUnresolvedThreadsUnknown_tooltip()),a.mergeBlockedReason&&r.push(eh(a.mergeBlockedReason))),r.join(`
2
2
  `)}function u3(t,e){return e.has(t??"manual")}function h3(t,e){return{path:t.relativePath,additions:t.stats.additions,deletions:t.stats.deletions,staged:e,status:t.status,attribution:t.attribution?.agent?{agentId:t.attribution.agent.agentId,agentName:t.attribution.agent.agentName,sessionId:t.attribution.agent.sessionId,turnNumber:t.attribution.agent.turnNumber,timestamp:t.attribution.timestamp}:void 0}}const Hl=500;function d3(t,e=Hl){const r=Math.max(0,Math.floor(e));return t.length<=r?{visible:t,shown:t.length,hiddenCount:0}:{visible:t.slice(0,r),shown:r,hiddenCount:t.length-r}}function m3(t,e,r=Hl){let n=Math.max(0,Math.floor(r)),a=0,i=0;return{groups:t.map(o=>{if(e(o))return{group:o,visibleFiles:[]};const c=Math.min(n,o.files.length);return n-=c,a+=c,i+=o.files.length-c,{group:o,visibleFiles:c===o.files.length?o.files:o.files.slice(0,c)}}),shown:a,hiddenCount:i}}function p3(t){if(t.hiddenCount<=0)return"";const e=rt(t.shown),r=rt(t.shown+t.hiddenCount);return t.hiddenCount===1?ne.workspace_fileChanges_hiddenFiles_one({shown:e,total:r}):ne.workspace_fileChanges_hiddenFiles_many({shown:e,total:r,count:rt(t.hiddenCount)})}function sh(t){if(!t)return{};try{const e=JSON.parse(t);return e&&typeof e=="object"?e:{}}catch{return{}}}function Xa(t){return t.startsWith("@")?t.slice(1):t}function oh(t,e,r,n){const a=t.fullPath||t.path||t.filename;if(a)return Xa(String(a));const i=[r,e,n.trim()].map(Xa).filter(Boolean),s=i.find(o=>o.includes("/"))??i[0];return s?a1(s).path:void 0}function lh(t){const e=t.line??t.startLine??t.range?.start;return typeof e=="number"&&Number.isFinite(e)?e:void 0}function ch(t){if(!t||t.getAttribute("data-mention")===null)return null;const e=t.getAttribute("data-type")||"",r=t.getAttribute("data-id")||"",n=t.getAttribute("data-label")||"",a=t.getAttribute("data-uri")||"",i=sh(t.getAttribute("data-meta")),s={type:e,id:r,label:n,uri:a,meta:i},o=a.startsWith("intent://")?a:typeof i.fullUrl=="string"&&i.fullUrl.startsWith("intent://")?i.fullUrl:void 0;if(o&&(s.intentUrl=o),e==="file"||e==="file-range"){const c=oh(i,n,r,t.textContent||"");c&&(s.filePath=c);const h=lh(i);h!==void 0&&(s.line=h)}else if(e==="folder"||e==="source-folder"){const c=i.fullPath||i.path||r||n,h=c?Xa(String(c)).replace(/\/+$/,""):"";h&&(s.folderPath=h)}else if(e==="note"||e==="note-range"){const c=i.noteId||r;c&&(s.note=i.isExternalLink&&i.workspaceId?{id:c,workspaceId:String(i.workspaceId)}:{id:c})}return s}function f3(t){return{sidebarTabId:"files",type:"file",filePath:`${t}/`}}function Ii(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var Lr=Ii();function Ul(t){Lr=t}var Ir={exec:()=>null};function Kr(t){let e=[];return r=>{let n=Math.max(0,Math.min(3,r-1)),a=e[n];return a||(a=t(n),e[n]=a),a}}function ce(t,e=""){let r=typeof t=="string"?t:t.source,n={replace:(a,i)=>{let s=typeof i=="string"?i:i.source;return s=s.replace(Ke.caret,"$1"),r=r.replace(a,s),n},getRegex:()=>new RegExp(r,e)};return n}var uh=((t="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+t)}catch{return!1}})(),Ke={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,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ 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,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:t=>new RegExp(`^( {0,3}${t})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:Kr(t=>new RegExp(`^ {0,${t}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:Kr(t=>new RegExp(`^ {0,${t}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:Kr(t=>new RegExp(`^ {0,${t}}(?:\`\`\`|~~~)`)),headingBeginRegex:Kr(t=>new RegExp(`^ {0,${t}}#`)),htmlBeginRegex:Kr(t=>new RegExp(`^ {0,${t}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:Kr(t=>new RegExp(`^ {0,${t}}>`))},hh=/^(?:[ \t]*(?:\n|$))+/,dh=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,mh=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,U0=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ph=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,zi=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,Wl=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,Gl=ce(Wl).replace(/bull/g,zi).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),fh=ce(Wl).replace(/bull/g,zi).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}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ri=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,gh=/^[^\n]+/,Di=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,vh=ce(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",Di).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),bh=ce(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,zi).getRegex(),qn="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",Ni=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,yh=ce("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\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",Ni).replace("tag",qn).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),jl=t=>ce(Ri).replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",t).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex(),wh=jl(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),kh=jl(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),xh=ce(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",kh).getRegex(),_i={blockquote:xh,code:dh,def:vh,fences:mh,heading:ph,hr:U0,html:yh,lheading:Gl,list:bh,newline:hh,paragraph:wh,table:Ir,text:gh},qs=ce("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex(),Sh={..._i,lheading:fh,table:qs,paragraph:ce(Ri).replace("hr",U0).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",qs).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",qn).getRegex()},Ah={..._i,html:ce(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ni).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:Ir,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ce(Ri).replace("hr",U0).replace("heading",` *#{1,6} *[^
3
3
  ]`).replace("lheading",Gl).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},Th=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,Eh=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,Vl=/^( {2,}|\\)\n(?!\s*$)/,Mh=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,Kt=/[\p{P}\p{S}]/u,m0=/[\s\p{P}\p{S}]/u,W0=/[^\s\p{P}\p{S}]/u,Ch=ce(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,m0).getRegex(),Ih=/[\p{Pi}\p{Ps}"']/u,Kl=/(?!~)[\p{P}\p{S}]/u,zh=/(?!~)[\s\p{P}\p{S}]/u,Rh=/(?:[^\s\p{P}\p{S}]|~)/u,Dh=ce(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",uh?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),Yl=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,Nh=ce(Yl,"u").replace(/punct/g,Kt).getRegex(),_h=ce(Yl,"u").replace(/punct/g,Kl).getRegex(),Lh=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Oh=ce(Lh,"u").replace(/openQuote/g,Ih).replace(/punct/g,Kt).getRegex(),Xl="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",Ph=ce(Xl,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Kt).getRegex(),$h=ce(Xl,"gu").replace(/notPunctSpace/g,Rh).replace(/punctSpace/g,zh).replace(/punct/g,Kl).getRegex(),Bh="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",qh=ce(Bh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Kt).getRegex(),Fh=ce("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Kt).getRegex(),Hh="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Uh=ce(Hh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Kt).getRegex(),Wh=ce(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,Kt).getRegex(),Gh="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",jh=ce(Gh,"gu").replace(/notPunctSpace/g,W0).replace(/punctSpace/g,m0).replace(/punct/g,Kt).getRegex(),Vh=ce(/\\(punct)/,"gu").replace(/punct/g,Kt).getRegex(),Kh=ce(/^<(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(),Yh=ce(Ni).replace("(?:-->|$)","-->").getRegex(),Xh=ce("^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",Yh).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Nn=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Zh=ce(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Nn).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),Zl=ce(/^!?\[(label)\]\[(ref)\]/).replace("label",Nn).replace("ref",Di).getRegex(),Ql=ce(/^!?\[(ref)\](?:\[\])?/).replace("ref",Di).getRegex(),Qh=ce("reflink|nolink(?!\\()","g").replace("reflink",Zl).replace("nolink",Ql).getRegex(),Fs=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Li={_backpedal:Ir,anyPunctuation:Vh,autolink:Kh,blockSkip:Dh,br:Vl,code:Eh,del:Ir,delLDelim:Ir,delRDelim:Ir,emStrongLDelim:Nh,emStrongRDelimAst:Ph,emStrongRDelimUnd:Fh,escape:Th,link:Zh,nolink:Ql,punctuation:Ch,reflink:Zl,reflinkSearch:Qh,tag:Xh,text:Mh,url:Ir},Jh={...Li,emStrongLDelim:Oh,emStrongRDelimAst:qh,emStrongRDelimUnd:Uh,link:ce(/^!?\[(label)\]\((.*?)\)/).replace("label",Nn).getRegex(),reflink:ce(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Nn).getRegex()},Za={...Li,emStrongRDelimAst:$h,emStrongLDelim:_h,delLDelim:Wh,delRDelim:jh,url:ce(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Fs).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\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ce(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Fs).getRegex()},ed={...Za,br:ce(Vl).replace("{2,}","*").getRegex(),text:ce(Za.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},yn={normal:_i,gfm:Sh,pedantic:Ah},x0={normal:Li,gfm:Za,breaks:ed,pedantic:Jh},td={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Hs=t=>td[t];function Dt(t,e){if(e){if(Ke.escapeTest.test(t))return t.replace(Ke.escapeReplace,Hs)}else if(Ke.escapeTestNoEncode.test(t))return t.replace(Ke.escapeReplaceNoEncode,Hs);return t}function Us(t){try{t=encodeURI(t).replace(Ke.percentDecode,"%")}catch{return null}return t}function Ws(t,e){let r=t.replace(Ke.findPipe,(i,s,o)=>{let c=!1,h=s;for(;--h>=0&&o[h]==="\\";)c=!c;return c?"|":" |"}),n=r.split(Ke.splitPipe),a=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(;a<n.length;a++)n[a]=n[a].trim().replace(Ke.slashPipe,"|");return n}function rr(t,e,r){let n=t.length;if(n===0)return"";let a=0;for(;a<n&&t.charAt(n-a-1)===e;)a++;return t.slice(0,n-a)}function Gs(t){let e=t.split(`
4
4
  `),r=e.length-1;for(;r>=0&&Ke.blankLine.test(e[r]);)r--;return e.length-r<=2?t:e.slice(0,r+1).join(`
@@ -1,4 +1,4 @@
1
- import{bo as b,t as wt,bq as M,a_ as D,by as Tt,bs as xt,b as kt,bu as N}from"./BAqR9jtB.js";import{bs as It,ca as J,aD as t,a7 as At,ay as Q,W as w,bn as Pt,bS as F,c9 as f,aA as V,aB as x,a5 as I,bA as A,bl as P,b_ as E,bO as S}from"./DYhIMPy1.js";import{E as St}from"./UuiGcpAE.js";import{c as Wt}from"./B2RRuLl5.js";import{C as R}from"./DypB-Dwi.js";import{L as $t}from"./D8dE5NKO.js";import"./DuRHazc8.js";import"./BPk16bSc.js";import"./DiCMHWTR.js";import{be as Dt}from"./DKXEy5Lq.js";import"./C9gP-gRX.js";import"./BFETMHTz.js";import{Hp as B,HW as Nt,Ia as Ft,H$ as Et,tY as Bt}from"./BSwWMzab.js";import{T as Lt}from"./C8reKsm7.js";import{g as Ut}from"./DfN8_dcw.js";import{dl as Ot}from"./DY6JypjK.js";import{bN as Ht,bK as jt,b5 as Mt}from"./BCDWZbwh.js";import"./7IyNIHph.js";import{M as Vt}from"./AGSVFpXc.js";import{V as qt}from"./CeQYwwry.js";import{O as Rt}from"./D_uOXHFE.js";import{c as Gt}from"./ChTqQfQN.js";import{i as Kt}from"./H2jLkRRS.js";const T=new $t({category:"change-converters"});function q(e,n){return e.path||e.file||e.filePath||e.relativePath||n?.filePath}function X(e,n){return{additions:e.additions??n?.additions??0,deletions:e.deletions??n?.deletions??0,binary:e.binary??!1}}function Yt(e,n){if(n.actor?.type==="agent"&&n.actor.id){const r=n.actor;return{agentId:r.id,agentName:r.name||b.fileTracking_changeTimeline_agent_fallback(),sessionId:r.sessionId||e.sessionId||"",turnNumber:r.turnNumber??e.turnNumber??0,messageId:r.messageId,timestamp:new Date(n.timestamp).getTime()}}if(e.agentId)return{agentId:e.agentId,agentName:e.agentName||b.fileTracking_changeTimeline_agent_fallback(),sessionId:e.sessionId||"",turnNumber:e.turnNumber||0,timestamp:new Date(n.timestamp).getTime()}}function Z(e,n){return{timestamp:new Date(e.timestamp).getTime(),manual:e.actor?.type==="user",agent:Yt(n,e)}}function tt(e,n){return{oldContent:n?.oldContent??e.oldContent,newContent:n?.newContent??e.newContent,diff:e.diff??n?.diff}}function et(e,n,r){return r!==void 0?`${e}-${n}-${r}`:`${e}-${n}`}function zt(e){try{const n=e.data||{},r=e.codeChange;T.debug("Converting event to TrackedChange",{eventType:e.type,eventId:e.id,hasData:!!n,hasCodeChange:!!r});const c=q(n,r);if(e.type.startsWith("file:")&&c){const d=X(n,r);return T.debug("Creating TrackedChange for file event",{filePath:c,stats:d,hasDiff:!!(n.diff||r?.diff)}),[{id:et("event",e.id),file:c,relativePath:c,stage:R.Unstaged,stats:d,attribution:Z(e,n),content:tt(n,r)}]}return(e.type==="agent:completed"||e.type.startsWith("agent:"))&&n.fileChanges&&Array.isArray(n.fileChanges)?(T.debug("Creating TrackedChanges for agent event",{eventType:e.type,fileChangesCount:n.fileChanges.length,agentId:n.agentId}),n.fileChanges.filter(d=>q(d)?!0:(T.warn("Skipping file change without path",{change:d}),!1)).map((d,s)=>{const v=q(d);if(!v)throw new Error("file change without path");return{id:et("event",e.id,s),file:v,relativePath:v,stage:R.Unstaged,stats:X(d),attribution:Z(e,n),content:tt(d)}})):(T.debug("No TrackedChanges created for event",{eventType:e.type,eventId:e.id,hasFilePath:!!c,hasFileChanges:!!(n.fileChanges&&Array.isArray(n.fileChanges))}),[])}catch(n){return T.error("Error converting event to TrackedChange",n instanceof Error?n:new Error(String(n)),{eventType:e.type,eventId:e.id}),[]}}function Jt(e){if(!e)return{oldContent:"",newContent:""};const n=[],r=[],c=e.split(`
1
+ import{bo as b,t as wt,bq as M,a_ as D,by as Tt,bs as xt,b as kt,bu as N}from"./BAqR9jtB.js";import{bs as It,ca as J,aD as t,a7 as At,ay as Q,W as w,bn as Pt,bS as F,c9 as f,aA as V,aB as x,a5 as I,bA as A,bl as P,b_ as E,bO as S}from"./DYhIMPy1.js";import{E as St}from"./UuiGcpAE.js";import{c as Wt}from"./B2RRuLl5.js";import{C as R}from"./DypB-Dwi.js";import{L as $t}from"./D8dE5NKO.js";import"./C-fnz5X4.js";import"./BPk16bSc.js";import"./DiCMHWTR.js";import{be as Dt}from"./DKXEy5Lq.js";import"./C9gP-gRX.js";import"./B6Eksue8.js";import{Hp as B,HW as Nt,Ia as Ft,H$ as Et,tY as Bt}from"./BSwWMzab.js";import{T as Lt}from"./CXNySl0c.js";import{g as Ut}from"./DfN8_dcw.js";import{dl as Ot}from"./DY6JypjK.js";import{bN as Ht,bK as jt,b5 as Mt}from"./CzrG_lpv.js";import"./7IyNIHph.js";import{M as Vt}from"./AGSVFpXc.js";import{V as qt}from"./CeQYwwry.js";import{O as Rt}from"./D4qqUzAr.js";import{c as Gt}from"./ChTqQfQN.js";import{i as Kt}from"./H2jLkRRS.js";const T=new $t({category:"change-converters"});function q(e,n){return e.path||e.file||e.filePath||e.relativePath||n?.filePath}function X(e,n){return{additions:e.additions??n?.additions??0,deletions:e.deletions??n?.deletions??0,binary:e.binary??!1}}function Yt(e,n){if(n.actor?.type==="agent"&&n.actor.id){const r=n.actor;return{agentId:r.id,agentName:r.name||b.fileTracking_changeTimeline_agent_fallback(),sessionId:r.sessionId||e.sessionId||"",turnNumber:r.turnNumber??e.turnNumber??0,messageId:r.messageId,timestamp:new Date(n.timestamp).getTime()}}if(e.agentId)return{agentId:e.agentId,agentName:e.agentName||b.fileTracking_changeTimeline_agent_fallback(),sessionId:e.sessionId||"",turnNumber:e.turnNumber||0,timestamp:new Date(n.timestamp).getTime()}}function Z(e,n){return{timestamp:new Date(e.timestamp).getTime(),manual:e.actor?.type==="user",agent:Yt(n,e)}}function tt(e,n){return{oldContent:n?.oldContent??e.oldContent,newContent:n?.newContent??e.newContent,diff:e.diff??n?.diff}}function et(e,n,r){return r!==void 0?`${e}-${n}-${r}`:`${e}-${n}`}function zt(e){try{const n=e.data||{},r=e.codeChange;T.debug("Converting event to TrackedChange",{eventType:e.type,eventId:e.id,hasData:!!n,hasCodeChange:!!r});const c=q(n,r);if(e.type.startsWith("file:")&&c){const d=X(n,r);return T.debug("Creating TrackedChange for file event",{filePath:c,stats:d,hasDiff:!!(n.diff||r?.diff)}),[{id:et("event",e.id),file:c,relativePath:c,stage:R.Unstaged,stats:d,attribution:Z(e,n),content:tt(n,r)}]}return(e.type==="agent:completed"||e.type.startsWith("agent:"))&&n.fileChanges&&Array.isArray(n.fileChanges)?(T.debug("Creating TrackedChanges for agent event",{eventType:e.type,fileChangesCount:n.fileChanges.length,agentId:n.agentId}),n.fileChanges.filter(d=>q(d)?!0:(T.warn("Skipping file change without path",{change:d}),!1)).map((d,s)=>{const v=q(d);if(!v)throw new Error("file change without path");return{id:et("event",e.id,s),file:v,relativePath:v,stage:R.Unstaged,stats:X(d),attribution:Z(e,n),content:tt(d)}})):(T.debug("No TrackedChanges created for event",{eventType:e.type,eventId:e.id,hasFilePath:!!c,hasFileChanges:!!(n.fileChanges&&Array.isArray(n.fileChanges))}),[])}catch(n){return T.error("Error converting event to TrackedChange",n instanceof Error?n:new Error(String(n)),{eventType:e.type,eventId:e.id}),[]}}function Jt(e){if(!e)return{oldContent:"",newContent:""};const n=[],r=[],c=e.split(`
2
2
  `);c.length>0&&c[c.length-1]===""&&c.pop();let d=!1;for(const s of c)if(!(s.startsWith("diff --git")||s.startsWith("index ")||s.startsWith("--- ")||s.startsWith("+++ ")||s.startsWith("\"))){if(s.startsWith("@@")){d=!0;continue}d&&(s.startsWith("+")?r.push(s.slice(1)):s.startsWith("-")?n.push(s.slice(1)):s.startsWith(" ")?(n.push(s.slice(1)),r.push(s.slice(1))):s===""&&(n.push(""),r.push("")))}return{oldContent:n.join(`
3
3
  `),newContent:r.join(`
4
4
  `)}}var Qt=x("<!> <!>",1),Xt=x('<div class="flex items-center gap-1.5 px-3 py-1.5 text-xs text-subtle bg-muted/50 border-b border-border"><span> </span></div>'),Zt=x('<div class="flex flex-col h-full"><!> <div class="flex-1 min-h-0"><!></div></div>'),te=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <p class="text-xs opacity-70"> </p></div>'),ee=x('<p class="text-xs opacity-70"> </p>'),ne=x('<div class="flex flex-col items-center justify-center h-full text-subtle gap-4"><p class="text-sm"> </p> <!></div>');function ae(e,n){if(new.target)return wt({component:ae,...e});It(n,!0);const r=()=>N(lt,"$workspace",v),c=()=>N(st,"$foldUnchanged",v),d=()=>N(rt,"$lineWrapping",v),s=()=>N(ot,"$diffSideBySide",v),[v,nt]=xt(),at=a=>{qt(a,{embedded:!0,get foldEnabled(){return c()},onToggleFold:()=>B.dispatch(Et()),get wrapEnabled(){return d()},onToggleWrap:()=>B.dispatch(Ft()),get splitEnabled(){return s()},onToggleSplit:()=>B.dispatch(Nt())})},it=a=>{var i=Qt(),g=Q(i);{let m=f(()=>b.layout_diffHeader_goToFile_tooltip());Wt(g,()=>Vt,(l,h)=>{h(l,{get icon(){return Dt},get label(){return t(m)},onclick:$=>ut()})})}var y=F(g,2);{var C=m=>{Rt(m,{get filePath(){return t(K)},get workspaceId(){return _()},isDirectory:!1,embedded:!0,get workspaceFolderPath(){return t(O)}})};D(y,m=>{t(K)&&m(C)})}w(a,i)},rt=Ht(),st=jt(),ot=Mt(),dt=Gt("ActivityChangesTabType");let L=M(n,"tab",7),_=M(n,"workspaceId",7),U=M(n,"isActive",7);const G=Ut(),lt=Ot(_()),O=f(()=>r()?.worktreePath||r()?.repositoryPath||void 0),o=f(()=>L().data?.event),ct=f(()=>t(o)?zt(t(o)):[]),u=f(()=>t(ct)[0]),p=f(()=>t(u)?.relativePath||t(u)?.file||null),K=f(()=>t(p)&&t(O)?Kt(t(p))?t(p):`${t(O)}/${t(p)}`:null),H=f(()=>()=>{if(!t(o))return null;const a=t(o).data,i=t(o).codeChange;return a?.diff||i?.diff||t(u)?.content?.diff||null}),Y=f(()=>()=>t(u)?.content?!!(t(u).content.oldContent&&t(u).content.newContent):!1);function ft(a){if(!a)return;const i=a.match(/@@ -(\d+)/);return i?parseInt(i[1],10):void 0}const k=f(()=>{if(t(Y)()&&t(u)?.content)return{oldContent:t(u).content.oldContent??"",newContent:t(u).content.newContent??""};const a=t(H)();return a?Jt(a):null}),W=f(()=>ft(t(H)())),pt=f(()=>t(W)!==void 0&&t(W)>1),gt=f(()=>{const a=t(p)||"",i=t(o)?.data||{};return{id:`activity-${t(o)?.id||"unknown"}-${a}`,file:a,relativePath:a,stage:R.Committed,status:t(u)?.status||"modified",stats:{additions:i?.additions||t(u)?.stats?.additions||0,deletions:i?.deletions||t(u)?.stats?.deletions||0},attribution:{timestamp:t(o)?.timestamp?new Date(t(o).timestamp).getTime():Date.now()},content:t(k)?{oldContent:t(k).oldContent,newContent:t(k).newContent}:void 0}});function ut(a){if(!t(p))return;const g={type:"file",title:t(p).split("/").pop()||t(p),closable:!0,filePath:t(p),workspaceId:_()};B.dispatch(Bt(_(),g))}J(()=>{!G||!U()||G.registerActions({display:at,actions:it})}),J(()=>{if(t(o)){const a=t(o).data;dt.debug("Activity event diff info",{eventType:t(o).type,eventId:t(o).id,filePath:t(p),hasDiffString:!!t(H)(),hasOldNewContent:t(Y)(),hasDiffContents:!!t(k),dataAdditions:a?.additions,dataDeletions:a?.deletions})}});var ht={get tab(){return L()},set tab(a){L(a),V()},get workspaceId(){return _()},set workspaceId(a){_(a),V()},get isActive(){return U()},set isActive(a){U(a),V()},$set:Tt,$on:(a,i)=>kt(n,a,i)},z=At(),mt=Q(z);{var vt=a=>{var i=Zt(),g=I(i);{var y=l=>{var h=Xt(),$=I(h),j=P($,!0);A(h),E(_t=>S(j,_t),[()=>b.layout_activityChanges_partialDiff_label({line:t(W)??0})]),w(l,h)};D(g,l=>{t(pt)&&l(y)})}var C=F(g,2),m=I(C);St(m,()=>`${t(o)?.id}-${t(p)}`,l=>{{let h=f(()=>s()?"split":"unified");Lt(l,{get change(){return t(gt)},get workspaceId(){return _()},get viewMode(){return t(h)},get foldUnchanged(){return c()},get lineWrapping(){return d()},get lineOffset(){return t(W)}})}}),A(C),A(i),w(a,i)},yt=a=>{var i=te(),g=I(i),y=P(g,!0),C=F(g,2),m=P(C,!0);A(i),E((l,h)=>{S(y,l),S(m,h)},[()=>b.layout_activityChanges_noDiffStored_label(),()=>b.layout_activityChanges_diffNotCaptured_description()]),w(a,i)},Ct=a=>{var i=ne(),g=I(i),y=P(g,!0),C=F(g,2);{var m=l=>{var h=ee(),$=P(h,!0);E(j=>S($,j),[()=>b.layout_activityChanges_eventType_label({type:t(o).type})]),w(l,h)};D(C,l=>{t(o)&&l(m)})}A(i),E(l=>S(y,l),[()=>b.layout_activityChanges_noChanges_label()]),w(a,i)};D(mt,a=>{t(p)&&t(k)?a(vt):t(p)?a(yt,1):a(Ct,-1)})}w(e,z);var bt=Pt(ht);return nt(),bt}export{ae as default};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/C5EEwI0-.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/DiVHUgRZ.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/DkrnUdRW.js","/app/immutable/chunks/4CMzT_BI.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/DijSalri.js","/app/immutable/chunks/B_ifqSee.js"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"./BAqR9jtB.js";import{c as m}from"./ChTqQfQN.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}let _=0;function f(){_+=1}function E(){return _}const h=m("Navigation"),w="settings-previous-path";function r(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function l(t,a={}){if(d()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){h.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=a.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||f(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:e}=await import("./C5EEwI0-.js");return{showAssistantContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url);if(await n(t,{preserveFocus:!0,background:a.assistantContent===!0,agentId:a.assistantAgentId})){if(a.assistantContent)return;const{openPanel:e}=await i(async()=>{const{openPanel:o}=await import("./BSwWMzab.js").then(s=>s.H6);return{openPanel:o}},__vite__mapDeps([3,4,2,5,6,7,8,9,1,10]),import.meta.url),{store:g}=await i(async()=>{const{store:o}=await import("./4CMzT_BI.js");return{store:o}},__vite__mapDeps([36,3,4,2,5,6,7,8,9,1,10,37,38]),import.meta.url);g.dispatch(e("chief"));const{goto:p}=await i(async()=>{const{goto:o}=await import("./B_ifqSee.js").then(s=>s.n);return{goto:o}},__vite__mapDeps([39,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(r(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!r(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(w,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./B_ifqSee.js").then(e=>e.n);return{goto:n}},__vite__mapDeps([39,2]),import.meta.url);return a.state?u(t,{state:a.state}):u(t)}const P=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:w,isHudWindowRenderer:d,isSettingsRoute:r,navigateToRoute:l},Symbol.toStringTag,{value:"Module"}));export{w as S,r as a,f as b,E as c,P as d,d as i,l as n};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/BIZcuYRW.js","/app/immutable/chunks/BAqR9jtB.js","/app/immutable/chunks/DYhIMPy1.js","/app/immutable/chunks/BSwWMzab.js","/app/immutable/chunks/WFvSJ9zU.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/BlOn95cv.js","/app/immutable/chunks/UyBYtOpv.js","/app/immutable/chunks/DiCMHWTR.js","/app/immutable/chunks/UuiGcpAE.js","/app/immutable/chunks/C8_w7W1W.js","/app/immutable/chunks/BvFAWM27.js","/app/immutable/chunks/C9gP-gRX.js","/app/immutable/chunks/BPk16bSc.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/BaIAhI85.js","/app/immutable/chunks/B2RRuLl5.js","/app/immutable/chunks/C11wqToa.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BJzHxIyr.js","/app/immutable/chunks/CzRl1R1n.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/BtAYzBSd.js","/app/immutable/chunks/Cbh1BCiS.js","/app/immutable/chunks/Bc-8qHYh.js","/app/immutable/chunks/Bl_iEh1f.js","/app/immutable/chunks/7ZJvg7ev.js","/app/immutable/chunks/DfxQWSVU.js","/app/immutable/chunks/DKXEy5Lq.js","/app/immutable/chunks/BWYr8u9e.js","/app/immutable/assets/notify.BeL_JB6L.css","/app/immutable/chunks/DY6JypjK.js","/app/immutable/chunks/Ccf4dYFA.js","/app/immutable/chunks/C0VJEx2v.js","/app/immutable/chunks/DkrnUdRW.js","/app/immutable/chunks/4CMzT_BI.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/DijSalri.js","/app/immutable/chunks/BW6fyv0T.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./BAqR9jtB.js";import{c as m}from"./ChTqQfQN.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}let _=0;function f(){_+=1}function E(){return _}const h=m("Navigation"),w="settings-previous-path";function r(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function l(t,a={}){if(d()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){h.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=a.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||f(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:e}=await import("./BIZcuYRW.js");return{showAssistantContent:e}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35]),import.meta.url);if(await n(t,{preserveFocus:!0,background:a.assistantContent===!0,agentId:a.assistantAgentId})){if(a.assistantContent)return;const{openPanel:e}=await i(async()=>{const{openPanel:o}=await import("./BSwWMzab.js").then(s=>s.H6);return{openPanel:o}},__vite__mapDeps([3,4,2,5,6,7,8,9,1,10]),import.meta.url),{store:g}=await i(async()=>{const{store:o}=await import("./4CMzT_BI.js");return{store:o}},__vite__mapDeps([36,3,4,2,5,6,7,8,9,1,10,37,38]),import.meta.url);g.dispatch(e("chief"));const{goto:p}=await i(async()=>{const{goto:o}=await import("./BW6fyv0T.js").then(s=>s.n);return{goto:o}},__vite__mapDeps([39,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(r(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!r(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(w,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./BW6fyv0T.js").then(e=>e.n);return{goto:n}},__vite__mapDeps([39,2]),import.meta.url);return a.state?u(t,{state:a.state}):u(t)}const P=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:w,isHudWindowRenderer:d,isSettingsRoute:r,navigateToRoute:l},Symbol.toStringTag,{value:"Module"}));export{w as S,r as a,f as b,E as c,P as d,d as i,l as n};
@@ -1 +1 @@
1
- import{g as l,r as m,d as n}from"./B1Rrvp0b.js";import{p}from"./CM7ZaQP_.js";import{b as t,ay as o}from"./Bpy6Muvw.js";import{M as u,a as f}from"./BxiJOwnz.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};
1
+ import{g as l,r as m,d as n}from"./CBTot2K1.js";import{p}from"./CE8vXfAM.js";import{b as t,ay as o}from"./q4Mp6azq.js";import{M as u,a as f}from"./BxiJOwnz.js";var c=f().RailroadEbnf.parser.LangiumParser,s=t(e=>{const r=e.alternatives.map(E);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformChoice"),E=t(e=>{const r=e.elements.map(y);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),i=t(e=>{switch(e.$type){case"EbnfTerminal":return{type:"terminal",value:e.value};case"EbnfNonTerminal":return{type:"nonterminal",name:e.name};case"EbnfSpecial":return{type:"special",text:e.text};case"EbnfGroup":return s(e.element);case"EbnfOptional":return{type:"optional",element:s(e.element)};case"EbnfRepetition":return{type:"repetition",element:s(e.element),min:0,max:1/0};default:throw new Error(`Unsupported EBNF primary node: ${e.$type}`)}},"transformPrimary"),b=t((e,r)=>{switch(r.$type){case"EbnfOptionalPostfix":return{type:"optional",element:e};case"EbnfZeroOrMorePostfix":return{type:"repetition",element:e,min:0,max:1/0};case"EbnfOneOrMorePostfix":return{type:"repetition",element:e,min:1,max:1/0};case"EbnfExceptionPostfix":return{type:"sequence",elements:[e,{type:"terminal",value:"-"},i(r.except)]};default:throw new Error(`Unsupported EBNF postfix node: ${r.$type}`)}},"transformPostfix"),y=t(e=>e.postfixes.reduce((r,a)=>b(r,a),i(e.base)),"transformTerm"),d=t(e=>({name:e.name,definition:s(e.definition)}),"transformRule"),v=t(e=>{p(e,n),e.title&&n.setTitle(e.title),e.rules.map(r=>n.addRule(d(r)))},"populateDb"),g={parse:t(e=>{n.clear(),o.debug("[EBNF Parser] Starting Langium parse");const r=c.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const a=r.value;o.debug("[EBNF Parser] Parsed rules:",a.rules.length),v(a),o.debug("[EBNF Parser] Parse complete")},"parse"),parser:{yy:n}},N={parser:g,db:n,renderer:m,styles:l};export{N as diagram};