@intent-hq/web 2.375.1 → 2.376.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 (324) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{Dn-hGN0g.js → -Hb5Lymn.js} +1 -1
  3. package/web/app/immutable/chunks/{C9EedYBu.js → -SrZYziV.js} +1 -1
  4. package/web/app/immutable/chunks/{DKUOdUyV.js → 0rEEjvhW.js} +1 -1
  5. package/web/app/immutable/chunks/{DVcCnfZH.js → 0vLUv3ld.js} +1 -1
  6. package/web/app/immutable/chunks/1KDVFF23.js +1 -0
  7. package/web/app/immutable/chunks/{ChGLvrw4.js → 1_Sb4Kkv.js} +4 -4
  8. package/web/app/immutable/chunks/{Xgzrv-dN.js → 1wMLd-77.js} +1 -1
  9. package/web/app/immutable/chunks/{BX9IoE2d.js → 26zQgwyJ.js} +1 -1
  10. package/web/app/immutable/chunks/{DSiF4FpM.js → 2WaF6vs_.js} +1 -1
  11. package/web/app/immutable/chunks/{Bd6SODL5.js → 471Fgn_p.js} +1 -1
  12. package/web/app/immutable/chunks/{BE5ZU7pI.js → 5II1c2xL.js} +1 -1
  13. package/web/app/immutable/chunks/{DqujvsHK.js → 5IrgxRfr.js} +1 -1
  14. package/web/app/immutable/chunks/{DNozBV3M.js → 6529TVsv.js} +1 -1
  15. package/web/app/immutable/chunks/{Cpr2SOSC.js → 6FXzbKIf.js} +1 -1
  16. package/web/app/immutable/chunks/{DgiJ63hc.js → 7FS8g33K.js} +3 -3
  17. package/web/app/immutable/chunks/{CberoJl6.js → 7IpY0EgW.js} +1 -1
  18. package/web/app/immutable/chunks/{DY61j2wq.js → 7n3mxV6t.js} +1 -1
  19. package/web/app/immutable/chunks/{B_jbAa0I.js → 8PIbpdJu.js} +1 -1
  20. package/web/app/immutable/chunks/{B4SJ0wZk.js → 8VOCP3Xx.js} +1 -1
  21. package/web/app/immutable/chunks/{t4bVJhrn.js → 9Fwj-RCt.js} +4 -4
  22. package/web/app/immutable/chunks/{Jcrj5YZi.js → 9IHp8VDb.js} +1 -1
  23. package/web/app/immutable/chunks/{hK5d1dQ0.js → Aa4mTk2-.js} +1 -1
  24. package/web/app/immutable/chunks/{DV_Q2hiQ.js → B-lpv6Gv.js} +2 -2
  25. package/web/app/immutable/chunks/{DoQnqQZn.js → B4ot6F6B.js} +1 -1
  26. package/web/app/immutable/chunks/{B4n9OEnJ.js → B4wiFjXK.js} +1 -1
  27. package/web/app/immutable/chunks/B61tWwOC.js +1 -0
  28. package/web/app/immutable/chunks/{CM4xaytB.js → B6Zf-ZTX.js} +1 -1
  29. package/web/app/immutable/chunks/{DODG7FHv.js → B7o1DJo9.js} +1 -1
  30. package/web/app/immutable/chunks/{D3HVFnZe.js → B8tcC_lC.js} +1 -1
  31. package/web/app/immutable/chunks/{67uMgcnU.js → B9F4r5fH.js} +1 -1
  32. package/web/app/immutable/chunks/{BepABSAk.js → B9nat7hx.js} +1 -1
  33. package/web/app/immutable/chunks/{CtX28OJm.js → BA7mfVzm.js} +1 -1
  34. package/web/app/immutable/chunks/{CXjIzVpl.js → BGMy2Ryn.js} +1 -1
  35. package/web/app/immutable/chunks/{Dqtmunn7.js → BH4muXHE.js} +5 -5
  36. package/web/app/immutable/chunks/{Ds6Uj2aI.js → BIGkxv6Q.js} +1 -1
  37. package/web/app/immutable/chunks/{BWtq4mC4.js → BIwMjRQQ.js} +1 -1
  38. package/web/app/immutable/chunks/{CzEqpD5b.js → BLNcc2k4.js} +1 -1
  39. package/web/app/immutable/chunks/{CkRR8JwL.js → BLSHNn4a.js} +1 -1
  40. package/web/app/immutable/chunks/{jG67l4Uo.js → BLYYB2Pl.js} +2 -2
  41. package/web/app/immutable/chunks/{BbzFLKZE.js → BMScw2DS.js} +1 -1
  42. package/web/app/immutable/chunks/{gsUgKMwT.js → BMfUzLG6.js} +1 -1
  43. package/web/app/immutable/chunks/{B6CxzJhM.js → BOLzaoLg.js} +1 -1
  44. package/web/app/immutable/chunks/{mM-wy2h5.js → BP7XtCsE.js} +1 -1
  45. package/web/app/immutable/chunks/{NgEAPl8f.js → BPo1GPk4.js} +2 -2
  46. package/web/app/immutable/chunks/{BKPOvbtV.js → BPx3dFHu.js} +1 -1
  47. package/web/app/immutable/chunks/{DD_c8x6U.js → BQ5vM4FB.js} +2 -2
  48. package/web/app/immutable/chunks/{DJuFWuFo.js → BVunuTwn.js} +1 -1
  49. package/web/app/immutable/chunks/{DaUQbJQJ.js → BWBQA0E0.js} +1 -1
  50. package/web/app/immutable/chunks/{E0KBz4I2.js → BXB-ioXM.js} +1 -1
  51. package/web/app/immutable/chunks/{MBA6k0j3.js → BYBN65Dm.js} +1 -1
  52. package/web/app/immutable/chunks/{Dv3EtVHJ.js → BYeDxl_R.js} +1 -1
  53. package/web/app/immutable/chunks/{CiD4x8Gl.js → BZytk_HL.js} +1 -1
  54. package/web/app/immutable/chunks/{B5CW3gDe.js → Ba4cYgvZ.js} +3 -3
  55. package/web/app/immutable/chunks/{D806p2LW.js → BaEFcPEE.js} +3 -3
  56. package/web/app/immutable/chunks/{-18XT1CI.js → BblwdMxR.js} +1 -1
  57. package/web/app/immutable/chunks/{DIylOQL5.js → BcEldzTj.js} +1 -1
  58. package/web/app/immutable/chunks/{CRl6sOjh.js → Bco7_wmI.js} +1 -1
  59. package/web/app/immutable/chunks/{DppdhMsn.js → Bcx8Sxo7.js} +1 -1
  60. package/web/app/immutable/chunks/{PZRS5x7m.js → Bek4Es60.js} +1 -1
  61. package/web/app/immutable/chunks/{CUXVMwZ6.js → BgttkbLb.js} +1 -1
  62. package/web/app/immutable/chunks/{kFANwwYX.js → BgxLwwHQ.js} +1 -1
  63. package/web/app/immutable/chunks/{5mmUTVhd.js → BjYingUt.js} +1 -1
  64. package/web/app/immutable/chunks/{Cn8hCY5y.js → BkLeC-gf.js} +2 -2
  65. package/web/app/immutable/chunks/{ClkC2csJ.js → BlXvVwTG.js} +1 -1
  66. package/web/app/immutable/chunks/{DK-vph3Z.js → Blp2y8Zh.js} +1 -1
  67. package/web/app/immutable/chunks/{Bk5eDkyv.js → BmNAS5xc.js} +1 -1
  68. package/web/app/immutable/chunks/{CZJDTQJi.js → Bo5PTszQ.js} +1 -1
  69. package/web/app/immutable/chunks/{BZSs3eKh.js → BoEPe-FL.js} +1 -1
  70. package/web/app/immutable/chunks/{DZ8q1fkg.js → BoT5B49_.js} +1 -1
  71. package/web/app/immutable/chunks/{CSbK1_CV.js → BpT_ybtH.js} +2 -2
  72. package/web/app/immutable/chunks/{eGxC9Zfx.js → Br9RT7xb.js} +1 -1
  73. package/web/app/immutable/chunks/{CF0098kp.js → BrRuqfTp.js} +1 -1
  74. package/web/app/immutable/chunks/{DZmV2kHY.js → Bs1drFy2.js} +1 -1
  75. package/web/app/immutable/chunks/{DgOwYCT0.js → BtT-JO5g.js} +1 -1
  76. package/web/app/immutable/chunks/{DRPKvmfX.js → BtgBrLqZ.js} +1 -1
  77. package/web/app/immutable/chunks/{Dgn5Otg4.js → Bu4YAtNq.js} +1 -1
  78. package/web/app/immutable/chunks/{C0JDt0nm.js → Bu8LYT1B.js} +2 -2
  79. package/web/app/immutable/chunks/{BCKmKE5y.js → BuFlry2f.js} +1 -1
  80. package/web/app/immutable/chunks/{DvOdp8Jx.js → Bv5YjDej.js} +1 -1
  81. package/web/app/immutable/chunks/{Db_i0IkD.js → BvKzoZLa.js} +1 -1
  82. package/web/app/immutable/chunks/{CMFbZICM.js → BvhuCBEE.js} +2 -2
  83. package/web/app/immutable/chunks/{ChoM6f6w.js → BvjVhe2e.js} +1 -1
  84. package/web/app/immutable/chunks/{Bu7GfLOK.js → BvvCJG4x.js} +1 -1
  85. package/web/app/immutable/chunks/{LAC4SG96.js → Bwl-WDiM.js} +1 -1
  86. package/web/app/immutable/chunks/{tnfQ532f.js → BxlVsP3O.js} +1 -1
  87. package/web/app/immutable/chunks/{BSroN1Rt.js → ByJyX5qZ.js} +1 -1
  88. package/web/app/immutable/chunks/{K7F-rH-C.js → C09ifoAC.js} +4 -4
  89. package/web/app/immutable/chunks/{Q5HWwxnx.js → C0kzahSL.js} +1 -1
  90. package/web/app/immutable/chunks/{vXh-PQQZ.js → C0nXBDlv.js} +1 -1
  91. package/web/app/immutable/chunks/{DuPkRrZF.js → C2VSMRVU.js} +1 -1
  92. package/web/app/immutable/chunks/{B9-EoZ1p.js → C3FNiYoh.js} +1 -1
  93. package/web/app/immutable/chunks/{DINI7WNX.js → C3iIVLbv.js} +1 -1
  94. package/web/app/immutable/chunks/{LDe4IsYZ.js → C4MiITEz.js} +1 -1
  95. package/web/app/immutable/chunks/{TodMLsNs.js → C54d-qnB.js} +1 -1
  96. package/web/app/immutable/chunks/{D_Y9WK2x.js → C71BdIUW.js} +1 -1
  97. package/web/app/immutable/chunks/{iwQqOlmN.js → C7Ibt0hX.js} +1 -1
  98. package/web/app/immutable/chunks/{fXti0RCR.js → C7hm9bSX.js} +1 -1
  99. package/web/app/immutable/chunks/{CiJWG6bO.js → C82gBCX8.js} +1 -1
  100. package/web/app/immutable/chunks/{BmC0p6X8.js → CALsJq65.js} +1 -1
  101. package/web/app/immutable/chunks/{C-nutp9J.js → CB9DABC0.js} +1 -1
  102. package/web/app/immutable/chunks/{CnMgdwKG.js → CBLFNmYJ.js} +1 -1
  103. package/web/app/immutable/chunks/{DaysnCXK.js → CBmGf0Ke.js} +1 -1
  104. package/web/app/immutable/chunks/{gcpLbmeh.js → CCEqDzPP.js} +1 -1
  105. package/web/app/immutable/chunks/{C5l6D9GX.js → CClsvy7n.js} +1 -1
  106. package/web/app/immutable/chunks/{CpYW1yE7.js → CDeldaOF.js} +2 -2
  107. package/web/app/immutable/chunks/{CFqcGY4P.js → CEgHOs22.js} +1 -1
  108. package/web/app/immutable/chunks/{GlvfRTgI.js → CEqmtghP.js} +1 -1
  109. package/web/app/immutable/chunks/{RLFGU-s6.js → CFLXlno6.js} +1 -1
  110. package/web/app/immutable/chunks/{kuwy0JZA.js → CHHUtp07.js} +1 -1
  111. package/web/app/immutable/chunks/{BmEIQ8E-.js → CHzHsjlJ.js} +1 -1
  112. package/web/app/immutable/chunks/{Zw1KxEm0.js → CIzlkLuu.js} +1 -1
  113. package/web/app/immutable/chunks/{D5HhSqbc.js → CJJ2D2db.js} +1 -1
  114. package/web/app/immutable/chunks/{DGlNRMU1.js → CJh_F--P.js} +2 -2
  115. package/web/app/immutable/chunks/{CyaIe0jD.js → CJpjySL_.js} +1 -1
  116. package/web/app/immutable/chunks/{Cy9qAjIU.js → CL6yJ0UM.js} +1 -1
  117. package/web/app/immutable/chunks/{qPYbzgcC.js → CMgAi196.js} +1 -1
  118. package/web/app/immutable/chunks/{LGfIT3MS.js → CN0Csvus.js} +3 -3
  119. package/web/app/immutable/chunks/{Ctusnxiu.js → CN9rXc7J.js} +1 -1
  120. package/web/app/immutable/chunks/{Ilt_8E2i.js → COhzmnEo.js} +1 -1
  121. package/web/app/immutable/chunks/{D1HPSWvP.js → CPCza4LC.js} +1 -1
  122. package/web/app/immutable/chunks/{IVk1JAtP.js → CPEu2Vil.js} +1 -1
  123. package/web/app/immutable/chunks/{DSiZ9qTg.js → CQQvsDes.js} +1 -1
  124. package/web/app/immutable/chunks/{Cq76BY90.js → CQww8mRz.js} +1 -1
  125. package/web/app/immutable/chunks/{MyWfy8xc.js → CRWeEeIp.js} +1 -1
  126. package/web/app/immutable/chunks/{uE6SDSU_.js → CSepGuJ-.js} +1 -1
  127. package/web/app/immutable/chunks/{Byjmi-8z.js → CSp6HTdW.js} +2 -2
  128. package/web/app/immutable/chunks/CT6GHk2v.js +1 -0
  129. package/web/app/immutable/chunks/{BxVNHcGR.js → CTDEoCzv.js} +1 -1
  130. package/web/app/immutable/chunks/{oJ_ZL_ms.js → CToFQRbb.js} +1 -1
  131. package/web/app/immutable/chunks/{alEgYZuT.js → CUUAtNdA.js} +1 -1
  132. package/web/app/immutable/chunks/{C58p8xFm.js → CWFWI1JB.js} +1 -1
  133. package/web/app/immutable/chunks/{CFhbo3o1.js → CX9_bRjk.js} +1 -1
  134. package/web/app/immutable/chunks/{D1JjMDax.js → CYCawVEx.js} +1 -1
  135. package/web/app/immutable/chunks/{DzVqblgy.js → C_BHeuK7.js} +1 -1
  136. package/web/app/immutable/chunks/{DuDStABj.js → Ca9qLvAG.js} +1 -1
  137. package/web/app/immutable/chunks/{6JKrky9_.js → CbnYiL9b.js} +1 -1
  138. package/web/app/immutable/chunks/{CBl7oWeN.js → Cbu0O7F_.js} +1 -1
  139. package/web/app/immutable/chunks/{CHUCX9T6.js → CdgNuFkc.js} +1 -1
  140. package/web/app/immutable/chunks/{DZCvTRBp.js → CdpTO1ew.js} +1 -1
  141. package/web/app/immutable/chunks/{pZsrsFnW.js → CeWlRIsm.js} +1 -1
  142. package/web/app/immutable/chunks/{CHLHWub0.js → CfCk_l9B.js} +1 -1
  143. package/web/app/immutable/chunks/{DgH7yAy-.js → Cfy5Crpr.js} +1 -1
  144. package/web/app/immutable/chunks/{DoIr8Q2r.js → Ch-pFfsN.js} +1 -1
  145. package/web/app/immutable/chunks/{SMT1sep4.js → CjCvg4fu.js} +1 -1
  146. package/web/app/immutable/chunks/{DgaiTQpw.js → CjK2zm52.js} +1 -1
  147. package/web/app/immutable/chunks/{qkmjEtXH.js → CkmjUBxn.js} +3 -3
  148. package/web/app/immutable/chunks/{BJuNVIII.js → CkrblKaH.js} +1 -1
  149. package/web/app/immutable/chunks/{gSg6l32T.js → CmdE1AJL.js} +1 -1
  150. package/web/app/immutable/chunks/{C44hzh9R.js → CntPxeXh.js} +1 -1
  151. package/web/app/immutable/chunks/{1KCpY35B.js → Co4Bm5eY.js} +1 -1
  152. package/web/app/immutable/chunks/{C_GpcLP2.js → CqlSBroo.js} +1 -1
  153. package/web/app/immutable/chunks/{B4mmdCiF.js → CqsFOLCu.js} +1 -1
  154. package/web/app/immutable/chunks/{xS3xfMki.js → Csv5_672.js} +1 -1
  155. package/web/app/immutable/chunks/{C-7W2F0B.js → CtawaW2N.js} +1 -1
  156. package/web/app/immutable/chunks/{D6GBnYDv.js → CtguhKZB.js} +1 -1
  157. package/web/app/immutable/chunks/{C-JwFHXS.js → CuAAvi1f.js} +1 -1
  158. package/web/app/immutable/chunks/{DHqMqA41.js → CvZrEuUX.js} +1 -1
  159. package/web/app/immutable/chunks/{BlyKuyB7.js → CwQIGTQ1.js} +1 -1
  160. package/web/app/immutable/chunks/{C7Uh4cHO.js → CxfmOiQr.js} +1 -1
  161. package/web/app/immutable/chunks/{DyiA0AJU.js → D-7b6BAb.js} +1 -1
  162. package/web/app/immutable/chunks/{B3fU6XQp.js → D-rGNJzU.js} +1 -1
  163. package/web/app/immutable/chunks/{P3O1Bi5N.js → D1FftGj7.js} +1 -1
  164. package/web/app/immutable/chunks/{YfYAjqUM.js → D283eGmG.js} +1 -1
  165. package/web/app/immutable/chunks/{l4TJFOXC.js → D3GrssRa.js} +1 -1
  166. package/web/app/immutable/chunks/{DJ2vnC9G.js → D4EwlENg.js} +1 -1
  167. package/web/app/immutable/chunks/{BDXSQt10.js → D4XPYll-.js} +2 -2
  168. package/web/app/immutable/chunks/{BDsVnMYl.js → D7VeTrYO.js} +1 -1
  169. package/web/app/immutable/chunks/{BkLJnbD1.js → D7vAVIvz.js} +1 -1
  170. package/web/app/immutable/chunks/{D85P44Dj.js → D8B7qxXm.js} +1 -1
  171. package/web/app/immutable/chunks/{B_3JIPw3.js → DBI3WymG.js} +1 -1
  172. package/web/app/immutable/chunks/{LNZr9DCJ.js → DHSWOw-U.js} +1 -1
  173. package/web/app/immutable/chunks/{C6GJZLOP.js → DHbv9I-C.js} +1 -1
  174. package/web/app/immutable/chunks/{D_otNUZh.js → DJk5np0g.js} +1 -1
  175. package/web/app/immutable/chunks/{D-ls8znw.js → DKIi_opT.js} +1 -1
  176. package/web/app/immutable/chunks/{DUXVcIKV.js → DLMaiw5B.js} +1 -1
  177. package/web/app/immutable/chunks/{5uDsFopc.js → DM4cCUDd.js} +1 -1
  178. package/web/app/immutable/chunks/{DXwcjaPR.js → DM81x_EL.js} +2 -2
  179. package/web/app/immutable/chunks/{H3ekn9Mt.js → DMdq0QC2.js} +1 -1
  180. package/web/app/immutable/chunks/{kFRDyP-N.js → DPF9_zKV.js} +1 -1
  181. package/web/app/immutable/chunks/{C6jYe9up.js → DPLDRqMC.js} +1 -1
  182. package/web/app/immutable/chunks/{BO3WriTy.js → DPbnmxjX.js} +1 -1
  183. package/web/app/immutable/chunks/{CBtQnhwT.js → DPztwkUP.js} +1 -1
  184. package/web/app/immutable/chunks/{BYC0ucSR.js → DQlLBrpj.js} +1 -1
  185. package/web/app/immutable/chunks/{mdoDOmuU.js → DQmW4_9G.js} +1 -1
  186. package/web/app/immutable/chunks/{DzfHkSZF.js → DS5B84mn.js} +1 -1
  187. package/web/app/immutable/chunks/{P-zm4ktU.js → DSvyONiq.js} +1 -1
  188. package/web/app/immutable/chunks/{jaSHlZjt.js → DT8FaJbg.js} +1 -1
  189. package/web/app/immutable/chunks/{CGG7txTQ.js → DTpQzThG.js} +1 -1
  190. package/web/app/immutable/chunks/{BTKPx9nP.js → DTzE7g9m.js} +3 -3
  191. package/web/app/immutable/chunks/{BIo9gpGl.js → DUT4xhYi.js} +1 -1
  192. package/web/app/immutable/chunks/{D6YX_GFv.js → DVok8lSR.js} +1 -1
  193. package/web/app/immutable/chunks/{Bl8fHOk-.js → DXQ7EI2S.js} +1 -1
  194. package/web/app/immutable/chunks/{CdvXSvOC.js → DX_ZPiRZ.js} +1 -1
  195. package/web/app/immutable/chunks/{DgIh2Fs6.js → DXf8KXiZ.js} +1 -1
  196. package/web/app/immutable/chunks/{COUB9dHY.js → DYGC3eZn.js} +1 -1
  197. package/web/app/immutable/chunks/{BrFnR1vI.js → DZbKPa1t.js} +1 -1
  198. package/web/app/immutable/chunks/{U6kzE96u.js → D_fLfdMn.js} +1 -1
  199. package/web/app/immutable/chunks/{PCtwJJ25.js → D_xvUCUD.js} +1 -1
  200. package/web/app/immutable/chunks/{DoA3JmdK.js → DbSttgXv.js} +1 -1
  201. package/web/app/immutable/chunks/{3rxHCGTW.js → DcZr-m_l.js} +1 -1
  202. package/web/app/immutable/chunks/{a-OtAcF_.js → Dec_LXa-.js} +3 -3
  203. package/web/app/immutable/chunks/{CqJcYBUx.js → DfXFG9So.js} +1 -1
  204. package/web/app/immutable/chunks/{B7ydANq7.js → Dfq_rEeO.js} +1 -1
  205. package/web/app/immutable/chunks/{BowQ7sBM.js → DgV330Oe.js} +1 -1
  206. package/web/app/immutable/chunks/{grQh-L5q.js → DgaQFJ1C.js} +2 -2
  207. package/web/app/immutable/chunks/{CYWgGrsf.js → Dh_eorhd.js} +1 -1
  208. package/web/app/immutable/chunks/{ChJ4msi3.js → Dhj-Oo-y.js} +1 -1
  209. package/web/app/immutable/chunks/{CBHXSekd.js → DiEy7mCR.js} +1 -1
  210. package/web/app/immutable/chunks/{F-NRzkEu.js → DiLFzwi3.js} +1 -1
  211. package/web/app/immutable/chunks/{Bb_mQye1.js → Div7CQPf.js} +1 -1
  212. package/web/app/immutable/chunks/{DK3AlKip.js → DjBxG6q0.js} +3 -3
  213. package/web/app/immutable/chunks/{D6hUzfgH.js → DjLLAN4K.js} +1 -1
  214. package/web/app/immutable/chunks/{o1gxvTJU.js → DjpjFygj.js} +1 -1
  215. package/web/app/immutable/chunks/{BifXEk-G.js → Dk0afiu6.js} +1 -1
  216. package/web/app/immutable/chunks/{BOsHJKjO.js → DkY0xIi7.js} +2 -2
  217. package/web/app/immutable/chunks/{CpV-ehZ5.js → DkYquFOp.js} +1 -1
  218. package/web/app/immutable/chunks/{DZBnfhEV.js → Dmy603At.js} +1 -1
  219. package/web/app/immutable/chunks/{DmQm2Dw6.js → DnUdAfCR.js} +1 -1
  220. package/web/app/immutable/chunks/{CFUDIGea.js → DopSRBlm.js} +1 -1
  221. package/web/app/immutable/chunks/{CQxAYjD7.js → DpMsJtM0.js} +1 -1
  222. package/web/app/immutable/chunks/{kZanyiqf.js → DpSAF6fh.js} +1 -1
  223. package/web/app/immutable/chunks/{XyC5Phh7.js → DpgIqMGp.js} +1 -1
  224. package/web/app/immutable/chunks/{aToNeEMa.js → DqPe5uyz.js} +1 -1
  225. package/web/app/immutable/chunks/{D_o67XD6.js → DtO0wAdA.js} +2 -2
  226. package/web/app/immutable/chunks/{Di9CSB6H.js → DtYDlbcb.js} +1 -1
  227. package/web/app/immutable/chunks/{Bw0E8D92.js → Dv6PZjTW.js} +1 -1
  228. package/web/app/immutable/chunks/{yqs-hTyP.js → DvwOszqf.js} +1 -1
  229. package/web/app/immutable/chunks/{Cin575hV.js → Dwb4ijU4.js} +1 -1
  230. package/web/app/immutable/chunks/{m8gDbIPC.js → DwhE2_yv.js} +2 -2
  231. package/web/app/immutable/chunks/{C1m4pSe1.js → DxrRvklK.js} +1 -1
  232. package/web/app/immutable/chunks/{D9JbOH_S.js → Dy7nbUgl.js} +1 -1
  233. package/web/app/immutable/chunks/{iykV4pvb.js → DyFc4NAd.js} +1 -1
  234. package/web/app/immutable/chunks/{DTutiDCZ.js → DzTe1W0Z.js} +1 -1
  235. package/web/app/immutable/chunks/{CFtfWLBC.js → Dzl5aoA8.js} +1 -1
  236. package/web/app/immutable/chunks/{CCEQVSjx.js → G4lPpFfF.js} +1 -1
  237. package/web/app/immutable/chunks/{BL39LNxU.js → IdqO6uHC.js} +1 -1
  238. package/web/app/immutable/chunks/{B5bnHhgO.js → J9vGyyn3.js} +1 -1
  239. package/web/app/immutable/chunks/{DbCeN0Lt.js → KImhPY_I.js} +1 -1
  240. package/web/app/immutable/chunks/{YbP7yBkb.js → LFlj1pUW.js} +1 -1
  241. package/web/app/immutable/chunks/{dqvdjjXR.js → LqBZITyo.js} +3 -3
  242. package/web/app/immutable/chunks/{4r36FIB7.js → MujvTDgv.js} +1 -1
  243. package/web/app/immutable/chunks/{QjNLPDal.js → Mw2Z7eLx.js} +1 -1
  244. package/web/app/immutable/chunks/{DyT0mOdr.js → NUgfgzzR.js} +4 -4
  245. package/web/app/immutable/chunks/{DfdqseMI.js → NzPgPyYa.js} +1 -1
  246. package/web/app/immutable/chunks/{CJZ6Gu1k.js → Ow3KARwj.js} +1 -1
  247. package/web/app/immutable/chunks/{DtBx3nLm.js → PD1TeEVF.js} +1 -1
  248. package/web/app/immutable/chunks/{ChbTF48b.js → PqstdoKv.js} +1 -1
  249. package/web/app/immutable/chunks/{BK0rB8kZ.js → Pqx84Da9.js} +1 -1
  250. package/web/app/immutable/chunks/{8TUe2kcz.js → PtMxuYy8.js} +1 -1
  251. package/web/app/immutable/chunks/Q-Hp56ht.js +6 -0
  252. package/web/app/immutable/chunks/{BjWOzuMm.js → QSHJFaU7.js} +4 -4
  253. package/web/app/immutable/chunks/{zrdFYBgX.js → Qzhec1TY.js} +1 -1
  254. package/web/app/immutable/chunks/{Cr9glZDh.js → Ro7n3ECj.js} +1 -1
  255. package/web/app/immutable/chunks/{BReER1n3.js → THm8CnE2.js} +1 -1
  256. package/web/app/immutable/chunks/{S7_elIn6.js → TSQNyjhg.js} +1 -1
  257. package/web/app/immutable/chunks/{C-zY3GF-.js → UHs-xfbd.js} +1 -1
  258. package/web/app/immutable/chunks/{D0Ayz4Dm.js → Ug7t_gUQ.js} +1 -1
  259. package/web/app/immutable/chunks/{DQiheiDa.js → Wg-KBN6b.js} +48 -48
  260. package/web/app/immutable/chunks/{BsknvdQb.js → XmeiGQiO.js} +1 -1
  261. package/web/app/immutable/chunks/{COIbDYtT.js → Y4Eu_VSz.js} +3 -3
  262. package/web/app/immutable/chunks/{BQg4hK6W.js → Zg9SWWIQ.js} +1 -1
  263. package/web/app/immutable/chunks/{Cwvt_P5T.js → a0CN3en2.js} +1 -1
  264. package/web/app/immutable/chunks/{njprJ3WZ.js → aqQCGQpk.js} +1 -1
  265. package/web/app/immutable/chunks/bzfuMuVY.js +1 -0
  266. package/web/app/immutable/chunks/{BHni5QqW.js → cP-p0FYL.js} +1 -1
  267. package/web/app/immutable/chunks/{DMqmqAT4.js → dIyiVmNx.js} +1 -1
  268. package/web/app/immutable/chunks/{DVNEvaXi.js → fFnyP4ej.js} +1 -1
  269. package/web/app/immutable/chunks/{eZSKfAFO.js → gY6D1J3N.js} +1 -1
  270. package/web/app/immutable/chunks/{CyyqjEBc.js → hCk1hXVJ.js} +1 -1
  271. package/web/app/immutable/chunks/{DcNvIFJV.js → i0zaZVKI.js} +1 -1
  272. package/web/app/immutable/chunks/{CBRC7st2.js → i_Orzl3O.js} +2 -2
  273. package/web/app/immutable/chunks/{BevEoYEw.js → j9buSIht.js} +1 -1
  274. package/web/app/immutable/chunks/{BLYFfqzj.js → jUAybD8G.js} +1 -1
  275. package/web/app/immutable/chunks/{zjXa9LeK.js → jsYE2rXv.js} +1 -1
  276. package/web/app/immutable/chunks/{fXwGuYzr.js → kPyUfani.js} +1 -1
  277. package/web/app/immutable/chunks/{B0O5mhBM.js → mnnjJoDI.js} +1 -1
  278. package/web/app/immutable/chunks/{DQAJLaJ3.js → nHwpsxWy.js} +1 -1
  279. package/web/app/immutable/chunks/{y-lOZYhA.js → p0fS0rJD.js} +1 -1
  280. package/web/app/immutable/chunks/{BY16_RoT.js → q9cUG1dc.js} +1 -1
  281. package/web/app/immutable/chunks/{CYYyuCBb.js → qu0QpfUw.js} +1 -1
  282. package/web/app/immutable/chunks/{CQ6jYKtE.js → reP1x2hx.js} +1 -1
  283. package/web/app/immutable/chunks/{mF8ZdCMN.js → thdnIk1K.js} +1 -1
  284. package/web/app/immutable/chunks/tw85acZN.js +177 -0
  285. package/web/app/immutable/chunks/{BBiqqybB.js → wfSdTH77.js} +1 -1
  286. package/web/app/immutable/chunks/{Dtveg46I.js → wqzy1XTy.js} +1 -1
  287. package/web/app/immutable/chunks/{DCTwUEO7.js → xJBWkpxc.js} +1 -1
  288. package/web/app/immutable/chunks/{1Wzdy1K8.js → z1Wv0MVw.js} +6 -6
  289. package/web/app/immutable/chunks/{DinWeICM.js → zK-Wn6qa.js} +1 -1
  290. package/web/app/immutable/chunks/{C7TJE1vk.js → zaxjdjiF.js} +1 -1
  291. package/web/app/immutable/chunks/{DkkEizQf.js → zzl2tBQf.js} +1 -1
  292. package/web/app/immutable/entry/{app.B-3yrq60.js → app.CVv4zmJ_.js} +3 -3
  293. package/web/app/immutable/entry/start.CiYvv3YQ.js +1 -0
  294. package/web/app/immutable/nodes/{0.Dr7z-ndg.js → 0.Cb_UZQTB.js} +1 -1
  295. package/web/app/immutable/nodes/{1.DszvgcVt.js → 1.B0kBQ96l.js} +1 -1
  296. package/web/app/immutable/nodes/{10.mpjVYgcT.js → 10.CGIePvim.js} +5 -5
  297. package/web/app/immutable/nodes/{11.d9OIWvmS.js → 11.DcWpM7Yi.js} +1 -1
  298. package/web/app/immutable/nodes/{12.hNKUSgvY.js → 12.S6PrlAwz.js} +1 -1
  299. package/web/app/immutable/nodes/{13.NTcuwB8X.js → 13.Bs_o-uwb.js} +1 -1
  300. package/web/app/immutable/nodes/{14.C4hEzDzc.js → 14.CIZDoMeA.js} +3 -3
  301. package/web/app/immutable/nodes/{15.BGv16BME.js → 15.DDtIC3Hq.js} +1 -1
  302. package/web/app/immutable/nodes/{16.BLKEYdtz.js → 16.BgJmXimX.js} +1 -1
  303. package/web/app/immutable/nodes/{17.Cw1VnAlL.js → 17.BWRlIYI7.js} +1 -1
  304. package/web/app/immutable/nodes/{18.BC2tc74_.js → 18.BV2orlA1.js} +1 -1
  305. package/web/app/immutable/nodes/{19.BLf_cCOa.js → 19.B1-CCqHR.js} +2 -2
  306. package/web/app/immutable/nodes/{2.DT49t-u_.js → 2.CAFqSYBH.js} +4 -4
  307. package/web/app/immutable/nodes/{20.CAN0HPlm.js → 20.DLg8hCzP.js} +1 -1
  308. package/web/app/immutable/nodes/{3.CHLlivF3.js → 3.CNcHr_kX.js} +1 -1
  309. package/web/app/immutable/nodes/{4.D2tKSs2v.js → 4.BzoidTar.js} +1 -1
  310. package/web/app/immutable/nodes/{5.B9Lx7aa1.js → 5.vAApKfTG.js} +1 -1
  311. package/web/app/immutable/nodes/{6.BXEdmXk5.js → 6.D2VrWob4.js} +1 -1
  312. package/web/app/immutable/nodes/{7.Cg1blkaN.js → 7.cIi2v_en.js} +1 -1
  313. package/web/app/immutable/nodes/{8.B5g4h2T5.js → 8.DVH30a1F.js} +1 -1
  314. package/web/app/immutable/nodes/{9.CQeYWw6-.js → 9.AUZxhWIX.js} +4 -4
  315. package/web/app/version.json +1 -1
  316. package/web/generated/paraglide.js +49 -49
  317. package/web/index.html +18 -18
  318. package/web/app/immutable/chunks/B6sO6A0G.js +0 -1
  319. package/web/app/immutable/chunks/BSev9KPj.js +0 -1
  320. package/web/app/immutable/chunks/Bv8Gaorn.js +0 -1
  321. package/web/app/immutable/chunks/CAEqRKhy.js +0 -1
  322. package/web/app/immutable/chunks/Dr4PDf9D.js +0 -6
  323. package/web/app/immutable/chunks/EZ4dI6hS.js +0 -177
  324. package/web/app/immutable/entry/start.DZZRsHd3.js +0 -1
@@ -1 +1 @@
1
- var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./BjWOzuMm.js";import{bZ as we,cZ as ue,cp as de,co as be}from"./m8gDbIPC.js";import{Jr as p,C2 as Fe,bI as ke,i as Pe,Lw as me,ip as Ee,bU as Ge,D_ as H,Cr as xe,fk as Ve,Ax as Ue,e2 as fe,fg as _e,e1 as he,B0 as Be,La as $e,wu as Xe}from"./NgEAPl8f.js";import{aP as Se,dW as ge,A as K,P as Re,aK as Q}from"./CpV-ehZ5.js";import{h as We}from"./CSbK1_CV.js";import{c as Y}from"./ChTqQfQN.js";import{a as Ye}from"./BdWqymET.js";import{m as Z}from"./BkLJnbD1.js";import"./3SdAC2_C.js";import{bm as n}from"./Bv8Gaorn.js";import"./D85P44Dj.js";import"./DZBnfhEV.js";import"./BLYFfqzj.js";import{R as pe}from"./B5aYN90J.js";import{L as qe}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const j=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Ye("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=j.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=j.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=j.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},Ze={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function je(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return je(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):Ze[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class W extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=Y("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&Z.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,G=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&Z.error(G),new W(G,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&Z.error(ee(a.message)),new W(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof W?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new W(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=Y("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=Y("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new qe({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=Y("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),q=e.worktreePath||e.repositoryPath||e.path;if(!h&&q){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Pe.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],G={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...G,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Ge(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),q=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await We("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:q,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,P=T.turnId,L=typeof P=="string"?P:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,P=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===P));if(u()&&typeof P=="string"){const S=fe(s,t);A(_e(i,m.id,S,P,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:G})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
1
+ var De=Object.defineProperty;var Ce=(i,s,e)=>s in i?De(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var E=(i,s,e)=>Ce(i,typeof s!="symbol"?s+"":s,e);import{K as Le,P as ce,a6 as le,as as z,aC as ve}from"./QSHJFaU7.js";import{b_ as we,c_ as ue,cq as de,cp as be}from"./DwhE2_yv.js";import{Jr as p,C2 as Fe,bI as ke,i as Pe,Lw as me,ip as Ee,bU as Ge,D_ as H,Cr as xe,fk as Ve,Ax as Ue,e2 as fe,fg as _e,e1 as he,B0 as Be,La as $e,wu as Xe}from"./BPo1GPk4.js";import{aP as Se,dW as ge,A as K,P as Re,aK as Q}from"./DkYquFOp.js";import{h as We}from"./BpT_ybtH.js";import{c as q}from"./ChTqQfQN.js";import{a as qe}from"./BdWqymET.js";import{m as j}from"./D7vAVIvz.js";import"./3SdAC2_C.js";import{bm as n}from"./1KDVFF23.js";import"./D8B7qxXm.js";import"./Dmy603At.js";import"./jUAybD8G.js";import{R as pe}from"./B5aYN90J.js";import{L as Ye}from"./CSiaiLHL.js";function ze(i,s){return i.some(e=>e.id===s.id)?i.map(e=>e.id===s.id?{...s,...s.author==null&&e.author!==void 0?{author:e.author}:{}}:e):[...i,s]}const Te="confirmUnslothModelSwitch";function He(i){if(!i||typeof i!="object")return!1;const{agentId:s,agentName:e,workspaceId:t,workspaceTitle:r}=i;return typeof s=="string"&&typeof e=="string"&&typeof t=="string"&&(r===null||typeof r=="string")}function Ke(i){for(let s=i,e=0;s&&e<4;e++){const t=s.data;if(t&&typeof t=="object"){const{code:r,currentModel:a,requestedModel:l,agents:o}=t;if(r==="unsloth-model-switch-confirmation-required"&&typeof a=="string"&&typeof l=="string"&&Array.isArray(o)&&o.every(He))return{currentModel:a,requestedModel:l,agents:o}}s=s.cause}}function bt(i){if(!i||!(Te in i))return i;const{[Te]:s,...e}=i;return Object.keys(e).length>0?e:void 0}const Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new qe("PerformanceOptimizer"),w=class w{constructor(){E(this,"metricsBuffer");E(this,"metricsIndex",0);E(this,"metricsCount",0);E(this,"MAX_METRICS",500);E(this,"TARGET_RESPONSE_TIME",100);E(this,"memoCache",new Map);E(this,"MEMO_TTL",6e4);E(this,"MAX_CACHE_SIZE",100);E(this,"cacheHits",0);E(this,"cacheMisses",0);E(this,"pendingRequests",new Map);E(this,"requestQueue",[]);E(this,"cleanupInterval",null);this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.startCacheCleanup(),V.info("PerformanceOptimizer initialized")}static getInstance(){return w.instance||(w.instance=new w),w.instance}reset(){this.metricsBuffer=new Array(this.MAX_METRICS).fill(null),this.metricsIndex=0,this.metricsCount=0,this.memoCache.clear(),this.pendingRequests.clear(),this.requestQueue=[],this.cacheHits=0,this.cacheMisses=0}clearCache(){this.memoCache.clear(),this.cacheHits=0,this.cacheMisses=0}async processBatch(s,e,t={}){const{batchSize:r=10,concurrency:a=4}=t,l=[];for(let o=0;o<s.length;o+=r){const _=s.slice(o,o+r).map((c,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(c);d(k)},g)})}),u=await Promise.all(_);l.push(...u)}return l}startCacheCleanup(){this.cleanupInterval=setInterval(()=>{this.cleanupCache()},3e4)}stopCacheCleanup(){this.cleanupInterval&&(clearInterval(this.cleanupInterval),this.cleanupInterval=null)}cleanupCache(){const s=Date.now(),e=[];this.memoCache.forEach((t,r)=>{s-t.timestamp>this.MEMO_TTL&&e.push(r)}),e.forEach(t=>this.memoCache.delete(t)),this.memoCache.size>this.MAX_CACHE_SIZE&&Array.from(this.memoCache.entries()).sort((a,l)=>a[1].hits-l[1].hits||a[1].timestamp-l[1].timestamp).slice(0,this.memoCache.size-this.MAX_CACHE_SIZE).forEach(([a])=>this.memoCache.delete(a))}async track(s,e,t={}){const r=Z.now();try{const a=t.cacheKey||s;if(t.memoize){const _=this.getMemoized(a);if(_!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),_;this.cacheMisses++}if(t.coalesce){const _=this.pendingRequests.get(s);if(_)return V.debug("Request coalesced",{operation:s}),_}let l;t.coalesce?(l=t.timeout?this.withTimeout(e(),t.timeout):e(),this.pendingRequests.set(s,l)):l=t.timeout?this.withTimeout(e(),t.timeout):e();const o=await l;t.memoize&&this.memoize(a,o);const f=Z.now()-r;return this.recordMetric(s,f,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),f>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(f),target:this.TARGET_RESPONSE_TIME}),o}catch(a){const l=Z.now()-r;throw this.recordMetric(s,l,!1,{error:a instanceof Error?a.message:"Unknown error"}),a}finally{t.coalesce&&this.pendingRequests.delete(s)}}getStats(){if(this.metricsCount===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const s=[],e=this.metricsCount<this.MAX_METRICS?0:this.metricsIndex;for(let u=0;u<this.metricsCount;u++){const c=this.metricsBuffer[(e+u)%this.MAX_METRICS];c&&s.push(c)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,c)=>u.duration-c.duration);let r=0,a=0;const l=new Set;for(const u of s)a+=u.duration,u.success&&r++,u.duration>this.TARGET_RESPONSE_TIME&&l.add(u.operation);const o=a/s.length,f=Math.floor(t.length*.95),_=Math.floor(t.length*.99);return{avgResponseTime:Math.round(o),p95ResponseTime:Math.round(t[f]?.duration||0),p99ResponseTime:Math.round(t[_]?.duration||0),successRate:r/s.length*100,slowOperations:Array.from(l)}}getCacheStats(){const s=this.cacheHits+this.cacheMisses;return{size:this.memoCache.size,hitRate:s>0?this.cacheHits/s*100:0,hits:this.cacheHits,misses:this.cacheMisses}}getMemoized(s){const e=this.memoCache.get(s);if(e){if(Date.now()-e.timestamp>this.MEMO_TTL){this.memoCache.delete(s);return}return e.hits++,e.value}}memoize(s,e){const t=JSON.stringify(e).length;this.memoCache.set(s,{value:e,timestamp:Date.now(),hits:0,size:t}),this.memoCache.size>this.MAX_CACHE_SIZE&&this.cleanupCache()}async withTimeout(s,e){return Promise.race([s,new Promise((t,r)=>setTimeout(()=>r(new Error(`Operation timed out after ${e}ms`)),e))])}recordMetric(s,e,t,r){this.metricsBuffer[this.metricsIndex]={operation:s,duration:e,timestamp:Date.now(),success:t,metadata:r},this.metricsIndex=(this.metricsIndex+1)%this.MAX_METRICS,this.metricsCount<this.MAX_METRICS&&this.metricsCount++,e>this.TARGET_RESPONSE_TIME&&V.warn("Slow operation detected",{operation:s,duration:`${e.toFixed(2)}ms`,target:`${this.TARGET_RESPONSE_TIME}ms`,metadata:r})}};E(w,"instance");let te=w;const Qe=te.getInstance(),Ae={AGENT_CREATION:"https://docs.example.com/agent-creation",STREAMING:"https://docs.example.com/streaming-issues",STORAGE:"https://docs.example.com/storage-troubleshooting",MEMORY:"https://docs.example.com/memory-management",PROVIDER:"https://docs.example.com/provider-setup",GENERAL:"https://docs.example.com/help"},J={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_template({agentName:"{agentName}",details:"{details}"})},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_template({agentName:"{agentName}"})},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_template({details:"{details}"})},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_template({details:"{details}"})},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_template({sessionId:"{sessionId}"})},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_template()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_template({details:"{details}"})},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_template({details:"{details}"})},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_template({timeout:"{timeout}"})},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_template({attempt:"{attempt}",maxAttempts:"{maxAttempts}"})},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_template({attempts:"{attempts}"})},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_template({details:"{details}"})},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_template({details:"{details}"})},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_template({maxLength:"{maxLength}",currentLength:"{currentLength}"})},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_template({provider:"{provider}"})},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_template({provider:"{provider}",details:"{details}"})},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_template({provider:"{provider}"})},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_template({details:"{details}"})},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_template({details:"{details}"})},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_template({lastBackup:"{lastBackup}"})},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_template({currentUsage:"{currentUsage}",limit:"{limit}"})},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_template({count:"{count}",window:"{window}"})},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_template({current:"{current}",max:"{max}"})}},je={get AGENT_CREATION_FAILED(){return n.errors_catalog_agentCreationFailed_friendly()},get AGENT_ALREADY_EXISTS(){return n.errors_catalog_agentAlreadyExists_friendly()},get INVALID_AGENT_CONFIG(){return n.errors_catalog_invalidAgentConfig_friendly()},get INVALID_CONFIG(){return n.errors_catalog_invalidConfig_friendly()},get SESSION_NOT_FOUND(){return n.errors_catalog_sessionNotFound_friendly()},get SESSION_ALREADY_ACTIVE(){return n.errors_catalog_sessionAlreadyActive_friendly()},get SESSION_INITIALIZATION_FAILED(){return n.errors_catalog_sessionInitializationFailed_friendly()},get STREAM_CONNECTION_FAILED(){return n.errors_catalog_streamConnectionFailed_friendly()},get STREAM_TIMEOUT(){return n.errors_catalog_streamTimeout_friendly()},get STREAM_INTERRUPTED(){return n.errors_catalog_streamInterrupted_friendly()},get STREAM_RECOVERY_FAILED(){return n.errors_catalog_streamRecoveryFailed_friendly()},get MESSAGE_SEND_FAILED(){return n.errors_catalog_messageSendFailed_friendly()},get MESSAGE_VALIDATION_FAILED(){return n.errors_catalog_messageValidationFailed_friendly()},get MESSAGE_TOO_LONG(){return n.errors_catalog_messageTooLong_friendly()},get PROVIDER_NOT_FOUND(){return n.errors_catalog_providerNotFound_friendly()},get PROVIDER_CONNECTION_FAILED(){return n.errors_catalog_providerConnectionFailed_friendly()},get PROVIDER_PROCESS_DIED(){return n.errors_catalog_providerProcessDied_friendly()},get STORAGE_READ_FAILED(){return n.errors_catalog_storageReadFailed_friendly()},get STORAGE_WRITE_FAILED(){return n.errors_catalog_storageWriteFailed_friendly()},get STORAGE_CORRUPTED(){return n.errors_catalog_storageCorrupted_friendly()},get MEMORY_LIMIT_EXCEEDED(){return n.errors_catalog_memoryLimitExceeded_friendly()},get RATE_LIMIT_EXCEEDED(){return n.errors_catalog_rateLimitExceeded_friendly()},get CONCURRENT_LIMIT_EXCEEDED(){return n.errors_catalog_concurrentLimitExceeded_friendly()}};function Ze(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Je(i,s){return Ze(i).every(t=>t in s)}function Oe(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function ee(i){const s=n.errors_cleanMessage_fallback_error();if(!i)return s;let e=i;return e=e.replace(/^.*?failed(?:\s+to\s+.*?)?\s+after\s+\d+\s+attempts:\s*/i,""),e=e.replace(/^Error invoking remote method '[^']+':(\s*Error:)?\s*/i,""),e=e.replace(/^(Error:\s*)+/i,""),e=e.replace(/\n\s*at .+/g,""),e=e.replace(/\s+/g," ").trim(),e||s}function et(i,s){return s&&J[i]&&Je(J[i],s)?Oe(J[i],s):je[i]||n.errors_userFriendly_fallback_error()}function tt(i){const e={AGENT_CREATION_FAILED:"AGENT_CREATION",AGENT_ALREADY_EXISTS:"AGENT_CREATION",INVALID_AGENT_CONFIG:"AGENT_CREATION",STREAM_CONNECTION_FAILED:"STREAMING",STREAM_TIMEOUT:"STREAMING",STREAM_INTERRUPTED:"STREAMING",STREAM_RECOVERY_FAILED:"STREAMING",STORAGE_READ_FAILED:"STORAGE",STORAGE_WRITE_FAILED:"STORAGE",STORAGE_CORRUPTED:"STORAGE",MEMORY_LIMIT_EXCEEDED:"MEMORY",RATE_LIMIT_EXCEEDED:"MEMORY",CONCURRENT_LIMIT_EXCEEDED:"MEMORY",PROVIDER_NOT_FOUND:"PROVIDER",PROVIDER_CONNECTION_FAILED:"PROVIDER",PROVIDER_PROCESS_DIED:"PROVIDER"}[i];return e?Ae[e]:Ae.GENERAL}const st={AGENT_CREATION_FAILED:[{action:"retry",description:"Try creating the agent again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify agent configuration in settings",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient memory and disk space",automatic:!1,priority:"medium"}],AGENT_ALREADY_EXISTS:[{action:"rename",description:"Choose a different name for the agent",automatic:!1,priority:"high"},{action:"delete-existing",description:"Delete the existing agent first",automatic:!1,priority:"medium"}],INVALID_AGENT_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],INVALID_CONFIG:[{action:"review-config",description:"Review and correct the configuration",automatic:!1,priority:"high"},{action:"use-defaults",description:"Reset to default configuration",automatic:!1,priority:"medium"}],SESSION_NOT_FOUND:[{action:"start-new",description:"Start a new agent session",automatic:!1,priority:"high"},{action:"check-history",description:"Check session history for recent sessions",automatic:!1,priority:"medium"}],SESSION_ALREADY_ACTIVE:[{action:"wait",description:"Wait for the current session to complete",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel the active session first",automatic:!1,priority:"high"}],SESSION_INITIALIZATION_FAILED:[{action:"retry",description:"Try initializing the session again",automatic:!1,priority:"high"},{action:"check-resources",description:"Ensure sufficient resources are available",automatic:!1,priority:"medium"}],MESSAGE_SEND_FAILED:[{action:"retry",description:"Try sending the message again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],MESSAGE_VALIDATION_FAILED:[{action:"review-config",description:"Review and correct the message format",automatic:!1,priority:"high"},{action:"check-config",description:"Check configuration for valid message format",automatic:!1,priority:"medium"}],MESSAGE_TOO_LONG:[{action:"retry",description:"Shorten the message and try again",automatic:!1,priority:"high"},{action:"batch",description:"Split the message into multiple parts",automatic:!1,priority:"medium"}],PROVIDER_NOT_FOUND:[{action:"check-config",description:"Verify provider is properly configured",automatic:!1,priority:"high"},{action:"recreate",description:"Install or reinstall the provider",automatic:!1,priority:"high"}],PROVIDER_CONNECTION_FAILED:[{action:"retry",description:"Try connecting to the provider again",automatic:!1,priority:"high"},{action:"check-config",description:"Verify provider configuration",automatic:!1,priority:"high"}],STORAGE_READ_FAILED:[{action:"retry",description:"Try reading the data again",automatic:!1,priority:"high"},{action:"restore",description:"Restore from a recent backup",automatic:!1,priority:"medium"}],STORAGE_WRITE_FAILED:[{action:"retry",description:"Try saving again",automatic:!1,priority:"high"},{action:"check-resources",description:"Check available disk space",automatic:!1,priority:"high"}],STREAM_CONNECTION_FAILED:[{action:"retry",description:"Try connecting again",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your network connection",automatic:!1,priority:"high"}],STREAM_RECOVERY_FAILED:[{action:"restart",description:"Restart the agent",automatic:!1,priority:"high"},{action:"check-config",description:"Check error logs for more details",automatic:!1,priority:"medium"}],STREAM_INTERRUPTED:[{action:"reconnect",description:"Attempting automatic reconnection",automatic:!0,priority:"high"},{action:"retry",description:"Retry sending the message",automatic:!1,priority:"high"},{action:"check-connection",description:"Check your internet connection",automatic:!1,priority:"medium"}],STREAM_TIMEOUT:[{action:"wait",description:"Wait for agent to complete processing",automatic:!1,priority:"high"},{action:"cancel",description:"Cancel current operation",automatic:!1,priority:"medium"},{action:"increase-timeout",description:"Increase timeout in settings",automatic:!1,priority:"low"}],PROVIDER_PROCESS_DIED:[{action:"restart",description:"Restart agent process",automatic:!0,priority:"high"},{action:"recreate",description:"Create new agent session",automatic:!1,priority:"high"}],STORAGE_CORRUPTED:[{action:"restore",description:"Restore from backup",automatic:!1,priority:"high"},{action:"reset",description:"Reset agent data",automatic:!1,priority:"medium"}],MEMORY_LIMIT_EXCEEDED:[{action:"cleanup",description:"Close unused agents",automatic:!1,priority:"high"},{action:"increase-limit",description:"Increase memory limit in settings",automatic:!1,priority:"medium"}],RATE_LIMIT_EXCEEDED:[{action:"wait",description:"Wait before making more requests",automatic:!1,priority:"high"},{action:"batch",description:"Batch requests together",automatic:!1,priority:"medium"}],CONCURRENT_LIMIT_EXCEEDED:[{action:"close-agents",description:"Close some running agents",automatic:!1,priority:"high"},{action:"queue",description:"Queue operation for later",automatic:!1,priority:"medium"}]};function it(i){return st[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var N=(i=>(i.AGENT_CREATION_FAILED="AGENT_CREATION_FAILED",i.AGENT_ALREADY_EXISTS="AGENT_ALREADY_EXISTS",i.INVALID_AGENT_CONFIG="INVALID_AGENT_CONFIG",i.INVALID_CONFIG="INVALID_CONFIG",i.SESSION_NOT_FOUND="SESSION_NOT_FOUND",i.SESSION_ALREADY_ACTIVE="SESSION_ALREADY_ACTIVE",i.SESSION_INITIALIZATION_FAILED="SESSION_INITIALIZATION_FAILED",i.STREAM_CONNECTION_FAILED="STREAM_CONNECTION_FAILED",i.STREAM_TIMEOUT="STREAM_TIMEOUT",i.STREAM_INTERRUPTED="STREAM_INTERRUPTED",i.STREAM_RECOVERY_FAILED="STREAM_RECOVERY_FAILED",i.MESSAGE_SEND_FAILED="MESSAGE_SEND_FAILED",i.MESSAGE_VALIDATION_FAILED="MESSAGE_VALIDATION_FAILED",i.MESSAGE_TOO_LONG="MESSAGE_TOO_LONG",i.PROVIDER_NOT_FOUND="PROVIDER_NOT_FOUND",i.PROVIDER_CONNECTION_FAILED="PROVIDER_CONNECTION_FAILED",i.PROVIDER_PROCESS_DIED="PROVIDER_PROCESS_DIED",i.PROVIDER_UNAVAILABLE="PROVIDER_UNAVAILABLE",i.PROVIDER_ERROR="PROVIDER_ERROR",i.STORAGE_READ_FAILED="STORAGE_READ_FAILED",i.STORAGE_WRITE_FAILED="STORAGE_WRITE_FAILED",i.STORAGE_CORRUPTED="STORAGE_CORRUPTED",i.STORAGE_ERROR="STORAGE_ERROR",i.STORAGE_QUOTA_EXCEEDED="STORAGE_QUOTA_EXCEEDED",i.MEMORY_LIMIT_EXCEEDED="MEMORY_LIMIT_EXCEEDED",i.RATE_LIMIT_EXCEEDED="RATE_LIMIT_EXCEEDED",i.CONCURRENT_LIMIT_EXCEEDED="CONCURRENT_LIMIT_EXCEEDED",i.RESOURCE_NOT_FOUND="RESOURCE_NOT_FOUND",i.RESOURCE_EXHAUSTED="RESOURCE_EXHAUSTED",i.NETWORK_ERROR="NETWORK_ERROR",i.PERMISSION_DENIED="PERMISSION_DENIED",i.OPERATION_FAILED="OPERATION_FAILED",i.VALIDATION_ERROR="VALIDATION_ERROR",i.INVALID_RESPONSE="INVALID_RESPONSE",i.STATE_CORRUPTION="STATE_CORRUPTION",i.CONTEXT_OVERFLOW="CONTEXT_OVERFLOW",i))(N||{});class W extends Error{constructor(e,t,r={},a){super(e);E(this,"code");E(this,"context");E(this,"recoverySuggestions");E(this,"userMessage");E(this,"isRecoverable");E(this,"cause");this.name="AgentError",this.code=t,this.context={...r,timestamp:new Date,stackTrace:this.stack},this.userMessage=a?.userMessage||this.getDefaultUserMessage(t),this.recoverySuggestions=a?.recoverySuggestions||this.getDefaultRecoverySuggestions(t),this.isRecoverable=a?.isRecoverable??this.isErrorRecoverable(t),a?.cause&&(this.cause=a.cause)}getDefaultUserMessage(e){return et(e,this.context)}getDefaultRecoverySuggestions(e){return it(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return tt(this.code)}formatMessage(e){return Oe(e,this.context)}toJSON(){return{name:this.name,code:this.code,message:this.message,userMessage:this.userMessage,context:this.context,recoverySuggestions:this.recoverySuggestions,isRecoverable:this.isRecoverable,helpLink:this.getHelpLink(),stack:this.stack}}}const rt={NON_RETRYABLE_ERRORS:["EACCES","EPERM","ENOSPC","EMFILE","permission","memory","fatal","process died","not available on your current plan","agent binary","rate limit","too many requests","hit your limit","you've hit your limit","quota exceeded"]};function re(i){const s=i.toLowerCase();for(const e of rt.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const at="Agent already has an in-flight prompt. Message was not delivered.",v=q("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=pe.DEFAULT_ATTEMPTS,retryDelay:a=pe.BASE_DELAY,exponentialBackoff:l=!0,notify:o=!1,notifyOnRetry:f=!1,context:_={},onError:u,onRetry:c,shouldRetry:R=this.defaultShouldRetry}=t;let g=null,d=0;for(d=1;d<=r+1;d++)try{v.debug(`[${e}] Attempt ${d}/${r+1}`);const C=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),C}catch(C){if(g=C,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:_}),u?.(g,d),d<=r&&R(g)){const h=l?a*Math.pow(2,d-1):a;f&&j.warning(n.agent_errorBoundary_retrying_message({seconds:h/1e3})),c?.(d),v.info(`[${e}] Retrying in ${h}ms`),await this.sleep(h)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,G=ee(g?.message||n.agent_errorBoundary_generic_error()),D=g?.message?.toLowerCase()||"",$=D.includes("no available models")||D.includes("all models exhausted")||D.includes("all models unavailable");throw o&&!$&&j.error(G),new W(G,N.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:_})}async wrapVoid(s,e,t={}){await this.wrap(s,e,t)}wrapSync(s,e,t={}){try{return s()}catch(r){const a=r;throw v.error(`[${e}] Failed`,{error:a.message,context:t.context}),t.notify&&j.error(ee(a.message)),new W(ee(a.message),N.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return re(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof W?[N.NETWORK_ERROR,N.STREAM_TIMEOUT,N.STREAM_CONNECTION_FAILED,N.PROVIDER_CONNECTION_FAILED,N.PROVIDER_UNAVAILABLE].includes(s.code):!(e.includes("invalid")||e.includes("interrupted")||e.includes("cancel")||e.includes("not found")||e.includes("not available")||e.includes("404")||e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||e.includes("413")||e.includes("too long for the agent")||e.includes("request entity too large")||e.includes("payload too large")||e.includes("content too large")||e.includes("body too large")||e.includes("unauthorized")||e.includes("forbidden")||e.includes("401")||e.includes("403"))}sleep(s){return new Promise(e=>setTimeout(e,s))}async withTimeout(s,e,t){return Promise.race([s(),new Promise((r,a)=>setTimeout(()=>a(new W(`${t} timed out after ${e}ms`,N.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,o=[],f=[];for(let _=0;_<s.length;_+=r){const u=s.slice(_,_+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")o.push(R.value);else{const d=R.reason;if(f.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return f.length>0&&v.warn(`[${l}] Completed with ${f.length} errors`),{results:o,errors:f}}};E(b,"instance");let se=b;const nt=se.getInstance(),ie=q("browser/index"),F=new Map,B=new Map;let U;function ot(i,s,e){for(const t of s)try{t(e)}catch(r){ie.error("Error in agent subscriber callback",{agentId:i,error:r})}}function ct(){if(U)return;let i=!1;U=p.createSelector(e=>e.agentSessions)().subscribe(()=>{if(!i){i=!0;return}if(F.size===0)return;const e=p.state;for(const[t,r]of F){const a=Se.select(e,t);B.get(t)!==a&&(B.set(t,a),ot(t,r,a))}})}function lt(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ft(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),ct();const a=p.state,l=Se.select(a,i);return r&&B.set(i,l),l?ie.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):ie.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const o=F.get(i);o&&(o.delete(s),o.size===0&&(F.delete(i),B.delete(i))),lt()}}const y=q("ErrorRecovery"),ye={network:{maxRetries:3,initialBackoffMs:1e3,maxBackoffMs:1e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("network")||s.includes("fetch")||s.includes("connection")||s.includes("timeout")}},streaming:{maxRetries:5,initialBackoffMs:500,maxBackoffMs:5e3,backoffMultiplier:1.5,shouldRetry:(i,s)=>{if(s>=5)return!1;const e=i.message.toLowerCase();return e.includes("no available models")||e.includes("all models exhausted")||e.includes("all models unavailable")||re(i.message)?!1:e.includes("stream")||e.includes("chunk")||e.includes("incomplete")}},persistence:{maxRetries:2,initialBackoffMs:100,maxBackoffMs:1e3,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("save")||s.includes("write")||s.includes("persist")}},rateLimit:{maxRetries:3,initialBackoffMs:5e3,maxBackoffMs:3e4,backoffMultiplier:2,shouldRetry:i=>{const s=i.message.toLowerCase();return s.includes("rate")||s.includes("limit")||s.includes("429")}}};class ut{constructor(){E(this,"listeners",new Map)}on(s,e){let t=this.listeners.get(s);t||(t=new Set,this.listeners.set(s,t)),t.add(e)}off(s,e){this.listeners.get(s)?.delete(e)}emit(s,...e){this.listeners.get(s)?.forEach(t=>{try{t(...e)}catch(r){y.error(`Error in event listener for ${s}:`,r)}})}removeAllListeners(){this.listeners.clear()}}class dt extends ut{constructor(){super(...arguments);E(this,"activeRecoveries",new Map);E(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=ye.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let o,f=t.initialBackoffMs,_=0;for(let u=1;u<=t.maxRetries;u++){if(_=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const c=await e();return this.updateStats(r,!0),this.emit("recovery:success",{operationId:r,attempt:u,duration:Date.now()-a}),r&&this.activeRecoveries.delete(r),{success:!0,data:c,attempts:u,totalTime:Date.now()-a}}catch(c){o=c,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:o.message});const R=o.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:o.message});break}if(R.includes("no available models")||R.includes("all models exhausted")||R.includes("all models unavailable")){y.debug("All models exhausted, not retrying",{operationId:r,error:o.message});break}if(re(o.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:o.message});break}if(!t.shouldRetry(o,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:o.message});break}if(u<t.maxRetries){const g=Math.random()*.2*f,d=Math.min(f+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:o.message}),await this.delay(d,l.signal),f=Math.min(f*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(o,_),this.emit("recovery:failure",{operationId:r,attempts:_,duration:Date.now()-a,error:o?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:o,attempts:_,totalTime:Date.now()-a}}cancelRecovery(e){const t=this.activeRecoveries.get(e);t&&(t.abort(),this.activeRecoveries.delete(e),y.info(`Cancelled recovery for operation ${e}`))}cancelAllRecoveries(){for(const[e,t]of this.activeRecoveries)t.abort(),y.info(`Cancelled recovery for operation ${e}`);this.activeRecoveries.clear()}getStats(e){if(e)return this.recoveryStats.get(e)||{successes:0,failures:0};const t={};for(const[r,a]of this.recoveryStats)t[r]=a;return t}clearStats(e){e?this.recoveryStats.delete(e):this.recoveryStats.clear()}isRetryable(e,t){const r=e.message.toLowerCase();if(t)switch(t){case"NETWORK":return r.includes("network")||r.includes("fetch");case"TIMEOUT":return r.includes("timeout")||r.includes("timed out");case"RATE_LIMIT":return r.includes("rate")||r.includes("limit")||r.includes("429");case"TEMPORARY":return r.includes("temporary")||r.includes("transient");case"CONFLICT":return r.includes("conflict")||r.includes("concurrent");default:return!1}return this.isRetryable(e,"NETWORK")||this.isRetryable(e,"TIMEOUT")||this.isRetryable(e,"RATE_LIMIT")||this.isRetryable(e,"TEMPORARY")||this.isRetryable(e,"CONFLICT")}delay(e,t){return new Promise((r,a)=>{const l=setTimeout(r,e);if(t){const o=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",o);const f=r;r=()=>{t.removeEventListener("abort",o),f()}}})}updateStats(e,t){if(!e)return;const r=this.recoveryStats.get(e)||{successes:0,failures:0};t?r.successes++:r.failures++,this.recoveryStats.set(e,r)}dispose(){this.cancelAllRecoveries(),this.recoveryStats.clear(),this.removeAllListeners()}}const mt=new dt,O=new Ye({category:"WorkspaceMetrics"}),Et=100;class ft{constructor(){E(this,"metrics",new Map);E(this,"operations",new Map)}startWorkspaceCreation(s){const e=Date.now();for(this.metrics.delete(s),this.metrics.set(s,{workspaceId:s,creationStarted:e});this.metrics.size>Et;){const t=this.metrics.keys().next().value;if(t===void 0)break;this.metrics.delete(t)}O.info("Started tracking workspace creation",{workspaceId:s})}recordMilestone(s,e){const t=this.metrics.get(s);if(!t){O.warn("No metrics found for workspace",{workspaceId:s,milestone:e});return}const r=Date.now();switch(e){case"optimisticNavigation":t.optimisticNavigation=r;break;case"realWorkspaceCreated":t.realWorkspaceCreated=r;break;case"agentCreated":t.agentCreated=r;break;case"agentReady":t.agentReady=r;break;case"firstMessageSent":t.firstMessageSent=r;break;case"firstResponseReceived":t.firstResponseReceived=r;break;case"firstChunkReceived":t.firstChunkReceived=r;break;case"totalDuration":t.totalDuration=r;break;case"workspaceId":case"creationStarted":O.warn("Cannot update milestone",{milestone:e});return}const a=r-t.creationStarted;O.info(`Milestone: ${e}`,{workspaceId:s,elapsed:`${a}ms`,timestamp:r}),e==="firstResponseReceived"&&(t.totalDuration=r-t.creationStarted,this.logSummary(s))}startOperation(s,e){this.operations.set(s,{startTime:Date.now(),metadata:e})}endOperation(s,e){const t=this.operations.get(s);if(!t)return O.warn("Operation not found",{operationId:s}),null;const r=Date.now();return t.endTime=r,t.duration=r-t.startTime,e&&(t.metadata={...t.metadata,...e}),O.info("Operation completed",{operationId:s,duration:`${t.duration}ms`,metadata:t.metadata}),this.operations.delete(s),t.duration}getMetrics(s){return this.metrics.get(s)}logSummary(s){const e=this.metrics.get(s);if(!e)return;const t={workspaceId:s,totalDuration:`${e.totalDuration}ms`,stages:{optimisticNavigation:e.optimisticNavigation?`${e.optimisticNavigation-e.creationStarted}ms`:"N/A",realWorkspaceCreation:e.realWorkspaceCreated?`${e.realWorkspaceCreated-e.creationStarted}ms`:"N/A",agentCreation:e.agentCreated?`${e.agentCreated-e.creationStarted}ms`:"N/A",agentReady:e.agentReady?`${e.agentReady-e.creationStarted}ms`:"N/A",firstMessage:e.firstMessageSent?`${e.firstMessageSent-e.creationStarted}ms`:"N/A",firstResponse:e.firstResponseReceived?`${e.firstResponseReceived-e.creationStarted}ms`:"N/A"}};O.info("=== Workspace Creation Metrics Summary ===",t),O.info("Workspace Creation Metrics:",t)}clearMetrics(s){this.metrics.delete(s)}incrementAgentCreated(s){const e=this.metrics.get(s);e&&(e.agentCreated=Date.now(),O.info("Agent created",{workspaceId:s}))}incrementMessageSent(s){const e=this.metrics.get(s);e&&!e.firstMessageSent&&(e.firstMessageSent=Date.now(),O.info("First message sent",{workspaceId:s}))}}const _t=new ft,M=q("AgentSend");function A(i){p.dispatch(i)}function Ie(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function ht(i){const s=Ie(i)&&i.success===!0&&"data"in i?i.data:i;return!Ie(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(at)}async function kt(i,s,e,t={}){const r=ge.select(p.state,e.id);if(!r)return;const a=Le(i,e.id),l=t.submission,o=!!l&&we.select(p.state,l.scope)?.supported===!0,f=(c,R,g=!1)=>{l&&A(Xe(l.scope,l.id,c,Date.now(),R,g))};let _=!1;const u=()=>(!l||_||be.select(p.state,l))&&r===ge.select(p.state,e.id)&&a.isCurrent(p.state.agentSessions?.byAgentId[i]?.workspaceId);return Qe.track(`sendMessage:${a.key}:${i}:${l?.id??"legacy"}`,async()=>{if(!u())return;M.debug(`Sending message to agent ${i}`,{contentLength:s.length,hasContextReferences:!!t.contextReferences?.length,model:t.model});let c=await p.dispatch(Fe(e.id,i));if(u()){if(!c)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));c={...c,isStreaming:c.isStreaming??!1};{if(c&&(c.status==="pending"||!c.id)&&!c.backendSessionId&&c.activationState!==K.ACTIVE&&c.activationState!==K.ACTIVATING){const h=e.id.startsWith("optimistic-"),Y=e.worktreePath||e.repositoryPath||e.path;if(!h&&Y){M.info("Activating pending session in sendMessage",{agentId:i,status:c.status,activationState:c.activationState,hasBackendSessionId:!!c.backendSessionId});const x=await p.dispatch(ke(e.id,i));if(!u())return;x&&(c=x)}else throw M.warn("Cannot activate agent - workspace not ready",{agentId:i,workspaceId:e.id,isOptimistic:h,hasWorktreePath:!!e.worktreePath,hasRepositoryPath:!!e.repositoryPath,hasPath:!!e.path}),new Error(n.agent_streamLifecycle_spaceNotReady_error())}else c&&c.status==="pending"&&c.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:c.backendSessionId,activationState:c.activationState}),c={...c,status:Pe.Active,activationState:K.ACTIVE},A(me({...c,workspaceId:e.id})));if(!c)throw new Error(`Failed to get or create session for agent ${i}`);A(me({...c,workspaceId:e.id}));const g=[{type:"text",text:s}];if(t.imageBlocks)for(const h of t.imageBlocks)g.push({type:"image",...h.data!==void 0?{data:h.data}:{},...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.attachmentId!==void 0?{attachmentId:h.attachmentId}:{}});if(t.fileBlocks)for(const h of t.fileBlocks)g.push({type:"file",attachmentId:h.attachmentId,fileName:h.fileName,...h.mimeType!==void 0?{mimeType:h.mimeType}:{},...h.size!==void 0?{size:h.size}:{}});const d=t.userAppMessageId??ce(),k=t.messageMetadata?.[Re],G={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[Re]:k}:{}},D={id:Ee(ue()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...G,...t.messageMetadata??{}}};o||(l&&(f("rejected"),_=!0),A(Ge(c.id,D))),A(H(c.id,!0));let $=!1,C;try{o||await p.dispatch(xe(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=Ee(`msg_${ue()}`),Y=ce(),x=async()=>nt.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:c.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(m=>({type:m.type,mimeType:m.mimeType,dataLength:m.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(m=>({type:m.type,fileName:m.fileName,mimeType:m.mimeType,attachmentId:m.attachmentId,size:m.size}))||[]});const Me=t.model??t.modelId??c.model??void 0;A(Ve(i));const Ne=le(i,e.id),ne=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await We("agent.sendMessage",{agentId:i,...o&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Me,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:Y,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(m=>{if(u())throw Ke(m)&&(C=m),m});if(u()){if(ht(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:c.id}),f("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const m=T.error,I=typeof m=="string"?m:m?.message;throw $=!0,new Error(I||n.agent_streamLifecycle_sendToBackendFailed_error())}if("queued"in T&&T.queued===!0){if(M.info("sendMessage auto-queued by daemon (mid-turn or turn-startup race)",{agentId:i,sessionId:c.id,queuedMessageId:T.queuedMessage?.id}),(!o||!l||!de.select(p.state,l))&&A(H(c.id,!1)),o||A(Ue(c.id,D.id)),o){const I=T.queuedMessage,P=T.turnId,L=typeof P=="string"?P:I?.turnId;if(I&&typeof L=="string"){const S=fe(s,t),X=Q.select(p.state,i,e.id).find(oe=>oe.id===I.id||oe.turnId===L);A(_e(i,I.id,S,L,he(X??I,S),!X&&!!l&&de.select(p.state,l),ne))}f("accepted",I,!0),z(i,e.id);return}const m=T.queuedMessage;if(m){const I=T.turnId,P=typeof I=="string"?I:m.turnId;let L=m;if(u()&&le(i,e.id)===Ne){const S=Q.select(p.state,i,e.id),X=ze(S,m);A(Be(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:m.id}),await z(i,e.id).catch(()=>{}),L=Q.select(p.state,i,e.id).find(S=>S.id===m.id||S.turnId===P));if(u()&&typeof P=="string"){const S=fe(s,t);A(_e(i,m.id,S,P,he(L??m,S),!L,ne))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:m.id})}return}}o&&(f("accepted"),z(i,e.id),ve(i,e.id)),_t.incrementMessageSent(e.id)}},"send message",{retries:o?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),ae=o?await x().then(()=>({success:!0,error:void 0})):await mt.executeWithRecovery(x,ye.streaming,`send-message-${i}`);if(!ae.success)throw ae.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(H(c.id,!1)),!o&&t.messageMetadata&&A($e(c.id,D.id,{metadata:G})),o&&f($||C?"rejected":"uncertain"),C??h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Te as U,Ft as a,ee as c,ze as r,kt as s,Ke as u,bt as w};
@@ -1,4 +1,4 @@
1
- import{g as Jt}from"./Dtveg46I.js";import{g as Zt}from"./E0KBz4I2.js";import{s as $t}from"./H3ekn9Mt.js";import{b as C,a$ as e1,ay as Z,X as Ae,a1 as t1,aP as s1,bh as at,a_ as i1,aZ as r1,b0 as a1,V as n1,U as u1,Y as o1,z as l1,ax as c1,J as h1,aq as st,as as d1,$ as it,aW as rt,r as p1,a2 as f1,N as g1,am as b1,aU as k1,ab as A1,x as m1,aT as C1,p as S1}from"./ChGLvrw4.js";import{c as D1}from"./l4TJFOXC.js";import{aQ as T1}from"./m8gDbIPC.js";var E1="flowchart-",y1=["laneRole","laneIndex","drawnExtent"];function Wt(s){if(!s||typeof s!="object")return s;const i={...s};for(const a of y1)Reflect.deleteProperty(i,a);return i}C(Wt,"withoutInternalKeys");var Pe,x1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.droppedSubGraphMembers=[],this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=i1,this.setAccDescription=r1,this.setDiagramTitle=a1,this.getAccTitle=n1,this.getAccDescription=u1,this.getDiagramTitle=o1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return l1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,r,l,g,o={},m){if(!i||i.trim().length===0)return;let d;if(m!==void 0){let f;m.includes(`
1
+ import{g as Jt}from"./wqzy1XTy.js";import{g as Zt}from"./BXB-ioXM.js";import{s as $t}from"./DMdq0QC2.js";import{b as C,a$ as e1,ay as Z,X as Ae,a1 as t1,aP as s1,bh as at,a_ as i1,aZ as r1,b0 as a1,V as n1,U as u1,Y as o1,z as l1,ax as c1,J as h1,aq as st,as as d1,$ as it,aW as rt,r as p1,a2 as f1,N as g1,am as b1,aU as k1,ab as A1,x as m1,aT as C1,p as S1}from"./1_Sb4Kkv.js";import{c as D1}from"./D3GrssRa.js";import{aR as T1}from"./DwhE2_yv.js";var E1="flowchart-",y1=["laneRole","laneIndex","drawnExtent"];function Wt(s){if(!s||typeof s!="object")return s;const i={...s};for(const a of y1)Reflect.deleteProperty(i,a);return i}C(Wt,"withoutInternalKeys");var Pe,x1=(Pe=class{constructor(){this.vertexCounter=0,this.config=Ae(),this.diagramId="",this.vertices=new Map,this.edges=[],this.classes=new Map,this.subGraphs=[],this.subGraphLookup=new Map,this.droppedSubGraphMembers=[],this.tooltips=new Map,this.subCount=0,this.firstGraphFlag=!0,this.secCount=-1,this.posCrossRef=[],this.funs=[],this.setAccTitle=i1,this.setAccDescription=r1,this.setDiagramTitle=a1,this.getAccTitle=n1,this.getAccDescription=u1,this.getDiagramTitle=o1,this.funs.push(this.setupToolTips.bind(this)),this.addVertex=this.addVertex.bind(this),this.firstGraph=this.firstGraph.bind(this),this.setDirection=this.setDirection.bind(this),this.addSubGraph=this.addSubGraph.bind(this),this.addLink=this.addLink.bind(this),this.setLink=this.setLink.bind(this),this.updateLink=this.updateLink.bind(this),this.addClass=this.addClass.bind(this),this.setClass=this.setClass.bind(this),this.destructLink=this.destructLink.bind(this),this.setClickEvent=this.setClickEvent.bind(this),this.setTooltip=this.setTooltip.bind(this),this.updateLinkInterpolate=this.updateLinkInterpolate.bind(this),this.setClickFun=this.setClickFun.bind(this),this.bindFunctions=this.bindFunctions.bind(this),this.lex={firstGraph:this.firstGraph.bind(this)},this.clear(),this.setGen("gen-2")}sanitizeText(i){return l1.sanitizeText(i,this.config)}sanitizeNodeLabelType(i){switch(i){case"markdown":case"string":case"text":return i;default:return"markdown"}}setDiagramId(i){this.diagramId=i}lookUpDomId(i){for(const a of this.vertices.values())if(a.id===i)return this.diagramId?`${this.diagramId}-${a.domId}`:a.domId;return this.diagramId?`${this.diagramId}-${i}`:i}addVertex(i,a,n,r,l,g,o={},m){if(!i||i.trim().length===0)return;let d;if(m!==void 0){let f;m.includes(`
2
2
  `)?f=m+`
3
3
  `:f=`{
4
4
  `+m+`
@@ -1 +1 @@
1
- import{m as t}from"./BkLJnbD1.js";import"./3SdAC2_C.js";import{bm as n}from"./Bv8Gaorn.js";import"./D85P44Dj.js";import"./DZBnfhEV.js";import"./CSbK1_CV.js";import"./ChTqQfQN.js";import"./BLYFfqzj.js";import"./NgEAPl8f.js";function L(e){try{const r=new URL(e).hostname.toLowerCase();return r==="daemon.localhost"||r==="client.localhost"}catch{return!1}}const s="browser:resolve-url";function a(e){return typeof e=="object"&&e!==null&&typeof e.url=="string"&&typeof e.rewritten=="boolean"}async function l(e,r){const o={url:e,rewritten:!1};if(!r)return o;try{const i=await r(s,{url:e});return a(i)?i:o}catch{return o}}async function g(e,r){if(!r)return e;try{const o=await r(s,{url:e,mode:"rewrite-only"});return a(o)?o.url:e}catch{return e}}async function c(e){const r=await l(e,typeof window<"u"?window.electronAPI?.invoke:void 0);return r.error&&r.rewritten?r.forbidden?t.error(n.browser_linkOpen_ownerOnlyForward_error()):t.error(n.browser_embedded_resolveFailed_error(),{description:r.error}):r.warning&&t.warning(n.browser_linkOpen_loopbackAmbiguity_warning(),{description:r.warning}),{url:r.url,...r.rewritten&&r.requestedUrl!==void 0?{requestedUrl:r.requestedUrl}:{}}}const h=Object.freeze(Object.defineProperty({__proto__:null,resolveBrowserLinkForOpen:c},Symbol.toStringTag,{value:"Module"}));export{l as a,h as b,g as c,L as i,c as r};
1
+ import{m as t}from"./D7vAVIvz.js";import"./3SdAC2_C.js";import{bm as n}from"./1KDVFF23.js";import"./D8B7qxXm.js";import"./Dmy603At.js";import"./BpT_ybtH.js";import"./ChTqQfQN.js";import"./jUAybD8G.js";import"./BPo1GPk4.js";function L(e){try{const r=new URL(e).hostname.toLowerCase();return r==="daemon.localhost"||r==="client.localhost"}catch{return!1}}const s="browser:resolve-url";function a(e){return typeof e=="object"&&e!==null&&typeof e.url=="string"&&typeof e.rewritten=="boolean"}async function l(e,r){const o={url:e,rewritten:!1};if(!r)return o;try{const i=await r(s,{url:e});return a(i)?i:o}catch{return o}}async function g(e,r){if(!r)return e;try{const o=await r(s,{url:e,mode:"rewrite-only"});return a(o)?o.url:e}catch{return e}}async function c(e){const r=await l(e,typeof window<"u"?window.electronAPI?.invoke:void 0);return r.error&&r.rewritten?r.forbidden?t.error(n.browser_linkOpen_ownerOnlyForward_error()):t.error(n.browser_embedded_resolveFailed_error(),{description:r.error}):r.warning&&t.warning(n.browser_linkOpen_loopbackAmbiguity_warning(),{description:r.warning}),{url:r.url,...r.rewritten&&r.requestedUrl!==void 0?{requestedUrl:r.requestedUrl}:{}}}const h=Object.freeze(Object.defineProperty({__proto__:null,resolveBrowserLinkForOpen:c},Symbol.toStringTag,{value:"Module"}));export{l as a,h as b,g as c,L as i,c as r};
@@ -1 +1 @@
1
- import{aR as a,aP as u,aQ as r,m as N,a0 as w,l as x,ab as T,Y as A,b3 as C,aJ as M,ad as P,bM as m,bL as i,O as v,bZ as R,w as S,bN as s}from"./3SdAC2_C.js";import{B}from"./Bv8Gaorn.js";import{i as c}from"./DgaiTQpw.js";function J(g,p,F,l,L,O){let b=a;a&&u();var e=null;a&&r.nodeType===N&&(e=r,u());var f=a?r:g,E=v,o=new B(f,!1);w(()=>{const t=p()||null;var h=t==="svg"?S:void 0;if(t===null){o.ensure(null,null),s(!0);return}return o.ensure(t,_=>{if(t){var y=a;if(e=a?e:T(t,h),A(e,e),l){var d=null;a&&C(t)&&e.append(d=document.createComment(""));var n=a?M(e):e.appendChild(P());a&&(n===null?m(!1):i(n)),c(E),l(e,n),d?.remove(),c(null)}v.nodes.end=e,y||_.before(e)}a&&i(_)}),s(!0),()=>{t&&s(!1)}},x),R(()=>{s(!0)}),b&&(m(!0),i(f))}export{J as e};
1
+ import{aR as a,aP as u,aQ as r,m as N,a0 as w,l as x,ab as T,Y as A,b3 as C,aJ as M,ad as P,bM as m,bL as i,O as v,bZ as R,w as S,bN as s}from"./3SdAC2_C.js";import{B}from"./1KDVFF23.js";import{i as c}from"./CjK2zm52.js";function J(g,p,F,l,L,O){let b=a;a&&u();var e=null;a&&r.nodeType===N&&(e=r,u());var f=a?r:g,E=v,o=new B(f,!1);w(()=>{const t=p()||null;var h=t==="svg"?S:void 0;if(t===null){o.ensure(null,null),s(!0);return}return o.ensure(t,_=>{if(t){var y=a;if(e=a?e:T(t,h),A(e,e),l){var d=null;a&&C(t)&&e.append(d=document.createComment(""));var n=a?M(e):e.appendChild(P());a&&(n===null?m(!1):i(n)),c(E),l(e,n),d?.remove(),c(null)}v.nodes.end=e,y||_.before(e)}a&&i(_)}),s(!0),()=>{t&&s(!1)}},x),R(()=>{s(!0)}),b&&(m(!0),i(f))}export{J as e};
@@ -1 +1 @@
1
- import{Jr as o,bb as d}from"./NgEAPl8f.js";const f=o.createSelector((t,r)=>t.uiHighlight.activeById[r.trim()]??0),m=o.createSelector((t,r)=>t.uiHighlight.durationMsById[r.trim()]),n="ui-highlight-pulse-ring";function u(t){return(t??"").trim()}function T(t,r={}){let s=u(r.id??t.dataset.highlightId),a=0,l;function c(){t.classList.remove(n)}function g(e){t.classList.remove(n),t.offsetWidth,t.classList.add(n),l&&clearTimeout(l),l=setTimeout(c,e??d)}function h(){if(!s)return;let e;try{e=o.state}catch{return}const i=f.select(e,s);i>0&&i!==a&&(a=i,g(m.select(e,s)))}const I=setInterval(h,100);return h(),{update(e={}){const i=u(e.id??t.dataset.highlightId);i!==s&&(s=i,a=0,c(),h())},destroy(){clearInterval(I),l&&clearTimeout(l),c()}}}export{T as h};
1
+ import{Jr as o,bb as d}from"./BPo1GPk4.js";const f=o.createSelector((t,r)=>t.uiHighlight.activeById[r.trim()]??0),m=o.createSelector((t,r)=>t.uiHighlight.durationMsById[r.trim()]),n="ui-highlight-pulse-ring";function u(t){return(t??"").trim()}function T(t,r={}){let s=u(r.id??t.dataset.highlightId),a=0,l;function c(){t.classList.remove(n)}function g(e){t.classList.remove(n),t.offsetWidth,t.classList.add(n),l&&clearTimeout(l),l=setTimeout(c,e??d)}function h(){if(!s)return;let e;try{e=o.state}catch{return}const i=f.select(e,s);i>0&&i!==a&&(a=i,g(m.select(e,s)))}const I=setInterval(h,100);return h(),{update(e={}){const i=u(e.id??t.dataset.highlightId);i!==s&&(s=i,a=0,c(),h())},destroy(){clearInterval(I),l&&clearTimeout(l),c()}}}export{T as h};
@@ -1 +1 @@
1
- import{$ as st}from"./CpV-ehZ5.js";import{nW as ct,bq as ut}from"./NgEAPl8f.js";import{g as dt}from"./CMiilI_P.js";import{t as ze,bo as g,bw as Ae,b as Ue,bm as u,br as mt}from"./Bv8Gaorn.js";import{ai as Ve,bs as Ee,ca as xe,aD as e,a7 as we,ay as te,W as y,bn as Te,bV as se,aA as v,a5 as pe,bS as E,bH as P,bA as ge,b_ as Y,aj as Ce,aw as Ne,bl as ye,bO as ne,aB as W,c9 as $,be as Me,b$ as Ie}from"./3SdAC2_C.js";import{i as q}from"./BQg4hK6W.js";import{k as ft}from"./ChJ4msi3.js";import{s as ke,e as qe,f as pt,g as gt}from"./D85P44Dj.js";import{b as Se}from"./Dn334wJv.js";import{c as me}from"./kZanyiqf.js";import{q as He,l as Ge,d as Je,e as $e,K as Qe,h as et,M as tt}from"./C6GJZLOP.js";import{a as vt}from"./CC7to1B5.js";import{m as _e}from"./BkLJnbD1.js";import{f as Le}from"./BO3WriTy.js";import"./CSbK1_CV.js";import{l as Ke,f as nt,m as _t,a as ht}from"./C44hzh9R.js";import"./ChTqQfQN.js";import"./BLYFfqzj.js";import"./CFtfWLBC.js";import{bL as Re}from"./kuwy0JZA.js";import{s as je}from"./DZBnfhEV.js";import{F as Pe,d3 as bt,bW as wt,bX as yt,cq as xt,bF as kt,cr as Ct,aZ as Pt,a8 as Lt}from"./CiD4x8Gl.js";import{S as Mt}from"./B7ydANq7.js";import{n as It,g as $t}from"./DgaiTQpw.js";import{e as De}from"./D1JjMDax.js";import{i as zt,f as At}from"./DCTwUEO7.js";import{P as Ut}from"./DY61j2wq.js";import{h as Et}from"./BOsHJKjO.js";import{t as Tt}from"./DAsc1V4f.js";function Nt(i,t){return i?.isExternalLink===!0&&typeof i.workspaceId=="string"&&i.workspaceId?i.workspaceId:t||void 0}function St(i,t,o){const c=i.label||i.id||"mention";if(i.type==="member")return st(c);if(i.type==="note"&&i.id&&o){const s=Nt(i.meta,t),_=s?o(s,i.id)?.trim():void 0;if(_)return _}return c}function Bn(i,t,o){if(typeof document>"u"||!i.includes('data-type="note"'))return i;const c=document.createElement("template");c.innerHTML=i;let s=!1;for(const _ of c.content.querySelectorAll('[data-mention][data-type="note"]')){let h=null;try{h=JSON.parse(_.getAttribute("data-meta")||"{}")}catch{h=null}const I=_.textContent??"",C=St({type:"note",id:_.getAttribute("data-id"),label:I,meta:h},t,o);C!==I&&(_.textContent=C,s=!0)}return s?c.innerHTML:i}const jn=(i,t)=>{let o;try{o=dt().state}catch{return}const c=o?.workspaceNotes?.byWorkspaceId?.[i]?.notes;return c?ct(c,t)?.title:void 0};var Kt=W('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Rt=W('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Xe(i,t){if(new.target)return ze({component:Xe,...i});Ee(t,!0);let o=g(t,"open",15,!1),c=g(t,"ariaLabel",7),s=g(t,"closeLabel",7),_=g(t,"onClose",7),h=g(t,"openerElement",7,null),I=g(t,"children",7),C=g(t,"actions",7),T=g(t,"caption",7),w=g(t,"onKeydown",7),L=g(t,"onCopy",7);const S=zt(),d=At(b);let M=se(null),N=se(null);function b(){o()&&(o(!1),_()?.(),h()?.isConnected&&h().focus({preventScroll:!0}))}function O(n){(n.target instanceof Element?n.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||b()}function K(n){if(w()?.(n),n.defaultPrevented||n.key!=="Tab"||!e(M))return;const r=Array.from(e(M).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),m=r[0],l=r[r.length-1];!m||!l||(n.shiftKey&&document.activeElement===m?(n.preventDefault(),l.focus()):!n.shiftKey&&document.activeElement===l&&(n.preventDefault(),m.focus()))}xe(()=>{if(o())return He(b)}),xe(()=>{!o()||!e(N)||requestAnimationFrame(()=>e(N)?.focus())});var ae={get open(){return o()},set open(n=!1){o(n),v()},get ariaLabel(){return c()},set ariaLabel(n){c(n),v()},get closeLabel(){return s()},set closeLabel(n){s(n),v()},get onClose(){return _()},set onClose(n){_(n),v()},get openerElement(){return h()},set openerElement(n=null){h(n),v()},get children(){return I()},set children(n){I(n),v()},get actions(){return C()},set actions(n){C(n),v()},get caption(){return T()},set caption(n){T(n),v()},get onKeydown(){return w()},set onKeydown(n){w(n),v()},get onCopy(){return L()},set onCopy(n){L(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},B=we(),G=te(B);{var J=n=>{{let r=$(()=>S?.target()??"body");Ut(n,{get target(){return e(r)},zIndex:1e3,children:(m,l)=>{var f=Rt(),k=pe(f),z=pe(k);{var R=x=>{var re=we(),D=te(re);je(D,C),y(x,re)};q(z,x=>{C()&&x(R)})}var Q=E(z,2);Le(Q,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:b,get"aria-label"(){return s()},get ref(){return e(N)},set ref(x){P(N,x,!0)},children:(x,re)=>{Pe(x,{get icon(){return bt},size:"lg"})},$$slots:{default:!0}}),ge(k),De(k,x=>d?.(x));var j=E(k,2),F=pe(j);je(F,I),ge(j),De(j,x=>d?.(x));var V=E(j,2);{var ce=x=>{var re=Kt(),D=ye(re,!0);Y(()=>ne(D,T())),y(x,re)};q(V,x=>{T()&&x(ce)})}ge(f),Se(f,x=>P(M,x),()=>e(M)),Y(()=>ke(f,"aria-label",c())),Ce("click",f,O),Ce("keydown",f,K),Ne("copy",f,function(...x){L()?.apply(this,x)}),It(3,f,()=>$t,()=>({tier:"moderate"})),y(m,f)},$$slots:{default:!0}})}};q(G,n=>{o()&&n(J)})}return y(i,B),Te(ae)}Ve(["click","keydown"]);function Ye(i){if(!i.startsWith("workspace-file://"))return null;const o=i.slice(17).split(/[?#]/)[0].split("/"),c=o[0],s=o.slice(1);if(!c||s.length===0)return null;const _=[];for(const h of s){if(!h)return null;try{_.push(decodeURIComponent(h))}catch{return null}}return{workspaceId:c,path:_.join("/")}}function at(i){try{return new URL(i).protocol==="https:"}catch{return!1}}function Ze(i){const t=/^data:([^;,]+);base64,(.*)$/s.exec(i);return t?{mimeType:t[1],base64:t[2]}:null}function We(i){return at(i)||Ye(i)!==null||/^workspace-asset:\/\/[^/?#]+/.test(i)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(i)}function rt(i){if(i.length===0)return 0;let t=0;return i.endsWith("==")?t=2:i.endsWith("=")&&(t=1),Math.floor(i.length*3/4)-t}function Ft(i,t){const o=atob(i),c=new Uint8Array(o.length);for(let s=0;s<o.length;s++)c[s]=o.charCodeAt(s);return new Blob([c],{type:t})}const Ot={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Bt(i){if(i.workspacePath){const s=i.workspacePath.split("/").pop();if(s)return s}const t=(i.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(t))return t;const o=i.mimeType?.split(";")[0].trim().toLowerCase(),c=o&&Ot[o]||"png";return`${t}.${c}`}var jt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Dt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),Zt=W("<!> <!> <!>",1),Wt=W("<!> <!> <!> <!>",1),Vt=W("<!> <!>",1);function ot(i,t){if(new.target)return ze({component:ot,...i});Ee(t,!0);let o=g(t,"imageUrl",7),c=g(t,"imageName",7),s=g(t,"open",15,!1),_=g(t,"triggerClass",7),h=g(t,"contentClass",7);const I=$(()=>Ze(o())),C=$(()=>Ye(o())),T=$(()=>at(o()));let w=se(null),L=se(null),S=null;function d(){if(S===o())return;const l=S=o();P(w,null),P(L,e(I)?rt(e(I).base64):null,!0);const f=new Image;f.onload=()=>{S===l&&P(w,{width:f.naturalWidth,height:f.naturalHeight},!0)},f.src=o(),e(I)||fetch(o()).then(k=>k.ok?k.blob():null).then(k=>{k&&S===l&&P(L,k.size,!0)}).catch(()=>{})}xe(()=>{s()&&d()}),xe(()=>{if(s())return He(()=>{s(!1)})});async function M(l=o()){const f=Ze(l);if(f)return Ft(f.base64,f.mimeType);const k=await fetch(l);if(!k.ok)throw new Error(`Image fetch failed: ${k.status}`);return await k.blob()}async function N(){let l=null;try{let f=o(),k=e(I)?.mimeType;if(!e(I)){const R=await M();k=R.type,l=URL.createObjectURL(R),f=l}const z=document.createElement("a");z.href=f,z.download=Bt({workspacePath:e(C)?.path,imageName:c(),mimeType:k}),document.body.appendChild(z);try{z.click()}finally{z.remove()}}catch{_e.error(u.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function b(){if(e(C))try{await Re(e(C).path),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function O(){if(e(T))try{await Re(o()),_e.success(u.ui_imageActionsMenu_linkCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function K(l){let f,k;try{let z;if(l.type.split(";")[0].trim()==="image/svg+xml"){k=URL.createObjectURL(l);const j=new Image;j.src=k,await j.decode(),z=j}else z=f=await createImageBitmap(l);const R=document.createElement("canvas");R.width=z instanceof HTMLImageElement?z.naturalWidth:z.width,R.height=z instanceof HTMLImageElement?z.naturalHeight:z.height;const Q=R.getContext("2d");if(!Q)throw new Error("2d canvas context unavailable");return Q.drawImage(z,0,0),await new Promise((j,F)=>{R.toBlob(V=>V?j(V):F(new Error("canvas toBlob failed")),"image/png")})}finally{f?.close(),k&&URL.revokeObjectURL(k)}}async function ae(l=o()){try{let f=await M(l);f.type!=="image/png"&&(f=await K(f)),await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),_e.success(u.ui_imageActionsMenu_imageCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function B(l,f=o()){return l.defaultPrevented||!We(f)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||vt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(ae(f),s(!1)),!0)}var G={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),v()},get imageName(){return c()},set imageName(l){c(l),v()},get open(){return s()},set open(l=!1){s(l),v()},get triggerClass(){return _()},set triggerClass(l){_(l),v()},get contentClass(){return h()},set contentClass(l){h(l),v()},$set:Ae,$on:(l,f)=>Ue(t,l,f)},J=we(),n=te(J);{var r=l=>{var f=we(),k=te(f);me(k,()=>tt,(z,R)=>{R(z,{get open(){return s()},set open(Q){s(Q)},children:(Q,j)=>{var F=Vt(),V=te(F);{const x=(D,he)=>{let oe=()=>(he?.()).props;{let Z=$(()=>u.ui_imageActionsMenu_trigger_ariaLabel());Le(D,mt(oe,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e(Z)},children:(ie,fe)=>{Qe(ie,{class:"size-3.5"})},$$slots:{default:!0}}))}};let re=$(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",_()));me(V,()=>Ge,(D,he)=>{he(D,{get class(){return e(re)},onclick:oe=>oe.stopPropagation(),onkeydown:oe=>B(oe),oncopy:oe=>B(oe),child:x,$$slots:{child:!0}})})}var ce=E(V,2);me(ce,()=>Je,(x,re)=>{re(x,{get class(){return h()},align:"end",onkeydown:D=>B(D),oncopy:D=>B(D),children:(D,he)=>{var oe=Wt(),Z=te(oe);me(Z,()=>$e,(A,X)=>{X(A,{onSelect:()=>void N(),children:(U,ee)=>{Me();var le=Ie();Y(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_download_label()]),y(U,le)},$$slots:{default:!0}})});var ie=E(Z,2);me(ie,()=>$e,(A,X)=>{X(A,{onSelect:()=>void ae(),children:(U,ee)=>{Me();var le=Ie();Y(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_copyImage_label()]),y(U,le)},$$slots:{default:!0}})});var fe=E(ie,2);{var a=A=>{var X=we(),U=te(X);me(U,()=>$e,(ee,le)=>{le(ee,{onSelect:()=>void b(),children:(ue,Fe)=>{Me();var de=Ie();Y(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyPath_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,X)},p=A=>{var X=we(),U=te(X);me(U,()=>$e,(ee,le)=>{le(ee,{onSelect:()=>void O(),children:(ue,Fe)=>{Me();var de=Ie();Y(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyLink_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,X)};q(fe,A=>{e(C)?A(a):e(T)&&A(p,1)})}var H=E(fe,2);{var ve=A=>{var X=Zt(),U=te(X);me(U,()=>et,(de,be)=>{be(de,{})});var ee=E(U,2);{var le=de=>{var be=jt(),Oe=ye(be,!0);Y(Be=>ne(Oe,Be),[()=>u.ui_imageActionsMenu_dimensions_label({width:Ke(e(w).width),height:Ke(e(w).height)})]),y(de,be)};q(ee,de=>{e(w)&&de(le)})}var ue=E(ee,2);{var Fe=de=>{var be=Dt(),Oe=ye(be,!0);Y(Be=>ne(Oe,Be),[()=>nt(e(L))]),y(de,be)};q(ue,de=>{e(L)!==null&&de(Fe)})}y(A,X)};q(H,A=>{(e(w)||e(L)!==null)&&A(ve)})}y(D,oe)},$$slots:{default:!0}})}),y(Q,F)},$$slots:{default:!0}})}),y(l,f)},m=$(()=>We(o()));q(n,l=>{e(m)&&l(r)})}return y(i,J),Te(G)}var Ht=W('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function it(i,t){if(new.target)return ze({component:it,...i});Ee(t,!0);let o=g(t,"children",7),c=g(t,"minZoom",7,.25),s=g(t,"maxZoom",7,8),_=g(t,"onScaleChange",7);const h=1.25,I=.0015,C=.01,T=4;let w=se(1),L=se(0),S=se(0),d=se(!1),M=se(null);xe(()=>{_()?.(e(w))});let N=null,b=0,O=0,K=0,ae=!1;const B=$(()=>_t(e(w),{style:"percent",maximumFractionDigits:0}));function G(a){return Math.min(s(),Math.max(c(),a))}function J(a,p,H){const ve=G(H),A=e(M)?.getBoundingClientRect(),X=A?a-A.left:0,U=A?p-A.top:0;P(L,X-(X-e(L))/e(w)*ve),P(S,U-(U-e(S))/e(w)*ve),P(w,ve,!0)}function n(a){const p=e(M)?.getBoundingClientRect();p?J(p.left+p.width/2,p.top+p.height/2,a):P(w,G(a),!0)}function r(){P(w,1),P(L,0),P(S,0)}function m(a){a.preventDefault();const p=a.ctrlKey?C:I;J(a.clientX,a.clientY,e(w)*Math.exp(-a.deltaY*p))}xe(()=>{const a=e(M);if(a)return a.addEventListener("wheel",m,{passive:!1}),()=>a.removeEventListener("wheel",m)});function l(a){if(a.metaKey||a.ctrlKey||a.altKey)return!1;if(a.key==="+"||a.key==="=")n(e(w)*h);else if(a.key==="-")n(e(w)/h);else if(a.key==="0")r();else return!1;return a.preventDefault(),!0}function f(a){if(a.button>0)return;P(d,!0),N=a.pointerId,b=a.clientX,O=a.clientY,K=0;const p=a.currentTarget;typeof p.setPointerCapture=="function"&&p.setPointerCapture(a.pointerId)}function k(a){if(!e(d)||a.pointerId!==N)return;const p=a.clientX-b,H=a.clientY-O;K+=Math.abs(p)+Math.abs(H),P(L,e(L)+p),P(S,e(S)+H),b=a.clientX,O=a.clientY}function z(a){if(!e(d)||a.pointerId!==N)return;P(d,!1),N=null,K>T&&(ae=!0);const p=a.currentTarget;typeof p.hasPointerCapture=="function"&&typeof p.releasePointerCapture=="function"&&p.hasPointerCapture(a.pointerId)&&p.releasePointerCapture(a.pointerId)}function R(a){ae&&(ae=!1,a.preventDefault(),a.stopPropagation())}function Q(a){const p=Number.parseFloat(a.currentTarget.value);Number.isFinite(p)&&n(p)}var j={handleKeydown:l,get children(){return o()},set children(a){o(a),v()},get minZoom(){return c()},set minZoom(a=.25){c(a),v()},get maxZoom(){return s()},set maxZoom(a=8){s(a),v()},get onScaleChange(){return _()},set onScaleChange(a){_(a),v()},$set:Ae,$on:(a,p)=>Ue(t,a,p)},F=Ht(),V=pe(F),ce=pe(V);je(ce,o),ge(V);var x=E(V,2),re=pe(x);{let a=$(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel());Le(re,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)/h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return wt}})},$$slots:{default:!0}})}var D=E(re,2),he=pe(D);{let a=$(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel());Mt(he,{class:"accent-white",get min(){return c()},get max(){return s()},step:"0.01",get value(){return e(w)},oninput:Q,get"aria-label"(){return e(a)},get title(){return e(p)},"data-testid":"zoom-pan-slider"})}ge(D);var oe=E(D,2);{let a=$(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel());Le(oe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)*h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return yt}})},$$slots:{default:!0}})}var Z=E(oe,2),ie=ye(Z,!0),fe=E(Z,2);{let a=$(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel());Le(fe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:r,get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return xt}})},$$slots:{default:!0}})}return ge(x),ge(F),Se(F,a=>P(M,a),()=>e(M)),Y((a,p)=>{pt(F,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(d)?"cursor-grabbing":"cursor-grab"}`),ke(F,"aria-label",a),gt(V,`transform: translate(${e(L)??""}px, ${e(S)??""}px) scale(${e(w)??""}); transform-origin: 0 0;`),ke(x,"aria-label",p),ne(ie,e(B))},[()=>u.ui_zoomPanViewport_viewport_ariaLabel(),()=>u.ui_zoomPanViewport_controls_ariaLabel()]),Ce("pointerdown",F,f),Ce("pointermove",F,k),Ce("pointerup",F,z),Ne("pointercancel",F,z),Ne("click",F,R,!0),Ce("keydown",F,l),Ce("pointerdown",x,a=>a.stopPropagation()),y(i,F),Te(j)}Ve(["pointerdown","pointermove","pointerup","keydown"]);var Xt=W('<img class="max-h-[90vh] max-w-[90vw] rounded-lg object-contain" draggable="false" data-media-lightbox-content=""/>');function Yt(i,t){if(new.target)return ze({component:Yt,...i});Ee(t,!0);const o=b=>{var O=we(),K=te(O);{var ae=B=>{Se(ot(B,{get imageUrl(){return s()},get imageName(){return _()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(L)},set open(G){P(L,G,!0)}}),G=>P(w,G,!0),()=>e(w))};q(K,B=>{C()&&B(ae)})}y(b,O)};let c=g(t,"open",15,!1),s=g(t,"imageUrl",7),_=g(t,"imageName",23,()=>u.ui_imageLightbox_image_alt()),h=g(t,"onClose",7),I=g(t,"openerElement",7,null),C=g(t,"showActionsMenu",7,!1),T=se(void 0),w=se(void 0),L=se(!1);xe(()=>{c()||P(L,!1)});function S(b){d(b),b.defaultPrevented||e(T)?.handleKeydown(b)}function d(b){c()&&C()&&e(w)?.handleCopy(b)}function M(b){!C()||!We(s())||(b.preventDefault(),b.stopPropagation(),P(L,!0))}var N={get open(){return c()},set open(b=!1){c(b),v()},get imageUrl(){return s()},set imageUrl(b){s(b),v()},get imageName(){return _()},set imageName(b=u.ui_imageLightbox_image_alt()){_(b),v()},get onClose(){return h()},set onClose(b){h(b),v()},get openerElement(){return I()},set openerElement(b=null){I(b),v()},get showActionsMenu(){return C()},set showActionsMenu(b=!1){C(b),v()},$set:Ae,$on:(b,O)=>Ue(t,b,O)};{let b=$(()=>u.ui_imageLightbox_preview_ariaLabel()),O=$(()=>u.ui_imageLightbox_close_ariaLabel());Xe(i,{get ariaLabel(){return e(b)},get closeLabel(){return e(O)},get onClose(){return h()},get openerElement(){return I()},get actions(){return o},onKeydown:S,onCopy:d,get open(){return c()},set open(K){c(K)},children:(K,ae)=>{var B=we(),G=te(B);ft(G,s,J=>{Se(it(J,{children:(n,r)=>{var m=Xt();Y(()=>{ke(m,"src",s()),ke(m,"alt",_())}),Ce("contextmenu",m,M),y(n,m)},$$slots:{default:!0}}),n=>P(T,n,!0),()=>e(T))}),y(K,B)},$$slots:{default:!0}})}return Te(N)}Ve(["contextmenu"]);var qt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),Gt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),Jt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),Qt=W("<!> <!> <!> <!>",1),en=W("<!> <!> <!>",1),tn=W("<!> <!>",1);function lt(i,t){if(new.target)return ze({component:lt,...i});Ee(t,!0);let o=g(t,"videoUrl",7),c=g(t,"videoName",7),s=g(t,"sourceKind",7),_=g(t,"mimeType",7),h=g(t,"open",15,!1),I=g(t,"triggerClass",7),C=g(t,"contentClass",7);const T=$(()=>Ze(o())),w=$(()=>Ye(o())),L=$(()=>s()??(e(T)?"inline":e(w)?"workspace":"remote"));let S=se(null),d=se(null),M=se(null),N=null;function b(){if(N===o())return;const n=N=o();P(S,null),P(d,null),P(M,e(T)?rt(e(T).base64):null,!0);const r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>{N===n&&(Number.isFinite(r.duration)&&r.duration>0&&P(S,r.duration,!0),r.videoWidth>0&&r.videoHeight>0&&P(d,{width:r.videoWidth,height:r.videoHeight},!0))},r.src=o(),e(T)||fetch(o()).then(m=>m.ok?m.blob():null).then(m=>{m&&N===n&&P(M,m.size,!0)}).catch(()=>{})}function O(){const n=e(w)?.path.split("/").pop();if(n)return n;const r=(c()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(r))return r;const m=(_()??e(T)?.mimeType)==="video/webm"?"webm":"mp4";return`${r}.${m}`}async function K(){let n=null;try{let r=o();if(!e(T)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);n=URL.createObjectURL(await l.blob()),r=n}const m=document.createElement("a");m.href=r,m.download=O(),document.body.appendChild(m),m.click(),m.remove(),n&&URL.revokeObjectURL(n)}catch{n&&URL.revokeObjectURL(n),_e.error(u.ui_videoActionsMenu_downloadFailed_error())}}async function ae(n,r){try{await Re(n),_e.success(r)}catch{_e.error(u.ui_videoActionsMenu_copyFailed_error())}}xe(()=>{h()&&b()}),xe(()=>{if(h())return He(()=>{h(!1)})});var B={get videoUrl(){return o()},set videoUrl(n){o(n),v()},get videoName(){return c()},set videoName(n){c(n),v()},get sourceKind(){return s()},set sourceKind(n){s(n),v()},get mimeType(){return _()},set mimeType(n){_(n),v()},get open(){return h()},set open(n=!1){h(n),v()},get triggerClass(){return I()},set triggerClass(n){I(n),v()},get contentClass(){return C()},set contentClass(n){C(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},G=we(),J=te(G);return me(J,()=>tt,(n,r)=>{r(n,{get open(){return h()},set open(m){h(m)},children:(m,l)=>{var f=tn(),k=te(f);{let R=$(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",I())),Q=$(()=>u.ui_videoActionsMenu_trigger_ariaLabel());me(k,()=>Ge,(j,F)=>{F(j,{get class(){return e(R)},get"aria-label"(){return e(Q)},onclick:V=>V.stopPropagation(),children:(V,ce)=>{Qe(V,{class:"size-3.5"})},$$slots:{default:!0}})})}var z=E(k,2);me(z,()=>Je,(R,Q)=>{Q(R,{get class(){return C()},align:"end",children:(j,F)=>{var V=en(),ce=te(V);me(ce,()=>$e,(Z,ie)=>{ie(Z,{onSelect:()=>void K(),children:(fe,a)=>{Me();var p=Ie();Y(H=>ne(p,H),[()=>u.ui_videoActionsMenu_download_label()]),y(fe,p)},$$slots:{default:!0}})});var x=E(ce,2);{var re=Z=>{var ie=we(),fe=te(ie);me(fe,()=>$e,(a,p)=>{p(a,{onSelect:()=>void ae(e(w).path,u.ui_videoActionsMenu_pathCopied_label()),children:(H,ve)=>{Me();var A=Ie();Y(X=>ne(A,X),[()=>u.ui_videoActionsMenu_copyPath_label()]),y(H,A)},$$slots:{default:!0}})}),y(Z,ie)},D=Z=>{var ie=we(),fe=te(ie);me(fe,()=>$e,(a,p)=>{p(a,{onSelect:()=>void ae(o(),u.ui_videoActionsMenu_linkCopied_label()),children:(H,ve)=>{Me();var A=Ie();Y(X=>ne(A,X),[()=>u.ui_videoActionsMenu_copyLink_label()]),y(H,A)},$$slots:{default:!0}})}),y(Z,ie)};q(x,Z=>{e(L)==="workspace"&&e(w)?Z(re):e(L)==="remote"&&Z(D,1)})}var he=E(x,2);{var oe=Z=>{var ie=Qt(),fe=te(ie);me(fe,()=>et,(U,ee)=>{ee(U,{})});var a=E(fe,2);{var p=U=>{var ee=qt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_duration_label({duration:ht(e(S)*1e3)})]),y(U,ee)};q(a,U=>{e(S)!==null&&U(p)})}var H=E(a,2);{var ve=U=>{var ee=Gt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_dimensions_label({width:Ke(e(d).width),height:Ke(e(d).height)})]),y(U,ee)};q(H,U=>{e(d)&&U(ve)})}var A=E(H,2);{var X=U=>{var ee=Jt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>nt(e(M))]),y(U,ee)};q(A,U=>{e(M)!==null&&U(X)})}y(Z,ie)};q(he,Z=>{(e(S)!==null||e(d)||e(M)!==null)&&Z(oe)})}y(j,V)},$$slots:{default:!0}})}),y(m,f)},$$slots:{default:!0}})}),y(i,G),Te(B)}var nn=W('<p class="type-body text-white/80" role="status"> </p>'),an=W('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function rn(i,t){if(new.target)return ze({component:rn,...i});Ee(t,!0);const o=d=>{lt(d,{get videoUrl(){return s()},get videoName(){return _()},get sourceKind(){return I()},get mimeType(){return C()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let c=g(t,"open",15,!1),s=g(t,"videoUrl",7),_=g(t,"videoName",23,()=>u.chat_videoBlock_fromAgent_label()),h=g(t,"poster",7),I=g(t,"sourceKind",7),C=g(t,"mimeType",7),T=g(t,"openerElement",7,null),w=g(t,"onClose",7),L=se(!1);xe(()=>{!c()||!s()||P(L,!1)});var S={get open(){return c()},set open(d=!1){c(d),v()},get videoUrl(){return s()},set videoUrl(d){s(d),v()},get videoName(){return _()},set videoName(d=u.chat_videoBlock_fromAgent_label()){_(d),v()},get poster(){return h()},set poster(d){h(d),v()},get sourceKind(){return I()},set sourceKind(d){I(d),v()},get mimeType(){return C()},set mimeType(d){C(d),v()},get openerElement(){return T()},set openerElement(d=null){T(d),v()},get onClose(){return w()},set onClose(d){w(d),v()},$set:Ae,$on:(d,M)=>Ue(t,d,M)};{let d=$(()=>u.chat_videoBlock_dialog_title({name:_()})),M=$(()=>u.chat_videoBlock_close_ariaLabel());Xe(i,{get ariaLabel(){return e(d)},get closeLabel(){return e(M)},get openerElement(){return T()},get onClose(){return w()},get actions(){return o},get open(){return c()},set open(N){c(N)},children:(N,b)=>{var O=an(),K=pe(O),ae=ye(K,!0),B=E(K,2);{var G=J=>{var n=nn(),r=ye(n,!0);Y(m=>ne(r,m),[()=>u.chat_videoBlock_unavailable_description()]),y(J,n)};q(B,J=>{e(L)&&J(G)})}ge(O),Y(J=>{ke(K,"src",s()),ke(K,"poster",h()),ke(K,"aria-label",_()),ne(ae,J)},[()=>u.chat_videoBlock_unsupported_description()]),Ne("error",K,()=>P(L,!0)),y(N,O)},$$slots:{default:!0}})}return Te(S)}var on=W('<span class="block truncate text-foreground"> </span>'),ln=W("<!> ",1),sn=W("<!> <!>",1),cn=W('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),un=W('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function dn(i,t){if(new.target)return ze({component:dn,...i});Ee(t,!0);let o=g(t,"name",7),c=g(t,"reason",7),s=g(t,"path",7),_=g(t,"workspaceId",7),h=g(t,"onRetry",7);const I=$(()=>c()==="missing"?u.ui_mediaUnavailable_missing_description():c()==="unsupported"?u.ui_mediaUnavailable_unsupported_description():c()==="other-workspace"?u.ui_mediaUnavailable_otherWorkspace_description():c()==="invalid-link"?u.ui_mediaUnavailable_invalidLink_description():u.ui_mediaUnavailable_loadFailed_description());function C(r){r.preventDefault(),r.stopPropagation()}function T(r){C(r),h()?.()}async function w(r){if(C(r),!!s())try{await Re(s()),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function L(r){if(C(r),!s()||!_())return;const m=s().split("/").map(encodeURIComponent).join("/");Et(`intent://local/file/${m}`,{workspaceId:ut(_())})}var S={get name(){return o()},set name(r){o(r),v()},get reason(){return c()},set reason(r){c(r),v()},get path(){return s()},set path(r){s(r),v()},get workspaceId(){return _()},set workspaceId(r){_(r),v()},get onRetry(){return h()},set onRetry(r){h(r),v()},$set:Ae,$on:(r,m)=>Ue(t,r,m)},d=un(),M=pe(d),N=pe(M),b=pe(N);Pe(b,{get icon(){return kt},class:"size-3.5"}),ge(N);var O=E(N,2),K=pe(O);{var ae=r=>{var m=on(),l=ye(m,!0);De(m,(f,k)=>Tt?.(f,k),o),Y(()=>ne(l,o())),y(r,m)};q(K,r=>{o()&&r(ae)})}var B=E(K,2),G=ye(B,!0);ge(O),ge(M);var J=E(M,2);{var n=r=>{var m=cn(),l=pe(m);{var f=R=>{{let Q=$(()=>u.chat_shared_retry_label());Le(R,{variant:"ghost",size:"icon-compact",get tooltip(){return e(Q)},onclick:T,children:(j,F)=>{Pe(j,{get icon(){return Ct},size:"xs"})},$$slots:{default:!0}})}};q(l,R=>{h()&&R(f)})}var k=E(l,2);{var z=R=>{var Q=sn(),j=te(Q);{var F=ce=>{Le(ce,{variant:"ghost",size:"compact",onclick:L,children:(x,re)=>{var D=ln(),he=te(D);Pe(he,{get icon(){return Lt},size:"xs"});var oe=E(he);Y(Z=>ne(oe,` ${Z??""}`),[()=>u.chat_changesPanel_openFile_tooltip()]),y(x,D)},$$slots:{default:!0}})};q(j,ce=>{_()&&c()!=="other-workspace"&&c()!=="invalid-link"&&ce(F)})}var V=E(j,2);{let ce=$(()=>u.ui_imageActionsMenu_copyPath_label());Le(V,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ce)},onclick:w,children:(x,re)=>{Pe(x,{get icon(){return Pt},size:"xs"})},$$slots:{default:!0}})}y(R,Q)};q(k,R=>{s()&&R(z)})}ge(m),y(r,m)};q(J,r=>{(h()||s())&&r(n)})}return ge(d),Y(()=>{ke(d,"data-reason",c()),ne(G,e(I))}),y(i,d),Te(S)}export{ot as I,Xe as M,lt as V,it as Z,Yt as a,dn as b,rn as c,rt as d,Ft as e,We as f,St as m,Ye as p,Bn as r,jn as s};
1
+ import{$ as st}from"./DkYquFOp.js";import{nW as ct,bq as ut}from"./BPo1GPk4.js";import{g as dt}from"./CMiilI_P.js";import{t as ze,bo as g,bw as Ae,b as Ue,bm as u,br as mt}from"./1KDVFF23.js";import{ai as Ve,bs as Ee,ca as xe,aD as e,a7 as we,ay as te,W as y,bn as Te,bV as se,aA as v,a5 as pe,bS as E,bH as P,bA as ge,b_ as Y,aj as Ce,aw as Ne,bl as ye,bO as ne,aB as W,c9 as $,be as Me,b$ as Ie}from"./3SdAC2_C.js";import{i as q}from"./Zg9SWWIQ.js";import{k as ft}from"./Dhj-Oo-y.js";import{s as ke,e as qe,f as pt,g as gt}from"./D8B7qxXm.js";import{b as Se}from"./Dn334wJv.js";import{c as me}from"./DpSAF6fh.js";import{q as He,l as Ge,d as Je,e as $e,K as Qe,h as et,M as tt}from"./DHbv9I-C.js";import{a as vt}from"./CC7to1B5.js";import{m as _e}from"./D7vAVIvz.js";import{f as Le}from"./DPbnmxjX.js";import"./BpT_ybtH.js";import{l as Ke,f as nt,m as _t,a as ht}from"./CntPxeXh.js";import"./ChTqQfQN.js";import"./jUAybD8G.js";import"./Dzl5aoA8.js";import{bL as Re}from"./CHHUtp07.js";import{s as je}from"./Dmy603At.js";import{F as Pe,d3 as bt,bW as wt,bX as yt,cq as xt,bF as kt,cr as Ct,aZ as Pt,a8 as Lt}from"./BZytk_HL.js";import{S as Mt}from"./Dfq_rEeO.js";import{n as It,g as $t}from"./CjK2zm52.js";import{e as De}from"./CYCawVEx.js";import{i as zt,f as At}from"./xJBWkpxc.js";import{P as Ut}from"./7n3mxV6t.js";import{h as Et}from"./DkY0xIi7.js";import{t as Tt}from"./DAsc1V4f.js";function Nt(i,t){return i?.isExternalLink===!0&&typeof i.workspaceId=="string"&&i.workspaceId?i.workspaceId:t||void 0}function St(i,t,o){const c=i.label||i.id||"mention";if(i.type==="member")return st(c);if(i.type==="note"&&i.id&&o){const s=Nt(i.meta,t),_=s?o(s,i.id)?.trim():void 0;if(_)return _}return c}function Bn(i,t,o){if(typeof document>"u"||!i.includes('data-type="note"'))return i;const c=document.createElement("template");c.innerHTML=i;let s=!1;for(const _ of c.content.querySelectorAll('[data-mention][data-type="note"]')){let h=null;try{h=JSON.parse(_.getAttribute("data-meta")||"{}")}catch{h=null}const I=_.textContent??"",C=St({type:"note",id:_.getAttribute("data-id"),label:I,meta:h},t,o);C!==I&&(_.textContent=C,s=!0)}return s?c.innerHTML:i}const jn=(i,t)=>{let o;try{o=dt().state}catch{return}const c=o?.workspaceNotes?.byWorkspaceId?.[i]?.notes;return c?ct(c,t)?.title:void 0};var Kt=W('<p class="mt-2 max-w-[90vw] rounded-md bg-black/60 px-3 py-1.5 text-center text-sm text-white"> </p>'),Rt=W('<div data-media-lightbox-root="" data-image-lightbox-root="" class="fixed inset-0 z-[1000] flex cursor-zoom-out flex-col items-center justify-center bg-black/80 p-4 backdrop-blur-sm" style="pointer-events: auto;" role="dialog" aria-modal="true" tabindex="-1"><div class="absolute right-4 top-4 z-[1002] flex items-center gap-1"><!> <!></div> <div class="flex min-h-0 w-full flex-1 items-center justify-center"><!></div> <!></div>');function Xe(i,t){if(new.target)return ze({component:Xe,...i});Ee(t,!0);let o=g(t,"open",15,!1),c=g(t,"ariaLabel",7),s=g(t,"closeLabel",7),_=g(t,"onClose",7),h=g(t,"openerElement",7,null),I=g(t,"children",7),C=g(t,"actions",7),T=g(t,"caption",7),w=g(t,"onKeydown",7),L=g(t,"onCopy",7);const S=zt(),d=At(b);let M=se(null),N=se(null);function b(){o()&&(o(!1),_()?.(),h()?.isConnected&&h().focus({preventScroll:!0}))}function O(n){(n.target instanceof Element?n.target:null)?.closest('[data-media-lightbox-content], [role="toolbar"], button, input')||b()}function K(n){if(w()?.(n),n.defaultPrevented||n.key!=="Tab"||!e(M))return;const r=Array.from(e(M).querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])')),m=r[0],l=r[r.length-1];!m||!l||(n.shiftKey&&document.activeElement===m?(n.preventDefault(),l.focus()):!n.shiftKey&&document.activeElement===l&&(n.preventDefault(),m.focus()))}xe(()=>{if(o())return He(b)}),xe(()=>{!o()||!e(N)||requestAnimationFrame(()=>e(N)?.focus())});var ae={get open(){return o()},set open(n=!1){o(n),v()},get ariaLabel(){return c()},set ariaLabel(n){c(n),v()},get closeLabel(){return s()},set closeLabel(n){s(n),v()},get onClose(){return _()},set onClose(n){_(n),v()},get openerElement(){return h()},set openerElement(n=null){h(n),v()},get children(){return I()},set children(n){I(n),v()},get actions(){return C()},set actions(n){C(n),v()},get caption(){return T()},set caption(n){T(n),v()},get onKeydown(){return w()},set onKeydown(n){w(n),v()},get onCopy(){return L()},set onCopy(n){L(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},B=we(),G=te(B);{var J=n=>{{let r=$(()=>S?.target()??"body");Ut(n,{get target(){return e(r)},zIndex:1e3,children:(m,l)=>{var f=Rt(),k=pe(f),z=pe(k);{var R=x=>{var re=we(),D=te(re);je(D,C),y(x,re)};q(z,x=>{C()&&x(R)})}var Q=E(z,2);Le(Q,{variant:"ghost",size:"icon",class:"text-white hover:bg-white/20 hover:text-white",onclick:b,get"aria-label"(){return s()},get ref(){return e(N)},set ref(x){P(N,x,!0)},children:(x,re)=>{Pe(x,{get icon(){return bt},size:"lg"})},$$slots:{default:!0}}),ge(k),De(k,x=>d?.(x));var j=E(k,2),F=pe(j);je(F,I),ge(j),De(j,x=>d?.(x));var V=E(j,2);{var ce=x=>{var re=Kt(),D=ye(re,!0);Y(()=>ne(D,T())),y(x,re)};q(V,x=>{T()&&x(ce)})}ge(f),Se(f,x=>P(M,x),()=>e(M)),Y(()=>ke(f,"aria-label",c())),Ce("click",f,O),Ce("keydown",f,K),Ne("copy",f,function(...x){L()?.apply(this,x)}),It(3,f,()=>$t,()=>({tier:"moderate"})),y(m,f)},$$slots:{default:!0}})}};q(G,n=>{o()&&n(J)})}return y(i,B),Te(ae)}Ve(["click","keydown"]);function Ye(i){if(!i.startsWith("workspace-file://"))return null;const o=i.slice(17).split(/[?#]/)[0].split("/"),c=o[0],s=o.slice(1);if(!c||s.length===0)return null;const _=[];for(const h of s){if(!h)return null;try{_.push(decodeURIComponent(h))}catch{return null}}return{workspaceId:c,path:_.join("/")}}function at(i){try{return new URL(i).protocol==="https:"}catch{return!1}}function Ze(i){const t=/^data:([^;,]+);base64,(.*)$/s.exec(i);return t?{mimeType:t[1],base64:t[2]}:null}function We(i){return at(i)||Ye(i)!==null||/^workspace-asset:\/\/[^/?#]+/.test(i)||/^data:image\/[a-z0-9.+-]+(?:;[^,]*)?,/i.test(i)}function rt(i){if(i.length===0)return 0;let t=0;return i.endsWith("==")?t=2:i.endsWith("=")&&(t=1),Math.floor(i.length*3/4)-t}function Ft(i,t){const o=atob(i),c=new Uint8Array(o.length);for(let s=0;s<o.length;s++)c[s]=o.charCodeAt(s);return new Blob([c],{type:t})}const Ot={"image/png":"png","image/jpeg":"jpg","image/gif":"gif","image/webp":"webp","image/svg+xml":"svg","image/avif":"avif","image/bmp":"bmp"};function Bt(i){if(i.workspacePath){const s=i.workspacePath.split("/").pop();if(s)return s}const t=(i.imageName||"image").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(t))return t;const o=i.mimeType?.split(";")[0].trim().toLowerCase(),c=o&&Ot[o]||"png";return`${t}.${c}`}var jt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-dimensions"> </div>'),Dt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="image-info-size"> </div>'),Zt=W("<!> <!> <!>",1),Wt=W("<!> <!> <!> <!>",1),Vt=W("<!> <!>",1);function ot(i,t){if(new.target)return ze({component:ot,...i});Ee(t,!0);let o=g(t,"imageUrl",7),c=g(t,"imageName",7),s=g(t,"open",15,!1),_=g(t,"triggerClass",7),h=g(t,"contentClass",7);const I=$(()=>Ze(o())),C=$(()=>Ye(o())),T=$(()=>at(o()));let w=se(null),L=se(null),S=null;function d(){if(S===o())return;const l=S=o();P(w,null),P(L,e(I)?rt(e(I).base64):null,!0);const f=new Image;f.onload=()=>{S===l&&P(w,{width:f.naturalWidth,height:f.naturalHeight},!0)},f.src=o(),e(I)||fetch(o()).then(k=>k.ok?k.blob():null).then(k=>{k&&S===l&&P(L,k.size,!0)}).catch(()=>{})}xe(()=>{s()&&d()}),xe(()=>{if(s())return He(()=>{s(!1)})});async function M(l=o()){const f=Ze(l);if(f)return Ft(f.base64,f.mimeType);const k=await fetch(l);if(!k.ok)throw new Error(`Image fetch failed: ${k.status}`);return await k.blob()}async function N(){let l=null;try{let f=o(),k=e(I)?.mimeType;if(!e(I)){const R=await M();k=R.type,l=URL.createObjectURL(R),f=l}const z=document.createElement("a");z.href=f,z.download=Bt({workspacePath:e(C)?.path,imageName:c(),mimeType:k}),document.body.appendChild(z);try{z.click()}finally{z.remove()}}catch{_e.error(u.ui_imageActionsMenu_downloadFailed_error())}finally{l&&URL.revokeObjectURL(l)}}async function b(){if(e(C))try{await Re(e(C).path),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function O(){if(e(T))try{await Re(o()),_e.success(u.ui_imageActionsMenu_linkCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}async function K(l){let f,k;try{let z;if(l.type.split(";")[0].trim()==="image/svg+xml"){k=URL.createObjectURL(l);const j=new Image;j.src=k,await j.decode(),z=j}else z=f=await createImageBitmap(l);const R=document.createElement("canvas");R.width=z instanceof HTMLImageElement?z.naturalWidth:z.width,R.height=z instanceof HTMLImageElement?z.naturalHeight:z.height;const Q=R.getContext("2d");if(!Q)throw new Error("2d canvas context unavailable");return Q.drawImage(z,0,0),await new Promise((j,F)=>{R.toBlob(V=>V?j(V):F(new Error("canvas toBlob failed")),"image/png")})}finally{f?.close(),k&&URL.revokeObjectURL(k)}}async function ae(l=o()){try{let f=await M(l);f.type!=="image/png"&&(f=await K(f)),await navigator.clipboard.write([new ClipboardItem({"image/png":f})]),_e.success(u.ui_imageActionsMenu_imageCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function B(l,f=o()){return l.defaultPrevented||!We(f)||l instanceof KeyboardEvent&&(l.key.toLowerCase()!=="c"||!(l.metaKey||l.ctrlKey)||l.altKey||l.shiftKey||l.isComposing)||vt(l.target)||document.getSelection()?.toString()?!1:(l.preventDefault(),l.stopPropagation(),l instanceof KeyboardEvent&&l.repeat||(ae(f),s(!1)),!0)}var G={handleCopy:B,get imageUrl(){return o()},set imageUrl(l){o(l),v()},get imageName(){return c()},set imageName(l){c(l),v()},get open(){return s()},set open(l=!1){s(l),v()},get triggerClass(){return _()},set triggerClass(l){_(l),v()},get contentClass(){return h()},set contentClass(l){h(l),v()},$set:Ae,$on:(l,f)=>Ue(t,l,f)},J=we(),n=te(J);{var r=l=>{var f=we(),k=te(f);me(k,()=>tt,(z,R)=>{R(z,{get open(){return s()},set open(Q){s(Q)},children:(Q,j)=>{var F=Vt(),V=te(F);{const x=(D,he)=>{let oe=()=>(he?.()).props;{let Z=$(()=>u.ui_imageActionsMenu_trigger_ariaLabel());Le(D,mt(oe,{variant:"plain",size:"icon-sm",wrapContent:!1,get active(){return s()},get"aria-label"(){return e(Z)},children:(ie,fe)=>{Qe(ie,{class:"size-3.5"})},$$slots:{default:!0}}))}};let re=$(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",_()));me(V,()=>Ge,(D,he)=>{he(D,{get class(){return e(re)},onclick:oe=>oe.stopPropagation(),onkeydown:oe=>B(oe),oncopy:oe=>B(oe),child:x,$$slots:{child:!0}})})}var ce=E(V,2);me(ce,()=>Je,(x,re)=>{re(x,{get class(){return h()},align:"end",onkeydown:D=>B(D),oncopy:D=>B(D),children:(D,he)=>{var oe=Wt(),Z=te(oe);me(Z,()=>$e,(A,X)=>{X(A,{onSelect:()=>void N(),children:(U,ee)=>{Me();var le=Ie();Y(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_download_label()]),y(U,le)},$$slots:{default:!0}})});var ie=E(Z,2);me(ie,()=>$e,(A,X)=>{X(A,{onSelect:()=>void ae(),children:(U,ee)=>{Me();var le=Ie();Y(ue=>ne(le,ue),[()=>u.ui_imageActionsMenu_copyImage_label()]),y(U,le)},$$slots:{default:!0}})});var fe=E(ie,2);{var a=A=>{var X=we(),U=te(X);me(U,()=>$e,(ee,le)=>{le(ee,{onSelect:()=>void b(),children:(ue,Fe)=>{Me();var de=Ie();Y(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyPath_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,X)},p=A=>{var X=we(),U=te(X);me(U,()=>$e,(ee,le)=>{le(ee,{onSelect:()=>void O(),children:(ue,Fe)=>{Me();var de=Ie();Y(be=>ne(de,be),[()=>u.ui_imageActionsMenu_copyLink_label()]),y(ue,de)},$$slots:{default:!0}})}),y(A,X)};q(fe,A=>{e(C)?A(a):e(T)&&A(p,1)})}var H=E(fe,2);{var ve=A=>{var X=Zt(),U=te(X);me(U,()=>et,(de,be)=>{be(de,{})});var ee=E(U,2);{var le=de=>{var be=jt(),Oe=ye(be,!0);Y(Be=>ne(Oe,Be),[()=>u.ui_imageActionsMenu_dimensions_label({width:Ke(e(w).width),height:Ke(e(w).height)})]),y(de,be)};q(ee,de=>{e(w)&&de(le)})}var ue=E(ee,2);{var Fe=de=>{var be=Dt(),Oe=ye(be,!0);Y(Be=>ne(Oe,Be),[()=>nt(e(L))]),y(de,be)};q(ue,de=>{e(L)!==null&&de(Fe)})}y(A,X)};q(H,A=>{(e(w)||e(L)!==null)&&A(ve)})}y(D,oe)},$$slots:{default:!0}})}),y(Q,F)},$$slots:{default:!0}})}),y(l,f)},m=$(()=>We(o()));q(n,l=>{e(m)&&l(r)})}return y(i,J),Te(G)}var Ht=W('<div role="application" tabindex="0" data-testid="zoom-pan-viewport"><div class="flex h-full w-full items-center justify-center will-change-transform" data-testid="zoom-pan-content"><!></div> <div class="absolute bottom-4 left-1/2 z-10 flex -translate-x-1/2 cursor-default items-center gap-2 rounded-full bg-black/60 px-3 py-1.5 backdrop-blur-sm" role="toolbar" tabindex="-1" data-testid="zoom-pan-controls"><!> <div class="w-36"><!></div> <!> <span class="min-w-12 text-center text-xs tabular-nums text-white/90" data-testid="zoom-pan-percent"> </span> <!></div></div>');function it(i,t){if(new.target)return ze({component:it,...i});Ee(t,!0);let o=g(t,"children",7),c=g(t,"minZoom",7,.25),s=g(t,"maxZoom",7,8),_=g(t,"onScaleChange",7);const h=1.25,I=.0015,C=.01,T=4;let w=se(1),L=se(0),S=se(0),d=se(!1),M=se(null);xe(()=>{_()?.(e(w))});let N=null,b=0,O=0,K=0,ae=!1;const B=$(()=>_t(e(w),{style:"percent",maximumFractionDigits:0}));function G(a){return Math.min(s(),Math.max(c(),a))}function J(a,p,H){const ve=G(H),A=e(M)?.getBoundingClientRect(),X=A?a-A.left:0,U=A?p-A.top:0;P(L,X-(X-e(L))/e(w)*ve),P(S,U-(U-e(S))/e(w)*ve),P(w,ve,!0)}function n(a){const p=e(M)?.getBoundingClientRect();p?J(p.left+p.width/2,p.top+p.height/2,a):P(w,G(a),!0)}function r(){P(w,1),P(L,0),P(S,0)}function m(a){a.preventDefault();const p=a.ctrlKey?C:I;J(a.clientX,a.clientY,e(w)*Math.exp(-a.deltaY*p))}xe(()=>{const a=e(M);if(a)return a.addEventListener("wheel",m,{passive:!1}),()=>a.removeEventListener("wheel",m)});function l(a){if(a.metaKey||a.ctrlKey||a.altKey)return!1;if(a.key==="+"||a.key==="=")n(e(w)*h);else if(a.key==="-")n(e(w)/h);else if(a.key==="0")r();else return!1;return a.preventDefault(),!0}function f(a){if(a.button>0)return;P(d,!0),N=a.pointerId,b=a.clientX,O=a.clientY,K=0;const p=a.currentTarget;typeof p.setPointerCapture=="function"&&p.setPointerCapture(a.pointerId)}function k(a){if(!e(d)||a.pointerId!==N)return;const p=a.clientX-b,H=a.clientY-O;K+=Math.abs(p)+Math.abs(H),P(L,e(L)+p),P(S,e(S)+H),b=a.clientX,O=a.clientY}function z(a){if(!e(d)||a.pointerId!==N)return;P(d,!1),N=null,K>T&&(ae=!0);const p=a.currentTarget;typeof p.hasPointerCapture=="function"&&typeof p.releasePointerCapture=="function"&&p.hasPointerCapture(a.pointerId)&&p.releasePointerCapture(a.pointerId)}function R(a){ae&&(ae=!1,a.preventDefault(),a.stopPropagation())}function Q(a){const p=Number.parseFloat(a.currentTarget.value);Number.isFinite(p)&&n(p)}var j={handleKeydown:l,get children(){return o()},set children(a){o(a),v()},get minZoom(){return c()},set minZoom(a=.25){c(a),v()},get maxZoom(){return s()},set maxZoom(a=8){s(a),v()},get onScaleChange(){return _()},set onScaleChange(a){_(a),v()},$set:Ae,$on:(a,p)=>Ue(t,a,p)},F=Ht(),V=pe(F),ce=pe(V);je(ce,o),ge(V);var x=E(V,2),re=pe(x);{let a=$(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomOut_ariaLabel());Le(re,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)/h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return wt}})},$$slots:{default:!0}})}var D=E(re,2),he=pe(D);{let a=$(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomSlider_ariaLabel());Mt(he,{class:"accent-white",get min(){return c()},get max(){return s()},step:"0.01",get value(){return e(w)},oninput:Q,get"aria-label"(){return e(a)},get title(){return e(p)},"data-testid":"zoom-pan-slider"})}ge(D);var oe=E(D,2);{let a=$(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_zoomIn_ariaLabel());Le(oe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:()=>n(e(w)*h),get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return yt}})},$$slots:{default:!0}})}var Z=E(oe,2),ie=ye(Z,!0),fe=E(Z,2);{let a=$(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel()),p=$(()=>u.ui_zoomPanViewport_resetZoom_ariaLabel());Le(fe,{variant:"ghost",size:"icon-sm",class:"text-white hover:bg-white/20 hover:text-white",onclick:r,get"aria-label"(){return e(a)},get title(){return e(p)},children:(H,ve)=>{Pe(H,{get icon(){return xt}})},$$slots:{default:!0}})}return ge(x),ge(F),Se(F,a=>P(M,a),()=>e(M)),Y((a,p)=>{pt(F,1,`relative h-full w-full touch-none select-none overflow-hidden ${e(d)?"cursor-grabbing":"cursor-grab"}`),ke(F,"aria-label",a),gt(V,`transform: translate(${e(L)??""}px, ${e(S)??""}px) scale(${e(w)??""}); transform-origin: 0 0;`),ke(x,"aria-label",p),ne(ie,e(B))},[()=>u.ui_zoomPanViewport_viewport_ariaLabel(),()=>u.ui_zoomPanViewport_controls_ariaLabel()]),Ce("pointerdown",F,f),Ce("pointermove",F,k),Ce("pointerup",F,z),Ne("pointercancel",F,z),Ne("click",F,R,!0),Ce("keydown",F,l),Ce("pointerdown",x,a=>a.stopPropagation()),y(i,F),Te(j)}Ve(["pointerdown","pointermove","pointerup","keydown"]);var Xt=W('<img class="max-h-[90vh] max-w-[90vw] rounded-lg object-contain" draggable="false" data-media-lightbox-content=""/>');function Yt(i,t){if(new.target)return ze({component:Yt,...i});Ee(t,!0);const o=b=>{var O=we(),K=te(O);{var ae=B=>{Se(ot(B,{get imageUrl(){return s()},get imageName(){return _()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]",get open(){return e(L)},set open(G){P(L,G,!0)}}),G=>P(w,G,!0),()=>e(w))};q(K,B=>{C()&&B(ae)})}y(b,O)};let c=g(t,"open",15,!1),s=g(t,"imageUrl",7),_=g(t,"imageName",23,()=>u.ui_imageLightbox_image_alt()),h=g(t,"onClose",7),I=g(t,"openerElement",7,null),C=g(t,"showActionsMenu",7,!1),T=se(void 0),w=se(void 0),L=se(!1);xe(()=>{c()||P(L,!1)});function S(b){d(b),b.defaultPrevented||e(T)?.handleKeydown(b)}function d(b){c()&&C()&&e(w)?.handleCopy(b)}function M(b){!C()||!We(s())||(b.preventDefault(),b.stopPropagation(),P(L,!0))}var N={get open(){return c()},set open(b=!1){c(b),v()},get imageUrl(){return s()},set imageUrl(b){s(b),v()},get imageName(){return _()},set imageName(b=u.ui_imageLightbox_image_alt()){_(b),v()},get onClose(){return h()},set onClose(b){h(b),v()},get openerElement(){return I()},set openerElement(b=null){I(b),v()},get showActionsMenu(){return C()},set showActionsMenu(b=!1){C(b),v()},$set:Ae,$on:(b,O)=>Ue(t,b,O)};{let b=$(()=>u.ui_imageLightbox_preview_ariaLabel()),O=$(()=>u.ui_imageLightbox_close_ariaLabel());Xe(i,{get ariaLabel(){return e(b)},get closeLabel(){return e(O)},get onClose(){return h()},get openerElement(){return I()},get actions(){return o},onKeydown:S,onCopy:d,get open(){return c()},set open(K){c(K)},children:(K,ae)=>{var B=we(),G=te(B);ft(G,s,J=>{Se(it(J,{children:(n,r)=>{var m=Xt();Y(()=>{ke(m,"src",s()),ke(m,"alt",_())}),Ce("contextmenu",m,M),y(n,m)},$$slots:{default:!0}}),n=>P(T,n,!0),()=>e(T))}),y(K,B)},$$slots:{default:!0}})}return Te(N)}Ve(["contextmenu"]);var qt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-duration"> </div>'),Gt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-dimensions"> </div>'),Jt=W('<div class="type-caption px-2 py-1 text-muted-foreground" data-testid="video-info-size"> </div>'),Qt=W("<!> <!> <!> <!>",1),en=W("<!> <!> <!>",1),tn=W("<!> <!>",1);function lt(i,t){if(new.target)return ze({component:lt,...i});Ee(t,!0);let o=g(t,"videoUrl",7),c=g(t,"videoName",7),s=g(t,"sourceKind",7),_=g(t,"mimeType",7),h=g(t,"open",15,!1),I=g(t,"triggerClass",7),C=g(t,"contentClass",7);const T=$(()=>Ze(o())),w=$(()=>Ye(o())),L=$(()=>s()??(e(T)?"inline":e(w)?"workspace":"remote"));let S=se(null),d=se(null),M=se(null),N=null;function b(){if(N===o())return;const n=N=o();P(S,null),P(d,null),P(M,e(T)?rt(e(T).base64):null,!0);const r=document.createElement("video");r.preload="metadata",r.onloadedmetadata=()=>{N===n&&(Number.isFinite(r.duration)&&r.duration>0&&P(S,r.duration,!0),r.videoWidth>0&&r.videoHeight>0&&P(d,{width:r.videoWidth,height:r.videoHeight},!0))},r.src=o(),e(T)||fetch(o()).then(m=>m.ok?m.blob():null).then(m=>{m&&N===n&&P(M,m.size,!0)}).catch(()=>{})}function O(){const n=e(w)?.path.split("/").pop();if(n)return n;const r=(c()||"video").replace(/[/\\]/g,"_");if(/\.[A-Za-z0-9]+$/.test(r))return r;const m=(_()??e(T)?.mimeType)==="video/webm"?"webm":"mp4";return`${r}.${m}`}async function K(){let n=null;try{let r=o();if(!e(T)){const l=await fetch(o());if(!l.ok)throw new Error(`Video fetch failed: ${l.status}`);n=URL.createObjectURL(await l.blob()),r=n}const m=document.createElement("a");m.href=r,m.download=O(),document.body.appendChild(m),m.click(),m.remove(),n&&URL.revokeObjectURL(n)}catch{n&&URL.revokeObjectURL(n),_e.error(u.ui_videoActionsMenu_downloadFailed_error())}}async function ae(n,r){try{await Re(n),_e.success(r)}catch{_e.error(u.ui_videoActionsMenu_copyFailed_error())}}xe(()=>{h()&&b()}),xe(()=>{if(h())return He(()=>{h(!1)})});var B={get videoUrl(){return o()},set videoUrl(n){o(n),v()},get videoName(){return c()},set videoName(n){c(n),v()},get sourceKind(){return s()},set sourceKind(n){s(n),v()},get mimeType(){return _()},set mimeType(n){_(n),v()},get open(){return h()},set open(n=!1){h(n),v()},get triggerClass(){return I()},set triggerClass(n){I(n),v()},get contentClass(){return C()},set contentClass(n){C(n),v()},$set:Ae,$on:(n,r)=>Ue(t,n,r)},G=we(),J=te(G);return me(J,()=>tt,(n,r)=>{r(n,{get open(){return h()},set open(m){h(m)},children:(m,l)=>{var f=tn(),k=te(f);{let R=$(()=>qe("flex h-7 w-7 items-center justify-center rounded-md bg-black/60 text-white","hover:bg-black/75",I())),Q=$(()=>u.ui_videoActionsMenu_trigger_ariaLabel());me(k,()=>Ge,(j,F)=>{F(j,{get class(){return e(R)},get"aria-label"(){return e(Q)},onclick:V=>V.stopPropagation(),children:(V,ce)=>{Qe(V,{class:"size-3.5"})},$$slots:{default:!0}})})}var z=E(k,2);me(z,()=>Je,(R,Q)=>{Q(R,{get class(){return C()},align:"end",children:(j,F)=>{var V=en(),ce=te(V);me(ce,()=>$e,(Z,ie)=>{ie(Z,{onSelect:()=>void K(),children:(fe,a)=>{Me();var p=Ie();Y(H=>ne(p,H),[()=>u.ui_videoActionsMenu_download_label()]),y(fe,p)},$$slots:{default:!0}})});var x=E(ce,2);{var re=Z=>{var ie=we(),fe=te(ie);me(fe,()=>$e,(a,p)=>{p(a,{onSelect:()=>void ae(e(w).path,u.ui_videoActionsMenu_pathCopied_label()),children:(H,ve)=>{Me();var A=Ie();Y(X=>ne(A,X),[()=>u.ui_videoActionsMenu_copyPath_label()]),y(H,A)},$$slots:{default:!0}})}),y(Z,ie)},D=Z=>{var ie=we(),fe=te(ie);me(fe,()=>$e,(a,p)=>{p(a,{onSelect:()=>void ae(o(),u.ui_videoActionsMenu_linkCopied_label()),children:(H,ve)=>{Me();var A=Ie();Y(X=>ne(A,X),[()=>u.ui_videoActionsMenu_copyLink_label()]),y(H,A)},$$slots:{default:!0}})}),y(Z,ie)};q(x,Z=>{e(L)==="workspace"&&e(w)?Z(re):e(L)==="remote"&&Z(D,1)})}var he=E(x,2);{var oe=Z=>{var ie=Qt(),fe=te(ie);me(fe,()=>et,(U,ee)=>{ee(U,{})});var a=E(fe,2);{var p=U=>{var ee=qt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_duration_label({duration:ht(e(S)*1e3)})]),y(U,ee)};q(a,U=>{e(S)!==null&&U(p)})}var H=E(a,2);{var ve=U=>{var ee=Gt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>u.ui_videoActionsMenu_dimensions_label({width:Ke(e(d).width),height:Ke(e(d).height)})]),y(U,ee)};q(H,U=>{e(d)&&U(ve)})}var A=E(H,2);{var X=U=>{var ee=Jt(),le=ye(ee,!0);Y(ue=>ne(le,ue),[()=>nt(e(M))]),y(U,ee)};q(A,U=>{e(M)!==null&&U(X)})}y(Z,ie)};q(he,Z=>{(e(S)!==null||e(d)||e(M)!==null)&&Z(oe)})}y(j,V)},$$slots:{default:!0}})}),y(m,f)},$$slots:{default:!0}})}),y(i,G),Te(B)}var nn=W('<p class="type-body text-white/80" role="status"> </p>'),an=W('<div data-media-lightbox-content="" data-video-lightbox-root="" class="flex max-h-[90vh] max-w-[90vw] cursor-default flex-col items-center gap-3"><video controls="" preload="metadata" playsinline="" class="max-h-[85vh] max-w-[90vw] rounded-lg bg-black object-contain shadow-(--elevation-overlay)" data-testid="chat-video-player"> </video> <!></div>',2);function rn(i,t){if(new.target)return ze({component:rn,...i});Ee(t,!0);const o=d=>{lt(d,{get videoUrl(){return s()},get videoName(){return _()},get sourceKind(){return I()},get mimeType(){return C()},triggerClass:"h-9 w-9 bg-white/0 hover:bg-white/20",contentClass:"z-[1003]"})};let c=g(t,"open",15,!1),s=g(t,"videoUrl",7),_=g(t,"videoName",23,()=>u.chat_videoBlock_fromAgent_label()),h=g(t,"poster",7),I=g(t,"sourceKind",7),C=g(t,"mimeType",7),T=g(t,"openerElement",7,null),w=g(t,"onClose",7),L=se(!1);xe(()=>{!c()||!s()||P(L,!1)});var S={get open(){return c()},set open(d=!1){c(d),v()},get videoUrl(){return s()},set videoUrl(d){s(d),v()},get videoName(){return _()},set videoName(d=u.chat_videoBlock_fromAgent_label()){_(d),v()},get poster(){return h()},set poster(d){h(d),v()},get sourceKind(){return I()},set sourceKind(d){I(d),v()},get mimeType(){return C()},set mimeType(d){C(d),v()},get openerElement(){return T()},set openerElement(d=null){T(d),v()},get onClose(){return w()},set onClose(d){w(d),v()},$set:Ae,$on:(d,M)=>Ue(t,d,M)};{let d=$(()=>u.chat_videoBlock_dialog_title({name:_()})),M=$(()=>u.chat_videoBlock_close_ariaLabel());Xe(i,{get ariaLabel(){return e(d)},get closeLabel(){return e(M)},get openerElement(){return T()},get onClose(){return w()},get actions(){return o},get open(){return c()},set open(N){c(N)},children:(N,b)=>{var O=an(),K=pe(O),ae=ye(K,!0),B=E(K,2);{var G=J=>{var n=nn(),r=ye(n,!0);Y(m=>ne(r,m),[()=>u.chat_videoBlock_unavailable_description()]),y(J,n)};q(B,J=>{e(L)&&J(G)})}ge(O),Y(J=>{ke(K,"src",s()),ke(K,"poster",h()),ke(K,"aria-label",_()),ne(ae,J)},[()=>u.chat_videoBlock_unsupported_description()]),Ne("error",K,()=>P(L,!0)),y(N,O)},$$slots:{default:!0}})}return Te(S)}var on=W('<span class="block truncate text-foreground"> </span>'),ln=W("<!> ",1),sn=W("<!> <!>",1),cn=W('<span class="flex shrink-0 flex-wrap items-center gap-1"><!> <!></span>'),un=W('<div class="type-caption flex w-fit min-w-0 max-w-full items-center gap-3 whitespace-normal py-1 text-muted-foreground" role="status" data-testid="media-unavailable"><span class="flex min-w-0 max-w-full flex-1 items-start gap-2"><span class="first-line-icon" aria-hidden="true"><!></span> <span class="min-w-0"><!> <span class="block break-words"> </span></span></span> <!></div>');function dn(i,t){if(new.target)return ze({component:dn,...i});Ee(t,!0);let o=g(t,"name",7),c=g(t,"reason",7),s=g(t,"path",7),_=g(t,"workspaceId",7),h=g(t,"onRetry",7);const I=$(()=>c()==="missing"?u.ui_mediaUnavailable_missing_description():c()==="unsupported"?u.ui_mediaUnavailable_unsupported_description():c()==="other-workspace"?u.ui_mediaUnavailable_otherWorkspace_description():c()==="invalid-link"?u.ui_mediaUnavailable_invalidLink_description():u.ui_mediaUnavailable_loadFailed_description());function C(r){r.preventDefault(),r.stopPropagation()}function T(r){C(r),h()?.()}async function w(r){if(C(r),!!s())try{await Re(s()),_e.success(u.ui_imageActionsMenu_pathCopied_label())}catch{_e.error(u.ui_imageActionsMenu_copyFailed_error())}}function L(r){if(C(r),!s()||!_())return;const m=s().split("/").map(encodeURIComponent).join("/");Et(`intent://local/file/${m}`,{workspaceId:ut(_())})}var S={get name(){return o()},set name(r){o(r),v()},get reason(){return c()},set reason(r){c(r),v()},get path(){return s()},set path(r){s(r),v()},get workspaceId(){return _()},set workspaceId(r){_(r),v()},get onRetry(){return h()},set onRetry(r){h(r),v()},$set:Ae,$on:(r,m)=>Ue(t,r,m)},d=un(),M=pe(d),N=pe(M),b=pe(N);Pe(b,{get icon(){return kt},class:"size-3.5"}),ge(N);var O=E(N,2),K=pe(O);{var ae=r=>{var m=on(),l=ye(m,!0);De(m,(f,k)=>Tt?.(f,k),o),Y(()=>ne(l,o())),y(r,m)};q(K,r=>{o()&&r(ae)})}var B=E(K,2),G=ye(B,!0);ge(O),ge(M);var J=E(M,2);{var n=r=>{var m=cn(),l=pe(m);{var f=R=>{{let Q=$(()=>u.chat_shared_retry_label());Le(R,{variant:"ghost",size:"icon-compact",get tooltip(){return e(Q)},onclick:T,children:(j,F)=>{Pe(j,{get icon(){return Ct},size:"xs"})},$$slots:{default:!0}})}};q(l,R=>{h()&&R(f)})}var k=E(l,2);{var z=R=>{var Q=sn(),j=te(Q);{var F=ce=>{Le(ce,{variant:"ghost",size:"compact",onclick:L,children:(x,re)=>{var D=ln(),he=te(D);Pe(he,{get icon(){return Lt},size:"xs"});var oe=E(he);Y(Z=>ne(oe,` ${Z??""}`),[()=>u.chat_changesPanel_openFile_tooltip()]),y(x,D)},$$slots:{default:!0}})};q(j,ce=>{_()&&c()!=="other-workspace"&&c()!=="invalid-link"&&ce(F)})}var V=E(j,2);{let ce=$(()=>u.ui_imageActionsMenu_copyPath_label());Le(V,{variant:"ghost",size:"icon-compact",get tooltip(){return e(ce)},onclick:w,children:(x,re)=>{Pe(x,{get icon(){return Pt},size:"xs"})},$$slots:{default:!0}})}y(R,Q)};q(k,R=>{s()&&R(z)})}ge(m),y(r,m)};q(J,r=>{(h()||s())&&r(n)})}return ge(d),Y(()=>{ke(d,"data-reason",c()),ne(G,e(I))}),y(i,d),Te(S)}export{ot as I,Xe as M,lt as V,it as Z,Yt as a,dn as b,rn as c,rt as d,Ft as e,We as f,St as m,Ye as p,Bn as r,jn as s};
@@ -1 +1 @@
1
- import{t as G,bo as n,bw as H,b as W,bp as k}from"./Bv8Gaorn.js";import{bo as z,bs as B,a7 as m,ay as p,W as c,bn as D,aA as d,aD as h,a5 as I,bf as Q,bA as j,c9 as q,aB as E}from"./3SdAC2_C.js";import{i as F}from"./BQg4hK6W.js";import{s as _}from"./DZBnfhEV.js";import{b as J}from"./D85P44Dj.js";import{a as L,S as M}from"./njprJ3WZ.js";import{az as b,av as S,aQ as K}from"./BO3WriTy.js";var N=new Set(["$$slots","$$events","$$legacy","id","ref","children","child"]),O=E("<div><!></div>");function R(f,t){const u=z();if(new.target)return G({component:R,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"children",7),i=n(t,"child",7),x=k(t,N);const y=L.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get children(){return s()},set children(e){s(e),d()},get child(){return i()},set child(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,i,()=>({props:h(v)})),c(e,r)},C=e=>{var r=O();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>s()??Q),j(r),c(e,r)};F(P,e=>{i()?e(A):e(C,-1)})}return c(f,g),D(w)}var T=new Set(["$$slots","$$events","$$legacy","id","ref","child","children"]),U=E("<div><!></div>");function V(f,t){const u=z();if(new.target)return G({component:V,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"child",7),i=n(t,"children",7),x=k(t,T);const y=M.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get child(){return s()},set child(e){s(e),d()},get children(){return i()},set children(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,s,()=>({props:h(v)})),c(e,r)},C=e=>{var r=U();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>i()??Q),j(r),c(e,r)};F(P,e=>{s()?e(A):e(C,-1)})}return c(f,g),D(w)}export{R as S,V as a};
1
+ import{t as G,bo as n,bw as H,b as W,bp as k}from"./1KDVFF23.js";import{bo as z,bs as B,a7 as m,ay as p,W as c,bn as D,aA as d,aD as h,a5 as I,bf as Q,bA as j,c9 as q,aB as E}from"./3SdAC2_C.js";import{i as F}from"./Zg9SWWIQ.js";import{s as _}from"./Dmy603At.js";import{b as J}from"./D8B7qxXm.js";import{a as L,S as M}from"./aqQCGQpk.js";import{az as b,av as S,aQ as K}from"./DPbnmxjX.js";var N=new Set(["$$slots","$$events","$$legacy","id","ref","children","child"]),O=E("<div><!></div>");function R(f,t){const u=z();if(new.target)return G({component:R,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"children",7),i=n(t,"child",7),x=k(t,N);const y=L.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get children(){return s()},set children(e){s(e),d()},get child(){return i()},set child(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,i,()=>({props:h(v)})),c(e,r)},C=e=>{var r=O();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>s()??Q),j(r),c(e,r)};F(P,e=>{i()?e(A):e(C,-1)})}return c(f,g),D(w)}var T=new Set(["$$slots","$$events","$$legacy","id","ref","child","children"]),U=E("<div><!></div>");function V(f,t){const u=z();if(new.target)return G({component:V,...f});B(t,!0);let o=n(t,"id",23,()=>b(u)),a=n(t,"ref",15,null),s=n(t,"child",7),i=n(t,"children",7),x=k(t,T);const y=M.create({id:S(()=>o()),ref:S(()=>a(),e=>a(e))}),v=q(()=>K(x,y.props));var w={get id(){return o()},set id(e=b(u)){o(e),d()},get ref(){return a()},set ref(e=null){a(e),d()},get child(){return s()},set child(e){s(e),d()},get children(){return i()},set children(e){i(e),d()},$set:H,$on:(e,r)=>W(t,e,r)},g=m(),P=p(g);{var A=e=>{var r=m(),l=p(r);_(l,s,()=>({props:h(v)})),c(e,r)},C=e=>{var r=U();J(r,()=>({...h(v)}));var l=I(r);_(l,()=>i()??Q),j(r),c(e,r)};F(P,e=>{s()?e(A):e(C,-1)})}return c(f,g),D(w)}export{R as S,V as a};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/C0JDt0nm.js","/app/immutable/chunks/Bv8Gaorn.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/NgEAPl8f.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/8TUe2kcz.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/DZBnfhEV.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/Dr4PDf9D.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/CSbK1_CV.js","/app/immutable/chunks/B5bnHhgO.js","/app/immutable/chunks/D85P44Dj.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/mdoDOmuU.js","/app/immutable/chunks/D_o67XD6.js","/app/immutable/chunks/BkLJnbD1.js","/app/immutable/chunks/BQg4hK6W.js","/app/immutable/chunks/BO3WriTy.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/D1JjMDax.js","/app/immutable/chunks/kZanyiqf.js","/app/immutable/chunks/ChJ4msi3.js","/app/immutable/chunks/C44hzh9R.js","/app/immutable/chunks/BLYFfqzj.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/CiD4x8Gl.js","/app/immutable/chunks/DgaiTQpw.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/CpV-ehZ5.js","/app/immutable/chunks/iwQqOlmN.js","/app/immutable/chunks/-18XT1CI.js","/app/immutable/chunks/BWtq4mC4.js","/app/immutable/chunks/CM4xaytB.js","/app/immutable/chunks/4r36FIB7.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/1Wzdy1K8.js"])))=>i.map(i=>d[i]);
2
- import{_ as i}from"./Bv8Gaorn.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const v=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function E(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){v.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./C0JDt0nm.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await n(t,{preserveFocus:!0,background:e.assistantContent===!0,agentId:e.assistantAgentId})){if(e.assistantContent)return;const{openPanel:o}=await i(async()=>{const{openPanel:a}=await import("./NgEAPl8f.js").then(r=>r.I$);return{openPanel:a}},__vite__mapDeps([3,4,2,5,6,7,8,1,9,10,11]),import.meta.url),{store:f}=await i(async()=>{const{store:a}=await import("./4r36FIB7.js");return{store:a}},__vite__mapDeps([45,3,4,2,5,6,7,8,1,9,10,11,46,47]),import.meta.url);f.dispatch(o("chief"));const{goto:p}=await i(async()=>{const{goto:a}=await import("./1Wzdy1K8.js").then(r=>r.n);return{goto:a}},__vite__mapDeps([48,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(s(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!s(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(_,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./1Wzdy1K8.js").then(o=>o.n);return{goto:n}},__vite__mapDeps([48,2]),import.meta.url);return e.state?u(t,{state:e.state}):u(t)}const b=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:_,isHudWindowRenderer:d,isSettingsRoute:s,navigateToRoute:E},Symbol.toStringTag,{value:"Module"}));export{_ as S,s as a,y as b,l as c,h as d,T as e,b as f,d as i,E as n};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/Bu8LYT1B.js","/app/immutable/chunks/1KDVFF23.js","/app/immutable/chunks/3SdAC2_C.js","/app/immutable/chunks/BPo1GPk4.js","/app/immutable/chunks/Dms_DO28.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/PtMxuYy8.js","/app/immutable/chunks/CIyUrgF0.js","/app/immutable/chunks/Dmy603At.js","/app/immutable/chunks/DxwfiAWm.js","/app/immutable/chunks/uXuxG9cN.js","/app/immutable/chunks/Bqd7fdCF.js","/app/immutable/chunks/Q-Hp56ht.js","/app/immutable/chunks/B5aYN90J.js","/app/immutable/chunks/BpT_ybtH.js","/app/immutable/chunks/J9vGyyn3.js","/app/immutable/chunks/D8B7qxXm.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/BdWqymET.js","/app/immutable/chunks/BBWuirRW.js","/app/immutable/chunks/DONrLvvt.js","/app/immutable/chunks/DypB-Dwi.js","/app/immutable/chunks/DQmW4_9G.js","/app/immutable/chunks/DtO0wAdA.js","/app/immutable/chunks/D7vAVIvz.js","/app/immutable/chunks/Zg9SWWIQ.js","/app/immutable/chunks/DPbnmxjX.js","/app/immutable/chunks/Dn334wJv.js","/app/immutable/chunks/CYCawVEx.js","/app/immutable/chunks/DpSAF6fh.js","/app/immutable/chunks/Dhj-Oo-y.js","/app/immutable/chunks/CntPxeXh.js","/app/immutable/chunks/jUAybD8G.js","/app/immutable/chunks/D9tVylVS.js","/app/immutable/chunks/BZytk_HL.js","/app/immutable/chunks/CjK2zm52.js","/app/immutable/chunks/DU3vNstz.js","/app/immutable/chunks/XJv96NUg.js","/app/immutable/assets/notify.B1j5oT2y.css","/app/immutable/chunks/DkYquFOp.js","/app/immutable/chunks/C7Ibt0hX.js","/app/immutable/chunks/BblwdMxR.js","/app/immutable/chunks/BIwMjRQQ.js","/app/immutable/chunks/B6Zf-ZTX.js","/app/immutable/chunks/MujvTDgv.js","/app/immutable/chunks/CMiilI_P.js","/app/immutable/chunks/B_QPRXJ5.js","/app/immutable/chunks/z1Wv0MVw.js"])))=>i.map(i=>d[i]);
2
+ import{_ as i}from"./1KDVFF23.js";import{c as m}from"./ChTqQfQN.js";import{t as g}from"./DKwAaLwd.js";function d(){return typeof window<"u"&&window.location.pathname.startsWith("/hud")}function l(){return typeof window>"u"?null:g(window.location.pathname)}function h(){return l()!==null}let w=0;function y(){w+=1}function T(){return w}const v=m("Navigation"),_="settings-previous-path";function s(t){return/^\/settings(?:[/?#]|$)/.test(t)}async function E(t,e={}){if(d()||h()||typeof window<"u"&&/^\/dock(?:\/|$)/.test(window.location.pathname)){v.debug("Ignoring navigation in auxiliary window",{route:t});return}const c=e.assistantContent||t.startsWith("intent://")||/^https?:\/\//.test(t);if(c||y(),c){const{showAssistantContent:n}=await i(async()=>{const{showAssistantContent:o}=await import("./Bu8LYT1B.js");return{showAssistantContent:o}},__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44]),import.meta.url);if(await n(t,{preserveFocus:!0,background:e.assistantContent===!0,agentId:e.assistantAgentId})){if(e.assistantContent)return;const{openPanel:o}=await i(async()=>{const{openPanel:a}=await import("./BPo1GPk4.js").then(r=>r.I$);return{openPanel:a}},__vite__mapDeps([3,4,2,5,6,7,8,1,9,10,11]),import.meta.url),{store:f}=await i(async()=>{const{store:a}=await import("./MujvTDgv.js");return{store:a}},__vite__mapDeps([45,3,4,2,5,6,7,8,1,9,10,11,46,47]),import.meta.url);f.dispatch(o("chief"));const{goto:p}=await i(async()=>{const{goto:a}=await import("./z1Wv0MVw.js").then(r=>r.n);return{goto:a}},__vite__mapDeps([48,2]),import.meta.url);window.location.pathname!=="/"&&await p("/");return}}if(s(t)&&typeof window<"u"&&typeof sessionStorage<"u"&&!s(window.location.pathname)){const n=new URL(window.location.href);sessionStorage.setItem(_,n.pathname+n.search+n.hash)}const{goto:u}=await i(async()=>{const{goto:n}=await import("./z1Wv0MVw.js").then(o=>o.n);return{goto:n}},__vite__mapDeps([48,2]),import.meta.url);return e.state?u(t,{state:e.state}):u(t)}const b=Object.freeze(Object.defineProperty({__proto__:null,SETTINGS_PREV_PATH_KEY:_,isHudWindowRenderer:d,isSettingsRoute:s,navigateToRoute:E},Symbol.toStringTag,{value:"Module"}));export{_ as S,s as a,y as b,l as c,h as d,T as e,b as f,d as i,E as n};
@@ -0,0 +1 @@
1
+ import{oZ as o}from"./BPo1GPk4.js";import{aP as r}from"./DkYquFOp.js";function c(n,e){if(!e)return!0;const t=r.select(n,e);return!!t&&!o(t)}export{c};
@@ -1 +1 @@
1
- import{h as d}from"./C44hzh9R.js";import{bm as t}from"./Bv8Gaorn.js";import{Jr as n,nW as m,pc as _}from"./NgEAPl8f.js";import{c5 as h,a$ as g}from"./CpV-ehZ5.js";import{R as H}from"./DgOwYCT0.js";import{w as f,m as w,e as b}from"./CRl6sOjh.js";function u(e){return e.lastBackupAt?d(e.lastBackupAt):""}function k(e){if(e.starting)return t.workspaceHome_starting_label();if(e.state==="moving")return t.workspaceHome_banner_moving();if(e.unknownState)return t.workspaceHome_banner_detachedNoBackup({name:e.name});const o=u(e);return o?t.workspaceHome_banner_detached({name:e.name,time:o}):t.workspaceHome_banner_detachedNoBackup({name:e.name})}function A(e){return e?.unavailable?k(e):null}function y(e){if(e.banner==="detached"||e.banner==="moving")return k(e);if(e.banner!=="backupWarning")return"";const o=u(e);return o?t.workspaceHome_banner_backupWarning({name:e.name,time:o}):t.workspaceHome_banner_backupWarningNoBackup({name:e.name})}function R(e){switch(e.setup?.phase){case"preparing":case"runningSetup":return t.workspaceHome_opening_title({name:e.name});case"openFailed":return t.workspaceHome_openFailed_title({name:e.name});case"setupFailed":return t.remoteAgent_notice_setupFailed_title({machine:e.name});default:return""}}function N(e){const o=e.setup;switch(o?.phase){case"preparing":return t.remoteAgent_status_preparingCheckout();case"runningSetup":return t.remoteAgent_status_runningSetup();case"openFailed":return t.workspaceHome_openFailed_hint({name:e.name});case"setupFailed":return o.exitCode!==null?t.workspaceHome_setupFailed_exitCode({code:String(o.exitCode)}):o.timedOut?t.workspaceHome_setupFailed_timeout():t.workspaceHome_setupFailed_generic();default:return null}}function D(e){const o=e.setup,r=o?.phase==="openFailed"||o?.phase==="setupFailed"?o.error:null;return r&&r.replace(/^[a-z][a-z0-9-]*:\s*/,"").trim()||null}function E(e){return e==="detached"?t.workspaceHome_marker_detached():t.workspaceHome_marker_moving()}function C(e){const o=u(e);return o?t.workspaceHome_header_lastBackup({time:o}):null}function V(e){if(!e.moveWarning)return null;const o=u(e);return o?t.workspaceHome_moveDialog_warning({name:e.name,time:o}):t.workspaceHome_moveDialog_warningNoBackup({name:e.name})}function q(e){switch(e.code){case"forbidden":return t.workspaceHome_moveError_forbidden();case"homes-unsupported":return t.workspaceHome_moveError_homesUnsupported();case"home-moving":return t.workspaceHome_moveError_homeMoving();case"home-target-unavailable":return t.workspaceHome_moveError_targetUnavailable();case"machine-update-required":return t.workspaceHome_moveError_updateRequired();default:return t.workspaceHome_moveError_failed({message:e.message})}}const i=new WeakMap,S=n.createSelector((e,o)=>{const r=m(e.workspace.workspaces,o),a=r?.home;if(!a)return null;const s=i.get(a);if(s)return s;const c=f(r);return c&&i.set(a,c),c}),L=n.createSelector((e,o)=>w(m(e.workspace.workspaces,o),!h.select(e,o))),F=n.createSelector((e,o)=>{const r=m(e.workspace.workspaces,o)?.home;return r?.setup?.state==="failed"?_(r.homeId,r.setup.finishedAt):""}),U=n.createSelector((e,o)=>{const r=S.select(e,o);if(r?.banner!=="setupFailed")return r;const a=F.select(e,o);if(!a||!e.workspaceHome.dismissedSetupFailures[a])return r;const s=p.get(r);if(s)return s;const c={...r,banner:null};return p.set(r,c),c}),p=new WeakMap,z=n.createSelector((e,o)=>{const r=e.workspaceHome.setupOutputs[o],a=m(e.workspace.workspaces,o)?.home?.homeId;return r&&r.homeId===a?r:null}),I=n.createSelector((e,o)=>e.workspaceHome.waiting[o]===!0),J=n.createSelector(e=>e.workspaceHome.dialogWorkspaceId),K=n.createSelector(e=>e.workspaceHome.moveStatus==="submitting"),j=n.createSelector(e=>e.workspaceHome.moveFailure),W=[],l=new Map,P=n.createSelector((e,o)=>{if(!o)return W;const r=b({agents:g.select(e,o),machineRows:H.select(e)}),a=JSON.stringify(r),s=l.get(o);return s?.key===a?s.options:(l.set(o,{key:a,options:r}),r)}),$=n.createSelector((e,o)=>m(e.workspace.workspaces,o)!==void 0);export{C as a,E as b,V as c,D as d,A as e,N as f,R as g,y as h,k as i,F as j,z as k,I as l,q as m,J as n,j as o,P as p,K as q,U as r,L as s,S as t,$ as u};
1
+ import{h as d}from"./CntPxeXh.js";import{bm as t}from"./1KDVFF23.js";import{Jr as n,nW as m,pc as _}from"./BPo1GPk4.js";import{c5 as h,a$ as g}from"./DkYquFOp.js";import{R as H}from"./BtT-JO5g.js";import{w as f,m as w,e as b}from"./Bco7_wmI.js";function u(e){return e.lastBackupAt?d(e.lastBackupAt):""}function k(e){if(e.starting)return t.workspaceHome_starting_label();if(e.state==="moving")return t.workspaceHome_banner_moving();if(e.unknownState)return t.workspaceHome_banner_detachedNoBackup({name:e.name});const o=u(e);return o?t.workspaceHome_banner_detached({name:e.name,time:o}):t.workspaceHome_banner_detachedNoBackup({name:e.name})}function A(e){return e?.unavailable?k(e):null}function y(e){if(e.banner==="detached"||e.banner==="moving")return k(e);if(e.banner!=="backupWarning")return"";const o=u(e);return o?t.workspaceHome_banner_backupWarning({name:e.name,time:o}):t.workspaceHome_banner_backupWarningNoBackup({name:e.name})}function R(e){switch(e.setup?.phase){case"preparing":case"runningSetup":return t.workspaceHome_opening_title({name:e.name});case"openFailed":return t.workspaceHome_openFailed_title({name:e.name});case"setupFailed":return t.remoteAgent_notice_setupFailed_title({machine:e.name});default:return""}}function N(e){const o=e.setup;switch(o?.phase){case"preparing":return t.remoteAgent_status_preparingCheckout();case"runningSetup":return t.remoteAgent_status_runningSetup();case"openFailed":return t.workspaceHome_openFailed_hint({name:e.name});case"setupFailed":return o.exitCode!==null?t.workspaceHome_setupFailed_exitCode({code:String(o.exitCode)}):o.timedOut?t.workspaceHome_setupFailed_timeout():t.workspaceHome_setupFailed_generic();default:return null}}function D(e){const o=e.setup,r=o?.phase==="openFailed"||o?.phase==="setupFailed"?o.error:null;return r&&r.replace(/^[a-z][a-z0-9-]*:\s*/,"").trim()||null}function E(e){return e==="detached"?t.workspaceHome_marker_detached():t.workspaceHome_marker_moving()}function C(e){const o=u(e);return o?t.workspaceHome_header_lastBackup({time:o}):null}function V(e){if(!e.moveWarning)return null;const o=u(e);return o?t.workspaceHome_moveDialog_warning({name:e.name,time:o}):t.workspaceHome_moveDialog_warningNoBackup({name:e.name})}function q(e){switch(e.code){case"forbidden":return t.workspaceHome_moveError_forbidden();case"homes-unsupported":return t.workspaceHome_moveError_homesUnsupported();case"home-moving":return t.workspaceHome_moveError_homeMoving();case"home-target-unavailable":return t.workspaceHome_moveError_targetUnavailable();case"machine-update-required":return t.workspaceHome_moveError_updateRequired();default:return t.workspaceHome_moveError_failed({message:e.message})}}const i=new WeakMap,S=n.createSelector((e,o)=>{const r=m(e.workspace.workspaces,o),a=r?.home;if(!a)return null;const s=i.get(a);if(s)return s;const c=f(r);return c&&i.set(a,c),c}),L=n.createSelector((e,o)=>w(m(e.workspace.workspaces,o),!h.select(e,o))),F=n.createSelector((e,o)=>{const r=m(e.workspace.workspaces,o)?.home;return r?.setup?.state==="failed"?_(r.homeId,r.setup.finishedAt):""}),U=n.createSelector((e,o)=>{const r=S.select(e,o);if(r?.banner!=="setupFailed")return r;const a=F.select(e,o);if(!a||!e.workspaceHome.dismissedSetupFailures[a])return r;const s=p.get(r);if(s)return s;const c={...r,banner:null};return p.set(r,c),c}),p=new WeakMap,z=n.createSelector((e,o)=>{const r=e.workspaceHome.setupOutputs[o],a=m(e.workspace.workspaces,o)?.home?.homeId;return r&&r.homeId===a?r:null}),I=n.createSelector((e,o)=>e.workspaceHome.waiting[o]===!0),J=n.createSelector(e=>e.workspaceHome.dialogWorkspaceId),K=n.createSelector(e=>e.workspaceHome.moveStatus==="submitting"),j=n.createSelector(e=>e.workspaceHome.moveFailure),W=[],l=new Map,P=n.createSelector((e,o)=>{if(!o)return W;const r=b({agents:g.select(e,o),machineRows:H.select(e)}),a=JSON.stringify(r),s=l.get(o);return s?.key===a?s.options:(l.set(o,{key:a,options:r}),r)}),$=n.createSelector((e,o)=>m(e.workspace.workspaces,o)!==void 0);export{C as a,E as b,V as c,D as d,A as e,N as f,R as g,y as h,k as i,F as j,z as k,I as l,q as m,J as n,j as o,P as p,K as q,U as r,L as s,S as t,$ as u};
@@ -1 +1 @@
1
- import{t as l,bo as i,bw as m,b as u}from"./Bv8Gaorn.js";import{bs as f,bI as _,c5 as b,a7 as g,ay as h,W as v,bn as z,aA as o}from"./3SdAC2_C.js";import{s as y}from"./DZBnfhEV.js";import{a5 as C}from"./BO3WriTy.js";function S(s,t){if(new.target)return l({component:S,...s});f(t,!0);let a=i(t,"size",7,"default"),r=i(t,"children",7);_(C,b(()=>a()));var p={get size(){return a()},set size(e="default"){a(e),o()},get children(){return r()},set children(e){r(e),o()},$set:m,$on:(e,d)=>u(t,e,d)},n=g(),c=h(n);return y(c,r),v(s,n),z(p)}export{S};
1
+ import{t as l,bo as i,bw as m,b as u}from"./1KDVFF23.js";import{bs as f,bI as _,c5 as b,a7 as g,ay as h,W as v,bn as z,aA as o}from"./3SdAC2_C.js";import{s as y}from"./Dmy603At.js";import{a5 as C}from"./DPbnmxjX.js";function S(s,t){if(new.target)return l({component:S,...s});f(t,!0);let a=i(t,"size",7,"default"),r=i(t,"children",7);_(C,b(()=>a()));var p={get size(){return a()},set size(e="default"){a(e),o()},get children(){return r()},set children(e){r(e),o()},$set:m,$on:(e,d)=>u(t,e,d)},n=g(),c=h(n);return y(c,r),v(s,n),z(p)}export{S};
@@ -1 +1 @@
1
- import{t as a3,bo as p,bw as t3,b as s3}from"./Bv8Gaorn.js";import{bs as r3,a5 as o3,aD as t,bA as I,b_ as v,W as f,bn as l3,c9 as l,bV as L,aA as u,ay as i3,bS as n3,aw as S,bz as c3,bl as N,bO as Z,aB as m,bH as A}from"./3SdAC2_C.js";import{i as B}from"./BQg4hK6W.js";import{h as v3}from"./BKD7o1lQ.js";import{f as _,g as x,s as F}from"./D85P44Dj.js";import{F as f3,aT as m3,aL as g3,b0 as p3,cv as u3,ap as d3}from"./CiD4x8Gl.js";var h3=m("<div></div>"),b3=m('<span class="type-caption absolute text-subtle font-medium"> </span>'),w3=m("<img/> <!>",1),C3=m('<span class="type-caption text-subtle font-medium"> </span>'),_3=m("<div><!></div>");function x3(y,i){if(new.target)return a3({component:x3,...y});r3(i,!0);let r=p(i,"iconName",7),n=p(i,"label",7),o=p(i,"size",7,20),d=p(i,"class",7,"");const j={redis:"redis",mongodb:"mongodb",circleci:"circleci",vercel:"vercel",railway:"railway",convex:"convex",snowflake:"snowflake",sentry:"sentry",figma:"figma",github:"github",linear:"linear"},D={figma:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Figma-logo.svg/960px-Figma-logo.svg.png",playwright:"https://ray.run/playwright-brand-assets/playwright-logo.svg"},E={context7:'<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 0C26.2091 0 28 1.79086 28 4V24C28 26.2091 26.2091 28 24 28H4C1.79086 28 0 26.2091 0 24V4C0 1.79086 1.79086 0 4 0H24ZM8.58008 15.2559C8.58008 17.8621 7.95482 19.3557 6.33398 21.1885V22.7783H11.6309V21.1045H8.17773C9.66098 19.3776 10.5723 17.5019 10.5723 15.2559H8.58008ZM17.4268 15.2559C17.4268 17.5019 18.338 19.3776 19.8213 21.1045H16.3672V22.7783H21.6641V21.1885C20.0433 19.3558 19.4189 17.862 19.4189 15.2559H17.4268ZM6.33398 6.80957C7.95495 8.64244 8.58008 10.137 8.58008 12.7432H10.5713C10.5713 10.4972 9.66094 8.62143 8.17773 6.89453H11.6309V5.2207H6.33398V6.80957ZM16.3672 5.2207V6.89453H19.8213C18.338 8.62145 17.4268 10.4972 17.4268 12.7432H19.4189C19.4189 10.137 20.0432 8.64242 21.6641 6.80957V5.2207H16.3672Z" fill="black"/></svg>',slack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0" fill="#de1c59"/><path d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0" fill="#35c5f0"/><path d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0" fill="#2eb57d"/><path d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0" fill="#ebb02e"/></svg>'},U=new Set(["context7","github","linear"]),h={brain:d3,server:u3,database:p3,cloud:g3,default:m3},z=l(()=>j[r().toLowerCase()]),W=l(()=>h[r().toLowerCase()]||h.default),H=l(()=>E[r().toLowerCase()]||null),M=l(()=>U.has(r().toLowerCase()));let b=L(!1),V=L(!1);const k=l(()=>D[r().toLowerCase()]||(t(z)?`https://cdn.simpleicons.org/${t(z)}`:null));function O(){A(b,!0)}function T(){A(V,!0)}var q={get iconName(){return r()},set iconName(e){r(e),u()},get label(){return n()},set label(e){n(e),u()},get size(){return o()},set size(e=20){o(e),u()},get class(){return d()},set class(e=""){d(e),u()},$set:t3,$on:(e,a)=>s3(i,e,a)},c=_3(),G=o3(c);{var J=e=>{var a=h3();v3(a,()=>t(H),!0),I(a),v(()=>_(a,1,`w-full h-full flex items-center justify-center [&>svg]:w-full [&>svg]:h-full ${t(M)?"dark:invert":""}`)),f(e,a)},K=e=>{var a=w3(),s=i3(a);let g;var X=n3(s,2);{var Y=w=>{var C=b3(),$=N(C,!0);v(e3=>{x(C,`font-size: ${o()*.45}px;`),Z($,e3)},[()=>n().charAt(0)]),f(w,C)};B(X,w=>{t(b)||w(Y)})}v(()=>{F(s,"src",t(k)),F(s,"alt",n()),g=_(s,1,`w-full h-full object-contain ${t(M)?"dark:invert":""}`,null,g,{"opacity-0":!t(b)})}),S("load",s,O),S("error",s,T),c3(s),f(e,a)},P=e=>{{let a=l(()=>o()*.7);f3(e,{get icon(){return t(W)},class:"text-ghost",get style(){return`font-size: ${t(a)??""}px;`}})}},Q=l(()=>h[r().toLowerCase()]),R=e=>{var a=C3(),s=N(a,!0);v(g=>{x(a,`font-size: ${o()*.45}px;`),Z(s,g)},[()=>n().charAt(0)]),f(e,a)};B(G,e=>{t(H)?e(J):t(k)&&!t(V)?e(K,1):t(Q)?e(P,2):e(R,-1)})}return I(c),v(()=>{_(c,1,`flex items-center justify-center shrink-0 ${d()??""}`),x(c,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(y,c),l3(q)}export{x3 as M};
1
+ import{t as a3,bo as p,bw as t3,b as s3}from"./1KDVFF23.js";import{bs as r3,a5 as o3,aD as t,bA as I,b_ as v,W as f,bn as l3,c9 as l,bV as L,aA as u,ay as i3,bS as n3,aw as S,bz as c3,bl as N,bO as Z,aB as m,bH as A}from"./3SdAC2_C.js";import{i as B}from"./Zg9SWWIQ.js";import{h as v3}from"./BKD7o1lQ.js";import{f as _,g as x,s as F}from"./D8B7qxXm.js";import{F as f3,aT as m3,aL as g3,b0 as p3,cv as u3,ap as d3}from"./BZytk_HL.js";var h3=m("<div></div>"),b3=m('<span class="type-caption absolute text-subtle font-medium"> </span>'),w3=m("<img/> <!>",1),C3=m('<span class="type-caption text-subtle font-medium"> </span>'),_3=m("<div><!></div>");function x3(y,i){if(new.target)return a3({component:x3,...y});r3(i,!0);let r=p(i,"iconName",7),n=p(i,"label",7),o=p(i,"size",7,20),d=p(i,"class",7,"");const j={redis:"redis",mongodb:"mongodb",circleci:"circleci",vercel:"vercel",railway:"railway",convex:"convex",snowflake:"snowflake",sentry:"sentry",figma:"figma",github:"github",linear:"linear"},D={figma:"https://upload.wikimedia.org/wikipedia/commons/thumb/3/33/Figma-logo.svg/960px-Figma-logo.svg.png",playwright:"https://ray.run/playwright-brand-assets/playwright-logo.svg"},E={context7:'<svg width="28" height="28" viewBox="0 0 28 28" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M24 0C26.2091 0 28 1.79086 28 4V24C28 26.2091 26.2091 28 24 28H4C1.79086 28 0 26.2091 0 24V4C0 1.79086 1.79086 0 4 0H24ZM8.58008 15.2559C8.58008 17.8621 7.95482 19.3557 6.33398 21.1885V22.7783H11.6309V21.1045H8.17773C9.66098 19.3776 10.5723 17.5019 10.5723 15.2559H8.58008ZM17.4268 15.2559C17.4268 17.5019 18.338 19.3776 19.8213 21.1045H16.3672V22.7783H21.6641V21.1885C20.0433 19.3558 19.4189 17.862 19.4189 15.2559H17.4268ZM6.33398 6.80957C7.95495 8.64244 8.58008 10.137 8.58008 12.7432H10.5713C10.5713 10.4972 9.66094 8.62143 8.17773 6.89453H11.6309V5.2207H6.33398V6.80957ZM16.3672 5.2207V6.89453H19.8213C18.338 8.62145 17.4268 10.4972 17.4268 12.7432H19.4189C19.4189 10.137 20.0432 8.64242 21.6641 6.80957V5.2207H16.3672Z" fill="black"/></svg>',slack:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128"><path d="M27.255 80.719c0 7.33-5.978 13.317-13.309 13.317C6.616 94.036.63 88.049.63 80.719s5.987-13.317 13.317-13.317h13.309zm6.709 0c0-7.33 5.987-13.317 13.317-13.317s13.317 5.986 13.317 13.317v33.335c0 7.33-5.986 13.317-13.317 13.317-7.33 0-13.317-5.987-13.317-13.317zm0 0" fill="#de1c59"/><path d="M47.281 27.255c-7.33 0-13.317-5.978-13.317-13.309C33.964 6.616 39.951.63 47.281.63s13.317 5.987 13.317 13.317v13.309zm0 6.709c7.33 0 13.317 5.987 13.317 13.317s-5.986 13.317-13.317 13.317H13.946C6.616 60.598.63 54.612.63 47.281c0-7.33 5.987-13.317 13.317-13.317zm0 0" fill="#35c5f0"/><path d="M100.745 47.281c0-7.33 5.978-13.317 13.309-13.317 7.33 0 13.317 5.987 13.317 13.317s-5.987 13.317-13.317 13.317h-13.309zm-6.709 0c0 7.33-5.987 13.317-13.317 13.317s-13.317-5.986-13.317-13.317V13.946C67.402 6.616 73.388.63 80.719.63c7.33 0 13.317 5.987 13.317 13.317zm0 0" fill="#2eb57d"/><path d="M80.719 100.745c7.33 0 13.317 5.978 13.317 13.309 0 7.33-5.987 13.317-13.317 13.317s-13.317-5.987-13.317-13.317v-13.309zm0-6.709c-7.33 0-13.317-5.987-13.317-13.317s5.986-13.317 13.317-13.317h33.335c7.33 0 13.317 5.986 13.317 13.317 0 7.33-5.987 13.317-13.317 13.317zm0 0" fill="#ebb02e"/></svg>'},U=new Set(["context7","github","linear"]),h={brain:d3,server:u3,database:p3,cloud:g3,default:m3},z=l(()=>j[r().toLowerCase()]),W=l(()=>h[r().toLowerCase()]||h.default),H=l(()=>E[r().toLowerCase()]||null),M=l(()=>U.has(r().toLowerCase()));let b=L(!1),V=L(!1);const k=l(()=>D[r().toLowerCase()]||(t(z)?`https://cdn.simpleicons.org/${t(z)}`:null));function O(){A(b,!0)}function T(){A(V,!0)}var q={get iconName(){return r()},set iconName(e){r(e),u()},get label(){return n()},set label(e){n(e),u()},get size(){return o()},set size(e=20){o(e),u()},get class(){return d()},set class(e=""){d(e),u()},$set:t3,$on:(e,a)=>s3(i,e,a)},c=_3(),G=o3(c);{var J=e=>{var a=h3();v3(a,()=>t(H),!0),I(a),v(()=>_(a,1,`w-full h-full flex items-center justify-center [&>svg]:w-full [&>svg]:h-full ${t(M)?"dark:invert":""}`)),f(e,a)},K=e=>{var a=w3(),s=i3(a);let g;var X=n3(s,2);{var Y=w=>{var C=b3(),$=N(C,!0);v(e3=>{x(C,`font-size: ${o()*.45}px;`),Z($,e3)},[()=>n().charAt(0)]),f(w,C)};B(X,w=>{t(b)||w(Y)})}v(()=>{F(s,"src",t(k)),F(s,"alt",n()),g=_(s,1,`w-full h-full object-contain ${t(M)?"dark:invert":""}`,null,g,{"opacity-0":!t(b)})}),S("load",s,O),S("error",s,T),c3(s),f(e,a)},P=e=>{{let a=l(()=>o()*.7);f3(e,{get icon(){return t(W)},class:"text-ghost",get style(){return`font-size: ${t(a)??""}px;`}})}},Q=l(()=>h[r().toLowerCase()]),R=e=>{var a=C3(),s=N(a,!0);v(g=>{x(a,`font-size: ${o()*.45}px;`),Z(s,g)},[()=>n().charAt(0)]),f(e,a)};B(G,e=>{t(H)?e(J):t(k)&&!t(V)?e(K,1):t(Q)?e(P,2):e(R,-1)})}return I(c),v(()=>{_(c,1,`flex items-center justify-center shrink-0 ${d()??""}`),x(c,`width: ${o()??""}px; height: ${o()??""}px;`)}),f(y,c),l3(q)}export{x3 as M};
@@ -1 +1 @@
1
- import{t as le,bo as s,bw as ie,b as ce,bp as de}from"./Bv8Gaorn.js";import{bs as ve,a7 as X,ay as V,aD as r,W as c,bn as fe,bV as me,aA as o,bS as A,a5 as q,bf as ue,bA as F,b_ as ge,c9 as _,aB as p,bH as be}from"./3SdAC2_C.js";import{i as h}from"./BQg4hK6W.js";import{s as G}from"./DZBnfhEV.js";import{e as _e}from"./DSiZ9qTg.js";import{b as he,e as J,c as pe,f as ye,g as ze}from"./D85P44Dj.js";import{n as xe,c as ke}from"./DgaiTQpw.js";import{b as Re}from"./Dn334wJv.js";import{a_ as Se,f as Be}from"./BO3WriTy.js";import{m as Ie,X as Le,l as we}from"./CSbK1_CV.js";var Ce=new Set(["$$slots","$$events","$$legacy","ref","href","class","variant","color","size","style","dot","leadingIcon","removable","removeLabel","onRemove","children"]),Pe=p('<span data-slot="badge-dot"></span>'),Ve=p('<span data-slot="badge-icon" class="inline-flex shrink-0"><!></span>'),Ae=p('<span aria-hidden="true">×</span>'),De=p('<!> <!> <span class="[text-box:trim-both_cap_alphabetic]"><!></span> <!>',1);function je(D,a){if(new.target)return le({component:je,...D});ve(a,!0);let v=s(a,"ref",15,null),f=s(a,"href",7),y=s(a,"class",7),z=s(a,"variant",7,"solid"),x=s(a,"color",7),i=s(a,"size",7),k=s(a,"style",7),R=s(a,"dot",7,!1),m=s(a,"leadingIcon",7),u=s(a,"removable",7,!1),S=s(a,"removeLabel",7),B=s(a,"onRemove",7),I=s(a,"children",7),K=de(a,Ce);const M=Se(),l=_(()=>Le(z(),x())),L=_(()=>i()==="sm"?"compact":i()==="md"||i()==="lg"?"default":i()??M),j=_(()=>we[r(l).color]),Q=_(()=>r(l).variant==="solid"?`background-color: ${r(l).color==="gray"?"hsl(var(--accent))":`color-mix(in srgb, ${r(j)} 15%, hsl(var(--background)))`};`:"");let E=me(!0),g=null;function T(e){e.preventDefault(),e.stopPropagation(),g=e,be(E,!1)}function U(){g&&(B()?.(g),g=null)}var Y={get ref(){return v()},set ref(e=null){v(e),o()},get href(){return f()},set href(e){f(e),o()},get class(){return y()},set class(e){y(e),o()},get variant(){return z()},set variant(e="solid"){z(e),o()},get color(){return x()},set color(e){x(e),o()},get size(){return i()},set size(e){i(e),o()},get style(){return k()},set style(e){k(e),o()},get dot(){return R()},set dot(e=!1){R(e),o()},get leadingIcon(){return m()},set leadingIcon(e){m(e),o()},get removable(){return u()},set removable(e=!1){u(e),o()},get removeLabel(){return S()},set removeLabel(e){S(e),o()},get onRemove(){return B()},set onRemove(e){B(e),o()},get children(){return I()},set children(e){I(e),o()},$set:ie,$on:(e,b)=>ce(a,e,b)},H=X(),Z=V(H);{var $=e=>{var b=X(),ee=V(b);_e(ee,()=>f()?"a":"span",!1,(w,ae)=>{Re(w,t=>v(t),()=>v()),he(w,t=>({"data-slot":"badge","data-removable":u()||void 0,href:f(),class:t,style:`${r(Q)}${k()??""}`,"data-variant":r(l).variant,"data-color":r(l).color,"data-size":r(L),onoutroend:U,...K}),[()=>J(Ie({variant:r(l).variant,size:r(L)}),y())]),xe(2,w,()=>ke,()=>({tier:"fast"}));var N=De(),O=V(N);{var te=t=>{var n=Pe();let d;ge(P=>{ye(n,1,P),d=ze(n,"",d,{"background-color":r(l).color==="gray"?"hsl(var(--muted-foreground))":r(j)})},[()=>pe(J("shrink-0 rounded-full",r(L)==="compact"?"size-1.5":"size-[7px]"))]),c(t,n)};h(O,t=>{(R()||r(l).variant==="dot")&&t(te)})}var W=A(O,2);{var re=t=>{var n=Ve(),d=q(n);G(d,m),F(n),c(t,n)};h(W,t=>{m()&&t(re)})}var C=A(W,2),se=q(C);G(se,()=>I()??ue),F(C);var oe=A(C,2);{var ne=t=>{Be(t,{variant:"ghost",size:"icon-compact","data-slot":"badge-remove",get"aria-label"(){return S()},class:"-mr-1 inline-flex size-4 items-center justify-center rounded-full bg-transparent text-current transition-colors duration-spring-fast ease-spring-fast hover:bg-hover active:bg-active motion-reduce:transition-none",onclick:T,children:(n,d)=>{var P=Ae();c(n,P)},$$slots:{default:!0}})};h(oe,t=>{u()&&t(ne)})}c(ae,N)}),c(e,b)};h(Z,e=>{r(E)&&e($)})}return c(D,H),fe(Y)}export{je as B};
1
+ import{t as le,bo as s,bw as ie,b as ce,bp as de}from"./1KDVFF23.js";import{bs as ve,a7 as X,ay as V,aD as r,W as c,bn as fe,bV as me,aA as o,bS as A,a5 as q,bf as ue,bA as F,b_ as ge,c9 as _,aB as p,bH as be}from"./3SdAC2_C.js";import{i as h}from"./Zg9SWWIQ.js";import{s as G}from"./Dmy603At.js";import{e as _e}from"./CQQvsDes.js";import{b as he,e as J,c as pe,f as ye,g as ze}from"./D8B7qxXm.js";import{n as xe,c as ke}from"./CjK2zm52.js";import{b as Re}from"./Dn334wJv.js";import{a_ as Se,f as Be}from"./DPbnmxjX.js";import{m as Ie,X as Le,l as we}from"./BpT_ybtH.js";var Ce=new Set(["$$slots","$$events","$$legacy","ref","href","class","variant","color","size","style","dot","leadingIcon","removable","removeLabel","onRemove","children"]),Pe=p('<span data-slot="badge-dot"></span>'),Ve=p('<span data-slot="badge-icon" class="inline-flex shrink-0"><!></span>'),Ae=p('<span aria-hidden="true">×</span>'),De=p('<!> <!> <span class="[text-box:trim-both_cap_alphabetic]"><!></span> <!>',1);function je(D,a){if(new.target)return le({component:je,...D});ve(a,!0);let v=s(a,"ref",15,null),f=s(a,"href",7),y=s(a,"class",7),z=s(a,"variant",7,"solid"),x=s(a,"color",7),i=s(a,"size",7),k=s(a,"style",7),R=s(a,"dot",7,!1),m=s(a,"leadingIcon",7),u=s(a,"removable",7,!1),S=s(a,"removeLabel",7),B=s(a,"onRemove",7),I=s(a,"children",7),K=de(a,Ce);const M=Se(),l=_(()=>Le(z(),x())),L=_(()=>i()==="sm"?"compact":i()==="md"||i()==="lg"?"default":i()??M),j=_(()=>we[r(l).color]),Q=_(()=>r(l).variant==="solid"?`background-color: ${r(l).color==="gray"?"hsl(var(--accent))":`color-mix(in srgb, ${r(j)} 15%, hsl(var(--background)))`};`:"");let E=me(!0),g=null;function T(e){e.preventDefault(),e.stopPropagation(),g=e,be(E,!1)}function U(){g&&(B()?.(g),g=null)}var Y={get ref(){return v()},set ref(e=null){v(e),o()},get href(){return f()},set href(e){f(e),o()},get class(){return y()},set class(e){y(e),o()},get variant(){return z()},set variant(e="solid"){z(e),o()},get color(){return x()},set color(e){x(e),o()},get size(){return i()},set size(e){i(e),o()},get style(){return k()},set style(e){k(e),o()},get dot(){return R()},set dot(e=!1){R(e),o()},get leadingIcon(){return m()},set leadingIcon(e){m(e),o()},get removable(){return u()},set removable(e=!1){u(e),o()},get removeLabel(){return S()},set removeLabel(e){S(e),o()},get onRemove(){return B()},set onRemove(e){B(e),o()},get children(){return I()},set children(e){I(e),o()},$set:ie,$on:(e,b)=>ce(a,e,b)},H=X(),Z=V(H);{var $=e=>{var b=X(),ee=V(b);_e(ee,()=>f()?"a":"span",!1,(w,ae)=>{Re(w,t=>v(t),()=>v()),he(w,t=>({"data-slot":"badge","data-removable":u()||void 0,href:f(),class:t,style:`${r(Q)}${k()??""}`,"data-variant":r(l).variant,"data-color":r(l).color,"data-size":r(L),onoutroend:U,...K}),[()=>J(Ie({variant:r(l).variant,size:r(L)}),y())]),xe(2,w,()=>ke,()=>({tier:"fast"}));var N=De(),O=V(N);{var te=t=>{var n=Pe();let d;ge(P=>{ye(n,1,P),d=ze(n,"",d,{"background-color":r(l).color==="gray"?"hsl(var(--muted-foreground))":r(j)})},[()=>pe(J("shrink-0 rounded-full",r(L)==="compact"?"size-1.5":"size-[7px]"))]),c(t,n)};h(O,t=>{(R()||r(l).variant==="dot")&&t(te)})}var W=A(O,2);{var re=t=>{var n=Ve(),d=q(n);G(d,m),F(n),c(t,n)};h(W,t=>{m()&&t(re)})}var C=A(W,2),se=q(C);G(se,()=>I()??ue),F(C);var oe=A(C,2);{var ne=t=>{Be(t,{variant:"ghost",size:"icon-compact","data-slot":"badge-remove",get"aria-label"(){return S()},class:"-mr-1 inline-flex size-4 items-center justify-center rounded-full bg-transparent text-current transition-colors duration-spring-fast ease-spring-fast hover:bg-hover active:bg-active motion-reduce:transition-none",onclick:T,children:(n,d)=>{var P=Ae();c(n,P)},$$slots:{default:!0}})};h(oe,t=>{u()&&t(ne)})}c(ae,N)}),c(e,b)};h(Z,e=>{r(E)&&e($)})}return c(D,H),fe(Y)}export{je as B};