@futdevpro/ccap 1.1.2964 → 1.1.2968

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 (183) hide show
  1. package/client-dist/{agent-instances.module-HY2VHBIJ.js → agent-instances.module-LFM3J2LA.js} +2 -2
  2. package/client-dist/ca.module-6IKKBFCV.js +5 -0
  3. package/client-dist/ca.module-6IKKBFCV.js.map +7 -0
  4. package/client-dist/{cc-usage-dashboard.component-LKFNBYVL.js → cc-usage-dashboard.component-MAJTREX5.js} +2 -2
  5. package/client-dist/{cc.module-DIE6ZYLY.js → cc.module-WIBOFFFC.js} +4 -4
  6. package/client-dist/cc.module-WIBOFFFC.js.map +7 -0
  7. package/client-dist/{chunk-VPBJ7EDQ.js → chunk-2XU2LIK5.js} +2 -2
  8. package/client-dist/{chunk-LACKIWSR.js → chunk-334PU4V5.js} +2 -2
  9. package/client-dist/{chunk-TDNEXMNL.js → chunk-375SGREC.js} +2 -2
  10. package/client-dist/{chunk-R52CDVAS.js → chunk-3XP3ALCH.js} +2 -2
  11. package/client-dist/{chunk-LCOGH5NG.js → chunk-4O5PJT2Q.js} +2 -2
  12. package/client-dist/{chunk-IQB44YSD.js → chunk-536ONGRA.js} +2 -2
  13. package/client-dist/{chunk-HQUS6ZSW.js → chunk-5JBJMD26.js} +2 -2
  14. package/client-dist/{chunk-M2MQ43YC.js → chunk-5L255H5C.js} +2 -2
  15. package/client-dist/{chunk-M2MQ43YC.js.map → chunk-5L255H5C.js.map} +1 -1
  16. package/client-dist/{chunk-GTH4FT5Y.js → chunk-5SYCIFC7.js} +2 -2
  17. package/client-dist/{chunk-MICI24HP.js → chunk-62O4YXH2.js} +2 -2
  18. package/client-dist/{chunk-53UP5J5U.js → chunk-7DXWR6DX.js} +2 -2
  19. package/client-dist/{chunk-L3ECIYSX.js → chunk-7QXWTKTQ.js} +2 -2
  20. package/client-dist/{chunk-HD5BCFN3.js → chunk-AFNG5IFQ.js} +2 -2
  21. package/client-dist/{chunk-DQAJ7SNH.js → chunk-AOZH5KZ5.js} +2 -2
  22. package/client-dist/{chunk-4564GYJ5.js → chunk-B5C3VRNW.js} +2 -2
  23. package/client-dist/{chunk-5NGKACCT.js → chunk-BBQR7THP.js} +2 -2
  24. package/client-dist/{chunk-SUFGVRIV.js → chunk-BNZAUTHL.js} +2 -2
  25. package/client-dist/{chunk-ZDJUICKL.js → chunk-BP6PERGA.js} +2 -2
  26. package/client-dist/{chunk-OTVNMXWD.js → chunk-C6BPLTAT.js} +2 -2
  27. package/client-dist/{chunk-GMB2E5VV.js → chunk-CSJOCUB5.js} +2 -2
  28. package/client-dist/{chunk-PWPSHQ6T.js → chunk-DZ4365RI.js} +2 -2
  29. package/client-dist/{chunk-3DOLRVWQ.js → chunk-EIJM7YZZ.js} +2 -2
  30. package/client-dist/{chunk-P5IIY6MO.js → chunk-F5OKFSMW.js} +2 -2
  31. package/client-dist/{chunk-TTWKTVB4.js → chunk-GLISSBW6.js} +2 -2
  32. package/client-dist/{chunk-UVQOIRMW.js → chunk-GOHAZ3UP.js} +2 -2
  33. package/client-dist/{chunk-APF4FF3U.js → chunk-GXVFIYGG.js} +2 -2
  34. package/client-dist/{chunk-QTBI3NZR.js → chunk-GZJSMF4W.js} +2 -2
  35. package/client-dist/{chunk-HUDNX2TQ.js → chunk-GZNAXQSR.js} +2 -2
  36. package/client-dist/{chunk-DIZTKV2A.js → chunk-HIUVSLF2.js} +2 -2
  37. package/client-dist/{chunk-VJHWXKNO.js → chunk-K2BXFMAZ.js} +2 -2
  38. package/client-dist/{chunk-55MKVFNX.js → chunk-KS3E56FC.js} +2 -2
  39. package/client-dist/{chunk-ISQFVLSF.js → chunk-KYXVXZA4.js} +2 -2
  40. package/client-dist/{chunk-HWBJNTEA.js → chunk-M6XVA3F3.js} +2 -2
  41. package/client-dist/{chunk-6TP5DJKE.js → chunk-MDOELCBX.js} +2 -2
  42. package/client-dist/{chunk-UBTKADWP.js → chunk-OAYVBZZD.js} +2 -2
  43. package/client-dist/{chunk-OZE63YYG.js → chunk-OAZA6CLB.js} +2 -2
  44. package/client-dist/{chunk-5XCRRBNZ.js → chunk-OHXBMPQN.js} +2 -2
  45. package/client-dist/{chunk-BW5WKQNI.js → chunk-OUBAPK5Q.js} +2 -2
  46. package/client-dist/{chunk-22IFFOSI.js → chunk-P4E77IA5.js} +2 -2
  47. package/client-dist/{chunk-7HGLOQXB.js → chunk-PIN4VFXO.js} +2 -2
  48. package/client-dist/{chunk-IJLGLMJO.js → chunk-PZ3A7XIC.js} +2 -2
  49. package/client-dist/{chunk-WHYZNKV4.js → chunk-SBTVSUCF.js} +2 -2
  50. package/client-dist/{chunk-IBQTN5YN.js → chunk-SLYF4BZT.js} +2 -2
  51. package/client-dist/{chunk-SXMXRHRS.js → chunk-SOA6UZHW.js} +2 -2
  52. package/client-dist/{chunk-CCUYQVNE.js → chunk-TKJC6WIX.js} +2 -2
  53. package/client-dist/{chunk-2SMC7E3W.js → chunk-UZWYHQU5.js} +2 -2
  54. package/client-dist/{chunk-66HYCHT3.js → chunk-VER7DLPS.js} +2 -2
  55. package/client-dist/{chunk-DOEEKXYU.js → chunk-WSRT2AXO.js} +2 -2
  56. package/client-dist/{chunk-ZJBX4PWF.js → chunk-XC6OGCBT.js} +2 -2
  57. package/client-dist/{chunk-F6LSYMQS.js → chunk-XS5NRBFX.js} +2 -2
  58. package/client-dist/{chunk-FF6BH35R.js → chunk-Y4WOX5ZT.js} +2 -2
  59. package/client-dist/{chunk-W7PSBH2X.js → chunk-YFGRQVYN.js} +2 -2
  60. package/client-dist/{chunk-IKEQV7TO.js → chunk-YV7GEWMV.js} +2 -2
  61. package/client-dist/{chunk-VLW4WKLV.js → chunk-ZO42CPIZ.js} +2 -2
  62. package/client-dist/{chunk-BTJGFYMU.js → chunk-ZRLRJNW4.js} +2 -2
  63. package/client-dist/{chunk-4DO6YKND.js → chunk-ZTO2WC4L.js} +2 -2
  64. package/client-dist/{consultant.module-D3LT6Q7Q.js → consultant.module-XYGMFIBX.js} +2 -2
  65. package/client-dist/{crd.module-6H4ARFJI.js → crd.module-2TUYARHJ.js} +2 -2
  66. package/client-dist/{dashboard.module-3SOB7UIK.js → dashboard.module-G47SY7RR.js} +2 -2
  67. package/client-dist/{do.module-JEKCVDN7.js → do.module-WWLJVEM2.js} +2 -2
  68. package/client-dist/{document-library.module-QJRCHNHP.js → document-library.module-EKVYKBGO.js} +2 -2
  69. package/client-dist/{embedding-eval.module-MMR2X56Q.js → embedding-eval.module-ZXMLZHML.js} +2 -2
  70. package/client-dist/{embedding-registry.module-OF7URRJG.js → embedding-registry.module-EE5OFQVA.js} +2 -2
  71. package/client-dist/{err.module-BSNE44J4.js → err.module-AQ7S3MIX.js} +2 -2
  72. package/client-dist/{feedback.module-N42SJQAD.js → feedback.module-PS2TJILH.js} +2 -2
  73. package/client-dist/{host-runtime-mcp.module-UVYBS76M.js → host-runtime-mcp.module-XHWB3K2U.js} +2 -2
  74. package/client-dist/index.html +1 -1
  75. package/client-dist/{live-dev-pipeline.module-R33WI6YN.js → live-dev-pipeline.module-HVIUS654.js} +2 -2
  76. package/client-dist/{logs.module-CLZDKCFB.js → logs.module-RZOFXUFO.js} +2 -2
  77. package/client-dist/{main-Q7457G6W.js → main-N4T3LPFJ.js} +3 -3
  78. package/client-dist/{master-control-remote-poc.module-IXQRMTZO.js → master-control-remote-poc.module-Z44FHFP3.js} +2 -2
  79. package/client-dist/{mobile-app.module-6VL6WSNJ.js → mobile-app.module-7EN7TBHL.js} +2 -2
  80. package/client-dist/{model-registry.module-E63WDS2Y.js → model-registry.module-3GLXXUHT.js} +2 -2
  81. package/client-dist/oc.module-XJXWDHRE.js +3 -0
  82. package/client-dist/oc.module-XJXWDHRE.js.map +7 -0
  83. package/client-dist/{orc.module-NO2J4BGL.js → orc.module-TGXVMQLI.js} +2 -2
  84. package/client-dist/{project-management.module-RLNO5UZC.js → project-management.module-24CUEUF5.js} +2 -2
  85. package/client-dist/project-source-routed.module-DNGOB2JX.js +2 -0
  86. package/client-dist/{scheduler.module-WUBZXO5V.js → scheduler.module-I4VI7QU7.js} +2 -2
  87. package/client-dist/{session.module-5R43V7F5.js → session.module-MQKLXSPJ.js} +9 -9
  88. package/client-dist/session.module-MQKLXSPJ.js.map +7 -0
  89. package/client-dist/{set.module-36ZSGLGF.js → set.module-EBOPU2SQ.js} +2 -2
  90. package/client-dist/{setup.module-7MFIOZVY.js → setup.module-LOYXPT7O.js} +2 -2
  91. package/client-dist/{terminals.module-ZFFIL6DY.js → terminals.module-45PXK7MW.js} +2 -2
  92. package/client-dist/{voice-notes-poc.module-FXL6WNEJ.js → voice-notes-poc.module-UIV4RQN3.js} +2 -2
  93. package/client-dist/{wfs.module-KNRW6VWW.js → wfs.module-BNMGWII3.js} +2 -2
  94. package/package.json +1 -1
  95. package/client-dist/ca.module-ET22WIEL.js +0 -5
  96. package/client-dist/ca.module-ET22WIEL.js.map +0 -7
  97. package/client-dist/cc.module-DIE6ZYLY.js.map +0 -7
  98. package/client-dist/oc.module-TARPDB47.js +0 -3
  99. package/client-dist/oc.module-TARPDB47.js.map +0 -7
  100. package/client-dist/project-source-routed.module-NTVZXKR2.js +0 -2
  101. package/client-dist/session.module-5R43V7F5.js.map +0 -7
  102. /package/client-dist/{agent-instances.module-HY2VHBIJ.js.map → agent-instances.module-LFM3J2LA.js.map} +0 -0
  103. /package/client-dist/{cc-usage-dashboard.component-LKFNBYVL.js.map → cc-usage-dashboard.component-MAJTREX5.js.map} +0 -0
  104. /package/client-dist/{chunk-VPBJ7EDQ.js.map → chunk-2XU2LIK5.js.map} +0 -0
  105. /package/client-dist/{chunk-LACKIWSR.js.map → chunk-334PU4V5.js.map} +0 -0
  106. /package/client-dist/{chunk-TDNEXMNL.js.map → chunk-375SGREC.js.map} +0 -0
  107. /package/client-dist/{chunk-R52CDVAS.js.map → chunk-3XP3ALCH.js.map} +0 -0
  108. /package/client-dist/{chunk-LCOGH5NG.js.map → chunk-4O5PJT2Q.js.map} +0 -0
  109. /package/client-dist/{chunk-IQB44YSD.js.map → chunk-536ONGRA.js.map} +0 -0
  110. /package/client-dist/{chunk-HQUS6ZSW.js.map → chunk-5JBJMD26.js.map} +0 -0
  111. /package/client-dist/{chunk-GTH4FT5Y.js.map → chunk-5SYCIFC7.js.map} +0 -0
  112. /package/client-dist/{chunk-MICI24HP.js.map → chunk-62O4YXH2.js.map} +0 -0
  113. /package/client-dist/{chunk-53UP5J5U.js.map → chunk-7DXWR6DX.js.map} +0 -0
  114. /package/client-dist/{chunk-L3ECIYSX.js.map → chunk-7QXWTKTQ.js.map} +0 -0
  115. /package/client-dist/{chunk-HD5BCFN3.js.map → chunk-AFNG5IFQ.js.map} +0 -0
  116. /package/client-dist/{chunk-DQAJ7SNH.js.map → chunk-AOZH5KZ5.js.map} +0 -0
  117. /package/client-dist/{chunk-4564GYJ5.js.map → chunk-B5C3VRNW.js.map} +0 -0
  118. /package/client-dist/{chunk-5NGKACCT.js.map → chunk-BBQR7THP.js.map} +0 -0
  119. /package/client-dist/{chunk-SUFGVRIV.js.map → chunk-BNZAUTHL.js.map} +0 -0
  120. /package/client-dist/{chunk-ZDJUICKL.js.map → chunk-BP6PERGA.js.map} +0 -0
  121. /package/client-dist/{chunk-OTVNMXWD.js.map → chunk-C6BPLTAT.js.map} +0 -0
  122. /package/client-dist/{chunk-GMB2E5VV.js.map → chunk-CSJOCUB5.js.map} +0 -0
  123. /package/client-dist/{chunk-PWPSHQ6T.js.map → chunk-DZ4365RI.js.map} +0 -0
  124. /package/client-dist/{chunk-3DOLRVWQ.js.map → chunk-EIJM7YZZ.js.map} +0 -0
  125. /package/client-dist/{chunk-P5IIY6MO.js.map → chunk-F5OKFSMW.js.map} +0 -0
  126. /package/client-dist/{chunk-TTWKTVB4.js.map → chunk-GLISSBW6.js.map} +0 -0
  127. /package/client-dist/{chunk-UVQOIRMW.js.map → chunk-GOHAZ3UP.js.map} +0 -0
  128. /package/client-dist/{chunk-APF4FF3U.js.map → chunk-GXVFIYGG.js.map} +0 -0
  129. /package/client-dist/{chunk-QTBI3NZR.js.map → chunk-GZJSMF4W.js.map} +0 -0
  130. /package/client-dist/{chunk-HUDNX2TQ.js.map → chunk-GZNAXQSR.js.map} +0 -0
  131. /package/client-dist/{chunk-DIZTKV2A.js.map → chunk-HIUVSLF2.js.map} +0 -0
  132. /package/client-dist/{chunk-VJHWXKNO.js.map → chunk-K2BXFMAZ.js.map} +0 -0
  133. /package/client-dist/{chunk-55MKVFNX.js.map → chunk-KS3E56FC.js.map} +0 -0
  134. /package/client-dist/{chunk-ISQFVLSF.js.map → chunk-KYXVXZA4.js.map} +0 -0
  135. /package/client-dist/{chunk-HWBJNTEA.js.map → chunk-M6XVA3F3.js.map} +0 -0
  136. /package/client-dist/{chunk-6TP5DJKE.js.map → chunk-MDOELCBX.js.map} +0 -0
  137. /package/client-dist/{chunk-UBTKADWP.js.map → chunk-OAYVBZZD.js.map} +0 -0
  138. /package/client-dist/{chunk-OZE63YYG.js.map → chunk-OAZA6CLB.js.map} +0 -0
  139. /package/client-dist/{chunk-5XCRRBNZ.js.map → chunk-OHXBMPQN.js.map} +0 -0
  140. /package/client-dist/{chunk-BW5WKQNI.js.map → chunk-OUBAPK5Q.js.map} +0 -0
  141. /package/client-dist/{chunk-22IFFOSI.js.map → chunk-P4E77IA5.js.map} +0 -0
  142. /package/client-dist/{chunk-7HGLOQXB.js.map → chunk-PIN4VFXO.js.map} +0 -0
  143. /package/client-dist/{chunk-IJLGLMJO.js.map → chunk-PZ3A7XIC.js.map} +0 -0
  144. /package/client-dist/{chunk-WHYZNKV4.js.map → chunk-SBTVSUCF.js.map} +0 -0
  145. /package/client-dist/{chunk-IBQTN5YN.js.map → chunk-SLYF4BZT.js.map} +0 -0
  146. /package/client-dist/{chunk-SXMXRHRS.js.map → chunk-SOA6UZHW.js.map} +0 -0
  147. /package/client-dist/{chunk-CCUYQVNE.js.map → chunk-TKJC6WIX.js.map} +0 -0
  148. /package/client-dist/{chunk-2SMC7E3W.js.map → chunk-UZWYHQU5.js.map} +0 -0
  149. /package/client-dist/{chunk-66HYCHT3.js.map → chunk-VER7DLPS.js.map} +0 -0
  150. /package/client-dist/{chunk-DOEEKXYU.js.map → chunk-WSRT2AXO.js.map} +0 -0
  151. /package/client-dist/{chunk-ZJBX4PWF.js.map → chunk-XC6OGCBT.js.map} +0 -0
  152. /package/client-dist/{chunk-F6LSYMQS.js.map → chunk-XS5NRBFX.js.map} +0 -0
  153. /package/client-dist/{chunk-FF6BH35R.js.map → chunk-Y4WOX5ZT.js.map} +0 -0
  154. /package/client-dist/{chunk-W7PSBH2X.js.map → chunk-YFGRQVYN.js.map} +0 -0
  155. /package/client-dist/{chunk-IKEQV7TO.js.map → chunk-YV7GEWMV.js.map} +0 -0
  156. /package/client-dist/{chunk-VLW4WKLV.js.map → chunk-ZO42CPIZ.js.map} +0 -0
  157. /package/client-dist/{chunk-BTJGFYMU.js.map → chunk-ZRLRJNW4.js.map} +0 -0
  158. /package/client-dist/{chunk-4DO6YKND.js.map → chunk-ZTO2WC4L.js.map} +0 -0
  159. /package/client-dist/{consultant.module-D3LT6Q7Q.js.map → consultant.module-XYGMFIBX.js.map} +0 -0
  160. /package/client-dist/{crd.module-6H4ARFJI.js.map → crd.module-2TUYARHJ.js.map} +0 -0
  161. /package/client-dist/{dashboard.module-3SOB7UIK.js.map → dashboard.module-G47SY7RR.js.map} +0 -0
  162. /package/client-dist/{do.module-JEKCVDN7.js.map → do.module-WWLJVEM2.js.map} +0 -0
  163. /package/client-dist/{document-library.module-QJRCHNHP.js.map → document-library.module-EKVYKBGO.js.map} +0 -0
  164. /package/client-dist/{embedding-eval.module-MMR2X56Q.js.map → embedding-eval.module-ZXMLZHML.js.map} +0 -0
  165. /package/client-dist/{embedding-registry.module-OF7URRJG.js.map → embedding-registry.module-EE5OFQVA.js.map} +0 -0
  166. /package/client-dist/{err.module-BSNE44J4.js.map → err.module-AQ7S3MIX.js.map} +0 -0
  167. /package/client-dist/{feedback.module-N42SJQAD.js.map → feedback.module-PS2TJILH.js.map} +0 -0
  168. /package/client-dist/{host-runtime-mcp.module-UVYBS76M.js.map → host-runtime-mcp.module-XHWB3K2U.js.map} +0 -0
  169. /package/client-dist/{live-dev-pipeline.module-R33WI6YN.js.map → live-dev-pipeline.module-HVIUS654.js.map} +0 -0
  170. /package/client-dist/{logs.module-CLZDKCFB.js.map → logs.module-RZOFXUFO.js.map} +0 -0
  171. /package/client-dist/{main-Q7457G6W.js.map → main-N4T3LPFJ.js.map} +0 -0
  172. /package/client-dist/{master-control-remote-poc.module-IXQRMTZO.js.map → master-control-remote-poc.module-Z44FHFP3.js.map} +0 -0
  173. /package/client-dist/{mobile-app.module-6VL6WSNJ.js.map → mobile-app.module-7EN7TBHL.js.map} +0 -0
  174. /package/client-dist/{model-registry.module-E63WDS2Y.js.map → model-registry.module-3GLXXUHT.js.map} +0 -0
  175. /package/client-dist/{orc.module-NO2J4BGL.js.map → orc.module-TGXVMQLI.js.map} +0 -0
  176. /package/client-dist/{project-management.module-RLNO5UZC.js.map → project-management.module-24CUEUF5.js.map} +0 -0
  177. /package/client-dist/{project-source-routed.module-NTVZXKR2.js.map → project-source-routed.module-DNGOB2JX.js.map} +0 -0
  178. /package/client-dist/{scheduler.module-WUBZXO5V.js.map → scheduler.module-I4VI7QU7.js.map} +0 -0
  179. /package/client-dist/{set.module-36ZSGLGF.js.map → set.module-EBOPU2SQ.js.map} +0 -0
  180. /package/client-dist/{setup.module-7MFIOZVY.js.map → setup.module-LOYXPT7O.js.map} +0 -0
  181. /package/client-dist/{terminals.module-ZFFIL6DY.js.map → terminals.module-45PXK7MW.js.map} +0 -0
  182. /package/client-dist/{voice-notes-poc.module-FXL6WNEJ.js.map → voice-notes-poc.module-UIV4RQN3.js.map} +0 -0
  183. /package/client-dist/{wfs.module-KNRW6VWW.js.map → wfs.module-BNMGWII3.js.map} +0 -0
@@ -1,2 +1,2 @@
1
- import{e as ne}from"./chunk-QTBI3NZR.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-MICI24HP.js";import{I as te}from"./chunk-M2MQ43YC.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-LKFNBYVL.js.map
1
+ import{e as ne}from"./chunk-GZJSMF4W.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-62O4YXH2.js";import{I as te}from"./chunk-5L255H5C.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-MAJTREX5.js.map