@futdevpro/ccap 1.1.3034 → 1.1.3039

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 (181) hide show
  1. package/client-dist/{agent-instances.module-DNEQ4QES.js → agent-instances.module-63DMGKO2.js} +2 -2
  2. package/client-dist/{ca.module-RGPRFFQR.js → ca.module-T4GLGQMJ.js} +2 -2
  3. package/client-dist/ca.module-T4GLGQMJ.js.map +7 -0
  4. package/client-dist/{cc-usage-dashboard.component-PEZVSG7M.js → cc-usage-dashboard.component-WQFT75MV.js} +2 -2
  5. package/client-dist/{cc.module-JUQY7GCV.js → cc.module-PEJ6OV2U.js} +2 -2
  6. package/client-dist/cc.module-PEJ6OV2U.js.map +7 -0
  7. package/client-dist/{chunk-E4KDYJK2.js → chunk-2AGHFWEW.js} +2 -2
  8. package/client-dist/{chunk-ZGYR3BWU.js → chunk-2K7AS4TQ.js} +2 -2
  9. package/client-dist/{chunk-AZLDEUIZ.js → chunk-3GFRMENC.js} +2 -2
  10. package/client-dist/{chunk-AOKITOTZ.js → chunk-3ZIP6GFB.js} +2 -2
  11. package/client-dist/{chunk-B5D2O575.js → chunk-44PQAFEL.js} +2 -2
  12. package/client-dist/{chunk-6HT66YVK.js → chunk-4MMPDNPS.js} +2 -2
  13. package/client-dist/{chunk-YPZWNP5A.js → chunk-54YZZ7DI.js} +2 -2
  14. package/client-dist/{chunk-IIZH7NVD.js → chunk-56Q57BLF.js} +2 -2
  15. package/client-dist/{chunk-FV6SC2QU.js → chunk-5A22WYW7.js} +2 -2
  16. package/client-dist/{chunk-OMXNVPGE.js → chunk-5VMMYEMK.js} +2 -2
  17. package/client-dist/{chunk-Q5DHVZ7D.js → chunk-5Y3UBNHV.js} +2 -2
  18. package/client-dist/{chunk-P6FPD5OQ.js → chunk-6PIFC53E.js} +2 -2
  19. package/client-dist/{chunk-ZVQUYA4H.js → chunk-73W3SDF2.js} +2 -2
  20. package/client-dist/{chunk-YS7A2NP6.js → chunk-AD7RW3IE.js} +2 -2
  21. package/client-dist/{chunk-H3UBW75V.js → chunk-ATR4YAIL.js} +2 -2
  22. package/client-dist/{chunk-JWZ24GIQ.js → chunk-BJYELNNP.js} +2 -2
  23. package/client-dist/{chunk-P7KPEPO7.js → chunk-BNALWJUC.js} +2 -2
  24. package/client-dist/{chunk-JIYKLYYE.js → chunk-BPWY4SOQ.js} +2 -2
  25. package/client-dist/{chunk-HQMSP7F6.js → chunk-C4H7J567.js} +2 -2
  26. package/client-dist/{chunk-C77QVQH5.js → chunk-CUMUA2HP.js} +2 -2
  27. package/client-dist/{chunk-6H3YM2KP.js → chunk-EUMQRYBI.js} +2 -2
  28. package/client-dist/{chunk-SY5M3A3Q.js → chunk-GABPE7B3.js} +2 -2
  29. package/client-dist/{chunk-F4HSG3GQ.js → chunk-GBRJVJWI.js} +2 -2
  30. package/client-dist/{chunk-IEVAOKOF.js → chunk-H6OPOJX2.js} +2 -2
  31. package/client-dist/{chunk-ED2JP2SX.js → chunk-I3IKMSNZ.js} +2 -2
  32. package/client-dist/{chunk-AHBMUOS3.js → chunk-IOERVA2Z.js} +2 -2
  33. package/client-dist/{chunk-TS2SSYDS.js → chunk-JDBS6ZXD.js} +2 -2
  34. package/client-dist/{chunk-DOJVWJJ3.js → chunk-KD4JK4LC.js} +2 -2
  35. package/client-dist/{chunk-RJGC4CE7.js → chunk-M4CGCNOB.js} +2 -2
  36. package/client-dist/{chunk-E7UUENED.js → chunk-NNEFCEZZ.js} +2 -2
  37. package/client-dist/{chunk-Y2AUIGUM.js → chunk-NXBECCCW.js} +2 -2
  38. package/client-dist/{chunk-QE7LJZUK.js → chunk-OHI3J35R.js} +2 -2
  39. package/client-dist/{chunk-343QTRWG.js → chunk-OITOJMIX.js} +2 -2
  40. package/client-dist/{chunk-TBPY4N7X.js → chunk-PWGYG7KG.js} +2 -2
  41. package/client-dist/{chunk-KLIVF7NF.js → chunk-RIYSXVU2.js} +2 -2
  42. package/client-dist/{chunk-ZTPYZH3Z.js → chunk-RJX7O3DI.js} +2 -2
  43. package/client-dist/{chunk-CDFLZ523.js → chunk-RZPQNQWP.js} +2 -2
  44. package/client-dist/{chunk-AC6VDECU.js → chunk-S2FEPCDW.js} +2 -2
  45. package/client-dist/{chunk-B22GYBFL.js → chunk-SDS4IT63.js} +2 -2
  46. package/client-dist/{chunk-H62NDY3W.js → chunk-SNMSF3UC.js} +2 -2
  47. package/client-dist/{chunk-4F6OM6PQ.js → chunk-TKAV5X35.js} +2 -2
  48. package/client-dist/{chunk-BY7QOLIO.js → chunk-TXVACKLG.js} +2 -2
  49. package/client-dist/{chunk-OXGMGAWK.js → chunk-U3FLQ2MZ.js} +2 -2
  50. package/client-dist/{chunk-OXGMGAWK.js.map → chunk-U3FLQ2MZ.js.map} +2 -2
  51. package/client-dist/{chunk-TRPIAKRB.js → chunk-UOZVXYOQ.js} +2 -2
  52. package/client-dist/{chunk-MVAZ7JR5.js → chunk-UPREBG2C.js} +2 -2
  53. package/client-dist/{chunk-ZLKNTGRH.js → chunk-VA3QGKXE.js} +2 -2
  54. package/client-dist/{chunk-PS73GRXP.js → chunk-VILXJBM4.js} +2 -2
  55. package/client-dist/{chunk-5DVU3XRC.js → chunk-VRI47IVY.js} +2 -2
  56. package/client-dist/{chunk-5DVU3XRC.js.map → chunk-VRI47IVY.js.map} +1 -1
  57. package/client-dist/{chunk-3MSKVM2T.js → chunk-VS3F3LTC.js} +2 -2
  58. package/client-dist/{chunk-WKY6ZRDX.js → chunk-W3WV5NJ7.js} +2 -2
  59. package/client-dist/{chunk-Z2SVASLX.js → chunk-WL5L5AUS.js} +2 -2
  60. package/client-dist/{chunk-7R5IXHU5.js → chunk-WPT7HGB2.js} +2 -2
  61. package/client-dist/{chunk-CF6YGIKE.js → chunk-XSZRRELF.js} +2 -2
  62. package/client-dist/{chunk-XMFYG4OB.js → chunk-ZE4SBBQZ.js} +2 -2
  63. package/client-dist/{chunk-7SDU766A.js → chunk-ZELVI2B7.js} +2 -2
  64. package/client-dist/{chunk-CK5ZMGFL.js → chunk-ZKMLJXN4.js} +2 -2
  65. package/client-dist/{consultant.module-VDHVKNXB.js → consultant.module-H52V7TON.js} +2 -2
  66. package/client-dist/{consultant.module-VDHVKNXB.js.map → consultant.module-H52V7TON.js.map} +2 -2
  67. package/client-dist/{crd.module-746ZW6FL.js → crd.module-X5U6DQ3D.js} +2 -2
  68. package/client-dist/{dashboard.module-U2NE6P3E.js → dashboard.module-4LC4RSOF.js} +2 -2
  69. package/client-dist/{do.module-5V6Y3CDL.js → do.module-HWKFQZQK.js} +2 -2
  70. package/client-dist/{document-library.module-HXQGKT63.js → document-library.module-Z57ZOMUG.js} +2 -2
  71. package/client-dist/{embedding-eval.module-OENZYGQE.js → embedding-eval.module-ULD6Z5XA.js} +2 -2
  72. package/client-dist/{embedding-registry.module-RTS4TH4Q.js → embedding-registry.module-TGWG2VER.js} +2 -2
  73. package/client-dist/{err.module-E4JTGICP.js → err.module-V5HQPNPJ.js} +2 -2
  74. package/client-dist/{feedback.module-YFIHVIAZ.js → feedback.module-U2Z6XYBB.js} +2 -2
  75. package/client-dist/{host-runtime-mcp.module-N73MDNBO.js → host-runtime-mcp.module-ZZGAS7DP.js} +2 -2
  76. package/client-dist/index.html +1 -1
  77. package/client-dist/{live-dev-pipeline.module-IA4J3U76.js → live-dev-pipeline.module-TPPLFJXH.js} +2 -2
  78. package/client-dist/{logs.module-VRVZQ76G.js → logs.module-5ZT7XQ3Q.js} +2 -2
  79. package/client-dist/{main-AYZ66GKH.js → main-NSPSEMNL.js} +3 -3
  80. package/client-dist/{main-AYZ66GKH.js.map → main-NSPSEMNL.js.map} +2 -2
  81. package/client-dist/{master-control-remote-poc.module-ENMKL3BL.js → master-control-remote-poc.module-IK64YCVI.js} +2 -2
  82. package/client-dist/{mobile-app.module-25TPEFGS.js → mobile-app.module-GI44MNWC.js} +2 -2
  83. package/client-dist/{model-registry.module-DTJEN56N.js → model-registry.module-F7M4C7MR.js} +2 -2
  84. package/client-dist/{oc.module-2ZFRFAWW.js → oc.module-G4TGODLQ.js} +2 -2
  85. package/client-dist/oc.module-G4TGODLQ.js.map +7 -0
  86. package/client-dist/{orc.module-JLA5C7MW.js → orc.module-DOAWAEFJ.js} +2 -2
  87. package/client-dist/{project-management.module-NBKCZQ6Y.js → project-management.module-2SDSNJJL.js} +2 -2
  88. package/client-dist/project-source-routed.module-CQLNUDIR.js +2 -0
  89. package/client-dist/{scheduler.module-HFDAX5PZ.js → scheduler.module-25VUGCV3.js} +2 -2
  90. package/client-dist/{session.module-S5W7MI7Z.js → session.module-Q3KGKPUU.js} +2 -2
  91. package/client-dist/session.module-Q3KGKPUU.js.map +7 -0
  92. package/client-dist/{set.module-5NOTNWQ3.js → set.module-4NWORE5F.js} +2 -2
  93. package/client-dist/{setup.module-NBPWQBBC.js → setup.module-N3AYAAZ6.js} +2 -2
  94. package/client-dist/{terminals.module-2MRATCCN.js → terminals.module-3ELX7JV6.js} +2 -2
  95. package/client-dist/{voice-notes-poc.module-QRB77K3S.js → voice-notes-poc.module-ZHORCWRL.js} +2 -2
  96. package/client-dist/{wfs.module-ZWBQCUOA.js → wfs.module-EDYBZUSQ.js} +2 -2
  97. package/package.json +1 -1
  98. package/client-dist/ca.module-RGPRFFQR.js.map +0 -7
  99. package/client-dist/cc.module-JUQY7GCV.js.map +0 -7
  100. package/client-dist/oc.module-2ZFRFAWW.js.map +0 -7
  101. package/client-dist/project-source-routed.module-MDS232LH.js +0 -2
  102. package/client-dist/session.module-S5W7MI7Z.js.map +0 -7
  103. /package/client-dist/{agent-instances.module-DNEQ4QES.js.map → agent-instances.module-63DMGKO2.js.map} +0 -0
  104. /package/client-dist/{cc-usage-dashboard.component-PEZVSG7M.js.map → cc-usage-dashboard.component-WQFT75MV.js.map} +0 -0
  105. /package/client-dist/{chunk-E4KDYJK2.js.map → chunk-2AGHFWEW.js.map} +0 -0
  106. /package/client-dist/{chunk-ZGYR3BWU.js.map → chunk-2K7AS4TQ.js.map} +0 -0
  107. /package/client-dist/{chunk-AZLDEUIZ.js.map → chunk-3GFRMENC.js.map} +0 -0
  108. /package/client-dist/{chunk-AOKITOTZ.js.map → chunk-3ZIP6GFB.js.map} +0 -0
  109. /package/client-dist/{chunk-B5D2O575.js.map → chunk-44PQAFEL.js.map} +0 -0
  110. /package/client-dist/{chunk-6HT66YVK.js.map → chunk-4MMPDNPS.js.map} +0 -0
  111. /package/client-dist/{chunk-YPZWNP5A.js.map → chunk-54YZZ7DI.js.map} +0 -0
  112. /package/client-dist/{chunk-IIZH7NVD.js.map → chunk-56Q57BLF.js.map} +0 -0
  113. /package/client-dist/{chunk-FV6SC2QU.js.map → chunk-5A22WYW7.js.map} +0 -0
  114. /package/client-dist/{chunk-OMXNVPGE.js.map → chunk-5VMMYEMK.js.map} +0 -0
  115. /package/client-dist/{chunk-Q5DHVZ7D.js.map → chunk-5Y3UBNHV.js.map} +0 -0
  116. /package/client-dist/{chunk-P6FPD5OQ.js.map → chunk-6PIFC53E.js.map} +0 -0
  117. /package/client-dist/{chunk-ZVQUYA4H.js.map → chunk-73W3SDF2.js.map} +0 -0
  118. /package/client-dist/{chunk-YS7A2NP6.js.map → chunk-AD7RW3IE.js.map} +0 -0
  119. /package/client-dist/{chunk-H3UBW75V.js.map → chunk-ATR4YAIL.js.map} +0 -0
  120. /package/client-dist/{chunk-JWZ24GIQ.js.map → chunk-BJYELNNP.js.map} +0 -0
  121. /package/client-dist/{chunk-P7KPEPO7.js.map → chunk-BNALWJUC.js.map} +0 -0
  122. /package/client-dist/{chunk-JIYKLYYE.js.map → chunk-BPWY4SOQ.js.map} +0 -0
  123. /package/client-dist/{chunk-HQMSP7F6.js.map → chunk-C4H7J567.js.map} +0 -0
  124. /package/client-dist/{chunk-C77QVQH5.js.map → chunk-CUMUA2HP.js.map} +0 -0
  125. /package/client-dist/{chunk-6H3YM2KP.js.map → chunk-EUMQRYBI.js.map} +0 -0
  126. /package/client-dist/{chunk-SY5M3A3Q.js.map → chunk-GABPE7B3.js.map} +0 -0
  127. /package/client-dist/{chunk-F4HSG3GQ.js.map → chunk-GBRJVJWI.js.map} +0 -0
  128. /package/client-dist/{chunk-IEVAOKOF.js.map → chunk-H6OPOJX2.js.map} +0 -0
  129. /package/client-dist/{chunk-ED2JP2SX.js.map → chunk-I3IKMSNZ.js.map} +0 -0
  130. /package/client-dist/{chunk-AHBMUOS3.js.map → chunk-IOERVA2Z.js.map} +0 -0
  131. /package/client-dist/{chunk-TS2SSYDS.js.map → chunk-JDBS6ZXD.js.map} +0 -0
  132. /package/client-dist/{chunk-DOJVWJJ3.js.map → chunk-KD4JK4LC.js.map} +0 -0
  133. /package/client-dist/{chunk-RJGC4CE7.js.map → chunk-M4CGCNOB.js.map} +0 -0
  134. /package/client-dist/{chunk-E7UUENED.js.map → chunk-NNEFCEZZ.js.map} +0 -0
  135. /package/client-dist/{chunk-Y2AUIGUM.js.map → chunk-NXBECCCW.js.map} +0 -0
  136. /package/client-dist/{chunk-QE7LJZUK.js.map → chunk-OHI3J35R.js.map} +0 -0
  137. /package/client-dist/{chunk-343QTRWG.js.map → chunk-OITOJMIX.js.map} +0 -0
  138. /package/client-dist/{chunk-TBPY4N7X.js.map → chunk-PWGYG7KG.js.map} +0 -0
  139. /package/client-dist/{chunk-KLIVF7NF.js.map → chunk-RIYSXVU2.js.map} +0 -0
  140. /package/client-dist/{chunk-ZTPYZH3Z.js.map → chunk-RJX7O3DI.js.map} +0 -0
  141. /package/client-dist/{chunk-CDFLZ523.js.map → chunk-RZPQNQWP.js.map} +0 -0
  142. /package/client-dist/{chunk-AC6VDECU.js.map → chunk-S2FEPCDW.js.map} +0 -0
  143. /package/client-dist/{chunk-B22GYBFL.js.map → chunk-SDS4IT63.js.map} +0 -0
  144. /package/client-dist/{chunk-H62NDY3W.js.map → chunk-SNMSF3UC.js.map} +0 -0
  145. /package/client-dist/{chunk-4F6OM6PQ.js.map → chunk-TKAV5X35.js.map} +0 -0
  146. /package/client-dist/{chunk-BY7QOLIO.js.map → chunk-TXVACKLG.js.map} +0 -0
  147. /package/client-dist/{chunk-TRPIAKRB.js.map → chunk-UOZVXYOQ.js.map} +0 -0
  148. /package/client-dist/{chunk-MVAZ7JR5.js.map → chunk-UPREBG2C.js.map} +0 -0
  149. /package/client-dist/{chunk-ZLKNTGRH.js.map → chunk-VA3QGKXE.js.map} +0 -0
  150. /package/client-dist/{chunk-PS73GRXP.js.map → chunk-VILXJBM4.js.map} +0 -0
  151. /package/client-dist/{chunk-3MSKVM2T.js.map → chunk-VS3F3LTC.js.map} +0 -0
  152. /package/client-dist/{chunk-WKY6ZRDX.js.map → chunk-W3WV5NJ7.js.map} +0 -0
  153. /package/client-dist/{chunk-Z2SVASLX.js.map → chunk-WL5L5AUS.js.map} +0 -0
  154. /package/client-dist/{chunk-7R5IXHU5.js.map → chunk-WPT7HGB2.js.map} +0 -0
  155. /package/client-dist/{chunk-CF6YGIKE.js.map → chunk-XSZRRELF.js.map} +0 -0
  156. /package/client-dist/{chunk-XMFYG4OB.js.map → chunk-ZE4SBBQZ.js.map} +0 -0
  157. /package/client-dist/{chunk-7SDU766A.js.map → chunk-ZELVI2B7.js.map} +0 -0
  158. /package/client-dist/{chunk-CK5ZMGFL.js.map → chunk-ZKMLJXN4.js.map} +0 -0
  159. /package/client-dist/{crd.module-746ZW6FL.js.map → crd.module-X5U6DQ3D.js.map} +0 -0
  160. /package/client-dist/{dashboard.module-U2NE6P3E.js.map → dashboard.module-4LC4RSOF.js.map} +0 -0
  161. /package/client-dist/{do.module-5V6Y3CDL.js.map → do.module-HWKFQZQK.js.map} +0 -0
  162. /package/client-dist/{document-library.module-HXQGKT63.js.map → document-library.module-Z57ZOMUG.js.map} +0 -0
  163. /package/client-dist/{embedding-eval.module-OENZYGQE.js.map → embedding-eval.module-ULD6Z5XA.js.map} +0 -0
  164. /package/client-dist/{embedding-registry.module-RTS4TH4Q.js.map → embedding-registry.module-TGWG2VER.js.map} +0 -0
  165. /package/client-dist/{err.module-E4JTGICP.js.map → err.module-V5HQPNPJ.js.map} +0 -0
  166. /package/client-dist/{feedback.module-YFIHVIAZ.js.map → feedback.module-U2Z6XYBB.js.map} +0 -0
  167. /package/client-dist/{host-runtime-mcp.module-N73MDNBO.js.map → host-runtime-mcp.module-ZZGAS7DP.js.map} +0 -0
  168. /package/client-dist/{live-dev-pipeline.module-IA4J3U76.js.map → live-dev-pipeline.module-TPPLFJXH.js.map} +0 -0
  169. /package/client-dist/{logs.module-VRVZQ76G.js.map → logs.module-5ZT7XQ3Q.js.map} +0 -0
  170. /package/client-dist/{master-control-remote-poc.module-ENMKL3BL.js.map → master-control-remote-poc.module-IK64YCVI.js.map} +0 -0
  171. /package/client-dist/{mobile-app.module-25TPEFGS.js.map → mobile-app.module-GI44MNWC.js.map} +0 -0
  172. /package/client-dist/{model-registry.module-DTJEN56N.js.map → model-registry.module-F7M4C7MR.js.map} +0 -0
  173. /package/client-dist/{orc.module-JLA5C7MW.js.map → orc.module-DOAWAEFJ.js.map} +0 -0
  174. /package/client-dist/{project-management.module-NBKCZQ6Y.js.map → project-management.module-2SDSNJJL.js.map} +0 -0
  175. /package/client-dist/{project-source-routed.module-MDS232LH.js.map → project-source-routed.module-CQLNUDIR.js.map} +0 -0
  176. /package/client-dist/{scheduler.module-HFDAX5PZ.js.map → scheduler.module-25VUGCV3.js.map} +0 -0
  177. /package/client-dist/{set.module-5NOTNWQ3.js.map → set.module-4NWORE5F.js.map} +0 -0
  178. /package/client-dist/{setup.module-NBPWQBBC.js.map → setup.module-N3AYAAZ6.js.map} +0 -0
  179. /package/client-dist/{terminals.module-2MRATCCN.js.map → terminals.module-3ELX7JV6.js.map} +0 -0
  180. /package/client-dist/{voice-notes-poc.module-QRB77K3S.js.map → voice-notes-poc.module-ZHORCWRL.js.map} +0 -0
  181. /package/client-dist/{wfs.module-ZWBQCUOA.js.map → wfs.module-EDYBZUSQ.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{e as ne}from"./chunk-RJGC4CE7.js";import{a as ie}from"./chunk-FLAJXIYW.js";import{c as J,f as Q,i as X,v as ee}from"./chunk-EO4DNTT4.js";import"./chunk-4F6OM6PQ.js";import{I as te}from"./chunk-5DVU3XRC.js";import{C as w,D as L,Fa as r,Ga as I,Ha as d,J as U,K as A,L as v,M as S,Pa as N,Qa as j,R,Ra as W,Ta as G,Ua as K,Z as o,aa as _,da as x,fa as B,ga as f,ha as V,hb as Y,ia as E,ja as $,k as m,la as h,ma as P,na as z,oa as k,p as C,pa as D,qa as i,ra as a,sa as y,ua as F,ub as Z,va as b,wa as p,xb as q,y as O}from"./chunk-TBMJSIBB.js";var re=(()=>{class s{baseUrl=`${te.api.baseUrl}/cc-account`;http=w(q);listAccounts(){return C(this.http.get(`${this.baseUrl}/list`))}refreshLocalAccounts(){return C(this.http.post(`${this.baseUrl}/refresh`,{}))}getInstanceMapping(){return C(this.http.get(`${this.baseUrl}/instance-mapping`))}getAccount(e){return C(this.http.get(`${this.baseUrl}/${e}`))}getAccountUsage(e){return C(this.http.get(`${this.baseUrl}/${e}/usage`))}getAccountUsageHistory(e){let t=[];e.windowType!=null&&e.windowType!==""&&t.push(`windowType=${encodeURIComponent(e.windowType)}`),e.fromMs!=null&&t.push(`fromMs=${e.fromMs}`),e.toMs!=null&&t.push(`toMs=${e.toMs}`);let n=t.length>0?`?${t.join("&")}`:"";return C(this.http.get(`${this.baseUrl}/${e.accountKey}/usage-history${n}`))}refreshAccountUsage(e){return C(this.http.post(`${this.baseUrl}/${e}/refresh-usage`,{}))}renameAccount(e){let t={};return e.displayName!==void 0&&(t.displayName=e.displayName),e.email!==void 0&&(t.email=e.email),C(this.http.patch(`${this.baseUrl}/${e.accountKey}`,t))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le="cc:account-usage-update",ce="cc:account-list-update",oe=(()=>{class s{account_AS=w(re);socket_CS=w(ne);ngZone=w(R);socketSubscription=null;accounts_$=_([]);accountUsageMap_$=_(new Map);instanceMapping_$=_(null);usageHistoryMap_$=_(new Map);isLoading_$=_(!1);loadError_$=_(null);loadDashboardBootstrap(){return m(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let[e,t]=yield Promise.all([this.account_AS.listAccounts(),this.account_AS.getInstanceMapping()]);this.accounts_$.set(e.items),this.instanceMapping_$.set(t)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}finally{this.isLoading_$.set(!1)}})}loadAccounts(){return m(this,null,function*(){try{let e=yield this.account_AS.listAccounts();this.accounts_$.set(e.items)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadAccountUsage(e){return m(this,null,function*(){try{let t=yield this.account_AS.getAccountUsage(e),n=new Map(this.accountUsageMap_$());n.set(e,t.items),this.accountUsageMap_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadAccountUsageHistory(e){return m(this,null,function*(){try{let t=yield this.account_AS.getAccountUsageHistory(e),n=new Map(this.usageHistoryMap_$());n.set(e.accountKey,t.items),this.usageHistoryMap_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadInstanceMapping(){return m(this,null,function*(){try{let e=yield this.account_AS.getInstanceMapping();this.instanceMapping_$.set(e)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}refreshAccounts(){return m(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let e=yield this.account_AS.refreshLocalAccounts();return yield this.loadAccounts(),e}catch(e){return this.loadError_$.set(this.errorMessageOf(e)),{refreshedKeys:[],scannedPaths:0}}finally{this.isLoading_$.set(!1)}})}refreshAccountUsage(e){return m(this,null,function*(){try{let t=yield this.account_AS.refreshAccountUsage(e);return yield this.loadAccountUsage(e),yield this.loadAccounts(),t}catch(t){return this.loadError_$.set(this.errorMessageOf(t)),{status:"error",windowsUpserted:0,email:null}}})}renameAccount(e){return m(this,null,function*(){try{let t=yield this.account_AS.renameAccount(e),n=this.accounts_$().map(l=>l.accountKey===e.accountKey?t:l);this.accounts_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}startLiveUpdates(){this.socketSubscription==null&&(this.socketSubscription=this.socket_CS.event$.subscribe(e=>{this.ngZone.run(()=>{e.event===le?this.handleAccountUsageUpdate(e.payload):e.event===ce&&this.handleAccountListUpdate(e.payload)})}))}stopLiveUpdates(){this.socketSubscription!=null&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null)}ngOnDestroy(){this.stopLiveUpdates()}handleAccountUsageUpdate(e){let t=e.accountKey,n=e.windowType;if(typeof t!="string"||t===""||typeof n!="string")return;let l={accountKey:t,windowType:n,utilization:typeof e.utilization=="number"?e.utilization:void 0,resetsAtMs:typeof e.resetsAtMs=="number"?e.resetsAtMs:void 0,lastObservedStatus:typeof e.lastObservedStatus=="string"?e.lastObservedStatus:void 0,observedAt:typeof e.observedAt=="string"?e.observedAt:void 0,lastObservedByCcapId:typeof e.lastObservedByCcapId=="string"?e.lastObservedByCcapId:void 0,lastObservedBySessionId:typeof e.lastObservedBySessionId=="string"?e.lastObservedBySessionId:void 0},c=new Map(this.accountUsageMap_$()),M=(c.get(t)??[]).filter(H=>H.windowType!==n);M.push(l),c.set(t,M),this.accountUsageMap_$.set(c)}handleAccountListUpdate(e){this.loadAccounts()}errorMessageOf(e){if(e instanceof Error)return e.message;if(typeof e=="object"&&e!==null){let t=e;if(typeof t.message=="string")return t.message}return String(e)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var T=(()=>{class s{static WINDOW_SEC_BY_TYPE={five_hour:18e3,seven_day:604800,seven_day_opus:604800,seven_day_sonnet:604800};static computePacingFraction(e){let t=s.WINDOW_SEC_BY_TYPE[e.windowType];if(t===void 0||!e.resetsAtMs||e.resetsAtMs<=0)return null;let n=t*1e3,l=e.resetsAtMs-n,g=Math.max(0,e.nowMs-l)/n;return g<0?0:g>1?1:g}static classifyPacing(e){if(e.utilization==null||e.pacingFraction===null)return null;let t=e.tolerance??.1,n=e.utilization-e.pacingFraction;return n>t?"above":n<-t?"below":"on-pace"}static colorClassForPacing(e){return e==="below"?"text-green-400":e==="on-pace"?"text-yellow-300":e==="above"?"text-red-400":"text-neutral-500"}}return s})();var de=(s,u)=>u.accountKey,ue=(s,u)=>u.ccapId,pe=()=>[],me=()=>["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];function _e(s,u){s&1&&(i(0,"div",13),r(1," Loading dashboard\u2026 "),a())}function fe(s,u){s&1&&(i(0,"div",14)(1,"strong"),r(2,"Load error:"),a(),r(3),a()),s&2&&(o(3),d(" ",u," "))}function he(s,u){s&1&&(i(0,"div",19),v(),i(1,"svg",32),y(2,"path",33),a(),S(),i(3,"p",34),r(4,"No CC accounts discovered yet"),a(),i(5,"p",35),r(6," Run "),i(7,"code",36),r(8,"claude /login"),a(),r(9," on this machine, then click "),i(10,"strong",37),r(11,"Refresh accounts"),a(),r(12,". "),a()())}function xe(s,u){if(s&1&&(i(0,"span",62),r(1),a()),s&2){let e=p().$implicit,t=p();$("text-[9px] px-1.5 py-0.5 rounded-full border font-medium shrink-0 "+t.tokenStatusBadgeClassOf(e.tokenStatus)),f("title","Token status: "+e.tokenStatus),o(),d(" ",e.tokenStatus," ")}}function ge(s,u){if(s&1&&(i(0,"span",44),r(1),a()),s&2){let e=p().$implicit;o(),d(" ",e.planTier," ")}}function ye(s,u){if(s&1&&(i(0,"span",46),r(1),a()),s&2){let e=p().$implicit;o(),I(e.email)}}function be(s,u){if(s&1&&y(0,"div"),s&2){p();let e=W(0),t=p(2);$("h-full transition-all "+t.utilizationBarColorClass(e.utilization)),V("width",t.utilizationPercent(e.utilization),"%")}}function ve(s,u){if(s&1&&(N(0),i(1,"div",63)(2,"div",64),r(3),a(),i(4,"div",65)(5,"div",66),x(6,be,1,4,"div",67),a(),i(7,"span",68),r(8),a()(),i(9,"div",69),r(10),a()()),s&2){let e,t=u.$implicit,n=p().$implicit,l=p(),c=j(l.usageItemOfWindow(n.accountKey,t));o(),E("opacity-50",!c),o(),f("title",t),o(),d(" ",l.windowLabelOf(t)," "),o(3),h(c?6:-1),o(2),d(" ",l.formatUtilization((e=c==null?null:c.utilization)!==null&&e!==void 0?e:null)," "),o(),f("title","Resets in "+l.formatResetCountdown(c==null?null:c.resetsAtMs)),o(),d(" ",l.formatResetCountdown(c==null?null:c.resetsAtMs)," ")}}function Ce(s,u){s&1&&(i(0,"div",55),r(1," No data yet \u2014 click "),i(2,"strong",6),r(3,"Pull"),a(),r(4," or run a CC session. "),a())}function Se(s,u){s&1&&(i(0,"span",60),r(1,"loading\u2026"),a())}function we(s,u){s&1&&(i(0,"div",74),r(1," No history events recorded yet. Stream-driven events come from CC sessions when "),i(2,"code",76),r(3,"rate_limit_event"),a(),r(4," fires; pull-driven events come from periodic auto-pull or manual "),i(5,"strong"),r(6,"Pull"),a(),r(7," clicks. "),a())}function Ee(s,u){if(s&1&&(i(0,"tr",80)(1,"td",81),r(2),a(),i(3,"td",82),r(4),a(),i(5,"td",83)(6,"span"),r(7),a()(),i(8,"td",84),r(9),a(),i(10,"td",85),r(11),a(),i(12,"td",86),r(13),a()()),s&2){let e,t,n,l=u.$implicit,c=p(4);o(2),d(" ",c.formatObservedAt(l.observedAt)," "),o(2),d(" ",c.windowLabelOf(l.windowType)," "),o(2),$("text-[10px] px-1.5 py-0.5 rounded-full border "+c.sourceBadgeClassOf(l.source)),o(),d(" ",(e=l.source)!==null&&e!==void 0?e:"\u2014"," "),o(2),d(" ",c.formatUtilization((t=l.utilization)!==null&&t!==void 0?t:null)," "),o(2),d(" ",(n=l.lastObservedStatus)!==null&&n!==void 0?n:"\u2014"," "),o(2),d(" ",c.formatResetCountdown(l.resetsAtMs)," ")}}function $e(s,u){if(s&1&&(i(0,"div",75)(1,"table",77)(2,"thead",71)(3,"tr")(4,"th",78),r(5,"When"),a(),i(6,"th",78),r(7,"Window"),a(),i(8,"th",78),r(9,"Source"),a(),i(10,"th",79),r(11,"Util"),a(),i(12,"th",78),r(13,"Status"),a(),i(14,"th",78),r(15,"Reset in"),a()()(),i(16,"tbody"),k(17,Ee,14,8,"tr",80,P),a()()()),s&2){let e=p(2).$implicit,t=p();o(17),D(t.historyItemsOf(e.accountKey))}}function Me(s,u){if(s&1){let e=F();i(0,"div",61)(1,"div",70)(2,"span",71),r(3," Usage event history "),i(4,"span",72),r(5),a()(),i(6,"button",73),b("click",function(){U(e);let n=p().$implicit,l=p();return A(l.handleRefreshHistory(n.accountKey))}),r(7),a()(),x(8,we,8,0,"div",74)(9,$e,19,0,"div",75),a()}if(s&2){let e=p().$implicit,t=p();o(5),d(" \xB7 ",t.historyItemsOf(e.accountKey).length," event(s) "),o(),f("disabled",t.isHistoryLoading(e.accountKey)),o(),d(" ",t.isHistoryLoading(e.accountKey)?"\u2026":"Refresh history"," "),o(),h(!t.historyItemsOf(e.accountKey).length&&!t.isHistoryLoading(e.accountKey)?8:9)}}function Ue(s,u){if(s&1){let e=F();i(0,"div",38)(1,"div",39)(2,"div"),r(3),a(),i(4,"div",40)(5,"div",41)(6,"span",42),r(7),a(),x(8,xe,2,4,"span",43)(9,ge,2,1,"span",44),a(),i(10,"div",45),x(11,ye,2,1,"span",46),i(12,"button",47),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleEditEmail(n))}),r(13),a()(),i(14,"div",48)(15,"span",49),r(16,"key:"),a(),r(17),a()(),i(18,"button",50),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleRefreshUsage(n.accountKey))}),v(),i(19,"svg",51),y(20,"path",10),a(),S(),i(21,"span"),r(22),a()()(),i(23,"div",52)(24,"div",53),k(25,ve,11,9,"div",54,z),a(),x(27,Ce,5,0,"div",55),a(),i(28,"div",56)(29,"button",57),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleToggleHistory(n.accountKey))}),v(),i(30,"svg",58),y(31,"path",59),a(),r(32),x(33,Se,2,0,"span",60),a(),x(34,Me,10,4,"div",61),a()()}if(s&2){let e=u.$implicit,t=p();E("xl:col-span-2",t.isHistoryOpen(e.accountKey))("xl:col-span-3",!1),o(2),$("shrink-0 w-8 h-8 rounded-md flex items-center justify-center text-sm font-bold "+t.avatarBgClassOf(e.accountKey)),B("aria-label","Avatar for "+t.displayNameOf(e)),o(),d(" ",t.avatarLetterOf(e)," "),o(4),d(" ",t.displayNameOf(e)," "),o(),h(e.tokenStatus?8:-1),o(),h(e.planTier?9:-1),o(2),h(e.email?11:-1),o(),f("title",t.hasEmail(e)?"Edit email":"Set email manually"),o(),d(" ",t.hasEmail(e)?"\u270F\uFE0F Edit":"\u270F\uFE0F Set email"," "),o(),f("title","key: "+e.accountKey+(e.organizationId?" \xB7 org: "+e.organizationId:"")),o(3),d(" ",e.accountKey.slice(0,12)," "),o(),f("disabled",t.isRefreshingUsageOf(e.accountKey)),o(),E("animate-spin",t.isRefreshingUsageOf(e.accountKey)),o(3),I(t.isRefreshingUsageOf(e.accountKey)?"\u2026":"Pull"),o(3),D(K(27,me)),o(2),h(t.usageItemsOf(e.accountKey).length?-1:27),o(2),f("title",t.isHistoryOpen(e.accountKey)?"Hide usage history":"Show usage history"),o(),E("rotate-90",t.isHistoryOpen(e.accountKey)),o(2),d(" ",t.isHistoryOpen(e.accountKey)?"Hide":"Show"," history "),o(),h(t.isHistoryLoading(e.accountKey)?33:-1),o(),h(t.isHistoryOpen(e.accountKey)?34:-1)}}function Ae(s,u){s&1&&(i(0,"div",23),r(1," No instance mappings yet. Mappings appear after the first "),i(2,"code",76),r(3,"rate_limit_event"),a(),r(4," on a session with a bound account, or after a manual "),i(5,"strong",6),r(6,"Pull usage"),a(),r(7,". "),a())}function ke(s,u){if(s&1&&(i(0,"span",37),r(1),a(),i(2,"span",91),r(3),a(),i(4,"span",92),r(5,"\xB7"),a(),i(6,"span"),r(7,"5h: "),i(8,"strong"),r(9),a()(),i(10,"span",92),r(11,"\xB7"),a()),s&2){let e=u,t=p().$implicit,n=p();o(),d(" ",n.displayNameByAccountKey(e)," "),o(2),d("(",e.slice(0,6),"\u2026)"),o(5),$(n.pacingColorClassForFiveHour(t.items)),o(),I(n.formatUtilization(n.latestFiveHourUtilOf(t.items)))}}function De(s,u){if(s&1&&(i(0,"div",24)(1,"div",87),v(),i(2,"svg",9),y(3,"path",88),a()(),S(),i(4,"div",40)(5,"div",89),r(6),a(),i(7,"div",90),x(8,ke,12,5),i(9,"span",49),r(10),a()()()()),s&2){let e,t=u.$implicit,n=p();o(6),d(" ",t.ccapId," "),o(2),h((e=n.latestAccountKeyOf(t.items))?8:-1,e),o(2),d("",n.itemsCountOf(t.items)," record(s)")}}var Xe=(()=>{class s{account_DS=w(oe);isRefreshing_$=_(!1);isRefreshingAllUsage_$=_(!1);refreshingUsageKeys_$=_(new Set);editEmailModalOpen_$=_(!1);editEmailAccountKey_$=_(null);editEmailValue_$=_("");editEmailSaving_$=_(!1);expandedHistoryKeys_$=_(new Set);loadingHistoryKeys_$=_(new Set);instanceCount_$=Y(()=>this.account_DS.instanceMapping_$()?.instances.length??0);ngOnInit(){this.account_DS.loadDashboardBootstrap(),this.account_DS.startLiveUpdates()}handleRefresh(){return m(this,null,function*(){this.isRefreshing_$.set(!0);try{yield this.account_DS.refreshAccounts()}finally{this.isRefreshing_$.set(!1)}})}handleRefreshUsage(e){return m(this,null,function*(){this.refreshingUsageKeys_$.update(t=>{let n=new Set(t);return n.add(e),n});try{yield this.account_DS.refreshAccountUsage(e)}finally{this.refreshingUsageKeys_$.update(t=>{let n=new Set(t);return n.delete(e),n})}})}handleRefreshAllUsage(){return m(this,null,function*(){let e=this.account_DS.accounts_$().map(t=>t.accountKey);if(e.length!==0){this.isRefreshingAllUsage_$.set(!0);try{yield Promise.all(e.map(t=>this.account_DS.refreshAccountUsage(t)))}finally{this.isRefreshingAllUsage_$.set(!1)}}})}usageItemsOf(e){return this.account_DS.accountUsageMap_$().get(e)??[]}usageItemOfWindow(e,t){for(let n of this.usageItemsOf(e))if(n.windowType===t)return n;return null}formatResetCountdown(e){if(e==null||!isFinite(e)||e<=0)return"\u2014";let t=e-Date.now();if(t<=0)return"expired";let n=Math.floor(t/6e4),l=Math.floor(n/(60*24)),c=Math.floor(n%(60*24)/60),g=n%60;return l>0?`${l}d ${c}h`:c>0?`${c}h ${g}m`:`${g}m`}isRefreshingUsageOf(e){return this.refreshingUsageKeys_$().has(e)}handleEditEmail(e){this.editEmailAccountKey_$.set(e.accountKey),this.editEmailValue_$.set(e.email??""),this.editEmailModalOpen_$.set(!0)}handleEditEmailSave(){return m(this,null,function*(){let e=this.editEmailAccountKey_$();if(e===null)return;let t=this.editEmailValue_$().trim();this.editEmailSaving_$.set(!0);try{yield this.account_DS.renameAccount({accountKey:e,email:t===""?null:t}),this.handleEditEmailClose()}finally{this.editEmailSaving_$.set(!1)}})}handleEditEmailClose(){this.editEmailModalOpen_$.set(!1),this.editEmailAccountKey_$.set(null),this.editEmailValue_$.set("")}hasEmail(e){return typeof e.email=="string"&&e.email!==""}handleToggleHistory(e){return m(this,null,function*(){if(this.expandedHistoryKeys_$().has(e)){this.expandedHistoryKeys_$.update(l=>{let c=new Set(l);return c.delete(e),c});return}this.expandedHistoryKeys_$.update(l=>{let c=new Set(l);return c.add(e),c}),this.account_DS.usageHistoryMap_$().get(e)===void 0&&(yield this.loadHistoryFor(e))})}handleRefreshHistory(e){return m(this,null,function*(){yield this.loadHistoryFor(e)})}loadHistoryFor(e){return m(this,null,function*(){this.loadingHistoryKeys_$.update(t=>{let n=new Set(t);return n.add(e),n});try{yield this.account_DS.loadAccountUsageHistory({accountKey:e})}finally{this.loadingHistoryKeys_$.update(t=>{let n=new Set(t);return n.delete(e),n})}})}isHistoryOpen(e){return this.expandedHistoryKeys_$().has(e)}isHistoryLoading(e){return this.loadingHistoryKeys_$().has(e)}historyItemsOf(e){let n=(this.account_DS.usageHistoryMap_$().get(e)??[]).slice();return n.sort((l,c)=>{let g=l.observedAt?Date.parse(l.observedAt):0;return(c.observedAt?Date.parse(c.observedAt):0)-g}),n}sourceBadgeClassOf(e){return e==="stream"?"bg-cyan-900/40 border-cyan-700 text-cyan-300":e==="pull"?"bg-emerald-900/40 border-emerald-700 text-emerald-300":"bg-neutral-800 border-neutral-700 text-neutral-400"}formatObservedAt(e){if(e==null||e==="")return"\u2014";let t=Date.parse(e);if(!isFinite(t)||t<=0)return e;let n=new Date(t),l=String(n.getFullYear()),c=String(n.getMonth()+1).padStart(2,"0"),g=String(n.getDate()).padStart(2,"0"),M=String(n.getHours()).padStart(2,"0"),H=String(n.getMinutes()).padStart(2,"0"),se=String(n.getSeconds()).padStart(2,"0");return`${l}-${c}-${g} ${M}:${H}:${se}`}windowLabelOf(e){switch(e){case"five_hour":return"5-hour session";case"seven_day":return"Weekly";case"seven_day_opus":return"Weekly \xB7 Opus";case"seven_day_sonnet":return"Weekly \xB7 Sonnet";case"extra_usage":return"Extra (pay-as-you-go)";default:return e}}tokenStatusBadgeClassOf(e){return e==="valid"?"bg-green-900/40 border-green-700 text-green-300":e==="scope-incomplete"?"bg-amber-900/40 border-amber-700 text-amber-300":e==="expired"||e==="revoked"?"bg-red-900/40 border-red-700 text-red-300":"bg-neutral-800 border-neutral-700 text-neutral-400"}avatarLetterOf(e){let t=this.displayNameOf(e).trim();return t.length>0?t.charAt(0).toUpperCase():"A"}avatarBgClassOf(e){let t=["bg-emerald-700/60 text-emerald-200","bg-cyan-700/60 text-cyan-200","bg-indigo-700/60 text-indigo-200","bg-fuchsia-700/60 text-fuchsia-200","bg-amber-700/60 text-amber-200","bg-rose-700/60 text-rose-200","bg-teal-700/60 text-teal-200","bg-violet-700/60 text-violet-200"],n=0;for(let l=0;l<e.length;l++)n=n*31+e.charCodeAt(l)&2147483647;return t[n%t.length]}utilizationPercent(e){return e==null||!isFinite(e)?0:Math.max(0,Math.min(100,Math.round(e*100)))}utilizationBarColorClass(e){return e==null||!isFinite(e)?"bg-neutral-600":e>=.85?"bg-red-500":e>=.5?"bg-amber-500":"bg-emerald-500"}displayNameOf(e){return e.displayName!==""?e.displayName:`account-${e.accountKey.slice(0,6)}`}itemsCountOf(e){return e.length}latestFiveHourUtilOf(e){for(let t of e)if(t.windowType==="five_hour"&&typeof t.utilization=="number")return t.utilization;return null}latestAccountKeyOf(e){if(e.length===0)return null;let t=e[0];for(let n of e){let l=n.observedAt?Date.parse(n.observedAt):0,c=t.observedAt?Date.parse(t.observedAt):0;l>c&&(t=n)}return t.accountKey}displayNameByAccountKey(e){let t=this.account_DS.accounts_$().find(n=>n.accountKey===e);return t?this.displayNameOf(t):`account-${e.slice(0,6)}`}formatUtilization(e){return e===null?"\u2014":`${Math.round(e*100)}%`}utilizationColorClass(e){return e===null||e<.5?"text-green-400":e<.85?"text-yellow-300":"text-red-400"}pacingColorClassForFiveHour(e){let t;for(let c of e)if(c.windowType==="five_hour"){t=c;break}if(!t)return"text-neutral-500";let n=T.computePacingFraction({windowType:"five_hour",resetsAtMs:t.resetsAtMs,nowMs:Date.now()});if(n===null){let c=t.utilization??null;return this.utilizationColorClass(c)}let l=T.classifyPacing({utilization:t.utilization,pacingFraction:n});return T.colorClassForPacing(l)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=L({type:s,selectors:[["app-cc-usage-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-auto","p-4"],standalone:!0,features:[G],decls:55,vars:21,consts:[[1,"flex","items-start","justify-between","mb-6","pb-3","border-b","border-neutral-700","gap-3"],[1,"min-w-0","flex-1"],[1,"text-xl","font-bold","text-neutral-100","flex","items-center","gap-2"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-5","h-5","text-neonCyan"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 19V6l3-3 3 3v13M5 21h14a2 2 0 002-2v-7l-7-7-7 7v7a2 2 0 002 2z"],[1,"text-xs","text-neutral-500","mt-1"],[1,"text-neutral-400"],[1,"flex","items-center","gap-2","shrink-0"],["type","button","title","Re-scan local credential files (~/.claude/.credentials.json) and register newly discovered accounts.",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonDefault","bg-neonDefault/15","text-neutral-100","hover:bg-neonDefault/30","hover:border-neonDefault","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed","font-medium","flex","items-center","gap-1.5",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3.5","h-3.5"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"],["type","button","title","Pull live usage data from Anthropic for every known account.",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","hover:border-neonCyan","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed","font-medium","flex","items-center","gap-1.5",3,"click","disabled"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M13 10V3L4 14h7v7l9-11h-7z"],[1,"text-sm","text-neutral-400","italic","py-4"],[1,"text-sm","text-red-400","bg-red-950/30","border","border-red-700","rounded","p-3","mb-4"],[1,"mb-6"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider","mb-3","flex","items-center","gap-2"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"],[1,"text-neutral-600","font-normal","normal-case","tracking-normal"],[1,"rounded-lg","border","border-dashed","border-neutral-700","bg-neutral-900/30","px-6","py-10","text-center"],[1,"grid","grid-cols-1","md:grid-cols-2","xl:grid-cols-3","gap-3"],[1,"rounded-lg","border","border-neutral-800","hover:border-neutral-700","hover:shadow-md","hover:shadow-black/30","bg-gradient-to-br","from-neutral-900/60","to-neutral-950/30","transition-all","overflow-hidden","flex","flex-col",3,"xl:col-span-2","xl:col-span-3"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"],[1,"rounded-lg","border","border-dashed","border-neutral-700","bg-neutral-900/30","px-4","py-6","text-center","text-[11px]","text-neutral-500"],[1,"flex","items-center","gap-3","py-2.5","px-3","rounded-lg","border","border-neutral-800","mb-2","hover:border-neutral-700","hover:bg-neutral-900/40","transition-all"],["title","Set CC account email","maxWidth","sm",3,"closed","isOpen"],[1,"flex","flex-col","gap-3"],[1,"text-xs","text-neutral-400"],["type","email","placeholder","user@example.com","autofocus","",1,"w-full","px-3","py-2","rounded-md","bg-neutral-900","border","border-neutral-700","text-sm","text-neutral-100","placeholder-neutral-500","focus:outline-none","focus:border-neonCyan",3,"ngModelChange","ngModel"],[1,"flex","items-center","justify-end","gap-2","pt-2"],["type","button",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neutral-700","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click"],["type","button",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-12","h-12","mx-auto","text-neutral-600","mb-3"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","1.5","d","M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"],[1,"text-sm","text-neutral-300","font-medium","mb-1"],[1,"text-xs","text-neutral-500"],[1,"px-1.5","py-0.5","rounded","bg-neutral-800","text-neonCyan","font-mono"],[1,"text-neutral-300"],[1,"rounded-lg","border","border-neutral-800","hover:border-neutral-700","hover:shadow-md","hover:shadow-black/30","bg-gradient-to-br","from-neutral-900/60","to-neutral-950/30","transition-all","overflow-hidden","flex","flex-col"],[1,"flex","items-start","gap-2","py-2.5","px-3","border-b","border-neutral-800/70"],[1,"flex-1","min-w-0"],[1,"flex","items-center","gap-1.5","min-w-0"],[1,"text-sm","text-neutral-100","font-semibold","truncate"],[3,"class","title"],[1,"text-[9px]","text-neutral-200","px-1.5","py-0.5","rounded-full","border","border-indigo-700","bg-indigo-900/30","font-medium","shrink-0"],[1,"flex","items-center","gap-1.5","mt-0.5","min-w-0"],[1,"text-[11px]","text-neonCyan/90","truncate"],["type","button",1,"text-[9px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1","py-0.5","transition-colors","shrink-0",3,"click","title"],[1,"text-[10px]","text-neutral-500","font-mono","truncate","mt-0.5",3,"title"],[1,"text-neutral-600"],["type","button","title","Pull live usage data from Anthropic for this account.",1,"shrink-0","px-2","py-1","text-[11px]","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","transition-colors","flex","items-center","gap-1","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3"],[1,"px-3","py-2.5","border-b","border-neutral-800/40","flex-1"],[1,"space-y-2"],[1,"grid","grid-cols-[110px_1fr_64px]","items-center","gap-2","text-[11px]",3,"opacity-50"],[1,"text-[10px]","text-neutral-500","italic","mt-2","pt-2","border-t","border-neutral-800/40"],[1,"px-3","py-2"],["type","button",1,"text-[11px]","text-neutral-400","hover:text-neonCyan","flex","items-center","gap-1","transition-colors",3,"click","title"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3","transition-transform"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 5l7 7-7 7"],[1,"text-neutral-500","italic","ml-1"],[1,"mt-2","rounded-md","border","border-neutral-800","bg-neutral-950/40","p-2"],[3,"title"],[1,"grid","grid-cols-[110px_1fr_64px]","items-center","gap-2","text-[11px]"],[1,"text-neutral-300","font-medium","truncate",3,"title"],[1,"flex","items-center","gap-2","min-w-0"],[1,"flex-1","h-2","bg-neutral-800","rounded-full","overflow-hidden","relative"],[3,"class","width"],[1,"font-mono","text-neutral-200","text-right","w-9","shrink-0"],[1,"font-mono","text-neutral-500","text-right","text-[10px]","truncate",3,"title"],[1,"flex","items-center","justify-between","mb-2"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-neutral-600","normal-case","tracking-normal","ml-1"],["type","button","title","Re-fetch usage event history from server.",1,"text-[10px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1.5","py-0.5","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],[1,"text-[11px]","text-neutral-500","italic","px-2","py-3"],[1,"overflow-x-auto"],[1,"px-1","py-0.5","rounded","bg-neutral-800","text-neutral-400","font-mono","text-[10px]"],[1,"w-full","text-[11px]","text-left"],[1,"py-1","px-2","font-medium"],[1,"py-1","px-2","font-medium","text-right"],[1,"border-t","border-neutral-800/60","hover:bg-neutral-900/40"],[1,"py-1","px-2","font-mono","text-neutral-300"],[1,"py-1","px-2","text-neutral-300"],[1,"py-1","px-2"],[1,"py-1","px-2","font-mono","text-neutral-200","text-right"],[1,"py-1","px-2","text-neutral-400"],[1,"py-1","px-2","font-mono","text-neutral-500"],[1,"shrink-0","w-7","h-7","rounded-md","bg-neutral-800","border","border-neutral-700","flex","items-center","justify-center","text-neutral-400"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M5 12H3l9-9 9 9h-2M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"],[1,"text-sm","text-neutral-200","font-medium","truncate","font-mono"],[1,"text-[11px]","text-neutral-500","mt-0.5","flex","items-center","gap-1.5","flex-wrap"],[1,"font-mono","text-neutral-600","text-[10px]"],[1,"text-neutral-700"]],template:function(t,n){if(t&1&&(i(0,"header",0)(1,"div",1)(2,"h1",2),v(),i(3,"svg",3),y(4,"path",4),a(),r(5," CC Usage & Accounts "),a(),S(),i(6,"p",5),r(7," Anthropic OAuth credentials \xB7 per-account 5-hour / weekly / opus / sonnet / extra usage windows \xB7 "),i(8,"span",6),r(9),a(),r(10," \xB7 "),i(11,"span",6),r(12),a()()(),i(13,"div",7)(14,"button",8),b("click",function(){return n.handleRefresh()}),v(),i(15,"svg",9),y(16,"path",10),a(),r(17),a(),S(),i(18,"button",11),b("click",function(){return n.handleRefreshAllUsage()}),v(),i(19,"svg",9),y(20,"path",12),a(),r(21),a()()(),x(22,_e,2,0,"div",13)(23,fe,4,1,"div",14),S(),i(24,"section",15)(25,"h2",16),v(),i(26,"svg",9),y(27,"path",17),a(),r(28," Known CC Accounts "),S(),i(29,"span",18),r(30),a()(),x(31,he,13,0,"div",19),i(32,"div",20),k(33,Ue,35,28,"div",21,de),a()(),i(35,"section")(36,"h2",16),v(),i(37,"svg",9),y(38,"path",22),a(),r(39," Instance \u2194 Account Mapping "),S(),i(40,"span",18),r(41),a()(),x(42,Ae,8,0,"div",23),k(43,De,11,3,"div",24,ue),a(),i(45,"app-s-modal",25),b("closed",function(){return n.handleEditEmailClose()}),i(46,"div",26)(47,"p",27),r(48," Enter the email address linked to this Claude account. Leave empty to clear. "),a(),i(49,"input",28),b("ngModelChange",function(c){return n.editEmailValue_$.set(c)}),a(),i(50,"div",29)(51,"button",30),b("click",function(){return n.handleEditEmailClose()}),r(52," Cancel "),a(),i(53,"button",31),b("click",function(){return n.handleEditEmailSave()}),r(54),a()()()()),t&2){let l,c;o(9),d("",n.account_DS.accounts_$().length," account(s)"),o(3),d("",n.instanceCount_$()," instance mapping(s)"),o(2),f("disabled",n.isRefreshing_$()||n.account_DS.isLoading_$()),o(),E("animate-spin",n.isRefreshing_$()),o(2),d(" ",n.isRefreshing_$()?"Discovering\u2026":"Refresh accounts"," "),o(),f("disabled",n.isRefreshingAllUsage_$()||!n.account_DS.accounts_$().length),o(),E("animate-spin",n.isRefreshingAllUsage_$()),o(2),d(" ",n.isRefreshingAllUsage_$()?"Pulling all\u2026":"Pull all usage"," "),o(),h(n.account_DS.isLoading_$()?22:-1),o(),h((l=n.account_DS.loadError_$())?23:-1,l),o(7),d(" \xB7 ",n.account_DS.accounts_$().length," "),o(),h(!n.account_DS.accounts_$().length&&!n.account_DS.isLoading_$()?31:-1),o(2),D(n.account_DS.accounts_$()),o(8),d(" \xB7 ",n.instanceCount_$()," "),o(),h(!n.instanceCount_$()&&!n.account_DS.isLoading_$()?42:-1),o(),D((c=(c=n.account_DS.instanceMapping_$())==null?null:c.instances)!==null&&c!==void 0?c:K(20,pe)),o(2),f("isOpen",n.editEmailModalOpen_$()),o(4),f("ngModel",n.editEmailValue_$()),o(4),f("disabled",n.editEmailSaving_$()),o(),d(" ",n.editEmailSaving_$()?"Saving\u2026":"Save"," ")}},dependencies:[Z,ee,J,Q,X,ie],encapsulation:2})}return s})();export{Xe as CC_UsageDashboard_Component};
2
- //# sourceMappingURL=cc-usage-dashboard.component-PEZVSG7M.js.map
1
+ import{e as ne}from"./chunk-M4CGCNOB.js";import{a as ie}from"./chunk-FLAJXIYW.js";import{c as J,f as Q,i as X,v as ee}from"./chunk-EO4DNTT4.js";import"./chunk-TKAV5X35.js";import{I as te}from"./chunk-VRI47IVY.js";import{C as w,D as L,Fa as r,Ga as I,Ha as d,J as U,K as A,L as v,M as S,Pa as N,Qa as j,R,Ra as W,Ta as G,Ua as K,Z as o,aa as _,da as x,fa as B,ga as f,ha as V,hb as Y,ia as E,ja as $,k as m,la as h,ma as P,na as z,oa as k,p as C,pa as D,qa as i,ra as a,sa as y,ua as F,ub as Z,va as b,wa as p,xb as q,y as O}from"./chunk-TBMJSIBB.js";var re=(()=>{class s{baseUrl=`${te.api.baseUrl}/cc-account`;http=w(q);listAccounts(){return C(this.http.get(`${this.baseUrl}/list`))}refreshLocalAccounts(){return C(this.http.post(`${this.baseUrl}/refresh`,{}))}getInstanceMapping(){return C(this.http.get(`${this.baseUrl}/instance-mapping`))}getAccount(e){return C(this.http.get(`${this.baseUrl}/${e}`))}getAccountUsage(e){return C(this.http.get(`${this.baseUrl}/${e}/usage`))}getAccountUsageHistory(e){let t=[];e.windowType!=null&&e.windowType!==""&&t.push(`windowType=${encodeURIComponent(e.windowType)}`),e.fromMs!=null&&t.push(`fromMs=${e.fromMs}`),e.toMs!=null&&t.push(`toMs=${e.toMs}`);let n=t.length>0?`?${t.join("&")}`:"";return C(this.http.get(`${this.baseUrl}/${e.accountKey}/usage-history${n}`))}refreshAccountUsage(e){return C(this.http.post(`${this.baseUrl}/${e}/refresh-usage`,{}))}renameAccount(e){let t={};return e.displayName!==void 0&&(t.displayName=e.displayName),e.email!==void 0&&(t.email=e.email),C(this.http.patch(`${this.baseUrl}/${e.accountKey}`,t))}static \u0275fac=function(t){return new(t||s)};static \u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var le="cc:account-usage-update",ce="cc:account-list-update",oe=(()=>{class s{account_AS=w(re);socket_CS=w(ne);ngZone=w(R);socketSubscription=null;accounts_$=_([]);accountUsageMap_$=_(new Map);instanceMapping_$=_(null);usageHistoryMap_$=_(new Map);isLoading_$=_(!1);loadError_$=_(null);loadDashboardBootstrap(){return m(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let[e,t]=yield Promise.all([this.account_AS.listAccounts(),this.account_AS.getInstanceMapping()]);this.accounts_$.set(e.items),this.instanceMapping_$.set(t)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}finally{this.isLoading_$.set(!1)}})}loadAccounts(){return m(this,null,function*(){try{let e=yield this.account_AS.listAccounts();this.accounts_$.set(e.items)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}loadAccountUsage(e){return m(this,null,function*(){try{let t=yield this.account_AS.getAccountUsage(e),n=new Map(this.accountUsageMap_$());n.set(e,t.items),this.accountUsageMap_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadAccountUsageHistory(e){return m(this,null,function*(){try{let t=yield this.account_AS.getAccountUsageHistory(e),n=new Map(this.usageHistoryMap_$());n.set(e.accountKey,t.items),this.usageHistoryMap_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}loadInstanceMapping(){return m(this,null,function*(){try{let e=yield this.account_AS.getInstanceMapping();this.instanceMapping_$.set(e)}catch(e){this.loadError_$.set(this.errorMessageOf(e))}})}refreshAccounts(){return m(this,null,function*(){this.isLoading_$.set(!0),this.loadError_$.set(null);try{let e=yield this.account_AS.refreshLocalAccounts();return yield this.loadAccounts(),e}catch(e){return this.loadError_$.set(this.errorMessageOf(e)),{refreshedKeys:[],scannedPaths:0}}finally{this.isLoading_$.set(!1)}})}refreshAccountUsage(e){return m(this,null,function*(){try{let t=yield this.account_AS.refreshAccountUsage(e);return yield this.loadAccountUsage(e),yield this.loadAccounts(),t}catch(t){return this.loadError_$.set(this.errorMessageOf(t)),{status:"error",windowsUpserted:0,email:null}}})}renameAccount(e){return m(this,null,function*(){try{let t=yield this.account_AS.renameAccount(e),n=this.accounts_$().map(l=>l.accountKey===e.accountKey?t:l);this.accounts_$.set(n)}catch(t){this.loadError_$.set(this.errorMessageOf(t))}})}startLiveUpdates(){this.socketSubscription==null&&(this.socketSubscription=this.socket_CS.event$.subscribe(e=>{this.ngZone.run(()=>{e.event===le?this.handleAccountUsageUpdate(e.payload):e.event===ce&&this.handleAccountListUpdate(e.payload)})}))}stopLiveUpdates(){this.socketSubscription!=null&&(this.socketSubscription.unsubscribe(),this.socketSubscription=null)}ngOnDestroy(){this.stopLiveUpdates()}handleAccountUsageUpdate(e){let t=e.accountKey,n=e.windowType;if(typeof t!="string"||t===""||typeof n!="string")return;let l={accountKey:t,windowType:n,utilization:typeof e.utilization=="number"?e.utilization:void 0,resetsAtMs:typeof e.resetsAtMs=="number"?e.resetsAtMs:void 0,lastObservedStatus:typeof e.lastObservedStatus=="string"?e.lastObservedStatus:void 0,observedAt:typeof e.observedAt=="string"?e.observedAt:void 0,lastObservedByCcapId:typeof e.lastObservedByCcapId=="string"?e.lastObservedByCcapId:void 0,lastObservedBySessionId:typeof e.lastObservedBySessionId=="string"?e.lastObservedBySessionId:void 0},c=new Map(this.accountUsageMap_$()),M=(c.get(t)??[]).filter(H=>H.windowType!==n);M.push(l),c.set(t,M),this.accountUsageMap_$.set(c)}handleAccountListUpdate(e){this.loadAccounts()}errorMessageOf(e){if(e instanceof Error)return e.message;if(typeof e=="object"&&e!==null){let t=e;if(typeof t.message=="string")return t.message}return String(e)}static \u0275fac=function(t){return new(t||s)};static \u0275prov=O({token:s,factory:s.\u0275fac,providedIn:"root"})}return s})();var T=(()=>{class s{static WINDOW_SEC_BY_TYPE={five_hour:18e3,seven_day:604800,seven_day_opus:604800,seven_day_sonnet:604800};static computePacingFraction(e){let t=s.WINDOW_SEC_BY_TYPE[e.windowType];if(t===void 0||!e.resetsAtMs||e.resetsAtMs<=0)return null;let n=t*1e3,l=e.resetsAtMs-n,g=Math.max(0,e.nowMs-l)/n;return g<0?0:g>1?1:g}static classifyPacing(e){if(e.utilization==null||e.pacingFraction===null)return null;let t=e.tolerance??.1,n=e.utilization-e.pacingFraction;return n>t?"above":n<-t?"below":"on-pace"}static colorClassForPacing(e){return e==="below"?"text-green-400":e==="on-pace"?"text-yellow-300":e==="above"?"text-red-400":"text-neutral-500"}}return s})();var de=(s,u)=>u.accountKey,ue=(s,u)=>u.ccapId,pe=()=>[],me=()=>["five_hour","seven_day","seven_day_opus","seven_day_sonnet","extra_usage"];function _e(s,u){s&1&&(i(0,"div",13),r(1," Loading dashboard\u2026 "),a())}function fe(s,u){s&1&&(i(0,"div",14)(1,"strong"),r(2,"Load error:"),a(),r(3),a()),s&2&&(o(3),d(" ",u," "))}function he(s,u){s&1&&(i(0,"div",19),v(),i(1,"svg",32),y(2,"path",33),a(),S(),i(3,"p",34),r(4,"No CC accounts discovered yet"),a(),i(5,"p",35),r(6," Run "),i(7,"code",36),r(8,"claude /login"),a(),r(9," on this machine, then click "),i(10,"strong",37),r(11,"Refresh accounts"),a(),r(12,". "),a()())}function xe(s,u){if(s&1&&(i(0,"span",62),r(1),a()),s&2){let e=p().$implicit,t=p();$("text-[9px] px-1.5 py-0.5 rounded-full border font-medium shrink-0 "+t.tokenStatusBadgeClassOf(e.tokenStatus)),f("title","Token status: "+e.tokenStatus),o(),d(" ",e.tokenStatus," ")}}function ge(s,u){if(s&1&&(i(0,"span",44),r(1),a()),s&2){let e=p().$implicit;o(),d(" ",e.planTier," ")}}function ye(s,u){if(s&1&&(i(0,"span",46),r(1),a()),s&2){let e=p().$implicit;o(),I(e.email)}}function be(s,u){if(s&1&&y(0,"div"),s&2){p();let e=W(0),t=p(2);$("h-full transition-all "+t.utilizationBarColorClass(e.utilization)),V("width",t.utilizationPercent(e.utilization),"%")}}function ve(s,u){if(s&1&&(N(0),i(1,"div",63)(2,"div",64),r(3),a(),i(4,"div",65)(5,"div",66),x(6,be,1,4,"div",67),a(),i(7,"span",68),r(8),a()(),i(9,"div",69),r(10),a()()),s&2){let e,t=u.$implicit,n=p().$implicit,l=p(),c=j(l.usageItemOfWindow(n.accountKey,t));o(),E("opacity-50",!c),o(),f("title",t),o(),d(" ",l.windowLabelOf(t)," "),o(3),h(c?6:-1),o(2),d(" ",l.formatUtilization((e=c==null?null:c.utilization)!==null&&e!==void 0?e:null)," "),o(),f("title","Resets in "+l.formatResetCountdown(c==null?null:c.resetsAtMs)),o(),d(" ",l.formatResetCountdown(c==null?null:c.resetsAtMs)," ")}}function Ce(s,u){s&1&&(i(0,"div",55),r(1," No data yet \u2014 click "),i(2,"strong",6),r(3,"Pull"),a(),r(4," or run a CC session. "),a())}function Se(s,u){s&1&&(i(0,"span",60),r(1,"loading\u2026"),a())}function we(s,u){s&1&&(i(0,"div",74),r(1," No history events recorded yet. Stream-driven events come from CC sessions when "),i(2,"code",76),r(3,"rate_limit_event"),a(),r(4," fires; pull-driven events come from periodic auto-pull or manual "),i(5,"strong"),r(6,"Pull"),a(),r(7," clicks. "),a())}function Ee(s,u){if(s&1&&(i(0,"tr",80)(1,"td",81),r(2),a(),i(3,"td",82),r(4),a(),i(5,"td",83)(6,"span"),r(7),a()(),i(8,"td",84),r(9),a(),i(10,"td",85),r(11),a(),i(12,"td",86),r(13),a()()),s&2){let e,t,n,l=u.$implicit,c=p(4);o(2),d(" ",c.formatObservedAt(l.observedAt)," "),o(2),d(" ",c.windowLabelOf(l.windowType)," "),o(2),$("text-[10px] px-1.5 py-0.5 rounded-full border "+c.sourceBadgeClassOf(l.source)),o(),d(" ",(e=l.source)!==null&&e!==void 0?e:"\u2014"," "),o(2),d(" ",c.formatUtilization((t=l.utilization)!==null&&t!==void 0?t:null)," "),o(2),d(" ",(n=l.lastObservedStatus)!==null&&n!==void 0?n:"\u2014"," "),o(2),d(" ",c.formatResetCountdown(l.resetsAtMs)," ")}}function $e(s,u){if(s&1&&(i(0,"div",75)(1,"table",77)(2,"thead",71)(3,"tr")(4,"th",78),r(5,"When"),a(),i(6,"th",78),r(7,"Window"),a(),i(8,"th",78),r(9,"Source"),a(),i(10,"th",79),r(11,"Util"),a(),i(12,"th",78),r(13,"Status"),a(),i(14,"th",78),r(15,"Reset in"),a()()(),i(16,"tbody"),k(17,Ee,14,8,"tr",80,P),a()()()),s&2){let e=p(2).$implicit,t=p();o(17),D(t.historyItemsOf(e.accountKey))}}function Me(s,u){if(s&1){let e=F();i(0,"div",61)(1,"div",70)(2,"span",71),r(3," Usage event history "),i(4,"span",72),r(5),a()(),i(6,"button",73),b("click",function(){U(e);let n=p().$implicit,l=p();return A(l.handleRefreshHistory(n.accountKey))}),r(7),a()(),x(8,we,8,0,"div",74)(9,$e,19,0,"div",75),a()}if(s&2){let e=p().$implicit,t=p();o(5),d(" \xB7 ",t.historyItemsOf(e.accountKey).length," event(s) "),o(),f("disabled",t.isHistoryLoading(e.accountKey)),o(),d(" ",t.isHistoryLoading(e.accountKey)?"\u2026":"Refresh history"," "),o(),h(!t.historyItemsOf(e.accountKey).length&&!t.isHistoryLoading(e.accountKey)?8:9)}}function Ue(s,u){if(s&1){let e=F();i(0,"div",38)(1,"div",39)(2,"div"),r(3),a(),i(4,"div",40)(5,"div",41)(6,"span",42),r(7),a(),x(8,xe,2,4,"span",43)(9,ge,2,1,"span",44),a(),i(10,"div",45),x(11,ye,2,1,"span",46),i(12,"button",47),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleEditEmail(n))}),r(13),a()(),i(14,"div",48)(15,"span",49),r(16,"key:"),a(),r(17),a()(),i(18,"button",50),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleRefreshUsage(n.accountKey))}),v(),i(19,"svg",51),y(20,"path",10),a(),S(),i(21,"span"),r(22),a()()(),i(23,"div",52)(24,"div",53),k(25,ve,11,9,"div",54,z),a(),x(27,Ce,5,0,"div",55),a(),i(28,"div",56)(29,"button",57),b("click",function(){let n=U(e).$implicit,l=p();return A(l.handleToggleHistory(n.accountKey))}),v(),i(30,"svg",58),y(31,"path",59),a(),r(32),x(33,Se,2,0,"span",60),a(),x(34,Me,10,4,"div",61),a()()}if(s&2){let e=u.$implicit,t=p();E("xl:col-span-2",t.isHistoryOpen(e.accountKey))("xl:col-span-3",!1),o(2),$("shrink-0 w-8 h-8 rounded-md flex items-center justify-center text-sm font-bold "+t.avatarBgClassOf(e.accountKey)),B("aria-label","Avatar for "+t.displayNameOf(e)),o(),d(" ",t.avatarLetterOf(e)," "),o(4),d(" ",t.displayNameOf(e)," "),o(),h(e.tokenStatus?8:-1),o(),h(e.planTier?9:-1),o(2),h(e.email?11:-1),o(),f("title",t.hasEmail(e)?"Edit email":"Set email manually"),o(),d(" ",t.hasEmail(e)?"\u270F\uFE0F Edit":"\u270F\uFE0F Set email"," "),o(),f("title","key: "+e.accountKey+(e.organizationId?" \xB7 org: "+e.organizationId:"")),o(3),d(" ",e.accountKey.slice(0,12)," "),o(),f("disabled",t.isRefreshingUsageOf(e.accountKey)),o(),E("animate-spin",t.isRefreshingUsageOf(e.accountKey)),o(3),I(t.isRefreshingUsageOf(e.accountKey)?"\u2026":"Pull"),o(3),D(K(27,me)),o(2),h(t.usageItemsOf(e.accountKey).length?-1:27),o(2),f("title",t.isHistoryOpen(e.accountKey)?"Hide usage history":"Show usage history"),o(),E("rotate-90",t.isHistoryOpen(e.accountKey)),o(2),d(" ",t.isHistoryOpen(e.accountKey)?"Hide":"Show"," history "),o(),h(t.isHistoryLoading(e.accountKey)?33:-1),o(),h(t.isHistoryOpen(e.accountKey)?34:-1)}}function Ae(s,u){s&1&&(i(0,"div",23),r(1," No instance mappings yet. Mappings appear after the first "),i(2,"code",76),r(3,"rate_limit_event"),a(),r(4," on a session with a bound account, or after a manual "),i(5,"strong",6),r(6,"Pull usage"),a(),r(7,". "),a())}function ke(s,u){if(s&1&&(i(0,"span",37),r(1),a(),i(2,"span",91),r(3),a(),i(4,"span",92),r(5,"\xB7"),a(),i(6,"span"),r(7,"5h: "),i(8,"strong"),r(9),a()(),i(10,"span",92),r(11,"\xB7"),a()),s&2){let e=u,t=p().$implicit,n=p();o(),d(" ",n.displayNameByAccountKey(e)," "),o(2),d("(",e.slice(0,6),"\u2026)"),o(5),$(n.pacingColorClassForFiveHour(t.items)),o(),I(n.formatUtilization(n.latestFiveHourUtilOf(t.items)))}}function De(s,u){if(s&1&&(i(0,"div",24)(1,"div",87),v(),i(2,"svg",9),y(3,"path",88),a()(),S(),i(4,"div",40)(5,"div",89),r(6),a(),i(7,"div",90),x(8,ke,12,5),i(9,"span",49),r(10),a()()()()),s&2){let e,t=u.$implicit,n=p();o(6),d(" ",t.ccapId," "),o(2),h((e=n.latestAccountKeyOf(t.items))?8:-1,e),o(2),d("",n.itemsCountOf(t.items)," record(s)")}}var Xe=(()=>{class s{account_DS=w(oe);isRefreshing_$=_(!1);isRefreshingAllUsage_$=_(!1);refreshingUsageKeys_$=_(new Set);editEmailModalOpen_$=_(!1);editEmailAccountKey_$=_(null);editEmailValue_$=_("");editEmailSaving_$=_(!1);expandedHistoryKeys_$=_(new Set);loadingHistoryKeys_$=_(new Set);instanceCount_$=Y(()=>this.account_DS.instanceMapping_$()?.instances.length??0);ngOnInit(){this.account_DS.loadDashboardBootstrap(),this.account_DS.startLiveUpdates()}handleRefresh(){return m(this,null,function*(){this.isRefreshing_$.set(!0);try{yield this.account_DS.refreshAccounts()}finally{this.isRefreshing_$.set(!1)}})}handleRefreshUsage(e){return m(this,null,function*(){this.refreshingUsageKeys_$.update(t=>{let n=new Set(t);return n.add(e),n});try{yield this.account_DS.refreshAccountUsage(e)}finally{this.refreshingUsageKeys_$.update(t=>{let n=new Set(t);return n.delete(e),n})}})}handleRefreshAllUsage(){return m(this,null,function*(){let e=this.account_DS.accounts_$().map(t=>t.accountKey);if(e.length!==0){this.isRefreshingAllUsage_$.set(!0);try{yield Promise.all(e.map(t=>this.account_DS.refreshAccountUsage(t)))}finally{this.isRefreshingAllUsage_$.set(!1)}}})}usageItemsOf(e){return this.account_DS.accountUsageMap_$().get(e)??[]}usageItemOfWindow(e,t){for(let n of this.usageItemsOf(e))if(n.windowType===t)return n;return null}formatResetCountdown(e){if(e==null||!isFinite(e)||e<=0)return"\u2014";let t=e-Date.now();if(t<=0)return"expired";let n=Math.floor(t/6e4),l=Math.floor(n/(60*24)),c=Math.floor(n%(60*24)/60),g=n%60;return l>0?`${l}d ${c}h`:c>0?`${c}h ${g}m`:`${g}m`}isRefreshingUsageOf(e){return this.refreshingUsageKeys_$().has(e)}handleEditEmail(e){this.editEmailAccountKey_$.set(e.accountKey),this.editEmailValue_$.set(e.email??""),this.editEmailModalOpen_$.set(!0)}handleEditEmailSave(){return m(this,null,function*(){let e=this.editEmailAccountKey_$();if(e===null)return;let t=this.editEmailValue_$().trim();this.editEmailSaving_$.set(!0);try{yield this.account_DS.renameAccount({accountKey:e,email:t===""?null:t}),this.handleEditEmailClose()}finally{this.editEmailSaving_$.set(!1)}})}handleEditEmailClose(){this.editEmailModalOpen_$.set(!1),this.editEmailAccountKey_$.set(null),this.editEmailValue_$.set("")}hasEmail(e){return typeof e.email=="string"&&e.email!==""}handleToggleHistory(e){return m(this,null,function*(){if(this.expandedHistoryKeys_$().has(e)){this.expandedHistoryKeys_$.update(l=>{let c=new Set(l);return c.delete(e),c});return}this.expandedHistoryKeys_$.update(l=>{let c=new Set(l);return c.add(e),c}),this.account_DS.usageHistoryMap_$().get(e)===void 0&&(yield this.loadHistoryFor(e))})}handleRefreshHistory(e){return m(this,null,function*(){yield this.loadHistoryFor(e)})}loadHistoryFor(e){return m(this,null,function*(){this.loadingHistoryKeys_$.update(t=>{let n=new Set(t);return n.add(e),n});try{yield this.account_DS.loadAccountUsageHistory({accountKey:e})}finally{this.loadingHistoryKeys_$.update(t=>{let n=new Set(t);return n.delete(e),n})}})}isHistoryOpen(e){return this.expandedHistoryKeys_$().has(e)}isHistoryLoading(e){return this.loadingHistoryKeys_$().has(e)}historyItemsOf(e){let n=(this.account_DS.usageHistoryMap_$().get(e)??[]).slice();return n.sort((l,c)=>{let g=l.observedAt?Date.parse(l.observedAt):0;return(c.observedAt?Date.parse(c.observedAt):0)-g}),n}sourceBadgeClassOf(e){return e==="stream"?"bg-cyan-900/40 border-cyan-700 text-cyan-300":e==="pull"?"bg-emerald-900/40 border-emerald-700 text-emerald-300":"bg-neutral-800 border-neutral-700 text-neutral-400"}formatObservedAt(e){if(e==null||e==="")return"\u2014";let t=Date.parse(e);if(!isFinite(t)||t<=0)return e;let n=new Date(t),l=String(n.getFullYear()),c=String(n.getMonth()+1).padStart(2,"0"),g=String(n.getDate()).padStart(2,"0"),M=String(n.getHours()).padStart(2,"0"),H=String(n.getMinutes()).padStart(2,"0"),se=String(n.getSeconds()).padStart(2,"0");return`${l}-${c}-${g} ${M}:${H}:${se}`}windowLabelOf(e){switch(e){case"five_hour":return"5-hour session";case"seven_day":return"Weekly";case"seven_day_opus":return"Weekly \xB7 Opus";case"seven_day_sonnet":return"Weekly \xB7 Sonnet";case"extra_usage":return"Extra (pay-as-you-go)";default:return e}}tokenStatusBadgeClassOf(e){return e==="valid"?"bg-green-900/40 border-green-700 text-green-300":e==="scope-incomplete"?"bg-amber-900/40 border-amber-700 text-amber-300":e==="expired"||e==="revoked"?"bg-red-900/40 border-red-700 text-red-300":"bg-neutral-800 border-neutral-700 text-neutral-400"}avatarLetterOf(e){let t=this.displayNameOf(e).trim();return t.length>0?t.charAt(0).toUpperCase():"A"}avatarBgClassOf(e){let t=["bg-emerald-700/60 text-emerald-200","bg-cyan-700/60 text-cyan-200","bg-indigo-700/60 text-indigo-200","bg-fuchsia-700/60 text-fuchsia-200","bg-amber-700/60 text-amber-200","bg-rose-700/60 text-rose-200","bg-teal-700/60 text-teal-200","bg-violet-700/60 text-violet-200"],n=0;for(let l=0;l<e.length;l++)n=n*31+e.charCodeAt(l)&2147483647;return t[n%t.length]}utilizationPercent(e){return e==null||!isFinite(e)?0:Math.max(0,Math.min(100,Math.round(e*100)))}utilizationBarColorClass(e){return e==null||!isFinite(e)?"bg-neutral-600":e>=.85?"bg-red-500":e>=.5?"bg-amber-500":"bg-emerald-500"}displayNameOf(e){return e.displayName!==""?e.displayName:`account-${e.accountKey.slice(0,6)}`}itemsCountOf(e){return e.length}latestFiveHourUtilOf(e){for(let t of e)if(t.windowType==="five_hour"&&typeof t.utilization=="number")return t.utilization;return null}latestAccountKeyOf(e){if(e.length===0)return null;let t=e[0];for(let n of e){let l=n.observedAt?Date.parse(n.observedAt):0,c=t.observedAt?Date.parse(t.observedAt):0;l>c&&(t=n)}return t.accountKey}displayNameByAccountKey(e){let t=this.account_DS.accounts_$().find(n=>n.accountKey===e);return t?this.displayNameOf(t):`account-${e.slice(0,6)}`}formatUtilization(e){return e===null?"\u2014":`${Math.round(e*100)}%`}utilizationColorClass(e){return e===null||e<.5?"text-green-400":e<.85?"text-yellow-300":"text-red-400"}pacingColorClassForFiveHour(e){let t;for(let c of e)if(c.windowType==="five_hour"){t=c;break}if(!t)return"text-neutral-500";let n=T.computePacingFraction({windowType:"five_hour",resetsAtMs:t.resetsAtMs,nowMs:Date.now()});if(n===null){let c=t.utilization??null;return this.utilizationColorClass(c)}let l=T.classifyPacing({utilization:t.utilization,pacingFraction:n});return T.colorClassForPacing(l)}static \u0275fac=function(t){return new(t||s)};static \u0275cmp=L({type:s,selectors:[["app-cc-usage-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-auto","p-4"],standalone:!0,features:[G],decls:55,vars:21,consts:[[1,"flex","items-start","justify-between","mb-6","pb-3","border-b","border-neutral-700","gap-3"],[1,"min-w-0","flex-1"],[1,"text-xl","font-bold","text-neutral-100","flex","items-center","gap-2"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-5","h-5","text-neonCyan"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 19V6l3-3 3 3v13M5 21h14a2 2 0 002-2v-7l-7-7-7 7v7a2 2 0 002 2z"],[1,"text-xs","text-neutral-500","mt-1"],[1,"text-neutral-400"],[1,"flex","items-center","gap-2","shrink-0"],["type","button","title","Re-scan local credential files (~/.claude/.credentials.json) and register newly discovered accounts.",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonDefault","bg-neonDefault/15","text-neutral-100","hover:bg-neonDefault/30","hover:border-neonDefault","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed","font-medium","flex","items-center","gap-1.5",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3.5","h-3.5"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"],["type","button","title","Pull live usage data from Anthropic for every known account.",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","hover:border-neonCyan","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed","font-medium","flex","items-center","gap-1.5",3,"click","disabled"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M13 10V3L4 14h7v7l9-11h-7z"],[1,"text-sm","text-neutral-400","italic","py-4"],[1,"text-sm","text-red-400","bg-red-950/30","border","border-red-700","rounded","p-3","mb-4"],[1,"mb-6"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider","mb-3","flex","items-center","gap-2"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M17 20h5v-2a3 3 0 00-5.356-1.857M17 20H7m10 0v-2c0-.656-.126-1.283-.356-1.857M7 20H2v-2a3 3 0 015.356-1.857M7 20v-2c0-.656.126-1.283.356-1.857m0 0a5.002 5.002 0 019.288 0M15 7a3 3 0 11-6 0 3 3 0 016 0zm6 3a2 2 0 11-4 0 2 2 0 014 0zM7 10a2 2 0 11-4 0 2 2 0 014 0z"],[1,"text-neutral-600","font-normal","normal-case","tracking-normal"],[1,"rounded-lg","border","border-dashed","border-neutral-700","bg-neutral-900/30","px-6","py-10","text-center"],[1,"grid","grid-cols-1","md:grid-cols-2","xl:grid-cols-3","gap-3"],[1,"rounded-lg","border","border-neutral-800","hover:border-neutral-700","hover:shadow-md","hover:shadow-black/30","bg-gradient-to-br","from-neutral-900/60","to-neutral-950/30","transition-all","overflow-hidden","flex","flex-col",3,"xl:col-span-2","xl:col-span-3"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M19 11H5m14 0a2 2 0 012 2v6a2 2 0 01-2 2H5a2 2 0 01-2-2v-6a2 2 0 012-2m14 0V9a2 2 0 00-2-2M5 11V9a2 2 0 012-2m0 0V5a2 2 0 012-2h6a2 2 0 012 2v2M7 7h10"],[1,"rounded-lg","border","border-dashed","border-neutral-700","bg-neutral-900/30","px-4","py-6","text-center","text-[11px]","text-neutral-500"],[1,"flex","items-center","gap-3","py-2.5","px-3","rounded-lg","border","border-neutral-800","mb-2","hover:border-neutral-700","hover:bg-neutral-900/40","transition-all"],["title","Set CC account email","maxWidth","sm",3,"closed","isOpen"],[1,"flex","flex-col","gap-3"],[1,"text-xs","text-neutral-400"],["type","email","placeholder","user@example.com","autofocus","",1,"w-full","px-3","py-2","rounded-md","bg-neutral-900","border","border-neutral-700","text-sm","text-neutral-100","placeholder-neutral-500","focus:outline-none","focus:border-neonCyan",3,"ngModelChange","ngModel"],[1,"flex","items-center","justify-end","gap-2","pt-2"],["type","button",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neutral-700","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click"],["type","button",1,"px-3","py-1.5","text-xs","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-12","h-12","mx-auto","text-neutral-600","mb-3"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","1.5","d","M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"],[1,"text-sm","text-neutral-300","font-medium","mb-1"],[1,"text-xs","text-neutral-500"],[1,"px-1.5","py-0.5","rounded","bg-neutral-800","text-neonCyan","font-mono"],[1,"text-neutral-300"],[1,"rounded-lg","border","border-neutral-800","hover:border-neutral-700","hover:shadow-md","hover:shadow-black/30","bg-gradient-to-br","from-neutral-900/60","to-neutral-950/30","transition-all","overflow-hidden","flex","flex-col"],[1,"flex","items-start","gap-2","py-2.5","px-3","border-b","border-neutral-800/70"],[1,"flex-1","min-w-0"],[1,"flex","items-center","gap-1.5","min-w-0"],[1,"text-sm","text-neutral-100","font-semibold","truncate"],[3,"class","title"],[1,"text-[9px]","text-neutral-200","px-1.5","py-0.5","rounded-full","border","border-indigo-700","bg-indigo-900/30","font-medium","shrink-0"],[1,"flex","items-center","gap-1.5","mt-0.5","min-w-0"],[1,"text-[11px]","text-neonCyan/90","truncate"],["type","button",1,"text-[9px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1","py-0.5","transition-colors","shrink-0",3,"click","title"],[1,"text-[10px]","text-neutral-500","font-mono","truncate","mt-0.5",3,"title"],[1,"text-neutral-600"],["type","button","title","Pull live usage data from Anthropic for this account.",1,"shrink-0","px-2","py-1","text-[11px]","rounded-md","border","border-neonCyan","bg-neonCyan/15","text-neutral-100","hover:bg-neonCyan/30","transition-colors","flex","items-center","gap-1","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3"],[1,"px-3","py-2.5","border-b","border-neutral-800/40","flex-1"],[1,"space-y-2"],[1,"grid","grid-cols-[110px_1fr_64px]","items-center","gap-2","text-[11px]",3,"opacity-50"],[1,"text-[10px]","text-neutral-500","italic","mt-2","pt-2","border-t","border-neutral-800/40"],[1,"px-3","py-2"],["type","button",1,"text-[11px]","text-neutral-400","hover:text-neonCyan","flex","items-center","gap-1","transition-colors",3,"click","title"],["fill","none","stroke","currentColor","viewBox","0 0 24 24","aria-hidden","true",1,"w-3","h-3","transition-transform"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M9 5l7 7-7 7"],[1,"text-neutral-500","italic","ml-1"],[1,"mt-2","rounded-md","border","border-neutral-800","bg-neutral-950/40","p-2"],[3,"title"],[1,"grid","grid-cols-[110px_1fr_64px]","items-center","gap-2","text-[11px]"],[1,"text-neutral-300","font-medium","truncate",3,"title"],[1,"flex","items-center","gap-2","min-w-0"],[1,"flex-1","h-2","bg-neutral-800","rounded-full","overflow-hidden","relative"],[3,"class","width"],[1,"font-mono","text-neutral-200","text-right","w-9","shrink-0"],[1,"font-mono","text-neutral-500","text-right","text-[10px]","truncate",3,"title"],[1,"flex","items-center","justify-between","mb-2"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider"],[1,"text-neutral-600","normal-case","tracking-normal","ml-1"],["type","button","title","Re-fetch usage event history from server.",1,"text-[10px]","text-neutral-400","hover:text-neonCyan","border","border-neutral-700","hover:border-neonCyan","rounded","px-1.5","py-0.5","transition-colors","disabled:opacity-40","disabled:cursor-not-allowed",3,"click","disabled"],[1,"text-[11px]","text-neutral-500","italic","px-2","py-3"],[1,"overflow-x-auto"],[1,"px-1","py-0.5","rounded","bg-neutral-800","text-neutral-400","font-mono","text-[10px]"],[1,"w-full","text-[11px]","text-left"],[1,"py-1","px-2","font-medium"],[1,"py-1","px-2","font-medium","text-right"],[1,"border-t","border-neutral-800/60","hover:bg-neutral-900/40"],[1,"py-1","px-2","font-mono","text-neutral-300"],[1,"py-1","px-2","text-neutral-300"],[1,"py-1","px-2"],[1,"py-1","px-2","font-mono","text-neutral-200","text-right"],[1,"py-1","px-2","text-neutral-400"],[1,"py-1","px-2","font-mono","text-neutral-500"],[1,"shrink-0","w-7","h-7","rounded-md","bg-neutral-800","border","border-neutral-700","flex","items-center","justify-center","text-neutral-400"],["stroke-linecap","round","stroke-linejoin","round","stroke-width","2","d","M5 12H3l9-9 9 9h-2M5 12v7a2 2 0 002 2h10a2 2 0 002-2v-7"],[1,"text-sm","text-neutral-200","font-medium","truncate","font-mono"],[1,"text-[11px]","text-neutral-500","mt-0.5","flex","items-center","gap-1.5","flex-wrap"],[1,"font-mono","text-neutral-600","text-[10px]"],[1,"text-neutral-700"]],template:function(t,n){if(t&1&&(i(0,"header",0)(1,"div",1)(2,"h1",2),v(),i(3,"svg",3),y(4,"path",4),a(),r(5," CC Usage & Accounts "),a(),S(),i(6,"p",5),r(7," Anthropic OAuth credentials \xB7 per-account 5-hour / weekly / opus / sonnet / extra usage windows \xB7 "),i(8,"span",6),r(9),a(),r(10," \xB7 "),i(11,"span",6),r(12),a()()(),i(13,"div",7)(14,"button",8),b("click",function(){return n.handleRefresh()}),v(),i(15,"svg",9),y(16,"path",10),a(),r(17),a(),S(),i(18,"button",11),b("click",function(){return n.handleRefreshAllUsage()}),v(),i(19,"svg",9),y(20,"path",12),a(),r(21),a()()(),x(22,_e,2,0,"div",13)(23,fe,4,1,"div",14),S(),i(24,"section",15)(25,"h2",16),v(),i(26,"svg",9),y(27,"path",17),a(),r(28," Known CC Accounts "),S(),i(29,"span",18),r(30),a()(),x(31,he,13,0,"div",19),i(32,"div",20),k(33,Ue,35,28,"div",21,de),a()(),i(35,"section")(36,"h2",16),v(),i(37,"svg",9),y(38,"path",22),a(),r(39," Instance \u2194 Account Mapping "),S(),i(40,"span",18),r(41),a()(),x(42,Ae,8,0,"div",23),k(43,De,11,3,"div",24,ue),a(),i(45,"app-s-modal",25),b("closed",function(){return n.handleEditEmailClose()}),i(46,"div",26)(47,"p",27),r(48," Enter the email address linked to this Claude account. Leave empty to clear. "),a(),i(49,"input",28),b("ngModelChange",function(c){return n.editEmailValue_$.set(c)}),a(),i(50,"div",29)(51,"button",30),b("click",function(){return n.handleEditEmailClose()}),r(52," Cancel "),a(),i(53,"button",31),b("click",function(){return n.handleEditEmailSave()}),r(54),a()()()()),t&2){let l,c;o(9),d("",n.account_DS.accounts_$().length," account(s)"),o(3),d("",n.instanceCount_$()," instance mapping(s)"),o(2),f("disabled",n.isRefreshing_$()||n.account_DS.isLoading_$()),o(),E("animate-spin",n.isRefreshing_$()),o(2),d(" ",n.isRefreshing_$()?"Discovering\u2026":"Refresh accounts"," "),o(),f("disabled",n.isRefreshingAllUsage_$()||!n.account_DS.accounts_$().length),o(),E("animate-spin",n.isRefreshingAllUsage_$()),o(2),d(" ",n.isRefreshingAllUsage_$()?"Pulling all\u2026":"Pull all usage"," "),o(),h(n.account_DS.isLoading_$()?22:-1),o(),h((l=n.account_DS.loadError_$())?23:-1,l),o(7),d(" \xB7 ",n.account_DS.accounts_$().length," "),o(),h(!n.account_DS.accounts_$().length&&!n.account_DS.isLoading_$()?31:-1),o(2),D(n.account_DS.accounts_$()),o(8),d(" \xB7 ",n.instanceCount_$()," "),o(),h(!n.instanceCount_$()&&!n.account_DS.isLoading_$()?42:-1),o(),D((c=(c=n.account_DS.instanceMapping_$())==null?null:c.instances)!==null&&c!==void 0?c:K(20,pe)),o(2),f("isOpen",n.editEmailModalOpen_$()),o(4),f("ngModel",n.editEmailValue_$()),o(4),f("disabled",n.editEmailSaving_$()),o(),d(" ",n.editEmailSaving_$()?"Saving\u2026":"Save"," ")}},dependencies:[Z,ee,J,Q,X,ie],encapsulation:2})}return s})();export{Xe as CC_UsageDashboard_Component};
2
+ //# sourceMappingURL=cc-usage-dashboard.component-WQFT75MV.js.map
@@ -1,4 +1,4 @@
1
- import{a as de,b as Ve,c as Lt,d as Ot,e as Le,f as Ft}from"./chunk-E7UUENED.js";import{a as ve,b as ce,c as pe,d as Vt}from"./chunk-H3UBW75V.js";import"./chunk-EGRHWZRV.js";import{a as Re}from"./chunk-E4KDYJK2.js";import{a as Ae}from"./chunk-ZGYR3BWU.js";import{a as Se}from"./chunk-Q2PKIGLB.js";import{a as yt}from"./chunk-C77QVQH5.js";import{a as W}from"./chunk-Z2SVASLX.js";import{a as Ke}from"./chunk-YRVQSWSZ.js";import{a as bt}from"./chunk-6H3YM2KP.js";import{a as wt,b as Ee}from"./chunk-DOJVWJJ3.js";import"./chunk-OMXNVPGE.js";import"./chunk-CF6YGIKE.js";import"./chunk-L44637OO.js";import"./chunk-TBPY4N7X.js";import"./chunk-UFBTR2BG.js";import{a as re}from"./chunk-TS2SSYDS.js";import"./chunk-PS73GRXP.js";import"./chunk-ZTPYZH3Z.js";import"./chunk-H62NDY3W.js";import{e as Pt,f as At,g as Rt}from"./chunk-343QTRWG.js";import"./chunk-JWZ24GIQ.js";import{a as Dt}from"./chunk-7JUIBZEE.js";import{a as It,b as $t,c as Et}from"./chunk-C7XPBJTG.js";import{a as Qe,b as U,c as Ge,f as Mt}from"./chunk-7R5IXHU5.js";import"./chunk-WPHEQXWB.js";import{a as Tt,c as kt}from"./chunk-OXGMGAWK.js";import{b as Me,c as Pe}from"./chunk-BY7QOLIO.js";import"./chunk-IIZH7NVD.js";import"./chunk-YS7A2NP6.js";import"./chunk-Q2NVIOCY.js";import{a as le}from"./chunk-XOGAYT52.js";import"./chunk-QE7LJZUK.js";import"./chunk-YPZWNP5A.js";import"./chunk-F4HSG3GQ.js";import"./chunk-V3VQWJQL.js";import"./chunk-AC6VDECU.js";import"./chunk-RJGC4CE7.js";import"./chunk-ZBTWQZNB.js";import{a as Y}from"./chunk-FLAJXIYW.js";import{c as Ct,f as xt,i as ht,n as ft,o as gt,p as St,v as vt}from"./chunk-EO4DNTT4.js";import"./chunk-P6FPD5OQ.js";import{a as V}from"./chunk-5UPNU54P.js";import{j as ae}from"./chunk-4F6OM6PQ.js";import{p as pt}from"./chunk-5DVU3XRC.js";import{$a as F,Aa as xe,Ba as he,C as $,Cb as De,D as B,E as et,Ea as fe,Eb as _t,Fa as d,Fb as mt,G as ie,Ga as k,Gb as se,Ha as D,Ia as J,J as u,K as C,Kb as ut,L as P,M as O,N as tt,Pa as ge,Qa as ot,Ra as ke,T as ye,Ta as Ie,U as Q,Va as qe,W as G,Xa as st,Z as a,_ as nt,a as We,aa as b,ab as j,b as Ne,bb as at,ca as it,da as g,db as rt,fa as me,ga as v,h as Xe,ha as Te,hb as A,ia as ue,ib as lt,ja as L,jb as $e,k as R,la as _,mb as X,oa as N,ob as dt,pa as H,pb as ct,qa as o,ra as s,sa as S,ta as He,ua as T,ub as oe,va as x,wa as c,y as Ye,z as Ze,za as Ce}from"./chunk-TBMJSIBB.js";function an(t,r){t&1&&(o(0,"div",3),P(),o(1,"svg",5),S(2,"path",6),s(),O(),o(3,"span",7),d(4,"Plan accepted"),s()())}function rn(t,r){if(t&1){let e=T();o(0,"button",8),x("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),P(),o(1,"svg",9),S(2,"path",6),s(),d(3," Accept plan "),s()}}function ln(t,r){if(t&1){let e=T();o(0,"div",0)(1,"div",1),x("click",function(n){u(e);let l=c();return C(l.handleAssistantMdClick(n))}),s(),o(2,"div",2),g(3,an,5,0,"div",3)(4,rn,4,0,"button",4),s()()}if(t&2){let e=c();a(),v("innerHTML",r,G),a(2),_(e.isAccepted_$()?3:4)}}var Oe=(()=>{class t{sanitizer=$(De);globalError_CS=$(ae);rawData=Q(void 0);accepted=ye();isAccepted_$=b(!1);planText_$=A(()=>{let e=this.rawData();if(!e)return"";let i=e.input;if(!i||typeof i!="object")return"";let n=i.plan;return typeof n=="string"?n:""});planHtml_$=A(()=>{let e=this.planText_$();if(!e)return null;let i=Qe.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}handleAssistantMdClick(e){return R(this,null,function*(){yield Qe.handleCodeCopyClick(e,i=>this.globalError_CS.copyToClipboard(i))})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[Ie],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-2"],[1,"ccap-assistant-md","leading-snug","sm:leading-normal","break-words","text-neutral-200","text-xs","sm:text-sm","min-w-0","max-h-[400px]","overflow-y-auto","overflow-x-auto","pr-1",3,"click","innerHTML"],[1,"flex","justify-end","pt-1","border-t","border-orange-500/10"],[1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-green-500/10","border","border-green-500/25"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-green-400"],["d","M3.5 8.5l3 3 6-6"],[1,"text-[11px]","text-green-400","font-medium"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"]],template:function(i,n){if(i&1&&g(0,ln,5,2,"div",0),i&2){let l;_((l=n.planHtml_$())?0:-1,l)}},dependencies:[oe],styles:[`@charset "UTF-8";
1
+ import{a as de,b as Ve,c as Lt,d as Ot,e as Le,f as Ft}from"./chunk-NNEFCEZZ.js";import{a as ve,b as ce,c as pe,d as Vt}from"./chunk-ATR4YAIL.js";import"./chunk-EGRHWZRV.js";import{a as Re}from"./chunk-2AGHFWEW.js";import{a as Ae}from"./chunk-2K7AS4TQ.js";import{a as Se}from"./chunk-Q2PKIGLB.js";import{a as yt}from"./chunk-CUMUA2HP.js";import{a as W}from"./chunk-WL5L5AUS.js";import{a as Ke}from"./chunk-YRVQSWSZ.js";import{a as bt}from"./chunk-EUMQRYBI.js";import{a as wt,b as Ee}from"./chunk-KD4JK4LC.js";import"./chunk-5VMMYEMK.js";import"./chunk-XSZRRELF.js";import"./chunk-L44637OO.js";import"./chunk-PWGYG7KG.js";import"./chunk-UFBTR2BG.js";import{a as re}from"./chunk-JDBS6ZXD.js";import"./chunk-VILXJBM4.js";import"./chunk-RJX7O3DI.js";import"./chunk-SNMSF3UC.js";import{e as Pt,f as At,g as Rt}from"./chunk-OITOJMIX.js";import"./chunk-BJYELNNP.js";import{a as Dt}from"./chunk-7JUIBZEE.js";import{a as It,b as $t,c as Et}from"./chunk-C7XPBJTG.js";import{a as Qe,b as U,c as Ge,f as Mt}from"./chunk-WPT7HGB2.js";import"./chunk-WPHEQXWB.js";import{a as Tt,c as kt}from"./chunk-U3FLQ2MZ.js";import{b as Me,c as Pe}from"./chunk-TXVACKLG.js";import"./chunk-56Q57BLF.js";import"./chunk-AD7RW3IE.js";import"./chunk-Q2NVIOCY.js";import{a as le}from"./chunk-XOGAYT52.js";import"./chunk-OHI3J35R.js";import"./chunk-54YZZ7DI.js";import"./chunk-GBRJVJWI.js";import"./chunk-V3VQWJQL.js";import"./chunk-S2FEPCDW.js";import"./chunk-M4CGCNOB.js";import"./chunk-ZBTWQZNB.js";import{a as Y}from"./chunk-FLAJXIYW.js";import{c as Ct,f as xt,i as ht,n as ft,o as gt,p as St,v as vt}from"./chunk-EO4DNTT4.js";import"./chunk-6PIFC53E.js";import{a as V}from"./chunk-5UPNU54P.js";import{j as ae}from"./chunk-TKAV5X35.js";import{p as pt}from"./chunk-VRI47IVY.js";import{$a as F,Aa as xe,Ba as he,C as $,Cb as De,D as B,E as et,Ea as fe,Eb as _t,Fa as d,Fb as mt,G as ie,Ga as k,Gb as se,Ha as D,Ia as J,J as u,K as C,Kb as ut,L as P,M as O,N as tt,Pa as ge,Qa as ot,Ra as ke,T as ye,Ta as Ie,U as Q,Va as qe,W as G,Xa as st,Z as a,_ as nt,a as We,aa as b,ab as j,b as Ne,bb as at,ca as it,da as g,db as rt,fa as me,ga as v,h as Xe,ha as Te,hb as A,ia as ue,ib as lt,ja as L,jb as $e,k as R,la as _,mb as X,oa as N,ob as dt,pa as H,pb as ct,qa as o,ra as s,sa as S,ta as He,ua as T,ub as oe,va as x,wa as c,y as Ye,z as Ze,za as Ce}from"./chunk-TBMJSIBB.js";function an(t,r){t&1&&(o(0,"div",3),P(),o(1,"svg",5),S(2,"path",6),s(),O(),o(3,"span",7),d(4,"Plan accepted"),s()())}function rn(t,r){if(t&1){let e=T();o(0,"button",8),x("click",function(){u(e);let n=c(2);return C(n.handleAccept())}),P(),o(1,"svg",9),S(2,"path",6),s(),d(3," Accept plan "),s()}}function ln(t,r){if(t&1){let e=T();o(0,"div",0)(1,"div",1),x("click",function(n){u(e);let l=c();return C(l.handleAssistantMdClick(n))}),s(),o(2,"div",2),g(3,an,5,0,"div",3)(4,rn,4,0,"button",4),s()()}if(t&2){let e=c();a(),v("innerHTML",r,G),a(2),_(e.isAccepted_$()?3:4)}}var Oe=(()=>{class t{sanitizer=$(De);globalError_CS=$(ae);rawData=Q(void 0);accepted=ye();isAccepted_$=b(!1);planText_$=A(()=>{let e=this.rawData();if(!e)return"";let i=e.input;if(!i||typeof i!="object")return"";let n=i.plan;return typeof n=="string"?n:""});planHtml_$=A(()=>{let e=this.planText_$();if(!e)return null;let i=Qe.toSanitizedHtml(e);return this.sanitizer.bypassSecurityTrustHtml(i)});handleAccept(){this.isAccepted_$()||(this.isAccepted_$.set(!0),this.accepted.emit())}handleAssistantMdClick(e){return R(this,null,function*(){yield Qe.handleCodeCopyClick(e,i=>this.globalError_CS.copyToClipboard(i))})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-plan-view"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},outputs:{accepted:"accepted"},standalone:!0,features:[Ie],decls:1,vars:1,consts:[[1,"px-2.5","py-2","space-y-2"],[1,"ccap-assistant-md","leading-snug","sm:leading-normal","break-words","text-neutral-200","text-xs","sm:text-sm","min-w-0","max-h-[400px]","overflow-y-auto","overflow-x-auto","pr-1",3,"click","innerHTML"],[1,"flex","justify-end","pt-1","border-t","border-orange-500/10"],[1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-green-500/10","border","border-green-500/25"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-green-400"],["d","M3.5 8.5l3 3 6-6"],[1,"text-[11px]","text-green-400","font-medium"],["type","button",1,"inline-flex","items-center","gap-1.5","px-3","py-1","rounded-md","bg-ccapAccent/10","border","border-ccapAccent/30","text-ccapAccent","text-[11px]","font-medium","cursor-pointer","hover:bg-ccapAccent/20","hover:border-ccapAccent/50","transition-colors",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"]],template:function(i,n){if(i&1&&g(0,ln,5,2,"div",0),i&2){let l;_((l=n.planHtml_$())?0:-1,l)}},dependencies:[oe],styles:[`@charset "UTF-8";
2
2
  /*# sourceMappingURL=s-agent-tool-plan-view.component-E4T5UMZT.css.map */`]})}return t})();var cn=(t,r)=>r.content,pn=(t,r,e)=>({"text-neutral-500 line-through":t,"text-blue-300":r,"text-neutral-300":e});function _n(t,r){t&1&&(P(),o(0,"svg",5),S(1,"path",10),s())}function mn(t,r){t&1&&(o(0,"span",6),S(1,"span",11),s())}function un(t,r){t&1&&(o(0,"span",6),S(1,"span",12),s())}function Cn(t,r){if(t&1&&(o(0,"div",9),d(1),s()),t&2){let e=c().$implicit;a(),k(e.activeForm)}}function xn(t,r){if(t&1&&(o(0,"div",4),g(1,_n,2,0,":svg:svg",5)(2,mn,2,0,"span",6)(3,un,2,0,"span",6),o(4,"div",7)(5,"span",8),d(6),s(),g(7,Cn,2,1,"div",9),s()()),t&2){let e,i=r.$implicit;a(),_((e=i.status)==="completed"?1:e==="in_progress"?2:3),a(4),v("ngClass",st(4,pn,i.status==="completed",i.status==="in_progress",i.status!=="completed"&&i.status!=="in_progress")),a(),k(i.content),a(),_(i.status==="in_progress"&&i.activeForm?7:-1)}}function hn(t,r){if(t&1&&(o(0,"div",0)(1,"div",1)(2,"span",2),d(3,"Tasks"),s(),o(4,"span",3),d(5),s()(),N(6,xn,8,8,"div",4,cn),s()),t&2){let e=c();a(5),J("",e.completedCount_$(),"/",e.totalCount_$(),""),a(),H(e.todos_$())}}var Ue=(()=>{class t{rawData=Q(void 0);todos_$=A(()=>{let e=this.rawData();if(!e)return[];let i=e.input;if(!i||typeof i!="object")return[];let n=i.todos;return Array.isArray(n)?n.filter(l=>typeof l=="object"&&l!==null&&typeof l.content=="string"):[]});completedCount_$=A(()=>this.todos_$().filter(e=>e.status==="completed").length);totalCount_$=A(()=>this.todos_$().length);static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-s-agent-tool-todo-list"]],hostAttrs:[1,"block"],inputs:{rawData:[1,"rawData"]},standalone:!0,features:[Ie],decls:1,vars:1,consts:[[1,"px-2.5","py-1.5","space-y-0.5"],[1,"flex","items-center","gap-1.5","mb-1"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","font-medium"],[1,"text-[10px]","text-neutral-600"],[1,"flex","items-start","gap-2","py-0.5"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-4","h-4","text-green-400","shrink-0","mt-px"],[1,"w-4","h-4","shrink-0","mt-px","flex","items-center","justify-center"],[1,"min-w-0"],[1,"text-[11px]","leading-relaxed","break-words",3,"ngClass"],[1,"text-[9px]","text-blue-400/50","mt-px"],["d","M3.5 8.5l3 3 6-6"],[1,"w-3","h-3","rounded-full","border-2","border-blue-400/40","border-t-blue-400","animate-spin"],[1,"w-3","h-3","rounded-full","border","border-neutral-600"]],template:function(i,n){i&1&&g(0,hn,8,2,"div",0),i&2&&_(n.todos_$().length?0:-1)},dependencies:[oe,X],encapsulation:2})}return t})();var E="ccap-ccSession",y=class{static saveProjectFilter(r){V.writeString(`${E}:projectFilter`,r)}static loadProjectFilter(){return V.readString(`${E}:projectFilter`)??""}static saveLastWorkspacePath(r){V.writeString(`${E}:lastWorkspacePath`,r)}static loadLastWorkspacePath(){return V.readString(`${E}:lastWorkspacePath`)??""}static saveLastLabel(r){V.writeString(`${E}:lastLabel`,r)}static loadLastLabel(){return V.readString(`${E}:lastLabel`)??""}static savePromptDraft(r,e){ve.saveDraft(E,r,e)}static loadPromptDraft(r){return ve.loadDraft(E,r)}static clearPromptDraft(r){ve.clearDraft(E,r)}static hasPromptDraft(r){return ve.hasDraft(E,r)}static savePanelOpen(r,e){V.writeBoolean(`${E}:panelOpen:${r}`,e)}static loadPanelOpen(r,e){return V.readBoolean(`${E}:panelOpen:${r}`,e)}static savePanelWidth(r,e){V.writeNumber(`${E}:panelWidth:${r}`,e)}static loadPanelWidth(r,e){return V.readNumber(`${E}:panelWidth:${r}`,e)}static saveSessionMode(r){V.writeString(`${E}:sessionMode`,r)}static loadSessionMode(){return V.readString(`${E}:sessionMode`)??"normal"}static saveSessionEffort(r){V.writeString(`${E}:sessionEffort`,r)}static loadSessionEffort(){return V.readString(`${E}:sessionEffort`)??"high"}static saveSessionModel(r){V.writeString(`${E}:sessionModel`,r)}static loadSessionModel(){return V.readString(`${E}:sessionModel`)??"sonnet"}static saveStatusHistory(r){V.writeBoolean(`${E}:statusHistory`,r)}static loadStatusHistory(){return V.readBoolean(`${E}:statusHistory`,!1)}static saveLastSessionId(r){V.writeString(`${E}:lastSessionId`,r)}static loadLastSessionId(){return V.readString(`${E}:lastSessionId`)??""}static saveLastCcapId(r){V.writeString(`${E}:lastCcapId`,r)}static loadLastCcapId(){return V.readString(`${E}:lastCcapId`)??""}static saveShowStatusUpdates(r){V.writeBoolean(`${E}:showStatusUpdates`,r)}static loadShowStatusUpdates(){return V.readBoolean(`${E}:showStatusUpdates`,!0)}static saveShowArchived(r){V.writeBoolean(`${E}:showArchived`,r)}static loadShowArchived(){return V.readBoolean(`${E}:showArchived`,!1)}};var K=(()=>{class t{ccSession_DS=$(W);isTimelinePanelOpen_$=b(y.loadPanelOpen("timeline",!1));isMetadataPanelOpen_$=b(y.loadPanelOpen("metadata",!1));isResuming_$=b(!1);isTerminating_$=b(!1);isStopping_$=b(!1);isForking_$=b(!1);isShowSessionStatus_$=b(y.loadStatusHistory());isShowAgentUpdates_$=b(y.loadShowStatusUpdates());handleToggleTimeline(){let e=!this.isTimelinePanelOpen_$();this.isTimelinePanelOpen_$.set(e),y.savePanelOpen("timeline",e)}handleToggleMetadata(){let e=!this.isMetadataPanelOpen_$();this.isMetadataPanelOpen_$.set(e),y.savePanelOpen("metadata",e)}handleToggleSessionStatus(){let e=!this.isShowSessionStatus_$();this.isShowSessionStatus_$.set(e),y.saveStatusHistory(e)}handleToggleAgentUpdates(){let e=!this.isShowAgentUpdates_$();this.isShowAgentUpdates_$.set(e),y.saveShowStatusUpdates(e)}handleResume(){return R(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isResuming_$())return;let i=e.session.sessionId;if(i){this.isResuming_$.set(!0);try{yield this.ccSession_DS.resumeSession({sessionId:i})}catch{}finally{this.isResuming_$.set(!1)}}})}handleStopExecution(){return R(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isStopping_$())return;let i=e.session.sessionId;if(i){this.isStopping_$.set(!0);try{yield this.ccSession_DS.stopExecution({sessionId:i})}catch{}finally{this.isStopping_$.set(!1)}}})}handleFork(){return R(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isForking_$())return null;let i=e.session.sessionId;if(!i||!e.session.claudeSessionId)return null;this.isForking_$.set(!0);try{return yield this.ccSession_DS.forkSession({sessionId:i})}catch{return null}finally{this.isForking_$.set(!1)}})}handleTerminate(){return R(this,null,function*(){let e=this.ccSession_DS.selectedSession_$();if(!e||this.isTerminating_$())return;let i=e.session.sessionId;if(i){this.isTerminating_$.set(!0);try{yield this.ccSession_DS.terminateSession({sessionId:i})}catch{}finally{this.isTerminating_$.set(!1)}}})}static \u0275fac=function(i){return new(i||t)};static \u0275prov=Ye({token:t,factory:t.\u0275fac,providedIn:"root"})}return t})();var vn=(t,r)=>r._id,bn=(t,r)=>r.path;function wn(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=c().$implicit;v("value",e.localPath),a(),k(e.name)}}function yn(t,r){if(t&1&&g(0,wn,2,2,"option",26),t&2){let e=r.$implicit;_(e.localPath?0:-1)}}function Tn(t,r){t&1&&(o(0,"div",12),d(1,"Loading sessions..."),s())}function kn(t,r){t&1&&(o(0,"div",13),d(1,"Failed to load sessions"),s())}function In(t,r){if(t&1){let e=T();o(0,"app-s-session-select",27),x("selected",function(n){u(e);let l=c();return C(l.handleSelectSession(n))})("contextMenu",function(n){u(e);let l=c();return C(l.handleRowContextMenu(n))})("scheduleIndicatorClicked",function(n){u(e);let l=c();return C(l.handleScheduleIndicatorClick(n))})("coordinatorIndicatorClicked",function(n){u(e);let l=c();return C(l.handleCoordinatorIndicatorClick(n))}),s()}if(t&2){let e=c();v("rows",e.sessionRowViews_$())("activeId",e.ccSession_DS.activeSessionId_$())("hideSearch",!0)}}function $n(t,r){t&1&&(o(0,"div",12),d(1,"No sessions found"),s())}function Dn(t,r){if(t&1&&(o(0,"option",26),d(1),s()),t&2){let e=r.$implicit;v("value",e.path),a(),J("",e.label," \u2014 ",e.path,"")}}function En(t,r){if(t&1){let e=T();o(0,"select",28),x("ngModelChange",function(n){u(e);let l=c();return C(l.handlePathOptionChange(n))}),o(1,"option",29),d(2,"Select a path..."),s(),N(3,Dn,2,3,"option",26,bn),o(5,"option",30),d(6,"Custom path..."),s()()}if(t&2){let e=c();v("ngModel",e.selectedPathOption_$()),a(3),H(e.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$())}}function Mn(t,r){if(t&1){let e=T();o(0,"div",33)(1,"input",34,0),x("input",function(){u(e);let n=fe(2),l=c(2);return C(l.renameValue_$.set(n.value))})("keydown.enter",function(){u(e);let n=c(2);return C(n.handleCtxRenameConfirm())})("keydown.escape",function(){u(e);let n=c(2);return C(n.handleCloseCtxMenu())}),s()()}if(t&2){let e=c(2);a(),v("value",e.renameValue_$())}}function Pn(t,r){t&1&&d(0," \u2713 Link copied ")}function An(t,r){t&1&&d(0," Copy failed ")}function Rn(t,r){t&1&&d(0," Copy link ")}function Vn(t,r){if(t&1){let e=T();o(0,"button",36),x("click",function(){u(e);let n=c(3);return C(n.handleCtxResume())}),d(1," Resume "),s()}}function Ln(t,r){if(t&1){let e=T();S(0,"div",38),o(1,"button",39),x("click",function(){u(e);let n=c(3);return C(n.handleCtxTerminate())}),d(2," Terminate "),s()}}function On(t,r){if(t&1){let e=T();o(0,"button",35),x("click",function(){u(e);let n=c(2);return C(n.handleCtxCopyLink())}),g(1,Pn,1,0)(2,An,1,0)(3,Rn,1,0),s(),o(4,"button",36),x("click",function(){u(e);let n=c(2);return C(n.handleCtxRenameStart())}),d(5," Rename "),s(),o(6,"button",36),x("click",function(){u(e);let n=c(2);return C(n.handleCtxToggleArchive())}),d(7),s(),g(8,Vn,2,0,"button",37)(9,Ln,3,0)}if(t&2){let e,i=c(),n=c();v("disabled",n.linkCopyState_$()!=="idle"),a(),_((e=n.linkCopyState_$())==="copied"?1:e==="failed"?2:3),a(6),D(" ",i.isArchived?"Unarchive":"Archive"," "),a(),_(i.status==="completed"||i.status==="errored"?8:-1),a(),_(i.status==="running"||i.status==="starting"||i.status==="waiting-input"?9:-1)}}function Fn(t,r){if(t&1){let e=T();o(0,"div",31),x("click",function(){u(e);let n=c();return C(n.handleCloseCtxMenu())}),s(),o(1,"div",32),g(2,Mn,3,1,"div",33)(3,On,10,5),s()}if(t&2){let e=c();a(),Te("left",e.ctxMenuPos_$().x,"px")("top",e.ctxMenuPos_$().y,"px"),a(),_(e.isRenaming_$()?2:3)}}var jt=(()=>{class t{ccSession_DS=$(W);newAgentSessionWorkspace_DS=$(yt);pm_DS=$(Tt);peiContext_DS=$(re);scheduledJobs_DS=$(Ae);coordinator_DS=$(Re);router=$(se);globalError_CS=$(ae);instanceChangeEffect=$e(()=>{let e=this.peiContext_DS.activeCcapId_$(),i=this.showArchived_$();e&&lt(()=>{this.ccSession_DS.loadSessions({includeArchived:i||void 0})})});projectFilter_$=b("");filteredSessions_$=A(()=>{let e=this.ccSession_DS.sessions_$(),i=this.projectFilter_$();if(!i)return e;let n=t.normalizePath(i);return e.filter(l=>!!l.workspacePath&&t.normalizePath(l.workspacePath)===n)});sessionRowViews_$=A(()=>{let e=this.scheduledJobs_DS.scheduledSessionIds_$(),i=this.coordinator_DS.coordinatedSessionIds_$();return this.filteredSessions_$().map(n=>({id:n.sessionId,label:n.label||n.sessionId,status:n.status,statusColorClass:Ke.resolve(n.status),workspacePath:n.workspacePath,isArchived:!!n.isArchived,lastActivityAt:n.lastActivityAt,promptCount:n.promptCount,isRunning:Ke.isRunning(n.status),hasSchedule:e.has(n.sessionId),hasCoordinator:i.has(n.sessionId),hasDraft:y.hasPromptDraft(n.sessionId)}))});isCreateDialogOpen_$=b(!1);schedulePopupSessionId_$=b(null);coordinatorPopupSessionId_$=b(null);newSessionWorkspacePath_$=b("");newSessionLabel_$=b("");isCreating_$=b(!1);showArchived_$=b(!1);selectedPathOption_$=b("");sessionSelected=ye();ctxMenuSession_$=b(null);ctxMenuPos_$=b({x:0,y:0});isRenaming_$=b(!1);renameValue_$=b("");linkCopyState_$=b("idle");ngOnInit(){let e=y.loadProjectFilter();e&&this.projectFilter_$.set(e);let i=y.loadShowArchived();this.showArchived_$.set(i),!this.pm_DS.projectsLoadedOnce_$()&&!this.pm_DS.projectsLoading_$()&&this.pm_DS.loadProjects(),this.peiContext_DS.ensureInitialized().then(()=>{this.ccSession_DS.loadSessions({includeArchived:i||void 0})}),this.scheduledJobs_DS.loadAll(),this.coordinator_DS.loadAllCoordinatorsForManagementPage()}handleSelectSession(e){let i=this.peiContext_DS.activeCcapId_$(),n=i?["/cc-session",i,e]:["/cc-session",e];this.router.navigate(n),this.sessionSelected.emit()}handleOpenCreateDialog(){return R(this,null,function*(){if(this.isCreateDialogOpen_$.set(!0),yield this.newAgentSessionWorkspace_DS.refreshWorkspacePathPickerOptions(),!this.newSessionWorkspacePath_$()){let i=this.newAgentSessionWorkspace_DS.resolveInitialWorkspacePath({lastWorkspacePath:y.loadLastWorkspacePath()});if(i){this.newSessionWorkspacePath_$.set(i);let n=this.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$().some(l=>l.path===i);this.selectedPathOption_$.set(n?i:"custom")}}let e=y.loadLastLabel();e&&this.newSessionLabel_$.set(e)})}handlePathOptionChange(e){this.selectedPathOption_$.set(e),e&&e!=="custom"&&this.newSessionWorkspacePath_$.set(e)}handleCloseCreateDialog(){this.isCreateDialogOpen_$.set(!1),this.newSessionWorkspacePath_$.set(""),this.newSessionLabel_$.set(""),this.selectedPathOption_$.set("")}handleCreateSession(){return R(this,null,function*(){let e=this.newSessionWorkspacePath_$();if(!(!e||this.isCreating_$())){this.isCreating_$.set(!0);try{y.saveLastWorkspacePath(e),y.saveLastLabel(this.newSessionLabel_$());let i=y.loadSessionMode(),n=y.loadSessionEffort(),l=yield this.ccSession_DS.createSession({workspacePath:e,label:this.newSessionLabel_$()||void 0,mode:i||void 0,reasoningEffort:n||void 0});if(this.handleCloseCreateDialog(),l){let p=this.peiContext_DS.activeCcapId_$(),m=p?["/cc-session",p,l]:["/cc-session",l];this.router.navigate(m)}}catch{this.handleCloseCreateDialog()}finally{this.isCreating_$.set(!1)}}})}handleProjectFilterChange(e){this.projectFilter_$.set(e),y.saveProjectFilter(e)}handleToggleShowArchived(){let e=!this.showArchived_$();this.showArchived_$.set(e),y.saveShowArchived(e),this.handleRefresh()}handleToggleArchive(e,i){return R(this,null,function*(){e.stopPropagation();try{yield this.ccSession_DS.setSessionArchived({sessionId:i.sessionId,isArchived:!i.isArchived}),this.handleRefresh()}catch{}})}handleRowContextMenu(e){this.isRenaming_$.set(!1);let i=this.filteredSessions_$().find(n=>n.sessionId===e.id);i&&(this.ctxMenuSession_$.set(i),this.ctxMenuPos_$.set({x:e.event.clientX,y:e.event.clientY}))}handleScheduleIndicatorClick(e){this.schedulePopupSessionId_$.set(e)}handleCloseSchedulePopup(){this.schedulePopupSessionId_$.set(null)}handleCoordinatorIndicatorClick(e){this.coordinatorPopupSessionId_$.set(e)}handleCloseCoordinatorPopup(){this.coordinatorPopupSessionId_$.set(null)}handleCloseCtxMenu(){this.ctxMenuSession_$.set(null),this.isRenaming_$.set(!1),this.renameValue_$.set(""),this.linkCopyState_$.set("idle")}handleCtxCopyLink(){return R(this,null,function*(){let e=this.ctxMenuSession_$();if(!e)return;let i=this.peiContext_DS.activeCcapId_$(),n=i?`/cc-session/${i}/${e.sessionId}`:`/cc-session/${e.sessionId}`,l=`${window.location.origin}${n}`,p=yield this.globalError_CS.copyToClipboard(l);this.linkCopyState_$.set(p.ok?"copied":"failed"),setTimeout(()=>{this.handleCloseCtxMenu()},700)})}handleCtxRenameStart(){let e=this.ctxMenuSession_$();e&&(this.renameValue_$.set(e.label||""),this.isRenaming_$.set(!0),setTimeout(()=>{let i=document.querySelector("#ctxRenameInput");i&&(i.focus(),i.select())},0))}handleCtxRenameConfirm(){return R(this,null,function*(){let e=this.ctxMenuSession_$();if(!e)return;let i=this.renameValue_$().trim();if(i!==(e.label||""))try{yield this.ccSession_DS.updateSessionConfig({sessionId:e.sessionId,label:i})}catch{}this.handleCloseCtxMenu()})}handleCtxToggleArchive(){return R(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.setSessionArchived({sessionId:e.sessionId,isArchived:!e.isArchived}),this.handleRefresh()}catch{}}})}handleCtxTerminate(){return R(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.terminateSession({sessionId:e.sessionId}),this.handleRefresh()}catch{}}})}handleCtxResume(){return R(this,null,function*(){let e=this.ctxMenuSession_$();if(e){this.handleCloseCtxMenu();try{yield this.ccSession_DS.resumeSession({sessionId:e.sessionId}),this.handleRefresh()}catch{}}})}handleRefresh(){this.ccSession_DS.loadSessions({includeArchived:this.showArchived_$()||void 0})}static normalizePath(e){let i=e.trim().toLowerCase().replace(/\\/g,"/");for(;i.endsWith("/")&&i.length>1;)i=i.slice(0,-1);return i}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-dashboard"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],outputs:{sessionSelected:"sessionSelected"},decls:41,vars:24,consts:[["renameInput",""],[1,"p-2","border-b","border-neonDefault"],[1,"flex","items-center","justify-between","p-3","border-b","border-neonDefault"],[1,"text-sm","font-semibold","text-neutral-200"],[1,"flex","gap-1"],["title","Refresh",1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"px-2","py-1","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","hover:shadow-neon-glow-accent","rounded","transition-colors",3,"click"],[1,"p-2","border-b","border-neonDefault","flex","gap-2","items-center"],[1,"flex-1","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1","border","border-neonDefault",3,"ngModelChange","ngModel"],["value",""],[1,"px-2","py-1","text-[10px]","border","rounded","transition-colors","whitespace-nowrap",3,"click","title"],[1,"flex-1","overflow-y-auto"],[1,"p-4","text-center","text-neutral-500","text-sm"],[1,"p-4","text-center","text-red-400","text-sm"],["kind","cc",3,"rows","activeId","hideSearch"],[3,"closed","isOpen","title","maxWidth","closeOnBackdropClick"],[1,"mb-2"],[1,"text-xs","text-neutral-400","block","mb-1"],[1,"w-full","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none","mb-1.5",3,"ngModel"],["type","text","placeholder","/path/to/workspace",1,"w-full","bg-neutral-900","text-neutral-200","text-sm","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"ngModelChange","ngModel"],[1,"mb-3"],["type","text","placeholder","My session",1,"w-full","bg-neutral-900","text-neutral-200","text-sm","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"ngModelChange","ngModel"],[1,"flex","justify-end","gap-2"],[1,"px-3","py-1.5","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click","disabled"],[1,"px-3","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"click","disabled"],[3,"closed","sessionId","isOpen"],[3,"value"],["kind","cc",3,"selected","contextMenu","scheduleIndicatorClicked","coordinatorIndicatorClicked","rows","activeId","hideSearch"],[1,"w-full","bg-neutral-900","text-neutral-300","text-xs","rounded","px-2","py-1.5","border","border-neonDefault","focus:border-neonCyan","focus:outline-none","mb-1.5",3,"ngModelChange","ngModel"],["value","","disabled",""],["value","custom"],[1,"fixed","inset-0","z-40",3,"click"],[1,"fixed","z-50","min-w-[160px]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","py-1","text-xs"],[1,"px-2","py-1.5"],["id","ctxRenameInput","type","text",1,"w-full","bg-neutral-800","text-neutral-200","text-xs","rounded","px-2","py-1","border","border-neonDefault","focus:border-neonCyan","focus:outline-none",3,"input","keydown.enter","keydown.escape","value"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click","disabled"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors",3,"click"],[1,"w-full","text-left","px-3","py-1.5","text-neutral-300","hover:bg-neutral-800","transition-colors"],[1,"border-t","border-neutral-700","my-1"],[1,"w-full","text-left","px-3","py-1.5","text-red-400","hover:bg-red-500/10","transition-colors",3,"click"]],template:function(i,n){if(i&1&&(o(0,"div",1),S(1,"app-s-instance-chip-row-with-info"),s(),o(2,"div",2)(3,"h2",3),d(4,"CC Sessions"),s(),o(5,"div",4)(6,"button",5),x("click",function(){return n.handleRefresh()}),d(7," Refresh "),s(),o(8,"button",6),x("click",function(){return n.handleOpenCreateDialog()}),d(9," + New "),s()()(),o(10,"div",7)(11,"select",8),x("ngModelChange",function(p){return n.handleProjectFilterChange(p)}),o(12,"option",9),d(13,"All projects"),s(),N(14,yn,1,1,null,null,vn),s(),o(16,"button",10),x("click",function(){return n.handleToggleShowArchived()}),d(17),s()(),o(18,"div",11),g(19,Tn,2,0,"div",12)(20,kn,2,0,"div",13)(21,In,1,3,"app-s-session-select",14)(22,$n,2,0,"div",12),s(),o(23,"app-s-modal",15),x("closed",function(){return n.isCreateDialogOpen_$.set(!1)}),o(24,"div",16)(25,"label",17),d(26,"Workspace Path *"),s(),g(27,En,7,1,"select",18),o(28,"input",19),x("ngModelChange",function(p){return n.newSessionWorkspacePath_$.set(p)}),s()(),o(29,"div",20)(30,"label",17),d(31,"Label (optional)"),s(),o(32,"input",21),x("ngModelChange",function(p){return n.newSessionLabel_$.set(p)}),s()(),o(33,"div",22)(34,"button",23),x("click",function(){return n.handleCloseCreateDialog()}),d(35," Cancel "),s(),o(36,"button",24),x("click",function(){return n.handleCreateSession()}),d(37),s()()(),o(38,"app-sch-schedule-popup",25),x("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(39,"app-crd-info-popup",25),x("closed",function(){return n.handleCloseCoordinatorPopup()}),s(),g(40,Fn,4,5)),i&2){let l;a(11),v("ngModel",n.projectFilter_$()),a(3),H(n.pm_DS.projects_$()),a(2),L(n.showArchived_$()?"border-amber-500/60 text-amber-400 bg-amber-500/10 hover:bg-amber-500/20":"border-neonDefault text-neutral-500 hover:text-neutral-300 hover:bg-neutral-700"),v("title",n.showArchived_$()?"Hide archived sessions":"Show archived sessions"),a(),D(" ",n.showArchived_$()?"Archived ON":"Archived"," "),a(2),_(n.ccSession_DS.sessionsLoading_$()?19:-1),a(),_(n.ccSession_DS.sessionsLoadError_$()?20:-1),a(),_(n.sessionRowViews_$().length?21:-1),a(),_(!n.ccSession_DS.sessionsLoading_$()&&!n.sessionRowViews_$().length?22:-1),a(),v("isOpen",n.isCreateDialogOpen_$())("title","New CC Session")("maxWidth","sm")("closeOnBackdropClick",!1),a(4),_(n.newAgentSessionWorkspace_DS.workspacePathPickerOptions_$().length?27:-1),a(),v("ngModel",n.newSessionWorkspacePath_$()),a(4),v("ngModel",n.newSessionLabel_$()),a(2),v("disabled",n.isCreating_$()),a(2),v("disabled",n.isCreating_$()||!n.newSessionWorkspacePath_$()),a(),D(" ",n.isCreating_$()?"Creating...":"Create"," "),a(),v("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),v("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null),a(),_((l=n.ctxMenuSession_$())?40:-1,l)}},dependencies:[gt,St,Ct,ft,xt,ht,Ve,Y,ce,pe,kt],encapsulation:2})}return t})();var je=(()=>{class t{transform(e){switch(e){case"running":return"bg-yellow-500";case"waiting-input":return"bg-green-500";case"starting":return"bg-yellow-500";case"creating":return"bg-yellow-400";case"completed":return"bg-blue-500";case"errored":return"bg-red-500";case"terminated":return"bg-red-700";case"stalled":return"bg-orange-500";default:return"bg-neutral-600"}}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=ie({name:"ccSessionStatusColor",type:t,pure:!0})}return t})();function Bn(t,r){t&1&&S(0,"div",5)}function zn(t,r){if(t&1){let e=T();o(0,"button",14),x("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleMetadata())}),d(1," Info "),s()}if(t&2){let e=c();L(e.detailUi_DS.isMetadataPanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600")}}function Wn(t,r){t&1&&S(0,"span",18)}function Nn(t,r){if(t&1&&(S(0,"span",17),F(1,"ccSessionStatusColor"),g(2,Wn,1,0,"span",18)),t&2){c(2);let e=ke(1);v("ngClass",j(1,3,e.detail.session.status))("title",e.detail.session.status),a(2),_(e.detail.runtime.isLive?2:-1)}}function Hn(t,r){t&1&&(o(0,"span",16),d(1,"Loading\u2026"),s())}function qn(t,r){if(t&1&&(o(0,"span",15),d(1),s(),g(2,Nn,3,5)(3,Hn,2,0,"span",16)),t&2){c();let e=ke(1);v("title",e.title),a(),D(" ",e.title," "),a(),_(e.detail?2:-1),a(),_(e.isLoading&&!e.showActions?3:-1)}}function Kn(t,r){if(t&1){let e=T();o(0,"button",23),x("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleStopExecution())}),d(1),s()}if(t&2){let e=c(2);v("disabled",e.detailUi_DS.isStopping_$()),a(),D(" ",e.detailUi_DS.isStopping_$()?"Stopping\u2026":"Stop"," ")}}function Qn(t,r){if(t&1){let e=T();ge(0),o(1,"div",9)(2,"button",19),x("click",function(){u(e);let n=c();return C(n.detailUi_DS.handleToggleTimeline())}),d(3," Timeline "),s(),o(4,"button",20),x("click",function(){u(e);let n=c();return C(n.handleForkSession())}),d(5),s(),S(6,"span",21),g(7,Kn,2,2,"button",22),s()}if(t&2){let e=c(),n=ke(1).detail;a(2),L(e.detailUi_DS.isTimelinePanelOpen_$()?"border-neonCyan/50 text-neonCyan bg-neonCyan/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(2),v("disabled",e.detailUi_DS.isForking_$()||!n.session.claudeSessionId)("title",e.detailUi_DS.isForking_$()?"Fork in progress\u2026":n.session.claudeSessionId?"Fork conversation into new session":"Cannot fork: no conversation yet"),a(),D(" ",e.detailUi_DS.isForking_$()?"Forking\u2026":"Fork"," "),a(2),_(n.session.status==="running"?7:-1)}}var Ht=(()=>{class t{router=$(se);peiContext_DS=$(re);ccSession_DS=$(W);detailUi_DS=$(K);sidebarWidth_$=b(320);isSidebarOpen_$=b(!0);isResizing_$=b(!1);ccTopBarContext_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();if(!e)return null;let i=this.ccSession_DS.selectedSessionLoading_$(),n=this.ccSession_DS.selectedSession_$(),p=this.ccSession_DS.sessions_$().find(I=>I.sessionId===e),m=n?.session.sessionId===e;return{title:(m?n.session.label||n.session.sessionId:null)??(p?p.label||p.sessionId:e),detail:m?n:null,showActions:m&&!i,isLoading:i}});ngOnInit(){let e=y.loadPanelWidth("sidebar",320);this.sidebarWidth_$.set(Math.max(200,Math.min(600,e))),this.isSidebarOpen_$.set(y.loadPanelOpen("sidebar",!0))}handleSidebarResizeStart(e){let i=e.clientX,n=this.sidebarWidth_$();this.isResizing_$.set(!0),Se.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-i,m=Math.max(200,Math.min(600,n+p));this.sidebarWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),y.savePanelWidth("sidebar",this.sidebarWidth_$())}})}handleToggleSidebar(){this.isSidebarOpen_$.update(e=>!e),y.savePanelOpen("sidebar",this.isSidebarOpen_$())}handleSessionSelectedFromDashboard(){window.innerWidth<640&&this.isSidebarOpen_$.set(!1)}handleForkSession(){return R(this,null,function*(){let e=yield this.detailUi_DS.handleFork();if(e){let i=this.peiContext_DS.activeCcapId_$(),n=i?["/cc-session",i,e]:["/cc-session",e];yield this.router.navigate(n)}})}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-shell"]],hostAttrs:[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],decls:19,vars:14,consts:[[1,"flex","min-h-0","w-full","flex-1","flex-col","overflow-hidden"],["sSessionToolbarLeft","",1,"flex","items-center","gap-1","min-w-0"],[1,"px-2","py-1","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors","flex","items-center","gap-1","shrink-0",3,"click"],["viewBox","0 0 24 24","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","shrink-0","transition-transform","duration-150"],["points","6 9 12 15 18 9"],[1,"w-px","h-4","bg-neutral-700","shrink-0","self-center","mx-0.5"],["type","button",1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"class"],["sSessionToolbarCenter","",1,"flex","flex-wrap","items-center","justify-center","gap-2","min-w-0","max-w-[min(100vw-10rem,48rem)]"],["sSessionToolbarRight","",1,"flex","items-center","gap-1","min-w-0","flex-wrap","justify-end"],[1,"flex","gap-1","shrink-0","items-center","flex-wrap","justify-end"],[3,"sidebarResizeStart","isSidebarOpen","sidebarWidthPx","isResizing"],["sSessionShellSidebar","",1,"flex","flex-col","overflow-hidden","h-full"],[3,"sessionSelected"],["sSessionShellMain","",1,"flex","min-h-0","flex-1","flex-col","overflow-hidden","[&>router-outlet]:contents"],["type","button",1,"px-2","py-1","text-xs","border","rounded","transition-colors","shrink-0",3,"click"],[1,"text-sm","font-semibold","text-neutral-200","truncate","text-center","min-w-0","max-w-[min(240px,35vw)]",3,"title"],[1,"text-[10px]","text-neutral-500","shrink-0"],[1,"w-2","h-2","rounded-full","shrink-0",3,"ngClass","title"],["title","Live",1,"w-2","h-2","rounded-full","bg-green-500","animate-pulse","shrink-0"],[1,"px-2","py-1","text-xs","border","rounded","transition-colors",3,"click"],[1,"px-2","py-1","text-xs","border","border-neutral-700","text-neutral-500","hover:text-neutral-300","hover:border-neutral-600","disabled:opacity-40","rounded","transition-colors",3,"click","disabled","title"],[1,"w-px","bg-neutral-700","mx-0.5","self-stretch","min-h-[1.25rem]"],[1,"px-2","py-1","text-xs","border","border-neonRed/50","text-red-300","hover:bg-red-950/40","disabled:opacity-40","rounded","transition-colors",3,"disabled"],[1,"px-2","py-1","text-xs","border","border-neonRed/50","text-red-300","hover:bg-red-950/40","disabled:opacity-40","rounded","transition-colors",3,"click","disabled"]],template:function(i,n){if(i&1){let l=T();o(0,"div",0),ge(1),o(2,"app-s-session-shell-toolbar")(3,"div",1)(4,"button",2),x("click",function(){return u(l),C(n.handleToggleSidebar())}),P(),o(5,"svg",3),S(6,"polyline",4),s(),d(7," Sessions "),s(),g(8,Bn,1,0,"div",5)(9,zn,2,2,"button",6),s(),O(),o(10,"div",7),g(11,qn,4,4),s(),o(12,"div",8),g(13,Qn,8,6,"div",9),s()(),o(14,"app-s-resizable-session-shell-layout",10),x("sidebarResizeStart",function(m){return u(l),C(n.handleSidebarResizeStart(m))}),o(15,"div",11)(16,"app-ccap-cc-dashboard",12),x("sessionSelected",function(){return u(l),C(n.handleSessionSelectedFromDashboard())}),s()(),o(17,"div",13),S(18,"router-outlet"),s()()()}if(i&2){ue("select-none",n.isResizing_$()),a();let l=ot(n.ccTopBarContext_$());a(4),ue("rotate-90",n.isSidebarOpen_$())("-rotate-90",!n.isSidebarOpen_$()),a(3),_(l?8:-1),a(),_(l&&l.showActions&&l.detail?9:-1),a(2),_(l?11:-1),a(2),_(l&&l.showActions&&l.detail?13:-1),a(),v("isSidebarOpen",n.isSidebarOpen_$())("sidebarWidthPx",n.sidebarWidth_$())("isResizing",n.isResizing_$())}},dependencies:[X,mt,It,$t,jt,je],encapsulation:2})}return t})();var te=Xe(pt());var be=function(t){return t.normal="normal",t.plan="plan",t}(be||{});var _e=function(t){return t.sonnet="sonnet",t.opus="opus",t.haiku="haiku",t}(_e||{});var we=class t{static fromDisplayItem(r){let e=t.mapMessageTypeToKind(r.messageType),i=r.pairedResult?{text:r.pairedResult.text,expandableContent:r.pairedResult.expandableContent,rawData:r.pairedResult.rawData,isError:r.pairedResult.isError}:void 0,n=r.messageType==="tool"&&r.toolName==="Edit"&&!!r.expandableContent;return{listKey:r.listKey,kind:e,bodyText:r.text,toolName:r.toolName,expandableContent:r.expandableContent,pairedResult:i,rawData:r.rawData,subtype:r.subtype,isUserAligned:r.messageType==="prompt",flags:{showCopy:!0,showRawInfo:!0,useEditDiffForExpandable:n}}}static mapMessageTypeToKind(r){switch(r){case"prompt":return U.userPrompt;case"assistant":return U.assistant;case"tool":return U.tool;case"tool-result":return U.toolResult;case"error":return U.error;case"info":return U.info;case"status":return U.status;case"result":return U.result;case"run-intent":return U.runIntent;case"iteration":return U.iteration;case"thinking":return U.thinking;case"status-update":return U.statusUpdate;case"raw":return U.raw;case"tool-group":return U.toolGroup;case"sub-agent-group":return U.subAgentGroup;default:return U.info}}};var Be=(()=>{class t{sanitizer;constructor(e){this.sanitizer=e}transform(e){if(!e)return this.sanitizer.bypassSecurityTrustHtml('<span class="text-neutral-500">{}</span>');try{let i=JSON.stringify(e,null,2),n=this.highlightJson(i);return this.sanitizer.bypassSecurityTrustHtml(n)}catch{return this.sanitizer.bypassSecurityTrustHtml('<span class="text-neutral-500">{}</span>')}}MULTILINE_THRESHOLD=150;highlightJson(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/("(\\u[\da-fA-F]{4}|\\[^u]|[^\\"])*"(\s*:)?|\b(true|false|null)\b|-?\d+(?:\.\d*)?(?:[eE][+-]?\d+)?)/g,n=>/^"/.test(n)?/:$/.test(n)?`<span style="color:#7dd3fc">${n}</span>`:n.length>this.MULTILINE_THRESHOLD&&n.includes("\\n")?this.formatMultilineString(n):`<span style="color:#86efac">${n}</span>`:/true|false/.test(n)?`<span style="color:#fbbf24">${n}</span>`:/null/.test(n)?`<span style="color:#a78bfa">${n}</span>`:`<span style="color:#fb923c">${n}</span>`)}formatMultilineString(e){return'<span style="color:#86efac">"</span><span style="display:block;margin:2px 0;padding:4px 8px;border-left:2px solid rgba(134,239,172,0.25);background:rgba(134,239,172,0.04);border-radius:0 4px 4px 0;color:#86efac;opacity:0.85;white-space:pre-wrap;word-break:break-word;font-size:0.9em;line-height:1.5">'+e.slice(1,-1).replace(/\\n/g,`
3
3
  `).replace(/\\t/g," ").replace(/\\r/g,"").replace(/\\"/g,'"').replace(/\\\\/g,"\\")+'</span><span style="color:#86efac">"</span>'}static \u0275fac=function(i){return new(i||t)(nt(De,16))};static \u0275pipe=ie({name:"ccSessionJsonFormat",type:t,pure:!0})}return t})();var Gn=["chatScroll"],Jn=["sessionInput"],Xn=(t,r)=>r.promptListKey,Je=(t,r)=>r.listKey,Yn=(t,r)=>r.trackKey,Kt=t=>({$implicit:t});function Zn(t,r){if(t&1){let e=T();o(0,"div",14),x("click",function(){u(e);let n=c();return C(n.handleStickyPromptClick())}),o(1,"div",15)(2,"span",16),d(3,"YOU"),s(),o(4,"span",17),d(5),s(),P(),o(6,"svg",18),S(7,"path",19),s()()()}if(t&2){let e=c();a(5),k(e.lastPromptText_$())}}function ei(t,r){if(t&1){let e=T();o(0,"button",34),x("click",function(){u(e);let n=c(3).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",35),d(2,"i"),s()()}}function ti(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-plan-view",36),x("accepted",function(){u(e);let n=c(4);return C(n.handlePlanAccepted())}),s()}if(t&2){let e=c(3).$implicit;v("rawData",e.rawData)}}function ni(t,r){if(t&1&&S(0,"app-s-agent-tool-todo-list",33),t&2){let e=c(3).$implicit;v("rawData",e.rawData)}}function ii(t,r){if(t&1&&(o(0,"div",29),S(1,"span",30),F(2,"sAgentToolIcon"),o(3,"span",31),d(4),s(),g(5,ei,3,0,"button",32),s(),g(6,ti,1,1,"app-s-agent-tool-plan-view",33)(7,ni,1,1,"app-s-agent-tool-todo-list",33)),t&2){let e,i=c(2).$implicit;a(),v("innerHTML",j(2,4,(e=i.toolName)!==null&&e!==void 0?e:""),G),a(3),k(i.toolName==="ExitPlanMode"?"Plan":i.toolName),a(),_(i.rawData?5:-1),a(),_(i.toolName==="ExitPlanMode"?6:7)}}function oi(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-call-card",37),x("toolRawInfoClick",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))})("pairedRawInfoClick",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenPairedResultInfo(n))}),s()}if(t&2){let e,i,n,l,p=c(2).$implicit;v("toolName",(e=p.toolName)!==null&&e!==void 0?e:"")("summaryText",p.text)("toolDescription",(i=p.toolDescription)!==null&&i!==void 0?i:"")("isPathRtl",p.toolName==="Read")("showToolRawInfo",!!p.rawData||!!(p.pairedResult!=null&&p.pairedResult.rawData))("expandableContent",(n=p.expandableContent)!==null&&n!==void 0?n:"")("pairedResult",(l=p.pairedResult)!==null&&l!==void 0?l:null)}}function si(t,r){if(t&1&&(o(0,"div",20)(1,"div",27),g(2,ii,8,6)(3,oi,1,7,"app-s-agent-tool-call-card",28),s()()),t&2){let e=c().$implicit;a(2),_(e.toolName==="TodoWrite"||e.toolName==="ExitPlanMode"?2:3)}}function ai(t,r){if(t&1){let e=T();o(0,"app-s-agent-tool-call-card",45),x("toolRawInfoClick",function(){u(e);let n=c().$implicit,l=c(3);return C(l.handleOpenInfoPopup(n))})("pairedRawInfoClick",function(){u(e);let n=c().$implicit,l=c(3);return C(l.handleOpenPairedResultInfo(n))}),s()}if(t&2){let e,i,n,l,p=c().$implicit;v("toolName",(e=p.toolName)!==null&&e!==void 0?e:"")("summaryText",p.text)("toolDescription",(i=p.toolDescription)!==null&&i!==void 0?i:"")("isPathRtl",p.toolName==="Read")("showToolRawInfo",!!p.rawData||!!(p.pairedResult!=null&&p.pairedResult.rawData))("expandableContent",(n=p.expandableContent)!==null&&n!==void 0?n:"")("pairedResult",(l=p.pairedResult)!==null&&l!==void 0?l:null)}}function ri(t,r){if(t&1&&(o(0,"div",44)(1,"span",46),d(2),s()()),t&2){let e=c().$implicit;a(2),k(e.text)}}function li(t,r){if(t&1&&g(0,ai,1,7,"app-s-agent-tool-call-card",43)(1,ri,3,1,"div",44),t&2){let e=r.$implicit;_(e.messageType==="tool"?0:-1),a(),_(e.messageType==="tool-result"?1:-1)}}function di(t,r){if(t&1&&(o(0,"div",20)(1,"details",38)(2,"summary",39),S(3,"span",30),F(4,"sAgentToolIcon"),o(5,"span",31),d(6),s(),P(),o(7,"svg",40),S(8,"path",41),s()(),O(),o(9,"div",42),N(10,li,2,2,null,null,Je),s()()()),t&2){let e=c().$implicit;a(3),v("innerHTML",j(4,2,e.groupToolName),G),a(3),k(e.text),a(4),H(e.groupItems)}}function ci(t,r){t&1&&(o(0,"span",58),S(1,"span",63),o(2,"span",64),d(3,"running"),s()())}function pi(t,r){if(t&1){let e=T();o(0,"button",65),x("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l.groupItems[0]),C(n.stopPropagation())}),o(1,"span",66),d(2,"i"),s()()}}function _i(t,r){if(t&1){let e=T();o(0,"details",67),x("click",function(n){return u(e),C(n.stopPropagation())}),o(1,"summary",68),P(),o(2,"svg",69),S(3,"path",41),s(),O(),o(4,"span",70),d(5),s()(),o(6,"div",71)(7,"pre",72),d(8),s()()()}if(t&2){let e=c(2).$implicit;a(5),k(e.groupItems[0].pairedResult.text),a(3),k(e.groupItems[0].pairedResult.expandableContent||e.groupItems[0].pairedResult.text)}}function mi(t,r){if(t&1&&He(0,73),t&2){let e=c().$implicit;c(3);let i=fe(2);v("ngTemplateOutlet",i)("ngTemplateOutletContext",qe(2,Kt,e))}}function ui(t,r){if(t&1&&g(0,mi,1,4,"ng-container",73),t&2){let e=r.$index;_(e>0?0:-1)}}function Ci(t,r){if(t&1&&(o(0,"div",21)(1,"details",47)(2,"summary",48),P(),o(3,"svg",49),S(4,"rect",50)(5,"circle",51)(6,"circle",52)(7,"path",53)(8,"path",54),s(),O(),o(9,"span",55),d(10,"Sub-agent"),s(),o(11,"span",56),d(12),s(),o(13,"span",57),d(14),s(),g(15,ci,4,0,"span",58)(16,pi,3,0,"button",59),P(),o(17,"svg",60),S(18,"path",41),s()(),g(19,_i,9,2,"details",61),O(),o(20,"div",62),N(21,ui,1,1,null,null,Je),s()()()),t&2){let e,i=c().$implicit;a(12),k(i.text),a(2),k(((e=i.groupItems==null?null:i.groupItems.length)!==null&&e!==void 0?e:0)>1?i.groupItems.length-1:0),a(),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?-1:15),a(),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].rawData?16:-1),a(3),_(!(i.groupItems==null||i.groupItems[0]==null)&&i.groupItems[0].pairedResult?19:-1),a(2),H(i.groupItems)}}function xi(t,r){if(t&1){let e=T();o(0,"button",78),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",79),d(2,"i"),s()()}}function hi(t,r){if(t&1&&(o(0,"div",22)(1,"div",74),S(2,"span",75),o(3,"span",76),d(4),s(),g(5,xi,3,0,"button",77),s()()),t&2){let e=c().$implicit;a(4),k(e.text),a(),_(e.rawData?5:-1)}}function fi(t,r){t&1&&(o(0,"span",83),d(1,"Run intent: "),s())}function gi(t,r){if(t&1&&(o(0,"div",23)(1,"div",80),S(2,"span",81),o(3,"span",82),g(4,fi,2,0,"span",83),d(5),s()()()),t&2){let e=c().$implicit;a(4),_(e.isLatestMessage?-1:4),a(),D(" ",e.text," ")}}function Si(t,r){if(t&1&&(o(0,"div",20)(1,"div",84),S(2,"span",85),o(3,"span",86),d(4),s()()()),t&2){let e=c().$implicit;a(4),k(e.text)}}function vi(t,r){if(t&1){let e=T();o(0,"button",98),x("click",function(n){u(e);let l=c(2).$implicit;return c().handleOpenInfoPopup(l),C(n.stopPropagation())}),o(1,"span",99),d(2,"i"),s()()}}function bi(t,r){if(t&1&&(o(0,"div",24)(1,"details",87)(2,"summary",88),P(),o(3,"svg",89),S(4,"circle",90)(5,"path",91)(6,"circle",92),s(),O(),o(7,"span",93),d(8,"Thinking"),s(),o(9,"span",94),d(10),s(),g(11,vi,3,0,"button",95),s(),o(12,"div",96)(13,"pre",97),d(14),s()()()()),t&2){let e=c().$implicit;a(10),k(e.text),a(),_(e.rawData?11:-1),a(3),k(e.text)}}function wi(t,r){if(t&1){let e=T();o(0,"button",104),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",105),d(2,"i"),s()()}}function yi(t,r){if(t&1&&(o(0,"div",25)(1,"div",100),S(2,"span",101),o(3,"span",102),d(4),s(),g(5,wi,3,0,"button",103),s()()),t&2){let e=c().$implicit;a(4),k(e.text),a(),_(e.rawData?5:-1)}}function Ti(t,r){if(t&1&&(o(0,"span",110),d(1),s()),t&2){let e=c(2).$implicit;a(),k(e.subtype)}}function ki(t,r){if(t&1){let e=T();o(0,"button",112),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",113),d(2,"i"),s()()}}function Ii(t,r){if(t&1&&(o(0,"div",26)(1,"div",106),P(),o(2,"svg",107),S(3,"path",108),s(),O(),o(4,"span",109),d(5),s(),g(6,Ti,2,1,"span",110)(7,ki,3,0,"button",111),s()()),t&2){let e=c().$implicit;a(5),k(e.text),a(),_(e.subtype?6:-1),a(),_(e.rawData?7:-1)}}function $i(t,r){if(t&1){let e=T();o(0,"button",121),x("click",function(){u(e);let n=c(2).$implicit,l=c();return C(l.handleOpenInfoPopup(n))}),o(1,"span",122),d(2,"i"),s()()}}function Di(t,r){if(t&1&&(S(0,"pre",120),F(1,"ccSessionJsonFormat")),t&2){let e=c(2).$implicit;v("innerHTML",j(1,1,e.rawData),G)}}function Ei(t,r){if(t&1&&(o(0,"div",24)(1,"div",114)(2,"div",115),S(3,"span",116),o(4,"span",117),d(5),s(),o(6,"span",118),d(7,"needs brief"),s(),g(8,$i,3,0,"button",119),s(),g(9,Di,2,3,"pre",120),s()()),t&2){let e=c().$implicit;a(5),k(e.text),a(3),_(e.rawData?8:-1),a(),_(e.rawData?9:-1)}}function Mi(t,r){if(t&1&&g(0,si,4,1,"div",20)(1,di,12,4,"div",20)(2,Ci,23,5,"div",21)(3,hi,6,2,"div",22)(4,gi,6,2,"div",23)(5,Si,5,1,"div",20)(6,bi,15,3,"div",24)(7,yi,6,2,"div",25)(8,Ii,8,3,"div",26)(9,Ei,10,3,"div",24),t&2){let e,i=r.$implicit;_((e=i.messageType)==="tool"?0:e==="tool-group"?1:e==="sub-agent-group"?2:e==="result"?3:e==="run-intent"?4:e==="iteration"?5:e==="thinking"?6:e==="status"?7:e==="status-update"?8:e==="raw"?9:-1)}}function Pi(t,r){t&1&&(o(0,"div",6)(1,"div",123),P(),o(2,"svg",124),S(3,"path",108),s(),O(),o(4,"span",125),d(5,"Loading older messages..."),s()()())}function Ai(t,r){if(t&1){let e=T();o(0,"div",126)(1,"div",128)(2,"app-s-agent-console-message-bubble",129),x("ttsCached",function(n){u(e);let l=c(2);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;me("data-prompt-key",e.promptListKey)("data-prompt-text",e.promptText),a(2),v("view",e.promptBubbleView)}}function Ri(t,r){if(t&1){let e=T();o(0,"div",136)(1,"div",137)(2,"app-s-agent-console-message-bubble",129),x("ttsCached",function(n){u(e);let l=c(4);return C(l.handleTtsCached(n))}),s()()()}if(t&2){let e=c().$implicit;ue("justify-end",e.messageType==="prompt"),a(),L(e.messageType==="prompt"?"w-[85%]":e.messageType==="tool"||e.messageType==="tool-result"?"w-[90%] ml-4":"w-[90%]"),a(),v("view",e.bubbleView)}}function Vi(t,r){if(t&1&&He(0,73),t&2){let e=c().$implicit;c(3);let i=fe(2);v("ngTemplateOutlet",i)("ngTemplateOutletContext",qe(2,Kt,e))}}function Li(t,r){if(t&1&&g(0,Ri,3,5,"div",135)(1,Vi,1,4,"ng-container",73),t&2){let e=r.$implicit;_(e.bubbleView?0:1)}}function Oi(t,r){if(t&1&&(o(0,"details",127)(1,"summary",130),P(),o(2,"svg",131),S(3,"path",41),s(),O(),o(4,"span",132),d(5),s(),S(6,"div",133),s(),o(7,"div",134),N(8,Li,2,1,null,null,Je),s()()),t&2){let e=c().$implicit;a(5),D("",e.items.length," events"),a(3),H(e.items)}}function Fi(t,r){if(t&1&&g(0,Ai,3,3,"div",126)(1,Oi,10,1,"details",127),t&2){let e=r.$implicit;_(e.promptBubbleView?0:-1),a(),_(e.items.length?1:-1)}}function Ui(t,r){t&1&&(o(0,"div",138)(1,"div",140),S(2,"div",141),s(),o(3,"div",142),S(4,"div",143),s(),o(5,"div",140),S(6,"div",144),s(),o(7,"div",145),P(),o(8,"svg",146),S(9,"path",108),s(),O(),o(10,"span",147),d(11,"Loading chat history\u2026"),s()()())}function ji(t,r){t&1&&(o(0,"div",139)(1,"span",148),d(2,"\u{1F4AC}"),s(),o(3,"span",149),d(4,"Send a prompt to start the conversation"),s()())}function Bi(t,r){if(t&1&&g(0,Ui,12,0,"div",138)(1,ji,5,0,"div",139),t&2){let e=c();_(e.ccSession_DS.assembledMessagesLoaded_$()?1:0)}}function zi(t,r){t&1&&(P(),o(0,"svg",153),S(1,"path",154),s(),O(),o(2,"span"),d(3,"Copied!"),s())}function Wi(t,r){t&1&&(P(),o(0,"svg",155),S(1,"path",156),s(),O(),o(2,"span"),d(3,"Copy last 30 events"),s())}function Ni(t,r){t&1&&(P(),o(0,"svg",153),S(1,"path",154),s(),O(),o(2,"span"),d(3,"Copied!"),s())}function Hi(t,r){t&1&&(P(),o(0,"svg",155),S(1,"rect",157)(2,"path",158),s(),O(),o(3,"span"),d(4,"Copy JSON"),s())}function qi(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Primary (message / tool call)"),s(),o(3,"pre",160),d(4),s()()),t&2){let e=c();a(4),k(e.primaryJson)}}function Ki(t,r){if(t&1&&(o(0,"div",161)(1,"div",162),d(2),s(),o(3,"pre",160),d(4),s()()),t&2){let e=r.$implicit,i=c(2);a(2),J(" Part ",e.index+1," / ",i.streamParts.length," "),a(2),k(e.json)}}function Qi(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Stream mirror payloads (each chunk)"),s(),N(3,Ki,5,3,"div",161,Yn),s()),t&2){let e=c();a(3),H(e.streamParts)}}function Gi(t,r){if(t&1&&(o(0,"section")(1,"div",159),d(2,"Paired tool result"),s(),o(3,"pre",160),d(4),s()()),t&2){let e=c();a(4),k(e.pairedJson)}}function Ji(t,r){if(t&1){let e=T();o(0,"div",150)(1,"button",151),x("click",function(){u(e);let n=c();return C(n.handleCopyLast30Events())}),g(2,zi,4,0)(3,Wi,4,0),s(),o(4,"button",151),x("click",function(){u(e);let n=c();return C(n.handleCopyInfoPopup())}),g(5,Ni,4,0)(6,Hi,5,0),s()(),o(7,"div",152),g(8,qi,5,1,"section")(9,Qi,5,0,"section")(10,Gi,5,1,"section"),s()}if(t&2){let e=r,i=c();a(),L(i.isLast30Copied_$()?"bg-green-500/15 border border-green-500/30 text-green-300":"bg-neutral-800 border border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-600"),a(),_(i.isLast30Copied_$()?2:3),a(2),L(i.isInfoCopied_$()?"bg-green-500/15 border border-green-500/30 text-green-300":"bg-neutral-800 border border-neutral-700 text-neutral-400 hover:text-neutral-200 hover:border-neutral-600"),a(),_(i.isInfoCopied_$()?5:6),a(3),_(e.primaryJson?8:-1),a(),_(e.showStreamBreakdown?9:-1),a(),_(e.pairedJson?10:-1)}}var Qt=(()=>{class t{sessionId=Q("");ccSession_DS=$(W);detailUi_DS=$(K);sessionQueue_DS=$(Vt);voiceInputUi_DS=$(wt);ttsCachedKeys_$=b(new Set);handleTtsCached(e){this.ttsCachedKeys_$.update(i=>new Set([...i,e]))}promptInput_$=b("");isAutoScroll_$=b(!0);isSending_$=b(!1);isExecuting_$=A(()=>this.ccSession_DS.selectedSession_$()?.session?.status==="running");selectedMode_$=b(y.loadSessionMode()||be.normal);selectedEffort_$=b(y.loadSessionEffort()||le.high);selectedModel_$=b(y.loadSessionModel()||_e.sonnet);modeOptions=[be.normal,be.plan];effortOptions=[le.none,le.low,le.mid,le.high];modelOptions=[_e.sonnet,_e.opus,_e.haiku];modelName_$=A(()=>{let e=this.ccSession_DS.selectedSession_$();return e?.session?.activeModel||e?.session?.model||""});usage_$=A(()=>this.ccSession_DS.sessionUsage_$());usageText_$=A(()=>{let e=this.usage_$();if(!e.totalTokens)return"";let i=e.totalTokens>1e3?`${(e.totalTokens/1e3).toFixed(1)}k`:String(e.totalTokens),n=e.costUsd>0?` \xB7 $${e.costUsd.toFixed(4)}`:"";return`${i} tokens${n}`});chatTurns_$=A(()=>{let e=this.ccSession_DS.assembledMessages_$();if(e.length>0)return this.buildTurnsFromAssembledMessages(e);if(!this.ccSession_DS.assembledMessagesLoaded_$())return[];let i=this.ccSession_DS.consoleMessages_$(),n=this.isShowSessionStatus(),l=this.isShowAgentUpdates(),p=this.sessionId(),m=this.ttsCachedKeys_$(),w=[],h=null;for(let f of i)if(!(f.type==="status-update"&&!l))if(f.type==="prompt")h={promptText:f.text,promptListKey:f.listKey,promptBubbleView:{listKey:f.listKey,kind:U.userPrompt,bodyText:f.text,timestampIso:f.timestamp,isUserAligned:!0,flags:{showCopy:!0,showRawInfo:!1,useEditDiffForExpandable:!1},tts:f.text.trim().length>0?{messageKey:f.listKey,sessionId:p,role:"user",content:f.text,timestampIso:f.timestamp,hasTtsAudio:m.has(f.listKey)}:void 0,imageDataUrls:f.imageDataUrls},items:[]},w.push(h);else{h||(h={promptText:"",promptListKey:`__no-prompt-${w.length}`,items:[]},w.push(h));let I={listKey:f.listKey,messageType:f.type,text:f.text,isStatus:f.isStatus,expandableContent:f.expandableContent,isLatestMessage:!1,rawData:f.rawData,timestamp:f.timestamp,subtype:f.subtype,parentAgentId:f.parentAgentId};f.type==="tool"&&(I.toolName=this.extractToolNameFromMsg(f),I.toolDescription=this.extractToolDescription(f.rawData)),h.items.push(I)}if(w.length){let f=w[w.length-1];f.items.length&&(f.items[f.items.length-1].isLatestMessage=!0)}if(!n)for(let f of w){let I=-1;for(let M=f.items.length-1;M>=0;M--)if(f.items[M].isStatus){I=M;break}I>=0&&(f.items=f.items.filter((M,z)=>!M.isStatus||z===I))}for(let f of w)f.items=this.pairToolCallsWithResults(f.items);for(let f of w)f.items=this.groupSubAgentItems(f.items);for(let f of w)f.items=this.groupConsecutiveToolItems(f.items);for(let f of w)f.items=f.items.map(I=>{if(!(I.messageType==="assistant"||I.messageType==="error"||I.messageType==="tool-result"||I.messageType==="info"))return I;let z=we.fromDisplayItem(I);return I.messageType==="assistant"&&I.text.trim().length>0&&(z.tts={messageKey:I.listKey,sessionId:p,role:"assistant",content:I.text,timestampIso:I.timestamp??new Date().toISOString(),hasTtsAudio:m.has(I.listKey)}),Ne(We({},I),{bubbleView:z})});return w});stickyPromptInfo_$=b(null);lastPromptText_$=A(()=>this.stickyPromptInfo_$()?.promptText??"");isShowSessionStatus=Q(!1);isShowAgentUpdates=Q(!0);isShowStickyPrompt_$=b(!1);isInfoPopupOpen_$=b(!1);infoPopupBundle_$=b(null);infoPopupTitle_$=b("");isInfoCopied_$=b(!1);isLast30Copied_$=b(!1);chatScrollRef;sessionInputRef;pendingAttachments_$=b([]);previousItemCount=0;constructor(){$e(()=>{let e=this.sessionId();if(e){let i=y.loadPromptDraft(e);this.promptInput_$.set(i),this.sessionQueue_DS.subscribeToSession({sessionId:e,baseRoute:"cc-session"})}},{allowSignalWrites:!0})}ngOnDestroy(){this.sessionQueue_DS.unsubscribe()}ngAfterViewChecked(){let e=this.ccSession_DS.assembledMessages_$(),i=this.ccSession_DS.consoleMessages_$(),n=e.length+i.length;this.isAutoScroll_$()&&n>this.previousItemCount&&this.scrollToBottom(),this.previousItemCount=n}handleSendPrompt(){return R(this,null,function*(){let e=this.promptInput_$().trim(),i=this.pendingAttachments_$();if(!e&&!i.length||this.isSending_$())return;let n=this.sessionId();if(n){this.isSending_$.set(!0),y.clearPromptDraft(n);try{yield this.ccSession_DS.sendPrompt({sessionId:n,content:e,attachments:i.length>0?i:void 0}),this.promptInput_$.set(""),this.sessionInputRef?.clearAttachments()}catch{y.savePromptDraft(n,e)}finally{this.isSending_$.set(!1)}}})}handleAttachmentsChanged(e){this.pendingAttachments_$.set(e)}handlePromptInputChange(e){this.promptInput_$.set(e);let i=this.sessionId();i&&y.savePromptDraft(i,e)}handleQuickCastAction(e){return R(this,null,function*(){let i=e.trim(),n=this.sessionId();if(!(!i||!n||this.isSending_$())){this.isSending_$.set(!0);try{yield this.ccSession_DS.sendPrompt({sessionId:n,content:i})}finally{this.isSending_$.set(!1)}}})}handleVoiceSegment(e){let i=e.text.trim();if(!i.length)return;let n=this.promptInput_$().trim(),l=n.length>0?`${n} ${i}`:i;this.handlePromptInputChange(l),this.voiceInputUi_DS.autoSendAfterVoice_$()&&e.isFinal&&this.handleSendPrompt()}handleRestartRunnerClicked(){let e=this.sessionId().trim();e&&this.ccSession_DS.restartRunner({sessionId:e})}handlePlanAccepted(){let e=this.sessionId();e&&this.ccSession_DS.sendPrompt({sessionId:e,content:"plan approved, proceed"}).catch(i=>{te.DyFM_Log.error("[CCAP] cc-console plan-accept send",i)})}handleKeydown(e){e.key==="Enter"&&!e.shiftKey&&(e.preventDefault(),this.handleSendPrompt())}handleSelectMode(e){this.selectedMode_$.set(e),y.saveSessionMode(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,mode:e}).catch(n=>{te.DyFM_Log.error("[CCAP] cc-session-console config-update mode",n)})}handleSelectEffort(e){this.selectedEffort_$.set(e),y.saveSessionEffort(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,reasoningEffort:e}).catch(n=>{te.DyFM_Log.error("[CCAP] cc-session-console config-update effort",n)})}handleSelectModel(e){this.selectedModel_$.set(e),y.saveSessionModel(e);let i=this.sessionId();i&&this.ccSession_DS.updateSessionConfig({sessionId:i,model:e}).catch(n=>{te.DyFM_Log.error("[CCAP] cc-session-console config-update model",n)})}handleChatScroll(){let e=this.chatScrollRef?.nativeElement;if(!e)return;this.updateStickyPrompt(e);let i=e.scrollHeight-e.scrollTop-e.clientHeight<60;this.isAutoScroll_$.set(i),e.scrollTop<40&&this.ccSession_DS.assembledMessagesHasMore_$()&&this.loadOlderMessages(e)}updateStickyPrompt(e){if(!(e.scrollTop>80)){this.isShowStickyPrompt_$.set(!1),this.stickyPromptInfo_$.set(null);return}let l=e.getBoundingClientRect().top+50,p=e.querySelectorAll("[data-prompt-key]"),m=this.isShowStickyPrompt_$(),w=l-8,h=l+24,f=null;for(let I=p.length-1;I>=0;I--){let M=p[I],z=M.getBoundingClientRect(),ne=m?h:w;if(z.bottom<ne){let Z=M.getAttribute("data-prompt-key")??"",ee=M.getAttribute("data-prompt-text")??"";Z&&ee&&(f={promptListKey:Z,promptText:ee});break}}this.stickyPromptInfo_$.set(f),this.isShowStickyPrompt_$.set(!!f)}handleStickyPromptClick(){let e=this.stickyPromptInfo_$();if(!e)return;let i=this.chatScrollRef?.nativeElement;if(!i)return;let n=i.querySelector(`[data-prompt-key="${e.promptListKey}"]`);if(!n)return;let l=i.getBoundingClientRect(),p=n.getBoundingClientRect(),m=58;i.scrollTop+=p.top-l.top-m}loadOlderMessages(e){return R(this,null,function*(){let i=this.sessionId();if(!i)return;let n=e.scrollHeight;yield this.ccSession_DS.loadOlderAssembledMessages({sessionId:i}),requestAnimationFrame(()=>{let l=e.scrollHeight;e.scrollTop=l-n,requestAnimationFrame(()=>{this.updateStickyPrompt(e)})})})}handleOpenInfoPopup(e){Ge.ccItemHasAnyRaw(e)&&(this.infoPopupTitle_$.set(e.messageType),this.infoPopupBundle_$.set(Ge.buildForCcConsoleItem(e)),this.isInfoPopupOpen_$.set(!0))}handleOpenPairedResultInfo(e){this.handleOpenInfoPopup(e)}handleCloseInfoPopup(){this.isInfoPopupOpen_$.set(!1),this.infoPopupBundle_$.set(null),this.isInfoCopied_$.set(!1),this.isLast30Copied_$.set(!1)}handleCopyInfoPopup(){let e=this.infoPopupBundle_$();e&&navigator.clipboard.writeText(e.copyJsonString).then(()=>{this.isInfoCopied_$.set(!0),setTimeout(()=>{this.isInfoCopied_$.set(!1)},2e3)}).catch(i=>{te.DyFM_Log.error("[CCAP] cc-session-console clipboard-copy",i)})}handleCopyLast30Events(){let i=this.ccSession_DS.assembledMessages_$().slice(-30),n=JSON.stringify(i,null,2);navigator.clipboard.writeText(n).then(()=>{this.isLast30Copied_$.set(!0),setTimeout(()=>{this.isLast30Copied_$.set(!1)},2e3)}).catch(l=>{te.DyFM_Log.error("[CCAP] cc-session-console clipboard-copy-last30",l)})}pairToolCallsWithResults(e){let i=new Map;for(let l=0;l<e.length;l++){let p=e[l];if(p.messageType==="tool"&&p.rawData){let m=typeof p.rawData.id=="string"?p.rawData.id:"";m&&i.set(m,l)}}if(!i.size)return e;let n=new Set;for(let l=0;l<e.length;l++){let p=e[l];if(p.messageType==="tool-result"&&p.rawData){let m=typeof p.rawData.tool_use_id=="string"?p.rawData.tool_use_id:"",w=m?i.get(m):void 0;w!==void 0&&(e[w].pairedResult={text:p.text,expandableContent:p.expandableContent,rawData:p.rawData},n.add(l))}}return n.size?e.filter((l,p)=>!n.has(p)):e}extractToolNameFromMsg(e){if(e.rawData){let n=e.rawData.name??e.rawData.tool_name??e.rawData.last_tool_name;if(typeof n=="string")return n}let i=e.text.indexOf(":");return i>0?e.text.substring(0,i).trim():e.text.trim()}extractToolDescription(e){if(!e)return;let i=e.input;if(!i||typeof i!="object")return;let n=i.description;return typeof n=="string"?n:void 0}extractToolName(e){if(e.toolName)return e.toolName;if(e.rawData){let n=e.rawData.name??e.rawData.tool_name??e.rawData.last_tool_name;if(typeof n=="string")return n}let i=e.text.indexOf(":");return i>0?e.text.substring(0,i).trim():e.text.trim()}groupSubAgentItems(e){let i=new Map;for(let m=0;m<e.length;m++){let w=e[m];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let h=typeof w.rawData.id=="string"?w.rawData.id:"";h&&i.set(h,{item:w,index:m})}}if(!i.size)return e;let n=new Map,l=new Set;for(let m=0;m<e.length;m++){let w=e[m];if(w.parentAgentId&&(l.add(m),i.has(w.parentAgentId))){let h=n.get(w.parentAgentId)??[];h.push(w),n.set(w.parentAgentId,h)}}let p=[];for(let m=0;m<e.length;m++){if(l.has(m))continue;let w=e[m];if(w.messageType==="tool"&&w.toolName==="Agent"&&w.rawData){let h=typeof w.rawData.id=="string"?w.rawData.id:"",f=n.get(h)??[],I=[w,...f],M=w.rawData?.input,z=M&&typeof M=="object"&&typeof M.subagent_type=="string"?M.subagent_type:"",ne=M&&typeof M=="object"&&typeof M.description=="string"?M.description:"",Z=z?`${z}: ${ne||"..."}`:ne||"Sub-agent",ee=this.groupConsecutiveToolItems(I);p.push({listKey:w.listKey,messageType:"sub-agent-group",text:Z,isStatus:!1,isLatestMessage:!1,groupItems:ee,groupToolName:z||"Agent"})}else p.push(w)}return p}buildTurnsFromAssembledMessages(e){let i=this.isShowAgentUpdates(),n=this.isShowSessionStatus(),l=this.sessionId(),p=this.ttsCachedKeys_$(),m=[],w=null;for(let h of e){let f=h.messageRole==="status-update"&&h.subtype==="task_progress"&&!!h.rawData?.last_tool_name;if(!(h.messageRole==="status-update"&&!i&&!f))if(h.messageRole==="user"&&h.isUserAligned===!0)w={promptText:h.bodyText,promptListKey:h.messageKey,promptBubbleView:{listKey:h.messageKey,kind:U.userPrompt,bodyText:h.bodyText,timestampIso:h.timestamp,isUserAligned:!0,rawData:h.rawData,flags:{showCopy:!0,showRawInfo:!!h.rawData,useEditDiffForExpandable:!1},tts:h.bodyText.trim().length>0?{messageKey:h.messageKey,sessionId:l,role:"user",content:h.bodyText,timestampIso:h.timestamp,hasTtsAudio:p.has(h.messageKey)}:void 0},items:[]},m.push(w);else{w||(w={promptText:"",promptListKey:`__no-prompt-${m.length}`,items:[]},m.push(w));let I=h.rawData&&typeof h.rawData.last_tool_name=="string"?h.rawData.last_tool_name:"",M=h.messageRole==="status-update"&&h.subtype==="task_progress"&&!!I,z=M?"tool":h.messageRole,ne=z==="status"||z==="status-update",Z=t.mapAssembledRoleToMessageType(z),ee={listKey:h.messageKey,messageType:Z,text:M?`${I}: ${h.bodyText}`:h.bodyText,isStatus:ne,expandableContent:h.expandableContent,isLatestMessage:!1,rawData:h.rawData,timestamp:h.timestamp,subtype:h.subtype,parentAgentId:h.parentAgentId,toolName:h.toolName||(M?I:void 0),toolDescription:Z==="tool"?this.extractToolDescription(h.rawData):void 0};h.toolResult&&(ee.pairedResult={text:h.toolResult.text,expandableContent:h.toolResult.expandableContent,rawData:h.toolResult.rawData,isError:h.toolResult.isError}),w.items.push(ee)}}if(m.length){let h=m[m.length-1];h.items.length&&(h.items[h.items.length-1].isLatestMessage=!0)}if(!n)for(let h of m){let f=-1;for(let I=h.items.length-1;I>=0;I--)if(h.items[I].isStatus){f=I;break}f>=0&&(h.items=h.items.filter((I,M)=>!I.isStatus||M===f))}for(let h of m)h.items=this.groupSubAgentItems(h.items);for(let h of m)h.items=this.groupConsecutiveToolItems(h.items);for(let h of m)h.items=h.items.map(f=>{if(!(f.messageType==="assistant"||f.messageType==="error"||f.messageType==="tool-result"||f.messageType==="info"))return f;let M=we.fromDisplayItem(f);return f.messageType==="assistant"&&f.text.trim().length>0&&(M.tts={messageKey:f.listKey,sessionId:l,role:"assistant",content:f.text,timestampIso:f.timestamp??new Date().toISOString(),hasTtsAudio:p.has(f.listKey)}),Ne(We({},f),{bubbleView:M})});return m}groupConsecutiveToolItems(e){let i=[],n=[],l="",p=()=>{if(!n.length)return;let m=n.filter(w=>w.messageType==="tool").length;m>=2?i.push({listKey:n[0].listKey,messageType:"tool-group",text:`${l} \xD7 ${m}`,isStatus:!1,isLatestMessage:!1,groupItems:n,groupToolName:l}):i.push(...n),n=[],l=""};for(let m of e){if(m.messageType==="tool"){let w=this.extractToolName(m);l&&l!==w&&p(),l=w,n.push(m);continue}if(m.messageType==="tool-result"&&n.length){n.push(m);continue}p(),i.push(m)}return p(),i}static mapAssembledRoleToMessageType(e){switch(e){case"user":return"prompt";case"assistant":return"assistant";case"tool":return"tool";case"tool-result":return"tool-result";case"status":return"status";case"error":return"error";case"info":return"info";case"result":return"result";case"thinking":return"thinking";case"status-update":return"status-update";default:return"info"}}scrollToBottom(){let e=this.chatScrollRef?.nativeElement;e&&(e.scrollTop=e.scrollHeight)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-console"]],viewQuery:function(i,n){if(i&1&&(Ce(Gn,5),Ce(Jn,5)),i&2){let l;xe(l=he())&&(n.chatScrollRef=l.first),xe(l=he())&&(n.sessionInputRef=l.first)}},hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],inputs:{sessionId:[1,"sessionId"],isShowSessionStatus:[1,"isShowSessionStatus"],isShowAgentUpdates:[1,"isShowAgentUpdates"]},decls:20,vars:28,consts:[["itemRenderer",""],["chatScroll",""],["sessionInput",""],[1,"sticky","top-0","z-10","px-4","py-2","bg-ccapBg/95","backdrop-blur-sm","border-b","border-neonCyan/20","shrink-0","cursor-pointer","hover:bg-ccapBg/80","transition-colors","group/sticky"],[1,"relative","flex-1","flex","flex-col","min-h-0"],[1,"flex-1","overflow-y-auto","min-h-0","px-3","py-3",3,"scroll"],[1,"flex","justify-center","py-3"],[3,"sessionId"],[3,"actionSelected"],[3,"restartRunnerClicked","sessionId","showRestartRunner"],[1,"absolute","bottom-4","right-4","z-30","pointer-events-auto"],[3,"transcriptSegmentReady","compactLayout"],["placeholder","Type a message... (Enter to send)",3,"draftTextChange","attachmentsChanged","sendRequested","queueRequested","stopRequested","modeChanged","modelChanged","effortChanged","queueEditStart","queueEditTextChange","queueEditSave","queueEditCancel","queueRemoveItem","queueSendNow","queueMoveUp","queueMoveDown","draftText","isExecuting","isSending","isStopping","enableAttachments","modeOptions","selectedMode","modelOptions","selectedModel","effortOptions","selectedEffort","usageText","textareaRows","queueItems","isQueueLocked","editingQueueItemId","editingQueueText"],["maxWidth","4xl","headerBorderClass","border-neonCyan/30",3,"closed","isOpen","title"],[1,"sticky","top-0","z-10","px-4","py-2","bg-ccapBg/95","backdrop-blur-sm","border-b","border-neonCyan/20","shrink-0","cursor-pointer","hover:bg-ccapBg/80","transition-colors","group/sticky",3,"click"],[1,"flex","items-start","gap-2"],[1,"text-[10px]","text-neonCyan/70","font-medium","mt-0.5","shrink-0"],[1,"text-xs","text-neonCyan/90","line-clamp-2","leading-relaxed","group-hover/sticky:text-neonCyan"],["viewBox","0 0 12 12","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3","h-3","text-neonCyan/40","shrink-0","mt-0.5","group-hover/sticky:text-neonCyan/70","transition-colors"],["d","M6 9V3M3 5.5L6 3l3 2.5"],[1,"flex","justify-start","mb-1.5"],[1,"mb-2"],[1,"flex","justify-start","mb-2","group/msg"],[1,"flex","justify-start","mb-2"],[1,"flex","justify-start","mb-1.5","group/msg"],[1,"flex","justify-center","mb-1.5"],[1,"flex","justify-center","mb-1","group/msg"],[1,"bg-orange-500/5","border","border-orange-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],["layout","full","density","comfortable",3,"toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","border-b","border-orange-500/10"],[1,"text-orange-400","shrink-0","flex","items-center",3,"innerHTML"],[1,"text-[11px]","text-orange-300/90","font-medium"],[1,"ml-auto","shrink-0","w-4","h-4","rounded-full","bg-orange-500/20","border","border-orange-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-orange-500/40"],[3,"rawData"],[1,"ml-auto","shrink-0","w-4","h-4","rounded-full","bg-orange-500/20","border","border-orange-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-orange-500/40",3,"click"],[1,"text-[8px]","text-orange-300","font-bold","leading-none"],[3,"accepted","rawData"],["layout","full","density","comfortable",3,"toolRawInfoClick","pairedRawInfoClick","toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],["open","",1,"bg-orange-500/5","border","border-orange-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","cursor-pointer","select-none","hover:bg-orange-500/8","transition-colors"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-orange-400/50","ml-1","transition-transform","[details[open]>&]:rotate-90"],["d","M4.5 2.5l4 3.5-4 3.5","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round"],[1,"px-2","pb-1.5","pt-0.5","space-y-0.5"],["layout","nested","density","compact",3,"toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"pl-5","mb-0.5"],["layout","nested","density","compact",3,"toolRawInfoClick","pairedRawInfoClick","toolName","summaryText","toolDescription","isPathRtl","showToolRawInfo","expandableContent","pairedResult"],[1,"text-[10px]","text-neutral-500","line-clamp-1"],[1,"border","border-indigo-500/20","rounded-lg","overflow-hidden","bg-indigo-500/3"],[1,"flex","items-center","gap-1.5","px-2.5","py-1.5","cursor-pointer","select-none","hover:bg-indigo-500/8","transition-colors","list-none","[&::-webkit-details-marker]:hidden","group/sah"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-indigo-400","shrink-0"],["x","3","y","5","width","10","height","8","rx","2"],["cx","6","cy","9","r","1"],["cx","10","cy","9","r","1"],["d","M8 2v3"],["d","M6 2h4"],[1,"text-[10px]","text-indigo-400/60","font-medium","uppercase","tracking-wider","shrink-0"],[1,"text-[11px]","text-indigo-300/90","font-medium","truncate"],[1,"text-[9px]","text-indigo-400/40","shrink-0"],["title","Sub-agent in progress \u2014 m\xE9g nincs eredm\xE9ny",1,"flex","items-center","gap-1","text-[10px]","text-amber-300/90","shrink-0"],[1,"shrink-0","w-4","h-4","rounded-full","bg-indigo-500/20","border","border-indigo-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-indigo-500/40"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-indigo-400/40","ml-auto","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"border-t","border-indigo-500/10"],[1,"px-2","pb-2","pt-1","space-y-0.5","border-t","border-indigo-500/10"],["aria-hidden","true",1,"inline-block","w-2","h-2","animate-spin","rounded-full","border","border-amber-400/60","border-t-amber-200"],[1,"uppercase","tracking-wider"],[1,"shrink-0","w-4","h-4","rounded-full","bg-indigo-500/20","border","border-indigo-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-indigo-500/40",3,"click"],[1,"text-[8px]","text-indigo-300","font-bold","leading-none"],[1,"border-t","border-indigo-500/10",3,"click"],[1,"flex","items-center","gap-1","px-2.5","py-1","bg-indigo-500/5","cursor-pointer","select-none","hover:bg-indigo-500/8","transition-colors","list-none","[&::-webkit-details-marker]:hidden"],["viewBox","0 0 12 12","fill","none",1,"w-2.5","h-2.5","text-indigo-400/40","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"text-[10px]","text-indigo-300/40","truncate","leading-relaxed"],[1,"px-2.5","py-1.5","bg-indigo-500/5","border-t","border-indigo-500/8"],[1,"text-[10px]","text-indigo-200/40","whitespace-pre-wrap","break-words","max-h-[200px]","overflow-y-auto","overflow-x-auto","leading-relaxed"],[3,"ngTemplateOutlet","ngTemplateOutletContext"],[1,"inline-flex","items-center","gap-1.5","bg-green-500/8","border","border-green-500/20","rounded-lg","px-2.5","py-1"],[1,"w-1.5","h-1.5","rounded-full","bg-green-400","shrink-0"],[1,"text-[11px]","text-green-300/90","break-words","min-w-0"],[1,"ml-1","w-4","h-4","rounded-full","bg-green-500/20","border","border-green-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-green-500/40"],[1,"ml-1","w-4","h-4","rounded-full","bg-green-500/20","border","border-green-500/30","flex","items-center","justify-center","cursor-pointer","hover:bg-green-500/40",3,"click"],[1,"text-[8px]","text-green-300","font-bold","leading-none"],[1,"inline-flex","items-start","gap-1.5","bg-blue-500/8","border","border-blue-500/20","rounded-lg","px-2.5","py-1.5","max-w-[90%]"],[1,"w-1.5","h-1.5","rounded-full","bg-blue-400","shrink-0","mt-0.5"],[1,"text-[11px]","text-blue-300/90","leading-relaxed","min-w-0","break-words"],[1,"text-blue-400/60","font-medium"],[1,"inline-flex","items-center","gap-1.5","bg-violet-500/8","border","border-violet-500/20","rounded-lg","px-2.5","py-1"],[1,"w-1.5","h-1.5","rounded-full","bg-violet-400","shrink-0"],[1,"text-[11px]","text-violet-300/90","truncate","max-w-[80%]"],[1,"bg-sky-500/5","border","border-sky-500/15","rounded-lg","max-w-[90%]","overflow-hidden"],[1,"flex","items-center","gap-1.5","px-2.5","py-1","cursor-pointer","select-none","hover:bg-sky-500/8","transition-colors"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","text-sky-400","shrink-0"],["cx","8","cy","8","r","6"],["d","M6 6.5a2 2 0 0 1 3.5 1.5c0 1-1.5 1.5-1.5 1.5"],["cx","8","cy","12","r","0.5","fill","currentColor"],[1,"text-[11px]","text-sky-300/80","font-medium"],[1,"text-[10px]","text-sky-400/40","ml-1","truncate","min-w-0"],[1,"ml-auto","shrink-0","w-3.5","h-3.5","rounded-full","bg-sky-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-sky-500/30"],[1,"px-2.5","pb-2","pt-1"],[1,"text-[10px]","text-sky-200/60","whitespace-pre-wrap","break-words","max-h-[200px]","overflow-y-auto","overflow-x-auto","leading-relaxed"],[1,"ml-auto","shrink-0","w-3.5","h-3.5","rounded-full","bg-sky-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-sky-500/30",3,"click"],[1,"text-[7px]","text-sky-300/60","font-bold","leading-none"],[1,"inline-flex","items-center","gap-1.5","bg-neonPurple/8","border","border-neonPurple/20","rounded-full","px-3","py-0.5"],[1,"w-1","h-1","rounded-full","bg-neonPurple","animate-pulse","shrink-0"],[1,"text-[10px]","text-neonPurple/80","truncate"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-neonPurple/15","flex","items-center","justify-center","cursor-pointer","hover:bg-neonPurple/30"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-neonPurple/15","flex","items-center","justify-center","cursor-pointer","hover:bg-neonPurple/30",3,"click"],[1,"text-[7px]","text-neonPurple/60","font-bold","leading-none"],[1,"inline-flex","items-center","gap-1.5","bg-teal-500/6","border","border-teal-500/15","rounded-full","px-3","py-0.5","max-w-[85%]"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-teal-400/70","shrink-0","animate-spin"],["d","M8 2a6 6 0 0 1 6 6","stroke-linecap","round"],[1,"text-[10px]","text-teal-300/70","truncate"],[1,"text-[8px]","text-teal-400/40","shrink-0"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-teal-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-teal-500/30"],[1,"shrink-0","w-3.5","h-3.5","rounded-full","bg-teal-500/15","flex","items-center","justify-center","cursor-pointer","hover:bg-teal-500/30",3,"click"],[1,"text-[7px]","text-teal-300/60","font-bold","leading-none"],[1,"bg-neutral-800/60","border","border-amber-500/15","rounded-lg","px-2.5","py-1.5","max-w-[85%]"],[1,"flex","items-center","gap-1.5","mb-1"],[1,"w-1.5","h-1.5","rounded-full","bg-amber-400","shrink-0"],[1,"text-[10px]","text-neutral-400","font-medium","uppercase","tracking-wider"],[1,"text-[8px]","text-amber-500/60","italic","ml-1"],[1,"ml-auto","w-4","h-4","rounded-full","bg-neutral-700/80","border","border-neutral-600/50","flex","items-center","justify-center","cursor-pointer","hover:bg-neutral-600"],[1,"text-[10px]","text-neutral-500","whitespace-pre-wrap","break-words","max-h-[120px]","overflow-y-auto","overflow-x-auto","leading-relaxed",3,"innerHTML"],[1,"ml-auto","w-4","h-4","rounded-full","bg-neutral-700/80","border","border-neutral-600/50","flex","items-center","justify-center","cursor-pointer","hover:bg-neutral-600",3,"click"],[1,"text-[8px]","text-neutral-300","font-bold","leading-none"],[1,"inline-flex","items-center","gap-2","px-3","py-1.5","rounded-full","bg-neutral-800/60","border","border-neutral-700/50"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3.5","h-3.5","text-neonCyan/70","animate-spin"],[1,"text-[11px]","text-neutral-400"],[1,"flex","justify-end","mb-3"],["open","",1,"mb-3"],[1,"max-w-[85%]","min-w-0"],[3,"ttsCached","view"],[1,"flex","items-center","gap-1.5","mb-1.5","cursor-pointer","select-none","list-none","[&::-webkit-details-marker]:hidden","group/sum"],["viewBox","0 0 12 12","fill","none",1,"w-3","h-3","text-neutral-600","shrink-0","transition-transform","[[open]>&]:rotate-90"],[1,"text-[10px]","text-neutral-600","group-hover/sum:text-neutral-400","transition-colors"],[1,"flex-1","h-px","bg-neutral-800","ml-1"],[1,"pl-1"],[1,"flex","mb-2","w-full","min-w-0",3,"justify-end"],[1,"flex","mb-2","w-full","min-w-0"],[1,"min-w-0"],["aria-label","Chat history bet\xF6lt\xE9se folyamatban",1,"flex","flex-col","gap-3","px-2","py-4"],[1,"flex","flex-col","items-center","justify-center","h-full","text-neutral-500","gap-2"],[1,"flex","justify-end"],[1,"w-[60%]","max-w-[420px]","h-12","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"flex","justify-start"],[1,"w-[75%]","max-w-[520px]","h-20","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"w-[55%]","max-w-[380px]","h-10","rounded-lg","bg-neutral-800/50","animate-pulse"],[1,"flex","items-center","justify-center","gap-2","mt-2"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-neonCyan/70","animate-spin"],[1,"text-[10px]","text-neutral-500"],[1,"text-2xl"],[1,"text-xs"],[1,"flex","justify-end","gap-2","mb-2"],[1,"inline-flex","items-center","gap-1.5","px-2.5","py-1","rounded-md","text-[11px]","transition-colors","cursor-pointer",3,"click"],[1,"space-y-4","max-h-[60vh]","overflow-y-auto","p-1"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M3 8.5l3 3 7-7"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5"],["d","M2 4h12M2 8h12M2 12h8"],["x","5","y","5","width","9","height","9","rx","1.5"],["d","M3 11V3a1.5 1.5 0 0 1 1.5-1.5H11"],[1,"text-[9px]","text-neutral-500","uppercase","tracking-wide","mb-1"],[1,"text-xs","leading-relaxed","whitespace-pre-wrap","break-words","overflow-x-auto","font-mono","text-neutral-300"],[1,"mb-3","last:mb-0"],[1,"text-[8px]","text-neutral-600","mb-0.5"]],template:function(i,n){if(i&1){let l=T();g(0,Zn,8,1,"div",3)(1,Mi,10,1,"ng-template",null,0,rt),o(3,"div",4)(4,"div",5,1),x("scroll",function(){return u(l),C(n.handleChatScroll())}),g(6,Pi,6,0,"div",6),N(7,Fi,2,2,null,null,Xn),g(9,Bi,2,1),s(),S(10,"app-s-session-schedule-overlay",7),o(11,"app-s-session-quickcast-overlay",8),x("actionSelected",function(m){return u(l),C(n.handleQuickCastAction(m))}),s(),S(12,"app-s-session-coordinator-overlay",7),o(13,"app-s-session-quick-settings-overlay",9),x("restartRunnerClicked",function(){return u(l),C(n.handleRestartRunnerClicked())}),s(),o(14,"div",10)(15,"app-ccap-voice-record-button",11),x("transcriptSegmentReady",function(m){return u(l),C(n.handleVoiceSegment(m))}),s()()(),o(16,"app-s-session-input",12,2),x("draftTextChange",function(m){return u(l),C(n.handlePromptInputChange(m))})("attachmentsChanged",function(m){return u(l),C(n.handleAttachmentsChanged(m))})("sendRequested",function(){return u(l),C(n.handleSendPrompt())})("queueRequested",function(){return u(l),C(n.handleSendPrompt())})("stopRequested",function(){return u(l),C(n.detailUi_DS.handleStopExecution())})("modeChanged",function(m){return u(l),C(n.handleSelectMode(m))})("modelChanged",function(m){return u(l),C(n.handleSelectModel(m))})("effortChanged",function(m){return u(l),C(n.handleSelectEffort(m))})("queueEditStart",function(m){return u(l),C(n.sessionQueue_DS.startEditing(m))})("queueEditTextChange",function(m){return u(l),C(n.sessionQueue_DS.editingText_$.set(m))})("queueEditSave",function(){return u(l),C(n.sessionQueue_DS.saveEdit())})("queueEditCancel",function(){return u(l),C(n.sessionQueue_DS.cancelEdit())})("queueRemoveItem",function(m){return u(l),C(n.sessionQueue_DS.removeItem(m))})("queueSendNow",function(m){return u(l),C(n.sessionQueue_DS.sendNow(m))})("queueMoveUp",function(m){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:m,direction:"up"}))})("queueMoveDown",function(m){return u(l),C(n.sessionQueue_DS.reorderItem({queueItemId:m,direction:"down"}))}),s(),o(18,"app-s-modal",13),x("closed",function(){return u(l),C(n.handleCloseInfoPopup())}),g(19,Ji,11,9),s()}if(i&2){let l;_(n.isShowStickyPrompt_$()?0:-1),a(6),_(n.ccSession_DS.isLoadingOlderMessages_$()?6:-1),a(),H(n.chatTurns_$()),a(2),_(n.chatTurns_$().length?-1:9),a(),v("sessionId",n.sessionId()),a(2),v("sessionId",n.sessionId()),a(),v("sessionId",n.sessionId())("showRestartRunner",!0),a(2),v("compactLayout",!0),a(),v("draftText",n.promptInput_$())("isExecuting",n.isExecuting_$())("isSending",n.isSending_$())("isStopping",n.detailUi_DS.isStopping_$())("enableAttachments",!0)("modeOptions",n.modeOptions)("selectedMode",n.selectedMode_$())("modelOptions",n.modelOptions)("selectedModel",n.selectedModel_$())("effortOptions",n.effortOptions)("selectedEffort",n.selectedEffort_$())("usageText",n.usageText_$())("textareaRows",2)("queueItems",n.sessionQueue_DS.items_$())("isQueueLocked",n.sessionQueue_DS.isLocked_$())("editingQueueItemId",n.sessionQueue_DS.editingItemId_$())("editingQueueText",n.sessionQueue_DS.editingText_$()),a(2),v("isOpen",n.isInfoPopupOpen_$())("title","Event details \u2014 "+n.infoPopupTitle_$()),a(),_((l=n.infoPopupBundle_$())?19:-1,l)}},dependencies:[dt,Y,Ee,Oe,Ue,Lt,Ot,Le,Ft,Et,Mt,At,Pt,Be],encapsulation:2})}return t})();var Gt=(()=>{class t{transform(e){switch(e){case"status-change":return"bg-purple-600";case"prompt-sent":return"bg-blue-600";case"response-chunk":return"bg-green-600";case"response-complete":return"bg-green-500";case"tool-call-start":return"bg-orange-500";case"tool-call-end":return"bg-orange-400";case"stdout-line":return"bg-neutral-600";case"stderr-line":return"bg-red-500";case"error":return"bg-red-600";case"file-operation":return"bg-cyan-600";case"shell-command":return"bg-yellow-600";case"session-init":return"bg-blue-500";case"config-mismatch":return"bg-amber-600";case"cli-args-record":return"bg-slate-500";case"usage-update":return"bg-teal-600";case"config-change":return"bg-indigo-500";case"runner-overflow":return"bg-red-700";case"interrupted-prompt":return"bg-amber-500";case"cli-chunk":return"bg-neutral-500";default:return"bg-neutral-600"}}static \u0275fac=function(i){return new(i||t)};static \u0275pipe=ie({name:"ccSessionEventTypeColor",type:t,pure:!0})}return t})();var to=["eventList"],no=(t,r)=>r.sequence;function io(t,r){t&1&&(o(0,"span",14),d(1," CCAP "),s())}function oo(t,r){t&1&&(P(),o(0,"svg",19),S(1,"path",22),s())}function so(t,r){t&1&&(P(),o(0,"svg",20),S(1,"rect",23)(2,"path",24),s())}function ao(t,r){if(t&1&&(S(0,"pre",21),F(1,"ccSessionJsonFormat")),t&2){let e=c().$implicit;v("innerHTML",j(1,1,e.data),G)}}function ro(t,r){if(t&1){let e=T();o(0,"div",12),x("click",function(){let n=u(e).$implicit,l=c();return C(l.handleToggleEvent(n.sequence))}),o(1,"div",13),g(2,io,2,0,"span",14),o(3,"span",15),F(4,"ccSessionEventTypeColor"),d(5),s(),o(6,"span",16),d(7),s(),o(8,"span",17),F(9,"sAbsoluteTime"),d(10),F(11,"sTimeAgo"),s(),o(12,"button",18),x("click",function(n){let l=u(e).$implicit,p=c();return C(p.handleCopyEvent(l,n))}),g(13,oo,2,0,":svg:svg",19)(14,so,3,0,":svg:svg",20),s()(),g(15,ao,2,3,"pre",21),s()}if(t&2){let e=r.$implicit,i=c();a(2),_(e.eventSource==="ccap-internal"?2:-1),a(),v("ngClass",j(4,8,e.eventType)),a(2),D(" ",e.eventType," "),a(2),D(" #",e.sequence," "),a(),v("title",j(9,10,e.timestamp)),a(2),D(" ",j(11,12,e.timestamp)," "),a(3),_(i.copiedSequence_$()===e.sequence?13:14),a(2),_(i.isExpanded(e.sequence)?15:-1)}}function lo(t,r){t&1&&(o(0,"div",11),d(1,"No events yet"),s())}var Jt=(()=>{class t{ccSession_DS=$(W);detailUi_DS=$(K);globalError_CS=$(ae);expandedSequences_$=b(new Set);isAutoScroll_$=b(!0);copiedSequence_$=b(null);eventListRef;previousEventCount=0;ngAfterViewChecked(){let e=this.ccSession_DS.selectedSessionEvents_$().length;this.isAutoScroll_$()&&e>this.previousEventCount&&this.scrollToBottom(),this.previousEventCount=e}handleToggleEvent(e){let i=this.expandedSequences_$(),n=new Set(i);n.has(e)?n.delete(e):n.add(e),this.expandedSequences_$.set(n)}handleToggleAutoScroll(){this.isAutoScroll_$.update(e=>!e)}isExpanded(e){return this.expandedSequences_$().has(e)}handleCopyEvent(e,i){return R(this,null,function*(){i.stopPropagation();let n=JSON.stringify(e.data,null,2);(yield this.globalError_CS.copyToClipboard(n)).ok&&(this.copiedSequence_$.set(e.sequence),setTimeout(()=>{this.copiedSequence_$.set(null)},1500))})}scrollToBottom(){let e=this.eventListRef?.nativeElement;e&&(e.scrollTop=e.scrollHeight)}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-timeline"]],viewQuery:function(i,n){if(i&1&&Ce(to,5),i&2){let l;xe(l=he())&&(n.eventListRef=l.first)}},hostAttrs:[1,"flex","flex-col","h-full","overflow-hidden"],decls:18,vars:8,consts:[["eventList",""],[1,"flex","items-center","justify-between","p-2","border-b","border-neonDefault","shrink-0"],[1,"flex","items-center","gap-1"],[1,"text-xs","text-neutral-400","font-medium"],[1,"text-xs","text-neutral-500"],[1,"text-[10px]","px-1.5","py-0.5","border","rounded","transition-colors",3,"click"],[1,"flex","items-center","gap-1","px-2","py-1.5","border-b","border-neonDefault","shrink-0"],["title","Session lifecycle status changes (running, waiting, completed...)",1,"px-2","py-0.5","text-[10px]","border","rounded","transition-colors",3,"click"],["title","Agent progress updates (task_progress, tool status...)",1,"px-2","py-0.5","text-[10px]","border","rounded","transition-colors",3,"click"],[1,"flex-1","overflow-y-auto","min-h-0"],[1,"px-2","py-1","border-b","border-neutral-700/30","cursor-pointer","hover:bg-neutral-800/30","transition-colors"],[1,"p-3","text-center","text-neutral-500","text-xs"],[1,"px-2","py-1","border-b","border-neutral-700/30","cursor-pointer","hover:bg-neutral-800/30","transition-colors",3,"click"],[1,"flex","items-center","gap-1.5"],["title","CCAP-internal event (saj\xE1t rendszer state-reconciliation / force-reset / recovery)",1,"text-[9px]","px-1","py-0.5","rounded","bg-purple-700","text-white","whitespace-nowrap","leading-none","font-semibold"],[1,"text-[9px]","px-1","py-0.5","rounded","text-white","whitespace-nowrap","leading-none",3,"ngClass"],[1,"text-[10px]","text-neutral-600","leading-none"],[1,"text-[10px]","text-neutral-400","ml-auto","leading-none",3,"title"],["title","Copy event data",1,"ml-1","p-0.5","rounded","transition-colors","text-neutral-500","hover:text-neonCyan","shrink-0",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","2",1,"w-3","h-3","text-green-400"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5",1,"w-3","h-3"],[1,"mt-1","p-2","bg-neutral-900","border","border-neutral-700/50","rounded","text-[10px]","text-neonCyan/70","overflow-x-auto","max-h-60","whitespace-pre-wrap","break-words","font-mono",3,"innerHTML"],["d","M3 8.5L6.5 12L13 4","stroke-linecap","round","stroke-linejoin","round"],["x","5","y","5","width","8","height","8","rx","1","stroke-linecap","round","stroke-linejoin","round"],["d","M3 11V3h8","stroke-linecap","round","stroke-linejoin","round"]],template:function(i,n){if(i&1){let l=T();o(0,"div",1)(1,"div",2)(2,"span",3),d(3,"Event Timeline"),s(),o(4,"span",4),d(5),s()(),o(6,"button",5),x("click",function(){return u(l),C(n.handleToggleAutoScroll())}),d(7," Auto-scroll "),s()(),o(8,"div",6)(9,"button",7),x("click",function(){return u(l),C(n.detailUi_DS.handleToggleSessionStatus())}),d(10," Session status "),s(),o(11,"button",8),x("click",function(){return u(l),C(n.detailUi_DS.handleToggleAgentUpdates())}),d(12," Agent updates "),s()(),o(13,"div",9,0),N(15,ro,16,14,"div",10,no),g(17,lo,2,0,"div",11),s()}i&2&&(a(5),D(" (",n.ccSession_DS.selectedSessionEvents_$().length,") "),a(),L(n.isAutoScroll_$()?"border-neonCyan text-neonCyan shadow-neon-glow-cyan":"border-neonDefault text-neutral-400"),a(3),L(n.detailUi_DS.isShowSessionStatus_$()?"border-neonPurple/50 text-neonPurple bg-neonPurple/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(2),L(n.detailUi_DS.isShowAgentUpdates_$()?"border-teal-500/50 text-teal-400 bg-teal-500/10":"border-neutral-700 text-neutral-500 hover:text-neutral-300 hover:border-neutral-600"),a(4),H(n.ccSession_DS.selectedSessionEvents_$()),a(2),_(n.ccSession_DS.selectedSessionEvents_$().length?-1:17))},dependencies:[X,Me,Pe,Gt,Be],encapsulation:2})}return t})();var Xt=Xe(pt());function po(t,r){if(t&1){let e=T();o(0,"button",41),x("click",function(){u(e);let n=c(2);return C(n.handleScheduleBadgeClick())}),P(),o(1,"svg",42),S(2,"rect",43)(3,"line",44)(4,"line",45)(5,"line",46),s()()}}function _o(t,r){if(t&1){let e=T();o(0,"button",47),x("click",function(){u(e);let n=c(2);return C(n.handleCoordinatorBadgeClick())}),P(),o(1,"svg",42),S(2,"circle",48)(3,"polygon",49),s()()}}function mo(t,r){if(t&1){let e=T();o(0,"button",50),x("click",function(){u(e);let n=c(2);return C(n.detailUi_DS.handleResume())}),d(1),s()}if(t&2){let e=c(2);v("disabled",e.detailUi_DS.isResuming_$()),a(),D(" ",e.detailUi_DS.isResuming_$()?"Resuming...":"Resume"," ")}}function uo(t,r){if(t&1&&(o(0,"span"),d(1),s()),t&2){let e=c(2);a(),J("",e.rateLimitScopeLabel_$()," ",e.rateLimitPercent_$(),"%")}}function Co(t,r){t&1&&(o(0,"span"),d(1,"Rate limit"),s())}function xo(t,r){if(t&1&&(ge(0),o(1,"div",55)(2,"span",29),d(3,"Status"),s(),o(4,"span",56),d(5),s()(),o(6,"div",55)(7,"span",29),d(8,"Scope"),s(),o(9,"span",57),d(10),o(11,"span",58),d(12),s()()(),o(13,"div")(14,"div",59)(15,"span",29),d(16,"Utilization"),s(),o(17,"span",60),d(18),s()(),o(19,"div",61),S(20,"div",62),s()(),o(21,"div",55)(22,"span",29),d(23,"Warning threshold"),s(),o(24,"span",57),d(25),s()(),o(26,"div",55)(27,"span",29),d(28,"Resets in"),s(),o(29,"span",57),d(30),s()(),o(31,"div",55)(32,"span",29),d(33,"Overage"),s(),o(34,"span",63),d(35),s()(),o(36,"div",64)(37,"span",65),d(38),F(39,"date"),s()()),t&2){let e=c(3),i=e.rateLimitInfo_$();a(4),L(e.isRateLimitOverThreshold_$()?"text-red-400":"text-green-400"),a(),D(" ",i.status," "),a(5),D(" ",e.rateLimitScopeLabel_$()," "),a(2),D("(",i.rateLimitType,")"),a(6),D("",e.rateLimitPercent_$(),"%"),a(2),L(e.isRateLimitOverThreshold_$()?"bg-red-500":e.rateLimitPercent_$()>50?"bg-amber-500":"bg-green-500"),Te("width",e.rateLimitPercent_$(),"%"),me("data-utilization-color",e.isRateLimitOverThreshold_$()?"red":e.rateLimitPercent_$()>50?"amber":"green"),a(5),D("",e.rateLimitThresholdPercent_$(),"%"),a(5),k(e.rateLimitResetText_$()),a(4),L(i.isUsingOverage?"text-amber-400":"text-neutral-400"),a(),D(" ",i.isUsingOverage?"active":"inactive"," "),a(3),D("Last updated: ",at(39,17,i.receivedAt,"HH:mm:ss"),"")}}function ho(t,r){t&1&&(o(0,"div",54),d(1," No rate limit data yet "),s())}function fo(t,r){if(t&1){let e=T();o(0,"div",51),x("click",function(){u(e);let n=c(2);return C(n.handleToggleRateLimit())}),s(),o(1,"div",52)(2,"div",53),d(3,"Rate Limit Info"),s(),g(4,xo,40,20)(5,ho,2,0,"div",54),s()}if(t&2){let e=c(2);a(4),_(e.rateLimitInfo_$()?4:5)}}function go(t,r){t&1&&S(0,"span",19)}function So(t,r){if(t&1&&(o(0,"div",20),d(1),s()),t&2){let e=c();a(),k(e.session.statusMessage)}}function vo(t,r){if(t&1&&(o(0,"div",21)(1,"div",17),d(2,"Actor"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),D(" ",e.session.actorLabel||e.session.actorId," ")}}function bo(t,r){if(t&1&&(o(0,"div",21)(1,"div",17),d(2,"Process ID"),s(),o(3,"div",66),d(4),s()()),t&2){let e=c();a(4),k(e.session.processId)}}function wo(t,r){if(t&1&&(o(0,"div",21)(1,"div",17),d(2,"Claude Session"),s(),o(3,"div",22),d(4),s()()),t&2){let e=c();a(4),k(e.session.claudeSessionId)}}function yo(t,r){if(t&1&&(o(0,"div",21)(1,"div",17),d(2,"Last Prompt"),s(),o(3,"div",67),d(4),s()()),t&2){let e=c();a(4),k(e.session.lastPrompt)}}function To(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Started"),s(),o(3,"div",68),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.startedAt)),a(2),k(j(6,4,e.session.startedAt))}}function ko(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Last Activity"),s(),o(3,"div",68),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.lastActivityAt)),a(2),k(j(6,4,e.session.lastActivityAt))}}function Io(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Completed"),s(),o(3,"div",68),F(4,"sAbsoluteTime"),d(5),F(6,"sTimeAgo"),s()()),t&2){let e=c();a(3),v("title",j(4,2,e.session.completedAt)),a(2),k(j(6,4,e.session.completedAt))}}function $o(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Model"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.session.activeModel||e.session.model)}}function Do(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Mode"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.session.mode)}}function Eo(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Permission"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.session.permissionPolicy)}}function Mo(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Effort"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.session.reasoningEffort)}}function Po(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Max Turns"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.session.maxTurns)}}function Ao(t,r){if(t&1){let e=T();o(0,"button",69),x("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!0))}),d(1," on (--debug) "),s()}}function Ro(t,r){if(t&1){let e=T();o(0,"button",70),x("click",function(){u(e);let n=c(),l=c();return C(l.handleToggleDebugMode(n.session.sessionId,!1))}),d(1," off "),s()}}function Vo(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Cost"),s(),o(3,"div",73),d(4),s()()),t&2){let e=c(2);a(4),D("$",e.session.costUsdTotal.toFixed(4),"")}}function Lo(t,r){if(t&1&&(S(0,"hr",24),o(1,"h3",25),d(2," Usage "),s(),o(3,"div",71)(4,"div",27)(5,"div",72),d(6),s(),o(7,"div",29),d(8,"Input"),s()(),o(9,"div",27)(10,"div",72),d(11),s(),o(12,"div",29),d(13,"Output"),s()()(),g(14,Vo,5,1,"div",30)),t&2){let e=c(),i=c();a(6),k(i.formatTokens(e.session.inputTokensTotal)),a(5),k(i.formatTokens(e.session.outputTokensTotal)),a(3),_(e.session.costUsdTotal?14:-1)}}function Oo(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Runtime Status"),s(),o(3,"div",35),d(4),s()()),t&2){let e=c();a(4),k(e.runtime.runtimeStatus)}}function Fo(t,r){if(t&1&&(o(0,"div",30)(1,"div",31),d(2,"Runner"),s(),o(3,"div",34),d(4),s()()),t&2){let e=c();a(3),L(e.runtime.isTerminalRunnerConnected?"text-neonGreen":"text-amber-400"),a(),D(" ",e.runtime.isTerminalRunnerConnected?"connected":"disconnected"," ")}}function Uo(t,r){if(t&1){let e=T();o(0,"div",1)(1,"div",2)(2,"div",3)(3,"h3",4),d(4," Session Info "),s(),g(5,po,6,0,"button",5)(6,_o,4,0,"button",6),s(),o(7,"button",7),x("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!0))}),d(8),s()(),o(9,"div",8),g(10,mo,2,2,"button",9),o(11,"button",10),x("click",function(){u(e);let n=c();return C(n.handleRestartRunner())}),d(12," \u21BB Restart runner "),s(),o(13,"div",11)(14,"button",12),x("click",function(){u(e);let n=c();return C(n.handleToggleRateLimit())}),P(),o(15,"svg",13),S(16,"circle",14)(17,"path",15),s(),g(18,uo,2,2,"span")(19,Co,2,0,"span"),s(),g(20,fo,6,1),s()(),O(),o(21,"div",16)(22,"div",17),d(23,"Status"),s(),o(24,"div",3)(25,"span",18),F(26,"ccSessionStatusColor"),d(27),s(),g(28,go,1,0,"span",19),s(),g(29,So,2,1,"div",20),s(),o(30,"div",21)(31,"div",17),d(32,"Session ID"),s(),o(33,"div",22),d(34),s()(),o(35,"div",21)(36,"div",17),d(37,"Workspace"),s(),o(38,"div",23),d(39),s()(),g(40,vo,5,1,"div",21)(41,bo,5,1,"div",21)(42,wo,5,1,"div",21),S(43,"hr",24),o(44,"h3",25),d(45," Statistics "),s(),o(46,"div",26)(47,"div",27)(48,"div",28),d(49),s(),o(50,"div",29),d(51,"Prompts"),s()(),o(52,"div",27)(53,"div",28),d(54),s(),o(55,"div",29),d(56,"Tool Calls"),s()()(),g(57,yo,5,1,"div",21),S(58,"hr",24),o(59,"h3",25),d(60," Timestamps "),s(),g(61,To,7,6,"div",30)(62,ko,7,6,"div",30)(63,Io,7,6,"div",30),S(64,"hr",24),o(65,"h3",25),d(66," Configuration "),s(),g(67,$o,5,1,"div",30)(68,Do,5,1,"div",30)(69,Eo,5,1,"div",30)(70,Mo,5,1,"div",30)(71,Po,5,1,"div",30),o(72,"div",30)(73,"div",31),d(74,"Debug Mode"),s(),g(75,Ao,2,0,"button",32)(76,Ro,2,0,"button",33),s(),g(77,Lo,15,3),S(78,"hr",24),o(79,"h3",25),d(80," Runtime "),s(),o(81,"div",30)(82,"div",31),d(83,"Live"),s(),o(84,"div",34),d(85),s()(),g(86,Oo,5,1,"div",30),o(87,"div",30)(88,"div",31),d(89,"Output Buffer"),s(),o(90,"div",35),d(91),s()(),o(92,"div",30)(93,"div",31),d(94,"Runner Mode"),s(),o(95,"div",35),d(96),s()(),g(97,Fo,5,3,"div",30),s(),o(98,"app-s-modal",36),x("closed",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),o(99,"p",37),d(100),s(),o(101,"div",38)(102,"button",39),x("click",function(){u(e);let n=c();return C(n.isArchiveConfirmOpen_$.set(!1))}),d(103," Cancel "),s(),o(104,"button",40),x("click",function(){let n=u(e),l=c();return C(l.handleConfirmToggleArchive(n.session))}),d(105),s()()()}if(t&2){let e=r,i=c();a(5),_(i.hasSchedule_$()?5:-1),a(),_(i.hasCoordinator_$()?6:-1),a(),L(e.session.isArchived?"text-amber-400 border border-amber-500/60 bg-amber-500/10 hover:bg-amber-500/20":"text-neutral-500 border border-neutral-700 hover:text-neutral-300 hover:bg-neutral-700"),v("title",e.session.isArchived?"Unarchive session":"Archive session"),a(),D(" ",e.session.isArchived?"Unarchive":"Archive"," "),a(2),_(e.session.status==="completed"||e.session.status==="errored"?10:-1),a(4),L(i.rateLimitInfo_$()?i.isRateLimitOverThreshold_$()?"border-red-500/30 text-red-400/80 hover:bg-red-500/10":"border-green-500/30 text-green-400/80 hover:bg-green-500/10":"border-neutral-700 text-neutral-500"),me("data-rate-limit-state",i.rateLimitInfo_$()?i.isRateLimitOverThreshold_$()?"reached":"allowed":"unknown"),a(4),_(i.rateLimitInfo_$()?18:19),a(2),_(i.isRateLimitOpen_$()?20:-1),a(5),v("ngClass",j(26,47,e.session.status)),a(2),D(" ",e.session.status," "),a(),_(e.runtime.isLive?28:-1),a(),_(e.session.statusMessage?29:-1),a(5),k(e.session.sessionId),a(5),k(e.session.workspacePath),a(),_(e.session.actorId||e.session.actorLabel?40:-1),a(),_(e.session.processId?41:-1),a(),_(e.session.claudeSessionId?42:-1),a(7),k(e.session.promptCount),a(5),k(e.session.toolCallCount),a(3),_(e.session.lastPrompt?57:-1),a(4),_(e.session.startedAt?61:-1),a(),_(e.session.lastActivityAt?62:-1),a(),_(e.session.completedAt?63:-1),a(4),_(e.session.activeModel||e.session.model?67:-1),a(),_(e.session.mode?68:-1),a(),_(e.session.permissionPolicy?69:-1),a(),_(e.session.reasoningEffort?70:-1),a(),_(e.session.maxTurns?71:-1),a(4),_(e.session.isDebugMode?75:76),a(2),_(e.session.inputTokensTotal||e.session.outputTokensTotal||e.session.costUsdTotal?77:-1),a(7),L(e.runtime.isLive?"text-neonGreen":"text-neutral-500"),a(),D(" ",e.runtime.isLive?"Yes":"No"," "),a(),_(e.runtime.runtimeStatus?86:-1),a(5),D("",e.runtime.outputBufferLength," lines"),a(5),D(" ",e.runtime.isTerminalMode?"terminal":"direct"," "),a(),_(e.runtime.isTerminalMode?97:-1),a(),v("isOpen",i.isArchiveConfirmOpen_$())("title",e.session.isArchived?"Unarchive Session":"Archive Session")("maxWidth","sm")("closeOnBackdropClick",!0),a(2),D(" ",e.session.isArchived?"Are you sure you want to unarchive this session?":"Are you sure you want to archive this session?"," "),a(5),D(" ",e.session.isArchived?"Unarchive":"Archive"," ")}}var Yt=(()=>{class t{ccSession_DS=$(W);detailUi_DS=$(K);scheduledJobs_DS=$(Ae);coordinator_DS=$(Re);hasSchedule_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.scheduledJobs_DS.scheduledSessionIds_$().has(e):!1});hasCoordinator_$=A(()=>{let e=this.ccSession_DS.activeSessionId_$();return e?this.coordinator_DS.coordinatedSessionIds_$().has(e):!1});isRateLimitOpen_$=b(!1);isArchiveConfirmOpen_$=b(!1);schedulePopupSessionId_$=b(null);coordinatorPopupSessionId_$=b(null);handleScheduleBadgeClick(){let e=this.ccSession_DS.activeSessionId_$();e&&this.schedulePopupSessionId_$.set(e)}handleCloseSchedulePopup(){this.schedulePopupSessionId_$.set(null)}handleCoordinatorBadgeClick(){let e=this.ccSession_DS.activeSessionId_$();e&&this.coordinatorPopupSessionId_$.set(e)}handleCloseCoordinatorPopup(){this.coordinatorPopupSessionId_$.set(null)}handleToggleDebugMode(e,i){if(!e)return;let n=!i;this.ccSession_DS.updateSessionConfig({sessionId:e,isDebugMode:n}).catch(l=>{Xt.DyFM_Log.error("[CCAP] cc-metadata config-update isDebugMode",l)})}rateLimitInfo_$=A(()=>this.ccSession_DS.rateLimitInfo_$());rateLimitResetText_$=A(()=>de.formatResetText(this.rateLimitInfo_$()));rateLimitPercent_$=A(()=>de.computeUtilizationPercent(this.rateLimitInfo_$()));rateLimitThresholdPercent_$=A(()=>de.computeThresholdPercent(this.rateLimitInfo_$()));rateLimitScopeLabel_$=A(()=>de.formatLimitScopeLabel(this.rateLimitInfo_$()));isRateLimitOverThreshold_$=A(()=>de.isOverThreshold(this.rateLimitInfo_$()));ngOnInit(){this.scheduledJobs_DS.jobs_$().length===0&&this.scheduledJobs_DS.loadAll(),this.coordinator_DS.globalCoordinatorsList_$().length===0&&this.coordinator_DS.loadAllCoordinatorsForManagementPage()}handleToggleRateLimit(){this.isRateLimitOpen_$.update(e=>!e)}handleConfirmToggleArchive(e){return R(this,null,function*(){this.isArchiveConfirmOpen_$.set(!1);try{yield this.ccSession_DS.setSessionArchived({sessionId:e.sessionId,isArchived:!e.isArchived})}catch{}})}handleRestartRunner(){return R(this,null,function*(){let e=this.ccSession_DS.activeSessionId_$();if(e)try{yield this.ccSession_DS.restartRunner({sessionId:e})}catch{}})}formatTokens(e){return e?e>1e3?`${(e/1e3).toFixed(1)}k`:String(e):"0"}static \u0275fac=function(i){return new(i||t)};static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-metadata"]],hostAttrs:[1,"block","h-full","overflow-y-auto"],decls:3,vars:5,consts:[[3,"closed","sessionId","isOpen"],[1,"p-3"],[1,"flex","items-center","justify-between","mb-3"],[1,"flex","items-center","gap-1.5"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"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,"text-neonAmber/80","hover:text-neonAmber","focus:outline-none","focus:ring-1","focus:ring-neonAmber/60","rounded","p-0.5"],[1,"text-[10px]","px-1.5","py-0.5","rounded","transition-colors",3,"click","title"],[1,"flex","flex-col","gap-2","mb-4"],["type","button",1,"w-full","px-2","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"disabled"],["type","button","title","Runner kill + respawn (\xFAj CMD/termin\xE1l ablak; haszn\xE1ld ha verzi\xF3-mismatch vagy no-ACK loop van)",1,"w-full","px-2","py-1.5","text-xs","border","border-amber-500/60","text-amber-300","hover:bg-amber-500/10","disabled:opacity-50","rounded","transition-colors",3,"click"],["data-testid","cc-rate-limit-container",1,"relative","w-full","shrink-0"],["type","button","data-testid","cc-rate-limit-button","title","Rate limit info",1,"w-full","px-2","py-1.5","text-xs","border","rounded","transition-colors","flex","items-center","justify-center","gap-1.5",3,"click"],["viewBox","0 0 16 16","fill","none","stroke","currentColor","stroke-width","1.5","stroke-linecap","round","stroke-linejoin","round",1,"w-3.5","h-3.5","shrink-0"],["cx","8","cy","8","r","6"],["d","M8 5v3.5l2 1.5"],[1,"mb-4"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-1"],[1,"text-[10px]","px-1.5","py-0.5","rounded-full","text-white",3,"ngClass"],[1,"w-1.5","h-1.5","rounded-full","bg-green-500","animate-pulse"],[1,"text-xs","text-neutral-500","mt-0.5"],[1,"mb-3"],[1,"text-xs","text-neutral-400","font-mono","break-all"],[1,"text-xs","text-neutral-400","break-all"],[1,"border-neutral-700/50","my-3"],[1,"text-xs","font-semibold","text-neutral-400","uppercase","tracking-wider","mb-3"],[1,"grid","grid-cols-2","gap-2","mb-4"],[1,"bg-neutral-800/60","border","border-neonDefault","rounded","p-2","text-center"],[1,"text-lg","font-bold","text-neutral-100"],[1,"text-[10px]","text-neutral-500"],[1,"mb-2"],[1,"text-[10px]","text-neutral-500","uppercase","tracking-wider","mb-0.5"],["type","button","title","CLI --debug flag akt\xEDv \u2014 klikk a kikapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-amber-700","text-amber-400","hover:border-amber-500","hover:text-amber-300","transition-colors","duration-150"],["type","button","title","CLI --debug flag inakt\xEDv \u2014 klikk a bekapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-neutral-700","text-neutral-500","hover:border-neutral-500","hover:text-neutral-300","transition-colors","duration-150"],[1,"text-xs"],[1,"text-xs","text-neutral-400"],[3,"closed","isOpen","title","maxWidth","closeOnBackdropClick"],[1,"text-sm","text-neutral-300","mb-4"],[1,"flex","justify-end","gap-2"],[1,"px-3","py-1.5","text-xs","border","border-neonDefault","text-neutral-300","hover:bg-neutral-700","rounded","transition-colors",3,"click"],[1,"px-3","py-1.5","text-xs","border","border-amber-500","text-amber-400","hover:bg-amber-500","hover:text-white","rounded","transition-colors",3,"click"],["type","button","title","Ehhez a session-h\xF6z tartozik schedule \u2014 kattints a r\xE9szletek\xE9rt","aria-label","Schedule attached \u2014 open popup",1,"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,"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"],["type","button",1,"w-full","px-2","py-1.5","text-xs","border","border-ccapAccent","text-ccapAccent","hover:bg-ccapAccent","hover:text-white","disabled:opacity-50","rounded","transition-colors",3,"click","disabled"],[1,"fixed","inset-0","z-40",3,"click"],["data-testid","cc-rate-limit-popover",1,"absolute","left-0","top-full","mt-1","z-50","w-full","min-w-[16rem]","max-w-[min(100vw-2rem,18rem)]","bg-neutral-900","border","border-neutral-700","rounded-lg","shadow-xl","p-3","space-y-2.5"],[1,"text-xs","font-semibold","text-neutral-200","mb-2"],[1,"text-[11px]","text-neutral-500","text-center","py-2"],[1,"flex","items-center","justify-between"],["data-testid","cc-rate-limit-status",1,"text-[11px]","font-medium"],[1,"text-[11px]","text-neutral-300"],[1,"text-[9px]","text-neutral-500"],[1,"flex","items-center","justify-between","mb-1"],[1,"text-[10px]","text-neutral-300","font-medium"],[1,"w-full","h-1.5","bg-neutral-800","rounded-full","overflow-hidden"],["data-testid","cc-rate-limit-utilization-bar",1,"h-full","rounded-full","transition-all"],[1,"text-[11px]"],[1,"border-t","border-neutral-800","pt-1.5","mt-1.5"],[1,"text-[9px]","text-neutral-600"],[1,"text-xs","text-neutral-400","font-mono"],[1,"text-xs","text-neutral-400","line-clamp-3"],[1,"text-xs","text-neutral-400",3,"title"],["type","button","title","CLI --debug flag akt\xEDv \u2014 klikk a kikapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-amber-700","text-amber-400","hover:border-amber-500","hover:text-amber-300","transition-colors","duration-150",3,"click"],["type","button","title","CLI --debug flag inakt\xEDv \u2014 klikk a bekapcsol\xE1shoz",1,"text-xs","px-2","py-0.5","rounded","border","border-neutral-700","text-neutral-500","hover:border-neutral-500","hover:text-neutral-300","transition-colors","duration-150",3,"click"],[1,"grid","grid-cols-2","gap-2","mb-2"],[1,"text-sm","font-bold","text-neutral-100"],[1,"text-xs","text-neonGreen","font-mono"]],template:function(i,n){if(i&1&&(g(0,Uo,106,49),o(1,"app-sch-schedule-popup",0),x("closed",function(){return n.handleCloseSchedulePopup()}),s(),o(2,"app-crd-info-popup",0),x("closed",function(){return n.handleCloseCoordinatorPopup()}),s()),i&2){let l;_((l=n.ccSession_DS.selectedSession_$())?0:-1,l),a(),v("sessionId",n.schedulePopupSessionId_$())("isOpen",n.schedulePopupSessionId_$()!==null),a(),v("sessionId",n.coordinatorPopupSessionId_$())("isOpen",n.coordinatorPopupSessionId_$()!==null)}},dependencies:[X,Y,ce,pe,ct,Me,Pe,je],encapsulation:2})}return t})();function Bo(t,r){t&1&&(o(0,"div",0),d(1," Loading session... "),s())}function zo(t,r){if(t&1){let e=T();o(0,"app-s-session-detail-three-column-layout",2),x("startResizeStart",function(n){u(e);let l=c();return C(l.handleMetadataResizeStart(n))})("endResizeStart",function(n){u(e);let l=c();return C(l.handleTimelineResizeStart(n))}),o(1,"div",3),S(2,"app-ccap-cc-metadata"),s(),o(3,"div",4),S(4,"app-ccap-cc-console",5),s(),o(5,"div",6),S(6,"app-ccap-cc-timeline"),s()()}if(t&2){let e=c();v("isStartOpen",e.detailUi_DS.isMetadataPanelOpen_$())("isEndOpen",e.detailUi_DS.isTimelinePanelOpen_$())("startWidthPx",e.metadataWidth_$())("endWidthPx",e.timelineWidth_$())("isResizing",e.isResizing_$()),a(4),v("sessionId",e.sessionId_$())("isShowSessionStatus",e.detailUi_DS.isShowSessionStatus_$())("isShowAgentUpdates",e.detailUi_DS.isShowAgentUpdates_$())}}function Wo(t,r){t&1&&(o(0,"div",0),d(1," Select a session to view details "),s())}var ze=(()=>{class t extends bt{ccSession_DS=$(W);detailUi_DS=$(K);peiContext_DS=$(re);route=$(_t);router=$(se);sessionId_$=b("");metadataWidth_$=b(256);timelineWidth_$=b(288);isResizing_$=b(!1);ngOnInit(){this.metadataWidth_$.set(Math.max(160,Math.min(500,y.loadPanelWidth("metadata",256)))),this.timelineWidth_$.set(Math.max(200,Math.min(600,y.loadPanelWidth("timeline",288)))),this.addSubscription(this.route.params.subscribe(e=>{let i=e.sessionId??"",n=e.ccapId??"";if(this.sessionId_$.set(i),i)y.saveLastSessionId(i),n&&y.saveLastCcapId(n),this.peiContext_DS.ensureInitialized().then(()=>{n&&this.peiContext_DS.activeCcapId_$()!==n&&this.peiContext_DS.selectInstance(n),this.ccSession_DS.clearLiveOutput(),this.ccSession_DS.setActiveSessionId(i),this.ccSession_DS.loadSessionDetail({sessionId:i}),this.ccSession_DS.loadSessionEvents({sessionId:i});let l=this.peiContext_DS.activeCcapId_$();l&&this.ccSession_DS.loadPersistedRateLimitState({ccapId:l}).catch(()=>{})});else{let l=y.loadLastSessionId(),p=y.loadLastCcapId();if(l){let m=p?["/cc-session",p,l]:["/cc-session",l];this.router.navigate(m,{replaceUrl:!0})}}}))}ngOnDestroy(){this.ccSession_DS.setActiveSessionId(""),super.ngOnDestroy()}handleMetadataResizeStart(e){let i=this.metadataWidth_$(),n=e.clientX;this.isResizing_$.set(!0),Se.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=l.clientX-n,m=Math.max(160,Math.min(500,i+p));this.metadataWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),y.savePanelWidth("metadata",this.metadataWidth_$())}})}handleTimelineResizeStart(e){let i=this.timelineWidth_$(),n=e.clientX;this.isResizing_$.set(!0),Se.attachUntilPointerUp({startEvent:e,onMove:l=>{let p=n-l.clientX,m=Math.max(200,Math.min(600,i+p));this.timelineWidth_$.set(m)},onEnd:()=>{this.isResizing_$.set(!1),y.savePanelWidth("timeline",this.timelineWidth_$())}})}static \u0275fac=(()=>{let e;return function(n){return(e||(e=tt(t)))(n||t)}})();static \u0275cmp=B({type:t,selectors:[["app-ccap-cc-detail"]],hostAttrs:[1,"flex","flex-col","flex-1","min-h-0","overflow-hidden"],features:[it],decls:3,vars:1,consts:[[1,"flex","items-center","justify-center","h-full","text-neutral-500","text-sm"],[3,"isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],[3,"startResizeStart","endResizeStart","isStartOpen","isEndOpen","startWidthPx","endWidthPx","isResizing"],["sDetailColumnStart",""],["sDetailColumnMain",""],[3,"sessionId","isShowSessionStatus","isShowAgentUpdates"],["sDetailColumnEnd",""]],template:function(i,n){i&1&&g(0,Bo,2,0,"div",0)(1,zo,7,8,"app-s-session-detail-three-column-layout",1)(2,Wo,2,0,"div",0),i&2&&_(n.ccSession_DS.selectedSessionLoading_$()?0:n.ccSession_DS.selectedSession_$()?1:2)},dependencies:[Dt,Qt,Jt,Yt],encapsulation:2})}return t})();var No=[{path:"",component:Ht,children:[{path:"",pathMatch:"full",component:ze},{path:":ccapId/:sessionId",component:ze},{path:":sessionId",component:ze}]}],br=(()=>{class t{static \u0275fac=function(i){return new(i||t)};static \u0275mod=et({type:t});static \u0275inj=Ze({imports:[oe,vt,ut.forChild(No),Ve,Y,Ee,Oe,Ue,ce,Le,pe,Rt]})}return t})();export{br as CcSession_Module};
4
- //# sourceMappingURL=cc.module-JUQY7GCV.js.map
4
+ //# sourceMappingURL=cc.module-PEJ6OV2U.js.map