@futdevpro/ccap 1.1.2976 → 1.1.2980

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 (186) hide show
  1. package/client-dist/{agent-instances.module-RDNI5YIM.js → agent-instances.module-WFXL2NDE.js} +2 -2
  2. package/client-dist/{ca.module-DOSQOA3X.js → ca.module-CVTI3AF7.js} +2 -2
  3. package/client-dist/{cc-usage-dashboard.component-QRHS53KB.js → cc-usage-dashboard.component-I2G2NBSY.js} +2 -2
  4. package/client-dist/{cc.module-QHHXHWQG.js → cc.module-EXDXYOJ4.js} +2 -2
  5. package/client-dist/{chunk-PKJ7Y62N.js → chunk-2CUMN334.js} +2 -2
  6. package/client-dist/{chunk-ECCH2DHZ.js → chunk-2UXI7P2C.js} +2 -2
  7. package/client-dist/{chunk-RE5XOANX.js → chunk-2VU3GISV.js} +2 -2
  8. package/client-dist/{chunk-CFMCTGZ2.js → chunk-3HWZLIS3.js} +2 -2
  9. package/client-dist/{chunk-CQLAXUA5.js → chunk-4ANOVQQ6.js} +2 -2
  10. package/client-dist/{chunk-3WAVQMV4.js → chunk-4CXFWMLH.js} +2 -2
  11. package/client-dist/{chunk-AVF5CZDZ.js → chunk-4OK5LJEU.js} +2 -2
  12. package/client-dist/{chunk-ROLVKMOV.js → chunk-4PZ65LDL.js} +2 -2
  13. package/client-dist/{chunk-GQJGST2S.js → chunk-4WGQS2HA.js} +2 -2
  14. package/client-dist/{chunk-WJQ3I2JP.js → chunk-5N64HGRY.js} +2 -2
  15. package/client-dist/{chunk-WJQ3I2JP.js.map → chunk-5N64HGRY.js.map} +1 -1
  16. package/client-dist/{chunk-K5GHIIP6.js → chunk-6EPKNTJZ.js} +2 -2
  17. package/client-dist/{chunk-TRSQKYJ3.js → chunk-7EHVTWSO.js} +2 -2
  18. package/client-dist/{chunk-CA2S6A5N.js → chunk-7XAV5GIW.js} +2 -2
  19. package/client-dist/{chunk-LSKYY36G.js → chunk-AE5VAS75.js} +2 -2
  20. package/client-dist/{chunk-32TKSQQ4.js → chunk-AQO5IW5B.js} +2 -2
  21. package/client-dist/{chunk-ZXZYTEBK.js → chunk-AYDRWFG2.js} +2 -2
  22. package/client-dist/{chunk-P2DWOMGE.js → chunk-BGNEFOVG.js} +2 -2
  23. package/client-dist/{chunk-RM323G5Y.js → chunk-C75AJJFP.js} +2 -2
  24. package/client-dist/{chunk-K2LUZEU7.js → chunk-CU2HMFAD.js} +2 -2
  25. package/client-dist/{chunk-357BATFQ.js → chunk-DPGBOTN3.js} +2 -2
  26. package/client-dist/{chunk-MMOBWOV2.js → chunk-EP3IAFIL.js} +2 -2
  27. package/client-dist/{chunk-JOP5IVM2.js → chunk-EPIK2P4Q.js} +2 -2
  28. package/client-dist/{chunk-MQGZMZG3.js → chunk-ESPURNI3.js} +2 -2
  29. package/client-dist/{chunk-VGGHOZL3.js → chunk-FSUMD4VQ.js} +2 -2
  30. package/client-dist/{chunk-BPXKOVJB.js → chunk-FVNI46U2.js} +2 -2
  31. package/client-dist/{chunk-WA3EVNKZ.js → chunk-GH67BJ7J.js} +2 -2
  32. package/client-dist/{chunk-AOG3C4MB.js → chunk-GZRNNZID.js} +2 -2
  33. package/client-dist/{chunk-D2YJ6ZB6.js → chunk-HRSSMQBA.js} +2 -2
  34. package/client-dist/{chunk-OEP5AH6P.js → chunk-I4M7XPFX.js} +2 -2
  35. package/client-dist/{chunk-VA24IMJT.js → chunk-JGLBYLWW.js} +2 -2
  36. package/client-dist/{chunk-TC4ZWWYN.js → chunk-KB2F332Z.js} +2 -2
  37. package/client-dist/{chunk-O6W4XLGA.js → chunk-LBMIDL4S.js} +2 -2
  38. package/client-dist/{chunk-ZKIPL7J4.js → chunk-MMFURH5P.js} +2 -2
  39. package/client-dist/{chunk-HQPGIGEE.js → chunk-N26D6SXG.js} +2 -2
  40. package/client-dist/{chunk-3L2A6OYA.js → chunk-N7HJWJ2S.js} +2 -2
  41. package/client-dist/{chunk-KZGPAAZC.js → chunk-ORFH2XGX.js} +2 -2
  42. package/client-dist/{chunk-GIZQX4FZ.js → chunk-OVD3GSH2.js} +2 -2
  43. package/client-dist/{chunk-QUTV6V23.js → chunk-PGKNPYIE.js} +2 -2
  44. package/client-dist/{chunk-2NU642AU.js → chunk-PWAWM6DC.js} +2 -2
  45. package/client-dist/{chunk-DI2UBL2H.js → chunk-Q2WNI354.js} +2 -2
  46. package/client-dist/{chunk-CGYDBFFX.js → chunk-RG67NB4W.js} +2 -2
  47. package/client-dist/{chunk-2TJTUYN7.js → chunk-RT7QOL2Q.js} +2 -2
  48. package/client-dist/{chunk-SHWCVDPA.js → chunk-RV3A7THL.js} +2 -2
  49. package/client-dist/{chunk-GJLKW7DM.js → chunk-RWQ5B34I.js} +2 -2
  50. package/client-dist/{chunk-F3FKLFEZ.js → chunk-SBPFNYFT.js} +2 -2
  51. package/client-dist/{chunk-65TRXF6Q.js → chunk-SG5TSGOY.js} +2 -2
  52. package/client-dist/{chunk-GHCL3MSY.js → chunk-TSGXTLGO.js} +2 -2
  53. package/client-dist/{chunk-5PH776OB.js → chunk-UBUKMZCP.js} +2 -2
  54. package/client-dist/{chunk-K4J73VA4.js → chunk-UHAAQJ2R.js} +2 -2
  55. package/client-dist/{chunk-C5SF72NF.js → chunk-VEPJ3MZH.js} +2 -2
  56. package/client-dist/{chunk-W3LVU52O.js → chunk-VHZQSBXM.js} +2 -2
  57. package/client-dist/{chunk-ZB3FCA3E.js → chunk-VSGHMHDK.js} +2 -2
  58. package/client-dist/{chunk-HMKEVINB.js → chunk-WDSKSHR7.js} +2 -2
  59. package/client-dist/{chunk-FLTRXJF5.js → chunk-WL7JJ44C.js} +2 -2
  60. package/client-dist/{chunk-HWDURMDH.js → chunk-WXN5C3BS.js} +2 -2
  61. package/client-dist/{chunk-KRFIZINJ.js → chunk-ZOCMDQAW.js} +2 -2
  62. package/client-dist/{consultant.module-YJXM54HJ.js → consultant.module-WHGIMF6M.js} +2 -2
  63. package/client-dist/{crd.module-WTDKZXIE.js → crd.module-EH2RIMWD.js} +2 -2
  64. package/client-dist/{dashboard.module-NKQHPS5Q.js → dashboard.module-EROOHU4C.js} +2 -2
  65. package/client-dist/{do.module-FNFK3G5K.js → do.module-PATPM2KZ.js} +2 -2
  66. package/client-dist/{document-library.module-3P3ZFDV7.js → document-library.module-QBW7XGNT.js} +2 -2
  67. package/client-dist/{embedding-eval.module-WWIPZ3TY.js → embedding-eval.module-O4YXXNZE.js} +2 -2
  68. package/client-dist/{embedding-registry.module-BO7LYJLR.js → embedding-registry.module-DOWVA6RV.js} +2 -2
  69. package/client-dist/{err.module-AKZYERWR.js → err.module-AWN67SP6.js} +2 -2
  70. package/client-dist/{feedback.module-QL52SIU3.js → feedback.module-BWKJCSTU.js} +2 -2
  71. package/client-dist/{host-runtime-mcp.module-WGN2WK3K.js → host-runtime-mcp.module-24MRZ77I.js} +2 -2
  72. package/client-dist/index.html +1 -1
  73. package/client-dist/{live-dev-pipeline.module-WHO3NH3W.js → live-dev-pipeline.module-T4EERACF.js} +2 -2
  74. package/client-dist/{logs.module-YAFAVQPS.js → logs.module-O4MVHXRP.js} +2 -2
  75. package/client-dist/{main-IHO52LAW.js → main-NP3NWD3C.js} +3 -3
  76. package/client-dist/{master-control-remote-poc.module-KGXVVQQM.js → master-control-remote-poc.module-M6TNRCRQ.js} +2 -2
  77. package/client-dist/{mobile-app.module-JTAPGOXX.js → mobile-app.module-SW2L4EB3.js} +2 -2
  78. package/client-dist/{model-registry.module-7ZYZ3XZ2.js → model-registry.module-MMEFDY3Y.js} +2 -2
  79. package/client-dist/{oc.module-CMKG3TIN.js → oc.module-PVCITNSF.js} +2 -2
  80. package/client-dist/{orc.module-D5QH6N6Q.js → orc.module-2S5XXXZI.js} +2 -2
  81. package/client-dist/{project-management.module-EJLPHJD6.js → project-management.module-XD6NLN3S.js} +15 -15
  82. package/client-dist/{project-management.module-EJLPHJD6.js.map → project-management.module-XD6NLN3S.js.map} +3 -3
  83. package/client-dist/project-source-routed.module-ZBU2T4Q5.js +2 -0
  84. package/client-dist/{scheduler.module-7IWANUWU.js → scheduler.module-7YAZ6PYA.js} +2 -2
  85. package/client-dist/{session.module-42CEXVHT.js → session.module-QNFMZPFT.js} +2 -2
  86. package/client-dist/{set.module-QXF6DZFG.js → set.module-QLYUFFRH.js} +2 -2
  87. package/client-dist/{setup.module-4U42JK32.js → setup.module-HSVFOBYN.js} +2 -2
  88. package/client-dist/{terminals.module-RZXNECJ7.js → terminals.module-2NKJL3L6.js} +2 -2
  89. package/client-dist/{voice-notes-poc.module-TB6PFTCF.js → voice-notes-poc.module-VBWYBFHH.js} +2 -2
  90. package/client-dist/{wfs.module-K3NJ47QV.js → wfs.module-2ZF3S6F2.js} +2 -2
  91. package/package.json +1 -1
  92. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/consts/cc-kill-reasons.const.d.ts +11 -0
  93. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/consts/cc-kill-reasons.const.d.ts.map +1 -1
  94. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/consts/cc-kill-reasons.const.js +11 -0
  95. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/consts/cc-kill-reasons.const.js.map +1 -1
  96. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/lifecycle/cc-process-exit.util.d.ts.map +1 -1
  97. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/lifecycle/cc-process-exit.util.js +9 -4
  98. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/lifecycle/cc-process-exit.util.js.map +1 -1
  99. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/lifecycle/cc-process-exit.util.spec.js +20 -14
  100. package/server/build/src/_modules/external-sessions/_modules/claude-code/_collections/utils/lifecycle/cc-process-exit.util.spec.js.map +1 -1
  101. package/client-dist/project-source-routed.module-2OY6I5WD.js +0 -2
  102. /package/client-dist/{agent-instances.module-RDNI5YIM.js.map → agent-instances.module-WFXL2NDE.js.map} +0 -0
  103. /package/client-dist/{ca.module-DOSQOA3X.js.map → ca.module-CVTI3AF7.js.map} +0 -0
  104. /package/client-dist/{cc-usage-dashboard.component-QRHS53KB.js.map → cc-usage-dashboard.component-I2G2NBSY.js.map} +0 -0
  105. /package/client-dist/{cc.module-QHHXHWQG.js.map → cc.module-EXDXYOJ4.js.map} +0 -0
  106. /package/client-dist/{chunk-PKJ7Y62N.js.map → chunk-2CUMN334.js.map} +0 -0
  107. /package/client-dist/{chunk-ECCH2DHZ.js.map → chunk-2UXI7P2C.js.map} +0 -0
  108. /package/client-dist/{chunk-RE5XOANX.js.map → chunk-2VU3GISV.js.map} +0 -0
  109. /package/client-dist/{chunk-CFMCTGZ2.js.map → chunk-3HWZLIS3.js.map} +0 -0
  110. /package/client-dist/{chunk-CQLAXUA5.js.map → chunk-4ANOVQQ6.js.map} +0 -0
  111. /package/client-dist/{chunk-3WAVQMV4.js.map → chunk-4CXFWMLH.js.map} +0 -0
  112. /package/client-dist/{chunk-AVF5CZDZ.js.map → chunk-4OK5LJEU.js.map} +0 -0
  113. /package/client-dist/{chunk-ROLVKMOV.js.map → chunk-4PZ65LDL.js.map} +0 -0
  114. /package/client-dist/{chunk-GQJGST2S.js.map → chunk-4WGQS2HA.js.map} +0 -0
  115. /package/client-dist/{chunk-K5GHIIP6.js.map → chunk-6EPKNTJZ.js.map} +0 -0
  116. /package/client-dist/{chunk-TRSQKYJ3.js.map → chunk-7EHVTWSO.js.map} +0 -0
  117. /package/client-dist/{chunk-CA2S6A5N.js.map → chunk-7XAV5GIW.js.map} +0 -0
  118. /package/client-dist/{chunk-LSKYY36G.js.map → chunk-AE5VAS75.js.map} +0 -0
  119. /package/client-dist/{chunk-32TKSQQ4.js.map → chunk-AQO5IW5B.js.map} +0 -0
  120. /package/client-dist/{chunk-ZXZYTEBK.js.map → chunk-AYDRWFG2.js.map} +0 -0
  121. /package/client-dist/{chunk-P2DWOMGE.js.map → chunk-BGNEFOVG.js.map} +0 -0
  122. /package/client-dist/{chunk-RM323G5Y.js.map → chunk-C75AJJFP.js.map} +0 -0
  123. /package/client-dist/{chunk-K2LUZEU7.js.map → chunk-CU2HMFAD.js.map} +0 -0
  124. /package/client-dist/{chunk-357BATFQ.js.map → chunk-DPGBOTN3.js.map} +0 -0
  125. /package/client-dist/{chunk-MMOBWOV2.js.map → chunk-EP3IAFIL.js.map} +0 -0
  126. /package/client-dist/{chunk-JOP5IVM2.js.map → chunk-EPIK2P4Q.js.map} +0 -0
  127. /package/client-dist/{chunk-MQGZMZG3.js.map → chunk-ESPURNI3.js.map} +0 -0
  128. /package/client-dist/{chunk-VGGHOZL3.js.map → chunk-FSUMD4VQ.js.map} +0 -0
  129. /package/client-dist/{chunk-BPXKOVJB.js.map → chunk-FVNI46U2.js.map} +0 -0
  130. /package/client-dist/{chunk-WA3EVNKZ.js.map → chunk-GH67BJ7J.js.map} +0 -0
  131. /package/client-dist/{chunk-AOG3C4MB.js.map → chunk-GZRNNZID.js.map} +0 -0
  132. /package/client-dist/{chunk-D2YJ6ZB6.js.map → chunk-HRSSMQBA.js.map} +0 -0
  133. /package/client-dist/{chunk-OEP5AH6P.js.map → chunk-I4M7XPFX.js.map} +0 -0
  134. /package/client-dist/{chunk-VA24IMJT.js.map → chunk-JGLBYLWW.js.map} +0 -0
  135. /package/client-dist/{chunk-TC4ZWWYN.js.map → chunk-KB2F332Z.js.map} +0 -0
  136. /package/client-dist/{chunk-O6W4XLGA.js.map → chunk-LBMIDL4S.js.map} +0 -0
  137. /package/client-dist/{chunk-ZKIPL7J4.js.map → chunk-MMFURH5P.js.map} +0 -0
  138. /package/client-dist/{chunk-HQPGIGEE.js.map → chunk-N26D6SXG.js.map} +0 -0
  139. /package/client-dist/{chunk-3L2A6OYA.js.map → chunk-N7HJWJ2S.js.map} +0 -0
  140. /package/client-dist/{chunk-KZGPAAZC.js.map → chunk-ORFH2XGX.js.map} +0 -0
  141. /package/client-dist/{chunk-GIZQX4FZ.js.map → chunk-OVD3GSH2.js.map} +0 -0
  142. /package/client-dist/{chunk-QUTV6V23.js.map → chunk-PGKNPYIE.js.map} +0 -0
  143. /package/client-dist/{chunk-2NU642AU.js.map → chunk-PWAWM6DC.js.map} +0 -0
  144. /package/client-dist/{chunk-DI2UBL2H.js.map → chunk-Q2WNI354.js.map} +0 -0
  145. /package/client-dist/{chunk-CGYDBFFX.js.map → chunk-RG67NB4W.js.map} +0 -0
  146. /package/client-dist/{chunk-2TJTUYN7.js.map → chunk-RT7QOL2Q.js.map} +0 -0
  147. /package/client-dist/{chunk-SHWCVDPA.js.map → chunk-RV3A7THL.js.map} +0 -0
  148. /package/client-dist/{chunk-GJLKW7DM.js.map → chunk-RWQ5B34I.js.map} +0 -0
  149. /package/client-dist/{chunk-F3FKLFEZ.js.map → chunk-SBPFNYFT.js.map} +0 -0
  150. /package/client-dist/{chunk-65TRXF6Q.js.map → chunk-SG5TSGOY.js.map} +0 -0
  151. /package/client-dist/{chunk-GHCL3MSY.js.map → chunk-TSGXTLGO.js.map} +0 -0
  152. /package/client-dist/{chunk-5PH776OB.js.map → chunk-UBUKMZCP.js.map} +0 -0
  153. /package/client-dist/{chunk-K4J73VA4.js.map → chunk-UHAAQJ2R.js.map} +0 -0
  154. /package/client-dist/{chunk-C5SF72NF.js.map → chunk-VEPJ3MZH.js.map} +0 -0
  155. /package/client-dist/{chunk-W3LVU52O.js.map → chunk-VHZQSBXM.js.map} +0 -0
  156. /package/client-dist/{chunk-ZB3FCA3E.js.map → chunk-VSGHMHDK.js.map} +0 -0
  157. /package/client-dist/{chunk-HMKEVINB.js.map → chunk-WDSKSHR7.js.map} +0 -0
  158. /package/client-dist/{chunk-FLTRXJF5.js.map → chunk-WL7JJ44C.js.map} +0 -0
  159. /package/client-dist/{chunk-HWDURMDH.js.map → chunk-WXN5C3BS.js.map} +0 -0
  160. /package/client-dist/{chunk-KRFIZINJ.js.map → chunk-ZOCMDQAW.js.map} +0 -0
  161. /package/client-dist/{consultant.module-YJXM54HJ.js.map → consultant.module-WHGIMF6M.js.map} +0 -0
  162. /package/client-dist/{crd.module-WTDKZXIE.js.map → crd.module-EH2RIMWD.js.map} +0 -0
  163. /package/client-dist/{dashboard.module-NKQHPS5Q.js.map → dashboard.module-EROOHU4C.js.map} +0 -0
  164. /package/client-dist/{do.module-FNFK3G5K.js.map → do.module-PATPM2KZ.js.map} +0 -0
  165. /package/client-dist/{document-library.module-3P3ZFDV7.js.map → document-library.module-QBW7XGNT.js.map} +0 -0
  166. /package/client-dist/{embedding-eval.module-WWIPZ3TY.js.map → embedding-eval.module-O4YXXNZE.js.map} +0 -0
  167. /package/client-dist/{embedding-registry.module-BO7LYJLR.js.map → embedding-registry.module-DOWVA6RV.js.map} +0 -0
  168. /package/client-dist/{err.module-AKZYERWR.js.map → err.module-AWN67SP6.js.map} +0 -0
  169. /package/client-dist/{feedback.module-QL52SIU3.js.map → feedback.module-BWKJCSTU.js.map} +0 -0
  170. /package/client-dist/{host-runtime-mcp.module-WGN2WK3K.js.map → host-runtime-mcp.module-24MRZ77I.js.map} +0 -0
  171. /package/client-dist/{live-dev-pipeline.module-WHO3NH3W.js.map → live-dev-pipeline.module-T4EERACF.js.map} +0 -0
  172. /package/client-dist/{logs.module-YAFAVQPS.js.map → logs.module-O4MVHXRP.js.map} +0 -0
  173. /package/client-dist/{main-IHO52LAW.js.map → main-NP3NWD3C.js.map} +0 -0
  174. /package/client-dist/{master-control-remote-poc.module-KGXVVQQM.js.map → master-control-remote-poc.module-M6TNRCRQ.js.map} +0 -0
  175. /package/client-dist/{mobile-app.module-JTAPGOXX.js.map → mobile-app.module-SW2L4EB3.js.map} +0 -0
  176. /package/client-dist/{model-registry.module-7ZYZ3XZ2.js.map → model-registry.module-MMEFDY3Y.js.map} +0 -0
  177. /package/client-dist/{oc.module-CMKG3TIN.js.map → oc.module-PVCITNSF.js.map} +0 -0
  178. /package/client-dist/{orc.module-D5QH6N6Q.js.map → orc.module-2S5XXXZI.js.map} +0 -0
  179. /package/client-dist/{project-source-routed.module-2OY6I5WD.js.map → project-source-routed.module-ZBU2T4Q5.js.map} +0 -0
  180. /package/client-dist/{scheduler.module-7IWANUWU.js.map → scheduler.module-7YAZ6PYA.js.map} +0 -0
  181. /package/client-dist/{session.module-42CEXVHT.js.map → session.module-QNFMZPFT.js.map} +0 -0
  182. /package/client-dist/{set.module-QXF6DZFG.js.map → set.module-QLYUFFRH.js.map} +0 -0
  183. /package/client-dist/{setup.module-4U42JK32.js.map → setup.module-HSVFOBYN.js.map} +0 -0
  184. /package/client-dist/{terminals.module-RZXNECJ7.js.map → terminals.module-2NKJL3L6.js.map} +0 -0
  185. /package/client-dist/{voice-notes-poc.module-TB6PFTCF.js.map → voice-notes-poc.module-VBWYBFHH.js.map} +0 -0
  186. /package/client-dist/{wfs.module-K3NJ47QV.js.map → wfs.module-2ZF3S6F2.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{a as R,b as z,c as Ce}from"./chunk-C5SF72NF.js";import{c as ge}from"./chunk-LSKYY36G.js";import{a as xe}from"./chunk-FLAJXIYW.js";import{b as le,c as se,f as de,i as ce,n as ue,o as _e,p as me,v as pe}from"./chunk-EO4DNTT4.js";import{a as K}from"./chunk-5UPNU54P.js";import{j as fe}from"./chunk-HWDURMDH.js";import{C as q,D as Y,Fa as d,Ga as $,Ha as L,Ia as ie,J as f,Ja as oe,K as x,Ka as re,L as A,M as I,Ma as N,Na as W,Oa as O,Q as j,Ta as ae,U as H,Y as ee,Z as l,aa as p,da as C,fa as V,ga as y,ha as G,hb as v,ia as F,k as P,la as g,ma as te,na as ne,oa as B,pa as D,qa as o,ra as r,sa as S,ua as T,va as m,wa as c,y as X}from"./chunk-TBMJSIBB.js";var he="ccap-voiceInput:autoSendAfterVoice",be=(()=>{class n{autoSendAfterVoice_$=p(n.readAutoSendAfterVoiceFromStorage());setAutoSendAfterVoice(e){this.autoSendAfterVoice_$.set(e),K.writeString(he,String(e))}static readAutoSendAfterVoiceFromStorage(){return K.readString(he)==="true"}static \u0275fac=function(t){return new(t||n)};static \u0275prov=X({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var k=function(n){return n.equal="equal",n.removed="removed",n.added="added",n}(k||{});var U=class n{static tokenize(s){let e=s;if(e.length===0)return[];let t=e.split(/(\s+)/),i=[];for(let a=0;a<t.length;a++){let u=t[a];u.length>0&&i.push(u)}return i}static mergeAndAssignIds(s){if(s.length===0)return[];let e=[];for(let i=0;i<s.length;i++){let a=s[i],u=e[e.length-1];u!==void 0&&u.kind===a.kind?u.text=u.text+a.text:e.push({kind:a.kind,text:a.text})}let t=[];for(let i=0;i<e.length;i++){let a=e[i];t.push({id:i,kind:a.kind,text:a.text})}return t}static buildWordDiff(s,e){let t=n.tokenize(s),i=n.tokenize(e),a=t.length,u=i.length,_=[];for(let h=0;h<=a;h++){let E=[];for(let Q=0;Q<=u;Q++)E.push(0);_.push(E)}for(let h=1;h<=a;h++)for(let E=1;E<=u;E++)if(t[h-1]===i[E-1])_[h][E]=_[h-1][E-1]+1;else{let Q=_[h-1][E],Z=_[h][E-1];_[h][E]=Q>Z?Q:Z}let w=[],b=a,M=u;for(;b>0||M>0;)b>0&&M>0&&t[b-1]===i[M-1]?(w.push({kind:k.equal,text:t[b-1]}),b-=1,M-=1):M>0&&(b===0||_[b][M-1]>=_[b-1][M])?(w.push({kind:k.added,text:i[M-1]}),M-=1):b>0&&(w.push({kind:k.removed,text:t[b-1]}),b-=1);let J=[];for(let h=w.length-1;h>=0;h--)J.push(w[h]);return n.mergeAndAssignIds(J)}};var Se=(n,s)=>s.value,Ee=(n,s)=>s.id;function ye(n,s){n&1&&S(0,"span",25)}function $e(n,s){if(n&1&&(o(0,"div",28),S(1,"div",33)(2,"div",34),r()),n&2){let e=c(3);l(),G("height",e.volumePercent_$(),"%")}}function we(n,s){if(n&1&&(o(0,"div",26),C(1,$e,3,2,"div",28),A(),o(2,"svg",29),S(3,"path",30)(4,"path",31)(5,"line",32),r()()),n&2){let e=c(2);l(),g(e.isRecordActive_$()?1:-1)}}function Me(n,s){n&1&&(o(0,"p",27)(1,"span",35),d(2,"\u26A0"),r(),d(3),r()),n&2&&(V("aria-live","polite"),l(3),L("",s," "))}function Ae(n,s){if(n&1){let e=T();o(0,"div",0)(1,"div",15)(2,"button",16),m("click",function(i){return f(e),c().toggleSettings(),x(i.stopPropagation())}),A(),o(3,"svg",17),S(4,"path",18)(5,"path",19),r()(),I(),o(6,"button",20),m("click",function(i){return f(e),c().toggleInfo(),x(i.stopPropagation())}),A(),o(7,"svg",17),S(8,"circle",21)(9,"path",22)(10,"path",23),r()()(),I(),o(11,"button",24),m("click",function(){f(e);let i=c();return x(i.toggleRecord())}),C(12,ye,1,0,"span",25)(13,we,6,1,"div",26),r(),C(14,Me,4,2,"p",27),r()}if(n&2){let e,t=c();l(6),F("border-neonDefault",!t.lastQaTextWasModified_$())("text-neonCyan",!t.lastQaTextWasModified_$())("hover:border-neonCyan",!t.lastQaTextWasModified_$())("hover:shadow-neon-glow-cyan",!t.lastQaTextWasModified_$())("focus:ring-neonCyan",!t.lastQaTextWasModified_$())("border-neonAmber",t.lastQaTextWasModified_$())("text-neonAmber",t.lastQaTextWasModified_$())("shadow-neon-glow-orange",t.lastQaTextWasModified_$())("hover:border-neonAmber",t.lastQaTextWasModified_$())("hover:shadow-neon-glow-orange",t.lastQaTextWasModified_$())("focus:ring-neonAmber",t.lastQaTextWasModified_$()),V("aria-label",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult":"Utols\xF3 QA eredm\xE9ny")("title",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult (r\xE9szletek)":"Utols\xF3 QA eredm\xE9ny"),l(5),F("border-neonCyan",t.isRecordActive_$()||t.busy_$())("shadow-neon-glow-cyan",t.isRecordActive_$()||t.busy_$())("animate-pulse",t.isRecording_$()),y("disabled",t.mediaUnavailable_$()!==null),V("aria-label",t.recordButtonAriaLabel_$())("title",t.recordButtonTitle_$()),l(),g(t.busy_$()&&!t.isRecordActive_$()?12:13),l(2),g((e=t.mediaUnavailable_$())?14:-1,e)}}function Te(n,s){n&1&&S(0,"span",25)}function Pe(n,s){if(n&1&&(o(0,"div",28),S(1,"div",33)(2,"div",34),r()),n&2){let e=c(3);l(),G("height",e.volumePercent_$(),"%")}}function Ve(n,s){if(n&1&&(o(0,"div",26),C(1,Pe,3,2,"div",28),A(),o(2,"svg",29),S(3,"path",30)(4,"path",31)(5,"line",32),r()()),n&2){let e=c(2);l(),g(e.isRecordActive_$()?1:-1)}}function ke(n,s){n&1&&(o(0,"p",39)(1,"span",35),d(2,"\u26A0"),r(),d(3),r()),n&2&&(V("aria-live","polite"),l(3),L("",s," "))}function Re(n,s){if(n&1){let e=T();o(0,"div",36)(1,"button",24),m("click",function(){f(e);let i=c();return x(i.toggleRecord())}),C(2,Te,1,0,"span",25)(3,Ve,6,1,"div",26),r(),o(4,"button",37),m("click",function(i){return f(e),c().toggleSettings(),x(i.stopPropagation())}),A(),o(5,"svg",17),S(6,"path",18)(7,"path",19),r()(),I(),o(8,"button",38),m("click",function(i){return f(e),c().toggleInfo(),x(i.stopPropagation())}),A(),o(9,"svg",17),S(10,"circle",21)(11,"path",22)(12,"path",23),r()()(),C(13,ke,4,2,"p",39)}if(n&2){let e,t=c();l(),F("border-neonCyan",t.isRecordActive_$()||t.busy_$())("shadow-neon-glow-cyan",t.isRecordActive_$()||t.busy_$())("animate-pulse",t.isRecording_$()),y("disabled",t.mediaUnavailable_$()!==null),V("aria-label",t.recordButtonAriaLabel_$())("title",t.recordButtonTitle_$()),l(),g(t.busy_$()&&!t.isRecordActive_$()?2:3),l(6),F("border-neonDefault",!t.lastQaTextWasModified_$())("text-neonCyan",!t.lastQaTextWasModified_$())("hover:border-neonCyan",!t.lastQaTextWasModified_$())("hover:shadow-neon-glow-cyan",!t.lastQaTextWasModified_$())("focus:ring-neonCyan",!t.lastQaTextWasModified_$())("border-neonAmber",t.lastQaTextWasModified_$())("text-neonAmber",t.lastQaTextWasModified_$())("shadow-neon-glow-orange",t.lastQaTextWasModified_$())("hover:border-neonAmber",t.lastQaTextWasModified_$())("hover:shadow-neon-glow-orange",t.lastQaTextWasModified_$())("focus:ring-neonAmber",t.lastQaTextWasModified_$()),V("aria-label",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult":"Utols\xF3 QA eredm\xE9ny")("title",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult (r\xE9szletek)":"Utols\xF3 QA eredm\xE9ny"),l(5),g((e=t.mediaUnavailable_$())?13:-1,e)}}function Qe(n,s){if(n&1&&(o(0,"p",45),d(1),r()),n&2){let e=c(2);l(),re(" Override: ",e.qaProviderDisplayLabel_$()," / ",e.qaModelName||"\u2014"," (glob\xE1l: ",e.defaultLlmProviderDisplayLabel_$()||"\u2014"," / ",e.defaultLlmModel_$()||"\u2014","). ")}}function qe(n,s){if(n&1&&(o(0,"p",45),d(1),r()),n&2){let e=c(2);l(),ie(" Nincs be\xE1ll\xEDtva \u2013 haszn\xE1lt: ",e.defaultLlmProviderDisplayLabel_$()||"\u2014"," / ",e.defaultLlmModel_$()||"\u2014"," (glob\xE1l). ")}}function Fe(n,s){if(n&1&&(o(0,"option",49),d(1),r()),n&2){let e=s.$implicit;y("value",e.value),l(),$(e.label)}}function Be(n,s){if(n&1&&(o(0,"option",49),d(1),r()),n&2){let e=s.$implicit;y("value",e),l(),$(e)}}function De(n,s){if(n&1){let e=T();o(0,"select",59),O("ngModelChange",function(i){f(e);let a=c(2);return W(a.qaModelName,i)||(a.qaModelName=i),x(i)}),o(1,"option",48),d(2,"\u2014 default \u2014"),r(),B(3,Be,2,2,"option",49,ne),r()}if(n&2){let e=c(2);N("ngModel",e.qaModelName),l(3),D(e.qaModelsForProvider_$())}}function Le(n,s){if(n&1){let e=T();o(0,"input",60),O("ngModelChange",function(i){f(e);let a=c(2);return W(a.qaModelName,i)||(a.qaModelName=i),x(i)}),r()}if(n&2){let e=c(2);N("ngModel",e.qaModelName)}}function Ne(n,s){if(n&1&&(o(0,"p",52),d(1),r()),n&2){let e=c(2);l(),$(e.qaModelsListFetchError_$())}}function We(n,s){if(n&1){let e=T();o(0,"div",15)(1,"input",61),m("input",function(i){let a=f(e).$index,u=c(2);return x(u.updateConfusionFrom(a,i.target.value))}),r(),o(2,"span",62),d(3,"\u2192"),r(),o(4,"input",63),m("input",function(i){let a=f(e).$index,u=c(2);return x(u.updateConfusionTo(a,i.target.value))}),r(),o(5,"button",64),m("click",function(){let i=f(e).$index,a=c(2);return x(a.removeConfusionEntry(i))}),o(6,"span",65),d(7,"T\xF6rl\xE9s"),r(),A(),o(8,"svg",66),S(9,"path",67),r()()()}if(n&2){let e=s.$implicit;l(),y("value",e.from),l(3),y("value",e.to)}}function Oe(n,s){if(n&1){let e=T();o(0,"div",8)(1,"div",40)(2,"p",41),d(3,"System prompt (LLM-nek)"),r(),o(4,"p",42),d(5),r()(),o(6,"div",40)(7,"p",41),d(8," User prompt sablon (ide f\u0171z\u0151dik be a felv\xE9tel adata) "),r(),o(9,"p",43),d(10),r(),o(11,"p",44),d(12),r()(),o(13,"div",40)(14,"p",41),d(15,"STT QA provider \xE9s modell"),r(),C(16,Qe,2,4,"p",45)(17,qe,2,2,"p",45),o(18,"div",46)(19,"select",47),O("ngModelChange",function(i){f(e);let a=c();return W(a.qaProviderName,i)||(a.qaProviderName=i),x(i)}),m("ngModelChange",function(){f(e);let i=c();return x(i.onQaProviderChange())}),o(20,"option",48),d(21,"\u2014 default \u2014"),r(),B(22,Fe,2,2,"option",49,Se),r(),C(24,De,5,1,"select",50)(25,Le,1,1,"input",51),r(),C(26,Ne,2,1,"p",52),r(),o(27,"div",53)(28,"p",54),d(29," Tipikus el\xEDr\xE1sok / tip\xF3k (confusion map) \u2013 ezekre jav\xEDt a QA "),r(),o(30,"div",55),B(31,We,10,2,"div",15,te),r(),o(33,"div",56)(34,"button",57),m("click",function(){f(e);let i=c();return x(i.addConfusionEntry())}),d(35," + Sor hozz\xE1ad\xE1sa "),r(),o(36,"button",58),m("click",function(){f(e);let i=c();return x(i.saveQaSettings())}),d(37),r()()()()}if(n&2){let e=s,t=c();l(5),$(e.systemPrompt),l(5),L(" ",e.userPromptTemplate," "),l(2),oe(" Placeholderek: ","{{TRANSCRIPT}}"," = nyers sz\xF6veg, ","{{NOTE_CONTEXT}}"," = jegyzet, ","{{CONFUSION_MAP}}"," = az al\xE1bbi el\xEDr\xE1s lista JSON-ban. "),l(4),g(t.qaProviderName.trim()?16:17),l(3),N("ngModel",t.qaProviderName),l(3),D(t.llmProviderSelectOptions_$()),l(2),g(t.qaShowModelSelect_$()?24:25),l(2),g(t.qaModelsListFetchError_$().trim()?26:-1),l(5),D(t.confusionMapList_$()),l(5),y("disabled",t.qaSettingsSaving_$()),l(),L(" ",t.qaSettingsSaving_$()?"Ment\xE9s\u2026":"QA be\xE1ll\xEDt\xE1sok ment\xE9se"," ")}}function Ie(n,s){n&1&&(o(0,"p",9),d(1,"QA be\xE1ll\xEDt\xE1sok bet\xF6lt\xE9se\u2026"),r())}function ze(n,s){if(n&1){let e=T();o(0,"p",68),d(1," A QA be\xE1ll\xEDt\xE1sok bet\xF6lt\xE9se sikertelen. "),r(),o(2,"button",69),m("click",function(){f(e);let i=c();return x(i.loadQaSettings())}),d(3," \xDAjra bet\xF6lt\xE9s "),r()}}function Ue(n,s){if(n&1&&(o(0,"span",78),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function je(n,s){if(n&1&&(o(0,"span",79),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function He(n,s){if(n&1&&(o(0,"span",80),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function Ge(n,s){if(n&1&&C(0,Ue,2,1,"span",78)(1,je,2,1,"span",79)(2,He,2,1,"span",80),n&2){let e=s.$implicit,t=c(3);g(e.kind===t.SttQaDiffKind.equal?0:e.kind===t.SttQaDiffKind.removed?1:2)}}function Ke(n,s){if(n&1&&(o(0,"div",70)(1,"p",75),d(2," V\xE1ltoz\xE1sok (kiemelve) "),r(),o(3,"p",76),B(4,Ge,3,1,null,null,Ee),r(),o(6,"p",77),d(7," \xC1th\xFAzva: nyers STT; kiemelve: jav\xEDtott sz\xF6veg. Al\xE1bb a teljes k\xE9t v\xE1ltozat. "),r()()),n&2){let e=c(2);l(4),D(e.lastQaWordDiffSegments_$())}}function Je(n,s){if(n&1&&(o(0,"p",74),d(1,"Magyar\xE1zat:"),r(),o(2,"p",81),d(3),r()),n&2){let e=c();l(3),$(e.explanation)}}function Ze(n,s){if(n&1&&(o(0,"div",13),C(1,Ke,8,0,"div",70),o(2,"p",71),d(3,"Volt m\xF3dos\xEDt\xE1s: igen."),r(),o(4,"p",72),d(5,"Eredeti (nyers STT):"),r(),o(6,"p",73),d(7),r(),o(8,"p",74),d(9,"Jav\xEDtott:"),r(),o(10,"p",73),d(11),r(),C(12,Je,4,1),r()),n&2){let e=s,t=c();l(),g(t.lastQaWordDiffSegments_$().length>0?1:-1),l(6),$(e.original),l(4),$(e.corrected),l(),g(e.explanation?12:-1)}}function Xe(n,s){n&1&&(o(0,"p",14),d(1," M\xE9g nem volt STT QA jav\xEDt\xE1s. "),r())}var vt=(()=>{class n{globalError_CS=q(fe);soundRecorder_CS=q(Ce);voiceSttQaUi_DS=q(ge);voiceInputUi_DS=q(be);qaEnabled=H(void 0);compactLayout=H(!1);transcriptReady=new j;transcriptSegmentReady=new j;busy_$=p(!1);pendingTranscriptionCount=0;emitChain=Promise.resolve();volume_$=p(0);isQaEnabledFromSettings_$=p(!1);settingsOpen_$=p(!1);qaSettings_$=p(null);confusionMapList_$=p([]);qaSettingsSaving_$=p(!1);qaSettingsLoading_$=p(!1);settingsQaEnabled=!1;qaProviderName="";qaModelName="";llmProviderSelectOptions_$=p([]);qaModelsForProvider_$=p([]);qaModelsListFetchError_$=p("");lastQaTransformation_$=p(null);infoOpen_$=p(!1);mediaUnavailable_$=p(null);defaultLlmProvider_$=p("");defaultLlmModel_$=p("");volumePercent_$=v(()=>Math.min(100,this.volume_$()*250));qaShowModelSelect_$=v(()=>this.qaModelsForProvider_$().length>0);lastQaTextWasModified_$=v(()=>{let e=this.lastQaTransformation_$();return e===null?!1:e.original!==e.corrected});lastQaWordDiffSegments_$=v(()=>{let e=this.lastQaTransformation_$();return e===null||e.original===e.corrected?[]:U.buildWordDiff(e.original,e.corrected)});SttQaDiffKind=k;defaultLlmProviderDisplayLabel_$=v(()=>{let e=this.llmProviderSelectOptions_$(),t=this.defaultLlmProvider_$().trim();return t.length?e.find(a=>a.value===t)?.label??t:""});qaProviderDisplayLabel_$=v(()=>{let e=this.qaProviderName.trim();return e.length?this.llmProviderSelectOptions_$().find(a=>a.value===e)?.label??e:""});ngOnInit(){let e=z.getMediaRecordingAvailability();if(!e.supported&&e.reason){let t=e.reason;this.mediaUnavailable_$.set(z.getMediaUnavailableMessage(t)),this.globalError_CS.reportErrorOnly({message:z.getMediaUnavailableReportMessage(t),source:"ccap-voice-record-button"})}this.soundRecorder_CS.setOnChunk((t,i)=>{this.onChunk(t,i)}),this.soundRecorder_CS.setOnVolume(t=>{this.volume_$.set(t)}),this.soundRecorder_CS.setOnError(t=>{this.globalError_CS.showError(t,"ccap-voice-record-button")})}ngOnDestroy(){this.soundRecorder_CS.stopListening()}toggleRecord(){return P(this,null,function*(){if(this.mediaUnavailable_$()!==null)return;if(this.soundRecorder_CS.state_$()===R.stopped){this.qaEnabled()===void 0&&(yield this.loadQaEnabledOnce());try{yield this.soundRecorder_CS.startListening()}catch(t){this.globalError_CS.showError(t,"ccap-voice-record-button")}}else this.soundRecorder_CS.stopListening()})}loadQaEnabledOnce(){return P(this,null,function*(){this.isQaEnabledFromSettings_$.set(yield this.voiceSttQaUi_DS.fetchQaEnabledFlag())})}handleAutoSendAfterVoiceChange(e){this.voiceInputUi_DS.setAutoSendAfterVoice(e)}toggleSettings(){this.settingsOpen_$.update(e=>!e),this.settingsOpen_$()&&this.loadQaSettings()}toggleInfo(){this.infoOpen_$.update(e=>!e)}loadQaSettings(){return P(this,null,function*(){this.qaSettingsLoading_$.set(!0);try{let e=yield this.voiceSttQaUi_DS.loadSttQaSettingsPanelState(),t=e.qa;this.qaSettings_$.set(t),this.confusionMapList_$.set([...t.confusionMap??[]]),this.settingsQaEnabled=t.qaEnabled===!0,this.isQaEnabledFromSettings_$.set(t.qaEnabled===!0),this.qaProviderName=t.providerName??"",this.qaModelName=t.modelName??"",this.llmProviderSelectOptions_$.set(e.llmProviderSelectOptions),this.defaultLlmProvider_$.set(e.defaultLlmProvider),this.defaultLlmModel_$.set(e.defaultLlmModel),this.qaModelsForProvider_$.set(e.qaModelsForProvider),this.qaModelsListFetchError_$.set(e.qaModelsListFetchError)}catch(e){this.globalError_CS.showError(e,"ccap-voice-record-button"),this.qaSettings_$.set(null),this.confusionMapList_$.set([]),this.llmProviderSelectOptions_$.set([]),this.qaModelsListFetchError_$.set(""),this.qaModelsForProvider_$.set([])}finally{this.qaSettingsLoading_$.set(!1)}})}loadQaModelsForProvider(e){return P(this,null,function*(){let t=yield this.voiceSttQaUi_DS.fetchLlmModelsListForSttQa(e);this.qaModelsForProvider_$.set(t.models),this.qaModelsListFetchError_$.set(t.errorMessage)})}onQaProviderChange(){this.loadQaModelsForProvider(this.qaProviderName),this.qaModelName=""}addConfusionEntry(){this.confusionMapList_$.update(e=>[...e,{from:"",to:""}])}removeConfusionEntry(e){this.confusionMapList_$.update(t=>t.filter((i,a)=>a!==e))}updateConfusionFrom(e,t){this.confusionMapList_$.update(i=>{let a=[...i];return a[e]&&(a[e]={from:t,to:a[e].to}),a})}updateConfusionTo(e,t){this.confusionMapList_$.update(i=>{let a=[...i];return a[e]&&(a[e]={from:a[e].from,to:t}),a})}saveQaSettings(){return P(this,null,function*(){this.qaSettingsSaving_$.set(!0);try{let e=this.voiceSttQaUi_DS.normalizeConfusionMapEntries(this.confusionMapList_$());yield this.voiceSttQaUi_DS.saveVoiceNotesQaSettings({confusionMap:e,providerName:this.qaProviderName.trim()||void 0,modelName:this.qaModelName.trim()||void 0,qaEnabled:this.settingsQaEnabled}),this.confusionMapList_$.set([...e]),this.isQaEnabledFromSettings_$.set(this.settingsQaEnabled);let t=this.qaSettings_$();t!==null&&this.qaSettings_$.set({systemPrompt:t.systemPrompt,userPromptTemplate:t.userPromptTemplate,confusionMap:e,providerName:this.qaProviderName.trim()||"",modelName:this.qaModelName.trim()||"",qaEnabled:this.settingsQaEnabled})}catch(e){this.globalError_CS.showError(e,"ccap-voice-record-button")}finally{this.qaSettingsSaving_$.set(!1)}})}onEscape(){this.settingsOpen_$()&&this.settingsOpen_$.set(!1),this.infoOpen_$()&&this.infoOpen_$.set(!1)}effectiveQaEnabled_$=v(()=>this.qaEnabled()!==void 0?this.qaEnabled():this.isQaEnabledFromSettings_$());onChunk(e,t){return P(this,null,function*(){this.pendingTranscriptionCount++,this.busy_$.set(!0);let i=this.emitChain,a=()=>{};this.emitChain=new Promise(u=>{a=u});try{let u=yield this.voiceSttQaUi_DS.transcribeVoiceChunk({blob:e,mimeType:t.mimeType,filename:t.filename,qaEnabled:this.effectiveQaEnabled_$(),noteContext:"",skipClassification:!0});if(yield i,u.ok===!1){this.transcriptSegmentReady.emit({text:"",isFinal:t.isFinal});return}let _=u;if(_.qaFailed===!0){let b=_.qaFailureMessage?.trim()??"";b.length>0&&this.globalError_CS.showError(new Error(b),"voice-stt-qa")}let w=_.correctedTranscript!=null&&_.correctedTranscript.trim().length>0?_.correctedTranscript.trim():(_.transcript??"").trim();_.usedQa===!0&&(_.transcript??"").trim().length>0&&(_.correctedTranscript??"").trim().length>0&&this.lastQaTransformation_$.set({original:(_.transcript??"").trim(),corrected:(_.correctedTranscript??"").trim(),explanation:(_.qaExplanation??"").trim()||void 0,input:_.qaInput}),w&&(this.transcriptReady.emit(w),this.transcriptSegmentReady.emit({text:w,isFinal:t.isFinal}))}catch(u){this.globalError_CS.showError(u,"ccap-voice-record-button")}finally{a(),this.pendingTranscriptionCount--,this.pendingTranscriptionCount<=0&&(this.pendingTranscriptionCount=0,this.busy_$.set(!1))}})}recordStateLabel_$=v(()=>this.soundRecorder_CS.state_$()===R.stopped?"Felv\xE9tel":"Stop");isRecordActive_$=v(()=>{let e=this.soundRecorder_CS.state_$();return e===R.standby||e===R.running});isRecording_$=v(()=>this.soundRecorder_CS.state_$()===R.running);recordButtonAriaLabel_$=v(()=>{let e=this.mediaUnavailable_$();return e||(this.isRecordActive_$()?"Stop":this.busy_$()?"\xDAj felv\xE9tel (feldolgoz\xE1s folyamatban)":"Felv\xE9tel")});recordButtonTitle_$=v(()=>{let e=this.mediaUnavailable_$();return e||(this.isRecordActive_$()?"Stop":this.busy_$()?"\xDAj felv\xE9tel \u2014 el\u0151z\u0151 feldolgoz\xE1s folyamatban":"Felv\xE9tel")});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Y({type:n,selectors:[["app-ccap-voice-record-button"]],hostBindings:function(t,i){t&1&&m("keydown.escape",function(){return i.onEscape()},!1,ee)},inputs:{qaEnabled:[1,"qaEnabled"],compactLayout:[1,"compactLayout"]},outputs:{transcriptReady:"transcriptReady",transcriptSegmentReady:"transcriptSegmentReady"},standalone:!0,features:[ae],decls:25,vars:14,consts:[[1,"flex","flex-col","items-center","gap-1"],[3,"closed","isOpen","title","maxWidth","zIndex","bodyFlexColumn"],[1,"flex","flex-col","flex-1","min-h-0","w-full","overflow-y-auto","overflow-x-hidden","overscroll-y-contain"],[1,"flex","flex-col","gap-2","shrink-0"],[1,"flex","items-center","gap-2","cursor-pointer","select-none"],["type","checkbox","name","settingsQaEnabled",3,"ngModelChange","ngModel"],[1,"text-sm","text-neutral-300"],["type","checkbox","name","autoSendAfterVoice",3,"ngModelChange","ngModel"],[1,"mt-3","pt-3","border-t","border-neonDefault","flex","flex-col","gap-3","shrink-0"],[1,"mt-3","pt-3","border-t","border-neonDefault","text-xs","text-neutral-400"],["modal-footer","",1,"shrink-0","px-4","py-3","border-t","border-neonDefault"],["type","button",1,"w-full","px-3","py-1.5","text-sm","border","border-neonCyan","rounded","text-neutral-300","hover:shadow-neon-glow-cyan","transition-colors",3,"click"],[3,"closed","isOpen","title","maxWidth","zIndex"],[1,"space-y-2","text-sm"],[1,"text-xs","text-neutral-500"],[1,"flex","items-center","gap-2"],["type","button","aria-label","Be\xE1ll\xEDt\xE1sok","title","Be\xE1ll\xEDt\xE1sok",1,"w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","border-neonDefault","text-neonCyan","hover:border-neonCyan","hover:shadow-neon-glow-cyan","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-2.5","h-2.5","shrink-0"],["d","M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"],["d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"],["type","button",1,"w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["cx","12","cy","12","r","10"],["d","M12 16v-4"],["d","M12 8h.01"],["type","button",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-neutral-900","border-2","text-white","transition-all","duration-200","disabled:opacity-50","border-neonDefault","hover:border-neonCyan","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-neonCyan/40","border-t-neonCyan"],[1,"flex","flex-col","items-center","gap-0.5","shrink-0"],[1,"text-[11px]","text-amber-300","leading-tight","max-w-[180px]","text-center"],["aria-hidden","true",1,"relative","w-2","h-6","rounded-sm","bg-neutral-800","overflow-hidden"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0","text-neonCyan"],["d","M12 2a3 3 0 0 1 3 3v7a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z"],["d","M19 10v2a7 7 0 0 1-14 0v-2"],["x1","12","y1","19","x2","12","y2","22"],[1,"absolute","inset-x-0","bottom-0","bg-neonCyan","transition-[height]","duration-75"],[1,"absolute","inset-x-0","h-0.5","bg-neonAmber","rounded-sm","z-10",2,"bottom","5%"],["aria-hidden","true",1,"mr-1"],[1,"relative","inline-flex"],["type","button","aria-label","Be\xE1ll\xEDt\xE1sok","title","Be\xE1ll\xEDt\xE1sok",1,"absolute","right-full","mr-4","top-1/2","-translate-y-1/2","w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","border-neonDefault","text-neonCyan","hover:border-neonCyan","hover:shadow-neon-glow-cyan","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["type","button",1,"absolute","left-full","ml-4","top-1/2","-translate-y-1/2","w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],[1,"text-[11px]","text-amber-300","leading-tight","max-w-[240px]","mt-1"],[1,"shrink-0"],[1,"text-xs","font-medium","text-neutral-400","mb-1"],[1,"text-xs","text-neutral-300","whitespace-pre-wrap","break-words"],[1,"text-xs","text-neutral-300","whitespace-pre-wrap","break-words","font-mono"],[1,"text-[10px]","text-neonAmber","mt-1"],[1,"text-[10px]","text-neutral-500","mb-1"],[1,"flex","flex-wrap","gap-2","items-center"],["name","qaProviderName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[120px]",3,"ngModelChange","ngModel"],["value",""],[3,"value"],["name","qaModelName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]",3,"ngModel"],["type","text","name","qaModelNameText","placeholder","Modell id (lista nem el\xE9rhet\u0151 ehhez a providerhez)",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]","font-mono",3,"ngModel"],[1,"text-[10px]","text-amber-300/90","mt-1"],[1,"flex","flex-col","shrink-0"],[1,"text-xs","font-medium","text-neutral-400","mb-1","shrink-0"],[1,"space-y-1.5","rounded","border","border-neonDefault/50","bg-neutral-800/20","p-2"],[1,"flex","flex-wrap","gap-2","items-center","shrink-0","mt-2"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","rounded","text-neutral-400","hover:border-neonCyan","hover:text-neonCyan","transition-colors",3,"click"],["type","button",1,"px-2","py-1","text-xs","border","border-neonCyan","rounded","text-neonCyan","hover:shadow-neon-glow-cyan","disabled:opacity-50","transition-colors",3,"click","disabled"],["name","qaModelName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]",3,"ngModelChange","ngModel"],["type","text","name","qaModelNameText","placeholder","Modell id (lista nem el\xE9rhet\u0151 ehhez a providerhez)",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]","font-mono",3,"ngModelChange","ngModel"],["type","text","placeholder","El\xEDr\xE1s / f\xE9lrehall\xE1s",1,"flex-1","min-w-0","px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","placeholder-neutral-500",3,"input","value"],[1,"text-neutral-500","shrink-0"],["type","text","placeholder","Helyes forma",1,"flex-1","min-w-0","px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","placeholder-neutral-500",3,"input","value"],["type","button","aria-label","Sor t\xF6rl\xE9se","title","Sor t\xF6rl\xE9se",1,"shrink-0","p-1","text-neutral-500","hover:text-neonRed","transition-colors",3,"click"],[1,"sr-only"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"mt-3","pt-3","border-t","border-neonDefault","text-xs","text-neutral-500"],["type","button",1,"mt-1.5","px-2","py-1","text-xs","border","border-neonDefault","rounded","text-neutral-400","hover:border-neonCyan","hover:text-neonCyan","transition-colors",3,"click"],[1,"rounded-md","border","border-neonAmber/45","bg-neutral-950/95","p-2.5","mb-1"],[1,"font-medium","text-neonAmber"],[1,"text-neutral-400","text-xs"],[1,"text-neutral-200","break-words"],[1,"text-neutral-400","text-xs","mt-2"],[1,"text-[10px]","font-semibold","uppercase","tracking-wide","text-neonAmber/90","mb-1.5"],[1,"text-xs","leading-relaxed","whitespace-pre-wrap","break-words"],[1,"text-[10px]","text-neutral-500","mt-1.5","leading-snug"],[1,"text-neutral-300"],[1,"mx-0.5","inline","rounded","px-0.5","text-red-300/95","line-through","decoration-red-400/85","bg-red-950/50","border","border-red-900/45"],[1,"mx-0.5","inline","rounded","px-0.5","text-neonAmber","bg-amber-950/55","border","border-neonAmber/50","shadow-[0_0_10px_rgb(251_191_36/0.28)]"],[1,"text-neutral-300","break-words"]],template:function(t,i){if(t&1&&(C(0,Ae,15,35,"div",0)(1,Re,14,35),o(2,"app-s-modal",1),m("closed",function(){return i.settingsOpen_$.set(!1)}),o(3,"div",2)(4,"div",3)(5,"label",4)(6,"input",5),O("ngModelChange",function(u){return W(i.settingsQaEnabled,u)||(i.settingsQaEnabled=u),u}),r(),o(7,"span",6),d(8,"STT QA"),r()(),o(9,"label",4)(10,"input",7),m("ngModelChange",function(u){return i.handleAutoSendAfterVoiceChange(u)}),r(),o(11,"span",6),d(12,"Send immediately after voice (Mimik-style)"),r()()(),C(13,Oe,38,11,"div",8)(14,Ie,2,0,"p",9)(15,ze,4,0),r(),o(16,"div",10)(17,"button",11),m("click",function(){return i.settingsOpen_$.set(!1)}),d(18," Bez\xE1r\xE1s "),r()()(),o(19,"app-s-modal",12),m("closed",function(){return i.infoOpen_$.set(!1)}),C(20,Ze,13,4,"div",13)(21,Xe,2,0,"p",14),o(22,"div",10)(23,"button",11),m("click",function(){return i.infoOpen_$.set(!1)}),d(24," Bez\xE1r\xE1s "),r()()()),t&2){let a,u;g(i.compactLayout()?0:1),l(2),y("isOpen",i.settingsOpen_$())("title","Voice Input be\xE1ll\xEDt\xE1sok")("maxWidth","lg")("zIndex","40")("bodyFlexColumn",!0),l(4),N("ngModel",i.settingsQaEnabled),l(4),y("ngModel",i.voiceInputUi_DS.autoSendAfterVoice_$()),l(3),g((a=i.qaSettings_$())?13:i.qaSettingsLoading_$()?14:15,a),l(6),y("isOpen",i.infoOpen_$())("title","Utols\xF3 QA eredm\xE9ny")("maxWidth","md")("zIndex","40"),l(),g((u=i.lastQaTransformation_$())?20:21,u)}},dependencies:[pe,_e,me,se,le,ue,de,ce,xe],encapsulation:2})}return n})();export{be as a,vt as b};
2
- //# sourceMappingURL=chunk-ZKIPL7J4.js.map
1
+ import{a as R,b as z,c as Ce}from"./chunk-VEPJ3MZH.js";import{c as ge}from"./chunk-AE5VAS75.js";import{a as xe}from"./chunk-FLAJXIYW.js";import{b as le,c as se,f as de,i as ce,n as ue,o as _e,p as me,v as pe}from"./chunk-EO4DNTT4.js";import{a as K}from"./chunk-5UPNU54P.js";import{j as fe}from"./chunk-WXN5C3BS.js";import{C as q,D as Y,Fa as d,Ga as $,Ha as L,Ia as ie,J as f,Ja as oe,K as x,Ka as re,L as A,M as I,Ma as N,Na as W,Oa as O,Q as j,Ta as ae,U as H,Y as ee,Z as l,aa as p,da as C,fa as V,ga as y,ha as G,hb as v,ia as F,k as P,la as g,ma as te,na as ne,oa as B,pa as D,qa as o,ra as r,sa as S,ua as T,va as m,wa as c,y as X}from"./chunk-TBMJSIBB.js";var he="ccap-voiceInput:autoSendAfterVoice",be=(()=>{class n{autoSendAfterVoice_$=p(n.readAutoSendAfterVoiceFromStorage());setAutoSendAfterVoice(e){this.autoSendAfterVoice_$.set(e),K.writeString(he,String(e))}static readAutoSendAfterVoiceFromStorage(){return K.readString(he)==="true"}static \u0275fac=function(t){return new(t||n)};static \u0275prov=X({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var k=function(n){return n.equal="equal",n.removed="removed",n.added="added",n}(k||{});var U=class n{static tokenize(s){let e=s;if(e.length===0)return[];let t=e.split(/(\s+)/),i=[];for(let a=0;a<t.length;a++){let u=t[a];u.length>0&&i.push(u)}return i}static mergeAndAssignIds(s){if(s.length===0)return[];let e=[];for(let i=0;i<s.length;i++){let a=s[i],u=e[e.length-1];u!==void 0&&u.kind===a.kind?u.text=u.text+a.text:e.push({kind:a.kind,text:a.text})}let t=[];for(let i=0;i<e.length;i++){let a=e[i];t.push({id:i,kind:a.kind,text:a.text})}return t}static buildWordDiff(s,e){let t=n.tokenize(s),i=n.tokenize(e),a=t.length,u=i.length,_=[];for(let h=0;h<=a;h++){let E=[];for(let Q=0;Q<=u;Q++)E.push(0);_.push(E)}for(let h=1;h<=a;h++)for(let E=1;E<=u;E++)if(t[h-1]===i[E-1])_[h][E]=_[h-1][E-1]+1;else{let Q=_[h-1][E],Z=_[h][E-1];_[h][E]=Q>Z?Q:Z}let w=[],b=a,M=u;for(;b>0||M>0;)b>0&&M>0&&t[b-1]===i[M-1]?(w.push({kind:k.equal,text:t[b-1]}),b-=1,M-=1):M>0&&(b===0||_[b][M-1]>=_[b-1][M])?(w.push({kind:k.added,text:i[M-1]}),M-=1):b>0&&(w.push({kind:k.removed,text:t[b-1]}),b-=1);let J=[];for(let h=w.length-1;h>=0;h--)J.push(w[h]);return n.mergeAndAssignIds(J)}};var Se=(n,s)=>s.value,Ee=(n,s)=>s.id;function ye(n,s){n&1&&S(0,"span",25)}function $e(n,s){if(n&1&&(o(0,"div",28),S(1,"div",33)(2,"div",34),r()),n&2){let e=c(3);l(),G("height",e.volumePercent_$(),"%")}}function we(n,s){if(n&1&&(o(0,"div",26),C(1,$e,3,2,"div",28),A(),o(2,"svg",29),S(3,"path",30)(4,"path",31)(5,"line",32),r()()),n&2){let e=c(2);l(),g(e.isRecordActive_$()?1:-1)}}function Me(n,s){n&1&&(o(0,"p",27)(1,"span",35),d(2,"\u26A0"),r(),d(3),r()),n&2&&(V("aria-live","polite"),l(3),L("",s," "))}function Ae(n,s){if(n&1){let e=T();o(0,"div",0)(1,"div",15)(2,"button",16),m("click",function(i){return f(e),c().toggleSettings(),x(i.stopPropagation())}),A(),o(3,"svg",17),S(4,"path",18)(5,"path",19),r()(),I(),o(6,"button",20),m("click",function(i){return f(e),c().toggleInfo(),x(i.stopPropagation())}),A(),o(7,"svg",17),S(8,"circle",21)(9,"path",22)(10,"path",23),r()()(),I(),o(11,"button",24),m("click",function(){f(e);let i=c();return x(i.toggleRecord())}),C(12,ye,1,0,"span",25)(13,we,6,1,"div",26),r(),C(14,Me,4,2,"p",27),r()}if(n&2){let e,t=c();l(6),F("border-neonDefault",!t.lastQaTextWasModified_$())("text-neonCyan",!t.lastQaTextWasModified_$())("hover:border-neonCyan",!t.lastQaTextWasModified_$())("hover:shadow-neon-glow-cyan",!t.lastQaTextWasModified_$())("focus:ring-neonCyan",!t.lastQaTextWasModified_$())("border-neonAmber",t.lastQaTextWasModified_$())("text-neonAmber",t.lastQaTextWasModified_$())("shadow-neon-glow-orange",t.lastQaTextWasModified_$())("hover:border-neonAmber",t.lastQaTextWasModified_$())("hover:shadow-neon-glow-orange",t.lastQaTextWasModified_$())("focus:ring-neonAmber",t.lastQaTextWasModified_$()),V("aria-label",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult":"Utols\xF3 QA eredm\xE9ny")("title",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult (r\xE9szletek)":"Utols\xF3 QA eredm\xE9ny"),l(5),F("border-neonCyan",t.isRecordActive_$()||t.busy_$())("shadow-neon-glow-cyan",t.isRecordActive_$()||t.busy_$())("animate-pulse",t.isRecording_$()),y("disabled",t.mediaUnavailable_$()!==null),V("aria-label",t.recordButtonAriaLabel_$())("title",t.recordButtonTitle_$()),l(),g(t.busy_$()&&!t.isRecordActive_$()?12:13),l(2),g((e=t.mediaUnavailable_$())?14:-1,e)}}function Te(n,s){n&1&&S(0,"span",25)}function Pe(n,s){if(n&1&&(o(0,"div",28),S(1,"div",33)(2,"div",34),r()),n&2){let e=c(3);l(),G("height",e.volumePercent_$(),"%")}}function Ve(n,s){if(n&1&&(o(0,"div",26),C(1,Pe,3,2,"div",28),A(),o(2,"svg",29),S(3,"path",30)(4,"path",31)(5,"line",32),r()()),n&2){let e=c(2);l(),g(e.isRecordActive_$()?1:-1)}}function ke(n,s){n&1&&(o(0,"p",39)(1,"span",35),d(2,"\u26A0"),r(),d(3),r()),n&2&&(V("aria-live","polite"),l(3),L("",s," "))}function Re(n,s){if(n&1){let e=T();o(0,"div",36)(1,"button",24),m("click",function(){f(e);let i=c();return x(i.toggleRecord())}),C(2,Te,1,0,"span",25)(3,Ve,6,1,"div",26),r(),o(4,"button",37),m("click",function(i){return f(e),c().toggleSettings(),x(i.stopPropagation())}),A(),o(5,"svg",17),S(6,"path",18)(7,"path",19),r()(),I(),o(8,"button",38),m("click",function(i){return f(e),c().toggleInfo(),x(i.stopPropagation())}),A(),o(9,"svg",17),S(10,"circle",21)(11,"path",22)(12,"path",23),r()()(),C(13,ke,4,2,"p",39)}if(n&2){let e,t=c();l(),F("border-neonCyan",t.isRecordActive_$()||t.busy_$())("shadow-neon-glow-cyan",t.isRecordActive_$()||t.busy_$())("animate-pulse",t.isRecording_$()),y("disabled",t.mediaUnavailable_$()!==null),V("aria-label",t.recordButtonAriaLabel_$())("title",t.recordButtonTitle_$()),l(),g(t.busy_$()&&!t.isRecordActive_$()?2:3),l(6),F("border-neonDefault",!t.lastQaTextWasModified_$())("text-neonCyan",!t.lastQaTextWasModified_$())("hover:border-neonCyan",!t.lastQaTextWasModified_$())("hover:shadow-neon-glow-cyan",!t.lastQaTextWasModified_$())("focus:ring-neonCyan",!t.lastQaTextWasModified_$())("border-neonAmber",t.lastQaTextWasModified_$())("text-neonAmber",t.lastQaTextWasModified_$())("shadow-neon-glow-orange",t.lastQaTextWasModified_$())("hover:border-neonAmber",t.lastQaTextWasModified_$())("hover:shadow-neon-glow-orange",t.lastQaTextWasModified_$())("focus:ring-neonAmber",t.lastQaTextWasModified_$()),V("aria-label",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult":"Utols\xF3 QA eredm\xE9ny")("title",t.lastQaTextWasModified_$()?"Utols\xF3 QA eredm\xE9ny \u2014 a sz\xF6veg m\xF3dosult (r\xE9szletek)":"Utols\xF3 QA eredm\xE9ny"),l(5),g((e=t.mediaUnavailable_$())?13:-1,e)}}function Qe(n,s){if(n&1&&(o(0,"p",45),d(1),r()),n&2){let e=c(2);l(),re(" Override: ",e.qaProviderDisplayLabel_$()," / ",e.qaModelName||"\u2014"," (glob\xE1l: ",e.defaultLlmProviderDisplayLabel_$()||"\u2014"," / ",e.defaultLlmModel_$()||"\u2014","). ")}}function qe(n,s){if(n&1&&(o(0,"p",45),d(1),r()),n&2){let e=c(2);l(),ie(" Nincs be\xE1ll\xEDtva \u2013 haszn\xE1lt: ",e.defaultLlmProviderDisplayLabel_$()||"\u2014"," / ",e.defaultLlmModel_$()||"\u2014"," (glob\xE1l). ")}}function Fe(n,s){if(n&1&&(o(0,"option",49),d(1),r()),n&2){let e=s.$implicit;y("value",e.value),l(),$(e.label)}}function Be(n,s){if(n&1&&(o(0,"option",49),d(1),r()),n&2){let e=s.$implicit;y("value",e),l(),$(e)}}function De(n,s){if(n&1){let e=T();o(0,"select",59),O("ngModelChange",function(i){f(e);let a=c(2);return W(a.qaModelName,i)||(a.qaModelName=i),x(i)}),o(1,"option",48),d(2,"\u2014 default \u2014"),r(),B(3,Be,2,2,"option",49,ne),r()}if(n&2){let e=c(2);N("ngModel",e.qaModelName),l(3),D(e.qaModelsForProvider_$())}}function Le(n,s){if(n&1){let e=T();o(0,"input",60),O("ngModelChange",function(i){f(e);let a=c(2);return W(a.qaModelName,i)||(a.qaModelName=i),x(i)}),r()}if(n&2){let e=c(2);N("ngModel",e.qaModelName)}}function Ne(n,s){if(n&1&&(o(0,"p",52),d(1),r()),n&2){let e=c(2);l(),$(e.qaModelsListFetchError_$())}}function We(n,s){if(n&1){let e=T();o(0,"div",15)(1,"input",61),m("input",function(i){let a=f(e).$index,u=c(2);return x(u.updateConfusionFrom(a,i.target.value))}),r(),o(2,"span",62),d(3,"\u2192"),r(),o(4,"input",63),m("input",function(i){let a=f(e).$index,u=c(2);return x(u.updateConfusionTo(a,i.target.value))}),r(),o(5,"button",64),m("click",function(){let i=f(e).$index,a=c(2);return x(a.removeConfusionEntry(i))}),o(6,"span",65),d(7,"T\xF6rl\xE9s"),r(),A(),o(8,"svg",66),S(9,"path",67),r()()()}if(n&2){let e=s.$implicit;l(),y("value",e.from),l(3),y("value",e.to)}}function Oe(n,s){if(n&1){let e=T();o(0,"div",8)(1,"div",40)(2,"p",41),d(3,"System prompt (LLM-nek)"),r(),o(4,"p",42),d(5),r()(),o(6,"div",40)(7,"p",41),d(8," User prompt sablon (ide f\u0171z\u0151dik be a felv\xE9tel adata) "),r(),o(9,"p",43),d(10),r(),o(11,"p",44),d(12),r()(),o(13,"div",40)(14,"p",41),d(15,"STT QA provider \xE9s modell"),r(),C(16,Qe,2,4,"p",45)(17,qe,2,2,"p",45),o(18,"div",46)(19,"select",47),O("ngModelChange",function(i){f(e);let a=c();return W(a.qaProviderName,i)||(a.qaProviderName=i),x(i)}),m("ngModelChange",function(){f(e);let i=c();return x(i.onQaProviderChange())}),o(20,"option",48),d(21,"\u2014 default \u2014"),r(),B(22,Fe,2,2,"option",49,Se),r(),C(24,De,5,1,"select",50)(25,Le,1,1,"input",51),r(),C(26,Ne,2,1,"p",52),r(),o(27,"div",53)(28,"p",54),d(29," Tipikus el\xEDr\xE1sok / tip\xF3k (confusion map) \u2013 ezekre jav\xEDt a QA "),r(),o(30,"div",55),B(31,We,10,2,"div",15,te),r(),o(33,"div",56)(34,"button",57),m("click",function(){f(e);let i=c();return x(i.addConfusionEntry())}),d(35," + Sor hozz\xE1ad\xE1sa "),r(),o(36,"button",58),m("click",function(){f(e);let i=c();return x(i.saveQaSettings())}),d(37),r()()()()}if(n&2){let e=s,t=c();l(5),$(e.systemPrompt),l(5),L(" ",e.userPromptTemplate," "),l(2),oe(" Placeholderek: ","{{TRANSCRIPT}}"," = nyers sz\xF6veg, ","{{NOTE_CONTEXT}}"," = jegyzet, ","{{CONFUSION_MAP}}"," = az al\xE1bbi el\xEDr\xE1s lista JSON-ban. "),l(4),g(t.qaProviderName.trim()?16:17),l(3),N("ngModel",t.qaProviderName),l(3),D(t.llmProviderSelectOptions_$()),l(2),g(t.qaShowModelSelect_$()?24:25),l(2),g(t.qaModelsListFetchError_$().trim()?26:-1),l(5),D(t.confusionMapList_$()),l(5),y("disabled",t.qaSettingsSaving_$()),l(),L(" ",t.qaSettingsSaving_$()?"Ment\xE9s\u2026":"QA be\xE1ll\xEDt\xE1sok ment\xE9se"," ")}}function Ie(n,s){n&1&&(o(0,"p",9),d(1,"QA be\xE1ll\xEDt\xE1sok bet\xF6lt\xE9se\u2026"),r())}function ze(n,s){if(n&1){let e=T();o(0,"p",68),d(1," A QA be\xE1ll\xEDt\xE1sok bet\xF6lt\xE9se sikertelen. "),r(),o(2,"button",69),m("click",function(){f(e);let i=c();return x(i.loadQaSettings())}),d(3," \xDAjra bet\xF6lt\xE9s "),r()}}function Ue(n,s){if(n&1&&(o(0,"span",78),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function je(n,s){if(n&1&&(o(0,"span",79),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function He(n,s){if(n&1&&(o(0,"span",80),d(1),r()),n&2){let e=c().$implicit;l(),$(e.text)}}function Ge(n,s){if(n&1&&C(0,Ue,2,1,"span",78)(1,je,2,1,"span",79)(2,He,2,1,"span",80),n&2){let e=s.$implicit,t=c(3);g(e.kind===t.SttQaDiffKind.equal?0:e.kind===t.SttQaDiffKind.removed?1:2)}}function Ke(n,s){if(n&1&&(o(0,"div",70)(1,"p",75),d(2," V\xE1ltoz\xE1sok (kiemelve) "),r(),o(3,"p",76),B(4,Ge,3,1,null,null,Ee),r(),o(6,"p",77),d(7," \xC1th\xFAzva: nyers STT; kiemelve: jav\xEDtott sz\xF6veg. Al\xE1bb a teljes k\xE9t v\xE1ltozat. "),r()()),n&2){let e=c(2);l(4),D(e.lastQaWordDiffSegments_$())}}function Je(n,s){if(n&1&&(o(0,"p",74),d(1,"Magyar\xE1zat:"),r(),o(2,"p",81),d(3),r()),n&2){let e=c();l(3),$(e.explanation)}}function Ze(n,s){if(n&1&&(o(0,"div",13),C(1,Ke,8,0,"div",70),o(2,"p",71),d(3,"Volt m\xF3dos\xEDt\xE1s: igen."),r(),o(4,"p",72),d(5,"Eredeti (nyers STT):"),r(),o(6,"p",73),d(7),r(),o(8,"p",74),d(9,"Jav\xEDtott:"),r(),o(10,"p",73),d(11),r(),C(12,Je,4,1),r()),n&2){let e=s,t=c();l(),g(t.lastQaWordDiffSegments_$().length>0?1:-1),l(6),$(e.original),l(4),$(e.corrected),l(),g(e.explanation?12:-1)}}function Xe(n,s){n&1&&(o(0,"p",14),d(1," M\xE9g nem volt STT QA jav\xEDt\xE1s. "),r())}var vt=(()=>{class n{globalError_CS=q(fe);soundRecorder_CS=q(Ce);voiceSttQaUi_DS=q(ge);voiceInputUi_DS=q(be);qaEnabled=H(void 0);compactLayout=H(!1);transcriptReady=new j;transcriptSegmentReady=new j;busy_$=p(!1);pendingTranscriptionCount=0;emitChain=Promise.resolve();volume_$=p(0);isQaEnabledFromSettings_$=p(!1);settingsOpen_$=p(!1);qaSettings_$=p(null);confusionMapList_$=p([]);qaSettingsSaving_$=p(!1);qaSettingsLoading_$=p(!1);settingsQaEnabled=!1;qaProviderName="";qaModelName="";llmProviderSelectOptions_$=p([]);qaModelsForProvider_$=p([]);qaModelsListFetchError_$=p("");lastQaTransformation_$=p(null);infoOpen_$=p(!1);mediaUnavailable_$=p(null);defaultLlmProvider_$=p("");defaultLlmModel_$=p("");volumePercent_$=v(()=>Math.min(100,this.volume_$()*250));qaShowModelSelect_$=v(()=>this.qaModelsForProvider_$().length>0);lastQaTextWasModified_$=v(()=>{let e=this.lastQaTransformation_$();return e===null?!1:e.original!==e.corrected});lastQaWordDiffSegments_$=v(()=>{let e=this.lastQaTransformation_$();return e===null||e.original===e.corrected?[]:U.buildWordDiff(e.original,e.corrected)});SttQaDiffKind=k;defaultLlmProviderDisplayLabel_$=v(()=>{let e=this.llmProviderSelectOptions_$(),t=this.defaultLlmProvider_$().trim();return t.length?e.find(a=>a.value===t)?.label??t:""});qaProviderDisplayLabel_$=v(()=>{let e=this.qaProviderName.trim();return e.length?this.llmProviderSelectOptions_$().find(a=>a.value===e)?.label??e:""});ngOnInit(){let e=z.getMediaRecordingAvailability();if(!e.supported&&e.reason){let t=e.reason;this.mediaUnavailable_$.set(z.getMediaUnavailableMessage(t)),this.globalError_CS.reportErrorOnly({message:z.getMediaUnavailableReportMessage(t),source:"ccap-voice-record-button"})}this.soundRecorder_CS.setOnChunk((t,i)=>{this.onChunk(t,i)}),this.soundRecorder_CS.setOnVolume(t=>{this.volume_$.set(t)}),this.soundRecorder_CS.setOnError(t=>{this.globalError_CS.showError(t,"ccap-voice-record-button")})}ngOnDestroy(){this.soundRecorder_CS.stopListening()}toggleRecord(){return P(this,null,function*(){if(this.mediaUnavailable_$()!==null)return;if(this.soundRecorder_CS.state_$()===R.stopped){this.qaEnabled()===void 0&&(yield this.loadQaEnabledOnce());try{yield this.soundRecorder_CS.startListening()}catch(t){this.globalError_CS.showError(t,"ccap-voice-record-button")}}else this.soundRecorder_CS.stopListening()})}loadQaEnabledOnce(){return P(this,null,function*(){this.isQaEnabledFromSettings_$.set(yield this.voiceSttQaUi_DS.fetchQaEnabledFlag())})}handleAutoSendAfterVoiceChange(e){this.voiceInputUi_DS.setAutoSendAfterVoice(e)}toggleSettings(){this.settingsOpen_$.update(e=>!e),this.settingsOpen_$()&&this.loadQaSettings()}toggleInfo(){this.infoOpen_$.update(e=>!e)}loadQaSettings(){return P(this,null,function*(){this.qaSettingsLoading_$.set(!0);try{let e=yield this.voiceSttQaUi_DS.loadSttQaSettingsPanelState(),t=e.qa;this.qaSettings_$.set(t),this.confusionMapList_$.set([...t.confusionMap??[]]),this.settingsQaEnabled=t.qaEnabled===!0,this.isQaEnabledFromSettings_$.set(t.qaEnabled===!0),this.qaProviderName=t.providerName??"",this.qaModelName=t.modelName??"",this.llmProviderSelectOptions_$.set(e.llmProviderSelectOptions),this.defaultLlmProvider_$.set(e.defaultLlmProvider),this.defaultLlmModel_$.set(e.defaultLlmModel),this.qaModelsForProvider_$.set(e.qaModelsForProvider),this.qaModelsListFetchError_$.set(e.qaModelsListFetchError)}catch(e){this.globalError_CS.showError(e,"ccap-voice-record-button"),this.qaSettings_$.set(null),this.confusionMapList_$.set([]),this.llmProviderSelectOptions_$.set([]),this.qaModelsListFetchError_$.set(""),this.qaModelsForProvider_$.set([])}finally{this.qaSettingsLoading_$.set(!1)}})}loadQaModelsForProvider(e){return P(this,null,function*(){let t=yield this.voiceSttQaUi_DS.fetchLlmModelsListForSttQa(e);this.qaModelsForProvider_$.set(t.models),this.qaModelsListFetchError_$.set(t.errorMessage)})}onQaProviderChange(){this.loadQaModelsForProvider(this.qaProviderName),this.qaModelName=""}addConfusionEntry(){this.confusionMapList_$.update(e=>[...e,{from:"",to:""}])}removeConfusionEntry(e){this.confusionMapList_$.update(t=>t.filter((i,a)=>a!==e))}updateConfusionFrom(e,t){this.confusionMapList_$.update(i=>{let a=[...i];return a[e]&&(a[e]={from:t,to:a[e].to}),a})}updateConfusionTo(e,t){this.confusionMapList_$.update(i=>{let a=[...i];return a[e]&&(a[e]={from:a[e].from,to:t}),a})}saveQaSettings(){return P(this,null,function*(){this.qaSettingsSaving_$.set(!0);try{let e=this.voiceSttQaUi_DS.normalizeConfusionMapEntries(this.confusionMapList_$());yield this.voiceSttQaUi_DS.saveVoiceNotesQaSettings({confusionMap:e,providerName:this.qaProviderName.trim()||void 0,modelName:this.qaModelName.trim()||void 0,qaEnabled:this.settingsQaEnabled}),this.confusionMapList_$.set([...e]),this.isQaEnabledFromSettings_$.set(this.settingsQaEnabled);let t=this.qaSettings_$();t!==null&&this.qaSettings_$.set({systemPrompt:t.systemPrompt,userPromptTemplate:t.userPromptTemplate,confusionMap:e,providerName:this.qaProviderName.trim()||"",modelName:this.qaModelName.trim()||"",qaEnabled:this.settingsQaEnabled})}catch(e){this.globalError_CS.showError(e,"ccap-voice-record-button")}finally{this.qaSettingsSaving_$.set(!1)}})}onEscape(){this.settingsOpen_$()&&this.settingsOpen_$.set(!1),this.infoOpen_$()&&this.infoOpen_$.set(!1)}effectiveQaEnabled_$=v(()=>this.qaEnabled()!==void 0?this.qaEnabled():this.isQaEnabledFromSettings_$());onChunk(e,t){return P(this,null,function*(){this.pendingTranscriptionCount++,this.busy_$.set(!0);let i=this.emitChain,a=()=>{};this.emitChain=new Promise(u=>{a=u});try{let u=yield this.voiceSttQaUi_DS.transcribeVoiceChunk({blob:e,mimeType:t.mimeType,filename:t.filename,qaEnabled:this.effectiveQaEnabled_$(),noteContext:"",skipClassification:!0});if(yield i,u.ok===!1){this.transcriptSegmentReady.emit({text:"",isFinal:t.isFinal});return}let _=u;if(_.qaFailed===!0){let b=_.qaFailureMessage?.trim()??"";b.length>0&&this.globalError_CS.showError(new Error(b),"voice-stt-qa")}let w=_.correctedTranscript!=null&&_.correctedTranscript.trim().length>0?_.correctedTranscript.trim():(_.transcript??"").trim();_.usedQa===!0&&(_.transcript??"").trim().length>0&&(_.correctedTranscript??"").trim().length>0&&this.lastQaTransformation_$.set({original:(_.transcript??"").trim(),corrected:(_.correctedTranscript??"").trim(),explanation:(_.qaExplanation??"").trim()||void 0,input:_.qaInput}),w&&(this.transcriptReady.emit(w),this.transcriptSegmentReady.emit({text:w,isFinal:t.isFinal}))}catch(u){this.globalError_CS.showError(u,"ccap-voice-record-button")}finally{a(),this.pendingTranscriptionCount--,this.pendingTranscriptionCount<=0&&(this.pendingTranscriptionCount=0,this.busy_$.set(!1))}})}recordStateLabel_$=v(()=>this.soundRecorder_CS.state_$()===R.stopped?"Felv\xE9tel":"Stop");isRecordActive_$=v(()=>{let e=this.soundRecorder_CS.state_$();return e===R.standby||e===R.running});isRecording_$=v(()=>this.soundRecorder_CS.state_$()===R.running);recordButtonAriaLabel_$=v(()=>{let e=this.mediaUnavailable_$();return e||(this.isRecordActive_$()?"Stop":this.busy_$()?"\xDAj felv\xE9tel (feldolgoz\xE1s folyamatban)":"Felv\xE9tel")});recordButtonTitle_$=v(()=>{let e=this.mediaUnavailable_$();return e||(this.isRecordActive_$()?"Stop":this.busy_$()?"\xDAj felv\xE9tel \u2014 el\u0151z\u0151 feldolgoz\xE1s folyamatban":"Felv\xE9tel")});static \u0275fac=function(t){return new(t||n)};static \u0275cmp=Y({type:n,selectors:[["app-ccap-voice-record-button"]],hostBindings:function(t,i){t&1&&m("keydown.escape",function(){return i.onEscape()},!1,ee)},inputs:{qaEnabled:[1,"qaEnabled"],compactLayout:[1,"compactLayout"]},outputs:{transcriptReady:"transcriptReady",transcriptSegmentReady:"transcriptSegmentReady"},standalone:!0,features:[ae],decls:25,vars:14,consts:[[1,"flex","flex-col","items-center","gap-1"],[3,"closed","isOpen","title","maxWidth","zIndex","bodyFlexColumn"],[1,"flex","flex-col","flex-1","min-h-0","w-full","overflow-y-auto","overflow-x-hidden","overscroll-y-contain"],[1,"flex","flex-col","gap-2","shrink-0"],[1,"flex","items-center","gap-2","cursor-pointer","select-none"],["type","checkbox","name","settingsQaEnabled",3,"ngModelChange","ngModel"],[1,"text-sm","text-neutral-300"],["type","checkbox","name","autoSendAfterVoice",3,"ngModelChange","ngModel"],[1,"mt-3","pt-3","border-t","border-neonDefault","flex","flex-col","gap-3","shrink-0"],[1,"mt-3","pt-3","border-t","border-neonDefault","text-xs","text-neutral-400"],["modal-footer","",1,"shrink-0","px-4","py-3","border-t","border-neonDefault"],["type","button",1,"w-full","px-3","py-1.5","text-sm","border","border-neonCyan","rounded","text-neutral-300","hover:shadow-neon-glow-cyan","transition-colors",3,"click"],[3,"closed","isOpen","title","maxWidth","zIndex"],[1,"space-y-2","text-sm"],[1,"text-xs","text-neutral-500"],[1,"flex","items-center","gap-2"],["type","button","aria-label","Be\xE1ll\xEDt\xE1sok","title","Be\xE1ll\xEDt\xE1sok",1,"w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","border-neonDefault","text-neonCyan","hover:border-neonCyan","hover:shadow-neon-glow-cyan","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-2.5","h-2.5","shrink-0"],["d","M12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6Z"],["d","M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"],["type","button",1,"w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["cx","12","cy","12","r","10"],["d","M12 16v-4"],["d","M12 8h.01"],["type","button",1,"flex","items-center","justify-center","min-w-[44px]","min-h-[44px]","w-10","h-10","rounded-full","shrink-0","bg-neutral-900","border-2","text-white","transition-all","duration-200","disabled:opacity-50","border-neonDefault","hover:border-neonCyan","hover:shadow-neon-glow-cyan","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click","disabled"],["aria-hidden","true",1,"inline-block","w-5","h-5","shrink-0","animate-spin","rounded-full","border-2","border-neonCyan/40","border-t-neonCyan"],[1,"flex","flex-col","items-center","gap-0.5","shrink-0"],[1,"text-[11px]","text-amber-300","leading-tight","max-w-[180px]","text-center"],["aria-hidden","true",1,"relative","w-2","h-6","rounded-sm","bg-neutral-800","overflow-hidden"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-5","h-5","shrink-0","text-neonCyan"],["d","M12 2a3 3 0 0 1 3 3v7a3 3 0 0 1-6 0V5a3 3 0 0 1 3-3Z"],["d","M19 10v2a7 7 0 0 1-14 0v-2"],["x1","12","y1","19","x2","12","y2","22"],[1,"absolute","inset-x-0","bottom-0","bg-neonCyan","transition-[height]","duration-75"],[1,"absolute","inset-x-0","h-0.5","bg-neonAmber","rounded-sm","z-10",2,"bottom","5%"],["aria-hidden","true",1,"mr-1"],[1,"relative","inline-flex"],["type","button","aria-label","Be\xE1ll\xEDt\xE1sok","title","Be\xE1ll\xEDt\xE1sok",1,"absolute","right-full","mr-4","top-1/2","-translate-y-1/2","w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","border-neonDefault","text-neonCyan","hover:border-neonCyan","hover:shadow-neon-glow-cyan","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-neonCyan","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],["type","button",1,"absolute","left-full","ml-4","top-1/2","-translate-y-1/2","w-5","h-5","rounded-full","flex","items-center","justify-center","bg-neutral-900","border-2","transition-all","duration-200","focus:outline-none","focus:ring-2","focus:ring-offset-2","focus:ring-offset-neutral-900",3,"click"],[1,"text-[11px]","text-amber-300","leading-tight","max-w-[240px]","mt-1"],[1,"shrink-0"],[1,"text-xs","font-medium","text-neutral-400","mb-1"],[1,"text-xs","text-neutral-300","whitespace-pre-wrap","break-words"],[1,"text-xs","text-neutral-300","whitespace-pre-wrap","break-words","font-mono"],[1,"text-[10px]","text-neonAmber","mt-1"],[1,"text-[10px]","text-neutral-500","mb-1"],[1,"flex","flex-wrap","gap-2","items-center"],["name","qaProviderName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[120px]",3,"ngModelChange","ngModel"],["value",""],[3,"value"],["name","qaModelName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]",3,"ngModel"],["type","text","name","qaModelNameText","placeholder","Modell id (lista nem el\xE9rhet\u0151 ehhez a providerhez)",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]","font-mono",3,"ngModel"],[1,"text-[10px]","text-amber-300/90","mt-1"],[1,"flex","flex-col","shrink-0"],[1,"text-xs","font-medium","text-neutral-400","mb-1","shrink-0"],[1,"space-y-1.5","rounded","border","border-neonDefault/50","bg-neutral-800/20","p-2"],[1,"flex","flex-wrap","gap-2","items-center","shrink-0","mt-2"],["type","button",1,"px-2","py-1","text-xs","border","border-neonDefault","rounded","text-neutral-400","hover:border-neonCyan","hover:text-neonCyan","transition-colors",3,"click"],["type","button",1,"px-2","py-1","text-xs","border","border-neonCyan","rounded","text-neonCyan","hover:shadow-neon-glow-cyan","disabled:opacity-50","transition-colors",3,"click","disabled"],["name","qaModelName",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]",3,"ngModelChange","ngModel"],["type","text","name","qaModelNameText","placeholder","Modell id (lista nem el\xE9rhet\u0151 ehhez a providerhez)",1,"px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","min-w-[140px]","font-mono",3,"ngModelChange","ngModel"],["type","text","placeholder","El\xEDr\xE1s / f\xE9lrehall\xE1s",1,"flex-1","min-w-0","px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","placeholder-neutral-500",3,"input","value"],[1,"text-neutral-500","shrink-0"],["type","text","placeholder","Helyes forma",1,"flex-1","min-w-0","px-2","py-1","text-xs","bg-neutral-800","border","border-neonDefault","rounded","text-neutral-200","placeholder-neutral-500",3,"input","value"],["type","button","aria-label","Sor t\xF6rl\xE9se","title","Sor t\xF6rl\xE9se",1,"shrink-0","p-1","text-neutral-500","hover:text-neonRed","transition-colors",3,"click"],[1,"sr-only"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2",1,"w-3.5","h-3.5"],["d","M18 6L6 18M6 6l12 12"],[1,"mt-3","pt-3","border-t","border-neonDefault","text-xs","text-neutral-500"],["type","button",1,"mt-1.5","px-2","py-1","text-xs","border","border-neonDefault","rounded","text-neutral-400","hover:border-neonCyan","hover:text-neonCyan","transition-colors",3,"click"],[1,"rounded-md","border","border-neonAmber/45","bg-neutral-950/95","p-2.5","mb-1"],[1,"font-medium","text-neonAmber"],[1,"text-neutral-400","text-xs"],[1,"text-neutral-200","break-words"],[1,"text-neutral-400","text-xs","mt-2"],[1,"text-[10px]","font-semibold","uppercase","tracking-wide","text-neonAmber/90","mb-1.5"],[1,"text-xs","leading-relaxed","whitespace-pre-wrap","break-words"],[1,"text-[10px]","text-neutral-500","mt-1.5","leading-snug"],[1,"text-neutral-300"],[1,"mx-0.5","inline","rounded","px-0.5","text-red-300/95","line-through","decoration-red-400/85","bg-red-950/50","border","border-red-900/45"],[1,"mx-0.5","inline","rounded","px-0.5","text-neonAmber","bg-amber-950/55","border","border-neonAmber/50","shadow-[0_0_10px_rgb(251_191_36/0.28)]"],[1,"text-neutral-300","break-words"]],template:function(t,i){if(t&1&&(C(0,Ae,15,35,"div",0)(1,Re,14,35),o(2,"app-s-modal",1),m("closed",function(){return i.settingsOpen_$.set(!1)}),o(3,"div",2)(4,"div",3)(5,"label",4)(6,"input",5),O("ngModelChange",function(u){return W(i.settingsQaEnabled,u)||(i.settingsQaEnabled=u),u}),r(),o(7,"span",6),d(8,"STT QA"),r()(),o(9,"label",4)(10,"input",7),m("ngModelChange",function(u){return i.handleAutoSendAfterVoiceChange(u)}),r(),o(11,"span",6),d(12,"Send immediately after voice (Mimik-style)"),r()()(),C(13,Oe,38,11,"div",8)(14,Ie,2,0,"p",9)(15,ze,4,0),r(),o(16,"div",10)(17,"button",11),m("click",function(){return i.settingsOpen_$.set(!1)}),d(18," Bez\xE1r\xE1s "),r()()(),o(19,"app-s-modal",12),m("closed",function(){return i.infoOpen_$.set(!1)}),C(20,Ze,13,4,"div",13)(21,Xe,2,0,"p",14),o(22,"div",10)(23,"button",11),m("click",function(){return i.infoOpen_$.set(!1)}),d(24," Bez\xE1r\xE1s "),r()()()),t&2){let a,u;g(i.compactLayout()?0:1),l(2),y("isOpen",i.settingsOpen_$())("title","Voice Input be\xE1ll\xEDt\xE1sok")("maxWidth","lg")("zIndex","40")("bodyFlexColumn",!0),l(4),N("ngModel",i.settingsQaEnabled),l(4),y("ngModel",i.voiceInputUi_DS.autoSendAfterVoice_$()),l(3),g((a=i.qaSettings_$())?13:i.qaSettingsLoading_$()?14:15,a),l(6),y("isOpen",i.infoOpen_$())("title","Utols\xF3 QA eredm\xE9ny")("maxWidth","md")("zIndex","40"),l(),g((u=i.lastQaTransformation_$())?20:21,u)}},dependencies:[pe,_e,me,se,le,ue,de,ce,xe],encapsulation:2})}return n})();export{be as a,vt as b};
2
+ //# sourceMappingURL=chunk-MMFURH5P.js.map
@@ -1,4 +1,4 @@
1
- import{a as G}from"./chunk-3WAVQMV4.js";import{a as K}from"./chunk-RE5XOANX.js";import{e as F}from"./chunk-BPXKOVJB.js";import{h as f,j as U}from"./chunk-HWDURMDH.js";import{I as D,p as H}from"./chunk-WJQ3I2JP.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
1
+ import{a as G}from"./chunk-4CXFWMLH.js";import{a as K}from"./chunk-2VU3GISV.js";import{e as F}from"./chunk-FVNI46U2.js";import{h as f,j as U}from"./chunk-WXN5C3BS.js";import{I as D,p as H}from"./chunk-5N64HGRY.js";import{C as _,R as L,a as w,aa as p,b as $,d as k,h as O,k as h,p as d,vb as g,xb as P,y as M}from"./chunk-TBMJSIBB.js";var C=O(H());var I=(()=>{class l{static GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES=["timestamp","createdAt","updatedAt","ts","time","sentAt","messageTimestamp","created_at","updated_at","lastMessageAt","last_message_at","startedAt","started_at","lastActivityAt","last_activity_at"];static GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES=["lastActivityAt","updatedAt","lastMessageAt","updated_at","last_activity_at","last_message_at","startedAt","started_at","createdAt","created_at"];static GATEWAY_SESSION_STARTED_FIELD_NAMES=["startedAt","started_at","createdAt","created_at"];static GATEWAY_OUTPUT_ONLY_TIMESTAMP_FIELD_NAMES=["lastMessageAt","last_message_at","lastOutputAt","last_output_at"];static extractTimestamp(t,s){for(let e of s){let n=t[e];if(typeof n=="string"&&n)return n;if(typeof n=="number"&&n>0){let o=n<1e12?n*1e3:n;return new Date(o).toISOString()}}}}return l})();var E=class l{static buildGatewaySessionsFetch(y){let t=y.response._firstSessionKeys,s=Array.isArray(t)?t:[],e=Array.isArray(y.response.sessions)?y.response.sessions:[],n=e.map(i=>l.mapRawSessionToListItem({raw:i,gatewayUrl:y.response.gatewayUrl}));return{listItems:l.sortListItemsByLastActivityDesc({items:n}),rawSessions:e,gatewayUrl:y.response.gatewayUrl,source:y.response.source,instanceId:y.response.instanceId,firstSessionKeys:s}}static mapRawSessionToListItem(y){let t=y.raw;return{sessionId:typeof t.key=="string"?t.key:typeof t.sessionId=="string"?t.sessionId:typeof t.id=="string"?t.id:String(t.key??t.sessionId??t.id??""),label:typeof t.label=="string"?t.label:typeof t.name=="string"?t.name:typeof t.title=="string"?t.title:void 0,workspacePath:typeof t.workspacePath=="string"?t.workspacePath:typeof t.cwd=="string"?t.cwd:"",status:typeof t.status=="string"?t.status:"unknown",statusMessage:typeof t.statusMessage=="string"?t.statusMessage:void 0,gatewayUrl:y.gatewayUrl,openclawAgentName:typeof t.agentName=="string"?t.agentName:typeof t.agent=="string"?t.agent:void 0,promptCount:typeof t.promptCount=="number"?t.promptCount:typeof t.messageCount=="number"?t.messageCount:0,toolCallCount:typeof t.toolCallCount=="number"?t.toolCallCount:0,lastActivityAt:I.extractTimestamp(t,I.GATEWAY_SESSION_LAST_ACTIVITY_FIELD_NAMES),startedAt:I.extractTimestamp(t,I.GATEWAY_SESSION_STARTED_FIELD_NAMES),lastPrompt:typeof t.lastPrompt=="string"?t.lastPrompt:void 0,mode:typeof t.mode=="string"?t.mode:void 0,reasoningEffort:typeof t.reasoningEffort=="string"?t.reasoningEffort:typeof t.thinking=="string"?t.thinking:void 0,isArchived:typeof t.isArchived=="boolean"?t.isArchived:!1}}static sortListItemsByLastActivityDesc(y){return[...y.items].sort((t,s)=>{let e=t.lastActivityAt?new Date(t.lastActivityAt).getTime():0;return(s.lastActivityAt?new Date(s.lastActivityAt).getTime():0)-e})}};var N=(()=>{class l{baseUrl=`${D.api.baseUrl}/oc-session`;http=_(P);peiContext_DS=_(K);withCcapId(t){let s=this.peiContext_DS.activeCcapId_$();return s?t.set("ccapId",s):t}createSession(t){let s=this.withCcapId(new g);return d(this.http.post(this.baseUrl,t,{params:s}))}listSessions(t){let s=this.withCcapId(new g);return t?.status&&(s=s.set("status",t.status)),t?.workspacePath&&(s=s.set("workspacePath",t.workspacePath)),t?.gatewayUrl&&(s=s.set("gatewayUrl",t.gatewayUrl)),t?.includeArchived&&(s=s.set("includeArchived","1")),t?.limit!=null&&(s=s.set("limit",String(t.limit))),t?.offset!=null&&(s=s.set("offset",String(t.offset))),d(this.http.get(this.baseUrl,{params:s}))}listGatewaySessions(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions`,{params:s}))}getGatewaySessionHistory(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.get(`${this.baseUrl}/gateway-sessions/${t.sessionId}/history`,{params:s}))}sendGatewayPrompt(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/send`,{instanceId:t.instanceId,content:t.content,agentName:t.agentName}))}abortGatewaySession(t){return d(this.http.post(`${this.baseUrl}/gateway-sessions/${t.sessionId}/abort`,{instanceId:t.instanceId}))}deleteGatewaySession(t){let s=new g().set("instanceId",t.instanceId);return d(this.http.delete(`${this.baseUrl}/gateway-sessions/${t.sessionId}`,{params:s}))}getSession(t){let s=this.withCcapId(new g);return d(this.http.get(`${this.baseUrl}/${t.sessionId}`,{params:s}))}sendPrompt(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/prompt`,{content:t.content},{params:s}))}reconnectSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/reconnect`,{},{params:s}))}stopExecution(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/stop-execution`,{},{params:s}))}terminateSession(t){let s=this.withCcapId(new g);return d(this.http.post(`${this.baseUrl}/${t.sessionId}/terminate`,{},{params:s}))}updateSessionConfig(t){let o=t,{sessionId:s}=o,e=k(o,["sessionId"]),n=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${s}/config`,e,{params:n}))}setSessionArchived(t){let s=this.withCcapId(new g);return d(this.http.patch(`${this.baseUrl}/${t.sessionId}/archive`,{isArchived:t.isArchived},{params:s}))}getSessionEvents(t){let s=this.withCcapId(new g);return t.eventType&&(s=s.set("eventType",t.eventType)),t.since&&(s=s.set("since",t.since)),t.sinceSequence!=null&&(s=s.set("sinceSequence",String(t.sinceSequence))),t.limit!=null&&(s=s.set("limit",String(t.limit))),t.offset!=null&&(s=s.set("offset",String(t.offset))),t.latest&&(s=s.set("latest","1")),d(this.http.get(`${this.baseUrl}/${t.sessionId}/events`,{params:s}))}getSessionEventStreamUrl(t){let s=`${this.baseUrl}/${t.sessionId}/events/stream`,e=this.peiContext_DS.activeCcapId_$();return e?`${s}?ccapId=${encodeURIComponent(e)}`:s}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();var lt=(()=>{class l{sessions_$=p([]);sessionsLoading_$=p(!1);sessionsLoadError_$=p(null);selectedSession_$=p(null);selectedSessionLoading_$=p(!1);selectedSessionEvents_$=p([]);consoleMessages_$=p([]);assembledMessages_$=p([]);lastStatusUpdate_$=p(null);sessionUsage_$=p({inputTokens:0,outputTokens:0,costUsd:0});activeSessionId_$=p("");activeInstanceId_$=p("");gatewayFilter_$=p(null);extSessionMsg_AS=_(G);ocSession_AS=_(N);globalError_CS=_(U);socket_CS=_(F);ngZone=_(L);eventSubscription=null;reconnectSubscription=null;lastKnownEventSequence=-1;chatPollHandle=null;detailPollHandle=null;lastPolledHistoryFingerprint="";constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(t=>{this.handleSocketEvent(t)}),this.reconnectSubscription=this.socket_CS.connected$.subscribe(t=>{if(t){let s=this.activeSessionId_$();s&&(this.socket_CS.emit("oc-session:subscribe",{sessionId:s}),this.loadAssembledMessages({sessionId:s}).catch(()=>{})),this.backfillMissedEvents()}})}ngOnDestroy(){this.stopChatPolling(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.reconnectSubscription&&(this.reconnectSubscription.unsubscribe(),this.reconnectSubscription=null)}setGatewayFilter(t){this.gatewayFilter_$.set(t),this.loadSessions().catch(()=>{})}setGatewayFilterOnly(t){this.gatewayFilter_$.set(t)}loadSessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let e=[...(yield this.ocSession_AS.listSessions({status:t?.status,workspacePath:t?.workspacePath,gatewayUrl:this.gatewayFilter_$()??void 0,includeArchived:t?.includeArchived})).sessions].sort((n,o)=>{let i=n.lastActivityAt?new Date(n.lastActivityAt).getTime():0;return(o.lastActivityAt?new Date(o.lastActivityAt).getTime():0)-i});this.sessions_$.set(e)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}fetchGatewaySessionsForInstance(t){return h(this,null,function*(){let s=yield this.ocSession_AS.listGatewaySessions({instanceId:t.instanceId});return E.buildGatewaySessionsFetch({response:s})})}loadGatewaySessions(t){return h(this,null,function*(){this.sessionsLoading_$.set(!0),this.sessionsLoadError_$.set(null);try{let s=yield this.fetchGatewaySessionsForInstance({instanceId:t.instanceId});!s.listItems.length&&s.rawSessions.length>0&&this.pushConsoleMessage({type:"error",text:`Gateway returned ${s.rawSessions.length} sessions but mapping produced 0.
2
2
  First session keys: ${s.firstSessionKeys.join(", ")}`}),this.sessions_$.set(s.listItems)}catch(s){this.sessionsLoadError_$.set(s),this.pushConsoleMessage({type:"error",text:`Load gateway sessions failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.sessionsLoading_$.set(!1)}})}loadSessionDetail(t){return h(this,null,function*(){let s=t.isSilent===!0;s||this.selectedSessionLoading_$.set(!0);try{let e=yield this.ocSession_AS.getSession({sessionId:t.sessionId});this.selectedSession_$.set(e),this.loadAssembledMessages({sessionId:t.sessionId}).catch(()=>{})}catch(e){if(!s){this.selectedSession_$.set(null);let n=e instanceof Error?e.message:"Failed to load session details";this.pushConsoleMessage({type:"error",text:`Load session failed: ${n}`})}}finally{s||this.selectedSessionLoading_$.set(!1)}})}loadGatewaySessionHistory(t){return h(this,null,function*(){this.selectedSessionLoading_$.set(!0),this.consoleMessages_$.set([]);try{let s=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t.sessionId,instanceId:t.instanceId}),e=s,n=Array.isArray(e._rawKeys)?e._rawKeys:[],o=Array.isArray(s.history)?s.history:[],i=this.parseGatewayHistory(o),a=typeof e.messageCount=="number"?e.messageCount:0,r=Array.isArray(e._firstMessageKeys)?e._firstMessageKeys:[];i.length?this.consoleMessages_$.set(i):a>0?this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"error",text:`Gateway session has ${a} messages, but mapping failed.
3
3
  Message keys: ${r.join(", ")||"unknown"}
4
4
  Gateway response keys: ${n.join(", ")||"none"}`,timestamp:new Date().toISOString()}]):this.consoleMessages_$.set([{listKey:this.allocateConsoleListKey(),type:"info",text:"Gateway session loaded \u2014 session has no messages yet.",timestamp:new Date().toISOString()}]),this.selectedSession_$.set({session:{sessionId:t.sessionId,workspacePath:"",status:"unknown",promptCount:0,toolCallCount:0,isArchived:!1},runtime:{isLive:!1,runtimeStatus:null,outputBufferLength:0}}),this.lastPolledHistoryFingerprint=this.computeGatewayHistoryFingerprint(o),this.startChatPolling()}catch(s){this.selectedSession_$.set(null),this.pushConsoleMessage({type:"error",text:`Load gateway session history failed: ${f.getErrorMessageForDisplay(s)}`})}finally{this.selectedSessionLoading_$.set(!1)}})}loadSessionEvents(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.getSessionEvents({sessionId:t.sessionId,eventType:t.eventType,limit:t.limit??500,latest:!0});this.selectedSessionEvents_$.set(s.events),this.updateLastKnownSequence(s.events);for(let e of s.events)this.pushConsoleMessageFromEvent(e)}catch(s){this.selectedSessionEvents_$.set([]),this.pushConsoleMessage({type:"error",text:`Load events failed: ${f.getErrorMessageForDisplay(s)}`})}})}createSession(t){return h(this,null,function*(){try{let s=yield this.ocSession_AS.createSession(t),e=String(s.session.sessionId||"");return yield this.loadSessions(),e}catch(s){throw this.pushConsoleMessage({type:"error",text:`Create session failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}sendPrompt(t){return h(this,null,function*(){this.pushConsoleMessage({type:"prompt",text:t.content});try{let s=this.activeInstanceId_$();s?yield this.ocSession_AS.sendGatewayPrompt({sessionId:t.sessionId,instanceId:s,content:t.content}):yield this.ocSession_AS.sendPrompt(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Send failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}reconnectSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.reconnectSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Reconnect failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}stopExecution(t){return h(this,null,function*(){try{yield this.ocSession_AS.stopExecution(t)}catch(s){throw this.pushConsoleMessage({type:"error",text:`Stop execution failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}terminateSession(t){return h(this,null,function*(){try{yield this.ocSession_AS.terminateSession(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Terminate failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setSessionArchived(t){return h(this,null,function*(){try{yield this.ocSession_AS.setSessionArchived(t),yield this.loadSessions()}catch(s){throw this.pushConsoleMessage({type:"error",text:`Archive failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}updateSessionConfig(t){return h(this,null,function*(){try{yield this.ocSession_AS.updateSessionConfig(t);let s=this.selectedSession_$();if(s?.session.sessionId===t.sessionId){let e=w({},s.session);t.mode!=null&&(e.mode=t.mode),t.reasoningEffort!=null&&(e.reasoningEffort=t.reasoningEffort),t.openclawAgentName!=null&&(e.openclawAgentName=t.openclawAgentName),this.selectedSession_$.set($(w({},s),{session:e}))}}catch(s){throw this.pushConsoleMessage({type:"error",text:`Config update failed: ${f.getErrorMessageForDisplay(s)}`}),s}})}setActiveSessionId(t){let s=this.activeSessionId_$();s&&s!==t&&this.socket_CS.emit("oc-session:unsubscribe",{sessionId:s}),this.activeSessionId_$.set(t),t&&this.socket_CS.emit("oc-session:subscribe",{sessionId:t})}clearLiveOutput(){this.stopChatPolling(),this.consoleMessages_$.set([]),this.sessionUsage_$.set({inputTokens:0,outputTokens:0,costUsd:0}),this.lastKnownEventSequence=-1}allocateConsoleListKey(){return globalThis.crypto.randomUUID()}pushConsoleMessage(t){let s=t.type==="assistant"||t.type==="prompt"?t.text.trim():t.text,e={listKey:t.listKey??this.allocateConsoleListKey(),type:t.type,text:s,timestamp:t.timestamp??new Date().toISOString(),expandableContent:t.expandableContent,rawData:t.rawData},n=this.consoleMessages_$();this.consoleMessages_$.set([...n,e])}static CHAT_POLL_INTERVAL_MS=5*C.second;static DETAIL_POLL_INTERVAL_MS=10*C.second;startChatPolling(){this.stopChatPolling(),this.chatPollHandle=setInterval(()=>{this.pollChatHistory()},l.CHAT_POLL_INTERVAL_MS),this.detailPollHandle=setInterval(()=>{let t=this.activeSessionId_$();t&&this.loadSessionDetail({sessionId:t,isSilent:!0})},l.DETAIL_POLL_INTERVAL_MS)}stopChatPolling(){this.chatPollHandle&&(clearInterval(this.chatPollHandle),this.chatPollHandle=null),this.detailPollHandle&&(clearInterval(this.detailPollHandle),this.detailPollHandle=null),this.lastPolledHistoryFingerprint=""}computeGatewayHistoryFingerprint(t){let s=t.length;if(!s)return"0";let e=t[s-1],n=typeof e.id=="string"?e.id:typeof e.messageId=="string"?e.messageId:"",o=l.extractGatewayChatMessageTimestamp(e),i=this.extractTextFromMessage(e),a=400,r=i.length>a?i.slice(0,a):i;return`${s}${n}${o}${r}`}pollChatHistory(){return h(this,null,function*(){let t=this.activeSessionId_$(),s=this.activeInstanceId_$();if(!(!t||!s))try{let e=yield this.ocSession_AS.getGatewaySessionHistory({sessionId:t,instanceId:s}),n=Array.isArray(e.history)?e.history:[],o=this.computeGatewayHistoryFingerprint(n);if(o===this.lastPolledHistoryFingerprint)return;this.lastPolledHistoryFingerprint=o;let i=this.parseGatewayHistory(n);this.ngZone.run(()=>{this.consoleMessages_$.set(i)})}catch{}})}parseGatewayHistory(t){let s=[],e=new Map,n=[];for(let i of t){let a=i.content;if(Array.isArray(a))for(let r of a){let u=typeof r.type=="string"?r.type:"";if(u==="tool_use"||u==="toolCall"){let S=typeof r.id=="string"?r.id:"";S&&n.push(S)}if(u==="tool_result"){let S=typeof r.tool_use_id=="string"?r.tool_use_id:"";S&&e.set(S,this.extractTextFromContentBlock(r))}}}let o=0;for(let i of t){let a=typeof i.role=="string"?i.role:"";if(a==="toolResult"||a==="tool_result"){let r=this.extractTextFromMessage(i);o<n.length&&(e.set(n[o],r),o++)}}for(let i of t){let a=typeof i.role=="string"?i.role:"unknown",r=i.content,u=l.extractGatewayChatMessageTimestamp(i);if(a==="toolResult"||a==="tool_result")continue;if(typeof r=="string"){s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":"info",text:r,timestamp:u,rawData:i});continue}if(Array.isArray(r)){for(let c of r){let v=typeof c.type=="string"?c.type:"";if(v==="text")s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":"assistant",text:typeof c.text=="string"?c.text:"",timestamp:u,rawData:{_block:c,_message:{role:a,timestamp:u,contentBlockCount:r.length}}});else if(v==="tool_use"||v==="toolCall"){let b=typeof c.name=="string"?c.name:"unknown tool",T=typeof c.id=="string"?c.id:"",m=c.input??c.arguments,A=e.get(T);s.push({listKey:this.allocateConsoleListKey(),type:"tool",text:`${b}
@@ -6,4 +6,4 @@ ${JSON.stringify(m,null,2)}`,timestamp:u,expandableContent:A,rawData:{_block:c,_
6
6
  `):A=JSON.stringify(c,null,2),s.push({listKey:this.allocateConsoleListKey(),type:"tool-result",text:A,timestamp:u,rawData:{_block:c}})}}else v==="thinking"?s.push({listKey:this.allocateConsoleListKey(),type:"info",text:typeof c.thinking=="string"?c.thinking:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}}):s.push({listKey:this.allocateConsoleListKey(),type:"info",text:JSON.stringify(c,null,2),timestamp:u,rawData:{_block:c}})}continue}let S=typeof i.text=="string"?i.text:typeof i.message=="string"?i.message:JSON.stringify(i,null,2);s.push({listKey:this.allocateConsoleListKey(),type:a==="user"||a==="human"?"prompt":a==="assistant"?"assistant":a==="tool"||a==="tool_result"||a==="tool_use"?"tool":"info",text:S,timestamp:u,rawData:i})}return s}backfillMissedEvents(){return h(this,null,function*(){let t=this.activeSessionId_$();if(!(!t||this.lastKnownEventSequence<0))try{let e=(yield this.ocSession_AS.getSessionEvents({sessionId:t,sinceSequence:this.lastKnownEventSequence})).events;if(!e.length)return;this.ngZone.run(()=>{let n=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...n,...e]);for(let o of e)this.pushConsoleMessageFromEvent(o);this.updateLastKnownSequence(e)})}catch(s){C.DyFM_Log.warn("CCAP_OcSession_DS | backfill failed",s)}})}updateLastKnownSequence(t){for(let s of t)s.sequence>this.lastKnownEventSequence&&(this.lastKnownEventSequence=s.sequence)}handleSocketEvent(t){let s=t.event,e=t.payload;try{this.ngZone.run(()=>{switch(s){case"oc-session:status":this.handleStatusUpdate(e);break;case"oc-session:output":this.handleOutputChunk(e);break;case"oc-session:event":this.handleSessionEvent(e);break;case"oc-session:list-update":this.handleListUpdate(e);break;case"ext-session-msg:message":this.handleAssembledMessage(e);break;case"ext-session-msg:update":this.handleAssembledMessageUpdate(e);break}})}catch(n){C.DyFM_Log.error(`CCAP_OcSession_DS | socket event error | event: ${s}`,n)}}handleStatusUpdate(t){let s=t.sessionId??"",e=t.status??"",n=t.statusMessage;this.lastStatusUpdate_$.set({sessionId:s,status:e,statusMessage:n});let i=this.sessions_$().map(r=>r.sessionId===s?$(w({},r),{status:e,statusMessage:n}):r);this.sessions_$.set(i);let a=this.selectedSession_$();if(a?.session.sessionId===s){let r=e==="running"||e==="waiting-input";this.selectedSession_$.set($(w({},a),{session:$(w({},a.session),{status:e,statusMessage:n}),runtime:$(w({},a.runtime),{isLive:r,runtimeStatus:e})}))}if(e==="errored"){let r=n?`OC Session error (${s}): ${n}`:`OC Session error (${s}): session entered errored state`;this.globalError_CS.showError(new Error(r),"oc-session-status")}}handleOutputChunk(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.content??"",n=t.type??"response";e&&this.pushConsoleMessage({type:n==="error"?"error":"assistant",text:e})}handleSessionEvent(t){let s=t.sessionId??"";if(s&&s!==this.activeSessionId_$())return;let e=t.event??{},n={sessionId:s,eventType:e.eventType??"",timestamp:e.timestamp??"",data:e.data??{},sequence:e.sequence??0};if(n.sequence<=this.lastKnownEventSequence)return;this.lastKnownEventSequence=n.sequence;let o=this.selectedSessionEvents_$();this.selectedSessionEvents_$.set([...o,n]),this.pushConsoleMessageFromEvent(n)}handleListUpdate(t){this.loadSessions().catch(()=>{})}extractTextFromContentBlock(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
7
7
  `):typeof t.text=="string"?t.text:JSON.stringify(t,null,2)}extractTextFromMessage(t){let s=t.content;return typeof s=="string"?s:Array.isArray(s)?s.map(e=>typeof e.text=="string"?e.text:JSON.stringify(e,null,2)).join(`
8
8
  `):JSON.stringify(t,null,2)}pushConsoleMessageFromEvent(t){let s=t.data;switch(t.eventType){case"response-chunk":{let e=typeof s.content=="string"?s.content:"";e&&this.pushConsoleMessage({type:"assistant",text:e});break}case"response-complete":{let e=s.usage;if(e&&typeof e=="object"){let n=e,o=this.sessionUsage_$();this.sessionUsage_$.set({inputTokens:o.inputTokens+(typeof n.inputTokens=="number"?n.inputTokens:0),outputTokens:o.outputTokens+(typeof n.outputTokens=="number"?n.outputTokens:0),costUsd:o.costUsd+(typeof n.costUsd=="number"?n.costUsd:0)})}break}case"tool-call-start":{let e=typeof s.name=="string"?s.name:"unknown",n=s.input,o=n?this.summarizeToolInput(n):"",i=o?`${e}: ${o}`:e;this.pushConsoleMessage({type:"tool",text:i,rawData:s});break}case"tool-call-end":{let e=s.content??s.output,n=typeof e=="string"?e:JSON.stringify(e??{});this.pushConsoleMessage({type:"tool-result",text:n.length>200?n.substring(0,200)+"\u2026":n,expandableContent:n.length>200?n:void 0,rawData:s});break}case"error":{let e=s.message??s.content;typeof e=="string"&&e&&this.pushConsoleMessage({type:"error",text:e});break}case"connection-change":{let e=typeof s.state=="string"?s.state:"";e&&this.pushConsoleMessage({type:"info",text:`Gateway connection: ${e}`,rawData:s});break}default:break}}summarizeToolInput(t){if(typeof t=="string")return t.length>80?t.substring(0,80)+"\u2026":t;if(typeof t=="object"&&t!==null){let s=JSON.stringify(t);return s.length>80?s.substring(0,80)+"\u2026":s}return""}static extractGatewayChatMessageTimestamp(t){return I.extractTimestamp(t,I.GATEWAY_CHAT_MESSAGE_TIMESTAMP_FIELD_NAMES)??""}loadAssembledMessages(t){return h(this,null,function*(){try{let s=yield this.extSessionMsg_AS.getMessages({sessionId:t.sessionId,latest:!0});this.assembledMessages_$.set(s.messages)}catch(s){C.DyFM_Log.error(`CCAP_OcSession_DS | loadAssembledMessages failed | sessionId: ${t.sessionId}`,s)}})}handleAssembledMessage(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=t.message;if(!e||typeof e!="object")return;let n=e,o=this.assembledMessages_$();this.assembledMessages_$.set([...o,n])}handleAssembledMessageUpdate(t){let s=typeof t.sessionId=="string"?t.sessionId:"";if(!s||s!==this.activeSessionId_$())return;let e=typeof t.messageKey=="string"?t.messageKey:"";if(!e)return;let n=t.update;if(!n||typeof n!="object")return;let o=n,i=this.assembledMessages_$(),a=i.findIndex(S=>S.messageKey===e);if(a<0)return;let r=w({},i[a]);typeof o.bodyText=="string"&&(r.bodyText=o.bodyText),o.toolResult!==void 0&&(r.toolResult=o.toolResult),typeof o.toolStatus=="string"&&(r.toolStatus=o.toolStatus),o.headerStatusDot!==void 0&&(r.headerStatusDot=typeof o.headerStatusDot=="string"?o.headerStatusDot:void 0);let u=[...i];u[a]=r,this.assembledMessages_$.set(u)}static \u0275fac=function(s){return new(s||l)};static \u0275prov=M({token:l,factory:l.\u0275fac,providedIn:"root"})}return l})();export{I as a,lt as b};
9
- //# sourceMappingURL=chunk-HQPGIGEE.js.map
9
+ //# sourceMappingURL=chunk-N26D6SXG.js.map
@@ -1,2 +1,2 @@
1
- import{q as i}from"./chunk-WJQ3I2JP.js";var e=class{static build(r){let t=r.localAiKey.trim();if(!t.length)throw new Error("localAiSettings.key must be non-empty UUID for custom local LLM rows");return`${i.customLocalAi}--${t}`}static parseLocalAiKeyFromInstanceId(r){let t=`${i.customLocalAi}--`,o=r.instanceId.trim();if(!o.startsWith(t)||o.length<=t.length)throw new Error("Invalid custom local LLM instance id");return o.slice(t.length)}};export{e as a};
2
- //# sourceMappingURL=chunk-3L2A6OYA.js.map
1
+ import{q as i}from"./chunk-5N64HGRY.js";var e=class{static build(r){let t=r.localAiKey.trim();if(!t.length)throw new Error("localAiSettings.key must be non-empty UUID for custom local LLM rows");return`${i.customLocalAi}--${t}`}static parseLocalAiKeyFromInstanceId(r){let t=`${i.customLocalAi}--`,o=r.instanceId.trim();if(!o.startsWith(t)||o.length<=t.length)throw new Error("Invalid custom local LLM instance id");return o.slice(t.length)}};export{e as a};
2
+ //# sourceMappingURL=chunk-N7HJWJ2S.js.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-K4J73VA4.js";import{I as c,p as _}from"./chunk-WJQ3I2JP.js";import{C as a,aa as r,h as u,k as n,p as o,xb as f,y as l}from"./chunk-TBMJSIBB.js";var p=u(_());var $=6e4,y=(()=>{class i{api_AS=a(h);instancePresenceMap_$=r(new Map);intervalHandle=void 0;lastRefreshAt_$=r(null);startPeriodicRefresh(){this.intervalHandle===void 0&&(this.refreshNow(),this.intervalHandle=setInterval(()=>{this.refreshNow()},$))}stopPeriodicRefresh(){this.intervalHandle!==void 0&&(clearInterval(this.intervalHandle),this.intervalHandle=void 0)}refreshNow(){return n(this,null,function*(){try{let t=yield this.api_AS.getPresence(),e=new Map;for(let s of t.list??[])s.instanceKey&&e.set(s.instanceKey,s);this.instancePresenceMap_$.set(e),this.lastRefreshAt_$.set(new Date().toISOString())}catch(t){p.DyFM_Log.warn(`[CCAP] ExS_InstancePresence_DataService refresh failed (non-fatal): ${t instanceof Error?t.message:String(t)}`)}})}getPresence(t){let e=this.instancePresenceMap_$().get(t);return e||{instanceKey:t,presence:"unknown",wsConnected:!1,reason:"presence map not loaded yet"}}ngOnDestroy(){this.stopPeriodicRefresh()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=5e3,P=18,v=5e3,L=(()=>{class i{versionInfo_$=r(null);loading_$=r(!1);loadError_$=r(null);lastLoadedAt_$=r(null);triggering_$=r(!1);triggerResult_$=r(null);triggerError_$=r(null);pollingPostUpdate_$=r(!1);triggerSucceeded_$=r(null);triggerTimedOut_$=r(!1);http=a(f);pollTimer=null;loadVersionInfo(){return n(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{let t=`${c.api.baseUrl}/server/health/version-info`,e=yield o(this.http.get(t));this.versionInfo_$.set(e),this.lastLoadedAt_$.set(new Date)}catch(t){let e=t instanceof Error?t.message:String(t);this.loadError_$.set(e),this.versionInfo_$.set(null)}finally{this.loading_$.set(!1)}})}triggerUpdate(t){return n(this,null,function*(){this.cancelPostUpdatePolling(),this.triggerSucceeded_$.set(null),this.triggerTimedOut_$.set(!1),this.triggering_$.set(!0),this.triggerError_$.set(null),this.triggerResult_$.set(null);try{let e=`${c.api.baseUrl}/server/health/trigger-update`,s=yield o(this.http.post(e,{force:t===!0}));this.triggerResult_$.set(s),s.status==="started"&&s.currentVersion&&this.startPostUpdatePolling(s.currentVersion)}catch(e){let s=e instanceof Error?e.message:String(e);this.triggerError_$.set(s)}finally{this.triggering_$.set(!1)}})}startPostUpdatePolling(t){this.pollingPostUpdate_$.set(!0);let e=0,s=()=>n(this,null,function*(){e+=1;let d=yield this.pollHealthPid();if(d&&d!==t){this.triggerSucceeded_$.set({oldVersion:t,newVersion:d,detectedAtMs:Date.now()}),this.pollingPostUpdate_$.set(!1),this.pollTimer=null,setTimeout(()=>{typeof window<"u"&&window?.location&&window.location.reload()},v);return}if(e>=P){this.triggerTimedOut_$.set(!0),this.pollingPostUpdate_$.set(!1),this.pollTimer=null;return}this.pollTimer=setTimeout(()=>{s()},g)});this.pollTimer=setTimeout(()=>{s()},g)}cancelPostUpdatePolling(){this.pollTimer&&(clearTimeout(this.pollTimer),this.pollTimer=null),this.pollingPostUpdate_$.set(!1)}pollHealthPid(){return n(this,null,function*(){try{let t=`${c.api.baseUrl}/server/health/pid`,e=yield o(this.http.get(t));return typeof e?.ccapVersion=="string"?e.ccapVersion:null}catch{return null}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{y as a,L as b};
2
- //# sourceMappingURL=chunk-KZGPAAZC.js.map
1
+ import{a as h}from"./chunk-UHAAQJ2R.js";import{I as c,p as _}from"./chunk-5N64HGRY.js";import{C as a,aa as r,h as u,k as n,p as o,xb as f,y as l}from"./chunk-TBMJSIBB.js";var p=u(_());var $=6e4,y=(()=>{class i{api_AS=a(h);instancePresenceMap_$=r(new Map);intervalHandle=void 0;lastRefreshAt_$=r(null);startPeriodicRefresh(){this.intervalHandle===void 0&&(this.refreshNow(),this.intervalHandle=setInterval(()=>{this.refreshNow()},$))}stopPeriodicRefresh(){this.intervalHandle!==void 0&&(clearInterval(this.intervalHandle),this.intervalHandle=void 0)}refreshNow(){return n(this,null,function*(){try{let t=yield this.api_AS.getPresence(),e=new Map;for(let s of t.list??[])s.instanceKey&&e.set(s.instanceKey,s);this.instancePresenceMap_$.set(e),this.lastRefreshAt_$.set(new Date().toISOString())}catch(t){p.DyFM_Log.warn(`[CCAP] ExS_InstancePresence_DataService refresh failed (non-fatal): ${t instanceof Error?t.message:String(t)}`)}})}getPresence(t){let e=this.instancePresenceMap_$().get(t);return e||{instanceKey:t,presence:"unknown",wsConnected:!1,reason:"presence map not loaded yet"}}ngOnDestroy(){this.stopPeriodicRefresh()}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();var g=5e3,P=18,v=5e3,L=(()=>{class i{versionInfo_$=r(null);loading_$=r(!1);loadError_$=r(null);lastLoadedAt_$=r(null);triggering_$=r(!1);triggerResult_$=r(null);triggerError_$=r(null);pollingPostUpdate_$=r(!1);triggerSucceeded_$=r(null);triggerTimedOut_$=r(!1);http=a(f);pollTimer=null;loadVersionInfo(){return n(this,null,function*(){this.loading_$.set(!0),this.loadError_$.set(null);try{let t=`${c.api.baseUrl}/server/health/version-info`,e=yield o(this.http.get(t));this.versionInfo_$.set(e),this.lastLoadedAt_$.set(new Date)}catch(t){let e=t instanceof Error?t.message:String(t);this.loadError_$.set(e),this.versionInfo_$.set(null)}finally{this.loading_$.set(!1)}})}triggerUpdate(t){return n(this,null,function*(){this.cancelPostUpdatePolling(),this.triggerSucceeded_$.set(null),this.triggerTimedOut_$.set(!1),this.triggering_$.set(!0),this.triggerError_$.set(null),this.triggerResult_$.set(null);try{let e=`${c.api.baseUrl}/server/health/trigger-update`,s=yield o(this.http.post(e,{force:t===!0}));this.triggerResult_$.set(s),s.status==="started"&&s.currentVersion&&this.startPostUpdatePolling(s.currentVersion)}catch(e){let s=e instanceof Error?e.message:String(e);this.triggerError_$.set(s)}finally{this.triggering_$.set(!1)}})}startPostUpdatePolling(t){this.pollingPostUpdate_$.set(!0);let e=0,s=()=>n(this,null,function*(){e+=1;let d=yield this.pollHealthPid();if(d&&d!==t){this.triggerSucceeded_$.set({oldVersion:t,newVersion:d,detectedAtMs:Date.now()}),this.pollingPostUpdate_$.set(!1),this.pollTimer=null,setTimeout(()=>{typeof window<"u"&&window?.location&&window.location.reload()},v);return}if(e>=P){this.triggerTimedOut_$.set(!0),this.pollingPostUpdate_$.set(!1),this.pollTimer=null;return}this.pollTimer=setTimeout(()=>{s()},g)});this.pollTimer=setTimeout(()=>{s()},g)}cancelPostUpdatePolling(){this.pollTimer&&(clearTimeout(this.pollTimer),this.pollTimer=null),this.pollingPostUpdate_$.set(!1)}pollHealthPid(){return n(this,null,function*(){try{let t=`${c.api.baseUrl}/server/health/pid`,e=yield o(this.http.get(t));return typeof e?.ccapVersion=="string"?e.ccapVersion:null}catch{return null}})}static \u0275fac=function(e){return new(e||i)};static \u0275prov=l({token:i,factory:i.\u0275fac,providedIn:"root"})}return i})();export{y as a,L as b};
2
+ //# sourceMappingURL=chunk-ORFH2XGX.js.map
@@ -1,2 +1,2 @@
1
- import{a as h}from"./chunk-65TRXF6Q.js";import{I as l,p as $}from"./chunk-WJQ3I2JP.js";import{C as a,aa as e,h as L,k as r,p as n,xb as o,y as c}from"./chunk-TBMJSIBB.js";var f=L($());var d=(()=>{class s{baseUrl=`${l.api.baseUrl}/cai-instance-data`;http=a(o);listInstances(){return n(this.http.get(`${this.baseUrl}/list`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var p=(()=>{class s{baseUrl=`${l.api.baseUrl}/cci-instance-data`;http=a(o);listInstances(){return n(this.http.get(`${this.baseUrl}/list`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var u=(()=>{class s{baseUrl=`${l.api.baseUrl}/instance-data`;http=a(o);getList(){return n(this.http.get(`${this.baseUrl}/list`))}getCurrent(){return n(this.http.get(`${this.baseUrl}/current`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}ensure(t){return n(this.http.post(`${this.baseUrl}/ensure`,t??{}))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var q=(()=>{class s{instanceData_AS=a(u);ociInstanceData_AS=a(h);cciInstanceData_AS=a(p);caiInstanceData_AS=a(d);ccapInstanceList_$=e([]);ccapInstanceListLoading_$=e(!1);ccapInstanceListError_$=e(null);ociInstanceList_$=e([]);ociInstanceListLoading_$=e(!1);ociInstanceListError_$=e(null);cciInstanceList_$=e([]);cciInstanceListLoading_$=e(!1);cciInstanceListError_$=e(null);caiInstanceList_$=e([]);caiInstanceListLoading_$=e(!1);caiInstanceListError_$=e(null);loadCcapInstanceList(){return r(this,null,function*(){this.ccapInstanceListLoading_$.set(!0),this.ccapInstanceListError_$.set(null);try{let t=yield this.instanceData_AS.getList();this.ccapInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.ccapInstanceList_$.set([]),this.ccapInstanceListError_$.set(t),f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCcapInstanceList failed",t)}finally{this.ccapInstanceListLoading_$.set(!1)}})}loadOciInstanceListAllowEmpty(){return r(this,null,function*(){this.ociInstanceListLoading_$.set(!0),this.ociInstanceListError_$.set(null);try{let t=yield this.ociInstanceData_AS.listInstances();this.ociInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadOciInstanceListAllowEmpty failed",t),this.ociInstanceList_$.set([])}finally{this.ociInstanceListLoading_$.set(!1)}})}loadOciInstanceListStrict(){return r(this,null,function*(){this.ociInstanceListLoading_$.set(!0),this.ociInstanceListError_$.set(null);try{let t=yield this.ociInstanceData_AS.listInstances();this.ociInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.ociInstanceListError_$.set(t)}finally{this.ociInstanceListLoading_$.set(!1)}})}loadCciInstanceListAllowEmpty(){return r(this,null,function*(){this.cciInstanceListLoading_$.set(!0),this.cciInstanceListError_$.set(null);try{let t=yield this.cciInstanceData_AS.listInstances();this.cciInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCciInstanceListAllowEmpty failed",t),this.cciInstanceList_$.set([])}finally{this.cciInstanceListLoading_$.set(!1)}})}loadCciInstanceListStrict(){return r(this,null,function*(){this.cciInstanceListLoading_$.set(!0),this.cciInstanceListError_$.set(null);try{let t=yield this.cciInstanceData_AS.listInstances();this.cciInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.cciInstanceListError_$.set(t)}finally{this.cciInstanceListLoading_$.set(!1)}})}loadCaiInstanceListAllowEmpty(){return r(this,null,function*(){this.caiInstanceListLoading_$.set(!0),this.caiInstanceListError_$.set(null);try{let t=yield this.caiInstanceData_AS.listInstances();this.caiInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCaiInstanceListAllowEmpty failed",t),this.caiInstanceList_$.set([])}finally{this.caiInstanceListLoading_$.set(!1)}})}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{d as a,p as b,u as c,q as d};
2
- //# sourceMappingURL=chunk-GIZQX4FZ.js.map
1
+ import{a as h}from"./chunk-SG5TSGOY.js";import{I as l,p as $}from"./chunk-5N64HGRY.js";import{C as a,aa as e,h as L,k as r,p as n,xb as o,y as c}from"./chunk-TBMJSIBB.js";var f=L($());var d=(()=>{class s{baseUrl=`${l.api.baseUrl}/cai-instance-data`;http=a(o);listInstances(){return n(this.http.get(`${this.baseUrl}/list`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var p=(()=>{class s{baseUrl=`${l.api.baseUrl}/cci-instance-data`;http=a(o);listInstances(){return n(this.http.get(`${this.baseUrl}/list`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var u=(()=>{class s{baseUrl=`${l.api.baseUrl}/instance-data`;http=a(o);getList(){return n(this.http.get(`${this.baseUrl}/list`))}getCurrent(){return n(this.http.get(`${this.baseUrl}/current`))}getByCcapId(t){return n(this.http.get(`${this.baseUrl}/by-ccap/${t}`))}patchByCcapId(t){let i={};return t.name!==void 0&&(i.name=t.name),t.status!==void 0&&(i.status=t.status),t.darkOfficeVisuals!==void 0&&(i.darkOfficeVisuals=t.darkOfficeVisuals),n(this.http.patch(`${this.baseUrl}/by-ccap/${t.ccapId}`,i))}ensure(t){return n(this.http.post(`${this.baseUrl}/ensure`,t??{}))}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var q=(()=>{class s{instanceData_AS=a(u);ociInstanceData_AS=a(h);cciInstanceData_AS=a(p);caiInstanceData_AS=a(d);ccapInstanceList_$=e([]);ccapInstanceListLoading_$=e(!1);ccapInstanceListError_$=e(null);ociInstanceList_$=e([]);ociInstanceListLoading_$=e(!1);ociInstanceListError_$=e(null);cciInstanceList_$=e([]);cciInstanceListLoading_$=e(!1);cciInstanceListError_$=e(null);caiInstanceList_$=e([]);caiInstanceListLoading_$=e(!1);caiInstanceListError_$=e(null);loadCcapInstanceList(){return r(this,null,function*(){this.ccapInstanceListLoading_$.set(!0),this.ccapInstanceListError_$.set(null);try{let t=yield this.instanceData_AS.getList();this.ccapInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.ccapInstanceList_$.set([]),this.ccapInstanceListError_$.set(t),f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCcapInstanceList failed",t)}finally{this.ccapInstanceListLoading_$.set(!1)}})}loadOciInstanceListAllowEmpty(){return r(this,null,function*(){this.ociInstanceListLoading_$.set(!0),this.ociInstanceListError_$.set(null);try{let t=yield this.ociInstanceData_AS.listInstances();this.ociInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadOciInstanceListAllowEmpty failed",t),this.ociInstanceList_$.set([])}finally{this.ociInstanceListLoading_$.set(!1)}})}loadOciInstanceListStrict(){return r(this,null,function*(){this.ociInstanceListLoading_$.set(!0),this.ociInstanceListError_$.set(null);try{let t=yield this.ociInstanceData_AS.listInstances();this.ociInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.ociInstanceListError_$.set(t)}finally{this.ociInstanceListLoading_$.set(!1)}})}loadCciInstanceListAllowEmpty(){return r(this,null,function*(){this.cciInstanceListLoading_$.set(!0),this.cciInstanceListError_$.set(null);try{let t=yield this.cciInstanceData_AS.listInstances();this.cciInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCciInstanceListAllowEmpty failed",t),this.cciInstanceList_$.set([])}finally{this.cciInstanceListLoading_$.set(!1)}})}loadCciInstanceListStrict(){return r(this,null,function*(){this.cciInstanceListLoading_$.set(!0),this.cciInstanceListError_$.set(null);try{let t=yield this.cciInstanceData_AS.listInstances();this.cciInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){this.cciInstanceListError_$.set(t)}finally{this.cciInstanceListLoading_$.set(!1)}})}loadCaiInstanceListAllowEmpty(){return r(this,null,function*(){this.caiInstanceListLoading_$.set(!0),this.caiInstanceListError_$.set(null);try{let t=yield this.caiInstanceData_AS.listInstances();this.caiInstanceList_$.set(Array.isArray(t?.list)?t.list:[])}catch(t){f.DyFM_Error.logSimple("CCAP_RuntimeInstances_DS | loadCaiInstanceListAllowEmpty failed",t),this.caiInstanceList_$.set([])}finally{this.caiInstanceListLoading_$.set(!1)}})}static \u0275fac=function(i){return new(i||s)};static \u0275prov=c({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();export{d as a,p as b,u as c,q as d};
2
+ //# sourceMappingURL=chunk-OVD3GSH2.js.map
@@ -1,2 +1,2 @@
1
- import{a as P}from"./chunk-32TKSQQ4.js";import{a as T}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-RE5XOANX.js";import{e as k}from"./chunk-BPXKOVJB.js";import{G as C,I as y,p as O}from"./chunk-WJQ3I2JP.js";import{C as p,a as $,aa as o,b as v,h as N,jb as M,k as l,l as L,p as u,vb as f,xb as w,y as E}from"./chunk-TBMJSIBB.js";var A=class{static computeSocketUrlFromStatus(m,e){return e}};var b=class{static toDisplayString(m){if(m==null)return"";if(typeof m=="string")return m;if(typeof m=="object"&&m!==null){let t=m;if(typeof t.message=="string"&&t.message.trim().length>0)return t.message.trim();if(typeof t.error=="string"&&t.error.trim().length>0)return t.error.trim();if(typeof t.detail=="string"&&t.detail.trim().length>0)return t.detail.trim()}let e=String(m);return e==="[object Object]"?"\u2014":e}};var d=N(O());var R=(()=>{class r{baseUrl=`${y.api.baseUrl}/session`;http=p(w);getMessages(e){return u(this.http.get(`${this.baseUrl}/${e.sessionId}/messages`,{params:{viewMode:e.viewMode}}))}sendMessage(e){return u(this.http.post(`${this.baseUrl}/${e.sessionId}/messages`,{content:e.content,imageAttachments:e.imageAttachments}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var K=(()=>{class r{baseUrl=`${y.api.baseUrl}/session`;http=p(w);peiContext_DS=p(U);currentCcapId(){return this.peiContext_DS.activeCcapId_$()}withCcapId(e){let t=this.currentCcapId();return t?e.set("ccapId",t):e}listSessions(){let e=this.withCcapId(new f);return u(this.http.get(this.baseUrl,{params:e}))}listArchivedSessions(){let e=this.withCcapId(new f);return e=e.set("archived","true"),u(this.http.get(this.baseUrl,{params:e}))}createSession(e){let t={},s=e?.name!==void 0?e.name.trim():void 0;s!==void 0&&s.length>0&&(t.name=s);let i=this.withCcapId(new f);return u(this.http.post(this.baseUrl,t,{params:i}))}getSession(e){let t=this.withCcapId(new f);return u(this.http.get(`${this.baseUrl}/${e}`,{params:t}))}updateSession(e){let t=this.withCcapId(new f);return u(this.http.patch(`${this.baseUrl}/${e.sessionId}`,e.updates,{params:t}))}getSessionInfo(e){let t=this.withCcapId(new f);return u(this.http.get(`${this.baseUrl}/${e}/session-info`,{params:t}))}copySession(e){let t={};e.name&&(t.name=e.name),e.forkUntilMessageKey&&(t.forkUntilMessageKey=e.forkUntilMessageKey);let s=this.withCcapId(new f);return u(this.http.post(`${this.baseUrl}/${e.sessionId}/copy`,t,{params:s}))}stopExecution(e){let t=this.withCcapId(new f);return u(this.http.post(`${this.baseUrl}/${e}/stop-execution`,{},{params:t}))}getLlmDebugTrace(e){let t=this.withCcapId(new f);return t=t.set("runId",e.runId),u(this.http.get(`${this.baseUrl}/${e.sessionId}/llm-debug-trace`,{params:t}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var j="answer",V="notify-user",B="agent-events",z="context:updated",H="monitoring:event",G="user-interaction:request",q="user-interaction:resolved",W="ccap_notification",Q="notification-sent",X="waiting-for-user",Ce=(()=>{class r{sessionDetailBySessionId=new Map;sessionInfoBySessionId=new Map;activeSessionId_$=o("");requestSidebarCloseOnMobileBump_$=o(0);sessions_$=o([]);sessionsLoadError_$=o(null);sessionsLoading_$=o(!1);archivedSessions_$=o([]);archivedSessionsLoading_$=o(!1);messages_$=o([]);messagesLoading_$=o(!1);messagesLoadError_$=o(null);agentEvents_$=o({});activeRunExecutionMode_$=o("");contextUpdated_$=o(null);monitoringEvent_$=o(null);monitoringEvent_S=new L;pendingInteraction_$=o(null);pendingNotification_$=o(null);sessionDetailMap_$=o(new Map);sessionDetailLoading_$=o(!1);sessionInfoMap_$=o(new Map);sessionInfoLoading_$=o(!1);sessionInfoLoadError_$=o(null);llmDebugTraceEntries_$=o([]);llmDebugTraceLoading_$=o(!1);llmDebugTraceLoadError_$=o(null);eventSubscription=null;connectedEffectRef=null;session_AS=p(K);conversation_AS=p(R);serverStatus_AS=p(P);socket_CS=p(k);get connected_$(){return this.socket_CS.connected_$}get socketStatus_$(){return this.socket_CS.status_$}get lastSocketError_$(){return this.socket_CS.lastError_$}get connectAttemptCount_$(){return this.socket_CS.connectAttemptCount_$}diagnoseConnection(){return this.socket_CS.diagnoseConnection()}constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.connectedEffectRef=M(()=>{this.socket_CS.connected_$()&&this.getActiveSessionId()&&this.socket_CS.emit("session:attach",{sessionId:this.getActiveSessionId()})})}handleSocketEvent(e){let t=e.payload??{},s=this.getActiveSessionId(),i=typeof t.channelId=="string"?t.channelId:void 0,g=typeof t.sessionId=="string"?t.sessionId:void 0,I=!i&&!g||i===s||g===s;if(e.event===j&&I){let n=typeof t.content=="string"?t.content:"",a=typeof t.timestamp=="string"?t.timestamp:new Date().toISOString(),c=typeof t.runId=="string"?t.runId:void 0,S={role:"assistant",content:n,timestamp:new Date(a)},h=c?v($({},S),{runId:c}):S,_=this.ensureClientListKey(h);this.messages_$.set([...this.messages_$(),_]);return}if(e.event===V&&I){let n=typeof t.content=="string"?t.content:"";d.DyFM_Log.info(`CCAP_SessionDS | notify-user received: ${n.substring(0,120)}\u2026`);let a=this.ensureClientListKey({role:"system",content:n,timestamp:new Date});this.messages_$.set([...this.messages_$(),a]);return}if(e.event===B){let n=typeof t.eventData=="object"&&t.eventData!==null?t.eventData:{};this.agentEvents_$.set(n),this.applyAgentEventRunExecutionModeLatch(n);let a=typeof n.toolId=="string"?n.toolId:"",c=typeof n.phase=="string"?n.phase:"";a===W&&(c===Q||c===X)?this.pendingNotification_$.set({phase:c,notificationTitle:typeof n.notificationTitle=="string"?n.notificationTitle:"",notificationType:typeof n.notificationType=="string"?n.notificationType:"",notificationPriority:typeof n.notificationPriority=="string"?n.notificationPriority:"info"}):this.pendingNotification_$()&&this.pendingNotification_$.set(null);let S=n.toolError,h=i??n.channelId,_=!h||h===s,D=b.toDisplayString(S).trim();if(D.length>0&&_){d.DyFM_Log.info(`CCAP_SessionDS | toolError from agent-events, pushing to chat: ${D.substring(0,80)}\u2026`);let F=this.ensureClientListKey({role:"system",content:D,timestamp:new Date});this.messages_$.set([...this.messages_$(),F])}return}if(e.event===z){let n=typeof t.sessionId=="string"?t.sessionId:"",a=typeof t.contextState=="object"&&t.contextState!==null?t.contextState:{};this.contextUpdated_$.set({sessionId:n,contextState:a});return}if(e.event===H){let n=typeof t.sessionId=="string"?t.sessionId:"",a=typeof t.event=="object"&&t.event!==null?t.event:{},c={sessionId:n,event:a};this.monitoringEvent_$.set(c),this.monitoringEvent_S.next(c);return}if(e.event===G&&I){this.pendingInteraction_$.set(t);return}if(e.event===q&&I){let n=typeof t.interactionId=="string"?t.interactionId:void 0;if(!n)return;this.pendingInteraction_$()?.interactionId===n&&this.pendingInteraction_$.set(null);return}}loadSessions(){return l(this,null,function*(){this.sessionsLoading_$.set(!0);try{this.sessionsLoadError_$.set(null);let e=yield this.session_AS.listSessions();return this.sessions_$.set(e.sessions),e.sessions}catch(e){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load sessions",e),this.sessionsLoadError_$.set(e),[]}finally{this.sessionsLoading_$.set(!1)}})}createSession(e){return l(this,null,function*(){let t=yield this.session_AS.createSession(e);return yield this.loadSessions(),t.session})}copySession(e){return l(this,null,function*(){let t=yield this.session_AS.copySession(e);return yield this.loadSessions(),t.session})}forkSession(e){return l(this,null,function*(){let t=yield this.session_AS.copySession({sessionId:e.sessionId,name:e.name,forkUntilMessageKey:e.forkUntilMessageKey});return yield this.loadSessions(),t.session})}loadArchivedSessions(){return l(this,null,function*(){this.archivedSessionsLoading_$.set(!0);try{let e=yield this.session_AS.listArchivedSessions();return this.archivedSessions_$.set(e.sessions),e.sessions}catch(e){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load archived sessions",e),this.archivedSessions_$.set([]),[]}finally{this.archivedSessionsLoading_$.set(!1)}})}setActiveSession(e){this.activeSessionId_$()!==e&&(this.activeSessionId_$.set(e),this.clearMessages(),this.pendingInteraction_$.set(null),this.activeRunExecutionMode_$.set("")),this.socket_CS.emit("session:attach",{sessionId:e})}getActiveSessionId(){return this.activeSessionId_$()}reconnectSocket(){return l(this,null,function*(){try{let e=yield this.serverStatus_AS.getStatus(),t=typeof window<"u"?window.location.origin:"",s=A.computeSocketUrlFromStatus({httpPort:e.httpPort,socketPort:e.socketPort},t),i=y.socketUrl??t;if(s!==i&&typeof window<"u"){y.socketUrl=s,d.DyFM_Log.info("CCAP_SessionDS | socketUrl changed on reconnect, reloading",s),window.location.reload();return}}catch{}this.socket_CS.reconnect()})}stopExecution(e){return l(this,null,function*(){try{return(yield this.session_AS.stopExecution(e)).success}catch(t){return d.DyFM_Error.logSimple("CCAP_Session_DS | stopExecution failed",t),!1}})}sendMessageViaSocket(e,t){return l(this,null,function*(){let s=e.trim();if(s==="/new")return{newSession:yield this.createSession(),sent:!0};let i=this.activeSessionId_$();if(!i)return{sent:!1};let g=(t?.length??0)>0;if(!s.length&&!g)return{sent:!1};let I={role:"user",content:e,timestamp:new Date},n=this.ensureClientListKey(I);this.messages_$.set([...this.messages_$(),n]);try{let c=(yield this.conversation_AS.sendMessage({sessionId:i,content:e,imageAttachments:t})).message,S=this.messages_$().map(h=>{if(h.clientListKey!==n.clientListKey)return h;let _=$({},h);return c.messageKey&&(_.messageKey=c.messageKey),c.hasTtsAudio!==void 0&&(_.hasTtsAudio=c.hasTtsAudio),_});return this.messages_$.set(S),{sent:!0}}catch(a){d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to send message via REST",a);let c=this.messages_$().filter(h=>h.clientListKey!==n.clientListKey);return this.messages_$.set(c),{sent:!1,error:a instanceof Error?a.message:"\xDCzenet k\xFCld\xE9se sikertelen."}}})}sendMessageToSession(e){return l(this,null,function*(){yield this.conversation_AS.sendMessage({sessionId:e.sessionId,content:e.content})})}sendInteractionResponse(e){this.socket_CS.emit("user-interaction:response",e),this.pendingInteraction_$.set(null)}clearMessages(){this.messages_$.set([])}setMessages(e){let s=(e??[]).map(i=>this.ensureClientListKey(i));this.messages_$.set(s)}ensureClientListKey(e){if(e.clientListKey?.trim()?.length)return e;let s=e.messageKey?.trim();return s?.length?v($({},e),{clientListKey:s}):v($({},e),{clientListKey:globalThis.crypto.randomUUID()})}setMessageTtsCached(e){let s=this.messages_$().map(i=>i.messageKey===e?v($({},i),{hasTtsAudio:!0}):i);this.messages_$.set(s)}loadMessagesForView(e){return l(this,null,function*(){this.messagesLoading_$.set(!0),this.messagesLoadError_$.set(null);try{let s=(yield this.conversation_AS.getMessages({sessionId:e,viewMode:"conversationFull"})).messages??[];return e===this.activeSessionId_$()&&this.setMessages(s),s}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load messages for view",t),this.messagesLoadError_$.set(t),[]}finally{this.messagesLoading_$.set(!1)}})}loadSessionDetail(e){return l(this,null,function*(){if(!e)return null;this.sessionDetailLoading_$.set(!0);try{let t=yield this.session_AS.getSession(e),s={session:t.session,lastRun:t.lastRun??null};return this.sessionDetailBySessionId.set(e,s),this.sessionDetailMap_$.set(new Map(this.sessionDetailBySessionId)),s}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load session detail",t),null}finally{this.sessionDetailLoading_$.set(!1)}})}getCachedSessionDetail(e){return this.sessionDetailBySessionId.get(e)??null}loadSessionInfo(e){return l(this,null,function*(){if(!e)return null;this.sessionInfoLoading_$.set(!0),this.sessionInfoLoadError_$.set(null);try{let t=yield this.session_AS.getSessionInfo(e);return this.sessionInfoBySessionId.set(e,t),this.sessionInfoMap_$.set(new Map(this.sessionInfoBySessionId)),t}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load session info",t),this.sessionInfoLoadError_$.set(t),null}finally{this.sessionInfoLoading_$.set(!1)}})}getCachedSessionInfo(e){return this.sessionInfoBySessionId.get(e)??null}fetchLlmDebugTraceEntriesForRun(e){return l(this,null,function*(){let t=e.sessionId?.trim()??"",s=e.runId?.trim()??"";if(!t||!s)return[];try{return(yield this.session_AS.getLlmDebugTrace({sessionId:t,runId:s})).entries??[]}catch{return[]}})}loadLlmDebugTrace(e){return l(this,null,function*(){let t=e.sessionId?.trim()??"",s=e.runId?.trim()??"";if(!t||!s){this.llmDebugTraceEntries_$.set([]);return}this.llmDebugTraceLoading_$.set(!0),this.llmDebugTraceLoadError_$.set(null);try{let i=yield this.session_AS.getLlmDebugTrace({sessionId:t,runId:s});this.llmDebugTraceEntries_$.set(i.entries)}catch(i){d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load LLM debug trace",i),this.llmDebugTraceLoadError_$.set(i),this.llmDebugTraceEntries_$.set([])}finally{this.llmDebugTraceLoading_$.set(!1)}})}updateSession(e){return l(this,null,function*(){try{let t=yield this.session_AS.updateSession(e),s=e.updates.archived;return s===!0||s===!1?(yield this.loadSessions(),yield this.loadArchivedSessions()):yield this.loadSessions(),t.session}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to update session",t),null}})}applyAgentEventRunExecutionModeLatch(e){let t=e.phase,s=typeof t=="string"?t.trim():"";if(s===T.analyzeResult){let i=e.runExecutionMode;if(typeof i=="string"&&i.trim()!==""){let g=r.normalizeRunExecutionModeSocketValue(i);g!==void 0&&this.activeRunExecutionMode_$.set(g)}return}(s===T.runFlowComplete||s===T.runInitialization)&&this.activeRunExecutionMode_$.set("")}static normalizeRunExecutionModeSocketValue(e){let t=e.trim(),s=[C.instant,C.agenticAny,C.ask,C.plan];for(let i of s)if(t===i)return i}ngOnDestroy(){this.monitoringEvent_S.complete(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.connectedEffectRef&&(this.connectedEffectRef.destroy(),this.connectedEffectRef=null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{A as a,b,Ce as c};
2
- //# sourceMappingURL=chunk-QUTV6V23.js.map
1
+ import{a as P}from"./chunk-AQO5IW5B.js";import{a as T}from"./chunk-UFBTR2BG.js";import{a as U}from"./chunk-2VU3GISV.js";import{e as k}from"./chunk-FVNI46U2.js";import{G as C,I as y,p as O}from"./chunk-5N64HGRY.js";import{C as p,a as $,aa as o,b as v,h as N,jb as M,k as l,l as L,p as u,vb as f,xb as w,y as E}from"./chunk-TBMJSIBB.js";var A=class{static computeSocketUrlFromStatus(m,e){return e}};var b=class{static toDisplayString(m){if(m==null)return"";if(typeof m=="string")return m;if(typeof m=="object"&&m!==null){let t=m;if(typeof t.message=="string"&&t.message.trim().length>0)return t.message.trim();if(typeof t.error=="string"&&t.error.trim().length>0)return t.error.trim();if(typeof t.detail=="string"&&t.detail.trim().length>0)return t.detail.trim()}let e=String(m);return e==="[object Object]"?"\u2014":e}};var d=N(O());var R=(()=>{class r{baseUrl=`${y.api.baseUrl}/session`;http=p(w);getMessages(e){return u(this.http.get(`${this.baseUrl}/${e.sessionId}/messages`,{params:{viewMode:e.viewMode}}))}sendMessage(e){return u(this.http.post(`${this.baseUrl}/${e.sessionId}/messages`,{content:e.content,imageAttachments:e.imageAttachments}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var K=(()=>{class r{baseUrl=`${y.api.baseUrl}/session`;http=p(w);peiContext_DS=p(U);currentCcapId(){return this.peiContext_DS.activeCcapId_$()}withCcapId(e){let t=this.currentCcapId();return t?e.set("ccapId",t):e}listSessions(){let e=this.withCcapId(new f);return u(this.http.get(this.baseUrl,{params:e}))}listArchivedSessions(){let e=this.withCcapId(new f);return e=e.set("archived","true"),u(this.http.get(this.baseUrl,{params:e}))}createSession(e){let t={},s=e?.name!==void 0?e.name.trim():void 0;s!==void 0&&s.length>0&&(t.name=s);let i=this.withCcapId(new f);return u(this.http.post(this.baseUrl,t,{params:i}))}getSession(e){let t=this.withCcapId(new f);return u(this.http.get(`${this.baseUrl}/${e}`,{params:t}))}updateSession(e){let t=this.withCcapId(new f);return u(this.http.patch(`${this.baseUrl}/${e.sessionId}`,e.updates,{params:t}))}getSessionInfo(e){let t=this.withCcapId(new f);return u(this.http.get(`${this.baseUrl}/${e}/session-info`,{params:t}))}copySession(e){let t={};e.name&&(t.name=e.name),e.forkUntilMessageKey&&(t.forkUntilMessageKey=e.forkUntilMessageKey);let s=this.withCcapId(new f);return u(this.http.post(`${this.baseUrl}/${e.sessionId}/copy`,t,{params:s}))}stopExecution(e){let t=this.withCcapId(new f);return u(this.http.post(`${this.baseUrl}/${e}/stop-execution`,{},{params:t}))}getLlmDebugTrace(e){let t=this.withCcapId(new f);return t=t.set("runId",e.runId),u(this.http.get(`${this.baseUrl}/${e.sessionId}/llm-debug-trace`,{params:t}))}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();var j="answer",V="notify-user",B="agent-events",z="context:updated",H="monitoring:event",G="user-interaction:request",q="user-interaction:resolved",W="ccap_notification",Q="notification-sent",X="waiting-for-user",Ce=(()=>{class r{sessionDetailBySessionId=new Map;sessionInfoBySessionId=new Map;activeSessionId_$=o("");requestSidebarCloseOnMobileBump_$=o(0);sessions_$=o([]);sessionsLoadError_$=o(null);sessionsLoading_$=o(!1);archivedSessions_$=o([]);archivedSessionsLoading_$=o(!1);messages_$=o([]);messagesLoading_$=o(!1);messagesLoadError_$=o(null);agentEvents_$=o({});activeRunExecutionMode_$=o("");contextUpdated_$=o(null);monitoringEvent_$=o(null);monitoringEvent_S=new L;pendingInteraction_$=o(null);pendingNotification_$=o(null);sessionDetailMap_$=o(new Map);sessionDetailLoading_$=o(!1);sessionInfoMap_$=o(new Map);sessionInfoLoading_$=o(!1);sessionInfoLoadError_$=o(null);llmDebugTraceEntries_$=o([]);llmDebugTraceLoading_$=o(!1);llmDebugTraceLoadError_$=o(null);eventSubscription=null;connectedEffectRef=null;session_AS=p(K);conversation_AS=p(R);serverStatus_AS=p(P);socket_CS=p(k);get connected_$(){return this.socket_CS.connected_$}get socketStatus_$(){return this.socket_CS.status_$}get lastSocketError_$(){return this.socket_CS.lastError_$}get connectAttemptCount_$(){return this.socket_CS.connectAttemptCount_$}diagnoseConnection(){return this.socket_CS.diagnoseConnection()}constructor(){this.eventSubscription=this.socket_CS.event$.subscribe(e=>{this.handleSocketEvent(e)}),this.connectedEffectRef=M(()=>{this.socket_CS.connected_$()&&this.getActiveSessionId()&&this.socket_CS.emit("session:attach",{sessionId:this.getActiveSessionId()})})}handleSocketEvent(e){let t=e.payload??{},s=this.getActiveSessionId(),i=typeof t.channelId=="string"?t.channelId:void 0,g=typeof t.sessionId=="string"?t.sessionId:void 0,I=!i&&!g||i===s||g===s;if(e.event===j&&I){let n=typeof t.content=="string"?t.content:"",a=typeof t.timestamp=="string"?t.timestamp:new Date().toISOString(),c=typeof t.runId=="string"?t.runId:void 0,S={role:"assistant",content:n,timestamp:new Date(a)},h=c?v($({},S),{runId:c}):S,_=this.ensureClientListKey(h);this.messages_$.set([...this.messages_$(),_]);return}if(e.event===V&&I){let n=typeof t.content=="string"?t.content:"";d.DyFM_Log.info(`CCAP_SessionDS | notify-user received: ${n.substring(0,120)}\u2026`);let a=this.ensureClientListKey({role:"system",content:n,timestamp:new Date});this.messages_$.set([...this.messages_$(),a]);return}if(e.event===B){let n=typeof t.eventData=="object"&&t.eventData!==null?t.eventData:{};this.agentEvents_$.set(n),this.applyAgentEventRunExecutionModeLatch(n);let a=typeof n.toolId=="string"?n.toolId:"",c=typeof n.phase=="string"?n.phase:"";a===W&&(c===Q||c===X)?this.pendingNotification_$.set({phase:c,notificationTitle:typeof n.notificationTitle=="string"?n.notificationTitle:"",notificationType:typeof n.notificationType=="string"?n.notificationType:"",notificationPriority:typeof n.notificationPriority=="string"?n.notificationPriority:"info"}):this.pendingNotification_$()&&this.pendingNotification_$.set(null);let S=n.toolError,h=i??n.channelId,_=!h||h===s,D=b.toDisplayString(S).trim();if(D.length>0&&_){d.DyFM_Log.info(`CCAP_SessionDS | toolError from agent-events, pushing to chat: ${D.substring(0,80)}\u2026`);let F=this.ensureClientListKey({role:"system",content:D,timestamp:new Date});this.messages_$.set([...this.messages_$(),F])}return}if(e.event===z){let n=typeof t.sessionId=="string"?t.sessionId:"",a=typeof t.contextState=="object"&&t.contextState!==null?t.contextState:{};this.contextUpdated_$.set({sessionId:n,contextState:a});return}if(e.event===H){let n=typeof t.sessionId=="string"?t.sessionId:"",a=typeof t.event=="object"&&t.event!==null?t.event:{},c={sessionId:n,event:a};this.monitoringEvent_$.set(c),this.monitoringEvent_S.next(c);return}if(e.event===G&&I){this.pendingInteraction_$.set(t);return}if(e.event===q&&I){let n=typeof t.interactionId=="string"?t.interactionId:void 0;if(!n)return;this.pendingInteraction_$()?.interactionId===n&&this.pendingInteraction_$.set(null);return}}loadSessions(){return l(this,null,function*(){this.sessionsLoading_$.set(!0);try{this.sessionsLoadError_$.set(null);let e=yield this.session_AS.listSessions();return this.sessions_$.set(e.sessions),e.sessions}catch(e){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load sessions",e),this.sessionsLoadError_$.set(e),[]}finally{this.sessionsLoading_$.set(!1)}})}createSession(e){return l(this,null,function*(){let t=yield this.session_AS.createSession(e);return yield this.loadSessions(),t.session})}copySession(e){return l(this,null,function*(){let t=yield this.session_AS.copySession(e);return yield this.loadSessions(),t.session})}forkSession(e){return l(this,null,function*(){let t=yield this.session_AS.copySession({sessionId:e.sessionId,name:e.name,forkUntilMessageKey:e.forkUntilMessageKey});return yield this.loadSessions(),t.session})}loadArchivedSessions(){return l(this,null,function*(){this.archivedSessionsLoading_$.set(!0);try{let e=yield this.session_AS.listArchivedSessions();return this.archivedSessions_$.set(e.sessions),e.sessions}catch(e){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load archived sessions",e),this.archivedSessions_$.set([]),[]}finally{this.archivedSessionsLoading_$.set(!1)}})}setActiveSession(e){this.activeSessionId_$()!==e&&(this.activeSessionId_$.set(e),this.clearMessages(),this.pendingInteraction_$.set(null),this.activeRunExecutionMode_$.set("")),this.socket_CS.emit("session:attach",{sessionId:e})}getActiveSessionId(){return this.activeSessionId_$()}reconnectSocket(){return l(this,null,function*(){try{let e=yield this.serverStatus_AS.getStatus(),t=typeof window<"u"?window.location.origin:"",s=A.computeSocketUrlFromStatus({httpPort:e.httpPort,socketPort:e.socketPort},t),i=y.socketUrl??t;if(s!==i&&typeof window<"u"){y.socketUrl=s,d.DyFM_Log.info("CCAP_SessionDS | socketUrl changed on reconnect, reloading",s),window.location.reload();return}}catch{}this.socket_CS.reconnect()})}stopExecution(e){return l(this,null,function*(){try{return(yield this.session_AS.stopExecution(e)).success}catch(t){return d.DyFM_Error.logSimple("CCAP_Session_DS | stopExecution failed",t),!1}})}sendMessageViaSocket(e,t){return l(this,null,function*(){let s=e.trim();if(s==="/new")return{newSession:yield this.createSession(),sent:!0};let i=this.activeSessionId_$();if(!i)return{sent:!1};let g=(t?.length??0)>0;if(!s.length&&!g)return{sent:!1};let I={role:"user",content:e,timestamp:new Date},n=this.ensureClientListKey(I);this.messages_$.set([...this.messages_$(),n]);try{let c=(yield this.conversation_AS.sendMessage({sessionId:i,content:e,imageAttachments:t})).message,S=this.messages_$().map(h=>{if(h.clientListKey!==n.clientListKey)return h;let _=$({},h);return c.messageKey&&(_.messageKey=c.messageKey),c.hasTtsAudio!==void 0&&(_.hasTtsAudio=c.hasTtsAudio),_});return this.messages_$.set(S),{sent:!0}}catch(a){d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to send message via REST",a);let c=this.messages_$().filter(h=>h.clientListKey!==n.clientListKey);return this.messages_$.set(c),{sent:!1,error:a instanceof Error?a.message:"\xDCzenet k\xFCld\xE9se sikertelen."}}})}sendMessageToSession(e){return l(this,null,function*(){yield this.conversation_AS.sendMessage({sessionId:e.sessionId,content:e.content})})}sendInteractionResponse(e){this.socket_CS.emit("user-interaction:response",e),this.pendingInteraction_$.set(null)}clearMessages(){this.messages_$.set([])}setMessages(e){let s=(e??[]).map(i=>this.ensureClientListKey(i));this.messages_$.set(s)}ensureClientListKey(e){if(e.clientListKey?.trim()?.length)return e;let s=e.messageKey?.trim();return s?.length?v($({},e),{clientListKey:s}):v($({},e),{clientListKey:globalThis.crypto.randomUUID()})}setMessageTtsCached(e){let s=this.messages_$().map(i=>i.messageKey===e?v($({},i),{hasTtsAudio:!0}):i);this.messages_$.set(s)}loadMessagesForView(e){return l(this,null,function*(){this.messagesLoading_$.set(!0),this.messagesLoadError_$.set(null);try{let s=(yield this.conversation_AS.getMessages({sessionId:e,viewMode:"conversationFull"})).messages??[];return e===this.activeSessionId_$()&&this.setMessages(s),s}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load messages for view",t),this.messagesLoadError_$.set(t),[]}finally{this.messagesLoading_$.set(!1)}})}loadSessionDetail(e){return l(this,null,function*(){if(!e)return null;this.sessionDetailLoading_$.set(!0);try{let t=yield this.session_AS.getSession(e),s={session:t.session,lastRun:t.lastRun??null};return this.sessionDetailBySessionId.set(e,s),this.sessionDetailMap_$.set(new Map(this.sessionDetailBySessionId)),s}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load session detail",t),null}finally{this.sessionDetailLoading_$.set(!1)}})}getCachedSessionDetail(e){return this.sessionDetailBySessionId.get(e)??null}loadSessionInfo(e){return l(this,null,function*(){if(!e)return null;this.sessionInfoLoading_$.set(!0),this.sessionInfoLoadError_$.set(null);try{let t=yield this.session_AS.getSessionInfo(e);return this.sessionInfoBySessionId.set(e,t),this.sessionInfoMap_$.set(new Map(this.sessionInfoBySessionId)),t}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load session info",t),this.sessionInfoLoadError_$.set(t),null}finally{this.sessionInfoLoading_$.set(!1)}})}getCachedSessionInfo(e){return this.sessionInfoBySessionId.get(e)??null}fetchLlmDebugTraceEntriesForRun(e){return l(this,null,function*(){let t=e.sessionId?.trim()??"",s=e.runId?.trim()??"";if(!t||!s)return[];try{return(yield this.session_AS.getLlmDebugTrace({sessionId:t,runId:s})).entries??[]}catch{return[]}})}loadLlmDebugTrace(e){return l(this,null,function*(){let t=e.sessionId?.trim()??"",s=e.runId?.trim()??"";if(!t||!s){this.llmDebugTraceEntries_$.set([]);return}this.llmDebugTraceLoading_$.set(!0),this.llmDebugTraceLoadError_$.set(null);try{let i=yield this.session_AS.getLlmDebugTrace({sessionId:t,runId:s});this.llmDebugTraceEntries_$.set(i.entries)}catch(i){d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to load LLM debug trace",i),this.llmDebugTraceLoadError_$.set(i),this.llmDebugTraceEntries_$.set([])}finally{this.llmDebugTraceLoading_$.set(!1)}})}updateSession(e){return l(this,null,function*(){try{let t=yield this.session_AS.updateSession(e),s=e.updates.archived;return s===!0||s===!1?(yield this.loadSessions(),yield this.loadArchivedSessions()):yield this.loadSessions(),t.session}catch(t){return d.DyFM_Error.logSimple("CCAP_SessionDS | Failed to update session",t),null}})}applyAgentEventRunExecutionModeLatch(e){let t=e.phase,s=typeof t=="string"?t.trim():"";if(s===T.analyzeResult){let i=e.runExecutionMode;if(typeof i=="string"&&i.trim()!==""){let g=r.normalizeRunExecutionModeSocketValue(i);g!==void 0&&this.activeRunExecutionMode_$.set(g)}return}(s===T.runFlowComplete||s===T.runInitialization)&&this.activeRunExecutionMode_$.set("")}static normalizeRunExecutionModeSocketValue(e){let t=e.trim(),s=[C.instant,C.agenticAny,C.ask,C.plan];for(let i of s)if(t===i)return i}ngOnDestroy(){this.monitoringEvent_S.complete(),this.eventSubscription&&(this.eventSubscription.unsubscribe(),this.eventSubscription=null),this.connectedEffectRef&&(this.connectedEffectRef.destroy(),this.connectedEffectRef=null)}static \u0275fac=function(t){return new(t||r)};static \u0275prov=E({token:r,factory:r.\u0275fac,providedIn:"root"})}return r})();export{A as a,b,Ce as c};
2
+ //# sourceMappingURL=chunk-PGKNPYIE.js.map
@@ -1,4 +1,4 @@
1
- import{a as K,b as J,c as X}from"./chunk-GQJGST2S.js";import{c as U,f as H,i as N,v as O}from"./chunk-EO4DNTT4.js";import{f as Q}from"./chunk-OEP5AH6P.js";import{$a as b,C as E,D as x,Fa as m,Ha as y,J as $,K as v,L as I,T as g,Ta as A,U as p,Z as a,aa as r,ab as F,da as f,ga as w,ha as T,hb as j,ia as W,ja as D,k as o,la as h,mb as B,oa as G,pa as q,qa as c,ra as u,sa as P,ua as R,ub as V,va as S,wa as d,y as M}from"./chunk-TBMJSIBB.js";var L=class s{static normalizeNewlines(l){return l.replace(/\r\n/g,`
1
+ import{a as K,b as J,c as X}from"./chunk-4WGQS2HA.js";import{c as U,f as H,i as N,v as O}from"./chunk-EO4DNTT4.js";import{f as Q}from"./chunk-I4M7XPFX.js";import{$a as b,C as E,D as x,Fa as m,Ha as y,J as $,K as v,L as I,T as g,Ta as A,U as p,Z as a,aa as r,ab as F,da as f,ga as w,ha as T,hb as j,ia as W,ja as D,k as o,la as h,mb as B,oa as G,pa as q,qa as c,ra as u,sa as P,ua as R,ub as V,va as S,wa as d,y as M}from"./chunk-TBMJSIBB.js";var L=class s{static normalizeNewlines(l){return l.replace(/\r\n/g,`
2
2
  `).replace(/\r/g,`
3
3
  `)}static sha256HexOfNormalized(l){return o(this,null,function*(){let e=s.normalizeNewlines(l),i=new TextEncoder().encode(e),n=yield crypto.subtle.digest("SHA-256",i),_=new Uint8Array(n),C="";for(let k=0;k<_.length;k+=1)C+=_[k].toString(16).padStart(2,"0");return C})}};var Y=(()=>{class s{projects_$=r([]);projectsLoading_$=r(!1);projectsError_$=r(null);projectsLoadedOnce_$=r(!1);activeProject_$=r(null);activeProjectComputedCcapHost_$=r(!1);activeProjectLoading_$=r(!1);activeProjectError_$=r(null);userRequests_$=r([]);userRequestsLoading_$=r(!1);userRequestsError_$=r(null);discoveredProjects_$=r([]);discoveryLoading_$=r(!1);discoveryError_$=r(null);gitStatusLoading_$=r(!1);gitStatusError_$=r(null);syncLoading_$=r(!1);syncError_$=r(null);lastSyncResult_$=r(null);fileContents_$=r(null);fileContentLoading_$=r(!1);fileContentError_$=r(null);testErrorReportsClearing_$=r(!1);agentReports_$=r([]);agentReportsLoading_$=r(!1);agentReportsError_$=r(null);activeAgentReport_$=r(null);activeAgentReportLoading_$=r(!1);activeAgentReportError_$=r(null);reviewsMeta_$=r([]);reviewsMetaLoading_$=r(!1);reviewsMetaError_$=r(null);reviewResult_$=r(null);reviewsRunning_$=r(!1);reviewsRunError_$=r(null);userInputWizardSuggestLoading_$=r(!1);userInputWizardSuggestError_$=r(null);userInputWizardFinalizeLoading_$=r(!1);userInputWizardFinalizeError_$=r(null);userInputWizardLastLlmSystemPrompt_$=r(null);userInputWizardLastLlmUserMessage_$=r(null);groups_$=r([]);groupsLoading_$=r(!1);groupsError_$=r(null);activeGroup_$=r(null);groupFiles_$=r(null);groupFilesLoading_$=r(!1);groupFilesError_$=r(null);crossInstanceProjects_$=r([]);crossInstanceLoading_$=r(!1);crossInstanceError_$=r(null);currentCcapId_$=r(null);cloneLoading_$=r(!1);cloneError_$=r(null);pm_AS=E(Q);loadProjects(){return o(this,null,function*(){this.projectsLoading_$.set(!0),this.projectsError_$.set(null);try{let e=yield this.pm_AS.listProjects();this.projects_$.set(e.projects),this.projectsLoadedOnce_$.set(!0)}catch(e){this.projectsError_$.set(e)}finally{this.projectsLoading_$.set(!1)}})}loadProject(e){return o(this,null,function*(){this.activeProjectLoading_$.set(!0),this.activeProjectError_$.set(null);try{let t=yield this.pm_AS.getProject(e);this.activeProject_$.set(t.project),this.activeProjectComputedCcapHost_$.set(t.computedCcapRevisionedHost)}catch(t){this.activeProjectError_$.set(t)}finally{this.activeProjectLoading_$.set(!1)}})}createProject(e){return o(this,null,function*(){let t=yield this.pm_AS.createProject(e);return yield this.loadProjects(),t.project})}updateProject(e,t){return o(this,null,function*(){let i=yield this.pm_AS.updateProject(e,t);this.activeProject_$.set(i.project),this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost),this.projects_$.update(n=>n.map(_=>_._id===e?i.project:_))})}archiveProject(e){return o(this,null,function*(){yield this.pm_AS.archiveProject(e),yield this.loadProjects(),this.activeProject_$()?._id===e&&(this.activeProject_$.set(null),this.activeProjectComputedCcapHost_$.set(!1))})}loadGroups(){return o(this,null,function*(){this.groupsLoading_$.set(!0),this.groupsError_$.set(null);try{let e=yield this.pm_AS.listGroups();this.groups_$.set(e.groups)}catch(e){this.groupsError_$.set(e)}finally{this.groupsLoading_$.set(!1)}})}createGroup(e){return o(this,null,function*(){yield this.pm_AS.createGroup(e),yield this.loadGroups()})}archiveGroup(e){return o(this,null,function*(){yield this.pm_AS.archiveGroup(e),this.activeGroup_$()?._id===e&&this.activeGroup_$.set(null),yield this.loadGroups()})}selectGroup(e){this.activeGroup_$.set(e)}loadGroupFiles(e){return o(this,null,function*(){this.groupFilesLoading_$.set(!0),this.groupFilesError_$.set(null);try{let t=yield this.pm_AS.getGroupFiles(e);this.groupFiles_$.set(t)}catch(t){this.groupFilesError_$.set(t)}finally{this.groupFilesLoading_$.set(!1)}})}loadCrossInstanceProjects(){return o(this,null,function*(){this.crossInstanceLoading_$.set(!0),this.crossInstanceError_$.set(null);try{let e=yield this.pm_AS.listAllProjectsAcrossInstances();this.crossInstanceProjects_$.set(e.projects),this.currentCcapId_$.set(e.currentCcapId)}catch(e){this.crossInstanceError_$.set(e)}finally{this.crossInstanceLoading_$.set(!1)}})}cloneProject(e){return o(this,null,function*(){this.cloneLoading_$.set(!0),this.cloneError_$.set(null);try{yield this.pm_AS.cloneProject({sourceProjectId:e.sourceProjectId,targetParentDir:e.targetParentDir,repoName:e.repoName}),yield this.loadProjects()}catch(t){this.cloneError_$.set(t)}finally{this.cloneLoading_$.set(!1)}})}cloneGroup(e){return o(this,null,function*(){this.cloneLoading_$.set(!0),this.cloneError_$.set(null);try{yield this.pm_AS.cloneGroup({sourceGroupId:e.sourceGroupId,targetParentDir:e.targetParentDir}),yield this.loadProjects(),yield this.loadGroups()}catch(t){this.cloneError_$.set(t)}finally{this.cloneLoading_$.set(!1)}})}discoverProjects(e){return o(this,null,function*(){this.discoveryLoading_$.set(!0),this.discoveryError_$.set(null),this.discoveredProjects_$.set([]);try{let t=yield this.pm_AS.discoverProjects(e);this.discoveredProjects_$.set(t.discoveredProjects)}catch(t){this.discoveryError_$.set(t)}finally{this.discoveryLoading_$.set(!1)}})}createDiscoveredProjects(e){return o(this,null,function*(){for(let t of e){let i={name:t.name,localPath:t.localPath,description:t.description,githubRepoUrl:t.githubRepoUrl,isActive:!0};yield this.pm_AS.createProject(i)}yield this.loadProjects()})}clearDiscovery(){this.discoveredProjects_$.set([]),this.discoveryError_$.set(null),this.discoveryLoading_$.set(!1)}refreshGitStatus(e){return o(this,null,function*(){this.gitStatusLoading_$.set(!0),this.gitStatusError_$.set(null);try{let t=yield this.pm_AS.refreshGitStatus(e);this.activeProject_$.set(t.project);try{let i=yield this.pm_AS.getProject(e);this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost)}catch{}this.projects_$.update(i=>i.map(n=>n._id===e?t.project:n))}catch(t){this.gitStatusError_$.set(t)}finally{this.gitStatusLoading_$.set(!1)}})}syncProject(e){return o(this,null,function*(){this.syncLoading_$.set(!0),this.syncError_$.set(null),this.lastSyncResult_$.set(null);try{let t=yield this.pm_AS.syncProject(e);this.lastSyncResult_$.set(t.syncResult),this.activeProject_$.set(t.project);try{let i=yield this.pm_AS.getProject(e);this.activeProjectComputedCcapHost_$.set(i.computedCcapRevisionedHost)}catch{}this.projects_$.update(i=>i.map(n=>n._id===e?t.project:n))}catch(t){this.syncError_$.set(t)}finally{this.syncLoading_$.set(!1)}})}syncAllProjects(){return o(this,null,function*(){this.syncLoading_$.set(!0),this.syncError_$.set(null);try{yield this.pm_AS.syncAllProjects(),yield this.loadProjects()}catch(e){this.syncError_$.set(e)}finally{this.syncLoading_$.set(!1)}})}loadAllFileContents(e){return o(this,null,function*(){this.fileContentLoading_$.set(!0),this.fileContentError_$.set(null);try{let t=yield this.pm_AS.getAllFileContents(e);this.fileContents_$.set(t.files)}catch(t){this.fileContentError_$.set(t)}finally{this.fileContentLoading_$.set(!1)}})}clearTestErrorReportsAndRefresh(e){return o(this,null,function*(){this.testErrorReportsClearing_$.set(!0);try{yield this.pm_AS.clearTestErrorReports(e),yield this.loadAllFileContents(e)}finally{this.testErrorReportsClearing_$.set(!1)}})}getBugsPathResolve(e){return o(this,null,function*(){return this.pm_AS.getBugsPathResolve(e)})}appendBugsFromErrorsAndRefreshFiles(e,t){return o(this,null,function*(){let i=yield this.pm_AS.appendBugsFromErrors(e,t);return yield this.loadAllFileContents(e),i})}appendSingleBugFromErrorAndRefreshFiles(e,t,i){return o(this,null,function*(){let n=yield this.pm_AS.appendSingleBugFromError(e,t,i);return yield this.loadAllFileContents(e),n})}createManualBugAndRefresh(e,t){return o(this,null,function*(){let i=yield this.pm_AS.createManualBug(e,t);return yield this.loadAllFileContents(e),yield this.loadUserRequests(e),i})}loadUserRequests(e){return o(this,null,function*(){this.userRequestsLoading_$.set(!0),this.userRequestsError_$.set(null);try{let t=yield this.pm_AS.listUserRequests(e);this.userRequests_$.set(t.userRequests)}catch(t){this.userRequestsError_$.set(t)}finally{this.userRequestsLoading_$.set(!1)}})}createUserRequest(e,t){return o(this,null,function*(){yield this.pm_AS.createUserRequest(e,t),yield this.loadUserRequests(e)})}updateUserRequest(e,t,i){return o(this,null,function*(){let n=yield this.pm_AS.updateUserRequest(e,t,i);this.userRequests_$.update(_=>_.map(C=>C._id===t?n.userRequest:C))})}suggestUserInputFormat(e,t){return o(this,null,function*(){this.userInputWizardSuggestLoading_$.set(!0),this.userInputWizardSuggestError_$.set(null),this.userInputWizardLastLlmSystemPrompt_$.set(null),this.userInputWizardLastLlmUserMessage_$.set(null);try{let i=yield this.pm_AS.suggestUserInputFormat(e,t);return this.userInputWizardLastLlmSystemPrompt_$.set(i.llmSystemPrompt??null),this.userInputWizardLastLlmUserMessage_$.set(i.llmUserMessage??null),i}catch(i){throw this.userInputWizardSuggestError_$.set(i),i}finally{this.userInputWizardSuggestLoading_$.set(!1)}})}mutateControlFileEntryAndRefresh(e,t,i){return o(this,null,function*(){let n=i.priorRawFingerprintSha256?.trim(),_=n!=null&&n.length>0?n:yield L.sha256HexOfNormalized(i.priorRawBlock),C={mode:i.mode,priorRawBlock:i.priorRawBlock,priorRawFingerprintSha256:_,newRawBlock:i.newRawBlock,bugsFileAbsolutePath:i.bugsFileAbsolutePath},k=yield this.pm_AS.mutateControlFileEntry(e,t,C);return yield this.loadAllFileContents(e),k})}finalizeUserInputWizard(e,t){return o(this,null,function*(){this.userInputWizardFinalizeLoading_$.set(!0),this.userInputWizardFinalizeError_$.set(null);try{let i=yield this.pm_AS.finalizeUserInput(e,t);return yield this.loadUserRequests(e),yield this.loadAllFileContents(e),i}catch(i){throw this.userInputWizardFinalizeError_$.set(i),i}finally{this.userInputWizardFinalizeLoading_$.set(!1)}})}loadReviewsMeta(e){return o(this,null,function*(){this.reviewsMetaLoading_$.set(!0),this.reviewsMetaError_$.set(null);try{let t=yield this.pm_AS.getReviewsMeta(e);this.reviewsMeta_$.set(t.reviewsMeta)}catch(t){this.reviewsMetaError_$.set(t)}finally{this.reviewsMetaLoading_$.set(!1)}})}runProjectReviews(e,t){return o(this,null,function*(){this.reviewsRunning_$.set(!0),this.reviewsRunError_$.set(null),this.reviewResult_$.set(null);try{let i=yield this.pm_AS.runProjectReviews(e,t);this.reviewResult_$.set(i.reviewResult)}catch(i){this.reviewsRunError_$.set(i)}finally{this.reviewsRunning_$.set(!1)}})}loadAgentReports(e){return o(this,null,function*(){this.agentReportsLoading_$.set(!0),this.agentReportsError_$.set(null);try{let t=yield this.pm_AS.listAgentReports(e);this.agentReports_$.set(t.reports)}catch(t){this.agentReportsError_$.set(t)}finally{this.agentReportsLoading_$.set(!1)}})}loadAgentReport(e,t){return o(this,null,function*(){this.activeAgentReportLoading_$.set(!0),this.activeAgentReportError_$.set(null);try{let i=yield this.pm_AS.getAgentReportContent(e,t);this.activeAgentReport_$.set(i)}catch(i){this.activeAgentReport_$.set(null),this.activeAgentReportError_$.set(i)}finally{this.activeAgentReportLoading_$.set(!1)}})}clearActiveAgentReport(){this.activeAgentReport_$.set(null),this.activeAgentReportError_$.set(null)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=M({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();function te(s,l){if(s&1&&(c(0,"span",0),m(1),u()),s&2){let e=l;w("title",e),a(),y(" ",e," ")}}var Z=(()=>{class s{workspacePath=p(void 0);pm_DS=E(Y);projectName_$=j(()=>{let e=this.workspacePath();if(!e)return null;let t=s.normalizePath(e);return t?this.pm_DS.projects_$().find(_=>!!_.localPath&&s.normalizePath(_.localPath)===t)?.name??null:null});constructor(){!this.pm_DS.projectsLoadedOnce_$()&&!this.pm_DS.projectsLoading_$()&&!this.pm_DS.projectsError_$()&&this.pm_DS.loadProjects()}static normalizePath(e){let t=e.trim().toLowerCase().replace(/\\/g,"/");for(;t.endsWith("/")&&t.length>1;)t=t.slice(0,-1);return t}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-project-badge"]],hostAttrs:[1,"ml-auto"],hostVars:2,hostBindings:function(t,i){t&2&&T("display",i.projectName_$()?"inline-flex":"none")},inputs:{workspacePath:[1,"workspacePath"]},standalone:!0,features:[A],decls:1,vars:1,consts:[[1,"text-[9px]","px-1","py-0.5","rounded","bg-sky-500/20","text-sky-300","border","border-sky-500/30","shrink-0","truncate","max-w-[140px]",3,"title"]],template:function(t,i){if(t&1&&f(0,te,2,2,"span",0),t&2){let n;h((n=i.projectName_$())?0:-1,n)}},encapsulation:2})}return s})();function ie(s,l){s&1&&P(0,"span",4)}function se(s,l){if(s&1&&P(0,"app-s-project-badge",7),s&2){let e=d();w("workspacePath",e.view().workspacePath)}}function re(s,l){s&1&&(c(0,"span",8),m(1," archived "),u())}function ne(s,l){if(s&1){let e=R();c(0,"button",13),S("click",function(i){$(e);let n=d();return v(n.handleScheduleIndicatorClick(i))}),I(),c(1,"svg",14),P(2,"rect",15)(3,"line",16)(4,"line",17)(5,"line",18),u()()}}function oe(s,l){if(s&1){let e=R();c(0,"button",19),S("click",function(i){$(e);let n=d();return v(n.handleCoordinatorIndicatorClick(i))}),I(),c(1,"svg",14),P(2,"circle",20)(3,"polygon",21),u()()}}function ae(s,l){if(s&1&&(c(0,"div",11),m(1),u()),s&2){let e=d();a(),y(" ",e.view().workspacePath," ")}}function le(s,l){if(s&1&&(c(0,"div",12)(1,"span",22),m(2),u()()),s&2){let e=d();a(2),y(" ",e.view().promptCount," prompts ")}}var ee=(()=>{class s{view=p.required();isActive=p(!1);showWorkspacePath=p(!1);showPromptCount=p(!1);selected=g();contextMenu=g();scheduleIndicatorClicked=g();coordinatorIndicatorClicked=g();handleSelect(){this.selected.emit(this.view().id)}handleContextMenu(e){e.preventDefault(),e.stopPropagation(),this.contextMenu.emit({event:e,id:this.view().id})}handleScheduleIndicatorClick(e){e.stopPropagation(),this.scheduleIndicatorClicked.emit(this.view().id)}handleCoordinatorIndicatorClick(e){e.stopPropagation(),this.coordinatorIndicatorClicked.emit(this.view().id)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-session-list-row"]],hostAttrs:[1,"block"],inputs:{view:[1,"view"],isActive:[1,"isActive"],showWorkspacePath:[1,"showWorkspacePath"],showPromptCount:[1,"showPromptCount"]},outputs:{selected:"selected",contextMenu:"contextMenu",scheduleIndicatorClicked:"scheduleIndicatorClicked",coordinatorIndicatorClicked:"coordinatorIndicatorClicked"},standalone:!0,features:[A],decls:17,vars:20,consts:[[1,"px-2","py-1.5","border-b","cursor-pointer","transition-colors",3,"click","contextmenu"],[1,"flex","items-center","gap-1.5"],[1,"relative","w-3.5","h-3.5","shrink-0","flex","items-center","justify-center",3,"title"],[1,"w-1.5","h-1.5","rounded-full",3,"ngClass"],[1,"absolute","inset-0","rounded-full","border","border-transparent","border-t-yellow-400","animate-spin"],[1,"text-xs","text-neutral-200","font-medium","truncate","shrink-1","min-w-0"],[1,"text-[10px]","text-neutral-400","shrink-0",3,"title"],[3,"workspacePath"],[1,"text-[8px]","px-0.5","rounded","bg-amber-500/15","text-amber-500","shrink-0"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"shrink-0","text-neonCyan/80","hover:text-neonCyan","focus:outline-none","focus:ring-1","focus:ring-neonCyan/60","rounded","p-0.5"],["type","button","title","Ehhez a session-h\xF6z tartozik koordin\xE1tor \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Coordinator attached \u2014 open popup",1,"shrink-0","text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5"],[1,"text-[10px]","text-neutral-500","truncate","mt-0.5","ml-5"],[1,"flex","items-center","gap-2","mt-0.5","ml-5"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"shrink-0","text-neonCyan/80","hover:text-neonCyan","focus:outline-none","focus:ring-1","focus:ring-neonCyan/60","rounded","p-0.5",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round","aria-hidden","true",1,"w-3","h-3"],["x","3","y","4","width","18","height","18","rx","2","ry","2"],["x1","16","y1","2","x2","16","y2","6"],["x1","8","y1","2","x2","8","y2","6"],["x1","3","y1","10","x2","21","y2","10"],["type","button","title","Ehhez a session-h\xF6z tartozik koordin\xE1tor \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Coordinator attached \u2014 open popup",1,"shrink-0","text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5",3,"click"],["cx","12","cy","12","r","10"],["points","16.24 7.76 14.12 14.12 7.76 16.24 9.88 9.88 16.24 7.76"],[1,"text-[10px]","text-neutral-600"]],template:function(t,i){if(t&1&&(c(0,"div",0),S("click",function(){return i.handleSelect()})("contextmenu",function(_){return i.handleContextMenu(_)}),c(1,"div",1)(2,"span",2),P(3,"span",3),f(4,ie,1,0,"span",4),u(),c(5,"span",5),m(6),u(),c(7,"span",6),b(8,"sAbsoluteTime"),m(9),b(10,"sTimeAgo"),u(),f(11,se,1,1,"app-s-project-badge",7)(12,re,2,0,"span",8)(13,ne,6,0,"button",9)(14,oe,4,0,"button",10),u(),f(15,ae,2,1,"div",11)(16,le,3,1,"div",12),u()),t&2){let n;D(i.isActive()?"border-l-2 border-l-ccapAccent border-b-neutral-700/30 bg-neutral-800/80":"border-l-2 border-l-transparent border-b-neutral-700/30 hover:bg-neutral-800/60"),W("opacity-50",i.view().isArchived),a(2),w("title",i.view().status),a(),w("ngClass",i.view().statusColorClass),a(),h(i.view().isRunning?4:-1),a(2),y(" ",i.view().label," "),a(),w("title",F(8,16,(n=i.view().lastActivityAt)!==null&&n!==void 0?n:"")),a(2),y(" ",i.view().lastActivityAt?F(10,18,i.view().lastActivityAt):"\u2014"," "),a(2),h(i.view().workspacePath?11:-1),a(),h(i.view().isArchived?12:-1),a(),h(i.view().hasSchedule?13:-1),a(),h(i.view().hasCoordinator?14:-1),a(),h(i.showWorkspacePath()&&i.view().workspacePath?15:-1),a(),h(i.showPromptCount()&&i.view().promptCount?16:-1)}},dependencies:[B,J,X,Z],encapsulation:2})}return s})();var ce=(s,l)=>l.id;function ue(s,l){if(s&1){let e=R();c(0,"div",1)(1,"input",5),S("ngModelChange",function(i){$(e);let n=d();return v(n.searchQuery_$.set(i))}),u()()}if(s&2){let e=d();a(),w("placeholder",e.searchPlaceholder())("ngModel",e.searchQuery_$())}}function pe(s,l){if(s&1){let e=R();c(0,"app-s-session-list-row",6),S("selected",function(i){$(e);let n=d();return v(n.handleRowSelect(i))})("contextMenu",function(i){$(e);let n=d();return v(n.handleRowContextMenu(i))})("scheduleIndicatorClicked",function(i){$(e);let n=d();return v(n.handleRowScheduleIndicatorClick(i))})("coordinatorIndicatorClicked",function(i){$(e);let n=d();return v(n.handleRowCoordinatorIndicatorClick(i))}),u()}if(s&2){let e=l.$implicit,t=d();w("view",e)("isActive",e.id===t.activeId())("showWorkspacePath",t.showWorkspacePath())("showPromptCount",t.showPromptCount())}}function de(s,l){s&1&&m(0," Nincs tal\xE1lat. ")}function _e(s,l){s&1&&m(0," \xDCres lista. ")}function he(s,l){if(s&1&&(c(0,"span",4),f(1,de,1,0)(2,_e,1,0),u()),s&2){let e=d();a(),h(e.searchQuery_$().trim().length>0?1:2)}}var qe=(()=>{class s{kind=p.required();rows=p([]);activeId=p("");showWorkspacePath=p(!1);showPromptCount=p(!1);searchPlaceholder=p("Keres\xE9s...");hideSearch=p(!1);selected=g();contextMenu=g();scheduleIndicatorClicked=g();coordinatorIndicatorClicked=g();searchQuery_$=r("");filteredRows_$=j(()=>{let e=this.rows();if(this.hideSearch())return e;let t=this.searchQuery_$();return t.trim().length===0?e:e.filter(i=>K.includesText(i.label,t))});handleRowSelect(e){this.selected.emit(e)}handleRowContextMenu(e){this.contextMenu.emit(e)}handleRowScheduleIndicatorClick(e){this.scheduleIndicatorClicked.emit(e)}handleRowCoordinatorIndicatorClick(e){this.coordinatorIndicatorClicked.emit(e)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=x({type:s,selectors:[["app-s-session-select"]],hostAttrs:[1,"block"],inputs:{kind:[1,"kind"],rows:[1,"rows"],activeId:[1,"activeId"],showWorkspacePath:[1,"showWorkspacePath"],showPromptCount:[1,"showPromptCount"],searchPlaceholder:[1,"searchPlaceholder"],hideSearch:[1,"hideSearch"]},outputs:{selected:"selected",contextMenu:"contextMenu",scheduleIndicatorClicked:"scheduleIndicatorClicked",coordinatorIndicatorClicked:"coordinatorIndicatorClicked"},standalone:!0,features:[A],decls:6,vars:2,consts:[[1,"flex","flex-col","gap-2"],[1,"px-2","pt-2"],[1,"flex","flex-col","gap-1","px-2","pb-2"],[3,"view","isActive","showWorkspacePath","showPromptCount"],[1,"text-[11px]","text-neutral-500","italic","px-1","py-2"],["type","text","data-testid","s-session-select-search",1,"w-full","px-2","py-1","text-xs","rounded","border","border-neonDefault","bg-neutral-900","text-neutral-200","placeholder-neutral-500","focus:outline-none","focus:border-ccapAccent",3,"ngModelChange","placeholder","ngModel"],[3,"selected","contextMenu","scheduleIndicatorClicked","coordinatorIndicatorClicked","view","isActive","showWorkspacePath","showPromptCount"]],template:function(t,i){t&1&&(c(0,"div",0),f(1,ue,2,2,"div",1),c(2,"div",2),G(3,pe,1,4,"app-s-session-list-row",3,ce),f(5,he,3,1,"span",4),u()()),t&2&&(a(),h(i.hideSearch()?-1:1),a(2),q(i.filteredRows_$()),a(2),h(i.filteredRows_$().length===0?5:-1))},dependencies:[V,O,U,H,N,ee],encapsulation:2})}return s})();export{Y as a,ee as b,qe as c};
4
- //# sourceMappingURL=chunk-2NU642AU.js.map
4
+ //# sourceMappingURL=chunk-PWAWM6DC.js.map