@intent-hq/web 2.290.0 → 2.290.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/package.json +1 -1
  2. package/web/app/immutable/chunks/{DeXgzEXt.js → -8bl9H3j.js} +1 -1
  3. package/web/app/immutable/chunks/{B_tLm3FX.js → 1H7i14Jq.js} +1 -1
  4. package/web/app/immutable/chunks/{CVoR5NDH.js → 1NjHIsWL.js} +1 -1
  5. package/web/app/immutable/chunks/{BuPFKHtN.js → 2zyiBICC.js} +1 -1
  6. package/web/app/immutable/chunks/{7bnNetCh.js → 4cIwmSuD.js} +4 -4
  7. package/web/app/immutable/chunks/{DOzFltDq.js → 86pQg5ba.js} +1 -1
  8. package/web/app/immutable/chunks/{9mpJnkDG.js → 8DpW-FUQ.js} +1 -1
  9. package/web/app/immutable/chunks/{DFhWc3Xl.js → 8ZymRjAb.js} +1 -1
  10. package/web/app/immutable/chunks/{DTh2IQKZ.js → B05yODFj.js} +1 -1
  11. package/web/app/immutable/chunks/{xFioAb_b.js → B1uw4k3u.js} +1 -1
  12. package/web/app/immutable/chunks/{3Hx-xwhh.js → B4ARXgVr.js} +1 -1
  13. package/web/app/immutable/chunks/{BUGkkCym.js → B7WsW6mB.js} +2 -2
  14. package/web/app/immutable/chunks/{bGIBa4-r.js → BB-rM-bv.js} +1 -1
  15. package/web/app/immutable/chunks/{zCZWMH02.js → BCqLW1sk.js} +1 -1
  16. package/web/app/immutable/chunks/{Cx7iLEYy.js → BFxAoZrN.js} +3 -3
  17. package/web/app/immutable/chunks/{DIbPNVg7.js → BJiYgQMg.js} +1 -1
  18. package/web/app/immutable/chunks/{C6dKjZk_.js → BLV57oiS.js} +1 -1
  19. package/web/app/immutable/chunks/{VI8s0N-a.js → BLwubCUL.js} +1 -1
  20. package/web/app/immutable/chunks/{BJClJd-t.js → BME2e0zx.js} +1 -1
  21. package/web/app/immutable/chunks/{BLfTJyKw.js → BMI9BPVJ.js} +1 -1
  22. package/web/app/immutable/chunks/{BGG3Zscy.js → BOrf8iaF.js} +2 -2
  23. package/web/app/immutable/chunks/{BDn01g3q.js → BPomlxD-.js} +5 -5
  24. package/web/app/immutable/chunks/{DaNfseRw.js → BQAjYSZn.js} +1 -1
  25. package/web/app/immutable/chunks/{XG9LuART.js → BUfDnmlv.js} +1 -1
  26. package/web/app/immutable/chunks/{BeteiAtg.js → BVf1OKWM.js} +1 -1
  27. package/web/app/immutable/chunks/{DyTkTh0C.js → BVkABTn_.js} +1 -1
  28. package/web/app/immutable/chunks/{CFBH989r.js → BZML3c09.js} +1 -1
  29. package/web/app/immutable/chunks/{Bm0FPS2G.js → BZrGNaMY.js} +4 -4
  30. package/web/app/immutable/chunks/{Mb97pGy9.js → B_ZXH4Bf.js} +1 -1
  31. package/web/app/immutable/chunks/{_0mq0vvG.js → Ba-TS5vR.js} +1 -1
  32. package/web/app/immutable/chunks/{DI6oKJrr.js → BffyNBKQ.js} +1 -1
  33. package/web/app/immutable/chunks/{BXzaNdSF.js → Bfq2PcjA.js} +1 -1
  34. package/web/app/immutable/chunks/{TPpS6DWt.js → BgerNePf.js} +1 -1
  35. package/web/app/immutable/chunks/{DUMeb8Tg.js → BiCS5wL3.js} +1 -1
  36. package/web/app/immutable/chunks/{czyBPXbO.js → BjBW4i6w.js} +1 -1
  37. package/web/app/immutable/chunks/{2Zse_zlb.js → BjJW_Stw.js} +1 -1
  38. package/web/app/immutable/chunks/{DywBWiWr.js → BmwLKx4A.js} +2 -2
  39. package/web/app/immutable/chunks/{DwKgqaL_.js → BoHfk-5t.js} +1 -1
  40. package/web/app/immutable/chunks/{w9Jeqnt9.js → BpOXeNkx.js} +1 -1
  41. package/web/app/immutable/chunks/{txAmNNfN.js → BpxCnE9X.js} +2 -2
  42. package/web/app/immutable/chunks/{BX_hW0qI.js → BsqGui1M.js} +1 -1
  43. package/web/app/immutable/chunks/{DualWjmg.js → BssOKdq0.js} +1 -1
  44. package/web/app/immutable/chunks/{HWRbLPjE.js → BtVjR42p.js} +1 -1
  45. package/web/app/immutable/chunks/{BeZSE8qD.js → BvtLLvEi.js} +1 -1
  46. package/web/app/immutable/chunks/{CTNvudJn.js → BvypOCfp.js} +1 -1
  47. package/web/app/immutable/chunks/{BOV2yVmE.js → BwDb1jNr.js} +1 -1
  48. package/web/app/immutable/chunks/{ZahkIG5A.js → BxE5JflA.js} +1 -1
  49. package/web/app/immutable/chunks/{LgC5iPo9.js → Byu82QgX.js} +1 -1
  50. package/web/app/immutable/chunks/{CsBmR9QJ.js → C-BS-coA.js} +1 -1
  51. package/web/app/immutable/chunks/{CB5rZSQk.js → C0fOehTZ.js} +1 -1
  52. package/web/app/immutable/chunks/{CLCbFeGH.js → C1H4_ssx.js} +1 -1
  53. package/web/app/immutable/chunks/{BMAdQvY4.js → C4hboqwm.js} +1 -1
  54. package/web/app/immutable/chunks/{l8G_rqMf.js → C7KdCylX.js} +3 -3
  55. package/web/app/immutable/chunks/{Cf5LD9TB.js → C7mmIZCH.js} +1 -1
  56. package/web/app/immutable/chunks/{CBQ9Dj27.js → C9AcsTi0.js} +1 -1
  57. package/web/app/immutable/chunks/{DWVb7mpY.js → CAaAIfXJ.js} +1 -1
  58. package/web/app/immutable/chunks/{2p97_N8F.js → CEAZJuV2.js} +1 -1
  59. package/web/app/immutable/chunks/{DHyS0o2Q.js → CECSRFPp.js} +1 -1
  60. package/web/app/immutable/chunks/{CT_RWC-b.js → CETsvapu.js} +1 -1
  61. package/web/app/immutable/chunks/{BaL0o0Td.js → CG-2eU4S.js} +1 -1
  62. package/web/app/immutable/chunks/{CeJvKYEf.js → CJcw2WA-.js} +1 -1
  63. package/web/app/immutable/chunks/{BwTgppku.js → CKuYPUu0.js} +1 -1
  64. package/web/app/immutable/chunks/{CnRB4N94.js → CN15iJiw.js} +1 -1
  65. package/web/app/immutable/chunks/{CC2jdDPt.js → CNWeExHy.js} +1 -1
  66. package/web/app/immutable/chunks/{O7y8odEy.js → CQk4XJFx.js} +1 -1
  67. package/web/app/immutable/chunks/{D6XmzNBT.js → CSJ0J5sC.js} +1 -1
  68. package/web/app/immutable/chunks/{1RFrLNza.js → CT1GHsTn.js} +1 -1
  69. package/web/app/immutable/chunks/{DMEnrA6r.js → CU1rgNTy.js} +1 -1
  70. package/web/app/immutable/chunks/{D_TiJ_fE.js → CW92V9X1.js} +1 -1
  71. package/web/app/immutable/chunks/{FQxEz28M.js → CYEJX57C.js} +1 -1
  72. package/web/app/immutable/chunks/{R4VbyJYi.js → CYH5KIcO.js} +1 -1
  73. package/web/app/immutable/chunks/{CB3E3AyJ.js → CZiA6iY8.js} +1 -1
  74. package/web/app/immutable/chunks/{cfooBVHs.js → C_dZqjuM.js} +1 -1
  75. package/web/app/immutable/chunks/{Ce9YhY2C.js → Car8OZH2.js} +1 -1
  76. package/web/app/immutable/chunks/{Ico6LbU5.js → CaxwpItd.js} +1 -1
  77. package/web/app/immutable/chunks/{Bg4Uz_3j.js → CbVYqaBE.js} +1 -1
  78. package/web/app/immutable/chunks/{Bx7BNLnp.js → Ccxm74iK.js} +1 -1
  79. package/web/app/immutable/chunks/{DbNaInRh.js → CfV9aH5z.js} +2 -2
  80. package/web/app/immutable/chunks/{CtBQs9aW.js → Ch36jfts.js} +1 -1
  81. package/web/app/immutable/chunks/{Cyjl25fy.js → ChRkiYOJ.js} +1 -1
  82. package/web/app/immutable/chunks/{CjrYYJVA.js → CiyXcVwM.js} +1 -1
  83. package/web/app/immutable/chunks/{Dw68b__v.js → CjUzEyu9.js} +1 -1
  84. package/web/app/immutable/chunks/{DrDFJIB-.js → CkmJMnjs.js} +1 -1
  85. package/web/app/immutable/chunks/{BG92xiA-.js → ClHM0gRH.js} +1 -1
  86. package/web/app/immutable/chunks/{BZrxWDyC.js → Clm-X79i.js} +1 -1
  87. package/web/app/immutable/chunks/{DhkrcYPH.js → Cm8yeV3M.js} +1 -1
  88. package/web/app/immutable/chunks/{D_uZvS29.js → Cmd7Q9e2.js} +2 -2
  89. package/web/app/immutable/chunks/{uw9q9ubw.js → CpWIfz5C.js} +1 -1
  90. package/web/app/immutable/chunks/{gywQvRwA.js → CpZlxc5c.js} +1 -1
  91. package/web/app/immutable/chunks/{u43L-bVE.js → Cqsec-yx.js} +1 -1
  92. package/web/app/immutable/chunks/{YnEJ07_G.js → Cro1ceUg.js} +1 -1
  93. package/web/app/immutable/chunks/{aeIQN6XF.js → Cs1191LV.js} +1 -1
  94. package/web/app/immutable/chunks/{BSqZ5g0_.js → CvNRUlp4.js} +1 -1
  95. package/web/app/immutable/chunks/{4YAlYQZK.js → CvlQZpOV.js} +1 -1
  96. package/web/app/immutable/chunks/{DdTOR-fK.js → Cx9nrScM.js} +1 -1
  97. package/web/app/immutable/chunks/{DWH0KAf0.js → CzeJNa_N.js} +1 -1
  98. package/web/app/immutable/chunks/{QuwJBwI-.js → D-USmFEk.js} +1 -1
  99. package/web/app/immutable/chunks/{CR_QOSeH.js → D-nuXMbz.js} +1 -1
  100. package/web/app/immutable/chunks/{BxiHCJA9.js → D226daYk.js} +1 -1
  101. package/web/app/immutable/chunks/{DOd666za.js → D4KaTH-V.js} +1 -1
  102. package/web/app/immutable/chunks/{B-CzqeN8.js → D6rPVTS4.js} +1 -1
  103. package/web/app/immutable/chunks/{DUwPI6pr.js → D7RRnWwO.js} +1 -1
  104. package/web/app/immutable/chunks/{C17qLLZy.js → DC4NL8YS.js} +1 -1
  105. package/web/app/immutable/chunks/{pCx1Hl6T.js → DCpi1ytG.js} +1 -1
  106. package/web/app/immutable/chunks/{CDc4alpJ.js → DD8c9eUJ.js} +1 -1
  107. package/web/app/immutable/chunks/{DLg9iehs.js → DFT4lZL_.js} +1 -1
  108. package/web/app/immutable/chunks/{DNPPDjbf.js → DG2MKLyJ.js} +1 -1
  109. package/web/app/immutable/chunks/{CbcJLLbX.js → DG9YtBZO.js} +1 -1
  110. package/web/app/immutable/chunks/{CTm1UFNm.js → DK1Nq2tK.js} +1 -1
  111. package/web/app/immutable/chunks/{NnQLq3da.js → DKDZTli0.js} +1 -1
  112. package/web/app/immutable/chunks/{D2HP95As.js → DKs113YH.js} +1 -1
  113. package/web/app/immutable/chunks/{BORhTadA.js → DNWjwuC6.js} +1 -1
  114. package/web/app/immutable/chunks/{O7VU9svd.js → DPRoG8qR.js} +1 -1
  115. package/web/app/immutable/chunks/{D7KQ-C2a.js → DQcbLXPp.js} +1 -1
  116. package/web/app/immutable/chunks/{Bc1TTOKX.js → DR8eV9N8.js} +1 -1
  117. package/web/app/immutable/chunks/{Cw7IfVO4.js → DTTAQR6U.js} +1 -1
  118. package/web/app/immutable/chunks/{C_T_V_cz.js → DUEahgsi.js} +1 -1
  119. package/web/app/immutable/chunks/{DV5DGvsr.js → DV1BB3if.js} +1 -1
  120. package/web/app/immutable/chunks/{DaXfyPpV.js → DVOiawfp.js} +1 -1
  121. package/web/app/immutable/chunks/{C2VPDjeo.js → DVbZ5oZ8.js} +1 -1
  122. package/web/app/immutable/chunks/{DNUaZj8_.js → DX09WtDr.js} +1 -1
  123. package/web/app/immutable/chunks/{LIohq1To.js → DX8x4w_C.js} +1 -1
  124. package/web/app/immutable/chunks/{DVeZQ6um.js → DZyz0CaB.js} +1 -1
  125. package/web/app/immutable/chunks/{BeUBep3b.js → Darv-bZj.js} +1 -1
  126. package/web/app/immutable/chunks/{Cou180Vm.js → DbD4A30t.js} +1 -1
  127. package/web/app/immutable/chunks/{D-YtOwPX.js → Df8Itx2l.js} +1 -1
  128. package/web/app/immutable/chunks/{BbTuJlco.js → Dfw44tJF.js} +1 -1
  129. package/web/app/immutable/chunks/{sUO-mR-D.js → DknXCwG-.js} +1 -1
  130. package/web/app/immutable/chunks/{d5zYr7fC.js → Dl6wwL68.js} +1 -1
  131. package/web/app/immutable/chunks/{CYK_6j38.js → DlcwslMx.js} +1 -1
  132. package/web/app/immutable/chunks/{Bk3MUF5Z.js → Dlfu53Jt.js} +1 -1
  133. package/web/app/immutable/chunks/{DvM0Oc_2.js → DpDR6yW3.js} +1 -1
  134. package/web/app/immutable/chunks/{C28hhXd4.js → DqNPF1Kv.js} +1 -1
  135. package/web/app/immutable/chunks/{BU_GHz5Q.js → DsEt8_PJ.js} +1 -1
  136. package/web/app/immutable/chunks/{BuUX281b.js → Dt4GGs4d.js} +1 -1
  137. package/web/app/immutable/chunks/{PnAug6me.js → Dug6137y.js} +1 -1
  138. package/web/app/immutable/chunks/{cUFAcBAC.js → DxGgdCHB.js} +1 -1
  139. package/web/app/immutable/chunks/{CAoXCf6s.js → Dynz04e1.js} +1 -1
  140. package/web/app/immutable/chunks/{8pTk55sx.js → DzbhMJUu.js} +1 -1
  141. package/web/app/immutable/chunks/{C9hosAov.js → HK2fZqOM.js} +1 -1
  142. package/web/app/immutable/chunks/{DoRZvIjE.js → IorbBySt.js} +1 -1
  143. package/web/app/immutable/chunks/{FxlwG_cR.js → IuNsAsbW.js} +1 -1
  144. package/web/app/immutable/chunks/{bOHL4iEd.js → Kr-Hl0sp.js} +1 -1
  145. package/web/app/immutable/chunks/{CobcHKt3.js → LhLTjc8B.js} +6 -6
  146. package/web/app/immutable/chunks/{Bbg7YJDS.js → LwsqbQ0C.js} +1 -1
  147. package/web/app/immutable/chunks/{C1oWz50Y.js → Q0BLEqss.js} +3 -3
  148. package/web/app/immutable/chunks/{D3Vc9t57.js → Qe1_731c.js} +1 -1
  149. package/web/app/immutable/chunks/{DKCiaCAE.js → RiB0F36z.js} +1 -1
  150. package/web/app/immutable/chunks/RmgPTyFU.js +1 -0
  151. package/web/app/immutable/chunks/{D0xGfXvZ.js → SEnfPRC9.js} +1 -1
  152. package/web/app/immutable/chunks/{CSYt80U-.js → S_AAYsIr.js} +2 -2
  153. package/web/app/immutable/chunks/{CNP_2GEv.js → SpDQ1yhe.js} +1 -1
  154. package/web/app/immutable/chunks/{KjSY_6tg.js → Wtp4gWgF.js} +1 -1
  155. package/web/app/immutable/chunks/{v6v2loc1.js → Xz2JgrtK.js} +1 -1
  156. package/web/app/immutable/chunks/{CD6znF_9.js → ZBCGBGeT.js} +1 -1
  157. package/web/app/immutable/chunks/{D2WFqoJa.js → ZsIzkx4b.js} +1 -1
  158. package/web/app/immutable/chunks/{DYlMDxfy.js → _es_q85K.js} +1 -1
  159. package/web/app/immutable/chunks/{CqiIZBSl.js → bAWH0D1a.js} +7 -7
  160. package/web/app/immutable/chunks/{DqYyUQgu.js → dpToMVNV.js} +1 -1
  161. package/web/app/immutable/chunks/{B2D_mcko.js → fciB9y8B.js} +1 -1
  162. package/web/app/immutable/chunks/{MR-g1_iF.js → ihEwdinj.js} +1 -1
  163. package/web/app/immutable/chunks/{CjK0D9QS.js → jsY6ocH0.js} +1 -1
  164. package/web/app/immutable/chunks/{_u30tumF.js → kIb2FXed.js} +1 -1
  165. package/web/app/immutable/chunks/{WD5eiIht.js → kXKukUHU.js} +1 -1
  166. package/web/app/immutable/chunks/{AZdZd6y3.js → kza5UJ4U.js} +1 -1
  167. package/web/app/immutable/chunks/{UMrFWomj.js → mMBlGZk9.js} +1 -1
  168. package/web/app/immutable/chunks/{BvWLkg--.js → n-WVnUeH.js} +1 -1
  169. package/web/app/immutable/chunks/{hBdy3DXS.js → nR6RXxA9.js} +1 -1
  170. package/web/app/immutable/chunks/{C_Xkhy7Z.js → pBEY1Dg2.js} +1 -1
  171. package/web/app/immutable/chunks/{RDBJJxOY.js → pEUfw1x0.js} +1 -1
  172. package/web/app/immutable/chunks/{Bsgnuc3k.js → prrfQq6f.js} +1 -1
  173. package/web/app/immutable/chunks/{DVa-kQtc.js → puEh5oJr.js} +4 -4
  174. package/web/app/immutable/chunks/{DRmM5gTo.js → q6-D_vn6.js} +1 -1
  175. package/web/app/immutable/chunks/{B-vv1agI.js → qshqk_Zv.js} +1 -1
  176. package/web/app/immutable/chunks/{C1r6VU8i.js → qvHk51jx.js} +2 -2
  177. package/web/app/immutable/chunks/{a4fF0apV.js → r8ylcc1d.js} +1 -1
  178. package/web/app/immutable/chunks/{R9tUAGJO.js → u8Ybsqvl.js} +1 -1
  179. package/web/app/immutable/chunks/{DMAAeEjh.js → wk8l4Vfb.js} +1 -1
  180. package/web/app/immutable/chunks/{B10IM79i.js → wz1UgZlY.js} +1 -1
  181. package/web/app/immutable/chunks/{fdlSdJMU.js → yW5sglFu.js} +1 -1
  182. package/web/app/immutable/chunks/{BEN2zFww.js → ydrF5SOC.js} +1 -1
  183. package/web/app/immutable/chunks/{jRjYIDnt.js → zgX_Rwbq.js} +1 -1
  184. package/web/app/immutable/entry/{app.DwRPZdEe.js → app.DF_Qftdw.js} +2 -2
  185. package/web/app/immutable/entry/start.DzVa4jHd.js +1 -0
  186. package/web/app/immutable/nodes/{0.Opr0LpNR.js → 0.KW34tjG8.js} +1 -1
  187. package/web/app/immutable/nodes/{1.DxR1peSG.js → 1.CHhQxwtD.js} +1 -1
  188. package/web/app/immutable/nodes/{10.BMejDu10.js → 10.CGdaTN_a.js} +1 -1
  189. package/web/app/immutable/nodes/{14.C8M6elt-.js → 14.BTTvfbc0.js} +1 -1
  190. package/web/app/immutable/nodes/{16.Buvqlzgi.js → 16.DD-jxx3d.js} +2 -2
  191. package/web/app/immutable/nodes/{2.DGI0QMTl.js → 2.CTO1JTL7.js} +3 -3
  192. package/web/app/immutable/nodes/{3.CDWebO9a.js → 3.BE75vqzp.js} +1 -1
  193. package/web/app/immutable/nodes/{4.Dxmt1auu.js → 4.BUm0nN8e.js} +1 -1
  194. package/web/app/immutable/nodes/{5.CSz7wDme.js → 5.BRXD3vaZ.js} +1 -1
  195. package/web/app/immutable/nodes/{6.C8qeE1kc.js → 6.CWxGKv_E.js} +1 -1
  196. package/web/app/immutable/nodes/{7.BicRzjRG.js → 7.DI6-BnKI.js} +1 -1
  197. package/web/app/immutable/nodes/{8.BB2n9bBQ.js → 8.5BsghwEn.js} +2 -2
  198. package/web/app/immutable/nodes/{9.B1_vasqC.js → 9.-PRJswf6.js} +1 -1
  199. package/web/app/version.json +1 -1
  200. package/web/index.html +9 -9
  201. package/web/app/immutable/chunks/C1pLdIna.js +0 -1
  202. package/web/app/immutable/entry/start.ksbZjpza.js +0 -1
@@ -1,5 +1,5 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["/app/immutable/chunks/DY2nfza0.js","/app/immutable/chunks/Bo4f3vLH.js","/app/immutable/chunks/CgPr4hs2.js","/app/immutable/chunks/B8o4lNgr.js","/app/immutable/chunks/CsstSIr0.js","/app/immutable/chunks/CpHIRYx9.js","/app/immutable/assets/spinner.D_TRo5Hy.css","/app/immutable/chunks/Ps9iRbKd.js","/app/immutable/chunks/D3ROSEe0.js","/app/immutable/chunks/D2g8BuR1.js","/app/immutable/chunks/Co_Aa6ij.js","/app/immutable/chunks/P80hEEPK.js","/app/immutable/chunks/DJuSbP_R.js","/app/immutable/chunks/DVkfuwKw.js","/app/immutable/assets/button.-yaUNjRS.css","/app/immutable/chunks/CFHzcj7N.js","/app/immutable/chunks/D32qvOGn.js","/app/immutable/chunks/BL_sVoge.js","/app/immutable/chunks/CjSUqH7t.js","/app/immutable/chunks/ChTqQfQN.js","/app/immutable/chunks/D5B1sycf.js","/app/immutable/chunks/D2AmAQEr.js","/app/immutable/chunks/B7NNbItI.js","/app/immutable/chunks/CUrlpJj4.js","/app/immutable/assets/notify.BeL_JB6L.css"])))=>i.map(i=>d[i]);
2
- var Zc=Object.defineProperty;var Xc=(e,t,n)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jt=(e,t,n)=>Xc(e,typeof t!="symbol"?t+"":t,n);import{t as vt,bq as R,a_ as ge,by as _t,br as Bi,b as wt,bo as C,bs as jt,bu as gt,bt as Qc,_ as Vo}from"./CgPr4hs2.js";import{bs as yt,aG as zi,bk as rr,c0 as $o,a7 as bt,ay as Be,W as N,bn as Et,aA as O,ai as fr,bV as xe,br as rn,ca as Je,bH as T,aD as r,bS as $,a5 as J,bA as Z,bl as Re,b_ as me,bO as fe,aj as hn,c9 as b,aB as re,cd as on,be as Zt,b$ as Kt,aw as _n,bj as gr,c6 as Ur,c3 as la,bb as Fi,c5 as An,aC as Jc,cb as Ui,bo as Ra,bz as jc,a as ed}from"./B8o4lNgr.js";import{c as Bt}from"./Co_Aa6ij.js";import{bP as Or,aA as Vn,ak as ca,ap as td,k as nd,dM as rd,dj as Zr,dJ as Co,aM as od,ba as ad,dL as da,ci as sd,ah as id,$ as ld,cA as cd,c8 as dd,c1 as ud}from"./Df2ohObb.js";import{cn as Hi,hp as Oa,G9 as ye,lr as Ki,yu as pd,sF as Gn,HF as Wn,lV as fd,HO as Wi,c as so,z9 as qi,bE as Ja,xK as ja,hm as Vi,bI as gd,xV as es,d1 as md,d2 as hd,cR as bd,aP as vd,zp as _d,ej as wd,ek as yd,ti as Ed,tf as kd,gP as xd,gQ as Cd,by as Td,h_ as Sd,z0 as Ad,z6 as Id,Ap as Gi,hW as Nd,tk as Kr,t3 as Md,fw as Go,tz as Rd,b9 as Od,tm as Yi,rj as Ld,fO as Dd,q6 as Tr,wb as Pd,Fa as $d,zc as Bd,ma as zd,G4 as Fd,H7 as Ud,CS as Hd,CT as Kd,so as ts,sn as Wd,sw as qd,sv as Vd,ss as Gd,sr as Yd,pZ as Zd,gy as Xd,i3 as Qd,hE as Jd,ai as jd,zD as ns}from"./BL_sVoge.js";import{g as eu}from"./CoSk1zgY.js";import{V as tu,S as wn,a6 as Zi,v as nu,a4 as Xi,a0 as ru,O as ou,R as au,B as Yo,W as Qi,T as su,Y as iu,U as lu,X as cu}from"./CsBmR9QJ.js";import{l as Vt,c as sn}from"./ChTqQfQN.js";import{c as Ji,l as Pn,k as Ft,f as rs,I as To,a as ji,s as Gt,h as fn}from"./CsstSIr0.js";import{b as un}from"./D2g8BuR1.js";import{I as du}from"./BmUlDo2H.js";import"./q4FIdUSc.js";import{f as Ze,ap as Jn,ax as uu,bb as ua,am as wo,aj as pu}from"./Ps9iRbKd.js";import{F as dt,bW as La,af as fu,bB as gu,cI as mu,cv as hu,aI as Da,bH as bu,aR as vu,ar as mr,cF as Bo,b5 as pa,a1 as el,a$ as tl,bX as _u,aa as wu,a4 as yu,aQ as Eu,aC as ku,bG as xu,ca as Cu,cg as Tu,cT as Su,cd as nl,bJ as Au,cH as Pa,bu as rl,c2 as Mr,at as ol,au as Iu,bb as Nu,bK as Mu,bI as Ru,b6 as al,c0 as Ou,cz as Lu,a6 as sl,cq as Du,cK as Pu,aU as $u,bU as Bu,cG as zu}from"./B7NNbItI.js";import{P as $a,K as Fu,I as Uu,w as pn,s as Hu,k as Ku,M as Wu,r as os,q as as,R as ss,n as xr,p as is,j as qu}from"./C9tAiYT0.js";import{q as Vu,g as Gu,s as Ba}from"./D3ROSEe0.js";import{T as za}from"./Df1mOKLZ.js";import{t as yn,s as Yu,H as En,C as In,x as il,r as Fa,F as Zu,g as Xu,u as ls}from"./CFHzcj7N.js";import{t as ll,S as io}from"./C5qvCE4M.js";import{E as cl,w as So}from"./BRqvd9LR.js";import{f as dl,g as Xr}from"./FvORToMl.js";import{e as dr,Q as Ao,N as cs,s as Qu}from"./DbNaInRh.js";import{A as ds,L as Ju,T as Wr,o as ju,g as Ua}from"./DywBWiWr.js";import{N as ep,X as fa,s as en,as as nn,A as tp,af as np,ad as rp,aU as Io,y as xn,x as $n,g as Nn,h as mn,al as op,am as ap,W as dn,S as Dn,aq as sp,K as ip,F as kn,O as tr,t as lp,Z as cp,a4 as dp,ah as up,a9 as No,i as or,c as pp,a8 as ga,V as fp,v as hr,U as gp,Q as br,aV as mp,p as ul,C as hp,M as bp,a1 as vp,u as _p,aj as wp,q as yp,m as Ep,n as kp,au as xp,aN as Cp,D as Tp,aO as Sp,ai as Ap,d as us,aP as ps,a6 as fs,aQ as gs,w as ms,ar as hs,aR as bs,a5 as Ip,E as Np,P as Mp}from"./7bnNetCh.js";import{r as Ha,aF as qn,aE as nr,bG as Rp,cH as Op,cL as Lp,t as Dp,V as Pp,az as $p,cK as Bp,ay as zp,aK as Fp,E as Up,q as Hp}from"./DOzFltDq.js";import{$ as qr,ay as Kp,aY as vs,i as Wp,a1 as yo,x as qp,L as Vp,a0 as Gp,A as Yp,l as Zp}from"./BDn01g3q.js";import{D as Mo}from"./P80hEEPK.js";import{D as pl,g as Xp}from"./LIohq1To.js";import{C as Qp}from"./CivlAwc7.js";import{k as Jp}from"./C94wEIre.js";import{n as lr,t as jp,w as ef}from"./Bo4f3vLH.js";import{d as tf}from"./D32qvOGn.js";import{c as fl,f as nf}from"./CBQ9Dj27.js";import{C as rf}from"./DypB-Dwi.js";import{b as of,s as _s}from"./DQXapDyu.js";import{L as ws}from"./BVxQ-eUq.js";import{g as gl,a as af}from"./BJzHxIyr.js";import{r as sf,H as lf}from"./CoZ28bOB.js";import{C as cf}from"./BFY95MZy.js";import{g as df}from"./GIAV4N10.js";import{d as Rr}from"./B0Z-1lwJ.js";import{D as ma,M as uf,c5 as pf,b as ff}from"./CobcHKt3.js";import{C as gf}from"./2Zse_zlb.js";import{i as ml,l as hl}from"./CvXnZ-8G.js";import{a4 as mf,af as hf}from"./YnEJ07_G.js";import{P as bf}from"./BuPFKHtN.js";import"./DlqxHCQ7.js";import{bl as vf}from"./CE7ZtQHh.js";import{x as Ka,K as bl}from"./rpeM9FmT.js";import{s as _f}from"./uPJwsXgL.js";import{M as ha}from"./BmiNxvpC.js";import{O as wf}from"./BG92xiA-.js";import{M as yf}from"./Bm0FPS2G.js";import{d as Ef,l as kf}from"./wSFhIxGo.js";function vl(e,t,n){const[o,s]=Vu(n?.in,e,t),a=ys(o,s),i=Math.abs(Gu(o,s));o.setDate(o.getDate()-a*i);const l=+(ys(o,s)===-a),c=a*(i-l);return c===0?0:c}function ys(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var xf=new Set(["$$slots","$$events","$$legacy","as","children"]);function cr(e,t){if(new.target)return vt({component:cr,...e});yt(t,!0);const n=R(t,"as",7,"div"),o=R(t,"children",7),s=Bi(t,xf);let a;const i=zi(ep);rr(async()=>{await $o(),a.style.whiteSpace="pre-wrap",i?.contentDOMElement&&!a.contains(i.contentDOMElement)&&a.appendChild(i.contentDOMElement)});var l={get as(){return n()},set as(u="div"){n(u),O()},get children(){return o()},set children(u){o(u),O()},$set:_t,$on:(u,f)=>wt(t,u,f)},c=bt(),d=Be(c);return dl(d,n,!1,(u,f)=>{un(u,h=>a=h,()=>a),Ji(u,()=>({"data-node-view-content":!0,...s}));var p=bt(),g=Be(p);{var m=h=>{var v=bt(),y=Be(v);Ba(y,o),N(h,v)};ge(g,h=>{o()&&h(m)})}N(f,p)}),N(e,c),Et(l)}function Cf(e){return e.map(t=>({type:t.type,path:t.filePath,content:t.selectedText||t.taskText||t.codeChunk||t.terminalContent,metadata:{lineNumber:t.lineNumber,surroundingContext:t.surroundingContext,taskPosition:t.taskPosition,taskChecked:t.taskChecked,noteId:t.noteId,...t.metadata}}))}var Tf=re('<!> <div class="launch-dialog fixed z-60 svelte-19kh9x2"><div class="flex items-end gap-1.5"><!> <!></div> <div class="launch-hint svelte-19kh9x2"> <kbd class="svelte-19kh9x2"> </kbd> <kbd class="svelte-19kh9x2"> </kbd> </div></div>',1);function _l(e,t){if(new.target)return vt({component:_l,...e});yt(t,!0);let n=R(t,"x",7,0),o=R(t,"y",7,0),s=R(t,"workspace",7),a=R(t,"noteId",7),i=R(t,"initialMessage",7,""),l=R(t,"onSubmit",7),c=R(t,"onClose",7),d=xe(rn(i())),u=xe(null);Je(()=>{T(d,i())});function f(){l()?.(new CustomEvent("submit",{detail:{userMessage:r(d).trim()}}))}function p(){c()?.()}function g(v){v.key==="Escape"?p():v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),f())}rr(()=>{setTimeout(()=>{r(u)?.focus()},0)});let m=b(()=>{const P=n()-140,_=(typeof window<"u"?window.innerWidth:1e3)-280-12;return Math.max(12,Math.min(P,_))});var h={get x(){return n()},set x(v=0){n(v),O()},get y(){return o()},set y(v=0){o(v),O()},get workspace(){return s()},set workspace(v){s(v),O()},get noteId(){return a()},set noteId(v){a(v),O()},get initialMessage(){return i()},set initialMessage(v=""){i(v),O()},get onSubmit(){return l()},set onSubmit(v){l(v),O()},get onClose(){return c()},set onClose(v){c(v),O()},$set:_t,$on:(v,y)=>wt(t,v,y)};return $a(e,{children:(v,y)=>{var P=Tf(),_=Be(P);{let se=b(()=>C.tiptap_launchDialog_close_ariaLabel());Ze(_,{variant:"ghost",class:"fixed inset-0 z-50 bg-transparent",onclick:p,get"aria-label"(){return r(se)},type:"button"})}var I=$(_,2),k=J(I),M=J(k);{let se=b(()=>C.tiptap_launchDialog_message_placeholder());za(M,{get placeholder(){return r(se)},onkeydown:g,class:"launch-textarea",rows:1,get ref(){return r(u)},set ref(ve){T(u,ve,!0)},get value(){return r(d)},set value(ve){T(d,ve,!0)}})}var V=$(M,2);{let se=b(()=>C.tiptap_launchDialog_send_ariaLabel());Ze(V,{size:"icon",iconOnly:!0,onclick:f,class:"launch-submit-btn",get"aria-label"(){return r(se)},children:(ve,D)=>{dt(ve,{get icon(){return La},size:"xs"})},$$slots:{default:!0}})}Z(k);var x=$(k,2),w=J(x),S=$(w),ae=Re(S,!0),z=$(S),A=$(z),G=Re(A,!0),oe=$(A);Z(x),Z(I),me((se,ve,D,Q,le)=>{Pn(I,`left: ${r(m)??""}px; top: ${o()??""}px;`),fe(w,`${se??""} `),fe(ae,ve),fe(z,` ${D??""} `),fe(G,Q),fe(oe,` ${le??""}`)},[()=>C.tiptap_launchDialog_hint_before(),()=>C.tiptap_launchDialog_enterKey_label(),()=>C.tiptap_launchDialog_hint_middle(),()=>C.tiptap_launchDialog_escKey_label(),()=>C.tiptap_launchDialog_hint_after()]),hn("mousedown",I,se=>se.stopPropagation()),N(v,P)},$$slots:{default:!0}}),Et(h)}fr(["mousedown"]);var Sf=re('<div class="bubble-menu-divider svelte-73kpd2"></div> <!> <!>',1),Af=re('<div class="link-input-container svelte-73kpd2"><!> <div class="link-input-actions svelte-73kpd2"><!> <!></div></div>'),If=re('<div class="bubble-menu-floating svelte-73kpd2"><div class="bubble-menu-container svelte-73kpd2"><!> <!> <!> <!> <!> <!> <!></div> <!></div>'),Nf=re("<!> <!>",1);function wl(e,t){if(new.target)return vt({component:wl,...e});yt(t,!0);const n=()=>gt(v,"$hidesAgentLifecycleActions$",o),[o,s]=jt();let a=R(t,"editor",7,null),i=R(t,"workspace",7),l=R(t,"noteId",7),c=R(t,"onAddComment",7),d=R(t,"onAgentLaunched",7),u=R(t,"onCreateSessionComment",7),f=R(t,"showNoteActions",7,!0),p=xe(!1),g=xe(rn({x:0,y:0})),m=xe(null);const h=on("");Je(()=>{h.set(i()?.id??"")});const v=Or(h),y=40,P=8;let _=xe(!1),I=xe(rn({x:0,y:0})),k=xe(""),M=xe(""),V=xe(!1),x=xe(""),w=xe(null),S=xe(null);function ae(){a()?.chain().focus().toggleBold().run()}function z(){a()?.chain().focus().toggleItalic().run()}function A(){a()?.chain().focus().toggleUnderline().run()}function G(){a()?.chain().focus().toggleStrike().run()}function oe(){a()?.chain().focus().toggleCode().run()}function se(){c()&&c()()}function ve(){if(!a())return;const{selection:K}=a().state;T(S,{from:K.from,to:K.to},!0);const{href:ce}=a().getAttributes("link");ce?T(x,ce,!0):T(x,""),T(V,!0),setTimeout(()=>{r(w)?.focus()},0)}function D(){if(!a()||!r(S))return;const K=r(x).trim();a().commands.setTextSelection(r(S)),K?a().chain().focus().setLink({href:K}).run():a().chain().focus().unsetLink().run(),T(V,!1),T(x,""),T(S,null)}function Q(){T(V,!1),T(x,""),T(S,null),a()?.commands.focus()}function le(K){K.key==="Enter"?(K.preventDefault(),D()):K.key==="Escape"&&(K.preventDefault(),Q())}function X(){if(!a())return;const{selection:K}=a().state,{from:ce,to:Me}=K,Fe=a().state.doc.textBetween(ce,Me);if(!Fe||Fe.trim().length===0){Vt.warn("[BubbleMenu] No text selected");return}T(I,{x:r(g).x,y:r(g).y+y+8},!0),T(k,Fe,!0),T(_,!0)}async function U(K){const{userMessage:ce}=K.detail;if(!i()?.id){Vt.error("[BubbleMenu] Cannot launch agent: missing workspace");return}try{const Me={type:"selection",selectedText:r(k),noteId:l()},Fe=Cf([Me]),ne=ce.trim()||C.tiptap_bubbleMenu_defaultAgentMessage();Vt.info("[BubbleMenu] Creating agent with unified creator",{workspaceId:i().id,agentType:"workspace",hasSelection:!!r(k),userMessage:ne,contextLength:Fe.length,contextContent:Fe.map(H=>({type:H.type,hasContent:!!H.content,contentLength:H.content?.length}))});const De=Hi(i().id,{name:C.tiptap_bubbleMenu_agentName(),nameExplicitlySet:!1,initialMessage:ne,agentType:Oa("workspace"),contextReferences:Fe,source:"bubble-menu",metadata:{source:"bubble-menu",agentType:"workspace",contextReferences:Fe}},{openAgent:!0}),F=await ye.dispatch(De);Vt.info("[BubbleMenu] Agent created successfully",{agentId:F.id}),T(_,!1),T(M,""),F.id&&d()&&d()(F)}catch(Me){Vt.error("[BubbleMenu] Failed to launch agent:",Me)}}function ue(){T(M,""),T(_,!1)}function q(){queueMicrotask(()=>{T(p,!1)})}Je(()=>{if(!a())return;const K=()=>{const{selection:ce}=a().state,{from:Me,to:Fe}=ce;if(Me===Fe||!a().isFocused){T(p,!1);return}T(p,!0);const ne=a().view,De=ne.coordsAtPos(Me),F=ne.coordsAtPos(Fe);let H=(De.left+F.right)/2,ie=De.top-y-P;const pe=r(m)?.offsetWidth||280,ke=12,be=pe/2+ke,L=window.innerWidth-pe/2-ke;H=Math.max(be,Math.min(L,H)),ie<ke&&(ie=F.bottom+P),T(g,{x:H,y:ie},!0)};return a().on("selectionUpdate",K),a().on("update",K),a().on("blur",q),()=>{a()&&(a().off("selectionUpdate",K),a().off("update",K),a().off("blur",q))}}),Je(()=>{if(typeof document>"u")return;const K=()=>{document.hidden&&(q(),T(_,!1))};return document.addEventListener("visibilitychange",K),()=>{document.removeEventListener("visibilitychange",K)}});var B={get editor(){return a()},set editor(K=null){a(K),O()},get workspace(){return i()},set workspace(K){i(K),O()},get noteId(){return l()},set noteId(K){l(K),O()},get onAddComment(){return c()},set onAddComment(K){c(K),O()},get onAgentLaunched(){return d()},set onAgentLaunched(K){d(K),O()},get onCreateSessionComment(){return u()},set onCreateSessionComment(K){u(K),O()},get showNoteActions(){return f()},set showNoteActions(K=!0){f(K),O()},$set:_t,$on:(K,ce)=>wt(t,K,ce)},Y=Nf(),te=Be(Y);{var Ee=K=>{$a(K,{zIndex:100,children:(ce,Me)=>{var Fe=If(),ne=J(Fe),De=J(ne);{let Oe=b(()=>C.tiptap_bubbleMenu_bold_label());Jn(De,{get label(){return r(Oe)},shortcut:"cmd+b",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_bold_label()),et=b(()=>!a().can().chain().focus().toggleBold().run()),ze=b(()=>a().isActive("bold")),Ke=b(()=>a().isActive("bold"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:ae,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return fu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var F=$(De,2);{let Oe=b(()=>C.tiptap_bubbleMenu_italic_label());Jn(F,{get label(){return r(Oe)},shortcut:"cmd+i",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_italic_label()),et=b(()=>!a().can().chain().focus().toggleItalic().run()),ze=b(()=>a().isActive("italic")),Ke=b(()=>a().isActive("italic"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:z,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return gu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var H=$(F,2);{let Oe=b(()=>C.tiptap_bubbleMenu_underline_label());Jn(H,{get label(){return r(Oe)},shortcut:"cmd+u",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_underline_label()),et=b(()=>!a().can().chain().focus().toggleUnderline().run()),ze=b(()=>a().isActive("underline")),Ke=b(()=>a().isActive("underline"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:A,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return mu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var ie=$(H,2);{let Oe=b(()=>C.tiptap_bubbleMenu_strikethrough_label());Jn(ie,{get label(){return r(Oe)},shortcut:"cmd+shift+x",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_strikethrough_label()),et=b(()=>!a().can().chain().focus().toggleStrike().run()),ze=b(()=>a().isActive("strike")),Ke=b(()=>a().isActive("strike"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:G,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return hu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var pe=$(ie,2);{let Oe=b(()=>C.tiptap_bubbleMenu_code_label());Jn(pe,{get label(){return r(Oe)},shortcut:"cmd+e",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_code_label()),et=b(()=>!a().can().chain().focus().toggleCode().run()),ze=b(()=>a().isActive("code")),Ke=b(()=>a().isActive("code"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:oe,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return Da},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var ke=$(pe,2);{let Oe=b(()=>C.tiptap_bubbleMenu_addLink_label());Jn(ke,{get label(){return r(Oe)},shortcut:"cmd+k",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_addLink_label()),et=b(()=>a().isActive("link")),ze=b(()=>a().isActive("link"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:ve,get"aria-label"(){return r(je)},get"aria-pressed"(){return r(et)},get"data-active"(){return r(ze)},children:(Ke,ee)=>{dt(Ke,{get icon(){return bu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var be=$(ke,2);{var L=Oe=>{var He=Sf(),Ge=$(Be(He),2);{let ze=b(()=>C.tiptap_bubbleMenu_addComment_label());Jn(Ge,{get label(){return r(ze)},side:"top",delayDuration:200,children:(Ke,ee)=>{{let Ae=b(()=>C.tiptap_bubbleMenu_addComment_label());Ze(Ke,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:se,get"aria-label"(){return r(Ae)},children:(Te,Ie)=>{dt(Te,{get icon(){return vu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var je=$(Ge,2);{var et=ze=>{{let Ke=b(()=>C.tiptap_bubbleMenu_sendToAgent_label());Jn(ze,{get label(){return r(Ke)},side:"top",delayDuration:200,children:(ee,Ae)=>{{let Te=b(()=>C.tiptap_bubbleMenu_sendToAgent_label());Ze(ee,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:X,get"aria-label"(){return r(Te)},children:(Ie,Ue)=>{dt(Ie,{get icon(){return La},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}};ge(je,ze=>{n()||ze(et)})}N(Oe,He)};ge(be,Oe=>{f()&&Oe(L)})}Z(ne);var Ce=$(ne,2);{var Se=Oe=>{var He=Af(),Ge=J(He);{let Ke=b(()=>C.tiptap_bubbleMenu_linkUrl_placeholder());du(Ge,{onkeydown:le,type:"text",get placeholder(){return r(Ke)},class:"link-input",get ref(){return r(w)},set ref(ee){T(w,ee,!0)},get value(){return r(x)},set value(ee){T(x,ee,!0)}})}var je=$(Ge,2),et=J(je);{let Ke=b(()=>C.tiptap_bubbleMenu_setLink_ariaLabel());Ze(et,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn small",onclick:D,get"aria-label"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return mr},size:"xs"})},$$slots:{default:!0}})}var ze=$(et,2);{let Ke=b(()=>C.tiptap_bubbleMenu_cancel_ariaLabel());Ze(ze,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn small",onclick:Q,get"aria-label"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}Z(je),Z(He),N(Oe,He)};ge(Ce,Oe=>{r(V)&&Oe(Se)})}Z(Fe),un(Fe,Oe=>T(m,Oe),()=>r(m)),me(()=>Pn(Fe,`left: ${r(g).x??""}px; top: ${r(g).y??""}px;`)),hn("mousedown",Fe,Oe=>Oe.preventDefault()),N(ce,Fe)},$$slots:{default:!0}})};ge(te,K=>{r(p)&&a()&&K(Ee)})}var we=$(te,2);{var he=K=>{_l(K,{get x(){return r(I).x},get y(){return r(I).y},get workspace(){return i()},get noteId(){return l()},get initialMessage(){return r(M)},onSubmit:U,onClose:ue})};ge(we,K=>{f()&&r(_)&&i()&&K(he)})}N(e,Y);var _e=Et(B);return s(),_e}fr(["mousedown"]);var Mf=re('<div class="flex gap-2"><!> <!></div>'),Rf=re('<div class="fixed z-[15] bg-card rounded-lg shadow-lg border border-border p-3 w-80 animate-in fade-in slide-in-from-top-2 duration-spring-moderate ease-spring-moderate motion-reduce:animate-none"><div class="mb-3"><!></div> <!></div> <!>',1);function yl(e,t){if(new.target)return vt({component:yl,...e});yt(t,!0);let n=R(t,"x",7,0),o=R(t,"y",7,0),s=R(t,"onSubmit",7),a=R(t,"onClose",7),i=xe(""),l=xe(null),c=xe("comment");function d(){r(i).trim()&&(s()?.(new CustomEvent("submit",{detail:{content:r(i).trim(),type:r(c)}})),T(i,""),T(c,"comment"))}function u(){T(i,""),T(c,"comment"),a()?.()}function f(m){m.key==="Escape"?u():m.key==="Enter"&&m.ctrlKey&&d()}function p(m){const h=()=>{m.isConnected&&document.activeElement!==m&&m.focus()};h(),queueMicrotask(h);const v=typeof requestAnimationFrame=="function"?requestAnimationFrame(h):null,y=setTimeout(h,100);return{destroy(){v!==null&&cancelAnimationFrame(v),clearTimeout(y)}}}Je(()=>r(l)?p(r(l)).destroy:void 0);var g={get x(){return n()},set x(m=0){n(m),O()},get y(){return o()},set y(m=0){o(m),O()},get onSubmit(){return s()},set onSubmit(m){s(m),O()},get onClose(){return a()},set onClose(m){a(m),O()},$set:_t,$on:(m,h)=>wt(t,m,h)};return $a(e,{children:(m,h)=>{var v=Rf(),y=Be(v),P=J(y),_=J(P);{let x=b(()=>C.tiptap_commentDialog_content_placeholder());za(_,{get placeholder(){return r(x)},onkeydown:f,class:"w-full p-2 text-xs rounded bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 placeholder-slate-400 dark:placeholder-slate-500 resize-none border-0",rows:3,get ref(){return r(l)},set ref(w){T(l,w,!0)},get value(){return r(i)},set value(w){T(i,w,!0)}})}Z(P);var I=$(P,2);{var k=x=>{var w=Mf(),S=J(w);Ze(S,{variant:"primary",onclick:d,class:"text-xs px-2 py-1",children:(z,A)=>{Zt();var G=Kt();me(oe=>fe(G,oe),[()=>C.tiptap_commentDialog_send_label()]),N(z,G)},$$slots:{default:!0}});var ae=$(S,2);Ze(ae,{variant:"ghost",onclick:u,class:"text-xs px-2 py-1 rounded text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:(z,A)=>{Zt();var G=Kt();me(oe=>fe(G,oe),[()=>C.tiptap_commentDialog_cancel_label()]),N(z,G)},$$slots:{default:!0}}),Z(w),N(x,w)},M=b(()=>r(i).trim());ge(I,x=>{r(M)&&x(k)})}Z(y);var V=$(y,2);{let x=b(()=>C.tiptap_commentDialog_close_ariaLabel());Ze(V,{variant:"ghost",class:"fixed inset-0 z-[14]",onclick:u,get"aria-label"(){return r(x)},type:"button"})}me(()=>Pn(y,`left: ${n()??""}px; top: ${o()??""}px; transform: translateX(20px);`)),N(m,v)},$$slots:{default:!0}}),Et(g)}var Of=re('<div aria-hidden="true"> </div>');function Vr(e,t){if(new.target)return vt({component:Vr,...e});yt(t,!0);let n=R(t,"name",7,""),o=R(t,"size",7,32),s=R(t,"class",7,""),a=b(()=>(n()||"?").split(/\s+/).filter(Boolean).slice(0,2).map(p=>p[0]?.toUpperCase()||"?").join(""));function i(p){let g=0;for(let m=0;m<p.length;m++)g=(g<<5)-g+p.charCodeAt(m);return Math.abs(g)}const l=["hsl(var(--agent-avatar-surface-neutral))","hsl(var(--agent-avatar-surface-neutral))","hsl(var(--agent-avatar-surface-waiting))","hsl(var(--agent-avatar-surface-active))","hsl(var(--agent-avatar-surface-attention))","hsl(var(--agent-avatar-surface-neutral))"];let c=b(()=>l[i(n())%l.length]);var d={get name(){return n()},set name(p=""){n(p),O()},get size(){return o()},set size(p=32){o(p),O()},get class(){return s()},set class(p=""){s(p),O()},$set:_t,$on:(p,g)=>wt(t,p,g)},u=Of(),f=Re(u,!0);return me(p=>{Ft(u,1,`inline-flex items-center justify-center rounded-full text-[hsl(var(--agent-avatar-foreground))] font-semibold select-none ${s()}`),Pn(u,p),fe(f,r(a))},[()=>`width:${o()}px;height:${o()}px;background:${r(c)};font-size:${Math.max(10,Math.floor(o()*.45))}px;`]),N(e,u),Et(d)}var Zo=re('<div class="icon-wrapper svelte-1igknem"><!></div>'),Lf=re("<span> </span>"),Df=re('<div class="font-medium truncate-end text-subtle text-xs italic svelte-1igknem"><!></div>'),Pf=re('<div class="font-medium text-sm truncate"> <span class="text-xs text-subtle"> </span></div>'),$f=re('<div class="flex items-center gap-1 mb-2"><!> <span class="text-ui text-subtle"> </span></div>'),Bf=re('<div class="text-xs whitespace-pre-wrap mb-2 line-clamp-3"> </div>'),zf=re('<div class="text-xs mb-2 line-clamp-3"><!></div>'),Ff=re('<div class="text-xs text-subtle"> </div>'),Uf=re('<div class="px-3 pb-2"><!> <!> <!></div>'),Hf=re('<div class="flex items-center gap-2 px-3 py-2"><!> <div class="flex-1 min-w-0"><!></div> <!></div> <!>',1),Kf=re('<div class="flex items-center gap-2"><!> <div class="flex-1"><div class="text-sm font-medium"> </div> <div class="text-xs text-subtle mt-0.5"> </div></div></div>'),Wf=re('<div class="flex items-start gap-2"><!> <div class="flex-1"><div class="text-sm font-medium text-danger"> </div> <div> </div></div></div>'),qf=re('<div class="px-3 py-2"><!></div>'),Vf=re("<div><!></div>");function El(e,t){if(new.target)return vt({component:El,...e});yt(t,!0);const n=()=>gt(m,"$agent$",a),o=()=>gt(h,"$agentIsResponding$",a),s=()=>gt(y,"$lineStats$",a),[a,i]=jt();let l=R(t,"agentId",7),c=R(t,"isCollapsed",7,!1),d=R(t,"commentCreatedAt",7),u=R(t,"displayMode",7,"full"),f=R(t,"onShow",7);const p=Xr()?.workspaceId,g=on(l());Je(()=>{g.set(l())});const m=Vn(g),h=ca(g),v=b(()=>nd(n()));Je(()=>{p&&ye.dispatch(Ki(p,l()))});const y=td(g);Je(()=>{u()==="icon"||c()||ye.dispatch(pd(l()))});const P=b(()=>r(v)?.lastResponse?rd(r(v).lastResponse,1):""),_=3e4;let I=xe(rn(Date.now()));const k=b(()=>{if(!d())return!1;const z=new Date(d()).getTime();return r(I)-z<_});Je(()=>{if(!n()&&d()){const z=new Date(d()).getTime();if(Date.now()-z<_){const G=setInterval(()=>{T(I,Date.now(),!0),r(I)-z>=_&&clearInterval(G)},1e3);return()=>clearInterval(G)}}});var M={get agentId(){return l()},set agentId(z){l(z),O()},get isCollapsed(){return c()},set isCollapsed(z=!1){c(z),O()},get commentCreatedAt(){return d()},set commentCreatedAt(z){d(z),O()},get displayMode(){return u()},set displayMode(z="full"){u(z),O()},get onShow(){return f()},set onShow(z){f(z),O()},$set:_t,$on:(z,A)=>wt(t,z,A)},V=bt(),x=Be(V);{var w=z=>{var A=bt(),G=Be(A);{var oe=D=>{{let Q=b(()=>C.tiptap_agentPeek_session_ariaLabel({name:r(v).name}));Ze(D,{variant:"ghost",class:"icon-button session-comment",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);{let q=b(()=>rs(o()&&"animate-pulse"));dr(ue,{variant:"emphasized",get agentId(){return r(v).id},get class(){return r(q)}})}Z(U),N(le,U)},$$slots:{default:!0}})}},se=D=>{{let Q=b(()=>C.tiptap_agentPeek_launching_ariaLabel());Ze(D,{variant:"ghost",class:"icon-button session-comment",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);To(ue,{size:14}),Z(U),N(le,U)},$$slots:{default:!0}})}},ve=D=>{{let Q=b(()=>C.tiptap_agentPeek_notFound_ariaLabel());Ze(D,{variant:"ghost",class:"icon-button session-comment error",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);dt(ue,{get icon(){return pa},size:"sm"}),Z(U),N(le,U)},$$slots:{default:!0}})}};ge(G,D=>{r(v)?D(oe):r(k)?D(se,1):D(ve,-1)})}N(z,A)},S=z=>{var A=Vf();let G;var oe=J(A);{var se=D=>{var Q=Hf(),le=Be(Q),X=J(le);{let we=b(()=>c()?18:void 0),he=b(()=>rs(o()&&"animate-pulse"));dr(X,{variant:"standard",get size(){return r(we)},get agentId(){return r(v).id},get class(){return r(he)}})}var U=$(X,2),ue=J(U);{var q=we=>{var he=Df(),_e=J(he);{var K=Me=>{var Fe=Lf(),ne=Re(Fe,!0);me(()=>fe(ne,r(P))),N(Me,Fe)},ce=Me=>{ds(Me,{get toolUse(){return r(v).lastToolUse},get animate(){return o()}})};ge(_e,Me=>{r(P)?Me(K):r(v).lastToolUse&&Me(ce,1)})}Z(he),N(we,he)},B=we=>{var he=Pf(),_e=J(he,!0),K=$(_e),ce=Re(K,!0);Z(he),me(Me=>{fe(_e,r(v).name),fe(ce,Me)},[()=>o()?C.tiptap_agentPeek_active_label():C.tiptap_agentPeek_idle_label()]),N(we,he)};ge(ue,we=>{c()?we(q):we(B,-1)})}Z(U);var Y=$(U,2);{let we=b(()=>C.tiptap_agentPeek_openAgent_ariaLabel());Ze(Y,{variant:"ghost",size:"icon-sm",iconOnly:!0,get"aria-label"(){return r(we)},onclick:he=>{he.stopPropagation();const K=he.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,ce=he.metaKey||he.ctrlKey,Me=p;Me&&ye.dispatch(Gn(Me,{agentId:r(v).id,sourcePanelId:K,openInAdjacentPanel:ce}))},children:(he,_e)=>{dt(he,{get icon(){return el},class:"h-3 w-3"})},$$slots:{default:!0}})}Z(le);var te=$(le,2);{var Ee=we=>{var he=Uf(),_e=J(he);{var K=F=>{var H=$f(),ie=J(H);Ju(ie,{get additions(){return s().additions},get deletions(){return s().deletions},size:"xs",showZero:!1});var pe=$(ie,2),ke=Re(pe,!0);Z(H),me(be=>fe(ke,be),[()=>C.tiptap_agentPeek_lines_label()]),N(F,H)};ge(_e,F=>{s()&&(s().additions>0||s().deletions>0)&&F(K)})}var ce=$(_e,2);{var Me=F=>{var H=Bf(),ie=Re(H,!0);me(()=>fe(ie,r(v)?.lastResponse)),N(F,H)},Fe=F=>{var H=zf(),ie=J(H);ds(ie,{get toolUse(){return r(v).lastToolUse},get animate(){return o()}}),Z(H),N(F,H)};ge(ce,F=>{r(v)?.lastResponse?F(Me):r(v)?.lastToolUse&&F(Fe,1)})}var ne=$(ce,2);{var De=F=>{var H=Ff(),ie=Re(H,!0);me(pe=>fe(ie,pe),[()=>r(v).fileChanges.length===1?C.tiptap_agentPeek_filesChanged_one():C.tiptap_agentPeek_filesChanged_many({count:yn(r(v).fileChanges.length)})]),N(F,H)};ge(ne,F=>{r(v).fileChanges&&r(v).fileChanges.length>0&&F(De)})}Z(he),N(we,he)};ge(te,we=>{c()||we(Ee)})}N(D,Q)},ve=D=>{var Q=qf(),le=J(Q);{var X=ue=>{var q=Kf(),B=J(q);To(B,{size:16,class:"text-ghost"});var Y=$(B,2),te=J(Y),Ee=Re(te,!0),we=$(te,2),he=Re(we,!0);Z(Y),Z(q),me((_e,K)=>{fe(Ee,_e),fe(he,K)},[()=>C.tiptap_agentPeek_waitingLaunch_label(),()=>C.tiptap_agentPeek_appearOnceReady_label()]),N(ue,q)},U=ue=>{var q=Wf(),B=J(q);dt(B,{get icon(){return pa},class:"h-4 w-4 mt-0.5 text-danger"});var Y=$(B,2),te=J(Y),Ee=Re(te,!0),we=$(te,2);let he;var _e=Re(we,!0);Z(Y),Z(q),me((K,ce)=>{fe(Ee,K),he=Ft(we,1,"text-xs text-subtle mt-0.5",null,he,{hidden:u()!=="full"}),fe(_e,ce)},[()=>u()==="full"?C.tiptap_agentPeek_assignedNotFound_label():C.tiptap_agentPeek_notFound_label(),()=>C.tiptap_agentPeek_mayBeDeleted_description()]),N(ue,q)};ge(le,ue=>{r(k)?ue(X):ue(U,-1)})}Z(Q),N(D,Q)};ge(oe,D=>{r(v)?D(se):D(ve,-1)})}Z(A),me(()=>G=Ft(A,1,"flex flex-col bg-background rounded w-full min-w-[180px] transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none",null,G,{"max-w-[380px]":!c(),"cursor-pointer":c(),border:!c(),"border-border":!c(),"max-w-[180px]":u()==="compact"})),N(z,A)};ge(x,z=>{u()==="icon"?z(w):z(S,-1)})}N(e,V);var ae=Et(M);return i(),ae}var Gf=re('<div class="w-px bg-border flex-1 mt-2"></div>'),Yf=re("<span> </span>"),Zf=re('<span class="comment-type-badge px-1.5 py-0.5 text-ui font-mono bg-muted/50 text-subtle svelte-dj1q6v"> </span>'),Xf=re('<div class="flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 pointer-events-none group-hover:pointer-events-auto focus-within:pointer-events-auto transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none"><!> <!> <!></div>'),Qf=re('<p class="text-xs line-clamp-2 whitespace-pre-wrap wrap-break-word"> </p>'),Jf=re('<!> <div class="flex items-center gap-2 mt-2"><!> <!></div>',1),jf=re('<div class="whitespace-pre-wrap wrap-break-word"></div>'),eg=re('<div class="line-clamp-3 whitespace-pre-wrap wrap-break-word"> </div> <!>',1),tg=re('<div class="text-xs"><!></div>'),ng=re("<div></div>"),rg=re('<div class="group flex gap-2"><div class="flex flex-col items-center"><!> <!></div> <div class="flex-1 min-w-0"><div class="flex items-start justify-between"><div><span data-comment-author=""> </span> <!> <!></div> <!></div> <!> <!></div></div>');function ba(e,t){if(new.target)return vt({component:ba,...e});yt(t,!0);function n(ee){return ee.type==="session"&&!!ee.agentId}let o=R(t,"comment",7),s=R(t,"workspace",7),a=R(t,"isCollapsed",7,!1),i=R(t,"showTimeline",7,!1),l=R(t,"isLastInThread",7,!0),c=R(t,"showActions",7,!0),d=R(t,"showResolveButton",7,!0),u=R(t,"showCloseButton",7,!1),f=R(t,"showType",7,!1),p=R(t,"onEdit",7),g=R(t,"onResolve",7),m=R(t,"onClose",7),h=R(t,"onDelete",7),v=R(t,"size",7,"default"),y=R(t,"externalIsEditing",7),P=R(t,"externalEditHTML",7),_=R(t,"externalEditEditor",15),I=R(t,"onBeginEdit",7),k=R(t,"onSaveEdit",7),M=R(t,"onCancelEdit",7);const V=Xr()?.workspaceId??void 0,x=b(()=>s()?.id??V),w=Ha();function S(ee){if(!ee)return"";const Ae=new Date(ee);return vl(new Date,Ae)>=1?il(Ae):Fa(Ae)}const ae=b(()=>y()!==void 0&&I()!==void 0);let z=xe(!1),A=xe(null),G=xe("");const oe=b(()=>r(ae)?y():r(z));async function se(){if(r(ae))I()?.(o().id);else{T(z,!0);const ee=await Promise.resolve(qn(o().content||"",{allowEmpty:!0,workspaceId:r(x),workspaceFileVersion:w}));T(G,ee||"",!0)}}async function ve(){if(r(ae))k()?.();else try{const ee=r(A)?.getHTML?.()??"",Ae=nr(ee,{preserveAnchors:!1,workspaceId:r(x)}).trim();if(!Ae)return D();qr.select(ye.state,o().id)&&ye.dispatch(Wn(o().id,{content:Ae})),T(z,!1)}catch{T(z,!1)}}function D(){r(ae)?M()?.():(T(z,!1),T(G,""))}let Q=xe(!1);const le=b(()=>`${o().id}:${(o().content||"").length}`);Je(()=>{r(le),T(Q,!1)});let X=xe(""),U=xe("");Je(()=>{let ee=!1;const Ae=o().content||"";return Promise.resolve(qn(Ae,{allowEmpty:!0,workspaceId:r(x),workspaceFileVersion:w})).then(Te=>{if(!ee){T(X,Te||"",!0);try{const Ie=document.createElement("div");Ie.innerHTML=r(X),T(U,(Ie.textContent||"").trim(),!0)}catch{T(U,Ae,!0)}}}),()=>{ee=!0}});const ue=b(()=>v()==="compact"),q=b(()=>a()||r(ue)?"text-[13px]":"text-sm"),B=b(()=>(a()||r(ue),"text-xs")),Y=b(()=>r(ue)?"text-[14px]":"text-sm"),te=b(()=>cl(o()));var Ee={get comment(){return o()},set comment(ee){o(ee),O()},get workspace(){return s()},set workspace(ee){s(ee),O()},get isCollapsed(){return a()},set isCollapsed(ee=!1){a(ee),O()},get showTimeline(){return i()},set showTimeline(ee=!1){i(ee),O()},get isLastInThread(){return l()},set isLastInThread(ee=!0){l(ee),O()},get showActions(){return c()},set showActions(ee=!0){c(ee),O()},get showResolveButton(){return d()},set showResolveButton(ee=!0){d(ee),O()},get showCloseButton(){return u()},set showCloseButton(ee=!1){u(ee),O()},get showType(){return f()},set showType(ee=!1){f(ee),O()},get onEdit(){return p()},set onEdit(ee){p(ee),O()},get onResolve(){return g()},set onResolve(ee){g(ee),O()},get onClose(){return m()},set onClose(ee){m(ee),O()},get onDelete(){return h()},set onDelete(ee){h(ee),O()},get size(){return v()},set size(ee="default"){v(ee),O()},get externalIsEditing(){return y()},set externalIsEditing(ee){y(ee),O()},get externalEditHTML(){return P()},set externalEditHTML(ee){P(ee),O()},get externalEditEditor(){return _()},set externalEditEditor(ee){_(ee),O()},get onBeginEdit(){return I()},set onBeginEdit(ee){I(ee),O()},get onSaveEdit(){return k()},set onSaveEdit(ee){k(ee),O()},get onCancelEdit(){return M()},set onCancelEdit(ee){M(ee),O()},$set:_t,$on:(ee,Ae)=>wt(t,ee,Ae)},we=rg(),he=J(we),_e=J(he);{let ee=b(()=>o().author||"?");Vr(_e,{get name(){return r(ee)},size:24,class:"shrink-0"})}var K=$(_e,2);{var ce=ee=>{var Ae=Gf();N(ee,Ae)};ge(K,ee=>{i()&&!l()&&ee(ce)})}Z(he);var Me=$(he,2),Fe=J(Me),ne=J(Fe);let De;var F=J(ne),H=Re(F,!0);ji(F,(ee,Ae)=>ll?.(ee,Ae),()=>r(te));var ie=$(F,2);{var pe=ee=>{var Ae=Yf();Ft(Ae,1,`text-subtle whitespace-nowrap ${r(B)??""}`,"svelte-dj1q6v");var Te=Re(Ae,!0);me((Ie,Ue)=>{Gt(Ae,"title",Ie),fe(Te,Ue)},[()=>Yu(o().createdAt),()=>S(o().createdAt)]),N(ee,Ae)};ge(ie,ee=>{o().createdAt&&ee(pe)})}var ke=$(ie,2);{var be=ee=>{var Ae=Zf(),Te=Re(Ae,!0);me(()=>fe(Te,o().type)),N(ee,Ae)};ge(ke,ee=>{f()&&o().type&&o().type!=="comment"&&ee(be)})}Z(ne);var L=$(ne,2);{var Ce=ee=>{var Ae=Xf(),Te=J(Ae);{var Ie=st=>{{let Xe=b(()=>C.tiptap_comment_edit_label()),E=b(()=>C.tiptap_comment_edit_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:()=>{se(),p()?.()},children:(j,Ne)=>{dt(j,{get icon(){return tl},size:"xs"})},$$slots:{default:!0}})}};ge(Te,st=>{o().status==="open"&&st(Ie)})}var Ue=$(Te,2);{var Ye=st=>{{let Xe=b(()=>C.tiptap_comment_resolve_label()),E=b(()=>C.tiptap_comment_resolve_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:()=>g()?.(),children:(j,Ne)=>{dt(j,{get icon(){return mr},size:"xs"})},$$slots:{default:!0}})}};ge(Ue,st=>{d()&&o().status==="open"&&st(Ye)})}var ot=$(Ue,2);{var ft=st=>{{let Xe=b(()=>C.tiptap_comment_collapse_label()),E=b(()=>C.tiptap_comment_collapse_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:j=>{j.stopPropagation(),m()?.()},children:(j,Ne)=>{dt(j,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}};ge(ot,st=>{u()&&m()&&st(ft)})}Z(Ae),En(3,Ae,()=>In,()=>({axis:"y",tier:"moderate"})),N(ee,Ae)};ge(L,ee=>{c()&&!a()&&ee(Ce)})}Z(Fe);var Se=$(Fe,2);{var Oe=ee=>{var Ae=Qf(),Te=Re(Ae,!0);me(()=>fe(Te,r(U))),N(ee,Ae)},He=ee=>{var Ae=Jf(),Te=Be(Ae);{var Ie=st=>{{let Xe=b(()=>P()??""),E=b(()=>C.tiptap_comment_edit_placeholder());un(fa(st,{editorClassName:"pt-2! pb-4!",get value(){return r(Xe)},get placeholder(){return r(E)},minHeight:60,maxHeight:200,get workspace(){return s()},onSubmit:()=>ve()}),j=>_(j),()=>_())}},Ue=st=>{{let Xe=b(()=>C.tiptap_comment_edit_placeholder());un(fa(st,{editorClassName:"pt-2! pb-4!",get value(){return r(G)},get placeholder(){return r(Xe)},minHeight:60,maxHeight:200,get workspace(){return s()},onSubmit:()=>ve()}),E=>T(A,E,!0),()=>r(A))}};ge(Te,st=>{r(ae)?st(Ie):st(Ue,-1)})}var Ye=$(Te,2),ot=J(Ye);Ze(ot,{size:"sm",onclick:ve,children:(st,Xe)=>{Zt();var E=Kt();me(j=>fe(E,j),[()=>C.tiptap_comment_save_label()]),N(st,E)},$$slots:{default:!0}});var ft=$(ot,2);Ze(ft,{size:"sm",variant:"ghost",onclick:D,children:(st,Xe)=>{Zt();var E=Kt();me(j=>fe(E,j),[()=>C.tiptap_comment_cancel_label()]),N(st,E)},$$slots:{default:!0}}),Z(Ye),N(ee,Ae)},Ge=ee=>{var Ae=tg(),Te=J(Ae);{var Ie=Ye=>{var ot=jf();Ao(ot,()=>r(X),!0),Z(ot),N(Ye,ot)},Ue=Ye=>{var ot=eg(),ft=Be(ot),st=Re(ft,!0),Xe=$(ft,2);Ze(Xe,{variant:"ghost",class:"block text-sm text-muted-foreground hover:text-foreground underline underline-offset-2",onclick:()=>T(Q,!0),type:"button",children:(E,j)=>{Zt();var Ne=Kt();me(nt=>fe(Ne,nt),[()=>C.tiptap_comment_more_label()]),N(E,Ne)},$$slots:{default:!0}}),me(()=>fe(st,r(U))),N(Ye,ot)};ge(Te,Ye=>{r(Q)?Ye(Ie):Ye(Ue,-1)})}Z(Ae),N(ee,Ae)},je=ee=>{var Ae=ng();let Te;Ao(Ae,()=>r(X),!0),Z(Ae),me(()=>Te=Ft(Ae,1,`comment-content ${r(Y)??""} leading-snug text-subtle whitespace-pre-wrap wrap-break-word`,"svelte-dj1q6v",Te,{"leading-relaxed":r(ue),"text-gray-700":r(ue)})),N(ee,Ae)};ge(Se,ee=>{a()?ee(Oe):r(oe)?ee(He,1):(r(U)||"").length>180?ee(Ge,2):ee(je,-1)})}var et=$(Se,2);{var ze=ee=>{Ze(ee,{variant:"ghost",onclick:Ae=>{const Ie=Ae.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,Ue=Ae.metaKey||Ae.ctrlKey,Ye=s()?.id??V;Ye&&ye.dispatch(Gn(Ye,{agentId:o().agentId,sourcePanelId:Ie,openInAdjacentPanel:Ue}))},class:"mt-2 text-xs text-blue-500 hover:text-blue-600 hover:underline",type:"button",children:(Ae,Te)=>{Zt();var Ie=Kt();me(Ue=>fe(Ie,Ue),[()=>C.tiptap_comment_viewAgent_label()]),N(Ae,Ie)},$$slots:{default:!0}})},Ke=b(()=>n(o()));ge(et,ee=>{r(Ke)&&ee(ze)})}return Z(Me),Z(we),me(()=>{De=Ft(ne,1,"flex items-baseline gap-2 min-w-0",null,De,{"mt-0.5":!a()&&!r(ue),"mt-1":a()}),Gt(F,"aria-label",r(te)),Ft(F,1,`font-medium text-foreground truncate ${r(q)??""}`,"svelte-dj1q6v"),fe(H,r(te))}),N(e,we),Et(Ee)}var og=re('<div class="ml-8"><!></div>'),ag=re('<div class="ml-8"><span class="text-xs text-warning-ink mt-1 inline-block"> </span></div>'),sg=re("<div><!></div>"),ig=re('<div class="pt-1.5 flex flex-col gap-1.5"></div>'),lg=re('<div class="px-3 py-1.5 border-t border-border"><div class="flex items-center gap-px"><!> <div class="flex-1 rounded px-1 py-1"><!></div> <!> <!> <!></div></div>'),cg=re("<div><div><!> <!> <!> <!></div> <!></div>");function kl(e,t){if(new.target)return vt({component:kl,...e});yt(t,!0);function n(q){return q.type==="session"&&!!q.agentId}let o=R(t,"comment",7),s=R(t,"replies",23,()=>[]),a=R(t,"orphaned",7,!1),i=R(t,"focused",7,!1),l=R(t,"isCollapsed",7,!1),c=R(t,"replyValue",7,""),d=R(t,"onReplyValueChange",7),u=R(t,"onReply",7),f=R(t,"onAccept",7),p=R(t,"onReject",7),g=R(t,"onResolve",7),m=R(t,"onMarkUnread",7),h=R(t,"onEdit",7),v=R(t,"onCopyLink",7),y=R(t,"onDelete",7),P=R(t,"onShow",7),_=R(t,"onClose",7),I=R(t,"registerReplyInput",7),k=R(t,"workspace",7),M=R(t,"showType",7,!0);const V=Ha();let x=xe(null),w=xe(!1);Je(()=>{r(x)&&I()&&I()(r(x))});let S=xe(null),ae=xe(null),z=xe("");async function A(q){T(S,q,!0);const B=s().find(te=>te.id===q),Y=await Promise.resolve(qn(B?.content||"",{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V}));T(z,Y||"",!0)}async function G(){const q=r(S);if(!q)return oe();try{const B=r(ae)?.getHTML?.()??"",Y=nr(B,{preserveAnchors:!1,workspaceId:k()?.id}).trim();if(!Y)return oe();qr.select(ye.state,q)&&ye.dispatch(Wn(q,{content:Y}))}finally{T(S,null),T(z,""),T(ae,null)}}function oe(){T(S,null),T(z,""),T(ae,null)}Je(()=>{let q=!1;const B=o().content||"";return Promise.resolve(qn(B,{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V})).then(Y=>{if(!q)try{const te=document.createElement("div");te.innerHTML=Y||""}catch{}}),()=>{q=!0}});let se=xe(rn({}));Je(()=>{let q=!1;return s()?.forEach(B=>{Promise.resolve(qn(B.content||"",{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V})).then(Y=>{q||(r(se)[B.id]=Y||"")})}),()=>{q=!0}});async function ve(){if(r(w))return;const q=c()?.trim();if(!q)return;const B=c(),Y=r(x)?.getHTML?.()??"",Ee=(nr(Y,{preserveAnchors:!1,workspaceId:k()?.id})||q).trim();T(w,!0);try{if((Ee?await u()?.(Ee):!1)===!1||c()!==B)return;d()?.(""),r(x)?.clear?.()}finally{T(w,!1)}}var D={get comment(){return o()},set comment(q){o(q),O()},get replies(){return s()},set replies(q=[]){s(q),O()},get orphaned(){return a()},set orphaned(q=!1){a(q),O()},get focused(){return i()},set focused(q=!1){i(q),O()},get isCollapsed(){return l()},set isCollapsed(q=!1){l(q),O()},get replyValue(){return c()},set replyValue(q=""){c(q),O()},get onReplyValueChange(){return d()},set onReplyValueChange(q){d(q),O()},get onReply(){return u()},set onReply(q){u(q),O()},get onAccept(){return f()},set onAccept(q){f(q),O()},get onReject(){return p()},set onReject(q){p(q),O()},get onResolve(){return g()},set onResolve(q){g(q),O()},get onMarkUnread(){return m()},set onMarkUnread(q){m(q),O()},get onEdit(){return h()},set onEdit(q){h(q),O()},get onCopyLink(){return v()},set onCopyLink(q){v(q),O()},get onDelete(){return y()},set onDelete(q){y(q),O()},get onShow(){return P()},set onShow(q){P(q),O()},get onClose(){return _()},set onClose(q){_(q),O()},get registerReplyInput(){return I()},set registerReplyInput(q){I(q),O()},get workspace(){return k()},set workspace(q){k(q),O()},get showType(){return M()},set showType(q=!0){M(q),O()},$set:_t,$on:(q,B)=>wt(t,q,B)},Q=bt(),le=Be(Q);{var X=q=>{El(q,{get agentId(){return o().agentId},get isCollapsed(){return l()},get commentCreatedAt(){return o().createdAt}})},U=b(()=>n(o())),ue=q=>{var B=cg();let Y;var te=J(B);let Ee;var we=J(te);{let F=b(()=>!l()&&s().length>0),H=b(()=>!!_());ba(we,{get comment(){return o()},get workspace(){return k()},get isCollapsed(){return l()},get showTimeline(){return r(F)},showActions:!0,showResolveButton:!0,get showCloseButton(){return r(H)},get showType(){return M()},get onEdit(){return h()},get onResolve(){return g()},get onClose(){return _()}})}var he=$(we,2);{var _e=F=>{var H=og(),ie=J(H);Ze(ie,{variant:"ghost",class:"text-ui text-muted-foreground hover:text-foreground mt-1",onclick:pe=>{pe.stopPropagation(),P()?.()},type:"button",children:(pe,ke)=>{Zt();var be=Kt();me(L=>fe(be,L),[()=>s().length===1?C.tiptap_commentThread_showReplies_one():C.tiptap_commentThread_showReplies_many({count:yn(s().length)})]),N(pe,be)},$$slots:{default:!0}}),Z(H),N(F,H)};ge(he,F=>{l()&&s().length>0&&F(_e)})}var K=$(he,2);{var ce=F=>{var H=ag(),ie=J(H),pe=Re(ie,!0);Z(H),me((ke,be)=>{Gt(ie,"title",ke),fe(pe,be)},[()=>C.tiptap_commentThread_unlinked_tooltip(),()=>C.tiptap_commentThread_unlinked_label()]),N(F,H)};ge(K,F=>{a()&&!l()&&F(ce)})}var Me=$(K,2);{var Fe=F=>{var H=ig();fn(H,23,s,ie=>ie.id,(ie,pe,ke)=>{var be=sg(),L=J(be);{let Ce=b(()=>r(ke)===s().length-1),Se=b(()=>r(S)===r(pe).id);ba(L,{get comment(){return r(pe)},get workspace(){return k()},showTimeline:!0,get isLastInThread(){return r(Ce)},showActions:!0,showResolveButton:!1,showCloseButton:!1,get showType(){return M()},size:"compact",get externalIsEditing(){return r(Se)},get externalEditHTML(){return r(z)},onBeginEdit:Oe=>A(Oe),onSaveEdit:G,onCancelEdit:oe,get externalEditEditor(){return r(ae)},set externalEditEditor(Oe){T(ae,Oe,!0)}})}Z(be),En(3,be,()=>In,()=>({axis:"y",tier:"moderate"})),N(ie,be)}),Z(H),En(3,H,()=>In,()=>({axis:"y",tier:"moderate"})),N(F,H)};ge(Me,F=>{!l()&&s().length>0&&F(Fe)})}Z(te);var ne=$(te,2);{var De=F=>{var H=lg(),ie=J(H),pe=J(ie);Vr(pe,{name:"User",size:24,class:"shrink-0"});var ke=$(pe,2),be=J(ke);{let Oe=b(()=>C.tiptap_commentThread_reply_placeholder());un(fa(be,{editorClassName:"pt-2! pb-4!",get value(){return c()},get placeholder(){return r(Oe)},minHeight:32,maxHeight:160,get workspace(){return k()},get inputLocked(){return r(w)},onUpdate:He=>d()?.(He),onSubmit:()=>ve()}),He=>T(x,He,!0),()=>r(x))}Z(ke);var L=$(ke,2);{let Oe=b(()=>C.tiptap_commentThread_attach_tooltip());Ze(L,{variant:"ghost-light",size:"icon-sm",get tooltip(){return r(Oe)},children:(He,Ge)=>{dt(He,{get icon(){return _u},size:"sm",class:"text-ghost"})},$$slots:{default:!0}})}var Ce=$(L,2);{let Oe=b(()=>C.tiptap_commentThread_mention_tooltip());Ze(Ce,{variant:"ghost-light",size:"icon-sm",get tooltip(){return r(Oe)},onclick:()=>r(x)?.insertAtSymbol?.(),children:(He,Ge)=>{dt(He,{get icon(){return wu},size:"sm",class:"text-ghost"})},$$slots:{default:!0}})}var Se=$(Ce,2);{let Oe=b(()=>C.tiptap_commentThread_send_tooltip());Ze(Se,{variant:"ghost-light",size:"icon-sm",class:"rounded-full bg-muted text-foreground hover:bg-muted/80",get tooltip(){return r(Oe)},get disabled(){return r(w)},onclick:()=>ve(),children:(He,Ge)=>{dt(He,{get icon(){return yu},size:"sm"})},$$slots:{default:!0}})}Z(ie),Z(H),En(3,H,()=>In,()=>({axis:"y",tier:"moderate"})),N(F,H)};ge(ne,F=>{l()||F(De)})}Z(B),me(()=>{Y=Ft(B,1,"flex flex-col bg-background rounded w-full transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none border border-border",null,Y,{"max-w-[380px]":!l(),"max-h-[400px]":!l(),"overflow-hidden":!l(),"cursor-pointer":l()}),Ee=Ft(te,1,"px-1.5 py-1.5",null,Ee,{"py-2":!l(),"pb-1":!l(),"flex-1":!l(),"overflow-y-auto":!l(),"custom-scrollbar":!l()})}),N(q,B)};ge(le,q=>{r(U)?q(X):q(ue,-1)})}return N(e,Q),Et(D)}var dg=re('<div class="connection-line svelte-19i04dt"></div>'),ug=re('<span class="reply-badge"> </span>'),pg=re('<div class="icon-wrapper"><!> <!></div>'),fg=re('<div class="hover-card-footer svelte-19i04dt"> </div>'),gg=re('<div class="hover-card svelte-19i04dt" role="group"><div class="hover-card-header svelte-19i04dt"><!> <span class="author svelte-19i04dt"> </span> <span class="timestamp svelte-19i04dt"> </span></div> <div class="hover-card-content svelte-19i04dt"><div class="hover-message-text svelte-19i04dt"> </div></div> <!></div>'),mg=re("<!> <!>",1),hg=re("<!> ",1),bg=re('<div class="full-text"> </div> <div class="compact-actions svelte-19i04dt"><!> <!></div>',1),vg=re('<div class="truncated-text svelte-19i04dt"> </div>'),_g=re('<div class="compact-replies svelte-19i04dt"><!> <span> </span></div>'),wg=re('<div role="button" tabindex="0"><div class="compact-header svelte-19i04dt"><!> <span data-comment-author="" class="compact-author svelte-19i04dt"> </span> <!></div> <div class="compact-content svelte-19i04dt"><!></div> <!></div>'),yg=re('<div class="depth-indicator svelte-19i04dt"> </div>'),Eg=re('<div role="group"><!> <!> <!></div>');function xl(e,t){if(new.target)return vt({component:xl,...e});yt(t,!0);const n=()=>gt(se,"$position",o),[o,s]=jt();let a=R(t,"comment",7),i=R(t,"replies",23,()=>[]),l=R(t,"displayMode",7,"full"),c=R(t,"orphaned",7,!1),d=R(t,"focused",7,!1),u=R(t,"isCollapsed",7,!1),f=R(t,"depth",7,0),p=R(t,"offset",7,0),g=R(t,"hasConnectionLine",7,!1),m=R(t,"replyValue",7,""),h=R(t,"onReplyValueChange",7),v=R(t,"onReply",7),y=R(t,"onAccept",7),P=R(t,"onReject",7),_=R(t,"onResolve",7),I=R(t,"onMarkUnread",7),k=R(t,"onEdit",7),M=R(t,"onCopyLink",7),V=R(t,"onDelete",7),x=R(t,"onShow",7),w=R(t,"onClose",7),S=R(t,"registerReplyInput",7),ae=R(t,"workspace",7),z,A=xe(400),G=b(()=>r(A)<200?"icon":r(A)<320?"compact":"full"),oe=b(()=>l()||r(G));Je(()=>{if(!z)return;const F=new ResizeObserver(H=>{for(const ie of H)T(A,ie.contentRect.width,!0)});return F.observe(z),()=>F.disconnect()});const se=Zu({x:p(),y:0},"slow");Je(()=>{se.set({x:p(),y:0})}),Je(()=>{d()&&(T(X,!1),clearTimeout(U))});function ve(F){if(!F)return"";const H=new Date(F);return vl(new Date,H)>=1?il(H):Fa(H)}function D(F,H=100){return F.length<=H?F:F.substring(0,H).trim()+"..."}function Q(F){switch(F){case"suggestion":return xu;case"change-request":return tl;case"question":return ku;case"issue":return pa;case"session":return La;default:return Eu}}function le(F,H){if(H==="resolved")return"type-resolved";if(H==="accepted")return"type-accepted";if(H==="rejected")return"type-rejected";switch(F){case"suggestion":return"type-suggestion";case"change-request":return"type-change-request";case"question":return"type-question";case"issue":return"type-issue";default:return"type-comment"}}let X=xe(!1),U;function ue(){r(oe)==="icon"&&!d()&&(clearTimeout(U),U=setTimeout(()=>{T(X,!0)},300))}function q(){clearTimeout(U),r(oe)==="icon"&&!d()&&(U=setTimeout(()=>{T(X,!1)},200))}const B=b(()=>cl(a()));var Y={get comment(){return a()},set comment(F){a(F),O()},get replies(){return i()},set replies(F=[]){i(F),O()},get displayMode(){return l()},set displayMode(F="full"){l(F),O()},get orphaned(){return c()},set orphaned(F=!1){c(F),O()},get focused(){return d()},set focused(F=!1){d(F),O()},get isCollapsed(){return u()},set isCollapsed(F=!1){u(F),O()},get depth(){return f()},set depth(F=0){f(F),O()},get offset(){return p()},set offset(F=0){p(F),O()},get hasConnectionLine(){return g()},set hasConnectionLine(F=!1){g(F),O()},get replyValue(){return m()},set replyValue(F=""){m(F),O()},get onReplyValueChange(){return h()},set onReplyValueChange(F){h(F),O()},get onReply(){return v()},set onReply(F){v(F),O()},get onAccept(){return y()},set onAccept(F){y(F),O()},get onReject(){return P()},set onReject(F){P(F),O()},get onResolve(){return _()},set onResolve(F){_(F),O()},get onMarkUnread(){return I()},set onMarkUnread(F){I(F),O()},get onEdit(){return k()},set onEdit(F){k(F),O()},get onCopyLink(){return M()},set onCopyLink(F){M(F),O()},get onDelete(){return V()},set onDelete(F){V(F),O()},get onShow(){return x()},set onShow(F){x(F),O()},get onClose(){return w()},set onClose(F){w(F),O()},get registerReplyInput(){return S()},set registerReplyInput(F){S(F),O()},get workspace(){return ae()},set workspace(F){ae(F),O()},$set:_t,$on:(F,H)=>wt(t,F,H)},te=Eg();let Ee;var we=J(te);{var he=F=>{var H=dg();En(3,H,()=>Xu,()=>({tier:"moderate"})),N(F,H)};ge(we,F=>{g()&&F(he)})}var _e=$(we,2);{var K=F=>{var H=mg(),ie=Be(H);{let be=b(()=>le(a().type,a().status)),L=b(()=>i().length>0?"has-replies":""),Ce=b(()=>r(B)),Se=b(()=>D(a().content||""));Ze(ie,{variant:"ghost",get class(){return`icon-button ${r(be)??""} ${r(L)??""}`},onclick:()=>x()?.(),"data-comment-author":!0,get"aria-label"(){return`${r(Ce)??""}: ${r(Se)??""}`},children:(Oe,He)=>{var Ge=pg(),je=J(Ge);{let Ke=b(()=>Q(a().type));dt(je,{get icon(){return r(Ke)},size:"sm"})}var et=$(je,2);{var ze=Ke=>{var ee=ug(),Ae=Re(ee,!0);me(()=>fe(Ae,i().length)),N(Ke,ee)};ge(et,Ke=>{i().length>0&&Ke(ze)})}Z(Ge),N(Oe,Ge)},$$slots:{default:!0}})}var pe=$(ie,2);{var ke=be=>{var L=gg(),Ce=J(L),Se=J(Ce);{let Te=b(()=>a().author||"?");Vr(Se,{get name(){return r(Te)},size:20})}var Oe=$(Se,2),He=Re(Oe,!0),Ge=$(Oe,2),je=Re(Ge,!0);Z(Ce);var et=$(Ce,2),ze=J(et),Ke=Re(ze,!0);Z(et);var ee=$(et,2);{var Ae=Te=>{var Ie=fg(),Ue=Re(Ie,!0);me(Ye=>fe(Ue,Ye),[()=>i().length===1?C.tiptap_responsiveThread_replies_one():C.tiptap_responsiveThread_replies_many({count:yn(i().length)})]),N(Te,Ie)};ge(ee,Te=>{i().length>0&&Te(Ae)})}Z(L),me((Te,Ie)=>{fe(He,r(B)),fe(je,Te),fe(Ke,Ie)},[()=>ve(a().createdAt),()=>D(a().content||"",150)]),_n("mouseenter",L,()=>clearTimeout(U)),_n("mouseleave",L,q),En(3,L,()=>In,()=>({axis:"x",tier:"moderate"})),N(be,L)};ge(pe,be=>{r(X)&&be(ke)})}N(F,H)},ce=F=>{var H=wg(),ie=J(H),pe=J(ie);{let ze=b(()=>a().author||"?");Vr(pe,{get name(){return r(ze)},size:20})}var ke=$(pe,2),be=Re(ke,!0);ji(ke,(ze,Ke)=>ll?.(ze,Ke),()=>r(B));var L=$(ke,2);{var Ce=ze=>{{let Ke=b(()=>C.tiptap_commentThread_show_ariaLabel());Ze(ze,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Ke)},onclick:ee=>{ee.stopPropagation(),x()?.()},children:(ee,Ae)=>{Fu(ee,{class:"size-3.5"})},$$slots:{default:!0}})}};ge(L,ze=>{d()||ze(Ce)})}Z(ie);var Se=$(ie,2),Oe=J(Se);{var He=ze=>{var Ke=bg(),ee=Be(Ke),Ae=Re(ee,!0),Te=$(ee,2),Ie=J(Te);Ze(Ie,{size:"xs",variant:"ghost",onclick:()=>_()?.(),children:(Ye,ot)=>{var ft=hg(),st=Be(ft);dt(st,{get icon(){return mr},size:"xs"});var Xe=$(st);me(E=>fe(Xe,` ${E??""}`),[()=>C.tiptap_responsiveThread_resolve_label()]),N(Ye,ft)},$$slots:{default:!0}});var Ue=$(Ie,2);{let Ye=b(()=>C.tiptap_responsiveThread_close_ariaLabel());Ze(Ue,{size:"icon-compact",iconOnly:!0,variant:"ghost",get"aria-label"(){return r(Ye)},onclick:()=>w()?.(),children:(ot,ft)=>{dt(ot,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}Z(Te),me(()=>fe(Ae,a().content)),N(ze,Ke)},Ge=ze=>{var Ke=vg(),ee=Re(Ke,!0);me(Ae=>fe(ee,Ae),[()=>D(a().content||"",60)]),N(ze,Ke)};ge(Oe,ze=>{d()?ze(He):ze(Ge,-1)})}Z(Se);var je=$(Se,2);{var et=ze=>{var Ke=_g(),ee=J(Ke);dt(ee,{get icon(){return Cu},size:"xs"});var Ae=$(ee,2),Te=Re(Ae,!0);Z(Ke),me(()=>fe(Te,i().length)),N(ze,Ke)};ge(je,ze=>{i().length>0&&!d()&&ze(et)})}Z(H),me(ze=>{Ft(H,1,`compact-container ${ze??""}`,"svelte-19i04dt"),Gt(ke,"aria-label",r(B)),fe(be,r(B))},[()=>le(a().type,a().status)]),hn("click",H,()=>!d()&&x()?.()),hn("keydown",H,ze=>{(ze.key==="Enter"||ze.key===" ")&&(ze.preventDefault(),!d()&&x()?.())}),N(F,H)},Me=F=>{kl(F,{get comment(){return a()},get replies(){return i()},get isCollapsed(){return u()},get orphaned(){return c()},get focused(){return d()},get replyValue(){return m()},get onReplyValueChange(){return h()},get onShow(){return x()},get onClose(){return w()},get onReply(){return v()},get onAccept(){return y()},get onReject(){return P()},get onResolve(){return _()},get onMarkUnread(){return I()},get onEdit(){return k()},get onCopyLink(){return M()},get onDelete(){return V()},get registerReplyInput(){return S()},get workspace(){return ae()}})};ge(_e,F=>{r(oe)==="icon"&&!d()?F(K):r(oe)==="compact"&&!d()?F(ce,1):F(Me,-1)})}var Fe=$(_e,2);{var ne=F=>{var H=yg(),ie=Re(H,!0);me(()=>{Pn(H,`opacity: ${.3+f()*.2}`),fe(ie,f())}),N(F,H)};ge(Fe,F=>{f()>0&&F(ne)})}Z(te),un(te,F=>z=F,()=>z),me(()=>{Ee=Ft(te,1,"comment-thread-container svelte-19i04dt",null,Ee,{"icon-mode":r(oe)==="icon","compact-mode":r(oe)==="compact","full-mode":r(oe)==="full",focused:d(),collapsed:u()&&r(oe)!=="icon"}),Pn(te,`transform: translateX(${n().x??""}px); z-index: ${10-f()};`)}),_n("mouseenter",te,ue),_n("mouseleave",te,q),N(e,te);var De=Et(Y);return s(),De}fr(["click","keydown"]);const Es=sn("CommentAnchor"),kg=en.create({name:"commentAnchor",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-anchor-id"),renderHTML:e=>e.id?{"data-anchor-id":e.id}:{}},type:{default:"point",parseHTML:e=>e.getAttribute("data-anchor-type")||"point",renderHTML:e=>({"data-anchor-type":e.type})},commentId:{default:null,parseHTML:e=>e.getAttribute("data-comment-id"),renderHTML:e=>e.commentId?{"data-comment-id":e.commentId}:{}}}},parseHTML(){return[{tag:"span[data-anchor-id]"}]},renderHTML({HTMLAttributes:e}){return["span",nn(e,{class:"comment-anchor",style:"display: none;"})]},addCommands(){return{insertCommentAnchors:e=>(({commands:t,state:n,chain:o,tr:s})=>{const{from:a,to:i}=n.selection,l=n.doc.resolve(a),c=n.doc.resolve(i);return Es.debug("Selection info:",{from:a,to:i,selectedText:n.doc.textBetween(a,i),fromParent:l.parent.type.name,toParent:c.parent.type.name}),a!==i?t.command(({tr:d,dispatch:u})=>{if(!u)return!0;const f=n.schema.nodes[this.name].create({id:`${e}:start`,type:"start",commentId:e}),p=n.schema.nodes[this.name].create({id:`${e}:end`,type:"end",commentId:e});return d.insert(i,p),d.insert(a,f),Es.debug("Inserted anchors via transaction at positions:",{from:a,to:i}),!0}):t.command(({tr:d,dispatch:u})=>{if(!u)return!0;const f=n.schema.nodes[this.name].create({id:`${e}:point`,type:"point",commentId:e});return d.insert(a,f),!0})}),removeCommentAnchors:e=>({state:t,tr:n,dispatch:o})=>{let s=!1;return t.doc.descendants((a,i)=>{if(a.type.name===this.name&&a.attrs.commentId===e){s=!0;const l=n.mapping.map(i);n.delete(l,l+a.nodeSize)}}),s&&o?(o(n),!0):!1},insertPointAnchor:e=>({commands:t,state:n})=>{const{from:o}=n.selection;return t.insertContentAt(o,{type:this.name,attrs:{id:`${e}:point`,type:"point",commentId:e}})}}},addNodeView(){return({node:e})=>{const t=document.createElement("span");return t.style.display="none",t.className="comment-anchor",e.attrs.id&&t.setAttribute("data-anchor-id",e.attrs.id),e.attrs.type&&t.setAttribute("data-anchor-type",e.attrs.type),e.attrs.commentId&&t.setAttribute("data-comment-id",e.attrs.commentId),{dom:t,contentDOM:null,ignoreMutation:()=>!0}}}});function Hr(e,t){const n={};return e.descendants((o,s)=>{if(o.type.name==="commentAnchor"&&o.attrs.commentId===t){const a=o.attrs.type;a==="start"?n.start=s:a==="end"?n.end=s:a==="point"&&(n.point=s)}}),n}function va(e){const t=new Set;return e.descendants(n=>{n.type.name==="commentAnchor"&&n.attrs.commentId&&t.add(n.attrs.commentId)}),t}var xg=re('<div role="button" tabindex="0"><div><!></div></div>'),Cg=re('<div class="comments-container svelte-8a1he9"></div>');function Cl(e,t){if(new.target)return vt({component:Cl,...e});yt(t,!0);const n=()=>gt(i,"$selectedComment$",o),[o,s]=jt(),a=sn("CommentsSidebar"),i=Kp();let l=R(t,"comments",23,()=>[]),c=R(t,"editor",7),d=R(t,"editorWrapper",7),u=R(t,"workspace",7),f=R(t,"onResolve",7),p=R(t,"onAccept",7),g=R(t,"onReject",7),m=R(t,"onReply",7),h=R(t,"onMarkUnread",7),v=R(t,"onEdit",7),y=R(t,"onCopyLink",7),P=R(t,"onDelete",7),_=xe(rn({})),I=xe(rn({})),k=xe(rn({})),M=xe(rn(new Set)),V=xe(null),x=xe(null),w=!1,S=xe("full");Je(()=>{const B=d()||c()?.view?.dom;if(B){const Y=()=>{const he=B.closest(".workspace-spec-with-comments");if(he){const K=he.getBoundingClientRect().width;K<600?T(S,"icon"):K<800?T(S,"compact"):T(S,"full");const ce=B.closest(".tiptap-editor-wrapper");ce&&ce instanceof HTMLElement&&(r(S)==="icon"?ce.style.paddingRight="80px":r(S)==="compact"?ce.style.paddingRight="160px":ce.style.paddingRight="260px"),se()}};let te=requestAnimationFrame(()=>{te=null,Y()});const Ee=new ResizeObserver(Y);Ee.observe(B);const we=B.closest(".workspace-spec-with-comments");return we&&Ee.observe(we),()=>{te!==null&&cancelAnimationFrame(te),Ee.disconnect();const he=B.closest(".tiptap-editor-wrapper");he&&he instanceof HTMLElement&&(he.style.paddingRight="")}}}),Je(()=>{l().forEach(B=>{B.id in r(_)||(r(_)[B.id]="")}),l().length>0&&ve()});let ae=xe(!0),z=null;const A=b(()=>{const B=new Set,Y=[];for(const te of l())te.status!=="resolved"&&!te.parentId&&te.id&&!B.has(te.id)&&(B.add(te.id),Y.push(te));return Y});function G(B){return l().filter(Y=>Y.parentId===B)}let oe=xe(null);Je(()=>{a.debug("[CommentsSidebar] Comments received",{totalComments:l().length,activeComments:r(A).length})});function se(){if(!r(A).length)return;const B=[...r(A)].sort((he,_e)=>{const K=r(k)[he.id]||0,ce=r(k)[_e.id]||0;return K-ce});let Y=0;const te=10,Ee=47,we=47;B.forEach(he=>{const _e=r(k)[he.id]||100,ce=r(x)===he.id?we:Ee,Me=Y+te,Fe=Math.max(_e,Me+ce/2);r(k)[he.id]=Fe,Y=Fe+ce/2})}function ve(){!c()||!c().view||(z&&clearTimeout(z),z=setTimeout(()=>{c()&&c().view&&D()},r(ae)?300:50))}function D(){if(!c()||!c().view){const _e={};r(A).forEach((K,ce)=>{_e[K.id]=100+ce*150}),T(k,_e,!0),T(M,new Set(r(A).map(K=>K.id)),!0);return}let B;try{B=c().view.dom}catch(_e){a.debug("[CommentsSidebar] Editor view not available",{error:_e});const K={};r(A).forEach((ce,Me)=>{K[ce.id]=100+Me*150}),T(k,K,!0),T(M,new Set(r(A).map(ce=>ce.id)),!0);return}if(!B){const _e={};r(A).forEach((K,ce)=>{_e[K.id]=100+ce*150}),T(k,_e,!0),T(M,new Set(r(A).map(K=>K.id)),!0);return}const Y={},te=new Set,Ee=B.closest("#editor-content"),we=B.getBoundingClientRect(),he=Ee?.getBoundingClientRect()||we;r(A).forEach(_e=>{const{doc:K}=c().state;let ce=!1;const Me=Hr(K,_e.id),Fe=Me.start!==void 0?Me.start+1:Me.point!==void 0?Me.point+1:void 0;if(Fe!==void 0)try{if(!c().view)throw new Error("Editor view not available");const ne=c().view.coordsAtPos(Fe),De=Ee?.scrollTop||0,F=ne.top,H=he.top,ie=F-H+De;Y[_e.id]=ie,ce=!0}catch(ne){a.error("[CommentsSidebar] Position calculation failed",{commentId:_e.id,error:ne})}if(!ce){te.add(_e.id);const ne=r(A).indexOf(_e);Y[_e.id]=100+ne*150}}),T(M,te,!0),T(k,Y,!0),se()}Je(()=>{if(!c())return;const B=()=>{ve()};return ve(),c().on("update",B),c().on("selectionUpdate",B),()=>{c().off("update",B),c().off("selectionUpdate",B)}}),Je(()=>{if(!c()||!c().view)return;let B;try{B=c().view.dom}catch(we){a.debug("[CommentsSidebar] Editor view not available for scroll listener",{error:we});return}if(!B)return;const Y=B.closest(".overflow-y-auto");if(!Y)return;const te=()=>{ve()},Ee=()=>{requestAnimationFrame(te)};return Y.addEventListener("scroll",Ee),window.addEventListener("resize",Ee),()=>{Y.removeEventListener("scroll",Ee),window.removeEventListener("resize",Ee)}}),Je(()=>(document.addEventListener("click",X),()=>{document.removeEventListener("click",X)})),Je(()=>{if(r(A).length>0){const B=r(A)[r(A).length-1];B.id!==r(oe)&&T(oe,B.id,!0)}}),Je(()=>{if(r(ae)&&c()){const B=setTimeout(()=>{T(ae,!1),a.debug("[CommentsSidebar] Initial load complete")},1500);return()=>clearTimeout(B)}}),Je(()=>{const B=n()?.id??null;l().some(Y=>Y.id===B)&&B&&B!==r(V)&&(a.debug("[CommentsSidebar] Store selected comment changed",{selected:B,previous:r(V)}),T(V,B,!0),T(x,B,!0),se(),setTimeout(()=>{const Y=document.querySelector(`[data-comment-id="${B}"]`);Y?(Y.scrollIntoView({behavior:"smooth",block:"center"}),a.debug("[CommentsSidebar] Scrolled comment into view",{selected:B})):a.warn("[CommentsSidebar] Could not find element to scroll",{selected:B})},100))});function Q(B){r(x)!==B&&(T(x,B,!0),w=!0,B in r(_)||(r(_)[B]=""),setTimeout(()=>{const Y=document.querySelector(`[data-comment-id="${B}"]`),te=document.querySelector("#editor-content");if(Y&&te){const Ee=Y.getBoundingClientRect(),we=te.getBoundingClientRect();if(Ee.top<we.top+10){const he=we.top-Ee.top+20;te.scrollTop=Math.max(0,te.scrollTop-he)}else if(Ee.bottom>we.bottom-10){const he=Ee.bottom-we.bottom+20;te.scrollTop=te.scrollTop+he}}se()},50),setTimeout(()=>{w=!1},100)),a.debug("[CommentsSidebar] Focus comment",{commentId:B,focused:r(x)===B})}function le(){r(x)&&(a.debug("[CommentsSidebar] Unfocusing comment",{commentId:r(x)}),T(x,null),se())}function X(B){if(w)return;const Y=B.target,te=Y.closest("[data-comment-id]"),Ee=Y.closest(".portal-container");!te&&!Ee&&r(x)&&le()}Je(()=>{if(r(x))return Uu(()=>le())}),Je(()=>{Object.entries(r(I)).forEach(([B,Y])=>{r(x)===B&&Y&&setTimeout(()=>Y.focus(),0)})});var U={get comments(){return l()},set comments(B=[]){l(B),O()},get editor(){return c()},set editor(B){c(B),O()},get editorWrapper(){return d()},set editorWrapper(B){d(B),O()},get workspace(){return u()},set workspace(B){u(B),O()},get onResolve(){return f()},set onResolve(B){f(B),O()},get onAccept(){return p()},set onAccept(B){p(B),O()},get onReject(){return g()},set onReject(B){g(B),O()},get onReply(){return m()},set onReply(B){m(B),O()},get onMarkUnread(){return h()},set onMarkUnread(B){h(B),O()},get onEdit(){return v()},set onEdit(B){v(B),O()},get onCopyLink(){return y()},set onCopyLink(B){y(B),O()},get onDelete(){return P()},set onDelete(B){P(B),O()},$set:_t,$on:(B,Y)=>wt(t,B,Y)},ue=Cg();fn(ue,21,()=>r(A),B=>B.id,(B,Y)=>{var te=bt(),Ee=Be(te);{var we=he=>{const _e=b(()=>G(r(Y).id)),K=b(()=>r(k)[r(Y).id]),ce=b(()=>r(x)===r(Y).id),Me=b(()=>r(ce)?-50:0),Fe=b(()=>r(ce)?Math.max(10,r(K)-20):r(K)-20);var ne=xg();let De;var F=J(ne),H=J(F);{let ie=b(()=>r(x)!==r(Y).id),pe=b(()=>r(M).has(r(Y).id)),ke=b(()=>r(x)===r(Y).id),be=b(()=>r(_)[r(Y).id]||"");xl(H,{get comment(){return r(Y)},get replies(){return r(_e)},get displayMode(){return r(S)},get isCollapsed(){return r(ie)},get orphaned(){return r(pe)},get focused(){return r(ke)},depth:0,offset:0,hasConnectionLine:!1,get replyValue(){return r(be)},onReplyValueChange:L=>{r(_)[r(Y).id]=L},onShow:()=>Q(r(Y).id),onClose:()=>T(x,null),onReply:L=>m()?.(r(Y).id,L),onAccept:()=>p()?.(r(Y).id),onReject:()=>g()?.(r(Y).id),onResolve:()=>f()?.(r(Y).id),onMarkUnread:()=>h()?.(r(Y).id),onEdit:()=>v()?.(r(Y).id),onCopyLink:()=>y()?.(r(Y).id),onDelete:()=>P()?.(r(Y).id),registerReplyInput:L=>r(I)[r(Y).id]=L,get workspace(){return u()}})}Z(F),Z(ne),me(()=>{De=Ft(ne,1,"absolute pointer-events-auto outline-none focus:outline-none bg-background comment-thread-container svelte-8a1he9",null,De,{"w-auto":r(S)==="icon"||r(S)==="compact","w-64":r(S)==="compact","w-68":r(S)==="full","is-focused":r(ce)}),Pn(ne,`--comment-focus-inset: ${-r(Me)}px; top: ${r(Fe)??""}px; right: ${-r(Me)}px; z-index: ${r(ce)?20:10}; transition: right var(--motion-slow) var(--spring-slow-ease), top var(--motion-slow) var(--spring-slow-ease);`),Gt(ne,"data-comment-id",r(Y).id)}),hn("keydown",ne,ie=>{ie.target===ie.currentTarget&&(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),Q(r(Y).id))}),hn("click",ne,ie=>{ie.stopPropagation(),r(x)!==r(Y).id&&Q(r(Y).id)}),En(3,F,()=>In,()=>({axis:"y",tier:"moderate"})),N(he,ne)};ge(Ee,he=>{r(k)[r(Y).id]!==void 0&&he(we)})}N(B,te)}),Z(ue),N(e,ue);var q=Et(U);return s(),q}fr(["keydown","click"]);var Tg=re('<span class="text-ui font-mono font-medium"> </span>'),Sg=re('<div class="px-2.5 py-1.5 text-ui text-subtle"> </div>'),Ag=re('<div class="px-2.5 py-1.5 text-ui text-danger"> </div>'),Ig=re('<span></span> <span class="text-ui font-mono font-medium"> </span> <span class="text-ui text-subtle ml-auto"> </span>',1),Ng=re('<span>·</span> <span class="truncate"> </span>',1),Mg=re("<!> ",1),Rg=re('<div class="flex items-center justify-between gap-2 px-3 py-1.5 border-b border-border shrink-0"><div class="flex items-center gap-1.5 text-ui text-subtle min-w-0"><span class="font-medium text-foreground"> </span> <span>·</span> <span> </span> <!></div> <!></div>'),Og=re('<div class="flex h-full overflow-hidden"><div class="version-list svelte-ha3bfa"><!> <!></div> <div class="flex flex-col flex-1 min-w-0"><!> <div class="flex-1 overflow-auto"><!></div></div></div>');function Wa(e,t){if(new.target)return vt({component:Wa,...e});yt(t,!0);const n=()=>gt(f,"$noteVersionsState",o),[o,s]=jt();let a=R(t,"workspace",7),i=R(t,"noteId",7),l=R(t,"currentContent",7),c=R(t,"visible",7,!0),d=R(t,"onRestore",7);const u=on(a().id);Je(()=>{u.set(a().id),T(h,null)});const f=tu(u),p=b(()=>n()?.versions?[...n().versions].reverse().slice(0,10):[]),g=b(()=>n()?.loading??!1),m=b(()=>n()?.error??null);let h=xe(null);Je(()=>{c()&&a()?.id&&i()&&ye.dispatch(fd(a().id,i()))});const v=b(()=>r(h)===null?l():r(p)[r(h)]?.content||""),y=b(()=>{if(r(h)===null)return r(p)[0]?.content||"";const X=r(h)+1;return X<r(p).length?r(p)[X].content:""}),P=b(()=>r(v));function _(X){return Fa(X)||C.workspace_noteVersionHistory_unknown_label()}function I(X){return X?X.replace(/\n*$/,`
2
+ var Zc=Object.defineProperty;var Xc=(e,t,n)=>t in e?Zc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Jt=(e,t,n)=>Xc(e,typeof t!="symbol"?t+"":t,n);import{t as vt,bq as R,a_ as ge,by as _t,br as Bi,b as wt,bo as C,bs as jt,bu as gt,bt as Qc,_ as Vo}from"./CgPr4hs2.js";import{bs as yt,aG as zi,bk as rr,c0 as $o,a7 as bt,ay as Be,W as N,bn as Et,aA as O,ai as fr,bV as xe,br as rn,ca as Je,bH as T,aD as r,bS as $,a5 as J,bA as Z,bl as Re,b_ as me,bO as fe,aj as hn,c9 as b,aB as re,cd as on,be as Zt,b$ as Kt,aw as _n,bj as gr,c6 as Ur,c3 as la,bb as Fi,c5 as An,aC as Jc,cb as Ui,bo as Ra,bz as jc,a as ed}from"./B8o4lNgr.js";import{c as Bt}from"./Co_Aa6ij.js";import{bP as Or,aA as Vn,ak as ca,ap as td,k as nd,dM as rd,dj as Zr,dJ as Co,aM as od,ba as ad,dL as da,ci as sd,ah as id,$ as ld,cA as cd,c8 as dd,c1 as ud}from"./Df2ohObb.js";import{cn as Hi,hp as Oa,G9 as ye,lr as Ki,yu as pd,sF as Gn,HF as Wn,lV as fd,HO as Wi,c as so,z9 as qi,bE as Ja,xK as ja,hm as Vi,bI as gd,xV as es,d1 as md,d2 as hd,cR as bd,aP as vd,zp as _d,ej as wd,ek as yd,ti as Ed,tf as kd,gP as xd,gQ as Cd,by as Td,h_ as Sd,z0 as Ad,z6 as Id,Ap as Gi,hW as Nd,tk as Kr,t3 as Md,fw as Go,tz as Rd,b9 as Od,tm as Yi,rj as Ld,fO as Dd,q6 as Tr,wb as Pd,Fa as $d,zc as Bd,ma as zd,G4 as Fd,H7 as Ud,CS as Hd,CT as Kd,so as ts,sn as Wd,sw as qd,sv as Vd,ss as Gd,sr as Yd,pZ as Zd,gy as Xd,i3 as Qd,hE as Jd,ai as jd,zD as ns}from"./BL_sVoge.js";import{g as eu}from"./CoSk1zgY.js";import{V as tu,S as wn,a6 as Zi,v as nu,a4 as Xi,a0 as ru,O as ou,R as au,B as Yo,W as Qi,T as su,Y as iu,U as lu,X as cu}from"./C-BS-coA.js";import{l as Vt,c as sn}from"./ChTqQfQN.js";import{c as Ji,l as Pn,k as Ft,f as rs,I as To,a as ji,s as Gt,h as fn}from"./CsstSIr0.js";import{b as un}from"./D2g8BuR1.js";import{I as du}from"./BmUlDo2H.js";import"./q4FIdUSc.js";import{f as Ze,ap as Jn,ax as uu,bb as ua,am as wo,aj as pu}from"./Ps9iRbKd.js";import{F as dt,bW as La,af as fu,bB as gu,cI as mu,cv as hu,aI as Da,bH as bu,aR as vu,ar as mr,cF as Bo,b5 as pa,a1 as el,a$ as tl,bX as _u,aa as wu,a4 as yu,aQ as Eu,aC as ku,bG as xu,ca as Cu,cg as Tu,cT as Su,cd as nl,bJ as Au,cH as Pa,bu as rl,c2 as Mr,at as ol,au as Iu,bb as Nu,bK as Mu,bI as Ru,b6 as al,c0 as Ou,cz as Lu,a6 as sl,cq as Du,cK as Pu,aU as $u,bU as Bu,cG as zu}from"./B7NNbItI.js";import{P as $a,K as Fu,I as Uu,w as pn,s as Hu,k as Ku,M as Wu,r as os,q as as,R as ss,n as xr,p as is,j as qu}from"./C9tAiYT0.js";import{q as Vu,g as Gu,s as Ba}from"./D3ROSEe0.js";import{T as za}from"./Df1mOKLZ.js";import{t as yn,s as Yu,H as En,C as In,x as il,r as Fa,F as Zu,g as Xu,u as ls}from"./CFHzcj7N.js";import{t as ll,S as io}from"./C5qvCE4M.js";import{E as cl,w as So}from"./BRqvd9LR.js";import{f as dl,g as Xr}from"./FvORToMl.js";import{e as dr,Q as Ao,N as cs,s as Qu}from"./CfV9aH5z.js";import{A as ds,L as Ju,T as Wr,o as ju,g as Ua}from"./BmwLKx4A.js";import{N as ep,X as fa,s as en,as as nn,A as tp,af as np,ad as rp,aU as Io,y as xn,x as $n,g as Nn,h as mn,al as op,am as ap,W as dn,S as Dn,aq as sp,K as ip,F as kn,O as tr,t as lp,Z as cp,a4 as dp,ah as up,a9 as No,i as or,c as pp,a8 as ga,V as fp,v as hr,U as gp,Q as br,aV as mp,p as ul,C as hp,M as bp,a1 as vp,u as _p,aj as wp,q as yp,m as Ep,n as kp,au as xp,aN as Cp,D as Tp,aO as Sp,ai as Ap,d as us,aP as ps,a6 as fs,aQ as gs,w as ms,ar as hs,aR as bs,a5 as Ip,E as Np,P as Mp}from"./4cIwmSuD.js";import{r as Ha,aF as qn,aE as nr,bG as Rp,cH as Op,cL as Lp,t as Dp,V as Pp,az as $p,cK as Bp,ay as zp,aK as Fp,E as Up,q as Hp}from"./86pQg5ba.js";import{$ as qr,ay as Kp,aY as vs,i as Wp,a1 as yo,x as qp,L as Vp,a0 as Gp,A as Yp,l as Zp}from"./BPomlxD-.js";import{D as Mo}from"./P80hEEPK.js";import{D as pl,g as Xp}from"./DX8x4w_C.js";import{C as Qp}from"./CivlAwc7.js";import{k as Jp}from"./C94wEIre.js";import{n as lr,t as jp,w as ef}from"./Bo4f3vLH.js";import{d as tf}from"./D32qvOGn.js";import{c as fl,f as nf}from"./C9AcsTi0.js";import{C as rf}from"./DypB-Dwi.js";import{b as of,s as _s}from"./DQXapDyu.js";import{L as ws}from"./BVxQ-eUq.js";import{g as gl,a as af}from"./BJzHxIyr.js";import{r as sf,H as lf}from"./CoZ28bOB.js";import{C as cf}from"./BFY95MZy.js";import{g as df}from"./GIAV4N10.js";import{d as Rr}from"./B0Z-1lwJ.js";import{D as ma,M as uf,c5 as pf,b as ff}from"./LhLTjc8B.js";import{C as gf}from"./BjJW_Stw.js";import{i as ml,l as hl}from"./CvXnZ-8G.js";import{a4 as mf,af as hf}from"./Cro1ceUg.js";import{P as bf}from"./2zyiBICC.js";import"./DlqxHCQ7.js";import{bl as vf}from"./CE7ZtQHh.js";import{x as Ka,K as bl}from"./rpeM9FmT.js";import{s as _f}from"./uPJwsXgL.js";import{M as ha}from"./BmiNxvpC.js";import{O as wf}from"./ClHM0gRH.js";import{M as yf}from"./BZrGNaMY.js";import{d as Ef,l as kf}from"./wSFhIxGo.js";function vl(e,t,n){const[o,s]=Vu(n?.in,e,t),a=ys(o,s),i=Math.abs(Gu(o,s));o.setDate(o.getDate()-a*i);const l=+(ys(o,s)===-a),c=a*(i-l);return c===0?0:c}function ys(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}var xf=new Set(["$$slots","$$events","$$legacy","as","children"]);function cr(e,t){if(new.target)return vt({component:cr,...e});yt(t,!0);const n=R(t,"as",7,"div"),o=R(t,"children",7),s=Bi(t,xf);let a;const i=zi(ep);rr(async()=>{await $o(),a.style.whiteSpace="pre-wrap",i?.contentDOMElement&&!a.contains(i.contentDOMElement)&&a.appendChild(i.contentDOMElement)});var l={get as(){return n()},set as(u="div"){n(u),O()},get children(){return o()},set children(u){o(u),O()},$set:_t,$on:(u,f)=>wt(t,u,f)},c=bt(),d=Be(c);return dl(d,n,!1,(u,f)=>{un(u,h=>a=h,()=>a),Ji(u,()=>({"data-node-view-content":!0,...s}));var p=bt(),g=Be(p);{var m=h=>{var v=bt(),y=Be(v);Ba(y,o),N(h,v)};ge(g,h=>{o()&&h(m)})}N(f,p)}),N(e,c),Et(l)}function Cf(e){return e.map(t=>({type:t.type,path:t.filePath,content:t.selectedText||t.taskText||t.codeChunk||t.terminalContent,metadata:{lineNumber:t.lineNumber,surroundingContext:t.surroundingContext,taskPosition:t.taskPosition,taskChecked:t.taskChecked,noteId:t.noteId,...t.metadata}}))}var Tf=re('<!> <div class="launch-dialog fixed z-60 svelte-19kh9x2"><div class="flex items-end gap-1.5"><!> <!></div> <div class="launch-hint svelte-19kh9x2"> <kbd class="svelte-19kh9x2"> </kbd> <kbd class="svelte-19kh9x2"> </kbd> </div></div>',1);function _l(e,t){if(new.target)return vt({component:_l,...e});yt(t,!0);let n=R(t,"x",7,0),o=R(t,"y",7,0),s=R(t,"workspace",7),a=R(t,"noteId",7),i=R(t,"initialMessage",7,""),l=R(t,"onSubmit",7),c=R(t,"onClose",7),d=xe(rn(i())),u=xe(null);Je(()=>{T(d,i())});function f(){l()?.(new CustomEvent("submit",{detail:{userMessage:r(d).trim()}}))}function p(){c()?.()}function g(v){v.key==="Escape"?p():v.key==="Enter"&&!v.shiftKey&&(v.preventDefault(),f())}rr(()=>{setTimeout(()=>{r(u)?.focus()},0)});let m=b(()=>{const P=n()-140,_=(typeof window<"u"?window.innerWidth:1e3)-280-12;return Math.max(12,Math.min(P,_))});var h={get x(){return n()},set x(v=0){n(v),O()},get y(){return o()},set y(v=0){o(v),O()},get workspace(){return s()},set workspace(v){s(v),O()},get noteId(){return a()},set noteId(v){a(v),O()},get initialMessage(){return i()},set initialMessage(v=""){i(v),O()},get onSubmit(){return l()},set onSubmit(v){l(v),O()},get onClose(){return c()},set onClose(v){c(v),O()},$set:_t,$on:(v,y)=>wt(t,v,y)};return $a(e,{children:(v,y)=>{var P=Tf(),_=Be(P);{let se=b(()=>C.tiptap_launchDialog_close_ariaLabel());Ze(_,{variant:"ghost",class:"fixed inset-0 z-50 bg-transparent",onclick:p,get"aria-label"(){return r(se)},type:"button"})}var I=$(_,2),k=J(I),M=J(k);{let se=b(()=>C.tiptap_launchDialog_message_placeholder());za(M,{get placeholder(){return r(se)},onkeydown:g,class:"launch-textarea",rows:1,get ref(){return r(u)},set ref(ve){T(u,ve,!0)},get value(){return r(d)},set value(ve){T(d,ve,!0)}})}var V=$(M,2);{let se=b(()=>C.tiptap_launchDialog_send_ariaLabel());Ze(V,{size:"icon",iconOnly:!0,onclick:f,class:"launch-submit-btn",get"aria-label"(){return r(se)},children:(ve,D)=>{dt(ve,{get icon(){return La},size:"xs"})},$$slots:{default:!0}})}Z(k);var x=$(k,2),w=J(x),S=$(w),ae=Re(S,!0),z=$(S),A=$(z),G=Re(A,!0),oe=$(A);Z(x),Z(I),me((se,ve,D,Q,le)=>{Pn(I,`left: ${r(m)??""}px; top: ${o()??""}px;`),fe(w,`${se??""} `),fe(ae,ve),fe(z,` ${D??""} `),fe(G,Q),fe(oe,` ${le??""}`)},[()=>C.tiptap_launchDialog_hint_before(),()=>C.tiptap_launchDialog_enterKey_label(),()=>C.tiptap_launchDialog_hint_middle(),()=>C.tiptap_launchDialog_escKey_label(),()=>C.tiptap_launchDialog_hint_after()]),hn("mousedown",I,se=>se.stopPropagation()),N(v,P)},$$slots:{default:!0}}),Et(h)}fr(["mousedown"]);var Sf=re('<div class="bubble-menu-divider svelte-73kpd2"></div> <!> <!>',1),Af=re('<div class="link-input-container svelte-73kpd2"><!> <div class="link-input-actions svelte-73kpd2"><!> <!></div></div>'),If=re('<div class="bubble-menu-floating svelte-73kpd2"><div class="bubble-menu-container svelte-73kpd2"><!> <!> <!> <!> <!> <!> <!></div> <!></div>'),Nf=re("<!> <!>",1);function wl(e,t){if(new.target)return vt({component:wl,...e});yt(t,!0);const n=()=>gt(v,"$hidesAgentLifecycleActions$",o),[o,s]=jt();let a=R(t,"editor",7,null),i=R(t,"workspace",7),l=R(t,"noteId",7),c=R(t,"onAddComment",7),d=R(t,"onAgentLaunched",7),u=R(t,"onCreateSessionComment",7),f=R(t,"showNoteActions",7,!0),p=xe(!1),g=xe(rn({x:0,y:0})),m=xe(null);const h=on("");Je(()=>{h.set(i()?.id??"")});const v=Or(h),y=40,P=8;let _=xe(!1),I=xe(rn({x:0,y:0})),k=xe(""),M=xe(""),V=xe(!1),x=xe(""),w=xe(null),S=xe(null);function ae(){a()?.chain().focus().toggleBold().run()}function z(){a()?.chain().focus().toggleItalic().run()}function A(){a()?.chain().focus().toggleUnderline().run()}function G(){a()?.chain().focus().toggleStrike().run()}function oe(){a()?.chain().focus().toggleCode().run()}function se(){c()&&c()()}function ve(){if(!a())return;const{selection:K}=a().state;T(S,{from:K.from,to:K.to},!0);const{href:ce}=a().getAttributes("link");ce?T(x,ce,!0):T(x,""),T(V,!0),setTimeout(()=>{r(w)?.focus()},0)}function D(){if(!a()||!r(S))return;const K=r(x).trim();a().commands.setTextSelection(r(S)),K?a().chain().focus().setLink({href:K}).run():a().chain().focus().unsetLink().run(),T(V,!1),T(x,""),T(S,null)}function Q(){T(V,!1),T(x,""),T(S,null),a()?.commands.focus()}function le(K){K.key==="Enter"?(K.preventDefault(),D()):K.key==="Escape"&&(K.preventDefault(),Q())}function X(){if(!a())return;const{selection:K}=a().state,{from:ce,to:Me}=K,Fe=a().state.doc.textBetween(ce,Me);if(!Fe||Fe.trim().length===0){Vt.warn("[BubbleMenu] No text selected");return}T(I,{x:r(g).x,y:r(g).y+y+8},!0),T(k,Fe,!0),T(_,!0)}async function U(K){const{userMessage:ce}=K.detail;if(!i()?.id){Vt.error("[BubbleMenu] Cannot launch agent: missing workspace");return}try{const Me={type:"selection",selectedText:r(k),noteId:l()},Fe=Cf([Me]),ne=ce.trim()||C.tiptap_bubbleMenu_defaultAgentMessage();Vt.info("[BubbleMenu] Creating agent with unified creator",{workspaceId:i().id,agentType:"workspace",hasSelection:!!r(k),userMessage:ne,contextLength:Fe.length,contextContent:Fe.map(H=>({type:H.type,hasContent:!!H.content,contentLength:H.content?.length}))});const De=Hi(i().id,{name:C.tiptap_bubbleMenu_agentName(),nameExplicitlySet:!1,initialMessage:ne,agentType:Oa("workspace"),contextReferences:Fe,source:"bubble-menu",metadata:{source:"bubble-menu",agentType:"workspace",contextReferences:Fe}},{openAgent:!0}),F=await ye.dispatch(De);Vt.info("[BubbleMenu] Agent created successfully",{agentId:F.id}),T(_,!1),T(M,""),F.id&&d()&&d()(F)}catch(Me){Vt.error("[BubbleMenu] Failed to launch agent:",Me)}}function ue(){T(M,""),T(_,!1)}function q(){queueMicrotask(()=>{T(p,!1)})}Je(()=>{if(!a())return;const K=()=>{const{selection:ce}=a().state,{from:Me,to:Fe}=ce;if(Me===Fe||!a().isFocused){T(p,!1);return}T(p,!0);const ne=a().view,De=ne.coordsAtPos(Me),F=ne.coordsAtPos(Fe);let H=(De.left+F.right)/2,ie=De.top-y-P;const pe=r(m)?.offsetWidth||280,ke=12,be=pe/2+ke,L=window.innerWidth-pe/2-ke;H=Math.max(be,Math.min(L,H)),ie<ke&&(ie=F.bottom+P),T(g,{x:H,y:ie},!0)};return a().on("selectionUpdate",K),a().on("update",K),a().on("blur",q),()=>{a()&&(a().off("selectionUpdate",K),a().off("update",K),a().off("blur",q))}}),Je(()=>{if(typeof document>"u")return;const K=()=>{document.hidden&&(q(),T(_,!1))};return document.addEventListener("visibilitychange",K),()=>{document.removeEventListener("visibilitychange",K)}});var B={get editor(){return a()},set editor(K=null){a(K),O()},get workspace(){return i()},set workspace(K){i(K),O()},get noteId(){return l()},set noteId(K){l(K),O()},get onAddComment(){return c()},set onAddComment(K){c(K),O()},get onAgentLaunched(){return d()},set onAgentLaunched(K){d(K),O()},get onCreateSessionComment(){return u()},set onCreateSessionComment(K){u(K),O()},get showNoteActions(){return f()},set showNoteActions(K=!0){f(K),O()},$set:_t,$on:(K,ce)=>wt(t,K,ce)},Y=Nf(),te=Be(Y);{var Ee=K=>{$a(K,{zIndex:100,children:(ce,Me)=>{var Fe=If(),ne=J(Fe),De=J(ne);{let Oe=b(()=>C.tiptap_bubbleMenu_bold_label());Jn(De,{get label(){return r(Oe)},shortcut:"cmd+b",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_bold_label()),et=b(()=>!a().can().chain().focus().toggleBold().run()),ze=b(()=>a().isActive("bold")),Ke=b(()=>a().isActive("bold"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:ae,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return fu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var F=$(De,2);{let Oe=b(()=>C.tiptap_bubbleMenu_italic_label());Jn(F,{get label(){return r(Oe)},shortcut:"cmd+i",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_italic_label()),et=b(()=>!a().can().chain().focus().toggleItalic().run()),ze=b(()=>a().isActive("italic")),Ke=b(()=>a().isActive("italic"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:z,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return gu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var H=$(F,2);{let Oe=b(()=>C.tiptap_bubbleMenu_underline_label());Jn(H,{get label(){return r(Oe)},shortcut:"cmd+u",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_underline_label()),et=b(()=>!a().can().chain().focus().toggleUnderline().run()),ze=b(()=>a().isActive("underline")),Ke=b(()=>a().isActive("underline"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:A,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return mu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var ie=$(H,2);{let Oe=b(()=>C.tiptap_bubbleMenu_strikethrough_label());Jn(ie,{get label(){return r(Oe)},shortcut:"cmd+shift+x",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_strikethrough_label()),et=b(()=>!a().can().chain().focus().toggleStrike().run()),ze=b(()=>a().isActive("strike")),Ke=b(()=>a().isActive("strike"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:G,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return hu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var pe=$(ie,2);{let Oe=b(()=>C.tiptap_bubbleMenu_code_label());Jn(pe,{get label(){return r(Oe)},shortcut:"cmd+e",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_code_label()),et=b(()=>!a().can().chain().focus().toggleCode().run()),ze=b(()=>a().isActive("code")),Ke=b(()=>a().isActive("code"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:oe,get"aria-label"(){return r(je)},get disabled(){return r(et)},get"aria-pressed"(){return r(ze)},get"data-active"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return Da},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var ke=$(pe,2);{let Oe=b(()=>C.tiptap_bubbleMenu_addLink_label());Jn(ke,{get label(){return r(Oe)},shortcut:"cmd+k",side:"top",delayDuration:200,children:(He,Ge)=>{{let je=b(()=>C.tiptap_bubbleMenu_addLink_label()),et=b(()=>a().isActive("link")),ze=b(()=>a().isActive("link"));Ze(He,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:ve,get"aria-label"(){return r(je)},get"aria-pressed"(){return r(et)},get"data-active"(){return r(ze)},children:(Ke,ee)=>{dt(Ke,{get icon(){return bu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var be=$(ke,2);{var L=Oe=>{var He=Sf(),Ge=$(Be(He),2);{let ze=b(()=>C.tiptap_bubbleMenu_addComment_label());Jn(Ge,{get label(){return r(ze)},side:"top",delayDuration:200,children:(Ke,ee)=>{{let Ae=b(()=>C.tiptap_bubbleMenu_addComment_label());Ze(Ke,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:se,get"aria-label"(){return r(Ae)},children:(Te,Ie)=>{dt(Te,{get icon(){return vu},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}var je=$(Ge,2);{var et=ze=>{{let Ke=b(()=>C.tiptap_bubbleMenu_sendToAgent_label());Jn(ze,{get label(){return r(Ke)},side:"top",delayDuration:200,children:(ee,Ae)=>{{let Te=b(()=>C.tiptap_bubbleMenu_sendToAgent_label());Ze(ee,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn",onclick:X,get"aria-label"(){return r(Te)},children:(Ie,Ue)=>{dt(Ie,{get icon(){return La},size:"xs"})},$$slots:{default:!0}})}},$$slots:{default:!0}})}};ge(je,ze=>{n()||ze(et)})}N(Oe,He)};ge(be,Oe=>{f()&&Oe(L)})}Z(ne);var Ce=$(ne,2);{var Se=Oe=>{var He=Af(),Ge=J(He);{let Ke=b(()=>C.tiptap_bubbleMenu_linkUrl_placeholder());du(Ge,{onkeydown:le,type:"text",get placeholder(){return r(Ke)},class:"link-input",get ref(){return r(w)},set ref(ee){T(w,ee,!0)},get value(){return r(x)},set value(ee){T(x,ee,!0)}})}var je=$(Ge,2),et=J(je);{let Ke=b(()=>C.tiptap_bubbleMenu_setLink_ariaLabel());Ze(et,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn small",onclick:D,get"aria-label"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return mr},size:"xs"})},$$slots:{default:!0}})}var ze=$(et,2);{let Ke=b(()=>C.tiptap_bubbleMenu_cancel_ariaLabel());Ze(ze,{variant:"ghost",size:"icon-compact",iconOnly:!0,class:"bubble-menu-btn small",onclick:Q,get"aria-label"(){return r(Ke)},children:(ee,Ae)=>{dt(ee,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}Z(je),Z(He),N(Oe,He)};ge(Ce,Oe=>{r(V)&&Oe(Se)})}Z(Fe),un(Fe,Oe=>T(m,Oe),()=>r(m)),me(()=>Pn(Fe,`left: ${r(g).x??""}px; top: ${r(g).y??""}px;`)),hn("mousedown",Fe,Oe=>Oe.preventDefault()),N(ce,Fe)},$$slots:{default:!0}})};ge(te,K=>{r(p)&&a()&&K(Ee)})}var we=$(te,2);{var he=K=>{_l(K,{get x(){return r(I).x},get y(){return r(I).y},get workspace(){return i()},get noteId(){return l()},get initialMessage(){return r(M)},onSubmit:U,onClose:ue})};ge(we,K=>{f()&&r(_)&&i()&&K(he)})}N(e,Y);var _e=Et(B);return s(),_e}fr(["mousedown"]);var Mf=re('<div class="flex gap-2"><!> <!></div>'),Rf=re('<div class="fixed z-[15] bg-card rounded-lg shadow-lg border border-border p-3 w-80 animate-in fade-in slide-in-from-top-2 duration-spring-moderate ease-spring-moderate motion-reduce:animate-none"><div class="mb-3"><!></div> <!></div> <!>',1);function yl(e,t){if(new.target)return vt({component:yl,...e});yt(t,!0);let n=R(t,"x",7,0),o=R(t,"y",7,0),s=R(t,"onSubmit",7),a=R(t,"onClose",7),i=xe(""),l=xe(null),c=xe("comment");function d(){r(i).trim()&&(s()?.(new CustomEvent("submit",{detail:{content:r(i).trim(),type:r(c)}})),T(i,""),T(c,"comment"))}function u(){T(i,""),T(c,"comment"),a()?.()}function f(m){m.key==="Escape"?u():m.key==="Enter"&&m.ctrlKey&&d()}function p(m){const h=()=>{m.isConnected&&document.activeElement!==m&&m.focus()};h(),queueMicrotask(h);const v=typeof requestAnimationFrame=="function"?requestAnimationFrame(h):null,y=setTimeout(h,100);return{destroy(){v!==null&&cancelAnimationFrame(v),clearTimeout(y)}}}Je(()=>r(l)?p(r(l)).destroy:void 0);var g={get x(){return n()},set x(m=0){n(m),O()},get y(){return o()},set y(m=0){o(m),O()},get onSubmit(){return s()},set onSubmit(m){s(m),O()},get onClose(){return a()},set onClose(m){a(m),O()},$set:_t,$on:(m,h)=>wt(t,m,h)};return $a(e,{children:(m,h)=>{var v=Rf(),y=Be(v),P=J(y),_=J(P);{let x=b(()=>C.tiptap_commentDialog_content_placeholder());za(_,{get placeholder(){return r(x)},onkeydown:f,class:"w-full p-2 text-xs rounded bg-slate-50 dark:bg-slate-800 text-slate-900 dark:text-slate-100 placeholder-slate-400 dark:placeholder-slate-500 resize-none border-0",rows:3,get ref(){return r(l)},set ref(w){T(l,w,!0)},get value(){return r(i)},set value(w){T(i,w,!0)}})}Z(P);var I=$(P,2);{var k=x=>{var w=Mf(),S=J(w);Ze(S,{variant:"primary",onclick:d,class:"text-xs px-2 py-1",children:(z,A)=>{Zt();var G=Kt();me(oe=>fe(G,oe),[()=>C.tiptap_commentDialog_send_label()]),N(z,G)},$$slots:{default:!0}});var ae=$(S,2);Ze(ae,{variant:"ghost",onclick:u,class:"text-xs px-2 py-1 rounded text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors",children:(z,A)=>{Zt();var G=Kt();me(oe=>fe(G,oe),[()=>C.tiptap_commentDialog_cancel_label()]),N(z,G)},$$slots:{default:!0}}),Z(w),N(x,w)},M=b(()=>r(i).trim());ge(I,x=>{r(M)&&x(k)})}Z(y);var V=$(y,2);{let x=b(()=>C.tiptap_commentDialog_close_ariaLabel());Ze(V,{variant:"ghost",class:"fixed inset-0 z-[14]",onclick:u,get"aria-label"(){return r(x)},type:"button"})}me(()=>Pn(y,`left: ${n()??""}px; top: ${o()??""}px; transform: translateX(20px);`)),N(m,v)},$$slots:{default:!0}}),Et(g)}var Of=re('<div aria-hidden="true"> </div>');function Vr(e,t){if(new.target)return vt({component:Vr,...e});yt(t,!0);let n=R(t,"name",7,""),o=R(t,"size",7,32),s=R(t,"class",7,""),a=b(()=>(n()||"?").split(/\s+/).filter(Boolean).slice(0,2).map(p=>p[0]?.toUpperCase()||"?").join(""));function i(p){let g=0;for(let m=0;m<p.length;m++)g=(g<<5)-g+p.charCodeAt(m);return Math.abs(g)}const l=["hsl(var(--agent-avatar-surface-neutral))","hsl(var(--agent-avatar-surface-neutral))","hsl(var(--agent-avatar-surface-waiting))","hsl(var(--agent-avatar-surface-active))","hsl(var(--agent-avatar-surface-attention))","hsl(var(--agent-avatar-surface-neutral))"];let c=b(()=>l[i(n())%l.length]);var d={get name(){return n()},set name(p=""){n(p),O()},get size(){return o()},set size(p=32){o(p),O()},get class(){return s()},set class(p=""){s(p),O()},$set:_t,$on:(p,g)=>wt(t,p,g)},u=Of(),f=Re(u,!0);return me(p=>{Ft(u,1,`inline-flex items-center justify-center rounded-full text-[hsl(var(--agent-avatar-foreground))] font-semibold select-none ${s()}`),Pn(u,p),fe(f,r(a))},[()=>`width:${o()}px;height:${o()}px;background:${r(c)};font-size:${Math.max(10,Math.floor(o()*.45))}px;`]),N(e,u),Et(d)}var Zo=re('<div class="icon-wrapper svelte-1igknem"><!></div>'),Lf=re("<span> </span>"),Df=re('<div class="font-medium truncate-end text-subtle text-xs italic svelte-1igknem"><!></div>'),Pf=re('<div class="font-medium text-sm truncate"> <span class="text-xs text-subtle"> </span></div>'),$f=re('<div class="flex items-center gap-1 mb-2"><!> <span class="text-ui text-subtle"> </span></div>'),Bf=re('<div class="text-xs whitespace-pre-wrap mb-2 line-clamp-3"> </div>'),zf=re('<div class="text-xs mb-2 line-clamp-3"><!></div>'),Ff=re('<div class="text-xs text-subtle"> </div>'),Uf=re('<div class="px-3 pb-2"><!> <!> <!></div>'),Hf=re('<div class="flex items-center gap-2 px-3 py-2"><!> <div class="flex-1 min-w-0"><!></div> <!></div> <!>',1),Kf=re('<div class="flex items-center gap-2"><!> <div class="flex-1"><div class="text-sm font-medium"> </div> <div class="text-xs text-subtle mt-0.5"> </div></div></div>'),Wf=re('<div class="flex items-start gap-2"><!> <div class="flex-1"><div class="text-sm font-medium text-danger"> </div> <div> </div></div></div>'),qf=re('<div class="px-3 py-2"><!></div>'),Vf=re("<div><!></div>");function El(e,t){if(new.target)return vt({component:El,...e});yt(t,!0);const n=()=>gt(m,"$agent$",a),o=()=>gt(h,"$agentIsResponding$",a),s=()=>gt(y,"$lineStats$",a),[a,i]=jt();let l=R(t,"agentId",7),c=R(t,"isCollapsed",7,!1),d=R(t,"commentCreatedAt",7),u=R(t,"displayMode",7,"full"),f=R(t,"onShow",7);const p=Xr()?.workspaceId,g=on(l());Je(()=>{g.set(l())});const m=Vn(g),h=ca(g),v=b(()=>nd(n()));Je(()=>{p&&ye.dispatch(Ki(p,l()))});const y=td(g);Je(()=>{u()==="icon"||c()||ye.dispatch(pd(l()))});const P=b(()=>r(v)?.lastResponse?rd(r(v).lastResponse,1):""),_=3e4;let I=xe(rn(Date.now()));const k=b(()=>{if(!d())return!1;const z=new Date(d()).getTime();return r(I)-z<_});Je(()=>{if(!n()&&d()){const z=new Date(d()).getTime();if(Date.now()-z<_){const G=setInterval(()=>{T(I,Date.now(),!0),r(I)-z>=_&&clearInterval(G)},1e3);return()=>clearInterval(G)}}});var M={get agentId(){return l()},set agentId(z){l(z),O()},get isCollapsed(){return c()},set isCollapsed(z=!1){c(z),O()},get commentCreatedAt(){return d()},set commentCreatedAt(z){d(z),O()},get displayMode(){return u()},set displayMode(z="full"){u(z),O()},get onShow(){return f()},set onShow(z){f(z),O()},$set:_t,$on:(z,A)=>wt(t,z,A)},V=bt(),x=Be(V);{var w=z=>{var A=bt(),G=Be(A);{var oe=D=>{{let Q=b(()=>C.tiptap_agentPeek_session_ariaLabel({name:r(v).name}));Ze(D,{variant:"ghost",class:"icon-button session-comment",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);{let q=b(()=>rs(o()&&"animate-pulse"));dr(ue,{variant:"emphasized",get agentId(){return r(v).id},get class(){return r(q)}})}Z(U),N(le,U)},$$slots:{default:!0}})}},se=D=>{{let Q=b(()=>C.tiptap_agentPeek_launching_ariaLabel());Ze(D,{variant:"ghost",class:"icon-button session-comment",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);To(ue,{size:14}),Z(U),N(le,U)},$$slots:{default:!0}})}},ve=D=>{{let Q=b(()=>C.tiptap_agentPeek_notFound_ariaLabel());Ze(D,{variant:"ghost",class:"icon-button session-comment error",onclick:()=>f()?.(),get"aria-label"(){return r(Q)},children:(le,X)=>{var U=Zo(),ue=J(U);dt(ue,{get icon(){return pa},size:"sm"}),Z(U),N(le,U)},$$slots:{default:!0}})}};ge(G,D=>{r(v)?D(oe):r(k)?D(se,1):D(ve,-1)})}N(z,A)},S=z=>{var A=Vf();let G;var oe=J(A);{var se=D=>{var Q=Hf(),le=Be(Q),X=J(le);{let we=b(()=>c()?18:void 0),he=b(()=>rs(o()&&"animate-pulse"));dr(X,{variant:"standard",get size(){return r(we)},get agentId(){return r(v).id},get class(){return r(he)}})}var U=$(X,2),ue=J(U);{var q=we=>{var he=Df(),_e=J(he);{var K=Me=>{var Fe=Lf(),ne=Re(Fe,!0);me(()=>fe(ne,r(P))),N(Me,Fe)},ce=Me=>{ds(Me,{get toolUse(){return r(v).lastToolUse},get animate(){return o()}})};ge(_e,Me=>{r(P)?Me(K):r(v).lastToolUse&&Me(ce,1)})}Z(he),N(we,he)},B=we=>{var he=Pf(),_e=J(he,!0),K=$(_e),ce=Re(K,!0);Z(he),me(Me=>{fe(_e,r(v).name),fe(ce,Me)},[()=>o()?C.tiptap_agentPeek_active_label():C.tiptap_agentPeek_idle_label()]),N(we,he)};ge(ue,we=>{c()?we(q):we(B,-1)})}Z(U);var Y=$(U,2);{let we=b(()=>C.tiptap_agentPeek_openAgent_ariaLabel());Ze(Y,{variant:"ghost",size:"icon-sm",iconOnly:!0,get"aria-label"(){return r(we)},onclick:he=>{he.stopPropagation();const K=he.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,ce=he.metaKey||he.ctrlKey,Me=p;Me&&ye.dispatch(Gn(Me,{agentId:r(v).id,sourcePanelId:K,openInAdjacentPanel:ce}))},children:(he,_e)=>{dt(he,{get icon(){return el},class:"h-3 w-3"})},$$slots:{default:!0}})}Z(le);var te=$(le,2);{var Ee=we=>{var he=Uf(),_e=J(he);{var K=F=>{var H=$f(),ie=J(H);Ju(ie,{get additions(){return s().additions},get deletions(){return s().deletions},size:"xs",showZero:!1});var pe=$(ie,2),ke=Re(pe,!0);Z(H),me(be=>fe(ke,be),[()=>C.tiptap_agentPeek_lines_label()]),N(F,H)};ge(_e,F=>{s()&&(s().additions>0||s().deletions>0)&&F(K)})}var ce=$(_e,2);{var Me=F=>{var H=Bf(),ie=Re(H,!0);me(()=>fe(ie,r(v)?.lastResponse)),N(F,H)},Fe=F=>{var H=zf(),ie=J(H);ds(ie,{get toolUse(){return r(v).lastToolUse},get animate(){return o()}}),Z(H),N(F,H)};ge(ce,F=>{r(v)?.lastResponse?F(Me):r(v)?.lastToolUse&&F(Fe,1)})}var ne=$(ce,2);{var De=F=>{var H=Ff(),ie=Re(H,!0);me(pe=>fe(ie,pe),[()=>r(v).fileChanges.length===1?C.tiptap_agentPeek_filesChanged_one():C.tiptap_agentPeek_filesChanged_many({count:yn(r(v).fileChanges.length)})]),N(F,H)};ge(ne,F=>{r(v).fileChanges&&r(v).fileChanges.length>0&&F(De)})}Z(he),N(we,he)};ge(te,we=>{c()||we(Ee)})}N(D,Q)},ve=D=>{var Q=qf(),le=J(Q);{var X=ue=>{var q=Kf(),B=J(q);To(B,{size:16,class:"text-ghost"});var Y=$(B,2),te=J(Y),Ee=Re(te,!0),we=$(te,2),he=Re(we,!0);Z(Y),Z(q),me((_e,K)=>{fe(Ee,_e),fe(he,K)},[()=>C.tiptap_agentPeek_waitingLaunch_label(),()=>C.tiptap_agentPeek_appearOnceReady_label()]),N(ue,q)},U=ue=>{var q=Wf(),B=J(q);dt(B,{get icon(){return pa},class:"h-4 w-4 mt-0.5 text-danger"});var Y=$(B,2),te=J(Y),Ee=Re(te,!0),we=$(te,2);let he;var _e=Re(we,!0);Z(Y),Z(q),me((K,ce)=>{fe(Ee,K),he=Ft(we,1,"text-xs text-subtle mt-0.5",null,he,{hidden:u()!=="full"}),fe(_e,ce)},[()=>u()==="full"?C.tiptap_agentPeek_assignedNotFound_label():C.tiptap_agentPeek_notFound_label(),()=>C.tiptap_agentPeek_mayBeDeleted_description()]),N(ue,q)};ge(le,ue=>{r(k)?ue(X):ue(U,-1)})}Z(Q),N(D,Q)};ge(oe,D=>{r(v)?D(se):D(ve,-1)})}Z(A),me(()=>G=Ft(A,1,"flex flex-col bg-background rounded w-full min-w-[180px] transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none",null,G,{"max-w-[380px]":!c(),"cursor-pointer":c(),border:!c(),"border-border":!c(),"max-w-[180px]":u()==="compact"})),N(z,A)};ge(x,z=>{u()==="icon"?z(w):z(S,-1)})}N(e,V);var ae=Et(M);return i(),ae}var Gf=re('<div class="w-px bg-border flex-1 mt-2"></div>'),Yf=re("<span> </span>"),Zf=re('<span class="comment-type-badge px-1.5 py-0.5 text-ui font-mono bg-muted/50 text-subtle svelte-dj1q6v"> </span>'),Xf=re('<div class="flex items-center gap-1 opacity-0 group-hover:opacity-100 focus-within:opacity-100 pointer-events-none group-hover:pointer-events-auto focus-within:pointer-events-auto transition-opacity duration-spring-moderate ease-spring-moderate motion-reduce:transition-none"><!> <!> <!></div>'),Qf=re('<p class="text-xs line-clamp-2 whitespace-pre-wrap wrap-break-word"> </p>'),Jf=re('<!> <div class="flex items-center gap-2 mt-2"><!> <!></div>',1),jf=re('<div class="whitespace-pre-wrap wrap-break-word"></div>'),eg=re('<div class="line-clamp-3 whitespace-pre-wrap wrap-break-word"> </div> <!>',1),tg=re('<div class="text-xs"><!></div>'),ng=re("<div></div>"),rg=re('<div class="group flex gap-2"><div class="flex flex-col items-center"><!> <!></div> <div class="flex-1 min-w-0"><div class="flex items-start justify-between"><div><span data-comment-author=""> </span> <!> <!></div> <!></div> <!> <!></div></div>');function ba(e,t){if(new.target)return vt({component:ba,...e});yt(t,!0);function n(ee){return ee.type==="session"&&!!ee.agentId}let o=R(t,"comment",7),s=R(t,"workspace",7),a=R(t,"isCollapsed",7,!1),i=R(t,"showTimeline",7,!1),l=R(t,"isLastInThread",7,!0),c=R(t,"showActions",7,!0),d=R(t,"showResolveButton",7,!0),u=R(t,"showCloseButton",7,!1),f=R(t,"showType",7,!1),p=R(t,"onEdit",7),g=R(t,"onResolve",7),m=R(t,"onClose",7),h=R(t,"onDelete",7),v=R(t,"size",7,"default"),y=R(t,"externalIsEditing",7),P=R(t,"externalEditHTML",7),_=R(t,"externalEditEditor",15),I=R(t,"onBeginEdit",7),k=R(t,"onSaveEdit",7),M=R(t,"onCancelEdit",7);const V=Xr()?.workspaceId??void 0,x=b(()=>s()?.id??V),w=Ha();function S(ee){if(!ee)return"";const Ae=new Date(ee);return vl(new Date,Ae)>=1?il(Ae):Fa(Ae)}const ae=b(()=>y()!==void 0&&I()!==void 0);let z=xe(!1),A=xe(null),G=xe("");const oe=b(()=>r(ae)?y():r(z));async function se(){if(r(ae))I()?.(o().id);else{T(z,!0);const ee=await Promise.resolve(qn(o().content||"",{allowEmpty:!0,workspaceId:r(x),workspaceFileVersion:w}));T(G,ee||"",!0)}}async function ve(){if(r(ae))k()?.();else try{const ee=r(A)?.getHTML?.()??"",Ae=nr(ee,{preserveAnchors:!1,workspaceId:r(x)}).trim();if(!Ae)return D();qr.select(ye.state,o().id)&&ye.dispatch(Wn(o().id,{content:Ae})),T(z,!1)}catch{T(z,!1)}}function D(){r(ae)?M()?.():(T(z,!1),T(G,""))}let Q=xe(!1);const le=b(()=>`${o().id}:${(o().content||"").length}`);Je(()=>{r(le),T(Q,!1)});let X=xe(""),U=xe("");Je(()=>{let ee=!1;const Ae=o().content||"";return Promise.resolve(qn(Ae,{allowEmpty:!0,workspaceId:r(x),workspaceFileVersion:w})).then(Te=>{if(!ee){T(X,Te||"",!0);try{const Ie=document.createElement("div");Ie.innerHTML=r(X),T(U,(Ie.textContent||"").trim(),!0)}catch{T(U,Ae,!0)}}}),()=>{ee=!0}});const ue=b(()=>v()==="compact"),q=b(()=>a()||r(ue)?"text-[13px]":"text-sm"),B=b(()=>(a()||r(ue),"text-xs")),Y=b(()=>r(ue)?"text-[14px]":"text-sm"),te=b(()=>cl(o()));var Ee={get comment(){return o()},set comment(ee){o(ee),O()},get workspace(){return s()},set workspace(ee){s(ee),O()},get isCollapsed(){return a()},set isCollapsed(ee=!1){a(ee),O()},get showTimeline(){return i()},set showTimeline(ee=!1){i(ee),O()},get isLastInThread(){return l()},set isLastInThread(ee=!0){l(ee),O()},get showActions(){return c()},set showActions(ee=!0){c(ee),O()},get showResolveButton(){return d()},set showResolveButton(ee=!0){d(ee),O()},get showCloseButton(){return u()},set showCloseButton(ee=!1){u(ee),O()},get showType(){return f()},set showType(ee=!1){f(ee),O()},get onEdit(){return p()},set onEdit(ee){p(ee),O()},get onResolve(){return g()},set onResolve(ee){g(ee),O()},get onClose(){return m()},set onClose(ee){m(ee),O()},get onDelete(){return h()},set onDelete(ee){h(ee),O()},get size(){return v()},set size(ee="default"){v(ee),O()},get externalIsEditing(){return y()},set externalIsEditing(ee){y(ee),O()},get externalEditHTML(){return P()},set externalEditHTML(ee){P(ee),O()},get externalEditEditor(){return _()},set externalEditEditor(ee){_(ee),O()},get onBeginEdit(){return I()},set onBeginEdit(ee){I(ee),O()},get onSaveEdit(){return k()},set onSaveEdit(ee){k(ee),O()},get onCancelEdit(){return M()},set onCancelEdit(ee){M(ee),O()},$set:_t,$on:(ee,Ae)=>wt(t,ee,Ae)},we=rg(),he=J(we),_e=J(he);{let ee=b(()=>o().author||"?");Vr(_e,{get name(){return r(ee)},size:24,class:"shrink-0"})}var K=$(_e,2);{var ce=ee=>{var Ae=Gf();N(ee,Ae)};ge(K,ee=>{i()&&!l()&&ee(ce)})}Z(he);var Me=$(he,2),Fe=J(Me),ne=J(Fe);let De;var F=J(ne),H=Re(F,!0);ji(F,(ee,Ae)=>ll?.(ee,Ae),()=>r(te));var ie=$(F,2);{var pe=ee=>{var Ae=Yf();Ft(Ae,1,`text-subtle whitespace-nowrap ${r(B)??""}`,"svelte-dj1q6v");var Te=Re(Ae,!0);me((Ie,Ue)=>{Gt(Ae,"title",Ie),fe(Te,Ue)},[()=>Yu(o().createdAt),()=>S(o().createdAt)]),N(ee,Ae)};ge(ie,ee=>{o().createdAt&&ee(pe)})}var ke=$(ie,2);{var be=ee=>{var Ae=Zf(),Te=Re(Ae,!0);me(()=>fe(Te,o().type)),N(ee,Ae)};ge(ke,ee=>{f()&&o().type&&o().type!=="comment"&&ee(be)})}Z(ne);var L=$(ne,2);{var Ce=ee=>{var Ae=Xf(),Te=J(Ae);{var Ie=st=>{{let Xe=b(()=>C.tiptap_comment_edit_label()),E=b(()=>C.tiptap_comment_edit_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:()=>{se(),p()?.()},children:(j,Ne)=>{dt(j,{get icon(){return tl},size:"xs"})},$$slots:{default:!0}})}};ge(Te,st=>{o().status==="open"&&st(Ie)})}var Ue=$(Te,2);{var Ye=st=>{{let Xe=b(()=>C.tiptap_comment_resolve_label()),E=b(()=>C.tiptap_comment_resolve_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:()=>g()?.(),children:(j,Ne)=>{dt(j,{get icon(){return mr},size:"xs"})},$$slots:{default:!0}})}};ge(Ue,st=>{d()&&o().status==="open"&&st(Ye)})}var ot=$(Ue,2);{var ft=st=>{{let Xe=b(()=>C.tiptap_comment_collapse_label()),E=b(()=>C.tiptap_comment_collapse_label());Ze(st,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Xe)},get tooltip(){return r(E)},onclick:j=>{j.stopPropagation(),m()?.()},children:(j,Ne)=>{dt(j,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}};ge(ot,st=>{u()&&m()&&st(ft)})}Z(Ae),En(3,Ae,()=>In,()=>({axis:"y",tier:"moderate"})),N(ee,Ae)};ge(L,ee=>{c()&&!a()&&ee(Ce)})}Z(Fe);var Se=$(Fe,2);{var Oe=ee=>{var Ae=Qf(),Te=Re(Ae,!0);me(()=>fe(Te,r(U))),N(ee,Ae)},He=ee=>{var Ae=Jf(),Te=Be(Ae);{var Ie=st=>{{let Xe=b(()=>P()??""),E=b(()=>C.tiptap_comment_edit_placeholder());un(fa(st,{editorClassName:"pt-2! pb-4!",get value(){return r(Xe)},get placeholder(){return r(E)},minHeight:60,maxHeight:200,get workspace(){return s()},onSubmit:()=>ve()}),j=>_(j),()=>_())}},Ue=st=>{{let Xe=b(()=>C.tiptap_comment_edit_placeholder());un(fa(st,{editorClassName:"pt-2! pb-4!",get value(){return r(G)},get placeholder(){return r(Xe)},minHeight:60,maxHeight:200,get workspace(){return s()},onSubmit:()=>ve()}),E=>T(A,E,!0),()=>r(A))}};ge(Te,st=>{r(ae)?st(Ie):st(Ue,-1)})}var Ye=$(Te,2),ot=J(Ye);Ze(ot,{size:"sm",onclick:ve,children:(st,Xe)=>{Zt();var E=Kt();me(j=>fe(E,j),[()=>C.tiptap_comment_save_label()]),N(st,E)},$$slots:{default:!0}});var ft=$(ot,2);Ze(ft,{size:"sm",variant:"ghost",onclick:D,children:(st,Xe)=>{Zt();var E=Kt();me(j=>fe(E,j),[()=>C.tiptap_comment_cancel_label()]),N(st,E)},$$slots:{default:!0}}),Z(Ye),N(ee,Ae)},Ge=ee=>{var Ae=tg(),Te=J(Ae);{var Ie=Ye=>{var ot=jf();Ao(ot,()=>r(X),!0),Z(ot),N(Ye,ot)},Ue=Ye=>{var ot=eg(),ft=Be(ot),st=Re(ft,!0),Xe=$(ft,2);Ze(Xe,{variant:"ghost",class:"block text-sm text-muted-foreground hover:text-foreground underline underline-offset-2",onclick:()=>T(Q,!0),type:"button",children:(E,j)=>{Zt();var Ne=Kt();me(nt=>fe(Ne,nt),[()=>C.tiptap_comment_more_label()]),N(E,Ne)},$$slots:{default:!0}}),me(()=>fe(st,r(U))),N(Ye,ot)};ge(Te,Ye=>{r(Q)?Ye(Ie):Ye(Ue,-1)})}Z(Ae),N(ee,Ae)},je=ee=>{var Ae=ng();let Te;Ao(Ae,()=>r(X),!0),Z(Ae),me(()=>Te=Ft(Ae,1,`comment-content ${r(Y)??""} leading-snug text-subtle whitespace-pre-wrap wrap-break-word`,"svelte-dj1q6v",Te,{"leading-relaxed":r(ue),"text-gray-700":r(ue)})),N(ee,Ae)};ge(Se,ee=>{a()?ee(Oe):r(oe)?ee(He,1):(r(U)||"").length>180?ee(Ge,2):ee(je,-1)})}var et=$(Se,2);{var ze=ee=>{Ze(ee,{variant:"ghost",onclick:Ae=>{const Ie=Ae.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,Ue=Ae.metaKey||Ae.ctrlKey,Ye=s()?.id??V;Ye&&ye.dispatch(Gn(Ye,{agentId:o().agentId,sourcePanelId:Ie,openInAdjacentPanel:Ue}))},class:"mt-2 text-xs text-blue-500 hover:text-blue-600 hover:underline",type:"button",children:(Ae,Te)=>{Zt();var Ie=Kt();me(Ue=>fe(Ie,Ue),[()=>C.tiptap_comment_viewAgent_label()]),N(Ae,Ie)},$$slots:{default:!0}})},Ke=b(()=>n(o()));ge(et,ee=>{r(Ke)&&ee(ze)})}return Z(Me),Z(we),me(()=>{De=Ft(ne,1,"flex items-baseline gap-2 min-w-0",null,De,{"mt-0.5":!a()&&!r(ue),"mt-1":a()}),Gt(F,"aria-label",r(te)),Ft(F,1,`font-medium text-foreground truncate ${r(q)??""}`,"svelte-dj1q6v"),fe(H,r(te))}),N(e,we),Et(Ee)}var og=re('<div class="ml-8"><!></div>'),ag=re('<div class="ml-8"><span class="text-xs text-warning-ink mt-1 inline-block"> </span></div>'),sg=re("<div><!></div>"),ig=re('<div class="pt-1.5 flex flex-col gap-1.5"></div>'),lg=re('<div class="px-3 py-1.5 border-t border-border"><div class="flex items-center gap-px"><!> <div class="flex-1 rounded px-1 py-1"><!></div> <!> <!> <!></div></div>'),cg=re("<div><div><!> <!> <!> <!></div> <!></div>");function kl(e,t){if(new.target)return vt({component:kl,...e});yt(t,!0);function n(q){return q.type==="session"&&!!q.agentId}let o=R(t,"comment",7),s=R(t,"replies",23,()=>[]),a=R(t,"orphaned",7,!1),i=R(t,"focused",7,!1),l=R(t,"isCollapsed",7,!1),c=R(t,"replyValue",7,""),d=R(t,"onReplyValueChange",7),u=R(t,"onReply",7),f=R(t,"onAccept",7),p=R(t,"onReject",7),g=R(t,"onResolve",7),m=R(t,"onMarkUnread",7),h=R(t,"onEdit",7),v=R(t,"onCopyLink",7),y=R(t,"onDelete",7),P=R(t,"onShow",7),_=R(t,"onClose",7),I=R(t,"registerReplyInput",7),k=R(t,"workspace",7),M=R(t,"showType",7,!0);const V=Ha();let x=xe(null),w=xe(!1);Je(()=>{r(x)&&I()&&I()(r(x))});let S=xe(null),ae=xe(null),z=xe("");async function A(q){T(S,q,!0);const B=s().find(te=>te.id===q),Y=await Promise.resolve(qn(B?.content||"",{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V}));T(z,Y||"",!0)}async function G(){const q=r(S);if(!q)return oe();try{const B=r(ae)?.getHTML?.()??"",Y=nr(B,{preserveAnchors:!1,workspaceId:k()?.id}).trim();if(!Y)return oe();qr.select(ye.state,q)&&ye.dispatch(Wn(q,{content:Y}))}finally{T(S,null),T(z,""),T(ae,null)}}function oe(){T(S,null),T(z,""),T(ae,null)}Je(()=>{let q=!1;const B=o().content||"";return Promise.resolve(qn(B,{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V})).then(Y=>{if(!q)try{const te=document.createElement("div");te.innerHTML=Y||""}catch{}}),()=>{q=!0}});let se=xe(rn({}));Je(()=>{let q=!1;return s()?.forEach(B=>{Promise.resolve(qn(B.content||"",{allowEmpty:!0,workspaceId:k()?.id,workspaceFileVersion:V})).then(Y=>{q||(r(se)[B.id]=Y||"")})}),()=>{q=!0}});async function ve(){if(r(w))return;const q=c()?.trim();if(!q)return;const B=c(),Y=r(x)?.getHTML?.()??"",Ee=(nr(Y,{preserveAnchors:!1,workspaceId:k()?.id})||q).trim();T(w,!0);try{if((Ee?await u()?.(Ee):!1)===!1||c()!==B)return;d()?.(""),r(x)?.clear?.()}finally{T(w,!1)}}var D={get comment(){return o()},set comment(q){o(q),O()},get replies(){return s()},set replies(q=[]){s(q),O()},get orphaned(){return a()},set orphaned(q=!1){a(q),O()},get focused(){return i()},set focused(q=!1){i(q),O()},get isCollapsed(){return l()},set isCollapsed(q=!1){l(q),O()},get replyValue(){return c()},set replyValue(q=""){c(q),O()},get onReplyValueChange(){return d()},set onReplyValueChange(q){d(q),O()},get onReply(){return u()},set onReply(q){u(q),O()},get onAccept(){return f()},set onAccept(q){f(q),O()},get onReject(){return p()},set onReject(q){p(q),O()},get onResolve(){return g()},set onResolve(q){g(q),O()},get onMarkUnread(){return m()},set onMarkUnread(q){m(q),O()},get onEdit(){return h()},set onEdit(q){h(q),O()},get onCopyLink(){return v()},set onCopyLink(q){v(q),O()},get onDelete(){return y()},set onDelete(q){y(q),O()},get onShow(){return P()},set onShow(q){P(q),O()},get onClose(){return _()},set onClose(q){_(q),O()},get registerReplyInput(){return I()},set registerReplyInput(q){I(q),O()},get workspace(){return k()},set workspace(q){k(q),O()},get showType(){return M()},set showType(q=!0){M(q),O()},$set:_t,$on:(q,B)=>wt(t,q,B)},Q=bt(),le=Be(Q);{var X=q=>{El(q,{get agentId(){return o().agentId},get isCollapsed(){return l()},get commentCreatedAt(){return o().createdAt}})},U=b(()=>n(o())),ue=q=>{var B=cg();let Y;var te=J(B);let Ee;var we=J(te);{let F=b(()=>!l()&&s().length>0),H=b(()=>!!_());ba(we,{get comment(){return o()},get workspace(){return k()},get isCollapsed(){return l()},get showTimeline(){return r(F)},showActions:!0,showResolveButton:!0,get showCloseButton(){return r(H)},get showType(){return M()},get onEdit(){return h()},get onResolve(){return g()},get onClose(){return _()}})}var he=$(we,2);{var _e=F=>{var H=og(),ie=J(H);Ze(ie,{variant:"ghost",class:"text-ui text-muted-foreground hover:text-foreground mt-1",onclick:pe=>{pe.stopPropagation(),P()?.()},type:"button",children:(pe,ke)=>{Zt();var be=Kt();me(L=>fe(be,L),[()=>s().length===1?C.tiptap_commentThread_showReplies_one():C.tiptap_commentThread_showReplies_many({count:yn(s().length)})]),N(pe,be)},$$slots:{default:!0}}),Z(H),N(F,H)};ge(he,F=>{l()&&s().length>0&&F(_e)})}var K=$(he,2);{var ce=F=>{var H=ag(),ie=J(H),pe=Re(ie,!0);Z(H),me((ke,be)=>{Gt(ie,"title",ke),fe(pe,be)},[()=>C.tiptap_commentThread_unlinked_tooltip(),()=>C.tiptap_commentThread_unlinked_label()]),N(F,H)};ge(K,F=>{a()&&!l()&&F(ce)})}var Me=$(K,2);{var Fe=F=>{var H=ig();fn(H,23,s,ie=>ie.id,(ie,pe,ke)=>{var be=sg(),L=J(be);{let Ce=b(()=>r(ke)===s().length-1),Se=b(()=>r(S)===r(pe).id);ba(L,{get comment(){return r(pe)},get workspace(){return k()},showTimeline:!0,get isLastInThread(){return r(Ce)},showActions:!0,showResolveButton:!1,showCloseButton:!1,get showType(){return M()},size:"compact",get externalIsEditing(){return r(Se)},get externalEditHTML(){return r(z)},onBeginEdit:Oe=>A(Oe),onSaveEdit:G,onCancelEdit:oe,get externalEditEditor(){return r(ae)},set externalEditEditor(Oe){T(ae,Oe,!0)}})}Z(be),En(3,be,()=>In,()=>({axis:"y",tier:"moderate"})),N(ie,be)}),Z(H),En(3,H,()=>In,()=>({axis:"y",tier:"moderate"})),N(F,H)};ge(Me,F=>{!l()&&s().length>0&&F(Fe)})}Z(te);var ne=$(te,2);{var De=F=>{var H=lg(),ie=J(H),pe=J(ie);Vr(pe,{name:"User",size:24,class:"shrink-0"});var ke=$(pe,2),be=J(ke);{let Oe=b(()=>C.tiptap_commentThread_reply_placeholder());un(fa(be,{editorClassName:"pt-2! pb-4!",get value(){return c()},get placeholder(){return r(Oe)},minHeight:32,maxHeight:160,get workspace(){return k()},get inputLocked(){return r(w)},onUpdate:He=>d()?.(He),onSubmit:()=>ve()}),He=>T(x,He,!0),()=>r(x))}Z(ke);var L=$(ke,2);{let Oe=b(()=>C.tiptap_commentThread_attach_tooltip());Ze(L,{variant:"ghost-light",size:"icon-sm",get tooltip(){return r(Oe)},children:(He,Ge)=>{dt(He,{get icon(){return _u},size:"sm",class:"text-ghost"})},$$slots:{default:!0}})}var Ce=$(L,2);{let Oe=b(()=>C.tiptap_commentThread_mention_tooltip());Ze(Ce,{variant:"ghost-light",size:"icon-sm",get tooltip(){return r(Oe)},onclick:()=>r(x)?.insertAtSymbol?.(),children:(He,Ge)=>{dt(He,{get icon(){return wu},size:"sm",class:"text-ghost"})},$$slots:{default:!0}})}var Se=$(Ce,2);{let Oe=b(()=>C.tiptap_commentThread_send_tooltip());Ze(Se,{variant:"ghost-light",size:"icon-sm",class:"rounded-full bg-muted text-foreground hover:bg-muted/80",get tooltip(){return r(Oe)},get disabled(){return r(w)},onclick:()=>ve(),children:(He,Ge)=>{dt(He,{get icon(){return yu},size:"sm"})},$$slots:{default:!0}})}Z(ie),Z(H),En(3,H,()=>In,()=>({axis:"y",tier:"moderate"})),N(F,H)};ge(ne,F=>{l()||F(De)})}Z(B),me(()=>{Y=Ft(B,1,"flex flex-col bg-background rounded w-full transition-all duration-spring-moderate ease-spring-moderate motion-reduce:transition-none border border-border",null,Y,{"max-w-[380px]":!l(),"max-h-[400px]":!l(),"overflow-hidden":!l(),"cursor-pointer":l()}),Ee=Ft(te,1,"px-1.5 py-1.5",null,Ee,{"py-2":!l(),"pb-1":!l(),"flex-1":!l(),"overflow-y-auto":!l(),"custom-scrollbar":!l()})}),N(q,B)};ge(le,q=>{r(U)?q(X):q(ue,-1)})}return N(e,Q),Et(D)}var dg=re('<div class="connection-line svelte-19i04dt"></div>'),ug=re('<span class="reply-badge"> </span>'),pg=re('<div class="icon-wrapper"><!> <!></div>'),fg=re('<div class="hover-card-footer svelte-19i04dt"> </div>'),gg=re('<div class="hover-card svelte-19i04dt" role="group"><div class="hover-card-header svelte-19i04dt"><!> <span class="author svelte-19i04dt"> </span> <span class="timestamp svelte-19i04dt"> </span></div> <div class="hover-card-content svelte-19i04dt"><div class="hover-message-text svelte-19i04dt"> </div></div> <!></div>'),mg=re("<!> <!>",1),hg=re("<!> ",1),bg=re('<div class="full-text"> </div> <div class="compact-actions svelte-19i04dt"><!> <!></div>',1),vg=re('<div class="truncated-text svelte-19i04dt"> </div>'),_g=re('<div class="compact-replies svelte-19i04dt"><!> <span> </span></div>'),wg=re('<div role="button" tabindex="0"><div class="compact-header svelte-19i04dt"><!> <span data-comment-author="" class="compact-author svelte-19i04dt"> </span> <!></div> <div class="compact-content svelte-19i04dt"><!></div> <!></div>'),yg=re('<div class="depth-indicator svelte-19i04dt"> </div>'),Eg=re('<div role="group"><!> <!> <!></div>');function xl(e,t){if(new.target)return vt({component:xl,...e});yt(t,!0);const n=()=>gt(se,"$position",o),[o,s]=jt();let a=R(t,"comment",7),i=R(t,"replies",23,()=>[]),l=R(t,"displayMode",7,"full"),c=R(t,"orphaned",7,!1),d=R(t,"focused",7,!1),u=R(t,"isCollapsed",7,!1),f=R(t,"depth",7,0),p=R(t,"offset",7,0),g=R(t,"hasConnectionLine",7,!1),m=R(t,"replyValue",7,""),h=R(t,"onReplyValueChange",7),v=R(t,"onReply",7),y=R(t,"onAccept",7),P=R(t,"onReject",7),_=R(t,"onResolve",7),I=R(t,"onMarkUnread",7),k=R(t,"onEdit",7),M=R(t,"onCopyLink",7),V=R(t,"onDelete",7),x=R(t,"onShow",7),w=R(t,"onClose",7),S=R(t,"registerReplyInput",7),ae=R(t,"workspace",7),z,A=xe(400),G=b(()=>r(A)<200?"icon":r(A)<320?"compact":"full"),oe=b(()=>l()||r(G));Je(()=>{if(!z)return;const F=new ResizeObserver(H=>{for(const ie of H)T(A,ie.contentRect.width,!0)});return F.observe(z),()=>F.disconnect()});const se=Zu({x:p(),y:0},"slow");Je(()=>{se.set({x:p(),y:0})}),Je(()=>{d()&&(T(X,!1),clearTimeout(U))});function ve(F){if(!F)return"";const H=new Date(F);return vl(new Date,H)>=1?il(H):Fa(H)}function D(F,H=100){return F.length<=H?F:F.substring(0,H).trim()+"..."}function Q(F){switch(F){case"suggestion":return xu;case"change-request":return tl;case"question":return ku;case"issue":return pa;case"session":return La;default:return Eu}}function le(F,H){if(H==="resolved")return"type-resolved";if(H==="accepted")return"type-accepted";if(H==="rejected")return"type-rejected";switch(F){case"suggestion":return"type-suggestion";case"change-request":return"type-change-request";case"question":return"type-question";case"issue":return"type-issue";default:return"type-comment"}}let X=xe(!1),U;function ue(){r(oe)==="icon"&&!d()&&(clearTimeout(U),U=setTimeout(()=>{T(X,!0)},300))}function q(){clearTimeout(U),r(oe)==="icon"&&!d()&&(U=setTimeout(()=>{T(X,!1)},200))}const B=b(()=>cl(a()));var Y={get comment(){return a()},set comment(F){a(F),O()},get replies(){return i()},set replies(F=[]){i(F),O()},get displayMode(){return l()},set displayMode(F="full"){l(F),O()},get orphaned(){return c()},set orphaned(F=!1){c(F),O()},get focused(){return d()},set focused(F=!1){d(F),O()},get isCollapsed(){return u()},set isCollapsed(F=!1){u(F),O()},get depth(){return f()},set depth(F=0){f(F),O()},get offset(){return p()},set offset(F=0){p(F),O()},get hasConnectionLine(){return g()},set hasConnectionLine(F=!1){g(F),O()},get replyValue(){return m()},set replyValue(F=""){m(F),O()},get onReplyValueChange(){return h()},set onReplyValueChange(F){h(F),O()},get onReply(){return v()},set onReply(F){v(F),O()},get onAccept(){return y()},set onAccept(F){y(F),O()},get onReject(){return P()},set onReject(F){P(F),O()},get onResolve(){return _()},set onResolve(F){_(F),O()},get onMarkUnread(){return I()},set onMarkUnread(F){I(F),O()},get onEdit(){return k()},set onEdit(F){k(F),O()},get onCopyLink(){return M()},set onCopyLink(F){M(F),O()},get onDelete(){return V()},set onDelete(F){V(F),O()},get onShow(){return x()},set onShow(F){x(F),O()},get onClose(){return w()},set onClose(F){w(F),O()},get registerReplyInput(){return S()},set registerReplyInput(F){S(F),O()},get workspace(){return ae()},set workspace(F){ae(F),O()},$set:_t,$on:(F,H)=>wt(t,F,H)},te=Eg();let Ee;var we=J(te);{var he=F=>{var H=dg();En(3,H,()=>Xu,()=>({tier:"moderate"})),N(F,H)};ge(we,F=>{g()&&F(he)})}var _e=$(we,2);{var K=F=>{var H=mg(),ie=Be(H);{let be=b(()=>le(a().type,a().status)),L=b(()=>i().length>0?"has-replies":""),Ce=b(()=>r(B)),Se=b(()=>D(a().content||""));Ze(ie,{variant:"ghost",get class(){return`icon-button ${r(be)??""} ${r(L)??""}`},onclick:()=>x()?.(),"data-comment-author":!0,get"aria-label"(){return`${r(Ce)??""}: ${r(Se)??""}`},children:(Oe,He)=>{var Ge=pg(),je=J(Ge);{let Ke=b(()=>Q(a().type));dt(je,{get icon(){return r(Ke)},size:"sm"})}var et=$(je,2);{var ze=Ke=>{var ee=ug(),Ae=Re(ee,!0);me(()=>fe(Ae,i().length)),N(Ke,ee)};ge(et,Ke=>{i().length>0&&Ke(ze)})}Z(Ge),N(Oe,Ge)},$$slots:{default:!0}})}var pe=$(ie,2);{var ke=be=>{var L=gg(),Ce=J(L),Se=J(Ce);{let Te=b(()=>a().author||"?");Vr(Se,{get name(){return r(Te)},size:20})}var Oe=$(Se,2),He=Re(Oe,!0),Ge=$(Oe,2),je=Re(Ge,!0);Z(Ce);var et=$(Ce,2),ze=J(et),Ke=Re(ze,!0);Z(et);var ee=$(et,2);{var Ae=Te=>{var Ie=fg(),Ue=Re(Ie,!0);me(Ye=>fe(Ue,Ye),[()=>i().length===1?C.tiptap_responsiveThread_replies_one():C.tiptap_responsiveThread_replies_many({count:yn(i().length)})]),N(Te,Ie)};ge(ee,Te=>{i().length>0&&Te(Ae)})}Z(L),me((Te,Ie)=>{fe(He,r(B)),fe(je,Te),fe(Ke,Ie)},[()=>ve(a().createdAt),()=>D(a().content||"",150)]),_n("mouseenter",L,()=>clearTimeout(U)),_n("mouseleave",L,q),En(3,L,()=>In,()=>({axis:"x",tier:"moderate"})),N(be,L)};ge(pe,be=>{r(X)&&be(ke)})}N(F,H)},ce=F=>{var H=wg(),ie=J(H),pe=J(ie);{let ze=b(()=>a().author||"?");Vr(pe,{get name(){return r(ze)},size:20})}var ke=$(pe,2),be=Re(ke,!0);ji(ke,(ze,Ke)=>ll?.(ze,Ke),()=>r(B));var L=$(ke,2);{var Ce=ze=>{{let Ke=b(()=>C.tiptap_commentThread_show_ariaLabel());Ze(ze,{variant:"ghost-light",size:"icon-xs",get"aria-label"(){return r(Ke)},onclick:ee=>{ee.stopPropagation(),x()?.()},children:(ee,Ae)=>{Fu(ee,{class:"size-3.5"})},$$slots:{default:!0}})}};ge(L,ze=>{d()||ze(Ce)})}Z(ie);var Se=$(ie,2),Oe=J(Se);{var He=ze=>{var Ke=bg(),ee=Be(Ke),Ae=Re(ee,!0),Te=$(ee,2),Ie=J(Te);Ze(Ie,{size:"xs",variant:"ghost",onclick:()=>_()?.(),children:(Ye,ot)=>{var ft=hg(),st=Be(ft);dt(st,{get icon(){return mr},size:"xs"});var Xe=$(st);me(E=>fe(Xe,` ${E??""}`),[()=>C.tiptap_responsiveThread_resolve_label()]),N(Ye,ft)},$$slots:{default:!0}});var Ue=$(Ie,2);{let Ye=b(()=>C.tiptap_responsiveThread_close_ariaLabel());Ze(Ue,{size:"icon-compact",iconOnly:!0,variant:"ghost",get"aria-label"(){return r(Ye)},onclick:()=>w()?.(),children:(ot,ft)=>{dt(ot,{get icon(){return Bo},size:"xs"})},$$slots:{default:!0}})}Z(Te),me(()=>fe(Ae,a().content)),N(ze,Ke)},Ge=ze=>{var Ke=vg(),ee=Re(Ke,!0);me(Ae=>fe(ee,Ae),[()=>D(a().content||"",60)]),N(ze,Ke)};ge(Oe,ze=>{d()?ze(He):ze(Ge,-1)})}Z(Se);var je=$(Se,2);{var et=ze=>{var Ke=_g(),ee=J(Ke);dt(ee,{get icon(){return Cu},size:"xs"});var Ae=$(ee,2),Te=Re(Ae,!0);Z(Ke),me(()=>fe(Te,i().length)),N(ze,Ke)};ge(je,ze=>{i().length>0&&!d()&&ze(et)})}Z(H),me(ze=>{Ft(H,1,`compact-container ${ze??""}`,"svelte-19i04dt"),Gt(ke,"aria-label",r(B)),fe(be,r(B))},[()=>le(a().type,a().status)]),hn("click",H,()=>!d()&&x()?.()),hn("keydown",H,ze=>{(ze.key==="Enter"||ze.key===" ")&&(ze.preventDefault(),!d()&&x()?.())}),N(F,H)},Me=F=>{kl(F,{get comment(){return a()},get replies(){return i()},get isCollapsed(){return u()},get orphaned(){return c()},get focused(){return d()},get replyValue(){return m()},get onReplyValueChange(){return h()},get onShow(){return x()},get onClose(){return w()},get onReply(){return v()},get onAccept(){return y()},get onReject(){return P()},get onResolve(){return _()},get onMarkUnread(){return I()},get onEdit(){return k()},get onCopyLink(){return M()},get onDelete(){return V()},get registerReplyInput(){return S()},get workspace(){return ae()}})};ge(_e,F=>{r(oe)==="icon"&&!d()?F(K):r(oe)==="compact"&&!d()?F(ce,1):F(Me,-1)})}var Fe=$(_e,2);{var ne=F=>{var H=yg(),ie=Re(H,!0);me(()=>{Pn(H,`opacity: ${.3+f()*.2}`),fe(ie,f())}),N(F,H)};ge(Fe,F=>{f()>0&&F(ne)})}Z(te),un(te,F=>z=F,()=>z),me(()=>{Ee=Ft(te,1,"comment-thread-container svelte-19i04dt",null,Ee,{"icon-mode":r(oe)==="icon","compact-mode":r(oe)==="compact","full-mode":r(oe)==="full",focused:d(),collapsed:u()&&r(oe)!=="icon"}),Pn(te,`transform: translateX(${n().x??""}px); z-index: ${10-f()};`)}),_n("mouseenter",te,ue),_n("mouseleave",te,q),N(e,te);var De=Et(Y);return s(),De}fr(["click","keydown"]);const Es=sn("CommentAnchor"),kg=en.create({name:"commentAnchor",inline:!0,group:"inline",atom:!0,selectable:!1,addAttributes(){return{id:{default:null,parseHTML:e=>e.getAttribute("data-anchor-id"),renderHTML:e=>e.id?{"data-anchor-id":e.id}:{}},type:{default:"point",parseHTML:e=>e.getAttribute("data-anchor-type")||"point",renderHTML:e=>({"data-anchor-type":e.type})},commentId:{default:null,parseHTML:e=>e.getAttribute("data-comment-id"),renderHTML:e=>e.commentId?{"data-comment-id":e.commentId}:{}}}},parseHTML(){return[{tag:"span[data-anchor-id]"}]},renderHTML({HTMLAttributes:e}){return["span",nn(e,{class:"comment-anchor",style:"display: none;"})]},addCommands(){return{insertCommentAnchors:e=>(({commands:t,state:n,chain:o,tr:s})=>{const{from:a,to:i}=n.selection,l=n.doc.resolve(a),c=n.doc.resolve(i);return Es.debug("Selection info:",{from:a,to:i,selectedText:n.doc.textBetween(a,i),fromParent:l.parent.type.name,toParent:c.parent.type.name}),a!==i?t.command(({tr:d,dispatch:u})=>{if(!u)return!0;const f=n.schema.nodes[this.name].create({id:`${e}:start`,type:"start",commentId:e}),p=n.schema.nodes[this.name].create({id:`${e}:end`,type:"end",commentId:e});return d.insert(i,p),d.insert(a,f),Es.debug("Inserted anchors via transaction at positions:",{from:a,to:i}),!0}):t.command(({tr:d,dispatch:u})=>{if(!u)return!0;const f=n.schema.nodes[this.name].create({id:`${e}:point`,type:"point",commentId:e});return d.insert(a,f),!0})}),removeCommentAnchors:e=>({state:t,tr:n,dispatch:o})=>{let s=!1;return t.doc.descendants((a,i)=>{if(a.type.name===this.name&&a.attrs.commentId===e){s=!0;const l=n.mapping.map(i);n.delete(l,l+a.nodeSize)}}),s&&o?(o(n),!0):!1},insertPointAnchor:e=>({commands:t,state:n})=>{const{from:o}=n.selection;return t.insertContentAt(o,{type:this.name,attrs:{id:`${e}:point`,type:"point",commentId:e}})}}},addNodeView(){return({node:e})=>{const t=document.createElement("span");return t.style.display="none",t.className="comment-anchor",e.attrs.id&&t.setAttribute("data-anchor-id",e.attrs.id),e.attrs.type&&t.setAttribute("data-anchor-type",e.attrs.type),e.attrs.commentId&&t.setAttribute("data-comment-id",e.attrs.commentId),{dom:t,contentDOM:null,ignoreMutation:()=>!0}}}});function Hr(e,t){const n={};return e.descendants((o,s)=>{if(o.type.name==="commentAnchor"&&o.attrs.commentId===t){const a=o.attrs.type;a==="start"?n.start=s:a==="end"?n.end=s:a==="point"&&(n.point=s)}}),n}function va(e){const t=new Set;return e.descendants(n=>{n.type.name==="commentAnchor"&&n.attrs.commentId&&t.add(n.attrs.commentId)}),t}var xg=re('<div role="button" tabindex="0"><div><!></div></div>'),Cg=re('<div class="comments-container svelte-8a1he9"></div>');function Cl(e,t){if(new.target)return vt({component:Cl,...e});yt(t,!0);const n=()=>gt(i,"$selectedComment$",o),[o,s]=jt(),a=sn("CommentsSidebar"),i=Kp();let l=R(t,"comments",23,()=>[]),c=R(t,"editor",7),d=R(t,"editorWrapper",7),u=R(t,"workspace",7),f=R(t,"onResolve",7),p=R(t,"onAccept",7),g=R(t,"onReject",7),m=R(t,"onReply",7),h=R(t,"onMarkUnread",7),v=R(t,"onEdit",7),y=R(t,"onCopyLink",7),P=R(t,"onDelete",7),_=xe(rn({})),I=xe(rn({})),k=xe(rn({})),M=xe(rn(new Set)),V=xe(null),x=xe(null),w=!1,S=xe("full");Je(()=>{const B=d()||c()?.view?.dom;if(B){const Y=()=>{const he=B.closest(".workspace-spec-with-comments");if(he){const K=he.getBoundingClientRect().width;K<600?T(S,"icon"):K<800?T(S,"compact"):T(S,"full");const ce=B.closest(".tiptap-editor-wrapper");ce&&ce instanceof HTMLElement&&(r(S)==="icon"?ce.style.paddingRight="80px":r(S)==="compact"?ce.style.paddingRight="160px":ce.style.paddingRight="260px"),se()}};let te=requestAnimationFrame(()=>{te=null,Y()});const Ee=new ResizeObserver(Y);Ee.observe(B);const we=B.closest(".workspace-spec-with-comments");return we&&Ee.observe(we),()=>{te!==null&&cancelAnimationFrame(te),Ee.disconnect();const he=B.closest(".tiptap-editor-wrapper");he&&he instanceof HTMLElement&&(he.style.paddingRight="")}}}),Je(()=>{l().forEach(B=>{B.id in r(_)||(r(_)[B.id]="")}),l().length>0&&ve()});let ae=xe(!0),z=null;const A=b(()=>{const B=new Set,Y=[];for(const te of l())te.status!=="resolved"&&!te.parentId&&te.id&&!B.has(te.id)&&(B.add(te.id),Y.push(te));return Y});function G(B){return l().filter(Y=>Y.parentId===B)}let oe=xe(null);Je(()=>{a.debug("[CommentsSidebar] Comments received",{totalComments:l().length,activeComments:r(A).length})});function se(){if(!r(A).length)return;const B=[...r(A)].sort((he,_e)=>{const K=r(k)[he.id]||0,ce=r(k)[_e.id]||0;return K-ce});let Y=0;const te=10,Ee=47,we=47;B.forEach(he=>{const _e=r(k)[he.id]||100,ce=r(x)===he.id?we:Ee,Me=Y+te,Fe=Math.max(_e,Me+ce/2);r(k)[he.id]=Fe,Y=Fe+ce/2})}function ve(){!c()||!c().view||(z&&clearTimeout(z),z=setTimeout(()=>{c()&&c().view&&D()},r(ae)?300:50))}function D(){if(!c()||!c().view){const _e={};r(A).forEach((K,ce)=>{_e[K.id]=100+ce*150}),T(k,_e,!0),T(M,new Set(r(A).map(K=>K.id)),!0);return}let B;try{B=c().view.dom}catch(_e){a.debug("[CommentsSidebar] Editor view not available",{error:_e});const K={};r(A).forEach((ce,Me)=>{K[ce.id]=100+Me*150}),T(k,K,!0),T(M,new Set(r(A).map(ce=>ce.id)),!0);return}if(!B){const _e={};r(A).forEach((K,ce)=>{_e[K.id]=100+ce*150}),T(k,_e,!0),T(M,new Set(r(A).map(K=>K.id)),!0);return}const Y={},te=new Set,Ee=B.closest("#editor-content"),we=B.getBoundingClientRect(),he=Ee?.getBoundingClientRect()||we;r(A).forEach(_e=>{const{doc:K}=c().state;let ce=!1;const Me=Hr(K,_e.id),Fe=Me.start!==void 0?Me.start+1:Me.point!==void 0?Me.point+1:void 0;if(Fe!==void 0)try{if(!c().view)throw new Error("Editor view not available");const ne=c().view.coordsAtPos(Fe),De=Ee?.scrollTop||0,F=ne.top,H=he.top,ie=F-H+De;Y[_e.id]=ie,ce=!0}catch(ne){a.error("[CommentsSidebar] Position calculation failed",{commentId:_e.id,error:ne})}if(!ce){te.add(_e.id);const ne=r(A).indexOf(_e);Y[_e.id]=100+ne*150}}),T(M,te,!0),T(k,Y,!0),se()}Je(()=>{if(!c())return;const B=()=>{ve()};return ve(),c().on("update",B),c().on("selectionUpdate",B),()=>{c().off("update",B),c().off("selectionUpdate",B)}}),Je(()=>{if(!c()||!c().view)return;let B;try{B=c().view.dom}catch(we){a.debug("[CommentsSidebar] Editor view not available for scroll listener",{error:we});return}if(!B)return;const Y=B.closest(".overflow-y-auto");if(!Y)return;const te=()=>{ve()},Ee=()=>{requestAnimationFrame(te)};return Y.addEventListener("scroll",Ee),window.addEventListener("resize",Ee),()=>{Y.removeEventListener("scroll",Ee),window.removeEventListener("resize",Ee)}}),Je(()=>(document.addEventListener("click",X),()=>{document.removeEventListener("click",X)})),Je(()=>{if(r(A).length>0){const B=r(A)[r(A).length-1];B.id!==r(oe)&&T(oe,B.id,!0)}}),Je(()=>{if(r(ae)&&c()){const B=setTimeout(()=>{T(ae,!1),a.debug("[CommentsSidebar] Initial load complete")},1500);return()=>clearTimeout(B)}}),Je(()=>{const B=n()?.id??null;l().some(Y=>Y.id===B)&&B&&B!==r(V)&&(a.debug("[CommentsSidebar] Store selected comment changed",{selected:B,previous:r(V)}),T(V,B,!0),T(x,B,!0),se(),setTimeout(()=>{const Y=document.querySelector(`[data-comment-id="${B}"]`);Y?(Y.scrollIntoView({behavior:"smooth",block:"center"}),a.debug("[CommentsSidebar] Scrolled comment into view",{selected:B})):a.warn("[CommentsSidebar] Could not find element to scroll",{selected:B})},100))});function Q(B){r(x)!==B&&(T(x,B,!0),w=!0,B in r(_)||(r(_)[B]=""),setTimeout(()=>{const Y=document.querySelector(`[data-comment-id="${B}"]`),te=document.querySelector("#editor-content");if(Y&&te){const Ee=Y.getBoundingClientRect(),we=te.getBoundingClientRect();if(Ee.top<we.top+10){const he=we.top-Ee.top+20;te.scrollTop=Math.max(0,te.scrollTop-he)}else if(Ee.bottom>we.bottom-10){const he=Ee.bottom-we.bottom+20;te.scrollTop=te.scrollTop+he}}se()},50),setTimeout(()=>{w=!1},100)),a.debug("[CommentsSidebar] Focus comment",{commentId:B,focused:r(x)===B})}function le(){r(x)&&(a.debug("[CommentsSidebar] Unfocusing comment",{commentId:r(x)}),T(x,null),se())}function X(B){if(w)return;const Y=B.target,te=Y.closest("[data-comment-id]"),Ee=Y.closest(".portal-container");!te&&!Ee&&r(x)&&le()}Je(()=>{if(r(x))return Uu(()=>le())}),Je(()=>{Object.entries(r(I)).forEach(([B,Y])=>{r(x)===B&&Y&&setTimeout(()=>Y.focus(),0)})});var U={get comments(){return l()},set comments(B=[]){l(B),O()},get editor(){return c()},set editor(B){c(B),O()},get editorWrapper(){return d()},set editorWrapper(B){d(B),O()},get workspace(){return u()},set workspace(B){u(B),O()},get onResolve(){return f()},set onResolve(B){f(B),O()},get onAccept(){return p()},set onAccept(B){p(B),O()},get onReject(){return g()},set onReject(B){g(B),O()},get onReply(){return m()},set onReply(B){m(B),O()},get onMarkUnread(){return h()},set onMarkUnread(B){h(B),O()},get onEdit(){return v()},set onEdit(B){v(B),O()},get onCopyLink(){return y()},set onCopyLink(B){y(B),O()},get onDelete(){return P()},set onDelete(B){P(B),O()},$set:_t,$on:(B,Y)=>wt(t,B,Y)},ue=Cg();fn(ue,21,()=>r(A),B=>B.id,(B,Y)=>{var te=bt(),Ee=Be(te);{var we=he=>{const _e=b(()=>G(r(Y).id)),K=b(()=>r(k)[r(Y).id]),ce=b(()=>r(x)===r(Y).id),Me=b(()=>r(ce)?-50:0),Fe=b(()=>r(ce)?Math.max(10,r(K)-20):r(K)-20);var ne=xg();let De;var F=J(ne),H=J(F);{let ie=b(()=>r(x)!==r(Y).id),pe=b(()=>r(M).has(r(Y).id)),ke=b(()=>r(x)===r(Y).id),be=b(()=>r(_)[r(Y).id]||"");xl(H,{get comment(){return r(Y)},get replies(){return r(_e)},get displayMode(){return r(S)},get isCollapsed(){return r(ie)},get orphaned(){return r(pe)},get focused(){return r(ke)},depth:0,offset:0,hasConnectionLine:!1,get replyValue(){return r(be)},onReplyValueChange:L=>{r(_)[r(Y).id]=L},onShow:()=>Q(r(Y).id),onClose:()=>T(x,null),onReply:L=>m()?.(r(Y).id,L),onAccept:()=>p()?.(r(Y).id),onReject:()=>g()?.(r(Y).id),onResolve:()=>f()?.(r(Y).id),onMarkUnread:()=>h()?.(r(Y).id),onEdit:()=>v()?.(r(Y).id),onCopyLink:()=>y()?.(r(Y).id),onDelete:()=>P()?.(r(Y).id),registerReplyInput:L=>r(I)[r(Y).id]=L,get workspace(){return u()}})}Z(F),Z(ne),me(()=>{De=Ft(ne,1,"absolute pointer-events-auto outline-none focus:outline-none bg-background comment-thread-container svelte-8a1he9",null,De,{"w-auto":r(S)==="icon"||r(S)==="compact","w-64":r(S)==="compact","w-68":r(S)==="full","is-focused":r(ce)}),Pn(ne,`--comment-focus-inset: ${-r(Me)}px; top: ${r(Fe)??""}px; right: ${-r(Me)}px; z-index: ${r(ce)?20:10}; transition: right var(--motion-slow) var(--spring-slow-ease), top var(--motion-slow) var(--spring-slow-ease);`),Gt(ne,"data-comment-id",r(Y).id)}),hn("keydown",ne,ie=>{ie.target===ie.currentTarget&&(ie.key==="Enter"||ie.key===" ")&&(ie.preventDefault(),Q(r(Y).id))}),hn("click",ne,ie=>{ie.stopPropagation(),r(x)!==r(Y).id&&Q(r(Y).id)}),En(3,F,()=>In,()=>({axis:"y",tier:"moderate"})),N(he,ne)};ge(Ee,he=>{r(k)[r(Y).id]!==void 0&&he(we)})}N(B,te)}),Z(ue),N(e,ue);var q=Et(U);return s(),q}fr(["keydown","click"]);var Tg=re('<span class="text-ui font-mono font-medium"> </span>'),Sg=re('<div class="px-2.5 py-1.5 text-ui text-subtle"> </div>'),Ag=re('<div class="px-2.5 py-1.5 text-ui text-danger"> </div>'),Ig=re('<span></span> <span class="text-ui font-mono font-medium"> </span> <span class="text-ui text-subtle ml-auto"> </span>',1),Ng=re('<span>·</span> <span class="truncate"> </span>',1),Mg=re("<!> ",1),Rg=re('<div class="flex items-center justify-between gap-2 px-3 py-1.5 border-b border-border shrink-0"><div class="flex items-center gap-1.5 text-ui text-subtle min-w-0"><span class="font-medium text-foreground"> </span> <span>·</span> <span> </span> <!></div> <!></div>'),Og=re('<div class="flex h-full overflow-hidden"><div class="version-list svelte-ha3bfa"><!> <!></div> <div class="flex flex-col flex-1 min-w-0"><!> <div class="flex-1 overflow-auto"><!></div></div></div>');function Wa(e,t){if(new.target)return vt({component:Wa,...e});yt(t,!0);const n=()=>gt(f,"$noteVersionsState",o),[o,s]=jt();let a=R(t,"workspace",7),i=R(t,"noteId",7),l=R(t,"currentContent",7),c=R(t,"visible",7,!0),d=R(t,"onRestore",7);const u=on(a().id);Je(()=>{u.set(a().id),T(h,null)});const f=tu(u),p=b(()=>n()?.versions?[...n().versions].reverse().slice(0,10):[]),g=b(()=>n()?.loading??!1),m=b(()=>n()?.error??null);let h=xe(null);Je(()=>{c()&&a()?.id&&i()&&ye.dispatch(fd(a().id,i()))});const v=b(()=>r(h)===null?l():r(p)[r(h)]?.content||""),y=b(()=>{if(r(h)===null)return r(p)[0]?.content||"";const X=r(h)+1;return X<r(p).length?r(p)[X].content:""}),P=b(()=>r(v));function _(X){return Fa(X)||C.workspace_noteVersionHistory_unknown_label()}function I(X){return X?X.replace(/\n*$/,`
3
3
  `):""}function k(X){if(!X.author)return"bg-zinc-400";switch(X.author.type){case"user":return"bg-blue-500";case"agent":return"bg-violet-500";default:return"bg-zinc-400"}}function M(){if(r(h)===null)return;const X=r(p)[r(h)];X&&d()?.(X.versionId)}var V={get workspace(){return a()},set workspace(X){a(X),O()},get noteId(){return i()},set noteId(X){i(X),O()},get currentContent(){return l()},set currentContent(X){l(X),O()},get visible(){return c()},set visible(X=!0){c(X),O()},get onRestore(){return d()},set onRestore(X){d(X),O()},$set:_t,$on:(X,U)=>wt(t,X,U)},x=Og(),w=J(x),S=J(w);{let X=b(()=>r(h)===null?"selected":"");Ze(S,{variant:"ghost",get class(){return`version-item ${r(X)??""}`},onclick:()=>T(h,null),children:(U,ue)=>{var q=Tg(),B=Re(q,!0);me(Y=>fe(B,Y),[()=>C.workspace_noteVersionHistory_current_label()]),N(U,q)},$$slots:{default:!0}})}var ae=$(S,2);{var z=X=>{var U=Sg(),ue=Re(U,!0);me(q=>fe(ue,q),[()=>C.workspace_noteVersionHistory_loading_label()]),N(X,U)},A=X=>{var U=Ag(),ue=Re(U,!0);me(q=>fe(ue,q),[()=>C.workspace_noteVersionHistory_error_label()]),N(X,U)},G=X=>{var U=bt(),ue=Be(U);fn(ue,19,()=>r(p),q=>q.versionId,(q,B,Y)=>{{let te=b(()=>r(h)===r(Y)?"selected":"");Ze(q,{variant:"ghost",get class(){return`version-item ${r(te)??""}`},onclick:()=>T(h,r(Y),!0),children:(Ee,we)=>{var he=Ig(),_e=Be(he),K=$(_e,2),ce=Re(K),Me=$(K,2),Fe=Re(Me,!0);me((ne,De)=>{Ft(_e,1,`size-[5px] rounded-full shrink-0 ${ne??""}`,"svelte-ha3bfa"),fe(ce,`V${r(B).versionNumber??""}`),fe(Fe,De)},[()=>k(r(B)),()=>_(r(B).createdAt)]),N(Ee,he)},$$slots:{default:!0}})}}),N(X,U)};ge(ae,X=>{r(g)?X(z):r(m)?X(A,1):X(G,-1)})}Z(w);var oe=$(w,2),se=J(oe);{var ve=X=>{var U=Rg(),ue=J(U),q=J(ue),B=Re(q),Y=$(q,4),te=Re(Y,!0),Ee=$(Y,2);{var we=_e=>{var K=Ng(),ce=$(Be(K),2),Me=Re(ce,!0);me(()=>fe(Me,r(p)[r(h)].author?.name)),N(_e,K)};ge(Ee,_e=>{r(p)[r(h)].author?.name&&_e(we)})}Z(ue);var he=$(ue,2);Ze(he,{variant:"ghost-light",size:"xs",onclick:M,children:(_e,K)=>{var ce=Mg(),Me=Be(ce);dt(Me,{get icon(){return Tu},class:"text-ghost",size:"10"});var Fe=$(Me);me(ne=>fe(Fe,` ${ne??""}`),[()=>C.workspace_noteVersionHistory_restore_label()]),N(_e,ce)},$$slots:{default:!0}}),Z(U),me(_e=>{fe(B,`V${r(p)[r(h)].versionNumber??""}`),fe(te,_e)},[()=>_(r(p)[r(h)].createdAt)]),N(X,U)};ge(se,X=>{r(h)!==null&&X(ve)})}var D=$(se,2),Q=J(D);Mo(Q,()=>`${r(h)}`,X=>{{let U=b(()=>I(r(y))),ue=b(()=>I(r(P)));pl(X,{get oldContent(){return r(U)},get newContent(){return r(ue)},fileName:"note.md",viewMode:"unified",showHeader:!1,showStats:!1,showLineNumbers:!0,expandUnchanged:!0})}}),Z(D),Z(oe),Z(x),N(e,x);var le=Et(V);return s(),le}var Lg=re('<div class="flex-1 min-h-0 w-full" data-testid="raw-note-view"><!></div>');function Tl(e,t){if(new.target)return vt({component:Tl,...e});yt(t,!0);const n=()=>gt(f,"$lineWrapping",o),[o,s]=jt();let a=R(t,"workspaceId",7),i=R(t,"noteId",7),l=R(t,"content",7),c=R(t,"rev",7),d=R(t,"editable",7,!0),u=R(t,"isPanelFocused",7,!1);const f=Rp(),p=b(()=>l()??""),g=b(()=>`.workspace/notes/${i()}.md`);function m(){return l()??""}function h(){return a()}function v(){return i()}function y(){return c()}let P=xe(rn(m())),_=m(),I=y(),k=h(),M=v(),V=xe(!1),x=null,w=null,S=null;Je(()=>{const U=r(p),ue=c();r(V)||k===a()&&M===i()&&S?.content===U&&S.rev===ue||(S=null,U!==r(P)&&(T(P,U,!0),_=U,k=a(),M=i()),I=ue)});function ae(){return r(P)}function z(U){if(U===r(P)||(T(P,U,!0),k=a(),M=i(),!d()))return;T(V,!0),x&&clearTimeout(x);const ue=A(U);w=ue,x=setTimeout(()=>{x=null,G(ue),T(V,!1)},1e3)}function A(U=r(P)){return{workspaceId:a(),noteId:i(),content:U,lastSavedContent:_,baseRev:I}}function G(U=A(),ue=!1){w===U&&(w=null),!(!U.workspaceId||!U.noteId||U.content===U.lastSavedContent||!wn.select(ye.state,U.workspaceId,U.noteId))&&(U.workspaceId===a()&&U.noteId===i()&&(_=U.content,S={content:r(p),rev:c()}),ye.dispatch(Wi(U.workspaceId,U.noteId,U.content,{immediate:ue,baseRev:U.baseRev,baseContent:U.lastSavedContent})))}function oe(){if(x&&(clearTimeout(x),x=null),w){G(w,!0);return}k===a()&&M===i()&&G(A(),!0)}gr(()=>{oe()});var se={flushPendingSave:oe,get workspaceId(){return a()},set workspaceId(U){a(U),O()},get noteId(){return i()},set noteId(U){i(U),O()},get content(){return l()},set content(U){l(U),O()},get rev(){return c()},set rev(U){c(U),O()},get editable(){return d()},set editable(U=!0){d(U),O()},get isPanelFocused(){return u()},set isPanelFocused(U=!1){u(U),O()},$set:_t,$on:(U,ue)=>wt(t,U,ue)},ve=Lg(),D=J(ve),Q=ae,le=z;{let U=b(()=>!d());Qp(D,{get value(){return Q()},set value(ue){le(ue)},language:"markdown",get readOnly(){return r(U)},get fileName(){return r(g)},get workspaceId(){return a()},get filePath(){return r(g)},get lineWrapping(){return n()},get isPanelFocused(){return u()}})}Z(ve),N(e,ve);var X=Et(se);return s(),X}var Dg=re('<span class="suggestion-tooltip-author"> </span>'),Pg=re('<div class="suggestion-tooltip-reason"> </div>'),$g=re('<div class="mt-2 py-1 px-2 bg-muted rounded text-xs"><span class="font-semibold mr-1"> </span> <span class="italic"> </span></div>'),ks=re("<!> ",1),Bg=re('<div class="suggestion-tooltip"><div class="flex justify-between items-center mb-2"><span class="font-semibold text-xs"> </span> <!></div> <!> <!> <div class="suggestion-tooltip-actions"><!> <!></div></div>');function Sl(e,t){if(new.target)return vt({component:Sl,...e});yt(t,!0);let n=R(t,"suggestion",7),o=R(t,"x",7,0),s=R(t,"y",7,0),a=R(t,"onAccept",7),i=R(t,"onReject",7);function l(){a()?.(n().id)}function c(){i()?.(n().id)}function d(x){switch(x){case"addition":return C.tiptap_suggestionTooltip_addition_label();case"deletion":return C.tiptap_suggestionTooltip_deletion_label();case"modification":return C.tiptap_suggestionTooltip_modification_label();default:return C.tiptap_suggestionTooltip_suggestion_label()}}var u={get suggestion(){return n()},set suggestion(x){n(x),O()},get x(){return o()},set x(x=0){o(x),O()},get y(){return s()},set y(x=0){s(x),O()},get onAccept(){return a()},set onAccept(x){a(x),O()},get onReject(){return i()},set onReject(x){i(x),O()},$set:_t,$on:(x,w)=>wt(t,x,w)},f=Bg(),p=J(f),g=J(p),m=Re(g,!0),h=$(g,2);{var v=x=>{var w=Dg(),S=Re(w,!0);me(ae=>fe(S,ae),[()=>C.tiptap_suggestionTooltip_byAuthor_label({author:n().author})]),N(x,w)};ge(h,x=>{n().author&&x(v)})}Z(p);var y=$(p,2);{var P=x=>{var w=Pg(),S=Re(w,!0);me(()=>fe(S,n().reason)),N(x,w)};ge(y,x=>{n().reason&&x(P)})}var _=$(y,2);{var I=x=>{var w=$g(),S=J(w),ae=Re(S,!0),z=$(S,2),A=Re(z,!0);Z(w),me(G=>{fe(ae,G),fe(A,n().originalText)},[()=>C.tiptap_suggestionTooltip_original_label()]),N(x,w)};ge(_,x=>{n().originalText&&n().type==="modification"&&x(I)})}var k=$(_,2),M=J(k);Ze(M,{variant:"ghost",class:"accept",onclick:l,children:(x,w)=>{var S=ks(),ae=Be(S);dt(ae,{get icon(){return mr},size:"xs",class:"inline mr-1"});var z=$(ae);me(A=>fe(z,` ${A??""}`),[()=>C.tiptap_suggestionTooltip_accept_label()]),N(x,S)},$$slots:{default:!0}});var V=$(M,2);return Ze(V,{variant:"ghost",class:"reject",onclick:c,children:(x,w)=>{var S=ks(),ae=Be(S);dt(ae,{get icon(){return Su},size:"xs",class:"inline mr-1"});var z=$(ae);me(A=>fe(z,` ${A??""}`),[()=>C.tiptap_suggestionTooltip_reject_label()]),N(x,S)},$$slots:{default:!0}}),Z(k),Z(f),me(x=>{Pn(f,`left: ${o()??""}px; top: ${s()??""}px;`),fe(m,x)},[()=>d(n().type)]),N(e,f),Et(u)}const zg=sn("TaskAgentPollingManager"),Fg=500;class Ug{constructor(){Jt(this,"callbacks",new Map);Jt(this,"intervalId",null);Jt(this,"rafId",null);Jt(this,"isPending",!1)}register(t,n){this.callbacks.set(t,n),this.startIfNeeded()}unregister(t){this.callbacks.delete(t),this.stopIfEmpty()}startIfNeeded(){this.intervalId===null&&this.callbacks.size!==0&&(this.intervalId=setInterval(()=>{this.tick()},Fg))}stopIfEmpty(){this.callbacks.size>0||this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,this.rafId!==null&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.isPending=!1)}tick(){this.isPending||(this.isPending=!0,this.rafId=requestAnimationFrame(()=>{this.isPending=!1,this.rafId=null;const t=Array.from(this.callbacks.values());for(const n of t)try{n()}catch(o){zg.error("Callback error",{error:o})}}))}getRegisteredCount(){return this.callbacks.size}isPolling(){return this.intervalId!==null}}const Cr=new Ug;var Xo=re('<span class="status-text svelte-33ww27"> </span>'),xs=re('<span class="status-text loading-text svelte-33ww27"> </span>'),Hg=re('<div class="status-content svelte-33ww27"><!></div>'),Kg=re('<!> <div class="status-icon svelte-33ww27"><!></div>',1);function Ro(e,t){if(new.target)return vt({component:Ro,...e});yt(t,!0);const n=()=>gt(k,"$serviceAgent$",a),o=()=>gt(M,"$agentIsResponding$",a),s=()=>gt(V,"$agentHasPendingQuestion$",a),[a,i]=jt(),l=sn("TaskAgentStatus"),c=8,d=10,u=1e4,f=14,p=new Map,g=3e4;let m=R(t,"agentId",7),h=R(t,"onViewAgent",7),v=R(t,"compact",7,!1),y=R(t,"indicator",7,!1),P=R(t,"workspaceId",7);const _=Xr()?.workspaceId??void 0;let I=b(()=>P()??_);const k=Vn(m()),M=ca(m()),V=Jp(m());let x=xe(0),w,S,ae=!1,z=0,A=!1;const G=(()=>{const ne=m(),De=p.get(ne);return!!(De&&Date.now()-De<g)})();let oe=G,se=xe(rn(G)),ve=xe(!1),D=xe(null),Q=xe(!1);async function le(){if(!oe){oe=!0;try{const ne=ye.state,De=r(I)?Zr.select(ne,r(I)):void 0;De?(l.debug("[TaskAgentStatus] Attempting to load agent from disk",{agentId:m(),workspaceId:De.id}),await ye.dispatch(qi(De.id,m()))?(T(ve,!0),p.delete(m()),Ur(x)):(l.debug("[TaskAgentStatus] Agent not found on disk",{agentId:m()}),T(se,!0),p.set(m(),Date.now()))):(T(se,!0),p.set(m(),Date.now()))}catch(ne){l.debug("[TaskAgentStatus] Failed to load agent from disk",{agentId:m(),error:ne}),T(se,!0),p.set(m(),Date.now())}}}rr(()=>{l.debug("[TaskAgentStatus] Mounted",{agentId:m()});function ne(){z++;const De=ye.state,F=Vn.select(De,m()),H=r(I)?Vn.select(De,m()):void 0;if(F||H){let ie=!1;r(ve)||(l.debug("[TaskAgentStatus] Agent found",{agentId:m(),hasSession:!!F,hasStoreAgent:!!H,pollCount:z}),T(ve,!0),ie=!0),ca.select(De,m())&&!r(Q)&&(T(Q,!0),ie=!0);const ke=H?.status||F?.status;ke===so.Completed&&!r(D)?(T(D,"complete"),ie=!0):ke===so.Error&&!r(D)&&(T(D,"error"),ie=!0),ie&&Ur(x),r(ve)&&!r(Q)&&r(D)&&A&&(Cr.unregister(m()),A=!1)}else z===c?le():z>=f&&oe&&!r(ve)?(l.debug("[TaskAgentStatus] Stopping poll - agent not found after disk load attempt",{agentId:m(),pollCount:z}),A&&(Cr.unregister(m()),A=!1),T(se,!0)):z%d===0&&l.debug("[TaskAgentStatus] Still polling...",{agentId:m(),pollCount:z})}Cr.register(m(),ne),A=!0,w=setTimeout(()=>{!r(ve)&&A&&(l.warn("[TaskAgentStatus] Polling timeout reached, agent not found",{agentId:m(),pollCount:z}),Cr.unregister(m()),A=!1,T(se,!0))},u)}),Je(()=>{const ne=n(),De=o();if(!r(I)||!ne||ne===S&&De===ae)return;let F=!1;r(ve)||(l.debug("[TaskAgentStatus] Agent found via Redux",{agentId:m()}),T(ve,!0),F=!0),De&&!r(Q)?(T(Q,!0),F=!0):!De&&r(Q)&&(T(Q,!1),F=!0),ne.status===so.Completed&&!r(D)?(T(D,"complete"),F=!0):ne.status===so.Error&&!r(D)&&(T(D,"error"),F=!0),F&&Ur(x),r(ve)&&!r(Q)&&r(D)&&A&&(Cr.unregister(m()),A=!1),S=ne,ae=De}),gr(()=>{A&&(Cr.unregister(m()),A=!1),w&&clearTimeout(w)});const X=b(()=>(r(x),r(I)?n():void 0)),U=b(()=>(r(x),n())),ue=b(()=>r(X)||r(U)),q=b(()=>!r(se));let B=!1;Je(()=>{r(ue)&&!B&&(B=!0,l.debug("[TaskAgentStatus] Agent state available",{agentId:m(),hasStoreAgent:!!r(X),hasServiceAgent:!!r(U),agentStatus:r(X)?.status||r(U)?.status}))});const Y=b(()=>r(X)?.processQueueHint),te=b(()=>np(r(ue),{hasQuestion:s()})),Ee=b(()=>r(ue)?rp(r(te)):r(ve)?C.tiptap_taskAgentStatus_loadingAgent_label():C.tiptap_taskAgentStatus_spinningUp_label()),we=b(()=>`${C.chat_msgAttribution_openAgent_title({name:r(ue)?.name??m()})}: ${r(Ee)}`),he=ne=>{if(ne.preventDefault(),ne.stopPropagation(),l.debug("Task agent status clicked",{agentId:m()}),h())h()();else{const F=ne.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,H=ne.metaKey||ne.ctrlKey;r(I)&&ye.dispatch(Gn(r(I),{agentId:m(),sourcePanelId:F,openInAdjacentPanel:H}))}};var _e={get agentId(){return m()},set agentId(ne){m(ne),O()},get onViewAgent(){return h()},set onViewAgent(ne){h(ne),O()},get compact(){return v()},set compact(ne=!1){v(ne),O()},get indicator(){return y()},set indicator(ne=!1){y(ne),O()},get workspaceId(){return P()},set workspaceId(ne){P(ne),O()},$set:_t,$on:(ne,De)=>wt(t,ne,De)},K=bt(),ce=Be(K);{var Me=ne=>{{let De=b(()=>v()?"compact":""),F=b(()=>y()?"indicator":""),H=b(()=>r(ue)?"":"loading"),ie=b(()=>y()?r(we):void 0),pe=b(()=>y()?r(we):void 0),ke=b(()=>y()||void 0),be=b(()=>r(ue)?r(te):"unknown");Ze(ne,{variant:"ghost",onclick:he,onmousedown:L=>L.preventDefault(),get class(){return`task-agent-status ${r(De)??""} ${r(F)??""} ${r(H)??""}`},type:"button",contenteditable:"false",get"aria-label"(){return r(ie)},get title(){return r(pe)},get"data-task-agent-indicator"(){return r(ke)},get"data-agent-display-status"(){return r(be)},children:(L,Ce)=>{var Se=Kg(),Oe=Be(Se);{var He=et=>{var ze=Hg(),Ke=J(ze);{var ee=Ue=>{var Ye=bt(),ot=Be(Ye);{var ft=Xe=>{var E=Xo(),j=Re(E,!0);me((Ne,nt)=>{Gt(E,"title",Ne),fe(j,nt)},[()=>C.tiptap_taskAgentStatus_waitingMemory_tooltip(),()=>C.tiptap_taskAgentStatus_waitingMemory_label({used:yn(r(Y).used),cap:yn(r(Y).cap)})]),N(Xe,E)},st=Xe=>{var E=Xo(),j=Re(E,!0);me(Ne=>fe(j,Ne),[()=>C.tiptap_taskAgentStatus_waitingSlot_label({used:yn(r(Y).used),cap:yn(r(Y).cap)})]),N(Xe,E)};ge(ot,Xe=>{r(Y).reason==="memory-budget"?Xe(ft):Xe(st,-1)})}N(Ue,Ye)},Ae=Ue=>{var Ye=xs(),ot=Re(Ye,!0);me(ft=>fe(ot,ft),[()=>C.tiptap_taskAgentStatus_spinningUp_label()]),N(Ue,Ye)},Te=Ue=>{var Ye=xs(),ot=Re(Ye,!0);me(ft=>fe(ot,ft),[()=>C.tiptap_taskAgentStatus_loadingAgent_label()]),N(Ue,Ye)},Ie=Ue=>{var Ye=Xo(),ot=Re(Ye,!0);me(()=>fe(ot,r(Ee))),N(Ue,Ye)};ge(Ke,Ue=>{r(Y)?.waiting?Ue(ee):!r(ue)&&!r(ve)?Ue(Ae,1):r(ue)?Ue(Ie,-1):Ue(Te,2)})}Z(ze),N(et,ze)};ge(Oe,et=>{y()||et(He)})}var Ge=$(Oe,2),je=J(Ge);tp(je,{get agentId(){return m()},get state(){return r(te)},size:19}),Z(Ge),N(L,Se)},$$slots:{default:!0}})}};ge(ce,ne=>{r(q)&&ne(Me)})}N(e,K);var Fe=Et(_e);return i(),Fe}function Wg(e){let t=null;const n=new Map;function o(d){const u=d.getAttribute("data-agent-id");if(!u||n.has(u))return;const f=Fi(Ro,{target:d,props:{agentId:u,onViewAgent:()=>e.onViewAgent(u)}});n.set(u,{component:f,container:d})}function s(d){const u=n.get(d);u&&(la(u.component),n.delete(d))}function a(){const d=e.getRootElement();if(!d)return;const u=d.querySelectorAll(".task-agent-status-container[data-agent-id]"),f=new Set;u.forEach(p=>{const g=p.getAttribute("data-agent-id");g&&(f.add(g),n.has(g)||o(p))}),n.forEach((p,g)=>{(!f.has(g)||!document.contains(p.container))&&s(g)})}function i(){t&&(t.disconnect(),t=null)}function l(){const d=e.getRootElement();d&&(i(),a(),t=new MutationObserver(u=>{let f=!1;for(const p of u)if(p.type==="childList"){for(const g of p.addedNodes)if(g instanceof Element&&(g.classList?.contains("task-agent-status-container")||g.querySelector?.(".task-agent-status-container"))){f=!0;break}if(f)break;for(const g of p.removedNodes)if(g instanceof Element&&(g.classList?.contains("task-agent-status-container")||g.querySelector?.(".task-agent-status-container"))){f=!0;break}if(f)break}f&&requestAnimationFrame(a)}),t.observe(d,{childList:!0,subtree:!0}))}function c(){i(),n.forEach(d=>{la(d.component)}),n.clear()}return{start:l,refresh:a,stop:i,destroy:c}}const qg="",Al="agent:";function Ir(e,t){return`${t}${qg}${e}`}function Oo(e){return`${Al}${e}`}function qa(e,t){const n=e.get(t)??0;return e.set(t,n+1),n}function Vg(e){const t=[];return e.state.doc.descendants(n=>{if(n.type.name==="taskItem"){const o=n.textContent.trim();o&&t.push(o)}return!0}),t}function Gg(e){const t=[],n=new Map;return e.state.doc.descendants(o=>{if(o.type.name==="taskItem"){const s=o.textContent.trim();if(s){const a=qa(n,s);o.attrs.delegatedAgentId?t.push(Oo(o.attrs.delegatedAgentId)):t.push(Ir(s,a)),t.push(s)}}return!0}),t}function Yg(e,t,n){if(!e)return Ir(n,0);const o=new Map;let s=Ir(n,0);return e.state.doc.descendants((a,i)=>{if(a.type.name!=="taskItem")return!0;const l=a.textContent.trim();if(!l)return!0;const c=qa(o,l);return i===t?(s=Ir(l,c),!1):!0}),s}function Zg(e,t,n,o,s,a,i){if(o){const c=Oo(o),d=e.findIndex((u,f)=>!i.has(f)&&u.taskKey===c);if(d>=0)return{association:e[d],index:d}}if((a.get(t)??0)<=(s.get(t)??0)){const c=e.findIndex((d,u)=>!i.has(u)&&d.taskKey===n);if(c>=0)return{association:e[c],index:c}}if((s.get(t)??0)!==1||(a.get(t)??0)!==1)return null;const l=e.findIndex((c,d)=>!i.has(d)&&c.taskText===t&&(!c.taskKey||c.taskKey.startsWith(Al)));return l>=0?{association:e[l],index:l}:null}function Xg(e){const t=new Map;return e.state.doc.descendants(n=>{if(n.type.name==="taskItem"){const o=n.textContent.trim();o&&t.set(o,(t.get(o)??0)+1)}return!0}),t}function Qg(e){const t=new Map;return e.forEach(n=>{t.set(n.taskText,(t.get(n.taskText)??0)+1)}),t}function Va(e,t,n){if(n.debug("[restoreTaskAgentAssociations] Starting",{associationCount:t.length}),t.length===0)return;const o=e.state.doc;let s=0;const a=new Map,i=Xg(e),l=Qg(t),c=new Set;o.descendants((d,u)=>{if(d.type.name!=="taskItem")return!0;const f=d.textContent.trim();if(!f)return!0;const p=qa(a,f),g=Ir(f,p),m=Zg(t,f,g,d.attrs.delegatedAgentId??null,i,l,c);if(!m)return!0;c.add(m.index);const{association:h}=m;return d.attrs.delegatedAgentId||(n.debug("[restoreTaskAgentAssociations] Restoring agent association for task",{taskText:f,taskKey:h.taskKey,agentId:h.agentId}),e.chain().command(({tr:v})=>(v.setMeta("external-update",!0),!0)).command(({tr:v,state:y})=>{const P=y.doc.nodeAt(u);return P&&P.type.name==="taskItem"&&v.setNodeMarkup(u,void 0,{...P.attrs,delegatedAgentId:h.agentId}),!0}).run(),s++),!0}),s>0&&n.debug("[restoreTaskAgentAssociations] Restored associations",{restoredCount:s})}function Jg(e,t){if(!e)return 0;let n=0,o=0;return e.state.doc.descendants((s,a)=>{if(s.type.name==="taskItem"){if(a===t)return o=n,!1;n++}return!0}),o}async function jg({editor:e,workspace:t,noteId:n,taskData:o,options:s,parentNoteTitle:a,model:i,debounceUpdate:l,storeDispatch:c,logger:d}){if(Or.select(ye.state,t.id)){d.warn("Cannot assign an agent: agent lifecycle actions are not permitted here",{workspaceId:t.id,noteId:n});return}const u=o.text||C.workspace_taskMenu_unknownTask_label(),f=parseInt(o.position)||0,p=Yg(e,f,u);if(!n){d.error("Cannot graduate task: no noteId available");return}const g=vs.generateAgentId(),m=vs.generateNoteId();let h=g,v=Oo(g);e&&e.chain().command(({tr:M})=>(M.setMeta("external-update",!0),!0)).command(({tr:M,state:V})=>{const x=V.doc.nodeAt(f);return x&&x.type.name==="taskItem"?(M.setNodeMarkup(f,void 0,{...x.attrs,delegatedAgentId:g}),!0):!1}).run()&&d.info("Optimistically set agent ID on task item",{taskPosition:f,agentId:g});const y=Wp(u,n,a),P=new Date().toISOString(),_=Op(u),I={id:m,workspaceId:t.id,title:_,content:y,tags:[],contentType:"task",visibility:"private",taskStatus:"not_started",createdAt:P,updatedAt:P,created_at:P,updated_at:P,is_pinned:!1,is_archived:!1};c(Ja(t.id,I)),d.info("Added optimistic Task Note",{noteId:m,title:u});try{const k=Jg(e,f),M=(k+1)*100;d.info("Graduating checklist item to Task Note",{taskText:u,taskPosition:f,taskIndex:k,peerOrder:M,parentNoteId:n,parentNoteTitle:a,optimisticAgentId:g,optimisticNoteId:m});const V=await So.tasks.createPrerequisite(n,_,{content:y,status:"not_started"});if(!V.success||!V.id)throw e&&e.commands.setTaskAgentId(f,null),c(ja(t.id,m)),new Error(V.error||"Failed to create Task Note");const x=V.id;try{const S=await ye.dispatch(Vi(t.id,{workspaceId:t.id,name:_,agentType:Oa("task-loop"),source:"task-creation",model:i,metadata:{source:"task-creation",agentType:"task-loop",taskNoteId:x,isBackground:!0}},{activateAgent:!1,notifyOnError:!1}));h=String(S.id),v=Oo(h),e&&e.chain().command(({tr:ae})=>(ae.setMeta("external-update",!0),!0)).command(({tr:ae,state:z})=>{let A=!1;return z.doc.descendants((G,oe)=>A?!1:G.type.name==="taskItem"&&G.attrs.delegatedAgentId===g?(ae.setNodeMarkup(oe,void 0,{...G.attrs,delegatedAgentId:h}),A=!0,!1):!0),A}).run(),c(gd(t.id,n,{taskText:u,taskKey:v,agentId:h,noteId:n,createdAt:Date.now()})),d.debug("Persisted task-agent association with daemon-assigned id",{taskText:u,taskKey:v,agentId:h})}catch(S){d.warn("Failed to create agent for new Task Note",{taskNoteId:x,error:S instanceof Error?S.message:String(S)})}const w={...I,id:x};if(c(ja(t.id,m)),c(Ja(t.id,w)),d.info("Task Note created successfully",{taskNoteId:w.id}),e){const S=()=>{let A=-1,G=null;return e.state.doc.descendants((oe,se)=>A>=0?!1:oe.type.name==="taskItem"&&(oe.attrs.delegatedAgentId===h||oe.attrs.delegatedAgentId===g)?(A=se,G=oe,!1):!0),A>=0?{pos:A,node:G}:null},ae=()=>{let A=-1,G=null,oe=0,se=null;const ve=new Map;return e.state.doc.descendants((D,Q)=>{if(A>=0)return!1;if(D.type.name!=="taskItem")return!0;const le=D.textContent.trim();if(!le)return!0;const X=ve.get(le)??0;return ve.set(le,X+1),Ir(le,X)===p?(A=Q,G=D,!1):(le===u&&(oe++,se={pos:Q,node:D}),!0)}),A>=0?{pos:A,node:G}:oe===1?se:null};let z=S();if(!z&&t?.id&&n&&(d.debug("[convertToLinkedTask] Task not found by agentId, restoring associations",{agentId:h}),Va(e,[{taskText:u,taskKey:v,agentId:h,noteId:n,createdAt:Date.now()}],d),z=S()),z||(d.debug("[convertToLinkedTask] Task still not found by agentId, trying by task key/text",{agentId:h,taskKey:v,occurrenceTaskKey:p,taskText:u}),z=ae()),!z)d.warn("[convertToLinkedTask] Task item not found by agentId or text",{agentId:h,noteId:w.id,taskKey:v,taskText:u});else{const A=z;e.chain().command(({tr:oe})=>(oe.setMeta("external-update",!0),!0)).command(({tr:oe,state:se})=>{const{pos:ve,node:D}=A,Q=Co(w.id),le=se.schema.marks.link;if(!le)return d.error("[convertToLinkedTask] Link mark type not found in schema"),!1;const X=le.create({href:Q}),U=se.schema.text("delegated",[X]),ue=se.schema.nodes.paragraph;if(!ue)return d.error("[convertToLinkedTask] Paragraph node type not found in schema"),!1;const q=ue.create(null,U),B=ve+1,Y=ve+D.nodeSize-1;return oe.replaceWith(B,Y,q),!0}).run()?(d.info("Converted checklist item to linked task",{agentId:h,taskNoteId:w.id}),c(es(t.id,n,v)),s?.skipSave||l()):d.warn("Failed to convert checklist item to linked task in editor",{agentId:h,taskNoteId:w.id})}}}catch(k){d.error("Failed to graduate checklist item:",k),e&&e.chain().command(({tr:M})=>(M.setMeta("external-update",!0),!0)).command(({tr:M,state:V})=>{const x=V.doc.nodeAt(f);return x&&x.type.name==="taskItem"?(M.setNodeMarkup(f,void 0,{...x.attrs,delegatedAgentId:null}),!0):!1}).run(),c(es(t.id,n,v))}}async function em(e,t,n,o){return(n==="accept"?e.commands.acceptSuggestion(t):e.commands.rejectSuggestion(t))?(await o(),!0):!1}function tm({workspace:e,noteId:t,taskData:n}){const o=n.text||C.workspace_taskMenu_unknownTask_label(),s=parseInt(n.position)||0,a=n.checked===!0||n.checked==="true",i=[{type:"task",content:o,metadata:{source:"task-menu",noteId:t||"spec",workspaceId:e.id,taskPosition:s,taskChecked:a,anchorName:n.anchorName}},t?{type:"note",content:`Note ID: ${t}`,metadata:{noteId:t,source:"task-menu"}}:{type:"spec",content:"Space specification (note ID 'spec').",metadata:{noteId:"spec",source:"task-menu"}}],l=`Please break down this task into smaller subtasks: "${o}". Read the space specification and analyze the codebase for context, then replace the original task with a breakdown of manageable subtasks.`,c=C.workspace_taskMenu_breakDown_label({task:o}),d=Hi(e.id,{name:c,nameExplicitlySet:!1,initialMessage:l,agentType:Oa("task-breakdown"),contextReferences:i,source:"task-menu",metadata:{source:"task-menu",agentType:"task-breakdown",contextReferences:i}});ye.dispatch(d)}async function nm(e){const t=new FileReader,n=new Promise((o,s)=>{t.onload=()=>o(t.result),t.onerror=s});return t.readAsDataURL(e),await n}async function Il(e){const{file:t,editor:n,workspaceId:o,logger:s}=e;if(!(!n||!o))try{const a=await nm(t),i=await uu("note.saveAsset",{workspaceId:o,data:a,mimeType:t.type,originalName:t.name});n.chain().focus().setImage({src:i.url}).run(),s.info("Image inserted into note",{assetId:i.assetId})}catch(a){const i=a instanceof Error?a.message:String(a);s.error("Failed to upload image",{error:i}),lr.error(C.workspace_noteWithComments_imageUploadFailed_error(),{description:i})}}function rm(e){const{getEditor:t,getWorkspaceId:n,logger:o}=e;return s=>{const a=s.clipboardData?.items;if(a){for(const i of a)if(i.type.startsWith("image/")){s.preventDefault();const l=i.getAsFile();l&&Il({file:l,editor:t(),workspaceId:n(),logger:o});return}}}}function om(e){const{getEditor:t,getWorkspaceId:n,logger:o}=e;return s=>{const a=s.dataTransfer?.files;if(!(!a||a.length===0)){for(const i of a)if(i.type.startsWith("image/")){s.preventDefault(),Il({file:i,editor:t(),workspaceId:n(),logger:o});return}}}}function am(e){if(!e)return null;try{return JSON.parse(e)}catch{return null}}function sm(e){const t=e.querySelectorAll('[popovertarget^="task-menu-"]'),n=[],o=new Set;return t.forEach(s=>{const a=s.getAttribute("popovertarget"),i=s.getAttribute("data-anchor-name");!a||!i||o.has(a)||(o.add(a),n.push({id:a,anchorName:i,taskData:{position:s.getAttribute("data-task-position"),checked:s.getAttribute("data-task-checked")==="true",text:s.getAttribute("data-task-text"),node:am(s.getAttribute("data-task-node"))}}))}),n}function im({getEditor:e,getElement:t}){return n=>{try{const o=n?.detail?.text;if(!o)return;const s=t();if(!s)return;const a=s.querySelectorAll("h1,h2,h3,h4,h5,h6");for(const i of Array.from(a))if(i.textContent?.trim()===o.trim()){i.scrollIntoView({block:"center",behavior:"smooth"});try{const l=e(),c=l?.view?.posAtDOM?.(i,0);typeof c=="number"&&c>=0&&(l?.commands?.focus?.(),l?.commands?.setTextSelection?.({from:c,to:c}))}catch{}break}}catch{}}}function lm({getEditor:e,getElement:t,getNoteId:n,highlightTaskAtPosition:o,logger:s}){return a=>{try{const{noteId:i,taskPosition:l,taskText:c}=a?.detail||{},d=n();if(i&&d!==i)return;const u=e();if(!u?.view){s.warn("[NoteWithComments] Cannot scroll to task - editor not ready");return}if(typeof l=="number"&&l>=0){const f=u.state.doc;if(l<=f.content.size){s.info("[NoteWithComments] Scrolling to task by position",{taskPosition:l}),u.commands.smoothScrollToPos(l,{offset:80,block:"center"}),o(l);return}}if(c){s.info("[NoteWithComments] Searching for task by text",{taskText:c});const f=t();if(!f)return;const p=f.querySelectorAll('[data-type="taskItem"]');for(const g of Array.from(p)){const m=g.textContent?.trim();if(m&&m.includes(c.trim().substring(0,50))){g.scrollIntoView({block:"center",behavior:"smooth"}),g.classList.add("task-highlight-flash"),setTimeout(()=>g.classList.remove("task-highlight-flash"),2e3);return}}}s.warn("[NoteWithComments] Could not find task to scroll to",{taskPosition:l,taskText:c})}catch(i){s.error("[NoteWithComments] Error scrolling to task",i)}}}var Cs=re('<span class="first-line-icon w-(--menu-icon-size)"><!></span> <span> </span>',1),cm=re('<div popover="auto"><!> <!></div>');function Nl(e,t){if(new.target)return vt({component:Nl,...e});yt(t,!0);let n=R(t,"id",7),o=R(t,"anchorName",7,void 0),s=R(t,"onSelectAction",7),a=xe(void 0);function i(p){s()(p),r(a)?.hidePopover()}rr(()=>{const p=g=>{Vt.info("Popover toggled:",g)};return r(a)?.addEventListener("toggle",p),()=>{r(a)?.removeEventListener("toggle",p)}});var l={get id(){return n()},set id(p){n(p),O()},get anchorName(){return o()},set anchorName(p=void 0){o(p),O()},get onSelectAction(){return s()},set onSelectAction(p){s(p),O()},$set:_t,$on:(p,g)=>wt(t,p,g)},c=cm();let d;var u=J(c);Ze(u,{variant:"ghost",wrapContent:!1,class:"task-menu-item h-auto whitespace-normal",onclick:()=>i("assign-agent"),children:(p,g)=>{var m=Cs(),h=Be(m),v=J(h);dt(v,{get icon(){return nl},class:"size-(--menu-icon-size)"}),Z(h);var y=$(h,2),P=Re(y,!0);me(_=>fe(P,_),[()=>C.tiptap_taskMenu_assignToAgent_label()]),N(p,m)},$$slots:{default:!0}});var f=$(u,2);return Ze(f,{variant:"ghost",wrapContent:!1,class:"task-menu-item h-auto whitespace-normal",onclick:()=>i("task-breakdown"),children:(p,g)=>{var m=Cs(),h=Be(m),v=J(h);dt(v,{get icon(){return Au},class:"size-(--menu-icon-size)"}),Z(h);var y=$(h,2),P=Re(y,!0);me(_=>fe(P,_),[()=>C.tiptap_taskMenu_breakIntoSubtasks_label()]),N(p,m)},$$slots:{default:!0}}),Z(c),un(c,p=>T(a,p),()=>r(a)),me(()=>{Gt(c,"id",n()),d=Ft(c,1,"task-menu-popover svelte-dtyp35",null,d,{anchored:o()}),Pn(c,o()?`position-anchor: --${o()};`:"")}),N(e,c),Et(l)}const Ga=sn("TasksWriteService");function _a(e,t,n){ye.dispatch(md(e,t,n)),ye.dispatch(hd(e,t,n))}function dm(e,t){const n=wn.select(ye.state,e,t)?.metadata?.task?.status;return n!==void 0?n:Zi.select(ye.state,e).find(o=>o.id===t)?.status}function um(e,t){const n=wn.select(ye.state,e,t)?.rev;return n!==void 0?n:Zi.select(ye.state,e).find(o=>o.id===t)?.rev}function pm(e,t,n){if(!n.conflict)return!1;const o=n.conflict.current;return o&&typeof o=="object"&&(o.status&&_a(e,t,o.status),typeof o.rev=="number"&&ye.dispatch(bd(e,t,{rev:o.rev}))),Ga.warn("Task mutation conflicted; reloaded the latest version",{noteId:t}),lr.warning(C.tasks_write_conflict_title(),{description:C.tasks_write_conflict_description()}),!0}async function Ml(e,t,n){const o=dm(e,t),s=um(e,t);_a(e,t,n);const a=s!==void 0?await So.tasks.updateNoteStatus(t,n,s):await So.tasks.updateNoteStatus(t,n);if(!a.success){if(pm(e,t,a))return;o!==void 0&&_a(e,t,o),Ga.error("Failed to update task status",a.error),lr.error(C.notes_writeService_updateFailed_error())}}async function fm(e,t,n){const o=await So.tasks.createPrerequisite(e,t,n);if(!o.success){Ga.error("Failed to create prerequisite task",o.error);return}return o.id}var gm=re("<!> ",1),mm=re('<span class="flex items-center gap-2"><!> </span>'),hm=re("<!> <!>",1),bm=re('<!> <span role="status" class="sr-only"> </span>',1),vm=re("<span> </span>");function Rl(e,t){if(new.target)return vt({component:Rl,...e});yt(t,!0);let n=R(t,"workspaceId",7),o=R(t,"noteId",7),s=R(t,"status",7),a=R(t,"readonly",7,!1),i=R(t,"compact",7,!1),l=xe(!1),c=xe(!1);const d=["not_started","waiting","discussion_needed","blocked","in_progress","review_required","complete","cancelled"],u={get not_started(){return C.workspace_taskStatus_notStarted_label()},get waiting(){return C.workspace_taskStatus_waiting_label()},get discussion_needed(){return C.workspace_taskStatus_discussionNeeded_label()},get blocked(){return C.workspace_taskStatus_blocked_label()},get in_progress(){return C.workspace_taskStatus_inProgress_label()},get review_required(){return C.workspace_taskStatus_reviewRequired_label()},get complete(){return C.workspace_taskStatus_complete_label()},get cancelled(){return C.workspace_taskStatus_cancelled_label()}},f={not_started:"bg-gray-400/10 text-gray-400",waiting:"bg-gray-300/10 text-gray-400",discussion_needed:"bg-warning/10 text-warning-ink",blocked:"bg-red-500/10 text-red-600",in_progress:"bg-sky-400/10 text-sky-600",review_required:"bg-blue-500/10 text-blue-600",complete:"bg-emerald-500/10 text-emerald-700/70",cancelled:"bg-gray-600/10 text-gray-500"};let p=b(()=>!a()&&!!n()&&!!o());async function g(_){T(l,!1);const I=d.find(k=>k===_);if(!(!I||I===s()||r(c)||!n()||!o())){T(c,!0);try{await Ml(n(),o(),I)}catch{lr.error(C.notes_writeService_updateFailed_error())}finally{T(c,!1)}}}var m={get workspaceId(){return n()},set workspaceId(_){n(_),O()},get noteId(){return o()},set noteId(_){o(_),O()},get status(){return s()},set status(_){s(_),O()},get readonly(){return a()},set readonly(_=!1){a(_),O()},get compact(){return i()},set compact(_=!1){i(_),O()},$set:_t,$on:(_,I)=>wt(t,_,I)},h=bt(),v=Be(h);{var y=_=>{var I=bm(),k=Be(I);Bt(k,()=>io.Root,(x,w)=>{w(x,{get value(){return s()},get disabled(){return r(c)},onchange:g,get open(){return r(l)},set open(S){T(l,S,!0)},children:(S,ae)=>{var z=hm(),A=Be(z);{let oe=b(()=>C.workspace_taskStatus_change_ariaLabel()),se=b(()=>i()?"py-0.5 gap-1.5":"py-1 gap-2");Bt(A,()=>io.Trigger,(ve,D)=>{D(ve,{variant:"ghost",get"aria-label"(){return r(oe)},get"aria-busy"(){return r(c)},get class(){return`inline-flex items-center cursor-pointer ${r(se)??""}`},children:(Q,le)=>{var X=gm(),U=Be(X);Wr(U,{get status(){return s()},size:12});var ue=$(U);me(()=>fe(ue,` ${u[s()]??""}`)),N(Q,X)},$$slots:{default:!0}})})}var G=$(A,2);Bt(G,()=>io.Content,(oe,se)=>{se(oe,{portal:!0,class:"min-w-48",children:(ve,D)=>{var Q=bt(),le=Be(Q);fn(le,16,()=>d,X=>X,(X,U)=>{var ue=bt(),q=Be(ue);Bt(q,()=>io.Item,(B,Y)=>{Y(B,{get value(){return U},get label(){return u[U]},children:(te,Ee)=>{var we=mm(),he=J(we);Wr(he,{get status(){return U},size:12});var _e=$(he);Z(we),me(()=>fe(_e,` ${u[U]??""}`)),N(te,we)},$$slots:{default:!0}})}),N(X,ue)}),N(ve,Q)},$$slots:{default:!0}})}),N(S,z)},$$slots:{default:!0}})});var M=$(k,2),V=Re(M,!0);me(x=>fe(V,x),[()=>r(c)?C.workspace_taskStatus_updating_label():""]),N(_,I)},P=_=>{var I=vm(),k=Re(I,!0);me(()=>{Ft(I,1,`inline-flex items-center rounded-md font-semibold ${i()?"px-2 py-0.5 text-[0.66rem] ":"px-2 py-1 text-sm "} ${f[s()]??""}`),fe(k,u[s()])}),N(_,I)};ge(v,_=>{r(p)?_(y):_(P,-1)})}return N(e,h),Et(m)}var _m=re('<span class="contents" inert=""><!></span>'),wm=re('<span class="shrink-0 inline-flex items-center"><!></span>'),ym=re("<!> <span> </span> <!>",1);function Nr(e,t){if(new.target)return vt({component:Nr,...e});yt(t,!0);const n=()=>gt(f,"$relatedNote$",o),[o,s]=jt();let a=R(t,"workspaceId",7),i=R(t,"noteId",7),l=R(t,"variant",7,"dependency"),c=R(t,"unmet",7,!1);const d=Io(()=>a()),u=Io(()=>i()),f=wn(d,u);let p=b(()=>n()??null),g=b(()=>r(p)?.title??C.workspace_taskRelationLink_notFound_label({id:i()})),m=b(()=>r(p)?.metadata?.task?.status??null);function h(P){P.stopPropagation(),P.preventDefault(),fl(i(),{workspaceId:a(),openInAdjacentPanel:P.metaKey||P.ctrlKey,sourcePanelId:nf(P.target)})}var v={get workspaceId(){return a()},set workspaceId(P){a(P),O()},get noteId(){return i()},set noteId(P){i(P),O()},get variant(){return l()},set variant(P="dependency"){l(P),O()},get unmet(){return c()},set unmet(P=!1){c(P),O()},$set:_t,$on:(P,_)=>wt(t,P,_)};{let P=b(()=>l()==="conflict"?"bg-transparent text-warning-ink hover:bg-warning/20":c()?"bg-transparent text-subtle hover:bg-muted/80":"bg-transparent text-subtle hover:bg-muted/60");Ze(e,{type:"button",variant:"ghost",onclick:h,get class(){return`inline-flex items-center gap-1.5 h-6 min-w-0 max-w-full rounded px-2 py-0 text-left cursor-pointer transition-colors ${r(P)??""}`},children:(_,I)=>{var k=ym(),M=Be(k);{var V=A=>{dt(A,{get icon(){return Pa},size:"xs",class:"shrink-0"})},x=A=>{var G=_m(),oe=J(G);Mo(oe,()=>r(m),se=>{Wr(se,{get status(){return r(m)},size:14})}),Z(G),N(A,G)};ge(M,A=>{l()==="conflict"?A(V):A(x,-1)})}var w=$(M,2),S=Re(w,!0),ae=$(w,2);{var z=A=>{var G=wm(),oe=J(G);dt(oe,{get icon(){return rl},size:"xs"}),Z(G),me(se=>Gt(G,"title",se),[()=>C.workspace_taskRelationLink_unmet_tooltip()]),N(A,G)};ge(ae,A=>{l()==="dependency"&&c()&&A(z)})}me(()=>{Ft(w,1,`truncate font-medium ${r(p)?"":"italic"}`),fe(S,r(g))}),N(_,k)},$$slots:{default:!0}})}var y=Et(v);return s(),y}var Em=re('<!> <span class="truncate font-medium text-subtle -mt-0.5"> </span>',1),km=re('<div class="flex flex-wrap items-center gap-0.5 min-w-0"><!> <!></div>'),Qo=re('<div class="grid grid-cols-[120px_1fr] items-start min-h-6 min-w-0"><div class="text-subtle pt-0.5"> </div> <div class="flex flex-wrap items-center gap-0.5 min-h-6 min-w-0"></div></div>'),xm=re('<div class="w-full flex justify-center"><div class="w-full max-w-[var(--content-max-width,60rem)] px-[var(--content-gutter-left)] pt-12 mb-6 flex flex-col"><div class="grid grid-cols-[120px_1fr] items-start min-h-6 min-w-0"><div class="text-subtle pt-0.5"> </div> <div class="flex items-center min-h-6 -mt-0.5"><!></div></div> <div class="grid grid-cols-[120px_1fr] items-start min-h-6 min-w-0"><div class="text-subtle pt-0.5"> </div> <div class="flex flex-col gap-0.5 min-h-6 min-w-0 overflow-hidden"><!></div></div> <!> <!> <!></div></div>');function Ol(e,t){if(new.target)return vt({component:Ol,...e});yt(t,!0);const n=()=>gt(P,"$allNotes$",i),o=()=>gt(g,"$workspaceAgents$",i),s=()=>gt(f,"$workspace$",i),a=()=>gt(p,"$hidesAgentLifecycleActions$",i),[i,l]=jt();sn("NoteMetadataBar");let c=R(t,"workspaceId",7),d=R(t,"note",7);const u=Io(()=>c()),f=Zr(u),p=Or(u),g=od(u),m=b(()=>!!d().metadata?.task),h=b(()=>d().metadata?.task),v=b(()=>r(h)?.assignedAgentIds||[]),y=b(()=>d().id===vd),P=nu(u),_=b(()=>r(h)?.dependsOn??[]),I=b(()=>r(h)?.conflictsWith??[]),k=b(()=>new Set(r(h)?.unmetDependsOn??[])),M=b(()=>r(h)?.status==="complete"),V=b(()=>n().filter(Q=>Q.id!==d().id&&Q.metadata?.task?.dependsOn?.includes(d().id)).map(Q=>Q.id).sort()),x=b(()=>{o();const D=ye.state;return[...new Set(r(v))].sort((le,X)=>{const U=Vn.select(D,le),ue=Vn.select(D,X),q=U?.createdAt?new Date(U.createdAt).getTime():1/0,B=ue?.createdAt?new Date(ue.createdAt).getTime():1/0;return q-B})});function w(D){return o(),Vn.select(ye.state,D)?.name||C.workspace_fileChanges_agent_label()}const S=new Set;Je(()=>{const D=s();if(!D)return;const Q=r(v).filter(le=>!o().some(X=>X.id===le)&&!S.has(le));if(Q.length>0){for(const le of Q)S.add(le);for(const le of Q)ye.dispatch(Ki(D.id,le))}});function ae(D,Q){if(ju(D,c(),Q))return;const X=D.target?.closest("[data-panel-id]")?.getAttribute("data-panel-id")??void 0,U=D.metaKey||D.ctrlKey;ye.dispatch(Gn(c(),{agentId:Q,sourcePanelId:X,openInAdjacentPanel:U}))}function z(){a()||ye.dispatch(_d(c(),d().id,d().title||C.workspace_noteCodeChanges_task_label()))}var A={get workspaceId(){return c()},set workspaceId(D){c(D),O()},get note(){return d()},set note(D){d(D),O()},$set:_t,$on:(D,Q)=>wt(t,D,Q)},G=bt(),oe=Be(G);{var se=D=>{var Q=xm(),le=J(Q),X=J(le),U=J(X),ue=Re(U,!0),q=$(U,2),B=J(q);Rl(B,{get workspaceId(){return c()},get noteId(){return d().id},get status(){return r(h).status},compact:!0}),Z(q),Z(X);var Y=$(X,2),te=J(Y),Ee=Re(te,!0),we=$(te,2),he=J(we);{var _e=H=>{var ie=bt(),pe=Be(ie);{var ke=be=>{{let L=b(()=>C.workspace_noteMetadataBar_runAgent_tooltip());Ze(be,{variant:"ghost",size:"icon-compact",iconOnly:!0,onclick:z,class:"size-6 rounded text-muted-foreground hover:text-muted-foreground transition-colors cursor-pointer",get title(){return r(L)},children:(Ce,Se)=>{dt(Ce,{get icon(){return Mr},class:"text-xs"})},$$slots:{default:!0}})}};ge(pe,be=>{a()||be(ke)})}N(H,ie)},K=H=>{var ie=km(),pe=J(ie);fn(pe,16,()=>r(x),L=>L,(L,Ce)=>{Ze(L,{variant:"ghost",onclick:Se=>ae(Se,Ce),class:"inline-flex items-center gap-1 h-6 min-w-0 py-0 pl-0.5 pr-2 rounded bg-transparent cursor-pointer",children:(Se,Oe)=>{var He=Em(),Ge=Be(He);dr(Ge,{size:22,get agentId(){return Ce}});var je=$(Ge,2),et=Re(je,!0);me(ze=>fe(et,ze),[()=>w(Ce)]),N(Se,He)},$$slots:{default:!0}})});var ke=$(pe,2);{var be=L=>{{let Ce=b(()=>C.workspace_noteMetadataBar_runAgent_tooltip());Ze(L,{variant:"ghost",size:"icon-compact",iconOnly:!0,onclick:z,class:"size-6 rounded text-muted-foreground hover:text-muted-foreground transition-colors cursor-pointer",get title(){return r(Ce)},children:(Se,Oe)=>{dt(Se,{get icon(){return Mr},class:"text-xs"})},$$slots:{default:!0}})}};ge(ke,L=>{a()||L(be)})}Z(ie),N(H,ie)};ge(he,H=>{r(x).length===0?H(_e):H(K,-1)})}Z(we),Z(Y);var ce=$(Y,2);{var Me=H=>{var ie=Qo(),pe=J(ie),ke=Re(pe,!0),be=$(pe,2);fn(be,20,()=>r(_),L=>L,(L,Ce)=>{{let Se=b(()=>!r(M)&&r(k).has(Ce));Nr(L,{get workspaceId(){return c()},get noteId(){return Ce},get unmet(){return r(Se)}})}}),Z(be),Z(ie),me(L=>fe(ke,L),[()=>C.workspace_noteMetadataBar_dependsOn_label()]),N(H,ie)};ge(ce,H=>{r(_).length>0&&H(Me)})}var Fe=$(ce,2);{var ne=H=>{var ie=Qo(),pe=J(ie),ke=Re(pe,!0),be=$(pe,2);fn(be,20,()=>r(V),L=>L,(L,Ce)=>{Nr(L,{get workspaceId(){return c()},get noteId(){return Ce}})}),Z(be),Z(ie),me(L=>fe(ke,L),[()=>C.workspace_noteMetadataBar_dependedOnBy_label()]),N(H,ie)};ge(Fe,H=>{r(V).length>0&&H(ne)})}var De=$(Fe,2);{var F=H=>{var ie=Qo(),pe=J(ie),ke=Re(pe,!0),be=$(pe,2);fn(be,20,()=>r(I),L=>L,(L,Ce)=>{Nr(L,{get workspaceId(){return c()},get noteId(){return Ce},variant:"conflict"})}),Z(be),Z(ie),me(L=>fe(ke,L),[()=>C.workspace_noteMetadataBar_conflictsWith_label()]),N(H,ie)};ge(De,H=>{r(I).length>0&&H(F)})}Z(le),Z(Q),me((H,ie)=>{fe(ue,H),fe(Ee,ie)},[()=>C.workspace_noteMetadataBar_status_label(),()=>C.workspace_noteMetadataBar_assignee_label()]),N(D,Q)};ge(oe,D=>{!r(y)&&r(m)&&r(h)&&D(se)})}N(e,G);var ve=Et(A);return l(),ve}var Cm=re('<div class="flex items-center gap-2.5"><span class="text-sm font-medium text-foreground"><!></span> <!></div> <!>',1),Tm=re('<span class="flex-1 text-xs text-subtle truncate hidden sm:inline"> </span>'),Sm=re('<!> <div class="flex-1 min-w-0 flex items-baseline gap-2"><span class="text-sm truncate text-foreground"> </span> <!></div> <!>',1),Am=re('<div class="px-4 py-2 border-t border-border"><span class="text-xs text-subtle"> </span></div>'),Im=re('<div class="border-t border-border"><div class="divide-y divide-border"></div> <!> <div class="px-4 pt-0.5 pb-1 bg-muted/30"><!></div></div>'),Nm=re('<div class="w-full flex justify-center"><div class="w-full max-w-[var(--content-max-width,60rem)] px-14 pb-4"><div class="rounded-lg border border-border overflow-hidden"><!> <!></div></div></div>');function Ll(e,t){if(new.target)return vt({component:Ll,...e});yt(t,!0);const n=()=>gt(d,"$ftChanges$",o),[o,s]=jt(),a=sn("NoteCodeChangesCard");let i=R(t,"workspaceId",7),l=R(t,"note",7);const c=Io(()=>i()),d=ad(c);let u=xe(!1),f=xe(!1),p=xe(rn([]));const g=b(()=>l().metadata?.task?.assignedAgentIds||[]),m=b(()=>r(g).length>0),h=b(()=>r(p).length),v=b(()=>r(p).reduce((D,Q)=>D+Q.additions,0)),y=b(()=>r(p).reduce((D,Q)=>D+Q.deletions,0)),P=b(()=>r(h)>0),_=5,I=b(()=>r(u)?r(p):r(p).slice(0,_)),k=b(()=>r(p).length>_);async function M(){if(!r(m)){T(p,[],!0);return}T(f,!0);try{const D=[],Q=Zr.select(ye.state,i());for(const X of r(g))try{let U=Vn.select(ye.state,X);!U&&Q&&(U=await ye.dispatch(qi(Q.id,X))),U?.messages&&D.push(...U.messages)}catch(U){a.error("Error loading agent messages",{agentId:X,error:U})}const le=of(D);T(p,le.changes,!0)}catch(D){a.error("Error loading changes",D),T(p,[],!0)}finally{T(f,!1)}}let V=[];Je(()=>{const D=r(g);(D.length!==V.length||D.some((le,X)=>le!==V[X]))&&(V=[...D],An(()=>{D.length>0?M():T(p,[],!0)}))});function x(D){return D.split("/").pop()||D}function w(D){const Q=D.split("/");return Q.pop(),Q.join("/")}function S(D){return n().find(Q=>(Q.relativePath===D||Q.file===D)&&(Q.stage==="staged"||Q.stage==="unstaged"))??null}function ae(D){const Q=S(D.filePath),le=Q||{id:`chat-change-${D.filePath}`,file:D.filePath,relativePath:D.filePath,status:"modified",stage:rf.Unstaged,stats:{additions:D.additions,deletions:D.deletions},attribution:{manual:!0,timestamp:Date.now()},content:D.oldContent||D.newContent?{oldContent:D.oldContent,newContent:D.newContent}:void 0};ye.dispatch(Ed(i(),le,{changeId:Q?.id||`chat-change-${D.filePath}`,filePath:D.filePath}))}function z(){ye.dispatch(kd(i(),r(p),C.workspace_noteCodeChanges_changesFrom_label({title:l().title||C.workspace_noteCodeChanges_task_label()}),{isAggregate:!0,scopeId:l().id}))}Je(()=>{const D=i();if(!(!D||!r(m)))return ye.dispatch(wd(D,"files")),()=>ye.dispatch(yd(D,"files"))});var A={get workspaceId(){return i()},set workspaceId(D){i(D),O()},get note(){return l()},set note(D){l(D),O()},$set:_t,$on:(D,Q)=>wt(t,D,Q)},G=bt(),oe=Be(G);{var se=D=>{var Q=Nm(),le=J(Q),X=J(le),U=J(X);Ze(U,{variant:"ghost",onclick:()=>T(u,!r(u)),class:"w-full flex items-center justify-between px-4 py-2.5 transition-colors cursor-pointer",children:(B,Y)=>{var te=Cm(),Ee=Be(te),we=J(Ee),he=J(we);{var _e=ne=>{var De=Kt();me(F=>fe(De,F),[()=>C.workspace_noteCodeChanges_loading_label()]),N(ne,De)},K=ne=>{var De=Kt();me(F=>fe(De,F),[()=>r(h)===1?C.workspace_noteCodeChanges_filesChanged_one():C.workspace_noteCodeChanges_filesChanged_many({count:yn(r(h))})]),N(ne,De)};ge(he,ne=>{r(f)?ne(_e):ne(K,-1)})}Z(we);var ce=$(we,2);{var Me=ne=>{ws(ne,{get additions(){return r(v)},get deletions(){return r(y)},size:"xs"})};ge(ce,ne=>{!r(f)&&r(P)&&ne(Me)})}Z(Ee);var Fe=$(Ee,2);{let ne=b(()=>r(u)?ol:Iu);dt(Fe,{get icon(){return r(ne)},class:"text-subtle",size:"xs"})}N(B,te)},$$slots:{default:!0}});var ue=$(U,2);{var q=B=>{var Y=Im(),te=J(Y);fn(te,21,()=>r(I),K=>K.filePath,(K,ce)=>{Ze(K,{variant:"ghost",onclick:()=>ae(r(ce)),class:"w-full flex items-center gap-3 px-4 py-2 transition-colors cursor-pointer text-left group",children:(Me,Fe)=>{var ne=Sm(),De=Be(ne);dt(De,{get icon(){return Nu},class:"text-ghost shrink-0",size:"xs"});var F=$(De,2),H=J(F),ie=Re(H,!0),pe=$(H,2);{var ke=Ce=>{var Se=Tm(),Oe=Re(Se,!0);me(He=>fe(Oe,He),[()=>w(r(ce).filePath)]),N(Ce,Se)},be=b(()=>w(r(ce).filePath));ge(pe,Ce=>{r(be)&&Ce(ke)})}Z(F);var L=$(F,2);ws(L,{get additions(){return r(ce).additions},get deletions(){return r(ce).deletions},size:"xs"}),me(Ce=>fe(ie,Ce),[()=>x(r(ce).filePath)]),N(Me,ne)},$$slots:{default:!0}})}),Z(te);var Ee=$(te,2);{var we=K=>{var ce=Am(),Me=J(ce),Fe=Re(Me,!0);Z(ce),me(ne=>fe(Fe,ne),[()=>C.workspace_noteCodeChanges_moreFiles_label({count:yn(r(p).length-_)})]),N(K,ce)};ge(Ee,K=>{r(k)&&!r(u)&&K(we)})}var he=$(Ee,2),_e=J(he);Ze(_e,{variant:"ghost",onclick:z,class:"text-xs text-subtle transition-colors cursor-pointer",children:(K,ce)=>{Zt();var Me=Kt();me(Fe=>fe(Me,Fe),[()=>C.workspace_noteCodeChanges_viewAll_label()]),N(K,Me)},$$slots:{default:!0}}),Z(he),Z(Y),En(3,Y,()=>In,()=>({tier:"moderate"})),N(B,Y)};ge(ue,B=>{r(u)&&r(P)&&B(q)})}Z(X),Z(le),Z(Q),En(3,le,()=>In,()=>({tier:"moderate"})),N(D,Q)};ge(oe,D=>{r(m)&&(r(P)||r(f))&&D(se)})}N(e,G);var ve=Et(A);return s(),ve}const Mm=new xn("commentDecorations");function Jo(e,t){const n=[],o=va(e),s=new Map;return t.forEach(a=>{const i="threadId"in a&&a.threadId?a.threadId:a.id;"parentId"in a&&a.parentId||s.set(i,a)}),o.forEach(a=>{const i=t.find(u=>u.id===a);if(!i)return;const l="threadId"in i&&i.threadId?i.threadId:i.id;if((s.get(l)||i).status==="resolved"||"parentId"in i&&i.parentId)return;const d=Hr(e,a);if(d.start!==void 0&&d.end!==void 0){const u=Nn.inline(d.start,d.end,{nodeName:"span",class:Rm(i),"data-comment-id":a,"data-comment-status":i.status,"data-comment-type":i.type},{inclusiveStart:!1,inclusiveEnd:!1});n.push(u)}else if(d.point!==void 0){const u=Nn.widget(d.point,()=>{const f=document.createElement("span");return f.className="comment-point-marker",f.setAttribute("data-comment-id",a),f.innerHTML=`<svg width="16" height="16" viewBox="0 0 16 16" fill="currentColor">
4
4
  <circle cx="8" cy="8" r="3"/>
5
5
  </svg>`,f},{side:1,key:`comment-point-${a}`});n.push(u)}}),mn.create(e,n)}function Rm(e){const t=["comment-highlight"];return t.push(`comment-${e.status}`),t.push(`comment-type-${e.type}`),e.authorType&&t.push(`comment-author-${e.authorType}`),t.join(" ")}function Om(e){let t=[],n=0;const o=100,s=()=>{const a=Date.now();return a-n>o&&(t=e.getComments(),n=a),t};return new $n({key:Mm,state:{init(a,i){return t=e.getComments(),n=Date.now(),Jo(i.doc,t)},apply(a,i,l,c){return a.getMeta("commentsChanged")?(t=e.getComments(),n=Date.now(),Jo(c.doc,t)):a.docChanged?Jo(c.doc,s()):i.map(a.mapping,c.doc)}},props:{decorations(a){return this.getState(a)},handleClick(a,i,l){if(!e.onCommentClick)return!1;const d=l.target.closest("[data-comment-id]");if(d){const u=d.getAttribute("data-comment-id");if(u)return e.onCommentClick(u),!0}return!1}}})}function Dl(e){const t=e.state.tr.setMeta("commentsChanged",!0);e.dispatch(t)}function Lm(){return typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function Ts(){return Lm()}function Ss(e){const t=e.anchor?.pointId??e.anchor?.startId??e.anchor?.endId;if(!t)return e.id;const n=t.lastIndexOf(":");return n>0?t.slice(0,n):t}function Pl(e){return/\s/.test(e)||e==="*"||e==="_"||e==="`"||e==="~"||e==="["||e==="]"||e==="@"}const Dm=/<!--[\s\S]*?-->/g,Pm=/\]\([^)]*\)/g,$m=/^[ \t]*(?:#{1,6}[ \t]+|>[ \t]+|[-*+][ \t]+\[[ xX]\][ \t]+|[-*+][ \t]+|\d+[.)][ \t]+)/,Bm=4;function zm(e){let t=e,n;do n=t,t=t.replace(Dm,"");while(t!==n);const s=t.replace(Pm,"]").split(`
@@ -1,4 +1,4 @@
1
- import{g as st}from"./CjK0D9QS.js";import{g as it}from"./D6XmzNBT.js";import{s as at}from"./Cou180Vm.js";import{f,bC as we,aO as F,aS as nt,bZ as rt,cx as Ve,c3 as Ae,c7 as ut,aL as lt,c6 as ct,aK as ot,c9 as ht,aP as dt,a4 as I,a0 as pt,aQ as At,c2 as ft,bR as U}from"./CobcHKt3.js";import{c as gt}from"./DMAAeEjh.js";import{aI as mt}from"./DOzFltDq.js";var Pe=(function(){var s=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],ge=[1,34],b=[1,45],me=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],ee=[1,58],te=[1,59],se=[1,60],ie=[1,61],ae=[1,62],_e=[1,63],Se=[1,64],_=[1,8,9,41],Me=[1,77],R=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],re=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],ue=[1,103],Y=[1,121],Q=[1,117],W=[1,113],j=[1,119],X=[1,114],q=[1,115],H=[1,116],J=[1,118],Z=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],le=[12,39],Ne=[1,8,9,39,41,44,46],ce=[1,8,9,22],ze=[1,153],Ke=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,$){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se}),{39:[1,65]},s(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(R,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(R,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(re,[2,83],{66:94,68:ee,69:te,70:se,71:ie,72:ae}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ue},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:Q,59:110,60:W,82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},{60:[1,122]},{13:Me,55:123},s(_,[2,72]),s(_,[2,138]),{22:Y,50:Q,59:124,60:W,61:[1,125],82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(R,[2,16]),s(R,[2,17]),s(R,[2,18]),{11:127,12:Ue,39:[2,36]},s(le,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(le,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(ce,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(re,[2,82],{66:136,68:ee,69:te,70:se,71:ie,72:ae}),s(re,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(_,[2,48],{39:[1,142]}),{41:[1,143]},s(_,[2,50]),{41:[2,61],45:144,51:ue},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ke,[2,107],{85:154,22:Y,50:Q,60:W,82:j,86:X,87:q,88:H,89:J,90:Z}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(_,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(R,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(le,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(ce,[2,69]),s(ce,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(re,[2,80]),s(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ue},s(_,[2,49]),{41:[2,62]},s(_,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:Q,60:W,82:j,84:169,85:112,86:X,87:q,88:H,89:J,90:Z},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(le,[2,11]),s(ce,[2,70]),s(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ue},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ke,[2,108],{85:154,22:Y,50:Q,60:W,82:j,86:X,87:q,88:H,89:J,90:Z}),s(Ne,[2,8]),s(_,[2,51]),{41:[1,175]},s(_,[2,54]),s(A,[2,104]),s(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],$=this.table,t="",he=0,Ye=0,Ze=2,Qe=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(tt,"popStack");function We(){var S;return S=l.pop()||D.lex()||Qe,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,P,L,Ie,G={},de,v,je,pe;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((B===null||typeof B>"u")&&(B=We()),L=$[P]&&$[P][B]),typeof L>"u"||!L.length||!L[0]){var Oe="";pe=[];for(de in $[P])this.terminals_[de]&&de>Ze&&pe.push("'"+this.terminals_[de]+"'");D.showPosition?Oe="Parse error on line "+(he+1)+`:
1
+ import{g as st}from"./jsY6ocH0.js";import{g as it}from"./CSJ0J5sC.js";import{s as at}from"./DbD4A30t.js";import{f,bC as we,aO as F,aS as nt,bZ as rt,cx as Ve,c3 as Ae,c7 as ut,aL as lt,c6 as ct,aK as ot,c9 as ht,aP as dt,a4 as I,a0 as pt,aQ as At,c2 as ft,bR as U}from"./LhLTjc8B.js";import{c as gt}from"./wk8l4Vfb.js";import{aI as mt}from"./86pQg5ba.js";var Pe=(function(){var s=f(function(O,o,h,p){for(h=h||{},p=O.length;p--;h[O[p]]=o);return h},"o"),i=[1,18],a=[1,19],n=[1,20],r=[1,41],c=[1,26],u=[1,42],d=[1,24],m=[1,25],g=[1,32],N=[1,33],ge=[1,34],b=[1,45],me=[1,35],Ce=[1,36],be=[1,37],ke=[1,38],Ee=[1,27],Te=[1,28],ye=[1,29],De=[1,30],Fe=[1,31],k=[1,44],E=[1,46],T=[1,43],y=[1,47],Be=[1,9],A=[1,8,9],ee=[1,58],te=[1,59],se=[1,60],ie=[1,61],ae=[1,62],_e=[1,63],Se=[1,64],_=[1,8,9,41],Me=[1,77],R=[1,8,9,12,13,22,39,41,44,46,68,69,70,71,72,73,74,79,81],ne=[1,8,9,12,13,18,20,22,39,41,44,46,47,60,68,69,70,71,72,73,74,79,81,86,100,102,103],re=[13,60,86,100,102,103],K=[13,60,73,74,86,100,102,103],Re=[13,60,68,69,70,71,72,86,100,102,103],ue=[1,103],Y=[1,121],Q=[1,117],W=[1,113],j=[1,119],X=[1,114],q=[1,115],H=[1,116],J=[1,118],Z=[1,120],Ge=[22,50,60,61,82,86,87,88,89,90],Ue=[1,128],le=[12,39],Ne=[1,8,9,39,41,44,46],ce=[1,8,9,22],ze=[1,153],Ke=[1,8,9,61],x=[1,8,9,22,50,60,61,82,86,87,88,89,90],Le={trace:f(function(){},"trace"),yy:{},symbols_:{error:2,start:3,mermaidDoc:4,statements:5,graphConfig:6,CLASS_DIAGRAM:7,NEWLINE:8,EOF:9,statement:10,classLabel:11,SQS:12,STR:13,SQE:14,namespaceName:15,alphaNumToken:16,classLiteralName:17,DOT:18,className:19,GENERICTYPE:20,relationStatement:21,LABEL:22,namespaceStatement:23,classStatement:24,memberStatement:25,annotationStatement:26,clickStatement:27,styleStatement:28,cssClassStatement:29,noteStatement:30,classDefStatement:31,direction:32,acc_title:33,acc_title_value:34,acc_descr:35,acc_descr_value:36,acc_descr_multiline_value:37,namespaceIdentifier:38,STRUCT_START:39,classStatements:40,STRUCT_STOP:41,NAMESPACE:42,classIdentifier:43,STYLE_SEPARATOR:44,members:45,ANNOTATION_START:46,ANNOTATION_END:47,CLASS:48,emptyBody:49,SPACE:50,MEMBER:51,SEPARATOR:52,relation:53,NOTE_FOR:54,noteText:55,NOTE:56,CLASSDEF:57,classList:58,stylesOpt:59,ALPHA:60,COMMA:61,direction_tb:62,direction_bt:63,direction_rl:64,direction_lr:65,relationType:66,lineType:67,AGGREGATION:68,EXTENSION:69,COMPOSITION:70,DEPENDENCY:71,LOLLIPOP:72,LINE:73,DOTTED_LINE:74,CALLBACK:75,LINK:76,LINK_TARGET:77,CLICK:78,CALLBACK_NAME:79,CALLBACK_ARGS:80,HREF:81,STYLE:82,CSSCLASS:83,style:84,styleComponent:85,NUM:86,COLON:87,UNIT:88,BRKT:89,PCT:90,commentToken:91,textToken:92,graphCodeTokens:93,textNoTagsToken:94,TAGSTART:95,TAGEND:96,"==":97,"--":98,DEFAULT:99,MINUS:100,keywords:101,UNICODE_TEXT:102,BQUOTE_STR:103,$accept:0,$end:1},terminals_:{2:"error",7:"CLASS_DIAGRAM",8:"NEWLINE",9:"EOF",12:"SQS",13:"STR",14:"SQE",18:"DOT",20:"GENERICTYPE",22:"LABEL",33:"acc_title",34:"acc_title_value",35:"acc_descr",36:"acc_descr_value",37:"acc_descr_multiline_value",39:"STRUCT_START",41:"STRUCT_STOP",42:"NAMESPACE",44:"STYLE_SEPARATOR",46:"ANNOTATION_START",47:"ANNOTATION_END",48:"CLASS",50:"SPACE",51:"MEMBER",52:"SEPARATOR",54:"NOTE_FOR",56:"NOTE",57:"CLASSDEF",60:"ALPHA",61:"COMMA",62:"direction_tb",63:"direction_bt",64:"direction_rl",65:"direction_lr",68:"AGGREGATION",69:"EXTENSION",70:"COMPOSITION",71:"DEPENDENCY",72:"LOLLIPOP",73:"LINE",74:"DOTTED_LINE",75:"CALLBACK",76:"LINK",77:"LINK_TARGET",78:"CLICK",79:"CALLBACK_NAME",80:"CALLBACK_ARGS",81:"HREF",82:"STYLE",83:"CSSCLASS",86:"NUM",87:"COLON",88:"UNIT",89:"BRKT",90:"PCT",93:"graphCodeTokens",95:"TAGSTART",96:"TAGEND",97:"==",98:"--",99:"DEFAULT",100:"MINUS",101:"keywords",102:"UNICODE_TEXT",103:"BQUOTE_STR"},productions_:[0,[3,1],[3,1],[4,1],[6,4],[5,1],[5,2],[5,3],[11,3],[15,1],[15,1],[15,3],[15,2],[19,1],[19,3],[19,1],[19,2],[19,2],[19,2],[10,1],[10,2],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,1],[10,2],[10,2],[10,1],[23,4],[23,5],[38,2],[38,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[40,1],[40,2],[40,3],[24,1],[24,3],[24,4],[24,3],[24,6],[24,4],[24,7],[24,6],[43,2],[43,3],[49,0],[49,2],[49,2],[26,4],[45,1],[45,2],[25,1],[25,2],[25,1],[25,1],[21,3],[21,4],[21,4],[21,5],[30,3],[30,2],[31,3],[58,1],[58,3],[32,1],[32,1],[32,1],[32,1],[53,3],[53,2],[53,2],[53,1],[66,1],[66,1],[66,1],[66,1],[66,1],[67,1],[67,1],[27,3],[27,4],[27,3],[27,4],[27,4],[27,5],[27,3],[27,4],[27,4],[27,5],[27,4],[27,5],[27,5],[27,6],[28,3],[29,3],[59,1],[59,3],[84,1],[84,2],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[85,1],[91,1],[91,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[92,1],[94,1],[94,1],[94,1],[94,1],[16,1],[16,1],[16,1],[16,1],[17,1],[55,1]],performAction:f(function(o,h,p,l,C,e,$){var t=e.length-1;switch(C){case 8:this.$=e[t-1];break;case 9:case 10:case 13:case 15:this.$=e[t];break;case 11:case 14:this.$=e[t-2]+"."+e[t];break;case 12:case 16:this.$=e[t-1]+e[t];break;case 17:case 18:this.$=e[t-1]+"~"+e[t]+"~";break;case 19:l.addRelation(e[t]);break;case 20:e[t-1].title=l.cleanupLabel(e[t]),l.addRelation(e[t-1]);break;case 31:this.$=e[t].trim(),l.setAccTitle(this.$);break;case 32:case 33:this.$=e[t].trim(),l.setAccDescription(this.$);break;case 34:l.addClassesToNamespace(e[t-3],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 35:l.addClassesToNamespace(e[t-4],e[t-1][0],e[t-1][1]),l.popNamespace();break;case 36:this.$=l.addNamespace(e[t]);break;case 37:this.$=l.addNamespace(e[t-1],e[t]);break;case 38:this.$=[[e[t]],[]];break;case 39:this.$=[[e[t-1]],[]];break;case 40:e[t][0].unshift(e[t-2]),this.$=e[t];break;case 41:this.$=[[],[e[t]]];break;case 42:this.$=[[],[e[t-1]]];break;case 43:e[t][1].unshift(e[t-2]),this.$=e[t];break;case 44:case 45:this.$=[[],[]];break;case 46:this.$=e[t];break;case 48:l.setCssClass(e[t-2],e[t]);break;case 49:l.addMembers(e[t-3],e[t-1]);break;case 51:l.setCssClass(e[t-5],e[t-3]),l.addMembers(e[t-5],e[t-1]);break;case 52:l.addAnnotation(e[t-3],e[t-1]);break;case 53:l.addAnnotation(e[t-6],e[t-4]),l.addMembers(e[t-6],e[t-1]);break;case 54:l.addAnnotation(e[t-5],e[t-3]);break;case 55:this.$=e[t],l.addClass(e[t]);break;case 56:this.$=e[t-1],l.addClass(e[t-1]),l.setClassLabel(e[t-1],e[t]);break;case 60:l.addAnnotation(e[t],e[t-2]);break;case 61:case 74:this.$=[e[t]];break;case 62:e[t].push(e[t-1]),this.$=e[t];break;case 63:break;case 64:l.addMember(e[t-1],l.cleanupLabel(e[t]));break;case 65:break;case 66:break;case 67:this.$={id1:e[t-2],id2:e[t],relation:e[t-1],relationTitle1:"none",relationTitle2:"none"};break;case 68:this.$={id1:e[t-3],id2:e[t],relation:e[t-1],relationTitle1:e[t-2],relationTitle2:"none"};break;case 69:this.$={id1:e[t-3],id2:e[t],relation:e[t-2],relationTitle1:"none",relationTitle2:e[t-1]};break;case 70:this.$={id1:e[t-4],id2:e[t],relation:e[t-2],relationTitle1:e[t-3],relationTitle2:e[t-1]};break;case 71:this.$=l.addNote(e[t],e[t-1]);break;case 72:this.$=l.addNote(e[t]);break;case 73:this.$=e[t-2],l.defineClass(e[t-1],e[t]);break;case 75:this.$=e[t-2].concat([e[t]]);break;case 76:l.setDirection("TB");break;case 77:l.setDirection("BT");break;case 78:l.setDirection("RL");break;case 79:l.setDirection("LR");break;case 80:this.$={type1:e[t-2],type2:e[t],lineType:e[t-1]};break;case 81:this.$={type1:"none",type2:e[t],lineType:e[t-1]};break;case 82:this.$={type1:e[t-1],type2:"none",lineType:e[t]};break;case 83:this.$={type1:"none",type2:"none",lineType:e[t]};break;case 84:this.$=l.relationType.AGGREGATION;break;case 85:this.$=l.relationType.EXTENSION;break;case 86:this.$=l.relationType.COMPOSITION;break;case 87:this.$=l.relationType.DEPENDENCY;break;case 88:this.$=l.relationType.LOLLIPOP;break;case 89:this.$=l.lineType.LINE;break;case 90:this.$=l.lineType.DOTTED_LINE;break;case 91:case 97:this.$=e[t-2],l.setClickEvent(e[t-1],e[t]);break;case 92:case 98:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 93:this.$=e[t-2],l.setLink(e[t-1],e[t]);break;case 94:this.$=e[t-3],l.setLink(e[t-2],e[t-1],e[t]);break;case 95:this.$=e[t-3],l.setLink(e[t-2],e[t-1]),l.setTooltip(e[t-2],e[t]);break;case 96:this.$=e[t-4],l.setLink(e[t-3],e[t-2],e[t]),l.setTooltip(e[t-3],e[t-1]);break;case 99:this.$=e[t-3],l.setClickEvent(e[t-2],e[t-1],e[t]);break;case 100:this.$=e[t-4],l.setClickEvent(e[t-3],e[t-2],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 101:this.$=e[t-3],l.setLink(e[t-2],e[t]);break;case 102:this.$=e[t-4],l.setLink(e[t-3],e[t-1],e[t]);break;case 103:this.$=e[t-4],l.setLink(e[t-3],e[t-1]),l.setTooltip(e[t-3],e[t]);break;case 104:this.$=e[t-5],l.setLink(e[t-4],e[t-2],e[t]),l.setTooltip(e[t-4],e[t-1]);break;case 105:this.$=e[t-2],l.setCssStyle(e[t-1],e[t]);break;case 106:l.setCssClass(e[t-1],e[t]);break;case 107:this.$=[e[t]];break;case 108:e[t-2].push(e[t]),this.$=e[t-2];break;case 110:this.$=e[t-1]+e[t];break}},"anonymous"),table:[{3:1,4:2,5:3,6:4,7:[1,6],10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},{1:[3]},{1:[2,1]},{1:[2,2]},{1:[2,3]},s(Be,[2,5],{8:[1,48]}),{8:[1,49]},s(A,[2,19],{22:[1,50]}),s(A,[2,21]),s(A,[2,22]),s(A,[2,23]),s(A,[2,24]),s(A,[2,25]),s(A,[2,26]),s(A,[2,27]),s(A,[2,28]),s(A,[2,29]),s(A,[2,30]),{34:[1,51]},{36:[1,52]},s(A,[2,33]),s(A,[2,63],{53:53,66:56,67:57,13:[1,54],22:[1,55],68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se}),{39:[1,65]},s(_,[2,47],{39:[1,67],44:[1,66],46:[1,68]}),s(A,[2,65]),s(A,[2,66]),{16:69,60:b,86:k,100:E,102:T},{16:39,17:40,19:70,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:71,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:72,60:b,86:k,100:E,102:T,103:y},{60:[1,73]},{13:[1,74]},{16:39,17:40,19:75,60:b,86:k,100:E,102:T,103:y},{13:Me,55:76},{58:78,60:[1,79]},s(A,[2,76]),s(A,[2,77]),s(A,[2,78]),s(A,[2,79]),s(R,[2,13],{16:39,17:40,19:81,18:[1,80],20:[1,82],60:b,86:k,100:E,102:T,103:y}),s(R,[2,15],{20:[1,83]}),{15:84,16:85,17:86,60:b,86:k,100:E,102:T,103:y},{16:39,17:40,19:87,60:b,86:k,100:E,102:T,103:y},s(ne,[2,133]),s(ne,[2,134]),s(ne,[2,135]),s(ne,[2,136]),s([1,8,9,12,13,20,22,39,41,44,46,68,69,70,71,72,73,74,79,81],[2,137]),s(Be,[2,6],{10:5,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,19:21,38:22,43:23,16:39,17:40,5:88,33:i,35:a,37:n,42:r,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y}),{5:89,10:5,16:39,17:40,19:21,21:7,23:8,24:9,25:10,26:11,27:12,28:13,29:14,30:15,31:16,32:17,33:i,35:a,37:n,38:22,42:r,43:23,46:c,48:u,51:d,52:m,54:g,56:N,57:ge,60:b,62:me,63:Ce,64:be,65:ke,75:Ee,76:Te,78:ye,82:De,83:Fe,86:k,100:E,102:T,103:y},s(A,[2,20]),s(A,[2,31]),s(A,[2,32]),{13:[1,91],16:39,17:40,19:90,60:b,86:k,100:E,102:T,103:y},{53:92,66:56,67:57,68:ee,69:te,70:se,71:ie,72:ae,73:_e,74:Se},s(A,[2,64]),{67:93,73:_e,74:Se},s(re,[2,83],{66:94,68:ee,69:te,70:se,71:ie,72:ae}),s(K,[2,84]),s(K,[2,85]),s(K,[2,86]),s(K,[2,87]),s(K,[2,88]),s(Re,[2,89]),s(Re,[2,90]),{8:[1,96],23:99,24:97,30:98,38:22,40:95,42:r,43:23,48:u,54:g,56:N},{16:100,60:b,86:k,100:E,102:T},{41:[1,102],45:101,51:ue},{16:104,60:b,86:k,100:E,102:T},{47:[1,105]},{13:[1,106]},{13:[1,107]},{79:[1,108],81:[1,109]},{22:Y,50:Q,59:110,60:W,82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},{60:[1,122]},{13:Me,55:123},s(_,[2,72]),s(_,[2,138]),{22:Y,50:Q,59:124,60:W,61:[1,125],82:j,84:111,85:112,86:X,87:q,88:H,89:J,90:Z},s(Ge,[2,74]),{16:39,17:40,19:126,60:b,86:k,100:E,102:T,103:y},s(R,[2,16]),s(R,[2,17]),s(R,[2,18]),{11:127,12:Ue,39:[2,36]},s(le,[2,9],{16:85,17:86,15:130,18:[1,129],60:b,86:k,100:E,102:T,103:y}),s(le,[2,10]),s(Ne,[2,55],{11:131,12:Ue}),s(Be,[2,7]),{9:[1,132]},s(ce,[2,67]),{16:39,17:40,19:133,60:b,86:k,100:E,102:T,103:y},{13:[1,135],16:39,17:40,19:134,60:b,86:k,100:E,102:T,103:y},s(re,[2,82],{66:136,68:ee,69:te,70:se,71:ie,72:ae}),s(re,[2,81]),{41:[1,137]},{23:99,24:97,30:98,38:22,40:138,42:r,43:23,48:u,54:g,56:N},{8:[1,139],41:[2,38]},{8:[1,140],41:[2,41]},{8:[1,141],41:[2,44]},s(_,[2,48],{39:[1,142]}),{41:[1,143]},s(_,[2,50]),{41:[2,61],45:144,51:ue},{47:[1,145]},{16:39,17:40,19:146,60:b,86:k,100:E,102:T,103:y},s(A,[2,91],{13:[1,147]}),s(A,[2,93],{13:[1,149],77:[1,148]}),s(A,[2,97],{13:[1,150],80:[1,151]}),{13:[1,152]},s(A,[2,105],{61:ze}),s(Ke,[2,107],{85:154,22:Y,50:Q,60:W,82:j,86:X,87:q,88:H,89:J,90:Z}),s(x,[2,109]),s(x,[2,111]),s(x,[2,112]),s(x,[2,113]),s(x,[2,114]),s(x,[2,115]),s(x,[2,116]),s(x,[2,117]),s(x,[2,118]),s(x,[2,119]),s(A,[2,106]),s(_,[2,71]),s(A,[2,73],{61:ze}),{60:[1,155]},s(R,[2,14]),{39:[2,37]},{13:[1,156]},{15:157,16:85,17:86,60:b,86:k,100:E,102:T,103:y},s(le,[2,12]),s(Ne,[2,56]),{1:[2,4]},s(ce,[2,69]),s(ce,[2,68]),{16:39,17:40,19:158,60:b,86:k,100:E,102:T,103:y},s(re,[2,80]),s(_,[2,34]),{41:[1,159]},{23:99,24:97,30:98,38:22,40:160,41:[2,39],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:161,41:[2,42],42:r,43:23,48:u,54:g,56:N},{23:99,24:97,30:98,38:22,40:162,41:[2,45],42:r,43:23,48:u,54:g,56:N},{45:163,51:ue},s(_,[2,49]),{41:[2,62]},s(_,[2,52],{39:[1,164]}),s(A,[2,60]),s(A,[2,92]),s(A,[2,94]),s(A,[2,95],{77:[1,165]}),s(A,[2,98]),s(A,[2,99],{13:[1,166]}),s(A,[2,101],{13:[1,168],77:[1,167]}),{22:Y,50:Q,60:W,82:j,84:169,85:112,86:X,87:q,88:H,89:J,90:Z},s(x,[2,110]),s(Ge,[2,75]),{14:[1,170]},s(le,[2,11]),s(ce,[2,70]),s(_,[2,35]),{41:[2,40]},{41:[2,43]},{41:[2,46]},{41:[1,171]},{41:[1,173],45:172,51:ue},s(A,[2,96]),s(A,[2,100]),s(A,[2,102]),s(A,[2,103],{77:[1,174]}),s(Ke,[2,108],{85:154,22:Y,50:Q,60:W,82:j,86:X,87:q,88:H,89:J,90:Z}),s(Ne,[2,8]),s(_,[2,51]),{41:[1,175]},s(_,[2,54]),s(A,[2,104]),s(_,[2,53])],defaultActions:{2:[2,1],3:[2,2],4:[2,3],127:[2,37],132:[2,4],144:[2,62],160:[2,40],161:[2,43],162:[2,46]},parseError:f(function(o,h){if(h.recoverable)this.trace(o);else{var p=new Error(o);throw p.hash=h,p}},"parseError"),parse:f(function(o){var h=this,p=[0],l=[],C=[null],e=[],$=this.table,t="",he=0,Ye=0,Ze=2,Qe=1,$e=e.slice.call(arguments,1),D=Object.create(this.lexer),V={yy:{}};for(var xe in this.yy)Object.prototype.hasOwnProperty.call(this.yy,xe)&&(V.yy[xe]=this.yy[xe]);D.setInput(o,V.yy),V.yy.lexer=D,V.yy.parser=this,typeof D.yylloc>"u"&&(D.yylloc={});var ve=D.yylloc;e.push(ve);var et=D.options&&D.options.ranges;typeof V.yy.parseError=="function"?this.parseError=V.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;function tt(S){p.length=p.length-2*S,C.length=C.length-S,e.length=e.length-S}f(tt,"popStack");function We(){var S;return S=l.pop()||D.lex()||Qe,typeof S!="number"&&(S instanceof Array&&(l=S,S=l.pop()),S=h.symbols_[S]||S),S}f(We,"lex");for(var B,P,L,Ie,G={},de,v,je,pe;;){if(P=p[p.length-1],this.defaultActions[P]?L=this.defaultActions[P]:((B===null||typeof B>"u")&&(B=We()),L=$[P]&&$[P][B]),typeof L>"u"||!L.length||!L[0]){var Oe="";pe=[];for(de in $[P])this.terminals_[de]&&de>Ze&&pe.push("'"+this.terminals_[de]+"'");D.showPosition?Oe="Parse error on line "+(he+1)+`:
2
2
  `+D.showPosition()+`
3
3
  Expecting `+pe.join(", ")+", got '"+(this.terminals_[B]||B)+"'":Oe="Parse error on line "+(he+1)+": Unexpected "+(B==Qe?"end of input":"'"+(this.terminals_[B]||B)+"'"),this.parseError(Oe,{text:D.match,token:this.terminals_[B]||B,line:D.yylineno,loc:ve,expected:pe})}if(L[0]instanceof Array&&L.length>1)throw new Error("Parse Error: multiple actions possible at state: "+P+", token: "+B);switch(L[0]){case 1:p.push(B),C.push(D.yytext),e.push(D.yylloc),p.push(L[1]),B=null,Ye=D.yyleng,t=D.yytext,he=D.yylineno,ve=D.yylloc;break;case 2:if(v=this.productions_[L[1]][1],G.$=C[C.length-v],G._$={first_line:e[e.length-(v||1)].first_line,last_line:e[e.length-1].last_line,first_column:e[e.length-(v||1)].first_column,last_column:e[e.length-1].last_column},et&&(G._$.range=[e[e.length-(v||1)].range[0],e[e.length-1].range[1]]),Ie=this.performAction.apply(G,[t,Ye,he,V.yy,L[1],C,e].concat($e)),typeof Ie<"u")return Ie;v&&(p=p.slice(0,-1*v*2),C=C.slice(0,-1*v),e=e.slice(0,-1*v)),p.push(this.productions_[L[1]][0]),C.push(G.$),e.push(G._$),je=$[p[p.length-2]][p[p.length-1]],p.push(je);break;case 3:return!0}}return!0},"parse")},Je=(function(){var O={EOF:1,parseError:f(function(h,p){if(this.yy.parser)this.yy.parser.parseError(h,p);else throw new Error(h)},"parseError"),setInput:f(function(o,h){return this.yy=h||this.yy||{},this._input=o,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 o=this._input[0];this.yytext+=o,this.yyleng++,this.offset++,this.match+=o,this.matched+=o;var h=o.match(/(?:\r\n?|\n).*/g);return h?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),o},"input"),unput:f(function(o){var h=o.length,p=o.split(/(?:\r\n?|\n)/g);this._input=o+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-h),this.offset-=h;var l=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),p.length-1&&(this.yylineno-=p.length-1);var C=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:p?(p.length===l.length?this.yylloc.first_column:0)+l[l.length-p.length].length-p[0].length:this.yylloc.first_column-h},this.options.ranges&&(this.yylloc.range=[C[0],C[0]+this.yyleng-h]),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(o){this.unput(this.match.slice(o))},"less"),pastInput:f(function(){var o=this.matched.substr(0,this.matched.length-this.match.length);return(o.length>20?"...":"")+o.substr(-20).replace(/\n/g,"")},"pastInput"),upcomingInput:f(function(){var o=this.match;return o.length<20&&(o+=this._input.substr(0,20-o.length)),(o.substr(0,20)+(o.length>20?"...":"")).replace(/\n/g,"")},"upcomingInput"),showPosition:f(function(){var o=this.pastInput(),h=new Array(o.length+1).join("-");return o+this.upcomingInput()+`