vansrouter 0.9.63 → 0.9.71

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 (676) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +13 -13
  3. package/app/.next-cli-build/build-manifest.json +3 -3
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/react-loadable-manifest.json +5 -5
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +5 -5
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  78. package/app/.next-cli-build/server/app/_global-error.rsc +2 -2
  79. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +2 -2
  80. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +2 -2
  85. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  88. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  89. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  90. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  91. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  92. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  93. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  95. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  96. package/app/.next-cli-build/server/app/api/auth/check/route.js +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/check/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +17 -12
  113. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  119. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  121. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +2 -2
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +2 -2
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  133. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  135. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +15 -10
  137. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  139. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  143. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  145. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +2 -2
  147. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  160. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  165. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  167. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  176. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  180. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  198. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js +1 -1
  226. package/app/.next-cli-build/server/app/api/providers/[id]/gcp-projects/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/[name]/reset/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/providers/circuit-breakers/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  239. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  240. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  244. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  245. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  246. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  247. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  248. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  249. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  250. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  251. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  252. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  253. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  254. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  255. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  256. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  257. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  258. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  259. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  264. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
  265. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  266. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  270. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  271. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  272. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  278. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  284. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  300. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  302. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  303. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  304. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  305. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/usage/request-details/[id]/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  365. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  367. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  368. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  369. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  370. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  371. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  372. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  373. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  374. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  375. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  376. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  377. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  378. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  379. package/app/.next-cli-build/server/app/callback.html +1 -1
  380. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  381. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  382. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  383. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  384. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  385. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  386. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  389. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  394. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  396. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  397. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  399. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  400. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  403. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  404. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  406. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  407. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  409. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  410. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  412. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  413. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  414. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  416. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  417. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  419. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  420. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  422. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  424. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  426. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  427. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  428. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  429. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  430. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  435. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  437. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  439. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +7 -7
  440. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  444. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +7 -7
  445. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +5 -5
  447. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  448. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  449. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  450. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  451. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  452. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  454. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  455. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  456. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  457. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  458. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  460. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  463. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  465. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  466. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  467. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  468. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  469. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  470. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  472. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  473. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  475. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  476. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  477. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  478. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  479. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  485. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  486. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  487. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  488. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  489. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  490. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +7 -7
  491. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  492. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  493. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  495. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +7 -7
  496. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +5 -5
  498. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  501. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  502. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  503. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  505. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  506. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  508. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +5 -5
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  515. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  517. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  522. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  524. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  525. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  527. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  528. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  529. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  531. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  532. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +7 -7
  534. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  535. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  537. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  538. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +7 -7
  539. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  540. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  541. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  542. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  543. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  544. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  545. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  547. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  549. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  550. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  551. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  552. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  553. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  554. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  555. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  556. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  557. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  559. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  560. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  561. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  562. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  563. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  564. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  565. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  568. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  570. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  571. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  572. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  573. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  574. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  575. package/app/.next-cli-build/server/app/landing.html +1 -1
  576. package/app/.next-cli-build/server/app/landing.rsc +6 -6
  577. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +6 -6
  578. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  580. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  581. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  582. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  583. package/app/.next-cli-build/server/app/login/page.js +1 -1
  584. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  585. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  586. package/app/.next-cli-build/server/app/login.html +1 -1
  587. package/app/.next-cli-build/server/app/login.rsc +6 -6
  588. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  589. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  590. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  591. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  592. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  593. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  594. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  595. package/app/.next-cli-build/server/app/masuk/page.js +1 -1
  596. package/app/.next-cli-build/server/app/masuk/page.js.nft.json +1 -1
  597. package/app/.next-cli-build/server/app/masuk/page_client-reference-manifest.js +1 -1
  598. package/app/.next-cli-build/server/app-paths-manifest.json +13 -13
  599. package/app/.next-cli-build/server/chunks/1253.js +1 -1
  600. package/app/.next-cli-build/server/chunks/1558.js +1 -0
  601. package/app/.next-cli-build/server/chunks/2445.js +1 -1
  602. package/app/.next-cli-build/server/chunks/2557.js +2 -2
  603. package/app/.next-cli-build/server/chunks/32.js +1 -1
  604. package/app/.next-cli-build/server/chunks/3235.js +10 -0
  605. package/app/.next-cli-build/server/chunks/3736.js +1 -1
  606. package/app/.next-cli-build/server/chunks/3813.js +1 -0
  607. package/app/.next-cli-build/server/chunks/383.js +1 -1
  608. package/app/.next-cli-build/server/chunks/3969.js +16 -9
  609. package/app/.next-cli-build/server/chunks/4029.js +3 -3
  610. package/app/.next-cli-build/server/chunks/4105.js +1 -1
  611. package/app/.next-cli-build/server/chunks/4203.js +1 -0
  612. package/app/.next-cli-build/server/chunks/4574.js +10 -26
  613. package/app/.next-cli-build/server/chunks/4836.js +1 -1
  614. package/app/.next-cli-build/server/chunks/5006.js +2 -2
  615. package/app/.next-cli-build/server/chunks/5009.js +1 -1
  616. package/app/.next-cli-build/server/chunks/5198.js +1 -0
  617. package/app/.next-cli-build/server/chunks/5300.js +1 -1
  618. package/app/.next-cli-build/server/chunks/5302.js +1 -1
  619. package/app/.next-cli-build/server/chunks/5577.js +1 -1
  620. package/app/.next-cli-build/server/chunks/6385.js +1 -1
  621. package/app/.next-cli-build/server/chunks/6584.js +1 -0
  622. package/app/.next-cli-build/server/chunks/7216.js +1 -0
  623. package/app/.next-cli-build/server/chunks/740.js +1 -0
  624. package/app/.next-cli-build/server/chunks/8171.js +1 -1
  625. package/app/.next-cli-build/server/chunks/{6723.js → 8385.js} +1 -1
  626. package/app/.next-cli-build/server/chunks/8574.js +1 -0
  627. package/app/.next-cli-build/server/chunks/8711.js +1 -1
  628. package/app/.next-cli-build/server/chunks/8765.js +1 -1
  629. package/app/.next-cli-build/server/chunks/893.js +1 -0
  630. package/app/.next-cli-build/server/chunks/9212.js +7 -7
  631. package/app/.next-cli-build/server/chunks/935.js +1 -0
  632. package/app/.next-cli-build/server/chunks/9607.js +1 -1
  633. package/app/.next-cli-build/server/chunks/9614.js +3 -3
  634. package/app/.next-cli-build/server/chunks/9633.js +1 -1
  635. package/app/.next-cli-build/server/chunks/9984.js +1 -1
  636. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  637. package/app/.next-cli-build/server/middleware-react-loadable-manifest.js +1 -1
  638. package/app/.next-cli-build/server/pages/404.html +1 -1
  639. package/app/.next-cli-build/server/pages/500.html +1 -1
  640. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  641. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  642. package/app/.next-cli-build/static/chunks/{1049.7963aa5d17354a22.js → 1049.adc9916d5a6b95f8.js} +3 -3
  643. package/app/.next-cli-build/static/chunks/2940-48989ef09fe01727.js +1 -0
  644. package/app/.next-cli-build/static/chunks/4385-f8d0890bcd2c8690.js +1 -0
  645. package/app/.next-cli-build/static/chunks/5331.049b1512362de1f4.js +1 -0
  646. package/app/.next-cli-build/static/chunks/{5479-c46d5dd0b4a7c54c.js → 5479-1eae6e4ed4867f26.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/{7617-5e8db3f89d044083.js → 7617-ed9e49c9d0a3ac0f.js} +21 -14
  648. package/app/.next-cli-build/static/chunks/9078.ea6aeb4af0c25e5d.js +7 -0
  649. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-ed06db06e443e758.js → page-1f06b0306077df0d.js} +1 -1
  650. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-a57f2bc58839b8ae.js → page-098e5884b208fa2b.js} +1 -1
  651. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a72ed093152d7a72.js +12 -0
  652. package/app/.next-cli-build/static/chunks/app/landing/page-775bf0f40a06728d.js +1 -0
  653. package/app/.next-cli-build/static/chunks/{webpack-bd29069ed9367e6a.js → webpack-bc04f378a1088de3.js} +1 -1
  654. package/app/.next-cli-build/static/css/04cdd30b78c3f748.css +1 -0
  655. package/app/package.json +1 -1
  656. package/app/public/providers/tokenrouter.webp +0 -0
  657. package/app/public/providers/zenmux.webp +0 -0
  658. package/package.json +1 -1
  659. package/app/.next-cli-build/server/chunks/2365.js +0 -1
  660. package/app/.next-cli-build/server/chunks/3473.js +0 -10
  661. package/app/.next-cli-build/server/chunks/6519.js +0 -1
  662. package/app/.next-cli-build/server/chunks/6767.js +0 -1
  663. package/app/.next-cli-build/server/chunks/6824.js +0 -1
  664. package/app/.next-cli-build/server/chunks/8493.js +0 -1
  665. package/app/.next-cli-build/server/chunks/874.js +0 -1
  666. package/app/.next-cli-build/server/chunks/9541.js +0 -1
  667. package/app/.next-cli-build/server/chunks/9673.js +0 -1
  668. package/app/.next-cli-build/static/chunks/2940-5acfc7ddadd12323.js +0 -1
  669. package/app/.next-cli-build/static/chunks/4385-e5370f042a008012.js +0 -1
  670. package/app/.next-cli-build/static/chunks/5331.f8686056a7f7a65b.js +0 -1
  671. package/app/.next-cli-build/static/chunks/9078.38c599e95c240357.js +0 -7
  672. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-d3f02f432d21e3c4.js +0 -12
  673. package/app/.next-cli-build/static/chunks/app/landing/page-48842432e2deff17.js +0 -1
  674. package/app/.next-cli-build/static/css/10c9ef6746089099.css +0 -1
  675. /package/app/.next-cli-build/static/{mZVv8KY04HLew9bB1j0W4 → DyCA8QWmMwHq8zuzERHLA}/_buildManifest.js +0 -0
  676. /package/app/.next-cli-build/static/{mZVv8KY04HLew9bB1j0W4 → DyCA8QWmMwHq8zuzERHLA}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- "use strict";exports.id=3969,exports.ids=[3969],exports.modules={61126:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},63969:(a,b,c)=>{c.d(b,{Tk:()=>v,aG:()=>X,Ah:()=>x,h1:()=>V,Q6:()=>T,lF:()=>aa,a7:()=>L,ZM:()=>A,E_:()=>ag,RF:()=>G,mW:()=>ad,c9:()=>Z,tA:()=>aj,kn:()=>ao,yZ:()=>D,qO:()=>O});var d=c(66238),e=c(71183),f=c(43736),g=c(15901),h=c(13717);let i="__custom__",j="__save__",k=()=>[],l=a=>{},m=({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};function n({value:a,onChange:b,requiresExternalUrl:c=!1,tunnelEnabled:f=!1,tunnelPublicUrl:g="",tailscaleEnabled:h=!1,tailscaleUrl:o="",cloudEnabled:p=!1,cloudUrl:q="",withV1:r=!0}){let[s,t]=(0,e.useState)(k),[u,v]=(0,e.useState)("");(0,e.useRef)(!1);let w=(0,e.useMemo)(()=>m({requiresExternalUrl:c,tunnelEnabled:f,tunnelPublicUrl:g,tailscaleEnabled:h,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,savedPresets:s,withV1:r}),[c,f,g,h,o,p,q,s,r]),[x,y]=(0,e.useState)(()=>{let a=m({requiresExternalUrl:c,tunnelEnabled:f,tunnelPublicUrl:g,tailscaleEnabled:h,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,savedPresets:k(),withV1:r}).find(a=>a.value!==i);return a?a.value:i});(0,e.useRef)(b);let z=x.startsWith("saved:"),A=x===i,B=A&&(u||"").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:x,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=[...s.filter(a=>a.name!==d.trim()),{name:d.trim(),baseUrl:b}].sort((a,b)=>a.name.localeCompare(b.name));t(e),l(e);return}if(y(d),d===i){v(""),b("");return}let e=w.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:[w.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value)),B&&(0,d.jsx)("option",{value:j,children:"+ Save current as..."})]}),z&&(0,d.jsx)("button",{type:"button",onClick:()=>{if(!x.startsWith("saved:"))return;let a=x.slice(6),c=s.filter(b=>b.name!==a);t(c),l(c),y(i),v(""),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"})})]}),A&&(0,d.jsx)("input",{type:"text",value:u,onChange:a=>{let c=a.target.value;v(c),b(c)},placeholder:r?"https://example.com/v1":"https://example.com","aria-label":"Custom base URL",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 o="__custom__",p=[];function q({value:a,onChange:b,apiKeys:c=p,cloudEnabled:f=!1,className:g=""}){let h=!c.some(b=>b.key===a)&&""!==a,[i,j]=(0,e.useState)(()=>a?c.some(b=>b.key===a)?a:o:c.length>0?c[0].key:o),[k,l]=(0,e.useState)(h?a:"");return 0===c.length&&i!==o&&i!==o?(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 ${g}`,children:f?"No API keys - Create one in Keys page":"sk_9router (default)"}):(0,d.jsxs)("div",{className:`flex flex-col gap-1.5 ${g}`,children:[(0,d.jsxs)("select",{value:i,onChange:a=>{let c=a.target.value;j(c),c===o?(l(""),b("")):b(c)},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:[c.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id)),(0,d.jsx)("option",{value:o,children:"Custom..."})]}),i===o&&(0,d.jsx)("input",{type:"text",value:k,onChange:a=>{let c=a.target.value;l(c),b(c)},placeholder:"sk-...","aria-label":"Custom API key",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 r=a=>(a||"").replace(/\/+$/,"");function s(a,b={}){if(!a)return!1;let c=r(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(r(d))||e&&c.startsWith(r(e))||f&&c.startsWith(r(f)))}let t=process.env.NEXT_PUBLIC_CLOUD_URL;function u({applying:a,apiKeys:b,ccFilterNaming:c,checkingClaude:e,cloudEnabled:g,claudeStatus:h,customBaseUrl:i,getDisplayUrl:j,handleApplySettings:k,handleCcFilterNamingToggle:l,handleResetSettings:m,hasActiveProviders:o,message:p,modelMappings:r,onModelMappingChange:s,openModelSelector:t,restoring:v,selectedApiKey:w,setCustomBaseUrl:x,setSelectedApiKey:y,setShowInstallGuide:z,setShowManualConfigModal:A,showInstallGuide:B,tailscaleEnabled:C,tailscaleUrl:D,tool:E,tunnelEnabled:F,tunnelPublicUrl:G}){return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[e&&(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..."})]}),!e&&h&&!h.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 VansAI is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.Button,{variant:"secondary",size:"sm",onClick:()=>A(!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.Button,{variant:"outline",size:"sm",onClick:()=>z(!B),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:B?"expand_less":"help"}),B?"Hide":"How to Install"]})]})]}),B&&(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."]})]})]})]}),!e&&h?.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)(n,{value:i||j(),onChange:x,requiresExternalUrl:E.requiresExternalUrl,tunnelEnabled:F,tunnelPublicUrl:G,tailscaleEnabled:C,tailscaleUrl:D})]}),h?.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:h.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"}),(0,d.jsx)(q,{value:w,onChange:y,apiKeys:b,cloudEnabled:g})]}),E.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:r[a.alias]||"",onChange:b=>s(a.alias,b.target.value),"aria-label":"Model ID",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"}),r[a.alias]&&(0,d.jsx)("button",{type:"button",onClick:()=>s(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",{type:"button",onClick:()=>t(a.alias),disabled:!o,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 ${o?"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:c,onChange:l,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.Tooltip,{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"})})]})]})]}),p&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===p.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"===p.type?"check_circle":"error"}),(0,d.jsx)("span",{children:p.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.Button,{variant:"primary",size:"sm",onClick:k,disabled:!o,loading:a,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:m,disabled:!h?.hasVansRoute,loading:v,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.Button,{variant:"ghost",size:"sm",onClick:()=>A(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]})}function v({tool:a,isExpanded:b,onToggle:c,activeProviders:h,modelMappings:i,onModelMappingChange:j,baseUrl:k,hasActiveProviders:l,apiKeys:m,cloudEnabled:n,initialStatus:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:w}){let x,y,[z,A]=(0,e.useReducer)((a,b)=>{switch(b.type){case"CHECK_START":return{...a,checking:!0};case"CHECK_DONE":return{...a,status:b.data,checking:!1};case"APPLY_START":return{...a,applying:!0,message:null};case"APPLY_DONE":return{...a,applying:!1,message:b.message};case"RESTORE_START":return{...a,restoring:!0,message:null};case"RESTORE_DONE":return{...a,restoring:!1,message:b.message};default:return a}},{status:o||null,checking:!1,applying:!1,restoring:!1,message:null}),B=z.status,C=z.checking,{applying:D,restoring:E,message:F}=z,[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(null),[M,N]=(0,e.useState)(null),O=B?.settings?.env?.ANTHROPIC_AUTH_TOKEN,P=O&&m?.some(a=>a.key===O)?O:null,Q=M??P??(m?.length>0?m[0].key:""),[R,S]=(0,e.useState)({}),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(!1);(0,e.useRef)(!1);let Z=(()=>{if(!B?.installed)return null;let a=B.settings?.env?.ANTHROPIC_BASE_URL;return a?s(a,{tunnelPublicUrl:q,tailscaleUrl:w,cloudUrl:n?t:null})?"configured":"other":"not_configured"})(),$=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&S(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}},[]),_=(0,e.useCallback)(async()=>{A({type:"CHECK_START"});try{let a=await fetch("/api/cli-tools/claude-settings"),b=await a.json();A({type:"CHECK_DONE",data:b})}catch(a){A({type:"CHECK_DONE",data:{installed:!1,error:a.message}})}},[]),aa=(0,e.useRef)(!!o),ab=(0,e.useRef)(!1),ac=(0,e.useCallback)(async()=>{aa.current||(aa.current=!0,await _()),ab.current||(ab.current=!0,await $())},[_,$]),ad=(0,e.useCallback)(()=>{b||ac(),c()},[b,ac,c]),ae=async a=>{let b=a.target.checked;Y(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},af=()=>{let a=V||k;return a.endsWith("/v1")?a:`${a}/v1`},ag=async()=>{A({type:"APPLY_START"});try{let b={ANTHROPIC_BASE_URL:af()},c=Q?.trim()||(m?.length>0?m[0].key:null)||(n?null:"sk_VansRoute");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?(A({type:"APPLY_DONE",message:{type:"success",text:"Settings applied successfully!"}}),A({type:"CHECK_DONE",data:{...B,hasBackup:!0,settings:{...B?.settings,env:b}}})):A({type:"APPLY_DONE",message:{type:"error",text:e.error||"Failed to apply settings"}})}catch(a){A({type:"APPLY_DONE",message:{type:"error",text:a.message}})}},ah=async()=>{A({type:"RESTORE_START"});try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(A({type:"RESTORE_DONE",message:{type:"success",text:"Settings reset successfully!"}}),a.defaultModels.forEach(a=>j(a.alias,a.defaultValue||"")),N("")):A({type:"RESTORE_DONE",message:{type:"error",text:c.error||"Failed to reset settings"}})}catch(a){A({type:"RESTORE_DONE",message:{type:"error",text:a.message}})}};return(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:ad,"aria-expanded":b,"aria-label":"Toggle section",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.webp",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.jsx)(u,{applying:D,apiKeys:m,ccFilterNaming:X,checkingClaude:C,cloudEnabled:n,claudeStatus:B,customBaseUrl:V,getDisplayUrl:()=>{let a=V||k;return a.endsWith("/v1")?a:`${a}/v1`},handleApplySettings:ag,handleCcFilterNamingToggle:ae,handleResetSettings:ah,hasActiveProviders:l,message:F,modelMappings:i,onModelMappingChange:j,openModelSelector:a=>{L(a),J(!0)},restoring:E,selectedApiKey:Q,setCustomBaseUrl:W,setSelectedApiKey:N,setShowInstallGuide:H,setShowManualConfigModal:U,showInstallGuide:G,tailscaleEnabled:r,tailscaleUrl:w,tool:a,tunnelEnabled:p,tunnelPublicUrl:q}),(0,d.jsx)(f.ModelSelectModal,{isOpen:I,onClose:()=>J(!1),onSelect:a=>{K&&j(K,a.value)},selectedModel:K?i[K]:null,activeProviders:h,modelAliases:R,title:`Select model for ${K}`}),(0,d.jsx)(f.ManualConfigModal,{isOpen:T,onClose:()=>U(!1),title:"Claude CLI - Manual Configuration",configs:(x=Q&&Q.trim()?Q:n?"<API_KEY_FROM_DASHBOARD>":"sk_VansRoute",y={ANTHROPIC_BASE_URL:af(),ANTHROPIC_AUTH_TOKEN:x},a.defaultModels.forEach(a=>{let b=i[a.alias];b&&a.envKey&&(y[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:y},null,2)}])})]})}function w({activeProviders:a,apiKeys:b,applying:c,checkingCodex:e,cloudEnabled:g,codexStatus:h,customBaseUrl:i,getDisplayUrl:j,handleApplySettings:k,handleResetSettings:l,message:m,restoring:o,selectedApiKey:p,selectedModel:r,setCustomBaseUrl:s,setModalOpen:t,setSelectedApiKey:u,setSelectedModel:v,setShowInstallGuide:x,setShowManualConfigModal:y,setSubagentModalOpen:z,setSubagentModel:A,showInstallGuide:B,subagentModel:C,tailscaleEnabled:D,tailscaleUrl:E,tool:F,tunnelEnabled:G,tunnelPublicUrl:H}){let I,J;return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[e&&(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..."})]}),!e&&h&&!h.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 VansAI is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.Button,{variant:"secondary",size:"sm",onClick:()=>y(!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.Button,{variant:"outline",size:"sm",onClick:()=>x(!B),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:B?"expand_less":"help"}),B?"Hide":"How to Install"]})]})]}),B&&(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.']})})]})]})]}),!e&&h?.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)(n,{value:i||j(),onChange:s,requiresExternalUrl:F.requiresExternalUrl,tunnelEnabled:G,tunnelPublicUrl:H,tailscaleEnabled:D,tailscaleUrl:E})]}),h?.config&&((J=(I=h.config.match(/base_url\s*=\s*"([^"]+)"/))?I[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:J})]}):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"}),(0,d.jsx)(q,{value:p,onChange:u,apiKeys:b,cloudEnabled:g})]}),(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:r,onChange:a=>v(a.target.value),"aria-label":"Model ID",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"}),r&&(0,d.jsx)("button",{type:"button",onClick:()=>v(""),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",{type:"button",onClick:()=>t(!0),disabled:!a?.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 ${a?.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:C,onChange:a=>A(a.target.value),placeholder:r||"provider/model-id (defaults to main model)","aria-label":"Subagent 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"}),C&&(0,d.jsx)("button",{type:"button",onClick:()=>A(""),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",{type:"button",onClick:()=>z(!0),disabled:!a?.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 ${a?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),m&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===m.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"===m.type?"check_circle":"error"}),(0,d.jsx)("span",{children:m.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.Button,{variant:"primary",size:"sm",onClick:k,disabled:!p&&g&&b.length>0||!r,loading:c,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:l,disabled:o,loading:o,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.Button,{variant:"ghost",size:"sm",onClick:()=>y(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]})}function x({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l,tunnelEnabled:m,tunnelPublicUrl:n,tailscaleEnabled:o,tailscaleUrl:p}){let q,r,[t,u]=(0,e.useReducer)((a,b)=>{switch(b.type){case"CHECK_START":return{...a,checking:!0};case"CHECK_DONE":return{...a,status:b.data,checking:!1};case"APPLY_START":return{...a,applying:!0,message:null};case"APPLY_DONE":return{...a,applying:!1,message:b.message};case"RESTORE_START":return{...a,restoring:!0,message:null};case"RESTORE_DONE":return{...a,restoring:!1,message:b.message};default:return a}},{status:l||null,checking:!1,applying:!1,restoring:!1,message:null}),v=t.status,y=t.checking,{applying:z,restoring:A,message:B}=t,[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),G=E??(i?.length>0?i[0].key:""),[H,I]=(0,e.useState)(null),J=H??(()=>{if(v?.config){let a=v.config.match(/^model\s*=\s*"([^"]+)"/m);if(a)return a[1]}return""})(),[K,L]=(0,e.useState)(null),M=K??(()=>{if(v?.config){let a=v.config.match(/\[agents\.subagent\]\s*\n\s*model\s*=\s*"([^"]+)"/m);if(a)return a[1]}return""})(),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)({}),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(""),X=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&S(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}},[]),Y=(0,e.useCallback)(async()=>{u({type:"CHECK_START"});try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();u({type:"CHECK_DONE",data:b})}catch(a){u({type:"CHECK_DONE",data:{installed:!1,error:a.message}})}},[]),Z=(0,e.useRef)(!!l),$=(0,e.useRef)(!1),_=(0,e.useCallback)(async()=>{Z.current||(Z.current=!0,await Y()),$.current||($.current=!0,await X())},[Y,X]),aa=(0,e.useCallback)(()=>{b||_(),c()},[b,_,c]),ab=(()=>{if(!v?.installed)return null;if(!v.config)return"not_configured";let a=v.config.match(/base_url\s*=\s*"([^"]+)"/);return s(a?a[1]:"",{tunnelPublicUrl:n,tailscaleUrl:p})?"configured":"other"})(),ac=()=>{let a=V||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ad=async()=>{u({type:"APPLY_START"});try{let a=G&&G.trim()||k?G:"sk_VansRoute",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ac(),apiKey:a,model:J,subagentModel:M||J})}),c=await b.json();b.ok?(u({type:"APPLY_DONE",message:{type:"success",text:"Settings applied successfully!"}}),Y()):u({type:"APPLY_DONE",message:{type:"error",text:c.error||"Failed to apply settings"}})}catch(a){u({type:"APPLY_DONE",message:{type:"error",text:a.message}})}},ae=async()=>{u({type:"RESTORE_START"});try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(u({type:"RESTORE_DONE",message:{type:"success",text:"Settings reset successfully!"}}),I(""),L(""),Y()):u({type:"RESTORE_DONE",message:{type:"error",text:b.error||"Failed to reset settings"}})}catch(a){u({type:"RESTORE_DONE",message:{type:"error",text:a.message}})}};return(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:aa,"aria-expanded":b,"aria-label":"Toggle section",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.webp",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"===ab&&(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"===ab&&(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"===ab&&(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.jsx)(w,{activeProviders:j,apiKeys:i,applying:z,checkingCodex:y,cloudEnabled:k,codexStatus:v,customBaseUrl:V,getDisplayUrl:()=>V||`${h}/v1`,handleApplySettings:ad,handleResetSettings:ae,message:B,restoring:A,selectedApiKey:G,selectedModel:J,setCustomBaseUrl:W,setModalOpen:O,setSelectedApiKey:F,setSelectedModel:I,setShowInstallGuide:D,setShowManualConfigModal:U,setSubagentModalOpen:Q,setSubagentModel:L,showInstallGuide:C,subagentModel:M,tailscaleEnabled:o,tailscaleUrl:p,tool:a,tunnelEnabled:m,tunnelPublicUrl:n}),(0,d.jsx)(f.ModelSelectModal,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{I(a.value),M||L(a.value),O(!1)},selectedModel:J,activeProviders:j,modelAliases:R,title:"Select Model for Codex"}),(0,d.jsx)(f.ModelSelectModal,{isOpen:P,onClose:()=>Q(!1),onSelect:a=>{L(a.value),Q(!1)},selectedModel:M,activeProviders:j,modelAliases:R,title:"Select Subagent Model for Codex"}),(0,d.jsx)(f.ManualConfigModal,{isOpen:T,onClose:()=>U(!1),title:"Codex CLI - Manual Configuration",configs:(q=G&&G.trim()?G:k?"<API_KEY_FROM_DASHBOARD>":"sk_VansRoute",r=M||J,[{filename:"~/.codex/config.toml",content:`# VansAI Configuration for Codex CLI
1
+ "use strict";exports.id=3969,exports.ids=[3969],exports.modules={61126:a=>{a.exports={TOOL_HOSTS:{antigravity:["daily-cloudcode-pa.googleapis.com","cloudcode-pa.googleapis.com"],copilot:["api.individual.githubcopilot.com"],kiro:["runtime.us-east-1.kiro.dev","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com"],cursor:["api2.cursor.sh"]}}},63969:(a,b,c)=>{c.d(b,{Tk:()=>v,aG:()=>X,Ah:()=>x,h1:()=>V,Q6:()=>T,lF:()=>aa,a7:()=>L,ZM:()=>A,E_:()=>aj,RF:()=>G,mW:()=>ad,c9:()=>Z,tA:()=>am,kn:()=>ar,yZ:()=>D,qO:()=>O});var d=c(66238),e=c(71183),f=c(43736),g=c(15901),h=c(13717);let i="__custom__",j="__save__",k=()=>[],l=a=>{},m=({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};function n({value:a,onChange:b,requiresExternalUrl:c=!1,tunnelEnabled:f=!1,tunnelPublicUrl:g="",tailscaleEnabled:h=!1,tailscaleUrl:o="",cloudEnabled:p=!1,cloudUrl:q="",withV1:r=!0}){let[s,t]=(0,e.useState)(k),[u,v]=(0,e.useState)("");(0,e.useRef)(!1);let w=(0,e.useMemo)(()=>m({requiresExternalUrl:c,tunnelEnabled:f,tunnelPublicUrl:g,tailscaleEnabled:h,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,savedPresets:s,withV1:r}),[c,f,g,h,o,p,q,s,r]),[x,y]=(0,e.useState)(()=>{let a=m({requiresExternalUrl:c,tunnelEnabled:f,tunnelPublicUrl:g,tailscaleEnabled:h,tailscaleUrl:o,cloudEnabled:p,cloudUrl:q,savedPresets:k(),withV1:r}).find(a=>a.value!==i);return a?a.value:i});(0,e.useRef)(b);let z=x.startsWith("saved:"),A=x===i,B=A&&(u||"").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:x,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=[...s.filter(a=>a.name!==d.trim()),{name:d.trim(),baseUrl:b}].sort((a,b)=>a.name.localeCompare(b.name));t(e),l(e);return}if(y(d),d===i){v(""),b("");return}let e=w.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:[w.map(a=>(0,d.jsx)("option",{value:a.value,children:a.label},a.value)),B&&(0,d.jsx)("option",{value:j,children:"+ Save current as..."})]}),z&&(0,d.jsx)("button",{type:"button",onClick:()=>{if(!x.startsWith("saved:"))return;let a=x.slice(6),c=s.filter(b=>b.name!==a);t(c),l(c),y(i),v(""),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"})})]}),A&&(0,d.jsx)("input",{type:"text",value:u,onChange:a=>{let c=a.target.value;v(c),b(c)},placeholder:r?"https://example.com/v1":"https://example.com","aria-label":"Custom base URL",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 o="__custom__",p=[];function q({value:a,onChange:b,apiKeys:c=p,cloudEnabled:f=!1,className:g=""}){let h=!c.some(b=>b.key===a)&&""!==a,[i,j]=(0,e.useState)(()=>a?c.some(b=>b.key===a)?a:o:c.length>0?c[0].key:o),[k,l]=(0,e.useState)(h?a:"");return 0===c.length&&i!==o&&i!==o?(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 ${g}`,children:f?"No API keys - Create one in Keys page":"sk_9router (default)"}):(0,d.jsxs)("div",{className:`flex flex-col gap-1.5 ${g}`,children:[(0,d.jsxs)("select",{value:i,onChange:a=>{let c=a.target.value;j(c),c===o?(l(""),b("")):b(c)},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:[c.map(a=>(0,d.jsx)("option",{value:a.key,children:a.key},a.id)),(0,d.jsx)("option",{value:o,children:"Custom..."})]}),i===o&&(0,d.jsx)("input",{type:"text",value:k,onChange:a=>{let c=a.target.value;l(c),b(c)},placeholder:"sk-...","aria-label":"Custom API key",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 r=a=>(a||"").replace(/\/+$/,"");function s(a,b={}){if(!a)return!1;let c=r(a),{tunnelPublicUrl:d,tailscaleUrl:e,cloudUrl:f}=b;return!!(/localhost|127\.0\.0\.1|0\.0\.0\.0/.test(c)||d&&c.startsWith(r(d))||e&&c.startsWith(r(e))||f&&c.startsWith(r(f)))}let t=process.env.NEXT_PUBLIC_CLOUD_URL;function u({applying:a,apiKeys:b,ccFilterNaming:c,checkingClaude:e,cloudEnabled:g,claudeStatus:h,customBaseUrl:i,getDisplayUrl:j,handleApplySettings:k,handleCcFilterNamingToggle:l,handleResetSettings:m,hasActiveProviders:o,message:p,modelMappings:r,onModelMappingChange:s,openModelSelector:t,restoring:v,selectedApiKey:w,setCustomBaseUrl:x,setSelectedApiKey:y,setShowInstallGuide:z,setShowManualConfigModal:A,showInstallGuide:B,tailscaleEnabled:C,tailscaleUrl:D,tool:E,tunnelEnabled:F,tunnelPublicUrl:G}){return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[e&&(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..."})]}),!e&&h&&!h.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 VansAI is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.Button,{variant:"secondary",size:"sm",onClick:()=>A(!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.Button,{variant:"outline",size:"sm",onClick:()=>z(!B),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:B?"expand_less":"help"}),B?"Hide":"How to Install"]})]})]}),B&&(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."]})]})]})]}),!e&&h?.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)(n,{value:i||j(),onChange:x,requiresExternalUrl:E.requiresExternalUrl,tunnelEnabled:F,tunnelPublicUrl:G,tailscaleEnabled:C,tailscaleUrl:D})]}),h?.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:h.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"}),(0,d.jsx)(q,{value:w,onChange:y,apiKeys:b,cloudEnabled:g})]}),E.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:r[a.alias]||"",onChange:b=>s(a.alias,b.target.value),"aria-label":"Model ID",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"}),r[a.alias]&&(0,d.jsx)("button",{type:"button",onClick:()=>s(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",{type:"button",onClick:()=>t(a.alias),disabled:!o,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 ${o?"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:c,onChange:l,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.Tooltip,{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"})})]})]})]}),p&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===p.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"===p.type?"check_circle":"error"}),(0,d.jsx)("span",{children:p.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.Button,{variant:"primary",size:"sm",onClick:k,disabled:!o,loading:a,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:m,disabled:!h?.hasVansRoute,loading:v,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.Button,{variant:"ghost",size:"sm",onClick:()=>A(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]})}function v({tool:a,isExpanded:b,onToggle:c,activeProviders:h,modelMappings:i,onModelMappingChange:j,baseUrl:k,hasActiveProviders:l,apiKeys:m,cloudEnabled:n,initialStatus:o,tunnelEnabled:p,tunnelPublicUrl:q,tailscaleEnabled:r,tailscaleUrl:w}){let x,y,[z,A]=(0,e.useReducer)((a,b)=>{switch(b.type){case"CHECK_START":return{...a,checking:!0};case"CHECK_DONE":return{...a,status:b.data,checking:!1};case"APPLY_START":return{...a,applying:!0,message:null};case"APPLY_DONE":return{...a,applying:!1,message:b.message};case"RESTORE_START":return{...a,restoring:!0,message:null};case"RESTORE_DONE":return{...a,restoring:!1,message:b.message};default:return a}},{status:o||null,checking:!1,applying:!1,restoring:!1,message:null}),B=z.status,C=z.checking,{applying:D,restoring:E,message:F}=z,[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(!1),[K,L]=(0,e.useState)(null),[M,N]=(0,e.useState)(null),O=B?.settings?.env?.ANTHROPIC_AUTH_TOKEN,P=O&&m?.some(a=>a.key===O)?O:null,Q=M??P??(m?.length>0?m[0].key:""),[R,S]=(0,e.useState)({}),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(""),[X,Y]=(0,e.useState)(!1);(0,e.useRef)(!1);let Z=(()=>{if(!B?.installed)return null;let a=B.settings?.env?.ANTHROPIC_BASE_URL;return a?s(a,{tunnelPublicUrl:q,tailscaleUrl:w,cloudUrl:n?t:null})?"configured":"other":"not_configured"})(),$=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&S(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}},[]),_=(0,e.useCallback)(async()=>{A({type:"CHECK_START"});try{let a=await fetch("/api/cli-tools/claude-settings"),b=await a.json();A({type:"CHECK_DONE",data:b})}catch(a){A({type:"CHECK_DONE",data:{installed:!1,error:a.message}})}},[]),aa=(0,e.useRef)(!!o),ab=(0,e.useRef)(!1),ac=(0,e.useCallback)(async()=>{aa.current||(aa.current=!0,await _()),ab.current||(ab.current=!0,await $())},[_,$]),ad=(0,e.useCallback)(()=>{b||ac(),c()},[b,ac,c]),ae=async a=>{let b=a.target.checked;Y(b),await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({ccFilterNaming:b})}).catch(()=>{})},af=()=>{let a=V||k;return a.endsWith("/v1")?a:`${a}/v1`},ag=async()=>{A({type:"APPLY_START"});try{let b={ANTHROPIC_BASE_URL:af()},c=Q?.trim()||(m?.length>0?m[0].key:null)||(n?null:"sk_VansRoute");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?(A({type:"APPLY_DONE",message:{type:"success",text:"Settings applied successfully!"}}),A({type:"CHECK_DONE",data:{...B,hasBackup:!0,settings:{...B?.settings,env:b}}})):A({type:"APPLY_DONE",message:{type:"error",text:e.error||"Failed to apply settings"}})}catch(a){A({type:"APPLY_DONE",message:{type:"error",text:a.message}})}},ah=async()=>{A({type:"RESTORE_START"});try{let b=await fetch("/api/cli-tools/claude-settings",{method:"DELETE"}),c=await b.json();b.ok?(A({type:"RESTORE_DONE",message:{type:"success",text:"Settings reset successfully!"}}),a.defaultModels.forEach(a=>j(a.alias,a.defaultValue||"")),N("")):A({type:"RESTORE_DONE",message:{type:"error",text:c.error||"Failed to reset settings"}})}catch(a){A({type:"RESTORE_DONE",message:{type:"error",text:a.message}})}};return(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:ad,"aria-expanded":b,"aria-label":"Toggle section",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.webp",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.jsx)(u,{applying:D,apiKeys:m,ccFilterNaming:X,checkingClaude:C,cloudEnabled:n,claudeStatus:B,customBaseUrl:V,getDisplayUrl:()=>{let a=V||k;return a.endsWith("/v1")?a:`${a}/v1`},handleApplySettings:ag,handleCcFilterNamingToggle:ae,handleResetSettings:ah,hasActiveProviders:l,message:F,modelMappings:i,onModelMappingChange:j,openModelSelector:a=>{L(a),J(!0)},restoring:E,selectedApiKey:Q,setCustomBaseUrl:W,setSelectedApiKey:N,setShowInstallGuide:H,setShowManualConfigModal:U,showInstallGuide:G,tailscaleEnabled:r,tailscaleUrl:w,tool:a,tunnelEnabled:p,tunnelPublicUrl:q}),(0,d.jsx)(f.ModelSelectModal,{isOpen:I,onClose:()=>J(!1),onSelect:a=>{K&&j(K,a.value)},selectedModel:K?i[K]:null,activeProviders:h,modelAliases:R,title:`Select model for ${K}`}),(0,d.jsx)(f.ManualConfigModal,{isOpen:T,onClose:()=>U(!1),title:"Claude CLI - Manual Configuration",configs:(x=Q&&Q.trim()?Q:n?"<API_KEY_FROM_DASHBOARD>":"sk_VansRoute",y={ANTHROPIC_BASE_URL:af(),ANTHROPIC_AUTH_TOKEN:x},a.defaultModels.forEach(a=>{let b=i[a.alias];b&&a.envKey&&(y[a.envKey]=b)}),[{filename:"~/.claude/settings.json",content:JSON.stringify({hasCompletedOnboarding:!0,env:y},null,2)}])})]})}function w({activeProviders:a,apiKeys:b,applying:c,checkingCodex:e,cloudEnabled:g,codexStatus:h,customBaseUrl:i,getDisplayUrl:j,handleApplySettings:k,handleResetSettings:l,message:m,restoring:o,selectedApiKey:p,selectedModel:r,setCustomBaseUrl:s,setModalOpen:t,setSelectedApiKey:u,setSelectedModel:v,setShowInstallGuide:x,setShowManualConfigModal:y,setSubagentModalOpen:z,setSubagentModel:A,showInstallGuide:B,subagentModel:C,tailscaleEnabled:D,tailscaleUrl:E,tool:F,tunnelEnabled:G,tunnelPublicUrl:H}){let I,J;return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[e&&(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..."})]}),!e&&h&&!h.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 VansAI is deployed on a remote server."})]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2 pl-9",children:[(0,d.jsxs)(f.Button,{variant:"secondary",size:"sm",onClick:()=>y(!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.Button,{variant:"outline",size:"sm",onClick:()=>x(!B),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:B?"expand_less":"help"}),B?"Hide":"How to Install"]})]})]}),B&&(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.']})})]})]})]}),!e&&h?.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)(n,{value:i||j(),onChange:s,requiresExternalUrl:F.requiresExternalUrl,tunnelEnabled:G,tunnelPublicUrl:H,tailscaleEnabled:D,tailscaleUrl:E})]}),h?.config&&((J=(I=h.config.match(/base_url\s*=\s*"([^"]+)"/))?I[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:J})]}):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"}),(0,d.jsx)(q,{value:p,onChange:u,apiKeys:b,cloudEnabled:g})]}),(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:r,onChange:a=>v(a.target.value),"aria-label":"Model ID",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"}),r&&(0,d.jsx)("button",{type:"button",onClick:()=>v(""),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",{type:"button",onClick:()=>t(!0),disabled:!a?.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 ${a?.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:C,onChange:a=>A(a.target.value),placeholder:r||"provider/model-id (defaults to main model)","aria-label":"Subagent 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"}),C&&(0,d.jsx)("button",{type:"button",onClick:()=>A(""),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",{type:"button",onClick:()=>z(!0),disabled:!a?.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 ${a?.length?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select Model"})]})]}),m&&(0,d.jsxs)("div",{className:`flex items-center gap-2 px-2 py-1.5 rounded text-xs ${"success"===m.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"===m.type?"check_circle":"error"}),(0,d.jsx)("span",{children:m.text})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,d.jsxs)(f.Button,{variant:"primary",size:"sm",onClick:k,disabled:!p&&g&&b.length>0||!r,loading:c,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"save"}),"Apply"]}),(0,d.jsxs)(f.Button,{variant:"outline",size:"sm",onClick:l,disabled:o,loading:o,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"restore"}),"Reset"]}),(0,d.jsxs)(f.Button,{variant:"ghost",size:"sm",onClick:()=>y(!0),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mr-1",children:"content_copy"}),"Manual Config"]})]})]})]})}function x({tool:a,isExpanded:b,onToggle:c,baseUrl:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l,tunnelEnabled:m,tunnelPublicUrl:n,tailscaleEnabled:o,tailscaleUrl:p}){let q,r,[t,u]=(0,e.useReducer)((a,b)=>{switch(b.type){case"CHECK_START":return{...a,checking:!0};case"CHECK_DONE":return{...a,status:b.data,checking:!1};case"APPLY_START":return{...a,applying:!0,message:null};case"APPLY_DONE":return{...a,applying:!1,message:b.message};case"RESTORE_START":return{...a,restoring:!0,message:null};case"RESTORE_DONE":return{...a,restoring:!1,message:b.message};default:return a}},{status:l||null,checking:!1,applying:!1,restoring:!1,message:null}),v=t.status,y=t.checking,{applying:z,restoring:A,message:B}=t,[C,D]=(0,e.useState)(!1),[E,F]=(0,e.useState)(null),G=E??(i?.length>0?i[0].key:""),[H,I]=(0,e.useState)(null),J=H??(()=>{if(v?.config){let a=v.config.match(/^model\s*=\s*"([^"]+)"/m);if(a)return a[1]}return""})(),[K,L]=(0,e.useState)(null),M=K??(()=>{if(v?.config){let a=v.config.match(/\[agents\.subagent\]\s*\n\s*model\s*=\s*"([^"]+)"/m);if(a)return a[1]}return""})(),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)({}),[T,U]=(0,e.useState)(!1),[V,W]=(0,e.useState)(""),X=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&S(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}},[]),Y=(0,e.useCallback)(async()=>{u({type:"CHECK_START"});try{let a=await fetch("/api/cli-tools/codex-settings"),b=await a.json();u({type:"CHECK_DONE",data:b})}catch(a){u({type:"CHECK_DONE",data:{installed:!1,error:a.message}})}},[]),Z=(0,e.useRef)(!!l),$=(0,e.useRef)(!1),_=(0,e.useCallback)(async()=>{Z.current||(Z.current=!0,await Y()),$.current||($.current=!0,await X())},[Y,X]),aa=(0,e.useCallback)(()=>{b||_(),c()},[b,_,c]),ab=(()=>{if(!v?.installed)return null;if(!v.config)return"not_configured";let a=v.config.match(/base_url\s*=\s*"([^"]+)"/);return s(a?a[1]:"",{tunnelPublicUrl:n,tailscaleUrl:p})?"configured":"other"})(),ac=()=>{let a=V||`${h}/v1`;return a.endsWith("/v1")?a:`${a}/v1`},ad=async()=>{u({type:"APPLY_START"});try{let a=G&&G.trim()||k?G:"sk_VansRoute",b=await fetch("/api/cli-tools/codex-settings",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:ac(),apiKey:a,model:J,subagentModel:M||J})}),c=await b.json();b.ok?(u({type:"APPLY_DONE",message:{type:"success",text:"Settings applied successfully!"}}),Y()):u({type:"APPLY_DONE",message:{type:"error",text:c.error||"Failed to apply settings"}})}catch(a){u({type:"APPLY_DONE",message:{type:"error",text:a.message}})}},ae=async()=>{u({type:"RESTORE_START"});try{let a=await fetch("/api/cli-tools/codex-settings",{method:"DELETE"}),b=await a.json();a.ok?(u({type:"RESTORE_DONE",message:{type:"success",text:"Settings reset successfully!"}}),I(""),L(""),Y()):u({type:"RESTORE_DONE",message:{type:"error",text:b.error||"Failed to reset settings"}})}catch(a){u({type:"RESTORE_DONE",message:{type:"error",text:a.message}})}};return(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:aa,"aria-expanded":b,"aria-label":"Toggle section",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.webp",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"===ab&&(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"===ab&&(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"===ab&&(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.jsx)(w,{activeProviders:j,apiKeys:i,applying:z,checkingCodex:y,cloudEnabled:k,codexStatus:v,customBaseUrl:V,getDisplayUrl:()=>V||`${h}/v1`,handleApplySettings:ad,handleResetSettings:ae,message:B,restoring:A,selectedApiKey:G,selectedModel:J,setCustomBaseUrl:W,setModalOpen:O,setSelectedApiKey:F,setSelectedModel:I,setShowInstallGuide:D,setShowManualConfigModal:U,setSubagentModalOpen:Q,setSubagentModel:L,showInstallGuide:C,subagentModel:M,tailscaleEnabled:o,tailscaleUrl:p,tool:a,tunnelEnabled:m,tunnelPublicUrl:n}),(0,d.jsx)(f.ModelSelectModal,{isOpen:N,onClose:()=>O(!1),onSelect:a=>{I(a.value),M||L(a.value),O(!1)},selectedModel:J,activeProviders:j,modelAliases:R,title:"Select Model for Codex"}),(0,d.jsx)(f.ModelSelectModal,{isOpen:P,onClose:()=>Q(!1),onSelect:a=>{L(a.value),Q(!1)},selectedModel:M,activeProviders:j,modelAliases:R,title:"Select Subagent Model for Codex"}),(0,d.jsx)(f.ManualConfigModal,{isOpen:T,onClose:()=>U(!1),title:"Codex CLI - Manual Configuration",configs:(q=G&&G.trim()?G:k?"<API_KEY_FROM_DASHBOARD>":"sk_VansRoute",r=M||J,[{filename:"~/.codex/config.toml",content:`# VansAI Configuration for Codex CLI
2
2
  model = "${J}"
3
3
  model_provider = "VansRoute"
4
4
 
@@ -28,14 +28,21 @@ default_model = "${H||"cc/claude-opus-4-7"}"
28
28
  requires_api_key = true
29
29
 
30
30
  [[providers.VansRoute.models]]
31
- id = "${H||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-VansRoute.env",content:`JCODE_VansRoute_API_KEY="${r}"`}])})]})}let ae="/api/cli-tools/grok-build-settings",af="9router";function ag({tool:a,isExpanded:b,onToggle:c,baseUrl:h,hasActiveProviders:i,apiKeys:j,activeProviders:k,cloudEnabled:l,initialStatus:m,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:r,tailscaleUrl:t}){let u,v,[w,x]=(0,e.useState)(m||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?s(a.base_url,{tunnelPublicUrl:p,tailscaleUrl:t})?"configured":"other":"not_configured"})(),T=async()=>{z(!0);try{let a=await fetch(ae),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=async()=>{B(!0),F(null);try{let a=G?.trim()||(j?.length>0?j[0].key:null)||(l?null:"sk_9router"),b=await fetch(ae,{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)}},W=async()=>{D(!0),F(null);try{let a=await fetch(ae,{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.Card,{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||"/providers/grok-cli.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(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 Grok Build..."})]}),!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:"Grok Build not detected locally"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-1",children:"Install:"}),(0,d.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"curl -fsSL https://x.ai/cli/install.sh | bash"}),(0,d.jsx)("p",{className:"text-sm text-text-muted mt-2",children:"Manual configuration is still available if 9router is deployed on a remote server."})]})]}),(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.Button,{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:[a.notes&&a.notes.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:a.notes.map((a,b)=>(0,d.jsxs)("div",{className:`flex items-start gap-2 p-2 rounded text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"error"===a.type?"bg-red-500/10 text-red-600 dark:text-red-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] mt-0.5",children:"warning"===a.type?"warning":"error"===a.type?"error":"info"}),(0,d.jsx)("span",{children:a.text})]},b))}),(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)(n,{value:Q||U(),onChange:R,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:o,tunnelPublicUrl:p,tailscaleEnabled:r,tailscaleUrl:t})]}),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.jsxs)("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,w.settings.model.model?` \xb7 ${w.settings.model.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:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(q,{value:G,onChange:H,apiKeys:j,cloudEnabled:l})]}),(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.Button,{variant:"primary",size:"sm",onClick:V,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.Button,{variant:"outline",size:"sm",onClick:W,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.Button,{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"]})]})]})]}),K&&(0,d.jsx)(f.ModelSelectModal,{isOpen:K,onClose:()=>L(!1),onSelect:a=>{J(a.value),L(!1)},selectedModel:I,activeProviders:k,modelAliases:M,title:"Select Model for Grok Build"}),(0,d.jsx)(f.ManualConfigModal,{isOpen:O,onClose:()=>P(!1),title:"Grok Build - Manual Configuration",configs:(u=G&&G.trim()?G:l?"<API_KEY_FROM_DASHBOARD>":"sk_9router",v=I||"provider/model-id",[{filename:"~/.grok/config.toml",content:`[models]
32
- default = "${af}"
33
-
34
- [model.${af}]
35
- model = "${v}"
36
- base_url = "${U()}"
31
+ id = "${H||"cc/claude-opus-4-7"}"`},{filename:"~/.config/jcode/provider-VansRoute.env",content:`JCODE_VansRoute_API_KEY="${r}"`}])})]})}var ae=c(55009);let af="/api/cli-tools/grok-build-settings",ag="9router",ah=[{id:"general-purpose",label:"General-purpose",help:"Implementation, testing, and full-capability delegated tasks"},{id:"explore",label:"Explore",help:"Read-only codebase research and investigation"},{id:"plan",label:"Plan",help:"Architecture and implementation planning"}];function ai({label:a,value:b,placeholder:c,onChange:e,onSelect:f,disabled:g,help:h}){return(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)("div",{className:"sm:text-right",children:[(0,d.jsx)("span",{className:"text-xs font-semibold text-text-main sm:text-sm",children:a}),h&&(0,d.jsx)("p",{className:"mt-0.5 text-[10px] leading-tight text-text-muted",children:h})]}),(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:b,onChange:a=>e(a.target.value),placeholder:c,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"}),b&&(0,d.jsx)("button",{type:"button",onClick:()=>e(""),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 (inherit main model for subagents)",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,d.jsx)("button",{type:"button",onClick:f,disabled:g,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 ${!g?"bg-surface border-border text-text-main hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]})}function aj({tool:a,isExpanded:b,onToggle:c,hasActiveProviders:h,apiKeys:i,activeProviders:j,cloudEnabled:k,initialStatus:l,tunnelEnabled:m,tunnelPublicUrl:o,tailscaleEnabled:p,tailscaleUrl:r}){let{getCaps:t}=(0,ae.y)(),u=a=>t(a)?.contextWindow||null,v=l?.settings?.model?.model||"",w=Object.fromEntries(ah.map(a=>[a.id,l?.settings?.subagentModels?.[a.id]?.model]).filter(([,a])=>!!a)),[x,y]=(0,e.useState)(l||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)(i?.[0]?.key||""),[J,K]=(0,e.useState)(v),[L,M]=(0,e.useState)(w),[N,O]=(0,e.useState)(null),[P,Q]=(0,e.useState)({}),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(""),V=(0,e.useRef)(!!l),W=x?.settings?.model,X=x?.installed?W?.base_url?s(W.base_url,{tunnelPublicUrl:o,tailscaleUrl:r})?"configured":"other":"not_configured":null,Y=(0,e.useCallback)(a=>{let b=a?.settings?.model?.model||"",c=Object.fromEntries(ah.map(b=>[b.id,a?.settings?.subagentModels?.[b.id]?.model]).filter(([,a])=>!!a));K(b),M(c)},[]);(0,e.useCallback)(async()=>{try{let a=await fetch("/api/models/alias"),b=await a.json();a.ok&&Q(b.aliases||{})}catch(a){console.log("Error fetching model aliases:",a)}},[]);let Z=(0,e.useCallback)(async({hydrate:a=!1}={})=>{A(!0);try{let b=await fetch(af),c=await b.json();y(c),V.current=!0,a&&Y(c)}catch(a){y({installed:!1,error:a.message})}finally{A(!1)}},[Y]),$=()=>{let a=T||"http://127.0.0.1:20128";return a.endsWith("/v1")?a:`${a}/v1`},_=async()=>{C(!0),G(null);try{let a=H?.trim()||(i?.length>0?i[0].key:null)||(k?null:"sk_9router"),b={};for(let a of ah){let c=L[a.id]?.trim();c&&(b[a.id]={model:c,contextWindow:u(c)})}let c=await fetch(af,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:$(),apiKey:a,model:J,contextWindow:u(J),subagentModels:b})}),d=await c.json();c.ok?(G({type:"success",text:"Main and subagent models applied successfully!"}),Z()):G({type:"error",text:d.error||"Failed to apply settings"})}catch(a){G({type:"error",text:a.message})}finally{C(!1)}},aa=async()=>{E(!0),G(null);try{let a=await fetch(af,{method:"DELETE"}),b=await a.json();a.ok?(G({type:"success",text:"Settings reset successfully!"}),K(""),M({}),Z()):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.Card,{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||"/providers/grok-cli.png",alt:a.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:a=>{a.target.style.display="none"},loading:"lazy",decoding:"async"})}),(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:[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 Grok Build..."})]}),!z&&x&&!x.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:"Grok Build not detected locally"}),(0,d.jsx)("code",{className:"block mt-2 p-2 bg-black/20 rounded text-xs font-mono",children:"curl -fsSL https://x.ai/cli/install.sh | bash"})]})]}),(0,d.jsxs)(f.Button,{variant:"secondary",size:"sm",onClick:()=>S(!0),className:"w-full sm:w-auto",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] mr-1",children:"content_copy"}),"Manual Config"]})]}),!z&&x?.installed&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[a.notes?.length>0&&(0,d.jsx)("div",{className:"mb-2 flex flex-col gap-2",children:a.notes.map((a,b)=>(0,d.jsxs)("div",{className:`flex items-start gap-2 rounded p-2 text-xs ${"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"bg-blue-500/10 text-blue-600 dark:text-blue-400"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-[14px]",children:"warning"===a.type?"warning":"info"}),(0,d.jsx)("span",{children:a.text})]},b))}),(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)(n,{value:T||$(),onChange:U,requiresExternalUrl:a.requiresExternalUrl,tunnelEnabled:m,tunnelPublicUrl:o,tailscaleEnabled:p,tailscaleUrl:r})]}),W?.base_url&&(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:"Current"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsxs)("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.base_url," \xb7 ",W.model,W.context_window?` \xb7 ${(W.context_window/1e3).toLocaleString()}K ctx`:""]})]}),(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:"API Key"}),(0,d.jsx)("span",{className:"material-symbols-outlined hidden text-text-muted text-[14px] sm:inline",children:"arrow_forward"}),(0,d.jsx)(q,{value:H,onChange:I,apiKeys:i,cloudEnabled:k})]}),(0,d.jsx)(ai,{label:"Main Model",value:J,onChange:K,placeholder:"provider/model-id",onSelect:()=>O("main"),disabled:!h}),(0,d.jsx)("div",{className:"my-1 border-t border-border pt-3",children:(0,d.jsxs)("div",{className:"mb-2 flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[16px]",children:"account_tree"}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-xs font-semibold text-text-main",children:"Subagent model overrides"}),(0,d.jsx)("p",{className:"text-[10px] text-text-muted",children:"Leave blank to inherit Main Model. Each override keeps its own context window."})]})]})}),ah.map(a=>(0,d.jsx)(ai,{label:a.label,help:a.help,value:L[a.id]||"",onChange:b=>M(c=>({...c,[a.id]:b})),placeholder:`${J||"Main Model"} (inherit)`,onSelect:()=>O(a.id),disabled:!h},a.id))]}),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.Button,{variant:"primary",size:"sm",onClick:_,disabled:!J,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.Button,{variant:"outline",size:"sm",onClick:aa,disabled:!x?.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.Button,{variant:"ghost",size:"sm",onClick:()=>S(!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"]})]})]})]}),N&&(0,d.jsx)(f.ModelSelectModal,{isOpen:!!N,onClose:()=>O(null),onSelect:a=>{"main"===N?K(a.value):N&&M(b=>({...b,[N]:a.value})),O(null)},selectedModel:"main"===N?J:L[N]||"",activeProviders:j,modelAliases:P,title:"main"===N?"Select Main Model for Grok Build":`Select ${ah.find(a=>a.id===N)?.label||"Subagent"} Model`}),(0,d.jsx)(f.ManualConfigModal,{isOpen:R,onClose:()=>S(!1),title:"Grok Build - Manual Configuration",configs:(()=>{let a=H?.trim()||(k?"<API_KEY_FROM_DASHBOARD>":"sk_9router"),b=$(),c=J||"provider/model-id",d=[`[models]
32
+ default = "${ag}"`,`[model.${ag}]
33
+ model = "${c}"
34
+ base_url = "${b}"
37
35
  name = "9Router"
38
36
  description = "Routed via 9Router gateway"
39
37
  api_backend = "chat_completions"
40
- api_key = "${u}"
41
- `}])})]})}let ah="http://localhost:20128";function ai({showPasswordModal:a,sudoPassword:b,dispatch:c,loading:e,modalError:g,handleConfirmPassword:h,port443Conflict:i,handleKillAndStart:j}){return(0,d.jsxs)(d.Fragment,{children:[a&&(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.Input,{type:"password",placeholder:"Enter sudo password",value:b,onChange:a=>c({sudoPassword:a.target.value}),onKeyDown:a=>{"Enter"!==a.key||e||h()}}),g&&(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:g})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>{c({showPasswordModal:!1}),c({sudoPassword:""}),c({modalError:null})},disabled:e,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:h,loading:e,children:"Confirm"})]})]})}),i&&(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 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[i.owner.name," (PID ",i.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>{c({port443Conflict:null}),c({loading:!1})},disabled:e,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:j,loading:e,children:"Kill & Start"})]})]})})]})}function aj({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useReducer)((a,b)=>({...a,...b}),{status:null,loading:!1,showPasswordModal:!1,sudoPassword:"",pendingAction:null,modalError:null,actionError:null,mitmRouterBaseUrl:ah,port443Conflict:null}),{status:i,loading:j,showPasswordModal:k,sudoPassword:l,pendingAction:m,modalError:n,actionError:o,mitmRouterBaseUrl:p,port443Conflict:q}=g,[r,s]=(0,e.useState)(()=>a?.[0]?.key||""),t=i?.isWin===!0,u=t||i?.hasCachedPassword||i?.needsSudoPassword===!1,v=i?.isAdmin!==!1;!v&&(t||i?.hasCachedPassword||i?.needsSudoPassword);let w=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h({status:b}),b.mitmRouterBaseUrl&&h({mitmRouterBaseUrl:b.mitmRouterBaseUrl}),c?.(b)}}catch{h({status:{running:!1,certExists:!1,dnsStatus:{}}})}},[c]),x=a=>{h({actionError:null}),i&&(u?y(a,""):(h({pendingAction:a}),h({showPasswordModal:!0}),h({modalError:null})))},y=async(c,d,e=!1)=>{h({loading:!0}),h({actionError: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=r?.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:p.trim()||ah,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){h({showPasswordModal:!1}),h({port443Conflict:{owner:a.portOwner,password:d}});return}h({actionError:a.error||`Failed to ${c} MITM server`});return}h({showPasswordModal:!1}),h({sudoPassword:""}),h({port443Conflict:null}),await w()}catch(a){h({actionError:a.message||"Network error"})}finally{h({loading:!1}),h({pendingAction:null})}},z=i?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Card,{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"}),z?(0,d.jsx)(f.Badge,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Badge,{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:i?.certExists},{label:"Trusted",ok:i?.certTrusted},{label:"Server",ok:z}].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 VansAI"]}),(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 → VansAI → 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:"VansAI 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:p,onChange:a=>h({mitmRouterBaseUrl:a.target.value}),placeholder:ah,disabled:z,"aria-label":"VansAI Base URL",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"})]}),!z&&(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:r,onChange:a=>s(a.target.value),placeholder:b?"Enter or pick API key":"sk_9router (default)","aria-label":"API Key",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:[i?.certExists&&!i?.certTrusted&&(0,d.jsxs)("button",{type:"button",onClick:()=>x("trust-cert"),disabled:j,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"]}),z?(0,d.jsxs)("button",{type:"button",onClick:()=>x("stop"),disabled:j,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled: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",{type:"button",onClick:()=>x("start"),disabled:j||!i||t&&!v,title:t&&!v?"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"]}),z&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),o&&(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:o})]}),t&&!v&&(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 VansAI as Administrator to use MITM"})]})]})}),(0,d.jsx)(ai,{showPasswordModal:k,sudoPassword:l,dispatch:h,loading:j,modalError:n,handleConfirmPassword:()=>{l.trim()?y(m,l):h({modalError:"Sudo password is required"})},port443Conflict:q,handleKillAndStart:()=>{y("start",q?.password||"",!0)}})]})}var ak=c(61126);let al={},am={};function an({dnsActive:a,handleDnsToggle:b,handleMappingBlur:c,handleModelMappingChange:e,hasActiveProviders:f,loading:g,mitmHosts:h,modelMappings:i,openModelSelector:j,saveMappings:k,serverRunning:l,tool:m,warning:n}){return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[h.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:h.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 ",m.name," traffic through VansAI via MITM."]}),!a&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),m.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:m.defaultModels.map(b=>(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:b.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[b.alias]||"",onChange:a=>e(b.alias,a.target.value),onBlur:a=>c(b.alias,a.target.value),"aria-label":"Model ID",placeholder:"provider/model-id",disabled:!a,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 ${!a?"opacity-50 cursor-not-allowed":""}`}),i[b.alias]&&(0,d.jsx)("button",{type:"button",onClick:()=>{e(b.alias,""),k({...i,[b.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",{type:"button",onClick:()=>j(b.alias),disabled:!f||!a,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${f&&a?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},b.alias))}),m.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:[a?(0,d.jsxs)("button",{type:"button",onClick:b,disabled:!l||g,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",{type:"button",onClick:b,disabled:!l||g,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"]}),n&&(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:n})]})]})]})}function ao({tool:a,status:{isExpanded:b,hasCachedPassword:c,needsSudoPassword:h,isWin:i}=am,onToggle:j,serverRunning:k,dnsActive:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p=al,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,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=ak.TOOL_HOSTS[a.id]??[],L=i||c||!1===h,M=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${a.id}`);if(b.ok){let a=await b.json();Object.keys(a.aliases||{}).length>0&&F(a.aliases)}}catch{}},[a.id]),N=(0,e.useRef)(!1),O=(0,e.useCallback)(async()=>{N.current||(N.current=!0,await M())},[M]);(0,e.useCallback)(()=>{b||O(),j()},[b,O,j]);let P=(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]),Q=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)}},R=()=>{y.trim()?Q(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:j,"aria-expanded":b,"aria-label":"Toggle section",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"},loading:"lazy",decoding:"async"})}),(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}),k?l?(0,d.jsx)(f.Badge,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Badge,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Badge,{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.jsx)(an,{dnsActive:l,handleDnsToggle:()=>{if(!k)return;let a=l?"disable":"enable";L?Q(a,""):(B(a),x(!0),D(null))},handleMappingBlur:(a,b)=>{P({...E,[a]:b})},handleModelMappingChange:(a,b)=>{F(c=>({...c,[a]:b}))},hasActiveProviders:o,loading:s,mitmHosts:K,modelMappings:E,openModelSelector:a=>{J(a),H(!0)},saveMappings:P,serverRunning:k,tool:a,warning: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.Input,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||R()}}),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.Button,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:R,loading:s,children:"Confirm"})]})]})}),G&&(0,d.jsx)(f.ModelSelectModal,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),P(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}c(95385)}};
38
+ api_key = "${a}"
39
+ context_window = ${u(c)||2e5}`],e=[];for(let c of ah){let f=L[c.id]?.trim();if(!f)continue;let g=`${ag}-${c.id}`;e.push(`${c.id} = "${g}"`),d.push(`[model.${g}]
40
+ model = "${f}"
41
+ base_url = "${b}"
42
+ name = "9Router ${c.id}"
43
+ description = "Routed via 9Router gateway"
44
+ api_backend = "chat_completions"
45
+ api_key = "${a}"
46
+ context_window = ${u(f)||2e5}`)}return e.length&&d.splice(1,0,`[subagents.models]
47
+ ${e.join("\n")}`),[{filename:"~/.grok/config.toml",content:`${d.join("\n\n")}
48
+ `}]})()})]})}let ak="http://localhost:20128";function al({showPasswordModal:a,sudoPassword:b,dispatch:c,loading:e,modalError:g,handleConfirmPassword:h,port443Conflict:i,handleKillAndStart:j}){return(0,d.jsxs)(d.Fragment,{children:[a&&(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.Input,{type:"password",placeholder:"Enter sudo password",value:b,onChange:a=>c({sudoPassword:a.target.value}),onKeyDown:a=>{"Enter"!==a.key||e||h()}}),g&&(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:g})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>{c({showPasswordModal:!1}),c({sudoPassword:""}),c({modalError:null})},disabled:e,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:h,loading:e,children:"Confirm"})]})]})}),i&&(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 is currently used by another process:"}),(0,d.jsxs)("p",{className:"font-mono text-text-main","data-i18n-skip":"true",children:[i.owner.name," (PID ",i.owner.pid,")"]}),(0,d.jsx)("p",{children:"Kill this process to start MITM Server?"})]})]}),(0,d.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[(0,d.jsx)(f.Button,{variant:"ghost",size:"sm",onClick:()=>{c({port443Conflict:null}),c({loading:!1})},disabled:e,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:j,loading:e,children:"Kill & Start"})]})]})})]})}function am({apiKeys:a,cloudEnabled:b,onStatusChange:c}){let[g,h]=(0,e.useReducer)((a,b)=>({...a,...b}),{status:null,loading:!1,showPasswordModal:!1,sudoPassword:"",pendingAction:null,modalError:null,actionError:null,mitmRouterBaseUrl:ak,port443Conflict:null}),{status:i,loading:j,showPasswordModal:k,sudoPassword:l,pendingAction:m,modalError:n,actionError:o,mitmRouterBaseUrl:p,port443Conflict:q}=g,[r,s]=(0,e.useState)(()=>a?.[0]?.key||""),t=i?.isWin===!0,u=t||i?.hasCachedPassword||i?.needsSudoPassword===!1,v=i?.isAdmin!==!1;!v&&(t||i?.hasCachedPassword||i?.needsSudoPassword);let w=(0,e.useCallback)(async()=>{try{let a=await fetch("/api/cli-tools/antigravity-mitm");if(a.ok){let b=await a.json();h({status:b}),b.mitmRouterBaseUrl&&h({mitmRouterBaseUrl:b.mitmRouterBaseUrl}),c?.(b)}}catch{h({status:{running:!1,certExists:!1,dnsStatus:{}}})}},[c]),x=a=>{h({actionError:null}),i&&(u?y(a,""):(h({pendingAction:a}),h({showPasswordModal:!0}),h({modalError:null})))},y=async(c,d,e=!1)=>{h({loading:!0}),h({actionError: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=r?.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:p.trim()||ak,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){h({showPasswordModal:!1}),h({port443Conflict:{owner:a.portOwner,password:d}});return}h({actionError:a.error||`Failed to ${c} MITM server`});return}h({showPasswordModal:!1}),h({sudoPassword:""}),h({port443Conflict:null}),await w()}catch(a){h({actionError:a.message||"Network error"})}finally{h({loading:!1}),h({pendingAction:null})}},z=i?.running;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.Card,{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"}),z?(0,d.jsx)(f.Badge,{variant:"success",size:"sm",children:"Running"}):(0,d.jsx)(f.Badge,{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:i?.certExists},{label:"Trusted",ok:i?.certTrusted},{label:"Server",ok:z}].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 VansAI"]}),(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 → VansAI → 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:"VansAI 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:p,onChange:a=>h({mitmRouterBaseUrl:a.target.value}),placeholder:ak,disabled:z,"aria-label":"VansAI Base URL",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"})]}),!z&&(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:r,onChange:a=>s(a.target.value),placeholder:b?"Enter or pick API key":"sk_9router (default)","aria-label":"API Key",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:[i?.certExists&&!i?.certTrusted&&(0,d.jsxs)("button",{type:"button",onClick:()=>x("trust-cert"),disabled:j,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"]}),z?(0,d.jsxs)("button",{type:"button",onClick:()=>x("stop"),disabled:j,className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-red-500/30 bg-red-500/10 px-4 py-2 text-xs font-medium text-red-500 transition-colors hover:bg-red-500/20 disabled: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",{type:"button",onClick:()=>x("start"),disabled:j||!i||t&&!v,title:t&&!v?"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"]}),z&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Enable DNS per tool below to activate interception"})]}),o&&(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:o})]}),t&&!v&&(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 VansAI as Administrator to use MITM"})]})]})}),(0,d.jsx)(al,{showPasswordModal:k,sudoPassword:l,dispatch:h,loading:j,modalError:n,handleConfirmPassword:()=>{l.trim()?y(m,l):h({modalError:"Sudo password is required"})},port443Conflict:q,handleKillAndStart:()=>{y("start",q?.password||"",!0)}})]})}var an=c(61126);let ao={},ap={};function aq({dnsActive:a,handleDnsToggle:b,handleMappingBlur:c,handleModelMappingChange:e,hasActiveProviders:f,loading:g,mitmHosts:h,modelMappings:i,openModelSelector:j,saveMappings:k,serverRunning:l,tool:m,warning:n}){return(0,d.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex flex-col gap-4",children:[h.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:h.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 ",m.name," traffic through VansAI via MITM."]}),!a&&(0,d.jsx)("p",{className:"text-amber-600 text-[10px] mt-1",children:"⚠️ Enable DNS to edit model mappings"})]}),m.defaultModels?.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-2",children:m.defaultModels.map(b=>(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:b.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[b.alias]||"",onChange:a=>e(b.alias,a.target.value),onBlur:a=>c(b.alias,a.target.value),"aria-label":"Model ID",placeholder:"provider/model-id",disabled:!a,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 ${!a?"opacity-50 cursor-not-allowed":""}`}),i[b.alias]&&(0,d.jsx)("button",{type:"button",onClick:()=>{e(b.alias,""),k({...i,[b.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",{type:"button",onClick:()=>j(b.alias),disabled:!f||!a,className:`rounded border px-2 py-2 text-xs transition-colors sm:py-1.5 ${f&&a?"bg-surface border-border hover:border-primary cursor-pointer":"opacity-50 cursor-not-allowed border-border"}`,children:"Select"})]},b.alias))}),m.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:[a?(0,d.jsxs)("button",{type:"button",onClick:b,disabled:!l||g,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",{type:"button",onClick:b,disabled:!l||g,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"]}),n&&(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:n})]})]})]})}function ar({tool:a,status:{isExpanded:b,hasCachedPassword:c,needsSudoPassword:h,isWin:i}=ap,onToggle:j,serverRunning:k,dnsActive:l,apiKeys:m,activeProviders:n,hasActiveProviders:o,modelAliases:p=ao,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,D]=(0,e.useState)(null),[E,F]=(0,e.useState)({}),[G,H]=(0,e.useState)(!1),[I,J]=(0,e.useState)(null),K=an.TOOL_HOSTS[a.id]??[],L=i||c||!1===h,M=(0,e.useCallback)(async()=>{try{let b=await fetch(`/api/cli-tools/antigravity-mitm/alias?tool=${a.id}`);if(b.ok){let a=await b.json();Object.keys(a.aliases||{}).length>0&&F(a.aliases)}}catch{}},[a.id]),N=(0,e.useRef)(!1),O=(0,e.useCallback)(async()=>{N.current||(N.current=!0,await M())},[M]);(0,e.useCallback)(()=>{b||O(),j()},[b,O,j]);let P=(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]),Q=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)}},R=()=>{y.trim()?Q(A,y):D("Sudo password is required")};return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)(f.Card,{padding:"xs",className:"overflow-hidden",children:[(0,d.jsxs)("button",{type:"button",className:"flex w-full items-start justify-between gap-3 hover:cursor-pointer sm:items-center text-left",onClick:j,"aria-expanded":b,"aria-label":"Toggle section",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"},loading:"lazy",decoding:"async"})}),(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}),k?l?(0,d.jsx)(f.Badge,{variant:"success",size:"sm",children:"Active"}):(0,d.jsx)(f.Badge,{variant:"warning",size:"sm",children:"DNS off"}):(0,d.jsx)(f.Badge,{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.jsx)(aq,{dnsActive:l,handleDnsToggle:()=>{if(!k)return;let a=l?"disable":"enable";L?Q(a,""):(B(a),x(!0),D(null))},handleMappingBlur:(a,b)=>{P({...E,[a]:b})},handleModelMappingChange:(a,b)=>{F(c=>({...c,[a]:b}))},hasActiveProviders:o,loading:s,mitmHosts:K,modelMappings:E,openModelSelector:a=>{J(a),H(!0)},saveMappings:P,serverRunning:k,tool:a,warning: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.Input,{type:"password",placeholder:"Enter sudo password",value:y,onChange:a=>z(a.target.value),onKeyDown:a=>{"Enter"!==a.key||s||R()}}),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.Button,{variant:"ghost",size:"sm",onClick:()=>{x(!1),z(""),D(null)},disabled:s,children:"Cancel"}),(0,d.jsx)(f.Button,{variant:"primary",size:"sm",onClick:R,loading:s,children:"Confirm"})]})]})}),G&&(0,d.jsx)(f.ModelSelectModal,{isOpen:G,onClose:()=>H(!1),onSelect:a=>{if(!I||a.isPlaceholder)return;let b={...E,[I]:a.value};F(b),P(b)},selectedModel:I?E[I]:null,activeProviders:n,modelAliases:p,title:`Select model for ${I}`})]})}c(95385)}};
@@ -1,7 +1,7 @@
1
- "use strict";exports.id=4029,exports.ids=[4029,9614],exports.modules={14029:(a,b,c)=>{c.r(b),c.d(b,{default:()=>l});var d=c(66238),e=c(71183),f=c(34455),g=c(75814),h=c(93864),i=c(99614);let j=/^[a-zA-Z0-9_.\-]+$/;function k({index:a,model:b,isFirst:c,isLast:f,onEdit:g,onMoveUp:h,onMoveDown:i,onRemove:j}){let[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(b);p!==b&&(q(b),o(null));let r=n??b,s=()=>{let a=r.trim();a&&a!==b?g(a):o(null),m(!1)};return(0,d.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,d.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:a+1}),l?(0,d.jsx)("input",{value:r,onChange:a=>o(a.target.value),onBlur:s,onKeyDown:a=>{"Enter"===a.key&&s(),"Escape"===a.key&&(o(null),m(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20","aria-label":`Edit model ${a+1}`}):(0,d.jsx)("button",{type:"button",className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main text-left hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>m(!0),title:"Click to edit","aria-label":`Edit model: ${b}`,children:b}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,d.jsx)("button",{type:"button",onClick:h,disabled:c,className:`p-0.5 rounded ${c?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,d.jsx)("button",{type:"button",onClick:i,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,d.jsx)("button",{type:"button",onClick:j,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function l({isOpen:a,combo:b,onClose:c,onSave:m,activeProviders:n,kindFilter:o=null,forcePrefix:p="",title:q}){let r=b?.name?p&&b.name.startsWith(p)?b.name.slice(p.length):b.name:"",[s,t]=(0,e.useState)(r),[u,v]=(0,e.useState)(b?.models||[]),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)({});(0,e.useRef)(!1);let E=a=>{if(!a.trim())return B("Name is required"),!1;let b=p+a;return j.test(b)?(B(""),!0):(B("Only letters, numbers, -, _ and . allowed"),!1)},F=a=>{let b=a.target.value;p&&b.startsWith(p)&&(b=b.slice(p.length)),t(b),b?E(b):B("")},G=async()=>{E(s)&&(z(!0),await m({name:p+s.trim(),models:u}),z(!1))},H=!!b;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{isOpen:a,onClose:c,title:q||(H?"Edit Combo":"Create Combo"),children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("label",{htmlFor:"combo-name-input",className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,d.jsxs)("div",{className:"flex items-stretch",children:[(0,d.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:p}),(0,d.jsx)("input",{id:"combo-name-input",value:s,onChange:F,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),A&&(0,d.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:A})]}):(0,d.jsx)(g.A,{label:"Combo Name",value:s,onChange:F,placeholder:"my-combo",error:A}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[p?`Auto-prefixed with "${p}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===u.length?(0,d.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,d.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:u.map((a,b)=>(0,d.jsx)(k,{index:b,model:a,isFirst:0===b,isLast:b===u.length-1,onEdit:a=>{let c=[...u];c[b]=a,v(c)},onMoveUp:()=>(a=>{if(0===a)return;let b=[...u];[b[a-1],b[a]]=[b[a],b[a-1]],v(b)})(b),onMoveDown:()=>(a=>{if(a===u.length-1)return;let b=[...u];[b[a],b[a+1]]=[b[a+1],b[a]],v(b)})(b),onRemove:()=>v(u.filter((a,c)=>c!==b))},a))}),(0,d.jsxs)("button",{type:"button",onClick:()=>x(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,d.jsx)(h.A,{onClick:c,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(h.A,{onClick:G,fullWidth:!0,size:"sm",disabled:!s.trim()||!!A||y,children:y?"Saving...":H?"Save":"Create"})]})]})}),w&&(0,d.jsx)(i.default,{isOpen:w,onClose:()=>x(!1),onSelect:a=>{u.includes(a.value)||v([...u,a.value])},onDeselect:a=>{v(u.filter(b=>b!==a.value))},activeProviders:n,modelAliases:C,title:"Add Model to Combo",kindFilter:o,addedModelValues:u,closeOnSelect:!1,onBack:()=>x(!1)})]})}},99614:(a,b,c)=>{c.r(b),c.d(b,{default:()=>n});var d=c(66238),e=c(71183),f=c(34455),g=c(95988),h=c(42148),i=c(55009),j=c(47953),k=c(53207);let l=[...Object.keys(k.zN),...Object.keys(k.IS),...Object.keys(k.nJ),...Object.keys(k.fg)],m=Object.keys(k.IS).filter(a=>k.IS[a].noAuth);function n({isOpen:a,onClose:b,onSelect:c,onDeselect:o,selectedModel:p,activeProviders:q=[],title:r="Select Model",modelAliases:s={},kindFilter:t=null,addedModelValues:u=[],closeOnSelect:v=!0}){let w=(0,e.useMemo)(()=>t?q.filter(a=>{let b=k.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(t)}):q,[q,t]),{getCaps:x}=(0,i.y)(),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)([]),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)({}),I=(0,e.useMemo)(()=>({...k.zN,...k.IS,...k.nJ,...k.fg}),[]),J=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...w.map(a=>a.provider),...t?m.filter(a=>(k.Q2[a]?.serviceKinds||["llm"]).includes(t)):m])].sort((a,b)=>{let c=l.indexOf(a),d=l.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,k.wG)(e),g=I[e]||{name:e,color:"#666"},h=(0,k.mq)(e)||(0,k.gb)(e);if(t&&b.has(t)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(s).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b})),h=E.filter(a=>a.providerAlias===f).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,kind:(0,j.CP)(a),isCustom:!0})),i=b;if(t&&c.has(t)){let a=h.filter(a=>(0,j.CP)(a)===t);0===(i=[...a,...(0,j.KC)(e).filter(a=>(0,j.CP)(a)===t).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})).filter(b=>!a.some(a=>a.value===b.value))]).length&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(i=[{id:e,name:g.name,value:f}])}else{let a=h.filter(a=>!(0,j.CP)(a)||"llm"===(0,j.CP)(a)),c=new Set([...b,...a].map(a=>a.value)),d=(0,j.KC)(e).filter(a=>!(0,j.CP)(a)||"llm"===(0,j.CP)(a)).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})).filter(a=>!c.has(a.value));i=[...a,...b.filter(b=>!a.some(a=>a.value===b.value)),...d]}if(i.length>0){let b=C.find(a=>a.id===e),c=b?.name||g.name;a[e]={name:c,alias:f,color:g.color,models:i}}}else if(h){if(t&&c.has(t))return;let b=q.find(a=>a.provider===e),d=C.find(a=>a.id===e),f=d?.name||b?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(s).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=E.filter(a=>a.providerAlias===e).map(a=>({id:a.id,name:a.name||a.id,value:`${h}/${a.id}`,isCustom:!0})),k=new Set(i.map(a=>a.value)),l=[...i,...j.filter(a=>!k.has(a.value))],m=l.length>0?l:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:m,isCustom:!0,hasModels:l.length>0}}else{var i;let b=(0,j.KC)(e),h=new Set(b.map(a=>a.id)),k=b.length>0,l=Object.entries(s).filter(([a,b])=>b.startsWith(`${f}/`)&&(!k||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=E.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})),...l,...n],p=new Set,q=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),t?c.has(t)?i.filter(a=>a.isPlaceholder||(0,j.CP)(a)===t):i:i.filter(a=>a.isPlaceholder||a.isCustom||!(0,j.CP)(a)||"llm"===(0,j.CP)(a)));0===q.length&&t&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(q=[{id:e,name:g.name,value:f}]),q.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:q})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...G[(0,k.wG)(b)]||[],...G[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[w,s,I,C,E,G,t,q]),K=(0,e.useMemo)(()=>{if(t)return[];if(!y.trim())return A;let a=y.toLowerCase();return A.filter(b=>b.name.toLowerCase().includes(a))},[A,y,t]),L=(0,e.useMemo)(()=>{let a=y.trim().toLowerCase(),b={};return Object.entries(J).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>u.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!u.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[J,y,u]),M=a=>{let d=a?.value||a?.name||a;u.includes(d)&&o?o(a):c(a),v&&(b(),z(""))};return(0,d.jsxs)(f.A,{isOpen:a,onClose:()=>{b(),z("")},title:r,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:y,onChange:a=>z(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[K.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",K.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:K.map(a=>{let b=p===a.name;return(0,d.jsxs)("button",{onClick:()=>M({id:a.name,name:a.name,value:a.name}),className:`
1
+ "use strict";exports.id=4029,exports.ids=[4029,9614],exports.modules={14029:(a,b,c)=>{c.r(b),c.d(b,{default:()=>l});var d=c(66238),e=c(71183),f=c(34455),g=c(75814),h=c(93864),i=c(99614);let j=/^[a-zA-Z0-9_.\-]+$/;function k({index:a,model:b,isFirst:c,isLast:f,onEdit:g,onMoveUp:h,onMoveDown:i,onRemove:j}){let[l,m]=(0,e.useState)(!1),[n,o]=(0,e.useState)(null),[p,q]=(0,e.useState)(b);p!==b&&(q(b),o(null));let r=n??b,s=()=>{let a=r.trim();a&&a!==b?g(a):o(null),m(!1)};return(0,d.jsxs)("div",{className:"group flex min-w-0 items-center gap-1.5 rounded-md bg-black/[0.02] px-2 py-1 transition-colors hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04]",children:[(0,d.jsx)("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:a+1}),l?(0,d.jsx)("input",{value:r,onChange:a=>o(a.target.value),onBlur:s,onKeyDown:a=>{"Enter"===a.key&&s(),"Escape"===a.key&&(o(null),m(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20","aria-label":`Edit model ${a+1}`}):(0,d.jsx)("button",{type:"button",className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main text-left hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>m(!0),title:"Click to edit","aria-label":`Edit model: ${b}`,children:b}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5",children:[(0,d.jsx)("button",{type:"button",onClick:h,disabled:c,className:`p-0.5 rounded ${c?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),(0,d.jsx)("button",{type:"button",onClick:i,disabled:f,className:`p-0.5 rounded ${f?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),(0,d.jsx)("button",{type:"button",onClick:j,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function l({isOpen:a,combo:b,onClose:c,onSave:m,activeProviders:n,kindFilter:o=null,forcePrefix:p="",title:q}){let r=b?.name?p&&b.name.startsWith(p)?b.name.slice(p.length):b.name:"",[s,t]=(0,e.useState)(r),[u,v]=(0,e.useState)(b?.models||[]),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(!1),[A,B]=(0,e.useState)(""),[C,D]=(0,e.useState)({});(0,e.useRef)(!1);let E=a=>{if(!a.trim())return B("Name is required"),!1;let b=p+a;return j.test(b)?(B(""),!0):(B("Only letters, numbers, -, _ and . allowed"),!1)},F=a=>{let b=a.target.value;p&&b.startsWith(p)&&(b=b.slice(p.length)),t(b),b?E(b):B("")},G=async()=>{E(s)&&(z(!0),await m({name:p+s.trim(),models:u}),z(!1))},H=!!b;return(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(f.A,{isOpen:a,onClose:c,title:q||(H?"Edit Combo":"Create Combo"),children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,d.jsxs)("div",{children:[p?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("label",{htmlFor:"combo-name-input",className:"text-sm font-medium mb-1 block",children:"Combo Name"}),(0,d.jsxs)("div",{className:"flex items-stretch",children:[(0,d.jsx)("span",{className:"inline-flex items-center px-2 rounded-l border border-r-0 border-black/10 dark:border-white/10 bg-black/[0.04] dark:bg-white/[0.04] text-text-muted font-mono text-sm",children:p}),(0,d.jsx)("input",{id:"combo-name-input",value:s,onChange:F,placeholder:"my-combo",className:"flex-1 min-w-0 rounded-r border border-black/10 dark:border-white/10 bg-white dark:bg-black/20 px-2 py-1.5 font-mono text-sm outline-none focus:border-primary"})]}),A&&(0,d.jsx)("p",{className:"text-[11px] text-red-500 mt-0.5",children:A})]}):(0,d.jsx)(g.A,{label:"Combo Name",value:s,onChange:F,placeholder:"my-combo",error:A}),(0,d.jsxs)("p",{className:"text-[10px] text-text-muted mt-0.5",children:[p?`Auto-prefixed with "${p}". `:"","Only letters, numbers, -, _ and . allowed"]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("span",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),0===u.length?(0,d.jsxs)("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):(0,d.jsx)("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:u.map((a,b)=>(0,d.jsx)(k,{index:b,model:a,isFirst:0===b,isLast:b===u.length-1,onEdit:a=>{let c=[...u];c[b]=a,v(c)},onMoveUp:()=>(a=>{if(0===a)return;let b=[...u];[b[a-1],b[a]]=[b[a],b[a-1]],v(b)})(b),onMoveDown:()=>(a=>{if(a===u.length-1)return;let b=[...u];[b[a],b[a+1]]=[b[a+1],b[a]],v(b)})(b),onRemove:()=>v(u.filter((a,c)=>c!==b))},a))}),(0,d.jsxs)("button",{type:"button",onClick:()=>x(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[(0,d.jsx)(h.A,{onClick:c,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,d.jsx)(h.A,{onClick:G,fullWidth:!0,size:"sm",disabled:!s.trim()||!!A||y,children:y?"Saving...":H?"Save":"Create"})]})]})}),w&&(0,d.jsx)(i.default,{isOpen:w,onClose:()=>x(!1),onSelect:a=>{u.includes(a.value)||v([...u,a.value])},onDeselect:a=>{v(u.filter(b=>b!==a.value))},activeProviders:n,modelAliases:C,title:"Add Model to Combo",kindFilter:o,addedModelValues:u,closeOnSelect:!1,onBack:()=>x(!1)})]})}},99614:(a,b,c)=>{c.r(b),c.d(b,{default:()=>n});var d=c(66238),e=c(71183),f=c(34455),g=c(95988),h=c(42148),i=c(55009),j=c(47953),k=c(53207);let l=[...Object.keys(k.zN),...Object.keys(k.IS),...Object.keys(k.nJ),...Object.keys(k.fg)],m=Object.keys(k.IS).filter(a=>k.IS[a].noAuth);function n({isOpen:a,onClose:b,onSelect:c,onDeselect:o,selectedModel:p,activeProviders:q=[],title:r="Select Model",modelAliases:s={},kindFilter:t=null,addedModelValues:u=[],closeOnSelect:v=!0}){let w=(0,e.useMemo)(()=>t?q.filter(a=>{let b=k.Q2[a.provider];return(b?.serviceKinds||["llm"]).includes(t)}):q,[q,t]),{getCaps:x}=(0,i.y)(),[y,z]=(0,e.useState)(""),[A,B]=(0,e.useState)([]),[C,D]=(0,e.useState)([]),[E,F]=(0,e.useState)([]),[G,H]=(0,e.useState)({}),[I,J]=(0,e.useState)([]);(0,e.useMemo)(()=>q.filter(a=>"cursor"===a.provider&&a.id).map(a=>a.id),[q]);let K=(0,e.useMemo)(()=>({...k.zN,...k.IS,...k.nJ,...k.fg}),[]),L=(0,e.useMemo)(()=>{let a={},b=new Set(["webSearch","webFetch"]),c=new Set(["image","tts","stt","embedding","imageToText"]),d=new Set(["tts","image","webFetch"]);return[...new Set([...w.map(a=>a.provider),...t?m.filter(a=>(k.Q2[a]?.serviceKinds||["llm"]).includes(t)):m])].sort((a,b)=>{let c=l.indexOf(a),d=l.indexOf(b);return(-1===c?999:c)-(-1===d?999:d)}).forEach(e=>{let f=(0,k.wG)(e),g=K[e]||{name:e,color:"#666"},h=(0,k.mq)(e)||(0,k.gb)(e);if(t&&b.has(t)){a[e]={name:g.name,alias:f,color:g.color,models:[{id:e,name:g.name,value:e}]};return}if(g.passthroughModels){let b=Object.entries(s).filter(([,a])=>a.startsWith(`${f}/`)).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b})),h=E.filter(a=>a.providerAlias===f).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,kind:(0,j.CP)(a),isCustom:!0})),i=b;if(t&&c.has(t)){let a=h.filter(a=>(0,j.CP)(a)===t);0===(i=[...a,...(0,j.KC)(e).filter(a=>(0,j.CP)(a)===t).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})).filter(b=>!a.some(a=>a.value===b.value))]).length&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(i=[{id:e,name:g.name,value:f}])}else{let a=h.filter(a=>!(0,j.CP)(a)||"llm"===(0,j.CP)(a)),c=new Set([...b,...a].map(a=>a.value)),d=(0,j.KC)(e).filter(a=>!(0,j.CP)(a)||"llm"===(0,j.CP)(a)).map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})).filter(a=>!c.has(a.value));i=[...a,...b.filter(b=>!a.some(a=>a.value===b.value)),...d]}if(i.length>0){let b=C.find(a=>a.id===e),c=b?.name||g.name;a[e]={name:c,alias:f,color:g.color,models:i}}}else if(h){if(t&&c.has(t))return;let b=q.find(a=>a.provider===e),d=C.find(a=>a.id===e),f=d?.name||b?.name||g.name,h=b?.providerSpecificData?.prefix||d?.prefix||e,i=Object.entries(s).filter(([,a])=>a.startsWith(`${e}/`)).map(([a,b])=>({id:b.replace(`${e}/`,""),name:a,value:`${h}/${b.replace(`${e}/`,"")}`})),j=E.filter(a=>a.providerAlias===e).map(a=>({id:a.id,name:a.name||a.id,value:`${h}/${a.id}`,isCustom:!0})),k=new Set(i.map(a=>a.value)),l=[...i,...j.filter(a=>!k.has(a.value))],m=l.length>0?l:[{id:`__placeholder__${e}`,name:`${h}/model-id`,value:`${h}/model-id`,isPlaceholder:!0}];a[e]={name:f,alias:h,color:g.color,models:m,isCustom:!0,hasModels:l.length>0}}else{var i;let b="cursor"===e&&I.length>0?I:(0,j.KC)(e),h=new Set(b.map(a=>a.id)),k=b.length>0,l=Object.entries(s).filter(([a,b])=>b.startsWith(`${f}/`)&&(!k||a===b.replace(`${f}/`,""))&&!h.has(b.replace(`${f}/`,""))).map(([a,b])=>({id:b.replace(`${f}/`,""),name:a,value:b,isCustom:!0})),m=new Set(l.map(a=>a.id)),n=E.filter(a=>a.providerAlias===f&&!h.has(a.id)&&!m.has(a.id)).map(a=>({id:a.id,name:a.name||a.id,value:`${f}/${a.id}`,isCustom:!0})),o=[...b.map(a=>({id:a.id,name:a.name,value:`${f}/${a.id}`,kind:(0,j.CP)(a)})),...l,...n],p=new Set,q=(i=o.filter(a=>!p.has(a.value)&&(p.add(a.value),!0)),t?c.has(t)?i.filter(a=>a.isPlaceholder||(0,j.CP)(a)===t):i:i.filter(a=>a.isPlaceholder||a.isCustom||!(0,j.CP)(a)||"llm"===(0,j.CP)(a)));0===q.length&&t&&d.has(t)&&(g.serviceKinds||["llm"]).includes(t)&&(q=[{id:e,name:g.name,value:f}]),q.length>0&&(a[e]={name:g.name,alias:f,color:g.color,models:q})}}),Object.entries(a).forEach(([b,c])=>{let d=new Set([...G[(0,k.wG)(b)]||[],...G[b]||[]]);0!==d.size&&(c.models=c.models.filter(a=>!d.has(a.id)),0===c.models.length&&delete a[b])}),a},[w,s,K,C,E,G,t,q,I]),M=(0,e.useMemo)(()=>{if(t)return[];if(!y.trim())return A;let a=y.toLowerCase();return A.filter(b=>b.name.toLowerCase().includes(a))},[A,y,t]),N=(0,e.useMemo)(()=>{let a=y.trim().toLowerCase(),b={};return Object.entries(L).forEach(([c,d])=>{var e;let f=d.models;if(a){let b=d.name.toLowerCase().includes(a);if(0===(f=f.filter(b=>b.name.toLowerCase().includes(a)||b.id.toLowerCase().includes(a))).length&&!b)return}b[c]={...d,models:[...(e=f).filter(a=>u.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name)),...e.filter(a=>!u.includes(a.value)).sort((a,b)=>a.name.localeCompare(b.name))]}}),b},[L,y,u]),O=a=>{let d=a?.value||a?.name||a;u.includes(d)&&o?o(a):c(a),v&&(b(),z(""))};return(0,d.jsxs)(f.A,{isOpen:a,onClose:()=>{b(),z("")},title:r,size:"md",className:"p-4!",footer:null,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 mb-3 px-2.5 py-2 bg-primary/8 border border-primary/20 rounded-lg text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary shrink-0",style:{fontSize:"14px"},children:"info"}),(0,d.jsx)("span",{children:"Click to add, click again to remove. Changes are saved automatically."})]}),(0,d.jsx)("div",{className:"mb-3",children:(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:y,onChange:a=>z(a.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,d.jsxs)("div",{className:"max-h-[400px] overflow-y-auto space-y-3",children:[M.length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",M.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:M.map(a=>{let b=p===a.name;return(0,d.jsxs)("button",{onClick:()=>O({id:a.name,name:a.name,value:a.name}),className:`
2
2
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer flex items-center gap-1
3
3
  ${b?"bg-primary text-white border-primary":u.includes(a.name)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
4
- `,children:[u.includes(a.name)&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a.name]},a.id)})})]}),Object.entries(L).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)(g.A,{src:`/providers/${a}.webp`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=p===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>M(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
4
+ `,children:[u.includes(a.name)&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),a.name]},a.id)})})]}),Object.entries(N).map(([a,b])=>(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,d.jsx)(g.A,{src:`/providers/${a}.webp`,alt:b.name,size:14,fallbackText:(b.name||a).slice(0,2).toUpperCase(),fallbackColor:b.color}),(0,d.jsx)("span",{className:"text-xs font-medium text-primary",children:b.name}),(0,d.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",b.models.length,")"]})]}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:b.models.map(a=>{let b=p===a.value,c=a.isPlaceholder;return(0,d.jsx)("button",{onClick:()=>O(a),title:c?"Select to pre-fill, then edit model ID in the input":void 0,className:`
5
5
  px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
6
6
  ${c?"border-dashed border-border text-text-muted hover:border-primary/50 hover:text-primary bg-surface italic":b?"bg-primary text-white border-primary":u.includes(a.value)?"bg-primary border-primary text-white hover:bg-primary-hover":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
7
- `,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[u.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,d.jsx)(h.A,{caps:x(a.value)})]}):(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)(h.A,{caps:x(a.value)})]})]})},a.value)})})]},a)),0===Object.keys(L).length&&0===K.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}}};
7
+ `,children:(0,d.jsxs)("span",{className:"flex items-center gap-1",children:[u.includes(a.value)&&!c&&(0,d.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"10px"},children:"check"}),c?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[11px]",children:"edit"}),a.name]}):a.isCustom?(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)("span",{className:"text-[9px] opacity-60 font-normal",children:"custom"}),(0,d.jsx)(h.A,{caps:x(a.value)})]}):(0,d.jsxs)(d.Fragment,{children:[a.name,(0,d.jsx)(h.A,{caps:x(a.value)})]})]})},a.value)})})]},a)),0===Object.keys(N).length&&0===M.length&&(0,d.jsxs)("div",{className:"text-center py-4 text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-2xl mb-1 block",children:"search_off"}),(0,d.jsx)("p",{className:"text-xs",children:"No models found"})]})]})]})}}};
@@ -40,4 +40,4 @@
40
40
  <style>body{font-family:system-ui;display:flex;justify-content:center;align-items:center;height:100vh;margin:0;background:#f5f5f5}.c{text-align:center;padding:2rem;background:#fff;border-radius:8px;box-shadow:0 2px 10px rgba(0,0,0,.1)}.i{color:${a?"#22c55e":"#ef4444"};font-size:3rem}h1{margin:1rem 0}p{color:#666}</style>
41
41
  </head><body><div class="c"><div class="i">${a?"&#10003;":"&#10007;"}</div><h1>${c}</h1><p>${d}</p><p>Closing in <span id="cd">3</span>s...</p>
42
42
  <script>let n=3;const c=document.getElementById("cd");const t=setInterval(()=>{n--;c.textContent=n;if(n<=0){clearInterval(t);window.close();}},1000);</script>
43
- </div></body></html>`}function q(a){return new Promise(b=>{if(i)return void b({success:!0});let d=e().createServer(async(b,d)=>{let e=new f.URL(b.url,"http://localhost");if("/callback"!==e.pathname&&"/auth/callback"!==e.pathname){d.writeHead(404),d.end("Not found");return}let g=e.searchParams.get("code"),h=e.searchParams.get("state"),i=e.searchParams.get("error"),j=h?l.get(h):null;if(j){try{if(i)throw Error(e.searchParams.get("error_description")||i);if(!g)throw Error("No authorization code received");let{exchangeTokens:a}=await Promise.all([c.e(3398),c.e(7010),c.e(7916),c.e(2445),c.e(32),c.e(9212),c.e(4574),c.e(2557),c.e(6767)]).then(c.bind(c,96975)),{createProviderConnection:b}=await c.e(6820).then(c.bind(c,46820)),f=await a("codex",g,j.redirectUri,j.codeVerifier,h),k=await b({provider:"codex",authType:"oauth",...f,expiresAt:f.expiresIn?new Date(Date.now()+1e3*f.expiresIn).toISOString():null,testStatus:"active"});j.status="done",j.connectionId=k.id,j.email=k.email,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!0,"You can close this window."))}catch(a){j.status="error",j.error=a.message,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!1,a.message))}finally{r()}return}let k=`http://localhost:${a}/callback${e.search}`;d.writeHead(302,{Location:k}),d.end(),r()});d.listen(k,"127.0.0.1",()=>{i=d,j=setTimeout(()=>r(),3e5),b({success:!0})}),d.on("error",a=>{"EADDRINUSE"===a.code?b({success:!1,reason:"port_busy"}):b({success:!1,reason:a.message})})})}function r(){j&&(clearTimeout(j),j=null),i&&(i.close(),i=null)}let s=null,t=null,u=new Map;function v({state:a,codeVerifier:b,redirectUri:c}){return!!a&&!!b&&!!c&&(u.set(a,{codeVerifier:b,redirectUri:c,status:"pending",createdAt:Date.now()}),!0)}function w(a){return u.get(a)||null}function x(a){u.delete(a)}function y(a){return new Promise(b=>{if(s)return void b({success:!0});let d=e().createServer(async(b,d)=>{let e=new f.URL(b.url,"http://localhost");if("/callback"!==e.pathname&&"/auth/callback"!==e.pathname){d.writeHead(404),d.end("Not found");return}let g=e.searchParams.get("code"),h=e.searchParams.get("state"),i=e.searchParams.get("error"),j=h?u.get(h):null;if(j){try{if(i)throw Error(e.searchParams.get("error_description")||i);if(!g)throw Error("No authorization code received");let{exchangeTokens:a}=await Promise.all([c.e(3398),c.e(7010),c.e(7916),c.e(2445),c.e(32),c.e(9212),c.e(4574),c.e(2557),c.e(6767)]).then(c.bind(c,96975)),{createProviderConnection:b}=await c.e(6820).then(c.bind(c,46820)),f=await a("xai",g,j.redirectUri,j.codeVerifier,h),k=await b({provider:"xai",authType:"oauth",...f,expiresAt:f.expiresIn?new Date(Date.now()+1e3*f.expiresIn).toISOString():null,testStatus:"active"});j.status="done",j.connectionId=k.id,j.email=k.email,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!0,"You can close this window."))}catch(a){j.status="error",j.error=a.message,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!1,a.message))}finally{z()}return}let k=`http://localhost:${a}/callback${e.search}`;d.writeHead(302,{Location:k}),d.end(),z()});d.listen(56121,"127.0.0.1",()=>{s=d,t=setTimeout(()=>z(),3e5),b({success:!0})}),d.on("error",a=>{"EADDRINUSE"===a.code?b({success:!1,reason:"port_busy"}):b({success:!1,reason:a.message})})})}function z(){t&&(clearTimeout(t),t=null),s&&(s.close(),s=null)}},26254:(a,b,c)=>{c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},59824:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,Op:()=>A,S6:()=>s,Td:()=>B,Tx:()=>q,WN:()=>t,Ww:()=>D,YT:()=>n,ZL:()=>m,aV:()=>u,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,qp:()=>C,w1:()=>x});var d=c(21820),e=c(24567),f=c(68711);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.dG,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr.kimi,clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||process.env.KIMI_OAUTH_CLIENT_ID||f.xq.kimi?.clientId||f.sr.kimi?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.zcode},B={...f.sr.kimchi},C={...f.sr["grok-cli"]},D=3e5}};
43
+ </div></body></html>`}function q(a){return new Promise(b=>{if(i)return void b({success:!0});let d=e().createServer(async(b,d)=>{let e=new f.URL(b.url,"http://localhost");if("/callback"!==e.pathname&&"/auth/callback"!==e.pathname){d.writeHead(404),d.end("Not found");return}let g=e.searchParams.get("code"),h=e.searchParams.get("state"),i=e.searchParams.get("error"),j=h?l.get(h):null;if(j){try{if(i)throw Error(e.searchParams.get("error_description")||i);if(!g)throw Error("No authorization code received");let{exchangeTokens:a}=await Promise.all([c.e(3398),c.e(7216),c.e(7010),c.e(7916),c.e(2445),c.e(32),c.e(3235),c.e(9212),c.e(4574),c.e(2557),c.e(5198)]).then(c.bind(c,96975)),{createProviderConnection:b}=await c.e(6820).then(c.bind(c,46820)),f=await a("codex",g,j.redirectUri,j.codeVerifier,h),k=await b({provider:"codex",authType:"oauth",...f,expiresAt:f.expiresIn?new Date(Date.now()+1e3*f.expiresIn).toISOString():null,testStatus:"active"});j.status="done",j.connectionId=k.id,j.email=k.email,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!0,"You can close this window."))}catch(a){j.status="error",j.error=a.message,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!1,a.message))}finally{r()}return}let k=`http://localhost:${a}/callback${e.search}`;d.writeHead(302,{Location:k}),d.end(),r()});d.listen(k,"127.0.0.1",()=>{i=d,j=setTimeout(()=>r(),3e5),b({success:!0})}),d.on("error",a=>{"EADDRINUSE"===a.code?b({success:!1,reason:"port_busy"}):b({success:!1,reason:a.message})})})}function r(){j&&(clearTimeout(j),j=null),i&&(i.close(),i=null)}let s=null,t=null,u=new Map;function v({state:a,codeVerifier:b,redirectUri:c}){return!!a&&!!b&&!!c&&(u.set(a,{codeVerifier:b,redirectUri:c,status:"pending",createdAt:Date.now()}),!0)}function w(a){return u.get(a)||null}function x(a){u.delete(a)}function y(a){return new Promise(b=>{if(s)return void b({success:!0});let d=e().createServer(async(b,d)=>{let e=new f.URL(b.url,"http://localhost");if("/callback"!==e.pathname&&"/auth/callback"!==e.pathname){d.writeHead(404),d.end("Not found");return}let g=e.searchParams.get("code"),h=e.searchParams.get("state"),i=e.searchParams.get("error"),j=h?u.get(h):null;if(j){try{if(i)throw Error(e.searchParams.get("error_description")||i);if(!g)throw Error("No authorization code received");let{exchangeTokens:a}=await Promise.all([c.e(3398),c.e(7216),c.e(7010),c.e(7916),c.e(2445),c.e(32),c.e(3235),c.e(9212),c.e(4574),c.e(2557),c.e(5198)]).then(c.bind(c,96975)),{createProviderConnection:b}=await c.e(6820).then(c.bind(c,46820)),f=await a("xai",g,j.redirectUri,j.codeVerifier,h),k=await b({provider:"xai",authType:"oauth",...f,expiresAt:f.expiresIn?new Date(Date.now()+1e3*f.expiresIn).toISOString():null,testStatus:"active"});j.status="done",j.connectionId=k.id,j.email=k.email,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!0,"You can close this window."))}catch(a){j.status="error",j.error=a.message,d.writeHead(200,{"Content-Type":"text/html; charset=utf-8"}),d.end(p(!1,a.message))}finally{z()}return}let k=`http://localhost:${a}/callback${e.search}`;d.writeHead(302,{Location:k}),d.end(),z()});d.listen(56121,"127.0.0.1",()=>{s=d,t=setTimeout(()=>z(),3e5),b({success:!0})}),d.on("error",a=>{"EADDRINUSE"===a.code?b({success:!1,reason:"port_busy"}):b({success:!1,reason:a.message})})})}function z(){t&&(clearTimeout(t),t=null),s&&(s.close(),s=null)}},26254:(a,b,c)=>{c.d(b,{$N:()=>f,OK:()=>g,Zl:()=>h,lz:()=>i});var d=c(55511),e=c.n(d);function f(a=32){return e().randomBytes(a).toString("base64url")}function g(a){return e().createHash("sha256").update(a).digest("base64url")}function h(){return e().randomBytes(32).toString("base64url")}function i(a=32){let b=f(a),c=g(b);return{codeVerifier:b,codeChallenge:c,state:h()}}},59824:(a,b,c)=>{c.d(b,{DI:()=>i,Hp:()=>k,LT:()=>j,MZ:()=>v,Nl:()=>z,Nu:()=>p,OV:()=>h,Op:()=>A,S6:()=>s,Td:()=>B,Tx:()=>q,WN:()=>t,Ww:()=>D,YT:()=>n,ZL:()=>m,aV:()=>u,cD:()=>o,f7:()=>y,hF:()=>l,lB:()=>w,qp:()=>C,w1:()=>x});var d=c(21820),e=c(24567),f=c(68711);function g(){let a=(0,d.platform)(),b=(0,d.arch)();return"darwin"===a?"arm64"===b?2:1:"linux"===a?"arm64"===b?4:3:5*("win32"===a)}let h={...f.sr.claude},i={...f.sr.codex},j={...e.dG,...f.sr["gemini-cli"]},k={...f.sr.qwen},l={...f.sr.qoder},m={...f.sr.iflow},n={...e.XP,...f.sr.antigravity,loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:g(),pluginType:2})};function o(){return{ideType:9,platform:g(),pluginType:2}}({...f.sr.openai});let p={...f.sr.github},q={...f.sr.kiro},r=/^[a-z]{2}-[a-z]+-\d{1,2}$/;function s(a){if("string"!=typeof a||!r.test(a))throw Error("Invalid region");return a}let t={...f.sr.cursor,tokenStoragePaths:{linux:"~/.config/Cursor/User/globalStorage/state.vscdb",macos:"/Users/<user>/Library/Application Support/Cursor/User/globalStorage/state.vscdb",windows:"%APPDATA%\\Cursor\\User\\globalStorage\\state.vscdb"}},u={...f.sr.kimi,clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||process.env.KIMI_OAUTH_CLIENT_ID||f.xq.kimi?.clientId||f.sr.kimi?.clientId},v={...f.sr.kilocode},w={...f.sr.cline},x={...f.sr.clinepass},y={...f.sr.gitlab},z={...f.sr["codebuddy-cn"]},A={...f.sr.zcode},B={...f.sr.kimchi},C={...f.sr["grok-cli"]},D=3e5}};
@@ -0,0 +1 @@
1
+ exports.id=4203,exports.ids=[4203,6584],exports.modules={5759:(a,b,c)=>{"use strict";c.d(b,{k:()=>e});let d=[];for(let a=0;a<256;++a)d.push((a+256).toString(16).slice(1));function e(a,b=0){return(d[a[b+0]]+d[a[b+1]]+d[a[b+2]]+d[a[b+3]]+"-"+d[a[b+4]]+d[a[b+5]]+"-"+d[a[b+6]]+d[a[b+7]]+"-"+d[a[b+8]]+d[a[b+9]]+"-"+d[a[b+10]]+d[a[b+11]]+d[a[b+12]]+d[a[b+13]]+d[a[b+14]]+d[a[b+15]]).toLowerCase()}},23123:(a,b,c)=>{"use strict";c.d(b,{A:()=>i});var d=c(77598);let e={randomUUID:d.randomUUID},f=new Uint8Array(256),g=f.length;var h=c(5759);let i=function(a,b,c){if(e.randomUUID&&!b&&!a)return e.randomUUID();var i=a,j=c;let k=(i=i||{}).random??i.rng?.()??(g>f.length-16&&((0,d.randomFillSync)(f),g=0),f.slice(g,g+=16));if(k.length<16)throw Error("Random bytes length must be >= 16");if(k[6]=15&k[6]|64,k[8]=63&k[8]|128,b){if((j=j||0)<0||j+16>b.length)throw RangeError(`UUID byte range ${j}:${j+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[j+a]=k[a];return b}return(0,h.k)(k)}},70690:function(a,b,c){a.exports=function(a,b){var d=[function(a,b,c){a.exports=c(34)},function(a,b,c){var d=c(29)("wks"),e=c(33),f=c(2).Symbol,g="function"==typeof f;(a.exports=function(a){return d[a]||(d[a]=g&&f[a]||(g?f:e)("Symbol."+a))}).store=d},function(a,b){var c=a.exports="u">typeof window&&window.Math==Math?window:"u">typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=c)},function(a,b,c){var d=c(9);a.exports=function(a){if(!d(a))throw TypeError(a+" is not an object!");return a}},function(a,b,c){a.exports=!c(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(a,b,c){var d=c(12),e=c(17);a.exports=c(4)?function(a,b,c){return d.f(a,b,e(1,c))}:function(a,b,c){return a[b]=c,a}},function(a,b){var c=a.exports={version:"2.4.0"};"number"==typeof __e&&(__e=c)},function(a,b,c){var d=c(14);a.exports=function(a,b,c){if(d(a),void 0===b)return a;switch(c){case 1:return function(c){return a.call(b,c)};case 2:return function(c,d){return a.call(b,c,d)};case 3:return function(c,d,e){return a.call(b,c,d,e)}}return function(){return a.apply(b,arguments)}}},function(a,b){var c={}.hasOwnProperty;a.exports=function(a,b){return c.call(a,b)}},function(a,b){a.exports=function(a){return"object"==typeof a?null!==a:"function"==typeof a}},function(a,b){a.exports={}},function(a,b){var c={}.toString;a.exports=function(a){return c.call(a).slice(8,-1)}},function(a,b,c){var d=c(3),e=c(26),f=c(32),g=Object.defineProperty;b.f=c(4)?Object.defineProperty:function(a,b,c){if(d(a),b=f(b,!0),d(c),e)try{return g(a,b,c)}catch(a){}if("get"in c||"set"in c)throw TypeError("Accessors not supported!");return"value"in c&&(a[b]=c.value),a}},function(a,b,c){var d=c(42),e=c(15);a.exports=function(a){return d(e(a))}},function(a,b){a.exports=function(a){if("function"!=typeof a)throw TypeError(a+" is not a function!");return a}},function(a,b){a.exports=function(a){if(void 0==a)throw TypeError("Can't call method on "+a);return a}},function(a,b,c){var d=c(9),e=c(2).document,f=d(e)&&d(e.createElement);a.exports=function(a){return f?e.createElement(a):{}}},function(a,b){a.exports=function(a,b){return{enumerable:!(1&a),configurable:!(2&a),writable:!(4&a),value:b}}},function(a,b,c){var d=c(12).f,e=c(8),f=c(1)("toStringTag");a.exports=function(a,b,c){a&&!e(a=c?a:a.prototype,f)&&d(a,f,{configurable:!0,value:b})}},function(a,b,c){var d=c(29)("keys"),e=c(33);a.exports=function(a){return d[a]||(d[a]=e(a))}},function(a,b){var c=Math.ceil,d=Math.floor;a.exports=function(a){return isNaN(a*=1)?0:(a>0?d:c)(a)}},function(a,b,c){var d=c(11),e=c(1)("toStringTag"),f="Arguments"==d(function(){return arguments}()),g=function(a,b){try{return a[b]}catch(a){}};a.exports=function(a){var b,c,h;return void 0===a?"Undefined":null===a?"Null":"string"==typeof(c=g(b=Object(a),e))?c:f?d(b):"Object"==(h=d(b))&&"function"==typeof b.callee?"Arguments":h}},function(a,b){a.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(a,b,c){var d=c(2),e=c(6),f=c(7),g=c(5),h="prototype",i=function(a,b,c){var j,k,l,m=a&i.F,n=a&i.G,o=a&i.S,p=a&i.P,q=a&i.B,r=a&i.W,s=n?e:e[b]||(e[b]={}),t=s[h],u=n?d:o?d[b]:(d[b]||{})[h];for(j in n&&(c=b),c)(k=!m&&u&&void 0!==u[j])&&j in s||(l=k?u[j]:c[j],s[j]=n&&"function"!=typeof u[j]?c[j]:q&&k?f(l,d):r&&u[j]==l?function(a){var b=function(b,c,d){if(this instanceof a){switch(arguments.length){case 0:return new a;case 1:return new a(b);case 2:return new a(b,c)}return new a(b,c,d)}return a.apply(this,arguments)};return b[h]=a[h],b}(l):p&&"function"==typeof l?f(Function.call,l):l,p&&((s.virtual||(s.virtual={}))[j]=l,a&i.R&&t&&!t[j]&&g(t,j,l)))};i.F=1,i.G=2,i.S=4,i.P=8,i.B=16,i.W=32,i.U=64,i.R=128,a.exports=i},function(a,b){a.exports=function(a){try{return!!a()}catch(a){return!0}}},function(a,b,c){a.exports=c(2).document&&document.documentElement},function(a,b,c){a.exports=!c(4)&&!c(24)(function(){return 7!=Object.defineProperty(c(16)("div"),"a",{get:function(){return 7}}).a})},function(a,b,c){"use strict";var d=c(28),e=c(23),f=c(57),g=c(5),h=c(8),i=c(10),j=c(45),k=c(18),l=c(52),m=c(1)("iterator"),n=!([].keys&&"next"in[].keys()),o="keys",p="values",q=function(){return this};a.exports=function(a,b,c,r,s,t,u){j(c,b,r);var v,w,x,y=function(a){if(!n&&a in C)return C[a];switch(a){case o:case p:return function(){return new c(this,a)}}return function(){return new c(this,a)}},z=b+" Iterator",A=s==p,B=!1,C=a.prototype,D=C[m]||C["@@iterator"]||s&&C[s],E=D||y(s),F=s?A?y("entries"):E:void 0,G="Array"==b&&C.entries||D;if(G&&(x=l(G.call(new a)))!==Object.prototype&&(k(x,z,!0),d||h(x,m)||g(x,m,q)),A&&D&&D.name!==p&&(B=!0,E=function(){return D.call(this)}),(!d||u)&&(n||B||!C[m])&&g(C,m,E),i[b]=E,i[z]=q,s)if(v={values:A?E:y(p),keys:t?E:y(o),entries:F},u)for(w in v)w in C||f(C,w,v[w]);else e(e.P+e.F*(n||B),b,v);return v}},function(a,b){a.exports=!0},function(a,b,c){var d=c(2),e="__core-js_shared__",f=d[e]||(d[e]={});a.exports=function(a){return f[a]||(f[a]={})}},function(a,b,c){var d,e,f,g=c(7),h=c(41),i=c(25),j=c(16),k=c(2),l=k.process,m=k.setImmediate,n=k.clearImmediate,o=k.MessageChannel,p=0,q={},r="onreadystatechange",s=function(){var a=+this;if(q.hasOwnProperty(a)){var b=q[a];delete q[a],b()}},t=function(a){s.call(a.data)};m&&n||(m=function(a){for(var b=[],c=1;arguments.length>c;)b.push(arguments[c++]);return q[++p]=function(){h("function"==typeof a?a:Function(a),b)},d(p),p},n=function(a){delete q[a]},"process"==c(11)(l)?d=function(a){l.nextTick(g(s,a,1))}:o?(f=(e=new o).port2,e.port1.onmessage=t,d=g(f.postMessage,f,1)):k.addEventListener&&"function"==typeof postMessage&&!k.importScripts?(d=function(a){k.postMessage(a+"","*")},k.addEventListener("message",t,!1)):d=r in j("script")?function(a){i.appendChild(j("script"))[r]=function(){i.removeChild(this),s.call(a)}}:function(a){setTimeout(g(s,a,1),0)}),a.exports={set:m,clear:n}},function(a,b,c){var d=c(20),e=Math.min;a.exports=function(a){return a>0?e(d(a),0x1fffffffffffff):0}},function(a,b,c){var d=c(9);a.exports=function(a,b){var c,e;if(!d(a))return a;if(b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a))||"function"==typeof(c=a.valueOf)&&!d(e=c.call(a))||!b&&"function"==typeof(c=a.toString)&&!d(e=c.call(a)))return e;throw TypeError("Can't convert object to primitive value")}},function(a,b){var c=0,d=Math.random();a.exports=function(a){return"Symbol(".concat(void 0===a?"":a,")_",(++c+d).toString(36))}},function(a,b,c){"use strict";function d(a){return(0,i.createHash)("sha256").update(a).digest("hex")}function e(a){switch(j){case"darwin":return a.split("IOPlatformUUID")[1].split("\n")[0].replace(/\=|\s+|\"/gi,"").toLowerCase();case"win32":return a.toString().split("REG_SZ")[1].replace(/\r+|\n+|\s+/gi,"").toLowerCase();case"linux":case"freebsd":return a.toString().replace(/\r+|\n+|\s+/gi,"").toLowerCase();default:throw Error("Unsupported platform: "+process.platform)}}Object.defineProperty(b,"__esModule",{value:!0});var f,g=(f=c(35))&&f.__esModule?f:{default:f};b.machineIdSync=function(a){var b=e((0,h.execSync)(k[j]).toString());return a?b:d(b)},b.machineId=function(a){return new g.default(function(b,c){return(0,h.exec)(k[j],{},function(f,g,h){if(f)return c(Error("Error while obtaining machine id: "+f.stack));var i=e(g.toString());return b(a?i:d(i))})})};var h=c(70),i=c(71),j=process.platform,k={darwin:"ioreg -rd1 -c IOPlatformExpertDevice",win32:{native:"%windir%\\System32",mixed:"%windir%\\sysnative\\cmd.exe /c %windir%\\System32"}["win32"!==process.platform?"":"ia32"===process.arch&&process.env.hasOwnProperty("PROCESSOR_ARCHITEW6432")?"mixed":"native"]+"\\REG.exe QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",linux:"( cat /var/lib/dbus/machine-id /etc/machine-id 2> /dev/null || hostname ) | head -n 1 || :",freebsd:"kenv -q smbios.system.uuid || sysctl -n kern.hostuuid"}},function(a,b,c){a.exports={default:c(36),__esModule:!0}},function(a,b,c){c(66),c(68),c(69),c(67),a.exports=c(6).Promise},function(a,b){a.exports=function(){}},function(a,b){a.exports=function(a,b,c,d){if(!(a instanceof b)||void 0!==d&&d in a)throw TypeError(c+": incorrect invocation!");return a}},function(a,b,c){var d=c(13),e=c(31),f=c(62);a.exports=function(a){return function(b,c,g){var h,i=d(b),j=e(i.length),k=f(g,j);if(a&&c!=c){for(;j>k;)if((h=i[k++])!=h)return!0}else for(;j>k;k++)if((a||k in i)&&i[k]===c)return a||k||0;return!a&&-1}}},function(a,b,c){var d=c(7),e=c(44),f=c(43),g=c(3),h=c(31),i=c(64),j={},k={},b=a.exports=function(a,b,c,l,m){var n,o,p,q,r=m?function(){return a}:i(a),s=d(c,l,b?2:1),t=0;if("function"!=typeof r)throw TypeError(a+" is not iterable!");if(f(r)){for(n=h(a.length);n>t;t++)if((q=b?s(g(o=a[t])[0],o[1]):s(a[t]))===j||q===k)return q}else for(p=r.call(a);!(o=p.next()).done;)if((q=e(p,s,o.value,b))===j||q===k)return q};b.BREAK=j,b.RETURN=k},function(a,b){a.exports=function(a,b,c){var d=void 0===c;switch(b.length){case 0:return d?a():a.call(c);case 1:return d?a(b[0]):a.call(c,b[0]);case 2:return d?a(b[0],b[1]):a.call(c,b[0],b[1]);case 3:return d?a(b[0],b[1],b[2]):a.call(c,b[0],b[1],b[2]);case 4:return d?a(b[0],b[1],b[2],b[3]):a.call(c,b[0],b[1],b[2],b[3])}return a.apply(c,b)}},function(a,b,c){var d=c(11);a.exports=Object("z").propertyIsEnumerable(0)?Object:function(a){return"String"==d(a)?a.split(""):Object(a)}},function(a,b,c){var d=c(10),e=c(1)("iterator"),f=Array.prototype;a.exports=function(a){return void 0!==a&&(d.Array===a||f[e]===a)}},function(a,b,c){var d=c(3);a.exports=function(a,b,c,e){try{return e?b(d(c)[0],c[1]):b(c)}catch(b){var f=a.return;throw void 0!==f&&d(f.call(a)),b}}},function(a,b,c){"use strict";var d=c(49),e=c(17),f=c(18),g={};c(5)(g,c(1)("iterator"),function(){return this}),a.exports=function(a,b,c){a.prototype=d(g,{next:e(1,c)}),f(a,b+" Iterator")}},function(a,b,c){var d=c(1)("iterator"),e=!1;try{var f=[7][d]();f.return=function(){e=!0},Array.from(f,function(){throw 2})}catch(a){}a.exports=function(a,b){if(!b&&!e)return!1;var c=!1;try{var f=[7],g=f[d]();g.next=function(){return{done:c=!0}},f[d]=function(){return g},a(f)}catch(a){}return c}},function(a,b){a.exports=function(a,b){return{value:b,done:!!a}}},function(a,b,c){var d=c(2),e=c(30).set,f=d.MutationObserver||d.WebKitMutationObserver,g=d.process,h=d.Promise,i="process"==c(11)(g);a.exports=function(){var a,b,c,j=function(){var d,e;for(i&&(d=g.domain)&&d.exit();a;){e=a.fn,a=a.next;try{e()}catch(d){throw a?c():b=void 0,d}}b=void 0,d&&d.enter()};if(i)c=function(){g.nextTick(j)};else if(f){var k=!0,l=document.createTextNode("");new f(j).observe(l,{characterData:!0}),c=function(){l.data=k=!k}}else if(h&&h.resolve){var m=h.resolve();c=function(){m.then(j)}}else c=function(){e.call(d,j)};return function(d){var e={fn:d,next:void 0};b&&(b.next=e),a||(a=e,c()),b=e}}},function(a,b,c){var d=c(3),e=c(50),f=c(22),g=c(19)("IE_PROTO"),h=function(){},i="prototype",j=function(){var a,b=c(16)("iframe"),d=f.length;for(b.style.display="none",c(25).appendChild(b),b.src="javascript:",(a=b.contentWindow.document).open(),a.write("<script>document.F=Object<\/script>"),a.close(),j=a.F;d--;)delete j[i][f[d]];return j()};a.exports=Object.create||function(a,b){var c;return null!==a?(h[i]=d(a),c=new h,h[i]=null,c[g]=a):c=j(),void 0===b?c:e(c,b)}},function(a,b,c){var d=c(12),e=c(3),f=c(54);a.exports=c(4)?Object.defineProperties:function(a,b){e(a);for(var c,g=f(b),h=g.length,i=0;h>i;)d.f(a,c=g[i++],b[c]);return a}},function(a,b,c){var d=c(55),e=c(17),f=c(13),g=c(32),h=c(8),i=c(26),j=Object.getOwnPropertyDescriptor;b.f=c(4)?j:function(a,b){if(a=f(a),b=g(b,!0),i)try{return j(a,b)}catch(a){}if(h(a,b))return e(!d.f.call(a,b),a[b])}},function(a,b,c){var d=c(8),e=c(63),f=c(19)("IE_PROTO"),g=Object.prototype;a.exports=Object.getPrototypeOf||function(a){return d(a=e(a),f)?a[f]:"function"==typeof a.constructor&&a instanceof a.constructor?a.constructor.prototype:a instanceof Object?g:null}},function(a,b,c){var d=c(8),e=c(13),f=c(39)(!1),g=c(19)("IE_PROTO");a.exports=function(a,b){var c,h=e(a),i=0,j=[];for(c in h)c!=g&&d(h,c)&&j.push(c);for(;b.length>i;)d(h,c=b[i++])&&(~f(j,c)||j.push(c));return j}},function(a,b,c){var d=c(53),e=c(22);a.exports=Object.keys||function(a){return d(a,e)}},function(a,b){b.f=({}).propertyIsEnumerable},function(a,b,c){var d=c(5);a.exports=function(a,b,c){for(var e in b)c&&a[e]?a[e]=b[e]:d(a,e,b[e]);return a}},function(a,b,c){a.exports=c(5)},function(a,b,c){var d=c(9),e=c(3),f=function(a,b){if(e(a),!d(b)&&null!==b)throw TypeError(b+": can't set as prototype!")};a.exports={set:Object.setPrototypeOf||("__proto__"in{}?function(a,b,d){try{(d=c(7)(Function.call,c(51).f(Object.prototype,"__proto__").set,2))(a,[]),b=!(a instanceof Array)}catch(a){b=!0}return function(a,c){return f(a,c),b?a.__proto__=c:d(a,c),a}}({},!1):void 0),check:f}},function(a,b,c){"use strict";var d=c(2),e=c(6),f=c(12),g=c(4),h=c(1)("species");a.exports=function(a){var b="function"==typeof e[a]?e[a]:d[a];g&&b&&!b[h]&&f.f(b,h,{configurable:!0,get:function(){return this}})}},function(a,b,c){var d=c(3),e=c(14),f=c(1)("species");a.exports=function(a,b){var c,g=d(a).constructor;return void 0===g||void 0==(c=d(g)[f])?b:e(c)}},function(a,b,c){var d=c(20),e=c(15);a.exports=function(a){return function(b,c){var f,g,h=String(e(b)),i=d(c),j=h.length;return i<0||i>=j?a?"":void 0:(f=h.charCodeAt(i))<55296||f>56319||i+1===j||(g=h.charCodeAt(i+1))<56320||g>57343?a?h.charAt(i):f:a?h.slice(i,i+2):(f-55296<<10)+(g-56320)+65536}}},function(a,b,c){var d=c(20),e=Math.max,f=Math.min;a.exports=function(a,b){return(a=d(a))<0?e(a+b,0):f(a,b)}},function(a,b,c){var d=c(15);a.exports=function(a){return Object(d(a))}},function(a,b,c){var d=c(21),e=c(1)("iterator"),f=c(10);a.exports=c(6).getIteratorMethod=function(a){if(void 0!=a)return a[e]||a["@@iterator"]||f[d(a)]}},function(a,b,c){"use strict";var d=c(37),e=c(47),f=c(10),g=c(13);a.exports=c(27)(Array,"Array",function(a,b){this._t=g(a),this._i=0,this._k=b},function(){var a=this._t,b=this._k,c=this._i++;return!a||c>=a.length?(this._t=void 0,e(1)):"keys"==b?e(0,c):"values"==b?e(0,a[c]):e(0,[c,a[c]])},"values"),f.Arguments=f.Array,d("keys"),d("values"),d("entries")},function(a,b){},function(a,b,c){"use strict";var d,e,f,g=c(28),h=c(2),i=c(7),j=c(21),k=c(23),l=c(9),m=(c(3),c(14)),n=c(38),o=c(40),p=(c(58).set,c(60)),q=c(30).set,r=c(48)(),s="Promise",t=h.TypeError,u=h.process,v=h[s],u=h.process,w="process"==j(u),x=function(){},y=!!function(){try{var a=v.resolve(1),b=(a.constructor={})[c(1)("species")]=function(a){a(x,x)};return(w||"function"==typeof PromiseRejectionEvent)&&a.then(x)instanceof b}catch(a){}}(),z=function(a,b){return a===b||a===v&&b===f},A=function(a){var b;return!(!l(a)||"function"!=typeof(b=a.then))&&b},B=function(a){return z(v,a)?new C(a):new e(a)},C=e=function(a){var b,c;this.promise=new a(function(a,d){if(void 0!==b||void 0!==c)throw t("Bad Promise constructor");b=a,c=d}),this.resolve=m(b),this.reject=m(c)},D=function(a){try{a()}catch(a){return{error:a}}},E=function(a,b){if(!a._n){a._n=!0;var c=a._c;r(function(){for(var d=a._v,e=1==a._s,f=0;c.length>f;)!function(b){var c,f,g=e?b.ok:b.fail,h=b.resolve,i=b.reject,j=b.domain;try{g?(e||(2==a._h&&H(a),a._h=1),!0===g?c=d:(j&&j.enter(),c=g(d),j&&j.exit()),c===b.promise?i(t("Promise-chain cycle")):(f=A(c))?f.call(c,h,i):h(c)):i(d)}catch(a){i(a)}}(c[f++]);a._c=[],a._n=!1,b&&!a._h&&F(a)})}},F=function(a){q.call(h,function(){var b,c,d,e=a._v;if(G(a)&&(b=D(function(){w?u.emit("unhandledRejection",e,a):(c=h.onunhandledrejection)?c({promise:a,reason:e}):(d=h.console)&&d.error&&d.error("Unhandled promise rejection",e)}),a._h=w||G(a)?2:1),a._a=void 0,b)throw b.error})},G=function(a){if(1==a._h)return!1;for(var b,c=a._a||a._c,d=0;c.length>d;)if((b=c[d++]).fail||!G(b.promise))return!1;return!0},H=function(a){q.call(h,function(){var b;w?u.emit("rejectionHandled",a):(b=h.onrejectionhandled)&&b({promise:a,reason:a._v})})},I=function(a){var b=this;b._d||(b._d=!0,(b=b._w||b)._v=a,b._s=2,b._a||(b._a=b._c.slice()),E(b,!0))},J=function(a){var b,c=this;if(!c._d){c._d=!0,c=c._w||c;try{if(c===a)throw t("Promise can't be resolved itself");(b=A(a))?r(function(){var d={_w:c,_d:!1};try{b.call(a,i(J,d,1),i(I,d,1))}catch(a){I.call(d,a)}}):(c._v=a,c._s=1,E(c,!1))}catch(a){I.call({_w:c,_d:!1},a)}}};y||(v=function(a){n(this,v,s,"_h"),m(a),d.call(this);try{a(i(J,this,1),i(I,this,1))}catch(a){I.call(this,a)}},(d=function(a){this._c=[],this._a=void 0,this._s=0,this._d=!1,this._v=void 0,this._h=0,this._n=!1}).prototype=c(56)(v.prototype,{then:function(a,b){var c=B(p(this,v));return c.ok="function"!=typeof a||a,c.fail="function"==typeof b&&b,c.domain=w?u.domain:void 0,this._c.push(c),this._a&&this._a.push(c),this._s&&E(this,!1),c.promise},catch:function(a){return this.then(void 0,a)}}),C=function(){var a=new d;this.promise=a,this.resolve=i(J,a,1),this.reject=i(I,a,1)}),k(k.G+k.W+!y*k.F,{Promise:v}),c(18)(v,s),c(59)(s),f=c(6)[s],k(k.S+!y*k.F,s,{reject:function(a){var b=B(this);return(0,b.reject)(a),b.promise}}),k(k.S+k.F*(g||!y),s,{resolve:function(a){if(a instanceof v&&z(a.constructor,this))return a;var b=B(this);return(0,b.resolve)(a),b.promise}}),k(k.S+!(y&&c(46)(function(a){v.all(a).catch(x)}))*k.F,s,{all:function(a){var b=this,c=B(b),d=c.resolve,e=c.reject,f=D(function(){var c=[],f=0,g=1;o(a,!1,function(a){var h=f++,i=!1;c.push(void 0),g++,b.resolve(a).then(function(a){i||(i=!0,c[h]=a,--g||d(c))},e)}),--g||d(c)});return f&&e(f.error),c.promise},race:function(a){var b=this,c=B(b),d=c.reject,e=D(function(){o(a,!1,function(a){b.resolve(a).then(c.resolve,d)})});return e&&d(e.error),c.promise}})},function(a,b,c){"use strict";var d=c(61)(!0);c(27)(String,"String",function(a){this._t=String(a),this._i=0},function(){var a,b=this._t,c=this._i;return c>=b.length?{value:void 0,done:!0}:(a=d(b,c),this._i+=a.length,{value:a,done:!1})})},function(a,b,c){c(65);for(var d=c(2),e=c(5),f=c(10),g=c(1)("toStringTag"),h=["NodeList","DOMTokenList","MediaList","StyleSheetList","CSSRuleList"],i=0;i<5;i++){var j=h[i],k=d[j],l=k&&k.prototype;l&&!l[g]&&e(l,g,j),f[j]=f.Array}},function(a,b){a.exports=c(79646)},function(a,b){a.exports=c(55511)}];function e(a){if(f[a])return f[a].exports;var b=f[a]={exports:{},id:a,loaded:!1};return d[a].call(b.exports,b,b.exports,e),b.loaded=!0,b.exports}var f={};return e.m=d,e.c=f,e.p="",e(0)}(c(79646),c(55511))}};