zevairouter 1.0.146 → 1.0.148

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 (345) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/cli/app/.next-cli-build/BUILD_ID +1 -1
  3. package/cli/app/.next-cli-build/app-path-routes-manifest.json +8 -8
  4. package/cli/app/.next-cli-build/build-manifest.json +2 -2
  5. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/automation/page_client-reference-manifest.js +1 -1
  6. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  7. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  10. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  11. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/context/page_client-reference-manifest.js +1 -1
  12. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  13. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  14. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  15. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  16. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  17. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  18. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  19. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/playground/page_client-reference-manifest.js +1 -1
  20. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  21. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  22. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  23. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  24. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  25. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  26. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  27. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  28. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  29. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/terminal/page_client-reference-manifest.js +1 -1
  30. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  31. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  32. package/cli/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  33. package/cli/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  34. package/cli/app/.next-cli-build/server/app/_global-error.html +1 -1
  35. package/cli/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  36. package/cli/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  37. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  38. package/cli/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  39. package/cli/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  40. package/cli/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  41. package/cli/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  42. package/cli/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  43. package/cli/app/.next-cli-build/server/app/_not-found.html +1 -1
  44. package/cli/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  45. package/cli/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  46. package/cli/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  47. package/cli/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  48. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  49. package/cli/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  50. package/cli/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  51. package/cli/app/.next-cli-build/server/app/api/models/route.js +1 -1
  52. package/cli/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  53. package/cli/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  54. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  55. package/cli/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  56. package/cli/app/.next-cli-build/server/app/api/version/route.js +1 -1
  57. package/cli/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  58. package/cli/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  59. package/cli/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  60. package/cli/app/.next-cli-build/server/app/callback.html +1 -1
  61. package/cli/app/.next-cli-build/server/app/callback.rsc +4 -4
  62. package/cli/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  63. package/cli/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  64. package/cli/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  65. package/cli/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  66. package/cli/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  67. package/cli/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  68. package/cli/app/.next-cli-build/server/app/dashboard/automation.html +1 -1
  69. package/cli/app/.next-cli-build/server/app/dashboard/automation.rsc +6 -6
  70. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation/__PAGE__.segment.rsc +2 -2
  71. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard/automation.segment.rsc +1 -1
  72. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  73. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  74. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_full.segment.rsc +6 -6
  75. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_head.segment.rsc +1 -1
  76. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_index.segment.rsc +4 -4
  77. package/cli/app/.next-cli-build/server/app/dashboard/automation.segments/_tree.segment.rsc +2 -2
  78. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  79. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  80. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  81. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  82. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  83. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  84. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  85. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  86. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  87. package/cli/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  88. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  89. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  90. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  91. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  92. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  93. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  94. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  95. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  96. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  97. package/cli/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  98. package/cli/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  99. package/cli/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  100. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  101. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  102. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  103. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  104. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  105. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  106. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  107. package/cli/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  108. package/cli/app/.next-cli-build/server/app/dashboard/context.html +1 -1
  109. package/cli/app/.next-cli-build/server/app/dashboard/context.rsc +6 -6
  110. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context/__PAGE__.segment.rsc +2 -2
  111. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard/context.segment.rsc +1 -1
  112. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  113. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  114. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_full.segment.rsc +6 -6
  115. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_head.segment.rsc +1 -1
  116. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_index.segment.rsc +4 -4
  117. package/cli/app/.next-cli-build/server/app/dashboard/context.segments/_tree.segment.rsc +2 -2
  118. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  119. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  120. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  121. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  122. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  123. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  124. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  125. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  126. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  127. package/cli/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  128. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  129. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  130. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  131. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  132. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  133. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  134. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  135. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  136. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  137. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  138. package/cli/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  139. package/cli/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  140. package/cli/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  141. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  142. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  143. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  144. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  145. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  146. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  147. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  148. package/cli/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  149. package/cli/app/.next-cli-build/server/app/dashboard/playground.html +1 -1
  150. package/cli/app/.next-cli-build/server/app/dashboard/playground.rsc +6 -6
  151. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground/__PAGE__.segment.rsc +2 -2
  152. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard/playground.segment.rsc +1 -1
  153. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  154. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  155. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_full.segment.rsc +6 -6
  156. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_head.segment.rsc +1 -1
  157. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_index.segment.rsc +4 -4
  158. package/cli/app/.next-cli-build/server/app/dashboard/playground.segments/_tree.segment.rsc +2 -2
  159. package/cli/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  160. package/cli/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  161. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  162. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  163. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  164. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  165. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  166. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  167. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  168. package/cli/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  169. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  170. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  171. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  172. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  173. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  174. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  175. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  176. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  177. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  178. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  179. package/cli/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  180. package/cli/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  181. package/cli/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  182. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  183. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  184. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  185. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  186. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  187. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  188. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  189. package/cli/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  190. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  191. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  192. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  193. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  194. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  195. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  196. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  197. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  198. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  199. package/cli/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  200. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  201. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  202. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  203. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  204. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  205. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  206. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  207. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  208. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +4 -4
  209. package/cli/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  210. package/cli/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  211. package/cli/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  212. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  213. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  214. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  215. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  216. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  217. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  218. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  219. package/cli/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  220. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  221. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  222. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  223. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  224. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  225. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  226. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  227. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  228. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  229. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  230. package/cli/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  231. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  232. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  233. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  234. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  235. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  236. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  237. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  238. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  239. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +4 -4
  240. package/cli/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  241. package/cli/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  242. package/cli/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  243. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  244. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  245. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  246. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  247. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  248. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  249. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  250. package/cli/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  251. package/cli/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  252. package/cli/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  253. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  254. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  255. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  256. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  257. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  258. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  259. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  260. package/cli/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  261. package/cli/app/.next-cli-build/server/app/dashboard.html +1 -1
  262. package/cli/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  263. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  264. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  265. package/cli/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  266. package/cli/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  267. package/cli/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  268. package/cli/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  269. package/cli/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  270. package/cli/app/.next-cli-build/server/app/index.html +1 -1
  271. package/cli/app/.next-cli-build/server/app/index.rsc +4 -4
  272. package/cli/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  273. package/cli/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  274. package/cli/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  275. package/cli/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  276. package/cli/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  277. package/cli/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  278. package/cli/app/.next-cli-build/server/app/landing.html +1 -1
  279. package/cli/app/.next-cli-build/server/app/landing.rsc +5 -5
  280. package/cli/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  281. package/cli/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  282. package/cli/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  283. package/cli/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  284. package/cli/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +2 -2
  285. package/cli/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  286. package/cli/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  287. package/cli/app/.next-cli-build/server/app/login.html +1 -1
  288. package/cli/app/.next-cli-build/server/app/login.rsc +5 -5
  289. package/cli/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  290. package/cli/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  291. package/cli/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  292. package/cli/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  293. package/cli/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  294. package/cli/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  295. package/cli/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  296. package/cli/app/.next-cli-build/server/app-paths-manifest.json +8 -8
  297. package/cli/app/.next-cli-build/server/chunks/3155.js +1 -1
  298. package/cli/app/.next-cli-build/server/chunks/412.js +2 -2
  299. package/cli/app/.next-cli-build/server/chunks/4566.js +1 -1
  300. package/cli/app/.next-cli-build/server/chunks/4746.js +1 -1
  301. package/cli/app/.next-cli-build/server/chunks/5307.js +1 -1
  302. package/cli/app/.next-cli-build/server/chunks/5469.js +1 -1
  303. package/cli/app/.next-cli-build/server/chunks/5949.js +3 -3
  304. package/cli/app/.next-cli-build/server/chunks/8242.js +2 -2
  305. package/cli/app/.next-cli-build/server/chunks/8306.js +1 -1
  306. package/cli/app/.next-cli-build/server/chunks/8371.js +1 -1
  307. package/cli/app/.next-cli-build/server/chunks/9621.js +1 -1
  308. package/cli/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  309. package/cli/app/.next-cli-build/server/pages/404.html +1 -1
  310. package/cli/app/.next-cli-build/server/pages/500.html +1 -1
  311. package/cli/app/.next-cli-build/static/chunks/523-176a0660a9383518.js +3 -0
  312. package/cli/app/.next-cli-build/static/chunks/5497-8d0ec2995dc0a392.js +7 -0
  313. package/cli/app/.next-cli-build/static/chunks/{620-cc65df39cb93df1c.js → 620-16902cd352ef1d97.js} +1 -1
  314. package/cli/app/.next-cli-build/static/chunks/9126-7d5476f17beddfb0.js +1 -0
  315. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-2468e6ba8d1efeec.js +1 -0
  316. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-579bf915396efc69.js +1 -0
  317. package/cli/app/.next-cli-build/static/css/87ffa46afc2273f4.css +1 -0
  318. package/cli/app/CHANGELOG.md +22 -0
  319. package/cli/app/cli/hooks/cloakbrowserRuntime.js +111 -4
  320. package/cli/app/package.json +1 -1
  321. package/cli/hooks/cloakbrowserRuntime.js +111 -4
  322. package/cli/package.json +1 -1
  323. package/package.json +1 -1
  324. package/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js +91 -38
  325. package/src/app/(dashboard)/dashboard/endpoint/EndpointPageClient.js +45 -38
  326. package/src/app/(dashboard)/dashboard/providers/page.js +136 -36
  327. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/QuotaTable.js +15 -9
  328. package/src/app/(dashboard)/dashboard/usage/components/ProviderLimits/index.js +188 -120
  329. package/src/app/(dashboard)/dashboard/usage/components/ProviderTopology.js +128 -3
  330. package/src/lib/oauth/services/bulkImportBrowserEngine.js +36 -0
  331. package/src/lib/oauth/services/codebuddyCnBulkImportManager.js +469 -172
  332. package/src/lib/oauth/services/codebuddyCnPhoneAutomation.js +16 -2
  333. package/src/lib/oauth/services/kiroBulkImportManager.js +7 -1
  334. package/src/shared/components/Header.js +4 -4
  335. package/src/shared/components/HeaderLanguage.js +2 -1
  336. package/src/shared/components/HeaderMenu.js +2 -1
  337. package/src/shared/components/Toggle.js +28 -12
  338. package/cli/app/.next-cli-build/static/chunks/523-078802482e95c757.js +0 -3
  339. package/cli/app/.next-cli-build/static/chunks/5497-7f6609cd427c6525.js +0 -7
  340. package/cli/app/.next-cli-build/static/chunks/9126-9e1755f122b943cd.js +0 -1
  341. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-847b19cd29966941.js +0 -1
  342. package/cli/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6050ac2547c62b54.js +0 -1
  343. package/cli/app/.next-cli-build/static/css/1472cd17dfd55a13.css +0 -1
  344. /package/cli/app/.next-cli-build/static/{DeFI037NxtdV4EpLD2ihz → kmlfntQuBCJ_ni8__OiKd}/_buildManifest.js +0 -0
  345. /package/cli/app/.next-cli-build/static/{DeFI037NxtdV4EpLD2ihz → kmlfntQuBCJ_ni8__OiKd}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- exports.id=5307,exports.ids=[1998,4720,5307],exports.modules={15626:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.146","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.2.12","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{"use strict";c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(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()}},66811:(a,b,c)=>{"use strict";c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=n[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider||"clinepass"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await p(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await r(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await p(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await r(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},74926:(a,b,c)=>{"use strict";c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(80601)},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});var d=c(21820);function e(){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 f={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},i={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},j={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},k={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},l={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},o={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},p={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",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"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},q={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},t={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},u={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},v={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},93943:(a,b,c)=>{"use strict";c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},96487:()=>{}};
1
+ exports.id=5307,exports.ids=[1998,4720,5307],exports.modules={15626:(a,b,c)=>{"use strict";c.d(b,{buildClineHeaders:()=>e});let d=c(39006).version||"0.0.0";function e(a,b={}){let c,f=(c=function(a){if("string"!=typeof a)return"";let b=a.trim();return b?b.startsWith("workos:")?b:`workos:${b}`:""}(a))?`Bearer ${c}`:"",g={"HTTP-Referer":"https://cline.bot","X-Title":"Cline","User-Agent":`ZevaiRouter/${d}`,"X-PLATFORM":process.platform||"unknown","X-PLATFORM-VERSION":process.version||"unknown","X-CLIENT-TYPE":"zevairouter","X-CLIENT-VERSION":d,"X-CORE-VERSION":d,"X-IS-MULTIROOT":"false",...b};return f&&(g.Authorization=f),g}},30869:(a,b,c)=>{"use strict";c.d(b,{UY:()=>h,X3:()=>i,eh:()=>f.eh,fg:()=>e.fg,h0:()=>g});var d=c(39006),e=c(75681),f=c(81329);d.version;let g={npmPackageName:"zevairouter",installCmd:"npm i -g zevairouter",installCmdLatest:"npm i -g zevairouter@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:1997},h={maxLines:200,pollIntervalMs:1e3},i={openrouter:"https://openrouter.ai/api/v1/chat/completions",glm:"https://api.z.ai/api/anthropic/v1/messages","glm-cn":"https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",kimi:"https://api.kimi.com/coding/v1/messages",minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages",alicode:"https://coding.dashscope.aliyuncs.com/v1/chat/completions","alicode-intl":"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions","volcengine-ark":"https://ark.cn-beijing.volces.com/api/coding/v3/chat/completions",byteplus:"https://ark.ap-southeast.bytepluses.com/api/coding/v3/chat/completions",openai:"https://api.openai.com/v1/chat/completions","vercel-ai-gateway":"https://ai-gateway.vercel.sh/v1/chat/completions",anthropic:"https://api.anthropic.com/v1/messages",gemini:"https://generativelanguage.googleapis.com/v1beta/models",ollama:"https://ollama.com/api/chat","ollama-local":"http://localhost:11434/api/chat"}},39006:a=>{"use strict";a.exports=JSON.parse('{"name":"zevairouter","version":"1.0.148","description":"Self-hosted AI router: many providers, one OpenAI-compatible /v1 endpoint and dashboard","bin":{"zevai":"./cli/cli.js"},"files":["cli/","src/","public/","scripts/","i18n/","assets/","images/","open-sse/","next.config.mjs","postcss.config.mjs","jsconfig.json","start.sh","package.json","README.md","LICENSE","CHANGELOG.md"],"scripts":{"dev":"next dev --webpack --port 1997","build":"next build --webpack","start":"node ./scripts/start-standalone.mjs","dev:bun":"bun --bun next dev --webpack --port 1997","build:bun":"bun --bun next build --webpack","start:bun":"bun ./.next/standalone/server.js","build:cli":"node cli/scripts/build-cli.js","release":"node cli/scripts/release.js","prepack":"node cli/scripts/build-cli.js","postinstall":"node cli/hooks/postinstall.js || exit 0"},"dependencies":{"@dnd-kit/core":"^6.3.1","@dnd-kit/modifiers":"^9.0.0","@dnd-kit/sortable":"^10.0.0","@dnd-kit/utilities":"^3.2.2","@monaco-editor/react":"^4.7.0","@xterm/addon-fit":"^0.11.0","@xterm/addon-web-links":"^0.12.0","@xterm/xterm":"^6.0.0","@xyflow/react":"^12.10.1","bcryptjs":"^3.0.3","confbox":"^0.2.4","express":"^5.2.1","http-proxy-middleware":"^3.0.7","jose":"^6.1.3","marked":"^18.0.1","material-symbols":"^0.45.1","monaco-editor":"^0.55.1","next":"^16.2.12","node-forge":"^1.3.3","node-machine-id":"^1.1.12","open":"^11.0.0","ora":"^9.1.0","react":"19.2.4","react-dom":"19.2.4","react-is":"^19.2.7","recharts":"^3.7.0","selfsigned":"^5.5.0","socks":"^2.8.9","socks-proxy-agent":"^10.1.0","sql.js":"^1.14.1","undici":"^8.7.0","uuid":"^14.0.1","zustand":"^5.0.10"},"comment_optional_runtime":"Heavy packages are installed into ~/.zevai/runtime instead of the published tarball. Automation uses Playwright Chromium only; ZEVAI_MINIMAL_POSTINSTALL=1 skips its browser download. Other lazy runtimes are better-sqlite3 and node-pty.","overrides":{"dompurify":"^3.4.12","postcss":"^8.5.10"},"comment_overrides":"dompurify: monaco-editor@0.55.1 pins vulnerable dompurify@3.2.7 (multiple mXSS advisories, all fixed in 3.4.x). Override forces the patched 3.4.12 until monaco ships a stable release with the fix (currently only in 0.56.0-dev). We don\'t use dompurify directly; monaco only uses it to sanitize HTML hover/completion output.","devDependencies":{"@tailwindcss/postcss":"^4.1.18","better-sqlite3":"^12.6.2","esbuild":"^0.28.1","eslint":"^9","eslint-config-next":"16.2.9","postcss":"^8.5.10","tailwindcss":"^4"},"engines":{"node":">=22.5.0"},"keywords":["zevairouter","zevai","ai","router","proxy","kiro","codebuddy","claude","openai","api","quota","automation"],"license":"MIT","repository":{"type":"git","url":"https://github.com/Verifiedlabs/zevairouter"},"homepage":"https://github.com/Verifiedlabs/zevairouter"}')},39326:(a,b,c)=>{"use strict";c.d(b,{B:()=>h,p:()=>g});var d=c(71998);function e(a){return null==a?"":String(a).trim()}let f=new Map;function g(a,b,c){if(!a||0===a.length)return null;if(1===a.length)return a[0];if("round-robin"===b){let b=f.get(c)||{index:-1};return b.index=(b.index+1)%a.length,f.set(c,b),a[b.index]}return"random"===b?a[Math.floor(Math.random()*a.length)]:a[0]}async function h(a={}){try{let b=e(a?.proxyPoolId),c="__none__"===b?"":b,f=function(a={}){let b=a?.connectionProxyEnabled===!0,c=e(a?.connectionProxyUrl);return{connectionProxyEnabled:b,connectionProxyUrl:c,connectionNoProxy:e(a?.connectionNoProxy)}}(a);if(c){let a=await (0,d.hr)(c),b=e(a?.proxyUrl),f=e(a?.noProxy);if(a&&!0===a.isActive&&b){if("vercel"===a.type||"cloudflare"===a.type||"deno"===a.type)return{source:a.type,proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:f,strictProxy:!0===a.strictProxy,vercelRelayUrl:b};return{source:"pool",proxyPoolId:c,proxyPool:a,connectionProxyEnabled:!0,connectionProxyUrl:b,connectionNoProxy:f,strictProxy:!0===a.strictProxy}}}if(f.connectionProxyEnabled&&f.connectionProxyUrl)return{source:"legacy",proxyPoolId:c||null,proxyPool:null,...f};return{source:"none",proxyPoolId:c||null,proxyPool:null,...f}}catch(a){return console.error("[resolveConnectionProxyConfig] Failed to resolve proxy config:",a),{source:"error",proxyPoolId:null,proxyPool:null,connectionProxyEnabled:!1,connectionProxyUrl:"",connectionNoProxy:"",strictProxy:!1}}}},47293:(a,b,c)=>{"use strict";c.d(b,{A:()=>f});let d=new Uint8Array(16);var e=c(50122);let f=function(a,b,c){return b||a||!crypto.randomUUID?function(a,b,c){let f=(a=a||{}).random??a.rng?.()??crypto.getRandomValues(d);if(f.length<16)throw Error("Random bytes length must be >= 16");if(f[6]=15&f[6]|64,f[8]=63&f[8]|128,b){if((c=c||0)<0||c+16>b.length)throw RangeError(`UUID byte range ${c}:${c+15} is out of buffer bounds`);for(let a=0;a<16;++a)b[c+a]=f[a];return b}return(0,e.k)(f)}(a,b,c):crypto.randomUUID()}},50122:(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()}},66811:(a,b,c)=>{"use strict";c.d(b,{F:()=>t});var d=c(89718),e=c(39326),f=c(74926),g=c(75681),h=c(30869),i=c(44404),j=c(35024),k=c(93943),l=c(92990),m=c(15626);let n={claude:{checkExpiry:!0,refreshable:!0},codex:{url:"https://chatgpt.com/backend-api/codex/responses",method:"POST",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"Content-Type":"application/json",originator:"codex_cli_rs","User-Agent":"codex_cli_rs/0.136.0"},body:JSON.stringify({model:"gpt-5.3-codex",input:[],stream:!1,store:!1}),acceptStatuses:[400],refreshable:!0},"gemini-cli":{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},antigravity:{url:"https://www.googleapis.com/oauth2/v1/userinfo?alt=json",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!0},github:{url:"https://api.github.com/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{"User-Agent":"ZevaiRouter",Accept:"application/vnd.github+json"}},iflow:{buildUrl:a=>`https://iflow.cn/api/oauth/getUserInfo?accessToken=${encodeURIComponent(a)}`,method:"GET",noAuth:!0},qwen:{checkExpiry:!0,refreshable:!0},kiro:{checkExpiry:!0,refreshable:!0},qoder:{url:"https://openapi.qoder.sh/api/v1/userinfo",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",refreshable:!1},"kimi-coding":{checkExpiry:!0,refreshable:!1},cursor:{tokenExists:!0},kilocode:{url:`${l.MZ.apiBaseUrl}/api/profile`,method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},cline:{refreshable:!0},clinepass:{refreshable:!0},kimchi:{url:l.Td.validationUrl||"https://api.cast.ai/v1/llm/openai/supported-providers",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json","User-Agent":"kimchi/0.1.40"},refreshable:!1},"grok-cli":{url:j.xq["grok-cli"]?.userUrl||"https://cli-chat-proxy.grok.com/v1/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer ",extraHeaders:{Accept:"application/json",...j.xq["grok-cli"]?.headers||{"User-Agent":"grok-pager/0.2.93 grok-shell/0.2.93 (linux; x86_64)","x-xai-token-auth":"xai-grok-cli","x-grok-client-identifier":"grok-pager","x-grok-client-version":"0.2.93"}},refreshable:!0},gitlab:{url:"https://gitlab.com/api/v4/user",method:"GET",authHeader:"Authorization",authPrefix:"Bearer "},codebuddy:{tokenExists:!0},"codebuddy-cn":{tokenExists:!0}};async function o(a){return await fetch("https://api.cline.bot/api/v1/users/me",{method:"GET",headers:(0,m.buildClineHeaders)(a,{Accept:"application/json"})})}async function p(a){let b=a.provider,c=a.refreshToken;if(!c)return null;try{if("gemini-cli"===b||"antigravity"===b){let a="gemini-cli"===b?l.LT:l.YT,d=await fetch("https://oauth2.googleapis.com/token",{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:a.clientId,client_secret:a.clientSecret,grant_type:"refresh_token",refresh_token:c})});if(!d.ok)return null;let e=await d.json();return{accessToken:e.access_token,expiresIn:e.expires_in,refreshToken:e.refresh_token||c}}if("codex"===b||"grok-cli"===b||"xai"===b)return await (0,k.Vq)(b,a,console);if("claude"===b){let a=await fetch(l.OV.tokenUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({grant_type:"refresh_token",refresh_token:c,client_id:l.OV.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("kiro"===b){let b=a.providerSpecificData||{},d=b.clientId||a.clientId,e=b.clientSecret||a.clientSecret,f=b.region||a.region;if(d&&e){let a=`https://oidc.${f||"us-east-1"}.amazonaws.com/token`,b=await fetch(a,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({clientId:d,clientSecret:e,refreshToken:c,grantType:"refresh_token"})});if(!b.ok)return null;let g=await b.json();return{accessToken:g.accessToken,expiresIn:g.expiresIn||3600,refreshToken:g.refreshToken||c}}let g=await fetch(l.Tx.socialRefreshUrl,{method:"POST",headers:{"Content-Type":"application/json","User-Agent":"kiro-cli/2.12.2"},body:JSON.stringify({refreshToken:c})});if(!g.ok)return null;let h=await g.json();return{accessToken:h.accessToken,expiresIn:h.expiresIn||3600,refreshToken:h.refreshToken||c}}if("qwen"===b){let a=await fetch(l.Hp.tokenUrl,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"},body:new URLSearchParams({grant_type:"refresh_token",refresh_token:c,client_id:l.Hp.clientId})});if(!a.ok)return null;let b=await a.json();return{accessToken:b.access_token,expiresIn:b.expires_in,refreshToken:b.refresh_token||c}}if("cline"===b||"clinepass"===b){let a=await fetch(l.lB.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify({refreshToken:c,grantType:"refresh_token",clientType:"extension"})});if(!a.ok)return null;let b=await a.json(),d=b?.data||b,e=d?.expiresAt?Math.max(1,Math.floor((new Date(d.expiresAt).getTime()-Date.now())/1e3)):3600;return{accessToken:d?.accessToken,expiresIn:e,refreshToken:d?.refreshToken||c}}if("codebuddy"===b||"codebuddy-cn"===b){let a="codebuddy-cn"===b?l.ne:l.Nl,d=await fetch(a.refreshUrl,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":a.userAgent,"X-Requested-With":"XMLHttpRequest","X-Domain":a.domain,"X-Refresh-Token":c,"X-Auth-Refresh-Source":"plugin","X-Product":"SaaS"},body:"{}"});if(!d.ok)return null;let e=await d.json(),f=e?.data||e,g=f?.accessToken||f?.access_token;if(!g)return null;return{accessToken:g,expiresIn:f?.expiresIn||f?.expires_in||86400,refreshToken:f?.refreshToken||f?.refresh_token||c}}return null}catch(a){return console.log(`Error refreshing ${b} token:`,a.message),null}}async function q(a,b=null){if("autoclaw"===a.provider){if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};try{let{AUTOCLAW_WALLET_ENDPOINT:d,buildAutoClawWalletHeaders:e}=await c.e(2693).then(c.bind(c,42693)),f=await r(d,{method:"GET",headers:e(a.accessToken)},b);if(!f.ok){if(401===f.status||403===f.status)return{valid:!1,error:"Token invalid or revoked",refreshed:!1};return{valid:!1,error:`AutoClaw API returned ${f.status}`,refreshed:!1}}let g=await f.json().catch(()=>null);if(g&&0===g.code)return{valid:!0,error:null,refreshed:!1,newTokens:null};return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}catch(a){return{valid:!1,error:a.message,refreshed:!1}}}let d=n[a.provider];if(!d)return{valid:!1,error:"Provider test not supported",refreshed:!1};if(!a.accessToken)return{valid:!1,error:"No access token",refreshed:!1};if(d.tokenExists)return{valid:!0,error:null,refreshed:!1,newTokens:null};let e=a.accessToken,f=!1,g=null,h=(0,k.fp)(a.provider,a);if(d.refreshable&&h&&a.refreshToken){let b=await p(a);if(!b)return{valid:!1,error:"Token expired and refresh failed",refreshed:!1};e=b.accessToken,f=!0,g=b}if(d.checkExpiry)return f?{valid:!0,error:null,refreshed:f,newTokens:g}:h?{valid:!1,error:"Token expired",refreshed:!1}:{valid:!0,error:null,refreshed:!1,newTokens:null};if("cline"===a.provider||"clinepass"===a.provider){let b=async a=>{let b=await o(a);return b.ok?{valid:!0,error:null,refreshed:f,newTokens:g}:401===b.status?{valid:!1,error:"Token invalid or revoked",refreshed:f}:403===b.status?{valid:!1,error:"Access denied",refreshed:f}:{valid:!1,error:`API returned ${b.status}`,refreshed:f}},c=await b(e);if(c.valid||"Token invalid or revoked"!==c.error||!a.refreshToken)return c;let d=await p(a);return d?.accessToken?(f=!0,g=d,e=d.accessToken,await b(e)):{valid:!1,error:"Token invalid or revoked",refreshed:!1}}try{let c=d.buildUrl?d.buildUrl(e):d.url,h=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e}`,...d.extraHeaders},i={method:d.method,headers:h};d.body&&(i.body=d.body);let j=await r(c,i,b);if(j.ok||d.acceptStatuses&&d.acceptStatuses.includes(j.status))return{valid:!0,error:null,refreshed:f,newTokens:g};if(401===j.status&&d.refreshable&&!f&&a.refreshToken){let e=await p(a);if(e){let a=d.buildUrl?d.buildUrl(e.accessToken):c,f=d.noAuth?{...d.extraHeaders}:{[d.authHeader]:`${d.authPrefix}${e.accessToken}`,...d.extraHeaders},g={method:d.method,headers:f};d.body&&(g.body=d.body);let h=await r(a,g,b);if(h.ok||d.acceptStatuses&&d.acceptStatuses.includes(h.status))return{valid:!0,error:null,refreshed:!0,newTokens:e}}return{valid:!1,error:"Token invalid or revoked",refreshed:!1}}if(401===j.status)return{valid:!1,error:"Token invalid or revoked",refreshed:f};if(403===j.status)return{valid:!1,error:"Access denied",refreshed:f};return{valid:!1,error:`API returned ${j.status}`,refreshed:f}}catch(a){return{valid:!1,error:a.message,refreshed:f}}}async function r(a,b={},d=null){if(d?.vercelRelayUrl){let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{vercelRelayUrl:d.vercelRelayUrl})}if(!d?.connectionProxyEnabled||!d?.connectionProxyUrl)return fetch(a,b);let{proxyAwareFetch:e}=await Promise.resolve().then(c.bind(c,39609));return e(a,b,{connectionProxyEnabled:!0,connectionProxyUrl:d.connectionProxyUrl,connectionNoProxy:d.connectionNoProxy||""})}async function s(a,b=null){if((0,g.mq)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{let d=await r(`${c.replace(/\/$/,"")}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}if((0,g.gb)(a.provider)){let c=a.providerSpecificData?.baseUrl;if(!c)return{valid:!1,error:"Missing base URL"};try{(c=c.replace(/\/$/,"")).endsWith("/messages")&&(c=c.slice(0,-9));let d=await r(`${c}/models`,{headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01",Authorization:`Bearer ${a.apiKey}`}},b);return{valid:d.ok,error:d.ok?null:"Invalid API key or base URL"}}catch(a){return{valid:!1,error:a.message}}}try{switch(a.provider){case"cloudflare-ai":{let c=(a.providerSpecificData||{}).accountId;if(!c)return{valid:!1,error:"Missing Account ID"};let d=`https://api.cloudflare.com/client/v4/accounts/${c}/ai/v1/chat/completions`,e=await r(d,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"Content-Type":"application/json"},body:JSON.stringify({model:(0,i.fZ)("cloudflare-ai"),messages:[{role:"user",content:"test"}],max_tokens:1})},b),f=401!==e.status&&403!==e.status&&404!==e.status;return{valid:f,error:f?null:"Invalid API token or Account ID"}}case"azure":{let c=a.providerSpecificData||{},d=(c.azureEndpoint||"").replace(/\/$/,""),e=c.deployment||"gpt-4",f=c.apiVersion||"2024-10-01-preview",g=`${d}/openai/deployments/${e}/chat/completions?api-version=${f}`,h={"api-key":a.apiKey,"Content-Type":"application/json"};c.organization&&(h["OpenAI-Organization"]=c.organization);let i=await r(g,{method:"POST",headers:h,body:JSON.stringify({messages:[{role:"user",content:"test"}],max_completion_tokens:1})},b),j=401!==i.status&&403!==i.status;return{valid:j,error:j?null:"Invalid API key or Azure configuration"}}case"openai":{let c=await r("https://api.openai.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"vercel-ai-gateway":{let c=await r("https://ai-gateway.vercel.sh/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"anthropic":{let c=await r("https://api.anthropic.com/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"claude-3-haiku-20240307",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"gemini":{let c=await r(`https://generativelanguage.googleapis.com/v1/models?key=${a.apiKey}`,{},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"openrouter":{let c=await r("https://openrouter.ai/api/v1/auth/key",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"glm":{let c=await r("https://api.z.ai/api/anthropic/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"glm-cn":{let c=await r("https://open.bigmodel.cn/api/coding/paas/v4/chat/completions",{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:"glm-4.7",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"minimax":case"minimax-cn":{let c=await r({minimax:"https://api.minimax.io/anthropic/v1/messages","minimax-cn":"https://api.minimaxi.com/anthropic/v1/messages"}[a.provider],{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"minimax-m2",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"kimi":{let c=await r("https://api.kimi.com/coding/v1/messages",{method:"POST",headers:{"x-api-key":a.apiKey,"anthropic-version":"2023-06-01","content-type":"application/json"},body:JSON.stringify({model:"kimi-latest",max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"alicode":case"alicode-intl":{let c="alicode-intl"===a.provider?"https://coding-intl.dashscope.aliyuncs.com/v1/chat/completions":"https://coding.dashscope.aliyuncs.com/v1/chat/completions",d=await r(c,{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),e=401!==d.status&&403!==d.status;return{valid:e,error:e?null:"Invalid API key"}}case"volcengine-ark":case"byteplus":{let c=await r(h.X3[a.provider],{method:"POST",headers:{Authorization:`Bearer ${a.apiKey}`,"content-type":"application/json"},body:JSON.stringify({model:(0,i.fZ)(a.provider),max_tokens:1,messages:[{role:"user",content:"test"}]})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"deepseek":{let c=await r("https://api.deepseek.com/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"groq":{let c=await r("https://api.groq.com/openai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"mistral":{let c=await r("https://api.mistral.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"xai":{let c=await r("https://api.x.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nvidia":{let c=await r("https://integrate.api.nvidia.com/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"perplexity":{let c=await r("https://api.perplexity.ai/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"together":{let c=await r("https://api.together.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fireworks":{let c=await r("https://api.fireworks.ai/inference/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cerebras":{let c=await r("https://api.cerebras.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"cohere":{let c=await r("https://api.cohere.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nebius":{let c=await r("https://api.studio.nebius.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"siliconflow":{let c=await r("https://api.siliconflow.cn/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"hyperbolic":{let c=await r("https://api.hyperbolic.xyz/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"ollama":{let b=await fetch("https://ollama.com/api/tags",{headers:{Authorization:`Bearer ${a.apiKey}`}});return{valid:b.ok,error:b.ok?null:"Invalid API key"}}case"ollama-local":{let b=(0,j.Ak)(a),c=await fetch(`${b}/api/tags`);return{valid:c.ok,error:c.ok?null:`Ollama not reachable at ${b}`}}case"deepgram":{let c=await r("https://api.deepgram.com/v1/projects",{headers:{Authorization:`Token ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"assemblyai":{let c=await r("https://api.assemblyai.com/v1/account",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"nanobanana":{let c=await r("https://api.nanobananaapi.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"fal-ai":{let c=await r("https://api.fal.ai/v1/models?limit=1",{headers:{Authorization:`Key ${a.apiKey}`}},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"chutes":{let c=await r("https://llm.chutes.ai/v1/models",{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"grok-web":{let c=a.apiKey.startsWith("sso=")?a.apiKey.slice(4):a.apiKey,d=a=>Array.from(crypto.getRandomValues(new Uint8Array(a)),a=>a.toString(16).padStart(2,"0")).join(""),e=Buffer.from("e:TypeError: Cannot read properties of null (reading 'children')").toString("base64"),f=await r("https://grok.com/rest/app-chat/conversations/new",{method:"POST",headers:{Accept:"*/*","Content-Type":"application/json",Cookie:`sso=${c}`,Origin:"https://grok.com",Referer:"https://grok.com/","User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36","x-statsig-id":e,"x-xai-request-id":crypto.randomUUID(),traceparent:`00-${d(16)}-${d(8)}-00`},body:JSON.stringify({temporary:!0,modelName:"grok-4",message:"ping",fileAttachments:[],imageAttachments:[],disableSearch:!1,enableImageGeneration:!1,sendFinalMetadata:!0})},b),g=401!==f.status&&403!==f.status;return{valid:g,error:g?null:"Invalid SSO cookie"}}case"perplexity-web":{let c=a.apiKey;c.startsWith("__Secure-next-auth.session-token=")&&(c=c.slice(33));let d=await r("https://www.perplexity.ai/api/auth/session",{method:"GET",headers:{"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",Cookie:`__Secure-next-auth.session-token=${c}`}},b);if(!d.ok)return{valid:!1,error:"Invalid session cookie"};let e=await d.json().catch(()=>null),f=!!(e&&e.user);return{valid:f,error:f?null:"Session expired — re-paste cookie"}}case"opencode-go":{let c=await r("https://opencode.ai/zen/go/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${a.apiKey}`},body:JSON.stringify({model:(0,i.fZ)("opencode-go"),messages:[{role:"user",content:"ping"}],max_tokens:1,stream:!1})},b),d=401!==c.status&&403!==c.status;return{valid:d,error:d?null:"Invalid API key"}}case"xiaomi-mimo":case"xiaomi-tokenplan":{let c=await r(`${{"xiaomi-mimo":"https://api.xiaomimimo.com/v1","xiaomi-tokenplan":"https://token-plan-sgp.xiaomimimo.com/v1"}[a.provider]}/models`,{headers:{Authorization:`Bearer ${a.apiKey}`}},b);return{valid:c.ok,error:c.ok?null:"Invalid API key"}}case"codebuddy":case"codebuddy-cn":{let c="codebuddy-cn"===a.provider?l.ne:l.Nl,d=c.baseUrl,e=await r(`${d}/v2/chat/completions`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","User-Agent":c.userAgent,"X-Domain":c.domain,"X-Requested-With":"XMLHttpRequest","X-Product":"SaaS","X-Api-Key":a.apiKey},body:JSON.stringify({model:"default-model-lite",max_tokens:1,messages:[{role:"user",content:"hi"}]})},b),f=await e.clone().json().catch(()=>null);if(f?.code===11102)return{valid:!1,inconclusive:!0,error:"Test model is not available for this account"};let g=e.ok||429===e.status||400===e.status;return{valid:g,error:g?null:`Invalid API key (${e.status})`}}default:return{valid:!1,error:"Provider test not supported"}}}catch(a){return{valid:!1,error:a.message}}}async function t(a){let b,c=await (0,d.Mc)(a);if(!c)return{valid:!1,error:"Connection not found",latencyMs:0,testedAt:new Date().toISOString()};let g=await (0,e.B)(c.providerSpecificData||{});if(g.connectionProxyEnabled&&g.connectionProxyUrl&&!g.vercelRelayUrl){let b=await (0,f.C)({proxyUrl:g.connectionProxyUrl});if(!b.ok){let c=b.error||`Proxy test failed with status ${b.status}`;return await (0,d.updateProviderConnection)(a,{testStatus:"error",lastError:c,lastErrorAt:new Date().toISOString()}),{valid:!1,error:c,latencyMs:0,testedAt:new Date().toISOString()}}}let h=Date.now();b="apikey"===c.authType||"cookie"===c.authType?await s(c,g):await q(c,g);let i=Date.now()-h,j=b.inconclusive?{}:{testStatus:b.valid?"active":"error",lastError:b.valid?null:b.error,lastErrorAt:b.valid?null:new Date().toISOString()};return b.refreshed&&b.newTokens&&(b.newTokens.accessToken&&(j.accessToken=b.newTokens.accessToken),b.newTokens.refreshToken&&(j.refreshToken=b.newTokens.refreshToken),b.newTokens.idToken&&(j.idToken=b.newTokens.idToken),b.newTokens.lastRefreshAt&&(j.lastRefreshAt=b.newTokens.lastRefreshAt),b.newTokens.expiresIn&&(j.expiresIn=b.newTokens.expiresIn),b.newTokens.expiresIn?j.expiresAt=new Date(Date.now()+1e3*b.newTokens.expiresIn).toISOString():b.newTokens.expiresAt&&(j.expiresAt=b.newTokens.expiresAt),b.newTokens.providerSpecificData&&(j.providerSpecificData={...c.providerSpecificData||{},...b.newTokens.providerSpecificData})),await (0,d.updateProviderConnection)(a,j),{valid:b.valid,error:b.error,refreshed:!!b.refreshed,latencyMs:i,testedAt:new Date().toISOString()}}},71998:(a,b,c)=>{"use strict";c.d(b,{Fh:()=>d.Fh,L9:()=>d.L9,Mc:()=>d.Mc,OM:()=>d.getModelAliases,Pc:()=>d.Pc,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Yd:()=>d.Yd,ZO:()=>d.ZO,c:()=>d.c,createProviderConnection:()=>d.iE,fK:()=>d.fK,fv:()=>d.deleteModelAlias,getProviderConnections:()=>d.getProviderConnections,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,o5:()=>d.o5,op:()=>d.op,rj:()=>d.updateProviderConnection,uL:()=>d.uL,ui:()=>d.ui,uv:()=>d.uv});var d=c(89718)},74926:(a,b,c)=>{"use strict";c.d(b,{C:()=>f});var d=c(47774);function e(a){return null==a?"":String(a).trim()}async function f({proxyUrl:a,testUrl:b,timeoutMs:c}={}){let g,h=e(a);if(!h)return{ok:!1,status:400,error:"proxyUrl is required"};let i=e(b)||"https://google.com/",j=Number(c),k=Number.isFinite(j)&&j>0?Math.min(j,3e4):8e3;try{try{g=new d.ProxyAgent({uri:h})}catch(a){return{ok:!1,status:400,error:`Invalid proxy URL: ${a?.message||String(a)}`}}let a=new AbortController,b=Date.now(),c=setTimeout(()=>a.abort(),k);try{let c=await (0,d.hd)(i,{method:"HEAD",dispatcher:g,signal:a.signal,headers:{"User-Agent":"ZevaiRouter"}});return{ok:c.ok,status:c.status,statusText:c.statusText,url:i,elapsedMs:Date.now()-b}}catch(b){let a=b?.name==="AbortError"?"Proxy test timed out":function(a){if(!a)return"Unknown error";let b=a?.message||String(a),c=a?.cause?.code||a?.code,d=a?.cause?.message;return d&&d!==b?c?`${b}: ${d} (${c})`:`${b}: ${d}`:c&&!b.includes(c)?`${b} (${c})`:b}(b);return{ok:!1,status:500,error:a}}finally{clearTimeout(c)}}finally{try{await g?.close?.()}catch{}}}},78335:()=>{},81329:(a,b,c)=>{"use strict";c.d(b,{Xg:()=>d.Xg,eh:()=>e,vq:()=>d.vq});var d=c(44404);Object.entries(c(75681).AI_PROVIDERS).filter(([,a])=>a.passthroughModels).map(([a])=>a);let e=Object.entries(d.vq).flatMap(([a,b])=>b.map(b=>({provider:a,model:b.id,name:b.name})))},89718:(a,b,c)=>{"use strict";c.d(b,{CG:()=>d.CG,Dj:()=>d.Dj,Fh:()=>d.Fh,Iq:()=>d.Iq,K1:()=>d.K1,KJ:()=>d.KJ,KK:()=>d.KK,L:()=>d.L,L9:()=>d.L9,Lh:()=>d.Lh,Mc:()=>d.Mc,NR:()=>d.NR,PX:()=>d.PX,Pb:()=>d.Pb,Pc:()=>d.Pc,QI:()=>d.QI,Q_:()=>d.Q_,Qu:()=>d.Qu,S8:()=>d.S8,Uv:()=>d.Uv,VT:()=>d.VT,XW:()=>d.XW,Xx:()=>d.Xx,Yd:()=>d.Yd,ZO:()=>d.ZO,bI:()=>d.bI,c:()=>d.c,dK:()=>d.dK,deleteModelAlias:()=>d.fv,ek:()=>d.ek,fK:()=>d.fK,getModelAliases:()=>d.OM,getProviderConnections:()=>d.P,getQuotaSnapshot:()=>d.LF,ho:()=>d.ho,hr:()=>d.hr,i0:()=>d.i0,iE:()=>d.iE,jd:()=>d.jd,mt:()=>d.mt,o5:()=>d.o5,oG:()=>d.oG,op:()=>d.op,p3:()=>d.p3,qd:()=>d.qd,r4:()=>d.r4,tV:()=>d.tV,uL:()=>d.uL,ui:()=>d.ui,updateProviderConnection:()=>d.rj,uv:()=>d.uv,yF:()=>d.yF,yW:()=>d.yW,yg:()=>d.yg,zP:()=>d.zP,zY:()=>d.zY});var d=c(80601)},92990:(a,b,c)=>{"use strict";c.d(b,{DI:()=>g,Hp:()=>i,LT:()=>h,MZ:()=>r,Nl:()=>x,Nu:()=>n,OV:()=>f,Td:()=>u,Tx:()=>o,WN:()=>p,Ww:()=>z,YT:()=>l,ZL:()=>k,cD:()=>m,f7:()=>w,hF:()=>j,lB:()=>s,ne:()=>y,qp:()=>v,t:()=>q,w1:()=>t});var d=c(21820);function e(){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 f={clientId:"9d1c250a-e61b-44d9-88ed-5944d1962f5e",authorizeUrl:"https://claude.ai/oauth/authorize",tokenUrl:"https://api.anthropic.com/v1/oauth/token",scopes:["org:create_api_key","user:profile","user:inference"],codeChallengeMethod:"S256"},g={clientId:"app_EMoamEEZ73f0CkXaXp7hrann",authorizeUrl:"https://auth.openai.com/oauth/authorize",tokenUrl:"https://auth.openai.com/oauth/token",scope:"openid profile email offline_access",codeChallengeMethod:"S256",extraParams:{id_token_add_organizations:"true",codex_cli_simplified_flow:"true",originator:"codex_cli_rs"}},h={clientId:"681255809395-oo8ft2oprdrnp9e3aqf6av3hmdib135j.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile"]},i={clientId:"f0304373b74a44d2b584a3fb70ca9e56",deviceCodeUrl:"https://chat.qwen.ai/api/v1/oauth2/device/code",tokenUrl:"https://chat.qwen.ai/api/v1/oauth2/token",scope:"openid profile email model.completion",codeChallengeMethod:"S256"},j={openApiBaseUrl:"https://openapi.qoder.sh",centerBaseUrl:"https://center.qoder.sh",chatBaseUrl:"https://api3.qoder.sh",deviceTokenUrl:"https://openapi.qoder.sh/api/v1/deviceToken/poll",refreshUrl:"https://center.qoder.sh/algo/api/v3/user/refresh_token",userInfoUrl:"https://openapi.qoder.sh/api/v1/userinfo",quotaUsageUrl:"https://openapi.qoder.sh/api/v2/quota/usage",loginUrl:"https://qoder.com/device/selectAccounts"},k={clientId:"10009311001",clientSecret:"4Z3YjXycVsQvyGF1etiNlIBB4RsqSDtW",authorizeUrl:"https://iflow.cn/oauth",tokenUrl:"https://iflow.cn/oauth/token",userInfoUrl:"https://iflow.cn/api/oauth/getUserInfo",extraParams:{loginMethod:"phone",type:"phone"}},l={clientId:"1071006060591-tmhssin2h21lcre235vtolojh4g403ep.apps.googleusercontent.com",clientSecret:"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",authorizeUrl:"https://accounts.google.com/o/oauth2/v2/auth",tokenUrl:"https://oauth2.googleapis.com/token",userInfoUrl:"https://www.googleapis.com/oauth2/v1/userinfo",scopes:["https://www.googleapis.com/auth/cloud-platform","https://www.googleapis.com/auth/userinfo.email","https://www.googleapis.com/auth/userinfo.profile","https://www.googleapis.com/auth/cclog","https://www.googleapis.com/auth/experimentsandconfigs"],apiEndpoint:"https://cloudcode-pa.googleapis.com",apiVersion:"v1internal",loadCodeAssistEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:loadCodeAssist",onboardUserEndpoint:"https://cloudcode-pa.googleapis.com/v1internal:onboardUser",loadCodeAssistUserAgent:"google-api-nodejs-client/9.15.1",loadCodeAssistApiClient:"google-cloud-sdk vscode_cloudshelleditor/0.1",loadCodeAssistClientMetadata:JSON.stringify({ideType:9,platform:e(),pluginType:2})};function m(){return{ideType:9,platform:e(),pluginType:2}}let n={clientId:"Iv1.b507a08c87ecfe98",deviceCodeUrl:"https://github.com/login/device/code",tokenUrl:"https://github.com/login/oauth/access_token",userInfoUrl:"https://api.github.com/user",scopes:"read:user",apiVersion:"2022-11-28",copilotTokenUrl:"https://api.github.com/copilot_internal/v2/token",userAgent:"GitHubCopilotChat/0.26.7",editorVersion:"vscode/1.85.0",editorPluginVersion:"copilot-chat/0.26.7"},o={ssoOidcEndpoint:"https://oidc.us-east-1.amazonaws.com",registerClientUrl:"https://oidc.us-east-1.amazonaws.com/client/register",deviceAuthUrl:"https://oidc.us-east-1.amazonaws.com/device_authorization",tokenUrl:"https://oidc.us-east-1.amazonaws.com/token",startUrl:"https://view.awsapps.com/start",clientName:"kiro-oauth-client",clientType:"public",scopes:["codewhisperer:completions","codewhisperer:analysis","codewhisperer:conversations"],grantTypes:["urn:ietf:params:oauth:grant-type:device_code","refresh_token"],issuerUrl:"https://identitycenter.amazonaws.com/ssoins-722374e8c3c8e6c6",socialAuthEndpoint:"https://prod.us-east-1.auth.desktop.kiro.dev",socialLoginUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/login",socialTokenUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/oauth/token",socialRefreshUrl:"https://prod.us-east-1.auth.desktop.kiro.dev/refreshToken",authMethods:["builder-id","idc","google","github","import"]},p={apiEndpoint:"https://api2.cursor.sh",chatEndpoint:"/aiserver.v1.ChatService/StreamUnifiedChatWithTools",modelsEndpoint:"/aiserver.v1.AiService/GetDefaultModelNudgeData",api3Endpoint:"https://api3.cursor.sh",agentEndpoint:"https://agent.api5.cursor.sh",agentNonPrivacyEndpoint:"https://agentn.api5.cursor.sh",clientVersion:"3.1.0",clientType:"ide",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"},dbKeys:{accessToken:"cursorAuth/accessToken",machineId:"storage.serviceMachineId"}},q={clientId:process.env.KIMI_CODING_OAUTH_CLIENT_ID||"17e5f671-d194-4dfb-9706-5516cb48c098",deviceCodeUrl:"https://auth.kimi.com/api/oauth/device_authorization",tokenUrl:"https://auth.kimi.com/api/oauth/token"},r={apiBaseUrl:"https://api.kilo.ai",initiateUrl:"https://api.kilo.ai/api/device-auth/codes",pollUrlBase:"https://api.kilo.ai/api/device-auth/codes"},s={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},t={appBaseUrl:"https://app.cline.bot",apiBaseUrl:"https://api.cline.bot",authorizeUrl:"https://api.cline.bot/api/v1/auth/authorize",tokenUrl:"https://api.cline.bot/api/v1/auth/token",tokenExchangeUrl:"https://api.cline.bot/api/v1/auth/token",refreshUrl:"https://api.cline.bot/api/v1/auth/refresh"},u={webAppUrl:"https://app.kimchi.dev",validationUrl:"https://api.cast.ai/v1/llm/openai/supported-providers",userInfoUrl:"https://app.kimchi.dev/api/v1/me",modelsUrl:"https://llm.kimchi.dev/v1/models/metadata?include_in_cli=true"},v={clientId:"b1a00492-073a-47ea-816f-4c329264a828",deviceCodeUrl:"https://auth.x.ai/oauth2/device/code",tokenUrl:"https://auth.x.ai/oauth2/token",refreshUrl:"https://auth.x.ai/oauth2/token",scope:"openid profile email offline_access grok-cli:access api:access conversations:read conversations:write",referrer:"grok-build",refreshLeadMs:3e5},w={defaultBaseUrl:"https://gitlab.com",authorizeUrlPath:"/oauth/authorize",tokenUrlPath:"/oauth/token",userInfoUrlPath:"/api/v4/user",scope:"api read_user",codeChallengeMethod:"S256"},x={baseUrl:"https://www.codebuddy.ai",stateUrl:"https://www.codebuddy.ai/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.ai/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.ai/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.ai/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.ai/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.ai",platform:"CLI",pollInterval:5e3},y={baseUrl:"https://www.codebuddy.cn",stateUrl:"https://www.codebuddy.cn/v2/plugin/auth/state",tokenUrl:"https://www.codebuddy.cn/v2/plugin/auth/token",accountUrl:"https://www.codebuddy.cn/v2/plugin/login/account",accountsUrl:"https://www.codebuddy.cn/v2/plugin/accounts",refreshUrl:"https://www.codebuddy.cn/v2/plugin/auth/token/refresh",userAgent:"CLI/2.63.2 CodeBuddy/2.63.2",domain:"www.codebuddy.cn",platform:"CLI",pollInterval:5e3},z=3e5},93943:(a,b,c)=>{"use strict";c.d(b,{Vq:()=>i,fp:()=>g});var d=c(8590);let e=new Map;function f(a){if(null==a||""===a)return null;if("number"==typeof a)return a<1e12?1e3*a:a;let b=new Date(a).getTime();return Number.isFinite(b)?b:null}function g(a,b,c=Date.now()){if(!b)return!1;let e=f(b?.expiresAt??b?.tokenExpiresAt);return!!(null!==e&&e-c<(0,d.Og)(a)||"codex"===a&&b.refreshToken&&function(a,b=Date.now()){let c=f(a?.lastRefreshAt??a?.lastRefresh??a?.providerSpecificData?.lastRefreshAt);return!c||b-c>=6912e5}(b,c))}async function h(a,b,c){let d,f=(d=b?.connectionId||b?.id||b?.email||b?.name||b?.refreshToken?.slice?.(-16)||"default",`${a}:${d}`),g=e.get(f);if(g)return g;let h=Promise.resolve().then(c).finally(()=>{e.delete(f)});return e.set(f,h),h}async function i(a,b,c){return b?h(a,b,async()=>{let e=await (0,d.$B)(a,b,c);return function(a,b,c,e=Date.now()){var f,g;if(!c)return null;if((0,d.jT)(c))return c;let h={},i=new Date(e).toISOString();c.accessToken&&(h.accessToken=c.accessToken),c.apiKey&&(h.apiKey=c.apiKey),c.token&&(h.token=c.token);let j=c.refreshToken??b?.refreshToken;j&&(h.refreshToken=j);let k=c.idToken??b?.idToken;return k&&(h.idToken=k),c.expiresIn?(h.expiresIn=c.expiresIn,h.expiresAt=function(a,b=Date.now()){return a?new Date(b+1e3*a).toISOString():null}(c.expiresIn,e)):c.expiresAt&&(h.expiresAt=c.expiresAt),c.projectId&&(h.projectId=c.projectId),c.providerSpecificData&&(f=b?.providerSpecificData,h.providerSpecificData=(g=c.providerSpecificData)&&"object"==typeof g?{...f||{},...g}:f),c.copilotToken&&(h.copilotToken=c.copilotToken),c.copilotTokenExpiresAt&&(h.copilotTokenExpiresAt=c.copilotTokenExpiresAt),("codex"===a||h.accessToken||h.apiKey||h.token||h.refreshToken||h.copilotToken)&&(h.lastRefreshAt=c.lastRefreshAt||i),h}(a,b,e)}):null}},96487:()=>{}};
@@ -1 +1 @@
1
- exports.id=5469,exports.ids=[5469],exports.modules={73180:(a,b,c)=>{"use strict";c.d(b,{default:()=>o});var d=c(48249),e=c(67484),f=c(26921),g=c(11656),h=c(50412);c(91431),c(96919);let i=[],j=["Explain this project like I'm new","Write a concise PR description","Debug this error message","Summarize the key trade-offs"];function k(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function l(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(l).filter(Boolean).join(" ");if("object"==typeof a){if("string"==typeof a.message)return a.message;if("string"==typeof a.error)return a.error;try{return JSON.stringify(a)}catch{}}return String(a)}function m(a=""){let b=l(a).replace(/\s+/g," ").trim();return b?b.length>52?`${b.slice(0,52).trimEnd()}…`:b:"New chat"}async function n(a){return await new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(String(d.result||"")),d.onerror=()=>c(d.error||Error("Failed to read file")),d.readAsDataURL(a)})}function o(){let[a,b]=(0,e.useState)([]),[c,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(()=>[]),[t,u]=(0,e.useState)(()=>""),[v,w]=(0,e.useState)(()=>""),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(()=>""),[B,C]=(0,e.useState)([]),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(""),[V,W]=(0,e.useState)(()=>.7),[X,Y]=(0,e.useState)(()=>""),Z=(0,e.useRef)(null),$=(0,e.useRef)(null);(0,e.useRef)(!1);let _=(0,e.useRef)(null),aa=(0,e.useRef)(null),ab=(0,e.useRef)(null),ac=(0,e.useRef)(null),ad=(0,e.useRef)(null),ae=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)for(let a of c.models)b.set(a.id,{...a,providerId:c.providerId,providerName:c.providerName});return b},[a]),af=(0,e.useMemo)(()=>a.find(a=>a.providerId===v)||a[0]||null,[a,v]),ag=(0,e.useMemo)(()=>{if(x&&ae.has(x))return ae.get(x);if(t){let a=r.find(a=>a.id===t);if(a?.modelId&&ae.has(a.modelId))return ae.get(a.modelId)}return af?.models?.[0]||null},[x,ae,af,r,t]),ah=(0,e.useMemo)(()=>r.find(a=>a.id===t)||null,[r,t]),ai=ah?.messages||i,aj=(0,e.useMemo)(()=>[...r].sort((a,b)=>new Date(b.updatedAt).getTime()-new Date(a.updatedAt).getTime()),[r]),ak=!D&&!!ag&&(z.trim().length>0||B.length>0),al=(a,b)=>{s(c=>c.map(c=>c.id===a?b({...c,messages:Array.isArray(c.messages)?c.messages.map(a=>({...a})):[]}):c))},am=a=>a?{id:k(),title:"New chat",providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,an=()=>{if(!ag)return;let a=am(ag);a&&(s(b=>[a,...b]),u(a.id),w(a.providerId),y(a.modelId),A(""),C([]),G(""),I(""))},ao=async a=>{let b=Array.from(a.target.files||[]);if(0===b.length)return;let c=b.filter(a=>a.type.startsWith("image/"));if(0===c.length){a.target.value="";return}let d=await Promise.all(c.map(async a=>({id:k(),name:a.name,type:a.type,size:a.size,dataUrl:await n(a)})));C(a=>[...a,...d]),a.target.value=""},ap=(a,b)=>{let c=m(b);al(a,a=>({...a,title:"New chat"===a.title?c:a.title,updatedAt:new Date().toISOString()}))},aq=async(a,b)=>{try{await navigator.clipboard.writeText(l(b)),U(a),setTimeout(()=>U(b=>b===a?"":b),1500)}catch{}},ar=async(a={})=>{let b=ag||af?.models?.[0]||null;if(!b)return;let c=!0===a.regenerate,d=t,e=r.find(a=>a.id===d),f="string"==typeof a.userText?a.userText:z.trim(),g=Array.isArray(a.attachments)?a.attachments:B;if(c){if(!e)return;let a=[...e.messages||[]];for(;a.length&&a[a.length-1]?.role==="assistant";)a.pop();let b=[...a].reverse().find(a=>"user"===a.role);if(!b)return;f=l(b.content).trim(),g=Array.isArray(b.attachments)?b.attachments:[],e={...e,messages:a},s(a=>a.map(a=>a.id===d?e:a))}if(!f&&(!g||0===g.length))return;if(!e){if(!(e=am(b)))return;d=e.id,s(a=>[e,...a]),u(d)}let h=c?null:{id:k(),role:"user",content:f,attachments:(g||[]).map(a=>({id:a.id,name:a.name,type:a.type,dataUrl:a.dataUrl})),createdAt:new Date().toISOString()},i=k(),j={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...c?[...e.messages||[]]:[...e.messages||[],h],j];s(a=>a.map(a=>a.id===d?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?m(f):a.title}:a)),!c&&(A(""),C([]),ac.current&&(ac.current.style.height="auto")),E(!0),G(i),I(""),$.current?.abort(),$.current=new AbortController;let o=n.filter(a=>"assistant"!==a.role||a.id!==i).map(a=>({role:a.role,content:"user"===a.role?function(a){let b=l(a.content).trim(),c=Array.isArray(a.attachments)?a.attachments:[];if(0===c.length)return b;let d=[];for(let a of(b&&d.push({type:"text",text:b}),c))a?.dataUrl&&d.push({type:"image_url",image_url:{url:a.dataUrl}});return d.length>0?d:b}(a):a.content})),p=X.trim(),q=p?[{role:"system",content:p},...o]:o;try{let a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:b.requestModel||b.id,messages:q,stream:!0,temperature:V}),signal:$.current.signal});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(l(b.error||b.message||`Request failed (${a.status})`))}let c=a.body?.getReader();if(!c){let b=await a.json().catch(()=>({})),c=l(b?.choices?.[0]?.message?.content||b?.output_text||b?.error||b?.message||"");al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:c,status:"done"}:a),updatedAt:new Date().toISOString()}));return}let e=new TextDecoder,g="",h="";for(;;){let{value:a,done:b}=await c.read();if(b)break;let f=(g+=e.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(g=f.pop()||"",f)){let b=a.trim();if(!b.startsWith("data:"))continue;let c=b.slice(5).trim();if(c&&"[DONE]"!==c)try{let a=JSON.parse(c),b=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];return[(b?.delta||{}).content,b?.message?.content,a.output_text,a.text].map(l).filter(Boolean)[0]||""}(a);if(!b)continue;h+=b,I(h),al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:h,status:"streaming"}:a),updatedAt:new Date().toISOString()}))}catch{}}}al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:h||a.content,status:"done"}:a),updatedAt:new Date().toISOString()})),ap(d,f)}catch(a){if("AbortError"===a.name)al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:a.content||"Stopped",status:"stopped"}:a),updatedAt:new Date().toISOString()})),ap(d,f);else{let b=l(a?.message||a);al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:a.content||`Error: ${b}`,status:"error"}:a),updatedAt:new Date().toISOString()}))}}finally{E(!1),G(""),I(""),$.current=null}},as=ag?ag.name:"Select model",at=ag?`${ag.providerName||""} \xb7 ${ag.requestModel||ag.id}`.replace(/^ · /,""):"Connected providers only",au=(0,e.useMemo)(()=>{let b=N.trim().toLowerCase();return b?a.map(a=>{let c=(a.providerName||"").toLowerCase().includes(b)||(a.providerId||"").toLowerCase().includes(b)?a.models:a.models.filter(a=>`${a.name||""} ${a.requestModel||""} ${a.id||""}`.toLowerCase().includes(b));return{...a,models:c}}).filter(a=>a.models.length>0):a},[a,N]);return(0,d.jsxs)("div",{className:"relative flex h-full min-h-0 min-w-0 flex-1 overflow-hidden bg-bg text-text-main",children:[(0,d.jsxs)("aside",{id:"playground-history",className:`${P?"flex":"hidden"} fixed inset-y-0 left-0 z-30 w-[min(85vw,260px)] shrink-0 flex-col border-r border-border-subtle bg-surface/95 backdrop-blur-xl lg:static lg:z-auto lg:flex lg:w-[260px] lg:bg-surface/60`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border-subtle p-3",children:[(0,d.jsxs)("button",{type:"button",onClick:an,disabled:!ag,className:"flex h-9 flex-1 items-center justify-center gap-2 rounded-[10px] bg-primary text-sm font-semibold text-white transition hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"New chat"]}),(0,d.jsx)("button",{type:"button",className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted lg:hidden hover:bg-surface-2",onClick:()=>Q(!1),"aria-label":"Close history",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{ref:aa,className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:[(0,d.jsx)("p",{className:"px-2 py-2 text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Chats"}),0===aj.length?(0,d.jsx)("div",{className:"rounded-[10px] border border-dashed border-border px-3 py-6 text-center text-xs text-text-muted",children:"No conversations yet"}):(0,d.jsx)("div",{className:"space-y-0.5",children:aj.map(a=>{let b=a.id===t,c=[...a.messages||[]].reverse().find(a=>"user"===a.role)||a.messages?.[0];return(0,d.jsxs)("button",{type:"button",onClick:()=>{var b;let c;b=a.id,(c=r.find(a=>a.id===b))&&(u(b),w(c.providerId||v),y(c.modelId||x),Q(!1))},className:`group flex w-full items-start gap-2 rounded-[10px] px-2.5 py-2.5 text-left transition ${b?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-[16px] opacity-70",children:"chat_bubble"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium leading-snug",children:a.title||"New chat"}),(0,d.jsxs)("p",{className:"mt-0.5 truncate text-[11px] opacity-60",children:[l(c?.content)||"Empty"," \xb7"," ",function(a){if(!a)return"Now";let b=new Date(a).getTime();if(Number.isNaN(b))return"Now";let c=Math.max(1,Math.round((Date.now()-b)/6e4));if(c<60)return`${c}m`;let d=Math.round(c/60);return d<24?`${d}h`:`${Math.round(d/24)}d`}(a.updatedAt)]})]})]},a.id)})})]}),(0,d.jsx)("div",{className:"border-t border-border-subtle p-3",children:(0,d.jsxs)("button",{type:"button",onClick:()=>{if(!t)return;let a=r.filter(a=>a.id!==t),b=a[0]||null;s(a),b?(u(b.id),w(b.providerId),y(b.modelId)):(u(""),w(""),y(""))},disabled:!t||0===r.length,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-[8px] text-xs font-medium text-text-muted transition hover:bg-surface-2 hover:text-danger disabled:opacity-40",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"}),"Delete current chat"]})})]}),(0,d.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-col",children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle px-3 py-2 lg:hidden",children:[(0,d.jsx)("button",{type:"button",onClick:()=>Q(!0),className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted hover:bg-surface-2","aria-label":"Open chats","aria-expanded":P,"aria-controls":"playground-history",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"history"})}),(0,d.jsxs)("div",{className:"min-w-0 text-center",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:as}),(0,d.jsx)("p",{className:"truncate text-[11px] text-text-subtle",children:at})]}),(0,d.jsx)("button",{type:"button",onClick:an,disabled:!ag,className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted hover:bg-surface-2 disabled:opacity-40","aria-label":"New chat",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"edit_square"})})]}),p?(0,d.jsx)("div",{role:"alert",className:"mx-4 mt-3 rounded-[10px] border border-danger/25 bg-danger/10 px-3 py-2.5 text-sm text-danger",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,d.jsx)("p",{children:p})]})}):null,(0,d.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===ai.length?(0,d.jsxs)("div",{className:"flex min-h-full flex-col items-center justify-center px-6 pb-36 pt-10 text-center",children:[(0,d.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-2xl border border-border bg-surface text-primary shadow-soft",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:"forum"})}),(0,d.jsx)("h2",{className:"text-[22px] font-semibold tracking-tight text-text-main",children:"How can I help?"}),(0,d.jsx)("p",{className:"mt-1.5 max-w-md text-[13px] leading-relaxed text-text-muted",children:"Pick a model below, then ask anything through your connected providers."}),(0,d.jsx)("div",{className:"mt-6 flex max-w-xl flex-wrap items-center justify-center gap-2",children:j.map(a=>(0,d.jsx)("button",{type:"button",disabled:!ag||c,onClick:()=>{A(a),requestAnimationFrame(()=>ac.current?.focus())},className:"rounded-full border border-border bg-surface px-3.5 py-2 text-left text-[12.5px] text-text-muted transition hover:border-primary/35 hover:bg-primary/5 hover:text-text-main disabled:opacity-40",children:a},a))}),c?(0,d.jsx)("p",{className:"mt-4 text-xs text-text-subtle",children:"Loading models…"}):null]}):(0,d.jsxs)("div",{className:"mx-auto w-full max-w-3xl px-4 py-6 lg:px-8",children:[ai.map((a,b)=>{let c="user"===a.role,e="assistant"===a.role,h=e&&a.id===F&&"streaming"===a.status,i=l(a.content)||(e?H:""),j="error"===a.status,k="stopped"===a.status,m=e&&b===ai.length-1&&"streaming"!==a.status;return(0,d.jsx)("div",{className:"group relative mb-1 border-b border-border-subtle/50 py-5 last:border-0",children:(0,d.jsxs)("div",{className:"flex gap-3.5",children:[(0,d.jsx)("div",{className:`flex size-7 shrink-0 items-center justify-center rounded-full text-[11px] font-bold ${c?"bg-primary text-white":"border border-border bg-surface-2 text-text-muted"}`,children:c?"Y":"AI"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"mb-1.5 text-[12px] font-semibold text-text-main",children:c?"You":ag?.name||"Assistant"}),a.attachments?.length?(0,d.jsx)("div",{className:"mb-3 grid max-w-md grid-cols-2 gap-2 sm:grid-cols-3",children:a.attachments.map(a=>(0,d.jsx)("a",{href:a.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-lg border border-border",children:(0,d.jsx)("img",{src:a.dataUrl,alt:a.name,className:"h-24 w-full object-cover"})},a.id))}):null,e&&!j?(0,d.jsx)("div",{className:"playground-md text-[14.5px] leading-[1.7] text-text-main",dangerouslySetInnerHTML:{__html:function(a){let b=l(a);if(!b)return"";try{return g.A.sanitize(f.xI.parse(b))}catch{return b.replace(/</g,"&lt;").replace(/>/g,"&gt;")}}(i)||""}}):(0,d.jsx)("div",{className:`whitespace-pre-wrap break-words text-[14.5px] leading-[1.7] ${j?"text-danger":"text-text-main"}`,children:i}),e&&h?(0,d.jsx)("span",{className:"ml-0.5 inline-block animate-pulse text-primary",children:"▋"}):null,k?(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Generation stopped"}):null,e&&i&&!h?(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-1 opacity-100 transition sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>aq(a.id,i),className:"inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-text-muted hover:bg-surface-2 hover:text-text-main",title:"Copy",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:T===a.id?"check":"content_copy"}),T===a.id?"Copied":"Copy"]}),m&&!D?(0,d.jsxs)("button",{type:"button",onClick:()=>ar({regenerate:!0}),className:"inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-text-muted hover:bg-surface-2 hover:text-text-main",title:"Regenerate",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]}):null]}):null]})]})},a.id)}),(0,d.jsx)("div",{ref:ad})]})}),(0,d.jsx)("div",{className:"shrink-0 border-t border-border-subtle bg-bg/90 backdrop-blur-xl",children:(0,d.jsxs)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-4 pt-3 lg:px-6",children:[B.length>0?(0,d.jsx)("div",{className:"mb-2 flex flex-wrap gap-2",children:B.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border bg-surface px-3 py-1.5",children:[(0,d.jsx)("span",{className:"max-w-[10rem] truncate text-xs text-text-muted",children:a.name}),(0,d.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.id,void C(a=>a.filter(a=>a.id!==b))},className:"text-text-subtle hover:text-text-main","aria-label":"Remove attachment",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},a.id))}):null,(0,d.jsxs)("div",{className:"rounded-2xl border border-border-subtle bg-surface-2/80 shadow-soft ring-1 ring-border-subtle focus-within:border-primary/50 focus-within:ring-primary/20 transition",children:[(0,d.jsx)("textarea",{ref:ac,"aria-label":"Message",value:z,onChange:a=>A(a.target.value),onKeyDown:a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),ak&&ar())},placeholder:ag?`Message ${ag.name}…`:"Select a model below to start chatting",rows:1,disabled:!ag||c,className:"max-h-[28vh] min-h-[52px] w-full resize-none overflow-y-auto bg-transparent px-4 pt-3.5 text-[15px] leading-6 text-text-main outline-none placeholder:text-text-subtle custom-scrollbar disabled:opacity-50"}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-2.5 pb-2.5 pt-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>Z.current?.click(),disabled:!ag||c,className:"inline-flex h-11 items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-[12px] font-medium text-text-main transition hover:border-primary/40 hover:bg-primary/10 hover:text-primary disabled:cursor-not-allowed disabled:opacity-40",title:"Upload image",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_photo_alternate"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Image"})]}),(0,d.jsx)("input",{ref:Z,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ao}),(0,d.jsxs)("div",{ref:ab,className:"relative",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>S(a=>!a),className:`inline-flex h-11 items-center gap-1.5 rounded-full border px-3 text-[12px] font-medium transition ${R||X.trim()||.7!==V?"border-primary/40 bg-primary/10 text-primary":"border-border bg-surface text-text-main hover:border-primary/40 hover:bg-primary/10 hover:text-primary"}`,title:"Chat settings","aria-label":"Chat settings","aria-expanded":R,"aria-controls":"playground-chat-settings",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"}),(0,d.jsx)("span",{className:"hidden sm:inline tabular-nums",children:V.toFixed(1)})]}),R?(0,d.jsxs)("div",{id:"playground-chat-settings",className:"absolute bottom-[calc(100%+8px)] left-0 z-40 w-[min(320px,calc(100vw-2rem))] space-y-3 rounded-xl border border-border bg-surface p-3 shadow-elevated",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Temperature"}),(0,d.jsx)("span",{className:"text-xs font-semibold tabular-nums text-text-main",children:V.toFixed(2)})]}),(0,d.jsx)("input",{type:"range",min:0,max:2,step:.05,value:V,onChange:a=>W(Number(a.target.value)),className:"w-full accent-[var(--color-primary,#E56A4A)]"}),(0,d.jsxs)("div",{className:"mt-1 flex justify-between text-[10px] text-text-subtle",children:[(0,d.jsx)("span",{children:"Precise"}),(0,d.jsx)("span",{children:"Creative"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"System prompt"}),(0,d.jsx)("textarea",{value:X,onChange:a=>Y(a.target.value),rows:4,placeholder:"Optional instructions for the model…",className:"w-full resize-y rounded-lg border border-border bg-bg px-2.5 py-2 text-[12.5px] leading-5 text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40 custom-scrollbar"})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{W(.7),Y("")},className:"text-[11px] font-medium text-text-muted hover:text-text-main",children:"Reset defaults"})]}):null]}),(0,d.jsxs)("div",{ref:_,className:"relative min-w-0",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{M(a=>{let b=!a;return b||O(""),b})},disabled:c||0===a.length,"aria-label":`Choose model, currently ${as}`,"aria-haspopup":"listbox","aria-expanded":L,"aria-controls":"playground-model-menu",className:"inline-flex h-11 max-w-[min(100vw-12rem,260px)] items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-left transition hover:border-primary/40 hover:bg-surface-2 disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary shrink-0",children:"smart_toy"}),(0,d.jsx)("span",{className:"min-w-0 truncate text-[12.5px] font-semibold text-text-main",children:c?"Loading…":as}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[16px] text-text-muted",children:L?"expand_less":"expand_more"})]}),L?(0,d.jsxs)("div",{id:"playground-model-menu",role:"listbox","aria-label":"Models",className:"absolute bottom-[calc(100%+8px)] left-0 z-40 w-[min(420px,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-surface shadow-elevated",children:[(0,d.jsxs)("div",{className:"border-b border-border-subtle px-3 py-2.5 space-y-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Models"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[a.length," providers \xb7 search by name"]})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:N,onChange:a=>O(a.target.value),placeholder:"Search models…",autoFocus:!0,className:"w-full rounded-lg border border-border bg-bg py-1.5 pl-8 pr-3 text-[16px] text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),(0,d.jsx)("div",{className:"max-h-[min(50vh,360px)] overflow-y-auto p-1.5 custom-scrollbar",children:0===au.length?(0,d.jsxs)("p",{className:"px-3 py-6 text-center text-xs text-text-muted",children:["No models match “",N.trim(),"”"]}):au.map(a=>(0,d.jsxs)("div",{className:"mb-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-subtle",children:a.providerName}),(0,d.jsx)(h.Ex,{size:"sm",variant:"default",children:a.models.length})]}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.models.map(a=>{let b=a.id===x;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>{(a=>{let b=ae.get(a);if(!b)return;let c=r.find(a=>a.id===t);if(c&&c.messages.length>0){let a=am(b);if(!a)return;s(b=>[a,...b]),u(a.id)}else if(c)s(a=>a.map(a=>a.id===c.id?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name}:a)),u(c.id);else{let a=am(b);if(!a)return;s(b=>[a,...b]),u(a.id)}w(b.providerId),y(b.id),M(!1)})(a.id),O("")},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${b?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"}`,children:[(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-[13px] font-medium",children:a.name}),(0,d.jsx)("span",{className:"block truncate text-[11px] opacity-60",children:a.requestModel})]}),b?(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check"}):null]},a.id)})})]},a.providerId))})]}):null]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[D?(0,d.jsxs)("button",{type:"button",onClick:()=>{$.current?.abort()},className:"inline-flex h-11 items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-[12px] font-semibold text-text-main transition hover:bg-surface-2",title:"Stop generating",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Stop"})]}):null,(0,d.jsxs)("button",{type:"button",onClick:ar,disabled:!ak,className:`inline-flex h-11 min-w-9 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] font-semibold transition ${ak?"bg-primary text-white shadow-[0_2px_12px_rgba(229,106,74,0.45)] hover:bg-primary-hover active:scale-[0.97]":"bg-surface-3 text-text-subtle cursor-not-allowed opacity-70"}`,title:"Send message",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] font-bold",children:"send"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Send"})]})]})]})]}),(0,d.jsx)("p",{className:"mt-2 text-center text-[11px] text-text-subtle",children:"Routed through ZevaiRouter \xb7 Enter to send \xb7 Shift+Enter for new line"})]})})]}),P?(0,d.jsx)("button",{type:"button",className:"fixed inset-0 z-20 bg-black/40 lg:hidden","aria-label":"Close history",onClick:()=>Q(!1)}):null]})}f.xI.setOptions({gfm:!0,breaks:!0})},75746:(a,b,c)=>{Promise.resolve().then(c.bind(c,79286))},79286:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js","default")},93898:(a,b,c)=>{Promise.resolve().then(c.bind(c,73180))}};
1
+ exports.id=5469,exports.ids=[5469],exports.modules={73180:(a,b,c)=>{"use strict";c.d(b,{default:()=>o});var d=c(48249),e=c(67484),f=c(26921),g=c(11656),h=c(50412);c(91431),c(96919);let i=[],j=["Explain this project like I'm new","Write a concise PR description","Debug this error message","Summarize the key trade-offs"];function k(){return globalThis.crypto?.randomUUID?globalThis.crypto.randomUUID():`chat_${Date.now()}_${Math.random().toString(16).slice(2)}`}function l(a){if("string"==typeof a)return a;if(null==a)return"";if(Array.isArray(a))return a.map(l).filter(Boolean).join(" ");if("object"==typeof a){if("string"==typeof a.message)return a.message;if("string"==typeof a.error)return a.error;try{return JSON.stringify(a)}catch{}}return String(a)}function m(a=""){let b=l(a).replace(/\s+/g," ").trim();return b?b.length>52?`${b.slice(0,52).trimEnd()}…`:b:"New chat"}async function n(a){return await new Promise((b,c)=>{let d=new FileReader;d.onload=()=>b(String(d.result||"")),d.onerror=()=>c(d.error||Error("Failed to read file")),d.readAsDataURL(a)})}function o(){let[a,b]=(0,e.useState)([]),[c,o]=(0,e.useState)(!0),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)([]),[t,u]=(0,e.useState)(""),[v,w]=(0,e.useState)(""),[x,y]=(0,e.useState)(""),[z,A]=(0,e.useState)(""),[B,C]=(0,e.useState)([]),[D,E]=(0,e.useState)(!1),[F,G]=(0,e.useState)(""),[H,I]=(0,e.useState)(""),[J,K]=(0,e.useState)(!1),[L,M]=(0,e.useState)(!1),[N,O]=(0,e.useState)(""),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(""),[V,W]=(0,e.useState)(.7),[X,Y]=(0,e.useState)(""),Z=(0,e.useRef)(null),$=(0,e.useRef)(null);(0,e.useRef)(!1);let _=(0,e.useRef)(null),aa=(0,e.useRef)(null),ab=(0,e.useRef)(null),ac=(0,e.useRef)(null),ad=(0,e.useRef)(null),ae=(0,e.useMemo)(()=>{let b=new Map;for(let c of a)for(let a of c.models)b.set(a.id,{...a,providerId:c.providerId,providerName:c.providerName});return b},[a]),af=(0,e.useMemo)(()=>a.find(a=>a.providerId===v)||a[0]||null,[a,v]),ag=(0,e.useMemo)(()=>{if(x&&ae.has(x))return ae.get(x);if(t){let a=r.find(a=>a.id===t);if(a?.modelId&&ae.has(a.modelId))return ae.get(a.modelId)}return af?.models?.[0]||null},[x,ae,af,r,t]),ah=(0,e.useMemo)(()=>r.find(a=>a.id===t)||null,[r,t]),ai=ah?.messages||i,aj=(0,e.useMemo)(()=>[...r].sort((a,b)=>new Date(b.updatedAt).getTime()-new Date(a.updatedAt).getTime()),[r]),ak=!D&&!!ag&&(z.trim().length>0||B.length>0),al=(a,b)=>{s(c=>c.map(c=>c.id===a?b({...c,messages:Array.isArray(c.messages)?c.messages.map(a=>({...a})):[]}):c))},am=a=>a?{id:k(),title:"New chat",providerId:a.providerId,providerName:a.providerName,modelId:a.id,modelName:a.name,createdAt:new Date().toISOString(),updatedAt:new Date().toISOString(),messages:[]}:null,an=()=>{if(!ag)return;let a=am(ag);a&&(s(b=>[a,...b]),u(a.id),w(a.providerId),y(a.modelId),A(""),C([]),G(""),I(""))},ao=async a=>{let b=Array.from(a.target.files||[]);if(0===b.length)return;let c=b.filter(a=>a.type.startsWith("image/"));if(0===c.length){a.target.value="";return}let d=await Promise.all(c.map(async a=>({id:k(),name:a.name,type:a.type,size:a.size,dataUrl:await n(a)})));C(a=>[...a,...d]),a.target.value=""},ap=(a,b)=>{let c=m(b);al(a,a=>({...a,title:"New chat"===a.title?c:a.title,updatedAt:new Date().toISOString()}))},aq=async(a,b)=>{try{await navigator.clipboard.writeText(l(b)),U(a),setTimeout(()=>U(b=>b===a?"":b),1500)}catch{}},ar=async(a={})=>{let b=ag||af?.models?.[0]||null;if(!b)return;let c=!0===a.regenerate,d=t,e=r.find(a=>a.id===d),f="string"==typeof a.userText?a.userText:z.trim(),g=Array.isArray(a.attachments)?a.attachments:B;if(c){if(!e)return;let a=[...e.messages||[]];for(;a.length&&a[a.length-1]?.role==="assistant";)a.pop();let b=[...a].reverse().find(a=>"user"===a.role);if(!b)return;f=l(b.content).trim(),g=Array.isArray(b.attachments)?b.attachments:[],e={...e,messages:a},s(a=>a.map(a=>a.id===d?e:a))}if(!f&&(!g||0===g.length))return;if(!e){if(!(e=am(b)))return;d=e.id,s(a=>[e,...a]),u(d)}let h=c?null:{id:k(),role:"user",content:f,attachments:(g||[]).map(a=>({id:a.id,name:a.name,type:a.type,dataUrl:a.dataUrl})),createdAt:new Date().toISOString()},i=k(),j={id:i,role:"assistant",content:"",createdAt:new Date().toISOString(),status:"streaming"},n=[...c?[...e.messages||[]]:[...e.messages||[],h],j];s(a=>a.map(a=>a.id===d?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name,messages:n,updatedAt:new Date().toISOString(),title:"New chat"===a.title?m(f):a.title}:a)),!c&&(A(""),C([]),ac.current&&(ac.current.style.height="auto")),E(!0),G(i),I(""),$.current?.abort(),$.current=new AbortController;let o=n.filter(a=>"assistant"!==a.role||a.id!==i).map(a=>({role:a.role,content:"user"===a.role?function(a){let b=l(a.content).trim(),c=Array.isArray(a.attachments)?a.attachments:[];if(0===c.length)return b;let d=[];for(let a of(b&&d.push({type:"text",text:b}),c))a?.dataUrl&&d.push({type:"image_url",image_url:{url:a.dataUrl}});return d.length>0?d:b}(a):a.content})),p=X.trim(),q=p?[{role:"system",content:p},...o]:o;try{let a=await fetch("/api/dashboard/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream"},body:JSON.stringify({model:b.requestModel||b.id,messages:q,stream:!0,temperature:V}),signal:$.current.signal});if(!a.ok){let b=await a.json().catch(()=>({}));throw Error(l(b.error||b.message||`Request failed (${a.status})`))}let c=a.body?.getReader();if(!c){let b=await a.json().catch(()=>({})),c=l(b?.choices?.[0]?.message?.content||b?.output_text||b?.error||b?.message||"");al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:c,status:"done"}:a),updatedAt:new Date().toISOString()}));return}let e=new TextDecoder,g="",h="";for(;;){let{value:a,done:b}=await c.read();if(b)break;let f=(g+=e.decode(a,{stream:!0})).split(/\r?\n/);for(let a of(g=f.pop()||"",f)){let b=a.trim();if(!b.startsWith("data:"))continue;let c=b.slice(5).trim();if(c&&"[DONE]"!==c)try{let a=JSON.parse(c),b=function(a){if(!a||"object"!=typeof a)return"";let b=a.choices?.[0];return[(b?.delta||{}).content,b?.message?.content,a.output_text,a.text].map(l).filter(Boolean)[0]||""}(a);if(!b)continue;h+=b,I(h),al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:h,status:"streaming"}:a),updatedAt:new Date().toISOString()}))}catch{}}}al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:h||a.content,status:"done"}:a),updatedAt:new Date().toISOString()})),ap(d,f)}catch(a){if("AbortError"===a.name)al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:a.content||"Stopped",status:"stopped"}:a),updatedAt:new Date().toISOString()})),ap(d,f);else{let b=l(a?.message||a);al(d,a=>({...a,messages:a.messages.map(a=>a.id===i?{...a,content:a.content||`Error: ${b}`,status:"error"}:a),updatedAt:new Date().toISOString()}))}}finally{E(!1),G(""),I(""),$.current=null}},as=ag?ag.name:"Select model",at=ag?`${ag.providerName||""} \xb7 ${ag.requestModel||ag.id}`.replace(/^ · /,""):"Connected providers only",au=(0,e.useMemo)(()=>{let b=N.trim().toLowerCase();return b?a.map(a=>{let c=(a.providerName||"").toLowerCase().includes(b)||(a.providerId||"").toLowerCase().includes(b)?a.models:a.models.filter(a=>`${a.name||""} ${a.requestModel||""} ${a.id||""}`.toLowerCase().includes(b));return{...a,models:c}}).filter(a=>a.models.length>0):a},[a,N]);return(0,d.jsxs)("div",{className:"relative flex h-full min-h-0 min-w-0 flex-1 overflow-hidden bg-bg text-text-main",children:[(0,d.jsxs)("aside",{id:"playground-history",className:`${P?"flex":"hidden"} fixed inset-y-0 left-0 z-30 w-[min(85vw,260px)] shrink-0 flex-col border-r border-border-subtle bg-surface/95 backdrop-blur-xl lg:static lg:z-auto lg:flex lg:w-[260px] lg:bg-surface/60`,children:[(0,d.jsxs)("div",{className:"flex items-center gap-2 border-b border-border-subtle p-3",children:[(0,d.jsxs)("button",{type:"button",onClick:an,disabled:!ag,className:"flex h-9 flex-1 items-center justify-center gap-2 rounded-[10px] bg-primary text-sm font-semibold text-white transition hover:bg-primary-hover disabled:cursor-not-allowed disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"New chat"]}),(0,d.jsx)("button",{type:"button",className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted lg:hidden hover:bg-surface-2",onClick:()=>Q(!1),"aria-label":"Close history",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"close"})})]}),(0,d.jsxs)("div",{ref:aa,className:"flex-1 overflow-y-auto p-2 custom-scrollbar",children:[(0,d.jsx)("p",{className:"px-2 py-2 text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Chats"}),0===aj.length?(0,d.jsx)("div",{className:"rounded-[10px] border border-dashed border-border px-3 py-6 text-center text-xs text-text-muted",children:"No conversations yet"}):(0,d.jsx)("div",{className:"space-y-0.5",children:aj.map(a=>{let b=a.id===t,c=[...a.messages||[]].reverse().find(a=>"user"===a.role)||a.messages?.[0];return(0,d.jsxs)("button",{type:"button",onClick:()=>{var b;let c;b=a.id,(c=r.find(a=>a.id===b))&&(u(b),w(c.providerId||v),y(c.modelId||x),Q(!1))},className:`group flex w-full items-start gap-2 rounded-[10px] px-2.5 py-2.5 text-left transition ${b?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined mt-0.5 text-[16px] opacity-70",children:"chat_bubble"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-[13px] font-medium leading-snug",children:a.title||"New chat"}),(0,d.jsxs)("p",{className:"mt-0.5 truncate text-[11px] opacity-60",children:[l(c?.content)||"Empty"," \xb7"," ",function(a){if(!a)return"Now";let b=new Date(a).getTime();if(Number.isNaN(b))return"Now";let c=Math.max(1,Math.round((Date.now()-b)/6e4));if(c<60)return`${c}m`;let d=Math.round(c/60);return d<24?`${d}h`:`${Math.round(d/24)}d`}(a.updatedAt)]})]})]},a.id)})})]}),(0,d.jsx)("div",{className:"border-t border-border-subtle p-3",children:(0,d.jsxs)("button",{type:"button",onClick:()=>{if(!t)return;let a=r.filter(a=>a.id!==t),b=a[0]||null;s(a),b?(u(b.id),w(b.providerId),y(b.modelId)):(u(""),w(""),y(""))},disabled:!t||0===r.length,className:"flex h-8 w-full items-center justify-center gap-1.5 rounded-[8px] text-xs font-medium text-text-muted transition hover:bg-surface-2 hover:text-danger disabled:opacity-40",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"delete"}),"Delete current chat"]})})]}),(0,d.jsxs)("div",{className:"relative flex min-w-0 flex-1 flex-col",children:[(0,d.jsxs)("div",{className:"flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle px-3 py-2 lg:hidden",children:[(0,d.jsx)("button",{type:"button",onClick:()=>Q(!0),className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted hover:bg-surface-2","aria-label":"Open chats","aria-expanded":P,"aria-controls":"playground-history",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"history"})}),(0,d.jsxs)("div",{className:"min-w-0 text-center",children:[(0,d.jsx)("p",{className:"truncate text-sm font-semibold",children:as}),(0,d.jsx)("p",{className:"truncate text-[11px] text-text-subtle",children:at})]}),(0,d.jsx)("button",{type:"button",onClick:an,disabled:!ag,className:"flex size-11 items-center justify-center rounded-[10px] border border-border text-text-muted hover:bg-surface-2 disabled:opacity-40","aria-label":"New chat",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"edit_square"})})]}),p?(0,d.jsx)("div",{role:"alert",className:"mx-4 mt-3 rounded-[10px] border border-danger/25 bg-danger/10 px-3 py-2.5 text-sm text-danger",children:(0,d.jsxs)("div",{className:"flex items-start gap-2",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"error"}),(0,d.jsx)("p",{children:p})]})}):null,(0,d.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:0===ai.length?(0,d.jsxs)("div",{className:"flex min-h-full flex-col items-center justify-center px-6 pb-36 pt-10 text-center",children:[(0,d.jsx)("div",{className:"mb-4 flex size-12 items-center justify-center rounded-2xl border border-border bg-surface text-primary shadow-soft",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[26px]",children:"forum"})}),(0,d.jsx)("h2",{className:"text-[22px] font-semibold tracking-tight text-text-main",children:"How can I help?"}),(0,d.jsx)("p",{className:"mt-1.5 max-w-md text-[13px] leading-relaxed text-text-muted",children:"Pick a model below, then ask anything through your connected providers."}),(0,d.jsx)("div",{className:"mt-6 flex max-w-xl flex-wrap items-center justify-center gap-2",children:j.map(a=>(0,d.jsx)("button",{type:"button",disabled:!ag||c,onClick:()=>{A(a),requestAnimationFrame(()=>ac.current?.focus())},className:"rounded-full border border-border bg-surface px-3.5 py-2 text-left text-[12.5px] text-text-muted transition hover:border-primary/35 hover:bg-primary/5 hover:text-text-main disabled:opacity-40",children:a},a))}),c?(0,d.jsx)("p",{className:"mt-4 text-xs text-text-subtle",children:"Loading models…"}):null]}):(0,d.jsxs)("div",{className:"mx-auto w-full max-w-3xl px-4 py-6 lg:px-8",children:[ai.map((a,b)=>{let c="user"===a.role,e="assistant"===a.role,h=e&&a.id===F&&"streaming"===a.status,i=l(a.content)||(e?H:""),j="error"===a.status,k="stopped"===a.status,m=e&&b===ai.length-1&&"streaming"!==a.status;return(0,d.jsx)("div",{className:"group relative mb-1 border-b border-border-subtle/50 py-5 last:border-0",children:(0,d.jsxs)("div",{className:"flex gap-3.5",children:[(0,d.jsx)("div",{className:`flex size-7 shrink-0 items-center justify-center rounded-full text-[11px] font-bold ${c?"bg-primary text-white":"border border-border bg-surface-2 text-text-muted"}`,children:c?"Y":"AI"}),(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"mb-1.5 text-[12px] font-semibold text-text-main",children:c?"You":ag?.name||"Assistant"}),a.attachments?.length?(0,d.jsx)("div",{className:"mb-3 grid max-w-md grid-cols-2 gap-2 sm:grid-cols-3",children:a.attachments.map(a=>(0,d.jsx)("a",{href:a.dataUrl,target:"_blank",rel:"noreferrer",className:"overflow-hidden rounded-lg border border-border",children:(0,d.jsx)("img",{src:a.dataUrl,alt:a.name,className:"h-24 w-full object-cover"})},a.id))}):null,e&&!j?(0,d.jsx)("div",{className:"playground-md text-[14.5px] leading-[1.7] text-text-main",dangerouslySetInnerHTML:{__html:function(a){let b=l(a);if(!b)return"";try{return g.A.sanitize(f.xI.parse(b))}catch{return b.replace(/</g,"&lt;").replace(/>/g,"&gt;")}}(i)||""}}):(0,d.jsx)("div",{className:`whitespace-pre-wrap break-words text-[14.5px] leading-[1.7] ${j?"text-danger":"text-text-main"}`,children:i}),e&&h?(0,d.jsx)("span",{className:"ml-0.5 inline-block animate-pulse text-primary",children:"▋"}):null,k?(0,d.jsx)("p",{className:"mt-2 text-xs text-text-muted",children:"Generation stopped"}):null,e&&i&&!h?(0,d.jsxs)("div",{className:"mt-2 flex items-center gap-1 opacity-100 transition sm:opacity-0 sm:group-hover:opacity-100 sm:group-focus-within:opacity-100",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>aq(a.id,i),className:"inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-text-muted hover:bg-surface-2 hover:text-text-main",title:"Copy",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:T===a.id?"check":"content_copy"}),T===a.id?"Copied":"Copy"]}),m&&!D?(0,d.jsxs)("button",{type:"button",onClick:()=>ar({regenerate:!0}),className:"inline-flex h-7 items-center gap-1 rounded-md px-2 text-[11px] font-medium text-text-muted hover:bg-surface-2 hover:text-text-main",title:"Regenerate",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"refresh"}),"Retry"]}):null]}):null]})]})},a.id)}),(0,d.jsx)("div",{ref:ad})]})}),(0,d.jsx)("div",{className:"shrink-0 border-t border-border-subtle bg-bg/90 backdrop-blur-xl",children:(0,d.jsxs)("div",{className:"mx-auto w-full max-w-3xl px-4 pb-4 pt-3 lg:px-6",children:[B.length>0?(0,d.jsx)("div",{className:"mb-2 flex flex-wrap gap-2",children:B.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-full border border-border bg-surface px-3 py-1.5",children:[(0,d.jsx)("span",{className:"max-w-[10rem] truncate text-xs text-text-muted",children:a.name}),(0,d.jsx)("button",{type:"button",onClick:()=>{var b;return b=a.id,void C(a=>a.filter(a=>a.id!==b))},className:"text-text-subtle hover:text-text-main","aria-label":"Remove attachment",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})})]},a.id))}):null,(0,d.jsxs)("div",{className:"rounded-2xl border border-border-subtle bg-surface-2/80 shadow-soft ring-1 ring-border-subtle focus-within:border-primary/50 focus-within:ring-primary/20 transition",children:[(0,d.jsx)("textarea",{ref:ac,"aria-label":"Message",value:z,onChange:a=>A(a.target.value),onKeyDown:a=>{"Enter"===a.key&&!a.shiftKey&&(a.preventDefault(),ak&&ar())},placeholder:ag?`Message ${ag.name}…`:"Select a model below to start chatting",rows:1,disabled:!ag||c,className:"max-h-[28vh] min-h-[52px] w-full resize-none overflow-y-auto bg-transparent px-4 pt-3.5 text-[15px] leading-6 text-text-main outline-none placeholder:text-text-subtle custom-scrollbar disabled:opacity-50"}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2 px-2.5 pb-2.5 pt-1",children:[(0,d.jsxs)("div",{className:"flex min-w-0 items-center gap-1.5",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>Z.current?.click(),disabled:!ag||c,className:"inline-flex h-11 items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-[12px] font-medium text-text-main transition hover:border-primary/40 hover:bg-primary/10 hover:text-primary disabled:cursor-not-allowed disabled:opacity-40",title:"Upload image",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_photo_alternate"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Image"})]}),(0,d.jsx)("input",{ref:Z,type:"file",accept:"image/*",multiple:!0,className:"hidden",onChange:ao}),(0,d.jsxs)("div",{ref:ab,className:"relative",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>S(a=>!a),className:`inline-flex h-11 items-center gap-1.5 rounded-full border px-3 text-[12px] font-medium transition ${R||X.trim()||.7!==V?"border-primary/40 bg-primary/10 text-primary":"border-border bg-surface text-text-main hover:border-primary/40 hover:bg-primary/10 hover:text-primary"}`,title:"Chat settings","aria-label":"Chat settings","aria-expanded":R,"aria-controls":"playground-chat-settings",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"}),(0,d.jsx)("span",{className:"hidden sm:inline tabular-nums",children:V.toFixed(1)})]}),R?(0,d.jsxs)("div",{id:"playground-chat-settings",className:"absolute bottom-[calc(100%+8px)] left-0 z-40 w-[min(320px,calc(100vw-2rem))] space-y-3 rounded-xl border border-border bg-surface p-3 shadow-elevated",children:[(0,d.jsxs)("div",{children:[(0,d.jsxs)("div",{className:"mb-1.5 flex items-center justify-between gap-2",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Temperature"}),(0,d.jsx)("span",{className:"text-xs font-semibold tabular-nums text-text-main",children:V.toFixed(2)})]}),(0,d.jsx)("input",{type:"range",min:0,max:2,step:.05,value:V,onChange:a=>W(Number(a.target.value)),className:"w-full accent-[var(--color-primary,#E56A4A)]"}),(0,d.jsxs)("div",{className:"mt-1 flex justify-between text-[10px] text-text-subtle",children:[(0,d.jsx)("span",{children:"Precise"}),(0,d.jsx)("span",{children:"Creative"})]})]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"mb-1.5 text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"System prompt"}),(0,d.jsx)("textarea",{value:X,onChange:a=>Y(a.target.value),rows:4,placeholder:"Optional instructions for the model…",className:"w-full resize-y rounded-lg border border-border bg-bg px-2.5 py-2 text-[12.5px] leading-5 text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40 custom-scrollbar"})]}),(0,d.jsx)("button",{type:"button",onClick:()=>{W(.7),Y("")},className:"text-[11px] font-medium text-text-muted hover:text-text-main",children:"Reset defaults"})]}):null]}),(0,d.jsxs)("div",{ref:_,className:"relative min-w-0",children:[(0,d.jsxs)("button",{type:"button",onClick:()=>{M(a=>{let b=!a;return b||O(""),b})},disabled:c||0===a.length,"aria-label":`Choose model, currently ${as}`,"aria-haspopup":"listbox","aria-expanded":L,"aria-controls":"playground-model-menu",className:"inline-flex h-11 max-w-[min(100vw-12rem,260px)] items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-left transition hover:border-primary/40 hover:bg-surface-2 disabled:opacity-50",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary shrink-0",children:"smart_toy"}),(0,d.jsx)("span",{className:"min-w-0 truncate text-[12.5px] font-semibold text-text-main",children:c?"Loading…":as}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-[16px] text-text-muted",children:L?"expand_less":"expand_more"})]}),L?(0,d.jsxs)("div",{id:"playground-model-menu",role:"listbox","aria-label":"Models",className:"absolute bottom-[calc(100%+8px)] left-0 z-40 w-[min(420px,calc(100vw-2rem))] overflow-hidden rounded-xl border border-border bg-surface shadow-elevated",children:[(0,d.jsxs)("div",{className:"border-b border-border-subtle px-3 py-2.5 space-y-2",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wider text-text-subtle",children:"Models"}),(0,d.jsxs)("p",{className:"text-xs text-text-muted",children:[a.length," providers \xb7 search by name"]})]}),(0,d.jsxs)("div",{className:"relative",children:[(0,d.jsx)("span",{className:"material-symbols-outlined pointer-events-none absolute left-2.5 top-1/2 -translate-y-1/2 text-[16px] text-text-subtle",children:"search"}),(0,d.jsx)("input",{type:"search",value:N,onChange:a=>O(a.target.value),placeholder:"Search models…",autoFocus:!0,className:"w-full rounded-lg border border-border bg-bg py-1.5 pl-8 pr-3 text-[16px] text-text-main outline-none placeholder:text-text-subtle focus:border-primary/40"})]})]}),(0,d.jsx)("div",{className:"max-h-[min(50vh,360px)] overflow-y-auto p-1.5 custom-scrollbar",children:0===au.length?(0,d.jsxs)("p",{className:"px-3 py-6 text-center text-xs text-text-muted",children:["No models match “",N.trim(),"”"]}):au.map(a=>(0,d.jsxs)("div",{className:"mb-1",children:[(0,d.jsxs)("div",{className:"flex items-center justify-between px-2 py-1.5",children:[(0,d.jsx)("p",{className:"text-[11px] font-semibold uppercase tracking-wide text-text-subtle",children:a.providerName}),(0,d.jsx)(h.Ex,{size:"sm",variant:"default",children:a.models.length})]}),(0,d.jsx)("div",{className:"space-y-0.5",children:a.models.map(a=>{let b=a.id===x;return(0,d.jsxs)("button",{type:"button",role:"option","aria-selected":b,onClick:()=>{(a=>{let b=ae.get(a);if(!b)return;let c=r.find(a=>a.id===t);if(c&&c.messages.length>0){let a=am(b);if(!a)return;s(b=>[a,...b]),u(a.id)}else if(c)s(a=>a.map(a=>a.id===c.id?{...a,providerId:b.providerId,providerName:b.providerName,modelId:b.id,modelName:b.name}:a)),u(c.id);else{let a=am(b);if(!a)return;s(b=>[a,...b]),u(a.id)}w(b.providerId),y(b.id),M(!1)})(a.id),O("")},className:`flex w-full items-center gap-2 rounded-lg px-2.5 py-2 text-left transition ${b?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface-2 hover:text-text-main"}`,children:[(0,d.jsxs)("span",{className:"min-w-0 flex-1",children:[(0,d.jsx)("span",{className:"block truncate text-[13px] font-medium",children:a.name}),(0,d.jsx)("span",{className:"block truncate text-[11px] opacity-60",children:a.requestModel})]}),b?(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check"}):null]},a.id)})})]},a.providerId))})]}):null]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[D?(0,d.jsxs)("button",{type:"button",onClick:()=>{$.current?.abort()},className:"inline-flex h-11 items-center gap-1.5 rounded-full border border-border bg-surface px-3 text-[12px] font-semibold text-text-main transition hover:bg-surface-2",title:"Stop generating",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"stop_circle"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Stop"})]}):null,(0,d.jsxs)("button",{type:"button",onClick:ar,disabled:!ak,className:`inline-flex h-11 min-w-9 items-center justify-center gap-1.5 rounded-full px-3.5 text-[13px] font-semibold transition ${ak?"bg-primary text-white shadow-[0_2px_12px_rgba(229,106,74,0.45)] hover:bg-primary-hover active:scale-[0.97]":"bg-surface-3 text-text-subtle cursor-not-allowed opacity-70"}`,title:"Send message",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px] font-bold",children:"send"}),(0,d.jsx)("span",{className:"hidden sm:inline",children:"Send"})]})]})]})]}),(0,d.jsx)("p",{className:"mt-2 text-center text-[11px] text-text-subtle",children:"Routed through ZevaiRouter \xb7 Enter to send \xb7 Shift+Enter for new line"})]})})]}),P?(0,d.jsx)("button",{type:"button",className:"fixed inset-0 z-20 bg-black/40 lg:hidden","aria-label":"Close history",onClick:()=>Q(!1)}):null]})}f.xI.setOptions({gfm:!0,breaks:!0})},75746:(a,b,c)=>{Promise.resolve().then(c.bind(c,79286))},79286:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"/Users/firda/zevairouter/src/app/(dashboard)/dashboard/basic-chat/BasicChatPageClient.js","default")},93898:(a,b,c)=>{Promise.resolve().then(c.bind(c,73180))}};
@@ -18,7 +18,7 @@ Zevai install doctor
18
18
  version: ${l||"not installed for this Node"}
19
19
  home data: ${h.join(g.homedir(),".zevai")}
20
20
  `);try{let a=(e("win32"===process.platform?"where":"which",["-a",j],{encoding:"utf8",shell:"win32"===process.platform}).stdout||"").trim().split(/\r?\n/).filter(Boolean);if(a.length){for(let b of(console.log(" PATH zevai binaries:"),a))console.log(` - ${b}`);a.length>1&&console.log("\n ⚠ Multiple zevai on PATH — use one Node only (nvm use / brew unlink).")}}catch{console.log(" PATH zevai: not found")}console.log("")}if(c.c[c.s]===a){let a=process.argv.slice(2);(a.includes("--doctor")||a.includes("doctor"))&&(w(),process.exit(0));let b="latest",c=a.indexOf("--version");c>=0&&a[c+1]&&(b=a[c+1]),a.includes("--latest")&&(b="latest");let d=v({version:b,forceClean:a.includes("--force-clean")||a.includes("--clean")});d.ok||(console.error(d.error||"install failed"),process.exit(1)),console.log(`
21
- Done. Run: zevai --version`),d.zevaiPath&&console.log(`Binary: ${d.zevaiPath}`),process.exit(0)}a.exports={safeInstallGlobal:v,printDoctor:w,detectPlatform:m,resolveNpmForThisNode:n,getGlobalRoot:p,APP_NAME:i,BIN_NAME:j}},75949:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DEFAULT_BULK_IMPORT_ENGINE:()=>e,buildAccountFingerprint:()=>h,buildFingerprintInitScript:()=>i,forceCloseBrowser:()=>n,launchBulkImportBrowser:()=>l,makeBrowserLauncher:()=>m,newStealthContext:()=>j,normalizeBulkImportEngine:()=>g});var d=c(77598);let e="cloakbrowser",f=new Set(["cloakbrowser"]);function g(a){if("string"!=typeof a||!a.trim())return e;let b=a.trim().toLowerCase();return"cloak"===b||"cloackbrowser"===b||"cloack"===b||"cloak-browser"===b||"chromium"===b||"chrome"===b||"camoufox"===b||"playwright"===b?"cloakbrowser":f.has(b)?b:e}function h(a){let b=(0,d.createHash)("sha256").update(String(a??`${Date.now()}-${Math.random()}`)).digest(),c=0,e=()=>(c>=b.length&&(b=(0,d.createHash)("sha256").update(b).digest(),c=0),b[c++]),f=a=>a[Math.floor(e()/256*a.length)%a.length],g=f([{width:1366,height:768},{width:1440,height:900},{width:1536,height:864},{width:1920,height:1080},{width:1280,height:800},{width:1600,height:900},{width:1280,height:720},{width:1680,height:1050},{width:2560,height:1440}]),h=g.width-e()%17,i=g.height-e()%13,j=f([0,30,40,48]),k=f([24,30,32]);return{seed:String(a??""),viewport:{width:h,height:i},deviceScaleFactor:f([1,1,1.25,1.5,2]),hardwareConcurrency:f([4,6,8,8,12,16]),deviceMemory:f([4,8,8,16]),maxTouchPoints:0,screen:{width:h,height:i,availWidth:h,availHeight:Math.max(i-j,Math.floor(.92*i)),colorDepth:k,pixelDepth:k}}}function i({languages:a,fingerprint:b}={}){return`
21
+ Done. Run: zevai --version`),d.zevaiPath&&console.log(`Binary: ${d.zevaiPath}`),process.exit(0)}a.exports={safeInstallGlobal:v,printDoctor:w,detectPlatform:m,resolveNpmForThisNode:n,getGlobalRoot:p,APP_NAME:i,BIN_NAME:j}},75949:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DEFAULT_BULK_IMPORT_ENGINE:()=>e,buildAccountFingerprint:()=>h,buildFingerprintInitScript:()=>j,compactAccountFingerprint:()=>i,forceCloseBrowser:()=>o,launchBulkImportBrowser:()=>m,makeBrowserLauncher:()=>n,newStealthContext:()=>k,normalizeBulkImportEngine:()=>g});var d=c(77598);let e="cloakbrowser",f=new Set(["cloakbrowser"]);function g(a){if("string"!=typeof a||!a.trim())return e;let b=a.trim().toLowerCase();return"cloak"===b||"cloackbrowser"===b||"cloack"===b||"cloak-browser"===b||"chromium"===b||"chrome"===b||"camoufox"===b||"playwright"===b?"cloakbrowser":f.has(b)?b:e}function h(a){let b=(0,d.createHash)("sha256").update(String(a??`${Date.now()}-${Math.random()}`)).digest(),c=0,e=()=>(c>=b.length&&(b=(0,d.createHash)("sha256").update(b).digest(),c=0),b[c++]),f=a=>a[Math.floor(e()/256*a.length)%a.length],g=f([{width:1366,height:768},{width:1440,height:900},{width:1536,height:864},{width:1920,height:1080},{width:1280,height:800},{width:1600,height:900},{width:1280,height:720},{width:1680,height:1050},{width:2560,height:1440}]),h=g.width-e()%17,i=g.height-e()%13,j=f([0,30,40,48]),k=f([24,30,32]);return{seed:String(a??""),viewport:{width:h,height:i},deviceScaleFactor:f([1,1,1.25,1.5,2]),hardwareConcurrency:f([4,6,8,8,12,16]),deviceMemory:f([4,8,8,16]),maxTouchPoints:0,screen:{width:h,height:i,availWidth:h,availHeight:Math.max(i-j,Math.floor(.92*i)),colorDepth:k,pixelDepth:k}}}function i(a,{maxWidth:b=1280,maxHeight:c=800,maxDeviceScaleFactor:d=1.25}={}){if(!a||"object"!=typeof a)return a;let e=a.viewport||{},f=a.screen||{},g=Math.min(Number(e.width)||b,b),h=Math.min(Number(e.height)||c,c),j=Number(f.height)||h,k=Number(f.availHeight)||j,l=Math.max(0,j-k);return{...a,viewport:{width:g,height:h},deviceScaleFactor:Math.min(Number(a.deviceScaleFactor)||1,d),screen:{...f,width:g,height:h,availWidth:g,availHeight:Math.max(0,h-Math.min(l,48))}}}function j({languages:a,fingerprint:b}={}){return`
22
22
  (() => {
23
23
  const profile = ${JSON.stringify({languages:Array.isArray(a)?a:null,hardwareConcurrency:b?.hardwareConcurrency??null,deviceMemory:b?.deviceMemory??null,maxTouchPoints:b?.maxTouchPoints??null,screen:b?.screen??null})};
24
24
  try {
@@ -52,9 +52,9 @@ Done. Run: zevai --version`),d.zevaiPath&&console.log(`Binary: ${d.zevaiPath}`)
52
52
  }
53
53
  } catch {}
54
54
  })();
55
- `}async function j(a,b={}){let{languages:c,fingerprint:d,...e}=b||{},f=await a.newContext(e);if(Array.isArray(c)&&c.length||d&&"object"==typeof d)try{await f.addInitScript(i({languages:c,fingerprint:d}))}catch{}return f}async function k({proxyUrl:a,headless:b=!1,windowSize:d=null}={}){let{ensureDisplayForHeadedBrowser:e}=await c.e(3331).then(c.bind(c,13331)),f=function(a){try{return c(50982)(`./${a}`)}catch{return null}}("cloakbrowserRuntime"),g=null;if(f?.ensureCloakbrowserRuntime){let a=f.ensureCloakbrowserRuntime({silent:!1});if(!a.ok&&a.error)throw a.error;g=a.module||f.loadCloakbrowserModule?.()}if(!g?.launch)try{let a=await Promise.resolve().then(function(){var a=Error("Cannot find module 'cloakbrowser'");throw a.code="MODULE_NOT_FOUND",a});g=a?.default||a}catch(b){let a=Error("cloakbrowser is not installed. Bulk import will auto-install on next run, or run: cd ~/.zevai/runtime && npm install cloakbrowser mmdb-lib playwright-core");throw a.code="CLOAKBROWSER_PACKAGE_MISSING",a.cause=b,a}if(!g?.launch){let a=Error("cloakbrowser loaded but launch() is missing");throw a.code="CLOAKBROWSER_API_MISMATCH",a}let h=!0===b;if(!h){let a=e();if(!a.ok)throw a.error}let i={headless:h,humanize:!0};a&&(i.proxy=a,i.geoip=!0),d?.width&&d?.height&&(i.viewport={width:d.width,height:d.height});try{return await g.launch(i)}catch(b){let a=String(b?.message||b||"");if(!h&&/XServer|DISPLAY|Missing X server|headed browser|no DISPLAY/i.test(a)){if(e().ok)return g.launch(i);let c=Error(`${a}
55
+ `}async function k(a,b={}){let{languages:c,fingerprint:d,...e}=b||{},f=await a.newContext(e);if(Array.isArray(c)&&c.length||d&&"object"==typeof d)try{await f.addInitScript(j({languages:c,fingerprint:d}))}catch{}return f}async function l({proxyUrl:a,headless:b=!1,windowSize:d=null}={}){let{ensureDisplayForHeadedBrowser:e}=await c.e(3331).then(c.bind(c,13331)),f=function(a){try{return c(50982)(`./${a}`)}catch{return null}}("cloakbrowserRuntime"),g=null;if(f?.ensureCloakbrowserRuntime){let a=f.ensureCloakbrowserRuntime({silent:!1});if(!a.ok&&a.error)throw a.error;g=a.module||f.loadCloakbrowserModule?.()}if(!g?.launch)try{let a=await Promise.resolve().then(function(){var a=Error("Cannot find module 'cloakbrowser'");throw a.code="MODULE_NOT_FOUND",a});g=a?.default||a}catch(b){let a=Error("cloakbrowser is not installed. Bulk import will auto-install on next run, or run: cd ~/.zevai/runtime && npm install cloakbrowser mmdb-lib playwright-core");throw a.code="CLOAKBROWSER_PACKAGE_MISSING",a.cause=b,a}if(!g?.launch){let a=Error("cloakbrowser loaded but launch() is missing");throw a.code="CLOAKBROWSER_API_MISMATCH",a}let h=!0===b;if(!h){let a=e();if(!a.ok)throw a.error}let i={headless:h,humanize:!0};a&&(i.proxy=a,i.geoip=!0),d?.width&&d?.height&&(i.viewport={width:d.width,height:d.height});try{return await g.launch(i)}catch(b){let a=String(b?.message||b||"");if(!h&&/XServer|DISPLAY|Missing X server|headed browser|no DISPLAY/i.test(a)){if(e().ok)return g.launch(i);let c=Error(`${a}
56
56
 
57
57
  VPS has no display. Install a virtual screen then retry:
58
58
  sudo apt-get update && sudo apt-get install -y xvfb
59
59
  sudo systemctl restart zevairouter
60
- ZevaiRouter auto-starts Xvfb when installed.`);throw c.code="NO_DISPLAY",c.cause=b,c}throw b}}async function l({engine:a=e,proxyUrl:b,headless:c=!1,windowSize:d=null}={}){return g(a),k({proxyUrl:b,headless:!0===c,windowSize:d})}function m({engine:a,proxyUrl:b,headless:c=!1,windowSize:d=null}={}){return()=>l({engine:a,proxyUrl:b,headless:c,windowSize:d})}async function n(a,{timeoutMs:b=4e3}={}){if(!a)return;let c=null;try{let b="function"==typeof a.process?a.process():null;c=b?.pid||null}catch{c=null}try{await Promise.race([Promise.resolve().then(()=>a.close()).catch(()=>null),new Promise(a=>setTimeout(a,b))])}catch{}if(c&&Number.isFinite(c)&&c>1)for(let a of["SIGTERM","SIGKILL"]){try{process.kill(c,0)}catch{break}try{process.kill(c,a)}catch{}try{process.kill(-c,a)}catch{}"SIGTERM"===a&&await new Promise(a=>setTimeout(a,400))}}},77897:(a,b,c)=>{let d=c(33873),e=c(29021);process.env.NPM_CONFIG_FUND="false",process.env.NPM_CONFIG_AUDIT="false",process.env.NPM_CONFIG_UPDATE_NOTIFIER="false",process.env.NPM_CONFIG_LOGLEVEL=process.env.NPM_CONFIG_LOGLEVEL||"error";let{ensureSqliteRuntime:f,runNpmInstall:g,getRuntimeDir:h}=c(24344),{ensureTrayRuntime:i}=c(52784),{ensureCloakbrowserRuntime:j}=c(99436),k="1"===process.env.ZEVAI_MINIMAL_POSTINSTALL||"true"===process.env.ZEVAI_MINIMAL_POSTINSTALL;function l(a){console.log(`[zevai] ${a}`)}function m(a){console.warn(`[zevai] ${a}`)}l(k?"Minimal postinstall (ZEVAI_MINIMAL_POSTINSTALL=1) — browsers install on first use":"Preparing full runtime so all features work after this install…");try{f({silent:!0}),l("✓ SQLite engine ready")}catch(a){m(`SQLite warm-up skipped: ${a.message}`)}try{i({silent:!0}),l("✓ System tray helper ready")}catch(a){m(`Tray warm-up skipped: ${a.message}`)}k&&(l("Done (minimal). Use bulk import / terminal once to finish remaining downloads."),process.exit(0));try{let a=j({silent:!0});a.ok?(l("✓ CloakBrowser ready (sole automation browser engine)"),function(){try{let{getRuntimeNodeModules:a}=c(24344),b=a(),f=d.join(__dirname,"..","app","node_modules");if(!e.existsSync(d.join(f,"next")))return;for(let a of["playwright-core","cloakbrowser","mmdb-lib"]){let c=d.join(b,a),g=d.join(f,a);e.existsSync(d.join(c,"package.json"))&&(e.existsSync(g)&&e.rmSync(g,{recursive:!0,force:!0}),e.cpSync(c,g,{recursive:!0}))}l("CloakBrowser runtime linked into app bundle")}catch{}}()):m(`CloakBrowser skipped: ${a.error?.message||a.reason||"unknown"}`)}catch(a){m(`CloakBrowser skipped: ${a.message}`)}try{let a=function(){if("win32"===process.platform)return{ok:!0,skipped:"windows uses pipe shell"};try{return c(Object(function(){var a=Error("Cannot find module 'node-pty'");throw a.code="MODULE_NOT_FOUND",a}())),{ok:!0,already:!0}}catch{}return g({cwd:h(),pkgs:["node-pty@^1.1.0"],timeout:3e5}).ok?{ok:!0}:{ok:!1,reason:"native build failed (terminal still works via python PTY / pipe)"}}();a.ok?l(a.already?"✓ node-pty already available":"✓ node-pty ready (web terminal)"):a.skipped?l(`\xb7 node-pty skipped (${a.skipped})`):m(`node-pty skipped: ${a.reason||"unknown"} — terminal still works`)}catch(a){m(`node-pty skipped: ${a.message}`)}l("Runtime warm-up finished. Start with: zevai"),process.exit(0)},99436:(a,b,c)=>{"use strict";let{createRequire:d}=c(8086),e=c(29021),f=c(33873),{runNpmInstall:g,getRuntimeDir:h,getRuntimeNodeModules:i,summarizeNpmError:j,buildEnvWithRuntime:k}=c(24344),l="cloakbrowser",m="^0.5.2",n="mmdb-lib",o="^3.0.2",p="playwright-core",q="^1.54.2",r="function"==typeof require?require:c(51029);function s(){try{let a=f.join(h(),"noop.js");return d(a)}catch{return null}}let t=null;function u(a){return e.existsSync(f.join(i(),a,"package.json"))}function v(){try{let a=s(),b=f.join(i(),l);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return r(l)}catch{}try{let a=f.join(i(),l);if(e.existsSync(f.join(a,"package.json")))return r(a)}catch{}return null}function w(){try{let a=s(),b=f.join(i(),n);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return r(n)}catch{}return null}a.exports={ensureCloakbrowserRuntime:function({silent:a=!1}={}){if(t?.ok&&t.module&&w()&&u(p))return t;try{let a=k(process.env);if(a.NODE_PATH&&!process.env.NODE_PATH?.includes(i())){process.env.NODE_PATH=a.NODE_PATH;try{c(8086).Module._initPaths()}catch{}}}catch{}let b=v(),d=!b?.launch,e=!w()&&!u(n),f=!u(p);if(d||e||f){let b=[];d&&b.push(`${l}@${m}`),e&&b.push(`${n}@${o}`),f&&b.push(`${p}@${q}`),a||console.log(`[cloakbrowser] Installing ${b.join(", ")} into runtime…`);let c=g({cwd:h(),pkgs:b,timeout:3e5});if(!c.ok){let a=j(c.stderr||c.stdout||""),d=Error(`Failed to install ${b.join(", ")}. On the host run: cd "${h()}" && npm install ${b.join(" ")} — ${a}`);return d.code="CLOAKBROWSER_INSTALL_FAILED",{ok:!1,error:d}}}if(b=v(),!b?.launch){let a=Error(`cloakbrowser installed but launch() is missing. Reinstall: cd "${h()}" && npm install ${l}@${m} ${n}@${o} ${p}@${q}`);return a.code="CLOAKBROWSER_API_MISMATCH",{ok:!1,error:a}}if(!w()&&!u(n)){let a=Error(`mmdb-lib is required for geoip: true. Install: cd "${h()}" && npm install ${n}@${o}`);return a.code="MMDB_MISSING",{ok:!1,error:a}}return t={ok:!0,module:b}},loadCloakbrowserModule:function(){return v()},CLOAKBROWSER_PACKAGE:l,CLOAKBROWSER_VERSION:m,MMDB_PACKAGE:n,MMDB_VERSION:o,PLAYWRIGHT_CORE_PACKAGE:p,PLAYWRIGHT_CORE_VERSION:q}}};
60
+ ZevaiRouter auto-starts Xvfb when installed.`);throw c.code="NO_DISPLAY",c.cause=b,c}throw b}}async function m({engine:a=e,proxyUrl:b,headless:c=!1,windowSize:d=null}={}){return g(a),l({proxyUrl:b,headless:!0===c,windowSize:d})}function n({engine:a,proxyUrl:b,headless:c=!1,windowSize:d=null}={}){return()=>m({engine:a,proxyUrl:b,headless:c,windowSize:d})}async function o(a,{timeoutMs:b=4e3}={}){if(!a)return;let c=null;try{let b="function"==typeof a.process?a.process():null;c=b?.pid||null}catch{c=null}try{await Promise.race([Promise.resolve().then(()=>a.close()).catch(()=>null),new Promise(a=>setTimeout(a,b))])}catch{}if(c&&Number.isFinite(c)&&c>1)for(let a of["SIGTERM","SIGKILL"]){try{process.kill(c,0)}catch{break}try{process.kill(c,a)}catch{}try{process.kill(-c,a)}catch{}"SIGTERM"===a&&await new Promise(a=>setTimeout(a,400))}}},77897:(a,b,c)=>{let d=c(33873),e=c(29021);process.env.NPM_CONFIG_FUND="false",process.env.NPM_CONFIG_AUDIT="false",process.env.NPM_CONFIG_UPDATE_NOTIFIER="false",process.env.NPM_CONFIG_LOGLEVEL=process.env.NPM_CONFIG_LOGLEVEL||"error";let{ensureSqliteRuntime:f,runNpmInstall:g,getRuntimeDir:h}=c(24344),{ensureTrayRuntime:i}=c(52784),{ensureCloakbrowserRuntime:j}=c(99436),k="1"===process.env.ZEVAI_MINIMAL_POSTINSTALL||"true"===process.env.ZEVAI_MINIMAL_POSTINSTALL;function l(a){console.log(`[zevai] ${a}`)}function m(a){console.warn(`[zevai] ${a}`)}l(k?"Minimal postinstall (ZEVAI_MINIMAL_POSTINSTALL=1) — browsers install on first use":"Preparing full runtime so all features work after this install…");try{f({silent:!0}),l("✓ SQLite engine ready")}catch(a){m(`SQLite warm-up skipped: ${a.message}`)}try{i({silent:!0}),l("✓ System tray helper ready")}catch(a){m(`Tray warm-up skipped: ${a.message}`)}k&&(l("Done (minimal). Use bulk import / terminal once to finish remaining downloads."),process.exit(0));try{let a=j({silent:!0});a.ok?(l("✓ CloakBrowser ready (sole automation browser engine)"),function(){try{let{getRuntimeNodeModules:a}=c(24344),b=a(),f=d.join(__dirname,"..","app","node_modules");if(!e.existsSync(d.join(f,"next")))return;for(let a of["playwright-core","cloakbrowser","mmdb-lib"]){let c=d.join(b,a),g=d.join(f,a);e.existsSync(d.join(c,"package.json"))&&(e.existsSync(g)&&e.rmSync(g,{recursive:!0,force:!0}),e.cpSync(c,g,{recursive:!0}))}l("CloakBrowser runtime linked into app bundle")}catch{}}()):m(`CloakBrowser skipped: ${a.error?.message||a.reason||"unknown"}`)}catch(a){m(`CloakBrowser skipped: ${a.message}`)}try{let a=function(){if("win32"===process.platform)return{ok:!0,skipped:"windows uses pipe shell"};try{return c(Object(function(){var a=Error("Cannot find module 'node-pty'");throw a.code="MODULE_NOT_FOUND",a}())),{ok:!0,already:!0}}catch{}return g({cwd:h(),pkgs:["node-pty@^1.1.0"],timeout:3e5}).ok?{ok:!0}:{ok:!1,reason:"native build failed (terminal still works via python PTY / pipe)"}}();a.ok?l(a.already?"✓ node-pty already available":"✓ node-pty ready (web terminal)"):a.skipped?l(`\xb7 node-pty skipped (${a.skipped})`):m(`node-pty skipped: ${a.reason||"unknown"} — terminal still works`)}catch(a){m(`node-pty skipped: ${a.message}`)}l("Runtime warm-up finished. Start with: zevai"),process.exit(0)},99436:(a,b,c)=>{"use strict";let{createRequire:d}=c(8086),e=c(29021),f=c(33873),{runNpmInstall:g,getRuntimeDir:h,getRuntimeNodeModules:i,summarizeNpmError:j,buildEnvWithRuntime:k}=c(24344),l="cloakbrowser",m="^0.5.2",n="mmdb-lib",o="^3.0.2",p="playwright-core",q="^1.54.2",r="function"==typeof require?require:c(51029);function s(){try{let a=f.join(h(),"noop.js");return d(a)}catch{return null}}let t=null;function u(a){return e.existsSync(f.join(i(),a,"package.json"))}function v(a){let b=String(a||"").trim().match(/^v?(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/);return b?{major:Number.parseInt(b[1],10),minor:Number.parseInt(b[2],10),patch:Number.parseInt(b[3],10),prerelease:b[4]?b[4].split("."):[]}:null}function w(a,b){for(let c of["major","minor","patch"])if(a[c]!==b[c])return a[c]<b[c]?-1:1;return function(a,b){if(0===a.length&&0===b.length)return 0;if(0===a.length)return 1;if(0===b.length)return -1;let c=Math.max(a.length,b.length);for(let d=0;d<c;d+=1){if(void 0===a[d])return -1;if(void 0===b[d])return 1;if(a[d]===b[d])continue;let c=/^\d+$/.test(a[d]),e=/^\d+$/.test(b[d]);if(c&&e)return Number.parseInt(a[d],10)<Number.parseInt(b[d],10)?-1:1;if(c!==e)return c?-1:1;return a[d]<b[d]?-1:1}return 0}(a.prerelease,b.prerelease)}function x(a,b){let c,d=v(a),e=String(b||"").trim().match(/^\^\s*(.+)$/),f=v(e?.[1]);return!!d&&!!f&&(!(d.prerelease.length>0)||0!==f.prerelease.length)&&(c=f.major>0?{major:f.major+1,minor:0,patch:0,prerelease:[]}:f.minor>0?{major:0,minor:f.minor+1,patch:0,prerelease:[]}:{major:0,minor:0,patch:f.patch+1,prerelease:[]},w(d,f)>=0&&0>w(d,c))}function y(a){try{let b=JSON.parse(e.readFileSync(f.join(i(),a,"package.json"),"utf8"));return"string"==typeof b.version?b.version:null}catch{return null}}function z(a,b){return!!a?.launch&&x(b,m)}function A(){try{let a=s(),b=f.join(i(),l);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return r(l)}catch{}try{let a=f.join(i(),l);if(e.existsSync(f.join(a,"package.json")))return r(a)}catch{}return null}function B(){try{let a=s(),b=f.join(i(),n);if(a&&e.existsSync(f.join(b,"package.json")))return a(b)}catch{}try{return r(n)}catch{}return null}a.exports={ensureCloakbrowserRuntime:function({silent:a=!1}={}){let b=y(l);if(t?.ok&&z(t.module,b)&&B()&&u(p))return t;try{let a=k(process.env);if(a.NODE_PATH&&!process.env.NODE_PATH?.includes(i())){process.env.NODE_PATH=a.NODE_PATH;try{c(8086).Module._initPaths()}catch{}}}catch{}let d=A(),e=!z(d,b),r=!B()&&!u(n),s=!u(p);if(e||r||s){let b=[];e&&b.push(`${l}@${m}`),r&&b.push(`${n}@${o}`),s&&b.push(`${p}@${q}`),a||console.log(`[cloakbrowser] Installing ${b.join(", ")} into runtime…`);let d=g({cwd:h(),pkgs:b,timeout:3e5});if(!d.ok){let a=j(d.stderr||d.stdout||""),c=Error(`Failed to install ${b.join(", ")}. On the host run: cd "${h()}" && npm install ${b.join(" ")} — ${a}`);return c.code="CLOAKBROWSER_INSTALL_FAILED",{ok:!1,error:c}}e&&function(a){let b=`${f.join(i(),a)}${f.sep}`;for(let a of Object.keys(c.c))a.startsWith(b)&&delete c.c[a]}(l)}if(d=A(),b=y(l),!d?.launch){let a=Error(`cloakbrowser installed but launch() is missing. Reinstall: cd "${h()}" && npm install ${l}@${m} ${n}@${o} ${p}@${q}`);return a.code="CLOAKBROWSER_API_MISMATCH",{ok:!1,error:a}}if(!x(b,m)){let a=Error(`cloakbrowser version mismatch: installed ${b||"unknown"}, required ${m}. Reinstall: cd "${h()}" && npm install ${l}@${m}`);return a.code="CLOAKBROWSER_VERSION_MISMATCH",{ok:!1,error:a}}if(!B()&&!u(n)){let a=Error(`mmdb-lib is required for geoip: true. Install: cd "${h()}" && npm install ${n}@${o}`);return a.code="MMDB_MISSING",{ok:!1,error:a}}return t={ok:!0,module:d,version:b}},loadCloakbrowserModule:function(){return A()},CLOAKBROWSER_PACKAGE:l,CLOAKBROWSER_VERSION:m,MMDB_PACKAGE:n,MMDB_VERSION:o,PLAYWRIGHT_CORE_PACKAGE:p,PLAYWRIGHT_CORE_VERSION:q,__test__:{parseSemver:v,compareSemver:w,satisfiesCaretRange:x,isCloakbrowserRuntimeCompatible:z}}}};