zevairouter 1.0.263 → 1.0.265

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 (351) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +10 -10
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/prerender-manifest.json +3 -3
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.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_client-reference-manifest.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  45. package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  51. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  52. package/cli/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +4 -4
  53. package/cli/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  55. package/cli/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  56. package/cli/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  58. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  59. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  60. package/cli/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  61. package/cli/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +1 -1
  62. package/cli/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  63. package/cli/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +1 -1
  64. package/cli/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  65. package/cli/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +2 -2
  66. package/cli/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  67. package/cli/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  68. package/cli/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  69. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  70. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  71. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  72. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  73. package/cli/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  74. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  75. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  76. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  77. package/cli/app/.next-cli-build/server/app/callback.rsc +4 -4
  78. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  79. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  80. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  81. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  82. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  83. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  84. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  85. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +6 -6
  86. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  87. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  88. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  90. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +6 -6
  91. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +4 -4
  93. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  95. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  96. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  97. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  98. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  100. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  101. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  103. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  105. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  106. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  107. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  108. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  110. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  111. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  113. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  115. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  116. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  117. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  118. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  120. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  121. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  123. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  125. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +6 -6
  126. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  127. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  128. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  130. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +6 -6
  131. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +4 -4
  133. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +2 -2
  134. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  135. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  136. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  137. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  138. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  139. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  140. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  141. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  142. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  143. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  144. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  145. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  146. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  147. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  148. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  149. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  150. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  151. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  152. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  154. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  156. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  157. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  158. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  159. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  161. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  162. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  164. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  166. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +6 -6
  167. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  168. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  169. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  171. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +6 -6
  172. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +4 -4
  174. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
  175. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  176. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  177. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  178. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  179. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  180. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  181. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  182. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  183. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  184. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  185. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  186. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  187. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  188. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  189. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  190. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  191. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  192. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  193. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  195. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  197. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  198. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  199. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  200. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  201. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  202. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  203. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  205. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  207. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  208. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  209. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  210. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  211. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  212. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  213. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  215. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  216. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  217. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  218. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  219. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  220. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  222. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  223. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  224. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  225. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  226. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  227. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  228. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  229. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  231. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  232. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  233. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  234. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  235. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  236. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  237. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  238. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  239. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  240. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  241. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  242. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  243. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  244. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  246. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  248. package/cli/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  249. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  250. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  251. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  253. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  254. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  256. package/cli/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  257. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  258. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  259. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  260. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  261. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  262. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  263. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  264. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  266. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  267. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  268. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  269. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  270. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  271. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  272. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  273. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  274. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  276. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  277. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  278. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  279. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  280. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  281. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  282. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  283. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  284. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  285. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  286. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  287. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  288. package/cli/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  289. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  290. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  293. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  294. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  295. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  296. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  297. package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
  298. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  299. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  300. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  301. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  302. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  303. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  304. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  305. package/cli/app/.next-cli-build/server/app/landing.rsc +5 -5
  306. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  307. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  308. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  309. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  310. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  311. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  312. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  313. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  314. package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
  315. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  316. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  317. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  318. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  319. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  320. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  321. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  322. package/cli/app/.next-cli-build/server/app-paths-manifest.json +10 -10
  323. package/cli/app/.next-cli-build/server/chunks/1131.js +1 -1
  324. package/cli/app/.next-cli-build/server/chunks/1350.js +1 -1
  325. package/cli/app/.next-cli-build/server/chunks/3110.js +5 -5
  326. package/cli/app/.next-cli-build/server/chunks/3949.js +1 -1
  327. package/cli/app/.next-cli-build/server/chunks/412.js +1 -1
  328. package/cli/app/.next-cli-build/server/chunks/4721.js +2 -2
  329. package/cli/app/.next-cli-build/server/chunks/4827.js +1 -1
  330. package/cli/app/.next-cli-build/server/chunks/492.js +1 -1
  331. package/cli/app/.next-cli-build/server/chunks/7319.js +9 -9
  332. package/cli/app/.next-cli-build/server/chunks/7634.js +1 -1
  333. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  334. package/cli/app/.next-cli-build/server/chunks/8895.js +8 -6
  335. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  336. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  337. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  338. package/cli/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  339. package/cli/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  340. package/cli/app/.next-cli-build/static/chunks/523-b919955efdfb3114.js +3 -0
  341. package/cli/app/.next-cli-build/static/chunks/{5497-58cf38baa1268b48.js → 5497-1418f24d40191d87.js} +1 -1
  342. package/cli/app/.next-cli-build/static/chunks/{620-46bb7a507391dfb3.js → 620-3b2455ce06fdf95b.js} +1 -1
  343. package/cli/app/.next-cli-build/static/css/fbf6ffb753d0acf3.css +1 -0
  344. package/cli/app/CHANGELOG.md +12 -0
  345. package/cli/app/package.json +1 -1
  346. package/cli/package.json +1 -1
  347. package/package.json +1 -1
  348. package/cli/app/.next-cli-build/static/chunks/523-6328fbe601833f42.js +0 -3
  349. package/cli/app/.next-cli-build/static/css/61b96453f1770241.css +0 -1
  350. /package/cli/app/.next-cli-build/static/{zu5cbA_a_vsm5uwG_akSv → Y5Cb81ptqfyKXUcn7uCLE}/_buildManifest.js +0 -0
  351. /package/cli/app/.next-cli-build/static/{zu5cbA_a_vsm5uwG_akSv → Y5Cb81ptqfyKXUcn7uCLE}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- exports.id=4721,exports.ids=[4721],exports.modules={43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>m});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(2116),i=c.n(h),j=c(50412),k=c(50377);let l=[{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"}];function m({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)([]),[h,r]=(0,e.useState)(!0),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)(null),[A,B]=(0,e.useState)(null),[C,D]=(0,e.useState)(null),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(()=>new Set),[I,J]=(0,e.useState)(()=>({})),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!0),[O,P]=(0,e.useState)(!0),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!0),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)(""),[aa,ab]=(0,e.useState)(!1),[ac,ad]=(0,e.useState)(""),[ae,af]=(0,e.useState)(null),[ag,ah]=(0,e.useState)(!1),[ai,aj]=(0,e.useState)(!1),[ak,al]=(0,e.useState)(!1),[am,an]=(0,e.useState)(!1),[ao,ap]=(0,e.useState)(""),[aq,ar]=(0,e.useState)(!1),[as,at]=(0,e.useState)(""),[au,av]=(0,e.useState)(null),[aw,ax]=(0,e.useState)(""),[ay,az]=(0,e.useState)(""),[aA,aB]=(0,e.useState)(null),[aC,aD]=(0,e.useState)(!1),[aE,aF]=(0,e.useState)([]),[aG,aH]=(0,e.useState)(""),[aI,aJ]=(0,e.useState)(!1),[aK,aL]=(0,e.useState)(!1),[aM,aN]=(0,e.useState)(!1),aO=(0,e.useRef)(null),aP=(0,e.useRef)(0),aQ=(0,e.useRef)(0);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aR,aS]=(0,e.useState)(!1),[aT,aU]=(0,e.useState)(!1),[aV,aW]=(0,e.useState)(!1),{copied:aX,copy:aY}=(0,k.C)(),aZ=!M||!O,a$=M?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let a_=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&R(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},a0=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&L(a)}catch(a){console.log("Error updating requireApiKey:",a)}},a1=async()=>{try{let[a,b]=await Promise.all([fetch("/api/keys"),fetch("/api/providers")]),[d,e]=await Promise.all([a.json(),b.json()]);a.ok&&c(d.keys||[]),b.ok&&g(e.connections||[])}catch(a){console.log("Error fetching data:",a)}finally{r(!1)}},a2=async(a,...b)=>{let c=()=>aP.current===a;ab(!0),ad("Waiting for tunnel ready...");let d=b.filter(Boolean).map(a=>`${a}/api/health`),e=Date.now();for(;Date.now()-e<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),!c())return!1;let a=await Promise.any(d.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1);if(!c())return!1;if(a)return V(!0),ab(!1),ad(""),!0;if((Date.now()-e)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return af({type:"error",message:"Tunnel process stopped unexpectedly."}),ab(!1),ad(""),!1}}catch{}}return af({type:"error",message:"Tunnel created but not reachable. Please try again."}),ab(!1),ad(""),!1},a3=async()=>{ah(!1);let a=aP.current+1;aP.current=a;let b=()=>aP.current===a;ab(!0),af(null),ad("Creating tunnel...");let c=!0;(async()=>{for(;c&&b();){try{let a=await fetch("/api/tunnel/status");if(a.ok){let d=await a.json();d.download?.downloading?ad(`Downloading cloudflared... ${d.download.progress}%`):c&&b()&&ad("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let d=await fetch("/api/tunnel/enable",{method:"POST"});c=!1;let e=await d.json();if(!b())return;if(!d.ok)return void af({type:"error",message:e.error||"Failed to enable tunnel"});let f=e.tunnelUrl;if(!f)return void af({type:"error",message:"No tunnel URL returned"});Z(f),_(e.publicUrl||""),await a2(a,e.publicUrl,f)}catch(a){b()&&af({type:"error",message:a.message})}finally{c=!1,b()&&(ab(!1),ad(""))}},a4=async()=>{ab(!0),af(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(V(!1),Z(""),aj(!1),af({type:"success",message:"Tunnel disabled"})):af({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){af({type:"error",message:a.message})}finally{ab(!1)}},a5=async()=>{aB(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aB(b.installed),b}}catch{}return aB(!1),{installed:!1}},a6=async()=>{aD(!0),av(null),aF([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aG})});if(aH(""),!a.ok){let b=await a.json().catch(()=>({}));throw Error(b.error||`Install failed (${a.status})`)}let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aF(a=>[...a.slice(-50),d.message]);else if("done"===c){aB(!0),aD(!1),aL(!1),ba();return}else"error"===c&&av({type:"error",message:d.error||"Install failed"})}}}catch(a){av({type:"error",message:a.message})}finally{aD(!1)}},a7=async(a,b)=>{let c=()=>aQ.current===a;at("Waiting for Tailscale ready...");let d=`${b}/api/health`,e=Date.now();for(;Date.now()-e<3e5&&(await new Promise(a=>setTimeout(a,2e3)),c());)try{let a=await fetch(d,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}return!1},a8=(a,b)=>{ax(a),az(b)},a9=()=>{ax(""),az("")},ba=async()=>{aL(!1);let a=aQ.current+1;aQ.current=a;let b=()=>aQ.current===a;aJ(!0),ar(!0),av(null),at("Connecting..."),a9();try{let c=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await c.json();if(!b())return;if(c.ok&&d.success){ap(d.tunnelUrl||"");let c=await a7(a,d.tunnelUrl);if(!b())return;al(!0),av(c?null:{type:"warning",message:"Connected but not reachable yet."});return}if(d.needsLogin&&d.authUrl){a8(d.authUrl,"Open Login Page"),at('Login required — click "Open Login Page" to continue');for(let c=0;c<40;c++){if(await new Promise(a=>setTimeout(a,3e3)),!b())return;try{let c=await fetch("/api/tunnel/tailscale-check");if(c.ok&&(await c.json()).loggedIn){a9(),at("Starting funnel...");let c=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await c.json();if(!b())return;if(c.ok&&d.success){ap(d.tunnelUrl||"");let c=await a7(a,d.tunnelUrl);if(!b())return;al(!0),av(c?null:{type:"warning",message:"Connected but not reachable yet."})}else d.funnelNotEnabled&&d.enableUrl?await bb(a,d.enableUrl):av({type:"error",message:d.error||"Failed to start funnel"});return}}catch{}}a9(),av({type:"error",message:"Login timed out. Please try again."});return}if(d.funnelNotEnabled&&d.enableUrl)return void await bb(a,d.enableUrl);av({type:"error",message:d.error||"Failed to connect"})}catch(a){b()&&av({type:"error",message:a.message})}finally{b()&&(ar(!1),aJ(!1),at(""),a9())}},bb=async(a,b)=>{let c=()=>aQ.current===a;a8(b,"Open Funnel Settings"),at('Click "Open Funnel Settings" to enable Funnel...');for(let b=0;b<40;b++){if(await new Promise(a=>setTimeout(a,3e3)),!c())return;try{let b=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await b.json();if(!c())return;if(b.ok&&d.success){a9(),ap(d.tunnelUrl||"");let b=await a7(a,d.tunnelUrl);if(!c())return;al(!0),av(b?null:{type:"warning",message:"Connected but not reachable yet."});return}if(d.funnelNotEnabled)continue;if(d.error){a9(),av({type:"error",message:d.error});return}}catch{}}a9(),av({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bc=async()=>{ar(!0),av(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(al(!1),ap(""),aN(!1),av({type:"success",message:"Tailscale disabled"})):av({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){av({type:"error",message:a.message})}finally{ar(!1)}},bd=async()=>{av(null),aF([]);let a=await a5();a?.installed&&a?.hasCachedPassword?ba():aL(!0)},be=async a=>{if(a.preventDefault(),u.trim()&&!A){B("create"),D(null);try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:u})}),b=await a.json();if(!a.ok)throw Error(b.error||`Failed to create key (${a.status})`);x(b.key),b.id&&b.key&&J(a=>({...a,[b.id]:b.key})),await a1(),v(""),t(!1),D({type:"success",message:"API key created"})}catch(a){D({type:"error",message:a.message})}finally{B(null)}}},bf=async(a,b)=>{if(!A){B(`toggle:${a}`),D(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(!d.ok)throw Error(`Failed to update key (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c)),D({type:"success",message:"API key updated"})}catch(a){D({type:"error",message:a.message})}finally{B(null)}}},bg=async(a,b,d)=>{if(A)return;let e=""===d?0:Math.max(0,Number(d)||0);B(`budget:${a}`),D(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:e})});if(!d.ok)throw Error(`Failed to update budget (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,[b]:e}:c)),D({type:"success",message:"Budget updated"})}catch(a){D({type:"error",message:a.message})}finally{B(null)}},bh=async()=>{if(!E||A)return;let{keyId:a,selected:b}=E,d=[...b];B(`connections:${a}`),D(null);try{let b=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedConnectionIds:d})}),e=await b.json().catch(()=>({}));if(!b.ok)throw Error(e.error||`Failed to update provider access (${b.status})`);c(b=>b.map(b=>b.id===a?{...b,allowedConnectionIds:d}:b)),F(null),D({type:"success",message:"Provider access updated"})}catch(a){D({type:"error",message:a.message})}finally{B(null)}},bi=async a=>{if(I[a])return I[a];let b=await fetch(`/api/keys/${a}?reveal=1`,{cache:"no-store"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`Failed to reveal key (${b.status})`);let d=c.key?.key||c.key;if("string"!=typeof d||!d)throw Error("Key secret is not available");return J(b=>({...b,[a]:d})),d},bj=async a=>{if(G.has(a))return void H(b=>{let c=new Set(b);return c.delete(a),c});try{await bi(a),H(b=>{let c=new Set(b);return c.add(a),c}),D(null)}catch(a){D({type:"error",message:a.message})}},bk=async a=>{try{let b=await bi(a);aY(b,a),D(null)}catch(a){D({type:"error",message:a.message})}},[bl,bm]=(0,e.useState)("/v1");if(h)return(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsx)(j.Qv,{}),(0,d.jsx)(j.Qv,{})]});let bn=f.reduce((a,b)=>{let c=b.provider||"other";return a[c]||(a[c]=[]),a[c].push(b),a},{});return(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsxs)(j.Zp,{padding:"none",children:[(0,d.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,d.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,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Choose how local and remote clients connect to Zevai Router."})]})]}),(0,d.jsxs)("div",{className:"p-4 sm:p-5",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(n,{label:"Local",url:bl,copyId:"local_url",copied:aX,onCopy:aY}),(0,d.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,d.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] ${U?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),U&&!aa&&W?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Cloudflare Tunnel endpoint URL",value:`${$||Y}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aY(`${$||Y}/v1`,"tunnel_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aX?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aj(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!U||aa||W?aa?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ac||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{aP.current+=1,ab(!1),ad("")},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ae?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ae.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>ah(!0),children:"Enable"})]}):S?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>T(!1),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>{aZ?af({type:"error",message:`Security required: ${a$}`}):K?ah(!0):af({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aR?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>aj(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.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,d.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] ${ak?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),ak&&!aq&&am?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(j.pd,{"aria-label":"Tailscale endpoint URL",value:`${ao}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aY(`${ao}/v1`,"ts_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aX?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aN(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ak||aq||am?aq||aI?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),as||"Connecting..."]}),aw&&(0,d.jsx)(j.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aw,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:ay||"Open"}),(0,d.jsx)("button",{onClick:()=>{aQ.current+=1,ar(!1),aJ(!1),at(""),a9()},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):au?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),au.message]}),(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",className:"min-h-11 sm:min-h-8",onClick:bd,children:"Enable"})]}):(0,d.jsx)(j.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aZ?av({type:"error",message:`Security required: ${a$}`}):bd()},className:"min-h-11 sm:min-h-8",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aT?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aN(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aZ&&!U&&!ak&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(q,{message:a$,action:{label:"Open settings",href:"/dashboard/profile"}})}),(U||ak)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!K&&(0,d.jsx)(q,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!M||!O)&&(0,d.jsx)(q,{message:M?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:M?"Change password":"Enable",href:"/dashboard/profile"}})]}),(U||ak)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(j.lM,{touchTarget:!0,label:"Allow dashboard access via tunnel",checked:Q,onChange:()=>a_(!Q)}),(0,d.jsx)(p,{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,d.jsx)(j.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,d.jsxs)("div",{className:"relative flex flex-col gap-4 p-5 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3.5",children:[(0,d.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,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"Token Saver"}),(0,d.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tune RTK, Caveman, Ponytail, Headroom, and PXPIPE in one workspace."})]})]}),(0,d.jsxs)(i(),{href:"/dashboard/token-saver",className:"inline-flex min-h-11 w-full shrink-0 items-center justify-center gap-1.5 rounded-xl 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:min-h-0 sm:w-auto sm:rounded-lg",children:["Open workspace",(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"arrow_forward"})]})]})}),(0,d.jsxs)(j.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.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,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Keys"}),(0,d.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:[b.length," ",1===b.length?"key":"keys"]})]}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Control authentication and spending per client."})]})]}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>t(!0),className:"w-full sm:w-auto",children:"Create Key"})]}),C&&(0,d.jsx)("p",{role:"status",className:`mb-4 text-sm ${"error"===C.type?"text-red-500":"text-green-500"}`,children:C.message}),(0,d.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,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.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,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Reject requests that do not include a valid client key."})]})]}),(0,d.jsx)("div",{className:"shrink-0 self-end sm:self-auto",children:(0,d.jsx)(j.lM,{touchTarget:!0,label:"Require API key",checked:K,onChange:()=>a0(!K)})})]}),aV&&!K&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(q,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-surface-2/25 py-12 text-center",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(j.$n,{icon:"add",onClick:()=>t(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:b.map(a=>{var b,e;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono truncate max-w-[min(100%,28rem)]",children:(b=a,G.has(b.id)&&I[b.id]?I[b.id]:b.maskedKey||((e=b.key)?e.length>8?e.slice(0,8)+"...":e:"")||"••••••••")}),(0,d.jsx)("button",{type:"button",onClick:()=>bj(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:G.has(a.id)?"Hide key":"Show key","aria-label":G.has(a.id)?"Hide API key":"Show API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:G.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{type:"button",onClick:()=>bk(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:"Copy key","aria-label":"Copy API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aX===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Daily $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:A===`budget:${a.id}`,defaultValue:a.budgetDaily||0,onBlur:b=>bg(a.id,"budgetDaily",b.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)"},`daily-${a.budgetDaily||0}`)]}),(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Monthly $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:A===`budget:${a.id}`,defaultValue:a.budgetMonthly||0,onBlur:b=>bg(a.id,"budgetMonthly",b.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)"},`monthly-${a.budgetMonthly||0}`)]}),(0,d.jsxs)("button",{type:"button",disabled:A===`connections:${a.id}`,onClick:()=>{F({keyId:a.id,keyName:a.name,selected:new Set(a.allowedConnectionIds||[])})},className:"inline-flex min-h-8 items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1 text-[11px] font-medium text-text-muted transition-colors hover:border-primary/40 hover:text-primary disabled:opacity-50",title:"Restrict this API key to selected provider connections",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"account_tree"}),(a.allowedConnectionIds||[]).length>0?`${a.allowedConnectionIds.length} connection${1===a.allowedConnectionIds.length?"":"s"}`:"All connections"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex size-11 items-center justify-center sm:size-auto",children:(0,d.jsx)(j.lM,{size:"sm",touchTarget:!0,disabled:A===`toggle:${a.id}`,checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?z({title:"Pause API Key",message:`Pause API key "${a.name}"?
1
+ exports.id=4721,exports.ids=[4721],exports.modules={43173:(a,b,c)=>{"use strict";c.d(b,{default:()=>k});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(50377);let j=[{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"}];function k({machineId:a}){let[b,c]=(0,e.useState)([]),[f,g]=(0,e.useState)([]),[p,q]=(0,e.useState)(!0),[r,s]=(0,e.useState)(!1),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(null),[x,y]=(0,e.useState)(null),[z,A]=(0,e.useState)(null),[B,C]=(0,e.useState)(null),[D,E]=(0,e.useState)(null),[F,G]=(0,e.useState)(()=>new Set),[H,I]=(0,e.useState)(()=>({})),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!0),[N,O]=(0,e.useState)(!0),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!0),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),[Z,$]=(0,e.useState)(""),[_,aa]=(0,e.useState)(!1),[ab,ac]=(0,e.useState)(""),[ad,ae]=(0,e.useState)(null),[af,ag]=(0,e.useState)(!1),[ah,ai]=(0,e.useState)(!1),[aj,ak]=(0,e.useState)(!1),[al,am]=(0,e.useState)(!1),[an,ao]=(0,e.useState)(""),[ap,aq]=(0,e.useState)(!1),[ar,as]=(0,e.useState)(""),[at,au]=(0,e.useState)(null),[av,aw]=(0,e.useState)(""),[ax,ay]=(0,e.useState)(""),[az,aA]=(0,e.useState)(null),[aB,aC]=(0,e.useState)(!1),[aD,aE]=(0,e.useState)([]),[aF,aG]=(0,e.useState)(""),[aH,aI]=(0,e.useState)(!1),[aJ,aK]=(0,e.useState)(!1),[aL,aM]=(0,e.useState)(!1),aN=(0,e.useRef)(null),aO=(0,e.useRef)(0),aP=(0,e.useRef)(0);(0,e.useRef)(0),(0,e.useRef)(0),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1),(0,e.useRef)(!1);let[aQ,aR]=(0,e.useState)(!1),[aS,aT]=(0,e.useState)(!1),[aU,aV]=(0,e.useState)(!1),{copied:aW,copy:aX}=(0,i.C)(),aY=!L||!N,aZ=L?"Change the default dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,e.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=5&&d(!1))},[]);let a$=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tunnelDashboardAccess:a})})).ok&&Q(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},a_=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireApiKey:a})})).ok&&K(a)}catch(a){console.log("Error updating requireApiKey:",a)}},a0=async()=>{try{let[a,b]=await Promise.all([fetch("/api/keys"),fetch("/api/providers")]),[d,e]=await Promise.all([a.json(),b.json()]);a.ok&&c(d.keys||[]),b.ok&&g(e.connections||[])}catch(a){console.log("Error fetching data:",a)}finally{q(!1)}},a1=async(a,...b)=>{let c=()=>aO.current===a;aa(!0),ac("Waiting for tunnel ready...");let d=b.filter(Boolean).map(a=>`${a}/api/health`),e=Date.now();for(;Date.now()-e<3e5;){if(await new Promise(a=>setTimeout(a,2e3)),!c())return!1;let a=await Promise.any(d.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1);if(!c())return!1;if(a)return U(!0),aa(!1),ac(""),!0;if((Date.now()-e)%1e4<2e3)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return ae({type:"error",message:"Tunnel process stopped unexpectedly."}),aa(!1),ac(""),!1}}catch{}}return ae({type:"error",message:"Tunnel created but not reachable. Please try again."}),aa(!1),ac(""),!1},a2=async()=>{ag(!1);let a=aO.current+1;aO.current=a;let b=()=>aO.current===a;aa(!0),ae(null),ac("Creating tunnel...");let c=!0;(async()=>{for(;c&&b();){try{let a=await fetch("/api/tunnel/status");if(a.ok){let d=await a.json();d.download?.downloading?ac(`Downloading cloudflared... ${d.download.progress}%`):c&&b()&&ac("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let d=await fetch("/api/tunnel/enable",{method:"POST"});c=!1;let e=await d.json();if(!b())return;if(!d.ok)return void ae({type:"error",message:e.error||"Failed to enable tunnel"});let f=e.tunnelUrl;if(!f)return void ae({type:"error",message:"No tunnel URL returned"});Y(f),$(e.publicUrl||""),await a1(a,e.publicUrl,f)}catch(a){b()&&ae({type:"error",message:a.message})}finally{c=!1,b()&&(aa(!1),ac(""))}},a3=async()=>{aa(!0),ae(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(U(!1),Y(""),ai(!1),ae({type:"success",message:"Tunnel disabled"})):ae({type:"error",message:b.error||"Failed to disable tunnel"})}catch(a){ae({type:"error",message:a.message})}finally{aa(!1)}},a4=async()=>{aA(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aA(b.installed),b}}catch{}return aA(!1),{installed:!1}},a5=async()=>{aC(!0),au(null),aE([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aF})});if(aG(""),!a.ok){let b=await a.json().catch(()=>({}));throw Error(b.error||`Install failed (${a.status})`)}let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aE(a=>[...a.slice(-50),d.message]);else if("done"===c){aA(!0),aC(!1),aK(!1),a9();return}else"error"===c&&au({type:"error",message:d.error||"Install failed"})}}}catch(a){au({type:"error",message:a.message})}finally{aC(!1)}},a6=async(a,b)=>{let c=()=>aP.current===a;as("Waiting for Tailscale ready...");let d=`${b}/api/health`,e=Date.now();for(;Date.now()-e<3e5&&(await new Promise(a=>setTimeout(a,2e3)),c());)try{let a=await fetch(d,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}return!1},a7=(a,b)=>{aw(a),ay(b)},a8=()=>{aw(""),ay("")},a9=async()=>{aK(!1);let a=aP.current+1;aP.current=a;let b=()=>aP.current===a;aI(!0),aq(!0),au(null),as("Connecting..."),a8();try{let c=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await c.json();if(!b())return;if(c.ok&&d.success){ao(d.tunnelUrl||"");let c=await a6(a,d.tunnelUrl);if(!b())return;ak(!0),au(c?null:{type:"warning",message:"Connected but not reachable yet."});return}if(d.needsLogin&&d.authUrl){a7(d.authUrl,"Open Login Page"),as('Login required — click "Open Login Page" to continue');for(let c=0;c<40;c++){if(await new Promise(a=>setTimeout(a,3e3)),!b())return;try{let c=await fetch("/api/tunnel/tailscale-check");if(c.ok&&(await c.json()).loggedIn){a8(),as("Starting funnel...");let c=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await c.json();if(!b())return;if(c.ok&&d.success){ao(d.tunnelUrl||"");let c=await a6(a,d.tunnelUrl);if(!b())return;ak(!0),au(c?null:{type:"warning",message:"Connected but not reachable yet."})}else d.funnelNotEnabled&&d.enableUrl?await ba(a,d.enableUrl):au({type:"error",message:d.error||"Failed to start funnel"});return}}catch{}}a8(),au({type:"error",message:"Login timed out. Please try again."});return}if(d.funnelNotEnabled&&d.enableUrl)return void await ba(a,d.enableUrl);au({type:"error",message:d.error||"Failed to connect"})}catch(a){b()&&au({type:"error",message:a.message})}finally{b()&&(aq(!1),aI(!1),as(""),a8())}},ba=async(a,b)=>{let c=()=>aP.current===a;a7(b,"Open Funnel Settings"),as('Click "Open Funnel Settings" to enable Funnel...');for(let b=0;b<40;b++){if(await new Promise(a=>setTimeout(a,3e3)),!c())return;try{let b=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),d=await b.json();if(!c())return;if(b.ok&&d.success){a8(),ao(d.tunnelUrl||"");let b=await a6(a,d.tunnelUrl);if(!c())return;ak(!0),au(b?null:{type:"warning",message:"Connected but not reachable yet."});return}if(d.funnelNotEnabled)continue;if(d.error){a8(),au({type:"error",message:d.error});return}}catch{}}a8(),au({type:"error",message:"Timed out waiting for Funnel to be enabled."})},bb=async()=>{aq(!0),au(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(ak(!1),ao(""),aM(!1),au({type:"success",message:"Tailscale disabled"})):au({type:"error",message:b.error||"Failed to disable Tailscale"})}catch(a){au({type:"error",message:a.message})}finally{aq(!1)}},bc=async()=>{au(null),aE([]);let a=await a4();a?.installed&&a?.hasCachedPassword?a9():aK(!0)},bd=async a=>{if(a.preventDefault(),t.trim()&&!z){A("create"),C(null);try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t})}),b=await a.json();if(!a.ok)throw Error(b.error||`Failed to create key (${a.status})`);w(b.key),b.id&&b.key&&I(a=>({...a,[b.id]:b.key})),await a0(),u(""),s(!1),C({type:"success",message:"API key created"})}catch(a){C({type:"error",message:a.message})}finally{A(null)}}},be=async(a,b)=>{if(!z){A(`toggle:${a}`),C(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})});if(!d.ok)throw Error(`Failed to update key (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c)),C({type:"success",message:"API key updated"})}catch(a){C({type:"error",message:a.message})}finally{A(null)}}},bf=async(a,b,d)=>{if(z)return;let e=""===d?0:Math.max(0,Number(d)||0);A(`budget:${a}`),C(null);try{let d=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({[b]:e})});if(!d.ok)throw Error(`Failed to update budget (${d.status})`);c(c=>c.map(c=>c.id===a?{...c,[b]:e}:c)),C({type:"success",message:"Budget updated"})}catch(a){C({type:"error",message:a.message})}finally{A(null)}},bg=async()=>{if(!D||z)return;let{keyId:a,selected:b}=D,d=[...b];A(`connections:${a}`),C(null);try{let b=await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedConnectionIds:d})}),e=await b.json().catch(()=>({}));if(!b.ok)throw Error(e.error||`Failed to update provider access (${b.status})`);c(b=>b.map(b=>b.id===a?{...b,allowedConnectionIds:d}:b)),E(null),C({type:"success",message:"Provider access updated"})}catch(a){C({type:"error",message:a.message})}finally{A(null)}},bh=async a=>{if(H[a])return H[a];let b=await fetch(`/api/keys/${a}?reveal=1`,{cache:"no-store"}),c=await b.json().catch(()=>({}));if(!b.ok)throw Error(c.error||`Failed to reveal key (${b.status})`);let d=c.key?.key||c.key;if("string"!=typeof d||!d)throw Error("Key secret is not available");return I(b=>({...b,[a]:d})),d},bi=async a=>{if(F.has(a))return void G(b=>{let c=new Set(b);return c.delete(a),c});try{await bh(a),G(b=>{let c=new Set(b);return c.add(a),c}),C(null)}catch(a){C({type:"error",message:a.message})}},bj=async a=>{try{let b=await bh(a);aX(b,a),C(null)}catch(a){C({type:"error",message:a.message})}},[bk,bl]=(0,e.useState)("/v1");if(p)return(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsx)(h.Qv,{}),(0,d.jsx)(h.Qv,{})]});let bm=f.reduce((a,b)=>{let c=b.provider||"other";return a[c]||(a[c]=[]),a[c].push(b),a},{});return(0,d.jsxs)("div",{className:"flex flex-col gap-6 lg:gap-7",children:[(0,d.jsxs)(h.Zp,{padding:"none",children:[(0,d.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,d.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,d.jsxs)("div",{children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Endpoint"}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Choose how local and remote clients connect to Zevai Router."})]})]}),(0,d.jsxs)("div",{className:"p-4 sm:p-5",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)(l,{label:"Local",url:bk,copyId:"local_url",copied:aW,onCopy:aX}),(0,d.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,d.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] ${T?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),T&&!_&&V?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{"aria-label":"Cloudflare Tunnel endpoint URL",value:`${Z||X}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aX(`${Z||X}/v1`,"tunnel_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===aW?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>ai(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!T||_||V?_?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ab||"Creating tunnel..."]}),(0,d.jsx)("button",{onClick:()=>{aO.current+=1,aa(!1),ac("")},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):ad?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),ad.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>ag(!0),children:"Enable"})]}):R?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,d.jsx)("button",{onClick:()=>S(!1),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"cloud_upload",className:"min-h-11 sm:min-h-8",onClick:()=>{aY?ae({type:"error",message:`Security required: ${aZ}`}):J?ag(!0):ae({type:"error",message:'Security required: Enable "Require API key" before activating the tunnel.'})},children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aQ?"Tunnel reconnecting...":"Tunnel checking..."]}),(0,d.jsx)("button",{onClick:()=>ai(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tunnel",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,d.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,d.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] ${aj?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),aj&&!ap&&al?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.pd,{"aria-label":"Tailscale endpoint URL",value:`${an}/v1`,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>aX(`${an}/v1`,"ts_url"),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===aW?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>aM(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!aj||ap||al?ap||aH?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),ar||"Connecting..."]}),av&&(0,d.jsx)(h.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(av,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:ax||"Open"}),(0,d.jsx)("button",{onClick:()=>{aP.current+=1,aq(!1),aI(!1),as(""),a8()},className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Stop",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):at?.type==="error"?(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),at.message]}),(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",className:"min-h-11 sm:min-h-8",onClick:bc,children:"Enable"})]}):(0,d.jsx)(h.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{aY?au({type:"error",message:`Security required: ${aZ}`}):bc()},className:"min-h-11 sm:min-h-8",children:"Enable"}):(0,d.jsxs)(d.Fragment,{children:[(0,d.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,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aS?"Tailscale reconnecting...":"Tailscale checking..."]}),(0,d.jsx)("button",{onClick:()=>aM(!0),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-red-500 transition-colors hover:bg-red-500/10 sm:size-9 sm:rounded-lg",title:"Disable Tailscale",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),aY&&!T&&!aj&&(0,d.jsx)("div",{className:"mt-4",children:(0,d.jsx)(o,{message:aZ,action:{label:"Open settings",href:"/dashboard/profile"}})}),(T||aj)&&(0,d.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!J&&(0,d.jsx)(o,{message:"Require API key is disabled — your endpoint is publicly accessible without authentication.",action:{label:"Enable",href:"#require-api-key"}}),(!L||!N)&&(0,d.jsx)(o,{message:L?"Dashboard uses the default password — change it in Profile settings.":"Require login is disabled — anyone can access your dashboard via tunnel.",action:{label:L?"Change password":"Enable",href:"/dashboard/profile"}})]}),(T||aj)&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,d.jsx)(h.lM,{touchTarget:!0,label:"Allow dashboard access via tunnel",checked:P,onChange:()=>a$(!P)}),(0,d.jsx)(n,{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,d.jsxs)(h.Zp,{id:"require-api-key",children:[(0,d.jsxs)("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.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,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,d.jsx)("h2",{className:"text-lg font-semibold leading-tight",children:"API Keys"}),(0,d.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:[b.length," ",1===b.length?"key":"keys"]})]}),(0,d.jsx)("p",{className:"mt-0.5 text-xs text-text-muted",children:"Control authentication and spending per client."})]})]}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>s(!0),className:"w-full sm:w-auto",children:"Create Key"})]}),B&&(0,d.jsx)("p",{role:"status",className:`mb-4 text-sm ${"error"===B.type?"text-red-500":"text-green-500"}`,children:B.message}),(0,d.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,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.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,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Require API key"}),(0,d.jsx)("p",{className:"mt-0.5 text-sm text-text-muted",children:"Reject requests that do not include a valid client key."})]})]}),(0,d.jsx)("div",{className:"shrink-0 self-end sm:self-auto",children:(0,d.jsx)(h.lM,{touchTarget:!0,label:"Require API key",checked:J,onChange:()=>a_(!J)})})]}),aU&&!J&&(0,d.jsx)("div",{className:"mb-4 -mt-2",children:(0,d.jsx)(o,{message:"Endpoint is exposed without an API key."})}),0===b.length?(0,d.jsxs)("div",{className:"rounded-xl border border-dashed border-border bg-surface-2/25 py-12 text-center",children:[(0,d.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,d.jsx)("p",{className:"text-text-main font-medium mb-1",children:"No API keys yet"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Create your first API key to get started"}),(0,d.jsx)(h.$n,{icon:"add",onClick:()=>s(!0),children:"Create Key"})]}):(0,d.jsx)("div",{className:"grid grid-cols-1 gap-3 lg:grid-cols-2",children:b.map(a=>{var b,e;return(0,d.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===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:a.name}),(0,d.jsxs)("div",{className:"flex items-center gap-2 mt-1 min-w-0",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono truncate max-w-[min(100%,28rem)]",children:(b=a,F.has(b.id)&&H[b.id]?H[b.id]:b.maskedKey||((e=b.key)?e.length>8?e.slice(0,8)+"...":e:"")||"••••••••")}),(0,d.jsx)("button",{type:"button",onClick:()=>bi(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:F.has(a.id)?"Hide key":"Show key","aria-label":F.has(a.id)?"Hide API key":"Show API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:F.has(a.id)?"visibility_off":"visibility"})}),(0,d.jsx)("button",{type:"button",onClick:()=>bj(a.id),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted opacity-100 transition-all hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-7 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100",title:"Copy key","aria-label":"Copy API key",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:aW===a.id?"check":"content_copy"})})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Created ",new Date(a.createdAt).toLocaleDateString()]}),!1===a.isActive&&(0,d.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:"Paused"}),(0,d.jsxs)("div",{className:"mt-3 flex flex-wrap items-center gap-3",children:[(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Daily $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:z===`budget:${a.id}`,defaultValue:a.budgetDaily||0,onBlur:b=>bf(a.id,"budgetDaily",b.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)"},`daily-${a.budgetDaily||0}`)]}),(0,d.jsxs)("label",{className:"flex items-center gap-1 text-[11px] text-text-muted",children:["Monthly $",(0,d.jsx)("input",{type:"number",min:"0",step:"0.01",disabled:z===`budget:${a.id}`,defaultValue:a.budgetMonthly||0,onBlur:b=>bf(a.id,"budgetMonthly",b.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)"},`monthly-${a.budgetMonthly||0}`)]}),(0,d.jsxs)("button",{type:"button",disabled:z===`connections:${a.id}`,onClick:()=>{E({keyId:a.id,keyName:a.name,selected:new Set(a.allowedConnectionIds||[])})},className:"inline-flex min-h-8 items-center gap-1.5 rounded-lg border border-border bg-surface px-2.5 py-1 text-[11px] font-medium text-text-muted transition-colors hover:border-primary/40 hover:text-primary disabled:opacity-50",title:"Restrict this API key to selected provider connections",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"account_tree"}),(a.allowedConnectionIds||[]).length>0?`${a.allowedConnectionIds.length} connection${1===a.allowedConnectionIds.length?"":"s"}`:"All connections"]})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("div",{className:"flex size-11 items-center justify-center sm:size-auto",children:(0,d.jsx)(h.lM,{size:"sm",touchTarget:!0,disabled:z===`toggle:${a.id}`,checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?y({title:"Pause API Key",message:`Pause API key "${a.name}"?
2
2
 
3
- This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{z(null),bf(a.id,b)}}):bf(a.id,b)},title:a.isActive?"Pause key":"Resume key"})}),(0,d.jsx)("button",{disabled:A===`delete:${a.id}`,onClick:()=>{var b;return b=a.id,void(!A&&z({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{z(null),B(`delete:${b}`),D(null);try{let a=await fetch(`/api/keys/${b}`,{method:"DELETE"});if(!a.ok)throw Error(`Failed to delete key (${a.status})`);c(a=>a.filter(a=>a.id!==b)),H(a=>{let c=new Set(a);return c.delete(b),c}),J(a=>{if(!(b in a))return a;let c={...a};return delete c[b],c}),D({type:"success",message:"API key deleted"})}catch(a){D({type:"error",message:a.message})}finally{B(null)}}}))},className:"flex size-11 items-center justify-center rounded-xl text-red-500 opacity-100 transition-all hover:bg-red-500/10 sm:size-9 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100","aria-label":`Delete ${a.name}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(j.aF,{isOpen:!!E,title:"Provider Access",onClose:()=>{A?.startsWith("connections:")||F(null)},children:E&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"rounded-xl border border-primary/15 bg-primary/[0.045] p-3",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:E.keyName}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Empty selection keeps the current unrestricted behavior. Once selected, routing, fallback, and combos can only use these connections."})]}),0===f.length?(0,d.jsx)("p",{className:"rounded-xl border border-dashed border-border p-5 text-center text-sm text-text-muted",children:"No provider connections are configured yet."}):(0,d.jsx)("div",{className:"max-h-[min(28rem,60vh)] space-y-3 overflow-y-auto pr-1",children:Object.entries(bn).map(([a,b])=>(0,d.jsxs)("div",{className:"rounded-xl border border-border-subtle bg-surface-2/25 p-3",children:[(0,d.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted",children:a}),(0,d.jsx)("div",{className:"space-y-1.5",children:b.map(a=>{let b=E.selected.has(a.id),c=a.displayName||a.name||a.email||a.id;return(0,d.jsxs)("label",{className:"flex min-h-11 cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>{var b;return b=a.id,void F(a=>{if(!a)return a;let c=new Set(a.selected);return c.has(b)?c.delete(b):c.add(b),{...a,selected:c}})},className:"size-4 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm text-text-main",children:c}),(0,d.jsx)("span",{className:"block truncate font-mono text-[10px] text-text-muted",children:a.id})]}),!1===a.isActive&&(0,d.jsx)("span",{className:"rounded-full bg-orange-500/10 px-2 py-0.5 text-[10px] text-orange-500",children:"Paused"})]},a.id)})})]},a))}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{fullWidth:!0,onClick:bh,disabled:A===`connections:${E.keyId}`,children:A===`connections:${E.keyId}`?"Saving...":"Save access"}),(0,d.jsx)(j.$n,{fullWidth:!0,variant:"ghost",disabled:A===`connections:${E.keyId}`,onClick:()=>F(null),children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:s,title:"Create API Key",onClose:()=>{t(!1),v("")},children:(0,d.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:be,children:[(0,d.jsx)(j.pd,{label:"Key Name",value:u,onChange:a=>v(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{type:"submit",fullWidth:!0,disabled:!u.trim()||"create"===A,children:"create"===A?"Creating...":"Create"}),(0,d.jsx)(j.$n,{type:"button",onClick:()=>{t(!1),v("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:!!w,title:"API Key Created",onClose:()=>x(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.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,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.pd,{value:w||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(j.$n,{variant:"secondary",icon:"created_key"===aX?"check":"content_copy",onClick:()=>aY(w,"created_key"),children:"created_key"===aX?"Copied!":"Copy"})]}),(0,d.jsx)(j.$n,{onClick:()=>x(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(j.aF,{isOpen:ag,title:"Enable Tunnel",onClose:()=>ah(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.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,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:l.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a3,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(j.$n,{onClick:()=>ah(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:ai,title:"Disable Tunnel",onClose:()=>!aa&&aj(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a4,fullWidth:!0,disabled:aa,variant:"danger",children:aa?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>aj(!1),variant:"ghost",fullWidth:!0,disabled:aa,children:"Cancel"})]})]})}),(0,d.jsx)(j.aF,{isOpen:aK,title:"Tailscale Funnel",onClose:()=>{aC||(aL(!1),aH(""),av(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aA&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===aA&&!aC&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:a6,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(j.$n,{onClick:()=>aL(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aC&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aE.length>0&&(0,d.jsx)("div",{ref:aO,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:aE.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===aA&&!aC&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:()=>ba(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(j.$n,{onClick:()=>aL(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),au&&(0,d.jsx)(o,{status:au})]})}),(0,d.jsx)(j.aF,{isOpen:aM,title:"Disable Tailscale",onClose:()=>!aq&&aN(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(j.$n,{onClick:bc,fullWidth:!0,disabled:aq,variant:"danger",children:aq?"Disabling...":"Disable"}),(0,d.jsx)(j.$n,{onClick:()=>aN(!1),variant:"ghost",fullWidth:!0,disabled:aq,children:"Cancel"})]})]})}),(0,d.jsx)(j.uo,{isOpen:!!y,onClose:()=>z(null),onConfirm:y?.onConfirm,title:y?.title||"Confirm",message:y?.message,variant:"danger"})]})}function n({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:h}){return(0,d.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,d.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"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(j.pd,{"aria-label":`${a} endpoint URL`,value:b,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg","aria-label":`Copy ${a} endpoint URL`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),h]})}function o({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function p({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.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:a})]})}function q({message:a,action:b}){return(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"inline-flex min-h-11 shrink-0 items-center text-xs font-medium underline hover:opacity-80 sm:min-h-0",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}m.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/zevairouter-build/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/zevairouter-build/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},71885:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},95853:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))}};
3
+ This key will stop working immediately but can be resumed later.`,onConfirm:async()=>{y(null),be(a.id,b)}}):be(a.id,b)},title:a.isActive?"Pause key":"Resume key"})}),(0,d.jsx)("button",{disabled:z===`delete:${a.id}`,onClick:()=>{var b;return b=a.id,void(!z&&y({title:"Delete API Key",message:"Delete this API key?",onConfirm:async()=>{y(null),A(`delete:${b}`),C(null);try{let a=await fetch(`/api/keys/${b}`,{method:"DELETE"});if(!a.ok)throw Error(`Failed to delete key (${a.status})`);c(a=>a.filter(a=>a.id!==b)),G(a=>{let c=new Set(a);return c.delete(b),c}),I(a=>{if(!(b in a))return a;let c={...a};return delete c[b],c}),C({type:"success",message:"API key deleted"})}catch(a){C({type:"error",message:a.message})}finally{A(null)}}}))},className:"flex size-11 items-center justify-center rounded-xl text-red-500 opacity-100 transition-all hover:bg-red-500/10 sm:size-9 sm:rounded-lg sm:opacity-0 sm:group-hover:opacity-100","aria-label":`Delete ${a.name}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,d.jsx)(h.aF,{isOpen:!!D,title:"Provider Access",onClose:()=>{z?.startsWith("connections:")||E(null)},children:D&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"rounded-xl border border-primary/15 bg-primary/[0.045] p-3",children:[(0,d.jsx)("p",{className:"text-sm font-medium",children:D.keyName}),(0,d.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Empty selection keeps the current unrestricted behavior. Once selected, routing, fallback, and combos can only use these connections."})]}),0===f.length?(0,d.jsx)("p",{className:"rounded-xl border border-dashed border-border p-5 text-center text-sm text-text-muted",children:"No provider connections are configured yet."}):(0,d.jsx)("div",{className:"max-h-[min(28rem,60vh)] space-y-3 overflow-y-auto pr-1",children:Object.entries(bm).map(([a,b])=>(0,d.jsxs)("div",{className:"rounded-xl border border-border-subtle bg-surface-2/25 p-3",children:[(0,d.jsx)("p",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-text-muted",children:a}),(0,d.jsx)("div",{className:"space-y-1.5",children:b.map(a=>{let b=D.selected.has(a.id),c=a.displayName||a.name||a.email||a.id;return(0,d.jsxs)("label",{className:"flex min-h-11 cursor-pointer items-center gap-3 rounded-lg px-2 py-1.5 transition-colors hover:bg-surface",children:[(0,d.jsx)("input",{type:"checkbox",checked:b,onChange:()=>{var b;return b=a.id,void E(a=>{if(!a)return a;let c=new Set(a.selected);return c.has(b)?c.delete(b):c.add(b),{...a,selected:c}})},className:"size-4 accent-primary"}),(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-sm text-text-main",children:c}),(0,d.jsx)("span",{className:"block truncate font-mono text-[10px] text-text-muted",children:a.id})]}),!1===a.isActive&&(0,d.jsx)("span",{className:"rounded-full bg-orange-500/10 px-2 py-0.5 text-[10px] text-orange-500",children:"Paused"})]},a.id)})})]},a))}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{fullWidth:!0,onClick:bg,disabled:z===`connections:${D.keyId}`,children:z===`connections:${D.keyId}`?"Saving...":"Save access"}),(0,d.jsx)(h.$n,{fullWidth:!0,variant:"ghost",disabled:z===`connections:${D.keyId}`,onClick:()=>E(null),children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:r,title:"Create API Key",onClose:()=>{s(!1),u("")},children:(0,d.jsxs)("form",{className:"flex flex-col gap-4",onSubmit:bd,children:[(0,d.jsx)(h.pd,{label:"Key Name",value:t,onChange:a=>u(a.target.value),placeholder:"Production Key"}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{type:"submit",fullWidth:!0,disabled:!t.trim()||"create"===z,children:"create"===z?"Creating...":"Create"}),(0,d.jsx)(h.$n,{type:"button",onClick:()=>{s(!1),u("")},variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:!!v,title:"API Key Created",onClose:()=>w(null),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.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,d.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:"Save this key now!"}),(0,d.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,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.pd,{value:v||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,d.jsx)(h.$n,{variant:"secondary",icon:"created_key"===aW?"check":"content_copy",onClick:()=>aX(v,"created_key"),children:"created_key"===aW?"Copied!":"Copy"})]}),(0,d.jsx)(h.$n,{onClick:()=>w(null),fullWidth:!0,children:"Done"})]})}),(0,d.jsx)(h.aF,{isOpen:af,title:"Enable Tunnel",onClose:()=>ag(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:"Cloudflare Tunnel"}),(0,d.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,d.jsx)("div",{className:"grid grid-cols-2 gap-3",children:j.map(a=>(0,d.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,d.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a2,fullWidth:!0,children:"Start Tunnel"}),(0,d.jsx)(h.$n,{onClick:()=>ag(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:ah,title:"Disable Tunnel",onClose:()=>!_&&ai(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a3,fullWidth:!0,disabled:_,variant:"danger",children:_?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>ai(!1),variant:"ghost",fullWidth:!0,disabled:_,children:"Cancel"})]})]})}),(0,d.jsx)(h.aF,{isOpen:aJ,title:"Tailscale Funnel",onClose:()=>{aB||(aK(!1),aG(""),au(null))},children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[null===az&&(0,d.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),!1===az&&!aB&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:a5,fullWidth:!0,children:"Install Tailscale"}),(0,d.jsx)(h.$n,{onClick:()=>aK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),aB&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aD.length>0&&(0,d.jsx)("div",{ref:aN,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:aD.map((a,b)=>(0,d.jsx)("div",{children:a},b))})]}),!0===az&&!aB&&(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:()=>a9(),fullWidth:!0,children:"Connect"}),(0,d.jsx)(h.$n,{onClick:()=>aK(!1),variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),at&&(0,d.jsx)(m,{status:at})]})}),(0,d.jsx)(h.aF,{isOpen:aL,title:"Disable Tailscale",onClose:()=>!ap&&aM(!1),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(h.$n,{onClick:bb,fullWidth:!0,disabled:ap,variant:"danger",children:ap?"Disabling...":"Disable"}),(0,d.jsx)(h.$n,{onClick:()=>aM(!1),variant:"ghost",fullWidth:!0,disabled:ap,children:"Cancel"})]})]})}),(0,d.jsx)(h.uo,{isOpen:!!x,onClose:()=>y(null),onConfirm:x?.onConfirm,title:x?.title||"Confirm",message:x?.message,variant:"danger"})]})}function l({label:a,url:b,copyId:c,copied:e,onCopy:f,badge:g,actions:i}){return(0,d.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,d.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"===g||"TS"===g?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,d.jsx)(h.pd,{"aria-label":`${a} endpoint URL`,value:b,readOnly:!0,className:"w-full min-w-0 font-mono text-sm sm:flex-1"}),(0,d.jsx)("button",{onClick:()=>f(b,c),className:"flex size-11 shrink-0 items-center justify-center rounded-xl text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5 sm:size-9 sm:rounded-lg","aria-label":`Copy ${a} endpoint URL`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e===c?"check":"content_copy"})}),i]})}function m({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}function n({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.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:a})]})}function o({message:a,action:b}){return(0,d.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,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"inline-flex min-h-11 shrink-0 items-center text-xs font-medium underline hover:opacity-80 sm:min-h-0",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}k.propTypes={machineId:g().string.isRequired}},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/zevairouter-build/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/zevairouter-build/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js","default")},71885:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},95853:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))}};
@@ -1 +1 @@
1
- exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.263","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"@node-saml/node-saml":"5.1.0","next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(83477);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};
1
+ exports.id=4827,exports.ids=[4827],exports.modules={15754:(a,b,c)=>{"use strict";let d=c(29021),{execFileSync:e}=c(79646),f="win32"===process.platform,g="linux"===process.platform;function h(a){return Number.isInteger(a)&&a>0&&a<=4194304}function i(a,b){try{return e(a,b,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:5e3,windowsHide:!0})}catch{return null}}function j(a,b){if("string"!=typeof a||/[\r\n]/.test(a.trim()))return null;let c=a.trim(),d=c.indexOf(" ("),e=c.lastIndexOf(") ");if(d<1||e<=d+2||Number(c.slice(0,d))!==b)return null;let f=c.slice(e+2).split(/\s+/),g=f[19];return f.length<20||!/^\d+$/.test(g)?null:g}function k(a){if(!h(a))return null;if(g){let b=null;try{b=d.readFileSync(`/proc/${a}/stat`,"utf8")}catch{return null}let c=j(b,a);return c?`${a}:${c}`:null}if(f){let b=String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-Process -Id ${a} -ErrorAction Stop).StartTime.Ticks`])||"").trim();return/^\d+$/.test(b)?`${a}:${b}`:null}let b=String(i("ps",["-o","lstart=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());if(1!==b.length)return null;let c=b[0].trim();return c?`${a}:${c}`:null}function l(a){if(!h(a))return null;if(f)return String(i("powershell",["-NonInteractive","-NoProfile","-Command",`(Get-CimInstance Win32_Process -Filter "ProcessId=${a}").CommandLine`])||"").trim()||null;let b=String(i("ps",["-o","command=","-p",String(a)])||"").split(/\r?\n/).filter(a=>a.trim());return 1!==b.length?null:b[0].trim()||null}function m(a){if(!h(a))return!1;try{return process.kill(a,0),!0}catch(a){return"EPERM"===a.code||"EACCES"===a.code}}function n(a){let b;try{b=d.readFileSync(a,"utf8").trim()}catch{return null}if(!b)return null;if(/^\d+$/.test(b)){let a=Number(b);return h(a)?{pid:a,startToken:null,kind:null,legacy:!0}:null}try{let a=JSON.parse(b),c=Number(a?.pid);if(!h(c))return null;return{pid:c,startToken:"string"==typeof a.startToken&&a.startToken?a.startToken:null,kind:"string"==typeof a.kind?a.kind:null,legacy:!1}}catch{return null}}a.exports={isValidPid:h,isProcessAlive:m,readProcessStartToken:k,readProcessCommand:l,writePidFile:function(a,b,{kind:c="process"}={}){let e=Number(b);if(!h(e))return!1;let f={v:1,kind:c,pid:e,startToken:k(e),platform:process.platform,writtenAt:new Date().toISOString()};try{let b=`${a}.${process.pid}.tmp`;return d.writeFileSync(b,JSON.stringify(f)),d.renameSync(b,a),!0}catch{return!1}},readPidFile:n,resolveVerifiedPid:function(a,{commandPattern:b=null}={}){let c=n(a);if(!c)return{pid:null,reason:"no_pid_file"};if(!m(c.pid))return{pid:null,reason:"not_running",pidFileStale:!0};let d=k(c.pid);if(c.startToken)return d?d!==c.startToken?{pid:null,reason:"pid_recycled",pidFileStale:!0}:{pid:c.pid,reason:"verified_start_token"}:{pid:null,reason:"identity_unreadable"};if(!b)return{pid:null,reason:"identity_unverifiable"};let e=l(c.pid);return e?b.test(e)?{pid:c.pid,reason:"verified_command"}:{pid:null,reason:"command_mismatch",pidFileStale:!0}:{pid:null,reason:"identity_unreadable"}},removePidFile:function(a){try{d.rmSync(a,{force:!0})}catch{}},parseLinuxStartTime:j}},21719:(a,b,c)=>{"use strict";c.d(b,{g:()=>n,l:()=>m});var d=c(79646),e=c(33873),f=c.n(e),g=c(29021),h=c.n(g),i=c(21820),j=c.n(i),k=c(30869),l=c(15754);async function m({excludePids:a=[]}={}){!function(){try{let a=f().join("win32"===process.platform?f().join(process.env.APPDATA||"","zevai"):f().join(j().homedir(),".zevai"),"mitm",".mitm.pid"),{pid:b}=(0,l.resolveVerifiedPid)(a,{commandPattern:/(mitm[\\/]server\.js|mitm[\\/]+server\b)/i});if(!b)return void(0,l.removePidFile)(a);if("win32"===process.platform)try{(0,d.execSync)(`taskkill /F /T /PID ${b}`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{try{(0,d.execSync)(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${b} -Force"`,{stdio:"ignore",windowsHide:!0,timeout:3e3})}catch{}}else try{(0,d.execSync)(`sudo -n kill -9 ${b} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{try{process.kill(b,"SIGKILL")}catch{}}(0,l.removePidFile)(a)}catch{}}();let b=function(a=[]){let b=[],c=process.platform,e=new Set([process.pid,...Array.isArray(a)?a:[]].filter(a=>null!=a).map(String));if("win32"===c){try{(0,d.execSync)('powershell -NonInteractive -WindowStyle Hidden -Command "Get-WmiObject Win32_Process -Filter \'Name=\\"node.exe\\"\' | Select-Object ProcessId,CommandLine | ConvertTo-Csv -NoTypeInformation"',{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").slice(1).filter(a=>a.trim()).forEach(a=>{let c=a.toLowerCase();if(c.includes("zevai")||c.includes("next-server")||c.includes("\\bin\\app\\")||c.includes("/bin/app/")||c.includes("cli.js")){let c=a.match(/^"(\d+)"/);c&&c[1]&&!e.has(c[1])&&b.push(c[1])}})}catch{}for(let a of["cloudflared","tray_windows_release"])try{let c=`powershell -NonInteractive -WindowStyle Hidden -Command "Get-Process ${a} -ErrorAction SilentlyContinue | Select-Object -ExpandProperty Id"`;(0,d.execSync)(c,{encoding:"utf8",windowsHide:!0,timeout:5e3}).split("\n").forEach(a=>{let c=a.trim();!c||isNaN(c)||e.has(c)||b.push(c)})}catch{}}else try{(0,d.execSync)("ps aux 2>/dev/null",{encoding:"utf8",timeout:5e3}).split("\n").forEach(a=>{if(a.includes("zevai")||a.includes("next-server")||a.includes("cloudflared")||a.includes("/bin/app/")||a.includes("tray_darwin")||a.includes("tray_linux")){let c=a.trim().split(/\s+/)[1];!c||isNaN(c)||e.has(c)||b.push(c)}})}catch{}return b}(a),c=process.platform;b.forEach(a=>{try{"win32"===c?(0,d.execSync)(`taskkill /F /PID ${a} 2>nul`,{stdio:"ignore",shell:!0,windowsHide:!0,timeout:3e3}):(0,d.execSync)(`kill -9 ${a} 2>/dev/null`,{stdio:"ignore",timeout:3e3})}catch{}}),b.length>0&&await new Promise(a=>setTimeout(a,1500))}async function n(a=k.h0.npmPackageName){let b=function(a){try{if(!a||!h().existsSync(a))return a;let b=f().join(process.env.DATA_DIR?process.env.DATA_DIR:"win32"===process.platform?f().join(process.env.APPDATA||f().join(j().homedir(),"AppData","Roaming"),"zevai"):f().join(j().homedir(),".zevai"),"runtime","updater"),c=f().join(b,"updater.js");if(h().existsSync(c))try{if(h().statSync(a).size===h().statSync(c).size)return c}catch{}return h().mkdirSync(b,{recursive:!0}),h().copyFileSync(a,c),c}catch{return a}}(function(){if(process.env.UPDATER_SCRIPT_PATH&&h().existsSync(process.env.UPDATER_SCRIPT_PATH))return process.env.UPDATER_SCRIPT_PATH;let a=f().join(process.cwd(),"src","lib","updater","updater.js");if(h().existsSync(a))return a;let b=f().join(process.cwd(),"..","src","lib","updater","updater.js");return h().existsSync(b)?b:a}()),c="1"===process.env.TRAY_MODE,e={cmd:"win32"===process.platform?"npx.cmd":"npx",args:[k.h0.npmPackageName]},g=String(process.env.PORT||k.h0.appPort||1997),i=c?[...e.args,"--tray","--skip-update"]:[...e.args,"--port",g,"--no-browser","--skip-update","--log"],l=(0,d.spawn)(process.execPath,[b],{detached:!0,stdio:"ignore",windowsHide:!0,env:function(a={}){let b={...process.env,...a};return delete b.ZEVAI_LAUNCHD_JOB,delete b.XPC_SERVICE_NAME,b}({UPDATER_PKG_NAME:a||"zevairouter",UPDATER_PORT:String(k.h0.statusPort),UPDATER_TAIL_LINES:String(k.h0.statusLogTailLines),UPDATER_RETRIES:String(k.h0.installRetries),UPDATER_RETRY_DELAY_MS:String(k.h0.installRetryDelayMs),UPDATER_LINGER_MS:String(k.h0.lingerAfterDoneMs),UPDATER_WAIT_MIN_MS:String(k.h0.waitForExitMinMs),UPDATER_WAIT_MAX_MS:String(k.h0.waitForExitMaxMs),UPDATER_WAIT_CHECK_MS:String(k.h0.waitForExitCheckMs),UPDATER_APP_PORT:g,UPDATER_RELAUNCH:"1",UPDATER_RELAUNCH_CMD:e.cmd,UPDATER_RELAUNCH_ARGS:JSON.stringify(i),ZEVAI_SERVER_MODE:c?"":"1"})});l.unref();try{await m({excludePids:[l.pid]})}catch{}return setTimeout(()=>process.exit(0),k.h0.exitDelayMs),l.pid}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g,oc:()=>i});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}},j={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat","notion-ai":"https://app.notion.com/api/v3/runInferenceTranscript"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.265","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"cli/cli.js"},"files":["cli/cli.js","cli/app/","cli/hooks/","cli/src/","cli/package.json","cli/README.md","cli/LICENSE","scripts/start-standalone.mjs","README.md","README.zh-CN.md","DOCKER.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"node scripts/build-app.mjs","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","lint":"eslint .","test":"vitest run --config tests/vitest.config.js","build:cli":"node cli/scripts/build-cli.js","audit:package":"node cli/scripts/audit-package.mjs","smoke:package":"node cli/scripts/smoke-package.mjs","release":"node cli/scripts/release.js","prepack":"npm run build:cli && npm run audit:package","postinstall":"node cli/hooks/postinstall.js"},"dependencies":{"@node-saml/node-saml":"5.1.0","next":"16.2.12","node-machine-id":"1.1.12","react":"19.2.4","react-dom":"19.2.4","sql.js":"1.14.1","yaml":"2.9.0"},"comment_optional_runtime":"Optional packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses CloakBrowser with playwright-core; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3, node-pty, and systray2.","overrides":{"body-parser":"^2.3.0","brace-expansion":"5.0.9","dompurify":"^3.4.12","ip-address":"^10.4.0","nanoid":"^3.3.18","postcss":"^8.5.10","sharp":"^0.35.0"},"comment_overrides":"Security floors for transitive dependencies. ESLint\'s legacy minimatch is a private, source-pinned 3.1.5 compatibility package backed by brace-expansion 5.0.9; modern minimatch and nanoid use fixed floors directly. Monaco still pins an old DOMPurify; Express and Next may resolve vulnerable body-parser/sharp releases. Recheck and remove overrides once parent packages require fixed versions.","devDependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@tailwindcss/postcss":"^4.1.18","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","better-sqlite3":"^12.6.2","chalk":"^4.1.2","confbox":"^0.2.4","dompurify":"^3.4.12","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","minimatch":"file:vendor/minimatch3-secure","monaco-editor":"^0.55.1","node-forge":"^1.3.3","open":"^11.0.0","ora":"^9.1.0","postcss":"^8.5.10","prop-types":"^15.8.1","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","tailwindcss":"^4","undici":"^8.10.0","uuid":"^14.0.1","vitest":"^4.1.10","zustand":"^5.0.10"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"git+https://github.com/Verifiedlabs/zevairouter.git"},"bugs":{"url":"https://github.com/Verifiedlabs/zevairouter/issues"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(83477);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},96487:()=>{}};