@rabbi696/ezrouter 0.5.72 → 0.5.74

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 (362) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +14 -14
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  35. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  36. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  37. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  42. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  43. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  44. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  46. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  49. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js +1 -1
  50. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  51. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  52. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  53. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  54. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  55. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  56. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  57. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  58. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  59. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  60. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  61. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  62. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  63. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  64. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  65. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  66. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  67. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  68. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  69. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  70. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  71. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  72. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  73. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  74. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  75. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  76. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  77. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  78. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  79. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  80. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/callback.html +1 -1
  82. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  83. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  84. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  85. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  86. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  88. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  90. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  91. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  92. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  95. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  96. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  98. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  100. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  101. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  102. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  105. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  106. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  108. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  109. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  110. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  111. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  112. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  115. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  116. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  117. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  118. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  119. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  120. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
  121. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  122. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  123. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  124. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  125. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
  126. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
  128. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
  129. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  130. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  131. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  132. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  134. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  135. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  136. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  137. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  138. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  139. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  140. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  141. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  142. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  143. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  144. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  145. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  146. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  147. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  148. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  149. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  150. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  151. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  152. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  153. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  154. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  155. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  156. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  157. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  158. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  159. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  160. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  161. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  162. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  163. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  164. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  166. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  167. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  168. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  169. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  170. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  171. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  172. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  173. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  174. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  175. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  176. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  177. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  178. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  179. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  180. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  181. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  182. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  183. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  184. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  185. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  186. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  187. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  188. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  189. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  190. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  191. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  192. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  193. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  194. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  195. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  197. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  198. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  199. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  200. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  201. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  202. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  203. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  204. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  205. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  207. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  208. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  209. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  210. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  212. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  213. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  214. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  215. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  216. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  217. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  218. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  219. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  220. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  222. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
  223. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  224. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  225. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  226. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  227. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
  228. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  229. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
  230. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  232. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  233. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  234. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  235. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  236. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  237. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  239. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  240. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  243. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  244. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  245. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  248. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  249. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  251. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  252. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  254. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  255. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  258. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  259. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  261. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  262. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  264. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  265. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  268. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  269. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  271. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  274. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  275. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  278. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  279. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  281. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  283. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  284. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  285. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  287. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  288. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  289. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  290. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/index.html +1 -1
  292. package/app/.next-cli-build/server/app/index.rsc +3 -3
  293. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  295. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  297. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  299. package/app/.next-cli-build/server/app/landing.html +1 -1
  300. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  301. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  302. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  303. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  304. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  305. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  307. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  308. package/app/.next-cli-build/server/app/login.html +1 -1
  309. package/app/.next-cli-build/server/app/login.rsc +4 -4
  310. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  311. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  313. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  315. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  317. package/app/.next-cli-build/server/app-paths-manifest.json +14 -14
  318. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  319. package/app/.next-cli-build/server/chunks/1531.js +1 -1
  320. package/app/.next-cli-build/server/chunks/1770.js +1 -1
  321. package/app/.next-cli-build/server/chunks/2547.js +3 -3
  322. package/app/.next-cli-build/server/chunks/3352.js +1 -1
  323. package/app/.next-cli-build/server/chunks/369.js +16 -16
  324. package/app/.next-cli-build/server/chunks/4843.js +1 -1
  325. package/app/.next-cli-build/server/chunks/5315.js +1 -1
  326. package/app/.next-cli-build/server/chunks/5502.js +1 -1
  327. package/app/.next-cli-build/server/chunks/5767.js +1 -1
  328. package/app/.next-cli-build/server/chunks/5841.js +1 -1
  329. package/app/.next-cli-build/server/chunks/6606.js +1 -1
  330. package/app/.next-cli-build/server/chunks/6982.js +1 -1
  331. package/app/.next-cli-build/server/chunks/7079.js +1 -1
  332. package/app/.next-cli-build/server/chunks/7335.js +1 -1
  333. package/app/.next-cli-build/server/chunks/7591.js +1 -1
  334. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  335. package/app/.next-cli-build/server/chunks/7889.js +1 -1
  336. package/app/.next-cli-build/server/chunks/8002.js +1 -1
  337. package/app/.next-cli-build/server/chunks/8034.js +1 -1
  338. package/app/.next-cli-build/server/chunks/8243.js +1 -1
  339. package/app/.next-cli-build/server/chunks/8327.js +7 -7
  340. package/app/.next-cli-build/server/chunks/8421.js +1 -1
  341. package/app/.next-cli-build/server/chunks/915.js +1 -1
  342. package/app/.next-cli-build/server/chunks/921.js +1 -1
  343. package/app/.next-cli-build/server/chunks/9212.js +1 -1
  344. package/app/.next-cli-build/server/chunks/9356.js +2 -2
  345. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  346. package/app/.next-cli-build/server/chunks/9573.js +1 -1
  347. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  348. package/app/.next-cli-build/server/pages/404.html +1 -1
  349. package/app/.next-cli-build/server/pages/500.html +1 -1
  350. package/app/.next-cli-build/static/chunks/{1321-d960790950cf69e9.js → 1321-2afc09de622a4598.js} +1 -1
  351. package/app/.next-cli-build/static/chunks/316-60e8ba3cfa73b4f9.js +1 -0
  352. package/app/.next-cli-build/static/chunks/8105-ddf64e1006ae16f8.js +1 -0
  353. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-40b649726913b166.js +1 -0
  354. package/app/CHANGELOG.md +29 -1
  355. package/app/package.json +1 -1
  356. package/app/public/CHANGELOG.md +29 -1
  357. package/package.json +1 -1
  358. package/app/.next-cli-build/static/chunks/316-338292ed1e0e0c2d.js +0 -1
  359. package/app/.next-cli-build/static/chunks/8105-74ce2cd62f81a87d.js +0 -1
  360. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-0c64fbc888c74b51.js +0 -1
  361. /package/app/.next-cli-build/static/{VPp5UAgAM1eEBzLPINnic → MXNgo9yJbNyyCpuZ-4uFJ}/_buildManifest.js +0 -0
  362. /package/app/.next-cli-build/static/{VPp5UAgAM1eEBzLPINnic → MXNgo9yJbNyyCpuZ-4uFJ}/_ssgManifest.js +0 -0
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3826],{62022:(e,t,r)=>{Promise.resolve().then(r.bind(r,75095)),Promise.resolve().then(r.bind(r,25086))},75095:(e,t,r)=>{"use strict";r.d(t,{default:()=>M});var a=r(95155),i=r(12115),s=r(57250),n=r(47218);let l="quotaCacheData",o="quotaAutoRefresh",d=[10,20,50,100],c=[{value:"all",label:"All accounts"},{value:"active",label:"Active"},{value:"inactive",label:"Turned off"}],u=[{value:"default",label:"Default quota order"},{value:"remaining-asc",label:"% quota: low to high"},{value:"remaining-desc",label:"% quota: high to low"}];function m(e){return e.name?.trim()||e.email?.trim()||e.displayName?.trim()||null}function x(e,t){let r=t[e.id]?.quotas?.[0];return r&&"number"==typeof r.remaining?r.remaining:1/0}function h(e){let t={};return e.forEach(e=>{t[e.id]=!0}),t}function p(e,t){let r=new Set(t.map(e=>e.id));return Object.fromEntries(Object.entries(e).filter(([e])=>r.has(e)))}async function b(e,t){return await e(t)}function g(){try{let e=window.localStorage.getItem(l);return e?JSON.parse(e):{}}catch(e){return console.error("Error reading quota cache:",e),{}}}function f(e,t){try{let r=g();r[e]={...t,cachedAt:new Date().toISOString()},window.localStorage.setItem(l,JSON.stringify(r))}catch(e){console.error("Error writing quota cache:",e)}}function y(e,t){return t&&0!==t?!e||e<0?100:e>=t?0:Math.round((t-e)/t*100):0}function v(e){return e&&"object"==typeof e?String(e.modelKey||e.name||"").trim():""}function k(e,t){let r=t?.[e]?.hidden;return new Set(Array.isArray(r)?r.map(String):[])}function w({quotas:e=[],compact:t=!1,sortMode:r="default",showSortLabel:s=!1,onHideQuota:n=null}){let[l,o]=(0,i.useState)(1),d=(0,i.useMemo)(()=>e.map((e,t)=>({...e,index:t,remaining:e?.remaining!==void 0?Math.max(0,Math.round(e.remaining)):e?.remainingPercentage!==void 0?Math.round(e.remainingPercentage):y(e?.used,e?.total)})),[e]),c=(0,i.useMemo)(()=>"remaining-asc"===r?[...d].sort((e,t)=>e.remaining-t.remaining||e.name.localeCompare(t.name)):"remaining-desc"===r?[...d].sort((e,t)=>t.remaining-e.remaining||e.name.localeCompare(t.name)):d,[d,r]),u=Math.max(1,Math.ceil(c.length/10));if((0,i.useEffect)(()=>{o(1)},[r,e]),(0,i.useEffect)(()=>{o(e=>Math.min(e,u))},[u]),!e||0===e.length)return null;let m=c.slice((l-1)*10,10*l),x=0===c.length?0:(l-1)*10+1,h=Math.min(10*l,c.length),p=t?"py-1 px-1.5":"py-2 px-3",b=t?"text-[11px]":"text-sm",g=t?"text-[11px]":"text-sm",f=t?"text-[10px] leading-tight":"text-xs",v="function"==typeof n;return(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"text-[10px] text-text-muted",children:[c.length," quota",c.length>1?"s":""]}),s&&(0,a.jsx)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1 text-[10px] text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"Sorted by account remaining"})]}),(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("table",{className:"w-full table-fixed text-left",children:(0,a.jsx)("tbody",{children:m.map(e=>{var r;let i=(r=e.remaining)>70?{text:"text-green-600 dark:text-green-400",bg:"bg-green-500",bgLight:"bg-green-500/10",emoji:"\uD83D\uDFE2"}:r>=30?{text:"text-yellow-600 dark:text-yellow-400",bg:"bg-yellow-500",bgLight:"bg-yellow-500/10",emoji:"\uD83D\uDFE1"}:{text:"text-red-600 dark:text-red-400",bg:"bg-red-500",bgLight:"bg-red-500/10",emoji:"\uD83D\uDD34"},s=function(e){if(!e)return"-";try{let t="string"==typeof e?new Date(e):e,r=new Date,a=t-r;if(a<=0)return"-";let i=Math.ceil(a/6e4);if(i<60)return`${i}m`;let s=Math.floor(i/60),n=i%60;if(s<24)return`${s}h ${n}m`;let l=Math.floor(s/24);return`${l}d ${s%24}h ${n}m`}catch(e){return"-"}}(e.resetAt),l=function(e){if(!e)return null;try{let t=new Date(e),r=new Date,a=new Date(r.getFullYear(),r.getMonth(),r.getDate()),i=new Date(a);i.setDate(i.getDate()+1);let s="";s=t>=a&&t<i?"Today":t>=i&&t<new Date(i.getTime()+864e5)?"Tomorrow":t.toLocaleDateString("en-US",{month:"short",day:"numeric"});let n=t.toLocaleTimeString("en-US",{hour:"numeric",minute:"2-digit",hour12:!0});return`${s}, ${n}`}catch{return null}}(e.resetAt),o=!1!==e.recurring?`in ${s}`:`expires in ${s}`;return(0,a.jsxs)("tr",{className:"border-b border-black/5 dark:border-white/5 hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors",children:[(0,a.jsx)("td",{className:`${p} w-[30%]`,children:(0,a.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,a.jsx)("span",{className:"text-[10px] shrink-0",children:i.emoji}),(0,a.jsx)("span",{className:`${b} font-medium text-text-primary truncate`,children:e.name}),e.runtimeLimited&&(e.runtimeActionUrl?(0,a.jsx)("a",{href:e.runtimeActionUrl,target:"_blank",rel:"noreferrer",className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 underline decoration-dotted underline-offset-2 dark:text-amber-400",title:e.runtimeLimitReason||"Verify this Google account, then retry the model.",children:e.runtimeLimitLabel||"account blocked"}):(0,a.jsx)("span",{className:"shrink-0 rounded bg-amber-500/15 px-1 py-0.5 text-[9px] font-medium text-amber-600 dark:text-amber-400",title:e.runtimeLimitReason||"The provider runtime rejected this model even though the quota endpoint still reports capacity.",children:e.runtimeLimitLabel||"runtime limit"}))]})}),(0,a.jsx)("td",{className:`${p} w-[45%]`,children:(0,a.jsxs)("div",{className:t?"space-y-1":"space-y-1.5",children:[(0,a.jsx)("div",{className:`${t?"h-1":"h-1.5"} rounded-full overflow-hidden border ${i.bgLight} ${0===e.remaining?"border-black/10 dark:border-white/10":"border-transparent"}`,children:(0,a.jsx)("div",{className:`h-full transition-all duration-300 ${i.bg}`,style:{width:`${Math.min(e.remaining,100)}%`}})}),(0,a.jsxs)("div",{className:`flex items-center justify-between ${t?"text-[10px]":"text-xs"}`,children:[(0,a.jsx)("span",{className:"text-text-muted",children:e.percentageOnly?(0,a.jsx)("span",{title:e.quotaNote||"The provider does not expose an absolute request count.",children:"count unavailable"}):(0,a.jsxs)(a.Fragment,{children:[e.used.toLocaleString()," / ",e.total>0?e.total.toLocaleString():"∞"]})}),(0,a.jsxs)("span",{className:`font-medium ${i.text}`,children:[e.remaining,"%"]})]})]})}),(0,a.jsx)("td",{className:`${p} ${v?"w-[20%]":"w-[25%]"}`,children:"-"!==s||l?t?(0,a.jsx)("div",{className:`${g} text-text-primary font-medium truncate`,title:l||"",children:"-"!==s?o:l}):(0,a.jsxs)("div",{className:"space-y-0.5",children:["-"!==s&&(0,a.jsx)("div",{className:`${g} text-text-primary font-medium`,children:o}),l&&(0,a.jsx)("div",{className:`${f} text-text-muted`,children:l})]}):(0,a.jsx)("div",{className:`${g} text-text-muted italic`,children:"N/A"})}),v&&(0,a.jsx)("td",{className:`${p} w-[5%] text-right`,children:(0,a.jsx)("button",{type:"button",onClick:()=>n(e),className:"inline-flex h-6 w-6 items-center justify-center rounded-md text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5",title:"Hide this quota row","aria-label":`Hide quota ${e.name}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"visibility_off"})})})]},`${e.name}-${e.index}`)})})})}),u>1&&(0,a.jsxs)("div",{className:"rounded-md border border-black/10 bg-black/[0.02] px-2 py-1.5 dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2 text-[10px] text-text-muted",children:[(0,a.jsxs)("span",{children:["Showing ",x,"-",h," of ",c.length]}),(0,a.jsxs)("span",{children:["Page ",l," / ",u]})]}),(0,a.jsxs)("div",{className:"mt-1.5 flex items-center justify-end gap-1",children:[(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.max(1,e-1)),disabled:1===l,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Prev"}),(0,a.jsx)("button",{type:"button",onClick:()=>o(e=>Math.min(u,e+1)),disabled:l===u,className:"flex h-6 items-center rounded-md border border-black/10 px-2 text-[10px] text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Next"})]})]})]})}var j=r(98542),N=r(97677),C=r(84588),S=r(35497),A=r(88105),$=r(11059);let q={"builder-id":"AWS Builder ID",idc:"IAM Identity Center",google:"Google",github:"GitHub",imported:"Imported Token",api_key:"API Key"},E={claude:"claudeAutoPing",codex:"codexAutoPing"},P={claude:"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",codex:"Auto-starts the next 5h Codex window after reset by sending a tiny request to an available model. Consumes a small amount of quota."};function T(e){return e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null}function D(e){let t=e.providerSpecificData?.region;if(t)return t;let r=e.providerSpecificData?.profileArn;return("string"==typeof r?r.split(":")[3]:"")||""}function L(e){if(!e)return"N/A";let t=new Date(e);return Number.isFinite(t.getTime())?t.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):"N/A"}function M(){let{copied:e,copy:t}=(0,$.C)(),[r,M]=(0,i.useState)([]),[O,_]=(0,i.useState)({}),[I,F]=(0,i.useState)({}),[z,R]=(0,i.useState)({}),[U,H]=(0,i.useState)(!0),[J,K]=(0,i.useState)({claude:{},codex:{}}),[G,V]=(0,i.useState)(null),[W,B]=(0,i.useState)(!1),[Q,Y]=(0,i.useState)(!1),[X,Z]=(0,i.useState)(60),[ee,et]=(0,i.useState)(!0),[er,ea]=(0,i.useState)(null),[ei,es]=(0,i.useState)(null),[en,el]=(0,i.useState)(null),[eo,ed]=(0,i.useState)(null),[ec,eu]=(0,i.useState)(null),[em,ex]=(0,i.useState)(!1),[eh,ep]=(0,i.useState)(null),[eb,eg]=(0,i.useState)([]),[ef,ey]=(0,i.useState)("all"),[ev,ek]=(0,i.useState)([]),[ew,ej]=(0,i.useState)("all"),[eN,eC]=(0,i.useState)("default"),[eS,eA]=(0,i.useState)({}),[e$,eq]=(0,i.useState)(!1),[eE,eP]=(0,i.useState)(!1),[eT,eD]=(0,i.useState)(!1),[eL,eM]=(0,i.useState)(1),[eO,e_]=(0,i.useState)(20),[eI,eF]=(0,i.useState)(String(20)),[ez,eR]=(0,i.useState)({page:1,pageSize:20,total:0,totalPages:1}),[eU,eH]=(0,i.useState)({eligibleConnections:0,providerFilteredConnections:0}),eJ=(0,i.useRef)(null),eK=(0,i.useRef)(null),eG=(0,i.useRef)(0),eV=(0,i.useCallback)(async(e=eL)=>{try{var t,r;let a=new URLSearchParams({page:String(e),pageSize:String(eO),accountStatus:ew,sort:"priority"});"all"!==ef&&a.set("provider",ef);let i=await fetch(`/api/providers/client?${a.toString()}`);if(!i.ok)throw Error("Failed to fetch connections");let s=await i.json(),n=s.connections||[],l=(t=s.pagination,t||{page:1,pageSize:eO,total:0,totalPages:1}),o=function(e,t=0){return e||{eligibleConnections:t,providerFilteredConnections:t}}(s.totals,n.length);return M(n),ek(s.providerOptions||[]),eR(l),eH(o),eM((r=s.pagination,r?.page||e)),n}catch(e){return console.error("Error fetching connections:",e),M([]),ek([]),eR({page:1,pageSize:eO,total:0,totalPages:1}),eH({eligibleConnections:0,providerFilteredConnections:0}),[]}},[ew,e$,eL,eO,ef]),eW=(0,i.useCallback)(async(e,t,{force:r=!1}={})=>{F(t=>({...t,[e]:!0})),R(t=>({...t,[e]:null}));try{console.log(`[ProviderLimits] Fetching quota for ${t} (${e})`);let a=`/api/usage/${e}${r?"?force=1":""}`,i=await fetch(a);if(!i.ok){let r=(await i.json().catch(()=>({}))).error||i.statusText;if(404===i.status)return void console.warn(`[ProviderLimits] Connection not found for ${t}, skipping`);if(401===i.status){console.warn(`[ProviderLimits] Auth error for ${t}:`,r);let a={quotas:[],message:r};_(t=>({...t,[e]:a})),f(e,a);return}throw Error(`HTTP ${i.status}: ${r}`)}let s=await i.json();console.log(`[ProviderLimits] Got quota for ${t}:`,s);let l={quotas:function(e,t){if(!t||"object"!=typeof t)return[];let r=[];try{switch(e.toLowerCase()){case"github":default:t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"antigravity":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:t.displayName||e,modelKey:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage,runtimeLimited:!0===t.runtimeLimited,runtimeLimitLabel:t.runtimeLimitLabel,runtimeLimitReason:t.runtimeLimitReason,runtimeActionUrl:t.runtimeActionUrl,percentageOnly:!0===t.percentageOnly,quotaNote:t.quotaNote})});break;case"codex":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{let a=e;"spark_session"===e?a="Spark (5h)":"spark_weekly"===e?a="Spark (Weekly)":"session"===e?a="5h":"weekly"===e?a="Weekly":"review_session"===e?a="Review (5h)":"review_weekly"===e&&(a="Review (Weekly)"),r.push({name:a,quotaType:e,used:t.used||0,total:t.total||0,remaining:t.remaining,resetAt:t.resetAt||null})});break;case"kiro":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"qoder":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{"organization"===e&&(!t||[t.total,t.used,t.remaining].every(e=>0===(Number(e)||0)))||r.push({name:"user"===e?"Personal":"organization"===e?"Organization":e,used:t.used||0,total:Math.max(0,Number(t.total)||0)||(Number(t.used)||0)+(Number(t.remaining)||0),unit:t.unit,resetAt:t.resetAt||null})});break;case"claude":t.message?r.push({name:"error",used:0,total:0,resetAt:null,message:t.message}):t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})});break;case"vercel-ai-gateway":case"ollama":case"deepseek":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"codebuddy-cn":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,recurring:!1!==t.recurring})});break;case"grok-cli":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"kimi":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null,remainingPercentage:t.remainingPercentage})});break;case"cursor":t.quotas&&Object.entries(t.quotas).forEach(([e,t])=>{r.push({name:e,used:t.used||0,total:t.total||0,resetAt:t.resetAt||null})})}}catch(t){return console.error(`Error parsing quota data for ${e}:`,t),[]}let a=(0,n.KC)(e);if(a.length>0){let e=new Map(a.map((e,t)=>[e.id,t]));r.sort((t,r)=>{let a=t.modelKey||t.name,i=r.modelKey||r.name;return(e.get(a)??999)-(e.get(i)??999)})}return r}(t,s),plan:s.plan||null,message:s.message||null,raw:s};_(t=>({...t,[e]:l})),f(e,l)}catch(r){console.error(`[ProviderLimits] Error fetching quota for ${t} (${e}):`,r),R(t=>({...t,[e]:r.message||"Failed to fetch quota"}))}finally{F(t=>({...t,[e]:!1}))}},[]),eB=(0,i.useCallback)(async(e,t)=>{await eW(e,t,{force:!0}),V(new Date)},[eW]),eQ=(0,i.useCallback)(async(e,t)=>{if("codex"===t&&!en){el(e),R(t=>({...t,[e]:null}));try{let r=await fetch(`/api/usage/${e}/codex-reset-credits`,{method:"POST"}),a=await r.json().catch(()=>({}));if(!r.ok)throw Error(a.message||a.error||a.code||"Failed to reset Codex limit");await eW(e,t),V(new Date)}catch(t){R(r=>({...r,[e]:t.message||"Failed to reset Codex limit"}))}finally{el(null)}}},[eW,en]),eY=(0,i.useCallback)(async e=>{eu({connection:e,loading:!0,error:null,data:null});try{let t=await fetch(`/api/usage/${e.id}/codex-reset-credits`,{cache:"no-store"}),r=await t.json().catch(()=>({}));if(!t.ok)throw Error(r.error||r.message||"Failed to load Codex reset credits");let a=Array.isArray(r.credits)?[...r.credits]:[];a.sort((e,t)=>{let r=e.expiresAt?new Date(e.expiresAt).getTime():1/0,a=t.expiresAt?new Date(t.expiresAt).getTime():1/0;return r-a}),eu({connection:e,loading:!1,error:null,data:{...r,credits:a}})}catch(t){eu({connection:e,loading:!1,error:t.message||"Failed to load Codex reset credits",data:null})}},[]),eX=(0,i.useCallback)(async e=>{if(confirm("Delete this connection?")){ea(e);try{if((await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok){_(t=>{let r={...t};return delete r[e],r}),F(t=>{let r={...t};return delete r[e],r}),R(t=>{let r={...t};return delete r[e],r});try{let t=g();t[e]&&(delete t[e],window.localStorage.setItem(l,JSON.stringify(t)))}catch(e){console.error("Error deleting cache entry:",e)}await b(eV,eL)}}catch(e){console.error("Error deleting connection:",e)}finally{ea(null)}}},[eV,eL]),eZ=(0,i.useCallback)(async(e,t)=>{es(e);try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&(_(e=>({...e})),await b(eV,eL))}catch(e){console.error("Error updating connection status:",e)}finally{es(null)}},[eV,eL]),e0=(0,i.useCallback)(async e=>{if(!eh?.id)return;let t=eh.id,r=eh.provider;try{(await fetch(`/api/providers/${t}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await eV(),ex(!1),ep(null),A.wb.includes(r)&&await eW(t,r))}catch(e){console.error("Error saving connection:",e)}},[eh,eV,eW]);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}).then(e=>e.json()).then(t=>{!e&&t?.proxyPools&&eg(t.proxyPools)}).catch(()=>{}),()=>{e=!0}},[]);let e1=(0,i.useCallback)(async(e=!1)=>{if(Q)return;Y(!0),Z(60);let t=eG.current+=1,r=Math.round(10);try{let a=await eV(eL);F(h(a)),R(e=>p(e,a)),_(e=>p(e,a)),await Promise.all(a.filter(a=>e||"claude"!==a.provider||t%r==0).map(e=>eW(e.id,e.provider))),V(new Date)}catch(e){console.error("Error refreshing all providers:",e)}finally{Y(!1)}},[Q,eV,eW,eL]);(0,i.useEffect)(()=>{(async()=>{et(!0);let e=await eV(eL);et(!1),F(h(e)),R(t=>p(t,e)),_(t=>p(t,e)),await Promise.all(e.map(e=>eW(e.id,e.provider))),V(new Date)})()},[eV,eW,eL]),(0,i.useEffect)(()=>{let e=window.localStorage.getItem(o);H(null===e||"true"===e),B(!0)},[]),(0,i.useEffect)(()=>{W&&window.localStorage.setItem(o,String(U))},[U,W]),(0,i.useEffect)(()=>{fetch("/api/settings",{cache:"no-store"}).then(e=>e.ok?e.json():{}).then(e=>{K({claude:e?.claudeAutoPing?.connections||{},codex:e?.codexAutoPing?.connections||{}}),eA(e?.quotaVisibility||{})}).catch(()=>{})},[]);let e5=(0,i.useCallback)(async(e,t,r)=>{let a=E[t];if(!a)return;let i={...J[t]||{},[e]:r};K({...J,[t]:i});try{let e=await fetch("/api/settings",{cache:"no-store"}),t={...(e.ok?await e.json():{})[a]||{},connections:i};await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({[a]:t})})}catch{K(J)}},[J]),e2=(0,i.useCallback)(async(e,t)=>{eA(e);try{if(!(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({quotaVisibility:e})})).ok)throw Error("Failed to update quota visibility")}catch(e){console.error("Error updating quota visibility:",e),eA(t)}},[]),e3=(0,i.useCallback)((e,t)=>{let r=v(t);if(!e||!r)return;let a=eS[e]||{},i=new Set(a.hidden||[]);i.add(r),e2({...eS,[e]:{...a,hidden:[...i]}},eS)},[eS,e2]),e4=(0,i.useCallback)((e,t)=>{let r=v(t);if(!e||!r)return;let a=eS[e]||{},i=new Set(a.hidden||[]);i.delete(r),e2({...eS,[e]:{...a,hidden:[...i]}},eS)},[eS,e2]);(0,i.useEffect)(()=>{if(!W||!U){eJ.current&&(clearInterval(eJ.current),eJ.current=null),eK.current&&(clearInterval(eK.current),eK.current=null);return}return eJ.current=setInterval(()=>{e1()},6e4),eK.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3),()=>{eJ.current&&clearInterval(eJ.current),eK.current&&clearInterval(eK.current)}},[U,e1,W]),(0,i.useEffect)(()=>{let e=()=>{document.hidden?(eJ.current&&(clearInterval(eJ.current),eJ.current=null),eK.current&&(clearInterval(eK.current),eK.current=null)):U&&W&&(eJ.current=setInterval(()=>e1(),6e4),eK.current=setInterval(()=>{Z(e=>e<=1?60:e-1)},1e3))};return document.addEventListener("visibilitychange",e),()=>{document.removeEventListener("visibilitychange",e)}},[U,e1,W]);let e8=(0,i.useMemo)(()=>(function(e,t,r,a,i){if("codex"===a&&"default"!==i)return[...e].sort((e,r)=>{let a=x(e,t),s=x(r,t),n="remaining-asc"===i?a-s:s-a;return 0!==n?n:(m(e)||"").localeCompare(m(r)||"")});if(!r){let t=new Map;for(let r of e){let e=r.provider||"";t.has(e)||t.set(e,[]),t.get(e).push(r)}return Array.from(t.values()).flat()}let s=e=>{let r=(t[e.id]?.quotas||[]).map(e=>e.resetAt?new Date(e.resetAt).getTime():1/0).filter(e=>Number.isFinite(e));return r.length>0?Math.min(...r):1/0};return[...e].sort((e,t)=>{let r=s(e)-s(t);return 0!==r?r:(e.provider||"").localeCompare(t.provider||"")||(m(e)||"").localeCompare(m(t)||"")})})(r,O,e$,ef,eN),[r,O,e$,ef,eN]),e6=e=>{let t=O[e.id]?.quotas;return!!t?.length&&t.some(e=>!!e.total&&!(e.total<=0)&&5>=y(e.used,e.total))},e9=(0,i.useCallback)(async(e,t)=>{if(e.length&&!eT){eD(!0);try{await Promise.all(e.map(e=>fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})}))),await b(eV,eL)}catch(e){console.error("Error bulk toggling connections:",e)}finally{eD(!1)}}},[eT,eV,eL]),e7="all"===ef?"All providers":ef,te=eU.eligibleConnections>0,tt=e8.length>0,tr=eU.eligibleConnections?eU.providerFilteredConnections?{icon:"filter_alt_off",title:"No Accounts On This Page",description:"Try moving to another page or refreshing the current filters."}:{icon:"filter_alt_off",title:"No Accounts Match Current Filters",description:"all"===ef?"Try changing the account status filter to see more quota trackers.":`No ${"inactive"===ew?"turned off":"active"===ew?"active":"matching"} accounts found for ${ef}.`}:{icon:"cloud_off",title:"No Providers Connected",description:"Connect to providers with OAuth to track your API quota limits and usage."},ta=function(e){var t;let{start:r,end:a}=(t=e).total?{start:(t.page-1)*t.pageSize+1,end:Math.min(t.page*t.pageSize,t.total)}:{start:0,end:0};return`Showing ${r}-${a} of ${e.total}`}(ez),ti=!d.includes(eO);return ee||te?ee||tt?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-end",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,a.jsxs)("div",{className:"relative",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>eP(e=>!e),className:"flex h-8 items-center justify-between gap-1 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-haspopup":"menu","aria-expanded":eE,title:"Filter quota providers",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:["all"===ef?(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"apps"}):(0,a.jsx)(s.A,{src:`/providers/${ef}.png`,alt:ef,size:18,className:"size-[18px] rounded object-contain",fallbackText:ef.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"truncate capitalize hidden lg:inline",children:e7})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:"expand_more"})]}),eE&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{type:"button",className:"fixed inset-0 z-30 bg-transparent","aria-label":"Close provider filter",onClick:()=>eP(!1)}),(0,a.jsxs)("div",{className:"absolute left-0 z-40 mt-2 w-64 overflow-hidden rounded-2xl border border-black/10 bg-surface/95 p-1.5 shadow-xl shadow-black/10 backdrop-blur dark:border-white/10 dark:bg-surface/95 sm:w-72",children:[(0,a.jsxs)("button",{type:"button",onClick:()=>{"all"!==ef&&eM(1),ey("all"),eP(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${"all"===ef?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[22px]",children:"apps"}),(0,a.jsx)("span",{className:"font-medium",children:"All providers"}),"all"===ef&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]}),(0,a.jsx)("div",{className:"my-1 h-px bg-black/10 dark:bg-white/10"}),(0,a.jsx)("div",{className:"max-h-72 overflow-y-auto pr-1",children:ev.map(e=>(0,a.jsxs)("button",{type:"button",onClick:()=>{ef!==e&&eM(1),ey(e),eP(!1)},className:`flex w-full items-center gap-3 rounded-xl px-3 py-2.5 text-left text-sm transition-colors ${ef===e?"bg-primary/10 text-primary":"text-text-primary hover:bg-black/5 dark:hover:bg-white/10"}`,children:[(0,a.jsx)(s.A,{src:`/providers/${e}.png`,alt:e,size:24,className:"size-6 rounded-md object-contain",fallbackText:e.slice(0,2).toUpperCase()}),(0,a.jsx)("span",{className:"font-medium capitalize",children:e}),ef===e&&(0,a.jsx)("span",{className:"material-symbols-outlined ml-auto text-[20px]",children:"check"})]},e))})]})]})]}),(0,a.jsx)("select",{value:ew,onChange:e=>{let t=e.target.value;ew!==t&&eM(1),ej(t)},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Filter accounts by status",children:c.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),"codex"===ef&&(0,a.jsx)("select",{value:eN,onChange:e=>eC(e.target.value),className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Sort Codex quotas by remaining",children:u.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsxs)("button",{type:"button",onClick:()=>eq(e=>!e),"aria-pressed":e$,className:`flex h-8 shrink-0 items-center gap-1 rounded-lg border px-2 text-xs transition-colors ${e$?"border-amber-500/40 bg-amber-500/10 text-amber-500":"border-black/10 text-text-primary hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5"}`,title:"Sort accounts by earliest quota reset time",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"hourglass_top"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Expiring first"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e9(e8.filter(e=>(e.isActive??!0)&&e6(e)).map(e=>e.id),!1)},disabled:eT,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-red-500/30 px-2 text-xs text-red-500 transition-colors hover:bg-red-500/10 disabled:opacity-50",title:"Disable connections with depleted quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"block"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn off Empty"})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{e9(e8.filter(e=>!(e.isActive??!0)&&!e6(e)).map(e=>e.id),!0)},disabled:eT,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-emerald-500/30 px-2 text-xs text-emerald-500 transition-colors hover:bg-emerald-500/10 disabled:opacity-50",title:"Enable connections that still have quota on the current page",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check_circle"}),(0,a.jsx)("span",{className:"hidden sm:inline",children:"Turn on Available"})]}),(0,a.jsxs)("button",{onClick:()=>H(e=>!e),className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5",title:U?"Disable auto-refresh":"Enable auto-refresh",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${U?"text-primary":"text-text-muted"}`,children:U?"toggle_on":"toggle_off"}),(0,a.jsx)("span",{className:"hidden text-text-primary sm:inline",children:"Auto-refresh"}),U&&(0,a.jsxs)("span",{className:"text-[10px] text-text-muted tabular-nums",children:["(",X,"s)"]})]}),(0,a.jsx)("button",{type:"button",onClick:()=>e1(!0),disabled:Q,className:"flex h-8 shrink-0 items-center gap-1 rounded-lg border border-black/10 px-2 text-xs text-text-primary transition-colors hover:bg-black/5 dark:border-white/10 dark:hover:bg-white/5 disabled:opacity-50",title:"Refresh all",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[14px] ${Q?"animate-spin":""}`,children:"refresh"})})]})}),e$&&(0,a.jsx)("div",{className:"rounded-xl border border-amber-500/20 bg-amber-500/10 px-3 py-2 text-xs text-amber-700 dark:text-amber-300",children:"Expiring-first currently reorders accounts inside the current page. Cross-page ordering still follows backend pagination."}),(0,a.jsx)("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e8.map(r=>{let i,n,l,o,d=O[r.id],c=I[r.id],u=z[r.id],x=!1===r.isActive,h="codex"===r.provider,p=h?(i=d?.plan?.trim())&&"unknown"!==i.toLowerCase()?i:r?.providerSpecificData?.chatgptPlanType?.trim()||null:null,b=Number.isFinite(l="number"==typeof(n=d?.raw?.resetCredits?.availableCount)?n:Number(n))?Math.max(0,l):0,g=en===r.id,f=er===r.id||ei===r.id||g,y=d?.quotas||[],S=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=k(e,r);return 0===a.size?t:t.filter(e=>!a.has(v(e)))}(r.provider,y,eS),A=function(e,t=[],r={}){if(!Array.isArray(t)||0===t.length)return[];let a=k(e,r);return 0===a.size?[]:t.filter(e=>a.has(v(e)))}(r.provider,y,eS);return(0,a.jsxs)(C.default,{padding:"none",className:`min-w-0 ${x?"opacity-60":""}`,children:[(0,a.jsx)("div",{className:"px-3 py-2 border-b border-black/10 dark:border-white/10",children:(0,a.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,a.jsx)("div",{className:"w-8 h-8 shrink-0 rounded-md flex items-center justify-center overflow-hidden",children:(0,a.jsx)(s.A,{src:`/providers/${r.provider}.png`,alt:r.provider,size:32,className:"object-contain",fallbackText:r.provider?.slice(0,2).toUpperCase()||"PR"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-primary capitalize truncate",children:r.provider}),m(r)?(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:m(r)}):null,T(r)?(0,a.jsx)("p",{className:"text-[11px] text-text-muted/80 truncate",children:T(r)}):null,p?(0,a.jsx)("span",{className:"mt-1 inline-flex rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:p}):null,"kiro"===r.provider&&(0,a.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-1",children:[(0,a.jsx)("span",{className:"rounded-full bg-brand-500/10 px-2 py-0.5 text-[10px] font-semibold text-brand-600 dark:text-brand-300",children:(o=r.providerSpecificData?.authMethod)&&q[o]?q[o]:"api_key"===r.authType?"API Key":"OAuth"}),D(r)&&(0,a.jsx)("span",{className:"rounded-full bg-blue-500/10 px-2 py-0.5 text-[10px] font-semibold text-blue-600 dark:text-blue-400",children:D(r)}),(0,a.jsx)("span",{className:`rounded-full px-2 py-0.5 text-[10px] font-semibold ${x?"bg-surface-2 text-text-muted":"active"===r.testStatus||"success"===r.testStatus?"bg-green-500/10 text-green-600 dark:text-green-400":"error"===r.testStatus||"expired"===r.testStatus||"unavailable"===r.testStatus?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-surface-2 text-text-muted"}`,children:x?"disabled":r.testStatus||"unknown"}),r.providerSpecificData?.profileArn&&(0,a.jsxs)("button",{type:"button",onClick:()=>t(r.providerSpecificData.profileArn,r.id),title:r.providerSpecificData.profileArn,className:"inline-flex max-w-full items-center gap-1 rounded-full border border-border-subtle px-2 py-0.5 text-[10px] text-text-muted transition-colors hover:text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:e===r.id?"check":"content_copy"}),(0,a.jsx)("code",{className:"truncate font-mono",children:r.providerSpecificData.profileArn})]})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1 shrink-0",children:[h&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(N.default,{text:b>0?`Use one Codex reset credit. Available: ${b}`:"No Codex reset credits available",children:(0,a.jsxs)("button",{type:"button",onClick:()=>ed({connection:r,resetCreditCount:b}),disabled:b<=0||c||f,"aria-label":b>0?`Use one Codex reset credit. ${b} available.`:"No Codex reset credits available",className:`flex h-8 min-w-10 items-center justify-center gap-1 rounded-lg border px-2 text-[11px] font-medium tabular-nums transition-colors focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary/60 disabled:cursor-not-allowed disabled:opacity-60 ${b>0?"border-primary/30 bg-primary/5 text-primary hover:bg-primary/10":"border-black/10 bg-black/[0.02] text-text-muted dark:border-white/10 dark:bg-white/[0.03]"}`,children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${g?"animate-spin":""}`,children:g?"progress_activity":"restart_alt"}),(0,a.jsx)("span",{children:b})]})}),(0,a.jsx)(N.default,{text:"View Codex reset credit expiry",children:(0,a.jsx)("button",{type:"button",onClick:()=>eY(r),disabled:c||f,"aria-label":"View Codex reset credit expiry",className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-muted transition-colors hover:bg-black/5 hover:text-primary disabled:cursor-not-allowed disabled:opacity-50 dark:border-white/10 dark:hover:bg-white/5",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[17px]",children:"schedule"})})})]}),E[r.provider]&&"oauth"===r.authType&&(0,a.jsx)(N.default,{text:P[r.provider],children:(0,a.jsx)("button",{type:"button",onClick:()=>e5(r.id,r.provider,J[r.provider]?.[r.id]!==!0),"aria-label":"Toggle auto-ping",className:`flex h-8 w-8 items-center justify-center rounded-lg transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${J[r.provider]?.[r.id]===!0?"text-primary":"text-text-muted"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"})})}),(0,a.jsx)(N.default,{text:"Refresh quota",children:(0,a.jsx)("button",{type:"button",onClick:()=>eB(r.id,r.provider),disabled:c||f,"aria-label":"Refresh quota",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] text-text-muted ${c?"animate-spin":""}`,children:"refresh"})})}),(0,a.jsx)(N.default,{text:"Edit connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>{ep(r),ex(!0)},disabled:f,"aria-label":"Edit connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"})})}),(0,a.jsx)(N.default,{text:"Delete connection",children:(0,a.jsx)("button",{type:"button",onClick:()=>eX(r.id),disabled:f,"aria-label":"Delete connection",className:"flex h-8 w-8 items-center justify-center rounded-lg hover:bg-red-500/10 text-red-500 transition-colors disabled:opacity-50",children:(0,a.jsx)("span",{className:`material-symbols-outlined text-[18px] ${er===r.id?"animate-pulse":""}`,children:"delete"})})}),(0,a.jsx)("div",{className:"inline-flex items-center pl-0.5",title:r.isActive??!0?"Disable connection":"Enable connection",children:(0,a.jsx)(j.default,{size:"sm",checked:r.isActive??!0,disabled:f,onChange:e=>eZ(r.id,e)})})]})]})}),(0,a.jsxs)("div",{className:"px-2 py-1.5",children:[c?(0,a.jsx)("div",{className:"text-center py-5 text-text-muted",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] animate-spin",children:"progress_activity"})}):u?(0,a.jsxs)("div",{className:"text-center py-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[28px] text-red-500",children:"error"}),(0,a.jsx)("p",{className:"mt-1.5 text-xs text-text-muted",children:u})]}):d?.message?(0,a.jsx)("div",{className:"text-center py-5",children:(0,a.jsx)("p",{className:"text-xs text-text-muted",children:d.message})}):(0,a.jsx)(w,{quotas:S,compact:!0,sortMode:"default",showSortLabel:"codex"===r.provider&&"default"!==eN,onHideQuota:e=>e3(r.provider,e)}),A.length>0&&(0,a.jsxs)("div",{className:"mt-2 flex min-w-0 items-center gap-1 border-t border-black/5 pt-2 text-[10px] text-text-muted dark:border-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[14px]",children:"visibility_off"}),(0,a.jsx)("span",{className:"shrink-0",children:"Hidden:"}),(0,a.jsx)("div",{className:"flex min-w-0 flex-1 items-center gap-1 overflow-x-auto whitespace-nowrap pb-2",children:A.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>e4(r.provider,e),className:"shrink-0 rounded-md border border-black/10 px-1.5 py-0.5 transition-colors hover:bg-black/5 hover:text-text-primary dark:border-white/10 dark:hover:bg-white/5",title:"Show this quota row",children:e.name},v(e)))})]})]})]},r.id)})}),(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:ta}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsxs)("select",{value:ti?"custom":String(eO),onChange:e=>{let t=e.target.value;if("custom"===t)return;let r=Number.parseInt(t,10);Number.isFinite(r)&&(eM(1),e_(r),eF(String(r)))},className:"h-8 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Accounts per page",children:[d.map(e=>(0,a.jsxs)("option",{value:String(e),children:[e," / page"]},e)),(0,a.jsx)("option",{value:"custom",children:"Custom"})]}),(0,a.jsx)("input",{type:"number",min:"1",max:String(500),inputMode:"numeric",value:eI,onChange:e=>eF(e.target.value),onBlur:()=>{let e=Number.parseInt(eI,10);if(!Number.isFinite(e))return void eF(String(eO));let t=Math.min(500,Math.max(1,e));eM(1),e_(t),eF(String(t))},onKeyDown:e=>{if("Enter"!==e.key)return;let t=Number.parseInt(eI,10);if(!Number.isFinite(t))return void eF(String(eO));let r=Math.min(500,Math.max(1,t));eM(1),e_(r),eF(String(r))},className:"h-8 w-20 rounded-lg border border-black/10 bg-black/[0.02] px-2 text-xs text-text-primary outline-none transition-colors hover:bg-black/5 dark:border-white/10 dark:bg-white/[0.03] dark:hover:bg-white/10","aria-label":"Custom accounts per page",placeholder:"Custom"}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Page ",ez.page," / ",ez.totalPages]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,a.jsx)("button",{type:"button",onClick:()=>eM(1),disabled:ez.page<=1||ee||Q,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"First Page"}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(e=>Math.max(1,e-1)),disabled:ez.page<=1||ee||Q,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Previous accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_left"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(e=>Math.min(ez.totalPages,e+1)),disabled:ez.page>=ez.totalPages||ee||Q,className:"flex h-8 w-8 items-center justify-center rounded-lg border border-black/10 text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5","aria-label":"Next accounts page",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"chevron_right"})}),(0,a.jsx)("button",{type:"button",onClick:()=>eM(ez.totalPages),disabled:ez.page>=ez.totalPages||ee||Q,className:"flex h-8 items-center rounded-lg border border-black/10 px-3 text-xs text-text-primary transition-colors hover:bg-black/5 disabled:cursor-not-allowed disabled:opacity-40 dark:border-white/10 dark:hover:bg-white/5",children:"Last Page"})]})]})}),(0,a.jsx)(S.uo,{isOpen:!!eo,onClose:()=>{en||ed(null)},onConfirm:async()=>{let e=eo?.connection;e&&(await eQ(e.id,e.provider),ed(null))},title:"Reset Codex limit?",message:`Use 1 Codex reset credit for ${m(eo?.connection||{})||"this account"}. This cannot be undone. Remaining credits: ${eo?.resetCreditCount??0}.`,confirmText:"Reset limit",cancelText:"Cancel",variant:"danger",loading:!!en}),ec&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 px-4 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"w-full max-w-2xl overflow-hidden rounded-2xl border border-black/15 bg-white shadow-2xl ring-1 ring-black/10 dark:border-white/15 dark:bg-neutral-950 dark:ring-white/10",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 border-b border-black/10 bg-black/[0.03] px-4 py-3 dark:border-white/10 dark:bg-white/[0.04]",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h3",{className:"text-base font-semibold text-text-primary",children:"Codex Reset Credit Expiry"}),(0,a.jsx)("p",{className:"mt-0.5 truncate text-xs text-text-muted",children:m(ec.connection)||"Codex account"})]}),(0,a.jsx)("button",{type:"button",onClick:()=>eu(null),className:"flex h-8 w-8 items-center justify-center rounded-lg text-text-muted transition-colors hover:bg-black/5 hover:text-text-primary dark:hover:bg-white/5","aria-label":"Close reset credit expiry modal",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,a.jsx)("div",{className:"max-h-[70vh] overflow-auto bg-white p-4 dark:bg-neutral-950",children:ec.loading?(0,a.jsxs)("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-[20px]",children:"progress_activity"}),"Loading reset credits..."]}):ec.error?(0,a.jsx)("div",{className:"rounded-xl border border-red-500/20 bg-red-500/10 px-3 py-2 text-sm text-red-600 dark:text-red-300",children:ec.error}):ec.data?.credits?.length?(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between rounded-xl border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:[(0,a.jsxs)("span",{children:[ec.data.credits.length," reset credit",1===ec.data.credits.length?"":"s"]}),(0,a.jsxs)("span",{children:[ec.data.availableCount??0," available"]})]}),(0,a.jsx)("div",{className:"overflow-x-auto rounded-xl border border-black/10 dark:border-white/10",children:(0,a.jsxs)("table",{className:"w-full min-w-[560px] text-left text-sm",children:[(0,a.jsx)("thead",{className:"bg-black/[0.03] text-xs uppercase tracking-wide text-text-muted dark:bg-white/[0.04]",children:(0,a.jsxs)("tr",{children:[(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Status"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Granted At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Expires At"}),(0,a.jsx)("th",{className:"px-3 py-2 font-medium",children:"Remaining"})]})}),(0,a.jsx)("tbody",{children:ec.data.credits.map((e,t)=>(0,a.jsxs)("tr",{className:"border-t border-black/5 dark:border-white/5",children:[(0,a.jsx)("td",{className:"px-3 py-2",children:(0,a.jsx)("span",{className:"rounded-full bg-primary/10 px-2 py-0.5 text-xs font-medium text-primary",children:e.status||"unknown"})}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-muted",children:L(e.grantedAt)}),(0,a.jsx)("td",{className:"px-3 py-2 text-text-primary",children:L(e.expiresAt)}),(0,a.jsx)("td",{className:"px-3 py-2 font-medium text-text-primary",children:function(e){if(!e)return"N/A";let t=new Date(e).getTime()-Date.now();if(!Number.isFinite(t))return"N/A";if(t<=0)return"Expired";let r=Math.ceil(t/36e5),a=Math.floor(r/24),i=r%24;return a>0?`${a}d ${i}h`:`${i}h`}(e.expiresAt)})]},`${e.status}-${e.expiresAt||t}`))})]})})]}):(0,a.jsx)("div",{className:"rounded-xl border border-black/10 bg-black/[0.02] px-3 py-8 text-center text-sm text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:"No reset credit details returned for this account."})})]})}),(0,a.jsx)(S.wI,{isOpen:em,connection:eh,proxyPools:eb,onSave:e0,onClose:()=>{ex(!1),ep(null)}})]}):(0,a.jsx)(C.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:tr.icon}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:tr.title}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:tr.description})]})}):(0,a.jsx)(C.default,{padding:"lg",children:(0,a.jsxs)("div",{className:"text-center py-12",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[64px] text-text-muted opacity-20",children:"cloud_off"}),(0,a.jsx)("h3",{className:"mt-4 text-lg font-semibold text-text-primary",children:"No Providers Connected"}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted max-w-md mx-auto",children:"Connect to providers with OAuth to track your API quota limits and usage."})]})})}}},e=>{e.O(0,[8010,8105,1321,801,5497,8441,3794,7358],()=>e(e.s=62022)),_N_E=e.O()}]);
package/app/CHANGELOG.md CHANGED
@@ -1,6 +1,15 @@
1
- # v0.5.71 (2026-08-22)
1
+ # v0.5.74 (2026-08-22)
2
2
 
3
3
  ## Features & Improvements
4
+ - **Upstream Sync & Enhancements (PRs #3417–#3466)**:
5
+ - **Claude Streaming**: Decloak tool names in same-format streaming passthrough (`decloakStreamChunk`) (#3466).
6
+ - **Combo & Account Fallback**: Automatically fall back to the next combo account when an upstream provider returns an empty HTTP 200 response with no text, tool calls, or reasoning (`EMPTY_CONTENT_COOLDOWN_MS`) (#3465).
7
+ - **Codex Usage**: Added GPT-5.3-Codex-Spark quota tracking support (`spark_session` and `spark_weekly`) (#3458).
8
+ - **SSE Streaming Keepalive**: Emits SSE keepalive ping every 10s during upstream inference silence for Claude Code (`SSE_KEEPALIVE_MS`) (#3457).
9
+ - **Gemini / Antigravity System Prompts**: Sanitized client branding mentions in system prompts to prevent provider-level rejections (#3454).
10
+ - **OpenCode-Go**: Added `ox-alpha-free` (`Ox Alpha Free`) and `muse-spark-1.2-contributor` models with Chat Completions transport guard and full test coverage (#3451).
11
+ - **Kimi Performance**: Enabled `forceStream: true` for Kimi Code messages to reduce TTFT from 20s to 2s (#3421).
12
+ - **MiniMax Multi-Transport**: Preserved images and OpenAI wire format for MiniMax-M3 requests on matching OpenAI transports (#3419).
4
13
  - **OAuth & Error Recovery UX**:
5
14
  - Added dedicated **"Reconnect"** action button to connection rows for expired/invalidated OAuth sessions.
6
15
  - Added friendly human-readable error messages for token expiration (`invalid_grant`, `refresh_token_expired`, `reauth_required`, `unrecoverable_refresh_error`).
@@ -17,6 +26,10 @@
17
26
  - Updated Skills dashboard display name to `EzRouter (Entry)`.
18
27
 
19
28
  ## Fixes
29
+ - **OpenCode Free & Ox Alpha Model Aliases**:
30
+ - Added upstream alias mapping in `open-sse/providers/registry/opencode.js` and `open-sse/executors/opencode.js` so that `oc/ox-alpha`, `oc/ox-alpha-free`, and `oc/x-preview-f-free` all resolve to OpenCode's wire ID `x-preview-f-free` and pass `dispatchModel` to the executor (resolves `[401]: Model ox-alpha-free is not supported`).
31
+ - Added OpenCode Free models (`mimo-v2.5-free`, `hy3-free`, `nemotron-3.5-lightning-free`, `nemotron-3-ultra-free`, `laguna-s-2.1-free`) to the registry catalog.
32
+ - Fixed `isResponsesResponse` reference in `nonStreamingHandler.js`.
20
33
  - **Google & Antigravity Request Payload**:
21
34
  - Stripped `stream` and `stream_options` fields from Google Gemini/Antigravity/Vertex payloads in `chatCore.js`, `antigravity.js`, and `gemini-cli.js` (resolves HTTP 400 `Invalid JSON payload received. Unknown name "stream": Cannot find field`).
22
35
  - **Provider Details & Pagination**:
@@ -31,12 +44,27 @@
31
44
  - Removed unused `Pagination` import in `providers/[id]/page.js`.
32
45
  - Fixed `api/translator/send` to use `getProjectIdForConnection` instead of the removed `resolveAntigravityProjectId` helper.
33
46
  - **Testing & Packaging**:
47
+ - Added OpenCode-Go model catalog unit tests for `ox-alpha-free` in `tests/unit/opencode-go-models.test.js` (12/12 pass).
34
48
  - Restored `module.exports` and `require.main` guard in `cli/scripts/build-cli.js` so `cli-build-artifacts.test.js` runs in isolation without triggering full builds.
35
49
  - Updated `tests/unit/saml.test.js` default issuer expectation to `urn:ezrouter:sp`.
36
50
  - Normalized Node platform version and package semver in `tests/translator/golden-url-header.test.js` to ensure snapshot stability.
37
51
 
38
52
  ---
39
53
 
54
+ # v0.5.72 (2026-08-22)
55
+
56
+ ## Internal
57
+ - Version bump and packaging sync for CLI release
58
+
59
+ ---
60
+
61
+ # v0.5.71 (2026-08-22)
62
+
63
+ ## Internal
64
+ - Version bump and packaging sync for CLI release
65
+
66
+ ---
67
+
40
68
  # v0.5.70 (2026-08-22)
41
69
 
42
70
  ## Internal
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ezrouter-app",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "description": "9Router web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
@@ -1,6 +1,15 @@
1
- # v0.5.71 (2026-08-22)
1
+ # v0.5.74 (2026-08-22)
2
2
 
3
3
  ## Features & Improvements
4
+ - **Upstream Sync & Enhancements (PRs #3417–#3466)**:
5
+ - **Claude Streaming**: Decloak tool names in same-format streaming passthrough (`decloakStreamChunk`) (#3466).
6
+ - **Combo & Account Fallback**: Automatically fall back to the next combo account when an upstream provider returns an empty HTTP 200 response with no text, tool calls, or reasoning (`EMPTY_CONTENT_COOLDOWN_MS`) (#3465).
7
+ - **Codex Usage**: Added GPT-5.3-Codex-Spark quota tracking support (`spark_session` and `spark_weekly`) (#3458).
8
+ - **SSE Streaming Keepalive**: Emits SSE keepalive ping every 10s during upstream inference silence for Claude Code (`SSE_KEEPALIVE_MS`) (#3457).
9
+ - **Gemini / Antigravity System Prompts**: Sanitized client branding mentions in system prompts to prevent provider-level rejections (#3454).
10
+ - **OpenCode-Go**: Added `ox-alpha-free` (`Ox Alpha Free`) and `muse-spark-1.2-contributor` models with Chat Completions transport guard and full test coverage (#3451).
11
+ - **Kimi Performance**: Enabled `forceStream: true` for Kimi Code messages to reduce TTFT from 20s to 2s (#3421).
12
+ - **MiniMax Multi-Transport**: Preserved images and OpenAI wire format for MiniMax-M3 requests on matching OpenAI transports (#3419).
4
13
  - **OAuth & Error Recovery UX**:
5
14
  - Added dedicated **"Reconnect"** action button to connection rows for expired/invalidated OAuth sessions.
6
15
  - Added friendly human-readable error messages for token expiration (`invalid_grant`, `refresh_token_expired`, `reauth_required`, `unrecoverable_refresh_error`).
@@ -17,6 +26,10 @@
17
26
  - Updated Skills dashboard display name to `EzRouter (Entry)`.
18
27
 
19
28
  ## Fixes
29
+ - **OpenCode Free & Ox Alpha Model Aliases**:
30
+ - Added upstream alias mapping in `open-sse/providers/registry/opencode.js` and `open-sse/executors/opencode.js` so that `oc/ox-alpha`, `oc/ox-alpha-free`, and `oc/x-preview-f-free` all resolve to OpenCode's wire ID `x-preview-f-free` and pass `dispatchModel` to the executor (resolves `[401]: Model ox-alpha-free is not supported`).
31
+ - Added OpenCode Free models (`mimo-v2.5-free`, `hy3-free`, `nemotron-3.5-lightning-free`, `nemotron-3-ultra-free`, `laguna-s-2.1-free`) to the registry catalog.
32
+ - Fixed `isResponsesResponse` reference in `nonStreamingHandler.js`.
20
33
  - **Google & Antigravity Request Payload**:
21
34
  - Stripped `stream` and `stream_options` fields from Google Gemini/Antigravity/Vertex payloads in `chatCore.js`, `antigravity.js`, and `gemini-cli.js` (resolves HTTP 400 `Invalid JSON payload received. Unknown name "stream": Cannot find field`).
22
35
  - **Provider Details & Pagination**:
@@ -31,12 +44,27 @@
31
44
  - Removed unused `Pagination` import in `providers/[id]/page.js`.
32
45
  - Fixed `api/translator/send` to use `getProjectIdForConnection` instead of the removed `resolveAntigravityProjectId` helper.
33
46
  - **Testing & Packaging**:
47
+ - Added OpenCode-Go model catalog unit tests for `ox-alpha-free` in `tests/unit/opencode-go-models.test.js` (12/12 pass).
34
48
  - Restored `module.exports` and `require.main` guard in `cli/scripts/build-cli.js` so `cli-build-artifacts.test.js` runs in isolation without triggering full builds.
35
49
  - Updated `tests/unit/saml.test.js` default issuer expectation to `urn:ezrouter:sp`.
36
50
  - Normalized Node platform version and package semver in `tests/translator/golden-url-header.test.js` to ensure snapshot stability.
37
51
 
38
52
  ---
39
53
 
54
+ # v0.5.72 (2026-08-22)
55
+
56
+ ## Internal
57
+ - Version bump and packaging sync for CLI release
58
+
59
+ ---
60
+
61
+ # v0.5.71 (2026-08-22)
62
+
63
+ ## Internal
64
+ - Version bump and packaging sync for CLI release
65
+
66
+ ---
67
+
40
68
  # v0.5.70 (2026-08-22)
41
69
 
42
70
  ## Internal
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rabbi696/ezrouter",
3
- "version": "0.5.72",
3
+ "version": "0.5.74",
4
4
  "description": "EzRouter CLI - Start and manage EzRouter server (default port 20126)",
5
5
  "bin": {
6
6
  "ezrouter": "./cli.js"
@@ -1 +0,0 @@
1
- "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[316],{30316:(e,s,t)=>{t.d(s,{gY:()=>o,tA:()=>x,kn:()=>p});var a=t(95155),r=t(12115),l=t(35497),i=t(5772);t(55188),t(94504),t(78721),t(86181),t(16338),t(77069),t(46586),t(27543),t(85328),t(18071),t(52036),t(43953),t(46283);var n=t(98500),d=t.n(n);function o({tool:e}){return(0,a.jsx)(d(),{href:"/dashboard/mitm",className:"block",children:(0,a.jsx)(l.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),(0,a.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:e.description})]})]}),(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}let c="http://localhost:20126";function x({apiKeys:e,cloudEnabled:s,onStatusChange:t}){let[i,n]=(0,r.useState)(null),[d,o]=(0,r.useState)(!1),[m,p]=(0,r.useState)(!1),[u,h]=(0,r.useState)(""),[f,b]=(0,r.useState)(()=>e?.[0]?.key||""),[g,y]=(0,r.useState)(null),[j,N]=(0,r.useState)(null),[w,v]=(0,r.useState)(null),[k,S]=(0,r.useState)(c),[C,_]=(0,r.useState)(null),E=i?.isWin===!0,T=E||i?.hasCachedPassword||i?.needsSudoPassword===!1,z=i?.isAdmin!==!1;!z&&(E||i?.hasCachedPassword||i?.needsSudoPassword);let P=(0,r.useCallback)(async()=>{try{let e=await fetch("/api/cli-tools/antigravity-mitm");if(e.ok){let s=await e.json();n(s),s.mitmRouterBaseUrl&&S(s.mitmRouterBaseUrl),t?.(s)}}catch{n({running:!1,certExists:!1,dnsStatus:{}})}},[t]);(0,r.useEffect)(()=>{queueMicrotask(()=>{P()})},[P]);let M=e=>{v(null),i&&(T?O(e,""):(y(e),p(!0),N(null)))},O=async(t,a,r=!1)=>{o(!0),v(null);try{let l;if("trust-cert"===t)l=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:a})});else if("start"===t){let t=f?.trim()||(e?.length>0?e[0].key:null)||(s?null:"sk_9router");l=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:t,sudoPassword:a,mitmRouterBaseUrl:k.trim()||c,forceKillPort443:r})})}else l=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:a})});if(!l.ok){let e=await l.json().catch(()=>({}));if("PORT_443_BUSY"===e.code&&e.portOwner){p(!1),_({owner:e.portOwner,password:a});return}v(e.error||`Failed to ${t} MITM server`);return}p(!1),h(""),_(null),await P()}catch(e){v(e.message||"Network error")}finally{o(!1),y(null)}},A=()=>{u.trim()?O(g,u):N("Sudo password is required")},R=i?.running;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(l.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,a.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),R?(0,a.jsx)(l.Ex,{variant:"success",size:"sm",children:"Running"}):(0,a.jsx)(l.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,a.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:i?.certExists},{label:"Trusted",ok:i?.certTrusted},{label:"Server",ok:R}].map(({label:e,ok:s})=>(0,a.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${s?"text-green-600":"text-text-muted"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:s?"check_circle":"cancel"}),e]},e))})]}),(0,a.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from 9Router"]}),(0,a.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → 9Router → response to Antigravity/Copilot"]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"9Router Base URL"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",value:k,onChange:e=>S(e.target.value),placeholder:c,disabled:R,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!R&&(0,a.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsx)("input",{type:"text",list:"mitm-api-keys",value:f,onChange:e=>b(e.target.value),placeholder:s?"Enter or pick API key":"sk_9router (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),e?.length>0&&(0,a.jsx)("datalist",{id:"mitm-api-keys",children:e.map(e=>(0,a.jsx)("option",{value:e.key,children:e.name||e.key},e.id))})]})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[i?.certExists&&!i?.certTrusted&&(0,a.jsxs)("button",{onClick:()=>M("trust-cert"),disabled:d,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),R?(0,a.jsxs)("button",{onClick:()=>M("stop"),disabled:d,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,a.jsxs)("button",{onClick:()=>M("start"),disabled:d||!i||E&&!z,title:E&&!z?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),R&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),w&&(0,a.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,a.jsx)("span",{children:w})]}),E&&!z&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,a.jsx)("span",{children:"Administrator required — restart 9Router as Administrator to use MITM"})]})]})}),m&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Enter sudo password",value:u,onChange:e=>h(e.target.value),onKeyDown:e=>{"Enter"!==e.key||d||A()}}),j&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:j})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",onClick:()=>{p(!1),h(""),N(null)},disabled:d,children:"Cancel"}),(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:A,loading:d,children:"Confirm"})]})]})}),C&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,a.jsx)("p",{children:"Port 443 is currently used by another process:"}),(0,a.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[C.owner.name," (PID ",C.owner.pid,")"]}),(0,a.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",onClick:()=>{_(null),o(!1)},disabled:d,children:"Cancel"}),(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:()=>{O("start",C?.password||"",!0)},loading:d,children:"Kill & Start"})]})]})})]})}var m=t(40295);function p({tool:e,isExpanded:s,onToggle:t,serverRunning:n,dnsActive:d,hasCachedPassword:o,needsSudoPassword:c,isWin:x,apiKeys:u,activeProviders:h,hasActiveProviders:f,modelAliases:b={},cloudEnabled:g,onDnsChange:y}){let[j,N]=(0,r.useState)(!1),[w,v]=(0,r.useState)(null),[k,S]=(0,r.useState)(!1),[C,_]=(0,r.useState)(""),[E,T]=(0,r.useState)(null),[z,P]=(0,r.useState)(null),[M,O]=(0,r.useState)({}),[A,R]=(0,r.useState)(!1),[D,I]=(0,r.useState)(null),$=m.TOOL_HOSTS[e.id]??[],q=x||o||!1===c;(0,r.useEffect)(()=>{s&&U()},[s]);let U=async()=>{try{let s=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${e.id}`);if(s.ok){let e=await s.json();Object.keys(e.aliases||{}).length>0&&O(e.aliases)}}catch{}},B=(0,r.useCallback)(async s=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,mappings:s})})}catch{}},[e.id]),H=(e,s)=>{O(t=>({...t,[e]:s}))},K=()=>{if(!n)return;let e=d?"disable":"enable";q?J(e,""):(T(e),S(!0),P(null))},J=async(s,t)=>{N(!0),v(null);try{let a=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:e.id,action:s,sudoPassword:t})}),r=await a.json();if(!a.ok)throw Error(r.error||"Failed to toggle DNS");"enable"===s&&v(`Restart ${e.name} to apply changes`),S(!1),_(""),y?.(r)}catch{}finally{N(!1),T(null)}},L=()=>{C.trim()?J(E,C):P("Sudo password is required")};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)(l.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:t,children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,a.jsx)(i.default,{src:e.image,alt:e.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"},loading:"lazy",decoding:"async"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,a.jsx)("h3",{className:"font-medium text-sm",children:e.name}),n?d?(0,a.jsx)(l.Ex,{variant:"success",size:"sm",children:"Active"}):(0,a.jsx)(l.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,a.jsx)(l.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",e.name," requests via MITM proxy"]})]})]}),(0,a.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${s?"rotate-180":""}`,children:"expand_more"})]}),s&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[$.length>0&&(0,a.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,a.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,a.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:$.map(e=>(0,a.jsxs)("li",{children:["127.0.0.1 ",e]},e))})]}),(0,a.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,a.jsxs)("p",{children:["Toggle DNS to redirect ",e.name," traffic through 9Router via MITM."]}),!d&&(0,a.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),e.defaultModels?.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-2",children:e.defaultModels.map(e=>(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,a.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:e.name}),(0,a.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,a.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,a.jsx)("input",{type:"text",value:M[e.alias]||"",onChange:s=>H(e.alias,s.target.value),onBlur:s=>{var t,a;return t=e.alias,a=s.target.value,void B({...M,[t]:a})},placeholder:"provider/model-id",disabled:!d,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!d?"opacity-50 cursor-not-allowed":""}`}),M[e.alias]&&(0,a.jsx)("button",{onClick:()=>{H(e.alias,""),B({...M,[e.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,a.jsx)("button",{onClick:()=>{I(e.alias),R(!0)},disabled:!f||!d,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${f&&d?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},e.alias))}),e.defaultModels?.length===0&&(0,a.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,a.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[d?(0,a.jsxs)("button",{onClick:K,disabled:!n||j,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,a.jsxs)("button",{onClick:K,disabled:!n||j,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),w&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,a.jsx)("span",{children:w})]})]})]})]}),k&&(0,a.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,a.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,a.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,a.jsx)(l.pd,{type:"password",placeholder:"Enter sudo password",value:C,onChange:e=>_(e.target.value),onKeyDown:e=>{"Enter"!==e.key||j||L()}}),z&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,a.jsx)("span",{children:z})]}),(0,a.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,a.jsx)(l.$n,{variant:"ghost",size:"sm",onClick:()=>{S(!1),_(""),P(null)},disabled:j,children:"Cancel"}),(0,a.jsx)(l.$n,{variant:"primary",size:"sm",onClick:L,loading:j,children:"Confirm"})]})]})}),A&&(0,a.jsx)(l.rq,{isOpen:A,onClose:()=>R(!1),onSelect:e=>{if(!D||e.isPlaceholder)return;let s={...M,[D]:e.value};O(s),B(s)},selectedModel:D?M[D]:null,activeProviders:h,modelAliases:b,title:`Select model for ${D}`})]})}t(82341),t(39983),t(74153)},40295:e=>{e.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}}}]);