zevairouter 1.0.145 → 1.0.147

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 (338) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +9 -9
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  45. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  51. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  61. package/cli/app/.next-cli-build/server/app/callback.rsc +4 -4
  62. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  63. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  64. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  65. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  66. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  69. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +6 -6
  70. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  71. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  73. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  74. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +6 -6
  75. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +4 -4
  77. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +2 -2
  78. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  79. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  80. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  81. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  82. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  83. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  84. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  85. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  86. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  87. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  88. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  90. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  95. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  97. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  98. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  100. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  107. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +6 -6
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +6 -6
  115. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +4 -4
  117. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +2 -2
  118. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  120. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  125. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  127. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  128. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  130. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  134. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  135. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  136. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  137. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  138. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  139. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  140. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  141. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  142. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  144. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  145. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  146. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  147. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  148. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  149. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  150. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +6 -6
  151. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  152. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +6 -6
  156. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +4 -4
  158. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
  159. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  161. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  166. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  167. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  168. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  169. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  171. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  172. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  175. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  176. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  177. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  178. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  179. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  180. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  181. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  182. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  183. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  187. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  188. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  189. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  190. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  191. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  192. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  193. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  197. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  199. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  200. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  201. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  202. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  203. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  207. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  208. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  209. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  210. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  211. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  212. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  213. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  217. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  218. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  219. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  220. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  222. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  223. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  224. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  226. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  227. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  228. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  229. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  231. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  232. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  233. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  234. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  238. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  239. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  240. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  241. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  242. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  243. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  244. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  248. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  249. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  250. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  251. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  253. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  254. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  258. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  259. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  260. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  261. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  262. package/cli/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  263. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  264. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  266. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  267. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  268. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  269. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  270. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  271. package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
  272. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  273. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  274. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  276. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  277. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  278. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  279. package/cli/app/.next-cli-build/server/app/landing.rsc +5 -5
  280. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  281. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  282. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  283. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  285. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  286. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  288. package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
  289. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  290. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  291. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  292. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  293. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  294. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  295. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  296. package/cli/app/.next-cli-build/server/app-paths-manifest.json +9 -9
  297. package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
  298. package/cli/app/.next-cli-build/server/chunks/412.js +2 -2
  299. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  300. package/cli/app/.next-cli-build/server/chunks/5307.js +1 -1
  301. package/cli/app/.next-cli-build/server/chunks/5469.js +1 -1
  302. package/cli/app/.next-cli-build/server/chunks/8242.js +2 -2
  303. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  304. package/cli/app/.next-cli-build/server/chunks/9621.js +1 -1
  305. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  306. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  307. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  308. package/cli/app/.next-cli-build/static/chunks/523-176a0660a9383518.js +3 -0
  309. package/cli/app/.next-cli-build/static/chunks/5497-8d0ec2995dc0a392.js +7 -0
  310. package/cli/app/.next-cli-build/static/chunks/{620-b21eb963d0189283.js → 620-375754e53341e85b.js} +1 -1
  311. package/cli/app/.next-cli-build/static/chunks/9126-7d5476f17beddfb0.js +1 -0
  312. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-2468e6ba8d1efeec.js +1 -0
  313. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-579bf915396efc69.js +1 -0
  314. package/cli/app/.next-cli-build/static/css/87ffa46afc2273f4.css +1 -0
  315. package/cli/app/CHANGELOG.md +17 -0
  316. package/cli/app/package.json +1 -1
  317. package/cli/package.json +1 -1
  318. package/package.json +1 -1
  319. package/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js +91 -38
  320. package/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +45 -38
  321. package/src/app/(dashboard)/dashboard/providers/page.js +199 -173
  322. package/src/app/(dashboard)/dashboard/usage/components/OverviewCards.js +11 -17
  323. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js +15 -9
  324. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.js +188 -120
  325. package/src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js +149 -24
  326. package/src/shared/components/Header.js +4 -4
  327. package/src/shared/components/HeaderLanguage.js +2 -1
  328. package/src/shared/components/HeaderMenu.js +2 -1
  329. package/src/shared/components/Toggle.js +28 -12
  330. package/src/shared/components/UsageStats.js +3 -3
  331. package/cli/app/.next-cli-build/static/chunks/523-078802482e95c757.js +0 -3
  332. package/cli/app/.next-cli-build/static/chunks/5497-276ef7bcaaa911b7.js +0 -7
  333. package/cli/app/.next-cli-build/static/chunks/9126-9e1755f122b943cd.js +0 -1
  334. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-2cedde97aaf3c729.js +0 -1
  335. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6050ac2547c62b54.js +0 -1
  336. package/cli/app/.next-cli-build/static/css/b912482d9fc0b2ed.css +0 -1
  337. /package/cli/app/.next-cli-build/static/{x2eyEbk18Mgl67fqRmEFx → y-U4C09T7DItXT7CZZV41}/_buildManifest.js +0 -0
  338. /package/cli/app/.next-cli-build/static/{x2eyEbk18Mgl67fqRmEFx → y-U4C09T7DItXT7CZZV41}/_ssgManifest.js +0 -0
@@ -11,11 +11,12 @@ import {
11
11
  } from "@xyflow/react";
12
12
  import "@xyflow/react/dist/style.css";
13
13
  import { AI_PROVIDERS } from "@/shared/constants/providers";
14
+ import ProviderIcon from "@/shared/components/ProviderIcon";
14
15
 
15
16
  // Force-stop FE animation if a provider stays active longer than this
16
17
  const FE_ACTIVE_TIMEOUT_MS = 60000;
17
18
  const FE_ACTIVE_TICK_MS = 1000;
18
- const FIT_OPTS = { padding: 0.2, duration: 200 };
19
+ const FIT_OPTS = { padding: 0.14, duration: 200 };
19
20
 
20
21
  function getProviderConfig(providerId) {
21
22
  return AI_PROVIDERS[providerId] || { color: "#6b7280", name: providerId };
@@ -32,11 +33,11 @@ function ProviderNode({ data }) {
32
33
  const [imgError, setImgError] = useState(false);
33
34
  return (
34
35
  <div
35
- className="flex items-center gap-2.5 px-4 py-2.5 rounded-lg border-2 transition-all duration-300 bg-bg"
36
+ className="flex items-center gap-2 rounded-lg border bg-surface px-3 py-2 transition-all duration-300"
36
37
  style={{
37
38
  borderColor: active ? color : "var(--color-border)",
38
- boxShadow: active ? `0 0 16px ${color}40` : "none",
39
- minWidth: "150px",
39
+ boxShadow: active ? `0 0 12px ${color}30` : "none",
40
+ minWidth: "140px",
40
41
  }}
41
42
  >
42
43
  <Handle type="target" position={Position.Top} id="top" className="!bg-transparent !border-0 !w-0 !h-0" />
@@ -46,19 +47,19 @@ function ProviderNode({ data }) {
46
47
 
47
48
  {/* Provider icon */}
48
49
  <div
49
- className="w-8 h-8 rounded-md flex items-center justify-center shrink-0"
50
+ className="flex size-7 shrink-0 items-center justify-center rounded-md"
50
51
  style={{ backgroundColor: `${color}15` }}
51
52
  >
52
53
  {!imgError ? (
53
- <img src={imageUrl} alt={label} className="w-6 h-6 rounded-sm object-contain" onError={() => setImgError(true)} />
54
+ <img src={imageUrl} alt={label} className="size-5 rounded-sm object-contain" onError={() => setImgError(true)} />
54
55
  ) : (
55
- <span className="text-sm font-bold" style={{ color }}>{textIcon}</span>
56
+ <span className="text-xs font-bold" style={{ color }}>{textIcon}</span>
56
57
  )}
57
58
  </div>
58
59
 
59
60
  {/* Provider name */}
60
61
  <span
61
- className="text-base font-medium truncate"
62
+ className="truncate text-sm font-medium"
62
63
  style={{ color: active ? color : "var(--color-text)" }}
63
64
  >
64
65
  {label}
@@ -82,16 +83,16 @@ ProviderNode.propTypes = {
82
83
  // Center ZevaiRouter node
83
84
  function RouterNode({ data }) {
84
85
  return (
85
- <div className="flex items-center justify-center px-5 py-3 rounded-xl border-2 border-primary bg-primary/5 shadow-md min-w-[130px]">
86
+ <div className="flex min-w-[118px] items-center justify-center rounded-lg border border-primary bg-primary/[0.06] px-4 py-2.5 shadow-sm">
86
87
  <Handle type="source" position={Position.Top} id="top" className="!bg-transparent !border-0 !w-0 !h-0" />
87
88
  <Handle type="source" position={Position.Bottom} id="bottom" className="!bg-transparent !border-0 !w-0 !h-0" />
88
89
  <Handle type="source" position={Position.Left} id="left" className="!bg-transparent !border-0 !w-0 !h-0" />
89
90
  <Handle type="source" position={Position.Right} id="right" className="!bg-transparent !border-0 !w-0 !h-0" />
90
91
 
91
- <img src="/favicon.svg" alt="ZevaiRouter" className="w-6 h-6 mr-2" />
92
- <span className="text-sm font-bold text-primary">ZevaiRouter</span>
92
+ <img src="/favicon.svg" alt="ZevaiRouter" className="mr-2 size-5" />
93
+ <span className="text-xs font-semibold text-primary">ZevaiRouter</span>
93
94
  {data.activeCount > 0 && (
94
- <span className="ml-2 px-1.5 py-0.5 rounded-full bg-primary text-white text-xs font-bold">
95
+ <span className="ml-2 rounded-full bg-primary px-1.5 py-0.5 text-[10px] font-semibold text-white">
95
96
  {data.activeCount}
96
97
  </span>
97
98
  )}
@@ -105,20 +106,67 @@ RouterNode.propTypes = {
105
106
 
106
107
  const nodeTypes = { provider: ProviderNode, router: RouterNode };
107
108
 
109
+ function MobileProviderRoute({ provider, status }) {
110
+ const config = getProviderConfig(provider.provider);
111
+ const label = (config.name !== provider.provider ? config.name : null) || provider.name || provider.provider;
112
+ const statusConfig = {
113
+ active: { label: "Live traffic", color: "text-success", dot: "bg-success" },
114
+ error: { label: "Last request failed", color: "text-error", dot: "bg-error" },
115
+ last: { label: "Last route", color: "text-warning", dot: "bg-warning" },
116
+ available: { label: "Available", color: "text-text-muted", dot: "bg-text-subtle" },
117
+ }[status];
118
+
119
+ return (
120
+ <div className="flex min-h-14 items-center gap-3 rounded-xl border border-border-subtle bg-surface px-3 py-2.5">
121
+ <div
122
+ className="flex size-9 shrink-0 items-center justify-center rounded-lg ring-1 ring-black/[0.04] dark:ring-white/[0.06]"
123
+ style={{ backgroundColor: `${config.color || "#6b7280"}15` }}
124
+ >
125
+ <ProviderIcon
126
+ src={getProviderImageUrl(provider.provider)}
127
+ alt=""
128
+ size={26}
129
+ className="max-h-[26px] max-w-[26px] rounded-md object-contain"
130
+ fallbackText={config.textIcon || (provider.provider || "?").slice(0, 2).toUpperCase()}
131
+ fallbackColor={config.color}
132
+ />
133
+ </div>
134
+ <div className="min-w-0 flex-1">
135
+ <p className="truncate text-sm font-semibold text-text-main">{label}</p>
136
+ <p className={`mt-0.5 flex items-center gap-1.5 text-[11px] font-medium ${statusConfig.color}`}>
137
+ <span className={`size-1.5 shrink-0 rounded-full ${statusConfig.dot} ${status === "active" ? "animate-pulse" : ""}`} />
138
+ {statusConfig.label}
139
+ </p>
140
+ </div>
141
+ <span aria-hidden="true" className="material-symbols-outlined text-[18px] text-text-subtle">
142
+ arrow_forward
143
+ </span>
144
+ </div>
145
+ );
146
+ }
147
+
148
+ MobileProviderRoute.propTypes = {
149
+ provider: PropTypes.shape({
150
+ provider: PropTypes.string.isRequired,
151
+ name: PropTypes.string,
152
+ }).isRequired,
153
+ status: PropTypes.oneOf(["active", "error", "last", "available"]).isRequired,
154
+ };
155
+
108
156
  // Place N nodes evenly along an ellipse around the router center.
109
157
  function buildLayout(providers, activeSet, lastSet, errorSet) {
110
- const nodeW = 180;
111
- const nodeH = 30;
112
- const routerW = 120;
113
- const routerH = 44;
114
- const nodeGap = 24;
158
+ const nodeW = 160;
159
+ const nodeH = 44;
160
+ const routerW = 118;
161
+ const routerH = 40;
162
+ const nodeGap = 20;
115
163
 
116
164
  const count = providers.length;
117
165
 
118
166
  // Compute rx so arc spacing between nodes >= nodeW + nodeGap
119
167
  const minRx = ((nodeW + nodeGap) * count) / (2 * Math.PI);
120
- const rx = Math.max(320, minRx);
121
- const ry = Math.max(200, rx * 0.55); // ellipse ratio ~0.55
168
+ const rx = Math.max(270, minRx);
169
+ const ry = Math.max(150, rx * 0.52);
122
170
  if (count === 0) {
123
171
  return {
124
172
  nodes: [{ id: "router", type: "router", position: { x: 0, y: 0 }, data: { activeCount: 0 }, draggable: false }],
@@ -213,6 +261,16 @@ export default function ProviderTopology({ providers = [], activeRequests = [],
213
261
  // Track firstSeen per active provider; drop provider if running too long (BE stuck)
214
262
  const firstSeenRef = useRef({});
215
263
  const [tick, setTick] = useState(0);
264
+ const [isDesktop, setIsDesktop] = useState(false);
265
+ const [mobileExpanded, setMobileExpanded] = useState(false);
266
+
267
+ useEffect(() => {
268
+ const media = window.matchMedia("(min-width: 640px)");
269
+ const syncViewport = () => setIsDesktop(media.matches);
270
+ syncViewport();
271
+ media.addEventListener("change", syncViewport);
272
+ return () => media.removeEventListener("change", syncViewport);
273
+ }, []);
216
274
 
217
275
  useEffect(() => {
218
276
  const seen = firstSeenRef.current;
@@ -250,6 +308,33 @@ export default function ProviderTopology({ providers = [], activeRequests = [],
250
308
  [providers, activeSet, lastSet, errorSet]
251
309
  );
252
310
 
311
+ const mobileProviderRows = useMemo(() => {
312
+ const rank = { active: 0, error: 1, last: 2, available: 3 };
313
+ return providers
314
+ .map((provider) => {
315
+ const id = provider.provider?.toLowerCase();
316
+ const status = activeSet.has(id)
317
+ ? "active"
318
+ : errorSet.has(id)
319
+ ? "error"
320
+ : lastSet.has(id)
321
+ ? "last"
322
+ : "available";
323
+ return { provider, status };
324
+ })
325
+ .sort((a, b) => {
326
+ const statusDiff = rank[a.status] - rank[b.status];
327
+ if (statusDiff !== 0) return statusDiff;
328
+ const nameA = getProviderConfig(a.provider.provider).name || a.provider.name || a.provider.provider;
329
+ const nameB = getProviderConfig(b.provider.provider).name || b.provider.name || b.provider.provider;
330
+ return nameA.localeCompare(nameB);
331
+ });
332
+ }, [providers, activeSet, errorSet, lastSet]);
333
+
334
+ const visibleMobileRows = mobileExpanded
335
+ ? mobileProviderRows
336
+ : mobileProviderRows.slice(0, 6);
337
+
253
338
  // Stable key — only remount when provider list changes
254
339
  const providersKey = useMemo(
255
340
  () => providers.map((p) => p.provider).sort().join(","),
@@ -272,7 +357,7 @@ export default function ProviderTopology({ providers = [], activeRequests = [],
272
357
  });
273
358
  ro.observe(el);
274
359
  return () => ro.disconnect();
275
- }, []);
360
+ }, [isDesktop]);
276
361
 
277
362
  // Re-fit when node count/layout changes
278
363
  useEffect(() => {
@@ -283,21 +368,61 @@ export default function ProviderTopology({ providers = [], activeRequests = [],
283
368
  }, [nodes.length]);
284
369
 
285
370
  return (
286
- <div ref={containerRef} className="flex h-[360px] w-full min-w-0 flex-col overflow-hidden rounded-[14px] border border-border-subtle bg-surface/94 shadow-[0_14px_34px_-26px_rgba(15,23,42,0.28)] sm:h-[480px]">
371
+ <div ref={isDesktop ? containerRef : undefined} className="flex w-full min-w-0 flex-col overflow-hidden rounded-[14px] border border-border-subtle bg-surface/94 shadow-[0_14px_34px_-26px_rgba(15,23,42,0.28)] sm:h-[440px]">
287
372
  <div className="flex shrink-0 items-center justify-between border-b border-border-subtle bg-surface/75 px-4 py-3.5">
288
373
  <div className="flex items-center gap-2">
289
374
  <span className="material-symbols-outlined text-[17px] text-primary">route</span>
290
- <span className="text-xs font-bold uppercase tracking-[0.08em] text-text-muted">Routing Map</span>
375
+ <span className="text-xs font-semibold text-text-main">Routing map</span>
291
376
  </div>
292
- <span className="rounded-full bg-primary/[0.08] px-2 py-1 text-[10px] font-semibold text-primary ring-1 ring-primary/15">
377
+ <span className="text-[11px] font-medium text-text-muted">
293
378
  {providers.length} {providers.length === 1 ? "provider" : "providers"}
294
379
  </span>
295
380
  </div>
296
381
  <div className="min-h-0 flex-1 bg-bg/35">
297
382
  {providers.length === 0 ? (
298
- <div className="flex h-full items-center justify-center text-sm text-text-muted">
383
+ <div className="flex min-h-56 items-center justify-center text-sm text-text-muted sm:h-full sm:min-h-0">
299
384
  No providers connected
300
385
  </div>
386
+ ) : !isDesktop ? (
387
+ <div className="p-3">
388
+ <div className="mb-3 flex items-center gap-3 rounded-xl border border-primary/20 bg-primary/[0.06] px-3 py-3">
389
+ <span className="flex size-10 shrink-0 items-center justify-center rounded-xl bg-primary/10 ring-1 ring-primary/15">
390
+ <img src="/favicon.svg" alt="" className="size-6" />
391
+ </span>
392
+ <div className="min-w-0 flex-1">
393
+ <p className="text-sm font-semibold text-primary">ZevaiRouter</p>
394
+ <p className="mt-0.5 text-[11px] text-text-muted">Routes requests to healthy providers</p>
395
+ </div>
396
+ {activeSet.size > 0 && (
397
+ <span className="rounded-full bg-success/10 px-2 py-1 text-[10px] font-semibold text-success">
398
+ {activeSet.size} live
399
+ </span>
400
+ )}
401
+ </div>
402
+ <div className="ml-7 h-3 w-px bg-border" aria-hidden="true" />
403
+ <div className="space-y-2">
404
+ {visibleMobileRows.map(({ provider, status }) => (
405
+ <MobileProviderRoute
406
+ key={provider.provider}
407
+ provider={provider}
408
+ status={status}
409
+ />
410
+ ))}
411
+ </div>
412
+ {mobileProviderRows.length > 6 && (
413
+ <button
414
+ type="button"
415
+ onClick={() => setMobileExpanded((current) => !current)}
416
+ className="mt-3 flex h-11 w-full items-center justify-center gap-1.5 rounded-xl border border-border bg-surface text-xs font-medium text-text-main transition-colors hover:border-primary/30 hover:text-primary"
417
+ aria-expanded={mobileExpanded}
418
+ >
419
+ {mobileExpanded ? "Show fewer providers" : `Show ${mobileProviderRows.length - 6} more providers`}
420
+ <span className="material-symbols-outlined text-[18px]">
421
+ {mobileExpanded ? "expand_less" : "expand_more"}
422
+ </span>
423
+ </button>
424
+ )}
425
+ </div>
301
426
  ) : (
302
427
  <ReactFlow
303
428
  key={providersKey}
@@ -268,7 +268,7 @@ export default function Header({ onMenuClick, showMenuButton = true }) {
268
268
  <button
269
269
  type="button"
270
270
  onClick={onMenuClick}
271
- className="flex size-10 items-center justify-center rounded-lg text-text-main hover:bg-surface-2 hover:text-primary transition-colors"
271
+ className="flex size-11 items-center justify-center rounded-xl text-text-main hover:bg-surface-2 hover:text-primary transition-colors sm:size-10 sm:rounded-lg"
272
272
  aria-label="Open dashboard navigation"
273
273
  >
274
274
  <span className="material-symbols-outlined">menu</span>
@@ -350,7 +350,7 @@ export default function Header({ onMenuClick, showMenuButton = true }) {
350
350
  </span>
351
351
  </div>
352
352
  )}
353
- <ThemeToggle className="size-9 sm:size-10" />
353
+ <ThemeToggle className="size-11 sm:size-10" />
354
354
  <HeaderLanguage />
355
355
  <HeaderMenu onLogout={handleLogout} />
356
356
  </div>
@@ -377,13 +377,13 @@ function HeaderSearch() {
377
377
  value={query}
378
378
  onChange={(e) => setQuery(e.target.value)}
379
379
  placeholder={placeholder}
380
- className="h-9 w-full rounded-xl border border-border bg-surface/80 pl-8 pr-7 text-sm shadow-sm transition-colors focus:border-primary/50 focus:outline-none focus:ring-2 focus:ring-primary/10"
380
+ className="h-11 w-full rounded-xl border border-border bg-surface/80 pl-9 pr-11 text-sm shadow-sm transition-colors focus:border-primary/50 focus:outline-none focus:ring-2 focus:ring-primary/10 sm:h-9 sm:pl-8 sm:pr-8"
381
381
  />
382
382
  {query && (
383
383
  <button
384
384
  type="button"
385
385
  onClick={() => setQuery("")}
386
- className="absolute right-1 top-1/2 -translate-y-1/2 text-text-muted hover:text-text-main p-0.5 rounded"
386
+ className="absolute right-0 top-1/2 flex size-11 -translate-y-1/2 items-center justify-center rounded-xl text-text-muted hover:text-text-main sm:right-0.5 sm:size-8 sm:rounded-lg"
387
387
  aria-label="Clear search"
388
388
  >
389
389
  <span className="material-symbols-outlined text-[16px]">close</span>
@@ -27,8 +27,9 @@ export default function HeaderLanguage() {
27
27
  <>
28
28
  <button
29
29
  onClick={() => setOpen(true)}
30
- className="flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all"
30
+ className="flex size-11 items-center justify-center rounded-xl text-text-muted transition-all hover:bg-black/5 hover:text-text-main dark:hover:bg-white/5 sm:size-10 sm:rounded-lg"
31
31
  title="Language"
32
+ aria-label="Change language"
32
33
  data-i18n-skip="true"
33
34
  >
34
35
  <span className="text-lg leading-none">{LOCALE_FLAGS[locale] || "🌐"}</span>
@@ -71,8 +71,9 @@ export default function HeaderMenu({ onLogout }) {
71
71
  <div className="relative" ref={menuRef}>
72
72
  <button
73
73
  onClick={() => setIsOpen((v) => !v)}
74
- className="flex items-center justify-center p-2 rounded-lg text-text-muted hover:text-text-main hover:bg-black/5 dark:hover:bg-white/5 transition-all"
74
+ className="flex size-11 items-center justify-center rounded-xl text-text-muted transition-all hover:bg-black/5 hover:text-text-main dark:hover:bg-white/5 sm:size-10 sm:rounded-lg"
75
75
  title="Menu"
76
+ aria-label="Open dashboard menu"
76
77
  >
77
78
  <span className="material-symbols-outlined">grid_view</span>
78
79
  </button>
@@ -12,6 +12,7 @@ export default function Toggle({
12
12
  size = "md",
13
13
  className,
14
14
  busy = false,
15
+ touchTarget = false,
15
16
  ...props
16
17
  }) {
17
18
  const labelId = useId();
@@ -26,6 +27,18 @@ export default function Toggle({
26
27
  if (!disabled && !busy && onChange) onChange(!checked);
27
28
  };
28
29
 
30
+ const thumb = (
31
+ <span
32
+ className={cn(
33
+ "pointer-events-none inline-block rounded-full bg-white shadow-sm",
34
+ "transform transition duration-200 ease-in-out",
35
+ checked ? sizes[size].translate : "translate-x-0.5",
36
+ sizes[size].thumb,
37
+ "mt-0.5"
38
+ )}
39
+ />
40
+ );
41
+
29
42
  return (
30
43
  <div
31
44
  className={cn(
@@ -46,23 +59,26 @@ export default function Toggle({
46
59
  onClick={handleClick}
47
60
  {...props}
48
61
  className={cn(
49
- "relative inline-flex shrink-0 cursor-pointer rounded-full",
62
+ "relative inline-flex shrink-0 cursor-pointer",
50
63
  "transition-colors duration-200 ease-in-out",
51
64
  "focus:outline-none focus:ring-2 focus:ring-brand-500/30",
52
- checked ? "bg-brand-500" : "bg-surface-3",
53
- sizes[size].track,
65
+ touchTarget
66
+ ? "size-11 items-center justify-center rounded-xl sm:size-8 sm:rounded-lg"
67
+ : "rounded-full",
68
+ !touchTarget && (checked ? "bg-brand-500" : "bg-surface-3"),
69
+ !touchTarget && sizes[size].track,
54
70
  disabled && "cursor-not-allowed"
55
71
  )}
56
72
  >
57
- <span
58
- className={cn(
59
- "pointer-events-none inline-block rounded-full bg-white shadow-sm",
60
- "transform transition duration-200 ease-in-out",
61
- checked ? sizes[size].translate : "translate-x-0.5",
62
- sizes[size].thumb,
63
- "mt-0.5"
64
- )}
65
- />
73
+ {touchTarget ? (
74
+ <span className={cn(
75
+ "relative inline-flex shrink-0 rounded-full",
76
+ checked ? "bg-brand-500" : "bg-surface-3",
77
+ sizes[size].track,
78
+ )}>
79
+ {thumb}
80
+ </span>
81
+ ) : thumb}
66
82
  </button>
67
83
  {(label || description) && (
68
84
  <div className="flex flex-col">
@@ -75,12 +75,12 @@ function RecentRequests({ requests = [], streamStatus = "connecting" }) {
75
75
  const stream = STREAM_STATUS[streamStatus] || STREAM_STATUS.connecting;
76
76
 
77
77
  return (
78
- <Card className="flex min-w-0 flex-col overflow-hidden" padding="none" style={{ height: 480 }}>
78
+ <Card className="flex h-[420px] min-w-0 flex-col overflow-hidden sm:h-[440px]" padding="none">
79
79
  {/* Header */}
80
80
  <div className="flex shrink-0 items-center justify-between border-b border-border-subtle bg-surface/75 px-4 py-3.5">
81
81
  <div className="flex items-center gap-2">
82
82
  <span className="material-symbols-outlined text-[17px] text-primary">monitor_heart</span>
83
- <span className="text-xs font-bold uppercase tracking-[0.08em] text-text-muted">Recent Requests</span>
83
+ <span className="text-xs font-semibold text-text-main">Recent requests</span>
84
84
  </div>
85
85
  <span
86
86
  className={`inline-flex items-center gap-1.5 rounded-full px-2 py-1 text-[10px] font-semibold ${stream.className}`}
@@ -125,7 +125,7 @@ function RecentRequests({ requests = [], streamStatus = "connecting" }) {
125
125
  </td>
126
126
  <td className="min-w-0 py-1.5 pr-2">
127
127
  <div className="max-w-[132px] truncate font-mono" title={r.model}>{r.model}</div>
128
- <div className="mt-0.5 max-w-[132px] truncate text-[9px] font-semibold uppercase tracking-[0.08em] text-text-subtle" title={providerName}>
128
+ <div className="mt-0.5 max-w-[132px] truncate text-[10px] font-medium text-text-subtle" title={providerName}>
129
129
  {providerName}
130
130
  </div>
131
131
  </td>
@@ -1,3 +0,0 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[523],{80523:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>p});var a=s(95155),r=s(12115),l=s(14051),n=s.n(l),i=s(98500),o=s.n(i),c=s(35497),d=s(11059);let m=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}];async function u(e){if(!e)return!1;try{return(await fetch(`${e}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(5e3)})).ok}catch{return!1}}async function x(...e){let t=e.filter(Boolean).map(u);return!!t.length&&new Promise(e=>{let s=t.length;t.forEach(t=>t.then(t=>{t?e(!0):0==--s&&e(!1)}))})}function p({machineId:e}){let[t,s]=(0,r.useState)([]),[l,n]=(0,r.useState)(!0),[i,f]=(0,r.useState)(!1),[j,w]=(0,r.useState)(""),[k,v]=(0,r.useState)(null),[N,C]=(0,r.useState)(null),[S,T]=(0,r.useState)(null),[_,P]=(0,r.useState)(null),[$,E]=(0,r.useState)(()=>new Set),[A,I]=(0,r.useState)(()=>({})),[U,D]=(0,r.useState)(!1),[F,O]=(0,r.useState)(!0),[R,L]=(0,r.useState)(!0),[q,W]=(0,r.useState)(!1),[K,z]=(0,r.useState)(!0),[M,J]=(0,r.useState)(!1),[B,H]=(0,r.useState)(!1),[Z,V]=(0,r.useState)(""),[Q,X]=(0,r.useState)(""),[G,Y]=(0,r.useState)(!1),[ee,et]=(0,r.useState)(""),[es,ea]=(0,r.useState)(null),[er,el]=(0,r.useState)(!1),[en,ei]=(0,r.useState)(!1),[eo,ec]=(0,r.useState)(!1),[ed,em]=(0,r.useState)(!1),[eu,ex]=(0,r.useState)(""),[ep,eh]=(0,r.useState)(!1),[eg,eb]=(0,r.useState)(""),[ey,ef]=(0,r.useState)(null),[ej,ew]=(0,r.useState)(""),[ek,ev]=(0,r.useState)(""),[eN,eC]=(0,r.useState)(null),[eS,eT]=(0,r.useState)(!1),[e_,eP]=(0,r.useState)([]),[e$,eE]=(0,r.useState)(""),[eA,eI]=(0,r.useState)(!1),[eU,eD]=(0,r.useState)(!1),[eF,eO]=(0,r.useState)(!1),eR=(0,r.useRef)(null),eL=(0,r.useRef)(0),eq=(0,r.useRef)(0),eW=(0,r.useRef)(!1),eK=(0,r.useRef)(!1),ez=(0,r.useRef)(!1),eM=(0,r.useRef)(!1),[eJ,eB]=(0,r.useState)(!1),[eH,eZ]=(0,r.useState)(!1),[eV,eQ]=(0,r.useState)(!1);(0,r.useEffect)(()=>{eQ(!["localhost","127.0.0.1","::1"].includes(window.location.hostname))},[]);let{copied:eX,copy:eG}=(0,d.C)(),eY=!F||!R,e0=F?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,r.useEffect)(()=>{eR.current&&(eR.current.scrollTop=eR.current.scrollHeight)},[e_]),(0,r.useEffect)(()=>{e8(),e2()},[]),(0,r.useEffect)(()=>{if(!(M||eo))return;let e=!M||B,t=!eo||ed,s=()=>{document.hidden||e5()};if(document.addEventListener("visibilitychange",s),e&&t)return()=>document.removeEventListener("visibilitychange",s);let a=setInterval(()=>{document.hidden||e5()},5e3);return()=>{clearInterval(a),document.removeEventListener("visibilitychange",s)}},[M,eo,B,ed]),(0,r.useEffect)(()=>{let e=async()=>{if(!document.hidden){if(M&&(Z||Q)){let e=await x(Q,Z);eW.current=e,e?(eL.current=0,H(!0),ez.current||(ez.current=!0,eB(!0))):(eL.current+=1,eL.current>=5&&H(!1))}else eW.current=!1;if(eo&&eu){let e=await u(eu);eK.current=e,e?(eq.current=0,em(!0),eM.current||(eM.current=!0,eZ(!0))):(eq.current+=1,eq.current>=5&&em(!1))}else eK.current=!1}};if(!(M&&(Z||Q)||eo&&eu))return;e();let t=!eo||ed;if((!M||B)&&t)return;let s=setInterval(e,1e4);return()=>clearInterval(s)},[M,Z,Q,eo,eu,B,ed]);let e1=(0,r.useCallback)((e,t,s,a,r,l)=>{t.current?(s.current=0,a(!0),r.current||(r.current=!0,l(!0))):(s.current+=1,s.current>=5&&a(!1))},[]),e5=async()=>{try{let e=await fetch("/api/tunnel/status",{cache:"no-store"});if(!e.ok)return;let t=await e.json(),s=t.tunnel?.settingsEnabled??t.tunnel?.enabled??!1,a=t.tunnel?.tunnelUrl||"";V(a),X(t.tunnel?.publicUrl||""),J(s),e1(null,eW,eL,H,ez,eB);let r=t.tailscale?.settingsEnabled??t.tailscale?.enabled??!1,l=t.tailscale?.tunnelUrl||"";ex(l),ec(r),e1(null,eK,eq,em,eM,eZ)}catch{}},e2=async()=>{z(!0);try{let[e,t]=await Promise.all([fetch("/api/settings"),fetch("/api/tunnel/status",{cache:"no-store"})]);if(e.ok){let t=await e.json();D(t.requireApiKey||!1),O(!1!==t.requireLogin),L(t.hasPassword||!1),W(t.tunnelDashboardAccess||!1)}if(t.ok){let e=await t.json(),s=e.tunnel?.settingsEnabled??e.tunnel?.enabled??!1,a=e.tunnel?.tunnelUrl||"";V(a),X(e.tunnel?.publicUrl||""),J(s),e1(null,eW,eL,H,ez,eB);let r=e.tailscale?.settingsEnabled??e.tailscale?.enabled??!1,l=e.tailscale?.tunnelUrl||"";ex(l),ec(r),e1(null,eK,eq,em,eM,eZ)}}catch(e){console.log("Error loading settings:",e)}finally{z(!1)}},e3=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:e})})).ok&&W(e)}catch(e){console.log("Error updating tunnelDashboardAccess:",e)}},e4=async e=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:e})})).ok&&D(e)}catch(e){console.log("Error updating requireApiKey:",e)}},e8=async()=>{try{let e=await fetch("/api/keys"),t=await e.json();e.ok&&s(t.keys||[])}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},e6=async(...e)=>{Y(!0),et("Waiting for tunnel ready...");let t=e.filter(Boolean).map(e=>`${e}/api/health`),s=Date.now();for(;Date.now()-s<3e5;){if(await new Promise(e=>setTimeout(e,2e3)),await Promise.any(t.map(async e=>{if((await fetch(e,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return J(!0),Y(!1),et(""),!0;if((Date.now()-s)%1e4<2e3)try{let e=await fetch("/api/tunnel/status");if(e.ok){let t=await e.json();if(!t.tunnel?.enabled)return ea({type:"error",message:"Tunnel process stopped unexpectedly."}),Y(!1),et(""),!1}}catch{}}return ea({type:"error",message:"Tunnel created but not reachable. Please try again."}),Y(!1),et(""),!1},e9=async()=>{el(!1),Y(!0),ea(null),et("Creating tunnel...");let e=!0;(async()=>{for(;e;){try{let t=await fetch("/api/tunnel/status");if(t.ok){let s=await t.json();s.download?.downloading?et(`Downloading cloudflared... ${s.download.progress}%`):e&&et("Creating tunnel...")}}catch{}await new Promise(e=>setTimeout(e,1e3))}})();try{let t=await fetch("/api/tunnel/enable",{method:"POST"});e=!1;let s=await t.json();if(!t.ok)return void ea({type:"error",message:s.error||"Failed to enable tunnel"});let a=s.tunnelUrl;if(!a)return void ea({type:"error",message:"No tunnel URL returned"});V(a),X(s.publicUrl||""),await e6(s.publicUrl,a)}catch(e){ea({type:"error",message:e.message})}finally{e=!1,Y(!1),et("")}},e7=async()=>{Y(!0),ea(null);try{let e=await fetch("/api/tunnel/disable",{method:"POST"}),t=await e.json();e.ok?(J(!1),V(""),ei(!1),ea({type:"success",message:"Tunnel disabled"})):ea({type:"error",message:t.error||"Failed to disable tunnel"})}catch(e){ea({type:"error",message:e.message})}finally{Y(!1)}},te=async()=>{eC(null);try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok){let t=await e.json();return eC(t.installed),t}}catch{}return eC(!1),{installed:!1}},tt=async()=>{eT(!0),ef(null),eP([]);try{let e=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:e$})});eE("");let t=e.body.getReader(),s=new TextDecoder,a="";for(;;){let{done:e,value:r}=await t.read();if(e)break;let l=(a+=s.decode(r,{stream:!0})).split("\n\n");for(let e of(a=l.pop()||"",l)){let t=e.split("\n"),s="progress",a=null;for(let e of t)if(e.startsWith("event: ")&&(s=e.slice(7).trim()),e.startsWith("data: "))try{a=JSON.parse(e.slice(6))}catch{}if(a)if("progress"===s)eP(e=>[...e.slice(-50),a.message]);else if("done"===s){eC(!0),eT(!1),eD(!1),tl();return}else"error"===s&&ef({type:"error",message:a.error||"Install failed"})}}}catch(e){ef({type:"error",message:e.message})}finally{eT(!1)}},ts=async e=>{eb("Waiting for Tailscale ready...");let t=`${e}/api/health`,s=Date.now();for(;Date.now()-s<3e5;){await new Promise(e=>setTimeout(e,2e3));try{let e=await fetch(t,{mode:"no-cors",cache:"no-store"});if(e.ok||"opaque"===e.type)return!0}catch{}}return!1},ta=(e,t)=>{ew(e),ev(t)},tr=()=>{ew(""),ev("")},tl=async()=>{eD(!1),eI(!0),eh(!0),ef(null),eb("Connecting..."),tr();try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ex(t.tunnelUrl||"");let e=await ts(t.tunnelUrl);ec(!0),ef(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.needsLogin&&t.authUrl){ta(t.authUrl,"Open Login Page"),eb('Login required — click "Open Login Page" to continue');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-check");if(e.ok&&(await e.json()).loggedIn){tr(),eb("Starting funnel...");let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){ex(t.tunnelUrl||"");let e=await ts(t.tunnelUrl);ec(!0),ef(e?null:{type:"warning",message:"Connected but not reachable yet."})}else t.funnelNotEnabled&&t.enableUrl?await tn(t.enableUrl):ef({type:"error",message:t.error||"Failed to start funnel"});return}}catch{}}tr(),ef({type:"error",message:"Login timed out. Please try again."});return}if(t.funnelNotEnabled&&t.enableUrl)return void await tn(t.enableUrl);ef({type:"error",message:t.error||"Failed to connect"})}catch(e){ef({type:"error",message:e.message})}finally{eh(!1),eI(!1),eb(""),tr()}},tn=async e=>{ta(e,"Open Funnel Settings"),eb('Click "Open Funnel Settings" to enable Funnel...');for(let e=0;e<40;e++){await new Promise(e=>setTimeout(e,3e3));try{let e=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),t=await e.json();if(e.ok&&t.success){tr(),ex(t.tunnelUrl||"");let e=await ts(t.tunnelUrl);ec(!0),ef(e?null:{type:"warning",message:"Connected but not reachable yet."});return}if(t.funnelNotEnabled)continue;if(t.error){tr(),ef({type:"error",message:t.error});return}}catch{}}tr(),ef({type:"error",message:"Timed out waiting for Funnel to be enabled."})},ti=async()=>{eh(!0),ef(null);try{let e=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),t=await e.json();e.ok?(ec(!1),ex(""),eO(!1),ef({type:"success",message:"Tailscale disabled"})):ef({type:"error",message:t.error||"Failed to disable Tailscale"})}catch(e){ef({type:"error",message:e.message})}finally{eh(!1)}},to=async()=>{ef(null),eP([]);let e=await te();e?.installed&&e?.hasCachedPassword?tl():eD(!0)},tc=async e=>{if(e.preventDefault(),j.trim()&&!S){T("create"),P(null);try{let e=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:j})}),t=await e.json();if(!e.ok)throw Error(t.error||`Failed to create key (${e.status})`);v(t.key),t.id&&t.key&&I(e=>({...e,[t.id]:t.key})),await e8(),w(""),f(!1),P({type:"success",message:"API key created"})}catch(e){P({type:"error",message:e.message})}finally{T(null)}}},td=async(e,t)=>{if(!S){T(`toggle:${e}`),P(null);try{let a=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})});if(!a.ok)throw Error(`Failed to update key (${a.status})`);s(s=>s.map(s=>s.id===e?{...s,isActive:t}:s)),P({type:"success",message:"API key updated"})}catch(e){P({type:"error",message:e.message})}finally{T(null)}}},tm=async(e,t,a)=>{if(S)return;let r=""===a?0:Math.max(0,Number(a)||0);T(`budget:${e}`),P(null);try{let a=await fetch(`/api/keys/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[t]:r})});if(!a.ok)throw Error(`Failed to update budget (${a.status})`);s(s=>s.map(s=>s.id===e?{...s,[t]:r}:s)),P({type:"success",message:"Budget updated"})}catch(e){P({type:"error",message:e.message})}finally{T(null)}},tu=async e=>{if(A[e])return A[e];let t=await fetch(`/api/keys/${e}?reveal=1`,{cache:"no-store"}),s=await t.json().catch(()=>({}));if(!t.ok)throw Error(s.error||`Failed to reveal key (${t.status})`);let a=s.key?.key||s.key;if("string"!=typeof a||!a)throw Error("Key secret is not available");return I(t=>({...t,[e]:a})),a},tx=async e=>{if($.has(e))return void E(t=>{let s=new Set(t);return s.delete(e),s});try{await tu(e),E(t=>{let s=new Set(t);return s.add(e),s}),P(null)}catch(e){P({type:"error",message:e.message})}},tp=async e=>{try{let t=await tu(e);eG(t,e),P(null)}catch(e){P({type:"error",message:e.message})}},[th,tg]=(0,r.useState)("/v1");return((0,r.useEffect)(()=>{tg(`${window.location.origin}/v1`)},[]),l)?(0,a.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,a.jsx)(c.Qv,{}),(0,a.jsx)(c.Qv,{})]}):(0,a.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,a.jsxs)(c.Zp,{padding:"none",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-t-[13px] border-b border-border-subtle bg-linear-to-r from-primary/[0.07] via-primary/[0.025] to-transparent px-4 py-4 sm:px-5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/12 text-[22px] text-primary ring-1 ring-primary/15",children:"terminal"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Endpoint"}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Choose how local and remote clients connect to Zevai Router."})]})]}),(0,a.jsxs)("div",{className:"p-4 sm:p-5",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(h,{label:"Local",url:th,copyId:"local_url",copied:eX,onCopy:eG}),(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,a.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${M?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),M&&!G&&B?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pd,{"aria-label":"Cloudflare Tunnel endpoint URL",value:`${Q||Z}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,a.jsx)("button",{onClick:()=>eG(`${Q||Z}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===eX?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>ei(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!M||G||B?G?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ee||"Creating tunnel..."]}),(0,a.jsx)("button",{onClick:()=>{Y(!1),et("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):es?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),es.message]}),(0,a.jsx)(c.$n,{size:"sm",icon:"cloud_upload",onClick:()=>el(!0),children:"Enable"})]}):K?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,a.jsx)("button",{onClick:()=>z(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{eY?ea({type:"error",message:`Security required: ${e0}`}):U?el(!0):ea({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eJ?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,a.jsx)("button",{onClick:()=>ei(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tunnel",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,a.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${eo?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),eo&&!ep&&ed?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(c.pd,{"aria-label":"Tailscale endpoint URL",value:`${eu}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,a.jsx)("button",{onClick:()=>eG(`${eu}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===eX?"check":"content_copy"})}),(0,a.jsx)("button",{onClick:()=>eO(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!eo||ep||ed?ep||eA?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-input text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eg||"Connecting..."]}),ej&&(0,a.jsx)(c.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(ej,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:ek||"Open"}),(0,a.jsx)("button",{onClick:()=>{eh(!1),eI(!1),eb(""),tr()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Stop",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ey?.type==="error"?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ey.message]}),(0,a.jsx)(c.$n,{size:"sm",icon:"vpn_lock",onClick:to,children:"Enable"})]}):(0,a.jsx)(c.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{eY?ef({type:"error",message:`Security required: ${e0}`}):to()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:"Enable"}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),eH?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,a.jsx)("button",{onClick:()=>eO(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:"Disable Tailscale",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),eY&&!M&&!eo&&(0,a.jsx)("div",{className:"mt-4",children:(0,a.jsx)(y,{message:e0,action:{label:"Open settings",href:"/dashboard/profile"}})}),(M||eo)&&(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!U&&(0,a.jsx)(y,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!F||!R)&&(0,a.jsx)(y,{message:F?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:F?"Change password":"Enable",href:"/dashboard/profile"}})]}),(M||eo)&&(0,a.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,a.jsx)(c.lM,{label:"Allow dashboard access via tunnel",checked:q,onChange:()=>e3(!q)}),(0,a.jsx)(b,{text:"When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked."})]})]})]}),(0,a.jsx)(c.Zp,{id:"rtk",padding:"none",className:"relative overflow-hidden border-primary/20 bg-linear-to-br from-primary/[0.08] via-surface to-surface",children:(0,a.jsxs)("div",{className:"relative flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3.5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary text-[22px] text-white shadow-[0_10px_24px_-14px_rgba(229,106,74,0.9)]",children:"bolt"}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"Token Saver"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tune RTK, Caveman, Ponytail, Headroom, and PXPIPE in one workspace."})]})]}),(0,a.jsxs)(o(),{href:"/dashboard/token-saver",className:"inline-flex w-full shrink-0 items-center justify-center gap-1.5 rounded-lg border border-primary/25 bg-surface/80 px-3.5 py-2 text-sm font-semibold text-text-main shadow-sm transition-[border-color,color,transform] hover:translate-x-0.5 hover:border-primary/50 hover:text-primary sm:w-auto",children:["Open workspace",(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_forward"})]})]})}),(0,a.jsxs)(c.Zp,{id:"require-api-key",children:[(0,a.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined flex size-11 shrink-0 items-center justify-center rounded-xl bg-primary/10 text-[21px] text-primary ring-1 ring-primary/15",children:"vpn_key"}),(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)("h2",{className:"text-lg font-semibold leading-tight",children:"API Keys"}),(0,a.jsxs)("span",{className:"rounded-full bg-surface-2 px-2 py-0.5 text-[10px] font-semibold text-text-muted ring-1 ring-border-subtle",children:[t.length," ",1===t.length?"key":"keys"]})]}),(0,a.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Control authentication and spending per client."})]})]}),(0,a.jsx)(c.$n,{icon:"add",onClick:()=>f(!0),className:"w-full sm:w-auto",children:"Create Key"})]}),_&&(0,a.jsx)("p",{role:"status",className:`mb-4 text-sm ${"error"===_.type?"text-red-500":"text-green-500"}`,children:_.message}),(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 rounded-xl border border-primary/15 bg-primary/[0.045] p-4 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined mt-0.5 flex size-8 shrink-0 items-center justify-center rounded-lg bg-surface text-[17px] text-primary ring-1 ring-border-subtle",children:"shield_lock"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,a.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Reject requests that do not include a valid client key."})]})]}),(0,a.jsx)("div",{className:"shrink-0 self-end sm:self-auto",children:(0,a.jsx)(c.lM,{label:"Require API key",checked:U,onChange:()=>e4(!U)})})]}),eV&&!U&&(0,a.jsx)("div",{className:"mb-4 -mt-2",children:(0,a.jsx)(y,{message:"Endpoint is exposed without an API key."})}),0===t.length?(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-surface-2/25 py-12 text-center",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,a.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,a.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,a.jsx)(c.$n,{icon:"add",onClick:()=>f(!0),children:"Create Key"})]}):(0,a.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:t.map(e=>{var t,r;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-wrap items-center justify-between gap-3 rounded-xl border border-border-subtle bg-surface-2/25 p-4 transition-[border-color,box-shadow,opacity] hover:border-primary/20 hover:shadow-[0_14px_28px_-26px_rgba(15,23,42,0.65)] ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium",children:e.name}),(0,a.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono truncate max-w-[min(100%,28rem)]",children:(t=e,$.has(t.id)&&A[t.id]?A[t.id]:t.maskedKey||((r=t.key)?r.length>8?r.slice(0,8)+"...":r:"")||"••••••••")}),(0,a.jsx)("button",{type:"button",onClick:()=>tx(e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all shrink-0",title:$.has(e.id)?"Hide key":"Show key","aria-label":$.has(e.id)?"Hide API key":"Show API key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:$.has(e.id)?"visibility_off":"visibility"})}),(0,a.jsx)("button",{type:"button",onClick:()=>tp(e.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all shrink-0",title:"Copy key","aria-label":"Copy API key",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eX===e.id?"check":"content_copy"})})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(e.createdAt).toLocaleDateString()]}),!1===e.isActive&&(0,a.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,a.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Daily $",(0,a.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:S===`budget:${e.id}`,defaultValue:e.budgetDaily||0,onBlur:t=>tm(e.id,"budgetDaily",t.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Daily budget cap in USD (0 = unlimited)"})]}),(0,a.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Monthly $",(0,a.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:S===`budget:${e.id}`,defaultValue:e.budgetMonthly||0,onBlur:t=>tm(e.id,"budgetMonthly",t.target.value),className:"w-16 rounded border border-border bg-surface px-1 py-0.5 text-[11px]",title:"Monthly budget cap in USD (0 = unlimited)"})]})]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)(c.lM,{size:"sm",disabled:S===`toggle:${e.id}`,checked:e.isActive??!0,onChange:t=>{e.isActive&&!t?C({title:"Pause API Key",message:`Pause API key "${e.name}"?
2
-
3
- This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{C(null),td(e.id,t)}}):td(e.id,t)},title:e.isActive?"Pause key":"Resume key"}),(0,a.jsx)("button",{disabled:S===`delete:${e.id}`,onClick:()=>{var t;return t=e.id,void(!S&&C({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{C(null),T(`delete:${t}`),P(null);try{let e=await fetch(`/api/keys/${t}`,{method:"DELETE"});if(!e.ok)throw Error(`Failed to delete key (${e.status})`);s(e=>e.filter(e=>e.id!==t)),E(e=>{let s=new Set(e);return s.delete(t),s}),I(e=>{if(!(t in e))return e;let s={...e};return delete s[t],s}),P({type:"success",message:"API key deleted"})}catch(e){P({type:"error",message:e.message})}finally{T(null)}}}))},className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},e.id)})})]}),(0,a.jsx)(c.aF,{isOpen:i,title:"Create API Key",onClose:()=>{f(!1),w("")},children:(0,a.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:tc,children:[(0,a.jsx)(c.pd,{label:"Key Name",value:j,onChange:e=>w(e.target.value),placeholder:"Production Key"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{type:"submit",fullWidth:!0,disabled:!j.trim()||"create"===S,children:"create"===S?"Creating...":"Create"}),(0,a.jsx)(c.$n,{type:"button",onClick:()=>{f(!1),w("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(c.aF,{isOpen:!!k,title:"API Key Created",onClose:()=>v(null),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,a.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,a.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:"This is the only time you will see this key. Store it securely."})]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.pd,{value:k||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,a.jsx)(c.$n,{variant:"secondary",icon:"created_key"===eX?"check":"content_copy",onClick:()=>eG(k,"created_key"),children:"created_key"===eX?"Copied!":"Copy"})]}),(0,a.jsx)(c.$n,{onClick:()=>v(null),fullWidth:!0,children:"Done"})]})}),(0,a.jsx)(c.aF,{isOpen:er,title:"Enable Tunnel",onClose:()=>el(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,a.jsxs)("div",{className:"flex items-start gap-3",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,a.jsxs)("div",{children:[(0,a.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Expose your local ZevaiRouter to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere."})]})]})}),(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",children:m.map(e=>(0,a.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:e.icon}),(0,a.jsx)("p",{className:"text-xs font-semibold",children:e.title}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:e.desc})]},e.title))}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:e9,fullWidth:!0,children:"Start Tunnel"}),(0,a.jsx)(c.$n,{onClick:()=>el(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,a.jsx)(c.aF,{isOpen:en,title:"Disable Tunnel",onClose:()=>!G&&ei(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:e7,fullWidth:!0,disabled:G,variant:"danger",children:G?"Disabling...":"Disable"}),(0,a.jsx)(c.$n,{onClick:()=>ei(!1),variant:"ghost",fullWidth:!0,disabled:G,children:"Cancel"})]})]})}),(0,a.jsx)(c.aF,{isOpen:eU,title:"Tailscale Funnel",onClose:()=>{eS||(eD(!1),eE(""),ef(null))},children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[null===eN&&(0,a.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===eN&&!eS&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:tt,fullWidth:!0,children:"Install Tailscale"}),(0,a.jsx)(c.$n,{onClick:()=>eD(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),eS&&(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),e_.length>0&&(0,a.jsx)("div",{ref:eR,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:e_.map((e,t)=>(0,a.jsx)("div",{children:e},t))})]}),!0===eN&&!eS&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:()=>tl(),fullWidth:!0,children:"Connect"}),(0,a.jsx)(c.$n,{onClick:()=>eD(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),ey&&(0,a.jsx)(g,{status:ey})]})}),(0,a.jsx)(c.aF,{isOpen:eF,title:"Disable Tailscale",onClose:()=>!ep&&eO(!1),children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(c.$n,{onClick:ti,fullWidth:!0,disabled:ep,variant:"danger",children:ep?"Disabling...":"Disable"}),(0,a.jsx)(c.$n,{onClick:()=>eO(!1),variant:"ghost",fullWidth:!0,disabled:ep,children:"Cancel"})]})]})}),(0,a.jsx)(c.uo,{isOpen:!!N,onClose:()=>C(null),onConfirm:N?.onConfirm,title:N?.title||"Confirm",message:N?.message,variant:"danger"})]})}function h({label:e,url:t,copyId:s,copied:r,onCopy:l,badge:n,actions:i}){return(0,a.jsxs)("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)_auto_auto] items-center gap-2.5 rounded-xl border border-border-subtle bg-bg/55 p-3 transition-colors hover:border-primary/20 sm:flex",children:[(0,a.jsx)("span",{className:`col-span-full inline-flex min-h-8 w-full shrink-0 items-center justify-center rounded-lg px-2.5 text-[11px] font-semibold uppercase tracking-[0.08em] sm:w-[96px] ${"CF"===n||"TS"===n?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:e}),(0,a.jsx)(c.pd,{"aria-label":`${e} endpoint URL`,value:t,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,a.jsx)("button",{onClick:()=>l(t,s),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0","aria-label":`Copy ${e} endpoint URL`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:r===s?"check":"content_copy"})}),i]})}function g({status:e,className:t=""}){return(0,a.jsx)("div",{className:`p-2 rounded text-sm ${t} ${"success"===e.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===e.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===e.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:e.message.split(/(https?:\/\/[^\s]+)/g).map((e,t)=>/^https?:\/\//.test(e)?(0,a.jsx)("a",{href:e,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:e},t):e)})}function b({text:e}){return(0,a.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,a.jsx)("span",{className:"pointer-events-none absolute right-0 top-full z-50 mt-2 w-[min(16rem,calc(100vw-2rem))] rounded bg-gray-900 px-2.5 py-1.5 text-xs text-white opacity-0 shadow-lg transition-opacity group-hover:opacity-100 dark:bg-gray-800",children:e})]})}function y({message:e,action:t}){return(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,a.jsx)("p",{className:"text-xs flex-1",children:e}),t&&(0,a.jsx)("a",{href:t.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:t.href.startsWith("#")?e=>{e.preventDefault(),document.getElementById(t.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:t.label})]})}p.propTypes={machineId:n().string.isRequired}}}]);