@intent-hq/web 2.350.0 → 2.351.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 (266) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{DNZhZg57.js → -o555Jq8.js} +1 -1
  3. package/web/app/immutable/chunks/{wMJR-wv6.js → 0-xAXZgf.js} +1 -1
  4. package/web/app/immutable/chunks/{7uJhY2Ro.js → 25Qfa38y.js} +1 -1
  5. package/web/app/immutable/chunks/{BRWlAcla.js → 3yYmQx2z.js} +1 -1
  6. package/web/app/immutable/chunks/41c-5lbJ.js +1 -0
  7. package/web/app/immutable/chunks/{CdmGeaJT.js → 4XRamNN4.js} +1 -1
  8. package/web/app/immutable/chunks/{CypR-p04.js → 5P8mOVWK.js} +1 -1
  9. package/web/app/immutable/chunks/{BLSKMxu8.js → 67kYB1lt.js} +1 -1
  10. package/web/app/immutable/chunks/{BtEQs3u_.js → 6pSwNbUy.js} +3 -3
  11. package/web/app/immutable/chunks/{BBYhh_eX.js → 73QfWqEv.js} +1 -1
  12. package/web/app/immutable/chunks/{Cjw1QvKa.js → AOUBMpYk.js} +1 -1
  13. package/web/app/immutable/chunks/{BT9NukZQ.js → AyGecNlS.js} +1 -1
  14. package/web/app/immutable/chunks/{Cq31bVAU.js → B-TDUD-n.js} +1 -1
  15. package/web/app/immutable/chunks/{CncRZ2UX.js → B-hKl_xx.js} +1 -1
  16. package/web/app/immutable/chunks/{DwWmN_70.js → B043Z8mk.js} +1 -1
  17. package/web/app/immutable/chunks/{D7v0ZhmL.js → B0QrNgSj.js} +1 -1
  18. package/web/app/immutable/chunks/{Ca33AaL6.js → B22owOuz.js} +1 -1
  19. package/web/app/immutable/chunks/{DfHhvXgb.js → B57wBfTw.js} +1 -1
  20. package/web/app/immutable/chunks/{nelewHAT.js → B5ekpGAe.js} +1 -1
  21. package/web/app/immutable/chunks/{BmxmL68T.js → B6bPIJ1k.js} +1 -1
  22. package/web/app/immutable/chunks/{4CvTKhAA.js → B9aafd7C.js} +1 -1
  23. package/web/app/immutable/chunks/{B1eDx3CN.js → B9l9TMyA.js} +1 -1
  24. package/web/app/immutable/chunks/{x2y577z4.js → BA4L4UPI.js} +1 -1
  25. package/web/app/immutable/chunks/{C-Hyxax0.js → BAb3JAL_.js} +1 -1
  26. package/web/app/immutable/chunks/{Bp_k45o-.js → BBCbq-hE.js} +1 -1
  27. package/web/app/immutable/chunks/{CNkNQisE.js → BCP62aew.js} +1 -1
  28. package/web/app/immutable/chunks/{CpRIbMDe.js → BCQGaqgQ.js} +1 -1
  29. package/web/app/immutable/chunks/{BGNS9xef.js → BDX4YTR9.js} +1 -1
  30. package/web/app/immutable/chunks/{D897Deqj.js → BDbt9cuZ.js} +1 -1
  31. package/web/app/immutable/chunks/{BN_2jpxS.js → BEsCIa2p.js} +1 -1
  32. package/web/app/immutable/chunks/{D4xoTssJ.js → BH-zWM3a.js} +3 -3
  33. package/web/app/immutable/chunks/{Cn9rdOTG.js → BHcKnFOT.js} +1 -1
  34. package/web/app/immutable/chunks/{B78lBv8l.js → BI5nb_pF.js} +1 -1
  35. package/web/app/immutable/chunks/{Dsv-aPKR.js → BJ5nSO_Z.js} +3 -3
  36. package/web/app/immutable/chunks/{DdDbAXaw.js → BJdaIUzQ.js} +1 -1
  37. package/web/app/immutable/chunks/BJwMP_No.js +1 -0
  38. package/web/app/immutable/chunks/{rbrWRnHh.js → BOuXmWAj.js} +1 -1
  39. package/web/app/immutable/chunks/{C5_BSKQx.js → BPIrwIPC.js} +1 -1
  40. package/web/app/immutable/chunks/{D_euwo9H.js → BSkWWR3g.js} +1 -1
  41. package/web/app/immutable/chunks/{DJBAuZjD.js → BTI1m7l8.js} +1 -1
  42. package/web/app/immutable/chunks/{DU8fiCcb.js → BTLU_fQH.js} +1 -1
  43. package/web/app/immutable/chunks/{C-8EePTi.js → BXYFidlw.js} +1 -1
  44. package/web/app/immutable/chunks/{NkFvZgbA.js → BYT1TQGK.js} +1 -1
  45. package/web/app/immutable/chunks/{CPFtOnI7.js → BYjUWrg8.js} +1 -1
  46. package/web/app/immutable/chunks/{YeEGAsBO.js → BahcW9Py.js} +1 -1
  47. package/web/app/immutable/chunks/{CO6Za00z.js → Bd6Rwh69.js} +2 -2
  48. package/web/app/immutable/chunks/{-SLXtWbg.js → BdKft7gn.js} +1 -1
  49. package/web/app/immutable/chunks/{ChmnWquS.js → BhX-5zd9.js} +1 -1
  50. package/web/app/immutable/chunks/{BWW-jWou.js → Bj0v3XMt.js} +1 -1
  51. package/web/app/immutable/chunks/{Bv8FuKnx.js → BjHlv5EB.js} +1 -1
  52. package/web/app/immutable/chunks/{DLibMiVC.js → BjVx5o0n.js} +1 -1
  53. package/web/app/immutable/chunks/{BtEu1RiA.js → BjnapXgD.js} +2 -2
  54. package/web/app/immutable/chunks/{VSW9MxJG.js → Bkkc9nPJ.js} +3 -3
  55. package/web/app/immutable/chunks/{BANv-BXH.js → BlcZflKW.js} +1 -1
  56. package/web/app/immutable/chunks/{B_IuZd0O.js → Bm0VuPYn.js} +1 -1
  57. package/web/app/immutable/chunks/{eIlGg2ZH.js → Bo40L-We.js} +1 -1
  58. package/web/app/immutable/chunks/{BHpSEINq.js → BoT__Uvu.js} +1 -1
  59. package/web/app/immutable/chunks/{BVzVRoQ-.js → BpGfQKt5.js} +1 -1
  60. package/web/app/immutable/chunks/{BjgP_y-J.js → Bpkh7IXN.js} +1 -1
  61. package/web/app/immutable/chunks/{DKPFCCGK.js → BrR0973A.js} +1 -1
  62. package/web/app/immutable/chunks/{HHfiH428.js → BsDTYuK1.js} +1 -1
  63. package/web/app/immutable/chunks/{BSSsvY4I.js → BuDJvkTk.js} +1 -1
  64. package/web/app/immutable/chunks/{Cw94LfJC.js → BuupGai6.js} +1 -1
  65. package/web/app/immutable/chunks/{CDYEdeFG.js → Bv1i2B5u.js} +1 -1
  66. package/web/app/immutable/chunks/{DVpbdNgF.js → BwzznN4d.js} +1 -1
  67. package/web/app/immutable/chunks/{BRpVJjVZ.js → ByQWAkHB.js} +1 -1
  68. package/web/app/immutable/chunks/{DM6SW5ie.js → Byr2ZhFE.js} +1 -1
  69. package/web/app/immutable/chunks/{d34yYkdR.js → BzXCk-eX.js} +1 -1
  70. package/web/app/immutable/chunks/{EBvHmS3f.js → C-cC659R.js} +1 -1
  71. package/web/app/immutable/chunks/{fE-kcmYj.js → C1ha510g.js} +1 -1
  72. package/web/app/immutable/chunks/{GyHTdhNa.js → C1zdYplM.js} +1 -1
  73. package/web/app/immutable/chunks/{LeGktTWT.js → C2QAZ2iP.js} +1 -1
  74. package/web/app/immutable/chunks/{DTzXgeFz.js → C2pyYkiS.js} +1 -1
  75. package/web/app/immutable/chunks/{Dw4yJGUy.js → C4UmUQ0t.js} +1 -1
  76. package/web/app/immutable/chunks/{BGFEE7_E.js → C4oYAvfo.js} +1 -1
  77. package/web/app/immutable/chunks/{C7uOzB-k.js → C4qlKK6F.js} +1 -1
  78. package/web/app/immutable/chunks/{D93fSt3I.js → C96Cos0M.js} +1 -1
  79. package/web/app/immutable/chunks/{qVFwsb4j.js → C97vyu8P.js} +1 -1
  80. package/web/app/immutable/chunks/{BTgmF0VM.js → C9OFPDov.js} +1 -1
  81. package/web/app/immutable/chunks/{OvIv7krR.js → C9jK2F--.js} +1 -1
  82. package/web/app/immutable/chunks/{Cs2fCAnT.js → CA8Jy4WC.js} +1 -1
  83. package/web/app/immutable/chunks/{q3dUaF0j.js → CB3bw4PL.js} +1 -1
  84. package/web/app/immutable/chunks/{CVslHwOK.js → CBtX8-Aa.js} +1 -1
  85. package/web/app/immutable/chunks/{rEoZFmiI.js → CCO5tijn.js} +1 -1
  86. package/web/app/immutable/chunks/{286xXFLf.js → CCw4KHZp.js} +1 -1
  87. package/web/app/immutable/chunks/{DhoyV3Yf.js → CEpelLfd.js} +2 -2
  88. package/web/app/immutable/chunks/{D3HUOTfX.js → CEufllny.js} +1 -1
  89. package/web/app/immutable/chunks/{mxwa8yTT.js → CHnA0xpr.js} +1 -1
  90. package/web/app/immutable/chunks/{B0tZqpMw.js → CIm0iT4E.js} +1 -1
  91. package/web/app/immutable/chunks/{8j6wyzW6.js → CKGxulW8.js} +1 -1
  92. package/web/app/immutable/chunks/{CisyaOFD.js → CKmgmdFa.js} +1 -1
  93. package/web/app/immutable/chunks/{BVAf1qqU.js → CMWevjI7.js} +1 -1
  94. package/web/app/immutable/chunks/{WuzNFiDL.js → CNPNgdra.js} +1 -1
  95. package/web/app/immutable/chunks/{Bx0EPbRG.js → CTh4M5uj.js} +1 -1
  96. package/web/app/immutable/chunks/{BByPpbtL.js → CTvwRPyF.js} +1 -1
  97. package/web/app/immutable/chunks/{D7W4zxlI.js → CUBdinib.js} +1 -1
  98. package/web/app/immutable/chunks/{B4oIQ1kI.js → CVDRxz2f.js} +1 -1
  99. package/web/app/immutable/chunks/{BC51na55.js → CWUa486r.js} +1 -1
  100. package/web/app/immutable/chunks/{CBTiE17j.js → CYlvyU3U.js} +1 -1
  101. package/web/app/immutable/chunks/{2yJgo8xz.js → CYyISHjN.js} +1 -1
  102. package/web/app/immutable/chunks/{CMvvA2dm.js → C_akaBgq.js} +1 -1
  103. package/web/app/immutable/chunks/{BD7hz4AD.js → CaPALXDj.js} +1 -1
  104. package/web/app/immutable/chunks/{DEoOAy1Z.js → CbX7A7fn.js} +1 -1
  105. package/web/app/immutable/chunks/{Cwzl8GTd.js → Cc0uYvgR.js} +1 -1
  106. package/web/app/immutable/chunks/{CyRJV2Ki.js → CcYKMJWn.js} +1 -1
  107. package/web/app/immutable/chunks/{Cosr3Aeo.js → CccgSyFt.js} +2 -2
  108. package/web/app/immutable/chunks/{B_7vJcZK.js → CdXmpyDy.js} +1 -1
  109. package/web/app/immutable/chunks/{C8Tr-F9O.js → CgXr85TV.js} +1 -1
  110. package/web/app/immutable/chunks/{FoUQsQJW.js → CgfVp9Ef.js} +1 -1
  111. package/web/app/immutable/chunks/{DopiS9Ix.js → Ch2DvoYt.js} +1 -1
  112. package/web/app/immutable/chunks/{Xn8V9ehY.js → ChD6V-mA.js} +1 -1
  113. package/web/app/immutable/chunks/{VqXoK0d_.js → CjPfyTRR.js} +1 -1
  114. package/web/app/immutable/chunks/{khgof0nR.js → Cj__CwtA.js} +1 -1
  115. package/web/app/immutable/chunks/{DgvbF3tj.js → CjafAhxa.js} +1 -1
  116. package/web/app/immutable/chunks/{CFE62qf4.js → ClCe1k4i.js} +1 -1
  117. package/web/app/immutable/chunks/{B-DRVFcy.js → ClgmQqA9.js} +1 -1
  118. package/web/app/immutable/chunks/{CK2a86W3.js → ClkbPGx9.js} +1 -1
  119. package/web/app/immutable/chunks/{ZvvpWnYF.js → CrHTQDbT.js} +1 -1
  120. package/web/app/immutable/chunks/{DwEnF1oU.js → CramXAJ0.js} +1 -1
  121. package/web/app/immutable/chunks/{BkMQXe7-.js → Crf39e2Q.js} +1 -1
  122. package/web/app/immutable/chunks/{DISea0WG.js → CrkDo76r.js} +1 -1
  123. package/web/app/immutable/chunks/{CtMMpgin.js → CuCrpEmq.js} +1 -1
  124. package/web/app/immutable/chunks/{VbWa-HQf.js → CuHfgFFh.js} +1 -1
  125. package/web/app/immutable/chunks/{BjYS0G-V.js → Cv3VBAcZ.js} +1 -1
  126. package/web/app/immutable/chunks/{Dv1uFWMY.js → Cw23SInT.js} +1 -1
  127. package/web/app/immutable/chunks/{DQWngE5E.js → Cxn17X4d.js} +2 -2
  128. package/web/app/immutable/chunks/{DEkf_jel.js → Cy3svQNQ.js} +1 -1
  129. package/web/app/immutable/chunks/{Dy0WXzUp.js → D-fvD02O.js} +2 -2
  130. package/web/app/immutable/chunks/{B2r-op5b.js → D07rIrLM.js} +1 -1
  131. package/web/app/immutable/chunks/{iP2vS2hx.js → D2kFrNtb.js} +1 -1
  132. package/web/app/immutable/chunks/{DEWFL8HN.js → D542lbvk.js} +2 -2
  133. package/web/app/immutable/chunks/{MbX_TGmS.js → D68o263s.js} +1 -1
  134. package/web/app/immutable/chunks/{26eANJdh.js → D6kdeziR.js} +1 -1
  135. package/web/app/immutable/chunks/{C9CjIm-I.js → D6ncbN-K.js} +1 -1
  136. package/web/app/immutable/chunks/{B99vgEcA.js → D9WrXbf9.js} +1 -1
  137. package/web/app/immutable/chunks/{32pNLDLJ.js → D9XKGcAY.js} +1 -1
  138. package/web/app/immutable/chunks/{Db1OxcFa.js → DE4arwhh.js} +1 -1
  139. package/web/app/immutable/chunks/{BDh1WR6p.js → DEVAGsyG.js} +1 -1
  140. package/web/app/immutable/chunks/{CVNsMUrN.js → DGRqvVY1.js} +2 -2
  141. package/web/app/immutable/chunks/{vCsRAP9U.js → DGaDkdng.js} +1 -1
  142. package/web/app/immutable/chunks/{CbVK4mzc.js → DGb_dMRY.js} +1 -1
  143. package/web/app/immutable/chunks/{BCazrMx2.js → DL304mi1.js} +1 -1
  144. package/web/app/immutable/chunks/{B1uWzETW.js → DLiD3Y7h.js} +1 -1
  145. package/web/app/immutable/chunks/DMIrVtTU.js +1 -0
  146. package/web/app/immutable/chunks/{CIwCBz4N.js → DPemhAGL.js} +1 -1
  147. package/web/app/immutable/chunks/{CKET0e35.js → DQ8vH0VY.js} +1 -1
  148. package/web/app/immutable/chunks/{B_5CVv0g.js → DQ_x-k0O.js} +3 -3
  149. package/web/app/immutable/chunks/{2rtvtln4.js → DQjekoSU.js} +1 -1
  150. package/web/app/immutable/chunks/{BwgrW8yQ.js → DRRbh3V4.js} +1 -1
  151. package/web/app/immutable/chunks/{C82N7Ttz.js → DRiReCwX.js} +1 -1
  152. package/web/app/immutable/chunks/{Dqx3L5zl.js → DUor0DI_.js} +1 -1
  153. package/web/app/immutable/chunks/{BmMUMiCr.js → DWgWsm2y.js} +1 -1
  154. package/web/app/immutable/chunks/{CM0lKKPd.js → D_P8KoFV.js} +1 -1
  155. package/web/app/immutable/chunks/{BMcc0dQQ.js → Dc8XEwi0.js} +1 -1
  156. package/web/app/immutable/chunks/{Dqy9L9od.js → DcxuGfvW.js} +1 -1
  157. package/web/app/immutable/chunks/{Bj1gLv3I.js → DdfHQxRr.js} +1 -1
  158. package/web/app/immutable/chunks/{DZ-cwX5R.js → De70D2Lx.js} +2 -2
  159. package/web/app/immutable/chunks/{CzZDc-Ii.js → DfA_Upom.js} +1 -1
  160. package/web/app/immutable/chunks/{CMncH4az.js → DfuAejzr.js} +1 -1
  161. package/web/app/immutable/chunks/{DbM1yRvv.js → DhhomoFS.js} +1 -1
  162. package/web/app/immutable/chunks/{408Hki4d.js → DipCXz5L.js} +1 -1
  163. package/web/app/immutable/chunks/{D3wOVtz4.js → DjE6Tn4o.js} +1 -1
  164. package/web/app/immutable/chunks/{DTowKbOf.js → Dq9dLpt4.js} +4 -4
  165. package/web/app/immutable/chunks/{3hKPUzWE.js → DqKef_Yi.js} +1 -1
  166. package/web/app/immutable/chunks/{thMcSp0N.js → DsewpLhd.js} +1 -1
  167. package/web/app/immutable/chunks/{DhNmiaLk.js → DtV2WjXp.js} +1 -1
  168. package/web/app/immutable/chunks/{LIrM5l7a.js → DtWKfIHW.js} +1 -1
  169. package/web/app/immutable/chunks/{BwZVuT_r.js → DuPQa1Hv.js} +4 -4
  170. package/web/app/immutable/chunks/{CJeZnjZ2.js → Dv-TQImR.js} +1 -1
  171. package/web/app/immutable/chunks/{DokA8xhc.js → DvmJXjP_.js} +1 -1
  172. package/web/app/immutable/chunks/{DR7u6lm0.js → DwR2QVtr.js} +1 -1
  173. package/web/app/immutable/chunks/{D6FxazmU.js → DwqB2LW1.js} +1 -1
  174. package/web/app/immutable/chunks/{CrGdgRLR.js → Dy3sS5WY.js} +1 -1
  175. package/web/app/immutable/chunks/{DLbCIONA.js → Dy5C9WSY.js} +1 -1
  176. package/web/app/immutable/chunks/{Crbgpexl.js → DzIV-I7E.js} +1 -1
  177. package/web/app/immutable/chunks/{DiRf9bEu.js → DzqZnAgo.js} +4 -4
  178. package/web/app/immutable/chunks/{CQGn51Fx.js → ETkf7dmN.js} +1 -1
  179. package/web/app/immutable/chunks/{BRXwopQ4.js → FHXrLz5A.js} +1 -1
  180. package/web/app/immutable/chunks/{BR3-na8H.js → FbHjHDf9.js} +1 -1
  181. package/web/app/immutable/chunks/{2B0vRGaJ.js → G1rQ1ZLS.js} +1 -1
  182. package/web/app/immutable/chunks/{DP5_VjDz.js → GfKb8O3O.js} +1 -1
  183. package/web/app/immutable/chunks/{Cbr15rLJ.js → Ghm7WpFi.js} +1 -1
  184. package/web/app/immutable/chunks/{Y5hz4Ndf.js → Ju7PAma1.js} +1 -1
  185. package/web/app/immutable/chunks/{qWDVui2f.js → KcC0pRTT.js} +1 -1
  186. package/web/app/immutable/chunks/{CH0shWeP.js → Lx7mQEPN.js} +1 -1
  187. package/web/app/immutable/chunks/{By_ZupfB.js → N7G-ZTah.js} +5 -5
  188. package/web/app/immutable/chunks/{C22o2A7n.js → NFc5A7UL.js} +1 -1
  189. package/web/app/immutable/chunks/{C6DrVy6-.js → Og4xuM7g.js} +1 -1
  190. package/web/app/immutable/chunks/{CEHfILB1.js → QFwPCSKD.js} +1 -1
  191. package/web/app/immutable/chunks/{CKe6gKEB.js → QLXfiC8k.js} +1 -1
  192. package/web/app/immutable/chunks/{Auy4scdV.js → QPRdLPHE.js} +1 -1
  193. package/web/app/immutable/chunks/{DZUdTlgs.js → R6z5Bqeu.js} +1 -1
  194. package/web/app/immutable/chunks/{D2JEXCBC.js → RjrC7VFY.js} +1 -1
  195. package/web/app/immutable/chunks/{BUPCpU_w.js → SXjX79W0.js} +3 -3
  196. package/web/app/immutable/chunks/{DJHJbx3B.js → Sa9G_k7P.js} +1 -1
  197. package/web/app/immutable/chunks/{Ari-xzJB.js → SoUJpC1P.js} +1 -1
  198. package/web/app/immutable/chunks/{DcSI1nK9.js → UMKs78qL.js} +1 -1
  199. package/web/app/immutable/chunks/{2GRAEVbl.js → Uea955Vz.js} +1 -1
  200. package/web/app/immutable/chunks/{CClSMHHc.js → VIOarPUD.js} +1 -1
  201. package/web/app/immutable/chunks/{Lp_ZOIfH.js → VmRBMU-H.js} +2 -2
  202. package/web/app/immutable/chunks/{D3v_P2Uq.js → W2yoNJFv.js} +1 -1
  203. package/web/app/immutable/chunks/{ouB3SqBV.js → X0wrjHux.js} +1 -1
  204. package/web/app/immutable/chunks/{Ctvf1zqH.js → XVViy8ZW.js} +1 -1
  205. package/web/app/immutable/chunks/{BNuxEAQs.js → ZngqFVq2.js} +1 -1
  206. package/web/app/immutable/chunks/{CxxiwOxz.js → _6UbyZFm.js} +1 -1
  207. package/web/app/immutable/chunks/{hqwi43PO.js → a6ao35lO.js} +1 -1
  208. package/web/app/immutable/chunks/{D8acXZuO.js → af7yduyJ.js} +12 -12
  209. package/web/app/immutable/chunks/{kNB7-RPS.js → b1qSM27E.js} +1 -1
  210. package/web/app/immutable/chunks/{DldD9pcf.js → b8GoMhSt.js} +1 -1
  211. package/web/app/immutable/chunks/{WydNOMQI.js → bV1WTvQr.js} +1 -1
  212. package/web/app/immutable/chunks/{B79m0-as.js → cKfnoB88.js} +1 -1
  213. package/web/app/immutable/chunks/{CncaMZP7.js → dAVgSJe8.js} +1 -1
  214. package/web/app/immutable/chunks/{B25aSyPj.js → dvtNrmBJ.js} +1 -1
  215. package/web/app/immutable/chunks/{DW8-b4qF.js → fKGM3H1S.js} +1 -1
  216. package/web/app/immutable/chunks/{Bryo-Obg.js → gWaxvgpv.js} +4 -4
  217. package/web/app/immutable/chunks/{D68W4EG9.js → gtyJplKf.js} +1 -1
  218. package/web/app/immutable/chunks/{BIt-EHGB.js → hYtFXuM6.js} +1 -1
  219. package/web/app/immutable/chunks/{dt-eIcjK.js → jmGUW687.js} +1 -1
  220. package/web/app/immutable/chunks/{BVjxveE3.js → jqiN8Ebl.js} +2 -2
  221. package/web/app/immutable/chunks/{BXpSvmYd.js → jyFhDlZn.js} +1 -1
  222. package/web/app/immutable/chunks/{ktHrl9fr.js → mgh5gPA4.js} +1 -1
  223. package/web/app/immutable/chunks/{CxF8YFum.js → nLyQInj7.js} +1 -1
  224. package/web/app/immutable/chunks/nbfGErIW.js +1 -0
  225. package/web/app/immutable/chunks/{B2otWDii.js → nqpg2Djj.js} +1 -1
  226. package/web/app/immutable/chunks/{BRvIFAVQ.js → oNlT93oA.js} +1 -1
  227. package/web/app/immutable/chunks/{CNCNgnPl.js → ot3p-Y1j.js} +1 -1
  228. package/web/app/immutable/chunks/{xCXPOQKs.js → pA6KCKbP.js} +1 -1
  229. package/web/app/immutable/chunks/{B3aPtdPQ.js → sHSA98Ae.js} +1 -1
  230. package/web/app/immutable/chunks/{C7_ws2_m.js → sxpeFI4o.js} +1 -1
  231. package/web/app/immutable/chunks/{ZlJ0OsQO.js → ugjOCd8V.js} +3 -3
  232. package/web/app/immutable/chunks/{DBwXC8Tc.js → uoJ0nI_z.js} +1 -1
  233. package/web/app/immutable/chunks/{xt_aYD5Y.js → v23yk8Nl.js} +1 -1
  234. package/web/app/immutable/chunks/{935km0k5.js → vLUkS5Lr.js} +1 -1
  235. package/web/app/immutable/chunks/{cHlEaLvO.js → vSLEtuRc.js} +1 -1
  236. package/web/app/immutable/chunks/{BocgQf5E.js → zB3SalmM.js} +1 -1
  237. package/web/app/immutable/entry/{app.CWKtj1qb.js → app.D9kIVkFi.js} +3 -3
  238. package/web/app/immutable/entry/start.CsSnQcM4.js +1 -0
  239. package/web/app/immutable/nodes/{0.C-ApG_ZV.js → 0.CycxDG0L.js} +1 -1
  240. package/web/app/immutable/nodes/{1.7Yef1c7P.js → 1.DBDsO8vk.js} +1 -1
  241. package/web/app/immutable/nodes/{10.CgeOLrTm.js → 10.DeWMsWJr.js} +1 -1
  242. package/web/app/immutable/nodes/{11.BNBCl9Ko.js → 11.D3R05nAN.js} +1 -1
  243. package/web/app/immutable/nodes/{12.BriSlPZC.js → 12.FwwO1QwE.js} +1 -1
  244. package/web/app/immutable/nodes/{13.QpfX0_5g.js → 13.BXCK1uUO.js} +3 -3
  245. package/web/app/immutable/nodes/{14.D6hgWRXD.js → 14.CaU020TI.js} +1 -1
  246. package/web/app/immutable/nodes/{15.DdEMX_Kl.js → 15.DBweoCJ3.js} +1 -1
  247. package/web/app/immutable/nodes/{16.rtMs5JTy.js → 16.x7FRjB-z.js} +1 -1
  248. package/web/app/immutable/nodes/{17.DDfq3IKN.js → 17.nVKVEw2j.js} +1 -1
  249. package/web/app/immutable/nodes/{18.4frHbkPA.js → 18.D8Pypemm.js} +2 -2
  250. package/web/app/immutable/nodes/{2.BMmCaZ13.js → 2.bw2OhfV2.js} +4 -4
  251. package/web/app/immutable/nodes/{3.LGsMTwHE.js → 3.C3rwANJW.js} +1 -1
  252. package/web/app/immutable/nodes/{4.D_DWD0G6.js → 4.D3HKzTPL.js} +1 -1
  253. package/web/app/immutable/nodes/{5.NArgqqzw.js → 5.f1pRghhu.js} +1 -1
  254. package/web/app/immutable/nodes/{6.eVsatkxX.js → 6.rpNMjH5t.js} +1 -1
  255. package/web/app/immutable/nodes/{7.DfBjcCho.js → 7.BSbrbiiB.js} +1 -1
  256. package/web/app/immutable/nodes/8.DbrZFert.js +14 -0
  257. package/web/app/immutable/nodes/{9.DcP-Tpxp.js → 9.D--sfpfT.js} +5 -5
  258. package/web/app/version.json +1 -1
  259. package/web/generated/paraglide.js +46 -46
  260. package/web/index.html +18 -18
  261. package/web/app/immutable/chunks/DGQ1ECsI.js +0 -1
  262. package/web/app/immutable/chunks/DxLMmDZH.js +0 -1
  263. package/web/app/immutable/chunks/H2SodBVA.js +0 -1
  264. package/web/app/immutable/chunks/Hc3ynozM.js +0 -1
  265. package/web/app/immutable/entry/start.DscDu9_j.js +0 -1
  266. package/web/app/immutable/nodes/8.mrAj_KlQ.js +0 -14
@@ -1 +1 @@
1
- import{bv as f}from"./DYhIMPy1.js";import{W as o}from"./BDDVFcm3.js";import{bo as u}from"./DGQ1ECsI.js";import{k as b}from"./CK2a86W3.js";import"./Bp_k45o-.js";import"./ChmnWquS.js";import"./DZ-cwX5R.js";import"./ChTqQfQN.js";import"./B_7vJcZK.js";import"./BSSsvY4I.js";function l(){return globalThis.electronAPI??null}function i(r){const e=r?.enabled;return typeof e=="boolean"?e:null}const v=f(!1,r=>{const e=l();if(!e)return;let t=!0,s=!1;const c=e.on(o.DOCK_LAB_CHANGED,a=>{if(!t)return;const n=i(a);n!==null&&(s=!0,r(n))});return e.invoke(o.GET_DOCK_LAB,{}).then(a=>{const n=i(a);t&&!s&&n!==null&&r(n)}).catch(()=>{}),()=>{t=!1,e.offById(o.DOCK_LAB_CHANGED,c)}});async function d(r){const e=l();if(!e)return!1;try{const t=await e.invoke(o.SET_DOCK_LAB,{enabled:r});if(i(t)===r)return!0}catch{}return b.error(u.settings_gitWorkspace_saveError()),!1}async function y(r){await d(r)}export{v as d,d as r,y as s};
1
+ import{bv as f}from"./DYhIMPy1.js";import{W as o}from"./BDDVFcm3.js";import{bo as u}from"./41c-5lbJ.js";import{k as b}from"./ClkbPGx9.js";import"./BBCbq-hE.js";import"./BhX-5zd9.js";import"./De70D2Lx.js";import"./ChTqQfQN.js";import"./CdXmpyDy.js";import"./BuDJvkTk.js";function l(){return globalThis.electronAPI??null}function i(r){const e=r?.enabled;return typeof e=="boolean"?e:null}const v=f(!1,r=>{const e=l();if(!e)return;let t=!0,s=!1;const c=e.on(o.DOCK_LAB_CHANGED,a=>{if(!t)return;const n=i(a);n!==null&&(s=!0,r(n))});return e.invoke(o.GET_DOCK_LAB,{}).then(a=>{const n=i(a);t&&!s&&n!==null&&r(n)}).catch(()=>{}),()=>{t=!1,e.offById(o.DOCK_LAB_CHANGED,c)}});async function d(r){const e=l();if(!e)return!1;try{const t=await e.invoke(o.SET_DOCK_LAB,{enabled:r});if(i(t)===r)return!0}catch{}return b.error(u.settings_gitWorkspace_saveError()),!1}async function y(r){await d(r)}export{v as d,d as r,y as s};
@@ -1 +1 @@
1
- import{aB as v,b as y}from"./Bryo-Obg.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
1
+ import{aB as v,b as y}from"./gWaxvgpv.js";var w=5,O=1e-5,X=2,Y=.6,R=1e-6;function N(t){const e=[];for(let s=0;s<t.length-1;s++)e.push({a:t[s],b:t[s+1]});return e}y(N,"buildSegmentList");function T(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=a.x-s.x,d=a.y-s.y,u=r*d-o*i;if(u===0)return null;const n=s.x-t.x,c=s.y-t.y,p=(n*d-c*i)/u,f=(n*o-c*r)/u;return p<=R||p>=1-R||f<=R||f>=1-R?null:{point:{x:t.x+p*r,y:t.y+p*o},tA:p,tB:f}}y(T,"segmentIntersection");function P(t){return Math.abs(t.b.x-t.a.x)>=Math.abs(t.b.y-t.a.y)}y(P,"isHorizontalSeg");function B(t,e,s){if(t.curve!=="rounded")return!1;const a=t.points,r=a[e],o=a[e+1];if(!r||!o)return!1;const i=Math.hypot(o.x-r.x,o.y-r.y),d=s*i,u=e>0?L(a[e-1],r,o,w):null;if(u&&d<u.cutLen)return!0;const n=e+2<a.length?L(r,o,a[e+2],w):null;return n!==null&&i-d<n.cutLen}y(B,"crossingSitsInRoundedCorner");function C(t){const e=[];for(let s=0;s<t.length;s++){const a=t[s],r=N(a.points);for(let o=s+1;o<t.length;o++){const i=t[o],d=N(i.points);for(const[u,n]of r.entries())for(const[c,p]of d.entries()){const f=T(n.a,n.b,p.a,p.b);if(!f||B(a,u,f.tA)||B(i,c,f.tB))continue;const g=P(n),S=P(p);(g!==S?g:!1)?e.push({jumpEdgeId:a.id,otherEdgeId:i.id,segIndex:u,t:f.tA,point:f.point}):e.push({jumpEdgeId:i.id,otherEdgeId:a.id,segIndex:c,t:f.tB,point:f.point})}}}return e}y(C,"findEdgeIntersections");function M(t){const e=Math.round(t*1e3)/1e3;return Number.isInteger(e)?`${e}`:`${e}`}y(M,"fmt");function A(t){return`${M(t.x)},${M(t.y)}`}y(A,"pointToString");function D(t){const e=t.b.x-t.a.x,s=t.b.y-t.a.y;return Math.abs(e)>=Math.abs(s)?e>=0?1:0:s>=0?1:0}y(D,"getArcSweepFlag");function _(t,e){if(t.length<2)return t.map(o=>({...o}));const s=t.map(o=>({...o})),a=e.arrowTypeStart&&v[e.arrowTypeStart];if(a){const o=t[0],i=t[1],d=Math.atan2(i.y-o.y,i.x-o.x);s[0].x=o.x+a*Math.cos(d),s[0].y=o.y+a*Math.sin(d)}const r=e.arrowTypeEnd&&v[e.arrowTypeEnd];if(r){const o=t.length,i=t[o-2],d=t[o-1],u=Math.atan2(d.y-i.y,d.x-i.x);s[o-1].x=d.x-r*Math.cos(u),s[o-1].y=d.y-r*Math.sin(u)}return s}y(_,"applyMarkerOffsets");function k(t,e,s,a,r){const o=t.point.x,i=t.point.y,d={x:o-e*t.r,y:i-s*t.r},u={x:o+e*t.r,y:i+s*t.r},n=[`L${A(d)}`];return r==="arc"?n.push(`A${M(t.r)},${M(t.r)} 0 0 ${a} ${A(u)}`):n.push(`M${A(u)}`),n}y(k,"emitJump");function L(t,e,s,a){const r=e.x-t.x,o=e.y-t.y,i=s.x-e.x,d=s.y-e.y,u=Math.hypot(r,o),n=Math.hypot(i,d);if(u<O||n<O)return null;const c=r/u,p=o/u,f=i/n,g=d/n,S=c*f+p*g,b=Math.max(-1,Math.min(1,S)),m=Math.acos(b);if(m<O||Math.abs(Math.PI-m)<O)return null;const h=Math.min(a/Math.sin(m/2),u/2,n/2);return{startX:e.x-c*h,startY:e.y-p*h,endX:e.x+f*h,endY:e.y+g*h,ctrlX:e.x,ctrlY:e.y,cutLen:h}}y(L,"computeRoundedCorner");function H(t,e,s){const a=t.points;if(a.length<2)return"";const r=_(a,t),o=t.curve==="rounded",i=N(r),d=new Map;for(const n of e){const c=i[n.segIndex];if(!c)continue;const p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=d.get(n.segIndex)??[];f.push({t:n.t,point:n.point,d:n.t*p,r:s.jumpRadius}),d.set(n.segIndex,f)}const u=[`M${A(r[0])}`];for(let n=0;n<i.length;n++){const c=i[n],p=Math.hypot(c.b.x-c.a.x,c.b.y-c.a.y),f=p===0?0:(c.b.x-c.a.x)/p,g=p===0?0:(c.b.y-c.a.y)/p,S=D(c);let b=0;if(o&&n>0){const l=L(r[n-1],r[n],r[n+1]??r[n],w);l&&(b=l.cutLen)}let m=p,h=null;o&&n<i.length-1&&(h=L(r[n],r[n+1],r[n+2]??r[n+1],w),h&&(m=p-h.cutLen));const $=s.jumpRadius*Y,x=[...d.get(n)??[]].sort((l,E)=>l.t-E.t).filter(l=>{const E=Math.min(l.d-b,m-l.d)-X;return l.r=Math.min(l.r,E),l.r>=$});for(let l=0;l<x.length-1;l++){const E=x[l+1].d-x[l].d;if(x[l].r+x[l+1].r>E){const I=E/2;x[l].r=Math.min(x[l].r,I),x[l+1].r=Math.min(x[l+1].r,I)}}for(const l of x)l.r<$||u.push(...k(l,f,g,S,s.jumpStyle));o&&h?(u.push(`L${M(h.startX)},${M(h.startY)}`),u.push(`Q${M(h.ctrlX)},${M(h.ctrlY)} ${M(h.endX)},${M(h.endY)}`)):u.push(`L${A(c.b)}`)}return u.join(" ")}y(H,"rewriteEdgePath");function J(t){return/^[\d\s+,.LMelm-]*$/.test(t)}y(J,"isStraightPath");function U(t){return t?t==="linear"||t==="rounded"||t==="step"||t==="stepBefore"||t==="stepAfter":!0}y(U,"curveSupportsLineHops");function j(t){if(!t)return null;try{const e=typeof atob=="function"?atob(t):Buffer.from(t,"base64").toString(),s=JSON.parse(e);if(!Array.isArray(s))return null;const a=[];for(const r of s)r&&typeof r.x=="number"&&typeof r.y=="number"&&a.push({x:r.x,y:r.y});return a.length>=2?a:null}catch{return null}}y(j,"decodeDataPoints");function F(t,e,s){if(!s.enabled)return;const a=t.node();if(!a)return;const r=new Map;for(const n of e)r.set(n.id,n);const o=new Map;for(const n of a.querySelectorAll("path[data-id]")){const c=n.getAttribute("data-id");c!==null&&!o.has(c)&&o.set(c,n)}const i=[];for(const n of e){const c=o.get(n.id);if(!c)continue;const f=j(c.getAttribute("data-points"))??n.points;i.push({...n,points:f})}const d=C(i);if(d.length===0)return;const u=new Map;for(const n of d){const c=u.get(n.jumpEdgeId)??[];c.push(n),u.set(n.jumpEdgeId,c)}for(const n of i){const c=u.get(n.id);if(!c||c.length===0)continue;const f=r.get(n.id)?.curve;if(f!==void 0&&!U(f))continue;const g=o.get(n.id);if(!g)continue;if(f===void 0){const x=g.getAttribute("d")??"";if(!J(x))continue}const S=g.getAttribute("style")??"",b=/stroke-dasharray\s*:\s*0\s+([\d.]+)\s+[\d.]+\s+([\d.]+)/.exec(S),m=b?Number.parseFloat(b[1]):null,h=b?Number.parseFloat(b[2]):null,$=H(n,c,s);if(g.setAttribute("d",$),m!==null&&h!==null&&typeof g.getTotalLength=="function"){const x=g.getTotalLength(),l=Math.max(0,x-m-h),E=`0 ${m} ${l} ${h}`,I=S.replace(/stroke-dasharray\s*:[^;]*;?/g,`stroke-dasharray: ${E};`).replace(/;\s*;+/g,";");g.setAttribute("style",I)}}}y(F,"applyLineJumpsToSvg");export{F as a};
@@ -1 +1 @@
1
- import{t as F,bq as L,bo as H,by as G,bs as dt,b as J,bu as nt}from"./DGQ1ECsI.js";import{bs as K,cd as lt,ca as z,c5 as ct,a5 as T,be as D,b$ as M,b_ as h,bO as _,W as l,bH as U,aD as e,bS as B,bA as q,bn as N,bV as it,aA as R,c9 as u,aB as v,bl as S,ay as pt}from"./DYhIMPy1.js";import{i as C}from"./B-DRVFcy.js";import{C as ut}from"./BVzVRoQ-.js";import{f as V}from"./CxF8YFum.js";import"./DZ-cwX5R.js";import{k as vt}from"./eIlGg2ZH.js";import{Iv as W,dq as bt,dn as kt,dr as _t}from"./BSSsvY4I.js";var gt=v('<p class="p-2 text-xs text-subtle" data-testid="hook-script-content-too-large"> </p>'),mt=v('<div class="min-h-0 min-w-0 flex-1 overflow-auto" data-testid="hook-script-content-script"><!></div>'),ft=v('<span class="text-xs font-medium text-danger"> </span> <pre class="whitespace-pre-wrap break-all rounded bg-danger-background/10 p-2 font-mono text-xs text-danger"> </pre>',1),ht=v('<pre class="whitespace-pre-wrap break-all rounded bg-muted/40 p-2 font-mono text-xs text-subtle"> </pre>'),xt=v('<p class="text-xs text-subtle"> </p>'),wt=v('<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto" data-testid="hook-script-content-logs"><!> <!></div>'),It=v('<div class="flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden" data-testid="hook-script-content"><div class="flex shrink-0 border-b border-border" role="tablist"><!> <!></div> <!></div>');function Q(x,c){if(new.target)return F({component:Q,...x});K(c,!0);const g=()=>nt($,"$hooks$",w),[w,E]=dt();let s=L(c,"workspaceId",7),I=L(c,"hookId",7);const d=lt(s());z(()=>d.set(s()));const $=vt(d),b=u(()=>g().find(t=>t.hookId===I()));z(()=>{if(!s())return;const t=s();return ct(()=>{W.dispatch(bt(t)),W.dispatch(kt(t))}),()=>W.dispatch(_t(t))});let k=it("script");var X={get workspaceId(){return s()},set workspaceId(t){s(t),R()},get hookId(){return I()},set hookId(t){I(t),R()},$set:G,$on:(t,r)=>J(c,t,r)},A=It(),O=T(A),j=T(O);{let t=u(()=>e(k)==="script"),r=u(()=>e(k)==="script"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(j,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"script"),children:(p,y)=>{D();var i=M();h(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_scriptTab_label()]),l(p,i)},$$slots:{default:!0}})}var Y=B(j,2);{let t=u(()=>e(k)==="logs"),r=u(()=>e(k)==="logs"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(Y,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"logs"),children:(p,y)=>{D();var i=M();h(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_logsTab_label()]),l(p,i)},$$slots:{default:!0}})}q(O);var Z=B(O,2);{var tt=t=>{var r=mt(),p=T(r);{var y=a=>{var m=gt(),o=S(m,!0);h(n=>_(o,n),[()=>H.chat_backgroundHooks_modal_codeTooLarge_description({size:(e(b).codeBytes??0).toLocaleString()})]),l(a,m)},i=a=>{{let m=u(()=>e(b)?.code??"");ut(a,{get code(){return e(m)},language:"javascript",noMargin:!0})}};C(p,a=>{e(b)?.codeOmitted?a(y):a(i,-1)})}q(r),l(t,r)},et=t=>{var r=wt(),p=T(r);{var y=o=>{var n=ft(),f=pt(n),P=S(f,!0),at=B(f,2),ot=S(at,!0);h(st=>{_(P,st),_(ot,e(b).lastError)},[()=>H.chat_backgroundHooks_modal_lastError_label()]),l(o,n)};C(p,o=>{e(b)?.lastError&&o(y)})}var i=B(p,2);{var a=o=>{var n=ht(),f=S(n,!0);h(()=>_(f,e(b).lastLogs)),l(o,n)},m=o=>{var n=xt(),f=S(n,!0);h(P=>_(f,P),[()=>H.chat_backgroundHooks_modal_noLogs_description()]),l(o,n)};C(i,o=>{e(b)?.lastLogs?o(a):o(m,-1)})}q(r),l(t,r)};C(Z,t=>{e(k)==="script"?t(tt):t(et,-1)})}q(A),l(x,A);var rt=N(X);return E(),rt}var $t=v('<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden p-4" data-testid="hook-script-panel"><!></div>');function yt(x,c){if(new.target)return F({component:yt,...x});K(c,!0);let g=L(c,"tab",7),w=L(c,"workspaceId",7);var E={get tab(){return g()},set tab(d){g(d),R()},get workspaceId(){return w()},set workspaceId(d){w(d),R()},$set:G,$on:(d,$)=>J(c,d,$)},s=$t(),I=T(s);{let d=u(()=>g().workspaceId??w()),$=u(()=>g().hookId??"");Q(I,{get workspaceId(){return e(d)},get hookId(){return e($)}})}return q(s),l(x,s),N(E)}export{yt as default};
1
+ import{t as F,bq as L,bo as H,by as G,bs as dt,b as J,bu as nt}from"./41c-5lbJ.js";import{bs as K,cd as lt,ca as z,c5 as ct,a5 as T,be as D,b$ as M,b_ as h,bO as _,W as l,bH as U,aD as e,bS as B,bA as q,bn as N,bV as it,aA as R,c9 as u,aB as v,bl as S,ay as pt}from"./DYhIMPy1.js";import{i as C}from"./ClgmQqA9.js";import{C as ut}from"./BpGfQKt5.js";import{f as V}from"./nLyQInj7.js";import"./De70D2Lx.js";import{k as vt}from"./Bo40L-We.js";import{Iv as W,dq as bt,dn as kt,dr as _t}from"./BuDJvkTk.js";var gt=v('<p class="p-2 text-xs text-subtle" data-testid="hook-script-content-too-large"> </p>'),mt=v('<div class="min-h-0 min-w-0 flex-1 overflow-auto" data-testid="hook-script-content-script"><!></div>'),ft=v('<span class="text-xs font-medium text-danger"> </span> <pre class="whitespace-pre-wrap break-all rounded bg-danger-background/10 p-2 font-mono text-xs text-danger"> </pre>',1),ht=v('<pre class="whitespace-pre-wrap break-all rounded bg-muted/40 p-2 font-mono text-xs text-subtle"> </pre>'),xt=v('<p class="text-xs text-subtle"> </p>'),wt=v('<div class="flex min-h-0 min-w-0 flex-1 flex-col gap-2 overflow-auto" data-testid="hook-script-content-logs"><!> <!></div>'),It=v('<div class="flex h-full min-h-0 min-w-0 flex-col gap-3 overflow-hidden" data-testid="hook-script-content"><div class="flex shrink-0 border-b border-border" role="tablist"><!> <!></div> <!></div>');function Q(x,c){if(new.target)return F({component:Q,...x});K(c,!0);const g=()=>nt($,"$hooks$",w),[w,E]=dt();let s=L(c,"workspaceId",7),I=L(c,"hookId",7);const d=lt(s());z(()=>d.set(s()));const $=vt(d),b=u(()=>g().find(t=>t.hookId===I()));z(()=>{if(!s())return;const t=s();return ct(()=>{W.dispatch(bt(t)),W.dispatch(kt(t))}),()=>W.dispatch(_t(t))});let k=it("script");var X={get workspaceId(){return s()},set workspaceId(t){s(t),R()},get hookId(){return I()},set hookId(t){I(t),R()},$set:G,$on:(t,r)=>J(c,t,r)},A=It(),O=T(A),j=T(O);{let t=u(()=>e(k)==="script"),r=u(()=>e(k)==="script"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(j,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"script"),children:(p,y)=>{D();var i=M();h(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_scriptTab_label()]),l(p,i)},$$slots:{default:!0}})}var Y=B(j,2);{let t=u(()=>e(k)==="logs"),r=u(()=>e(k)==="logs"?"border-primary-ink text-primary-ink":"border-transparent text-subtle");V(Y,{variant:"ghost",role:"tab",get"aria-selected"(){return e(t)},get class(){return`border-b-2 px-3 py-1.5 text-sm ${e(r)??""}`},onclick:()=>U(k,"logs"),children:(p,y)=>{D();var i=M();h(a=>_(i,a),[()=>H.chat_backgroundHooks_modal_logsTab_label()]),l(p,i)},$$slots:{default:!0}})}q(O);var Z=B(O,2);{var tt=t=>{var r=mt(),p=T(r);{var y=a=>{var m=gt(),o=S(m,!0);h(n=>_(o,n),[()=>H.chat_backgroundHooks_modal_codeTooLarge_description({size:(e(b).codeBytes??0).toLocaleString()})]),l(a,m)},i=a=>{{let m=u(()=>e(b)?.code??"");ut(a,{get code(){return e(m)},language:"javascript",noMargin:!0})}};C(p,a=>{e(b)?.codeOmitted?a(y):a(i,-1)})}q(r),l(t,r)},et=t=>{var r=wt(),p=T(r);{var y=o=>{var n=ft(),f=pt(n),P=S(f,!0),at=B(f,2),ot=S(at,!0);h(st=>{_(P,st),_(ot,e(b).lastError)},[()=>H.chat_backgroundHooks_modal_lastError_label()]),l(o,n)};C(p,o=>{e(b)?.lastError&&o(y)})}var i=B(p,2);{var a=o=>{var n=ht(),f=S(n,!0);h(()=>_(f,e(b).lastLogs)),l(o,n)},m=o=>{var n=xt(),f=S(n,!0);h(P=>_(f,P),[()=>H.chat_backgroundHooks_modal_noLogs_description()]),l(o,n)};C(i,o=>{e(b)?.lastLogs?o(a):o(m,-1)})}q(r),l(t,r)};C(Z,t=>{e(k)==="script"?t(tt):t(et,-1)})}q(A),l(x,A);var rt=N(X);return E(),rt}var $t=v('<div class="h-full min-h-0 min-w-0 max-w-full overflow-hidden p-4" data-testid="hook-script-panel"><!></div>');function yt(x,c){if(new.target)return F({component:yt,...x});K(c,!0);let g=L(c,"tab",7),w=L(c,"workspaceId",7);var E={get tab(){return g()},set tab(d){g(d),R()},get workspaceId(){return w()},set workspaceId(d){w(d),R()},$set:G,$on:(d,$)=>J(c,d,$)},s=$t(),I=T(s);{let d=u(()=>g().workspaceId??w()),$=u(()=>g().hookId??"");Q(I,{get workspaceId(){return e(d)},get hookId(){return e($)}})}return q(s),l(x,s),N(E)}export{yt as default};
@@ -1 +1 @@
1
- var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./ZlJ0OsQO.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./Dqx3L5zl.js";import{Iv as p,Bd as we,bx as be,e as Fe,Ky as de,i8 as me,bJ as ke,D8 as z,BC as Ge,f6 as Pe,zI as xe,dT as Ee,f2 as fe,dS as _e,Ab as Ve,Kc as Ue,vQ as Be}from"./BSSsvY4I.js";import{aC as Ae,dG as he,A as H,P as ge,ay as K}from"./CbVK4mzc.js";import{h as $e}from"./DZ-cwX5R.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./CK2a86W3.js";import"./DYhIMPy1.js";import{bo as n}from"./DGQ1ECsI.js";import"./Bp_k45o-.js";import"./ChmnWquS.js";import"./B_7vJcZK.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(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 Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(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 c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);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 f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}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 c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}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 o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.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 c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.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})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={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 He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(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 Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(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?pe[e]:pe.GENERAL}const je={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 Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(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))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(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 Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(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 et={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 ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,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 h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}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&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.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 Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){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=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={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")||ie(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 nt{constructor(){m(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 ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=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:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.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:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,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 c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}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 ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(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>lt;){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 dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.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 o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=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 o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,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??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.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:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
1
+ var Me=Object.defineProperty;var De=(i,s,e)=>s in i?Me(i,s,{enumerable:!0,configurable:!0,writable:!0,value:e}):i[s]=e;var m=(i,s,e)=>De(i,typeof s!="symbol"?s+"":s,e);import{x as Ne,J as oe,Z as ce,ai as q,ar as Ce}from"./ugjOCd8V.js";import{bY as Le,cX as le,co as ue,cn as ve}from"./DUor0DI_.js";import{Iv as p,Bd as we,bx as be,e as Fe,Ky as de,i8 as me,bJ as ke,D8 as z,BC as Ge,f6 as Pe,zI as xe,dT as Ee,f2 as fe,dS as _e,Ab as Ve,Kc as Ue,vQ as Be}from"./BuDJvkTk.js";import{aC as Ae,dG as he,A as H,P as ge,ay as K}from"./DGb_dMRY.js";import{h as $e}from"./De70D2Lx.js";import{c as W}from"./ChTqQfQN.js";import{a as Xe}from"./BdWqymET.js";import{k as Q}from"./ClkbPGx9.js";import"./DYhIMPy1.js";import{bo as n}from"./41c-5lbJ.js";import"./BBCbq-hE.js";import"./BhX-5zd9.js";import"./CdXmpyDy.js";import{R as Re}from"./BvFAWM27.js";import{L as Ye}from"./CSiaiLHL.js";function We(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 Z=typeof performance<"u"?performance:{now:()=>Date.now()},V=new Xe("PerformanceOptimizer"),w=class w{constructor(){m(this,"metricsBuffer");m(this,"metricsIndex",0);m(this,"metricsCount",0);m(this,"MAX_METRICS",500);m(this,"TARGET_RESPONSE_TIME",100);m(this,"memoCache",new Map);m(this,"MEMO_TTL",6e4);m(this,"MAX_CACHE_SIZE",100);m(this,"cacheHits",0);m(this,"cacheMisses",0);m(this,"pendingRequests",new Map);m(this,"requestQueue",[]);m(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 c=0;c<s.length;c+=r){const f=s.slice(c,c+r).map((o,R)=>{const g=Math.floor(R/a)*10;return new Promise(d=>{setTimeout(async()=>{const k=await e(o);d(k)},g)})}),u=await Promise.all(f);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 f=this.getMemoized(a);if(f!==void 0)return this.cacheHits++,V.debug("Memoized result used",{operation:s,cacheKey:a,hits:this.cacheHits}),f;this.cacheMisses++}if(t.coalesce){const f=this.pendingRequests.get(s);if(f)return V.debug("Request coalesced",{operation:s}),f}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 c=await l;t.memoize&&this.memoize(a,c);const E=Z.now()-r;return this.recordMetric(s,E,!0,{strategy:t.priority||"normal",memoized:t.memoize||!1,coalesced:t.coalesce||!1}),E>this.TARGET_RESPONSE_TIME&&V.warn("Operation exceeded target time",{operation:s,duration:Math.round(E),target:this.TARGET_RESPONSE_TIME}),c}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 o=this.metricsBuffer[(e+u)%this.MAX_METRICS];o&&s.push(o)}if(s.length===0)return{avgResponseTime:0,p95ResponseTime:0,p99ResponseTime:0,successRate:100,slowOperations:[]};const t=s.sort((u,o)=>u.duration-o.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 c=a/s.length,E=Math.floor(t.length*.95),f=Math.floor(t.length*.99);return{avgResponseTime:Math.round(c),p95ResponseTime:Math.round(t[E]?.duration||0),p99ResponseTime:Math.round(t[f]?.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})}};m(w,"instance");let ee=w;const qe=ee.getInstance(),pe={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 He(i){return(i.match(/{(\w+)}/g)||[]).map(e=>e.slice(1,-1))}function Ke(i,s){return He(i).every(t=>t in s)}function Ie(i,s={}){return i.replace(/{(\w+)}/g,(e,t)=>String(s[t]??e))}function J(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 Qe(i,s){return s&&j[i]&&Ke(j[i],s)?Ie(j[i],s):ze[i]||n.errors_userFriendly_fallback_error()}function Ze(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?pe[e]:pe.GENERAL}const je={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 Je(i){return je[i]||[{action:"retry",description:"Try the operation again",automatic:!1,priority:"high"}]}var D=(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))(D||{});class Y extends Error{constructor(e,t,r={},a){super(e);m(this,"code");m(this,"context");m(this,"recoverySuggestions");m(this,"userMessage");m(this,"isRecoverable");m(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 Qe(e,this.context)}getDefaultRecoverySuggestions(e){return Je(e)}isErrorRecoverable(e){return["STREAM_INTERRUPTED","STREAM_TIMEOUT","MESSAGE_SEND_FAILED","PROVIDER_PROCESS_DIED","STORAGE_READ_FAILED","STORAGE_WRITE_FAILED"].includes(e)}getHelpLink(){return Ze(this.code)}formatMessage(e){return Ie(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 et={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 ie(i){const s=i.toLowerCase();for(const e of et.NON_RETRYABLE_ERRORS)if(s.includes(e.toLowerCase()))return!0;return!1}const tt="Agent already has an in-flight prompt. Message was not delivered.",v=W("ErrorBoundary"),b=class b{constructor(){}static getInstance(){return b.instance||(b.instance=new b),b.instance}async wrap(s,e,t={}){const{retries:r=Re.DEFAULT_ATTEMPTS,retryDelay:a=Re.BASE_DELAY,exponentialBackoff:l=!0,notify:c=!1,notifyOnRetry:E=!1,context:f={},onError:u,onRetry:o,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 h=await s();return d>1&&v.info(`[${e}] Succeeded after ${d} attempts`),h}catch(h){if(g=h,v.error(`[${e}] Attempt ${d} failed`,{error:g.message,attempt:d,maxAttempts:r+1,context:f}),u?.(g,d),d<=r&&R(g)){const C=l?a*Math.pow(2,d-1):a;E&&Q.warning(n.agent_errorBoundary_retrying_message({seconds:C/1e3})),o?.(d),v.info(`[${e}] Retrying in ${C}ms`),await this.sleep(C)}else break}const k=`${e} failed after ${d} attempt${d===1?"":"s"}: ${g?.message}`,P=J(g?.message||n.agent_errorBoundary_generic_error()),N=g?.message?.toLowerCase()||"",$=N.includes("no available models")||N.includes("all models exhausted")||N.includes("all models unavailable");throw c&&!$&&Q.error(P),new Y(P,D.OPERATION_FAILED,{originalError:g?.message,detailedMessage:k,attempts:d,context:f})}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&&Q.error(J(a.message)),new Y(J(a.message),D.OPERATION_FAILED,t.context)}}defaultShouldRetry(s){const e=s.message.toLowerCase();return ie(s.message)?!1:e.includes("network")||e.includes("timeout")?!0:s instanceof Y?[D.NETWORK_ERROR,D.STREAM_TIMEOUT,D.STREAM_CONNECTION_FAILED,D.PROVIDER_CONNECTION_FAILED,D.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 Y(`${t} timed out after ${e}ms`,D.STREAM_TIMEOUT)),e))])}async batchOperations(s,e,t={}){const{concurrency:r=5,continueOnError:a=!0,operationName:l="batch operation"}=t,c=[],E=[];for(let f=0;f<s.length;f+=r){const u=s.slice(f,f+r);(await Promise.allSettled(u.map(R=>e(R)))).forEach((R,g)=>{if(R.status==="fulfilled")c.push(R.value);else{const d=R.reason;if(E.push({item:u[g],error:d}),v.error(`[${l}] Batch item failed`,{item:u[g],error:d.message}),!a)throw d}})}return E.length>0&&v.warn(`[${l}] Completed with ${E.length} errors`),{results:c,errors:E}}};m(b,"instance");let te=b;const st=te.getInstance(),se=W("browser/index"),F=new Map,B=new Map;let U;function it(i,s,e){for(const t of s)try{t(e)}catch(r){se.error("Error in agent subscriber callback",{agentId:i,error:r})}}function rt(){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=Ae.select(e,t);B.get(t)!==a&&(B.set(t,a),it(t,r,a))}})}function at(){F.size>0||!U||(U(),U=void 0,B.clear())}function Ct(i,s,e){let t=F.get(i);const r=!t;t||(t=new Set,F.set(i,t)),t.add(s),rt();const a=p.state,l=Ae.select(a,i);return r&&B.set(i,l),l?se.debug("[subscribeToAgent] Initial callback data",{agentId:i,workspaceId:e??"current",hasSession:!0}):se.debug("[subscribeToAgent] No session found",{agentId:i,workspaceId:e??"current"}),s(l),()=>{const c=F.get(i);c&&(c.delete(s),c.size===0&&(F.delete(i),B.delete(i))),at()}}const y=W("ErrorRecovery"),Se={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")||ie(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 nt{constructor(){m(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 ot extends nt{constructor(){super(...arguments);m(this,"activeRecoveries",new Map);m(this,"recoveryStats",new Map)}async executeWithRecovery(e,t=Se.network,r){const a=Date.now(),l=new AbortController;r&&(this.cancelRecovery(r),this.activeRecoveries.set(r,l));let c,E=t.initialBackoffMs,f=0;for(let u=1;u<=t.maxRetries;u++){if(f=u,l.signal.aborted){y.info(`Recovery cancelled for operation ${r}`);break}try{y.debug(`Attempting operation (attempt ${u}/${t.maxRetries})`,{operationId:r});const o=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:o,attempts:u,totalTime:Date.now()-a}}catch(o){c=o,y.warn(`Operation failed (attempt ${u}/${t.maxRetries})`,{operationId:r,error:c.message});const R=c.message.toLowerCase();if(R.includes("interrupted")||R.includes("cancelled")||R.includes("canceled")){y.debug("User-initiated interruption/cancellation, not retrying",{operationId:r,error:c.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:c.message});break}if(ie(c.message)){y.debug("Fatal error detected, not retrying",{operationId:r,error:c.message});break}if(!t.shouldRetry(c,u)){y.debug("Error not retryable, stopping recovery",{operationId:r,error:c.message});break}if(u<t.maxRetries){const g=Math.random()*.2*E,d=Math.min(E+g,t.maxBackoffMs);t.onRetry?.(u,d),this.emit("recovery:retry",{operationId:r,attempt:u,delay:d,error:c.message}),await this.delay(d,l.signal),E=Math.min(E*t.backoffMultiplier,t.maxBackoffMs)}}}return this.updateStats(r,!1),t.onFailure?.(c,f),this.emit("recovery:failure",{operationId:r,attempts:f,duration:Date.now()-a,error:c?.message}),r&&this.activeRecoveries.delete(r),{success:!1,error:c,attempts:f,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 c=()=>{clearTimeout(l),a(new Error("Delay aborted"))};t.addEventListener("abort",c);const E=r;r=()=>{t.removeEventListener("abort",c),E()}}})}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 ct=new ot,O=new Ye({category:"WorkspaceMetrics"}),lt=100;class ut{constructor(){m(this,"metrics",new Map);m(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>lt;){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 dt=new ut,M=W("AgentSend");function A(i){p.dispatch(i)}function Te(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)}function mt(i){const s=Te(i)&&i.success===!0&&"data"in i?i.data:i;return!Te(s)||s.success!==!1?!1:typeof s.error=="string"&&s.error.includes(tt)}async function Lt(i,s,e,t={}){const r=he.select(p.state,e.id);if(!r)return;const a=Ne(i,e.id),l=t.submission,c=!!l&&Le.select(p.state,l.scope)?.supported===!0,E=(o,R,g=!1)=>{l&&A(Be(l.scope,l.id,o,Date.now(),R,g))};let f=!1;const u=()=>(!l||f||ve.select(p.state,l))&&r===he.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 o=await p.dispatch(we(e.id,i));if(u()){if(!o)throw new Error(n.agent_streamLifecycle_sessionNotFound_error({agentId:i}));o={...o,isStreaming:o.isStreaming??!1};{if(o&&(o.status==="pending"||!o.id)&&!o.backendSessionId&&o.activationState!==H.ACTIVE&&o.activationState!==H.ACTIVATING){const h=e.id.startsWith("optimistic-"),C=e.worktreePath||e.repositoryPath||e.path;if(!h&&C){M.info("Activating pending session in sendMessage",{agentId:i,status:o.status,activationState:o.activationState,hasBackendSessionId:!!o.backendSessionId});const x=await p.dispatch(be(e.id,i));if(!u())return;x&&(o=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 o&&o.status==="pending"&&o.backendSessionId&&(M.info("Fixing status for already-activated session",{agentId:i,backendSessionId:o.backendSessionId,activationState:o.activationState}),o={...o,status:Fe.Active,activationState:H.ACTIVE},A(de({...o,workspaceId:e.id})));if(!o)throw new Error(`Failed to get or create session for agent ${i}`);A(de({...o,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??oe(),k=t.messageMetadata?.[ge],P={...t.contextReferences?.length?{contextReferences:t.contextReferences}:{},...k!==void 0?{[ge]:k}:{}},N={id:me(le()),appMessageId:d,role:"user",contentBlocks:g,timestamp:new Date().toISOString(),metadata:{...P,...t.messageMetadata??{}}};c||(l&&(E("rejected"),f=!0),A(ke(o.id,N))),A(z(o.id,!0));let $=!1;try{c||await p.dispatch(Ge(e.id,i,!0,{allowTruncation:t.resetHistory}));const h=me(`msg_${le()}`),C=oe(),x=async()=>st.wrap(async()=>{if(!u())return;M.info("Agent Service: Sending message to backend with image and file blocks",{agentId:i,sessionId:o.id,hasImageBlocks:!!t.imageBlocks,imageBlocksCount:t.imageBlocks?.length||0,imageBlockDetails:t.imageBlocks?.map(_=>({type:_.type,mimeType:_.mimeType,dataLength:_.data?.length||0}))||[],hasFileBlocks:!!t.fileBlocks,fileBlocksCount:t.fileBlocks?.length||0,fileBlockDetails:t.fileBlocks?.map(_=>({type:_.type,fileName:_.fileName,mimeType:_.mimeType,attachmentId:_.attachmentId,size:_.size}))||[]});const Oe=t.model??t.modelId??o.model??void 0;A(Pe(i));const ye=ce(i,e.id),ae=p.state.chatState?.byAgentId[i]?.attemptGeneration??0,T=await $e("agent.sendMessage",{agentId:i,...c&&l?{messageId:l.id}:{},workspaceId:e.id,content:s,model:Oe,contextReferences:t.contextReferences,imageBlocks:t.imageBlocks,fileBlocks:t.fileBlocks,noteIds:t.noteIds,stdinContext:t.stdinContext,assistantMessageId:h,userAppMessageId:d,assistantAppMessageId:C,priority:t.priority,...t.messageMetadata?{messageMetadata:t.messageMetadata}:{}}).catch(_=>{if(u())throw _});if(u()){if(mt(T)){M.info("Backend dropped duplicate in-flight prompt",{agentId:i,sessionId:o.id}),E("rejected");return}if(T&&typeof T=="object"&&"success"in T){if(!T.success){const _=T.error,I=typeof _=="string"?_:_?.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:o.id,queuedMessageId:T.queuedMessage?.id}),(!c||!l||!ue.select(p.state,l))&&A(z(o.id,!1)),c||A(xe(o.id,N.id)),c){const I=T.queuedMessage,G=T.turnId,L=typeof G=="string"?G:I?.turnId;if(I&&typeof L=="string"){const S=Ee(s,t),X=K.select(p.state,i,e.id).find(ne=>ne.id===I.id||ne.turnId===L);A(fe(i,I.id,S,L,_e(X??I,S),!X&&!!l&&ue.select(p.state,l),ae))}E("accepted",I,!0),q(i,e.id);return}const _=T.queuedMessage;if(_){const I=T.turnId,G=typeof I=="string"?I:_.turnId;let L=_;if(u()&&ce(i,e.id)===ye){const S=K.select(p.state,i,e.id),X=We(S,_);A(Ve(i,X,e.id))}else u()&&(M.debug("queued-response queue seed superseded by an authoritative snapshot; reconciling via hydrate",{agentId:i,queuedMessageId:_.id}),await q(i,e.id).catch(()=>{}),L=K.select(p.state,i,e.id).find(S=>S.id===_.id||S.turnId===G));if(u()&&typeof G=="string"){const S=Ee(s,t);A(fe(i,_.id,S,G,_e(L??_,S),!L,ae))}else u()&&M.warn("auto-queued sendMessage response carried no turnId; retry record not parked",{agentId:i,queuedMessageId:_.id})}return}}c&&(E("accepted"),q(i,e.id),Ce(i,e.id)),dt.incrementMessageSent(e.id)}},"send message",{retries:c?0:2,notify:!1,context:{agentId:i,workspace:e.id}}),re=c?await x().then(()=>({success:!0,error:void 0})):await ct.executeWithRecovery(x,Se.streaming,`send-message-${i}`);if(!re.success)throw re.error||new Error(n.agent_streamLifecycle_sendFailed_error())}catch(h){if(!u())return;throw A(z(o.id,!1)),!c&&t.messageMetadata&&A(Ue(o.id,N.id,{metadata:P})),c&&E($?"rejected":"uncertain"),h}}}},{memoize:!1,coalesce:!0,priority:"high"})}export{Ct as a,J as c,We as r,Lt as s};
@@ -1 +1 @@
1
- import{t as z,bq as n,by as D,br as E,b as F}from"./DGQ1ECsI.js";import{bs as G,a5 as s,bS as g,bA as i,W as d,bn as I,aA as o,aB as v}from"./DYhIMPy1.js";import{i as p}from"./B-DRVFcy.js";import{s as c}from"./ChmnWquS.js";import{b as J,e as K}from"./Bp_k45o-.js";var L=new Set(["$$slots","$$events","$$legacy","title","description","counter","leading","actions","class"]),M=v('<div class="flex shrink-0 items-center"><!></div>'),O=v('<div data-slot="screen-header-counter" class="type-caption mb-1 text-muted-foreground"><!></div>'),Q=v('<div data-slot="screen-header-description" class="mt-1 text-sm text-muted-foreground"><!></div>'),R=v('<div data-slot="screen-header-actions" class="flex shrink-0 items-center gap-1"><!></div>'),T=v('<header><!> <div class="min-w-0 flex-1"><!> <div data-slot="screen-header-title" class="min-w-0"><!></div> <!></div> <!></header>');function U(w,a){if(new.target)return z({component:U,...w});G(a,!0);let h=n(a,"title",7),l=n(a,"description",7),_=n(a,"counter",7),m=n(a,"leading",7),u=n(a,"actions",7),b=n(a,"class",7),A=E(a,L);var C={get title(){return h()},set title(e){h(e),o()},get description(){return l()},set description(e){l(e),o()},get counter(){return _()},set counter(e){_(e),o()},get leading(){return m()},set leading(e){m(e),o()},get actions(){return u()},set actions(e){u(e),o()},get class(){return b()},set class(e){b(e),o()},$set:D,$on:(e,t)=>F(a,e,t)},f=T();J(f,e=>({"data-slot":"screen-header",class:e,...A}),[()=>K("flex min-w-0 shrink-0 items-start gap-3 px-5 pt-5",b())]);var S=s(f);{var q=e=>{var t=M(),r=s(t);c(r,m),i(t),d(e,t)};p(S,e=>{m()&&e(q)})}var x=g(S,2),k=s(x);{var B=e=>{var t=O(),r=s(t);c(r,_),i(t),d(e,t)};p(k,e=>{_()&&e(B)})}var y=g(k,2),H=s(y);c(H,h),i(y);var N=g(y,2);{var P=e=>{var t=Q(),r=s(t);c(r,l),i(t),d(e,t)};p(N,e=>{l()&&e(P)})}i(x);var W=g(x,2);{var j=e=>{var t=R(),r=s(t);c(r,u),i(t),d(e,t)};p(W,e=>{u()&&e(j)})}return i(f),d(w,f),I(C)}export{U as S};
1
+ import{t as z,bq as n,by as D,br as E,b as F}from"./41c-5lbJ.js";import{bs as G,a5 as s,bS as g,bA as i,W as d,bn as I,aA as o,aB as v}from"./DYhIMPy1.js";import{i as p}from"./ClgmQqA9.js";import{s as c}from"./BhX-5zd9.js";import{b as J,e as K}from"./BBCbq-hE.js";var L=new Set(["$$slots","$$events","$$legacy","title","description","counter","leading","actions","class"]),M=v('<div class="flex shrink-0 items-center"><!></div>'),O=v('<div data-slot="screen-header-counter" class="type-caption mb-1 text-muted-foreground"><!></div>'),Q=v('<div data-slot="screen-header-description" class="mt-1 text-sm text-muted-foreground"><!></div>'),R=v('<div data-slot="screen-header-actions" class="flex shrink-0 items-center gap-1"><!></div>'),T=v('<header><!> <div class="min-w-0 flex-1"><!> <div data-slot="screen-header-title" class="min-w-0"><!></div> <!></div> <!></header>');function U(w,a){if(new.target)return z({component:U,...w});G(a,!0);let h=n(a,"title",7),l=n(a,"description",7),_=n(a,"counter",7),m=n(a,"leading",7),u=n(a,"actions",7),b=n(a,"class",7),A=E(a,L);var C={get title(){return h()},set title(e){h(e),o()},get description(){return l()},set description(e){l(e),o()},get counter(){return _()},set counter(e){_(e),o()},get leading(){return m()},set leading(e){m(e),o()},get actions(){return u()},set actions(e){u(e),o()},get class(){return b()},set class(e){b(e),o()},$set:D,$on:(e,t)=>F(a,e,t)},f=T();J(f,e=>({"data-slot":"screen-header",class:e,...A}),[()=>K("flex min-w-0 shrink-0 items-start gap-3 px-5 pt-5",b())]);var S=s(f);{var q=e=>{var t=M(),r=s(t);c(r,m),i(t),d(e,t)};p(S,e=>{m()&&e(q)})}var x=g(S,2),k=s(x);{var B=e=>{var t=O(),r=s(t);c(r,_),i(t),d(e,t)};p(k,e=>{_()&&e(B)})}var y=g(k,2),H=s(y);c(H,h),i(y);var N=g(y,2);{var P=e=>{var t=Q(),r=s(t);c(r,l),i(t),d(e,t)};p(N,e=>{l()&&e(P)})}i(x);var W=g(x,2);{var j=e=>{var t=R(),r=s(t);c(r,u),i(t),d(e,t)};p(W,e=>{u()&&e(j)})}return i(f),d(w,f),I(C)}export{U as S};
@@ -1 +1 @@
1
- import{bI as b,dd as _,dj as C,bC as P,aS as k}from"./CbVK4mzc.js";import{c as v}from"./ChTqQfQN.js";import{bo as m}from"./DGQ1ECsI.js";import{Iv as y}from"./BSSsvY4I.js";const A={narrowWidth:600,shortHeight:500,wideWidth:900};function I(e,c,t){let i;e<A.narrowWidth?i=2:(e<A.wideWidth,i=Math.min(3,t));let o;c<A.shortHeight?o=2:o=Math.min(3,Math.ceil(t/i));const n=i*o;return{columns:i,rows:o,maxItems:n}}const h=v("PresetExecutor");async function F(e,c,t){switch(h.info("Applying content preset",{presetId:e,context:t}),e){case"planning":return W(c,t);case"agents-row":return D(c,t);case"changes":return G(c,t);case"review":return L(c,t);default:return c.applyPreset(e),!0}}async function W(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_tabTypes_agent_title(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"note",title:m.layout_shared_spec_title(),noteId:"spec",closable:!0,workspaceId:t},n[1]),!0})}async function D(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=6,r=y.state,l=b.select(r,t),d=k.select(r,t).sort((s,a)=>{const p=s.status==="active"||s.isProcessing,u=a.status==="active"||a.isProcessing;if(p&&!u)return-1;if(!p&&u)return 1;const f=s.lastActivity?new Date(s.lastActivity).getTime():s.updatedAt?new Date(s.updatedAt).getTime():0;return(a.lastActivity?new Date(a.lastActivity).getTime():a.updatedAt?new Date(a.updatedAt).getTime():0)-f});h.info("Agents row preset - agent counts",{total:l.length+d.length,foreground:l.length,background:d.length});const g=[...l,...d.slice(0,n-l.length)].slice(0,n);if(g.length===0)return h.info("No agents to display for agents-row preset"),!1;const T=I(i,o,g.length);return h.info("Agent tiling calculated",{tiling:T,agentCount:g.length}),e.batchMutations(()=>{const s=e.createGridLayout(g.length);h.info("Created grid layout for agents",{panelIds:s,panelCount:s.length,agentCount:g.length});for(let a=0;a<g.length;a++){const p=s[a];p&&e.openTab({type:"agent",title:g[a].name||m.layout_tabTypes_agent_title(),agentId:g[a].id,closable:!0,workspaceId:t},p)}return!0})}async function G(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=y.state,r=_.select(n,t),l=C.select(n,t),d=P.select(n,t),g=l.map(a=>({path:a.relativePath,type:"unstaged"})),T=r.map(a=>({path:a.relativePath,type:"staged"}));let s=[...g,...T].slice(0,6);return s.length===0&&d.length>0&&d[0].files&&(s=d[0].files.slice(0,6).map(a=>({path:a.path,type:"committed"}))),e.batchMutations(()=>{if(s.length===0){h.info("No changes to display for changes preset");const u=e.createGridLayout(1);return e.openTab({type:"changes",title:m.layout_tabTypes_changes_title(),closable:!0,workspaceId:t},u[0]),!0}const a=I(i,o,s.length);h.info("Changes tiling calculated",{tiling:a,fileCount:s.length});const p=e.createGridLayout(s.length);h.info("Created grid layout for changes",{panelIds:p,panelCount:p.length,fileCount:s.length});for(let u=0;u<s.length;u++){const f=s[u],w=f.path.split("/").pop()||f.path;e.openTab({type:"diff",title:w,diffPath:f.path,closable:!0,workspaceId:t,data:{staged:f.type==="staged"}},p[u])}return!0})}async function L(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_presetExecutor_coordinator_fallback(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"local-changes",title:m.layout_presetExecutor_allChanges_title(),closable:!0,workspaceId:t},n[1]),!0})}export{F as applyContentPreset};
1
+ import{bI as b,dd as _,dj as C,bC as P,aS as k}from"./DGb_dMRY.js";import{c as v}from"./ChTqQfQN.js";import{bo as m}from"./41c-5lbJ.js";import{Iv as y}from"./BuDJvkTk.js";const A={narrowWidth:600,shortHeight:500,wideWidth:900};function I(e,c,t){let i;e<A.narrowWidth?i=2:(e<A.wideWidth,i=Math.min(3,t));let o;c<A.shortHeight?o=2:o=Math.min(3,Math.ceil(t/i));const n=i*o;return{columns:i,rows:o,maxItems:n}}const h=v("PresetExecutor");async function F(e,c,t){switch(h.info("Applying content preset",{presetId:e,context:t}),e){case"planning":return W(c,t);case"agents-row":return D(c,t);case"changes":return G(c,t);case"review":return L(c,t);default:return c.applyPreset(e),!0}}async function W(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_tabTypes_agent_title(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"note",title:m.layout_shared_spec_title(),noteId:"spec",closable:!0,workspaceId:t},n[1]),!0})}async function D(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=6,r=y.state,l=b.select(r,t),d=k.select(r,t).sort((s,a)=>{const p=s.status==="active"||s.isProcessing,u=a.status==="active"||a.isProcessing;if(p&&!u)return-1;if(!p&&u)return 1;const f=s.lastActivity?new Date(s.lastActivity).getTime():s.updatedAt?new Date(s.updatedAt).getTime():0;return(a.lastActivity?new Date(a.lastActivity).getTime():a.updatedAt?new Date(a.updatedAt).getTime():0)-f});h.info("Agents row preset - agent counts",{total:l.length+d.length,foreground:l.length,background:d.length});const g=[...l,...d.slice(0,n-l.length)].slice(0,n);if(g.length===0)return h.info("No agents to display for agents-row preset"),!1;const T=I(i,o,g.length);return h.info("Agent tiling calculated",{tiling:T,agentCount:g.length}),e.batchMutations(()=>{const s=e.createGridLayout(g.length);h.info("Created grid layout for agents",{panelIds:s,panelCount:s.length,agentCount:g.length});for(let a=0;a<g.length;a++){const p=s[a];p&&e.openTab({type:"agent",title:g[a].name||m.layout_tabTypes_agent_title(),agentId:g[a].id,closable:!0,workspaceId:t},p)}return!0})}async function G(e,c){const{workspaceId:t,containerWidth:i,containerHeight:o}=c,n=y.state,r=_.select(n,t),l=C.select(n,t),d=P.select(n,t),g=l.map(a=>({path:a.relativePath,type:"unstaged"})),T=r.map(a=>({path:a.relativePath,type:"staged"}));let s=[...g,...T].slice(0,6);return s.length===0&&d.length>0&&d[0].files&&(s=d[0].files.slice(0,6).map(a=>({path:a.path,type:"committed"}))),e.batchMutations(()=>{if(s.length===0){h.info("No changes to display for changes preset");const u=e.createGridLayout(1);return e.openTab({type:"changes",title:m.layout_tabTypes_changes_title(),closable:!0,workspaceId:t},u[0]),!0}const a=I(i,o,s.length);h.info("Changes tiling calculated",{tiling:a,fileCount:s.length});const p=e.createGridLayout(s.length);h.info("Created grid layout for changes",{panelIds:p,panelCount:p.length,fileCount:s.length});for(let u=0;u<s.length;u++){const f=s[u],w=f.path.split("/").pop()||f.path;e.openTab({type:"diff",title:w,diffPath:f.path,closable:!0,workspaceId:t,data:{staged:f.type==="staged"}},p[u])}return!0})}async function L(e,c){const{workspaceId:t}=c,i=b.select(y.state,t),o=i.length>0?i.reduce((n,r)=>{const l=n.createdAt?new Date(n.createdAt).getTime():1/0;return(r.createdAt?new Date(r.createdAt).getTime():1/0)<l?r:n}):void 0;return e.batchMutations(()=>{const n=e.createGridLayout(2);return o&&e.openTab({type:"agent",title:o.name||m.layout_presetExecutor_coordinator_fallback(),agentId:o.id,closable:!0,workspaceId:t},n[0]),e.openTab({type:"local-changes",title:m.layout_presetExecutor_allChanges_title(),closable:!0,workspaceId:t},n[1]),!0})}export{F as applyContentPreset};
@@ -1,4 +1,4 @@
1
- import{t as oe,bq as st,bo as Q,by as ie,bu as $t,bs as Me,b as ce}from"./DGQ1ECsI.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as D,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as De,aj as Se,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as Be}from"./DYhIMPy1.js";import{i as at}from"./B-DRVFcy.js";import{I as ea,g as jt,i as Ne}from"./D3HUOTfX.js";import{f as Xt,g as ne,s as gt,c as se}from"./Bp_k45o-.js";import{b as ba}from"./BaIAhI85.js";import{f as Ut}from"./CxF8YFum.js";import"./DZ-cwX5R.js";import{A as aa,ao as na,an as sa}from"./DTowKbOf.js";import"./ChmnWquS.js";import{al as ra,aC as oa,an as Aa,ao as ka,ap as We,ag as ia,a as $a,p as Ta,dw as Ca,aO as Sa,aq as Na}from"./CbVK4mzc.js";import{R as Oa}from"./CK2a86W3.js";import{F as pe,bx as Fa,bc as Ra,ay as Ma,aS as Wa,cz as Da}from"./Cjw1QvKa.js";import{H as Ba}from"./DiRf9bEu.js";import{e as La}from"./Cosr3Aeo.js";import{L as Ea}from"./Dsv-aPKR.js";import{f as Pa}from"./B_IuZd0O.js";import{e as Nt,Iv as Fe,ny as Ga,fG as za,bX as ja,r$ as Ka,uk as Ha}from"./BSSsvY4I.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),S=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Dt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return S()},set onmouseleave(A){S(A),rt()},$set:ie,$on:(A,B)=>ce(a,A,B)},ht=nn(),bt=L(ht);{var Kt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(()=>D(Rt,` ${p()??""}`)),_(A,B)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
1
+ import{t as oe,bq as st,bo as Q,by as ie,bu as $t,bs as Me,b as ce}from"./41c-5lbJ.js";import{bs as le,a5 as L,bS as C,ay as Yt,aD as t,bA as $,bl as K,b_ as k,bO as D,W as _,bn as de,c9 as y,aA as rt,aB as F,bV as Mt,br as _a,aw as De,aj as Se,bH as V,ai as ya,be as Ia,b$ as xa,bf as wa,aC as he,a7 as Be}from"./DYhIMPy1.js";import{i as at}from"./ClgmQqA9.js";import{I as ea,g as jt,i as Ne}from"./CEufllny.js";import{f as Xt,g as ne,s as gt,c as se}from"./BBCbq-hE.js";import{b as ba}from"./BaIAhI85.js";import{f as Ut}from"./nLyQInj7.js";import"./De70D2Lx.js";import{A as aa,ao as na,an as sa}from"./Dq9dLpt4.js";import"./BhX-5zd9.js";import{al as ra,aC as oa,an as Aa,ao as ka,ap as We,ag as ia,a as $a,p as Ta,dw as Ca,aO as Sa,aq as Na}from"./DGb_dMRY.js";import{R as Oa}from"./ClkbPGx9.js";import{F as pe,bx as Fa,bc as Ra,ay as Ma,aS as Wa,cz as Da}from"./AOUBMpYk.js";import{H as Ba}from"./DzqZnAgo.js";import{e as La}from"./CccgSyFt.js";import{L as Ea}from"./BJ5nSO_Z.js";import{f as Pa}from"./Bm0VuPYn.js";import{e as Nt,Iv as Fe,ny as Ga,fG as za,bX as ja,r$ as Ka,uk as Ha}from"./BuDJvkTk.js";function qa(e){return e.type==="agent"}const Xa=180,Ya=180;var Le=F('<div class="activity-pill shrink-0 text-xs px-3 py-1.5 bg-muted/60 border border-border rounded-lg text-subtle max-w-32 truncate"><!> </div>'),Ua=F('<div class="text-ui text-subtle line-clamp-2 leading-tight px-1"> </div>'),Va=F('<div><div class="flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div> <!> <!></div>'),Qa=F('<div class="text-sm text-primary-ink flex items-center justify-center gap-1"><!> <span class="truncate"> </span></div>'),Oe=F('<span class="text-xs text-subtle"> </span>'),Za=F('<span class="status-pill text-xs px-1.5 py-0.5 bg-muted/80 rounded-md text-subtle truncate max-w-[130px]"> </span>'),Ja=F('<div class="text-ui text-subtle truncate w-full px-1 leading-tight"> </div>'),tn=F('<div class="flex flex-col items-center gap-1"><div class="flex items-center justify-center gap-1.5"><!> <!></div> <!></div>'),en=F('<div class="text-sm text-subtle line-clamp-3 leading-tight"> </div>'),an=F('<div class="avatar-wrapper h-9 w-12 flex items-center justify-center bg-background rounded-full"><!></div> <span class="font-semibold text-center leading-tight line-clamp-2"> </span> <div class="status-footer mt-auto pt-2 w-full text-center"><!></div>',1),nn=F('<div class="agent-card-wrapper flex items-center gap-3 shadow"><!> <!> <!></div>');function ca(e,a){if(new.target)return oe({component:ca,...e});le(a,!0);const s=()=>$t(_t,"$attentionRequest$",o),g=()=>$t(it,"$agentSession$",o),u=()=>$t(x,"$agentIsResponding$",o),c=()=>$t(ct,"$agentIsWaitingForOtherAgents$",o),d=()=>$t(P,"$agentIsWaiting$",o),i=()=>$t(I,"$agentIsThinking$",o),[o,l]=Me();let n=st(a,"agent",7),p=st(a,"activeFile",7),R=st(a,"activeNote",7),h=st(a,"agentNames",7),v=st(a,"onclick",7),b=st(a,"onmouseenter",7),S=st(a,"onmouseleave",7);const x=ra(n().agentId),it=oa(n().agentId),E=y(()=>!n().waitingForAgentIds||n().waitingForAgentIds.length===0?[]:n().waitingForAgentIds.map(A=>h()?.get(A)||Q.agentOverview_hierarchyCard_agent_fallback()).slice(0,2)),I=Aa(n().agentId),P=ka(n().agentId),ct=We(n().agentId),_t=ia(n().agentId),Ot=y(()=>{const A={attentionKind:s()?.kind??null};return g()?na(g(),A):sa({status:n().status,isResponding:u(),isWaitingForOtherAgents:c()},{...A,isCompleted:n().status==="completed",isFailed:n().status==="failed"})});var Dt={get agent(){return n()},set agent(A){n(A),rt()},get activeFile(){return p()},set activeFile(A){p(A),rt()},get activeNote(){return R()},set activeNote(A){R(A),rt()},get agentNames(){return h()},set agentNames(A){h(A),rt()},get onclick(){return v()},set onclick(A){v(A),rt()},get onmouseenter(){return b()},set onmouseenter(A){b(A),rt()},get onmouseleave(){return S()},set onmouseleave(A){S(A),rt()},$set:ie,$on:(A,B)=>ce(a,A,B)},ht=nn(),bt=L(ht);{var Kt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Ra},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(()=>D(Rt,` ${p()??""}`)),_(A,B)};at(bt,A=>{p()&&u()&&A(Kt)})}var Ft=C(bt,2);{let A=y(()=>d()?"border-primary-ink border-2":"");Ut(Ft,{variant:"ghost",type:"button",get class(){return`agent-card flex flex-col items-center px-2.5 py-4 bg-card border border-border
2
2
  hover:shadow transition-all cursor-pointer ${t(A)??""}`},get style(){return`width: 180px; height: 180px; anchor-name: --agent-hierarchy-${n().agentId??""};`},get onclick(){return v()},get onmouseenter(){return b()},get onmouseleave(){return S()},children:(B,Tt)=>{var Rt=an(),Lt=Yt(Rt),me=L(Lt);aa(me,{get agentId(){return n().agentId},variant:"emphasized",get state(){return t(Ot)},get specialist(){return n().specialist}}),$(Lt);var Zt=C(Lt,2),_e=K(Zt,!0),Jt=C(Zt,2),te=L(Jt);{var ye=ft=>{var r=Va(),f=L(r),M=L(f);{let z=y(()=>s().kind==="blocker"?Ma:Wa);pe(M,{get icon(){return t(z)},size:"xs"})}var W=C(M,2),m=K(W,!0);$(f);var H=C(f,2);{var nt=z=>{var It=Ua(),ot=K(It,!0);k(()=>D(ot,s().reason)),_(z,It)};at(H,z=>{s().reason&&z(nt)})}var N=C(H,2);{var G=z=>{Oa(z,{get date(){return s().timestamp},class:"text-ui text-ghost"})};at(N,z=>{s().timestamp&&z(G)})}$(r),k(z=>{Xt(r,1,`text-sm flex flex-col items-center gap-0.5 ${s().kind==="blocker"?"text-red-500":"text-warning-ink"}`),D(m,z)},[()=>s().kind==="blocker"?Q.chat_agentCard_attentionBlocker_label():Q.chat_agentCard_attentionDiscussion_label()]),_(ft,r)},yt=ft=>{var r=Qa(),f=L(r);pe(f,{get icon(){return Fa},size:"xs",class:"animate-pulse"});var M=C(f,2),W=K(M,!0);$(r),k(m=>D(W,m),[()=>Q.agentOverview_hierarchyCard_waitingFor_label({names:t(E).join(", ")})]),_(ft,r)},Ie=ft=>{const r=y(()=>n().activeToolName?$a(n().activeToolName,n().activeToolInput||{}):null),f=y(()=>t(r)&&!t(r).hidden?t(r):null);var M=tn(),W=L(M),m=L(W);ea(m,{size:14});var H=C(m,2);{var nt=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_thinking_label()]),_(Y,Z)},N=Y=>{var Z=Za(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}
3
3
  ${t(f).subject??""}`)),_(Y,Z)},G=Y=>{var Z=Oe(),pt=K(Z);k(()=>D(pt,`${t(f).verb??""}...`)),_(Y,Z)},z=Y=>{var Z=Oe(),pt=K(Z,!0);k(Et=>D(pt,Et),[()=>Q.agentOverview_hierarchyCard_responding_label()]),_(Y,Z)};at(H,Y=>{i()?Y(nt):t(f)&&t(f).subject?Y(N,1):t(f)?Y(G,2):Y(z,-1)})}$(W);var It=C(W,2);{var ot=Y=>{var Z=Ja(),pt=K(Z,!0);k(()=>D(pt,n().lastResponse)),_(Y,Z)};at(It,Y=>{!t(f)&&n().lastResponse&&Y(ot)})}$(M),_(ft,M)},xe=ft=>{var r=en(),f=K(r,!0);k(()=>D(f,n().lastResponse)),_(ft,r)};at(te,ft=>{s()?ft(ye):c()?ft(yt,1):u()||i()?ft(Ie,2):n().lastResponse&&ft(xe,3)})}$(Jt),k(()=>D(_e,n().name)),_(B,Rt)},$$slots:{default:!0}})}var ge=C(Ft,2);{var Bt=A=>{var B=Le(),Tt=L(B);pe(Tt,{get icon(){return Da},size:"xs",class:"inline"});var Rt=C(Tt);$(B),k(Lt=>D(Rt,` ${Lt??""}`),[()=>Q.agentOverview_hierarchyCard_note_label()]),_(A,B)};at(ge,A=>{R()&&u()&&A(Bt)})}$(ht),_(e,ht);var Qt=de(Dt);return l(),Qt}const sn=50;var rn=F('<span class="sr-only"> </span> <!>',1);function Re(e,a){if(new.target)return oe({component:Re,...e});le(a,!0);const s=()=>$t(R,"$attentionRequest$",c),g=()=>$t(h,"$agentSession$",c),u=()=>$t(p,"$agentIsWaitingForOtherAgents$",c),[c,d]=Me();let i=st(a,"agent",7),o=st(a,"onclick",7),l=st(a,"onmouseenter",7),n=st(a,"onmouseleave",7);const p=We(i().agentId),R=ia(i().agentId),h=oa(i().agentId),v=y(()=>{const x={attentionKind:s()?.kind??null};return g()?na(g(),x):sa({status:i().status,isResponding:i().status==="responding",isWaitingForOtherAgents:u()},{...x,isCompleted:i().status==="completed",isFailed:i().status==="failed"})});var b={get agent(){return i()},set agent(x){i(x),rt()},get onclick(){return o()},set onclick(x){o(x),rt()},get onmouseenter(){return l()},set onmouseenter(x){l(x),rt()},get onmouseleave(){return n()},set onmouseleave(x){n(x),rt()},$set:ie,$on:(x,it)=>ce(a,x,it)};Ut(e,{variant:"ghost",type:"button",class:"background-agent-card relative flex flex-col items-center justify-center gap-1 rounded-full bg-sidebar hover:bg-muted/70 transition-colors cursor-pointer p-2",get style(){return`width: 50px; min-height: 50px; anchor-name: --agent-hierarchy-${i().agentId??""};`},get onclick(){return o()},get onmouseenter(){return l()},get onmouseleave(){return n()},children:(x,it)=>{var E=rn(),I=Yt(E),P=K(I,!0),ct=C(I,2);aa(ct,{get agentId(){return i().agentId},size:32,get state(){return t(v)},get specialist(){return i().specialist}}),k(()=>D(P,i().name)),_(x,E)},$$slots:{default:!0}});var S=de(b);return d(),S}var re=he('<path fill="none"></path>'),on=F('<div class="batch-group-box relative z-10 bg-background border border-border rounded-xl"></div>'),cn=F('<svg class="connector-svg" style="overflow: visible; display: block;"><!><!></svg> <div class="children-items-row flex items-start justify-center"></div>',1),ln=F('<div class="children-wrapper flex flex-col items-center"></div>'),dn=F('<div class="agent-tree-node flex flex-col items-center"><div class="agent-card-wrapper relative z-10"><!></div> <!></div>'),gn=F('<div class="absolute inset-0 flex items-center justify-center"><div class="text-center text-subtle"><p class="text-lg font-medium"> </p> <p class="text-sm mt-1"> </p></div></div>'),un=F('<div class="utility-corral border border-dashed border-border rounded-lg p-3 min-w-20"><div class="corral-label text-xs text-subtle font-medium mb-2 text-center"> </div> <div class="corral-agents flex flex-col items-center gap-2"></div></div>'),fn=F('<div class="utility-corrals flex flex-col gap-4"></div>'),pn=F('<div class="text-xs text-subtle capitalize"> </div>'),vn=F('<span class="px-1.5 py-0.5 text-ui font-medium bg-muted text-subtle rounded"> </span>'),hn=F('<span class="text-warning-ink"> </span>'),mn=F('<span class="text-primary-ink"> </span>'),_n=F('<span class="text-green-500"> </span>'),yn=F('<span class="text-red-500"> </span>'),In=F("<span> </span>"),xn=F('<div class="text-xs text-subtle line-clamp-3 border-t border-border pt-2 mt-2"> </div>'),wn=F('<div class="text-xs text-subtle flex items-center gap-1"><!> <span> </span></div>'),bn=F('<div class="p-3 space-y-2"><div class="flex items-center gap-2"><!> <div class="flex-1 min-w-0"><div class="font-medium text-sm truncate"> </div> <!></div> <!></div> <div class="text-xs text-subtle"><!></div> <div class="text-xs text-subtle"> </div> <!> <!></div>'),An=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),kn=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>'),$n=he('<svg class="w-4 h-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M15 3h6v6M9 21H3v-6M21 3l-7 7M3 21l7-7"></path></svg>'),Tn=F('<div class="canvas-content absolute inset-0 flex items-center justify-center p-8 svelte-13q5gm4"><div class="hierarchy-wrapper flex items-start gap-8"><!> <div class="main-hierarchy flex flex-col items-center gap-4"><div class="hierarchy-container flex flex-col items-center gap-4"><div class="roots-row flex justify-center"></div></div></div></div> <!></div> <div class="zoom-controls absolute bottom-4 right-4 flex items-center gap-1 bg-card border border-border rounded-lg shadow-sm p-1"><!> <!> <!> <div class="w-px h-6 bg-border mx-1"></div> <!></div> <div class="absolute bottom-4 left-4 text-xs text-subtle"> </div>',1),Cn=F('<div class="agent-hierarchy-graph relative w-full h-full overflow-hidden bg-background svelte-13q5gm4"><!></div>');function la(e,a){if(new.target)return oe({component:la,...e});le(a,!0);const s=(r,f=wa,M)=>{const W=y(()=>f().agent.isBackground),m=y(()=>f().children.length>0),H=y(()=>t(m)&&f().children[0]?.agent.isBackground?sn:Xa),nt=y(()=>16),N=y(()=>60),G=y(()=>t(m)?Rt(f().children,t(H),i):[]),z=y(()=>(()=>{const O=[];for(let q=0;q<t(G).length;q+=Tt)O.push(t(G).slice(q,q+Tt));return O})()),It=y(()=>t(z).map(O=>O.reduce((q,J)=>q+J.width,0)+Math.max(0,O.length-1)*i)),ot=y(()=>Math.max(...t(It),0));var Y=dn(),Z=L(Y),pt=L(Z);{var Et=O=>{Re(O,{get agent(){return f().agent},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})},we=O=>{ca(O,{get agent(){return f().agent},get activeFile(){return f().activeFile},get activeNote(){return f().activeNote},get agentNames(){return t(Lt)},onclick:q=>te(f().agent,q),onmouseenter:()=>x(f().agent.agentId),onmouseleave:it})};at(pt,O=>{t(W)?O(Et):O(we,-1)})}$(Z);var be=C(Z,2);{var U=O=>{const q=y(()=>f().agent.status==="waiting"?f().agent.waitingForAgentIds||[]:[]),J=y(()=>t(q).length>0),et=y(()=>t(N)/2);var xt=ln();jt(xt,21,()=>t(z),Ne,(Ht,At,Ct)=>{const Pt=y(()=>t(It)[Ct]),ee=y(()=>(t(ot)-t(Pt))/2),Ae=y(()=>(()=>{let ut=0;return t(At).map(j=>{const St=ut+j.width/2;return ut+=j.width+i,St})})());var ue=cn(),Gt=Yt(ue);gt(Gt,"height",t(N));var qt=L(Gt);{var ke=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} -${Ya} L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)},$e=ut=>{var j=re();k(()=>{gt(j,"d",`M ${t(ot)/2} 0 L ${t(ot)/2} ${t(N)/3}`),gt(j,"stroke",t(J)?"var(--primary-ink)":"currentColor"),Xt(j,0,se(t(J)?"":"text-border")),gt(j,"stroke-width",t(J)?2:1)}),_(ut,j)};at(qt,ut=>{Ct>0?ut(ke):ut($e,-1)})}var Te=C(qt);jt(Te,17,()=>t(At),Ne,(ut,j,St)=>{const vt=y(()=>t(ee)+t(Ae)[St]),lt=y(()=>t(ot)/2),zt=y(()=>t(j).type==="batch"?t(j).children.some(wt=>t(q).includes(wt.agent.agentId)):t(q).includes(t(j).child.agent.agentId)),mt=y(()=>t(zt)?"var(--color-primary)":"currentColor"),kt=y(()=>t(zt)?"":"text-border"),w=y(()=>t(zt)?2:1),T=y(()=>t(j).type==="batch"?t(N)-A:t(N)),tt=y(()=>Math.abs(t(vt)-t(lt))),X=y(()=>Math.min(t(nt),t(tt)/2));var fe=Be(),Ce=Yt(fe);{var va=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3} L ${t(lt)??""} ${t(T)??""}`),gt(dt,"stroke",t(mt)),Xt(dt,0,se(t(kt)),"svelte-13q5gm4"),gt(dt,"stroke-width",t(w))}),_(wt,dt)},ha=wt=>{var dt=re();k(()=>{gt(dt,"d",`M ${t(lt)??""} ${t(N)/3}
4
4
  L ${t(lt)??""} ${t(et)-t(X)}
@@ -1 +1 @@
1
- import{t as mt,bq as k,by as dt,bs as ut,b as ft,bu as _,bo as D}from"./DGQ1ECsI.js";import{bs as gt,ca as T,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as i,cd as j,aA as w,bS as bt,aB as $t}from"./DYhIMPy1.js";import{i as A}from"./B-DRVFcy.js";import{k as q}from"./B99vgEcA.js";import{c as K}from"./CJeZnjZ2.js";import{as as It,cN as St}from"./Cjw1QvKa.js";import{dl as ht,dK as kt}from"./CbVK4mzc.js";import{S as wt,c as Ct}from"./BtEu1RiA.js";import{selectScriptById as yt,selectCanDeleteScript as xt}from"./VbWa-HQf.js";import"./Bp_k45o-.js";import"./ChmnWquS.js";import"./DZ-cwX5R.js";import"./286xXFLf.js";import{M as N}from"./CPFtOnI7.js";import{g as Dt}from"./DfN8_dcw.js";import{T as Tt}from"./BwZVuT_r.js";import{l as At,d as Bt}from"./C7_ws2_m.js";import{Iv as B,CD as Vt,uS as Wt,gM as Rt}from"./BSSsvY4I.js";var Mt=$t("<!> <!>",1);function Ht(V,c){if(new.target)return mt({component:Ht,...V});gt(c,!0);const $=()=>_(J,"$fullContext$",u),P=()=>_(U,"$canDeleteScript$",u),z=()=>_(L,"$scriptContext$",u),E=()=>_(Q,"$script$",u),W=()=>_(X,"$homeView$",u),[u,F]=ut(),G=t=>{var r=b(),n=m(r);{var f=g=>{var S=Mt(),O=m(S);{let v=i(()=>D.workspace_shell_showInBottomBar_tooltip());K(O,()=>N,(h,x)=>{x(h,{get icon(){return It},get label(){return e(v)},onclick:Z,"data-move-to-bottom-bar":!0})})}var st=bt(O,2);{var nt=v=>{var h=b(),x=m(h);{let it=i(()=>D.scripts_delete_label()),ct=i(()=>P()?void 0:D.scripts_delete_disabled_description());K(x,()=>N,(lt,pt)=>{pt(lt,{get icon(){return St},get label(){return e(it)},destructive:!0,get disabledReason(){return e(ct)},onclick:Y})})}d(v,h)};A(st,v=>{e(o)&&v(nt)})}d(g,S)};A(n,g=>{$()&&g(f)})}d(t,r)};let s=k(c,"tab",7),a=k(c,"workspaceId",7),C=k(c,"layoutId",7),l=k(c,"isActive",7);const I=i(()=>s().terminalId),o=i(()=>s().scriptId),R=Dt(),p=j(""),y=j("");T(()=>p.set(a())),T(()=>y.set(e(o)??""));const J=ht(p),L=kt(p),Q=yt(p,y),U=xt(p,y),X=At(p);let M=!0;vt(()=>{M=!1});function Y(){if(!e(o))return;const t=a(),r=e(o),n=s().id;return Ct(t,r,()=>M&&l()&&a()===t&&e(o)===r&&s().id===n)}function Z(){$()&&(e(o)&&B.dispatch(Vt(a(),e(o))),B.dispatch(Wt(a(),e(I))),B.dispatch(Rt(C()??a(),s().id)))}T(()=>{if(!(!R||!l()))return R.registerActions({actions:G})});var tt={get tab(){return s()},set tab(t){s(t),w()},get workspaceId(){return a()},set workspaceId(t){a(t),w()},get layoutId(){return C()},set layoutId(t){C(t),w()},get isActive(){return l()},set isActive(t){l(t),w()},$set:dt,$on:(t,r)=>ft(c,t,r)},H=b(),et=m(H);{var rt=t=>{var r=b(),n=m(r);q(n,()=>e(o),f=>{{let g=i(()=>W()?.unavailable===!0),S=i(()=>Bt(W()));wt(f,{get scriptId(){return e(o)},get workspaceId(){return a()},class:"h-full",get runDisabled(){return e(g)},get runDisabledReason(){return e(S)}})}}),d(t,r)},at=t=>{var r=b(),n=m(r);q(n,()=>e(I),f=>{Tt(f,{get terminalId(){return e(I)},get workspaceId(){return a()},class:"h-full"})}),d(t,r)};A(et,t=>{e(o)&&l()&&z()&&($()||E())?t(rt):e(I)&&l()&&$()&&t(at,1)})}d(V,H);var ot=_t(tt);return F(),ot}export{Ht as default};
1
+ import{t as mt,bq as k,by as dt,bs as ut,b as ft,bu as _,bo as D}from"./41c-5lbJ.js";import{bs as gt,ca as T,aD as e,bj as vt,a7 as b,ay as m,W as d,bn as _t,c9 as i,cd as j,aA as w,bS as bt,aB as $t}from"./DYhIMPy1.js";import{i as A}from"./ClgmQqA9.js";import{k as q}from"./D9WrXbf9.js";import{c as K}from"./Dv-TQImR.js";import{as as It,cN as St}from"./AOUBMpYk.js";import{dl as ht,dK as kt}from"./DGb_dMRY.js";import{S as wt,c as Ct}from"./BjnapXgD.js";import{selectScriptById as yt,selectCanDeleteScript as xt}from"./CuHfgFFh.js";import"./BBCbq-hE.js";import"./BhX-5zd9.js";import"./De70D2Lx.js";import"./CCw4KHZp.js";import{M as N}from"./BYjUWrg8.js";import{g as Dt}from"./DfN8_dcw.js";import{T as Tt}from"./DuPQa1Hv.js";import{l as At,d as Bt}from"./sxpeFI4o.js";import{Iv as B,CD as Vt,uS as Wt,gM as Rt}from"./BuDJvkTk.js";var Mt=$t("<!> <!>",1);function Ht(V,c){if(new.target)return mt({component:Ht,...V});gt(c,!0);const $=()=>_(J,"$fullContext$",u),P=()=>_(U,"$canDeleteScript$",u),z=()=>_(L,"$scriptContext$",u),E=()=>_(Q,"$script$",u),W=()=>_(X,"$homeView$",u),[u,F]=ut(),G=t=>{var r=b(),n=m(r);{var f=g=>{var S=Mt(),O=m(S);{let v=i(()=>D.workspace_shell_showInBottomBar_tooltip());K(O,()=>N,(h,x)=>{x(h,{get icon(){return It},get label(){return e(v)},onclick:Z,"data-move-to-bottom-bar":!0})})}var st=bt(O,2);{var nt=v=>{var h=b(),x=m(h);{let it=i(()=>D.scripts_delete_label()),ct=i(()=>P()?void 0:D.scripts_delete_disabled_description());K(x,()=>N,(lt,pt)=>{pt(lt,{get icon(){return St},get label(){return e(it)},destructive:!0,get disabledReason(){return e(ct)},onclick:Y})})}d(v,h)};A(st,v=>{e(o)&&v(nt)})}d(g,S)};A(n,g=>{$()&&g(f)})}d(t,r)};let s=k(c,"tab",7),a=k(c,"workspaceId",7),C=k(c,"layoutId",7),l=k(c,"isActive",7);const I=i(()=>s().terminalId),o=i(()=>s().scriptId),R=Dt(),p=j(""),y=j("");T(()=>p.set(a())),T(()=>y.set(e(o)??""));const J=ht(p),L=kt(p),Q=yt(p,y),U=xt(p,y),X=At(p);let M=!0;vt(()=>{M=!1});function Y(){if(!e(o))return;const t=a(),r=e(o),n=s().id;return Ct(t,r,()=>M&&l()&&a()===t&&e(o)===r&&s().id===n)}function Z(){$()&&(e(o)&&B.dispatch(Vt(a(),e(o))),B.dispatch(Wt(a(),e(I))),B.dispatch(Rt(C()??a(),s().id)))}T(()=>{if(!(!R||!l()))return R.registerActions({actions:G})});var tt={get tab(){return s()},set tab(t){s(t),w()},get workspaceId(){return a()},set workspaceId(t){a(t),w()},get layoutId(){return C()},set layoutId(t){C(t),w()},get isActive(){return l()},set isActive(t){l(t),w()},$set:dt,$on:(t,r)=>ft(c,t,r)},H=b(),et=m(H);{var rt=t=>{var r=b(),n=m(r);q(n,()=>e(o),f=>{{let g=i(()=>W()?.unavailable===!0),S=i(()=>Bt(W()));wt(f,{get scriptId(){return e(o)},get workspaceId(){return a()},class:"h-full",get runDisabled(){return e(g)},get runDisabledReason(){return e(S)}})}}),d(t,r)},at=t=>{var r=b(),n=m(r);q(n,()=>e(I),f=>{Tt(f,{get terminalId(){return e(I)},get workspaceId(){return a()},class:"h-full"})}),d(t,r)};A(et,t=>{e(o)&&l()&&z()&&($()||E())?t(rt):e(I)&&l()&&$()&&t(at,1)})}d(V,H);var ot=_t(tt);return F(),ot}export{Ht as default};
@@ -1 +1 @@
1
- import{t as Y,bq as s,by as G,br as J,b as K}from"./DGQ1ECsI.js";import{bo as L,bs as Q,ca as U,aD as i,ay as V,bx as X,bS as Z,W as B,bn as $,c9 as n,aA as r,be as ee,b$ as te,b_ as ae,bO as se,aB as re}from"./DYhIMPy1.js";import{i as ie}from"./B-DRVFcy.js";import{b as ne,e as oe}from"./Bp_k45o-.js";import{l as de,o as le,k as ue,t as ce,e as fe,a as ge}from"./CM0lKKPd.js";import{b as me}from"./BaIAhI85.js";import"./rEoZFmiI.js";import{a_ as xe}from"./CxF8YFum.js";var he=new Set(["$$slots","$$events","$$legacy","ref","id","class","value","doesExpandToFit","autoResize","minHeight","maxHeight","noFocusStyle","variant","size","message","error","messageId","aria-describedby","aria-invalid"]),be=re("<textarea></textarea> <!>",1);function ve(E,t){const C=L();if(new.target)return Y({component:ve,...E});Q(t,!0);const k=xe();let a=s(t,"ref",15),x=s(t,"id",7),h=s(t,"class",7),c=s(t,"value",15),b=s(t,"doesExpandToFit",7,!1),v=s(t,"autoResize",7,!1),f=s(t,"minHeight",7,80),o=s(t,"maxHeight",7,400),y=s(t,"noFocusStyle",7,!1),g=s(t,"variant",7,"default"),_=s(t,"size",7),z=s(t,"message",7),d=s(t,"error",7),m=s(t,"messageId",23,()=>`${C}-message`),H=s(t,"aria-describedby",7),p=s(t,"aria-invalid",7),M=J(t,he);const I=n(()=>_()??k),l=n(()=>v()||b()),F=n(()=>d()??z()),j=n(()=>[H(),i(F)?m():void 0].filter(Boolean).join(" ")||void 0),A=n(()=>d()?!0:p());function D(){a()?.focus()}function P(){a()?.blur()}function R(){if(!i(l)||!a())return;a(a().style.height="auto",!0);const e=Math.min(Math.max(a().scrollHeight,f()),o());a(a().style.height=`${e}px`,!0),a(a().style.overflowY=a().scrollHeight>o()?"auto":"hidden",!0)}U(()=>{i(l)&&a()&&c()!==void 0&&R()});var q={focus:D,blur:P,get ref(){return a()},set ref(e){a(e),r()},get id(){return x()},set id(e){x(e),r()},get class(){return h()},set class(e){h(e),r()},get value(){return c()},set value(e){c(e),r()},get doesExpandToFit(){return b()},set doesExpandToFit(e=!1){b(e),r()},get autoResize(){return v()},set autoResize(e=!1){v(e),r()},get minHeight(){return f()},set minHeight(e=80){f(e),r()},get maxHeight(){return o()},set maxHeight(e=400){o(e),r()},get noFocusStyle(){return y()},set noFocusStyle(e=!1){y(e),r()},get variant(){return g()},set variant(e="default"){g(e),r()},get size(){return _()},set size(e){_(e),r()},get message(){return z()},set message(e){z(e),r()},get error(){return d()},set error(e){d(e),r()},get messageId(){return m()},set messageId(e=`${C}-message`){m(e),r()},get"aria-describedby"(){return H()},set"aria-describedby"(e){H(e),r()},get"aria-invalid"(){return p()},set"aria-invalid"(e){p(e),r()},$set:G,$on:(e,S)=>K(t,e,S)},T=be(),u=V(T);X(u),ne(u,e=>({id:x(),"data-slot":"textarea","data-size":i(I),"data-variant":g()==="inline"?"inline":void 0,oninput:i(l)?R:void 0,"aria-describedby":i(j),"aria-invalid":i(A),class:e,style:i(l)?`min-height: ${f()}px; max-height: ${o()}px`:void 0,autocorrect:"off",autocapitalize:"off",spellcheck:"false",...M}),[()=>oe(g()==="inline"?le:["type-caption text-foreground placeholder:text-muted-foreground flex w-full rounded-(--radius-medium) border px-3",ue,ce,i(I)==="compact"?"py-1.5":"py-2",i(l)?"resize-none overflow-hidden":"min-h-20"],y()&&de,h())]),me(u,e=>a(e),()=>a());var N=Z(u,2);{var O=e=>{{let S=n(()=>d()?"error":"helper");ge(e,{get id(){return m()},get tone(){return i(S)},children:(W,ye)=>{ee();var w=te();ae(()=>se(w,i(F))),B(W,w)},$$slots:{default:!0}})}};ie(N,e=>{i(F)&&e(O)})}return fe(u,c),B(E,T),$(q)}export{ve as T};
1
+ import{t as Y,bq as s,by as G,br as J,b as K}from"./41c-5lbJ.js";import{bo as L,bs as Q,ca as U,aD as i,ay as V,bx as X,bS as Z,W as B,bn as $,c9 as n,aA as r,be as ee,b$ as te,b_ as ae,bO as se,aB as re}from"./DYhIMPy1.js";import{i as ie}from"./ClgmQqA9.js";import{b as ne,e as oe}from"./BBCbq-hE.js";import{l as de,o as le,k as ue,t as ce,e as fe,a as ge}from"./D_P8KoFV.js";import{b as me}from"./BaIAhI85.js";import"./CCO5tijn.js";import{a_ as xe}from"./nLyQInj7.js";var he=new Set(["$$slots","$$events","$$legacy","ref","id","class","value","doesExpandToFit","autoResize","minHeight","maxHeight","noFocusStyle","variant","size","message","error","messageId","aria-describedby","aria-invalid"]),be=re("<textarea></textarea> <!>",1);function ve(E,t){const C=L();if(new.target)return Y({component:ve,...E});Q(t,!0);const k=xe();let a=s(t,"ref",15),x=s(t,"id",7),h=s(t,"class",7),c=s(t,"value",15),b=s(t,"doesExpandToFit",7,!1),v=s(t,"autoResize",7,!1),f=s(t,"minHeight",7,80),o=s(t,"maxHeight",7,400),y=s(t,"noFocusStyle",7,!1),g=s(t,"variant",7,"default"),_=s(t,"size",7),z=s(t,"message",7),d=s(t,"error",7),m=s(t,"messageId",23,()=>`${C}-message`),H=s(t,"aria-describedby",7),p=s(t,"aria-invalid",7),M=J(t,he);const I=n(()=>_()??k),l=n(()=>v()||b()),F=n(()=>d()??z()),j=n(()=>[H(),i(F)?m():void 0].filter(Boolean).join(" ")||void 0),A=n(()=>d()?!0:p());function D(){a()?.focus()}function P(){a()?.blur()}function R(){if(!i(l)||!a())return;a(a().style.height="auto",!0);const e=Math.min(Math.max(a().scrollHeight,f()),o());a(a().style.height=`${e}px`,!0),a(a().style.overflowY=a().scrollHeight>o()?"auto":"hidden",!0)}U(()=>{i(l)&&a()&&c()!==void 0&&R()});var q={focus:D,blur:P,get ref(){return a()},set ref(e){a(e),r()},get id(){return x()},set id(e){x(e),r()},get class(){return h()},set class(e){h(e),r()},get value(){return c()},set value(e){c(e),r()},get doesExpandToFit(){return b()},set doesExpandToFit(e=!1){b(e),r()},get autoResize(){return v()},set autoResize(e=!1){v(e),r()},get minHeight(){return f()},set minHeight(e=80){f(e),r()},get maxHeight(){return o()},set maxHeight(e=400){o(e),r()},get noFocusStyle(){return y()},set noFocusStyle(e=!1){y(e),r()},get variant(){return g()},set variant(e="default"){g(e),r()},get size(){return _()},set size(e){_(e),r()},get message(){return z()},set message(e){z(e),r()},get error(){return d()},set error(e){d(e),r()},get messageId(){return m()},set messageId(e=`${C}-message`){m(e),r()},get"aria-describedby"(){return H()},set"aria-describedby"(e){H(e),r()},get"aria-invalid"(){return p()},set"aria-invalid"(e){p(e),r()},$set:G,$on:(e,S)=>K(t,e,S)},T=be(),u=V(T);X(u),ne(u,e=>({id:x(),"data-slot":"textarea","data-size":i(I),"data-variant":g()==="inline"?"inline":void 0,oninput:i(l)?R:void 0,"aria-describedby":i(j),"aria-invalid":i(A),class:e,style:i(l)?`min-height: ${f()}px; max-height: ${o()}px`:void 0,autocorrect:"off",autocapitalize:"off",spellcheck:"false",...M}),[()=>oe(g()==="inline"?le:["type-caption text-foreground placeholder:text-muted-foreground flex w-full rounded-(--radius-medium) border px-3",ue,ce,i(I)==="compact"?"py-1.5":"py-2",i(l)?"resize-none overflow-hidden":"min-h-20"],y()&&de,h())]),me(u,e=>a(e),()=>a());var N=Z(u,2);{var O=e=>{{let S=n(()=>d()?"error":"helper");ge(e,{get id(){return m()},get tone(){return i(S)},children:(W,ye)=>{ee();var w=te();ae(()=>se(w,i(F))),B(W,w)},$$slots:{default:!0}})}};ie(N,e=>{i(F)&&e(O)})}return fe(u,c),B(E,T),$(q)}export{ve as T};
@@ -1,4 +1,4 @@
1
- import{g as Ut}from"./B4oIQ1kI.js";import{s as Kt}from"./DLibMiVC.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./Bryo-Obg.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
1
+ import{g as Ut}from"./CVDRxz2f.js";import{s as Kt}from"./BjVx5o0n.js";import{b as f,C as Tt,a_ as Zt,V as jt,aZ as Wt,U as qt,b0 as Ht,Y as Qt,X as tt,ay as F,z as Xt,r as Jt,$ as $t,am as te,aU as ee,ab as se,aG as ie,aT as re,p as ae,_ as ne,a1 as oe,aP as ce,aW as le,bh as he}from"./gWaxvgpv.js";var Ct=(function(){var s=f(function(G,n,l,d){for(l=l||{},d=G.length;d--;l[G[d]]=n);return l},"o"),a=[6,9,21,23,25,27,34,37,38,39,40,41,43,46,47,51,53,54,55],o=[2,2],c=[1,7],r=[1,9],u=[1,10],y=[1,11],g=[1,12],k=[1,30],C=[1,23],p=[1,24],b=[1,25],A=[1,26],v=[1,27],O=[1,19],N=[1,28],I=[1,29],x=[1,20],D=[1,18],L=[1,21],w=[1,22],Ot=[2,6],h=[6,9,21,23,25,27,33,34,37,38,39,40,41,43,46,47,51,53,54,55],dt=[1,36],pt=[1,37],ft=[1,38],bt=[1,39],gt=[1,40],Z=[6,9,12,14,16,19,20,21,23,25,27,33,34,37,38,39,40,41,43,46,47,50,51,53,54,55,69,70,71,72,73],V=[1,46],M=[1,47],j=[1,57],W=[43,51,53,54,55,74,75],q=[1,70],H=[1,68],B=[1,65],Q=[1,69],X=[1,71],et=[6,9,12,16,21,23,25,27,33,34,37,38,39,40,41,43,44,45,46,47,51,52,53,54,55,69,70,71,72,73],st=[1,78],it=[1,77],rt=[1,76],Nt=[69,70,71,72,73],xt=[1,91],At=[6,9,45,50],z=[6,9,12,44,45,50,51,52],at=[1,101],nt=[1,100],ot=[1,99],J=[18,61],It=[1,110],Rt=[1,109],vt=[20,43,51,53,54,55],yt=[18,61,64,66],_t={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,ER_DIAGRAM:4,document:5,EOF:6,line:7,statement:8,NEWLINE:9,entityName:10,relSpec:11,COLON:12,role:13,STYLE_SEPARATOR:14,idList:15,BLOCK_START:16,attributes:17,BLOCK_STOP:18,SQS:19,SQE:20,title:21,title_value:22,acc_title:23,acc_title_value:24,acc_descr:25,acc_descr_value:26,acc_descr_multiline_value:27,direction:28,classDefStatement:29,classStatement:30,styleStatement:31,subgraphHeader:32,END:33,SUBGRAPH:34,separator:35,subgraphTitle:36,direction_tb:37,direction_bt:38,direction_rl:39,direction_lr:40,CLASSDEF:41,stylesOpt:42,UNICODE_TEXT:43,STYLE_TEXT:44,COMMA:45,CLASS:46,STYLE:47,style:48,styleComponent:49,SEMI:50,NUM:51,BRKT:52,ENTITY_NAME:53,DECIMAL_NUM:54,ENTITY_ONE:55,attribute:56,attributeType:57,attributeName:58,attributeKeyTypeList:59,attributeComment:60,ATTRIBUTE_WORD:61,"?":62,attributeKeyType:63,",":64,ATTRIBUTE_KEY:65,COMMENT:66,cardinality:67,relType:68,ZERO_OR_ONE:69,ZERO_OR_MORE:70,ONE_OR_MORE:71,ONLY_ONE:72,MD_PARENT:73,NON_IDENTIFYING:74,IDENTIFYING:75,WORD:76,$accept:0,$end:1},terminals_:{2:"error",4:"ER_DIAGRAM",6:"EOF",9:"NEWLINE",12:"COLON",14:"STYLE_SEPARATOR",16:"BLOCK_START",18:"BLOCK_STOP",19:"SQS",20:"SQE",21:"title",22:"title_value",23:"acc_title",24:"acc_title_value",25:"acc_descr",26:"acc_descr_value",27:"acc_descr_multiline_value",33:"END",34:"SUBGRAPH",37:"direction_tb",38:"direction_bt",39:"direction_rl",40:"direction_lr",41:"CLASSDEF",43:"UNICODE_TEXT",44:"STYLE_TEXT",45:"COMMA",46:"CLASS",47:"STYLE",50:"SEMI",51:"NUM",52:"BRKT",53:"ENTITY_NAME",54:"DECIMAL_NUM",55:"ENTITY_ONE",61:"ATTRIBUTE_WORD",62:"?",64:",",65:"ATTRIBUTE_KEY",66:"COMMENT",69:"ZERO_OR_ONE",70:"ZERO_OR_MORE",71:"ONE_OR_MORE",72:"ONLY_ONE",73:"MD_PARENT",74:"NON_IDENTIFYING",75:"IDENTIFYING",76:"WORD"},productions_:[0,[3,3],[5,0],[5,2],[7,1],[7,1],[7,1],[8,5],[8,9],[8,7],[8,7],[8,4],[8,6],[8,3],[8,5],[8,1],[8,3],[8,7],[8,9],[8,6],[8,8],[8,4],[8,6],[8,2],[8,2],[8,2],[8,1],[8,1],[8,1],[8,1],[8,1],[8,3],[32,3],[32,6],[36,1],[36,2],[28,1],[28,1],[28,1],[28,1],[29,4],[15,1],[15,1],[15,3],[15,3],[30,3],[31,4],[42,1],[42,3],[48,1],[48,2],[35,1],[35,1],[35,1],[49,1],[49,1],[49,1],[49,1],[10,1],[10,1],[10,1],[10,1],[10,1],[17,1],[17,2],[56,2],[56,3],[56,3],[56,4],[57,1],[57,2],[58,1],[59,1],[59,3],[63,1],[60,1],[11,3],[67,1],[67,1],[67,1],[67,1],[67,1],[68,1],[68,1],[13,1],[13,1],[13,1]],performAction:f(function(n,l,d,i,_,t,$){var e=t.length-1;switch(_){case 1:break;case 2:this.$=[];break;case 3:this.$=t[e-1].concat(t[e]);break;case 4:this.$=t[e];break;case 5:case 6:this.$=[];break;case 7:i.addEntity(t[e-4]),i.addEntity(t[e-2]),i.addRelationship(t[e-4],t[e],t[e-2],t[e-3]),this.$=[t[e-4],t[e-2]];break;case 8:i.addEntity(t[e-8]),i.addEntity(t[e-4]),i.addRelationship(t[e-8],t[e],t[e-4],t[e-5]),i.setClass([t[e-8]],t[e-6]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-8],t[e-4]];break;case 9:i.addEntity(t[e-6]),i.addEntity(t[e-2]),i.addRelationship(t[e-6],t[e],t[e-2],t[e-3]),i.setClass([t[e-6]],t[e-4]),this.$=[t[e-6],t[e-2]];break;case 10:i.addEntity(t[e-6]),i.addEntity(t[e-4]),i.addRelationship(t[e-6],t[e],t[e-4],t[e-5]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-6],t[e-4]];break;case 11:i.addEntity(t[e-3]),i.addAttributes(t[e-3],t[e-1]),this.$=[t[e-3]];break;case 12:i.addEntity(t[e-5]),i.addAttributes(t[e-5],t[e-1]),i.setClass([t[e-5]],t[e-3]),this.$=[t[e-5]];break;case 13:i.addEntity(t[e-2]),this.$=[t[e-2]];break;case 14:i.addEntity(t[e-4]),i.setClass([t[e-4]],t[e-2]),this.$=[t[e-4]];break;case 15:i.addEntity(t[e]),this.$=[t[e]];break;case 16:i.addEntity(t[e-2]),i.setClass([t[e-2]],t[e]),this.$=[t[e-2]];break;case 17:i.addEntity(t[e-6],t[e-4]),i.addAttributes(t[e-6],t[e-1]),this.$=[t[e-6]];break;case 18:i.addEntity(t[e-8],t[e-6]),i.addAttributes(t[e-8],t[e-1]),i.setClass([t[e-8]],t[e-3]),this.$=[t[e-8]];break;case 19:i.addEntity(t[e-5],t[e-3]),this.$=[t[e-5]];break;case 20:i.addEntity(t[e-7],t[e-5]),i.setClass([t[e-7]],t[e-2]),this.$=[t[e-7]];break;case 21:i.addEntity(t[e-3],t[e-1]);break;case 22:i.addEntity(t[e-5],t[e-3]),i.setClass([t[e-5]],t[e]);break;case 23:case 24:this.$=t[e].trim(),i.setAccTitle(this.$);break;case 25:case 26:this.$=t[e].trim(),i.setAccDescription(this.$);break;case 27:i.subgraphDepth?this.$=t[e]:(i.setDirection(t[e].value),this.$=[]);break;case 31:i.subgraphDepth=(i.subgraphDepth||1)-1,this.$=i.addSubGraph({text:t[e-2].id},t[e-1],{text:t[e-2].text});break;case 32:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-1],text:t[e-1]};break;case 33:i.subgraphDepth=(i.subgraphDepth||0)+1,this.$={id:t[e-4],text:t[e-2]};break;case 34:case 59:case 60:case 61:case 62:case 86:this.$=t[e];break;case 35:this.$=t[e-1]+" "+t[e];break;case 36:this.$={stmt:"dir",value:"TB"};break;case 37:this.$={stmt:"dir",value:"BT"};break;case 38:this.$={stmt:"dir",value:"RL"};break;case 39:this.$={stmt:"dir",value:"LR"};break;case 40:this.$=t[e-3],i.addClass(t[e-2],t[e-1]);break;case 41:case 42:case 63:case 72:this.$=[t[e]];break;case 43:case 44:this.$=t[e-2].concat([t[e]]);break;case 45:this.$=t[e-2],i.setClass(t[e-1],t[e]);break;case 46:this.$=t[e-3],i.addCssStyles(t[e-2],t[e-1]);break;case 47:this.$=[t[e]];break;case 48:t[e-2].push(t[e]),this.$=t[e-2];break;case 50:this.$=t[e-1]+t[e];break;case 58:case 84:case 85:this.$=t[e].replace(/"/g,"");break;case 64:t[e].push(t[e-1]),this.$=t[e];break;case 65:this.$={type:t[e-1],name:t[e]};break;case 66:this.$={type:t[e-2],name:t[e-1],keys:t[e]};break;case 67:this.$={type:t[e-2],name:t[e-1],comment:t[e]};break;case 68:this.$={type:t[e-3],name:t[e-2],keys:t[e-1],comment:t[e]};break;case 69:case 71:case 74:this.$=t[e];break;case 70:this.$=t[e-1]+t[e];break;case 73:t[e-2].push(t[e]),this.$=t[e-2];break;case 75:this.$=t[e].replace(/"/g,"");break;case 76:this.$={cardA:t[e],relType:t[e-1],cardB:t[e-2]};break;case 77:this.$=i.Cardinality.ZERO_OR_ONE;break;case 78:this.$=i.Cardinality.ZERO_OR_MORE;break;case 79:this.$=i.Cardinality.ONE_OR_MORE;break;case 80:this.$=i.Cardinality.ONLY_ONE;break;case 81:this.$=i.Cardinality.MD_PARENT;break;case 82:this.$=i.Identification.NON_IDENTIFYING;break;case 83:this.$=i.Identification.IDENTIFYING;break}},"anonymous"),table:[{3:1,4:[1,2]},{1:[3]},s(a,o,{5:3}),{6:[1,4],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},s(a,Ot,{1:[2,1]}),s(h,[2,3]),s(h,[2,4]),s(h,[2,5]),s(h,[2,15],{11:31,67:35,14:[1,32],16:[1,33],19:[1,34],69:dt,70:pt,71:ft,72:bt,73:gt}),{22:[1,41]},{24:[1,42]},{26:[1,43]},s(h,[2,26]),s(h,[2,27]),s(h,[2,28]),s(h,[2,29]),s(h,[2,30]),s(h,o,{5:44}),s(Z,[2,58]),s(Z,[2,59]),s(Z,[2,60]),s(Z,[2,61]),s(Z,[2,62]),s(h,[2,36]),s(h,[2,37]),s(h,[2,38]),s(h,[2,39]),{15:45,43:V,44:M},{15:48,43:V,44:M},{15:49,43:V,44:M},{10:50,43:O,51:x,53:D,54:L,55:w},{10:51,43:O,51:x,53:D,54:L,55:w},{15:52,43:V,44:M},{17:53,18:[1,54],56:55,57:56,61:j},{10:58,43:O,51:x,53:D,54:L,55:w},{68:59,74:[1,60],75:[1,61]},s(W,[2,77]),s(W,[2,78]),s(W,[2,79]),s(W,[2,80]),s(W,[2,81]),s(h,[2,23]),s(h,[2,24]),s(h,[2,25]),{6:[1,63],7:5,8:6,9:c,10:8,21:r,23:u,25:y,27:g,28:13,29:14,30:15,31:16,32:17,33:[1,62],34:k,37:C,38:p,39:b,40:A,41:v,43:O,46:N,47:I,51:x,53:D,54:L,55:w},{12:q,42:64,44:H,45:B,48:66,49:67,51:Q,52:X},s(et,[2,41]),s(et,[2,42]),{15:72,43:V,44:M,45:B},{12:q,42:73,44:H,45:B,48:66,49:67,51:Q,52:X},{6:st,9:it,19:[1,75],35:74,50:rt},{12:[1,79],14:[1,80]},s(h,[2,16],{67:35,11:81,16:[1,82],45:B,69:dt,70:pt,71:ft,72:bt,73:gt}),{18:[1,83]},s(h,[2,13]),{17:84,18:[2,63],56:55,57:56,61:j},{58:85,61:[1,86]},{61:[2,69],62:[1,87]},{20:[1,88]},{67:89,69:dt,70:pt,71:ft,72:bt,73:gt},s(Nt,[2,82]),s(Nt,[2,83]),s(h,[2,31]),s(h,Ot),{6:st,9:it,35:90,45:xt,50:rt},{43:[1,92],44:[1,93]},s(At,[2,47],{49:94,12:q,44:H,51:Q,52:X}),s(z,[2,49]),s(z,[2,54]),s(z,[2,55]),s(z,[2,56]),s(z,[2,57]),s(h,[2,45],{45:B}),{6:st,9:it,35:95,45:xt,50:rt},s(h,[2,32]),{10:97,36:96,43:O,51:x,53:D,54:L,55:w},s(h,[2,51]),s(h,[2,52]),s(h,[2,53]),{13:98,43:at,53:nt,76:ot},{15:102,43:V,44:M},{10:103,43:O,51:x,53:D,54:L,55:w},{17:104,18:[1,105],56:55,57:56,61:j},s(h,[2,11]),{18:[2,64]},s(J,[2,65],{59:106,60:107,63:108,65:It,66:Rt}),s([18,61,65,66],[2,71]),{61:[2,70]},s(h,[2,21],{14:[1,112],16:[1,111]}),s([43,51,53,54,55],[2,76]),s(h,[2,40]),{12:q,44:H,48:113,49:67,51:Q,52:X},s(et,[2,43]),s(et,[2,44]),s(z,[2,50]),s(h,[2,46]),{10:115,20:[1,114],43:O,51:x,53:D,54:L,55:w},s(vt,[2,34]),s(h,[2,7]),s(h,[2,84]),s(h,[2,85]),s(h,[2,86]),{12:[1,116],45:B},{12:[1,118],14:[1,117]},{18:[1,119]},s(h,[2,14]),s(J,[2,66],{60:120,64:[1,121],66:Rt}),s(J,[2,67]),s(yt,[2,72]),s(J,[2,75]),s(yt,[2,74]),{17:122,18:[1,123],56:55,57:56,61:j},{15:124,43:V,44:M},s(At,[2,48],{49:94,12:q,44:H,51:Q,52:X}),{6:st,9:it,35:125,50:rt},s(vt,[2,35]),{13:126,43:at,53:nt,76:ot},{15:127,43:V,44:M},{13:128,43:at,53:nt,76:ot},s(h,[2,12]),s(J,[2,68]),{63:129,65:It},{18:[1,130]},s(h,[2,19]),s(h,[2,22],{16:[1,131],45:B}),s(h,[2,33]),s(h,[2,10]),{12:[1,132],45:B},s(h,[2,9]),s(yt,[2,73]),s(h,[2,17]),{17:133,18:[1,134],56:55,57:56,61:j},{13:135,43:at,53:nt,76:ot},{18:[1,136]},s(h,[2,20]),s(h,[2,8]),s(h,[2,18])],defaultActions:{84:[2,64],87:[2,70]},parseError:f(function(n,l){if(l.recoverable)this.trace(n);else{var d=new Error(n);throw d.hash=l,d}},"parseError"),parse:f(function(n){var l=this,d=[0],i=[],_=[null],t=[],$=this.table,e="",lt=0,Dt=0,Ft=2,Lt=1,Yt=t.slice.call(arguments,1),m=Object.create(this.lexer),Y={yy:{}};for(var kt in this.yy)Object.prototype.hasOwnProperty.call(this.yy,kt)&&(Y.yy[kt]=this.yy[kt]);m.setInput(n,Y.yy),Y.yy.lexer=m,Y.yy.parser=this,typeof m.yylloc>"u"&&(m.yylloc={});var mt=m.yylloc;t.push(mt);var Pt=m.options&&m.options.ranges;typeof Y.yy.parseError=="function"?this.parseError=Y.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function zt(S){d.length=d.length-2*S,_.length=_.length-S,t.length=t.length-S}f(zt,"popStack");function wt(){var S;return S=i.pop()||m.lex()||Lt,typeof S!="number"&&(S instanceof Array&&(i=S,S=i.pop()),S=l.symbols_[S]||S),S}f(wt,"lex");for(var E,P,T,Et,U={},ht,R,Vt,ut;;){if(P=d[d.length-1],this.defaultActions[P]?T=this.defaultActions[P]:((E===null||typeof E>"u")&&(E=wt()),T=$[P]&&$[P][E]),typeof T>"u"||!T.length||!T[0]){var St="";ut=[];for(ht in $[P])this.terminals_[ht]&&ht>Ft&&ut.push("'"+this.terminals_[ht]+"'");m.showPosition?St="Parse error on line "+(lt+1)+`:
2
2
  `+m.showPosition()+`
3
3
  Expecting `+ut.join(", ")+", got '"+(this.terminals_[E]||E)+"'":St="Parse error on line "+(lt+1)+": Unexpected "+(E==Lt?"end of input":"'"+(this.terminals_[E]||E)+"'"),this.parseError(St,{text:m.match,token:this.terminals_[E]||E,line:m.yylineno,loc:mt,expected:ut})}if(T[0]instanceof Array&&T.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+E);switch(T[0]){case 1:d.push(E),_.push(m.yytext),t.push(m.yylloc),d.push(T[1]),E=null,Dt=m.yyleng,e=m.yytext,lt=m.yylineno,mt=m.yylloc;break;case 2:if(R=this.productions_[T[1]][1],U.$=_[_.length-R],U._$={first_line:t[t.length-(R||1)].first_line,last_line:t[t.length-1].last_line,first_column:t[t.length-(R||1)].first_column,last_column:t[t.length-1].last_column},Pt&&(U._$.range=[t[t.length-(R||1)].range[0],t[t.length-1].range[1]]),Et=this.performAction.apply(U,[e,Dt,lt,Y.yy,T[1],_,t].concat(Yt)),typeof Et<"u")return Et;R&&(d=d.slice(0,-1*R*2),_=_.slice(0,-1*R),t=t.slice(0,-1*R)),d.push(this.productions_[T[1]][0]),_.push(U.$),t.push(U._$),Vt=$[d[d.length-2]][d[d.length-1]],d.push(Vt);break;case 3:return!0}}return!0},"parse")},Gt=(function(){var G={EOF:1,parseError:f(function(l,d){if(this.yy.parser)this.yy.parser.parseError(l,d);else throw new Error(l)},"parseError"),setInput:f(function(n,l){return this.yy=l||this.yy||{},this._input=n,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},"setInput"),input:f(function(){var n=this._input[0];this.yytext+=n,this.yyleng++,this.offset++,this.match+=n,this.matched+=n;var l=n.match(/(?:\r\n?|\n).*/g);return l?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),n},"input"),unput:f(function(n){var l=n.length,d=n.split(/(?:\r\n?|\n)/g);this._input=n+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-l),this.offset-=l;var i=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),d.length-1&&(this.yylineno-=d.length-1);var _=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:d?(d.length===i.length?this.yylloc.first_column:0)+i[i.length-d.length].length-d[0].length:this.yylloc.first_column-l},this.options.ranges&&(this.yylloc.range=[_[0],_[0]+this.yyleng-l]),this.yyleng=this.yytext.length,this},"unput"),more:f(function(){return this._more=!0,this},"more"),reject:f(function(){if(this.options.backtrack_lexer)this._backtrack=!0;else return this.parseError("Lexical error on line "+(this.yylineno+1)+`. You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).
4
4
  `+this.showPosition(),{text:"",token:null,line:this.yylineno});return this},"reject"),less:f(function(n){this.unput(this.match.slice(n))},"less"),pastInput:f(function(){var n=this.matched.substr(0,this.matched.length-this.match.length);return(n.length>20?"...":"")+n.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var n=this.match;return n.length<20&&(n+=this._input.substr(0,20-n.length)),(n.substr(0,20)+(n.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var n=this.pastInput(),l=new Array(n.length+1).join("-");return n+this.upcomingInput()+`
@@ -1 +1 @@
1
- import{g as l,r as m,d as a}from"./FoUQsQJW.js";import{p}from"./BRvIFAVQ.js";import{b as t,ay as o}from"./Bryo-Obg.js";import{M as u,b as c}from"./D3v_P2Uq.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=y(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),y=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),v=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(v(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},$={parser:b,db:a,renderer:m,styles:l};export{$ as diagram};
1
+ import{g as l,r as m,d as a}from"./CgfVp9Ef.js";import{p}from"./oNlT93oA.js";import{b as t,ay as o}from"./gWaxvgpv.js";import{M as u,b as c}from"./W2yoNJFv.js";var f=c().RailroadPeg.parser.LangiumParser,i=t(e=>{const r=e.alternatives.map(d);return r.length===1?r[0]:{type:"choice",alternatives:r}},"transformOrderedChoice"),d=t(e=>{const r=e.elements.map(P);return r.length===1?r[0]:{type:"sequence",elements:r}},"transformSequence"),P=t(e=>{const r=g(e.suffix);return e.operator?{type:"special",text:e.operator==="&"?`&${s(r)}`:`!${s(r)}`}:r},"transformPrefix"),s=t(e=>{switch(e.type){case"terminal":return`"${e.value}"`;case"nonterminal":return e.name;case"special":return e.text;default:return"(...)"}},"nodeToLabel"),g=t(e=>{const r=y(e.primary);if(!e.operator)return r;switch(e.operator){case"?":return{type:"optional",element:r};case"*":return{type:"repetition",element:r,min:0,max:1/0};case"+":return{type:"repetition",element:r,min:1,max:1/0};default:throw new Error(`Unsupported PEG suffix operator: ${e.operator}`)}},"transformSuffix"),y=t(e=>{switch(e.$type){case"PegLiteral":return{type:"terminal",value:e.value};case"PegIdentifier":return{type:"nonterminal",name:e.name};case"PegGroup":return i(e.element);case"PegAny":return{type:"special",text:e.dot};default:throw new Error(`Unsupported PEG primary node: ${e.$type}`)}},"transformPrimary"),v=t(e=>({name:e.name,definition:i(e.definition)}),"transformRule"),h=t(e=>{p(e,a),e.title&&a.setTitle(e.title),e.rules.map(r=>a.addRule(v(r)))},"populateDb"),b={parse:t(e=>{a.clear(),o.debug("[PEG Parser] Starting Langium parse");const r=f.parse(e);if(r.lexerErrors.length>0||r.parserErrors.length>0)throw new u(r);const n=r.value;o.debug("[PEG Parser] Parsed rules:",n.rules.length),h(n),o.debug("[PEG Parser] Parse complete")},"parse"),parser:{yy:a}},$={parser:b,db:a,renderer:m,styles:l};export{$ as diagram};