9router 0.4.18 → 0.4.19

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 (686) hide show
  1. package/app/.next/BUILD_ID +1 -1
  2. package/app/.next/app-path-routes-manifest.json +9 -6
  3. package/app/.next/build-manifest.json +2 -2
  4. package/app/.next/routes-manifest.json +18 -0
  5. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  6. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  9. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  10. package/app/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  11. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  12. package/app/.next/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  13. package/app/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  14. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  15. package/app/.next/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  16. package/app/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  17. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  18. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  19. package/app/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  20. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  21. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  22. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  24. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  25. package/app/.next/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  26. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  27. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  28. package/app/.next/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  30. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  31. package/app/.next/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  32. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  33. package/app/.next/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  34. package/app/.next/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  35. package/app/.next/server/app/(dashboard)/dashboard/page.js +2 -2
  36. package/app/.next/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  37. package/app/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  38. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  39. package/app/.next/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  40. package/app/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  41. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +2 -2
  42. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  43. package/app/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  44. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  45. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  46. package/app/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  47. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  48. package/app/.next/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  49. package/app/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  50. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +3 -3
  51. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  52. package/app/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  53. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  54. package/app/.next/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  55. package/app/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  56. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  57. package/app/.next/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  58. package/app/.next/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  59. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  60. package/app/.next/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  61. package/app/.next/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  62. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  63. package/app/.next/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  64. package/app/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  65. package/app/.next/server/app/_global-error/page.js +3 -3
  66. package/app/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  67. package/app/.next/server/app/_global-error.html +1 -1
  68. package/app/.next/server/app/_global-error.rsc +1 -1
  69. package/app/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  70. package/app/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  71. package/app/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  72. package/app/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  73. package/app/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  74. package/app/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  75. package/app/.next/server/app/_not-found/page.js +2 -2
  76. package/app/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  77. package/app/.next/server/app/_not-found.html +1 -1
  78. package/app/.next/server/app/_not-found.rsc +4 -4
  79. package/app/.next/server/app/_not-found.segments/_full.segment.rsc +4 -4
  80. package/app/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  81. package/app/.next/server/app/_not-found.segments/_index.segment.rsc +4 -4
  82. package/app/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  83. package/app/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  84. package/app/.next/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  85. package/app/.next/server/app/api/auth/login/route.js +1 -1
  86. package/app/.next/server/app/api/auth/logout/route.js +1 -1
  87. package/app/.next/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  88. package/app/.next/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  89. package/app/.next/server/app/api/cli-tools/claude-settings/route.js +2 -2
  90. package/app/.next/server/app/api/cli-tools/codex-settings/route.js +2 -2
  91. package/app/.next/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  92. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -0
  93. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -0
  94. package/app/.next/server/app/api/cli-tools/cowork-mcp-registry/route_client-reference-manifest.js +1 -0
  95. package/app/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  96. package/app/.next/server/app/api/cli-tools/droid-settings/route.js +2 -2
  97. package/app/.next/server/app/api/cli-tools/hermes-settings/route.js +1 -1
  98. package/app/.next/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  99. package/app/.next/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  100. package/app/.next/server/app/api/cloud/auth/route.js +1 -1
  101. package/app/.next/server/app/api/cloud/credentials/update/route.js +1 -1
  102. package/app/.next/server/app/api/cloud/model/resolve/route.js +1 -1
  103. package/app/.next/server/app/api/cloud/models/alias/route.js +1 -1
  104. package/app/.next/server/app/api/combos/[id]/route.js +1 -1
  105. package/app/.next/server/app/api/combos/route.js +1 -1
  106. package/app/.next/server/app/api/health/route.js +1 -1
  107. package/app/.next/server/app/api/init/route.js +1 -1
  108. package/app/.next/server/app/api/keys/[id]/route.js +1 -1
  109. package/app/.next/server/app/api/keys/route.js +1 -1
  110. package/app/.next/server/app/api/locale/route.js +1 -1
  111. package/app/.next/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  112. package/app/.next/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  113. package/app/.next/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  114. package/app/.next/server/app/api/media-providers/tts/voices/route.js +1 -1
  115. package/app/.next/server/app/api/models/alias/route.js +1 -1
  116. package/app/.next/server/app/api/models/availability/route.js +1 -1
  117. package/app/.next/server/app/api/models/custom/route.js +1 -1
  118. package/app/.next/server/app/api/models/disabled/route.js +1 -1
  119. package/app/.next/server/app/api/models/route.js +1 -1
  120. package/app/.next/server/app/api/models/test/route.js +1 -1
  121. package/app/.next/server/app/api/oauth/[provider]/[action]/route.js +2 -2
  122. package/app/.next/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  123. package/app/.next/server/app/api/oauth/cursor/import/route.js +1 -1
  124. package/app/.next/server/app/api/oauth/gitlab/pat/route.js +1 -1
  125. package/app/.next/server/app/api/oauth/iflow/cookie/route.js +1 -1
  126. package/app/.next/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  127. package/app/.next/server/app/api/oauth/kiro/import/route.js +1 -1
  128. package/app/.next/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  129. package/app/.next/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  130. package/app/.next/server/app/api/pricing/route.js +1 -1
  131. package/app/.next/server/app/api/provider-nodes/[id]/route.js +1 -1
  132. package/app/.next/server/app/api/provider-nodes/route.js +1 -1
  133. package/app/.next/server/app/api/provider-nodes/validate/route.js +1 -1
  134. package/app/.next/server/app/api/providers/[id]/models/route.js +1 -1
  135. package/app/.next/server/app/api/providers/[id]/route.js +1 -1
  136. package/app/.next/server/app/api/providers/[id]/test/route.js +1 -1
  137. package/app/.next/server/app/api/providers/[id]/test-models/route.js +1 -1
  138. package/app/.next/server/app/api/providers/client/route.js +1 -1
  139. package/app/.next/server/app/api/providers/kilo/free-models/route.js +1 -1
  140. package/app/.next/server/app/api/providers/route.js +1 -1
  141. package/app/.next/server/app/api/providers/suggested-models/route.js +1 -1
  142. package/app/.next/server/app/api/providers/test-batch/route.js +1 -1
  143. package/app/.next/server/app/api/providers/validate/route.js +1 -1
  144. package/app/.next/server/app/api/proxy-pools/[id]/route.js +1 -1
  145. package/app/.next/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  146. package/app/.next/server/app/api/proxy-pools/route.js +1 -1
  147. package/app/.next/server/app/api/proxy-pools/vercel-deploy/route.js +2 -2
  148. package/app/.next/server/app/api/settings/database/route.js +1 -1
  149. package/app/.next/server/app/api/settings/proxy-test/route.js +1 -1
  150. package/app/.next/server/app/api/settings/require-login/route.js +1 -1
  151. package/app/.next/server/app/api/settings/route.js +1 -1
  152. package/app/.next/server/app/api/shutdown/route.js +1 -1
  153. package/app/.next/server/app/api/tags/route.js +1 -1
  154. package/app/.next/server/app/api/translator/console-logs/route.js +1 -1
  155. package/app/.next/server/app/api/translator/console-logs/stream/route.js +2 -2
  156. package/app/.next/server/app/api/translator/load/route.js +1 -1
  157. package/app/.next/server/app/api/translator/save/route.js +1 -1
  158. package/app/.next/server/app/api/translator/send/route.js +1 -1
  159. package/app/.next/server/app/api/translator/translate/route.js +1 -1
  160. package/app/.next/server/app/api/tunnel/disable/route.js +1 -1
  161. package/app/.next/server/app/api/tunnel/enable/route.js +1 -1
  162. package/app/.next/server/app/api/tunnel/status/route.js +1 -1
  163. package/app/.next/server/app/api/tunnel/tailscale-check/route.js +1 -1
  164. package/app/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  165. package/app/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  166. package/app/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  167. package/app/.next/server/app/api/tunnel/tailscale-login/route.js +1 -1
  168. package/app/.next/server/app/api/tunnel/tailscale-start-daemon/route.js +2 -2
  169. package/app/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  170. package/app/.next/server/app/api/usage/chart/route.js +1 -1
  171. package/app/.next/server/app/api/usage/history/route.js +1 -1
  172. package/app/.next/server/app/api/usage/providers/route.js +1 -1
  173. package/app/.next/server/app/api/usage/request-details/route.js +1 -1
  174. package/app/.next/server/app/api/usage/request-logs/route.js +1 -1
  175. package/app/.next/server/app/api/usage/stats/route.js +1 -1
  176. package/app/.next/server/app/api/usage/stream/route.js +2 -2
  177. package/app/.next/server/app/api/v1/api/chat/route.js +1 -1
  178. package/app/.next/server/app/api/v1/audio/speech/route.js +1 -1
  179. package/app/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  180. package/app/.next/server/app/api/v1/audio/voices/route.js +1 -0
  181. package/app/.next/server/app/api/v1/audio/voices/route.js.nft.json +1 -0
  182. package/app/.next/server/app/api/v1/audio/voices/route_client-reference-manifest.js +1 -0
  183. package/app/.next/server/app/api/v1/chat/completions/route.js +1 -1
  184. package/app/.next/server/app/api/v1/embeddings/route.js +1 -1
  185. package/app/.next/server/app/api/v1/images/generations/route.js +2 -2
  186. package/app/.next/server/app/api/v1/messages/count_tokens/route.js +1 -1
  187. package/app/.next/server/app/api/v1/messages/route.js +1 -1
  188. package/app/.next/server/app/api/v1/models/[kind]/route.js +1 -1
  189. package/app/.next/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  190. package/app/.next/server/app/api/v1/models/info/route.js +1 -0
  191. package/app/.next/server/app/api/v1/models/info/route.js.nft.json +1 -0
  192. package/app/.next/server/app/api/v1/models/info/route_client-reference-manifest.js +1 -0
  193. package/app/.next/server/app/api/v1/models/route.js +1 -1
  194. package/app/.next/server/app/api/v1/models/route.js.nft.json +1 -1
  195. package/app/.next/server/app/api/v1/responses/compact/route.js +1 -1
  196. package/app/.next/server/app/api/v1/responses/route.js +1 -1
  197. package/app/.next/server/app/api/v1/route.js +1 -1
  198. package/app/.next/server/app/api/v1/route.js.nft.json +1 -1
  199. package/app/.next/server/app/api/v1/search/route.js +1 -1
  200. package/app/.next/server/app/api/v1/web/fetch/route.js +1 -1
  201. package/app/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  202. package/app/.next/server/app/api/v1beta/models/route.js +1 -1
  203. package/app/.next/server/app/api/version/route.js +1 -1
  204. package/app/.next/server/app/api/version/update/route.js +1 -1
  205. package/app/.next/server/app/callback/page.js +2 -2
  206. package/app/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  207. package/app/.next/server/app/callback.html +1 -1
  208. package/app/.next/server/app/callback.rsc +4 -4
  209. package/app/.next/server/app/callback.segments/_full.segment.rsc +4 -4
  210. package/app/.next/server/app/callback.segments/_head.segment.rsc +1 -1
  211. package/app/.next/server/app/callback.segments/_index.segment.rsc +4 -4
  212. package/app/.next/server/app/callback.segments/_tree.segment.rsc +2 -2
  213. package/app/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  214. package/app/.next/server/app/callback.segments/callback.segment.rsc +1 -1
  215. package/app/.next/server/app/dashboard/basic-chat.html +1 -1
  216. package/app/.next/server/app/dashboard/basic-chat.rsc +6 -6
  217. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  218. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  219. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  220. package/app/.next/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  221. package/app/.next/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  222. package/app/.next/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  223. package/app/.next/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  224. package/app/.next/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  225. package/app/.next/server/app/dashboard/cli-tools.html +1 -1
  226. package/app/.next/server/app/dashboard/cli-tools.rsc +6 -6
  227. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  228. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  229. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  230. package/app/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  231. package/app/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  232. package/app/.next/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  233. package/app/.next/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  234. package/app/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  235. package/app/.next/server/app/dashboard/combos.html +1 -1
  236. package/app/.next/server/app/dashboard/combos.rsc +6 -6
  237. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  238. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  239. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  240. package/app/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  241. package/app/.next/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  242. package/app/.next/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  243. package/app/.next/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  244. package/app/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  245. package/app/.next/server/app/dashboard/endpoint.html +1 -1
  246. package/app/.next/server/app/dashboard/endpoint.rsc +6 -6
  247. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  248. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  249. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  250. package/app/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  251. package/app/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  252. package/app/.next/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  253. package/app/.next/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  254. package/app/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  255. package/app/.next/server/app/dashboard/media-providers/web.html +1 -1
  256. package/app/.next/server/app/dashboard/media-providers/web.rsc +6 -6
  257. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  258. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  259. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  260. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  261. package/app/.next/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  262. package/app/.next/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  263. package/app/.next/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  264. package/app/.next/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  265. package/app/.next/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  266. package/app/.next/server/app/dashboard/mitm.html +1 -1
  267. package/app/.next/server/app/dashboard/mitm.rsc +6 -6
  268. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  269. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  270. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  271. package/app/.next/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  272. package/app/.next/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  273. package/app/.next/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  274. package/app/.next/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  275. package/app/.next/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  276. package/app/.next/server/app/dashboard/profile.html +1 -1
  277. package/app/.next/server/app/dashboard/profile.rsc +6 -6
  278. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  279. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  280. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  283. package/app/.next/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  284. package/app/.next/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  285. package/app/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  286. package/app/.next/server/app/dashboard/providers/new.html +1 -1
  287. package/app/.next/server/app/dashboard/providers/new.rsc +6 -6
  288. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  289. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  290. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  291. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  292. package/app/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  293. package/app/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  294. package/app/.next/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  295. package/app/.next/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  296. package/app/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  297. package/app/.next/server/app/dashboard/providers.html +1 -1
  298. package/app/.next/server/app/dashboard/providers.rsc +6 -6
  299. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  300. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  301. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  302. package/app/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  303. package/app/.next/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  304. package/app/.next/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  305. package/app/.next/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  306. package/app/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  307. package/app/.next/server/app/dashboard/proxy-pools.html +1 -1
  308. package/app/.next/server/app/dashboard/proxy-pools.rsc +6 -6
  309. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  310. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  311. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  312. package/app/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  313. package/app/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  314. package/app/.next/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  315. package/app/.next/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  316. package/app/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  317. package/app/.next/server/app/dashboard/quota.html +2 -2
  318. package/app/.next/server/app/dashboard/quota.rsc +7 -7
  319. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  320. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  321. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  322. package/app/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  323. package/app/.next/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  324. package/app/.next/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  325. package/app/.next/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  326. package/app/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  327. package/app/.next/server/app/dashboard/settings/pricing/page.js +2 -2
  328. package/app/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  329. package/app/.next/server/app/dashboard/settings/pricing.html +1 -1
  330. package/app/.next/server/app/dashboard/settings/pricing.rsc +4 -4
  331. package/app/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  332. package/app/.next/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  333. package/app/.next/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  334. package/app/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  335. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  336. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  337. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  338. package/app/.next/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  339. package/app/.next/server/app/dashboard/skills.html +1 -1
  340. package/app/.next/server/app/dashboard/skills.rsc +6 -6
  341. package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  342. package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  343. package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  344. package/app/.next/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  345. package/app/.next/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  346. package/app/.next/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  347. package/app/.next/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  348. package/app/.next/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  349. package/app/.next/server/app/dashboard/translator.html +1 -1
  350. package/app/.next/server/app/dashboard/translator.rsc +6 -6
  351. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  352. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  353. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  354. package/app/.next/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  355. package/app/.next/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  356. package/app/.next/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  357. package/app/.next/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  358. package/app/.next/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  359. package/app/.next/server/app/dashboard/usage.html +1 -1
  360. package/app/.next/server/app/dashboard/usage.rsc +6 -6
  361. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  362. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  363. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  364. package/app/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  365. package/app/.next/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  366. package/app/.next/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  367. package/app/.next/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  368. package/app/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  369. package/app/.next/server/app/dashboard.html +1 -1
  370. package/app/.next/server/app/dashboard.rsc +6 -6
  371. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  372. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  373. package/app/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  374. package/app/.next/server/app/dashboard.segments/_full.segment.rsc +6 -6
  375. package/app/.next/server/app/dashboard.segments/_head.segment.rsc +1 -1
  376. package/app/.next/server/app/dashboard.segments/_index.segment.rsc +4 -4
  377. package/app/.next/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  378. package/app/.next/server/app/favicon.ico/route.js +1 -1
  379. package/app/.next/server/app/index.html +1 -1
  380. package/app/.next/server/app/index.rsc +4 -4
  381. package/app/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  382. package/app/.next/server/app/index.segments/_full.segment.rsc +4 -4
  383. package/app/.next/server/app/index.segments/_head.segment.rsc +1 -1
  384. package/app/.next/server/app/index.segments/_index.segment.rsc +4 -4
  385. package/app/.next/server/app/index.segments/_tree.segment.rsc +2 -2
  386. package/app/.next/server/app/landing/page.js +2 -2
  387. package/app/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  388. package/app/.next/server/app/landing.html +1 -1
  389. package/app/.next/server/app/landing.rsc +4 -4
  390. package/app/.next/server/app/landing.segments/_full.segment.rsc +4 -4
  391. package/app/.next/server/app/landing.segments/_head.segment.rsc +1 -1
  392. package/app/.next/server/app/landing.segments/_index.segment.rsc +4 -4
  393. package/app/.next/server/app/landing.segments/_tree.segment.rsc +2 -2
  394. package/app/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  395. package/app/.next/server/app/landing.segments/landing.segment.rsc +1 -1
  396. package/app/.next/server/app/login/page.js +2 -2
  397. package/app/.next/server/app/login/page_client-reference-manifest.js +1 -1
  398. package/app/.next/server/app/login.html +1 -1
  399. package/app/.next/server/app/login.rsc +5 -5
  400. package/app/.next/server/app/login.segments/_full.segment.rsc +5 -5
  401. package/app/.next/server/app/login.segments/_head.segment.rsc +1 -1
  402. package/app/.next/server/app/login.segments/_index.segment.rsc +4 -4
  403. package/app/.next/server/app/login.segments/_tree.segment.rsc +2 -2
  404. package/app/.next/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  405. package/app/.next/server/app/login.segments/login.segment.rsc +1 -1
  406. package/app/.next/server/app/manifest.webmanifest/route.js +2 -2
  407. package/app/.next/server/app/page.js +2 -2
  408. package/app/.next/server/app/page_client-reference-manifest.js +1 -1
  409. package/app/.next/server/app-paths-manifest.json +9 -6
  410. package/app/.next/server/chunks/126.js +1 -1
  411. package/app/.next/server/chunks/2049.js +1 -1
  412. package/app/.next/server/chunks/21.js +1 -1
  413. package/app/.next/server/chunks/253.js +1 -1
  414. package/app/.next/server/chunks/450.js +6 -6
  415. package/app/.next/server/chunks/5053.js +1 -1
  416. package/app/.next/server/chunks/514.js +3 -3
  417. package/app/.next/server/chunks/6782.js +1 -0
  418. package/app/.next/server/chunks/6890.js +23 -0
  419. package/app/.next/server/chunks/8035.js +1 -1
  420. package/app/.next/server/chunks/8202.js +4 -4
  421. package/app/.next/server/chunks/8515.js +1 -0
  422. package/app/.next/server/middleware-build-manifest.js +1 -1
  423. package/app/.next/server/pages/404.html +1 -1
  424. package/app/.next/server/pages/500.html +1 -1
  425. package/app/.next/server/server-reference-manifest.js +1 -1
  426. package/app/.next/server/server-reference-manifest.json +1 -1
  427. package/app/.next/static/9OjWTX0ytTCDd5CT8o5t1/_buildManifest.js +1 -0
  428. package/app/.next/static/chunks/1939-b2a5b6699b8bf3d5.js +23 -0
  429. package/app/.next/static/chunks/4156-cc8090a3b79e0545.js +7 -0
  430. package/app/.next/static/chunks/{505-cc19e0fe00f6ff66.js → 505-3794c7277120b05a.js} +1 -1
  431. package/app/.next/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-c8bd4fbe3e45d124.js → page-a6fe1644188a6348.js} +1 -1
  432. package/app/.next/static/chunks/app/(dashboard)/dashboard/combos/{page-24f203d25ad3f861.js → page-4e109bbbffbc2e16.js} +1 -1
  433. package/app/.next/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-d994f22741fa26ed.js → page-29ce6662637d64e4.js} +2 -2
  434. package/app/.next/static/chunks/app/(dashboard)/dashboard/mitm/{page-e40dca387669f457.js → page-bad9a5af75575018.js} +1 -1
  435. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-b150970e241c5c7b.js +1 -0
  436. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-6c6bb4f9b3b7e5f8.js +1 -0
  437. package/app/.next/static/chunks/app/(dashboard)/layout-14ad56e827498f3d.js +1 -0
  438. package/app/.next/static/chunks/app/_global-error/page-23420dc99d53d479.js +1 -0
  439. package/app/.next/static/chunks/app/api/auth/login/route-23420dc99d53d479.js +1 -0
  440. package/app/.next/static/chunks/app/api/auth/logout/route-23420dc99d53d479.js +1 -0
  441. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-23420dc99d53d479.js +1 -0
  442. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-23420dc99d53d479.js +1 -0
  443. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-23420dc99d53d479.js +1 -0
  444. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-23420dc99d53d479.js +1 -0
  445. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-23420dc99d53d479.js +1 -0
  446. package/app/.next/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-23420dc99d53d479.js +1 -0
  447. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-23420dc99d53d479.js +1 -0
  448. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-23420dc99d53d479.js +1 -0
  449. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-23420dc99d53d479.js +1 -0
  450. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-23420dc99d53d479.js +1 -0
  451. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-23420dc99d53d479.js +1 -0
  452. package/app/.next/static/chunks/app/api/cloud/auth/route-23420dc99d53d479.js +1 -0
  453. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-23420dc99d53d479.js +1 -0
  454. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-23420dc99d53d479.js +1 -0
  455. package/app/.next/static/chunks/app/api/cloud/models/alias/route-23420dc99d53d479.js +1 -0
  456. package/app/.next/static/chunks/app/api/combos/[id]/route-23420dc99d53d479.js +1 -0
  457. package/app/.next/static/chunks/app/api/combos/route-23420dc99d53d479.js +1 -0
  458. package/app/.next/static/chunks/app/api/health/route-23420dc99d53d479.js +1 -0
  459. package/app/.next/static/chunks/app/api/init/route-23420dc99d53d479.js +1 -0
  460. package/app/.next/static/chunks/app/api/keys/[id]/route-23420dc99d53d479.js +1 -0
  461. package/app/.next/static/chunks/app/api/keys/route-23420dc99d53d479.js +1 -0
  462. package/app/.next/static/chunks/app/api/locale/route-23420dc99d53d479.js +1 -0
  463. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-23420dc99d53d479.js +1 -0
  464. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-23420dc99d53d479.js +1 -0
  465. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-23420dc99d53d479.js +1 -0
  466. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-23420dc99d53d479.js +1 -0
  467. package/app/.next/static/chunks/app/api/models/alias/route-23420dc99d53d479.js +1 -0
  468. package/app/.next/static/chunks/app/api/models/availability/route-23420dc99d53d479.js +1 -0
  469. package/app/.next/static/chunks/app/api/models/custom/route-23420dc99d53d479.js +1 -0
  470. package/app/.next/static/chunks/app/api/models/disabled/route-23420dc99d53d479.js +1 -0
  471. package/app/.next/static/chunks/app/api/models/route-23420dc99d53d479.js +1 -0
  472. package/app/.next/static/chunks/app/api/models/test/route-23420dc99d53d479.js +1 -0
  473. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-23420dc99d53d479.js +1 -0
  474. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-23420dc99d53d479.js +1 -0
  475. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-23420dc99d53d479.js +1 -0
  476. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-23420dc99d53d479.js +1 -0
  477. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-23420dc99d53d479.js +1 -0
  478. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-23420dc99d53d479.js +1 -0
  479. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-23420dc99d53d479.js +1 -0
  480. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-23420dc99d53d479.js +1 -0
  481. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-23420dc99d53d479.js +1 -0
  482. package/app/.next/static/chunks/app/api/pricing/route-23420dc99d53d479.js +1 -0
  483. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-23420dc99d53d479.js +1 -0
  484. package/app/.next/static/chunks/app/api/provider-nodes/route-23420dc99d53d479.js +1 -0
  485. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-23420dc99d53d479.js +1 -0
  486. package/app/.next/static/chunks/app/api/providers/[id]/models/route-23420dc99d53d479.js +1 -0
  487. package/app/.next/static/chunks/app/api/providers/[id]/route-23420dc99d53d479.js +1 -0
  488. package/app/.next/static/chunks/app/api/providers/[id]/test/route-23420dc99d53d479.js +1 -0
  489. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-23420dc99d53d479.js +1 -0
  490. package/app/.next/static/chunks/app/api/providers/client/route-23420dc99d53d479.js +1 -0
  491. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-23420dc99d53d479.js +1 -0
  492. package/app/.next/static/chunks/app/api/providers/route-23420dc99d53d479.js +1 -0
  493. package/app/.next/static/chunks/app/api/providers/suggested-models/route-23420dc99d53d479.js +1 -0
  494. package/app/.next/static/chunks/app/api/providers/test-batch/route-23420dc99d53d479.js +1 -0
  495. package/app/.next/static/chunks/app/api/providers/validate/route-23420dc99d53d479.js +1 -0
  496. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-23420dc99d53d479.js +1 -0
  497. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-23420dc99d53d479.js +1 -0
  498. package/app/.next/static/chunks/app/api/proxy-pools/route-23420dc99d53d479.js +1 -0
  499. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-23420dc99d53d479.js +1 -0
  500. package/app/.next/static/chunks/app/api/settings/database/route-23420dc99d53d479.js +1 -0
  501. package/app/.next/static/chunks/app/api/settings/proxy-test/route-23420dc99d53d479.js +1 -0
  502. package/app/.next/static/chunks/app/api/settings/require-login/route-23420dc99d53d479.js +1 -0
  503. package/app/.next/static/chunks/app/api/settings/route-23420dc99d53d479.js +1 -0
  504. package/app/.next/static/chunks/app/api/shutdown/route-23420dc99d53d479.js +1 -0
  505. package/app/.next/static/chunks/app/api/tags/route-23420dc99d53d479.js +1 -0
  506. package/app/.next/static/chunks/app/api/translator/console-logs/route-23420dc99d53d479.js +1 -0
  507. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-23420dc99d53d479.js +1 -0
  508. package/app/.next/static/chunks/app/api/translator/load/route-23420dc99d53d479.js +1 -0
  509. package/app/.next/static/chunks/app/api/translator/save/route-23420dc99d53d479.js +1 -0
  510. package/app/.next/static/chunks/app/api/translator/send/route-23420dc99d53d479.js +1 -0
  511. package/app/.next/static/chunks/app/api/translator/translate/route-23420dc99d53d479.js +1 -0
  512. package/app/.next/static/chunks/app/api/tunnel/disable/route-23420dc99d53d479.js +1 -0
  513. package/app/.next/static/chunks/app/api/tunnel/enable/route-23420dc99d53d479.js +1 -0
  514. package/app/.next/static/chunks/app/api/tunnel/status/route-23420dc99d53d479.js +1 -0
  515. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-23420dc99d53d479.js +1 -0
  516. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-23420dc99d53d479.js +1 -0
  517. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-23420dc99d53d479.js +1 -0
  518. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-23420dc99d53d479.js +1 -0
  519. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-23420dc99d53d479.js +1 -0
  520. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-23420dc99d53d479.js +1 -0
  521. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-23420dc99d53d479.js +1 -0
  522. package/app/.next/static/chunks/app/api/usage/chart/route-23420dc99d53d479.js +1 -0
  523. package/app/.next/static/chunks/app/api/usage/history/route-23420dc99d53d479.js +1 -0
  524. package/app/.next/static/chunks/app/api/usage/providers/route-23420dc99d53d479.js +1 -0
  525. package/app/.next/static/chunks/app/api/usage/request-details/route-23420dc99d53d479.js +1 -0
  526. package/app/.next/static/chunks/app/api/usage/request-logs/route-23420dc99d53d479.js +1 -0
  527. package/app/.next/static/chunks/app/api/usage/stats/route-23420dc99d53d479.js +1 -0
  528. package/app/.next/static/chunks/app/api/usage/stream/route-23420dc99d53d479.js +1 -0
  529. package/app/.next/static/chunks/app/api/v1/api/chat/route-23420dc99d53d479.js +1 -0
  530. package/app/.next/static/chunks/app/api/v1/audio/speech/route-23420dc99d53d479.js +1 -0
  531. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-23420dc99d53d479.js +1 -0
  532. package/app/.next/static/chunks/app/api/v1/audio/voices/route-23420dc99d53d479.js +1 -0
  533. package/app/.next/static/chunks/app/api/v1/chat/completions/route-23420dc99d53d479.js +1 -0
  534. package/app/.next/static/chunks/app/api/v1/embeddings/route-23420dc99d53d479.js +1 -0
  535. package/app/.next/static/chunks/app/api/v1/images/generations/route-23420dc99d53d479.js +1 -0
  536. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-23420dc99d53d479.js +1 -0
  537. package/app/.next/static/chunks/app/api/v1/messages/route-23420dc99d53d479.js +1 -0
  538. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-23420dc99d53d479.js +1 -0
  539. package/app/.next/static/chunks/app/api/v1/models/info/route-23420dc99d53d479.js +1 -0
  540. package/app/.next/static/chunks/app/api/v1/models/route-23420dc99d53d479.js +1 -0
  541. package/app/.next/static/chunks/app/api/v1/responses/compact/route-23420dc99d53d479.js +1 -0
  542. package/app/.next/static/chunks/app/api/v1/responses/route-23420dc99d53d479.js +1 -0
  543. package/app/.next/static/chunks/app/api/v1/route-23420dc99d53d479.js +1 -0
  544. package/app/.next/static/chunks/app/api/v1/search/route-23420dc99d53d479.js +1 -0
  545. package/app/.next/static/chunks/app/api/v1/web/fetch/route-23420dc99d53d479.js +1 -0
  546. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-23420dc99d53d479.js +1 -0
  547. package/app/.next/static/chunks/app/api/v1beta/models/route-23420dc99d53d479.js +1 -0
  548. package/app/.next/static/chunks/app/api/version/route-23420dc99d53d479.js +1 -0
  549. package/app/.next/static/chunks/app/api/version/update/route-23420dc99d53d479.js +1 -0
  550. package/app/.next/static/chunks/app/manifest.webmanifest/route-23420dc99d53d479.js +1 -0
  551. package/app/.next/static/chunks/app/page-23420dc99d53d479.js +1 -0
  552. package/app/.next/static/chunks/c6123951-b42288d628b452ba.js +1 -0
  553. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-23420dc99d53d479.js +1 -0
  554. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-23420dc99d53d479.js +1 -0
  555. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-23420dc99d53d479.js +1 -0
  556. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-23420dc99d53d479.js +1 -0
  557. package/app/.next/static/css/085ed641ab718f9b.css +1 -0
  558. package/app/package.json +1 -1
  559. package/package.json +1 -1
  560. package/app/.next/server/chunks/2372.js +0 -23
  561. package/app/.next/server/chunks/8565.js +0 -1
  562. package/app/.next/server/chunks/9534.js +0 -1
  563. package/app/.next/static/chunks/4156-34c517ee5f198889.js +0 -7
  564. package/app/.next/static/chunks/4496-228f5725c9fc96f5.js +0 -23
  565. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-0161829206939ffe.js +0 -1
  566. package/app/.next/static/chunks/app/(dashboard)/dashboard/providers/page-b864d9416f014ad6.js +0 -1
  567. package/app/.next/static/chunks/app/(dashboard)/layout-2b41c9c888e0223f.js +0 -1
  568. package/app/.next/static/chunks/app/_global-error/page-ab0bb075b650e476.js +0 -1
  569. package/app/.next/static/chunks/app/api/auth/login/route-ab0bb075b650e476.js +0 -1
  570. package/app/.next/static/chunks/app/api/auth/logout/route-ab0bb075b650e476.js +0 -1
  571. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-ab0bb075b650e476.js +0 -1
  572. package/app/.next/static/chunks/app/api/cli-tools/antigravity-mitm/route-ab0bb075b650e476.js +0 -1
  573. package/app/.next/static/chunks/app/api/cli-tools/claude-settings/route-ab0bb075b650e476.js +0 -1
  574. package/app/.next/static/chunks/app/api/cli-tools/codex-settings/route-ab0bb075b650e476.js +0 -1
  575. package/app/.next/static/chunks/app/api/cli-tools/copilot-settings/route-ab0bb075b650e476.js +0 -1
  576. package/app/.next/static/chunks/app/api/cli-tools/cowork-settings/route-ab0bb075b650e476.js +0 -1
  577. package/app/.next/static/chunks/app/api/cli-tools/droid-settings/route-ab0bb075b650e476.js +0 -1
  578. package/app/.next/static/chunks/app/api/cli-tools/hermes-settings/route-ab0bb075b650e476.js +0 -1
  579. package/app/.next/static/chunks/app/api/cli-tools/openclaw-settings/route-ab0bb075b650e476.js +0 -1
  580. package/app/.next/static/chunks/app/api/cli-tools/opencode-settings/route-ab0bb075b650e476.js +0 -1
  581. package/app/.next/static/chunks/app/api/cloud/auth/route-ab0bb075b650e476.js +0 -1
  582. package/app/.next/static/chunks/app/api/cloud/credentials/update/route-ab0bb075b650e476.js +0 -1
  583. package/app/.next/static/chunks/app/api/cloud/model/resolve/route-ab0bb075b650e476.js +0 -1
  584. package/app/.next/static/chunks/app/api/cloud/models/alias/route-ab0bb075b650e476.js +0 -1
  585. package/app/.next/static/chunks/app/api/combos/[id]/route-ab0bb075b650e476.js +0 -1
  586. package/app/.next/static/chunks/app/api/combos/route-ab0bb075b650e476.js +0 -1
  587. package/app/.next/static/chunks/app/api/health/route-ab0bb075b650e476.js +0 -1
  588. package/app/.next/static/chunks/app/api/init/route-ab0bb075b650e476.js +0 -1
  589. package/app/.next/static/chunks/app/api/keys/[id]/route-ab0bb075b650e476.js +0 -1
  590. package/app/.next/static/chunks/app/api/keys/route-ab0bb075b650e476.js +0 -1
  591. package/app/.next/static/chunks/app/api/locale/route-ab0bb075b650e476.js +0 -1
  592. package/app/.next/static/chunks/app/api/media-providers/tts/deepgram/voices/route-ab0bb075b650e476.js +0 -1
  593. package/app/.next/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-ab0bb075b650e476.js +0 -1
  594. package/app/.next/static/chunks/app/api/media-providers/tts/inworld/voices/route-ab0bb075b650e476.js +0 -1
  595. package/app/.next/static/chunks/app/api/media-providers/tts/voices/route-ab0bb075b650e476.js +0 -1
  596. package/app/.next/static/chunks/app/api/models/alias/route-ab0bb075b650e476.js +0 -1
  597. package/app/.next/static/chunks/app/api/models/availability/route-ab0bb075b650e476.js +0 -1
  598. package/app/.next/static/chunks/app/api/models/custom/route-ab0bb075b650e476.js +0 -1
  599. package/app/.next/static/chunks/app/api/models/disabled/route-ab0bb075b650e476.js +0 -1
  600. package/app/.next/static/chunks/app/api/models/route-ab0bb075b650e476.js +0 -1
  601. package/app/.next/static/chunks/app/api/models/test/route-ab0bb075b650e476.js +0 -1
  602. package/app/.next/static/chunks/app/api/oauth/[provider]/[action]/route-ab0bb075b650e476.js +0 -1
  603. package/app/.next/static/chunks/app/api/oauth/cursor/auto-import/route-ab0bb075b650e476.js +0 -1
  604. package/app/.next/static/chunks/app/api/oauth/cursor/import/route-ab0bb075b650e476.js +0 -1
  605. package/app/.next/static/chunks/app/api/oauth/gitlab/pat/route-ab0bb075b650e476.js +0 -1
  606. package/app/.next/static/chunks/app/api/oauth/iflow/cookie/route-ab0bb075b650e476.js +0 -1
  607. package/app/.next/static/chunks/app/api/oauth/kiro/auto-import/route-ab0bb075b650e476.js +0 -1
  608. package/app/.next/static/chunks/app/api/oauth/kiro/import/route-ab0bb075b650e476.js +0 -1
  609. package/app/.next/static/chunks/app/api/oauth/kiro/social-authorize/route-ab0bb075b650e476.js +0 -1
  610. package/app/.next/static/chunks/app/api/oauth/kiro/social-exchange/route-ab0bb075b650e476.js +0 -1
  611. package/app/.next/static/chunks/app/api/pricing/route-ab0bb075b650e476.js +0 -1
  612. package/app/.next/static/chunks/app/api/provider-nodes/[id]/route-ab0bb075b650e476.js +0 -1
  613. package/app/.next/static/chunks/app/api/provider-nodes/route-ab0bb075b650e476.js +0 -1
  614. package/app/.next/static/chunks/app/api/provider-nodes/validate/route-ab0bb075b650e476.js +0 -1
  615. package/app/.next/static/chunks/app/api/providers/[id]/models/route-ab0bb075b650e476.js +0 -1
  616. package/app/.next/static/chunks/app/api/providers/[id]/route-ab0bb075b650e476.js +0 -1
  617. package/app/.next/static/chunks/app/api/providers/[id]/test/route-ab0bb075b650e476.js +0 -1
  618. package/app/.next/static/chunks/app/api/providers/[id]/test-models/route-ab0bb075b650e476.js +0 -1
  619. package/app/.next/static/chunks/app/api/providers/client/route-ab0bb075b650e476.js +0 -1
  620. package/app/.next/static/chunks/app/api/providers/kilo/free-models/route-ab0bb075b650e476.js +0 -1
  621. package/app/.next/static/chunks/app/api/providers/route-ab0bb075b650e476.js +0 -1
  622. package/app/.next/static/chunks/app/api/providers/suggested-models/route-ab0bb075b650e476.js +0 -1
  623. package/app/.next/static/chunks/app/api/providers/test-batch/route-ab0bb075b650e476.js +0 -1
  624. package/app/.next/static/chunks/app/api/providers/validate/route-ab0bb075b650e476.js +0 -1
  625. package/app/.next/static/chunks/app/api/proxy-pools/[id]/route-ab0bb075b650e476.js +0 -1
  626. package/app/.next/static/chunks/app/api/proxy-pools/[id]/test/route-ab0bb075b650e476.js +0 -1
  627. package/app/.next/static/chunks/app/api/proxy-pools/route-ab0bb075b650e476.js +0 -1
  628. package/app/.next/static/chunks/app/api/proxy-pools/vercel-deploy/route-ab0bb075b650e476.js +0 -1
  629. package/app/.next/static/chunks/app/api/settings/database/route-ab0bb075b650e476.js +0 -1
  630. package/app/.next/static/chunks/app/api/settings/proxy-test/route-ab0bb075b650e476.js +0 -1
  631. package/app/.next/static/chunks/app/api/settings/require-login/route-ab0bb075b650e476.js +0 -1
  632. package/app/.next/static/chunks/app/api/settings/route-ab0bb075b650e476.js +0 -1
  633. package/app/.next/static/chunks/app/api/shutdown/route-ab0bb075b650e476.js +0 -1
  634. package/app/.next/static/chunks/app/api/tags/route-ab0bb075b650e476.js +0 -1
  635. package/app/.next/static/chunks/app/api/translator/console-logs/route-ab0bb075b650e476.js +0 -1
  636. package/app/.next/static/chunks/app/api/translator/console-logs/stream/route-ab0bb075b650e476.js +0 -1
  637. package/app/.next/static/chunks/app/api/translator/load/route-ab0bb075b650e476.js +0 -1
  638. package/app/.next/static/chunks/app/api/translator/save/route-ab0bb075b650e476.js +0 -1
  639. package/app/.next/static/chunks/app/api/translator/send/route-ab0bb075b650e476.js +0 -1
  640. package/app/.next/static/chunks/app/api/translator/translate/route-ab0bb075b650e476.js +0 -1
  641. package/app/.next/static/chunks/app/api/tunnel/disable/route-ab0bb075b650e476.js +0 -1
  642. package/app/.next/static/chunks/app/api/tunnel/enable/route-ab0bb075b650e476.js +0 -1
  643. package/app/.next/static/chunks/app/api/tunnel/status/route-ab0bb075b650e476.js +0 -1
  644. package/app/.next/static/chunks/app/api/tunnel/tailscale-check/route-ab0bb075b650e476.js +0 -1
  645. package/app/.next/static/chunks/app/api/tunnel/tailscale-disable/route-ab0bb075b650e476.js +0 -1
  646. package/app/.next/static/chunks/app/api/tunnel/tailscale-enable/route-ab0bb075b650e476.js +0 -1
  647. package/app/.next/static/chunks/app/api/tunnel/tailscale-install/route-ab0bb075b650e476.js +0 -1
  648. package/app/.next/static/chunks/app/api/tunnel/tailscale-login/route-ab0bb075b650e476.js +0 -1
  649. package/app/.next/static/chunks/app/api/tunnel/tailscale-start-daemon/route-ab0bb075b650e476.js +0 -1
  650. package/app/.next/static/chunks/app/api/usage/[connectionId]/route-ab0bb075b650e476.js +0 -1
  651. package/app/.next/static/chunks/app/api/usage/chart/route-ab0bb075b650e476.js +0 -1
  652. package/app/.next/static/chunks/app/api/usage/history/route-ab0bb075b650e476.js +0 -1
  653. package/app/.next/static/chunks/app/api/usage/providers/route-ab0bb075b650e476.js +0 -1
  654. package/app/.next/static/chunks/app/api/usage/request-details/route-ab0bb075b650e476.js +0 -1
  655. package/app/.next/static/chunks/app/api/usage/request-logs/route-ab0bb075b650e476.js +0 -1
  656. package/app/.next/static/chunks/app/api/usage/stats/route-ab0bb075b650e476.js +0 -1
  657. package/app/.next/static/chunks/app/api/usage/stream/route-ab0bb075b650e476.js +0 -1
  658. package/app/.next/static/chunks/app/api/v1/api/chat/route-ab0bb075b650e476.js +0 -1
  659. package/app/.next/static/chunks/app/api/v1/audio/speech/route-ab0bb075b650e476.js +0 -1
  660. package/app/.next/static/chunks/app/api/v1/audio/transcriptions/route-ab0bb075b650e476.js +0 -1
  661. package/app/.next/static/chunks/app/api/v1/chat/completions/route-ab0bb075b650e476.js +0 -1
  662. package/app/.next/static/chunks/app/api/v1/embeddings/route-ab0bb075b650e476.js +0 -1
  663. package/app/.next/static/chunks/app/api/v1/images/generations/route-ab0bb075b650e476.js +0 -1
  664. package/app/.next/static/chunks/app/api/v1/messages/count_tokens/route-ab0bb075b650e476.js +0 -1
  665. package/app/.next/static/chunks/app/api/v1/messages/route-ab0bb075b650e476.js +0 -1
  666. package/app/.next/static/chunks/app/api/v1/models/[kind]/route-ab0bb075b650e476.js +0 -1
  667. package/app/.next/static/chunks/app/api/v1/models/route-ab0bb075b650e476.js +0 -1
  668. package/app/.next/static/chunks/app/api/v1/responses/compact/route-ab0bb075b650e476.js +0 -1
  669. package/app/.next/static/chunks/app/api/v1/responses/route-ab0bb075b650e476.js +0 -1
  670. package/app/.next/static/chunks/app/api/v1/route-ab0bb075b650e476.js +0 -1
  671. package/app/.next/static/chunks/app/api/v1/search/route-ab0bb075b650e476.js +0 -1
  672. package/app/.next/static/chunks/app/api/v1/web/fetch/route-ab0bb075b650e476.js +0 -1
  673. package/app/.next/static/chunks/app/api/v1beta/models/[...path]/route-ab0bb075b650e476.js +0 -1
  674. package/app/.next/static/chunks/app/api/v1beta/models/route-ab0bb075b650e476.js +0 -1
  675. package/app/.next/static/chunks/app/api/version/route-ab0bb075b650e476.js +0 -1
  676. package/app/.next/static/chunks/app/api/version/update/route-ab0bb075b650e476.js +0 -1
  677. package/app/.next/static/chunks/app/manifest.webmanifest/route-ab0bb075b650e476.js +0 -1
  678. package/app/.next/static/chunks/app/page-ab0bb075b650e476.js +0 -1
  679. package/app/.next/static/chunks/c6123951-462cab681f34bf85.js +0 -1
  680. package/app/.next/static/chunks/next/dist/client/components/builtin/app-error-ab0bb075b650e476.js +0 -1
  681. package/app/.next/static/chunks/next/dist/client/components/builtin/forbidden-ab0bb075b650e476.js +0 -1
  682. package/app/.next/static/chunks/next/dist/client/components/builtin/not-found-ab0bb075b650e476.js +0 -1
  683. package/app/.next/static/chunks/next/dist/client/components/builtin/unauthorized-ab0bb075b650e476.js +0 -1
  684. package/app/.next/static/css/63a1213af8e77ffe.css +0 -1
  685. package/app/.next/static/r-Jcjpzy4CWuaVq-r3ozi/_buildManifest.js +0 -1
  686. /package/app/.next/static/{r-Jcjpzy4CWuaVq-r3ozi → 9OjWTX0ytTCDd5CT8o5t1}/_ssgManifest.js +0 -0
@@ -2,8 +2,8 @@
2
2
  certutil -delstore Root ${j(p)} 2>$null | Out-Null
3
3
  $exit = & certutil -addstore Root ${j(a)} 2>&1
4
4
  if ($LASTEXITCODE -ne 0) { throw "certutil exit $LASTEXITCODE" }
5
- `;try{await i(b),k("\uD83D\uDD10 Cert: ✅ installed to Windows Root store")}catch(a){throw Error(`Failed to install certificate: ${a.message}`)}}async function u(a,b){let c=q(b).replace(/:/g,""),d=`security delete-certificate -Z "${c}" /Library/Keychains/System.keychain`;try{await g(d,a),k("\uD83D\uDD10 Cert: ✅ uninstalled from system keychain")}catch(a){throw Error("Failed to uninstall certificate")}}async function v(){let a=`certutil -delstore Root ${j(p)}`;try{await i(a),k("\uD83D\uDD10 Cert: ✅ uninstalled from Windows Root store")}catch(a){throw Error(`Failed to uninstall certificate: ${a.message}`)}}async function w(a,b){if(!h())return void k(`🔐 Cert: cannot install to system store without sudo — trust this file on clients: ${b}`);let c=`${o}/9router-root-ca.crt`,d=`cp "${b}" "${c}" && (update-ca-certificates 2>/dev/null || update-ca-trust 2>/dev/null || true)`;try{await g(d,a),k("\uD83D\uDD10 Cert: ✅ installed to Linux trust store")}catch(a){throw Error("Certificate install failed")}}async function x(a){if(!h())return;let b=`${o}/9router-root-ca.crt`,c=`rm -f "${b}" && (update-ca-certificates 2>/dev/null || update-ca-trust 2>/dev/null || true)`;try{await g(c,a),k("\uD83D\uDD10 Cert: ✅ uninstalled from Linux trust store")}catch(a){throw Error("Failed to uninstall certificate")}}a.exports={installCert:async function a(a,b){if(!d.existsSync(b))throw Error(`Certificate file not found: ${b}`);await r(b)?k("\uD83D\uDD10 Cert: already trusted ✅"):m?await t(b):n?await s(a,b):await w(a,b)},uninstallCert:async function a(a,b){await r(b)?m?await v():n?await u(a,b):await x(a):k("\uD83D\uDD10 Cert: not found in system store")},checkCertInstalled:r}},50514:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(98012),{isAdmin:u}=c(55757),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(6021),{installCert:y,uninstallCert:z}=c(28059),{isCertExpired:A}=c(89998),{DATA_DIR:B,MITM_DIR:C}=c(17893),{log:D,err:E}=c(93741),F="http://localhost:20128";function G(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function H(){if(!X)return F;try{let a=await X(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return F;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return F;return b.replace(/\/+$/,"")}catch{return F}}let I=g.join(C,".mitm.pid"),J=[5e3,1e4,2e4,3e4,6e4],K=0,L=0,M=!1,N=function(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.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(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}(function(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}()),O="aes-256-gcm",P="9router-mitm-pwd",Q=null,R=null;function S(){return globalThis.__mitmSudoPassword||null}function T(a){globalThis.__mitmSudoPassword=a}function U(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function V(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(98012);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function W(){try{let{machineIdSync:a}=c(20243),b=a();return l.createHash("sha256").update(b+P).digest()}catch{return l.createHash("sha256").update(P).digest()}}let X=null,Y=null;async function Z(a,b){if(Y)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=W(),d=l.randomBytes(12),e=l.createCipheriv(O,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await Y(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function $(){if(Y)try{await Y({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function _(){if(!X)return null;try{let a=await X();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=W(),f=l.createDecipheriv(O,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function aa(a,b){if(Y&&X)try{let c={...(await X()).dnsToolEnabled||{},[a]:b};await Y({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function ab(){if(!X)return{};try{return(await X()).dnsToolEnabled||{}}catch{return{}}}async function ac(a){let b=await ab(),c=a||S()||await _();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function ad(){return v?u():!(!u()&&t())||!!(S()||await _())}function ae(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d("lsof -nP -iTCP:443 -sTCP:LISTEN -t",{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function af(a){if(Q&&!Q.killed){try{Q.kill("SIGKILL")}catch{}Q=null,R=null}try{if(h.existsSync(I)){let b=parseInt(h.readFileSync(I,"utf-8").trim(),10);b&&U(b)&&(V(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(I)}}catch{}if(!v&&N)try{let b=N.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(98012);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function ag(){let a=null!==Q&&!Q.killed,b=R;if(!a)try{if(h.existsSync(I)){let c=parseInt(h.readFileSync(I,"utf-8").trim(),10);c&&U(c)?(a=!0,b=c):h.unlinkSync(I)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(28059),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function ah(a){if(M)return;if(Date.now()-L>=6e4&&(K=0),K>=5)return void E("Max restart attempts reached. Giving up.");let b=J[Math.min(K,J.length-1)];K++,M=!0,D(`Restarting in ${b/1e3}s... (${K}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=X?await X():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),M=!1;return}let c=S()||await _();if(!c&&!v){E("No cached password, cannot auto-restart"),M=!1;return}await aj(a,c),D("\uD83D\uDD04 Restarted successfully"),K=0,M=!1}catch(b){E(`Restart attempt ${K}/5 failed: ${b.message}`),M=!1,ah(a)}}async function ai(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(98012);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function aj(a,b,d=!1){if(!Q||Q.killed)try{if(h.existsSync(I)){let a=parseInt(h.readFileSync(I,"utf-8").trim(),10);if(a&&U(a))return R=a,D(`♻️ Reusing existing process (PID: ${a})`),await Z(!0,b),b&&T(b),{running:!0,pid:a};h.unlinkSync(I)}}catch{}if(Q&&!Q.killed)throw Error("MITM server is already running");if(await af(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ae(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(d)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await ai(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let l=g.join(C,"rootCA.crt"),m=g.join(C,"rootCA.key"),n=h.existsSync(l)&&h.existsSync(m);if(!n||A(l)){if(n){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||S()||await _();try{await z(a,l)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:o}=c(28059),p=await o(l),r=!v&&!w&&!s();if(p)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||S()||await _();if(r)D(`🔐 Cert: skipping system trust (no sudo). Install ${l} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,l),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let u=await H();if(D(`🚀 Starting server... (router: ${u})`),v){let c=await ae(b);if(c)if(d)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await ai(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}Q=e(process.execPath,[N],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:u}}),Y&&await Y({mitmCertInstalled:!0}).catch(()=>{})}else s()?((Q=e("sudo",["-S","-E","sh","-c",[`HOME=${G(i.homedir())}`,`ROUTER_API_KEY=${G(a)}`,`MITM_ROUTER_BASE=${G(u)}`,"NODE_ENV=production",G(process.execPath),G(N)].join(" ")],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
6
- `),Q.stdin.end()):Q=e(process.execPath,[N],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:u}});Q&&(R=Q.pid,h.writeFileSync(I,String(R)),L=Date.now());let B=null;Q&&(Q.stdout.on("data",a=>{process.stdout.write(a)}),Q.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(E(b),B=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(T(null),$(),M=!0)}),Q.on("exit",b=>{D(`Server exited (code: ${b})`),Q=null,R=null;try{h.unlinkSync(I)}catch{}0===b||M||ah(a)}));let F=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!F){if(Q&&!Q.killed){try{Q.kill()}catch{}Q=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f("lsof -i :443",{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=B||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}for(let[a,b]of(Y&&await Y({mitmCertInstalled:!0}).catch(()=>{}),D(`✅ Server healthy (PID: ${R||F.pid})`),Object.entries(q())))D(`🌐 DNS ${a}: ${b?"✅ active":"❌ inactive"}`);return await Z(!0,b),b&&T(b),{running:!0,pid:R}}async function ak(a){M=!0,K=0,D("⏹ Stopping server...");let b=Q,d=b&&!b.killed?b.pid:(()=>{try{return parseInt(h.readFileSync(I,"utf-8").trim(),10)}catch{return null}})();if(d&&U(d)&&(D(`Killing server (PID: ${d})...`),V(d,!1,a),await new Promise(a=>setTimeout(a,1e3)),U(d)&&V(d,!0,a)),Q=null,R=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(55757);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}D("\uD83C\uDF10 DNS: ✅ all tool hosts removed")}else{let c=b.map(f).join(","),d=`
5
+ `;try{await i(b),k("\uD83D\uDD10 Cert: ✅ installed to Windows Root store")}catch(a){throw Error(`Failed to install certificate: ${a.message}`)}}async function u(a,b){let c=q(b).replace(/:/g,""),d=`security delete-certificate -Z "${c}" /Library/Keychains/System.keychain`;try{await g(d,a),k("\uD83D\uDD10 Cert: ✅ uninstalled from system keychain")}catch(a){throw Error("Failed to uninstall certificate")}}async function v(){let a=`certutil -delstore Root ${j(p)}`;try{await i(a),k("\uD83D\uDD10 Cert: ✅ uninstalled from Windows Root store")}catch(a){throw Error(`Failed to uninstall certificate: ${a.message}`)}}async function w(a,b){if(!h())return void k(`🔐 Cert: cannot install to system store without sudo — trust this file on clients: ${b}`);let c=`${o}/9router-root-ca.crt`,d=`cp "${b}" "${c}" && (update-ca-certificates 2>/dev/null || update-ca-trust 2>/dev/null || true)`;try{await g(d,a),k("\uD83D\uDD10 Cert: ✅ installed to Linux trust store")}catch(a){throw Error("Certificate install failed")}}async function x(a){if(!h())return;let b=`${o}/9router-root-ca.crt`,c=`rm -f "${b}" && (update-ca-certificates 2>/dev/null || update-ca-trust 2>/dev/null || true)`;try{await g(c,a),k("\uD83D\uDD10 Cert: ✅ uninstalled from Linux trust store")}catch(a){throw Error("Failed to uninstall certificate")}}a.exports={installCert:async function a(a,b){if(!d.existsSync(b))throw Error(`Certificate file not found: ${b}`);await r(b)?k("\uD83D\uDD10 Cert: already trusted ✅"):m?await t(b):n?await s(a,b):await w(a,b)},uninstallCert:async function a(a,b){await r(b)?m?await v():n?await u(a,b):await x(a):k("\uD83D\uDD10 Cert: not found in system store")},checkCertInstalled:r}},50514:(a,b,c)=>{let{exec:d,spawn:e,execSync:f}=c(79646),g=c(33873),h=c(29021),i=c(21820),j=c(91645),k=c(55591),l=c(55511),{addDNSEntry:m,removeDNSEntry:n,removeAllDNSEntries:o,removeAllDNSEntriesSync:p,checkAllDNSStatus:q,TOOL_HOSTS:r,isSudoAvailable:s,isSudoPasswordRequired:t}=c(98012),{isAdmin:u}=c(55757),v="win32"===process.platform,w="darwin"===process.platform,{generateCert:x}=c(6021),{installCert:y,uninstallCert:z}=c(28059),{isCertExpired:A}=c(89998),{DATA_DIR:B,MITM_DIR:C}=c(17893),{log:D,err:E}=c(93741),F="http://localhost:20128";function G(a){return null==a||""===a?"''":`'${String(a).replace(/'/g,"'\\''")}'`}async function H(){if(!Z)return F;try{let a=await Z(),b=a&&null!=a.mitmRouterBaseUrl?String(a.mitmRouterBaseUrl).trim():"";if(!b)return F;let c=new URL(b);if("http:"!==c.protocol&&"https:"!==c.protocol)return F;return b.replace(/\/+$/,"")}catch{return F}}let I=g.join(C,".mitm.pid"),J=[5e3,1e4,2e4,3e4,6e4],K=0,L=0,M=!1;function N(){if(process.env.MITM_SERVER_PATH)return process.env.MITM_SERVER_PATH;let a=g.join(__dirname,"server.js");if(h.existsSync(a))return a;let b=g.join(process.cwd(),"src","mitm","server.js");if(h.existsSync(b))return b;let c=g.join(process.cwd(),"..","src","mitm","server.js");return h.existsSync(c)?c:b}function O(a){try{if(!a||!h.existsSync(a)||!a.includes(`${g.sep}node_modules${g.sep}`))return a;let b=g.join(B,"runtime","mitm"),c=g.join(b,"server.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(b){try{D(`[MITM] runtime copy failed: ${b.message}`)}catch{}return a}}let P=O(N()),Q="aes-256-gcm",R="9router-mitm-pwd",S=null,T=null;function U(){return globalThis.__mitmSudoPassword||null}function V(a){globalThis.__mitmSudoPassword=a}function W(a){try{return process.kill(a,0),!0}catch(a){return"EACCES"===a.code}}function X(a,b=!1,e=null){if(v)d(`taskkill ${b?"/F ":""}/PID ${a}`,{windowsHide:!0},()=>{});else{let f=b?"SIGKILL":"SIGTERM",g=`pkill -${f} -P ${a} 2>/dev/null; kill -${f} ${a} 2>/dev/null`;if(e||s()){let{execWithPassword:a}=c(98012);a(g,e||"").catch(()=>d(g,{windowsHide:!0},()=>{}))}else d(g,{windowsHide:!0},()=>{})}}function Y(){try{let{machineIdSync:a}=c(20243),b=a();return l.createHash("sha256").update(b+R).digest()}catch{return l.createHash("sha256").update(R).digest()}}let Z=null,$=null;async function _(a,b){if($)try{let c,d,e,f,g,h={mitmEnabled:a};b&&(c=Y(),d=l.randomBytes(12),e=l.createCipheriv(Q,c,d),f=Buffer.concat([e.update(b,"utf8"),e.final()]),g=e.getAuthTag(),h.mitmSudoEncrypted=`${d.toString("hex")}:${g.toString("hex")}:${f.toString("hex")}`),await $(h)}catch(a){E(`Failed to save settings: ${a.message}`)}}async function aa(){if($)try{await $({mitmSudoEncrypted:null})}catch(a){E(`Failed to clear encrypted password: ${a.message}`)}}async function ab(){if(!Z)return null;try{let a=await Z();if(!a.mitmSudoEncrypted)return null;return function(a){try{let[b,c,d]=a.split(":");if(!b||!c||!d)return null;let e=Y(),f=l.createDecipheriv(Q,e,Buffer.from(b,"hex"));return f.setAuthTag(Buffer.from(c,"hex")),f.update(Buffer.from(d,"hex"))+f.final("utf8")}catch{return null}}(a.mitmSudoEncrypted)}catch{return null}}async function ac(a,b){if($&&Z)try{let c={...(await Z()).dnsToolEnabled||{},[a]:b};await $({dnsToolEnabled:c})}catch(a){E(`Failed to save DNS state: ${a.message}`)}}async function ad(){if(!Z)return{};try{return(await Z()).dnsToolEnabled||{}}catch{return{}}}async function ae(a){let b=await ad(),c=a||U()||await ab();for(let[a,d]of Object.entries(b))if(d&&r[a])try{await m(a,c)}catch(b){E(`DNS ${a}: restore failed — ${b.message}`)}}async function af(){return v?u():!(!u()&&t())||!!(U()||await ab())}function ag(a){return new Promise(a=>{v?d('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{windowsHide:!0},(b,c)=>{if(b)return a(null);let e=parseInt(c.trim(),10);if(!e||e<=4)return a(null);d(`tasklist /FI "PID eq ${e}" /FO CSV /NH`,{windowsHide:!0},(b,c)=>{let d=c?.match(/"([^"]+)"/);a({pid:e,name:d?d[1]:"unknown"})})}):d("lsof -nP -iTCP:443 -sTCP:LISTEN -t",{windowsHide:!0},(b,c)=>{if(b||!c?.trim())return a(null);let e=parseInt(c.trim().split("\n")[0],10);if(!e||isNaN(e))return a(null);d(`ps -p ${e} -o comm=`,{windowsHide:!0},(b,c)=>{a({pid:e,name:c?.trim()||"unknown"})})})})}async function ah(a){if(S&&!S.killed){try{S.kill("SIGKILL")}catch{}S=null,T=null}try{if(h.existsSync(I)){let b=parseInt(h.readFileSync(I,"utf-8").trim(),10);b&&W(b)&&(X(b,!0,a),await new Promise(a=>setTimeout(a,500))),h.unlinkSync(I)}}catch{}if(!v&&P)try{let b=P.replace(/'/g,"'\\''");if(a||s()){let{execWithPassword:d}=c(98012);await d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,a||"").catch(()=>{})}else d(`pkill -SIGKILL -f "${b}" 2>/dev/null || true`,{windowsHide:!0},()=>{});await new Promise(a=>setTimeout(a,500))}catch{}}async function ai(){let a=null!==S&&!S.killed,b=T;if(!a)try{if(h.existsSync(I)){let c=parseInt(h.readFileSync(I,"utf-8").trim(),10);c&&W(c)?(a=!0,b=c):h.unlinkSync(I)}}catch{}let d=q(),e=g.join(C,"rootCA.crt"),f=h.existsSync(e),{checkCertInstalled:i}=c(28059),j=!!f&&await i(e);return{running:a,pid:b,certExists:f,certTrusted:j,dnsStatus:d}}async function aj(a){if(M)return;if(Date.now()-L>=6e4&&(K=0),K>=5)return void E("Max restart attempts reached. Giving up.");let b=J[Math.min(K,J.length-1)];K++,M=!0,D(`Restarting in ${b/1e3}s... (${K}/5)`),await new Promise(a=>setTimeout(a,b));try{let b=Z?await Z():null;if(b&&!b.mitmEnabled){D("MITM disabled, skipping restart"),M=!1;return}let c=U()||await ab();if(!c&&!v){E("No cached password, cannot auto-restart"),M=!1;return}await al(a,c),D("\uD83D\uDD04 Restarted successfully"),K=0,M=!1}catch(b){E(`Restart attempt ${K}/5 failed: ${b.message}`),M=!1,aj(a)}}async function ak(a,b){if(a&&a.pid){if(v)try{f(`powershell -NonInteractive -WindowStyle Hidden -Command "Stop-Process -Id ${a.pid} -Force -ErrorAction SilentlyContinue"`,{windowsHide:!0})}catch{}else try{let{execWithPassword:d}=c(98012);b||s()?await d(`kill -9 ${a.pid}`,b||""):f(`kill -9 ${a.pid}`,{windowsHide:!0})}catch{}await new Promise(a=>setTimeout(a,800))}}async function al(a,b,d=!1){if(!S||S.killed)try{if(h.existsSync(I)){let a=parseInt(h.readFileSync(I,"utf-8").trim(),10);if(a&&W(a))return T=a,D(`♻️ Reusing existing process (PID: ${a})`),await _(!0,b),b&&V(b),{running:!0,pid:a};h.unlinkSync(I)}}catch{}if(S&&!S.killed)throw Error("MITM server is already running");if(await ah(b),!v){let a=await new Promise(a=>{let b=j.createServer();b.once("error",b=>{"EADDRINUSE"===b.code?a("in-use"):a("no-permission")}),b.once("listening",()=>{b.close(()=>a("free"))}),b.listen(443,"127.0.0.1")});if("in-use"===a||"no-permission"===a){let a=await ag(b);if(a){let c=a.name.includes("/")?a.name.split("/").filter(Boolean).pop():a.name;if(d)D(`Killing process on port 443 (PID ${a.pid}, name=${c})...`),await ak(a,b);else{let b=Error(`Port 443 is already in use by "${c}" (PID ${a.pid}).`);throw b.code="PORT_443_BUSY",b.portOwner={pid:a.pid,name:c},b}}}}let l=g.join(C,"rootCA.crt"),m=g.join(C,"rootCA.key"),n=h.existsSync(l)&&h.existsSync(m);if(!n||A(l)){if(n){D("\uD83D\uDD10 Cert expired — uninstalling old cert...");let a=b||U()||await ab();try{await z(a,l)}catch{}}D("\uD83D\uDD10 Generating Root CA..."),await x()}let{checkCertInstalled:o}=c(28059),p=await o(l),r=!v&&!w&&!s();if(p)D("\uD83D\uDD10 Cert: already trusted ✅");else{D("\uD83D\uDD10 Cert: not trusted → installing...");let a=b||U()||await ab();if(r)D(`🔐 Cert: skipping system trust (no sudo). Install ${l} as a trusted CA on machines that use this proxy.`);else{if(!a&&t())throw Error("Sudo password required to install Root CA certificate");try{await y(a,l),D("\uD83D\uDD10 Cert: ✅ trusted")}catch(a){throw Error(`Failed to trust certificate: ${a.message}`)}}}let u=P;if((!u||!h.existsSync(u))&&(D(`[MITM] server.js missing at ${u} → recopying`),!(u=O(N()))||!h.existsSync(u)))throw Error(`MITM server.js not found at ${u}. Reinstall 9router.`);let B=await H();if(D(`🚀 Starting server... (router: ${B})`),v){let c=await ag(b);if(c)if(d)D(`Killing process on port 443 (PID ${c.pid}, name=${c.name})...`),await ak(c,b);else{let a=Error(`Port 443 is already in use by "${c.name}" (PID ${c.pid}).`);throw a.code="PORT_443_BUSY",a.portOwner={pid:c.pid,name:c.name},a}S=e(process.execPath,[u],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:B}}),$&&await $({mitmCertInstalled:!0}).catch(()=>{})}else s()?((S=e("sudo",["-S","-E","sh","-c",[`HOME=${G(i.homedir())}`,`ROUTER_API_KEY=${G(a)}`,`MITM_ROUTER_BASE=${G(B)}`,"NODE_ENV=production",G(process.execPath),G(u)].join(" ")],{detached:!1,windowsHide:!0,stdio:["pipe","pipe","pipe"]})).stdin.write(`${b}
6
+ `),S.stdin.end()):S=e(process.execPath,[u],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"],env:{...process.env,ROUTER_API_KEY:a,NODE_ENV:"production",MITM_ROUTER_BASE:B}});S&&(T=S.pid,h.writeFileSync(I,String(T)),L=Date.now());let F=null;S&&(S.stdout.on("data",a=>{process.stdout.write(a)}),S.stderr.on("data",a=>{let b=a.toString().trim();b&&(v||!b.includes("Password:")&&!b.includes("password for"))&&(E(b),F=b),!v&&(b.includes("incorrect password")||b.includes("no password was provided"))&&(V(null),aa(),M=!0)}),S.on("exit",b=>{D(`Server exited (code: ${b})`),S=null,T=null;try{h.unlinkSync(I)}catch{}0===b||M||aj(a)}));let J=await function(a=443){return new Promise(b=>{let c=Date.now()+8e3,d=()=>{let e=k.request({hostname:"127.0.0.1",port:a,path:"/_mitm_health",method:"GET",rejectUnauthorized:!1},a=>{let c="";a.on("data",a=>{c+=a}),a.on("end",()=>{try{let a=JSON.parse(c);b(!0===a.ok?{ok:!0,pid:a.pid||null}:null)}catch{b(null)}})});e.on("error",()=>{Date.now()<c?setTimeout(d,500):b(null)}),e.end()};d()})}(443);if(!J){if(S&&!S.killed){try{S.kill()}catch{}S=null}let a=function(){try{if(v){let a=f('powershell -NonInteractive -WindowStyle Hidden -Command "$c = Get-NetTCPConnection -LocalPort 443 -State Listen -ErrorAction SilentlyContinue | Select-Object -First 1; if ($c) { $c.OwningProcess } else { 0 }"',{encoding:"utf8",windowsHide:!0}).trim(),b=parseInt(a,10);if(b&&b>4){let a=f(`tasklist /FI "PID eq ${b}" /FO CSV /NH`,{encoding:"utf8",windowsHide:!0}).match(/"([^"]+)"/);if(a)return a[1].replace(".exe","")}}else{let a=f("lsof -i :443",{encoding:"utf8",windowsHide:!0}).trim().split("\n");if(a.length>1)return a[1].split(/\s+/)[0]}}catch{}return null}(),b=a?` Port 443 already in use by ${a}.`:"",c=F||`Check sudo password or port 443 access.${b}`;throw Error(`MITM server failed to start. ${c}`)}for(let[a,b]of($&&await $({mitmCertInstalled:!0}).catch(()=>{}),D(`✅ Server healthy (PID: ${T||J.pid})`),Object.entries(q())))D(`🌐 DNS ${a}: ${b?"✅ active":"❌ inactive"}`);return await _(!0,b),b&&V(b),{running:!0,pid:T}}async function am(a){M=!0,K=0,D("⏹ Stopping server...");let b=S,d=b&&!b.killed?b.pid:(()=>{try{return parseInt(h.readFileSync(I,"utf-8").trim(),10)}catch{return null}})();if(d&&W(d)&&(D(`Killing server (PID: ${d})...`),X(d,!1,a),await new Promise(a=>setTimeout(a,1e3)),W(d)&&X(d,!0,a)),S=null,T=null,v){let a=g.join(process.env.SystemRoot||"C:\\Windows","System32","drivers","etc","hosts"),b=Object.values(r).flat();try{let{isAdmin:d,runElevatedPowerShell:e,quotePs:f}=c(55757);if(d()){let d=h.readFileSync(a,"utf8"),e=d.split(/\r?\n/).filter(a=>!b.some(b=>a.includes(b))).join("\r\n").replace(/[\r\n\s]+$/g,"")+"\r\n";e!==d&&h.writeFileSync(a,e,"utf8");try{c(79646).execSync("ipconfig /flushdns",{windowsHide:!0,stdio:"ignore"})}catch{}D("\uD83C\uDF10 DNS: ✅ all tool hosts removed")}else{let c=b.map(f).join(","),d=`
7
7
  $hosts = @(${c})
8
8
  $lines = Get-Content -LiteralPath ${f(a)}
9
9
  $filtered = $lines | Where-Object {
@@ -12,4 +12,4 @@
12
12
  }
13
13
  Set-Content -LiteralPath ${f(a)} -Value $filtered
14
14
  ipconfig /flushdns | Out-Null
15
- `;await e(d)}}catch(a){E(`Failed to clean hosts: ${a.message}`)}}else await o(a);try{h.unlinkSync(I)}catch{}return await Z(!1,null),M=!1,{running:!1,pid:null}}async function al(a,b){if(!(await ag()).running)throw Error("MITM server is not running. Start the server first.");let c=b||S()||await _();return await m(a,c),await aa(a,!0),{success:!0}}a.exports={getMitmStatus:ag,startServer:aj,stopServer:ak,enableToolDNS:al,disableToolDNS:async function a(a,b){let c=b||S()||await _();return await n(a,c),await aa(a,!1),{success:!0}},trustCert:async function a(a){let b=g.join(C,"rootCA.crt");if(!h.existsSync(b))throw Error("Root CA not found. Start server first to generate it.");let{installCert:d}=c(28059);if(!v&&!w&&!s())return void D(`🔐 Cert: system trust unavailable (no sudo). Use file: ${b}`);let e=a||S()||await _();if(!e&&t())throw Error("Sudo password required to trust certificate");await d(e,b),e&&T(e)},startMitm:aj,stopMitm:ak,getCachedPassword:S,setCachedPassword:T,loadEncryptedPassword:_,clearEncryptedPassword:$,isSudoPasswordRequired:t,initDbHooks:function(a,b){X=a,Y=b},restoreToolDNS:ac,hasDnsPrivilege:ad,removeAllDNSEntriesSync:p}},89998:(a,b,c)=>{let d=c(33873),e=c(29021),f=c(65978),{MITM_DIR:g}=c(17893),h=d.join(g,"rootCA.key"),i=d.join(g,"rootCA.crt");function j(a){try{let b=f.pki.certificateFromPem(e.readFileSync(a,"utf8")),c=new Date(Date.now()+2592e6);return b.validity.notAfter<c}catch{return!0}}a.exports={generateRootCA:async function a(){let a=e.existsSync(h)&&e.existsSync(i);if(a&&!j(i))return console.log("✅ Root CA already exists"),{key:h,cert:i};if(a){console.log("\uD83D\uDD10 Root CA expired or expiring soon — regenerating...");try{e.unlinkSync(h)}catch{}try{e.unlinkSync(i)}catch{}}e.existsSync(g)||e.mkdirSync(g,{recursive:!0}),console.log("\uD83D\uDD10 Generating Root CA certificate...");let b=f.pki.rsa.generateKeyPair(2048),c=f.pki.createCertificate();c.publicKey=b.publicKey,c.serialNumber="01",c.validity.notBefore=new Date,c.validity.notAfter=new Date,c.validity.notAfter.setFullYear(c.validity.notBefore.getFullYear()+10);let d=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}];c.setSubject(d),c.setIssuer(d),c.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0},{name:"subjectKeyIdentifier"}]),c.sign(b.privateKey,f.md.sha256.create());let k=f.pki.privateKeyToPem(b.privateKey),l=f.pki.certificateToPem(c);return e.writeFileSync(h,k),e.writeFileSync(i,l),console.log("✅ Root CA generated successfully"),{key:h,cert:i}},loadRootCA:function(){if(!e.existsSync(h)||!e.existsSync(i))throw Error("Root CA not found. Generate it first.");let a=e.readFileSync(h,"utf8"),b=e.readFileSync(i,"utf8");return{key:f.pki.privateKeyFromPem(a),cert:f.pki.certificateFromPem(b)}},generateLeafCert:function(a,b){let c=f.pki.rsa.generateKeyPair(2048),d=f.pki.createCertificate();return d.publicKey=c.publicKey,d.serialNumber=Math.floor(1e6*Math.random()).toString(),d.validity.notBefore=new Date,d.validity.notAfter=new Date,d.validity.notAfter.setFullYear(d.validity.notBefore.getFullYear()+1),d.setSubject([{name:"commonName",value:a}]),d.setIssuer(b.cert.subject.attributes),d.setExtensions([{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:a},{type:2,value:`*.${a}`}]}]),d.sign(b.key,f.md.sha256.create()),{key:f.pki.privateKeyToPem(c.privateKey),cert:f.pki.certificateToPem(d)}},isCertExpired:j,ROOT_CA_CERT_PATH:i,ROOT_CA_KEY_PATH:h}}};
15
+ `;await e(d)}}catch(a){E(`Failed to clean hosts: ${a.message}`)}}else await o(a);try{h.unlinkSync(I)}catch{}return await _(!1,null),M=!1,{running:!1,pid:null}}async function an(a,b){if(!(await ai()).running)throw Error("MITM server is not running. Start the server first.");let c=b||U()||await ab();return await m(a,c),await ac(a,!0),{success:!0}}a.exports={getMitmStatus:ai,startServer:al,stopServer:am,enableToolDNS:an,disableToolDNS:async function a(a,b){let c=b||U()||await ab();return await n(a,c),await ac(a,!1),{success:!0}},trustCert:async function a(a){let b=g.join(C,"rootCA.crt");if(!h.existsSync(b))throw Error("Root CA not found. Start server first to generate it.");let{installCert:d}=c(28059);if(!v&&!w&&!s())return void D(`🔐 Cert: system trust unavailable (no sudo). Use file: ${b}`);let e=a||U()||await ab();if(!e&&t())throw Error("Sudo password required to trust certificate");await d(e,b),e&&V(e)},startMitm:al,stopMitm:am,getCachedPassword:U,setCachedPassword:V,loadEncryptedPassword:ab,clearEncryptedPassword:aa,isSudoPasswordRequired:t,initDbHooks:function(a,b){Z=a,$=b},restoreToolDNS:ae,hasDnsPrivilege:af,removeAllDNSEntriesSync:p}},89998:(a,b,c)=>{let d=c(33873),e=c(29021),f=c(65978),{MITM_DIR:g}=c(17893),h=d.join(g,"rootCA.key"),i=d.join(g,"rootCA.crt");function j(a){try{let b=f.pki.certificateFromPem(e.readFileSync(a,"utf8")),c=new Date(Date.now()+2592e6);return b.validity.notAfter<c}catch{return!0}}a.exports={generateRootCA:async function a(){let a=e.existsSync(h)&&e.existsSync(i);if(a&&!j(i))return console.log("✅ Root CA already exists"),{key:h,cert:i};if(a){console.log("\uD83D\uDD10 Root CA expired or expiring soon — regenerating...");try{e.unlinkSync(h)}catch{}try{e.unlinkSync(i)}catch{}}e.existsSync(g)||e.mkdirSync(g,{recursive:!0}),console.log("\uD83D\uDD10 Generating Root CA certificate...");let b=f.pki.rsa.generateKeyPair(2048),c=f.pki.createCertificate();c.publicKey=b.publicKey,c.serialNumber="01",c.validity.notBefore=new Date,c.validity.notAfter=new Date,c.validity.notAfter.setFullYear(c.validity.notBefore.getFullYear()+10);let d=[{name:"commonName",value:"9Router MITM Root CA"},{name:"organizationName",value:"9Router"},{name:"countryName",value:"US"}];c.setSubject(d),c.setIssuer(d),c.setExtensions([{name:"basicConstraints",cA:!0,critical:!0},{name:"keyUsage",keyCertSign:!0,cRLSign:!0,critical:!0},{name:"subjectKeyIdentifier"}]),c.sign(b.privateKey,f.md.sha256.create());let k=f.pki.privateKeyToPem(b.privateKey),l=f.pki.certificateToPem(c);return e.writeFileSync(h,k),e.writeFileSync(i,l),console.log("✅ Root CA generated successfully"),{key:h,cert:i}},loadRootCA:function(){if(!e.existsSync(h)||!e.existsSync(i))throw Error("Root CA not found. Generate it first.");let a=e.readFileSync(h,"utf8"),b=e.readFileSync(i,"utf8");return{key:f.pki.privateKeyFromPem(a),cert:f.pki.certificateFromPem(b)}},generateLeafCert:function(a,b){let c=f.pki.rsa.generateKeyPair(2048),d=f.pki.createCertificate();return d.publicKey=c.publicKey,d.serialNumber=Math.floor(1e6*Math.random()).toString(),d.validity.notBefore=new Date,d.validity.notAfter=new Date,d.validity.notAfter.setFullYear(d.validity.notBefore.getFullYear()+1),d.setSubject([{name:"commonName",value:a}]),d.setIssuer(b.cert.subject.attributes),d.setExtensions([{name:"basicConstraints",cA:!1},{name:"keyUsage",digitalSignature:!0,keyEncipherment:!0},{name:"extKeyUsage",serverAuth:!0,clientAuth:!0},{name:"subjectAltName",altNames:[{type:2,value:a},{type:2,value:`*.${a}`}]}]),d.sign(b.key,f.md.sha256.create()),{key:f.pki.privateKeyToPem(c.privateKey),cert:f.pki.certificateToPem(d)}},isCertExpired:j,ROOT_CA_CERT_PATH:i,ROOT_CA_KEY_PATH:h}}};
@@ -0,0 +1 @@
1
+ exports.id=6782,exports.ids=[6782],exports.modules={932:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroAuthModal.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.")},"/Users/Working/router4/app/src/shared/components/KiroAuthModal.js","default")},8114:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Input.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.")},"/Users/Working/router4/app/src/shared/components/Input.js","default")},13181:(a,b,c)=>{Promise.resolve().then(c.bind(c,89468)),Promise.resolve().then(c.bind(c,97617)),Promise.resolve().then(c.bind(c,69385)),Promise.resolve().then(c.bind(c,38868)),Promise.resolve().then(c.bind(c,82934)),Promise.resolve().then(c.bind(c,20535)),Promise.resolve().then(c.bind(c,91329)),Promise.resolve().then(c.bind(c,51283)),Promise.resolve().then(c.bind(c,39623)),Promise.resolve().then(c.bind(c,80959)),Promise.resolve().then(c.bind(c,78472)),Promise.resolve().then(c.bind(c,90537)),Promise.resolve().then(c.bind(c,87030)),Promise.resolve().then(c.bind(c,50258)),Promise.resolve().then(c.bind(c,8114)),Promise.resolve().then(c.bind(c,932)),Promise.resolve().then(c.bind(c,13377)),Promise.resolve().then(c.bind(c,65024)),Promise.resolve().then(c.bind(c,86241)),Promise.resolve().then(c.bind(c,68480)),Promise.resolve().then(c.bind(c,60864)),Promise.resolve().then(c.bind(c,59062)),Promise.resolve().then(c.bind(c,33335)),Promise.resolve().then(c.bind(c,73723)),Promise.resolve().then(c.bind(c,37218)),Promise.resolve().then(c.bind(c,69270)),Promise.resolve().then(c.bind(c,89439)),Promise.resolve().then(c.bind(c,15044)),Promise.resolve().then(c.bind(c,95031)),Promise.resolve().then(c.bind(c,81567)),Promise.resolve().then(c.bind(c,61357)),Promise.resolve().then(c.bind(c,22252)),Promise.resolve().then(c.bind(c,44846)),Promise.resolve().then(c.bind(c,87050)),Promise.resolve().then(c.bind(c,46127)),Promise.resolve().then(c.bind(c,86672)),Promise.resolve().then(c.bind(c,78249)),Promise.resolve().then(c.bind(c,85634))},13377:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroOAuthWrapper.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.")},"/Users/Working/router4/app/src/shared/components/KiroOAuthWrapper.js","default")},15044:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/OAuthModal.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.")},"/Users/Working/router4/app/src/shared/components/OAuthModal.js","default")},20535:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ChangelogModal.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.")},"/Users/Working/router4/app/src/shared/components/ChangelogModal.js","default")},22252:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Select.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.")},"/Users/Working/router4/app/src/shared/components/Select.js","default")},24797:(a,b,c)=>{Promise.resolve().then(c.bind(c,66610)),Promise.resolve().then(c.bind(c,93447)),Promise.resolve().then(c.bind(c,92251)),Promise.resolve().then(c.bind(c,55590)),Promise.resolve().then(c.bind(c,75012)),Promise.resolve().then(c.bind(c,52149)),Promise.resolve().then(c.bind(c,49871)),Promise.resolve().then(c.bind(c,37421)),Promise.resolve().then(c.bind(c,18649)),Promise.resolve().then(c.bind(c,4565)),Promise.resolve().then(c.bind(c,61094)),Promise.resolve().then(c.bind(c,46411)),Promise.resolve().then(c.bind(c,27452)),Promise.resolve().then(c.bind(c,14504)),Promise.resolve().then(c.bind(c,31288)),Promise.resolve().then(c.bind(c,82774)),Promise.resolve().then(c.bind(c,60835)),Promise.resolve().then(c.bind(c,33446)),Promise.resolve().then(c.bind(c,60115)),Promise.resolve().then(c.bind(c,53142)),Promise.resolve().then(c.bind(c,77410)),Promise.resolve().then(c.bind(c,11892)),Promise.resolve().then(c.bind(c,44037)),Promise.resolve().then(c.bind(c,33809)),Promise.resolve().then(c.bind(c,9904)),Promise.resolve().then(c.bind(c,85600)),Promise.resolve().then(c.bind(c,16081)),Promise.resolve().then(c.bind(c,7274)),Promise.resolve().then(c.bind(c,37545)),Promise.resolve().then(c.bind(c,15769)),Promise.resolve().then(c.bind(c,39907)),Promise.resolve().then(c.bind(c,62490)),Promise.resolve().then(c.bind(c,71708)),Promise.resolve().then(c.bind(c,7268)),Promise.resolve().then(c.bind(c,81101)),Promise.resolve().then(c.bind(c,37922)),Promise.resolve().then(c.bind(c,11747)),Promise.resolve().then(c.bind(c,33265))},33335:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ManualConfigModal.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.")},"/Users/Working/router4/app/src/shared/components/ManualConfigModal.js","default")},37218:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ModelSelectModal.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.")},"/Users/Working/router4/app/src/shared/components/ModelSelectModal.js","default")},38868:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Button.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.")},"/Users/Working/router4/app/src/shared/components/Button.js","default")},39623:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/EditConnectionModal.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.")},"/Users/Working/router4/app/src/shared/components/EditConnectionModal.js","default")},44846:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Sidebar.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.")},"/Users/Working/router4/app/src/shared/components/Sidebar.js","default")},46127:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ThemeToggle.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.")},"/Users/Working/router4/app/src/shared/components/ThemeToggle.js","default")},50258:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/IFlowCookieModal.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.")},"/Users/Working/router4/app/src/shared/components/IFlowCookieModal.js","default")},51283:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/CursorAuthModal.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.")},"/Users/Working/router4/app/src/shared/components/CursorAuthModal.js","default")},59062:(a,b,c)=>{"use strict";c.d(b,{CardSkeleton:()=>h,PageLoading:()=>f,Skeleton:()=>g,Spinner:()=>e,default:()=>i});var d=c(92713);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call Spinner() from the server but Spinner is 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.")},"/Users/Working/router4/app/src/shared/components/Loading.js","Spinner"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call PageLoading() from the server but PageLoading is 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.")},"/Users/Working/router4/app/src/shared/components/Loading.js","PageLoading"),g=(0,d.registerClientReference)(function(){throw Error("Attempted to call Skeleton() from the server but Skeleton is 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.")},"/Users/Working/router4/app/src/shared/components/Loading.js","Skeleton"),h=(0,d.registerClientReference)(function(){throw Error("Attempted to call CardSkeleton() from the server but CardSkeleton is 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.")},"/Users/Working/router4/app/src/shared/components/Loading.js","CardSkeleton"),i=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Loading.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.")},"/Users/Working/router4/app/src/shared/components/Loading.js","default")},60864:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/layouts/DashboardLayout.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.")},"/Users/Working/router4/app/src/shared/components/layouts/DashboardLayout.js","default")},61357:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/SegmentedControl.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.")},"/Users/Working/router4/app/src/shared/components/SegmentedControl.js","default")},65024:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/KiroSocialOAuthModal.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.")},"/Users/Working/router4/app/src/shared/components/KiroSocialOAuthModal.js","default")},68480:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/layouts/AuthLayout.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.")},"/Users/Working/router4/app/src/shared/components/layouts/AuthLayout.js","default")},69270:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/NineRemoteButton.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.")},"/Users/Working/router4/app/src/shared/components/NineRemoteButton.js","default")},69385:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Badge.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.")},"/Users/Working/router4/app/src/shared/components/Badge.js","default")},73723:(a,b,c)=>{"use strict";c.d(b,{ConfirmModal:()=>f,default:()=>e});var d=c(92713);let e=(0,d.registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Modal.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.")},"/Users/Working/router4/app/src/shared/components/Modal.js","default"),f=(0,d.registerClientReference)(function(){throw Error("Attempted to call ConfirmModal() from the server but ConfirmModal is 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.")},"/Users/Working/router4/app/src/shared/components/Modal.js","ConfirmModal")},78249:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Tooltip.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.")},"/Users/Working/router4/app/src/shared/components/Tooltip.js","default")},78472:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/GitLabAuthModal.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.")},"/Users/Working/router4/app/src/shared/components/GitLabAuthModal.js","default")},80959:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Footer.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.")},"/Users/Working/router4/app/src/shared/components/Footer.js","default")},81567:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/RequestLogger.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.")},"/Users/Working/router4/app/src/shared/components/RequestLogger.js","default")},82934:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Card.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.")},"/Users/Working/router4/app/src/shared/components/Card.js","default")},85634:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/UsageStats.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.")},"/Users/Working/router4/app/src/shared/components/UsageStats.js","default")},86241:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/LanguageSwitcher.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.")},"/Users/Working/router4/app/src/shared/components/LanguageSwitcher.js","default")},86672:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Toggle.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.")},"/Users/Working/router4/app/src/shared/components/Toggle.js","default")},87030:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/HeaderMenu.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.")},"/Users/Working/router4/app/src/shared/components/HeaderMenu.js","default")},89439:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/NoAuthProxyCard.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.")},"/Users/Working/router4/app/src/shared/components/NoAuthProxyCard.js","default")},89468:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/AddCustomEmbeddingModal.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.")},"/Users/Working/router4/app/src/shared/components/AddCustomEmbeddingModal.js","default")},90537:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Header.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.")},"/Users/Working/router4/app/src/shared/components/Header.js","default")},91329:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ComboFormModal.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.")},"/Users/Working/router4/app/src/shared/components/ComboFormModal.js","default")},95031:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/ProviderInfoCard.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.")},"/Users/Working/router4/app/src/shared/components/ProviderInfoCard.js","default")},97617:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(92713).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/Working/router4/app/src/shared/components/Avatar.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.")},"/Users/Working/router4/app/src/shared/components/Avatar.js","default")},97934:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>f});var d=c(22037);c(38868),c(8114),c(22252),c(82934),c(73723),c(59062),c(97617),c(69385),c(86672),c(46127),c(87050),c(44846),c(90537),c(80959),c(15044),c(37218),c(33335),c(91329),c(85634),c(86241),c(69270),c(87030),c(20535),c(81567),c(932),c(13377),c(65024),c(51283),c(50258),c(78472),c(39623),c(89468),c(89439),c(61357),c(78249),c(95031);var e=c(60864);function f({children:a}){return(0,d.jsx)(e.default,{children:a})}c(68480)}};
@@ -0,0 +1,23 @@
1
+ "use strict";exports.id=6890,exports.ids=[6890],exports.modules={5683:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},10228:(a,b,c)=>{c.d(b,{dM:()=>e,wn:()=>d});let d={antigravity:{id:"antigravity",name:"Antigravity",image:"/providers/antigravity.png",color:"#4285F4",description:"Google Antigravity IDE with MITM",configType:"mitm",mitmDomain:"daily-cloudcode-pa.googleapis.com",modelAliases:["claude-opus-4-6-thinking","claude-sonnet-4-6","gemini-3-flash","gpt-oss-120b-medium","gemini-3-pro-high","gemini-3-pro-low"],defaultModels:[{id:"gemini-3.1-pro-high",name:"Gemini 3.1 Pro High",alias:"gemini-3.1-pro-high"},{id:"gemini-3.1-pro-low",name:"Gemini 3.1 Pro Low",alias:"gemini-3.1-pro-low"},{id:"gemini-3-flash",name:"Gemini 3 Flash / Default",alias:"gemini-3-flash"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"claude-sonnet-4-6"},{id:"claude-opus-4-6-thinking",name:"Claude Opus 4.6 Thinking",alias:"claude-opus-4-6-thinking"},{id:"gpt-oss-120b-medium",name:"GPT OSS 120B Medium",alias:"gpt-oss-120b-medium"}]},copilot:{id:"copilot",name:"GitHub Copilot",image:"/providers/copilot.png",color:"#1F6FEB",description:"GitHub Copilot IDE with MITM",configType:"mitm",mitmDomain:"api.individual.githubcopilot.com",modelAliases:["gpt-4o-mini","claude-haiku-4.5","gpt-4o","gpt-5-mini"],defaultModels:[{id:"gpt-4o",name:"GPT-4o",alias:"gpt-4o"},{id:"gpt-4.1",name:"GPT-4.1",alias:"gpt-4.1"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"}]},kiro:{id:"kiro",name:"Kiro",image:"/providers/kiro.png",color:"#FF6B00",description:"Kiro IDE with MITM",configType:"mitm",mitmDomain:"q.us-east-1.amazonaws.com",defaultModels:[{id:"claude-sonnet-4.5",name:"Claude Sonnet 4.5",alias:"claude-sonnet-4.5"},{id:"claude-sonnet-4",name:"Claude Sonnet 4",alias:"claude-sonnet-4"},{id:"claude-haiku-4.5",name:"Claude Haiku 4.5",alias:"claude-haiku-4.5"},{id:"deepseek-3.2",name:"DeepSeek 3.2",alias:"deepseek-3.2"},{id:"minimax-m2.1",name:"MiniMax M2.1",alias:"minimax-m2.1"},{id:"simple-task",name:"Qwen3 Coder Next",alias:"simple-task"}]}},e={claude:{id:"claude",name:"Claude Code",icon:"terminal",color:"#D97757",description:"Anthropic Claude Code CLI",configType:"env",envVars:{baseUrl:"ANTHROPIC_BASE_URL",model:"ANTHROPIC_MODEL",opusModel:"ANTHROPIC_DEFAULT_OPUS_MODEL",sonnetModel:"ANTHROPIC_DEFAULT_SONNET_MODEL",haikuModel:"ANTHROPIC_DEFAULT_HAIKU_MODEL"},modelAliases:["default","sonnet","opus","haiku","opusplan"],settingsFile:"~/.claude/settings.json",defaultModels:[{id:"opus",name:"Claude Opus",alias:"opus",envKey:"ANTHROPIC_DEFAULT_OPUS_MODEL",defaultValue:"cc/claude-opus-4-6"},{id:"sonnet",name:"Claude Sonnet",alias:"sonnet",envKey:"ANTHROPIC_DEFAULT_SONNET_MODEL",defaultValue:"cc/claude-sonnet-4-6"},{id:"haiku",name:"Claude Haiku",alias:"haiku",envKey:"ANTHROPIC_DEFAULT_HAIKU_MODEL",defaultValue:"cc/claude-haiku-4-5-20251001"}]},openclaw:{id:"openclaw",name:"Open Claw",image:"/providers/openclaw.png",color:"#FF6B35",description:"Open Claw AI Assistant",configType:"custom"},codex:{id:"codex",name:"OpenAI Codex CLI",image:"/providers/codex.png",color:"#10A37F",description:"OpenAI Codex CLI",configType:"custom"},opencode:{id:"opencode",name:"OpenCode",image:"/providers/opencode.png",color:"#E87040",description:"OpenCode AI Terminal Assistant",configType:"custom"},cowork:{id:"cowork",name:"Claude Cowork",image:"/providers/claude.png",color:"#D97757",description:"Claude Desktop Cowork (third-party inference)",configType:"custom"},hermes:{id:"hermes",name:"Hermes Agent",image:"/providers/hermes.png",color:"#8B5CF6",description:"Nous Research self-improving AI agent",configType:"custom"},droid:{id:"droid",name:"Factory Droid",image:"/providers/droid.png",color:"#00D4FF",description:"Factory Droid AI Assistant",configType:"custom"},cursor:{id:"cursor",name:"Cursor",image:"/providers/cursor.png",color:"#000000",description:"Cursor AI Code Editor",configType:"guide",requiresExternalUrl:!0,notes:[{type:"warning",text:"Requires Cursor Pro account to use this feature."},{type:"cloudCheck",text:"Cursor routes requests through its own server, so local endpoint is not supported. Please enable Tunnel or Cloud Endpoint in Settings."}],guideSteps:[{step:1,title:"Open Settings",desc:"Go to Settings → Models"},{step:2,title:"Enable OpenAI API",desc:'Enable "OpenAI API key" option'},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Add Custom Model",desc:'Click "View All Model" → "Add Custom Model"'},{step:6,title:"Select Model",type:"modelSelector"}]},cline:{id:"cline",name:"Cline",image:"/providers/cline.png",color:"#00D1B2",description:"Cline AI Coding Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Cline Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},kilo:{id:"kilo",name:"Kilo Code",image:"/providers/kilocode.png",color:"#FF6B6B",description:"Kilo Code AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Kilo Code Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → OpenAI Compatible"},{step:3,title:"Base URL",value:"{{baseUrl}}/v1",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},roo:{id:"roo",name:"Roo",image:"/providers/roo.png",color:"#FF6B6B",description:"Roo AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Settings",desc:"Go to Roo Settings panel"},{step:2,title:"Select Provider",desc:"Choose API Provider → Ollama"},{step:3,title:"Base URL",value:"{{baseUrl}}",copyable:!0},{step:4,title:"API Key",type:"apiKeySelector"},{step:5,title:"Select Model",type:"modelSelector"}]},continue:{id:"continue",name:"Continue",image:"/providers/continue.png",color:"#7C3AED",description:"Continue AI Assistant",configType:"guide",guideSteps:[{step:1,title:"Open Config",desc:"Open Continue configuration file"},{step:2,title:"API Key",type:"apiKeySelector"},{step:3,title:"Select Model",type:"modelSelector"},{step:4,title:"Add Model Config",desc:"Add the following configuration to your models array:"}],codeBlock:{language:"json",code:`{
2
+ "apiBase": "{{baseUrl}}",
3
+ "title": "{{model}}",
4
+ "model": "{{model}}",
5
+ "provider": "openai",
6
+ "apiKey": "{{apiKey}}"
7
+ }`}}}},46323:(a,b,c)=>{c.d(b,{Tk:()=>p,Ah:()=>q,Q6:()=>A,a7:()=>x,ZM:()=>s,RF:()=>v,gY:()=>H,tA:()=>C,kn:()=>E,yZ:()=>t,qO:()=>y});var d=c(26835),e=c(53830),f=c(50450),g=c(65046),h=c(10074);let i="__custom__",j="__save__",k=a=>{};function l({value:a,onChange:b,requiresExternalUrl:c=!1,tunnelEnabled:f=!1,tunnelPublicUrl:g="",tailscaleEnabled:m=!1,tailscaleUrl:n="",cloudEnabled:o=!1,cloudUrl:p="",withV1:q=!0}){let[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)("");(0,e.useRef)(!1);let x=(0,e.useMemo)(()=>(({requiresExternalUrl:a,tunnelEnabled:b,tunnelPublicUrl:c,tailscaleEnabled:d,tailscaleUrl:e,cloudEnabled:f,cloudUrl:g,savedPresets:j,withV1:k})=>{let l=[],m=a=>{let b;return k?(b=(a||"").replace(/\/+$/,""))?/\/v1$/.test(b)?b:`${b}/v1`:"":(a||"").replace(/\/+$/,"")};if(!a){let a=m(`http://127.0.0.1:${h.h0.appPort}`);l.push({value:"local",label:a,url:a})}if(b&&c){let a=m(c);l.push({value:"tunnel",label:a,url:a})}if(d&&e){let a=m(e);l.push({value:"tailscale",label:a,url:a})}if(f&&g){let a=m(g);l.push({value:"cloud",label:a,url:a})}return j.forEach(a=>{l.push({value:`saved:${a.name}`,label:a.baseUrl,url:a.baseUrl,saved:!0})}),l.push({value:i,label:"Custom URL...",url:""}),l})({requiresExternalUrl:c,tunnelEnabled:f,tunnelPublicUrl:g,tailscaleEnabled:m,tailscaleUrl:n,cloudEnabled:o,cloudUrl:p,savedPresets:r,withV1:q}),[c,f,g,m,n,o,p,r,q]),y=t.startsWith("saved:"),z=t===i,A=z&&(v||"").trim().length>0;return(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("select",{value:t,onChange:c=>{let d=c.target.value;if(d===j){let b=(a||"").trim();if(!b)return;let c=b;try{c=new URL(b).host}catch{}let d=window.prompt("Save endpoint as:",c);if(!d?.trim())return;let e=[...r.filter(a=>a.name!==d.trim()),{name:d.trim(),baseUrl:b}].sort((a,b)=>a.name.localeCompare(b.name));s(e),k(e);return}if(u(d),d===i){w(""),b("");return}let e=x.find(a=>a.value===d);e&&b(e.url)},className:"flex-1 min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[x.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value)),A&&(0,d.jsx)("option",{value:j,children:"+ Save current as..."})]}),y&&(0,d.jsx)("button",{type:"button",onClick:()=>{if(!t.startsWith("saved:"))return;let a=t.slice(6),c=r.filter(b=>b.name!==a);s(c),k(c),u(i),w(""),b("")},className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors shrink-0",title:"Delete saved endpoint",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete"})})]}),z&&(0,d.jsx)("input",{type:"text",value:v,onChange:a=>{let c=a.target.value;w(c),b(c)},placeholder:q?"https://example.com/v1":"https://example.com",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"})]})}let m=a=>(a||"").replace(/\/+$/,"");function n(a,b={}){if(!a)return!1;let c=m(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(m(d))||e&&c.startsWith(m(e))||f&&c.startsWith(m(f)))}let o=process.env.NEXT_PUBLIC_CLOUD_URL;function p({tool:a,isExpanded:b,onToggle:c,activeProviders:h,modelMappings:i,onModelMappingChange:j,baseUrl:k,hasActiveProviders:m,apiKeys:q,cloudEnabled:r,initialStatus:s,tunnelEnabled:t,tunnelPublicUrl:u,tailscaleEnabled:v,tailscaleUrl:w}){let x,y,z,[A,B]=(0,e.useState)(s||null),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)(!1),[O,P]=(0,e.useState)(null),[Q,R]=(0,e.useState)(""),[S,T]=(0,e.useState)({}),[U,V]=(0,e.useState)(!1),[W,X]=(0,e.useState)(""),[Y,Z]=(0,e.useState)(!1);(0,e.useRef)(!1);let $=(()=>{if(!A?.installed)return null;let a=A.settings?.env?.ANTHROPIC_BASE_URL;return a?n(a,{tunnelPublicUrl:u,tailscaleUrl:w,cloudUrl:r?o:null})?"configured":"other":"not_configured"})(),_=async a=>{let b=a.target.checked;Z(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},aa=()=>{let a=W||k;return a.endsWith("/v1")?a:`${a}/v1`},ab=Q&&!q.some(a=>a.key===Q),ac=async()=>{F(!0),J(null);try{let b={ANTHROPIC_BASE_URL:aa()},c=Q?.trim()||(q?.length>0?q[0].key:null)||(r?null:"sk_9router");c&&(b.ANTHROPIC_AUTH_TOKEN=c),a.defaultModels.forEach(a=>{let c=i[a.alias];c&&a.envKey&&(b[a.envKey]=c)});let d=await fetch("/api/cli-tools/claude-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({env:b})}),e=await d.json();d.ok?(J({type:"success",text:"Settings applied successfully!"}),B(a=>({...a,hasBackup:!0,settings:{...a?.settings,env:b}}))):J({type:"error",text:e.error||"Failed to apply settings"})}catch(a){J({type:"error",text:a.message})}finally{F(!1)}},ad=async()=>{H(!0),J(null);try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(J({type:"success",text:"Settings reset successfully!"}),a.defaultModels.forEach(a=>j(a.alias,a.defaultValue||"")),R("")):J({type:"error",text:c.error||"Failed to reset settings"})}catch(a){J({type:"error",text:a.message})}finally{H(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/claude.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===$&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===$&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===$&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude CLI..."})]}),!C&&A&&!A.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>V(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>L(!K),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:K?"expand_less":"help"}),K?"Hide":"How to Install"]})]})]}),K&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @anthropic-ai/claude-code"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"claude"})," to verify."]})]})]})]}),!C&&A?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:W||((x=W||k).endsWith("/v1")?x:`${x}/v1`),onChange:X,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:t,tunnelPublicUrl:u,tailscaleEnabled:v,tailscaleUrl:w})]}),A?.settings?.env?.ANTHROPIC_BASE_URL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:A.settings.env.ANTHROPIC_BASE_URL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),q.length>0||Q?(0,d.jsxs)("select",{value:Q,onChange:a=>R(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[ab&&(0,d.jsx)("option",{value:Q,children:Q}),q.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:r?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:i[a.alias]||"",onChange:b=>j(a.alias,b.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),i[a.alias]&&(0,d.jsx)("button",{onClick:()=>j(a.alias,""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{P(a.alias),N(!0)},disabled:!m,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${m?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]},a.alias)),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Filter naming"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("label",{className:"flex items-center gap-1.5 cursor-pointer select-none",children:[(0,d.jsx)("input",{type:"checkbox",checked:Y,onChange:_,className:"w-3.5 h-3.5 accent-primary cursor-pointer"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"Filter naming requests"})]}),(0,d.jsx)(f.m_,{text:"Intercepts Claude Code's topic-naming requests and returns a fake response locally, saving API tokens.",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] cursor-help",children:"info"})})]})]}),I&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===I.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===I.type?"check_circle":"error"}),(0,d.jsx)("span",{children:I.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ac,disabled:!m,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ad,disabled:!A?.has9Router,loading:G,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>V(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:M,onClose:()=>N(!1),onSelect:a=>{O&&j(O,a.value)},selectedModel:O?i[O]:null,activeProviders:h,modelAliases:S,title:`Select model for ${O}`}),(0,d.jsx)(f.uR,{isOpen:U,onClose:()=>V(!1),title:"Claude CLI - Manual Configuration",configs:(y=Q&&Q.trim()?Q:r?"<API_KEY_FROM_DASHBOARD>":"sk_9router",z={ANTHROPIC_BASE_URL:aa(),ANTHROPIC_AUTH_TOKEN:y},a.defaultModels.forEach(a=>{let b=i[a.alias];b&&a.envKey&&(z[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:z},null,2)}])})]})}function q({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:r,tailscaleUrl:s}){let t,u,v,w,[x,y]=(0,e.useState)(m||null),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(!1),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)(""),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)({}),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)(""),Z=(()=>{if(!x?.installed)return null;if(!x.config)return"not_configured";let a=x.config.match(/base_url\s*=\s*"([^"]+)"/);return n(a?a[1]:"",{tunnelPublicUrl:p,tailscaleUrl:s})?"configured":"other"})(),$=()=>{let a=X||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},_=J&&!i.some(a=>a.key===J),aa=async()=>{A(!0);try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();y(b)}catch(a){y({installed:!1,error:a.message})}finally{A(!1)}},ab=async()=>{C(!0),G(null);try{let a=J&&J.trim()||k?J:"sk_9router",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:$(),apiKey:a,model:L,subagentModel:N||L})}),c=await b.json();b.ok?(G({type:"success",text:"Settings applied successfully!"}),aa()):G({type:"error",text:c.error||"Failed to apply settings"})}catch(a){G({type:"error",text:a.message})}finally{C(!1)}},ac=async()=>{E(!0),G(null);try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(G({type:"success",text:"Settings reset successfully!"}),M(""),O(""),aa()):G({type:"error",text:b.error||"Failed to reset settings"})}catch(a){G({type:"error",text:a.message})}finally{E(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/codex.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[z&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Codex CLI..."})]}),!z&&x&&!x.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Codex CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>W(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>I(!H),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:H?"expand_less":"help"}),H?"Hide":"How to Install"]})]})]}),H&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g @openai/codex"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"codex"})," to verify."]}),(0,d.jsx)("div",{className:"pt-2 border-t border-border",children:(0,d.jsxs)("p",{className:"text-text-muted text-xs",children:["Codex uses ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"~/.codex/auth.json"})," with ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"OPENAI_API_KEY"}),'. Click "Apply" to auto-configure.']})})]})]})]}),!z&&x?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:X||X||`${h}/v1`,onChange:Y,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:r,tailscaleUrl:s})]}),x?.config&&((u=(t=x.config.match(/base_url\s*=\s*"([^"]+)"/))?t[1]:null)?(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:u})]}):null),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),i.length>0||J?(0,d.jsxs)("select",{value:J,onChange:a=>K(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[_&&(0,d.jsx)("option",{value:J,children:J}),i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:L,onChange:a=>M(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),L&&(0,d.jsx)("button",{onClick:()=>M(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>Q(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:N,onChange:a=>O(a.target.value),placeholder:L||"provider/model-id (defaults to main model)",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),N&&(0,d.jsx)("button",{onClick:()=>O(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>S(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),F&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===F.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===F.type?"check_circle":"error"}),(0,d.jsx)("span",{children:F.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ab,disabled:!J&&k&&i.length>0||!L,loading:B,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ac,disabled:D,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>W(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:P,onClose:()=>Q(!1),onSelect:a=>{M(a.value),N||O(a.value),Q(!1)},selectedModel:L,activeProviders:j,modelAliases:T,title:"Select Model for Codex"}),(0,d.jsx)(f.rq,{isOpen:R,onClose:()=>S(!1),onSelect:a=>{O(a.value),S(!1)},selectedModel:N,activeProviders:j,modelAliases:T,title:"Select Subagent Model for Codex"}),(0,d.jsx)(f.uR,{isOpen:V,onClose:()=>W(!1),title:"Codex CLI - Manual Configuration",configs:(v=J&&J.trim()?J:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",w=N||L,[{filename:"~/.codex/config.toml",content:`# 9Router Configuration for Codex CLI
8
+ model = "${L}"
9
+ model_provider = "9router"
10
+
11
+ [model_providers.9router]
12
+ name = "9Router"
13
+ base_url = "${$()}"
14
+ wire_api = "responses"
15
+
16
+ [agents.subagent]
17
+ model = "${w}"
18
+ `},{filename:"~/.codex/auth.json",content:JSON.stringify({auth_mode:"apikey",OPENAI_API_KEY:v},null,2)}])})]})}let r=process.env.NEXT_PUBLIC_CLOUD_URL;function s({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:m,initialStatus:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:t,tailscaleUrl:u}){let v,w,x,y,[z,A]=(0,e.useState)(o||null),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(!1),[H,I]=(0,e.useState)(null),[J,K]=(0,e.useState)(""),[L,M]=(0,e.useState)([]),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)({}),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(!1),[X,Y]=(0,e.useState)("");(0,e.useRef)(!1);let Z=(()=>{if(!z?.installed)return null;let a=z.settings?.customModels?.find(a=>a.id?.startsWith("custom:9Router"));return a?n(a.baseUrl,{tunnelPublicUrl:q,tailscaleUrl:u,cloudUrl:m?r:null})?"configured":"other":"not_configured"})(),$=async()=>{C(!0);try{let a=await fetch("/api/cli-tools/droid-settings"),b=await a.json();A(b)}catch(a){A({installed:!1,error:a.message})}finally{C(!1)}},_=()=>{let a=X||h;return a.endsWith("/v1")?a:`${a}/v1`},aa=J&&!j.some(a=>a.key===J),ab=()=>{let a=N.trim();!a||L.includes(a)||(M(b=>[...b,a]),O(""))},ac=async()=>{E(!0),I(null);try{let a=J?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch("/api/cli-tools/droid-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:_(),apiKey:a,models:L,activeModel:L[0]||""})}),c=await b.json();b.ok?(I({type:"success",text:"Settings applied successfully!"}),$()):I({type:"error",text:c.error||"Failed to apply settings"})}catch(a){I({type:"error",text:a.message})}finally{E(!1)}},ad=async()=>{G(!0),I(null);try{let a=await fetch("/api/cli-tools/droid-settings",{method:"DELETE"}),b=await a.json();a.ok?(I({type:"success",text:"Settings reset successfully!"}),M([]),$()):I({type:"error",text:b.error||"Failed to reset settings"})}catch(a){I({type:"error",text:a.message})}finally{G(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/droid.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===Z&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[B&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Factory Droid CLI..."})]}),!B&&z&&!z.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Factory Droid CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>U(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>W(!V),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:V?"expand_less":"help"}),V?"Hide":"How to Install"]})]})]}),V&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux / Windows:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"curl -fsSL https://app.factory.ai/cli | sh"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"droid"})," to verify."]})]})]})]}),!B&&z?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:X||((v=X||h).endsWith("/v1")?v:`${v}/v1`),onChange:Y,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:t,tailscaleUrl:u})]}),z?.settings?.customModels?.find(a=>a.id?.startsWith("custom:9Router"))?.baseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:z.settings.customModels.find(a=>a.id?.startsWith("custom:9Router")).baseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),j.length>0||J?(0,d.jsxs)("select",{value:J,onChange:a=>K(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[aa&&(0,d.jsx)("option",{value:J,children:J}),j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:m?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsxs)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:["Models ",L.length>0&&(0,d.jsxs)("span",{className:"text-primary",children:["(",L.length,")"]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-1",children:[L.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-0.5 mb-1",children:L.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-1.5 px-2 py-1 bg-bg-secondary rounded border border-border",children:[(0,d.jsx)("span",{className:"flex-1 text-xs font-mono truncate",children:a}),(0,d.jsx)("button",{onClick:()=>M(b=>b.filter(b=>b!==a)),className:"text-text-muted hover:text-red-500 transition-colors shrink-0",title:"Remove",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,d.jsx)("input",{type:"text",value:N,onChange:a=>O(a.target.value),onKeyDown:a=>{"Enter"===a.key&&(a.preventDefault(),ab())},placeholder:"provider/model-id",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,d.jsx)("button",{onClick:()=>Q(!0),disabled:!i,className:`px-2 py-1.5 rounded border text-xs shrink-0 ${i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"}),(0,d.jsx)("button",{onClick:ab,disabled:!N.trim(),className:"px-2 py-1.5 rounded border bg-surface border-border hover:border-primary text-xs shrink-0 disabled:opacity-50",title:"Add model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"add"})})]})]})]})]}),H&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===H.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===H.type?"check_circle":"error"}),(0,d.jsx)("span",{children:H.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ac,disabled:0===L.length,loading:D,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ad,disabled:!z?.has9Router,loading:F,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>U(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:P,onClose:()=>Q(!1),onSelect:a=>{!a.value||L.includes(a.value)||(M(b=>[...b,a.value]),Q(!1))},selectedModel:null,activeProviders:k,modelAliases:R,title:"Select Model for Factory Droid"}),(0,d.jsx)(f.uR,{isOpen:T,onClose:()=>U(!1),title:"Factory Droid - Manual Configuration",configs:(w=J&&J.trim()?J:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",x={customModels:L.map((a,b)=>({model:a,id:`custom:9Router-${b}`,index:b,baseUrl:_(),apiKey:w,displayName:a,maxOutputTokens:131072,noImageSupport:!1,provider:"openai"}))},y="u">typeof navigator&&navigator.platform,[{filename:y?.toLowerCase().includes("win")?"%USERPROFILE%\\.factory\\settings.json":"~/.factory/settings.json",content:JSON.stringify(x,null,2)}])})]})}function t({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:m,initialStatus:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let u,v,[w,x]=(0,e.useState)(o||null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)({}),[M,N]=(0,e.useState)(null),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)({}),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)("");(0,e.useRef)(!1);let W=(()=>{if(!w?.installed)return null;let a=w.settings?.models?.providers?.["9router"];return a?n(a.baseUrl,{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured"})(),X=async()=>{z(!0);try{let a=await fetch("/api/cli-tools/openclaw-settings"),b=await a.json();x(b)}catch(a){x({installed:!1,error:a.message})}finally{z(!1)}},Y=()=>{let a=U||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},Z=G&&!j.some(a=>a.key===G),$=async()=>{B(!0),F(null);try{let a=G?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch("/api/cli-tools/openclaw-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:Y(),apiKey:a,model:I,agentModels:K})}),c=await b.json();b.ok?(F({type:"success",text:"Settings applied successfully!"}),X()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{B(!1)}},_=async()=>{D(!0),F(null);try{let a=await fetch("/api/cli-tools/openclaw-settings",{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),J(""),H(""),X()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{D(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/openclaw.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===W&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===W&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===W&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Open Claw CLI..."})]}),!y&&w&&!w.installed&&(0,d.jsx)("div",{className:"flex flex-col gap-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Open Claw CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsx)("div",{className:"flex items-center gap-2 pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>T(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!y&&w?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:U||((u=U||"http://127.0.0.1:20128").endsWith("/v1")?u:`${u}/v1`),onChange:V,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),w?.settings?.models?.providers?.["9router"]?.baseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.settings.models.providers["9router"].baseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),j.length>0||G?(0,d.jsxs)("select",{value:G,onChange:a=>H(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[Z&&(0,d.jsx)("option",{value:G,children:G}),j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:m?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:I,onChange:a=>J(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),I&&(0,d.jsx)("button",{onClick:()=>J(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{N(null),P(!0)},disabled:!i,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]}),(w.agents||[]).filter(a=>a.agentDir).map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-4",children:[(0,d.jsxs)("span",{className:"w-32 shrink-0 text-xs text-primary text-right truncate",title:a.name||a.id,children:["Agent ",a.name||a.id]}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:K[a.id]||"",onChange:b=>L(c=>({...c,[a.id]:b.target.value})),placeholder:`default (${I||"provider/model-id"})`,className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),K[a.id]&&(0,d.jsx)("button",{onClick:()=>L(b=>({...b,[a.id]:""})),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{N(a.id),P(!0)},disabled:!i,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.id))]}),E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:$,disabled:!I,loading:A,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:_,disabled:!w?.has9Router,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>T(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:O,onClose:()=>P(!1),onSelect:a=>{M?(L(b=>({...b,[M]:a.value})),N(null)):J(a.value),P(!1)},selectedModel:I,activeProviders:k,modelAliases:Q,title:"Select Model for Open Claw"}),(0,d.jsx)(f.uR,{isOpen:S,onClose:()=>T(!1),title:"Open Claw - Manual Configuration",configs:(v=G&&G.trim()?G:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.openclaw/openclaw.json",content:JSON.stringify({agents:{defaults:{model:{primary:`9router/${I||"provider/model-id"}`}}},models:{providers:{"9router":{baseUrl:Y(),apiKey:v,api:"openai-completions",models:[{id:I||"provider/model-id",name:(I||"provider/model-id").split("/").pop()}]}}}},null,2)}])})]})}let u="/api/cli-tools/hermes-settings";function v({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:m,initialStatus:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s}){let t,[w,x]=(0,e.useState)(o||null),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),[G,H]=(0,e.useState)(""),[I,J]=(0,e.useState)(""),[K,L]=(0,e.useState)(!1),[M,N]=(0,e.useState)({}),[O,P]=(0,e.useState)(!1),[Q,R]=(0,e.useState)("");(0,e.useRef)(!1);let S=(()=>{if(!w?.installed)return null;let a=w.settings?.model;return a?.base_url?n(a.base_url,{tunnelPublicUrl:q,tailscaleUrl:s})?"configured":"other":"not_configured"})(),T=async()=>{z(!0);try{let a=await fetch(u),b=await a.json();x(b)}catch(a){x({installed:!1,error:a.message})}finally{z(!1)}},U=()=>{let a=Q||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},V=G&&!j.some(a=>a.key===G),W=async()=>{B(!0),F(null);try{let a=G?.trim()||(j?.length>0?j[0].key:null)||(m?null:"sk_9router"),b=await fetch(u,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:U(),apiKey:a,model:I})}),c=await b.json();b.ok?(F({type:"success",text:"Settings applied successfully!"}),T()):F({type:"error",text:c.error||"Failed to apply settings"})}catch(a){F({type:"error",text:a.message})}finally{B(!1)}},X=async()=>{D(!0),F(null);try{let a=await fetch(u,{method:"DELETE"}),b=await a.json();a.ok?(F({type:"success",text:"Settings reset successfully!"}),J(""),T()):F({type:"error",text:b.error||"Failed to reset settings"})}catch(a){F({type:"error",text:a.message})}finally{D(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/hermes.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===S&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===S&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===S&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[y&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Hermes Agent..."})]}),!y&&w&&!w.installed&&(0,d.jsx)("div",{className:"flex flex-col gap-4",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Hermes Agent not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Install: curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install.sh | bash"})]})]}),(0,d.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2 pl-0 sm:pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>P(!0),className:"w-full sm:w-auto !bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]})}),!y&&w?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:Q||U(),onChange:R,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:s})]}),w?.settings?.model?.base_url&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:w.settings.model.base_url})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),j.length>0||G?(0,d.jsxs)("select",{value:G,onChange:a=>H(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[V&&(0,d.jsx)("option",{value:G,children:G}),j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:m?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Default Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:I,onChange:a=>J(a.target.value),placeholder:"provider/model-id",className:"w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),I&&(0,d.jsx)("button",{onClick:()=>J(""),className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>L(!0),disabled:!i,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${i?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})]}),E&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===E.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===E.type?"check_circle":"error"}),(0,d.jsx)("span",{children:E.text})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:W,disabled:!I,loading:A,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:X,disabled:!w?.has9Router,loading:C,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>P(!0),className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:K,onClose:()=>L(!1),onSelect:a=>{J(a.value),L(!1)},selectedModel:I,activeProviders:k,modelAliases:M,title:"Select Model for Hermes Agent"}),(0,d.jsx)(f.uR,{isOpen:O,onClose:()=>P(!1),title:"Hermes Agent - Manual Configuration",configs:(t=G&&G.trim()?G:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",[{filename:"~/.hermes/config.yaml",content:`model:
19
+ default: "${I||"provider/model-id"}"
20
+ provider: "custom"
21
+ base_url: "${U()}"
22
+ `},{filename:"~/.hermes/.env",content:`OPENAI_API_KEY=${t}
23
+ `}])})]})}var w=c(93617);function x({toolId:a,tool:b,isExpanded:c,onToggle:h,baseUrl:i,apiKeys:j,activeProviders:k=[],cloudEnabled:l=!1,tunnelEnabled:m=!1}){let[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(!1),[r,s]=(0,e.useState)(""),[t,u]=(0,e.useState)(()=>j?.length>0?j[0].key:""),v=a=>{let b=t&&t.trim()?t:l?"your-api-key":"sk_9router",c=i||"http://localhost:20128",d=c.endsWith("/v1")?c:`${c}/v1`;return a.replace(/\{\{baseUrl\}\}/g,d).replace(/\{\{apiKey\}\}/g,b).replace(/\{\{model\}\}/g,r||"provider/model-id")},{copy:y}=(0,w.C)(),z=async(a,b)=>{await y(v(a),`toolcard-${b}`),o(b),setTimeout(()=>o(null),2e3)},A=k.length>0,B=()=>(!b.requiresExternalUrl||!!l||!!m)&&(!b.requiresCloud||!!l);return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden overflow-x-hidden",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between hover:cursor-pointer",onClick:h,children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",children:b.image?(0,d.jsx)(g.default,{src:b.image,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}}):b.icon?(0,d.jsx)("span",{className:"material-symbols-outlined text-xl",style:{color:b.color},children:b.icon}):(0,d.jsx)(g.default,{src:`/providers/${a}.png`,alt:b.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:b.name}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:b.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${c?"rotate-180":""}`,children:"expand_more"})]}),c&&(0,d.jsx)("div",{className:"mt-6 pt-6 border-t border-border",children:b.guideSteps?(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[b.notes&&0!==b.notes.length?(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-4",children:b.notes.map((a,b)=>{if("cloudCheck"===a.type&&(l||m))return null;let c="warning"===a.type,e="cloudCheck"===a.type&&!l&&!m,f="bg-blue-500/10 border-blue-500/30",g="text-blue-600 dark:text-blue-400",h="text-blue-500",i="info";return c?(f="bg-yellow-500/10 border-yellow-500/30",g="text-yellow-600 dark:text-yellow-400",h="text-yellow-500",i="warning"):e&&(f="bg-red-500/10 border-red-500/30",g="text-red-600 dark:text-red-400",h="text-red-500",i="error"),(0,d.jsxs)("div",{className:`flex items-start gap-3 p-3 rounded-lg border ${f}`,children:[(0,d.jsx)("span",{className:`material-symbols-outlined text-lg ${h}`,children:i}),(0,d.jsx)("p",{className:`text-sm ${g}`,children:a.text})]},b)})}):null,B()&&b.guideSteps.map(a=>(0,d.jsxs)("div",{className:"flex items-start gap-4",children:[(0,d.jsx)("div",{className:"size-8 rounded-full flex items-center justify-center shrink-0 text-sm font-semibold text-white",style:{backgroundColor:b.color},children:a.step}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-text",children:a.title}),a.desc&&(0,d.jsx)("p",{className:"text-sm text-text-muted mt-0.5",children:a.desc}),"apiKeySelector"===a.type&&(0,d.jsx)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:j&&j.length>0?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("select",{value:t,onChange:a=>u(a.target.value),className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50",children:j.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))}),(0,d.jsx)("button",{onClick:()=>z(t,"apiKey"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"apiKey"===n?"check":"content_copy"})})]}):(0,d.jsx)("span",{className:"text-sm text-text-muted",children:l?"No API keys - Create one in Keys page":"sk_9router"})}),"modelSelector"===a.type&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("input",{type:"text",value:r,onChange:a=>s(a.target.value),placeholder:"provider/model-id",className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm border border-border focus:outline-none focus:ring-1 focus:ring-primary/50"}),(0,d.jsx)("button",{onClick:()=>q(!0),disabled:!A,className:`shrink-0 px-3 py-2 rounded-lg border text-sm transition-colors ${A?"bg-bg-secondary border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),r&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("button",{onClick:()=>z(r,"model"),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"model"===n?"check":"content_copy"})}),(0,d.jsx)("button",{onClick:()=>s(""),className:"p-2 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:"close"})})]})]}),a.value&&(0,d.jsxs)("div",{className:"mt-2 flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsx)("code",{className:"w-full sm:w-auto flex-1 px-3 py-2 bg-bg-secondary rounded-lg text-sm font-mono border border-border truncate",children:v(a.value)}),a.copyable&&(0,d.jsx)("button",{onClick:()=>z(a.value,`${a.step}-${a.title}`),className:"shrink-0 px-3 py-2 bg-bg-secondary hover:bg-bg-tertiary rounded-lg border border-border transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-lg",children:n===`${a.step}-${a.title}`?"check":"content_copy"})})]})]})]},a.step)),B()&&b.codeBlock&&(0,d.jsxs)("div",{className:"mt-2",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between mb-2",children:[(0,d.jsx)("span",{className:"text-xs text-text-muted uppercase tracking-wide",children:b.codeBlock.language}),(0,d.jsxs)("button",{onClick:()=>z(b.codeBlock.code,"codeblock"),className:"flex items-center gap-1 px-2 py-1 text-xs bg-bg-secondary hover:bg-bg-tertiary rounded border border-border transition-colors",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"codeblock"===n?"check":"content_copy"}),"codeblock"===n?"Copied!":"Copy"]})]}),(0,d.jsx)("pre",{className:"p-4 bg-bg-secondary rounded-lg border border-border overflow-x-auto",children:(0,d.jsx)("code",{className:"text-sm font-mono whitespace-pre",children:v(b.codeBlock.code)})})]})]}):(0,d.jsx)("p",{className:"text-text-muted text-sm",children:"Coming soon..."})}),(0,d.jsx)(f.rq,{isOpen:p,onClose:()=>q(!1),onSelect:a=>{s(a.value)},selectedModel:r,activeProviders:k,title:"Select Model"})]})}function y({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r}){let s,t,u,v,w,[x,z]=(0,e.useState)(m||null),[A,B]=(0,e.useState)(!1),[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(!1),[G,H]=(0,e.useState)(null),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(""),[M,N]=(0,e.useState)(""),[O,P]=(0,e.useState)(""),[Q,R]=(0,e.useState)(!1),[S,T]=(0,e.useState)(!1),[U,V]=(0,e.useState)({}),[W,X]=(0,e.useState)(!1),[Y,Z]=(0,e.useState)(""),[$,_]=(0,e.useState)([]),[aa,ab]=(0,e.useState)(""),ac=x?.installed?x.config&&x.has9Router?n(x.config?.provider?.["9router"]?.options?.baseURL||"",{tunnelPublicUrl:p,tailscaleUrl:r})?"configured":"other":"not_configured":null,ad=()=>{let a=Y||h;return a.endsWith("/v1")?a:`${a}/v1`},ae=K&&!i.some(a=>a.key===K),af=async()=>{B(!0);try{let a=await fetch("/api/cli-tools/opencode-settings"),b=await a.json();z(b)}catch(a){z({installed:!1,error:a.message})}finally{B(!1)}},ag=async()=>{D(!0),H(null);try{let a=K&&K.trim()||k?K:"sk_9router",b=await fetch("/api/cli-tools/opencode-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ad(),apiKey:a,models:$,activeModel:""===aa?"":aa||$[0],subagentModel:O})}),c=await b.json();b.ok?(H({type:"success",text:"Settings applied successfully!"}),af()):H({type:"error",text:c.error||"Failed to apply settings"})}catch(a){H({type:"error",text:a.message})}finally{D(!1)}},ah=async()=>{F(!0),H(null);try{let a=await fetch("/api/cli-tools/opencode-settings",{method:"DELETE"}),b=await a.json();a.ok?(H({type:"success",text:"Settings reset successfully!"}),N(""),P(""),_([]),ab(""),af()):H({type:"error",text:b.error||"Failed to reset settings"})}catch(a){H({type:"error",text:a.message})}finally{F(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:"/providers/opencode.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===ac&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===ac&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===ac&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[A&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking OpenCode CLI..."})]}),!A&&x&&!x.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"OpenCode CLI not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>X(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:()=>J(!I),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:I?"expand_less":"help"}),I?"Hide":"How to Install"]})]})]}),I&&(0,d.jsxs)("div",{className:"p-4 bg-surface border border-border rounded-lg",children:[(0,d.jsx)("h4",{className:"font-medium mb-3",children:"Installation Guide"}),(0,d.jsxs)("div",{className:"space-y-3 text-sm",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-text-muted mb-1",children:"macOS / Linux:"}),(0,d.jsx)("code",{className:"block px-3 py-2 bg-black/5 dark:bg-white/5 rounded font-mono text-xs",children:"npm install -g opencode-ai"})]}),(0,d.jsxs)("p",{className:"text-text-muted",children:["After installation, run ",(0,d.jsx)("code",{className:"px-1 bg-black/5 dark:bg-white/5 rounded",children:"opencode"})," to verify."]})]})]})]}),!A&&x?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:Y||Y||`${h}/v1`,onChange:Z,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r})]}),x?.config?.provider?.["9router"]?.options?.baseURL&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:x.config.provider["9router"].options.baseURL})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),i.length>0||K?(0,d.jsxs)("select",{value:K,onChange:a=>L(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[ae&&(0,d.jsx)("option",{value:K,children:K}),i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:k?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===$.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):$.map(a=>(0,d.jsxs)("span",{onClick:async()=>{if(a===aa)try{(await fetch("/api/cli-tools/opencode-settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({clearActiveModel:!0})})).ok&&(ab(""),af())}catch(a){console.log("Error clearing active model:",a)}else ab(a)},className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs cursor-pointer transition-colors ${a===aa?"bg-primary/10 text-primary border border-primary":"bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border"}`,title:a===aa?"Click to clear active model":"Click to set as active",children:[a===aa&&(0,d.jsx)("span",{className:"material-symbols-outlined text-[10px]",children:"star"}),a,(0,d.jsx)("button",{onClick:async b=>{b.stopPropagation();try{if((await fetch(`/api/cli-tools/opencode-settings?model=${encodeURIComponent(a)}`,{method:"DELETE"})).ok){let b=$.filter(b=>b!==a);_(b),aa===a&&ab(""),af()}}catch(a){console.log("Error removing model:",a)}},className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("button",{onClick:()=>R(!0),disabled:!j?.length,className:`px-2 py-1 rounded border text-xs transition-colors ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Add Model"}),(0,d.jsx)("span",{className:"text-xs text-text-muted",children:$.length>0&&aa?(0,d.jsxs)(d.Fragment,{children:["Active: ",(0,d.jsx)("span",{className:"text-primary",children:aa})]}):$.length>0?(0,d.jsx)("span",{className:"text-yellow-500",children:"Click a model to set/clear active"}):"Select models to add"})]})]})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Subagent Model"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:O,onChange:a=>P(a.target.value),placeholder:M||"provider/model-id (defaults to main model)",className:"w-full min-w-0 px-2 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5"}),(0,d.jsx)("button",{onClick:()=>T(!0),disabled:!j?.length,className:`w-full sm:w-auto rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 whitespace-nowrap sm:shrink-0 ${j?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"}),O&&(0,d.jsx)("button",{onClick:()=>P(""),className:"p-1 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear (will use main model)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})]}),G&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===G.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===G.type?"check_circle":"error"}),(0,d.jsx)("span",{children:G.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:ag,disabled:0===$.length,loading:C,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:ah,disabled:!x.has9Router,loading:E,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>X(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.rq,{isOpen:Q,onClose:()=>R(!1),onSelect:a=>{!$.includes(a.value)&&(_([...$,a.value]),aa||ab(a.value)),R(!1)},selectedModel:null,activeProviders:j,modelAliases:U,title:"Add Model for OpenCode"}),(0,d.jsx)(f.rq,{isOpen:S,onClose:()=>T(!1),onSelect:a=>{P(a.value),T(!1)},selectedModel:O,activeProviders:j,modelAliases:U,title:"Select Subagent Model for OpenCode"}),(0,d.jsx)(f.uR,{isOpen:W,onClose:()=>X(!1),title:"OpenCode - Manual Configuration",configs:(s=K&&K.trim()?K:k?"<API_KEY_FROM_DASHBOARD>":"sk_9router",t=$.length>0?$:["provider/model-id"],u=aa||$[0]||t[0],v=O||u,w={},t.forEach(a=>{w[a]={name:a}}),[{filename:"~/.config/opencode/opencode.json",content:JSON.stringify({provider:{"9router":{npm:"@ai-sdk/openai-compatible",options:{baseURL:ad(),apiKey:s},models:w}},model:`9router/${u}`,agent:{explorer:{description:"Fast explorer subagent for codebase exploration",mode:"subagent",model:`9router/${v}`}}},null,2)}])})]})}let z="/api/cli-tools/cowork-settings";function A({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,hasActiveProviders:k,cloudEnabled:m,cloudUrl:n,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r,initialStatus:s}){let t,u,[v,w]=(0,e.useState)(s||null),[x,y]=(0,e.useState)(!1),[B,C]=(0,e.useState)(!1),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(null),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)([]),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)([]),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(!1),V=async()=>{y(!0);try{let a=await fetch(z),b=await a.json();w(b)}catch(a){w({installed:!1,error:a.message})}finally{y(!1)}},W=()=>{let a;return(a=(N||"").replace(/\/+$/,""))?/\/v1$/.test(a)?a:`${a}/v1`:""},X=v?.installed?v?.cowork?.baseUrl?v.has9Router?"configured":"other":"not_configured":null,Y=H&&!i.some(a=>a.key===H),Z=async()=>{G(null);let a=W();if(0===J.length)return void G({type:"error",text:"Please select at least one model"});C(!0);try{let b=H?.trim()||(i?.length>0?i[0].key:null)||(m?null:"sk_9router"),c=await fetch(z,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:a,apiKey:b,models:J,plugins:P})}),d=await c.json();c.ok?(G({type:"success",text:"Settings applied. Quit & reopen Claude Desktop to load."}),V()):G({type:"error",text:d.error||"Failed to apply settings"})}catch(a){G({type:"error",text:a.message})}finally{C(!1)}},$=async({name:a,models:b})=>{try{let c=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:a,models:b})});if(!c.ok){let a=await c.json();G({type:"error",text:a.error||"Failed to create combo"});return}J.includes(a)||K([...J,a]),U(!1),G({type:"success",text:`Combo "${a}" created and added.`})}catch(a){G({type:"error",text:a.message})}},_=async()=>{E(!0),G(null);try{let a=await fetch(z,{method:"DELETE"}),b=await a.json();a.ok?(G({type:"success",text:"Settings reset successfully"}),K([]),V()):G({type:"error",text:b.error||"Failed to reset"})}catch(a){G({type:"error",text:a.message})}finally{E(!1)}};return(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),"configured"===X&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-600 dark:text-green-400 rounded-full",children:"Connected"}),"not_configured"===X&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-yellow-500/10 text-yellow-600 dark:text-yellow-400 rounded-full",children:"Not configured"}),"other"===X&&(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-blue-500/10 text-blue-600 dark:text-blue-400 rounded-full",children:"Other"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[x&&(0,d.jsxs)("div",{className:"flex items-center gap-2 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),(0,d.jsx)("span",{children:"Checking Claude Cowork..."})]}),!x&&v&&!v.installed&&(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsxs)("div",{className:"flex items-start gap-3",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500",children:"warning"}),(0,d.jsxs)("div",{className:"flex-1",children:[(0,d.jsx)("p",{className:"font-medium text-yellow-600 dark:text-yellow-400",children:"Claude Desktop (Cowork mode) not detected"}),(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Open Claude Desktop → Help → Troubleshooting → Enable Developer mode → Configure third-party inference, then return here."})]})]}),(0,d.jsx)("div",{className:"pl-9",children:(0,d.jsxs)(f.$n,{variant:"secondary",size:"sm",onClick:()=>M(!0),className:"!bg-yellow-500/20 !border-yellow-500/40 !text-yellow-700 dark:!text-yellow-300 hover:!bg-yellow-500/30",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})})]}),!x&&v?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Select Endpoint"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(l,{value:W(),onChange:a=>O((a||"").replace(/\/v1\/?$/,"")),tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:q,tailscaleUrl:r,cloudEnabled:m,cloudUrl:n})]}),v?.cowork?.baseUrl&&(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("span",{className:"min-w-0 truncate rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:v.cowork.baseUrl})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),i.length>0||H?(0,d.jsxs)("select",{value:H,onChange:a=>I(a.target.value),className:"w-full min-w-0 px-2 py-2 bg-surface rounded text-xs border border-border focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5",children:[Y&&(0,d.jsx)("option",{value:H,children:H}),i.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id))]}):(0,d.jsx)("span",{className:"min-w-0 rounded bg-surface/40 px-2 py-2 text-xs text-text-muted sm:py-1.5",children:m?"No API keys - Create one in Keys page":"sk_9router (default)"})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[8rem_auto_1fr] sm:items-start sm:gap-2",children:[(0,d.jsx)("span",{className:"w-32 shrink-0 text-sm font-semibold text-text-main text-right pt-1",children:"Models"}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[14px] mt-1.5",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"flex-1 flex flex-col gap-2",children:[(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5 min-h-[28px] px-2 py-1.5 bg-surface rounded border border-border",children:0===J.length?(0,d.jsx)("span",{className:"text-xs text-text-muted",children:"No models selected"}):J.map(a=>(0,d.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs bg-black/5 dark:bg-white/5 text-text-muted border border-transparent hover:border-border",children:[a,(0,d.jsx)("button",{onClick:()=>K(b=>b.filter(b=>b!==a)),className:"ml-0.5 hover:text-red-500",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]},a))}),(0,d.jsx)("button",{onClick:()=>U(!0),disabled:!k,className:`self-start px-2 py-1 rounded border text-xs transition-colors ${k?"bg-primary/10 border-primary/40 text-primary hover:bg-primary/20 cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"+ Add Combo (claude-)"})]})]}),!1]}),F&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===F.type?"bg-green-500/10 text-green-600":"bg-red-500/10 text-red-600"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"success"===F.type?"check_circle":"error"}),(0,d.jsx)("span",{children:F.text})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row sm:items-center gap-2",children:[(0,d.jsxs)(f.$n,{variant:"primary",size:"sm",onClick:Z,disabled:0===J.length,loading:B,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.$n,{variant:"outline",size:"sm",onClick:_,disabled:!v.has9Router,loading:D,className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.$n,{variant:"ghost",size:"sm",onClick:()=>M(!0),className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]}),(0,d.jsx)(f.uR,{isOpen:L,onClose:()=>M(!1),title:"Claude Cowork - Manual Configuration",configs:(t=H&&H.trim()?H:m?"<API_KEY_FROM_DASHBOARD>":"sk_9router",u=J.length>0?J:["provider/model-id"],[{filename:"~/Library/Application Support/Claude-3p/configLibrary/<appliedId>.json",content:JSON.stringify({inferenceProvider:"gateway",inferenceGatewayBaseUrl:W()||"https://your-public-host/v1",inferenceGatewayApiKey:t,inferenceModels:u.map(a=>({name:a}))},null,2)}])}),(0,d.jsx)(f.CK,{isOpen:T,combo:null,onClose:()=>U(!1),onSave:$,activeProviders:j,forcePrefix:"claude-",title:"Create Cowork Combo"})]})}let B="http://localhost:20128";function C({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useState)(null),[i,j]=(0,e.useState)(!1),[k,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(()=>a?.[0]?.key||""),[q,r]=(0,e.useState)(null),[s,t]=(0,e.useState)(null),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(B),[y,z]=(0,e.useState)(null),A=g?.isWin===!0,D=A||g?.hasCachedPassword||g?.needsSudoPassword===!1,E=g?.isAdmin!==!1;!E&&(A||g?.hasCachedPassword||g?.needsSudoPassword);let F=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h(b),b.mitmRouterBaseUrl&&x(b.mitmRouterBaseUrl),c?.(b)}}catch{h({running:!1,certExists:!1,dnsStatus:{}})}},[c]),G=a=>{v(null),g&&(D?H(a,""):(r(a),l(!0),t(null)))},H=async(c,d,e=!1)=>{j(!0),v(null);try{let f;if("trust-cert"===c)f=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({action:"trust-cert",sudoPassword:d})});else if("start"===c){let c=o?.trim()||(a?.length>0?a[0].key:null)||(b?null:"sk_9router");f=await fetch("/api/cli-tools/antigravity-mitm",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({apiKey:c,sudoPassword:d,mitmRouterBaseUrl:w.trim()||B,forceKillPort443:e})})}else f=await fetch("/api/cli-tools/antigravity-mitm",{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:d})});if(!f.ok){let a=await f.json().catch(()=>({}));if("PORT_443_BUSY"===a.code&&a.portOwner){l(!1),z({owner:a.portOwner,password:d});return}v(a.error||`Failed to ${c} MITM server`);return}l(!1),n(""),z(null),await F()}catch(a){v(a.message||"Network error")}finally{j(!1),r(null)}},I=()=>{m.trim()?H(q,m):t("Sudo password is required")},J=g?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Zp,{padding:"sm",className:"border-primary/20 bg-primary/5",children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-wrap items-center gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[20px]",children:"security"}),(0,d.jsx)("span",{className:"font-semibold text-sm text-text-main",children:"MITM Server"}),J?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Stopped"})]}),(0,d.jsx)("div",{className:"flex flex-wrap items-center gap-1 text-xs text-text-muted","data-i18n-skip":"true",children:[{label:"Cert",ok:g?.certExists},{label:"Trusted",ok:g?.certTrusted},{label:"Server",ok:J}].map(({label:a,ok:b})=>(0,d.jsxs)("span",{className:`flex items-center gap-0.5 px-1.5 py-0.5 rounded ${b?"text-green-600":"text-text-muted"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:b?"check_circle":"cancel"}),a]},a))})]}),(0,d.jsxs)("div",{className:"px-2 py-2 rounded-lg bg-surface/50 border border-border/50 flex flex-col gap-2",children:[(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"Purpose:"})," Use Antigravity IDE & GitHub Copilot → with ANY provider/model from 9Router"]}),(0,d.jsxs)("p",{className:"text-[11px] text-text-muted leading-relaxed",children:[(0,d.jsx)("span",{className:"font-medium text-text-main",children:"How it works:"})," Antigravity/Copilot IDE request → DNS redirect to localhost:443 → MITM proxy intercepts → 9Router → response to Antigravity/Copilot"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"9Router Base URL"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",value:w,onChange:a=>x(a.target.value),placeholder:B,disabled:J,className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50 disabled:opacity-50"})]}),!J&&(0,d.jsxs)("div",{className:"grid gap-1 sm:grid-cols-[8rem_auto_1fr] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right sm:text-sm",children:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)("input",{type:"text",list:"mitm-api-keys",value:o,onChange:a=>p(a.target.value),placeholder:b?"Enter or pick API key":"sk_9router (default)",className:"flex-1 min-w-0 px-2 py-1.5 bg-surface rounded border border-border text-xs text-text-main focus:outline-none focus:ring-1 focus:ring-primary/50"}),a?.length>0&&(0,d.jsx)("datalist",{id:"mitm-api-keys",children:a.map(a=>(0,d.jsx)("option",{value:a.key,children:a.name||a.key},a.id))})]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:flex-wrap sm:items-center","data-i18n-skip":"true",children:[g?.certExists&&!g?.certTrusted&&(0,d.jsxs)("button",{onClick:()=>G("trust-cert"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-yellow-500/30 bg-yellow-500/10 px-4 py-2 text-xs font-medium text-yellow-600 transition-colors hover:bg-yellow-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"verified_user"}),"Trust Cert"]}),J?(0,d.jsxs)("button",{onClick:()=>G("stop"),disabled:i,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop Server"]}):(0,d.jsxs)("button",{onClick:()=>G("start"),disabled:i||!g||A&&!E,title:A&&!E?"Administrator required":void 0,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start Server"]}),J&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),u&&(0,d.jsxs)("div",{className:"flex items-start gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 dark:text-red-400 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5 shrink-0",children:"error"}),(0,d.jsx)("span",{children:u})]}),A&&!E&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600 border border-red-500/20",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"shield_lock"}),(0,d.jsx)("span",{children:"Administrator required — restart 9Router as Administrator to use MITM"})]})]})}),k&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required for SSL certificate and server startup"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:m,onChange:a=>n(a.target.value),onKeyDown:a=>{"Enter"!==a.key||i||I()}}),s&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:s})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{l(!1),n(""),t(null)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:I,loading:i,children:"Confirm"})]})]})}),y&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-md flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Port 443 Already In Use"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsxs)("div",{className:"flex flex-col gap-1 text-xs text-text-muted",children:[(0,d.jsx)("p",{children:"Port 443 đang bị process kh\xe1c chiếm:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[y.owner.name," (PID ",y.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill process n\xe0y để chạy MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{z(null),j(!1)},disabled:i,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:()=>{H("start",y?.password||"",!0)},loading:i,children:"Kill & Start"})]})]})})]})}var D=c(5683);function E({tool:a,isExpanded:b,onToggle:c,serverRunning:h,dnsActive:i,hasCachedPassword:j,needsSudoPassword:k,isWin:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p={},cloudEnabled:q,onDnsChange:r}){let[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(null),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)(null),[C,F]=(0,e.useState)(null),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(null),M=D.TOOL_HOSTS[a.id]??[],N=l||j||!1===k,O=(0,e.useCallback)(async b=>{try{await fetch("/api/cli-tools/antigravity-mitm/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,mappings:b})})}catch{}},[a.id]),P=(a,b)=>{H(c=>({...c,[a]:b}))},Q=()=>{if(!h)return;let a=i?"disable":"enable";N?R(a,""):(B(a),x(!0),F(null))},R=async(b,c)=>{t(!0),v(null);try{let d=await fetch("/api/cli-tools/antigravity-mitm",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({tool:a.id,action:b,sudoPassword:c})}),e=await d.json();if(!d.ok)throw Error(e.error||"Failed to toggle DNS");"enable"===b&&v(`Restart ${a.name} to apply changes`),x(!1),z(""),r?.(e)}catch{}finally{t(!1),B(null)}},S=()=>{y.trim()?R(A,y):F("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Zp,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("div",{className:"flex items-start justify-between gap-3 hover:cursor-pointer sm:items-center",onClick:c,children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(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)("h3",{className:"font-medium text-sm",children:a.name}),h?i?(0,d.jsx)(f.Ex,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Ex,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Ex,{variant:"default",size:"sm",children:"Server off"})]}),(0,d.jsxs)("p",{className:"text-xs text-text-muted sm:truncate",children:["Intercept ",a.name," requests via MITM proxy"]})]})]}),(0,d.jsx)("span",{className:`material-symbols-outlined text-text-muted text-[20px] transition-transform ${b?"rotate-180":""}`,children:"expand_more"})]}),b&&(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[M.length>0&&(0,d.jsxs)("div",{className:"mt-2 rounded-md border border-border bg-surface/50 px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[10px] font-medium tracking-wide text-text-main/80 mb-1",children:"Edit hosts file manually to add the following entries:"}),(0,d.jsx)("ul",{className:"list-none space-y-0.5 font-mono text-[10px] text-text-muted break-all",children:M.map(a=>(0,d.jsxs)("li",{children:["127.0.0.1 ",a]},a))})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-0.5 text-[11px] text-text-muted px-1",children:[(0,d.jsxs)("p",{children:["Toggle DNS to redirect ",a.name," traffic through 9Router via MITM."]}),!i&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),a.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:a.defaultModels.map(a=>(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-1.5 sm:grid-cols-[9rem_auto_1fr_auto] sm:items-center sm:gap-2",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-right",children:a.name}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("div",{className:"relative w-full min-w-0",children:[(0,d.jsx)("input",{type:"text",value:G[a.alias]||"",onChange:b=>P(a.alias,b.target.value),onBlur:b=>{var c,d;return c=a.alias,d=b.target.value,void O({...G,[c]:d})},placeholder:"provider/model-id",disabled:!i,className:`w-full min-w-0 pl-2 pr-7 py-2 bg-surface rounded border border-border text-xs focus:outline-none focus:ring-1 focus:ring-primary/50 sm:py-1.5 ${!i?"opacity-50 cursor-not-allowed":""}`}),G[a.alias]&&(0,d.jsx)("button",{onClick:()=>{P(a.alias,""),O({...G,[a.alias]:""})},className:"absolute right-1 top-1/2 -translate-y-1/2 p-0.5 text-text-muted hover:text-red-500 rounded transition-colors",title:"Clear",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{onClick:()=>{L(a.alias),J(!0)},disabled:!o||!i,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${o&&i?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},a.alias))}),a.defaultModels?.length===0&&(0,d.jsx)("p",{className:"text-xs text-text-muted px-1",children:"Model mappings will be available soon."}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 sm:items-start",children:[i?(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"stop_circle"}),"Stop DNS"]}):(0,d.jsxs)("button",{onClick:Q,disabled:!h||s,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-primary/30 bg-primary/10 px-4 py-2 text-xs font-medium text-primary transition-colors hover:bg-primary/20 disabled:cursor-not-allowed disabled:opacity-50 sm:w-auto sm:py-1.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"play_circle"}),"Start DNS"]}),u&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs text-amber-500",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"warning"}),(0,d.jsx)("span",{children:u})]})]})]})]}),w&&(0,d.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 backdrop-blur-sm",children:(0,d.jsxs)("div",{className:"mx-4 flex w-full max-w-sm flex-col gap-4 rounded-xl border border-border bg-surface p-5 shadow-xl sm:p-6",children:[(0,d.jsx)("h3",{className:"font-semibold text-text-main",children:"Sudo Password Required"}),(0,d.jsxs)("div",{className:"flex items-start gap-3 p-3 bg-yellow-500/10 border border-yellow-500/30 rounded-lg",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-yellow-500 text-[20px]",children:"warning"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Required to modify /etc/hosts and flush DNS cache"})]}),(0,d.jsx)(f.pd,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||S()}}),C&&(0,d.jsxs)("div",{className:"flex items-center gap-2 px-2 py-1.5 rounded text-xs bg-red-500/10 text-red-600",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),(0,d.jsx)("span",{children:C})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.$n,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),F(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.$n,{variant:"primary",size:"sm",onClick:S,loading:s,children:"Confirm"})]})]})}),(0,d.jsx)(f.rq,{isOpen:I,onClose:()=>J(!1),onSelect:a=>{if(!K||a.isPlaceholder)return;let b={...G,[K]:a.value};H(b),O(b)},selectedModel:K?G[K]:null,activeProviders:n,modelAliases:p,title:`Select model for ${K}`})]})}var F=c(30978),G=c.n(F);function H({tool:a}){return(0,d.jsx)(G(),{href:"/dashboard/mitm",className:"block",children:(0,d.jsx)(f.Zp,{padding:"sm",className:"overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,d.jsxs)("div",{className:"flex items-center justify-between",children:[(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:(0,d.jsx)(g.default,{src:a.image,alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"}})}),(0,d.jsxs)("div",{className:"min-w-0",children:[(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsx)("h3",{className:"font-medium text-sm",children:a.name}),(0,d.jsx)("span",{className:"px-1.5 py-0.5 text-[10px] font-medium bg-purple-500/10 text-purple-600 dark:text-purple-400 rounded-full",children:"MITM"})]}),(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:a.description})]})]}),(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[20px]",children:"chevron_right"})]})})})}}};
@@ -1 +1 @@
1
- "use strict";exports.id=8035,exports.ids=[8035],exports.modules={50304:(a,b,c)=>{c.d(b,{DA:()=>h,Lh:()=>f,Ux:()=>d,cw:()=>g,rI:()=>i,t1:()=>e});let d={intervalMs:2e3,timeoutMs:18e4,fetchTimeoutMs:5e3,dnsTimeoutMs:2e3},e={host:"1.1.1.1",port:443,timeoutMs:3e3},f=6e4,g=2500,h=6e4,i=5e3},54495:(a,b,c)=>{c.d(b,{Al:()=>y,Dd:()=>w,es:()=>C,fn:()=>D,nN:()=>F,ss:()=>E});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(55591),i=c.n(h),j=c(21820),k=c.n(j),l=c(79646),m=c(19931),n=c(81372);let o=g().join(n.n,"bin"),p="cloudflared",q="win32"===k().platform(),r=q?`${p}.exe`:p,s=g().join(o,r),t={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-arm64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-386.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}},u={darwin:"cloudflared-darwin-amd64.tgz",win32:"cloudflared-windows-386.exe",linux:"cloudflared-linux-amd64"},v={downloading:!1,progress:0};function w(){return{downloading:v.downloading,progress:v.progress}}let x=null;async function y(){return x||(x=z().finally(()=>{x=null}))}async function z(){e().existsSync(o)||e().mkdirSync(o,{recursive:!0});let a=`${s}.tmp`;if(e().existsSync(a))try{e().unlinkSync(a)}catch{}if(e().existsSync(s))if(function(a){try{if(e().statSync(a).size<1048576)return!1;let b=e().openSync(a,"r"),c=Buffer.alloc(4);e().readSync(b,c,0,4,0),e().closeSync(b);let d=c.toString("hex");if(q)return d.startsWith("4d5a");if("darwin"===k().platform())return d.startsWith("cffaedfe")||d.startsWith("cefaedfe");return d.startsWith("7f454c46")}catch{return!1}}(s))return q||e().chmodSync(s,"755"),s;else console.log("[cloudflared] Invalid binary detected, re-downloading..."),e().unlinkSync(s);let b=function(){let a=k().platform(),b=k().arch(),c=t[a];if(!c)throw Error(`Unsupported platform: ${a}`);let d=c[b]||u[a];return`https://github.com/cloudflare/cloudflared/releases/latest/download/${d}`}(),c=b.endsWith(".tgz"),d=c?g().join(o,"cloudflared.tgz.tmp"):a;return await function a(b,c){return new Promise((d,f)=>{let g=e().createWriteStream(c);i().get(b,b=>{if([301,302,303,307,308].includes(b.statusCode)){g.close(),e().unlinkSync(c),a(b.headers.location,c).then(d).catch(f);return}if(200!==b.statusCode){g.close(),e().unlinkSync(c),f(Error(`Download failed with status ${b.statusCode}`));return}let h=parseInt(b.headers["content-length"],10)||0,i=0;v.downloading=!0,v.progress=0,b.on("data",a=>{i+=a.length,h>0&&(v.progress=Math.round(i/h*100))}),b.pipe(g),g.on("finish",()=>{v.downloading=!1,v.progress=100,g.close(()=>d(c))}),g.on("error",a=>{v.downloading=!1,v.progress=0,g.close(),e().unlinkSync(c),f(a)})}).on("error",a=>{v.downloading=!1,v.progress=0,g.close(),e().existsSync(c)&&e().unlinkSync(c),f(a)})})}(b,d),c?((0,l.execSync)(`tar -xzf "${d}" -C "${o}"`,{stdio:"pipe",windowsHide:!0}),e().unlinkSync(d)):e().renameSync(d,s),q||e().chmodSync(s,"755"),s}let A=null,B=null;function C(a){B=a}async function D(a,b){let c=await y(),d=e().mkdtempSync(g().join(k().tmpdir(),"cloudflared-quick-")),f=g().join(d,"config.yml");e().writeFileSync(f,"# quick-tunnel config placeholder\n","utf8");let h=!1,i=()=>{if(!h){h=!0;try{e().rmSync(d,{recursive:!0,force:!0})}catch(a){}}},j=(0,l.spawn)(c,["tunnel","--url",`http://localhost:${a}`,"--config",f,"--no-autoupdate"],{detached:!1,windowsHide:!0,stdio:["ignore","pipe","pipe"]});return A=j,(0,m.xS)(j.pid),new Promise((a,c)=>{let d=!1,e=setTimeout(()=>{d||(d=!0,i(),c(Error("Quick tunnel timed out")))},9e4),f=null,g=c=>{let g=function(a){let b=[];for(let c of a.matchAll(/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi)){let a=c[1];"api"!==a&&b.push(`https://${a}.trycloudflare.com`)}return b.length?b[b.length-1]:null}(c.toString());if(g){if(!d){d=!0,f=g,clearTimeout(e),i(),a({child:j,tunnelUrl:g});return}g!==f&&(f=g,b&&b(g))}};j.stdout.on("data",g),j.stderr.on("data",g),j.on("error",a=>{d||(d=!0,clearTimeout(e),i(),c(a))}),j.on("exit",(a,b)=>{if(A=null,(0,m.r4)(),!d){d=!0,clearTimeout(e),i(),1===a?c(Error(`cloudflared exited with code ${a}. This often means: (1) the tunnel token is invalid or expired, (2) network connectivity issues, or (3) cloudflared cannot reach the local server.`)):2===a?c(Error(`cloudflared exited with code ${a}. Check that arguments are correct.`)):c(Error(`cloudflared exited with code ${a}`));return}B&&B(),i()})})}function E(a){if(A){try{A.kill()}catch(a){}A=null}let b=(0,m.Cr)();if(b){try{process.kill(b)}catch(a){}(0,m.r4)()}if(a)try{if(q){let b=`Get-CimInstance Win32_Process -Filter \\"Name='cloudflared.exe'\\" | Where-Object { $_.CommandLine -match ':${a}(\\D|$)' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`;(0,l.execSync)(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${b}"`,{stdio:"ignore",windowsHide:!0})}else(0,l.execSync)(`pkill -f "cloudflared.*:${a}([^0-9]|$)" 2>/dev/null || true`,{stdio:"ignore",windowsHide:!0})}catch(a){}}function F(){let a=(0,m.Cr)();if(!a)return!1;try{return process.kill(a,0),!0}catch(a){return!1}}},88035:(a,b,c)=>{c.d(b,{H4:()=>x,Jv:()=>u,Qn:()=>o,Rg:()=>t,cb:()=>s,mh:()=>v,oN:()=>p,rH:()=>w});var d=c(55511),e=c.n(d),f=c(19931),g=c(54495),h=c(13774),i=c(37770),j=c(50514),k=c(91160);(0,j.initDbHooks)(i.getSettings,i.Xx);let l=process.env.TUNNEL_WORKER_URL||"https://9router.com",m={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null},n={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function o(){return m}function p(){return n}async function q(a,b){await fetch(`${l}/api/tunnel/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shortId:a,tunnelUrl:b})})}function r(a,b){if(a.cancelled)throw Error(`${b} cancelled`)}async function s(a=20128){m.cancelToken={cancelled:!1},m.activeLocalPort=a,m.spawnInProgress=!0;let b=m.cancelToken;try{if((0,g.nN)()){let a=(0,f.C7)();if(a?.tunnelUrl&&await (0,k.$c)(a.tunnelUrl)){let b=`https://r${a.shortId}.9router.com`;return{success:!0,tunnelUrl:a.tunnelUrl,shortId:a.shortId,publicUrl:b,alreadyRunning:!0}}}(0,g.ss)(a),r(b,"tunnel");let d=function(){try{let{machineIdSync:a}=c(20243),b=a();return e().createHash("sha256").update(b+"9router-tunnel-salt").digest("hex").substring(0,16)}catch(a){return e().randomUUID().replace(/-/g,"").substring(0,16)}}(),h=(0,f.C7)(),j=h?.shortId||(0,f.jd)(),l=async a=>{b.cancelled||(await q(j,a),(0,f.LZ)({shortId:j,machineId:d,tunnelUrl:a}),await (0,i.Xx)({tunnelEnabled:!0,tunnelUrl:a}))},{tunnelUrl:m}=await (0,g.fn)(a,l);r(b,"tunnel");let n=`https://r${j}.9router.com`;return await q(j,m),(0,f.LZ)({shortId:j,machineId:d,tunnelUrl:m}),await (0,i.Xx)({tunnelEnabled:!0,tunnelUrl:m}),await (0,k.tm)(n,b),{success:!0,tunnelUrl:m,shortId:j,publicUrl:n}}finally{m.spawnInProgress=!1}}async function t(){m.cancelToken.cancelled=!0,(0,g.es)(null),(0,g.ss)(m.activeLocalPort);let a=(0,f.C7)();return a&&(0,f.LZ)({shortId:a.shortId,machineId:a.machineId,tunnelUrl:null}),await (0,i.Xx)({tunnelEnabled:!1,tunnelUrl:""}),{success:!0}}async function u(){let a=(0,f.C7)(),b=(0,g.nN)(),c=await (0,i.getSettings)(),d=a?.shortId||"",e=d?`https://r${d}.9router.com`:"";return{enabled:!0===c.tunnelEnabled&&b,settingsEnabled:!0===c.tunnelEnabled,tunnelUrl:a?.tunnelUrl||"",shortId:d,publicUrl:e,running:b}}async function v(a=20128){n.cancelToken={cancelled:!1},n.activeLocalPort=a,n.spawnInProgress=!0;let b=n.cancelToken;try{let c=(0,j.getCachedPassword)()||await (0,j.loadEncryptedPassword)()||"";await (0,h.OZ)(c),r(b,"tailscale");let d=(0,f.C7)(),e=d?.shortId||(0,f.jd)();if(!(0,h.a$)()){let a=await (0,h.c$)(e);if(a.authUrl)return{success:!1,needsLogin:!0,authUrl:a.authUrl}}r(b,"tailscale"),(0,h.PZ)();let g=await (0,h.LC)(a);if(r(b,"tailscale"),g.funnelNotEnabled)return{success:!1,funnelNotEnabled:!0,enableUrl:g.enableUrl};if(!(0,h.a$)()||!(0,h.Kp)())return(0,h.PZ)(),{success:!1,error:"Tailscale not connected. Device may have been removed. Please re-login."};return await (0,i.Xx)({tailscaleEnabled:!0,tailscaleUrl:g.tunnelUrl}),await (0,k.tm)(g.tunnelUrl,b),{success:!0,tunnelUrl:g.tunnelUrl}}finally{n.spawnInProgress=!1}}async function w(){return n.cancelToken.cancelled=!0,(0,h.PZ)(),await (0,i.Xx)({tailscaleEnabled:!1,tailscaleUrl:""}),{success:!0}}async function x(){let a=await (0,i.getSettings)(),b=(0,h.Kp)();return{enabled:!0===a.tailscaleEnabled&&b,settingsEnabled:!0===a.tailscaleEnabled,tunnelUrl:a.tailscaleUrl||"",running:b}}},91160:(a,b,c)=>{c.d(b,{$c:()=>l,tm:()=>m,u7:()=>j});var d=c(91645),e=c.n(d),f=c(14985),g=c.n(f),h=c(50304);let i=new(g()).promises.Resolver;function j(){return new Promise(a=>{let b=new(e()).Socket,c=!1,d=d=>{if(!c){c=!0;try{b.destroy()}catch{}a(d)}};b.setTimeout(h.t1.timeoutMs),b.once("connect",()=>d(!0)),b.once("timeout",()=>d(!1)),b.once("error",()=>d(!1));try{b.connect(h.t1.port,h.t1.host)}catch{d(!1)}})}async function k(a,b){try{return await Promise.race([i.resolve4(a),new Promise((a,c)=>setTimeout(()=>c(Error("dns timeout")),b))]),!0}catch{return!1}}async function l(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await k(b,h.Ux.dnsTimeoutMs))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(h.Ux.fetchTimeoutMs)})).ok}catch{return!1}}async function m(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<h.Ux.timeoutMs;){if(b.cancelled)throw Error("cancelled");if(await l(a))return!0;await new Promise(a=>setTimeout(a,h.Ux.intervalMs))}throw Error(`Health check timeout after ${h.Ux.timeoutMs}ms`)}i.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"])}};
1
+ "use strict";exports.id=8035,exports.ids=[8035],exports.modules={50304:(a,b,c)=>{c.d(b,{DA:()=>h,Lh:()=>f,Ux:()=>d,cw:()=>g,rI:()=>i,t1:()=>e});let d={intervalMs:2e3,timeoutMs:18e4,fetchTimeoutMs:5e3,dnsTimeoutMs:2e3},e={host:"1.1.1.1",port:443,timeoutMs:3e3},f=6e4,g=2500,h=6e4,i=5e3},54495:(a,b,c)=>{c.d(b,{Al:()=>A,Dd:()=>y,es:()=>E,fn:()=>F,nN:()=>H,ss:()=>G});var d=c(29021),e=c.n(d),f=c(33873),g=c.n(f),h=c(55591),i=c.n(h),j=c(21820),k=c.n(j),l=c(79646),m=c(19931),n=c(81372);let o=g().join(n.n,"bin"),p="cloudflared",q="win32"===k().platform(),r=q?`${p}.exe`:p,s=g().join(o,r),t="http2",u=new Set(["http2","quic","auto"]),v={darwin:{x64:"cloudflared-darwin-amd64.tgz",arm64:"cloudflared-darwin-arm64.tgz"},win32:{x64:"cloudflared-windows-amd64.exe",ia32:"cloudflared-windows-386.exe",arm64:"cloudflared-windows-386.exe"},linux:{x64:"cloudflared-linux-amd64",arm64:"cloudflared-linux-arm64"}},w={darwin:"cloudflared-darwin-amd64.tgz",win32:"cloudflared-windows-386.exe",linux:"cloudflared-linux-amd64"},x={downloading:!1,progress:0};function y(){return{downloading:x.downloading,progress:x.progress}}let z=null;async function A(){return z||(z=B().finally(()=>{z=null}))}async function B(){e().existsSync(o)||e().mkdirSync(o,{recursive:!0});let a=`${s}.tmp`;if(e().existsSync(a))try{e().unlinkSync(a)}catch{}if(e().existsSync(s))if(function(a){try{if(e().statSync(a).size<1048576)return!1;let b=e().openSync(a,"r"),c=Buffer.alloc(4);e().readSync(b,c,0,4,0),e().closeSync(b);let d=c.toString("hex");if(q)return d.startsWith("4d5a");if("darwin"===k().platform())return d.startsWith("cffaedfe")||d.startsWith("cefaedfe");return d.startsWith("7f454c46")}catch{return!1}}(s))return q||e().chmodSync(s,"755"),s;else console.log("[cloudflared] Invalid binary detected, re-downloading..."),e().unlinkSync(s);let b=function(){let a=k().platform(),b=k().arch(),c=v[a];if(!c)throw Error(`Unsupported platform: ${a}`);let d=c[b]||w[a];return`https://github.com/cloudflare/cloudflared/releases/latest/download/${d}`}(),c=b.endsWith(".tgz"),d=c?g().join(o,"cloudflared.tgz.tmp"):a;return await function a(b,c){return new Promise((d,f)=>{let g=e().createWriteStream(c);i().get(b,b=>{if([301,302,303,307,308].includes(b.statusCode)){g.close(),e().unlinkSync(c),a(b.headers.location,c).then(d).catch(f);return}if(200!==b.statusCode){g.close(),e().unlinkSync(c),f(Error(`Download failed with status ${b.statusCode}`));return}let h=parseInt(b.headers["content-length"],10)||0,i=0;x.downloading=!0,x.progress=0,b.on("data",a=>{i+=a.length,h>0&&(x.progress=Math.round(i/h*100))}),b.pipe(g),g.on("finish",()=>{x.downloading=!1,x.progress=100,g.close(()=>d(c))}),g.on("error",a=>{x.downloading=!1,x.progress=0,g.close(),e().unlinkSync(c),f(a)})}).on("error",a=>{x.downloading=!1,x.progress=0,g.close(),e().existsSync(c)&&e().unlinkSync(c),f(a)})})}(b,d),c?((0,l.execSync)(`tar -xzf "${d}" -C "${o}"`,{stdio:"pipe",windowsHide:!0}),e().unlinkSync(d)):e().renameSync(d,s),q||e().chmodSync(s,"755"),s}let C=null,D=null;function E(a){D=a}async function F(a,b){let c=await A(),d=e().mkdtempSync(g().join(k().tmpdir(),"cloudflared-quick-")),f=g().join(d,"config.yml");e().writeFileSync(f,"# quick-tunnel config placeholder\n","utf8");let h=!1,i=()=>{if(!h){h=!0;try{e().rmSync(d,{recursive:!0,force:!0})}catch(a){}}},j=String(process.env.TUNNEL_TRANSPORT_PROTOCOL||process.env.CLOUDFLARED_PROTOCOL||t).trim().toLowerCase(),n=u.has(j)?j:t,o=(0,l.spawn)(c,["tunnel","--url",`http://127.0.0.1:${a}`,"--config",f,"--no-autoupdate"],{detached:!1,windowsHide:!0,env:{...process.env,TUNNEL_TRANSPORT_PROTOCOL:n},stdio:["ignore","pipe","pipe"]});return C=o,(0,m.xS)(o.pid),new Promise((a,c)=>{let d=!1,e=setTimeout(()=>{d||(d=!0,i(),c(Error("Quick tunnel timed out")))},9e4),f=null,g=c=>{let g=function(a){let b=[];for(let c of a.matchAll(/https:\/\/([a-z0-9-]+)\.trycloudflare\.com/gi)){let a=c[1];"api"!==a&&b.push(`https://${a}.trycloudflare.com`)}return b.length?b[b.length-1]:null}(c.toString());if(g){if(!d){d=!0,f=g,clearTimeout(e),i(),a({child:o,tunnelUrl:g});return}g!==f&&(f=g,b&&b(g))}};o.stdout.on("data",g),o.stderr.on("data",g),o.on("error",a=>{d||(d=!0,clearTimeout(e),i(),c(a))}),o.on("exit",(a,b)=>{if(C=null,(0,m.r4)(),!d){d=!0,clearTimeout(e),i(),1===a?c(Error(`cloudflared exited with code ${a}. This often means: (1) the tunnel token is invalid or expired, (2) network connectivity issues, or (3) cloudflared cannot reach the local server.`)):2===a?c(Error(`cloudflared exited with code ${a}. Check that arguments are correct.`)):c(Error(`cloudflared exited with code ${a}`));return}D&&D(),i()})})}function G(a){if(C){try{C.kill()}catch(a){}C=null}let b=(0,m.Cr)();if(b){try{process.kill(b)}catch(a){}(0,m.r4)()}if(a)try{if(q){let b=`Get-CimInstance Win32_Process -Filter \\"Name='cloudflared.exe'\\" | Where-Object { $_.CommandLine -match ':${a}(\\D|$)' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`;(0,l.execSync)(`powershell -NoProfile -NonInteractive -WindowStyle Hidden -Command "${b}"`,{stdio:"ignore",windowsHide:!0})}else(0,l.execSync)(`pkill -f "cloudflared.*:${a}([^0-9]|$)" 2>/dev/null || true`,{stdio:"ignore",windowsHide:!0})}catch(a){}}function H(){let a=(0,m.Cr)();if(!a)return!1;try{return process.kill(a,0),!0}catch(a){return!1}}},88035:(a,b,c)=>{c.d(b,{H4:()=>x,Jv:()=>u,Qn:()=>o,Rg:()=>t,cb:()=>s,mh:()=>v,oN:()=>p,rH:()=>w});var d=c(55511),e=c.n(d),f=c(19931),g=c(54495),h=c(13774),i=c(37770),j=c(50514),k=c(91160);(0,j.initDbHooks)(i.getSettings,i.Xx);let l=process.env.TUNNEL_WORKER_URL||"https://9router.com",m={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null},n={cancelToken:{cancelled:!1},spawnInProgress:!1,lastRestartAt:0,activeLocalPort:null};function o(){return m}function p(){return n}async function q(a,b){await fetch(`${l}/api/tunnel/register`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({shortId:a,tunnelUrl:b})})}function r(a,b){if(a.cancelled)throw Error(`${b} cancelled`)}async function s(a=20128){m.cancelToken={cancelled:!1},m.activeLocalPort=a,m.spawnInProgress=!0;let b=m.cancelToken;try{if((0,g.nN)()){let a=(0,f.C7)();if(a?.tunnelUrl&&await (0,k.$c)(a.tunnelUrl)){let b=`https://r${a.shortId}.9router.com`;return{success:!0,tunnelUrl:a.tunnelUrl,shortId:a.shortId,publicUrl:b,alreadyRunning:!0}}}(0,g.ss)(a),r(b,"tunnel");let d=function(){try{let{machineIdSync:a}=c(20243),b=a();return e().createHash("sha256").update(b+"9router-tunnel-salt").digest("hex").substring(0,16)}catch(a){return e().randomUUID().replace(/-/g,"").substring(0,16)}}(),h=(0,f.C7)(),j=h?.shortId||(0,f.jd)(),l=async a=>{b.cancelled||(await q(j,a),(0,f.LZ)({shortId:j,machineId:d,tunnelUrl:a}),await (0,i.Xx)({tunnelEnabled:!0,tunnelUrl:a}))},{tunnelUrl:m}=await (0,g.fn)(a,l);r(b,"tunnel");let n=`https://r${j}.9router.com`;return await q(j,m),(0,f.LZ)({shortId:j,machineId:d,tunnelUrl:m}),await (0,i.Xx)({tunnelEnabled:!0,tunnelUrl:m}),await (0,k.tm)(n,b),{success:!0,tunnelUrl:m,shortId:j,publicUrl:n}}finally{m.spawnInProgress=!1}}async function t(){m.cancelToken.cancelled=!0,(0,g.es)(null),(0,g.ss)(m.activeLocalPort);let a=(0,f.C7)();return a&&(0,f.LZ)({shortId:a.shortId,machineId:a.machineId,tunnelUrl:null}),await (0,i.Xx)({tunnelEnabled:!1,tunnelUrl:""}),{success:!0}}async function u(){let a=(0,f.C7)(),b=(0,g.nN)(),c=await (0,i.getSettings)(),d=a?.shortId||"",e=d?`https://r${d}.9router.com`:"";return{enabled:!0===c.tunnelEnabled&&b,settingsEnabled:!0===c.tunnelEnabled,tunnelUrl:a?.tunnelUrl||"",shortId:d,publicUrl:e,running:b}}async function v(a=20128){n.cancelToken={cancelled:!1},n.activeLocalPort=a,n.spawnInProgress=!0;let b=n.cancelToken;try{let c=(0,j.getCachedPassword)()||await (0,j.loadEncryptedPassword)()||"";await (0,h.OZ)(c),r(b,"tailscale");let d=(0,f.C7)(),e=d?.shortId||(0,f.jd)();if(!(0,h.a$)()){let a=await (0,h.c$)(e);if(a.authUrl)return{success:!1,needsLogin:!0,authUrl:a.authUrl}}r(b,"tailscale"),(0,h.PZ)();let g=await (0,h.LC)(a);if(r(b,"tailscale"),g.funnelNotEnabled)return{success:!1,funnelNotEnabled:!0,enableUrl:g.enableUrl};if(!(0,h.a$)()||!(0,h.Kp)())return(0,h.PZ)(),{success:!1,error:"Tailscale not connected. Device may have been removed. Please re-login."};return await (0,i.Xx)({tailscaleEnabled:!0,tailscaleUrl:g.tunnelUrl}),await (0,k.tm)(g.tunnelUrl,b),{success:!0,tunnelUrl:g.tunnelUrl}}finally{n.spawnInProgress=!1}}async function w(){return n.cancelToken.cancelled=!0,(0,h.PZ)(),await (0,i.Xx)({tailscaleEnabled:!1,tailscaleUrl:""}),{success:!0}}async function x(){let a=await (0,i.getSettings)(),b=(0,h.Kp)();return{enabled:!0===a.tailscaleEnabled&&b,settingsEnabled:!0===a.tailscaleEnabled,tunnelUrl:a.tailscaleUrl||"",running:b}}},91160:(a,b,c)=>{c.d(b,{$c:()=>l,tm:()=>m,u7:()=>j});var d=c(91645),e=c.n(d),f=c(14985),g=c.n(f),h=c(50304);let i=new(g()).promises.Resolver;function j(){return new Promise(a=>{let b=new(e()).Socket,c=!1,d=d=>{if(!c){c=!0;try{b.destroy()}catch{}a(d)}};b.setTimeout(h.t1.timeoutMs),b.once("connect",()=>d(!0)),b.once("timeout",()=>d(!1)),b.once("error",()=>d(!1));try{b.connect(h.t1.port,h.t1.host)}catch{d(!1)}})}async function k(a,b){try{return await Promise.race([i.resolve4(a),new Promise((a,c)=>setTimeout(()=>c(Error("dns timeout")),b))]),!0}catch{return!1}}async function l(a){let b;if(!a)return!1;try{b=new URL(a).hostname}catch{return!1}if(!await k(b,h.Ux.dnsTimeoutMs))return!1;try{return(await fetch(`${a}/api/health`,{signal:AbortSignal.timeout(h.Ux.fetchTimeoutMs)})).ok}catch{return!1}}async function m(a,b={cancelled:!1}){let c=Date.now();for(;Date.now()-c<h.Ux.timeoutMs;){if(b.cancelled)throw Error("cancelled");if(await l(a))return!0;await new Promise(a=>setTimeout(a,h.Ux.intervalMs))}throw Error(`Health check timeout after ${h.Ux.timeoutMs}ms`)}i.setServers(["1.1.1.1","1.0.0.1","8.8.8.8"])}};