@intent-hq/web 2.343.2 → 2.345.0

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 (274) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{wjBrDDKR.js → -6JGlnE4.js} +1 -1
  3. package/web/app/immutable/chunks/{4GiF-64P.js → -7ARPWgR.js} +1 -1
  4. package/web/app/immutable/chunks/{DHP1DFPI.js → -SwunqO3.js} +1 -1
  5. package/web/app/immutable/chunks/{Af7wRQM_.js → 1MWULgfl.js} +1 -1
  6. package/web/app/immutable/chunks/{ByiJOZiZ.js → 2xvAjJNs.js} +1 -1
  7. package/web/app/immutable/chunks/{C-3coqYU.js → 34C5M9lk.js} +1 -1
  8. package/web/app/immutable/chunks/{oYQw_s1S.js → 5MLUIYhU.js} +1 -1
  9. package/web/app/immutable/chunks/{DbNMpEC8.js → 6Zmm5CZL.js} +1 -1
  10. package/web/app/immutable/chunks/{CbeK0M7M.js → 7teYU7wH.js} +1 -1
  11. package/web/app/immutable/chunks/{CFLZAMP_.js → 8XhHIJcn.js} +1 -1
  12. package/web/app/immutable/chunks/{BW73Ve1a.js → 9HNwwiNt.js} +1 -1
  13. package/web/app/immutable/chunks/{CicdOSYm.js → A0r9TbR7.js} +2 -2
  14. package/web/app/immutable/chunks/{DWQSi293.js → A34-FDia.js} +1 -1
  15. package/web/app/immutable/chunks/{BycXuHIq.js → A8JjhnEv.js} +1 -1
  16. package/web/app/immutable/chunks/{Czmjmrib.js → B0a-wzQr.js} +1 -1
  17. package/web/app/immutable/chunks/{C0g2TqGQ.js → B0biUQQF.js} +9 -9
  18. package/web/app/immutable/chunks/{CiTK-_b6.js → B203wRvP.js} +1 -1
  19. package/web/app/immutable/chunks/{DQR5oUDY.js → B3kzQQLK.js} +1 -1
  20. package/web/app/immutable/chunks/{CusCKZ30.js → B3lXnLB8.js} +2 -2
  21. package/web/app/immutable/chunks/{Cdx0eFWC.js → B4ilKCwe.js} +1 -1
  22. package/web/app/immutable/chunks/{C91dOInA.js → B5tGFpkq.js} +1 -1
  23. package/web/app/immutable/chunks/{XkS41G1k.js → B7w_8Qom.js} +1 -1
  24. package/web/app/immutable/chunks/{qdwxdMJ_.js → B9Hetctu.js} +1 -1
  25. package/web/app/immutable/chunks/{CBnORL1F.js → B9x-giji.js} +3 -3
  26. package/web/app/immutable/chunks/{DU0nfy_y.js → BA3fud46.js} +1 -1
  27. package/web/app/immutable/chunks/{O6f99o2k.js → BAxqzRwc.js} +1 -1
  28. package/web/app/immutable/chunks/{B4sr0yPI.js → BBL1FO1t.js} +1 -1
  29. package/web/app/immutable/chunks/{L_S2h6Yw.js → BC2xxkKo.js} +1 -1
  30. package/web/app/immutable/chunks/{BJJ1m47o.js → BCASO_bV.js} +1 -1
  31. package/web/app/immutable/chunks/{DSnERXrp.js → BF-IM3Qf.js} +1 -1
  32. package/web/app/immutable/chunks/{BiVahgoJ.js → BGX6W-wu.js} +1 -1
  33. package/web/app/immutable/chunks/{tcxAslUm.js → BI7MYBTt.js} +1 -1
  34. package/web/app/immutable/chunks/{DaaneYTG.js → BIEvH8pu.js} +1 -1
  35. package/web/app/immutable/chunks/{BSpir4qY.js → BIlaJXMS.js} +1 -1
  36. package/web/app/immutable/chunks/{MgErAKgQ.js → BKYCO_49.js} +2 -2
  37. package/web/app/immutable/chunks/{BmB6-2Ft.js → BL8tUtYB.js} +1 -1
  38. package/web/app/immutable/chunks/{BBlRLBe7.js → BMMoYJAn.js} +1 -1
  39. package/web/app/immutable/chunks/{CnJe4S2a.js → BMm9sGZ6.js} +1 -1
  40. package/web/app/immutable/chunks/{KJX0Kw6L.js → BP5uyQTv.js} +3 -3
  41. package/web/app/immutable/chunks/{DGYr0_ON.js → BP7CI4Qx.js} +1 -1
  42. package/web/app/immutable/chunks/{a1r6BT-e.js → BTWq1_ry.js} +1 -1
  43. package/web/app/immutable/chunks/{B-00FHnf.js → BUGXi07N.js} +1 -1
  44. package/web/app/immutable/chunks/{B5_270cz.js → BUdcKH65.js} +1 -1
  45. package/web/app/immutable/chunks/{D9ajM8uP.js → BVPvh88-.js} +1 -1
  46. package/web/app/immutable/chunks/{DAYo95RN.js → BVt_T8ao.js} +1 -1
  47. package/web/app/immutable/chunks/{quYX3pdL.js → BVviSubD.js} +1 -1
  48. package/web/app/immutable/chunks/{DXozNEH9.js → BX3QD7rd.js} +1 -1
  49. package/web/app/immutable/chunks/{n5fDR6Ys.js → BXTuZcZW.js} +1 -1
  50. package/web/app/immutable/chunks/{fCEIPyv5.js → BXeiKdwz.js} +1 -1
  51. package/web/app/immutable/chunks/{B_frQYKx.js → BYFJ74nm.js} +1 -1
  52. package/web/app/immutable/chunks/{DBSA3jai.js → BYMNRS4c.js} +1 -1
  53. package/web/app/immutable/chunks/{Ciqm_fPa.js → BYU1cTbO.js} +2 -2
  54. package/web/app/immutable/chunks/{CN6xxeS_.js → BYtSPAAW.js} +1 -1
  55. package/web/app/immutable/chunks/{Dyra2UkJ.js → BZLRqiW7.js} +1 -1
  56. package/web/app/immutable/chunks/{B7_gjxTl.js → BZcpShp8.js} +1 -1
  57. package/web/app/immutable/chunks/{CpWbjqtx.js → BabPi6C5.js} +1 -1
  58. package/web/app/immutable/chunks/{Bs3KgIll.js → Bb-m1QhD.js} +1 -1
  59. package/web/app/immutable/chunks/{BJO4jUAG.js → BbNk8c_P.js} +1 -1
  60. package/web/app/immutable/chunks/{84AlJNR3.js → Bba6So1V.js} +1 -1
  61. package/web/app/immutable/chunks/{ihu83Gf7.js → Bc5_gcpq.js} +1 -1
  62. package/web/app/immutable/chunks/{B1ywot0G.js → Bc6DihnT.js} +4 -4
  63. package/web/app/immutable/chunks/{B_a_b8VS.js → BdCclrfD.js} +1 -1
  64. package/web/app/immutable/chunks/{Wsz69q6g.js → BdD2ADMz.js} +1 -1
  65. package/web/app/immutable/chunks/{ClTZNeVO.js → BdkEw9JP.js} +1 -1
  66. package/web/app/immutable/chunks/{C0v3RBBR.js → BfZCAeqU.js} +1 -1
  67. package/web/app/immutable/chunks/{DIHT0C7u.js → BgX4ALX_.js} +3 -3
  68. package/web/app/immutable/chunks/{BgN4cuBh.js → BhMsVKL2.js} +1 -1
  69. package/web/app/immutable/chunks/{uI0ZG7MM.js → Bj3n1RUK.js} +1 -1
  70. package/web/app/immutable/chunks/{D8lUkQ-B.js → Bk2z5Cd0.js} +1 -1
  71. package/web/app/immutable/chunks/{1VG8gLVS.js → BkNc2eFX.js} +4 -4
  72. package/web/app/immutable/chunks/{DOqpTP8b.js → BkbQGifa.js} +1 -1
  73. package/web/app/immutable/chunks/BlZYlbA9.js +1 -0
  74. package/web/app/immutable/chunks/{nmrokYzj.js → BmP1Wws6.js} +1 -1
  75. package/web/app/immutable/chunks/{4NM3BVdw.js → BoCZH6mk.js} +1 -1
  76. package/web/app/immutable/chunks/{kHCC2X2-.js → BqQiAH0O.js} +1 -1
  77. package/web/app/immutable/chunks/{Bv5I7YDM.js → BqRoJfH0.js} +1 -1
  78. package/web/app/immutable/chunks/{BM1KP-FJ.js → BqqN40AD.js} +1 -1
  79. package/web/app/immutable/chunks/{d_IAf8cB.js → BrRRz1w6.js} +1 -1
  80. package/web/app/immutable/chunks/{D-aNPvuh.js → Bs26_0Q5.js} +2 -2
  81. package/web/app/immutable/chunks/{xNZ_GbEJ.js → BuTNFoR8.js} +1 -1
  82. package/web/app/immutable/chunks/{CeizKDc4.js → BvZrnx87.js} +1 -1
  83. package/web/app/immutable/chunks/{DxztdKvh.js → Bvc8qRhk.js} +1 -1
  84. package/web/app/immutable/chunks/{DcFwDOMt.js → BwSA3fCS.js} +1 -1
  85. package/web/app/immutable/chunks/{XvLHDIL-.js → ByCIOkhM.js} +1 -1
  86. package/web/app/immutable/chunks/{NnMVp6ZM.js → ByTOmivs.js} +1 -1
  87. package/web/app/immutable/chunks/{WvxOnEzW.js → ByuX26Ym.js} +4 -4
  88. package/web/app/immutable/chunks/{Bwjn3GNi.js → Bywuf0q4.js} +1 -1
  89. package/web/app/immutable/chunks/{Cn3xolhp.js → C-M7eh_Z.js} +1 -1
  90. package/web/app/immutable/chunks/C-MmtmWQ.js +1 -0
  91. package/web/app/immutable/chunks/{BHt8CzB9.js → C-ZPZDJB.js} +1 -1
  92. package/web/app/immutable/chunks/{Pat1u3oY.js → C0p8rhDn.js} +1 -1
  93. package/web/app/immutable/chunks/{CDFRnJ8k.js → C1nHAGLu.js} +1 -1
  94. package/web/app/immutable/chunks/{B9qFB97l.js → C3SYquhf.js} +1 -1
  95. package/web/app/immutable/chunks/C4dCVzfY.js +2 -0
  96. package/web/app/immutable/chunks/{DIumxlqP.js → C52Qm4vO.js} +1 -1
  97. package/web/app/immutable/chunks/{CdN2Ihv_.js → C5AlgdZ0.js} +1 -1
  98. package/web/app/immutable/chunks/{-a8kGB-5.js → C6WI65lc.js} +1 -1
  99. package/web/app/immutable/chunks/{D8gunWV0.js → C8AARFCw.js} +2 -2
  100. package/web/app/immutable/chunks/{CjZIABEV.js → C8BVjzNA.js} +1 -1
  101. package/web/app/immutable/chunks/{CvmMeam2.js → C8dU7SM3.js} +2 -2
  102. package/web/app/immutable/chunks/{-PfxOD5O.js → CAOA5kev.js} +2 -2
  103. package/web/app/immutable/chunks/{CNsCzECr.js → CBqGKeYg.js} +1 -1
  104. package/web/app/immutable/chunks/{BAR7XkP3.js → CEQZVenN.js} +1 -1
  105. package/web/app/immutable/chunks/{Cgm3wI9t.js → CG3imlyr.js} +1 -1
  106. package/web/app/immutable/chunks/{DV6k5cHH.js → CJ58g2zu.js} +1 -1
  107. package/web/app/immutable/chunks/{_RGinDCt.js → CKzqOQI8.js} +1 -1
  108. package/web/app/immutable/chunks/{Cn19T3na.js → CL2hu5s-.js} +1 -1
  109. package/web/app/immutable/chunks/{BjcX_fOv.js → CN-2rfdx.js} +1 -1
  110. package/web/app/immutable/chunks/{BnZdkxbc.js → CNIUwMPp.js} +1 -1
  111. package/web/app/immutable/chunks/{BRhVB6Sv.js → COrK0goa.js} +1 -1
  112. package/web/app/immutable/chunks/{DuIazAmY.js → CRQGIXhv.js} +1 -1
  113. package/web/app/immutable/chunks/{Bk2hJ8Ly.js → CSdIXJpO.js} +1 -1
  114. package/web/app/immutable/chunks/{C3MZ_izG.js → CVYjvOCP.js} +1 -1
  115. package/web/app/immutable/chunks/{CuXCq1os.js → CVoXekIe.js} +3 -3
  116. package/web/app/immutable/chunks/{DWiPdXwB.js → CW13jkE8.js} +1 -1
  117. package/web/app/immutable/chunks/{BA55iEBB.js → CWE4oREl.js} +1 -1
  118. package/web/app/immutable/chunks/{BQAjCr1w.js → CWQrbZgx.js} +1 -1
  119. package/web/app/immutable/chunks/CWT4x6lB.js +2 -0
  120. package/web/app/immutable/chunks/{CzQCBVm9.js → CW_fORnH.js} +1 -1
  121. package/web/app/immutable/chunks/{MZ6PO-qe.js → CXNfY5OA.js} +1 -1
  122. package/web/app/immutable/chunks/{B2pRmyv7.js → CYEd8dKU.js} +1 -1
  123. package/web/app/immutable/chunks/{BW1LTGV1.js → CYf2hryc.js} +1 -1
  124. package/web/app/immutable/chunks/{B1SJZtm3.js → CaGwo1Kh.js} +1 -1
  125. package/web/app/immutable/chunks/{CpXorioa.js → CaXjFtDt.js} +1 -1
  126. package/web/app/immutable/chunks/{BEyWfhqM.js → CaxyE6o_.js} +1 -1
  127. package/web/app/immutable/chunks/{CWIcIgSm.js → CbCgON3R.js} +1 -1
  128. package/web/app/immutable/chunks/{L30ES58t.js → CcXuSxXv.js} +1 -1
  129. package/web/app/immutable/chunks/{CVBmzjKd.js → CeT1zT46.js} +1 -1
  130. package/web/app/immutable/chunks/{CwRpBR2e.js → CeswpNyE.js} +1 -1
  131. package/web/app/immutable/chunks/{B461Cu-8.js → Cfj3Lc6y.js} +1 -1
  132. package/web/app/immutable/chunks/{DwSYIDzZ.js → CgQ2Q_uI.js} +1 -1
  133. package/web/app/immutable/chunks/{yl6pDKiQ.js → CgW9XFcu.js} +1 -1
  134. package/web/app/immutable/chunks/{D60l1rCk.js → ChY17Glq.js} +2 -2
  135. package/web/app/immutable/chunks/{nM9_StK8.js → Chj7QpdD.js} +1 -1
  136. package/web/app/immutable/chunks/{BYgJjg0e.js → Cjpu4SJA.js} +1 -1
  137. package/web/app/immutable/chunks/{BjnZ1Xf3.js → Ck9ZyE1n.js} +1 -1
  138. package/web/app/immutable/chunks/CkSjvO0_.js +1 -0
  139. package/web/app/immutable/chunks/{By0eqGj-.js → CoLl8pQb.js} +1 -1
  140. package/web/app/immutable/chunks/{CD6GiPmw.js → CpLvDQcH.js} +1 -1
  141. package/web/app/immutable/chunks/{DPBk4F6a.js → CpadbTI2.js} +45 -45
  142. package/web/app/immutable/chunks/{DdjlRG5U.js → CrfXhNNb.js} +1 -1
  143. package/web/app/immutable/chunks/CsxVJm8Y.js +1 -0
  144. package/web/app/immutable/chunks/{CInXeVe5.js → CteSc0c_.js} +1 -1
  145. package/web/app/immutable/chunks/{CxLPEkg7.js → CuhrgDBI.js} +1 -1
  146. package/web/app/immutable/chunks/{BgzyvwGo.js → CvWyDJGm.js} +1 -1
  147. package/web/app/immutable/chunks/{DkvJR80T.js → Cv_J2c72.js} +1 -1
  148. package/web/app/immutable/chunks/{DRSdBoB7.js → CzVyzyWv.js} +2 -2
  149. package/web/app/immutable/chunks/{DuG2OZjB.js → D3I0DcnM.js} +1 -1
  150. package/web/app/immutable/chunks/{DZmMN74z.js → D3mUsAm9.js} +1 -1
  151. package/web/app/immutable/chunks/{Bzblbh-D.js → D419Hgek.js} +1 -1
  152. package/web/app/immutable/chunks/{-v5-bXWK.js → D6Wx8h-l.js} +4 -4
  153. package/web/app/immutable/chunks/{CSveVSnU.js → D6YDmdhV.js} +2 -2
  154. package/web/app/immutable/chunks/{CHhGO97x.js → D6yqDOhs.js} +1 -1
  155. package/web/app/immutable/chunks/{BFqED1Hh.js → D8Ohjkn4.js} +2 -2
  156. package/web/app/immutable/chunks/{PDh5csw9.js → DATvyyct.js} +1 -1
  157. package/web/app/immutable/chunks/{rElTuGMj.js → DAoagkbK.js} +1 -1
  158. package/web/app/immutable/chunks/{5a7lyWYQ.js → DCDhq2rq.js} +1 -1
  159. package/web/app/immutable/chunks/{blPVVvA0.js → DDMEgpvU.js} +4 -4
  160. package/web/app/immutable/chunks/{DiAIgif8.js → DDfvytcD.js} +1 -1
  161. package/web/app/immutable/chunks/{Dkh7OUxN.js → DEjP-x_s.js} +1 -1
  162. package/web/app/immutable/chunks/DFF9daPQ.js +13 -0
  163. package/web/app/immutable/chunks/{D2pPI0H2.js → DInreQbI.js} +2 -2
  164. package/web/app/immutable/chunks/{R9ODE8FL.js → DLJVFWjT.js} +3 -3
  165. package/web/app/immutable/chunks/{hX9Crt6i.js → DLqztIqC.js} +1 -1
  166. package/web/app/immutable/chunks/{C3bwGgmD.js → DPDCu-py.js} +1 -1
  167. package/web/app/immutable/chunks/{ivrPoCwd.js → DPR3VaPZ.js} +1 -1
  168. package/web/app/immutable/chunks/{DVH2puba.js → DSf8k2cE.js} +1 -1
  169. package/web/app/immutable/chunks/DTQYcznv.js +1 -0
  170. package/web/app/immutable/chunks/{CMO4ot9F.js → DU8kuP6M.js} +1 -1
  171. package/web/app/immutable/chunks/{SrezSe0o.js → DW36BCXj.js} +1 -1
  172. package/web/app/immutable/chunks/{CdqlgErf.js → DXCE75Ih.js} +1 -1
  173. package/web/app/immutable/chunks/{htyZQ7p9.js → DXDMhDlS.js} +1 -1
  174. package/web/app/immutable/chunks/{C1h34H4x.js → DYk0s6f0.js} +1 -1
  175. package/web/app/immutable/chunks/{zWI60sec.js → DYmPPjiq.js} +1 -1
  176. package/web/app/immutable/chunks/{BBC8ZwBc.js → DZmwTozc.js} +1 -1
  177. package/web/app/immutable/chunks/{BBKQVY9d.js → DZxSFexp.js} +1 -1
  178. package/web/app/immutable/chunks/{D89Fvz2g.js → D_2_kcuU.js} +1 -1
  179. package/web/app/immutable/chunks/{CgLCO0VS.js → DbK3CxeL.js} +1 -1
  180. package/web/app/immutable/chunks/{CmSDhJgU.js → Dc64E_SR.js} +1 -1
  181. package/web/app/immutable/chunks/{BnrnoFjd.js → DdSX2jjJ.js} +1 -1
  182. package/web/app/immutable/chunks/{HLKPZgVy.js → Ddw98WmY.js} +1 -1
  183. package/web/app/immutable/chunks/{gsElU_36.js → De4z9gHo.js} +1 -1
  184. package/web/app/immutable/chunks/{ozzjQyCh.js → Dk6iNNLu.js} +1 -1
  185. package/web/app/immutable/chunks/{ZjzfSXHu.js → DkQ7I_3J.js} +5 -5
  186. package/web/app/immutable/chunks/{D2Ntkwf_.js → DlHB0ULA.js} +2 -2
  187. package/web/app/immutable/chunks/{b-gQtgOb.js → Dlag9Uxb.js} +4 -4
  188. package/web/app/immutable/chunks/{C8j358_U.js → DnpnDt-B.js} +1 -1
  189. package/web/app/immutable/chunks/{D0GCx3sO.js → DpHl7r8K.js} +1 -1
  190. package/web/app/immutable/chunks/{DVYqzV0n.js → DpMTpLDQ.js} +1 -1
  191. package/web/app/immutable/chunks/{CfPxdWJl.js → DpsFFL7J.js} +1 -1
  192. package/web/app/immutable/chunks/{D7QiNhGR.js → Dq3RHtWu.js} +1 -1
  193. package/web/app/immutable/chunks/{CERb2-2E.js → Dq3leYTy.js} +1 -1
  194. package/web/app/immutable/chunks/{CXm95Q2a.js → Dq6CuXZE.js} +1 -1
  195. package/web/app/immutable/chunks/{Ct-2wSQ6.js → DqJ-M21G.js} +1 -1
  196. package/web/app/immutable/chunks/{CjtYlgpc.js → DqvXXMrh.js} +1 -1
  197. package/web/app/immutable/chunks/{D__R5V-4.js → Drt5qRI8.js} +1 -1
  198. package/web/app/immutable/chunks/{CUp3pS17.js → Ds3Wirif.js} +41 -41
  199. package/web/app/immutable/chunks/{GVckKXJ5.js → Dsmvkh8d.js} +1 -1
  200. package/web/app/immutable/chunks/{Djb279-4.js → DtKh4Q6Q.js} +1 -1
  201. package/web/app/immutable/chunks/{Czqd0ZZn.js → DwKUz42C.js} +1 -1
  202. package/web/app/immutable/chunks/{TsEB3aw-.js → Dwyq6WEC.js} +1 -1
  203. package/web/app/immutable/chunks/{CMQoXdpQ.js → Dx41gQiN.js} +1 -1
  204. package/web/app/immutable/chunks/{4gxaObsl.js → DxNbgJ8X.js} +2 -2
  205. package/web/app/immutable/chunks/{l6o3Xx95.js → Dz4sFk1c.js} +1 -1
  206. package/web/app/immutable/chunks/{BCXwgWax.js → DzHHkfB1.js} +1 -1
  207. package/web/app/immutable/chunks/{JTj2pw56.js → EbDWf2Y-.js} +1 -1
  208. package/web/app/immutable/chunks/{tHDPdTwr.js → Ek5W6pp5.js} +1 -1
  209. package/web/app/immutable/chunks/{DJuVbNrB.js → GETqdV-9.js} +1 -1
  210. package/web/app/immutable/chunks/{ViWKv_qM.js → H60Tbroe.js} +1 -1
  211. package/web/app/immutable/chunks/{SxNmK2GR.js → HvBMlLJP.js} +3 -3
  212. package/web/app/immutable/chunks/JzAjTSJP.js +1 -0
  213. package/web/app/immutable/chunks/{BXTPVho9.js → PPmweWGv.js} +2 -2
  214. package/web/app/immutable/chunks/{YRBYMsQ5.js → PrJr0a2j.js} +1 -1
  215. package/web/app/immutable/chunks/{BDo7DlDu.js → PwvNS9aJ.js} +1 -1
  216. package/web/app/immutable/chunks/{CfaMHdWP.js → RvvsGyv8.js} +1 -1
  217. package/web/app/immutable/chunks/{BBAp8oIt.js → UYKGMt9K.js} +1 -1
  218. package/web/app/immutable/chunks/{BxQzYe9E.js → VyOfhH-C.js} +1 -1
  219. package/web/app/immutable/chunks/{CjXLe_MO.js → X8W_BfF4.js} +1 -1
  220. package/web/app/immutable/chunks/{Ct8owPqN.js → XIXbmV8F.js} +1 -1
  221. package/web/app/immutable/chunks/{lsICrwNh.js → X_y6HQmR.js} +1 -1
  222. package/web/app/immutable/chunks/{CIX0DuRO.js → XzMpMF29.js} +1 -1
  223. package/web/app/immutable/chunks/{DnTKe3X-.js → YNoNxkXn.js} +2 -2
  224. package/web/app/immutable/chunks/{BCQ-e5LR.js → ZI2UcNVx.js} +1 -1
  225. package/web/app/immutable/chunks/{BUY1W-f0.js → _xNtAuSN.js} +1 -1
  226. package/web/app/immutable/chunks/{Cftldgk7.js → aETzmnsD.js} +1 -1
  227. package/web/app/immutable/chunks/{CZNjFz9H.js → fZqvRnJh.js} +1 -1
  228. package/web/app/immutable/chunks/{B10JrSzM.js → finAdq6c.js} +1 -1
  229. package/web/app/immutable/chunks/{C4Jo6GXP.js → gURPJ1oX.js} +1 -1
  230. package/web/app/immutable/chunks/{Dab1wvUg.js → j5aoAM0N.js} +1 -1
  231. package/web/app/immutable/chunks/{CyGN0Rwg.js → m18NZZRr.js} +1 -1
  232. package/web/app/immutable/chunks/{DIyuJ_GU.js → m3ndyWcI.js} +1 -1
  233. package/web/app/immutable/chunks/{BIY2S7K4.js → n58mTCVv.js} +1 -1
  234. package/web/app/immutable/chunks/{CHFUz5Rr.js → oilydQC6.js} +1 -1
  235. package/web/app/immutable/chunks/{iMyDpxOV.js → oxLL7zSC.js} +1 -1
  236. package/web/app/immutable/chunks/{Ba7k-40o.js → p3fN-Vr3.js} +1 -1
  237. package/web/app/immutable/chunks/{C-s9_soQ.js → s_GzTTEG.js} +1 -1
  238. package/web/app/immutable/chunks/{DVN2Xze9.js → t_3vjEsA.js} +1 -1
  239. package/web/app/immutable/chunks/{CHGTw2Bl.js → xOJeCqJf.js} +1 -1
  240. package/web/app/immutable/chunks/{juUcLrve.js → zN8eBYty.js} +1 -1
  241. package/web/app/immutable/entry/{app.9r9RhFng.js → app.Ci0fqF_i.js} +3 -3
  242. package/web/app/immutable/entry/start.DzDtsQrC.js +1 -0
  243. package/web/app/immutable/nodes/{0._MOrvR24.js → 0.BJcKF537.js} +1 -1
  244. package/web/app/immutable/nodes/{1.DVvUSeXg.js → 1.Dj_1C4wl.js} +1 -1
  245. package/web/app/immutable/nodes/{10.DIleurXr.js → 10.DTBkzFBQ.js} +1 -1
  246. package/web/app/immutable/nodes/{11.CPz1gfx7.js → 11.C9N9_Xb9.js} +1 -1
  247. package/web/app/immutable/nodes/{12.IWuvbIEt.js → 12.CqRfopX4.js} +1 -1
  248. package/web/app/immutable/nodes/{13.K9ySk2sQ.js → 13.CscEwLVK.js} +3 -3
  249. package/web/app/immutable/nodes/{14.BR3FpNbu.js → 14.BDOAvRMB.js} +1 -1
  250. package/web/app/immutable/nodes/{15.MdkxIvV5.js → 15.BWtoiI44.js} +1 -1
  251. package/web/app/immutable/nodes/{16.CKCeF79S.js → 16.Cfgb0nOQ.js} +1 -1
  252. package/web/app/immutable/nodes/{17.DNzYNnAu.js → 17.yV85i6g8.js} +2 -2
  253. package/web/app/immutable/nodes/{2.DJLdbLzb.js → 2.B_fHdNW9.js} +11 -11
  254. package/web/app/immutable/nodes/{3.BgL634Ss.js → 3.CzW2JK5A.js} +1 -1
  255. package/web/app/immutable/nodes/4.DP65YvXF.js +1 -0
  256. package/web/app/immutable/nodes/{5.sL-y10DG.js → 5.ivE-5gZP.js} +2 -2
  257. package/web/app/immutable/nodes/{6.Ci8BcEFn.js → 6.58wOdki0.js} +1 -1
  258. package/web/app/immutable/nodes/{7.BxPcDZ4n.js → 7.9Khb1Buc.js} +1 -1
  259. package/web/app/immutable/nodes/{8.DfInEKdf.js → 8.omc6d3jg.js} +12 -12
  260. package/web/app/immutable/nodes/{9.ChF6BmYv.js → 9._4FUjrca.js} +20 -20
  261. package/web/app/version.json +1 -1
  262. package/web/generated/paraglide.js +9 -9
  263. package/web/index.html +19 -19
  264. package/web/app/immutable/chunks/BAf7ckig.js +0 -1
  265. package/web/app/immutable/chunks/BCmtMsc3.js +0 -1
  266. package/web/app/immutable/chunks/BMQaU_PE.js +0 -2
  267. package/web/app/immutable/chunks/C2V9igbA.js +0 -1
  268. package/web/app/immutable/chunks/CGWRZzdk.js +0 -1
  269. package/web/app/immutable/chunks/CVc7LcaQ.js +0 -13
  270. package/web/app/immutable/chunks/DQJminLw.js +0 -1
  271. package/web/app/immutable/chunks/DrtMUjoh.js +0 -2
  272. package/web/app/immutable/chunks/FQr_NSnS.js +0 -1
  273. package/web/app/immutable/entry/start.C8tteIq6.js +0 -1
  274. package/web/app/immutable/nodes/4.CR0sD7s6.js +0 -1
@@ -1,6 +1,6 @@
1
- import{t as oe,br as st,a_ as at,bp as Q,bz as ie,bv as $t,bt as Me,b as ce}from"./CGWRZzdk.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as D,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as De,aj as Se,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as Be}from"./DYhIMPy1.js";import{v as Xt,I as ea,w as ne,n as jt,u as gt,p as Ne,j as se}from"./BjnZ1Xf3.js";import{b as ba}from"./BaIAhI85.js";import{f as Ut}from"./KJX0Kw6L.js";import{A as aa,ao as na,an as sa}from"./b-gQtgOb.js";import"./BEyWfhqM.js";import{al as ra,aC as oa,an as Aa,ao as ka,ap as We,ag as ia,a as $a,p as Ta,dw as Ca,aO as Sa,aq as Na}from"./C0g2TqGQ.js";import{R as Oa}from"./CxLPEkg7.js";import{F as pe,bx as Fa,bc as Ra,ay as Ma,aS as Wa,cz as Da}from"./By0eqGj-.js";import{H as Ba}from"./WvxOnEzW.js";import{e as La}from"./MgErAKgQ.js";import{L as Ea}from"./-v5-bXWK.js";import{f as Pa}from"./CpWbjqtx.js";import{c as Nt,Ix as Fe,nx as Ga,fE as za,bV as ja,r$ as Ka,uk as Ha}from"./CicdOSYm.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),S=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Dt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return S()},set onmouseleave(A){S(A),rt()},$set:ie,$on:(A,B)=>ce(a,A,B)},ht=nn(),bt=L(ht);{var Kt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(()=>D(Rt,` ${p()??""}`)),_(A,B)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
2
- hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return S()},children:(B,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(Ot)},get specialist(){return n().specialist}}),$(Lt);var Zt=C(Lt,2),_e=K(Zt,!0),Jt=C(Zt,2),te=L(Jt);{var ye=ft=>{var r=Va(),f=L(r),M=L(f);{let z=y(()=>s().kind==="blocker"?Ma:Wa);pe(M,{get icon(){return t(z)},size:"xs"})}var W=C(M,2),m=K(W,!0);$(f);var H=C(f,2);{var nt=z=>{var It=Ua(),ot=K(It,!0);k(()=>D(ot,s().reason)),_(z,It)};at(H,z=>{s().reason&&z(nt)})}var N=C(H,2);{var G=z=>{Oa(z,{get date(){return s().timestamp},class:"text-ui text-ghost"})};at(N,z=>{s().timestamp&&z(G)})}$(r),k(z=>{Xt(r,1,`text-sm flex flex-col items-center gap-0.5 ${s().kind==="blocker"?"text-red-500":"text-warning-ink"}`),D(m,z)},[()=>s().kind==="blocker"?Q.chat_agentCard_attentionBlocker_label():Q.chat_agentCard_attentionDiscussion_label()]),_(ft,r)},yt=ft=>{var r=Qa(),f=L(r);pe(f,{get icon(){return Fa},size:"xs",class:"animate-pulse"});var M=C(f,2),W=K(M,!0);$(r),k(m=>D(W,m),[()=>Q.agentOverview_hierarchyCard_waitingFor_label({names:t(E).join(", ")})]),_(ft,r)},Ie=ft=>{const r=y(()=>n().activeToolName?$a(n().activeToolName,n().activeToolInput||{}):null),f=y(()=>t(r)&&!t(r).hidden?t(r):null);var M=tn(),W=L(M),m=L(W);ea(m,{size:14});var H=C(m,2);{var nt=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_thinking_label()]),_(Y,Z)},N=Y=>{var Z=Za(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}
3
- ${t(f).subject??""}`)),_(Y,Z)},G=Y=>{var Z=Oe(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}...`)),_(Y,Z)},z=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_responding_label()]),_(Y,Z)};at(H,Y=>{i()?Y(nt):t(f)&&t(f).subject?Y(N,1):t(f)?Y(G,2):Y(z,-1)})}$(W);var It=C(W,2);{var ot=Y=>{var Z=Ja(),pt=K(Z,!0);k(()=>D(pt,n().lastResponse)),_(Y,Z)};at(It,Y=>{!t(f)&&n().lastResponse&&Y(ot)})}$(M),_(ft,M)},xe=ft=>{var r=en(),f=K(r,!0);k(()=>D(f,n().lastResponse)),_(ft,r)};at(te,ft=>{s()?ft(ye):c()?ft(yt,1):u()||i()?ft(Ie,2):n().lastResponse&&ft(xe,3)})}$(Jt),k(()=>D(_e,n().name)),_(B,Rt)},$$slots:{default:!0}})}var ge=C(Ft,2);{var Bt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Da},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(Lt=>D(Rt,` ${Lt??""}`),[()=>Q.agentOverview_hierarchyCard_note_label()]),_(A,B)};at(ge,A=>{R()&&u()&&A(Bt)})}$(ht),_(e,ht);var Qt=de(Dt);return l(),Qt}const sn=50;var rn=F('<span class="sr-only"> </span> <!>',1);function Re(e,a){if(new.target)return oe({component:Re,...e});le(a,!0);const s=()=>$t(R,"$attentionRequest$",c),g=()=>$t(h,"$agentSession$",c),u=()=>$t(p,"$agentIsWaitingForOtherAgents$",c),[c,d]=Me();let i=st(a,"agent",7),o=st(a,"onclick",7),l=st(a,"onmouseenter",7),n=st(a,"onmouseleave",7);const p=We(i().agentId),R=ia(i().agentId),h=oa(i().agentId),v=y(()=>{const x={attentionKind:s()?.kind??null};return g()?na(g(),x):sa({status:i().status,isResponding:i().status==="responding",isWaitingForOtherAgents:u()},{...x,isCompleted:i().status==="completed",isFailed:i().status==="failed"})});var b={get agent(){return i()},set agent(x){i(x),rt()},get onclick(){return o()},set onclick(x){o(x),rt()},get onmouseenter(){return l()},set onmouseenter(x){l(x),rt()},get onmouseleave(){return n()},set onmouseleave(x){n(x),rt()},$set:ie,$on:(x,it)=>ce(a,x,it)};Ut(e,{variant:"ghost",type:"button",class:"background-agent-card relative flex flex-col items-center justify-center gap-1 rounded-full bg-sidebar hover:bg-muted/70 transition-colors cursor-pointer p-2",get style(){return`width: 50px; min-height: 50px; anchor-name: --agent-hierarchy-${i().agentId??""};`},get onclick(){return o()},get onmouseenter(){return l()},get onmouseleave(){return n()},children:(x,it)=>{var E=rn(),I=Yt(E),P=K(I,!0),ct=C(I,2);aa(ct,{get agentId(){return i().agentId},size:32,get state(){return t(v)},get specialist(){return i().specialist}}),k(()=>D(P,i().name)),_(x,E)},$$slots:{default:!0}});var S=de(b);return d(),S}var re=he('<path fill="none"></path>'),on=F('<div class="batch-group-box relative z-10 bg-background border border-border rounded-xl"></div>'),cn=F('<svg class="connector-svg" style="overflow: visible; display: block;"><!><!></svg> <div class="children-items-row flex items-start justify-center"></div>',1),ln=F('<div class="children-wrapper flex flex-col items-center"></div>'),dn=F('<div class="agent-tree-node flex flex-col items-center"><div class="agent-card-wrapper relative z-10"><!></div> <!></div>'),gn=F('<div class="absolute inset-0 flex items-center justify-center"><div class="text-center text-subtle"><p class="text-lg font-medium"> </p> <p class="text-sm mt-1"> </p></div></div>'),un=F('<div class="utility-corral border border-dashed border-border rounded-lg p-3 min-w-20"><div class="corral-label text-xs text-subtle font-medium mb-2 text-center"> </div> <div class="corral-agents flex flex-col items-center gap-2"></div></div>'),fn=F('<div class="utility-corrals flex flex-col gap-4"></div>'),pn=F('<div class="text-xs text-subtle capitalize"> </div>'),vn=F('<span class="px-1.5 py-0.5 text-ui font-medium bg-muted text-subtle rounded"> </span>'),hn=F('<span class="text-warning-ink"> </span>'),mn=F('<span class="text-primary-ink"> </span>'),_n=F('<span class="text-green-500"> </span>'),yn=F('<span class="text-red-500"> </span>'),In=F("<span> </span>"),xn=F('<div class="text-xs text-subtle line-clamp-3 border-t border-border pt-2 mt-2"> </div>'),wn=F('<div class="text-xs text-subtle flex items-center gap-1"><!> <span> </span></div>'),bn=F('<div class="p-3 space-y-2"><div class="flex items-center gap-2"><!> <div class="flex-1 min-w-0"><div class="font-medium text-sm truncate"> </div> <!></div> <!></div> <div class="text-xs text-subtle"><!></div> <div class="text-xs text-subtle"> </div> <!> <!></div>'),An=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),kn=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),$n=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg>'),Tn=F('<div class="canvas-content absolute inset-0 flex items-center justify-center p-8 svelte-13q5gm4"><div class="hierarchy-wrapper flex items-start gap-8"><!> <div class="main-hierarchy flex flex-col items-center gap-4"><div class="hierarchy-container flex flex-col items-center gap-4"><div class="roots-row flex justify-center"></div></div></div></div> <!></div> <div class="zoom-controls absolute bottom-4 right-4 flex items-center gap-1 bg-card border border-border rounded-lg shadow-sm p-1"><!> <!> <!> <div class="w-px h-6 bg-border mx-1"></div> <!></div> <div class="absolute bottom-4 left-4 text-xs text-subtle"> </div>',1),Cn=F('<div class="agent-hierarchy-graph relative w-full h-full overflow-hidden bg-background svelte-13q5gm4"><!></div>');function la(e,a){if(new.target)return oe({component:la,...e});le(a,!0);const s=(r,f=wa,M)=>{const W=y(()=>f().agent.isBackground),m=y(()=>f().children.length>0),H=y(()=>t(m)&&f().children[0]?.agent.isBackground?sn:Xa),nt=y(()=>16),N=y(()=>60),G=y(()=>t(m)?Rt(f().children,t(H),i):[]),z=y(()=>(()=>{const O=[];for(let q=0;q<t(G).length;q+=Tt)O.push(t(G).slice(q,q+Tt));return O})()),It=y(()=>t(z).map(O=>O.reduce((q,J)=>q+J.width,0)+Math.max(0,O.length-1)*i)),ot=y(()=>Math.max(...t(It),0));var Y=dn(),Z=L(Y),pt=L(Z);{var Et=O=>{Re(O,{get agent(){return f().agent},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})},we=O=>{ca(O,{get agent(){return f().agent},get activeFile(){return f().activeFile},get activeNote(){return f().activeNote},get agentNames(){return t(Lt)},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})};at(pt,O=>{t(W)?O(Et):O(we,-1)})}$(Z);var be=C(Z,2);{var U=O=>{const q=y(()=>f().agent.status==="waiting"?f().agent.waitingForAgentIds||[]:[]),J=y(()=>t(q).length>0),et=y(()=>t(N)/2);var xt=ln();jt(xt,21,()=>t(z),Ne,(Ht,At,Ct)=>{const Pt=y(()=>t(It)[Ct]),ee=y(()=>(t(ot)-t(Pt))/2),Ae=y(()=>(()=>{let ut=0;return t(At).map(j=>{const St=ut+j.width/2;return ut+=j.width+i,St})})());var ue=cn(),Gt=Yt(ue);gt(Gt,"height",t(N));var qt=L(Gt);{var ke=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} -${Ya} L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)},$e=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} 0 L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)};at(qt,ut=>{Ct>0?ut(ke):ut($e,-1)})}var Te=C(qt);jt(Te,17,()=>t(At),Ne,(ut,j,St)=>{const vt=y(()=>t(ee)+t(Ae)[St]),lt=y(()=>t(ot)/2),zt=y(()=>t(j).type==="batch"?t(j).children.some(wt=>t(q).includes(wt.agent.agentId)):t(q).includes(t(j).child.agent.agentId)),mt=y(()=>t(zt)?"var(--color-primary)":"currentColor"),kt=y(()=>t(zt)?"":"text-border"),w=y(()=>t(zt)?2:1),T=y(()=>t(j).type==="batch"?t(N)-A:t(N)),tt=y(()=>Math.abs(t(vt)-t(lt))),X=y(()=>Math.min(t(nt),t(tt)/2));var fe=Be(),Ce=Yt(fe);{var va=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3} L ${t(lt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)},ha=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3}
1
+ import{t as oe,br as st,a_ as at,bp as Q,bz as ie,bv as $t,bt as Me,b as ce}from"./DTQYcznv.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as D,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as De,aj as Se,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as Be}from"./DYhIMPy1.js";import{v as Xt,I as ea,w as ne,n as jt,u as gt,p as Ne,j as se}from"./Ck9ZyE1n.js";import{b as ba}from"./BaIAhI85.js";import{f as Ut}from"./BP5uyQTv.js";import{A as aa,ao as na,an as sa}from"./Dlag9Uxb.js";import"./CaxyE6o_.js";import{al as ra,aC as oa,an as Aa,ao as ka,ap as We,ag as ia,a as $a,p as Ta,dw as Ca,aO as Sa,aq as Na}from"./B0biUQQF.js";import{R as Oa}from"./CuhrgDBI.js";import{F as pe,bx as Fa,bc as Ra,ay as Ma,aS as Wa,cz as Da}from"./CoLl8pQb.js";import{H as Ba}from"./ByuX26Ym.js";import{e as La}from"./BKYCO_49.js";import{L as Ea}from"./D6Wx8h-l.js";import{f as Pa}from"./BabPi6C5.js";import{c as Nt,Iz as Fe,nx as za,fE as Ga,bV as ja,r$ as Ka,uk as Ha}from"./A0r9TbR7.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),S=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Dt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return S()},set onmouseleave(A){S(A),rt()},$set:ie,$on:(A,B)=>ce(a,A,B)},ht=nn(),bt=L(ht);{var Kt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(()=>D(Rt,` ${p()??""}`)),_(A,B)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
2
+ hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return S()},children:(B,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(Ot)},get specialist(){return n().specialist}}),$(Lt);var Zt=C(Lt,2),_e=K(Zt,!0),Jt=C(Zt,2),te=L(Jt);{var ye=ft=>{var r=Va(),f=L(r),M=L(f);{let G=y(()=>s().kind==="blocker"?Ma:Wa);pe(M,{get icon(){return t(G)},size:"xs"})}var W=C(M,2),m=K(W,!0);$(f);var H=C(f,2);{var nt=G=>{var It=Ua(),ot=K(It,!0);k(()=>D(ot,s().reason)),_(G,It)};at(H,G=>{s().reason&&G(nt)})}var N=C(H,2);{var z=G=>{Oa(G,{get date(){return s().timestamp},class:"text-ui text-ghost"})};at(N,G=>{s().timestamp&&G(z)})}$(r),k(G=>{Xt(r,1,`text-sm flex flex-col items-center gap-0.5 ${s().kind==="blocker"?"text-red-500":"text-warning-ink"}`),D(m,G)},[()=>s().kind==="blocker"?Q.chat_agentCard_attentionBlocker_label():Q.chat_agentCard_attentionDiscussion_label()]),_(ft,r)},yt=ft=>{var r=Qa(),f=L(r);pe(f,{get icon(){return Fa},size:"xs",class:"animate-pulse"});var M=C(f,2),W=K(M,!0);$(r),k(m=>D(W,m),[()=>Q.agentOverview_hierarchyCard_waitingFor_label({names:t(E).join(", ")})]),_(ft,r)},Ie=ft=>{const r=y(()=>n().activeToolName?$a(n().activeToolName,n().activeToolInput||{}):null),f=y(()=>t(r)&&!t(r).hidden?t(r):null);var M=tn(),W=L(M),m=L(W);ea(m,{size:14});var H=C(m,2);{var nt=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_thinking_label()]),_(Y,Z)},N=Y=>{var Z=Za(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}
3
+ ${t(f).subject??""}`)),_(Y,Z)},z=Y=>{var Z=Oe(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}...`)),_(Y,Z)},G=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_responding_label()]),_(Y,Z)};at(H,Y=>{i()?Y(nt):t(f)&&t(f).subject?Y(N,1):t(f)?Y(z,2):Y(G,-1)})}$(W);var It=C(W,2);{var ot=Y=>{var Z=Ja(),pt=K(Z,!0);k(()=>D(pt,n().lastResponse)),_(Y,Z)};at(It,Y=>{!t(f)&&n().lastResponse&&Y(ot)})}$(M),_(ft,M)},xe=ft=>{var r=en(),f=K(r,!0);k(()=>D(f,n().lastResponse)),_(ft,r)};at(te,ft=>{s()?ft(ye):c()?ft(yt,1):u()||i()?ft(Ie,2):n().lastResponse&&ft(xe,3)})}$(Jt),k(()=>D(_e,n().name)),_(B,Rt)},$$slots:{default:!0}})}var ge=C(Ft,2);{var Bt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Da},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(Lt=>D(Rt,` ${Lt??""}`),[()=>Q.agentOverview_hierarchyCard_note_label()]),_(A,B)};at(ge,A=>{R()&&u()&&A(Bt)})}$(ht),_(e,ht);var Qt=de(Dt);return l(),Qt}const sn=50;var rn=F('<span class="sr-only"> </span> <!>',1);function Re(e,a){if(new.target)return oe({component:Re,...e});le(a,!0);const s=()=>$t(R,"$attentionRequest$",c),g=()=>$t(h,"$agentSession$",c),u=()=>$t(p,"$agentIsWaitingForOtherAgents$",c),[c,d]=Me();let i=st(a,"agent",7),o=st(a,"onclick",7),l=st(a,"onmouseenter",7),n=st(a,"onmouseleave",7);const p=We(i().agentId),R=ia(i().agentId),h=oa(i().agentId),v=y(()=>{const x={attentionKind:s()?.kind??null};return g()?na(g(),x):sa({status:i().status,isResponding:i().status==="responding",isWaitingForOtherAgents:u()},{...x,isCompleted:i().status==="completed",isFailed:i().status==="failed"})});var b={get agent(){return i()},set agent(x){i(x),rt()},get onclick(){return o()},set onclick(x){o(x),rt()},get onmouseenter(){return l()},set onmouseenter(x){l(x),rt()},get onmouseleave(){return n()},set onmouseleave(x){n(x),rt()},$set:ie,$on:(x,it)=>ce(a,x,it)};Ut(e,{variant:"ghost",type:"button",class:"background-agent-card relative flex flex-col items-center justify-center gap-1 rounded-full bg-sidebar hover:bg-muted/70 transition-colors cursor-pointer p-2",get style(){return`width: 50px; min-height: 50px; anchor-name: --agent-hierarchy-${i().agentId??""};`},get onclick(){return o()},get onmouseenter(){return l()},get onmouseleave(){return n()},children:(x,it)=>{var E=rn(),I=Yt(E),P=K(I,!0),ct=C(I,2);aa(ct,{get agentId(){return i().agentId},size:32,get state(){return t(v)},get specialist(){return i().specialist}}),k(()=>D(P,i().name)),_(x,E)},$$slots:{default:!0}});var S=de(b);return d(),S}var re=he('<path fill="none"></path>'),on=F('<div class="batch-group-box relative z-10 bg-background border border-border rounded-xl"></div>'),cn=F('<svg class="connector-svg" style="overflow: visible; display: block;"><!><!></svg> <div class="children-items-row flex items-start justify-center"></div>',1),ln=F('<div class="children-wrapper flex flex-col items-center"></div>'),dn=F('<div class="agent-tree-node flex flex-col items-center"><div class="agent-card-wrapper relative z-10"><!></div> <!></div>'),gn=F('<div class="absolute inset-0 flex items-center justify-center"><div class="text-center text-subtle"><p class="text-lg font-medium"> </p> <p class="text-sm mt-1"> </p></div></div>'),un=F('<div class="utility-corral border border-dashed border-border rounded-lg p-3 min-w-20"><div class="corral-label text-xs text-subtle font-medium mb-2 text-center"> </div> <div class="corral-agents flex flex-col items-center gap-2"></div></div>'),fn=F('<div class="utility-corrals flex flex-col gap-4"></div>'),pn=F('<div class="text-xs text-subtle capitalize"> </div>'),vn=F('<span class="px-1.5 py-0.5 text-ui font-medium bg-muted text-subtle rounded"> </span>'),hn=F('<span class="text-warning-ink"> </span>'),mn=F('<span class="text-primary-ink"> </span>'),_n=F('<span class="text-green-500"> </span>'),yn=F('<span class="text-red-500"> </span>'),In=F("<span> </span>"),xn=F('<div class="text-xs text-subtle line-clamp-3 border-t border-border pt-2 mt-2"> </div>'),wn=F('<div class="text-xs text-subtle flex items-center gap-1"><!> <span> </span></div>'),bn=F('<div class="p-3 space-y-2"><div class="flex items-center gap-2"><!> <div class="flex-1 min-w-0"><div class="font-medium text-sm truncate"> </div> <!></div> <!></div> <div class="text-xs text-subtle"><!></div> <div class="text-xs text-subtle"> </div> <!> <!></div>'),An=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),kn=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),$n=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg>'),Tn=F('<div class="canvas-content absolute inset-0 flex items-center justify-center p-8 svelte-13q5gm4"><div class="hierarchy-wrapper flex items-start gap-8"><!> <div class="main-hierarchy flex flex-col items-center gap-4"><div class="hierarchy-container flex flex-col items-center gap-4"><div class="roots-row flex justify-center"></div></div></div></div> <!></div> <div class="zoom-controls absolute bottom-4 right-4 flex items-center gap-1 bg-card border border-border rounded-lg shadow-sm p-1"><!> <!> <!> <div class="w-px h-6 bg-border mx-1"></div> <!></div> <div class="absolute bottom-4 left-4 text-xs text-subtle"> </div>',1),Cn=F('<div class="agent-hierarchy-graph relative w-full h-full overflow-hidden bg-background svelte-13q5gm4"><!></div>');function la(e,a){if(new.target)return oe({component:la,...e});le(a,!0);const s=(r,f=wa,M)=>{const W=y(()=>f().agent.isBackground),m=y(()=>f().children.length>0),H=y(()=>t(m)&&f().children[0]?.agent.isBackground?sn:Xa),nt=y(()=>16),N=y(()=>60),z=y(()=>t(m)?Rt(f().children,t(H),i):[]),G=y(()=>(()=>{const O=[];for(let q=0;q<t(z).length;q+=Tt)O.push(t(z).slice(q,q+Tt));return O})()),It=y(()=>t(G).map(O=>O.reduce((q,J)=>q+J.width,0)+Math.max(0,O.length-1)*i)),ot=y(()=>Math.max(...t(It),0));var Y=dn(),Z=L(Y),pt=L(Z);{var Et=O=>{Re(O,{get agent(){return f().agent},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})},we=O=>{ca(O,{get agent(){return f().agent},get activeFile(){return f().activeFile},get activeNote(){return f().activeNote},get agentNames(){return t(Lt)},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})};at(pt,O=>{t(W)?O(Et):O(we,-1)})}$(Z);var be=C(Z,2);{var U=O=>{const q=y(()=>f().agent.status==="waiting"?f().agent.waitingForAgentIds||[]:[]),J=y(()=>t(q).length>0),et=y(()=>t(N)/2);var xt=ln();jt(xt,21,()=>t(G),Ne,(Ht,At,Ct)=>{const Pt=y(()=>t(It)[Ct]),ee=y(()=>(t(ot)-t(Pt))/2),Ae=y(()=>(()=>{let ut=0;return t(At).map(j=>{const St=ut+j.width/2;return ut+=j.width+i,St})})());var ue=cn(),zt=Yt(ue);gt(zt,"height",t(N));var qt=L(zt);{var ke=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} -${Ya} L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)},$e=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} 0 L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)};at(qt,ut=>{Ct>0?ut(ke):ut($e,-1)})}var Te=C(qt);jt(Te,17,()=>t(At),Ne,(ut,j,St)=>{const vt=y(()=>t(ee)+t(Ae)[St]),lt=y(()=>t(ot)/2),Gt=y(()=>t(j).type==="batch"?t(j).children.some(wt=>t(q).includes(wt.agent.agentId)):t(q).includes(t(j).child.agent.agentId)),mt=y(()=>t(Gt)?"var(--color-primary)":"currentColor"),kt=y(()=>t(Gt)?"":"text-border"),w=y(()=>t(Gt)?2:1),T=y(()=>t(j).type==="batch"?t(N)-A:t(N)),tt=y(()=>Math.abs(t(vt)-t(lt))),X=y(()=>Math.min(t(nt),t(tt)/2));var fe=Be(),Ce=Yt(fe);{var va=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3} L ${t(lt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)},ha=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3}
4
4
  L ${t(lt)??""} ${t(et)-t(X)}
5
5
  Q ${t(lt)??""} ${t(et)??""}, ${t(lt)-t(X)} ${t(et)??""}
6
6
  L ${t(vt)+t(X)} ${t(et)??""}
@@ -10,5 +10,5 @@ import{t as oe,br as st,a_ as at,bp as Q,bz as ie,bv as $t,bt as Me,b as ce}from
10
10
  Q ${t(lt)??""} ${t(et)??""}, ${t(lt)+t(X)} ${t(et)??""}
11
11
  L ${t(vt)-t(X)} ${t(et)??""}
12
12
  Q ${t(vt)??""} ${t(et)??""}, ${t(vt)??""} ${t(et)+t(X)}
13
- L ${t(vt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)};at(Ce,wt=>{t(tt)<1?wt(va):t(vt)<t(lt)?wt(ha,1):wt(ma,-1)})}_(ut,fe)}),$(Gt);var ae=C(Gt,2);jt(ae,21,()=>t(At),Ne,(ut,j)=>{var St=Be(),vt=Yt(St);{var lt=mt=>{var kt=on();jt(kt,21,()=>t(j).children,w=>w.agent.agentId,(w,T)=>{s(w,()=>t(T))}),$(kt),k(()=>ne(kt,`padding: 10px; margin-top: -10px; display: grid; grid-template-columns: repeat(${t(j).cols??""}, auto); gap: 12px;`)),_(mt,kt)},zt=mt=>{s(mt,()=>t(j).child)};at(vt,mt=>{t(j).type==="batch"?mt(lt):mt(zt,-1)})}_(ut,St)}),$(ae),k(()=>{gt(Gt,"width",t(ot)),ne(ae,`gap: 12px; width: ${t(ot)??""}px;`)}),_(Ht,ue)}),$(xt),k(()=>ne(xt,`width: ${t(ot)??""}px;`)),_(O,xt)};at(be,O=>{t(m)&&O(U)})}$(Y),_(r,Y)};let g=st(a,"agents",7),u=st(a,"edges",7),c=st(a,"onAgentClick",7),d=st(a,"onFocus",7);const i=12,o=[{id:"git",label:"Git",types:["commit-message","pr-description"]},{id:"review",label:Q.agentOverview_hierarchyGraph_reviewCorral_label(),types:["code-review","code-walkthrough"]}];let l=Mt(1),n=Mt(0),p=Mt(0),R=Mt(!1),h=Mt(_a({x:0,y:0})),v=Mt(null),b=Mt(null),S=Mt(null);function x(r){t(S)&&clearTimeout(t(S)),V(b,r,!0)}function it(){t(S)&&(clearTimeout(t(S)),V(S,null)),V(b,null)}const E=y(()=>t(b)?g().find(r=>r.agentId===t(b)):null),I=.25,P=2,ct=.1;function _t(r){if(r.preventDefault(),r.ctrlKey||r.metaKey){const f=-r.deltaY*.001,M=Math.min(P,Math.max(I,t(l)*(1+f)));if(t(v)){const W=t(v).getBoundingClientRect(),m=r.clientX-W.left,H=r.clientY-W.top,nt=M/t(l);V(n,m-(m-t(n))*nt),V(p,H-(H-t(p))*nt)}V(l,M,!0)}else V(n,t(n)-r.deltaX),V(p,t(p)-r.deltaY)}function Ot(r){const f=r.target,M=f.closest(".agent-hierarchy-graph")&&!f.closest(".agent-card")&&!f.closest(".bg-agent-card")&&!f.closest(".zoom-controls");(r.button===1||r.button===0&&(r.shiftKey||M))&&(V(R,!0),V(h,{x:r.clientX,y:r.clientY},!0),r.preventDefault()),r.button===0&&d()?.()}function Dt(r){if(!t(R))return;const f=r.clientX-t(h).x,M=r.clientY-t(h).y;V(n,t(n)+f),V(p,t(p)+M),V(h,{x:r.clientX,y:r.clientY},!0)}function ht(){V(R,!1)}function bt(){V(l,Math.min(P,t(l)+ct),!0)}function Kt(){V(l,Math.max(I,t(l)-ct),!0)}function Ft(){V(l,1),V(n,0),V(p,0)}function ge(){V(l,.8),V(n,0),V(p,0)}const Bt=y(()=>Math.round(t(l)*100)),Qt=5e3,A=10,B=4,Tt=6;function Rt(r,f,M){if(r.length===0)return[];const W=[],m=new Map;for(const N of r){const G=N.agent.delegationBatchId;G&&(m.has(G)||m.set(G,[]),m.get(G).push(N))}const H=new Set;for(const N of r){const G=N.agent.delegationBatchId;if(G)H.has(G)||(H.add(G),W.push(m.get(G)));else{const z=W[W.length-1];if(z&&!z[0].agent.delegationBatchId){const It=new Date(z[z.length-1].agent.createdAt).getTime();if(new Date(N.agent.createdAt).getTime()-It<=Qt){z.push(N);continue}}W.push([N])}}const nt=f+M;return W.map(N=>{if(N.length===1)return{type:"single",child:N[0],width:f};const G=Math.min(Math.ceil(Math.sqrt(N.length)),B),z=Math.ceil(N.length/G);return{type:"batch",children:N,cols:G,rows:z,width:G*nt-M+A*2}})}const Lt=y(()=>{const r=new Map;for(const f of g())r.set(f.agentId,f.name);return r}),me=new Set(o.flatMap(r=>[...r.types])),Zt=y(()=>{const r=[];for(const f of o){const M=new Set(f.types),W=g().filter(m=>m.agentType&&M.has(m.agentType));W.length>0&&r.push({id:f.id,label:f.label,agents:W})}return r}),_e=y(()=>g().filter(r=>!r.agentType||!me.has(r.agentType))),Jt=y(()=>{const r=new Map,f=[];for(const m of t(_e))r.set(m.agentId,{agent:m,children:[],activeFile:void 0,activeNote:void 0});const M=u().filter(m=>m.isActive);for(const m of M){const H=m.sourceId.replace("agent-",""),nt=r.get(H);nt&&(m.type==="file-read"||m.type==="file-write"?nt.activeFile=m.targetId.replace("file-","").split("/").pop():(m.type==="note-read"||m.type==="note-write")&&(nt.activeNote=m.targetId.replace("note-","")))}for(const[,m]of r){const H=m.agent.parentAgentId;H&&r.has(H)?r.get(H).children.push(m):f.push(m)}const W=(m,H)=>new Date(m.agent.createdAt).getTime()-new Date(H.agent.createdAt).getTime();for(const[,m]of r)m.children.sort(W);return f.sort(W),f});function te(r,f){c()?.(r.agentId,r.name,f)}var ye={get agents(){return g()},set agents(r){g(r),rt()},get edges(){return u()},set edges(r){u(r),rt()},get onAgentClick(){return c()},set onAgentClick(r){c(r),rt()},get onFocus(){return d()},set onFocus(r){d(r),rt()},$set:ie,$on:(r,f)=>ce(a,r,f)},yt=Cn(),Ie=L(yt);{var xe=r=>{var f=gn(),M=L(f),W=L(M),m=K(W,!0),H=C(W,2),nt=K(H,!0);$(M),$(f),k((N,G)=>{D(m,N),D(nt,G)},[()=>Q.agentOverview_hierarchyGraph_noAgents_title(),()=>Q.agentOverview_hierarchyGraph_noAgents_description()]),_(r,f)},ft=r=>{var f=Tn(),M=Yt(f),W=L(M),m=L(W);{var H=U=>{var O=fn();jt(O,21,()=>t(Zt),q=>q.id,(q,J)=>{var et=un(),xt=L(et),Ht=K(xt,!0),At=C(xt,2);jt(At,21,()=>t(J).agents,Ct=>Ct.agentId,(Ct,Pt)=>{Re(Ct,{get agent(){return t(Pt)},onclick:ee=>te(t(Pt),ee),onmouseenter:()=>x(t(Pt).agentId),onmouseleave:it})}),$(At),$(et),k(()=>D(Ht,t(J).label)),_(q,et)}),$(O),_(U,O)};at(m,U=>{t(Zt).length>0&&U(H)})}var nt=C(m,2),N=L(nt),G=L(N);ne(G,"gap: 12px;"),jt(G,21,()=>t(Jt),U=>U.agent.agentId,(U,O)=>{s(U,()=>t(O))}),$(G),$(N),$(nt),$(W);var z=C(W,2);{var It=U=>{{let O=y(()=>"--agent-hierarchy-"+t(b));Ba(U,{get anchor(){return t(O)},position:"top",absolute:!0,children:(q,J)=>{var et=bn(),xt=L(et),Ht=L(xt);La(Ht,{variant:"emphasized",get agentId(){return t(E).agentId}});var At=C(Ht,2),Ct=L(At),Pt=K(Ct,!0),ee=C(Ct,2);{var Ae=w=>{var T=pn(),tt=K(T,!0);k(X=>D(tt,X),[()=>t(E).specialist.replace("-"," ")]),_(w,T)};at(ee,w=>{t(E).specialist&&w(Ae)})}$(At);var ue=C(At,2);{var Gt=w=>{var T=vn(),tt=K(T,!0);k(X=>D(tt,X),[()=>Q.agentOverview_hierarchyGraph_background_badge()]),_(w,T)};at(ue,w=>{t(E).isBackground&&w(Gt)})}$(xt);var qt=C(xt,2),ke=L(qt);{var $e=w=>{var T=hn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusWaiting_label()]),_(w,T)},Te=w=>{var T=mn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusResponding_label()]),_(w,T)},ae=w=>{var T=_n(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusCompleted_label()]),_(w,T)},ut=w=>{var T=yn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusFailed_label()]),_(w,T)},j=w=>{var T=In(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusIdle_label()]),_(w,T)};at(ke,w=>{t(E).status==="waiting"?w($e):t(E).status==="responding"?w(Te,1):t(E).status==="completed"?w(ae,2):t(E).status==="failed"?w(ut,3):w(j,-1)})}$(qt);var St=C(qt,2),vt=K(St,!0),lt=C(St,2);{var zt=w=>{var T=xn(),tt=K(T,!0);k(()=>D(tt,t(E).lastResponse)),_(w,T)};at(lt,w=>{t(E).lastResponse&&w(zt)})}var mt=C(lt,2);{var kt=w=>{var T=wn(),tt=L(T);ea(tt,{size:12});var X=C(tt,2),fe=K(X,!0);$(T),k(Ce=>D(fe,Ce),[()=>Q.agentOverview_hierarchyGraph_usingTool_label({tool:t(E).activeToolName})]),_(w,T)};at(mt,w=>{t(E).activeToolName&&w(kt)})}$(et),k(w=>{D(Pt,t(E).name),D(vt,w)},[()=>Q.agentOverview_hierarchyGraph_created_label({time:Ea(t(E).createdAt)})]),_(q,et)},$$slots:{default:!0}})}};at(z,U=>{t(E)&&U(It)})}$(M);var ot=C(M,2),Y=L(ot);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomOut_tooltip());Ut(Y,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:Kt,get title(){return t(U)},children:(O,q)=>{var J=An();_(O,J)},$$slots:{default:!0}})}var Z=C(Y,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_resetZoom_tooltip());Ut(Z,{variant:"ghost",type:"button",class:"zoom-percent w-12 h-8 flex items-center justify-center text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors",onclick:Ft,get title(){return t(U)},children:(O,q)=>{Ia();var J=xa();k(()=>D(J,`${t(Bt)??""}%`)),_(O,J)},$$slots:{default:!0}})}var pt=C(Z,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomIn_tooltip());Ut(pt,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:bt,get title(){return t(U)},children:(O,q)=>{var J=kn();_(O,J)},$$slots:{default:!0}})}var Et=C(pt,4);{let U=y(()=>Q.agentOverview_hierarchyGraph_fitToView_tooltip());Ut(Et,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:ge,get title(){return t(U)},children:(O,q)=>{var J=$n();_(O,J)},$$slots:{default:!0}})}$(ot);var we=C(ot,2),be=K(we,!0);k(U=>{ne(M,`transform: translate(${t(n)??""}px, ${t(p)??""}px) scale(${t(l)??""}); transform-origin: center center;`),D(be,U)},[()=>Q.agentOverview_hierarchyGraph_panHint_label()]),_(r,f)};at(Ie,r=>{t(Jt).length===0?r(xe):r(ft,-1)})}return $(yt),ba(yt,r=>V(v,r),()=>t(v)),De("wheel",yt,_t),Se("mousedown",yt,Ot),Se("mousemove",yt,Dt),Se("mouseup",yt,ht),De("mouseleave",yt,ht),_(e,yt),de(ye)}ya(["mousedown","mousemove","mouseup"]);const Ee=new Set(["str-replace-editor","save-file","remove-files","str_replace_editor"]),Pe=new Set(["create_note","update_note","set_note_content","add_to_note","append_to_note","edit_note","edit_note_lines","update_note_metadata","read_note","view_note","delete_note"]),Sn=new Set(["read_note","view_note","list_note_tasks"]),Ge=new Set(["add_tasks","update_tasks","view_tasklist","reorganize_tasklist"]),Nn=new Set(["view_tasklist"]),ze=new Set(["delegate_task","create_sub_agent","create_agent"]),On=5e3;function Fn(e,a=!1){if(!e)return"idle";if(e.status===Nt.Completed)return"completed";if(e.status===Nt.Error||e.status===Nt.Deleted)return"failed";if(a||da(e))return"responding";if(ga(e.status))return"idle";if(e.messages&&e.messages.length>0){const s=[...e.messages].reverse().find(g=>g.role==="assistant");if(s&&(s.isStreaming||s.streamingComplete===!1))return"responding"}switch(e.status){case Nt.Active:return"idle";case Nt.Pending:case Nt.Idle:return"idle";case Nt.Processing:return a?"responding":"idle";case Nt.Waiting:return"waiting";default:return"idle"}}function da(e){return!!(e.isProcessing||e.isStreaming||e.isResponding)}function ga(e){return e===Nt.Idle||e==="idle"}function Rn(e){const a={};if(!e)return a;if(e.lastAgentResponse){const s=Ta(e.lastAgentResponse);s&&(a.lastResponse=s)}return ga(e.status)&&!da(e)||e.isStreaming&&e.lastToolUse?.name&&(a.activeToolName=e.lastToolUse.name,a.activeToolInput=e.lastToolUse.input||{}),a}function Wt(e){return(e.name||e.toolName||"").toLowerCase()}function Vt(e){return"input"in e&&e.input?e.input:"arguments"in e&&e.arguments?e.arguments:"parameters"in e&&e.parameters?e.parameters:{}}function Mn(e){const a=e.toLowerCase();if(Ee.has(e))return!0;for(const s of Ee)if(a.startsWith(s.toLowerCase()))return!0;return!!(a.startsWith("edit ")||a.startsWith("save ")||a.startsWith("create "))}function ua(e){const a=e.toLowerCase();return!!(a.startsWith("read `")&&!a.includes("read `.`")||a.startsWith("view")||a==="view")}function je(e){if(Pe.has(e))return!0;for(const a of Pe)if(e.startsWith(a))return!0;return!1}function Wn(e){return e==="save-file"?"create":e==="remove-files"?"delete":"modify"}function Ke(e){return e==="create_note"?"create":Sn.has(e)?"read":"write"}function He(e){if(Ge.has(e))return!0;for(const a of Ge)if(e.startsWith(a))return!0;return!1}function qe(e){return e==="add_tasks"?"create":Nn.has(e)?"read":"update"}function fa(e){if(e==="."||e==="./"||e.endsWith("/"))return!0;const s=(e.split("/").pop()||e).lastIndexOf(".");return s===-1||s===0}function Dn(e){const a=e.match(/`([^`]+)`/);if(a&&a[1]){const s=a[1];return fa(s)?null:s}return null}function Xe(e,a){const s=e.path||e.file_path||e.filePath;return typeof s=="string"?fa(s)?null:s:a?Dn(a):null}function Ye(e){const a=e.noteId||e.note_id||e.title;return typeof a=="string"?a:null}function Ue(e){return Mn(e)||ua(e)}function Ve(e){return ua(e)?"read":Wn(e)}function Bn(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name||d.toolName);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}}return s}function Ln(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}}return s}function Qe(e){const a=[],s=e.tasks;if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.name;c&&a.push({taskId:`task-${c.toLowerCase().replace(/\s+/g,"-").slice(0,30)}`,name:c,description:u.description,state:u.state})}}if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.task_id;c&&!a.some(d=>d.taskId===c)&&a.push({taskId:c,name:u.name||c,description:u.description,state:u.state})}}return a}function Ze(e){if(!e)return"not_started";const a=e.toLowerCase();return a==="complete"||a==="completed"||a==="done"?"complete":a==="in_progress"||a==="in-progress"||a==="started"?"in_progress":a==="cancelled"||a==="canceled"?"cancelled":"not_started"}function En(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}}return s}function Je(e){if(ze.has(e))return!0;for(const a of ze)if(e.startsWith(a))return!0;return!1}function ta(e){if(!e)return null;const a=e.match(/Agent ID:\s*(\S+)/i);return a?a[1]:null}function ve(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.filter(a=>a&&typeof a=="object"&&a.type==="text"&&a.text).map(a=>a.text).join(`
14
- `);if(e&&typeof e=="object"){const a=e;if(typeof a.text=="string")return a.text;if(typeof a.content=="string")return a.content}return""}function Pn(e,a){const s=new Map,g=new Map;let u=0;for(const c of e){const d=[];if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const i of c.contentBlocks)if(i.type==="tool_use"&&i.name){const o=Wt(i);Je(o)&&i.id&&d.push(i.id)}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const i of c.toolCalls){const o=Wt(i);if(Je(o)){const l=i.id;l&&!d.includes(l)&&d.push(l)}}if(d.length>1){const i=`${a}-batch-${u}`;for(const o of d)g.set(o,i);u++}}for(const c of e){if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const d of c.contentBlocks)if(d.type==="tool_result"&&d.tool_use_id){const i=d.tool_use_id,o=g.get(i);if(o){const l=ve(d.text)||ve(d.content)||ve(d.output),n=ta(l);n&&s.set(n,o)}}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const d of c.toolCalls){const i=d.id;if(!i)continue;const o=g.get(i);if(!o)continue;const l=d.result;if(l){const n=ve(l),p=ta(n);p&&s.set(p,o)}}}return s}function Gn(e){const a={id:e.id,timestamp:e.timestamp,agentId:e.actor?.id||"",agentName:e.actor?.name};if(e.type==="agent:created"){const s=e.data;return{...a,type:"agent-created",agentId:s?.agentId||a.agentId,agentName:s?.agentName||a.agentName,parentAgentId:s?.createdByAgentId}}if(e.type==="agent:idle"){const s=e.data;return{...a,type:"agent-idle",agentId:s?.agentId||a.agentId,parentAgentId:s?.parentAgentId}}if(e.type==="file:changed"&&e.actor?.type==="agent"){const s=e.data,g=s?.action,u=g==="create"||g==="modify"||g==="delete",c=s?.relativePath;return{...a,type:u?"file-write":"file-read",targetId:s?.path||c,targetName:c?.split("/").pop()}}if(e.type?.startsWith("note:")&&e.actor?.type==="agent"){const s=e.data,g=e.type==="note:created"||e.type==="note:updated";return{...a,type:g?"note-write":"note-read",targetId:s?.noteId,targetName:s?.title}}if(e.type==="agent:tool:call"){const s=e.data,g=s?.toolName?.toLowerCase()||"";if(g.includes("read")&&s?.filesModified?.[0])return{...a,type:"file-read",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()};if((g.includes("write")||g.includes("edit"))&&s?.filesModified?.[0])return{...a,type:"file-write",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()}}return null}function zn(e,a){const s=e.workspaceEvents.byWorkspaceId[a]?.events??[],g=[];for(const u of s){const c=Gn(u);c&&g.push(c)}return g.sort((u,c)=>new Date(u.timestamp).getTime()-new Date(c.timestamp).getTime())}function jn(e){return e.length===0?new Date().toISOString():new Date(Math.max(...e.map(a=>new Date(a.timestamp).getTime()))).toISOString()}const Kn=Fe.createSelector((e,a)=>{const s=zn(e,a),g=jn(s),u=Ca.select(e,a),c={};for(const o of Sa.select(e,a))c[String(o.id)]=o;const d=e.workspaceNotes.byWorkspaceId[a],i=new Map;if(d)for(const o of Ga(d.notes))i.set(o.id,o);return Hn(s,c,g,!0,u,e,i)});function Hn(e,a,s,g,u,c,d){const i=new Date(s).getTime(),o=new Map;for(const I of u)o.set(I.path,I);const l=I=>d?.get(I)?.title||I,n=e.filter(I=>new Date(I.timestamp).getTime()<=i),p=[],R=[],h=new Map,v=new Set,b=[];let S=null;for(const[I,P]of Object.entries(a))if(za(P)==="topLevel"){S=I;break}for(const[I,P]of Object.entries(a)){if(h.has(I))continue;const ct=ja(P),_t=Rn(P),Ot=ra.select(c,I),Dt=We.select(c,I),ht=P.waitingForAgentIds;let bt=Fn(P,Ot);Dt?bt="waiting":(Ot||bt==="idle"&&_t.activeToolName)&&(bt="responding");const Kt={id:`agent-${I}`,type:"agent",agentId:I,name:P.name||"Agent",isCoordinator:I===S,isBackground:P.isBackground||!1,status:bt,specialist:P.metadata?.specialist||null,parentAgentId:ct,createdAt:String(P.createdAt||s),waitingForAgentIds:ht,activeToolName:_t.activeToolName,activeToolInput:_t.activeToolInput,lastResponse:_t.lastResponse,agentType:P.metadata?.agentType||null,x:0,y:0,vx:0,vy:0};if(h.set(I,Kt),p.push(Kt),ct&&a[ct]){const B=`del-${ct}-${I}`;v.has(B)||(v.add(B),b.push({key:B,sourceRawId:ct,targetRawId:I,edge:{id:B,type:"delegation",sourceId:`agent-${ct}`,targetId:`agent-${I}`,parentAgentId:ct,childAgentId:I,timestamp:String(P.createdAt||s),isActive:!1}}))}const Ft=P.messages||[];let Bt=Bn(Ft,s).map(B=>({...B,additions:o.get(B.path)?.additions,deletions:o.get(B.path)?.deletions}));Bt.length===0&&P.fileChanges&&P.fileChanges.length>0&&(Bt=P.fileChanges.map(B=>({path:B.path,type:B.type,timestamp:String(B.timestamp||s),additions:o.get(B.path)?.additions,deletions:o.get(B.path)?.deletions}))),qn(Bt,I,o,h,p,v,b,s);const Qt=Ln(Ft,s);Xn(Qt,I,l,h,p,v,b);const A=En(Ft,s);Yn(A,I,h,p,v,b)}for(const[I,P]of Object.entries(a)){const ct=P.messages||[];if(ct.length===0)continue;const _t=Pn(ct,I);if(_t.size!==0)for(const[Ot,Dt]of _t){const ht=h.get(Ot);ht&&ht.type==="agent"&&(ht.delegationBatchId=Dt)}}Un(n,g,i,a,o,l,h,p,v,b),Vn(p,u,a,S,h,v,R,g,s,c);for(const I of b)h.has(I.sourceRawId)&&h.has(I.targetRawId)&&R.push(I.edge);const x=e.map(I=>new Date(I.timestamp).getTime()),it=x.length>0?new Date(Math.min(...x)).toISOString():s,E=x.length>0?new Date(Math.max(...x)).toISOString():s;return{nodes:p,edges:R,currentTime:s,isLive:g,minTime:it,maxTime:E}}function qn(e,a,s,g,u,c,d,i){for(const o of e){const l=o.path;if(!l)continue;const n=o.type==="read",p=n?"file-read":"file-write",R=`file-${l}`;if(!g.has(l)){const v={id:R,type:"file",path:l,fileName:l.split("/").pop()||"",lastAction:o.type==="delete"?"delete":n?"read":"write",lastActionTimestamp:o.timestamp||i,x:0,y:0,vx:0,vy:0};g.set(l,v),u.push(v)}const h=`${p}-${a}-${l}`;if(!c.has(h)){c.add(h);const v=n?void 0:s.get(l);let b=n?void 0:o.additions??v?.additions,S=n?void 0:o.deletions??v?.deletions;if(!n&&b===void 0&&S===void 0){const x=l.split("").reduce((it,E)=>it+E.charCodeAt(0),0);o.type==="create"?(b=x%80+20,S=0):o.type==="modify"?(b=x%50+5,S=x%20+2):(b=x%30+3,S=x%15+1)}d.push({key:h,sourceRawId:a,targetRawId:l,edge:{id:h,type:p,sourceId:`agent-${a}`,targetId:R,agentId:a,filePath:l,timestamp:o.timestamp||i,isActive:!1,additions:b,deletions:S}})}}}function Xn(e,a,s,g,u,c,d){for(const i of e){const o=i.noteId,l=`note-${o}`;if(!g.has(o)){const R={id:l,type:"note",noteId:o,title:s(o),lastAction:i.action,lastActionTimestamp:i.timestamp,x:0,y:0,vx:0,vy:0};g.set(o,R),u.push(R)}const n=i.action==="read"?"note-read":"note-write",p=`${n}-${a}-${o}`;c.has(p)||(c.add(p),d.push({key:p,sourceRawId:a,targetRawId:o,edge:{id:p,type:n,sourceId:`agent-${a}`,targetId:l,agentId:a,noteId:o,timestamp:i.timestamp,isActive:!1}}))}}function Yn(e,a,s,g,u,c){for(const d of e){const i=d.taskId,o=`task-${i}`;if(!s.has(i)){const p={id:o,type:"task",taskId:i,name:d.name,description:d.description,state:d.state||"not_started",lastAction:d.action,lastActionTimestamp:d.timestamp,x:0,y:0,vx:0,vy:0};s.set(i,p),g.push(p)}const l=d.action==="create"?"task-create":"task-update",n=`${l}-${a}-${i}`;u.has(n)||(u.add(n),c.push({key:n,sourceRawId:a,targetRawId:i,edge:{id:n,type:l,sourceId:`agent-${a}`,targetId:o,agentId:a,taskId:i,timestamp:d.timestamp,isActive:!1}}))}}function Un(e,a,s,g,u,c,d,i,o,l){for(const n of e){const p=new Date(n.timestamp).getTime(),R=s-p<On;if((n.type==="agent-created"||n.type==="agent-idle")&&n.parentAgentId){const h=`del-${n.parentAgentId}-${n.agentId}`;o.has(h)||(o.add(h),l.push({key:h,sourceRawId:n.parentAgentId,targetRawId:n.agentId,edge:{id:h,type:"delegation",sourceId:`agent-${n.parentAgentId}`,targetId:`agent-${n.agentId}`,parentAgentId:n.parentAgentId,childAgentId:n.agentId,timestamp:n.timestamp,isActive:R}}))}if((n.type==="file-read"||n.type==="file-write")&&n.targetId){const h=`file-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"file",path:n.targetId,fileName:n.targetName||n.targetId.split("/").pop()||"",lastAction:n.type==="file-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;if(!o.has(v)){o.add(v);const b=n.type==="file-write"?u.get(n.targetId):void 0;let S=b?.additions,x=b?.deletions;if(n.type==="file-write"&&S===void 0&&x===void 0){const it=n.targetId.split("").reduce((E,I)=>E+I.charCodeAt(0),0);S=it%50+5,x=it%20+2}l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,filePath:n.targetId,timestamp:n.timestamp,isActive:R,additions:S,deletions:x}})}}if((n.type==="note-read"||n.type==="note-write")&&n.targetId){const h=`note-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"note",noteId:n.targetId,title:c(n.targetId)||n.targetName||n.targetId,lastAction:n.type==="note-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;o.has(v)||(o.add(v),l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,noteId:n.targetId,timestamp:n.timestamp,isActive:R}}))}}}function Vn(e,a,s,g,u,c,d,i,o,l){if(e.some(h=>h.type==="file")||a.length===0)return;const p=[];for(const h of Object.keys(s)){const v=Na.select(l,h);v&&(v.additions>0||v.deletions>0)&&p.push(h)}const R=p.length>0?p[0]:g;if(!(!R||!u.has(R)))for(const h of a){const v=h.path;if(!v)continue;const b=`file-${v}`;if(!u.has(v)){const S={id:b,type:"file",path:v,fileName:v.split("/").pop()||"",lastAction:h.action?.toLowerCase()==="delete"?"delete":"write",lastActionTimestamp:o,x:0,y:0,vx:0,vy:0};u.set(v,S),e.push(S);const x=`file-write-${R}-${v}`;c.has(x)||(c.add(x),d.push({id:x,type:"file-write",sourceId:`agent-${R}`,targetId:b,agentId:R,filePath:v,timestamp:o,isActive:i,additions:h.additions,deletions:h.deletions}))}}}var Qn=F('<div class="agent-overview-panel flex flex-col h-full bg-background overflow-auto svelte-1337n58"><!></div>');function pa(e,a){if(new.target)return oe({component:pa,...e});le(a,!0);const s=()=>$t(i,"$graphState$",g),[g,u]=Me();let c=st(a,"workspaceId",7),d=st(a,"onFocus",7);const i=Kn(c());Fe.dispatch(Ka(c()));function o(v,b,S){const x=S.metaKey||S.ctrlKey,it=Pa(S.target);Fe.dispatch(Ha(c(),{agentId:v,sourcePanelId:it,openInAdjacentPanel:x}))}const l=y(()=>s().nodes.filter(v=>qa(v)));var n={get workspaceId(){return c()},set workspaceId(v){c(v),rt()},get onFocus(){return d()},set onFocus(v){d(v),rt()},$set:ie,$on:(v,b)=>ce(a,v,b)},p=Qn(),R=L(p);la(R,{get agents(){return t(l)},get edges(){return s().edges},onAgentClick:o,get onFocus(){return d()}}),$(p),_(e,p);var h=de(n);return u(),h}function Zn(e,a){if(new.target)return oe({component:Zn,...e});le(a,!0);let s=st(a,"workspaceId",7),g=st(a,"onFocus",7);var u={get workspaceId(){return s()},set workspaceId(c){s(c),rt()},get onFocus(){return g()},set onFocus(c){g(c),rt()},$set:ie,$on:(c,d)=>ce(a,c,d)};return pa(e,{get workspaceId(){return s()},get onFocus(){return g()}}),de(u)}export{Zn as default};
13
+ L ${t(vt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)};at(Ce,wt=>{t(tt)<1?wt(va):t(vt)<t(lt)?wt(ha,1):wt(ma,-1)})}_(ut,fe)}),$(zt);var ae=C(zt,2);jt(ae,21,()=>t(At),Ne,(ut,j)=>{var St=Be(),vt=Yt(St);{var lt=mt=>{var kt=on();jt(kt,21,()=>t(j).children,w=>w.agent.agentId,(w,T)=>{s(w,()=>t(T))}),$(kt),k(()=>ne(kt,`padding: 10px; margin-top: -10px; display: grid; grid-template-columns: repeat(${t(j).cols??""}, auto); gap: 12px;`)),_(mt,kt)},Gt=mt=>{s(mt,()=>t(j).child)};at(vt,mt=>{t(j).type==="batch"?mt(lt):mt(Gt,-1)})}_(ut,St)}),$(ae),k(()=>{gt(zt,"width",t(ot)),ne(ae,`gap: 12px; width: ${t(ot)??""}px;`)}),_(Ht,ue)}),$(xt),k(()=>ne(xt,`width: ${t(ot)??""}px;`)),_(O,xt)};at(be,O=>{t(m)&&O(U)})}$(Y),_(r,Y)};let g=st(a,"agents",7),u=st(a,"edges",7),c=st(a,"onAgentClick",7),d=st(a,"onFocus",7);const i=12,o=[{id:"git",label:"Git",types:["commit-message","pr-description"]},{id:"review",label:Q.agentOverview_hierarchyGraph_reviewCorral_label(),types:["code-review","code-walkthrough"]}];let l=Mt(1),n=Mt(0),p=Mt(0),R=Mt(!1),h=Mt(_a({x:0,y:0})),v=Mt(null),b=Mt(null),S=Mt(null);function x(r){t(S)&&clearTimeout(t(S)),V(b,r,!0)}function it(){t(S)&&(clearTimeout(t(S)),V(S,null)),V(b,null)}const E=y(()=>t(b)?g().find(r=>r.agentId===t(b)):null),I=.25,P=2,ct=.1;function _t(r){if(r.preventDefault(),r.ctrlKey||r.metaKey){const f=-r.deltaY*.001,M=Math.min(P,Math.max(I,t(l)*(1+f)));if(t(v)){const W=t(v).getBoundingClientRect(),m=r.clientX-W.left,H=r.clientY-W.top,nt=M/t(l);V(n,m-(m-t(n))*nt),V(p,H-(H-t(p))*nt)}V(l,M,!0)}else V(n,t(n)-r.deltaX),V(p,t(p)-r.deltaY)}function Ot(r){const f=r.target,M=f.closest(".agent-hierarchy-graph")&&!f.closest(".agent-card")&&!f.closest(".bg-agent-card")&&!f.closest(".zoom-controls");(r.button===1||r.button===0&&(r.shiftKey||M))&&(V(R,!0),V(h,{x:r.clientX,y:r.clientY},!0),r.preventDefault()),r.button===0&&d()?.()}function Dt(r){if(!t(R))return;const f=r.clientX-t(h).x,M=r.clientY-t(h).y;V(n,t(n)+f),V(p,t(p)+M),V(h,{x:r.clientX,y:r.clientY},!0)}function ht(){V(R,!1)}function bt(){V(l,Math.min(P,t(l)+ct),!0)}function Kt(){V(l,Math.max(I,t(l)-ct),!0)}function Ft(){V(l,1),V(n,0),V(p,0)}function ge(){V(l,.8),V(n,0),V(p,0)}const Bt=y(()=>Math.round(t(l)*100)),Qt=5e3,A=10,B=4,Tt=6;function Rt(r,f,M){if(r.length===0)return[];const W=[],m=new Map;for(const N of r){const z=N.agent.delegationBatchId;z&&(m.has(z)||m.set(z,[]),m.get(z).push(N))}const H=new Set;for(const N of r){const z=N.agent.delegationBatchId;if(z)H.has(z)||(H.add(z),W.push(m.get(z)));else{const G=W[W.length-1];if(G&&!G[0].agent.delegationBatchId){const It=new Date(G[G.length-1].agent.createdAt).getTime();if(new Date(N.agent.createdAt).getTime()-It<=Qt){G.push(N);continue}}W.push([N])}}const nt=f+M;return W.map(N=>{if(N.length===1)return{type:"single",child:N[0],width:f};const z=Math.min(Math.ceil(Math.sqrt(N.length)),B),G=Math.ceil(N.length/z);return{type:"batch",children:N,cols:z,rows:G,width:z*nt-M+A*2}})}const Lt=y(()=>{const r=new Map;for(const f of g())r.set(f.agentId,f.name);return r}),me=new Set(o.flatMap(r=>[...r.types])),Zt=y(()=>{const r=[];for(const f of o){const M=new Set(f.types),W=g().filter(m=>m.agentType&&M.has(m.agentType));W.length>0&&r.push({id:f.id,label:f.label,agents:W})}return r}),_e=y(()=>g().filter(r=>!r.agentType||!me.has(r.agentType))),Jt=y(()=>{const r=new Map,f=[];for(const m of t(_e))r.set(m.agentId,{agent:m,children:[],activeFile:void 0,activeNote:void 0});const M=u().filter(m=>m.isActive);for(const m of M){const H=m.sourceId.replace("agent-",""),nt=r.get(H);nt&&(m.type==="file-read"||m.type==="file-write"?nt.activeFile=m.targetId.replace("file-","").split("/").pop():(m.type==="note-read"||m.type==="note-write")&&(nt.activeNote=m.targetId.replace("note-","")))}for(const[,m]of r){const H=m.agent.parentAgentId;H&&r.has(H)?r.get(H).children.push(m):f.push(m)}const W=(m,H)=>new Date(m.agent.createdAt).getTime()-new Date(H.agent.createdAt).getTime();for(const[,m]of r)m.children.sort(W);return f.sort(W),f});function te(r,f){c()?.(r.agentId,r.name,f)}var ye={get agents(){return g()},set agents(r){g(r),rt()},get edges(){return u()},set edges(r){u(r),rt()},get onAgentClick(){return c()},set onAgentClick(r){c(r),rt()},get onFocus(){return d()},set onFocus(r){d(r),rt()},$set:ie,$on:(r,f)=>ce(a,r,f)},yt=Cn(),Ie=L(yt);{var xe=r=>{var f=gn(),M=L(f),W=L(M),m=K(W,!0),H=C(W,2),nt=K(H,!0);$(M),$(f),k((N,z)=>{D(m,N),D(nt,z)},[()=>Q.agentOverview_hierarchyGraph_noAgents_title(),()=>Q.agentOverview_hierarchyGraph_noAgents_description()]),_(r,f)},ft=r=>{var f=Tn(),M=Yt(f),W=L(M),m=L(W);{var H=U=>{var O=fn();jt(O,21,()=>t(Zt),q=>q.id,(q,J)=>{var et=un(),xt=L(et),Ht=K(xt,!0),At=C(xt,2);jt(At,21,()=>t(J).agents,Ct=>Ct.agentId,(Ct,Pt)=>{Re(Ct,{get agent(){return t(Pt)},onclick:ee=>te(t(Pt),ee),onmouseenter:()=>x(t(Pt).agentId),onmouseleave:it})}),$(At),$(et),k(()=>D(Ht,t(J).label)),_(q,et)}),$(O),_(U,O)};at(m,U=>{t(Zt).length>0&&U(H)})}var nt=C(m,2),N=L(nt),z=L(N);ne(z,"gap: 12px;"),jt(z,21,()=>t(Jt),U=>U.agent.agentId,(U,O)=>{s(U,()=>t(O))}),$(z),$(N),$(nt),$(W);var G=C(W,2);{var It=U=>{{let O=y(()=>"--agent-hierarchy-"+t(b));Ba(U,{get anchor(){return t(O)},position:"top",absolute:!0,children:(q,J)=>{var et=bn(),xt=L(et),Ht=L(xt);La(Ht,{variant:"emphasized",get agentId(){return t(E).agentId}});var At=C(Ht,2),Ct=L(At),Pt=K(Ct,!0),ee=C(Ct,2);{var Ae=w=>{var T=pn(),tt=K(T,!0);k(X=>D(tt,X),[()=>t(E).specialist.replace("-"," ")]),_(w,T)};at(ee,w=>{t(E).specialist&&w(Ae)})}$(At);var ue=C(At,2);{var zt=w=>{var T=vn(),tt=K(T,!0);k(X=>D(tt,X),[()=>Q.agentOverview_hierarchyGraph_background_badge()]),_(w,T)};at(ue,w=>{t(E).isBackground&&w(zt)})}$(xt);var qt=C(xt,2),ke=L(qt);{var $e=w=>{var T=hn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusWaiting_label()]),_(w,T)},Te=w=>{var T=mn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusResponding_label()]),_(w,T)},ae=w=>{var T=_n(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusCompleted_label()]),_(w,T)},ut=w=>{var T=yn(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusFailed_label()]),_(w,T)},j=w=>{var T=In(),tt=K(T);k(X=>D(tt,`● ${X??""}`),[()=>Q.agentOverview_hierarchyGraph_statusIdle_label()]),_(w,T)};at(ke,w=>{t(E).status==="waiting"?w($e):t(E).status==="responding"?w(Te,1):t(E).status==="completed"?w(ae,2):t(E).status==="failed"?w(ut,3):w(j,-1)})}$(qt);var St=C(qt,2),vt=K(St,!0),lt=C(St,2);{var Gt=w=>{var T=xn(),tt=K(T,!0);k(()=>D(tt,t(E).lastResponse)),_(w,T)};at(lt,w=>{t(E).lastResponse&&w(Gt)})}var mt=C(lt,2);{var kt=w=>{var T=wn(),tt=L(T);ea(tt,{size:12});var X=C(tt,2),fe=K(X,!0);$(T),k(Ce=>D(fe,Ce),[()=>Q.agentOverview_hierarchyGraph_usingTool_label({tool:t(E).activeToolName})]),_(w,T)};at(mt,w=>{t(E).activeToolName&&w(kt)})}$(et),k(w=>{D(Pt,t(E).name),D(vt,w)},[()=>Q.agentOverview_hierarchyGraph_created_label({time:Ea(t(E).createdAt)})]),_(q,et)},$$slots:{default:!0}})}};at(G,U=>{t(E)&&U(It)})}$(M);var ot=C(M,2),Y=L(ot);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomOut_tooltip());Ut(Y,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:Kt,get title(){return t(U)},children:(O,q)=>{var J=An();_(O,J)},$$slots:{default:!0}})}var Z=C(Y,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_resetZoom_tooltip());Ut(Z,{variant:"ghost",type:"button",class:"zoom-percent w-12 h-8 flex items-center justify-center text-xs font-medium text-muted-foreground hover:text-foreground hover:bg-muted rounded transition-colors",onclick:Ft,get title(){return t(U)},children:(O,q)=>{Ia();var J=xa();k(()=>D(J,`${t(Bt)??""}%`)),_(O,J)},$$slots:{default:!0}})}var pt=C(Z,2);{let U=y(()=>Q.agentOverview_hierarchyGraph_zoomIn_tooltip());Ut(pt,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:bt,get title(){return t(U)},children:(O,q)=>{var J=kn();_(O,J)},$$slots:{default:!0}})}var Et=C(pt,4);{let U=y(()=>Q.agentOverview_hierarchyGraph_fitToView_tooltip());Ut(Et,{variant:"ghost",size:"icon",iconOnly:!0,type:"button",class:"zoom-btn hover:bg-muted transition-colors text-muted-foreground hover:text-foreground",onclick:ge,get title(){return t(U)},children:(O,q)=>{var J=$n();_(O,J)},$$slots:{default:!0}})}$(ot);var we=C(ot,2),be=K(we,!0);k(U=>{ne(M,`transform: translate(${t(n)??""}px, ${t(p)??""}px) scale(${t(l)??""}); transform-origin: center center;`),D(be,U)},[()=>Q.agentOverview_hierarchyGraph_panHint_label()]),_(r,f)};at(Ie,r=>{t(Jt).length===0?r(xe):r(ft,-1)})}return $(yt),ba(yt,r=>V(v,r),()=>t(v)),De("wheel",yt,_t),Se("mousedown",yt,Ot),Se("mousemove",yt,Dt),Se("mouseup",yt,ht),De("mouseleave",yt,ht),_(e,yt),de(ye)}ya(["mousedown","mousemove","mouseup"]);const Ee=new Set(["str-replace-editor","save-file","remove-files","str_replace_editor"]),Pe=new Set(["create_note","update_note","set_note_content","add_to_note","append_to_note","edit_note","edit_note_lines","update_note_metadata","read_note","view_note","delete_note"]),Sn=new Set(["read_note","view_note","list_note_tasks"]),ze=new Set(["add_tasks","update_tasks","view_tasklist","reorganize_tasklist"]),Nn=new Set(["view_tasklist"]),Ge=new Set(["delegate_task","create_sub_agent","create_agent"]),On=5e3;function Fn(e,a=!1){if(!e)return"idle";if(e.status===Nt.Completed)return"completed";if(e.status===Nt.Error||e.status===Nt.Deleted)return"failed";if(a||da(e))return"responding";if(ga(e.status))return"idle";if(e.messages&&e.messages.length>0){const s=[...e.messages].reverse().find(g=>g.role==="assistant");if(s&&(s.isStreaming||s.streamingComplete===!1))return"responding"}switch(e.status){case Nt.Active:return"idle";case Nt.Pending:case Nt.Idle:return"idle";case Nt.Processing:return a?"responding":"idle";case Nt.Waiting:return"waiting";default:return"idle"}}function da(e){return!!(e.isProcessing||e.isStreaming||e.isResponding)}function ga(e){return e===Nt.Idle||e==="idle"}function Rn(e){const a={};if(!e)return a;if(e.lastAgentResponse){const s=Ta(e.lastAgentResponse);s&&(a.lastResponse=s)}return ga(e.status)&&!da(e)||e.isStreaming&&e.lastToolUse?.name&&(a.activeToolName=e.lastToolUse.name,a.activeToolInput=e.lastToolUse.input||{}),a}function Wt(e){return(e.name||e.toolName||"").toLowerCase()}function Vt(e){return"input"in e&&e.input?e.input:"arguments"in e&&e.arguments?e.arguments:"parameters"in e&&e.parameters?e.parameters:{}}function Mn(e){const a=e.toLowerCase();if(Ee.has(e))return!0;for(const s of Ee)if(a.startsWith(s.toLowerCase()))return!0;return!!(a.startsWith("edit ")||a.startsWith("save ")||a.startsWith("create "))}function ua(e){const a=e.toLowerCase();return!!(a.startsWith("read `")&&!a.includes("read `.`")||a.startsWith("view")||a==="view")}function je(e){if(Pe.has(e))return!0;for(const a of Pe)if(e.startsWith(a))return!0;return!1}function Wn(e){return e==="save-file"?"create":e==="remove-files"?"delete":"modify"}function Ke(e){return e==="create_note"?"create":Sn.has(e)?"read":"write"}function He(e){if(ze.has(e))return!0;for(const a of ze)if(e.startsWith(a))return!0;return!1}function qe(e){return e==="add_tasks"?"create":Nn.has(e)?"read":"update"}function fa(e){if(e==="."||e==="./"||e.endsWith("/"))return!0;const s=(e.split("/").pop()||e).lastIndexOf(".");return s===-1||s===0}function Dn(e){const a=e.match(/`([^`]+)`/);if(a&&a[1]){const s=a[1];return fa(s)?null:s}return null}function Xe(e,a){const s=e.path||e.file_path||e.filePath;return typeof s=="string"?fa(s)?null:s:a?Dn(a):null}function Ye(e){const a=e.noteId||e.note_id||e.title;return typeof a=="string"?a:null}function Ue(e){return Mn(e)||ua(e)}function Ve(e){return ua(e)?"read":Wn(e)}function Bn(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name||d.toolName);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!Ue(i))continue;const o=Vt(d),l=Xe(o,d.name);!l||g.has(l)||(g.add(l),s.push({path:l,type:Ve(i),timestamp:c}))}}return s}function Ln(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!je(i))continue;const o=Vt(d),l=Ye(o);!l||g.has(l)||(g.add(l),s.push({noteId:l,title:o.title||l,action:Ke(i),timestamp:c}))}}return s}function Qe(e){const a=[],s=e.tasks;if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.name;c&&a.push({taskId:`task-${c.toLowerCase().replace(/\s+/g,"-").slice(0,30)}`,name:c,description:u.description,state:u.state})}}if(Array.isArray(s)){for(const g of s)if(typeof g=="object"&&g!==null){const u=g,c=u.task_id;c&&!a.some(d=>d.taskId===c)&&a.push({taskId:c,name:u.name||c,description:u.description,state:u.state})}}return a}function Ze(e){if(!e)return"not_started";const a=e.toLowerCase();return a==="complete"||a==="completed"||a==="done"?"complete":a==="in_progress"||a==="in-progress"||a==="started"?"in_progress":a==="cancelled"||a==="canceled"?"cancelled":"not_started"}function En(e,a){const s=[],g=new Set;for(const u of e){const c=u.timestamp?.toString()||a;if(u.toolCalls&&Array.isArray(u.toolCalls))for(const d of u.toolCalls){const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}if(u.contentBlocks&&Array.isArray(u.contentBlocks))for(const d of u.contentBlocks){if(d.type!=="tool_use")continue;const i=Wt(d);if(!He(i))continue;const o=Vt(d),l=qe(i),n=Qe(o);for(const p of n)g.has(p.taskId)||(g.add(p.taskId),s.push({taskId:p.taskId,name:p.name,description:p.description,state:Ze(p.state),action:l,timestamp:c}))}}return s}function Je(e){if(Ge.has(e))return!0;for(const a of Ge)if(e.startsWith(a))return!0;return!1}function ta(e){if(!e)return null;const a=e.match(/Agent ID:\s*(\S+)/i);return a?a[1]:null}function ve(e){if(typeof e=="string")return e;if(Array.isArray(e))return e.filter(a=>a&&typeof a=="object"&&a.type==="text"&&a.text).map(a=>a.text).join(`
14
+ `);if(e&&typeof e=="object"){const a=e;if(typeof a.text=="string")return a.text;if(typeof a.content=="string")return a.content}return""}function Pn(e,a){const s=new Map,g=new Map;let u=0;for(const c of e){const d=[];if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const i of c.contentBlocks)if(i.type==="tool_use"&&i.name){const o=Wt(i);Je(o)&&i.id&&d.push(i.id)}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const i of c.toolCalls){const o=Wt(i);if(Je(o)){const l=i.id;l&&!d.includes(l)&&d.push(l)}}if(d.length>1){const i=`${a}-batch-${u}`;for(const o of d)g.set(o,i);u++}}for(const c of e){if(c.contentBlocks&&Array.isArray(c.contentBlocks)){for(const d of c.contentBlocks)if(d.type==="tool_result"&&d.tool_use_id){const i=d.tool_use_id,o=g.get(i);if(o){const l=ve(d.text)||ve(d.content)||ve(d.output),n=ta(l);n&&s.set(n,o)}}}if(c.toolCalls&&Array.isArray(c.toolCalls))for(const d of c.toolCalls){const i=d.id;if(!i)continue;const o=g.get(i);if(!o)continue;const l=d.result;if(l){const n=ve(l),p=ta(n);p&&s.set(p,o)}}}return s}function zn(e){const a={id:e.id,timestamp:e.timestamp,agentId:e.actor?.id||"",agentName:e.actor?.name};if(e.type==="agent:created"){const s=e.data;return{...a,type:"agent-created",agentId:s?.agentId||a.agentId,agentName:s?.agentName||a.agentName,parentAgentId:s?.createdByAgentId}}if(e.type==="agent:idle"){const s=e.data;return{...a,type:"agent-idle",agentId:s?.agentId||a.agentId,parentAgentId:s?.parentAgentId}}if(e.type==="file:changed"&&e.actor?.type==="agent"){const s=e.data,g=s?.action,u=g==="create"||g==="modify"||g==="delete",c=s?.relativePath;return{...a,type:u?"file-write":"file-read",targetId:s?.path||c,targetName:c?.split("/").pop()}}if(e.type?.startsWith("note:")&&e.actor?.type==="agent"){const s=e.data,g=e.type==="note:created"||e.type==="note:updated";return{...a,type:g?"note-write":"note-read",targetId:s?.noteId,targetName:s?.title}}if(e.type==="agent:tool:call"){const s=e.data,g=s?.toolName?.toLowerCase()||"";if(g.includes("read")&&s?.filesModified?.[0])return{...a,type:"file-read",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()};if((g.includes("write")||g.includes("edit"))&&s?.filesModified?.[0])return{...a,type:"file-write",targetId:s.filesModified[0],targetName:s.filesModified[0].split("/").pop()}}return null}function Gn(e,a){const s=e.workspaceEvents.byWorkspaceId[a]?.events??[],g=[];for(const u of s){const c=zn(u);c&&g.push(c)}return g.sort((u,c)=>new Date(u.timestamp).getTime()-new Date(c.timestamp).getTime())}function jn(e){return e.length===0?new Date().toISOString():new Date(Math.max(...e.map(a=>new Date(a.timestamp).getTime()))).toISOString()}const Kn=Fe.createSelector((e,a)=>{const s=Gn(e,a),g=jn(s),u=Ca.select(e,a),c={};for(const o of Sa.select(e,a))c[String(o.id)]=o;const d=e.workspaceNotes.byWorkspaceId[a],i=new Map;if(d)for(const o of za(d.notes))i.set(o.id,o);return Hn(s,c,g,!0,u,e,i)});function Hn(e,a,s,g,u,c,d){const i=new Date(s).getTime(),o=new Map;for(const I of u)o.set(I.path,I);const l=I=>d?.get(I)?.title||I,n=e.filter(I=>new Date(I.timestamp).getTime()<=i),p=[],R=[],h=new Map,v=new Set,b=[];let S=null;for(const[I,P]of Object.entries(a))if(Ga(P)==="topLevel"){S=I;break}for(const[I,P]of Object.entries(a)){if(h.has(I))continue;const ct=ja(P),_t=Rn(P),Ot=ra.select(c,I),Dt=We.select(c,I),ht=P.waitingForAgentIds;let bt=Fn(P,Ot);Dt?bt="waiting":(Ot||bt==="idle"&&_t.activeToolName)&&(bt="responding");const Kt={id:`agent-${I}`,type:"agent",agentId:I,name:P.name||"Agent",isCoordinator:I===S,isBackground:P.isBackground||!1,status:bt,specialist:P.metadata?.specialist||null,parentAgentId:ct,createdAt:String(P.createdAt||s),waitingForAgentIds:ht,activeToolName:_t.activeToolName,activeToolInput:_t.activeToolInput,lastResponse:_t.lastResponse,agentType:P.metadata?.agentType||null,x:0,y:0,vx:0,vy:0};if(h.set(I,Kt),p.push(Kt),ct&&a[ct]){const B=`del-${ct}-${I}`;v.has(B)||(v.add(B),b.push({key:B,sourceRawId:ct,targetRawId:I,edge:{id:B,type:"delegation",sourceId:`agent-${ct}`,targetId:`agent-${I}`,parentAgentId:ct,childAgentId:I,timestamp:String(P.createdAt||s),isActive:!1}}))}const Ft=P.messages||[];let Bt=Bn(Ft,s).map(B=>({...B,additions:o.get(B.path)?.additions,deletions:o.get(B.path)?.deletions}));Bt.length===0&&P.fileChanges&&P.fileChanges.length>0&&(Bt=P.fileChanges.map(B=>({path:B.path,type:B.type,timestamp:String(B.timestamp||s),additions:o.get(B.path)?.additions,deletions:o.get(B.path)?.deletions}))),qn(Bt,I,o,h,p,v,b,s);const Qt=Ln(Ft,s);Xn(Qt,I,l,h,p,v,b);const A=En(Ft,s);Yn(A,I,h,p,v,b)}for(const[I,P]of Object.entries(a)){const ct=P.messages||[];if(ct.length===0)continue;const _t=Pn(ct,I);if(_t.size!==0)for(const[Ot,Dt]of _t){const ht=h.get(Ot);ht&&ht.type==="agent"&&(ht.delegationBatchId=Dt)}}Un(n,g,i,a,o,l,h,p,v,b),Vn(p,u,a,S,h,v,R,g,s,c);for(const I of b)h.has(I.sourceRawId)&&h.has(I.targetRawId)&&R.push(I.edge);const x=e.map(I=>new Date(I.timestamp).getTime()),it=x.length>0?new Date(Math.min(...x)).toISOString():s,E=x.length>0?new Date(Math.max(...x)).toISOString():s;return{nodes:p,edges:R,currentTime:s,isLive:g,minTime:it,maxTime:E}}function qn(e,a,s,g,u,c,d,i){for(const o of e){const l=o.path;if(!l)continue;const n=o.type==="read",p=n?"file-read":"file-write",R=`file-${l}`;if(!g.has(l)){const v={id:R,type:"file",path:l,fileName:l.split("/").pop()||"",lastAction:o.type==="delete"?"delete":n?"read":"write",lastActionTimestamp:o.timestamp||i,x:0,y:0,vx:0,vy:0};g.set(l,v),u.push(v)}const h=`${p}-${a}-${l}`;if(!c.has(h)){c.add(h);const v=n?void 0:s.get(l);let b=n?void 0:o.additions??v?.additions,S=n?void 0:o.deletions??v?.deletions;if(!n&&b===void 0&&S===void 0){const x=l.split("").reduce((it,E)=>it+E.charCodeAt(0),0);o.type==="create"?(b=x%80+20,S=0):o.type==="modify"?(b=x%50+5,S=x%20+2):(b=x%30+3,S=x%15+1)}d.push({key:h,sourceRawId:a,targetRawId:l,edge:{id:h,type:p,sourceId:`agent-${a}`,targetId:R,agentId:a,filePath:l,timestamp:o.timestamp||i,isActive:!1,additions:b,deletions:S}})}}}function Xn(e,a,s,g,u,c,d){for(const i of e){const o=i.noteId,l=`note-${o}`;if(!g.has(o)){const R={id:l,type:"note",noteId:o,title:s(o),lastAction:i.action,lastActionTimestamp:i.timestamp,x:0,y:0,vx:0,vy:0};g.set(o,R),u.push(R)}const n=i.action==="read"?"note-read":"note-write",p=`${n}-${a}-${o}`;c.has(p)||(c.add(p),d.push({key:p,sourceRawId:a,targetRawId:o,edge:{id:p,type:n,sourceId:`agent-${a}`,targetId:l,agentId:a,noteId:o,timestamp:i.timestamp,isActive:!1}}))}}function Yn(e,a,s,g,u,c){for(const d of e){const i=d.taskId,o=`task-${i}`;if(!s.has(i)){const p={id:o,type:"task",taskId:i,name:d.name,description:d.description,state:d.state||"not_started",lastAction:d.action,lastActionTimestamp:d.timestamp,x:0,y:0,vx:0,vy:0};s.set(i,p),g.push(p)}const l=d.action==="create"?"task-create":"task-update",n=`${l}-${a}-${i}`;u.has(n)||(u.add(n),c.push({key:n,sourceRawId:a,targetRawId:i,edge:{id:n,type:l,sourceId:`agent-${a}`,targetId:o,agentId:a,taskId:i,timestamp:d.timestamp,isActive:!1}}))}}function Un(e,a,s,g,u,c,d,i,o,l){for(const n of e){const p=new Date(n.timestamp).getTime(),R=s-p<On;if((n.type==="agent-created"||n.type==="agent-idle")&&n.parentAgentId){const h=`del-${n.parentAgentId}-${n.agentId}`;o.has(h)||(o.add(h),l.push({key:h,sourceRawId:n.parentAgentId,targetRawId:n.agentId,edge:{id:h,type:"delegation",sourceId:`agent-${n.parentAgentId}`,targetId:`agent-${n.agentId}`,parentAgentId:n.parentAgentId,childAgentId:n.agentId,timestamp:n.timestamp,isActive:R}}))}if((n.type==="file-read"||n.type==="file-write")&&n.targetId){const h=`file-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"file",path:n.targetId,fileName:n.targetName||n.targetId.split("/").pop()||"",lastAction:n.type==="file-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;if(!o.has(v)){o.add(v);const b=n.type==="file-write"?u.get(n.targetId):void 0;let S=b?.additions,x=b?.deletions;if(n.type==="file-write"&&S===void 0&&x===void 0){const it=n.targetId.split("").reduce((E,I)=>E+I.charCodeAt(0),0);S=it%50+5,x=it%20+2}l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,filePath:n.targetId,timestamp:n.timestamp,isActive:R,additions:S,deletions:x}})}}if((n.type==="note-read"||n.type==="note-write")&&n.targetId){const h=`note-${n.targetId}`;if(!d.has(n.targetId)){const b={id:h,type:"note",noteId:n.targetId,title:c(n.targetId)||n.targetName||n.targetId,lastAction:n.type==="note-write"?"write":"read",lastActionTimestamp:n.timestamp,x:0,y:0,vx:0,vy:0};d.set(n.targetId,b),i.push(b)}const v=`${n.type}-${n.agentId}-${n.targetId}`;o.has(v)||(o.add(v),l.push({key:v,sourceRawId:n.agentId,targetRawId:n.targetId,edge:{id:v,type:n.type,sourceId:`agent-${n.agentId}`,targetId:h,agentId:n.agentId,noteId:n.targetId,timestamp:n.timestamp,isActive:R}}))}}}function Vn(e,a,s,g,u,c,d,i,o,l){if(e.some(h=>h.type==="file")||a.length===0)return;const p=[];for(const h of Object.keys(s)){const v=Na.select(l,h);v&&(v.additions>0||v.deletions>0)&&p.push(h)}const R=p.length>0?p[0]:g;if(!(!R||!u.has(R)))for(const h of a){const v=h.path;if(!v)continue;const b=`file-${v}`;if(!u.has(v)){const S={id:b,type:"file",path:v,fileName:v.split("/").pop()||"",lastAction:h.action?.toLowerCase()==="delete"?"delete":"write",lastActionTimestamp:o,x:0,y:0,vx:0,vy:0};u.set(v,S),e.push(S);const x=`file-write-${R}-${v}`;c.has(x)||(c.add(x),d.push({id:x,type:"file-write",sourceId:`agent-${R}`,targetId:b,agentId:R,filePath:v,timestamp:o,isActive:i,additions:h.additions,deletions:h.deletions}))}}}var Qn=F('<div class="agent-overview-panel flex flex-col h-full bg-background overflow-auto svelte-1337n58"><!></div>');function pa(e,a){if(new.target)return oe({component:pa,...e});le(a,!0);const s=()=>$t(i,"$graphState$",g),[g,u]=Me();let c=st(a,"workspaceId",7),d=st(a,"onFocus",7);const i=Kn(c());Fe.dispatch(Ka(c()));function o(v,b,S){const x=S.metaKey||S.ctrlKey,it=Pa(S.target);Fe.dispatch(Ha(c(),{agentId:v,sourcePanelId:it,openInAdjacentPanel:x}))}const l=y(()=>s().nodes.filter(v=>qa(v)));var n={get workspaceId(){return c()},set workspaceId(v){c(v),rt()},get onFocus(){return d()},set onFocus(v){d(v),rt()},$set:ie,$on:(v,b)=>ce(a,v,b)},p=Qn(),R=L(p);la(R,{get agents(){return t(l)},get edges(){return s().edges},onAgentClick:o,get onFocus(){return d()}}),$(p),_(e,p);var h=de(n);return u(),h}function Zn(e,a){if(new.target)return oe({component:Zn,...e});le(a,!0);let s=st(a,"workspaceId",7),g=st(a,"onFocus",7);var u={get workspaceId(){return s()},set workspaceId(c){s(c),rt()},get onFocus(){return g()},set onFocus(c){g(c),rt()},$set:ie,$on:(c,d)=>ce(a,c,d)};return pa(e,{get workspaceId(){return s()},get onFocus(){return g()}}),de(u)}export{Zn as default};
@@ -1,2 +1,2 @@
1
- import{t as zt,br as ee,_ as Jr,a_ as Q,bz as Lt,bv as ce,bt as ir,b as At,bp as c}from"./CGWRZzdk.js";import{bs as Wt,ca as pe,aD as e,bH as f,a5 as T,bA as x,W as l,bn as Nt,bV as N,c9 as n,aA as te,c6 as Ut,ay as ne,be as Ze,b$ as tt,b_ as k,bO as g,bS as p,bl as F,aB as P,bj as Xr,aw as rt,ai as Yr,c5 as rr,a as yr,a7 as je,aj as gt,cd as Gr,br as Zr}from"./DYhIMPy1.js";import{G as Pr,H as Qr}from"./DHP1DFPI.js";import{u as at,w as It,v as fr,n as Ct}from"./BjnZ1Xf3.js";import{c as Rt}from"./nmrokYzj.js";import{b as $r}from"./BaIAhI85.js";import{Ix as j,nw as kr,vy as Ir,vx as Cr,KM as ea,KN as ta,et as ra,eu as aa,Kc as vr,lI as Gt,BD as pr,s1 as gr,nU as oa,ze as ia,a5 as mr,J1 as na,Jj as sa,n7 as la,iE as da,ny as ca,u$ as ua,zB as fa,Kb as va}from"./CicdOSYm.js";import{g as pa}from"./DfN8_dcw.js";import{a as ga,h as ma,j as _a,c as ha,d as wa,i as ba,e as xa,f as _r,g as ya,b as Zt}from"./B_frQYKx.js";import{bA as Pa,bN as $a,dr as ka}from"./C0g2TqGQ.js";import{w as hr,d as Ia}from"./L30ES58t.js";import{f as Ca}from"./CnJe4S2a.js";import{k as Qt}from"./CxLPEkg7.js";import{f as Ce,ax as Fa}from"./KJX0Kw6L.js";import"./BEyWfhqM.js";import{F as et,a8 as Sa,aq as Da,aV as Ta,a$ as jt,co as Ea,cp as Ra,bi as Ma,cN as Ua,c4 as ja}from"./By0eqGj-.js";import{d as Va,f as za,t as wr}from"./HLKPZgVy.js";import{c as La}from"./ChTqQfQN.js";import"./DVYqzV0n.js";import{$ as Aa}from"./DPBk4F6a.js";import{i as er,b as Wa,a as Na}from"./H2jLkRRS.js";import{C as ar,p as Ba}from"./ViWKv_qM.js";import{M as Oa}from"./WvxOnEzW.js";import{t as tr,u as Fr}from"./BM1KP-FJ.js";import"./BRhVB6Sv.js";import"./fCEIPyv5.js";import{M as Mt}from"./DIumxlqP.js";import{V as Ha}from"./CMO4ot9F.js";import{bR as qa,b5 as Ka}from"./CUp3pS17.js";import{ap as Ja}from"./b-gQtgOb.js";import{g as Xa,W as Ya}from"./BCXwgWax.js";import{r as Ga,p as Za}from"./D60l1rCk.js";import{l as Qa}from"./DuG2OZjB.js";const Sr=j.createSelector((X,w)=>kr(X.pdfPreview.previews,w));var eo=P('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),to=P('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function or(X,w){if(new.target)return zt({component:or,...X});Wt(w,!0);const ye=()=>ce(we,"$preview",ot),[ot,re]=ir();let y=ee(w,"workspaceId",7),ae=ee(w,"filePath",7),Pe=ee(w,"gitRootId",7);const Fe=crypto.randomUUID(),we=Sr(Fe),ge=new WeakMap;let G=N(null),Je=N(void 0),z=N(1),B=N(1),se=N(!0),me=N(!1),Se=N(null),A=N(0);const be=n(()=>ye()?.error??e(Se)),De=n(()=>e(be)==="missing"?c.file_pdf_missing_error():e(be)==="large"?c.file_pdf_large_error():e(be)==="invalid"?c.file_pdf_invalid_error():e(be)==="password"?c.file_pdf_password_error():c.file_pdf_load_error());pe(()=>{const d=y(),I=ae();e(A);const b=crypto.randomUUID();return j.dispatch(Ir(Fe,b,d,I,...Pe()?[{gitRootId:Pe()}]:[])),()=>{j.dispatch(Cr(Fe,b))}}),pe(()=>{const d=ye()?.url;let I=!1,b;if(f(G,null),f(Se,null),f(se,!0),f(z,1),f(B,1),!!d)return(async()=>{try{const{loadPdfDocument:W}=await Jr(async()=>{const{loadPdfDocument:_e}=await import("./cb1JHFKl.js");return{loadPdfDocument:_e}},[],import.meta.url);if(I)return;b=W(d);const M=await b.promise;I||f(G,M)}catch(W){if(I)return;f(Se,W instanceof Error&&W.name==="PasswordException"?"password":W instanceof Error&&W.name==="InvalidPDFException"?"invalid":"load",!0)}finally{I||f(se,!1)}})(),()=>{I=!0,b?.destroy()}}),pe(()=>{const d=e(G),I=e(Je),b=e(z),W=e(B);if(!d||!I)return;let M=!1,_e,E;const oe=()=>{if(!E)return;const J=(ge.get(E)??1)-1;J?ge.set(E,J):(ge.delete(E),E.cleanup()),E=void 0};return f(me,!0),(async()=>{try{if(E=await d.getPage(b),ge.set(E,(ge.get(E)??0)+1),M){oe();return}const J=E.getViewport({scale:W}),Z=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));I.width=Math.ceil(J.width*Z),I.height=Math.ceil(J.height*Z),I.style.width=`${J.width}px`,I.style.height=`${J.height}px`,_e=E.render({canvas:I,viewport:J,transform:[Z,0,0,Z,0,0]}),await _e.promise}catch{M||f(Se,"invalid")}finally{M||f(me,!1)}})(),()=>{M=!0,_e?.cancel(),_e?_e.promise.then(oe,oe):oe()}});var Ne={get workspaceId(){return y()},set workspaceId(d){y(d),te()},get filePath(){return ae()},set filePath(d){ae(d),te()},get gitRootId(){return Pe()},set gitRootId(d){Pe(d),te()},$set:Lt,$on:(d,I)=>At(w,d,I)},Ve=to(),Be=T(Ve);{var o=d=>{{const I=W=>{Ze();var M=tt();k(()=>g(M,e(De))),l(W,M)};let b=n(()=>c.ui_combobox_retry_label());Va(d,{onRetry:()=>Ut(A),get retryLabel(){return e(b)},class:"m-auto",message:I,$$slots:{message:!0}})}},i=d=>{{let I=n(()=>c.file_pdf_loading_label());za(d,{get label(){return e(I)},count:1,class:"p-4"})}},S=d=>{var I=eo(),b=ne(I),W=T(b);{let ue=n(()=>e(z)<=1);Ce(W,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>Ut(z,-1),children:(Ee,ze)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.file_pdf_previous_label()]),l(Ee,fe)},$$slots:{default:!0}})}var M=p(W,2),_e=F(M,!0),E=p(M,2);{let ue=n(()=>e(z)>=e(G).numPages);Ce(E,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>Ut(z),children:(Ee,ze)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.file_pdf_next_label()]),l(Ee,fe)},$$slots:{default:!0}})}var oe=p(E,2);{let ue=n(()=>e(B)<=.25);Ce(oe,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>f(B,Math.max(.25,e(B)-.25),!0),children:(Ee,ze)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.editor_fileViewer_zoomOut_tooltip()]),l(Ee,fe)},$$slots:{default:!0}})}var J=p(oe,2),Z=F(J,!0),it=p(J,2);{let ue=n(()=>e(B)>=3);Ce(it,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>f(B,Math.min(3,e(B)+.25),!0),children:(Ee,ze)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.editor_fileViewer_zoomIn_tooltip()]),l(Ee,fe)},$$slots:{default:!0}})}x(b);var nt=p(b,2),st=T(nt);let ut;$r(st,ue=>f(Je,ue),()=>e(Je)),x(nt),k((ue,Ee,ze)=>{g(_e,ue),g(Z,Ee),at(nt,"aria-busy",e(me)),at(st,"aria-label",ze),ut=It(st,"",ut,{visibility:e(me)?"hidden":"visible"})},[()=>c.file_pdf_page_label({page:tr(e(z)),total:tr(e(G).numPages)}),()=>Fr(e(B),{style:"percent"}),()=>c.file_pdf_canvas_ariaLabel({name:ae(),page:tr(e(z))})]),l(d,I)};Q(Be,d=>{e(be)?d(o):e(se)||ye()?.status==="loading"?d(i,1):e(G)&&d(S,2)})}x(Ve),l(X,Ve);var Te=Nt(Ne);return re(),Te}const ro=j.createSelector((X,w)=>kr(X.videoPreview.previews,w));var ao=P('<p role="status"> </p>'),oo=P('<p role="alert"> </p>'),io=P('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),no=P('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),so=P('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Dr(X,w){if(new.target)return zt({component:Dr,...X});Wt(w,!0);const ye=()=>ce(Je,"$preview",ot),[ot,re]=ir();let y=ee(w,"sourceUrl",7),ae=ee(w,"fileName",7),Pe=ee(w,"allowDownload",7),Fe=ee(w,"downloading",7),we=ee(w,"onDownload",7),ge=N(null);const G=crypto.randomUUID(),Je=ro(G),z=n(()=>ye()?.status==="loading"),B=n(()=>e(ge)??ye()?.error);let se=!1,me=!1;Xr(()=>{me=!0,j.dispatch(ea(G))});function Se(){if(me||e(z))return;const i=y().startsWith("workspace-file://")?new URL(y()):null;if(se||!i||!i.pathname.toLowerCase().endsWith(".mp4")){f(ge,"unsupported");return}se=!0,i.searchParams.set("preview","h264"),j.dispatch(ta(G,i.hostname,i.toString()))}function A(i){if(me)return;const S=i.currentTarget.error?.code;S===2?f(ge,"network"):S!==1&&Se()}var be={get sourceUrl(){return y()},set sourceUrl(i){y(i),te()},get fileName(){return ae()},set fileName(i){ae(i),te()},get allowDownload(){return Pe()},set allowDownload(i){Pe(i),te()},get downloading(){return Fe()},set downloading(i){Fe(i),te()},get onDownload(){return we()},set onDownload(i){we(i),te()},$set:Lt,$on:(i,S)=>At(w,i,S)},De=so(),Ne=T(De);{var Ve=i=>{var S=io(),Te=T(S),d=F(Te,!0),I=p(Te,2);{var b=E=>{var oe=ao(),J=F(oe,!0);k(Z=>g(J,Z),[()=>c.editor_fileViewer_videoPreparing_label()]),l(E,oe)},W=E=>{var oe=oo(),J=F(oe,!0);k(Z=>g(J,Z),[()=>e(B)==="network"?c.editor_fileViewer_videoLoad_error():c.editor_fileViewer_videoUnsupported_label()]),l(E,oe)};Q(I,E=>{e(z)?E(b):E(W,-1)})}var M=p(I,2);{var _e=E=>{Ce(E,{variant:"secondary",size:"sm",get onclick(){return we()},get disabled(){return Fe()},children:(oe,J)=>{Ze();var Z=tt();k(it=>g(Z,it),[()=>c.layout_fileTab_downloadFile_label()]),l(oe,Z)},$$slots:{default:!0}})};Q(M,E=>{Pe()&&E(_e)})}x(S),k(()=>g(d,ae())),l(i,S)},Be=i=>{var S=no(),Te=F(S,!0);k(d=>{at(S,"src",ye()?.url??y()),g(Te,d)},[()=>c.editor_fileViewer_videoUnsupported_label()]),rt("error",S,A),rt("loadedmetadata",S,d=>{d.currentTarget.videoWidth===0&&Se()}),l(i,S)};Q(Ne,i=>{e(B)||e(z)?i(Ve):i(Be,-1)})}x(De),l(X,De);var o=Nt(be);return re(),o}var lo=P('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),co=P('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),uo=P('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),fo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),vo=P("<!> ",1),po=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),go=P('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),mo=P('<td class="border border-border px-2 py-1 text-xs"> </td>'),_o=P("<tr></tr>"),ho=P('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),wo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),bo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),xo=P('<div class="h-full flex flex-col"><!></div>');function Vt(X,w){if(new.target)return zt({component:Vt,...X});Wt(w,!0);const ye=t=>{var a=lo(),u=ne(a);{let O=n(()=>c.editor_fileViewer_zoomOut_tooltip());Ce(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:oe,get title(){return e(O)},children:(D,V)=>{et(D,{get icon(){return Ea},size:"sm"})},$$slots:{default:!0}})}var m=p(u,2),h=F(m,!0),R=p(m,2);{let O=n(()=>c.editor_fileViewer_zoomIn_tooltip());Ce(R,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:E,get title(){return e(O)},children:(D,V)=>{et(D,{get icon(){return Ra},size:"sm"})},$$slots:{default:!0}})}Ze(2),k(()=>g(h,e(Se))),l(t,a)},ot=La("FileViewer");let re=ee(w,"filePath",7),y=ee(w,"fileContent",7,""),ae=ee(w,"sourceUrl",7),Pe=ee(w,"language",7),Fe=ee(w,"isBinary",7),we=ee(w,"allowDownload",7,!0),ge=ee(w,"onDownload",7),G=ee(w,"downloading",7,!1);const Je=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},z=n(()=>Je(re())),B=n(()=>re().split("/").pop()||c.editor_fileViewer_unknown_fallback());let se=N(100),me=N(0);const Se=n(()=>Fr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let A=N(!1),be=N(0),De=N(0),Ne=N(0),Ve=N(0),Be=N(!1),o=null;function i(){const t=o;o=null,f(Be,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function S(t){if(t.button!==0||!t.isPrimary||o)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),o={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},f(Be,!0),t.preventDefault()}function Te(t){if(!(!o||t.pointerId!==o.pointerId)){if((t.buttons&1)===0){i();return}f(Ne,o.viewport.scrollLeft,!0),f(Ve,o.viewport.scrollTop,!0),f(be,e(be)+(t.clientX-o.x)),f(De,e(De)+(t.clientY-o.y)),o.x=t.clientX,o.y=t.clientY}}function d(t){t.pointerId===o?.pointerId&&i()}pe(()=>{re(),ae(),e(se),e(me),f(Ne,0),f(Ve,0)}),pe(()=>(re(),ae(),rr(()=>{i(),f(be,0),f(De,0)}),i));const I=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},b=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},W=()=>{if(ae())return ae();if(typeof y()=="string")return y().startsWith("data:")||y().startsWith("http")?y():Fe()?`data:${I(re())};base64,${y()}`:`data:${I(re())};base64,${y()}`;if(y()instanceof ArrayBuffer){const a=new Uint8Array(y()).reduce((m,h)=>m+String.fromCharCode(h),""),u=btoa(a);return`data:${I(re())};base64,${u}`}return""},M=()=>{if(ae())return ae();const t=b(re());if(!t)return"";if(typeof y()=="string")return y().startsWith("data:")||y().startsWith("http")?y():`data:${t};base64,${y()}`;const a=new Uint8Array(y()),u=[],m=32768;for(let h=0;h<a.length;h+=m)u.push(String.fromCharCode(...a.subarray(h,h+m)));return`data:${t};base64,${btoa(u.join(""))}`},_e=()=>{const t=typeof y()=="string"?new TextEncoder().encode(y()):new Uint8Array(y()),a=[],u=32768;for(let m=0;m<t.length;m+=u)a.push(String.fromCharCode(...t.subarray(m,m+u)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},E=()=>{f(se,Math.min(e(se)+25,500),!0)},oe=()=>{f(se,Math.max(e(se)-25,25),!0)},J=()=>{f(me,(e(me)+90)%360)},Z=()=>{if(!we()||G())return;if(ge()){ge()();return}const t=document.createElement("a");t.href=e(z)==="video"?M():e(z)==="svg"?_e():W(),t.download=e(B),t.click()},it=async()=>{try{const t=W(),a=new Image;a.crossOrigin="anonymous";const u=await new Promise((m,h)=>{a.onload=()=>{const R=document.createElement("canvas");R.width=a.naturalWidth,R.height=a.naturalHeight;const O=R.getContext("2d");if(!O){h(new Error("Failed to get canvas context"));return}O.drawImage(a,0,0),R.toBlob(D=>{D?m(D):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),f(A,!0),setTimeout(()=>f(A,!1),2e3)}catch(t){ot.error("Failed to copy image:",t)}},nt=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},st=t=>t.split(`
2
- `).map(u=>u.split(",").map(m=>m.trim()));var ut={get filePath(){return re()},set filePath(t){re(t),te()},get fileContent(){return y()},set fileContent(t=""){y(t),te()},get sourceUrl(){return ae()},set sourceUrl(t){ae(t),te()},get language(){return Pe()},set language(t){Pe(t),te()},get isBinary(){return Fe()},set isBinary(t){Fe(t),te()},get allowDownload(){return we()},set allowDownload(t=!0){we(t),te()},get onDownload(){return ge()},set onDownload(t){ge(t),te()},get downloading(){return G()},set downloading(t=!1){G(t),te()},$set:Lt,$on:(t,a)=>At(w,t,a)},ue=xo();rt("blur",yr,i);var Ee=T(ue);{var ze=t=>{var a=co(),u=T(a),m=T(u);ye(m);var h=p(m,2);{let he=n(()=>c.editor_fileViewer_rotate_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:J,get title(){return e(he)},children:($e,He)=>{et($e,{get icon(){return Sa},size:"sm"})},$$slots:{default:!0}})}var R=p(h,4);{let he=n(()=>c.editor_fileViewer_copyImage_tooltip());Ce(R,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:it,get title(){return e(he)},children:($e,He)=>{var ke=je(),St=ne(ke);{var Dt=Ie=>{et(Ie,{get icon(){return Da},size:"sm",class:"text-green-500"})},Ye=Ie=>{et(Ie,{get icon(){return Ta},size:"sm"})};Q(St,Ie=>{e(A)?Ie(Dt):Ie(Ye,-1)})}l($e,ke)},$$slots:{default:!0}})}var O=p(R,2);{let he=n(()=>!we()||G()),$e=n(()=>c.editor_fileViewer_download_tooltip());Ce(O,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(he)},get title(){return e($e)},children:(He,ke)=>{et(He,{get icon(){return jt},size:"sm"})},$$slots:{default:!0}})}var D=p(O,2),V=F(D,!0);x(u);var H=p(u,2),xe=F(H);x(a),k(he=>{g(V,e(B)),fr(H,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Be)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),It(H,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),at(xe,"src",he),at(xe,"alt",e(B)),It(xe,`translate: ${e(be)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(me)??""}deg); transition: transform 0.2s;`)},[()=>W()]),gt("pointerdown",H,S),gt("pointermove",H,Te),gt("pointerup",H,d),rt("pointercancel",H,d),rt("lostpointercapture",H,d),l(t,a)},fe=t=>{var a=uo(),u=T(a),m=T(u);ye(m);var h=p(m,2);{let H=n(()=>!we()||G()),xe=n(()=>c.editor_fileViewer_download_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(H)},get title(){return e(xe)},children:(he,$e)=>{et(he,{get icon(){return jt},size:"sm"})},$$slots:{default:!0}})}var R=p(h,2),O=F(R,!0);x(u);var D=p(u,2),V=F(D);x(a),k(H=>{g(O,e(B)),fr(D,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Be)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),It(D,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(Ve)??""}px;`),at(V,"src",H),at(V,"alt",e(B)),It(V,`translate: ${e(be)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>_e()]),gt("pointerdown",D,S),gt("pointermove",D,Te),gt("pointerup",D,d),rt("pointercancel",D,d),rt("lostpointercapture",D,d),l(t,a)},Le=t=>{const a=n(M);var u=je(),m=ne(u);Pr(m,()=>re()+e(a),h=>{Dr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return we()},get downloading(){return G()},onDownload:Z})}),l(t,u)},mt=t=>{var a=fo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=T(h),O=p(R);x(h),x(a),k((D,V)=>{g(m,e(B)),at(R,"src",D),g(O,` ${V??""}`)},[()=>W(),()=>c.editor_fileViewer_audioUnsupported_label()]),l(t,a)},Bt=t=>{var a=po(),u=p(T(a),2),m=F(u,!0),h=p(u,2);{let R=n(()=>!we()||G());Ce(h,{size:"sm",variant:"secondary",onclick:Z,get disabled(){return e(R)},children:(O,D)=>{var V=vo(),H=ne(V);et(H,{get icon(){return jt},size:"sm",class:"mr-2"});var xe=p(H);k(he=>g(xe,` ${he??""}`),[()=>c.editor_fileViewer_downloadPdf_label()]),l(O,V)},$$slots:{default:!0}})}x(a),k(R=>g(m,R),[()=>c.editor_fileViewer_pdfUnavailable_label()]),l(t,a)},Ot=t=>{{let a=n(()=>nt(y().toString()));ar(t,{get value(){return e(a)},language:"json",get fileName(){return re()},lineNumbers:!0,readOnly:!0})}},Oe=t=>{const a=n(()=>st(y().toString()));var u=ho(),m=T(u),h=T(m),R=T(h);Ct(R,23,()=>e(a)[0]||[],(D,V)=>`header-${V}-${D}`,(D,V)=>{var H=go(),xe=F(H,!0);k(()=>g(xe,e(V))),l(D,H)}),x(R),x(h);var O=p(h);Ct(O,23,()=>e(a).slice(1),(D,V)=>`row-${V}`,(D,V,H)=>{var xe=_o();Ct(xe,23,()=>e(V),(he,$e)=>`cell-${e(H)}-${$e}`,(he,$e)=>{var He=mo(),ke=F(He,!0);k(()=>g(ke,e($e))),l(he,He)}),x(xe),l(D,xe)}),x(O),x(m),x(u),l(t,u)},Xe=t=>{var a=wo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=F(h,!0);x(a),k(O=>{g(m,e(B)),g(R,O)},[()=>c.editor_fileViewer_archive_label()]),l(t,a)},Ht=t=>{var a=bo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=F(h,!0);x(a),k(O=>{g(m,e(B)),g(R,O)},[()=>c.editor_fileViewer_binary_label()]),l(t,a)},Ft=t=>{{let a=n(()=>y().toString());ar(t,{get value(){return e(a)},get language(){return Pe()},get fileName(){return re()},lineNumbers:!0,highlightActiveLine:!0})}};Q(Ee,t=>{e(z)==="image"?t(ze):e(z)==="svg"?t(fe,1):e(z)==="video"?t(Le,2):e(z)==="audio"?t(mt,3):e(z)==="pdf"?t(Bt,4):e(z)==="json"?t(Ot,5):e(z)==="csv"?t(Oe,6):e(z)==="archive"?t(Xe,7):e(z)==="binary"?t(Ht,8):t(Ft,-1)})}return x(ue),l(X,ue),Nt(ut)}Yr(["pointerdown","pointermove","pointerup"]);const yo=/access denied|permission denied|outside (?:the )?workspace/i,Po=/file not found|no such file or directory/i;function $o(X){return yo.test(X)?"access-denied":X===c.files_read_notFound_error()||Po.test(X)?"not-found":"generic"}function ko(X){switch(X){case"access-denied":return c.layout_fileTab_errorAccessDenied_label();case"not-found":return c.layout_fileTab_errorNotFound_label();case"generic":return c.layout_fileTab_errorGeneric_label()}}var Io=P("<!> <!>",1),Co=P("<!> <!> <!>",1),Fo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),br=P('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),So=P('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),xr=P('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),Do=P('<div class="flex items-center gap-3"><!> <!></div>'),To=P('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Eo=P('<p class="text-xs"> </p>'),Ro=P("<li><!></li>"),Mo=P('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Uo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),jo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),Vo=P('<div class="h-full overflow-auto p-4"><!></div>');function zo(X,w){if(new.target)return zt({component:zo,...X});Wt(w,!0);const ye=()=>ce(Ot,"$workspace",A),ot=()=>ce(_e,"$fileContentStore",A),re=()=>ce(E,"$fileLoadingStore",A),y=()=>ce(oe,"$fileSavingStore",A),ae=()=>ce(J,"$fileErrorStore",A),Pe=()=>ce(Z,"$fileErrorInfoStore",A),Fe=()=>ce(it,"$homeView$",A),we=()=>ce(nt,"$fileNotFoundCandidatesStore",A),ge=()=>ce(st,"$isFileBinaryStore",A),G=()=>ce(ut,"$isFileDirtyStore",A),Je=()=>ce(ue,"$fileLastUpdatedStore",A),z=()=>ce(Ee,"$ftChanges$",A),B=()=>ce(Bt,"$gutterRead$",A),se=()=>ce(Ve,"$lineWrapping",A),me=()=>ce(Be,"$diffIndicators",A),Se=()=>ce(Le,"$rootMediaPreview",A),[A,be]=ir(),De=r=>{var s=Io(),$=ne(s);{var C=de=>{var Ae=je(),qe=ne(Ae);Rt(qe,()=>Mt,(pt,xt)=>{xt(pt,{get icon(){return Ma},get label(){return e(he)},disabled:!0})}),l(de,Ae)};Q($,de=>{!e(_t)&&!e(b)&&!e(V)&&de(C)})}var le=p($,2);{var Re=de=>{{let Ae=n(()=>!e(Tt)||!e(Ye)),qe=n(()=>!e(b)&&(!e(Tt)||!e(Ye)));Ha(de,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Tt)},get previewEnabled(){return e(Ye)},onTogglePreview:()=>f(Ye,!e(Ye)),get showWrap(){return e(Ae)},get wrapEnabled(){return se()},onToggleWrap:()=>j.dispatch(sa()),get showDiff(){return e(qe)},get diffEnabled(){return me()},onToggleDiff:()=>j.dispatch(na())})}};Q(le,de=>{o().filePath&&!e(_t)&&!e(V)&&de(Re)})}l(r,s)},Ne=r=>{var s=je(),$=ne(s);{var C=le=>{var Re=Co(),de=ne(Re);{var Ae=We=>{var Ge=je(),dt=ne(Ge);{let yt=n(()=>c.layout_fileTab_goToChanges_tooltip());Rt(dt,()=>Mt,(Pt,$t)=>{$t(Pt,{get icon(){return ja},get label(){return e(yt)},onclick:Lr})})}l(We,Ge)};Q(de,We=>{e(Rr)&&We(Ae)})}var qe=p(de,2);{var pt=We=>{var Ge=je(),dt=ne(Ge);{let yt=n(()=>c.layout_fileTab_downloadFile_label()),Pt=n(()=>!e(wt)||e(lt));Rt(dt,()=>Mt,($t,Jt)=>{Jt($t,{get icon(){return jt},get label(){return e(yt)},onclick:Et,get disabled(){return e(Pt)}})})}l(We,Ge)};Q(qe,We=>{e(Qe)&&We(pt)})}var xt=p(qe,2);{let We=n(()=>c.layout_fileTab_deleteFile_tooltip());Rt(xt,()=>Mt,(Ge,dt)=>{dt(Ge,{get icon(){return Ua},get label(){return e(We)},onclick:Ar,destructive:!0})})}l(le,Re)};Q($,le=>{o().filePath&&!e(_t)&&!e(b)&&le(C)})}l(r,s)},Ve=qa(),Be=Ka();let o=ee(w,"tab",7),i=ee(w,"workspaceId",7),S=ee(w,"isActive",7),Te=ee(w,"isPanelFocused",7);pe(()=>{const r=i();if(!(!S()||!r||e(d)))return j.dispatch(ra(r,"files")),()=>j.dispatch(aa(r,"files"))});const d=n(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),I=n(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),b=n(()=>!!e(d)),W=n(()=>o().filePath?Ca(o().filePath,e(d)):o().filePath),M=Gr(e(W));pe(()=>{M.set(e(W))});const _e=ga(i(),M),E=ma(i(),M),oe=_a(i(),M),J=ha(i(),M),Z=wa(i(),M),it=Qa(i()),nt=ba(i(),M),st=xa(i(),M),ut=_r(i(),M),ue=ya(i(),M),Ee=Pa(i()),ze=pa(),fe=crypto.randomUUID(),Le=Sr(fe),mt=`file-gutter:${crypto.randomUUID()}`,Bt=$a(i(),mt),Ot=ka(i()),Oe=n(()=>ye()?.worktreePath||ye()?.repositoryPath||ye()?.path||null),Xe=n(ot),Ht=Xa();pe(()=>{e(Xe)!==null&&e(Xe)!==void 0&&Ht?.markContentLoaded()});const Ft=n(re),t=n(y),a=n(ae),u=n(()=>e(a)?$o(e(a)):"generic"),m=n(()=>e(a)?Ga(Pe()):null);let h=N(0),R=!1;pe(()=>{const r=Fe();if(!r||r.unavailable){R=!1;return}e(m)&&!R&&(R=!0,rr(()=>Ut(h)))});const O=5,D=n(()=>(we()??[]).slice(0,O)),V=n(ge),H=n(G),xe=n(Je),he=n(()=>e(t)?c.ui_saveIndicator_saving_tooltip():e(H)?c.ui_saveIndicator_autoSaving_tooltip():c.ui_saveIndicator_saved_tooltip());let $e=N(null),He=N(Zr([])),ke=N(null),St=N(void 0),Dt=N(void 0),Ye=N(!0);pe(()=>{const r=o().data?.line,s=o().data?.jumpTimestamp;!r||s!==void 0&&s===e(Dt)||(f(Dt,s,!0),f(St,{line:r},!0),f(Ye,!1))});const Ie=n(()=>e(d)?hr(o().filePath,e(I)):null),_t=n(()=>e(d)?!e(Ie):!!(o().filePath&&(Wa(o().filePath)||e(Oe)&&Na(o().filePath,e(Oe))))),ht=n(()=>o().filePath&&e(Oe)?er(o().filePath)?o().filePath:`${e(Oe)}/${o().filePath}`:null),ft=n(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),vt=n(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Qe=n(()=>i()&&/^[A-Za-z0-9._-]+$/.test(i())?hr(o().filePath,e(Oe)):null),Tr=n(()=>!e(d)&&e(Qe)?e(Qe).split("/").slice(0,-1).join("/"):void 0),qt=n(()=>e(ft)||e(vt)?e(Qe):null),nr=n(()=>e(d)&&e(vt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);pe(()=>{if(!S()||!e(d)||!e(Ie)||!e(nr))return;const r=crypto.randomUUID();return j.dispatch(Ir(fe,r,i(),e(Ie),{gitRootId:e(d),mimeType:e(nr)})),()=>j.dispatch(Cr(fe,r))});let lt=N(!1);const wt=n(()=>!!e(Qe)&&!e(Ft)&&(!e(vt)||e(ke)===e(Qe))),sr=n(()=>e(ke)&&i()?`workspace-file://${i()}/${e(ke).split("/").map(encodeURIComponent).join("/")}`:null),Kt=n(()=>o().filePath?ca(o().filePath):"plaintext"),Tt=n(()=>e(Kt)==="markdown");pe(()=>{if(!S()||e(ft)||e(d))return;const r=e(qt),s=o().filePath,$=i(),C=o().id;if(f(ke,null),!r||!s||!$)return;let le=!1;const Re=()=>!le&&i()===$&&o().id===C&&o().filePath===s;return(async()=>{let de=!1;try{de=(await Fa("file.stat",{workspaceId:$,path:r}))?.isFile===!0}catch{}if(!Re())return;if(de){f(ke,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){f(ke,r,!0);return}const{candidates:Ae,truncated:qe}=await Aa($,r);if(Re()){if(!qe&&Ae.length===1){j.dispatch(vr($,s,Ae[0],C));return}f(ke,r,!0)}})(),()=>{le=!0}});function Er(r,s){return!!(r.file===s||r.relativePath===s||r.relativePath&&s.endsWith("/"+r.relativePath)||r.file&&s.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+s)||r.file&&r.file.endsWith("/"+s))}const bt=n(()=>e(b)||!o().filePath?null:z().find(r=>Er(r,o().filePath))??null),Rr=n(()=>!!e(bt));pe(()=>{if(e(b))return;const r=i(),s=o().filePath,$=e(Oe);return()=>{if(!r||!s)return;const C=Zt.select(j.state,r,s);if(C?.kind!=="editable-text")return;const le=Gt(C.localContent),Re=_r.select(j.state,r,s),de=er(s)?s:$?`${$}/${s}`:null;Re&&de&&j.dispatch(pr(r,s,de,le))}}),pe(()=>{const r=o().filePath,s=e(ht),$=i();if(e(h),!S())return;const C=!e(d)&&!!r&&er(r)&&!e(Oe);r&&$&&!e(_t)&&!e(vt)&&!e(ft)&&!C&&(e(d)&&e(Ie)&&e(W)?j.dispatch(gr($,e(W),s??r,{gitRoot:{id:e(d),relativePath:e(Ie)}})):j.dispatch(gr($,r,s??r)))});function Mr(){return e(Xe)??""}function Ur(r){e(b)||e(V)||!o().filePath||!i()||!e(ht)||j.dispatch(va(i(),o().filePath,Gt(r)))}function jr(){if(e(b)||e(V)||!o().filePath||!e(ht)||e(Xe)===null||e(t))return;const r=Zt.select(j.state,i(),o().filePath);r?.kind==="editable-text"&&j.dispatch(pr(i(),o().filePath,e(ht),Gt(r.localContent)))}function Vr(r){const s=o().filePath;!s||!i()||(j.dispatch(fa(i(),s)),j.dispatch(vr(i(),s,r,o().id)))}pe(()=>{const r=o().filePath,s=e(bt);if(!r||!s){f(He,[],!0);return}if(!S())return;const $=i(),C=crypto.randomUUID();return j.dispatch(oa($,mt,C,{kind:"diffs",path:r,staged:s.stage==="staged"})),()=>{j.dispatch(ia($,mt,C))}}),pe(()=>{const r=B(),s=r?.result?.kind==="diffs"?r.result.chunks:[],$=s.find(C=>C.file===o().filePath)??s[0];f(He,$?Ba($.chunks.map(C=>({oldStart:C.oldStart,oldLines:C.oldLines,newStart:C.newStart,newLines:C.newLines,lines:C.lines.map(le=>(le.type===mr.Addition?"+":le.type===mr.Deletion?"-":" ")+le.content)}))):[],!0)});function zr(r){const s=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),$=Re=>Qr(r,Ja(Re),s);if($("editor.save")){r.preventDefault(),e(H)&&!e(t)&&jr();return}const C=$("editor.undo")?"undo":$("editor.redo")?"redo":$("editor.toggle-task-list")?"toggle-task-list":$("editor.copy")?"copy":$("editor.select-all")?"select-all":null;if(!C||e(b)&&C!=="copy"&&C!=="select-all")return;C!=="toggle-task-list"&&e($e)?.runShortcut(C)&&r.preventDefault()}function Lr(r){if(!o().filePath||!e(bt))return;const s=r?.metaKey||r?.ctrlKey||!1,C=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;j.dispatch(ua(i(),e(bt),{filePath:o().filePath,changeId:e(bt).id,openInAdjacentPanel:s,sourcePanelId:C}))}async function Et(){const r=e(Qe);if(!(e(b)||!r||!i()||!e(wt)||e(lt))){f(lt,!0);try{const s=await Ia(i(),r,e(Oe));!s?.success&&!s?.canceled&&Qt.error(s?.error?.message||c.layout_fileTab_downloadFailed_error())}catch{Qt.error(c.layout_fileTab_downloadFailed_error())}finally{f(lt,!1)}}}function Ar(){const r=e(ht);if(e(b)||!o().filePath||!i()||!r)return;const s=la(Zt.select(j.state,i(),o().filePath));if(!s){Qt.error(c.ui_reversibleActions_failed_error({message:c.fileExplorer_tree_undoUnavailable_error()}));return}j.dispatch(da(i(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:s}))}pe(()=>{if(!ze||!S())return;const r={isDirty:!e(b)&&e(H),isSaving:!e(b)&&e(t)};rr(()=>{ze.registerActions({display:De,actions:Ne}),ze.registerState(r)})});var Wr={get tab(){return o()},set tab(r){o(r),te()},get workspaceId(){return i()},set workspaceId(r){i(r),te()},get isActive(){return S()},set isActive(r){S(r),te()},get isPanelFocused(){return Te()},set isPanelFocused(r){Te(r),te()},$set:Lt,$on:(r,s)=>At(w,r,s)},lr=je();rt("keydown",yr,r=>S()&&zr(r));var Nr=ne(lr);{var Br=r=>{var s=je(),$=ne(s);Pr($,()=>o().filePath,C=>{var le=je(),Re=ne(le);{var de=_=>{var v=Fo(),U=T(v),q=F(U,!0),L=p(U,2),Me=F(L,!0);x(v),k(Y=>{g(q,Y),g(Me,o().filePath)},[()=>c.layout_fileTab_outsideWorkspace_label()]),l(_,v)},Ae=_=>{var v=je(),U=ne(v);{var q=L=>{or(L,{get workspaceId(){return i()},get filePath(){return e(Ie)},get gitRootId(){return e(d)}})};Q(U,L=>{S()&&L(q)})}l(_,v)},qe=_=>{var v=je(),U=ne(v);{var q=Y=>{var K=br(),ie=T(K),Ue=F(ie,!0);x(K),k(ve=>g(Ue,ve),[()=>c.layout_fileTab_errorLoading_label()]),l(Y,K)},L=Y=>{Vt(Y,{get filePath(){return o().filePath},get sourceUrl(){return Se().url},allowDownload:!1})},Me=Y=>{var K=So(),ie=T(K),Ue=F(ie,!0);x(K),k(ve=>g(Ue,ve),[()=>c.layout_fileTab_preparing_label()]),l(Y,K)};Q(U,Y=>{Se()?.error?Y(q):Se()?.url?Y(L,1):Y(Me,-1)})}l(_,v)},pt=_=>{var v=je(),U=ne(v);{var q=L=>{or(L,{get workspaceId(){return i()},get filePath(){return e(qt)}})};Q(U,L=>{S()&&L(q)})}l(_,v)},xt=_=>{var v=br(),U=T(v),q=F(U,!0);x(v),k(L=>g(q,L),[()=>c.file_pdf_load_error()]),l(_,v)},We=_=>{{let v=n(()=>e(ke)??o().filePath),U=n(()=>!e(b)&&e(wt));Vt(_,{get filePath(){return e(v)},get sourceUrl(){return e(sr)},onDownload:Et,get allowDownload(){return e(U)},get downloading(){return e(lt)}})}},Ge=_=>{var v=xr(),U=T(v),q=F(U,!0);x(v),k(L=>g(q,L),[()=>c.layout_fileTab_preparing_label()]),l(_,v)},dt=_=>{var v=To(),U=T(v);Ct(U,20,()=>[...Array(20).keys()],q=>q,(q,L)=>{var Me=Do(),Y=T(Me);wr(Y,{class:"h-3 w-8 shrink-0"});var K=p(Y,2);wr(K,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),x(Me),l(q,Me)}),x(U),x(v),l(_,v)},yt=_=>{{let v=n(()=>Za(e(m)));Ya(_,{get view(){return e(v)}})}},Pt=_=>{var v=Uo(),U=T(v),q=F(U,!0),L=p(U,2),Me=F(L,!0),Y=p(L,2);{var K=ve=>{var Ke=Eo(),ct=F(Ke,!0);k(()=>g(ct,e(a))),l(ve,Ke)};Q(Y,ve=>{e(u)==="generic"&&ve(K)})}var ie=p(Y,2);{var Ue=ve=>{var Ke=Mo(),ct=ne(Ke),Xt=F(ct,!0),dr=p(ct,2);Ct(dr,20,()=>e(D),kt=>kt,(kt,cr)=>{var Yt=Ro(),qr=T(Yt);Ce(qr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>Vr(cr),children:(Kr,Lo)=>{Ze();var ur=tt();k(()=>g(ur,cr)),l(Kr,ur)},$$slots:{default:!0}}),x(Yt),l(kt,Yt)}),x(dr),k(kt=>g(Xt,kt),[()=>c.layout_fileTab_didYouMean_label()]),l(ve,Ke)};Q(ie,ve=>{e(D).length>0&&ve(Ue)})}x(v),k(ve=>{g(q,ve),g(Me,o().filePath)},[()=>ko(e(u))]),l(_,v)},$t=_=>{var v=jo(),U=T(v),q=F(U,!0),L=p(U,2),Me=F(L,!0),Y=p(L,2);{var K=ie=>{{let Ue=n(()=>!e(wt)||e(lt));Ce(ie,{variant:"secondary",size:"sm",onclick:Et,get disabled(){return e(Ue)},children:(ve,Ke)=>{Ze();var ct=tt();k(Xt=>g(ct,Xt),[()=>c.layout_fileTab_downloadFile_label()]),l(ve,ct)},$$slots:{default:!0}})}};Q(Y,ie=>{!e(b)&&e(Qe)&&ie(K)})}x(v),k(ie=>{g(q,ie),g(Me,o().filePath)},[()=>c.editor_fileViewer_binary_label()]),l(_,v)},Jt=_=>{const v=n(()=>o().filePath?.toLowerCase().endsWith(".svg"));var U=je(),q=ne(U);{var L=K=>{{let ie=n(()=>o().filePath||""),Ue=n(()=>!e(b)&&e(wt));Vt(K,{get filePath(){return e(ie)},get fileContent(){return e(Xe)},get language(){return e(Kt)},get isBinary(){return e(V)},onDownload:Et,get allowDownload(){return e(Ue)},get downloading(){return e(lt)}})}},Me=K=>{var ie=Vo(),Ue=T(ie);Oa(Ue,{get content(){return e(Xe)},get workspaceId(){return i()},get relativeMediaBase(){return e(Tr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),x(ie),l(K,ie)},Y=K=>{var ie=Mr,Ue=Ur;{let ve=n(()=>me()?e(He):[]);$r(ar(K,{get value(){return ie()},set value(Ke){Ue(Ke)},get language(){return e(Kt)},get readOnly(){return e(b)},get fileName(){return o().filePath},get workspaceId(){return i()},get filePath(){return o().filePath},get lineWrapping(){return se()},get lineChanges(){return e(ve)},get jumpTo(){return e(St)},get externalContentVersion(){return e(xe)},get isPanelFocused(){return Te()}}),Ke=>f($e,Ke,!0),()=>e($e))}};Q(q,K=>{e(v)?K(L):e(Tt)&&e(Ye)?K(Me,1):K(Y,-1)})}l(_,U)},Hr=_=>{var v=xr(),U=T(v),q=F(U,!0);x(v),k(L=>g(q,L),[()=>c.layout_fileTab_preparing_label()]),l(_,v)};Q(Re,_=>{e(_t)?_(de):e(d)&&e(ft)&&e(Ie)?_(Ae,1):e(d)&&e(vt)?_(qe,2):e(ft)&&e(qt)?_(pt,3):e(ft)?_(xt,4):e(sr)?_(We,5):e(vt)?_(Ge,6):e(Ft)?_(dt,7):e(m)?_(yt,8):e(a)?_(Pt,9):e(V)?_($t,10):e(Xe)!==null?_(Jt,11):_(Hr,-1)})}l(C,le)}),l(r,s)};Q(Nr,r=>{o().filePath&&r(Br)})}l(X,lr);var Or=Nt(Wr);return be(),Or}export{zo as default};
1
+ import{t as Vt,br as ee,_ as Jr,a_ as Q,bz as Lt,bv as ce,bt as ir,b as At,bp as c}from"./DTQYcznv.js";import{bs as Wt,ca as pe,aD as e,bH as f,a5 as T,bA as x,W as l,bn as Nt,bV as N,c9 as n,aA as te,c6 as Mt,ay as ne,be as Ze,b$ as tt,b_ as k,bO as g,bS as p,bl as F,aB as P,bj as Xr,aw as rt,ai as Yr,c5 as rr,a as yr,a7 as je,aj as gt,cd as Gr,br as Zr}from"./DYhIMPy1.js";import{G as Pr,H as Qr}from"./-SwunqO3.js";import{u as at,w as It,v as fr,n as Ct}from"./Ck9ZyE1n.js";import{c as Rt}from"./BmP1Wws6.js";import{b as $r}from"./BaIAhI85.js";import{Iz as j,nw as kr,vy as Ir,vx as Cr,KO as ea,KP as ta,et as ra,eu as aa,Ke as vr,lI as Gt,BF as pr,s1 as gr,nU as oa,zg as ia,a5 as mr,J3 as na,Jl as sa,n7 as la,iE as da,ny as ca,u$ as ua,zD as fa,Kd as va}from"./A0r9TbR7.js";import{g as pa}from"./DfN8_dcw.js";import{a as ga,h as ma,j as _a,c as ha,d as wa,i as ba,e as xa,f as _r,g as ya,b as Zt}from"./BYFJ74nm.js";import{bA as Pa,bN as $a,dr as ka}from"./B0biUQQF.js";import{w as hr,d as Ia}from"./CcXuSxXv.js";import{f as Ca}from"./BMm9sGZ6.js";import{k as Qt}from"./CuhrgDBI.js";import{f as Ce,ax as Fa}from"./BP5uyQTv.js";import"./CaxyE6o_.js";import{F as et,a8 as Sa,aq as Da,aV as Ta,a$ as jt,co as Ea,cp as Ra,bi as Ua,cN as Ma,c4 as ja}from"./CoLl8pQb.js";import{d as za,f as Va,t as wr}from"./Ddw98WmY.js";import{c as La}from"./ChTqQfQN.js";import"./DpMTpLDQ.js";import{$ as Aa}from"./CpadbTI2.js";import{i as er,b as Wa,a as Na}from"./H2jLkRRS.js";import{C as ar,p as Ba}from"./H60Tbroe.js";import{M as Oa}from"./ByuX26Ym.js";import{t as tr,u as Fr}from"./BqqN40AD.js";import"./COrK0goa.js";import"./BXeiKdwz.js";import{M as Ut}from"./C52Qm4vO.js";import{V as Ha}from"./DU8kuP6M.js";import{bR as qa,b5 as Ka}from"./Ds3Wirif.js";import{ap as Ja}from"./Dlag9Uxb.js";import{g as Xa,W as Ya}from"./DzHHkfB1.js";import{r as Ga,p as Za}from"./ChY17Glq.js";import{l as Qa}from"./D3I0DcnM.js";const Sr=j.createSelector((X,w)=>kr(X.pdfPreview.previews,w));var eo=P('<div class="flex shrink-0 flex-wrap items-center justify-center gap-2 border-b border-border p-2"><!> <span aria-live="polite"> </span> <!> <!> <span> </span> <!></div> <div class="min-h-0 flex-1 overflow-auto p-4"><canvas class="mx-auto block" role="img"></canvas></div>',1),to=P('<div class="flex h-full min-h-0 flex-col" data-testid="pdf-viewer"><!></div>');function or(X,w){if(new.target)return Vt({component:or,...X});Wt(w,!0);const ye=()=>ce(we,"$preview",ot),[ot,re]=ir();let y=ee(w,"workspaceId",7),ae=ee(w,"filePath",7),Pe=ee(w,"gitRootId",7);const Fe=crypto.randomUUID(),we=Sr(Fe),ge=new WeakMap;let G=N(null),Je=N(void 0),V=N(1),B=N(1),se=N(!0),me=N(!1),Se=N(null),A=N(0);const be=n(()=>ye()?.error??e(Se)),De=n(()=>e(be)==="missing"?c.file_pdf_missing_error():e(be)==="large"?c.file_pdf_large_error():e(be)==="invalid"?c.file_pdf_invalid_error():e(be)==="password"?c.file_pdf_password_error():c.file_pdf_load_error());pe(()=>{const d=y(),I=ae();e(A);const b=crypto.randomUUID();return j.dispatch(Ir(Fe,b,d,I,...Pe()?[{gitRootId:Pe()}]:[])),()=>{j.dispatch(Cr(Fe,b))}}),pe(()=>{const d=ye()?.url;let I=!1,b;if(f(G,null),f(Se,null),f(se,!0),f(V,1),f(B,1),!!d)return(async()=>{try{const{loadPdfDocument:W}=await Jr(async()=>{const{loadPdfDocument:_e}=await import("./cb1JHFKl.js");return{loadPdfDocument:_e}},[],import.meta.url);if(I)return;b=W(d);const U=await b.promise;I||f(G,U)}catch(W){if(I)return;f(Se,W instanceof Error&&W.name==="PasswordException"?"password":W instanceof Error&&W.name==="InvalidPDFException"?"invalid":"load",!0)}finally{I||f(se,!1)}})(),()=>{I=!0,b?.destroy()}}),pe(()=>{const d=e(G),I=e(Je),b=e(V),W=e(B);if(!d||!I)return;let U=!1,_e,E;const oe=()=>{if(!E)return;const J=(ge.get(E)??1)-1;J?ge.set(E,J):(ge.delete(E),E.cleanup()),E=void 0};return f(me,!0),(async()=>{try{if(E=await d.getPage(b),ge.set(E,(ge.get(E)??0)+1),U){oe();return}const J=E.getViewport({scale:W}),Z=Math.min(window.devicePixelRatio||1,2,Math.sqrt(16e6/(J.width*J.height)));I.width=Math.ceil(J.width*Z),I.height=Math.ceil(J.height*Z),I.style.width=`${J.width}px`,I.style.height=`${J.height}px`,_e=E.render({canvas:I,viewport:J,transform:[Z,0,0,Z,0,0]}),await _e.promise}catch{U||f(Se,"invalid")}finally{U||f(me,!1)}})(),()=>{U=!0,_e?.cancel(),_e?_e.promise.then(oe,oe):oe()}});var Ne={get workspaceId(){return y()},set workspaceId(d){y(d),te()},get filePath(){return ae()},set filePath(d){ae(d),te()},get gitRootId(){return Pe()},set gitRootId(d){Pe(d),te()},$set:Lt,$on:(d,I)=>At(w,d,I)},ze=to(),Be=T(ze);{var o=d=>{{const I=W=>{Ze();var U=tt();k(()=>g(U,e(De))),l(W,U)};let b=n(()=>c.ui_combobox_retry_label());za(d,{onRetry:()=>Mt(A),get retryLabel(){return e(b)},class:"m-auto",message:I,$$slots:{message:!0}})}},i=d=>{{let I=n(()=>c.file_pdf_loading_label());Va(d,{get label(){return e(I)},count:1,class:"p-4"})}},S=d=>{var I=eo(),b=ne(I),W=T(b);{let ue=n(()=>e(V)<=1);Ce(W,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>Mt(V,-1),children:(Ee,Ve)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.file_pdf_previous_label()]),l(Ee,fe)},$$slots:{default:!0}})}var U=p(W,2),_e=F(U,!0),E=p(U,2);{let ue=n(()=>e(V)>=e(G).numPages);Ce(E,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>Mt(V),children:(Ee,Ve)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.file_pdf_next_label()]),l(Ee,fe)},$$slots:{default:!0}})}var oe=p(E,2);{let ue=n(()=>e(B)<=.25);Ce(oe,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>f(B,Math.max(.25,e(B)-.25),!0),children:(Ee,Ve)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.editor_fileViewer_zoomOut_tooltip()]),l(Ee,fe)},$$slots:{default:!0}})}var J=p(oe,2),Z=F(J,!0),it=p(J,2);{let ue=n(()=>e(B)>=3);Ce(it,{variant:"ghost",size:"compact",get disabled(){return e(ue)},onclick:()=>f(B,Math.min(3,e(B)+.25),!0),children:(Ee,Ve)=>{Ze();var fe=tt();k(Le=>g(fe,Le),[()=>c.editor_fileViewer_zoomIn_tooltip()]),l(Ee,fe)},$$slots:{default:!0}})}x(b);var nt=p(b,2),st=T(nt);let ut;$r(st,ue=>f(Je,ue),()=>e(Je)),x(nt),k((ue,Ee,Ve)=>{g(_e,ue),g(Z,Ee),at(nt,"aria-busy",e(me)),at(st,"aria-label",Ve),ut=It(st,"",ut,{visibility:e(me)?"hidden":"visible"})},[()=>c.file_pdf_page_label({page:tr(e(V)),total:tr(e(G).numPages)}),()=>Fr(e(B),{style:"percent"}),()=>c.file_pdf_canvas_ariaLabel({name:ae(),page:tr(e(V))})]),l(d,I)};Q(Be,d=>{e(be)?d(o):e(se)||ye()?.status==="loading"?d(i,1):e(G)&&d(S,2)})}x(ze),l(X,ze);var Te=Nt(Ne);return re(),Te}const ro=j.createSelector((X,w)=>kr(X.videoPreview.previews,w));var ao=P('<p role="status"> </p>'),oo=P('<p role="alert"> </p>'),io=P('<div class="flex flex-col items-center gap-3 p-6 text-center text-sm text-subtle"><p class="break-all"> </p> <!> <!></div>'),no=P('<video controls="" preload="metadata" playsinline="" class="max-w-full max-h-full" data-testid="file-video"> </video>',2),so=P('<div class="min-h-0 flex-1 flex items-center justify-center bg-background"><!></div>');function Dr(X,w){if(new.target)return Vt({component:Dr,...X});Wt(w,!0);const ye=()=>ce(Je,"$preview",ot),[ot,re]=ir();let y=ee(w,"sourceUrl",7),ae=ee(w,"fileName",7),Pe=ee(w,"allowDownload",7),Fe=ee(w,"downloading",7),we=ee(w,"onDownload",7),ge=N(null);const G=crypto.randomUUID(),Je=ro(G),V=n(()=>ye()?.status==="loading"),B=n(()=>e(ge)??ye()?.error);let se=!1,me=!1;Xr(()=>{me=!0,j.dispatch(ea(G))});function Se(){if(me||e(V))return;const i=y().startsWith("workspace-file://")?new URL(y()):null;if(se||!i||!i.pathname.toLowerCase().endsWith(".mp4")){f(ge,"unsupported");return}se=!0,i.searchParams.set("preview","h264"),j.dispatch(ta(G,i.hostname,i.toString()))}function A(i){if(me)return;const S=i.currentTarget.error?.code;S===2?f(ge,"network"):S!==1&&Se()}var be={get sourceUrl(){return y()},set sourceUrl(i){y(i),te()},get fileName(){return ae()},set fileName(i){ae(i),te()},get allowDownload(){return Pe()},set allowDownload(i){Pe(i),te()},get downloading(){return Fe()},set downloading(i){Fe(i),te()},get onDownload(){return we()},set onDownload(i){we(i),te()},$set:Lt,$on:(i,S)=>At(w,i,S)},De=so(),Ne=T(De);{var ze=i=>{var S=io(),Te=T(S),d=F(Te,!0),I=p(Te,2);{var b=E=>{var oe=ao(),J=F(oe,!0);k(Z=>g(J,Z),[()=>c.editor_fileViewer_videoPreparing_label()]),l(E,oe)},W=E=>{var oe=oo(),J=F(oe,!0);k(Z=>g(J,Z),[()=>e(B)==="network"?c.editor_fileViewer_videoLoad_error():c.editor_fileViewer_videoUnsupported_label()]),l(E,oe)};Q(I,E=>{e(V)?E(b):E(W,-1)})}var U=p(I,2);{var _e=E=>{Ce(E,{variant:"secondary",size:"sm",get onclick(){return we()},get disabled(){return Fe()},children:(oe,J)=>{Ze();var Z=tt();k(it=>g(Z,it),[()=>c.layout_fileTab_downloadFile_label()]),l(oe,Z)},$$slots:{default:!0}})};Q(U,E=>{Pe()&&E(_e)})}x(S),k(()=>g(d,ae())),l(i,S)},Be=i=>{var S=no(),Te=F(S,!0);k(d=>{at(S,"src",ye()?.url??y()),g(Te,d)},[()=>c.editor_fileViewer_videoUnsupported_label()]),rt("error",S,A),rt("loadedmetadata",S,d=>{d.currentTarget.videoWidth===0&&Se()}),l(i,S)};Q(Ne,i=>{e(B)||e(V)?i(ze):i(Be,-1)})}x(De),l(X,De);var o=Nt(be);return re(),o}var lo=P('<!> <span class="text-xs text-subtle min-w-[50px] text-center"> </span> <!> <div class="w-px h-5 bg-border mx-1"></div>',1),co=P('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="w-px h-5 bg-border mx-1"></div> <!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),uo=P('<div class="min-h-0 flex-1 flex flex-col"><div class="flex items-center gap-2 p-2 border-b border-border bg-muted/30"><!> <!> <div class="ml-auto text-xs text-subtle"> </div></div> <div><img draggable="false" class="max-w-full max-h-full object-contain"/></div></div>'),fo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 19V6l12-3v13M9 19c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zm12-3c0 1.105-1.343 2-3 2s-3-.895-3-2 1.343-2 3-2 3 .895 3 2zM9 10l12-3"></path></svg></div> <div class="text-sm text-subtle mb-4"> </div> <audio controls="" class="w-full max-w-md"><source/> </audio></div>'),vo=P("<!> ",1),po=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M7 21h10a2 2 0 002-2V9.414a1 1 0 00-.293-.707l-5.414-5.414A1 1 0 0012.586 3H7a2 2 0 00-2 2v14a2 2 0 002 2z"></path></svg></div> <p class="text-sm text-subtle mb-4"> </p> <!></div>'),go=P('<th class="border border-border px-2 py-1 text-left text-xs font-medium bg-muted"> </th>'),mo=P('<td class="border border-border px-2 py-1 text-xs"> </td>'),_o=P("<tr></tr>"),ho=P('<div class="flex-1 overflow-auto p-4"><table class="w-full border-collapse"><thead><tr></tr></thead><tbody></tbody></table></div>'),wo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20 13V6a2 2 0 00-2-2H6a2 2 0 00-2 2v7m16 0v5a2 2 0 01-2 2H6a2 2 0 01-2-2v-5m16 0h-2.586a1 1 0 00-.707.293l-2.414 2.414a1 1 0 01-.707.293h-3.172a1 1 0 01-.707-.293l-2.414-2.414A1 1 0 006.586 13H4"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),bo=P('<div class="flex-1 flex flex-col items-center justify-center p-8"><div class="text-subtle mb-4"><svg class="w-24 h-24" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 3v2m6-2v2M9 19v2m6-2v2M5 9H3m2 6H3m18-6h-2m2 6h-2M7 19h10a2 2 0 002-2V7a2 2 0 00-2-2H7a2 2 0 00-2 2v10a2 2 0 002 2zM9 9h6v6H9V9z"></path></svg></div> <p class="text-sm text-subtle mb-2"> </p> <p class="text-xs text-subtle"> </p></div>'),xo=P('<div class="h-full flex flex-col"><!></div>');function zt(X,w){if(new.target)return Vt({component:zt,...X});Wt(w,!0);const ye=t=>{var a=lo(),u=ne(a);{let O=n(()=>c.editor_fileViewer_zoomOut_tooltip());Ce(u,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:oe,get title(){return e(O)},children:(D,z)=>{et(D,{get icon(){return Ea},size:"sm"})},$$slots:{default:!0}})}var m=p(u,2),h=F(m,!0),R=p(m,2);{let O=n(()=>c.editor_fileViewer_zoomIn_tooltip());Ce(R,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:E,get title(){return e(O)},children:(D,z)=>{et(D,{get icon(){return Ra},size:"sm"})},$$slots:{default:!0}})}Ze(2),k(()=>g(h,e(Se))),l(t,a)},ot=La("FileViewer");let re=ee(w,"filePath",7),y=ee(w,"fileContent",7,""),ae=ee(w,"sourceUrl",7),Pe=ee(w,"language",7),Fe=ee(w,"isBinary",7),we=ee(w,"allowDownload",7,!0),ge=ee(w,"onDownload",7),G=ee(w,"downloading",7,!1);const Je=t=>{const a=t.split(".").pop()?.toLowerCase()||"";return["png","jpg","jpeg","gif","webp","bmp","ico","avif"].includes(a)?"image":a==="svg"?"svg":["mp4","webm","ogg","mov","avi"].includes(a)?"video":["mp3","wav","ogg","m4a","flac"].includes(a)?"audio":a==="pdf"?"pdf":["md","markdown"].includes(a)?"markdown":a==="json"?"json":a==="csv"?"csv":["yaml","yml"].includes(a)?"yaml":a==="xml"?"xml":["zip","tar","gz","rar","7z","bz2"].includes(a)?"archive":["exe","dll","so","dylib","wasm"].includes(a)?"binary":"text"},V=n(()=>Je(re())),B=n(()=>re().split("/").pop()||c.editor_fileViewer_unknown_fallback());let se=N(100),me=N(0);const Se=n(()=>Fr(e(se)/100,{style:"percent",maximumFractionDigits:0}));let A=N(!1),be=N(0),De=N(0),Ne=N(0),ze=N(0),Be=N(!1),o=null;function i(){const t=o;o=null,f(Be,!1),t?.viewport.hasPointerCapture(t.pointerId)&&t.viewport.releasePointerCapture(t.pointerId)}function S(t){if(t.button!==0||!t.isPrimary||o)return;const a=t.currentTarget;a.setPointerCapture(t.pointerId),o={pointerId:t.pointerId,x:t.clientX,y:t.clientY,viewport:a},f(Be,!0),t.preventDefault()}function Te(t){if(!(!o||t.pointerId!==o.pointerId)){if((t.buttons&1)===0){i();return}f(Ne,o.viewport.scrollLeft,!0),f(ze,o.viewport.scrollTop,!0),f(be,e(be)+(t.clientX-o.x)),f(De,e(De)+(t.clientY-o.y)),o.x=t.clientX,o.y=t.clientY}}function d(t){t.pointerId===o?.pointerId&&i()}pe(()=>{re(),ae(),e(se),e(me),f(Ne,0),f(ze,0)}),pe(()=>(re(),ae(),rr(()=>{i(),f(be,0),f(De,0)}),i));const I=t=>{const a=t.split(".").pop()?.toLowerCase();return a==="jpg"||a==="jpeg"?"image/jpeg":a==="png"?"image/png":a==="gif"?"image/gif":a==="webp"?"image/webp":"application/octet-stream"},b=t=>{const a=t.split(".").pop()?.toLowerCase();if(a==="mp4")return"video/mp4";if(a==="webm")return"video/webm"},W=()=>{if(ae())return ae();if(typeof y()=="string")return y().startsWith("data:")||y().startsWith("http")?y():Fe()?`data:${I(re())};base64,${y()}`:`data:${I(re())};base64,${y()}`;if(y()instanceof ArrayBuffer){const a=new Uint8Array(y()).reduce((m,h)=>m+String.fromCharCode(h),""),u=btoa(a);return`data:${I(re())};base64,${u}`}return""},U=()=>{if(ae())return ae();const t=b(re());if(!t)return"";if(typeof y()=="string")return y().startsWith("data:")||y().startsWith("http")?y():`data:${t};base64,${y()}`;const a=new Uint8Array(y()),u=[],m=32768;for(let h=0;h<a.length;h+=m)u.push(String.fromCharCode(...a.subarray(h,h+m)));return`data:${t};base64,${btoa(u.join(""))}`},_e=()=>{const t=typeof y()=="string"?new TextEncoder().encode(y()):new Uint8Array(y()),a=[],u=32768;for(let m=0;m<t.length;m+=u)a.push(String.fromCharCode(...t.subarray(m,m+u)));return`data:image/svg+xml;base64,${btoa(a.join(""))}`},E=()=>{f(se,Math.min(e(se)+25,500),!0)},oe=()=>{f(se,Math.max(e(se)-25,25),!0)},J=()=>{f(me,(e(me)+90)%360)},Z=()=>{if(!we()||G())return;if(ge()){ge()();return}const t=document.createElement("a");t.href=e(V)==="video"?U():e(V)==="svg"?_e():W(),t.download=e(B),t.click()},it=async()=>{try{const t=W(),a=new Image;a.crossOrigin="anonymous";const u=await new Promise((m,h)=>{a.onload=()=>{const R=document.createElement("canvas");R.width=a.naturalWidth,R.height=a.naturalHeight;const O=R.getContext("2d");if(!O){h(new Error("Failed to get canvas context"));return}O.drawImage(a,0,0),R.toBlob(D=>{D?m(D):h(new Error("Failed to create blob from canvas"))},"image/png",1)},a.onerror=()=>h(new Error("Failed to load image")),a.src=t});await navigator.clipboard.write([new ClipboardItem({"image/png":u})]),f(A,!0),setTimeout(()=>f(A,!1),2e3)}catch(t){ot.error("Failed to copy image:",t)}},nt=t=>{try{const a=JSON.parse(t);return JSON.stringify(a,null,2)}catch{return t}},st=t=>t.split(`
2
+ `).map(u=>u.split(",").map(m=>m.trim()));var ut={get filePath(){return re()},set filePath(t){re(t),te()},get fileContent(){return y()},set fileContent(t=""){y(t),te()},get sourceUrl(){return ae()},set sourceUrl(t){ae(t),te()},get language(){return Pe()},set language(t){Pe(t),te()},get isBinary(){return Fe()},set isBinary(t){Fe(t),te()},get allowDownload(){return we()},set allowDownload(t=!0){we(t),te()},get onDownload(){return ge()},set onDownload(t){ge(t),te()},get downloading(){return G()},set downloading(t=!1){G(t),te()},$set:Lt,$on:(t,a)=>At(w,t,a)},ue=xo();rt("blur",yr,i);var Ee=T(ue);{var Ve=t=>{var a=co(),u=T(a),m=T(u);ye(m);var h=p(m,2);{let he=n(()=>c.editor_fileViewer_rotate_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:J,get title(){return e(he)},children:($e,He)=>{et($e,{get icon(){return Sa},size:"sm"})},$$slots:{default:!0}})}var R=p(h,4);{let he=n(()=>c.editor_fileViewer_copyImage_tooltip());Ce(R,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:it,get title(){return e(he)},children:($e,He)=>{var ke=je(),St=ne(ke);{var Dt=Ie=>{et(Ie,{get icon(){return Da},size:"sm",class:"text-green-500"})},Ye=Ie=>{et(Ie,{get icon(){return Ta},size:"sm"})};Q(St,Ie=>{e(A)?Ie(Dt):Ie(Ye,-1)})}l($e,ke)},$$slots:{default:!0}})}var O=p(R,2);{let he=n(()=>!we()||G()),$e=n(()=>c.editor_fileViewer_download_tooltip());Ce(O,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(he)},get title(){return e($e)},children:(He,ke)=>{et(He,{get icon(){return jt},size:"sm"})},$$slots:{default:!0}})}var D=p(O,2),z=F(D,!0);x(u);var H=p(u,2),xe=F(H);x(a),k(he=>{g(z,e(B)),fr(H,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Be)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),It(H,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(ze)??""}px;`),at(xe,"src",he),at(xe,"alt",e(B)),It(xe,`translate: ${e(be)??""}px ${e(De)??""}px; transform: scale(${e(se)/100}) rotate(${e(me)??""}deg); transition: transform 0.2s;`)},[()=>W()]),gt("pointerdown",H,S),gt("pointermove",H,Te),gt("pointerup",H,d),rt("pointercancel",H,d),rt("lostpointercapture",H,d),l(t,a)},fe=t=>{var a=uo(),u=T(a),m=T(u);ye(m);var h=p(m,2);{let H=n(()=>!we()||G()),xe=n(()=>c.editor_fileViewer_download_tooltip());Ce(h,{size:"icon",variant:"ghost",class:"h-7 w-7",onclick:Z,get disabled(){return e(H)},get title(){return e(xe)},children:(he,$e)=>{et(he,{get icon(){return jt},size:"sm"})},$$slots:{default:!0}})}var R=p(h,2),O=F(R,!0);x(u);var D=p(u,2),z=F(D);x(a),k(H=>{g(O,e(B)),fr(D,1,`relative min-h-0 flex-1 overflow-auto bg-checkered flex items-center justify-center p-4 select-none ${e(Be)?"cursor-grabbing":"cursor-grab"}`,"svelte-1uj35xu"),It(D,`--pan-scroll-x: ${e(Ne)??""}px; --pan-scroll-y: ${e(ze)??""}px;`),at(z,"src",H),at(z,"alt",e(B)),It(z,`translate: ${e(be)??""}px ${e(De)??""}px; transform: scale(${e(se)/100});`)},[()=>_e()]),gt("pointerdown",D,S),gt("pointermove",D,Te),gt("pointerup",D,d),rt("pointercancel",D,d),rt("lostpointercapture",D,d),l(t,a)},Le=t=>{const a=n(U);var u=je(),m=ne(u);Pr(m,()=>re()+e(a),h=>{Dr(h,{get sourceUrl(){return e(a)},get fileName(){return e(B)},get allowDownload(){return we()},get downloading(){return G()},onDownload:Z})}),l(t,u)},mt=t=>{var a=fo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=T(h),O=p(R);x(h),x(a),k((D,z)=>{g(m,e(B)),at(R,"src",D),g(O,` ${z??""}`)},[()=>W(),()=>c.editor_fileViewer_audioUnsupported_label()]),l(t,a)},Bt=t=>{var a=po(),u=p(T(a),2),m=F(u,!0),h=p(u,2);{let R=n(()=>!we()||G());Ce(h,{size:"sm",variant:"secondary",onclick:Z,get disabled(){return e(R)},children:(O,D)=>{var z=vo(),H=ne(z);et(H,{get icon(){return jt},size:"sm",class:"mr-2"});var xe=p(H);k(he=>g(xe,` ${he??""}`),[()=>c.editor_fileViewer_downloadPdf_label()]),l(O,z)},$$slots:{default:!0}})}x(a),k(R=>g(m,R),[()=>c.editor_fileViewer_pdfUnavailable_label()]),l(t,a)},Ot=t=>{{let a=n(()=>nt(y().toString()));ar(t,{get value(){return e(a)},language:"json",get fileName(){return re()},lineNumbers:!0,readOnly:!0})}},Oe=t=>{const a=n(()=>st(y().toString()));var u=ho(),m=T(u),h=T(m),R=T(h);Ct(R,23,()=>e(a)[0]||[],(D,z)=>`header-${z}-${D}`,(D,z)=>{var H=go(),xe=F(H,!0);k(()=>g(xe,e(z))),l(D,H)}),x(R),x(h);var O=p(h);Ct(O,23,()=>e(a).slice(1),(D,z)=>`row-${z}`,(D,z,H)=>{var xe=_o();Ct(xe,23,()=>e(z),(he,$e)=>`cell-${e(H)}-${$e}`,(he,$e)=>{var He=mo(),ke=F(He,!0);k(()=>g(ke,e($e))),l(he,He)}),x(xe),l(D,xe)}),x(O),x(m),x(u),l(t,u)},Xe=t=>{var a=wo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=F(h,!0);x(a),k(O=>{g(m,e(B)),g(R,O)},[()=>c.editor_fileViewer_archive_label()]),l(t,a)},Ht=t=>{var a=bo(),u=p(T(a),2),m=F(u,!0),h=p(u,2),R=F(h,!0);x(a),k(O=>{g(m,e(B)),g(R,O)},[()=>c.editor_fileViewer_binary_label()]),l(t,a)},Ft=t=>{{let a=n(()=>y().toString());ar(t,{get value(){return e(a)},get language(){return Pe()},get fileName(){return re()},lineNumbers:!0,highlightActiveLine:!0})}};Q(Ee,t=>{e(V)==="image"?t(Ve):e(V)==="svg"?t(fe,1):e(V)==="video"?t(Le,2):e(V)==="audio"?t(mt,3):e(V)==="pdf"?t(Bt,4):e(V)==="json"?t(Ot,5):e(V)==="csv"?t(Oe,6):e(V)==="archive"?t(Xe,7):e(V)==="binary"?t(Ht,8):t(Ft,-1)})}return x(ue),l(X,ue),Nt(ut)}Yr(["pointerdown","pointermove","pointerup"]);const yo=/access denied|permission denied|outside (?:the )?workspace/i,Po=/file not found|no such file or directory/i;function $o(X){return yo.test(X)?"access-denied":X===c.files_read_notFound_error()||Po.test(X)?"not-found":"generic"}function ko(X){switch(X){case"access-denied":return c.layout_fileTab_errorAccessDenied_label();case"not-found":return c.layout_fileTab_errorNotFound_label();case"generic":return c.layout_fileTab_errorGeneric_label()}}var Io=P("<!> <!>",1),Co=P("<!> <!> <!>",1),Fo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p> </p> <p class="text-xs"> </p></div>'),br=P('<div class="flex h-full items-center justify-center p-4 text-subtle"><p role="alert"> </p></div>'),So=P('<div class="flex h-full items-center justify-center text-subtle"><p> </p></div>'),xr=P('<div class="flex items-center justify-center h-full text-subtle"><p> </p></div>'),Do=P('<div class="flex items-center gap-3"><!> <!></div>'),To=P('<div class="flex flex-col h-full"><div class="flex-1 p-4 space-y-2"></div></div>'),Eo=P('<p class="text-xs"> </p>'),Ro=P("<li><!></li>"),Uo=P('<p class="text-xs mt-2"> </p> <ul class="flex flex-col items-center gap-1"></ul>',1),Mo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-2"><p class="text-danger" role="alert"> </p> <p class="text-xs font-mono"> </p> <!> <!></div>'),jo=P('<div class="flex flex-col items-center justify-center h-full text-subtle gap-3 p-4"><p> </p> <p class="text-xs break-all"> </p> <!></div>'),zo=P('<div class="h-full overflow-auto p-4"><!></div>');function Vo(X,w){if(new.target)return Vt({component:Vo,...X});Wt(w,!0);const ye=()=>ce(Ot,"$workspace",A),ot=()=>ce(_e,"$fileContentStore",A),re=()=>ce(E,"$fileLoadingStore",A),y=()=>ce(oe,"$fileSavingStore",A),ae=()=>ce(J,"$fileErrorStore",A),Pe=()=>ce(Z,"$fileErrorInfoStore",A),Fe=()=>ce(it,"$homeView$",A),we=()=>ce(nt,"$fileNotFoundCandidatesStore",A),ge=()=>ce(st,"$isFileBinaryStore",A),G=()=>ce(ut,"$isFileDirtyStore",A),Je=()=>ce(ue,"$fileLastUpdatedStore",A),V=()=>ce(Ee,"$ftChanges$",A),B=()=>ce(Bt,"$gutterRead$",A),se=()=>ce(ze,"$lineWrapping",A),me=()=>ce(Be,"$diffIndicators",A),Se=()=>ce(Le,"$rootMediaPreview",A),[A,be]=ir(),De=r=>{var s=Io(),$=ne(s);{var C=de=>{var Ae=je(),qe=ne(Ae);Rt(qe,()=>Ut,(pt,xt)=>{xt(pt,{get icon(){return Ua},get label(){return e(he)},disabled:!0})}),l(de,Ae)};Q($,de=>{!e(_t)&&!e(b)&&!e(z)&&de(C)})}var le=p($,2);{var Re=de=>{{let Ae=n(()=>!e(Tt)||!e(Ye)),qe=n(()=>!e(b)&&(!e(Tt)||!e(Ye)));Ha(de,{embedded:!0,showFold:!1,showSplit:!1,get showPreview(){return e(Tt)},get previewEnabled(){return e(Ye)},onTogglePreview:()=>f(Ye,!e(Ye)),get showWrap(){return e(Ae)},get wrapEnabled(){return se()},onToggleWrap:()=>j.dispatch(sa()),get showDiff(){return e(qe)},get diffEnabled(){return me()},onToggleDiff:()=>j.dispatch(na())})}};Q(le,de=>{o().filePath&&!e(_t)&&!e(z)&&de(Re)})}l(r,s)},Ne=r=>{var s=je(),$=ne(s);{var C=le=>{var Re=Co(),de=ne(Re);{var Ae=We=>{var Ge=je(),dt=ne(Ge);{let yt=n(()=>c.layout_fileTab_goToChanges_tooltip());Rt(dt,()=>Ut,(Pt,$t)=>{$t(Pt,{get icon(){return ja},get label(){return e(yt)},onclick:Lr})})}l(We,Ge)};Q(de,We=>{e(Rr)&&We(Ae)})}var qe=p(de,2);{var pt=We=>{var Ge=je(),dt=ne(Ge);{let yt=n(()=>c.layout_fileTab_downloadFile_label()),Pt=n(()=>!e(wt)||e(lt));Rt(dt,()=>Ut,($t,Jt)=>{Jt($t,{get icon(){return jt},get label(){return e(yt)},onclick:Et,get disabled(){return e(Pt)}})})}l(We,Ge)};Q(qe,We=>{e(Qe)&&We(pt)})}var xt=p(qe,2);{let We=n(()=>c.layout_fileTab_deleteFile_tooltip());Rt(xt,()=>Ut,(Ge,dt)=>{dt(Ge,{get icon(){return Ma},get label(){return e(We)},onclick:Ar,destructive:!0})})}l(le,Re)};Q($,le=>{o().filePath&&!e(_t)&&!e(b)&&le(C)})}l(r,s)},ze=qa(),Be=Ka();let o=ee(w,"tab",7),i=ee(w,"workspaceId",7),S=ee(w,"isActive",7),Te=ee(w,"isPanelFocused",7);pe(()=>{const r=i();if(!(!S()||!r||e(d)))return j.dispatch(ra(r,"files")),()=>j.dispatch(aa(r,"files"))});const d=n(()=>typeof o().data?.gitRootId=="string"?o().data.gitRootId:void 0),I=n(()=>typeof o().data?.gitRootPath=="string"?o().data.gitRootPath:void 0),b=n(()=>!!e(d)),W=n(()=>o().filePath?Ca(o().filePath,e(d)):o().filePath),U=Gr(e(W));pe(()=>{U.set(e(W))});const _e=ga(i(),U),E=ma(i(),U),oe=_a(i(),U),J=ha(i(),U),Z=wa(i(),U),it=Qa(i()),nt=ba(i(),U),st=xa(i(),U),ut=_r(i(),U),ue=ya(i(),U),Ee=Pa(i()),Ve=pa(),fe=crypto.randomUUID(),Le=Sr(fe),mt=`file-gutter:${crypto.randomUUID()}`,Bt=$a(i(),mt),Ot=ka(i()),Oe=n(()=>ye()?.worktreePath||ye()?.repositoryPath||ye()?.path||null),Xe=n(ot),Ht=Xa();pe(()=>{e(Xe)!==null&&e(Xe)!==void 0&&Ht?.markContentLoaded()});const Ft=n(re),t=n(y),a=n(ae),u=n(()=>e(a)?$o(e(a)):"generic"),m=n(()=>e(a)?Ga(Pe()):null);let h=N(0),R=!1;pe(()=>{const r=Fe();if(!r||r.unavailable){R=!1;return}e(m)&&!R&&(R=!0,rr(()=>Mt(h)))});const O=5,D=n(()=>(we()??[]).slice(0,O)),z=n(ge),H=n(G),xe=n(Je),he=n(()=>e(t)?c.ui_saveIndicator_saving_tooltip():e(H)?c.ui_saveIndicator_autoSaving_tooltip():c.ui_saveIndicator_saved_tooltip());let $e=N(null),He=N(Zr([])),ke=N(null),St=N(void 0),Dt=N(void 0),Ye=N(!0);pe(()=>{const r=o().data?.line,s=o().data?.jumpTimestamp;!r||s!==void 0&&s===e(Dt)||(f(Dt,s,!0),f(St,{line:r},!0),f(Ye,!1))});const Ie=n(()=>e(d)?hr(o().filePath,e(I)):null),_t=n(()=>e(d)?!e(Ie):!!(o().filePath&&(Wa(o().filePath)||e(Oe)&&Na(o().filePath,e(Oe))))),ht=n(()=>o().filePath&&e(Oe)?er(o().filePath)?o().filePath:`${e(Oe)}/${o().filePath}`:null),ft=n(()=>!!o().filePath&&/\.pdf$/i.test(o().filePath)),vt=n(()=>!!o().filePath&&/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(o().filePath)),Qe=n(()=>i()&&/^[A-Za-z0-9._-]+$/.test(i())?hr(o().filePath,e(Oe)):null),Tr=n(()=>!e(d)&&e(Qe)?e(Qe).split("/").slice(0,-1).join("/"):void 0),qt=n(()=>e(ft)||e(vt)?e(Qe):null),nr=n(()=>e(d)&&e(vt)?{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",mp4:"video/mp4",webm:"video/webm"}[o().filePath?.split(".").pop()?.toLowerCase()??""]:void 0);pe(()=>{if(!S()||!e(d)||!e(Ie)||!e(nr))return;const r=crypto.randomUUID();return j.dispatch(Ir(fe,r,i(),e(Ie),{gitRootId:e(d),mimeType:e(nr)})),()=>j.dispatch(Cr(fe,r))});let lt=N(!1);const wt=n(()=>!!e(Qe)&&!e(Ft)&&(!e(vt)||e(ke)===e(Qe))),sr=n(()=>e(ke)&&i()?`workspace-file://${i()}/${e(ke).split("/").map(encodeURIComponent).join("/")}`:null),Kt=n(()=>o().filePath?ca(o().filePath):"plaintext"),Tt=n(()=>e(Kt)==="markdown");pe(()=>{if(!S()||e(ft)||e(d))return;const r=e(qt),s=o().filePath,$=i(),C=o().id;if(f(ke,null),!r||!s||!$)return;let le=!1;const Re=()=>!le&&i()===$&&o().id===C&&o().filePath===s;return(async()=>{let de=!1;try{de=(await Fa("file.stat",{workspaceId:$,path:r}))?.isFile===!0}catch{}if(!Re())return;if(de){f(ke,r,!0);return}if(!/\.(?:png|jpe?g|gif|webp|mp4|webm)$/i.test(r)){f(ke,r,!0);return}const{candidates:Ae,truncated:qe}=await Aa($,r);if(Re()){if(!qe&&Ae.length===1){j.dispatch(vr($,s,Ae[0],C));return}f(ke,r,!0)}})(),()=>{le=!0}});function Er(r,s){return!!(r.file===s||r.relativePath===s||r.relativePath&&s.endsWith("/"+r.relativePath)||r.file&&s.endsWith("/"+r.file)||r.relativePath&&r.relativePath.endsWith("/"+s)||r.file&&r.file.endsWith("/"+s))}const bt=n(()=>e(b)||!o().filePath?null:V().find(r=>Er(r,o().filePath))??null),Rr=n(()=>!!e(bt));pe(()=>{if(e(b))return;const r=i(),s=o().filePath,$=e(Oe);return()=>{if(!r||!s)return;const C=Zt.select(j.state,r,s);if(C?.kind!=="editable-text")return;const le=Gt(C.localContent),Re=_r.select(j.state,r,s),de=er(s)?s:$?`${$}/${s}`:null;Re&&de&&j.dispatch(pr(r,s,de,le))}}),pe(()=>{const r=o().filePath,s=e(ht),$=i();if(e(h),!S())return;const C=!e(d)&&!!r&&er(r)&&!e(Oe);r&&$&&!e(_t)&&!e(vt)&&!e(ft)&&!C&&(e(d)&&e(Ie)&&e(W)?j.dispatch(gr($,e(W),s??r,{gitRoot:{id:e(d),relativePath:e(Ie)}})):j.dispatch(gr($,r,s??r)))});function Ur(){return e(Xe)??""}function Mr(r){e(b)||e(z)||!o().filePath||!i()||!e(ht)||j.dispatch(va(i(),o().filePath,Gt(r)))}function jr(){if(e(b)||e(z)||!o().filePath||!e(ht)||e(Xe)===null||e(t))return;const r=Zt.select(j.state,i(),o().filePath);r?.kind==="editable-text"&&j.dispatch(pr(i(),o().filePath,e(ht),Gt(r.localContent)))}function zr(r){const s=o().filePath;!s||!i()||(j.dispatch(fa(i(),s)),j.dispatch(vr(i(),s,r,o().id)))}pe(()=>{const r=o().filePath,s=e(bt);if(!r||!s){f(He,[],!0);return}if(!S())return;const $=i(),C=crypto.randomUUID();return j.dispatch(oa($,mt,C,{kind:"diffs",path:r,staged:s.stage==="staged"})),()=>{j.dispatch(ia($,mt,C))}}),pe(()=>{const r=B(),s=r?.result?.kind==="diffs"?r.result.chunks:[],$=s.find(C=>C.file===o().filePath)??s[0];f(He,$?Ba($.chunks.map(C=>({oldStart:C.oldStart,oldLines:C.oldLines,newStart:C.newStart,newLines:C.newLines,lines:C.lines.map(le=>(le.type===mr.Addition?"+":le.type===mr.Deletion?"-":" ")+le.content)}))):[],!0)});function Vr(r){const s=/Mac|iPhone|iPad|iPod/.test(navigator.userAgent),$=Re=>Qr(r,Ja(Re),s);if($("editor.save")){r.preventDefault(),e(H)&&!e(t)&&jr();return}const C=$("editor.undo")?"undo":$("editor.redo")?"redo":$("editor.toggle-task-list")?"toggle-task-list":$("editor.copy")?"copy":$("editor.select-all")?"select-all":null;if(!C||e(b)&&C!=="copy"&&C!=="select-all")return;C!=="toggle-task-list"&&e($e)?.runShortcut(C)&&r.preventDefault()}function Lr(r){if(!o().filePath||!e(bt))return;const s=r?.metaKey||r?.ctrlKey||!1,C=r?.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0;j.dispatch(ua(i(),e(bt),{filePath:o().filePath,changeId:e(bt).id,openInAdjacentPanel:s,sourcePanelId:C}))}async function Et(){const r=e(Qe);if(!(e(b)||!r||!i()||!e(wt)||e(lt))){f(lt,!0);try{const s=await Ia(i(),r,e(Oe));!s?.success&&!s?.canceled&&Qt.error(s?.error?.message||c.layout_fileTab_downloadFailed_error())}catch{Qt.error(c.layout_fileTab_downloadFailed_error())}finally{f(lt,!1)}}}function Ar(){const r=e(ht);if(e(b)||!o().filePath||!i()||!r)return;const s=la(Zt.select(j.state,i(),o().filePath));if(!s){Qt.error(c.ui_reversibleActions_failed_error({message:c.fileExplorer_tree_undoUnavailable_error()}));return}j.dispatch(da(i(),o().filePath,{absolutePath:r,tabId:o().id,snapshot:s}))}pe(()=>{if(!Ve||!S())return;const r={isDirty:!e(b)&&e(H),isSaving:!e(b)&&e(t)};rr(()=>{Ve.registerActions({display:De,actions:Ne}),Ve.registerState(r)})});var Wr={get tab(){return o()},set tab(r){o(r),te()},get workspaceId(){return i()},set workspaceId(r){i(r),te()},get isActive(){return S()},set isActive(r){S(r),te()},get isPanelFocused(){return Te()},set isPanelFocused(r){Te(r),te()},$set:Lt,$on:(r,s)=>At(w,r,s)},lr=je();rt("keydown",yr,r=>S()&&Vr(r));var Nr=ne(lr);{var Br=r=>{var s=je(),$=ne(s);Pr($,()=>o().filePath,C=>{var le=je(),Re=ne(le);{var de=_=>{var v=Fo(),M=T(v),q=F(M,!0),L=p(M,2),Ue=F(L,!0);x(v),k(Y=>{g(q,Y),g(Ue,o().filePath)},[()=>c.layout_fileTab_outsideWorkspace_label()]),l(_,v)},Ae=_=>{var v=je(),M=ne(v);{var q=L=>{or(L,{get workspaceId(){return i()},get filePath(){return e(Ie)},get gitRootId(){return e(d)}})};Q(M,L=>{S()&&L(q)})}l(_,v)},qe=_=>{var v=je(),M=ne(v);{var q=Y=>{var K=br(),ie=T(K),Me=F(ie,!0);x(K),k(ve=>g(Me,ve),[()=>c.layout_fileTab_errorLoading_label()]),l(Y,K)},L=Y=>{zt(Y,{get filePath(){return o().filePath},get sourceUrl(){return Se().url},allowDownload:!1})},Ue=Y=>{var K=So(),ie=T(K),Me=F(ie,!0);x(K),k(ve=>g(Me,ve),[()=>c.layout_fileTab_preparing_label()]),l(Y,K)};Q(M,Y=>{Se()?.error?Y(q):Se()?.url?Y(L,1):Y(Ue,-1)})}l(_,v)},pt=_=>{var v=je(),M=ne(v);{var q=L=>{or(L,{get workspaceId(){return i()},get filePath(){return e(qt)}})};Q(M,L=>{S()&&L(q)})}l(_,v)},xt=_=>{var v=br(),M=T(v),q=F(M,!0);x(v),k(L=>g(q,L),[()=>c.file_pdf_load_error()]),l(_,v)},We=_=>{{let v=n(()=>e(ke)??o().filePath),M=n(()=>!e(b)&&e(wt));zt(_,{get filePath(){return e(v)},get sourceUrl(){return e(sr)},onDownload:Et,get allowDownload(){return e(M)},get downloading(){return e(lt)}})}},Ge=_=>{var v=xr(),M=T(v),q=F(M,!0);x(v),k(L=>g(q,L),[()=>c.layout_fileTab_preparing_label()]),l(_,v)},dt=_=>{var v=To(),M=T(v);Ct(M,20,()=>[...Array(20).keys()],q=>q,(q,L)=>{var Ue=Do(),Y=T(Ue);wr(Y,{class:"h-3 w-8 shrink-0"});var K=p(Y,2);wr(K,{class:"h-3",style:`width: ${30+Math.random()*60}%`}),x(Ue),l(q,Ue)}),x(M),x(v),l(_,v)},yt=_=>{{let v=n(()=>Za(e(m)));Ya(_,{get view(){return e(v)}})}},Pt=_=>{var v=Mo(),M=T(v),q=F(M,!0),L=p(M,2),Ue=F(L,!0),Y=p(L,2);{var K=ve=>{var Ke=Eo(),ct=F(Ke,!0);k(()=>g(ct,e(a))),l(ve,Ke)};Q(Y,ve=>{e(u)==="generic"&&ve(K)})}var ie=p(Y,2);{var Me=ve=>{var Ke=Uo(),ct=ne(Ke),Xt=F(ct,!0),dr=p(ct,2);Ct(dr,20,()=>e(D),kt=>kt,(kt,cr)=>{var Yt=Ro(),qr=T(Yt);Ce(qr,{variant:"link",size:"compact",class:"h-auto p-0 font-mono text-xs",onclick:()=>zr(cr),children:(Kr,Lo)=>{Ze();var ur=tt();k(()=>g(ur,cr)),l(Kr,ur)},$$slots:{default:!0}}),x(Yt),l(kt,Yt)}),x(dr),k(kt=>g(Xt,kt),[()=>c.layout_fileTab_didYouMean_label()]),l(ve,Ke)};Q(ie,ve=>{e(D).length>0&&ve(Me)})}x(v),k(ve=>{g(q,ve),g(Ue,o().filePath)},[()=>ko(e(u))]),l(_,v)},$t=_=>{var v=jo(),M=T(v),q=F(M,!0),L=p(M,2),Ue=F(L,!0),Y=p(L,2);{var K=ie=>{{let Me=n(()=>!e(wt)||e(lt));Ce(ie,{variant:"secondary",size:"sm",onclick:Et,get disabled(){return e(Me)},children:(ve,Ke)=>{Ze();var ct=tt();k(Xt=>g(ct,Xt),[()=>c.layout_fileTab_downloadFile_label()]),l(ve,ct)},$$slots:{default:!0}})}};Q(Y,ie=>{!e(b)&&e(Qe)&&ie(K)})}x(v),k(ie=>{g(q,ie),g(Ue,o().filePath)},[()=>c.editor_fileViewer_binary_label()]),l(_,v)},Jt=_=>{const v=n(()=>o().filePath?.toLowerCase().endsWith(".svg"));var M=je(),q=ne(M);{var L=K=>{{let ie=n(()=>o().filePath||""),Me=n(()=>!e(b)&&e(wt));zt(K,{get filePath(){return e(ie)},get fileContent(){return e(Xe)},get language(){return e(Kt)},get isBinary(){return e(z)},onDownload:Et,get allowDownload(){return e(Me)},get downloading(){return e(lt)}})}},Ue=K=>{var ie=zo(),Me=T(ie);Oa(Me,{get content(){return e(Xe)},get workspaceId(){return i()},get relativeMediaBase(){return e(Tr)},renderRichFencesAsCode:!0,renderDiagrams:!0}),x(ie),l(K,ie)},Y=K=>{var ie=Ur,Me=Mr;{let ve=n(()=>me()?e(He):[]);$r(ar(K,{get value(){return ie()},set value(Ke){Me(Ke)},get language(){return e(Kt)},get readOnly(){return e(b)},get fileName(){return o().filePath},get workspaceId(){return i()},get filePath(){return o().filePath},get lineWrapping(){return se()},get lineChanges(){return e(ve)},get jumpTo(){return e(St)},get externalContentVersion(){return e(xe)},get isPanelFocused(){return Te()}}),Ke=>f($e,Ke,!0),()=>e($e))}};Q(q,K=>{e(v)?K(L):e(Tt)&&e(Ye)?K(Ue,1):K(Y,-1)})}l(_,M)},Hr=_=>{var v=xr(),M=T(v),q=F(M,!0);x(v),k(L=>g(q,L),[()=>c.layout_fileTab_preparing_label()]),l(_,v)};Q(Re,_=>{e(_t)?_(de):e(d)&&e(ft)&&e(Ie)?_(Ae,1):e(d)&&e(vt)?_(qe,2):e(ft)&&e(qt)?_(pt,3):e(ft)?_(xt,4):e(sr)?_(We,5):e(vt)?_(Ge,6):e(Ft)?_(dt,7):e(m)?_(yt,8):e(a)?_(Pt,9):e(z)?_($t,10):e(Xe)!==null?_(Jt,11):_(Hr,-1)})}l(C,le)}),l(r,s)};Q(Nr,r=>{o().filePath&&r(Br)})}l(X,lr);var Or=Nt(Wr);return be(),Or}export{Vo as default};