@jheavenknows/bluerouter 5.5.25 → 5.5.26

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 (661) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +18 -18
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ai-power-index/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/analytics/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/api-keys/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/audit-proxy/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/model-profiles/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cluster/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/console/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/logs/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personal/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudcombo/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovider/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalcloudprovidermonitor/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/personalquota/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/[id]/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/embedding/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/[id]/page_client-reference-manifest.js +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/image-to-text/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/[id]/page_client-reference-manifest.js +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/stt/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/tts/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/[kind]/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/web/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/resource-monitor/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  61. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  62. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  63. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  64. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  66. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  70. package/app/.next-cli-build/server/app/_not-found.rsc +5 -5
  71. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +5 -5
  72. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +5 -5
  74. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  75. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/api/audit-proxy/ca/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/audit-proxy/me/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/audit-proxy/root-ca/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/audit-proxy/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/audit-proxy/users/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/auth/view-mode/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/branding/[asset]/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/branding/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/branding/upload/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-model-profiles/cloud-models/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-model-profiles/model-catalog/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-model-profiles/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  100. package/app/.next-cli-build/server/app/api/cluster/config/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/cluster/heartbeat/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/command/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/cluster/peers/[id]/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/cluster/peers/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/cluster/snapshot/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/cluster/sync/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/cluster/test/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/codex-catalog/download/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/codex-catalog/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/codex-catalog/upload/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/dashboard/ai-power-index/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/dashboard/analytics/ai-models/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/dashboard/analytics/analyze/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/dashboard/analytics/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/dashboard/combos/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/dashboard/endpoint/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/options/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/dashboard/token-saver/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/keys/[id]/caveman-test/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/keys/[id]/rotate/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/oauth/grok-cli/device-code/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/oauth/grok-cli/poll/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/api-key-models/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/personal-cloud-combos/[id]/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/personal-cloud-combos/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/api-key-models/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/import-models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/models/[...routeModel]/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/move/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/personal-cloud-providers/[id]/usage/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/personal-cloud-providers/client/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/personal-cloud-providers/monitor/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/personal-cloud-providers/permissions/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/personal-cloud-providers/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/personal-cloud-providers/routing/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/personal-cloud-providers/shares/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/personal-cloud-providers/visibility/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/pricing/catalog/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/pricing/recalculate/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/provider-nodes/combo-references/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/provider-nodes/custom-embedding/manage/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/provider-nodes/openai-compatible/manage/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  190. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/resource-monitor/[id]/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/resource-monitor/ai-models/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/resource-monitor/analyze/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/resource-monitor/history/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/resource-monitor/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/settings/database/export/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/settings/prompt-log-db/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  210. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/v1/rate-limits/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  237. package/app/.next-cli-build/server/app/callback.html +1 -1
  238. package/app/.next-cli-build/server/app/callback.rsc +5 -5
  239. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +5 -5
  240. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +5 -5
  242. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  243. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  244. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/dashboard/ai-power-index.html +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/ai-power-index.rsc +6 -6
  247. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index/__PAGE__.segment.rsc +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard/ai-power-index.segment.rsc +1 -1
  249. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  251. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_full.segment.rsc +6 -6
  252. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_head.segment.rsc +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_index.segment.rsc +5 -5
  254. package/app/.next-cli-build/server/app/dashboard/ai-power-index.segments/_tree.segment.rsc +1 -1
  255. package/app/.next-cli-build/server/app/dashboard/api-keys.html +1 -1
  256. package/app/.next-cli-build/server/app/dashboard/api-keys.rsc +9 -9
  257. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys/__PAGE__.segment.rsc +4 -4
  258. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard/api-keys.segment.rsc +1 -1
  259. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  261. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_full.segment.rsc +9 -9
  262. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_head.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_index.segment.rsc +5 -5
  264. package/app/.next-cli-build/server/app/dashboard/api-keys.segments/_tree.segment.rsc +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  266. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +7 -7
  267. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  268. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  269. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  271. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +7 -7
  272. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +5 -5
  274. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.html +1 -1
  276. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.rsc +8 -8
  277. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles/__PAGE__.segment.rsc +3 -3
  278. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/model-profiles.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_full.segment.rsc +8 -8
  283. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_index.segment.rsc +5 -5
  285. package/app/.next-cli-build/server/app/dashboard/cli-tools/model-profiles.segments/_tree.segment.rsc +1 -1
  286. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +7 -7
  288. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  292. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +7 -7
  293. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +5 -5
  295. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  296. package/app/.next-cli-build/server/app/dashboard/cluster.html +1 -1
  297. package/app/.next-cli-build/server/app/dashboard/cluster.rsc +6 -6
  298. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster/__PAGE__.segment.rsc +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard/cluster.segment.rsc +1 -1
  300. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/cluster.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  302. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_full.segment.rsc +6 -6
  303. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_head.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_index.segment.rsc +5 -5
  305. package/app/.next-cli-build/server/app/dashboard/cluster.segments/_tree.segment.rsc +1 -1
  306. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  307. package/app/.next-cli-build/server/app/dashboard/combos.rsc +7 -7
  308. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  309. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  312. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  313. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +5 -5
  315. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  316. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  318. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  319. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  322. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  323. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +5 -5
  325. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  326. package/app/.next-cli-build/server/app/dashboard/logs.html +1 -1
  327. package/app/.next-cli-build/server/app/dashboard/logs.rsc +6 -6
  328. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs/__PAGE__.segment.rsc +1 -1
  329. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard/logs.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  332. package/app/.next-cli-build/server/app/dashboard/logs.segments/_full.segment.rsc +6 -6
  333. package/app/.next-cli-build/server/app/dashboard/logs.segments/_head.segment.rsc +1 -1
  334. package/app/.next-cli-build/server/app/dashboard/logs.segments/_index.segment.rsc +5 -5
  335. package/app/.next-cli-build/server/app/dashboard/logs.segments/_tree.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  337. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +7 -7
  338. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  339. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  343. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +7 -7
  344. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +5 -5
  346. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/dashboard/personal.html +1 -1
  348. package/app/.next-cli-build/server/app/dashboard/personal.rsc +7 -7
  349. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal/__PAGE__.segment.rsc +2 -2
  350. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard/personal.segment.rsc +1 -1
  351. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/personal.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  353. package/app/.next-cli-build/server/app/dashboard/personal.segments/_full.segment.rsc +7 -7
  354. package/app/.next-cli-build/server/app/dashboard/personal.segments/_head.segment.rsc +1 -1
  355. package/app/.next-cli-build/server/app/dashboard/personal.segments/_index.segment.rsc +5 -5
  356. package/app/.next-cli-build/server/app/dashboard/personal.segments/_tree.segment.rsc +1 -1
  357. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  358. package/app/.next-cli-build/server/app/dashboard/profile.rsc +7 -7
  359. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  360. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  361. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  363. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  364. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  365. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +5 -5
  366. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  367. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  368. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +6 -6
  369. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  370. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  371. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  373. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +6 -6
  374. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  375. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +5 -5
  376. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +1 -1
  377. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  378. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +6 -6
  379. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  382. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  383. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +6 -6
  384. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  385. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +5 -5
  386. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/providers/embedding.html +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/providers/embedding.rsc +7 -7
  389. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding/__PAGE__.segment.rsc +2 -2
  390. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers/embedding.segment.rsc +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  392. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  393. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  394. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_full.segment.rsc +7 -7
  395. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_head.segment.rsc +1 -1
  396. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_index.segment.rsc +5 -5
  397. package/app/.next-cli-build/server/app/dashboard/providers/embedding.segments/_tree.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.html +1 -1
  399. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.rsc +7 -7
  400. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text/__PAGE__.segment.rsc +2 -2
  401. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers/image-to-text.segment.rsc +1 -1
  402. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  403. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  405. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_full.segment.rsc +7 -7
  406. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_head.segment.rsc +1 -1
  407. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_index.segment.rsc +5 -5
  408. package/app/.next-cli-build/server/app/dashboard/providers/image-to-text.segments/_tree.segment.rsc +1 -1
  409. package/app/.next-cli-build/server/app/dashboard/providers/image.html +1 -1
  410. package/app/.next-cli-build/server/app/dashboard/providers/image.rsc +7 -7
  411. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image/__PAGE__.segment.rsc +2 -2
  412. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers/image.segment.rsc +1 -1
  413. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_full.segment.rsc +7 -7
  417. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_index.segment.rsc +5 -5
  419. package/app/.next-cli-build/server/app/dashboard/providers/image.segments/_tree.segment.rsc +1 -1
  420. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  421. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +7 -7
  422. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  425. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  426. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  427. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  428. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  429. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +5 -5
  430. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  431. package/app/.next-cli-build/server/app/dashboard/providers/stt.html +1 -1
  432. package/app/.next-cli-build/server/app/dashboard/providers/stt.rsc +7 -7
  433. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt/__PAGE__.segment.rsc +2 -2
  434. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers/stt.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  436. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  437. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  438. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_full.segment.rsc +7 -7
  439. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_head.segment.rsc +1 -1
  440. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_index.segment.rsc +5 -5
  441. package/app/.next-cli-build/server/app/dashboard/providers/stt.segments/_tree.segment.rsc +1 -1
  442. package/app/.next-cli-build/server/app/dashboard/providers/tts.html +1 -1
  443. package/app/.next-cli-build/server/app/dashboard/providers/tts.rsc +7 -7
  444. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts/__PAGE__.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers/tts.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  448. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  449. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_full.segment.rsc +7 -7
  450. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_head.segment.rsc +1 -1
  451. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_index.segment.rsc +5 -5
  452. package/app/.next-cli-build/server/app/dashboard/providers/tts.segments/_tree.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/dashboard/providers/web.html +1 -1
  454. package/app/.next-cli-build/server/app/dashboard/providers/web.rsc +7 -7
  455. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web/__PAGE__.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers/web.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  458. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  459. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  460. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_full.segment.rsc +7 -7
  461. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_head.segment.rsc +1 -1
  462. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_index.segment.rsc +5 -5
  463. package/app/.next-cli-build/server/app/dashboard/providers/web.segments/_tree.segment.rsc +1 -1
  464. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  465. package/app/.next-cli-build/server/app/dashboard/providers.rsc +7 -7
  466. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  467. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  468. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  469. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  470. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  471. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  472. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +5 -5
  473. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  474. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  475. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +7 -7
  476. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  478. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  479. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  480. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  481. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +5 -5
  483. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  485. package/app/.next-cli-build/server/app/dashboard/quota.rsc +8 -8
  486. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  487. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  488. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  489. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  491. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  492. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +5 -5
  493. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  494. package/app/.next-cli-build/server/app/dashboard/resource-monitor.html +1 -1
  495. package/app/.next-cli-build/server/app/dashboard/resource-monitor.rsc +6 -6
  496. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor/__PAGE__.segment.rsc +1 -1
  497. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard/resource-monitor.segment.rsc +1 -1
  498. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  499. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_full.segment.rsc +6 -6
  501. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_head.segment.rsc +1 -1
  502. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_index.segment.rsc +5 -5
  503. package/app/.next-cli-build/server/app/dashboard/resource-monitor.segments/_tree.segment.rsc +1 -1
  504. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  505. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  506. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  507. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings/pricing.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard/settings.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  511. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  512. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  513. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +5 -5
  514. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  516. package/app/.next-cli-build/server/app/dashboard/skills.rsc +7 -7
  517. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  518. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  519. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  521. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +7 -7
  522. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  523. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +5 -5
  524. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  526. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  527. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  529. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  531. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  532. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  533. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +5 -5
  534. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  536. package/app/.next-cli-build/server/app/dashboard/translator.rsc +7 -7
  537. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  538. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  539. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  540. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  541. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +7 -7
  542. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  543. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +5 -5
  544. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  546. package/app/.next-cli-build/server/app/dashboard/usage.rsc +7 -7
  547. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  548. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  549. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  550. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  551. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  552. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  553. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +5 -5
  554. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  556. package/app/.next-cli-build/server/app/dashboard.rsc +7 -7
  557. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  558. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  559. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  560. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +7 -7
  561. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  562. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +5 -5
  563. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  564. package/app/.next-cli-build/server/app/index.html +1 -1
  565. package/app/.next-cli-build/server/app/index.rsc +5 -5
  566. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  567. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +5 -5
  568. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +5 -5
  570. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  572. package/app/.next-cli-build/server/app/landing.html +1 -1
  573. package/app/.next-cli-build/server/app/landing.rsc +5 -5
  574. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +5 -5
  575. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +5 -5
  577. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  578. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  579. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  580. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  581. package/app/.next-cli-build/server/app/login.html +1 -1
  582. package/app/.next-cli-build/server/app/login.rsc +6 -6
  583. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +6 -6
  584. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  585. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +5 -5
  586. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  588. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  589. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  590. package/app/.next-cli-build/server/app-paths-manifest.json +18 -18
  591. package/app/.next-cli-build/server/chunks/2428.js +1 -1
  592. package/app/.next-cli-build/server/chunks/318.js +1 -1
  593. package/app/.next-cli-build/server/chunks/3399.js +1 -1
  594. package/app/.next-cli-build/server/chunks/3738.js +1 -1
  595. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  596. package/app/.next-cli-build/server/chunks/5024.js +1 -1
  597. package/app/.next-cli-build/server/chunks/5210.js +1 -1
  598. package/app/.next-cli-build/server/chunks/6118.js +1 -1
  599. package/app/.next-cli-build/server/chunks/6811.js +1 -1
  600. package/app/.next-cli-build/server/chunks/6992.js +1 -1
  601. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  602. package/app/.next-cli-build/server/pages/404.html +1 -1
  603. package/app/.next-cli-build/server/pages/500.html +1 -1
  604. package/app/.next-cli-build/static/chunks/{5263-b7941fae776c4373.js → 5263-827de68ed8132a29.js} +1 -1
  605. package/app/.next-cli-build/static/chunks/{7413-87f4038b5317729f.js → 7413-2cc83a72bcf459e1.js} +1 -1
  606. package/app/.next-cli-build/static/chunks/8723-c429b062393b6348.js +1 -0
  607. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/api-keys/{page-fa6ae9cb4ba87b70.js → page-1bb88dd0ad65807c.js} +1 -1
  608. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/audit-proxy/{page-8ddbfc576e6c54b4.js → page-30cd3f3e9f363bef.js} +1 -1
  609. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/basic-chat/{page-3b6fe31430b96954.js → page-70e158890ae4fc83.js} +1 -1
  610. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-678b01b8b35e85fd.js → page-ce7ac6694fbbb678.js} +1 -1
  611. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/model-profiles/{page-3c1dbf4a4cb14dcb.js → page-f521e8417f2e2f31.js} +1 -1
  612. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-0498f663a08738f1.js → page-0ecc380c93debdab.js} +1 -1
  613. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/{page-c64166b1525750d0.js → page-5ade313a9167c99b.js} +1 -1
  614. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/{page-b027f589b9f76fa8.js → page-0e22441e0507f163.js} +1 -1
  615. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/endpoint/{page-b28c25f5c4b94189.js → page-11e60a551b0228c1.js} +1 -1
  616. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/logs/console/{page-7e0fb3db5ded3275.js → page-0a6293eb31eab332.js} +1 -1
  617. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-e5b6794cd8a6364f.js → page-a08c52db4e01d8e3.js} +1 -1
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/combo/[id]/{page-68040f2d7e3f076b.js → page-07644039f6bf80ee.js} +1 -1
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/web/{page-71731eef239fdab0.js → page-6c63098dc771e280.js} +1 -1
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/{page-b28c25f5c4b94189.js → page-11e60a551b0228c1.js} +1 -1
  622. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personal/{page-db1a1700eea425f9.js → page-9ef9615e95c6d98c.js} +1 -1
  623. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/{layout-4d30604723c64128.js → layout-478314699bce9b31.js} +1 -1
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovider/{page-4c7c9a82cd4c06e4.js → page-9a5af94bcad73254.js} +1 -1
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalcloudprovidermonitor/{page-b729e99653688409.js → page-33d2948585dccd8c.js} +1 -1
  626. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/personalquota/{page-0537a2fa161b82eb.js → page-d5a701cfcbeb0aaa.js} +1 -1
  627. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-bfe98cb1f3da9ddd.js → page-57581f6add7284d5.js} +1 -1
  628. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-dfb9cb61a2e3114b.js → page-3567ff1ce2261dcf.js} +1 -1
  629. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/embedding/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  630. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/embedding/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  631. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  632. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  633. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image-to-text/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  634. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/image-to-text/{page-f408f6e27a9760bb.js → page-e870a4cb95e2a8bc.js} +1 -1
  635. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/new/{page-1710ccdfda2a7cbf.js → page-82eca1407d4266c2.js} +1 -1
  636. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-f195d485859696b8.js → page-267a7602579ef6f4.js} +1 -1
  637. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/[id]/{page-182a798f8ca008a1.js → page-c927b95886c5f0d6.js} +1 -1
  638. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/page-e870a4cb95e2a8bc.js +1 -0
  639. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/[id]/page-c927b95886c5f0d6.js +1 -0
  640. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/page-e870a4cb95e2a8bc.js +1 -0
  641. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/web/[kind]/[id]/{page-e46c0847d86fc008.js → page-7dedb965c7920eb8.js} +1 -1
  642. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/web/{page-71731eef239fdab0.js → page-6c63098dc771e280.js} +1 -1
  643. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/proxy-pools/{page-2043197f3715fe4c.js → page-94f864cc2f20b76d.js} +1 -1
  644. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/{page-3a4844e727cfec8f.js → page-a8165d10ab8301ef.js} +1 -1
  645. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/skills/{page-1b1ae93c3f398083.js → page-8ff70e1fe63630c5.js} +1 -1
  646. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/translator/{page-bc64c0e184eef9d3.js → page-78d24f71ba0846fa.js} +1 -1
  647. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/usage/{page-b6a76e695fa879b2.js → page-d08272fd14e6b4af.js} +1 -1
  648. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-c33de7f43266076b.js → layout-8b4790ae13ade152.js} +1 -1
  649. package/app/.next-cli-build/static/chunks/app/{layout-bf4de7a5f9e7315c.js → layout-9b0fc956496699bb.js} +1 -1
  650. package/app/.next-cli-build/static/chunks/app/login/{page-071c3519fddc7b20.js → page-534a498e40d54531.js} +1 -1
  651. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  652. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  653. package/app/package.json +1 -1
  654. package/package.json +1 -1
  655. package/app/.next-cli-build/static/chunks/2793-b3a4461f8347c3f1.js +0 -1
  656. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/stt/page-f408f6e27a9760bb.js +0 -1
  657. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/[id]/page-182a798f8ca008a1.js +0 -1
  658. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/tts/page-f408f6e27a9760bb.js +0 -1
  659. /package/app/.next-cli-build/static/{8HLcfPZQbiQFkzvYyYlAK → 5AQ_UrmD1tq7tn1M3F6jS}/_buildManifest.js +0 -0
  660. /package/app/.next-cli-build/static/{8HLcfPZQbiQFkzvYyYlAK → 5AQ_UrmD1tq7tn1M3F6jS}/_ssgManifest.js +0 -0
  661. /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-5.5.18-to-5.5.19-5.5.19-20260918-094232 → upgrade-5.5.25-to-5.5.26-5.5.26-20260923-102955}/data.sqlite +0 -0
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4845],{9385:(e,t,l)=>{"use strict";l.d(t,{Ek:()=>h,FY:()=>b,H1:()=>p,O0:()=>s,Zn:()=>j,cL:()=>g,j5:()=>u,pA:()=>o,u1:()=>f});let o=["coder","fast","thinking"],a=["claude","codex"],r={claude:"claude/",codex:"codex/"},d={coder:{model:"",contextWindow:0},fast:{model:"",contextWindow:0},thinking:{model:"",contextWindow:0}},s={version:2,local:{enabled:!0,providerName:"Local AI",autoCompactPct:75,models:{coder:{model:"programmer",contextWindow:12e4},fast:{model:"programmer-fast",contextWindow:12e4},thinking:{model:"programmer",contextWindow:12e4}}},cloud:{claude:{enabled:!1,providerName:"Claude Code Cloud",models:d},codex:{enabled:!1,providerName:"Codex Cloud",models:d}}};function n(e,t=300){return String(e??"").trim().slice(0,t)}function c(e,t){let l=Number(e);return!Number.isFinite(l)||l<=0?t:Math.floor(l)}function i(e,t=75){let l=Number(e);return Number.isFinite(l)?Math.min(100,Math.max(1,Math.floor(l))):t}function m(e,t,{local:l}){let a=e&&"object"==typeof e&&!Array.isArray(e)?e:{},r=a.models&&"object"==typeof a.models&&!Array.isArray(a.models)?a.models:{},d={};for(let e of o)d[e]=function(e,t,{local:l}){let o=e&&"object"==typeof e&&!Array.isArray(e)?e:{};return{model:n(Object.prototype.hasOwnProperty.call(o,"model")?o.model:t.model),contextWindow:l?c(o.contextWindow,t.contextWindow||12e4):0}}(r[e],t.models[e],{local:l});let s={enabled:Object.prototype.hasOwnProperty.call(a,"enabled")?!0===a.enabled:t.enabled,providerName:n(Object.prototype.hasOwnProperty.call(a,"providerName")?a.providerName:t.providerName,80)||t.providerName,models:d};return l&&(s.autoCompactPct=i(a.autoCompactPct,t.autoCompactPct)),s}function x(e,t){if(!e||"object"!=typeof e||Array.isArray(e)||e.claude||e.codex)return null;let l=e.models&&"object"==typeof e.models&&!Array.isArray(e.models)?e.models:{},a=o.map(e=>n(l?.[e]?.model)).filter(Boolean),d=r[t];return d&&0!==a.length&&a.every(e=>e.startsWith(d))?e:null}function u(e={}){let t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},l=t.cloud&&"object"==typeof t.cloud&&!Array.isArray(t.cloud)?t.cloud:{};return{version:2,local:m(t.local,s.local,{local:!0}),cloud:{claude:m(l.claude||x(l,"claude"),s.cloud.claude,{local:!1}),codex:m(l.codex||x(l,"codex"),s.cloud.codex,{local:!1})}}}function h(e,t){return a.includes(t)&&e?.cloud?.[t]||null}function p(e){return r[e]||""}function g(e,t,l=""){return n(e?.models?.[t]?.model)||l}function f(e,t,l=12e4){return c(e?.models?.[t]?.contextWindow,l)}function b(e){return[...new Set(o.map(t=>g(e,t)).filter(Boolean))]}function j(e){return Math.max(1,Math.floor(f(e,"coder")*i(e?.autoCompactPct)/100))}},11659:(e,t,l)=>{Promise.resolve().then(l.bind(l,59305)),Promise.resolve().then(l.bind(l,89053))},59305:(e,t,l)=>{"use strict";l.d(t,{default:()=>b});var o=l(95155),a=l(98500),r=l.n(a),d=l(12115),s=l(35497),n=l(94027),c=l(9385);let i={coder:{label:"Coder",hint:"Model ch\xednh cho coding/generation."},fast:{label:"Fast",hint:"Model nhanh cho explorer/small/haiku profile."},thinking:{label:"Thinking",hint:"Model reasoning/opus/thinking profile."}},m={claude:{title:"Claude Code Cloud Settings",badge:"Claude Code",description:"D\xf9ng route model claude/. Catalog chỉ để gợi \xfd; admin kh\xf4ng cần c\xf3 Claude Personal Auth ri\xeang."},codex:{title:"Codex Cloud Settings",badge:"Codex",description:"D\xf9ng route model codex/. Catalog chỉ để gợi \xfd; admin kh\xf4ng cần c\xf3 Codex Personal Auth ri\xeang."}};function x(e){return JSON.parse(JSON.stringify((0,c.j5)(e)))}function u({role:e,value:t,contextWindow:l,onModelChange:a,onContextChange:r}){let d=i[e];return(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,o.jsxs)("div",{className:"mb-2",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-text-main",children:d.label}),(0,o.jsx)("div",{className:"text-xs text-text-muted",children:d.hint})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_170px]",children:[(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Local model ID / alias"}),(0,o.jsx)("input",{list:"cli-local-model-catalog",value:t||"",onChange:e=>a(e.target.value),placeholder:"coder"===e?"programmer":"fast"===e?"programmer-fast":"programmer-thinking",className:"w-full rounded-xl border border-border bg-surface px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Max context"}),(0,o.jsx)("input",{type:"number",min:"1",max:"10000000",value:l||"",onChange:e=>r(e.target.value),className:"w-full rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]})]})]})}function h({profile:e,setProfiles:t}){let l=e=>t(t=>({...t,local:{...t.local,...e}})),a=(e,l)=>t(t=>({...t,local:{...t.local,models:{...t.local.models,[e]:{...t.local.models[e],...l}}}}));return(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Local"}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Shared Local AI Settings"})]}),(0,o.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng chung cho Claude Code, Codex, OpenCode v\xe0 Qwen Code. Context/auto-compact chỉ sinh v\xe0o CLI config, kh\xf4ng đổi runtime routing."})]}),(0,o.jsxs)("label",{className:"inline-flex items-center gap-2 text-sm text-text-main",children:[(0,o.jsx)("input",{type:"checkbox",checked:!0===e.enabled,onChange:e=>l({enabled:e.target.checked}),className:"size-4"}),"Enabled"]})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean profile hiển thị"}),(0,o.jsx)("input",{value:e.providerName||"",onChange:e=>l({providerName:e.target.value}),placeholder:"Local AI",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsx)("div",{className:"space-y-3",children:c.pA.map(t=>(0,o.jsx)(u,{role:t,value:e.models?.[t]?.model,contextWindow:e.models?.[t]?.contextWindow,onModelChange:e=>a(t,{model:e}),onContextChange:e=>a(t,{contextWindow:e})},t))}),(0,o.jsx)("div",{className:"rounded-xl border border-border bg-background p-3",children:(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[180px_minmax(0,1fr)] sm:items-end",children:[(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Auto compact %"}),(0,o.jsx)("input",{type:"number",min:"1",max:"100",value:e.autoCompactPct||75,onChange:e=>l({autoCompactPct:e.target.value}),className:"w-full rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-muted",children:["Derived Codex compact limit: ",(0,o.jsx)("span",{className:"font-mono font-medium text-text-main",children:(0,c.Zn)(e).toLocaleString()})," tokens."]})]})})]})})}function p({tool:e,role:t,value:l,onChange:a}){let r=i[t],d=(0,c.H1)(e);return(0,o.jsxs)("label",{className:"block rounded-xl border border-border bg-background p-3",children:[(0,o.jsx)("span",{className:"block text-sm font-medium text-text-main",children:r.label}),(0,o.jsx)("span",{className:"mb-2 block text-xs text-text-muted",children:"coder"===t?`${r.hint} Nhập hoặc chọn model ${d}.`:`${r.hint} Để trống = d\xf9ng Coder.`}),(0,o.jsx)("input",{list:`cli-cloud-${e}-catalog`,value:l||"",onChange:e=>a(e.target.value),placeholder:"coder"===t?`${d}...`:"Để trống = d\xf9ng Coder",className:"w-full rounded-xl border border-border bg-surface px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary"})]})}function g({tool:e,profile:t,options:l,catalogWarning:a,setProfiles:r}){let d=m[e],n=(0,c.H1)(e);return(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Cloud"}),(0,o.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2 py-1 text-[11px] font-medium text-primary",children:d.badge}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:d.title})]}),(0,o.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:d.description})]}),(0,o.jsxs)("label",{className:"inline-flex items-center gap-2 text-sm text-text-main",children:[(0,o.jsx)("input",{type:"checkbox",checked:!0===t.enabled,onChange:t=>{let l;return l={enabled:t.target.checked},r(t=>({...t,cloud:{...t.cloud,[e]:{...t.cloud[e],...l}}}))},className:"size-4"}),"Enabled"]})]}),(0,o.jsxs)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 p-3 text-xs text-text-muted",children:["C\xf3 ",l.length," model ",(0,o.jsx)("span",{className:"font-mono",children:n})," gợi \xfd từ catalog hệ thống + model đ\xe3 import của mọi Personal Cloud account. Admin c\xf3 thể nhập trực tiếp model ",(0,o.jsxs)("span",{className:"font-mono",children:[n,"..."]})," chưa c\xf3 trong danh s\xe1ch; kh\xf4ng phụ thuộc Personal Auth của ch\xednh admin."]}),a?(0,o.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:[a," Vẫn c\xf3 thể nhập model cloud thủ c\xf4ng đ\xfang prefix v\xe0 lưu settings."]}):null,(0,o.jsx)("div",{className:"space-y-3",children:c.pA.map(l=>(0,o.jsx)(p,{tool:e,role:l,value:t.models?.[l]?.model||"",onChange:t=>{let o;return o={model:t},r(t=>({...t,cloud:{...t.cloud,[e]:{...t.cloud[e],models:{...t.cloud[e].models,[l]:{...t.cloud[e].models[l],...o}}}}}))}},l))})]})})}function f({title:e,profile:t}){return(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3 text-sm",children:[(0,o.jsxs)("div",{className:"font-medium text-text-main",children:[e," \xb7 ",t.providerName," \xb7 ",t.enabled?"enabled":"disabled"]}),(0,o.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-xs text-text-muted",children:[(0,o.jsxs)("div",{children:["coder = ",t.models.coder.model||"—"]}),(0,o.jsxs)("div",{children:["fast = ",t.models.fast.model||"coder"]}),(0,o.jsxs)("div",{children:["thinking = ",t.models.thinking.model||"coder"]})]})]})}function b(){let[e,t]=(0,d.useState)(()=>x(c.O0)),[l,a]=(0,d.useState)([]),[i,u]=(0,d.useState)({claude:[],codex:[]}),[p,b]=(0,d.useState)(""),[j,N]=(0,d.useState)(!0),[v,y]=(0,d.useState)(!1),[C,w]=(0,d.useState)(""),[k,A]=(0,d.useState)(""),{isAdmin:S,canManageApiKeys:P}=(0,n.s)(),L=S||P;(0,d.useEffect)(()=>{let e=!1;return Promise.allSettled([fetch("/api/cli-model-profiles",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được CLI Model Profiles");return t.profiles}),fetch("/api/models",{cache:"no-store"}).then(async e=>e.ok&&(await e.json().catch(()=>({}))).models||[]),fetch("/api/cli-model-profiles/cloud-models",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được cloud model catalog");return t.models||{}})]).then(([l,o,r])=>{e||("fulfilled"===l.status?t(x(l.value)):A(l.reason?.message||"Kh\xf4ng tải được CLI Model Profiles"),"fulfilled"===o.status&&a(function(e){let t=[];for(let l of Array.isArray(e)?e:[])for(let e of[l?.fullModel,l?.alias,l?.model]){let l=String(e||"").trim();l&&t.push(l)}return[...new Set(t)].sort((e,t)=>e.localeCompare(t))}(o.value)),"fulfilled"===r.status?u(function(e){let t={claude:[],codex:[]};for(let l of Object.keys(t)){let o=(0,c.H1)(l);t[l]=[...new Set((Array.isArray(e?.[l])?e[l]:[]).map(e=>String(e||"").trim()).filter(e=>e.startsWith(o)))].sort((e,t)=>e.localeCompare(t))}return t}(r.value)):b(r.reason?.message||"Kh\xf4ng tải được cloud model catalog."),N(!1))}),()=>{e=!0}},[]);let M=(0,d.useMemo)(()=>(0,c.j5)(e),[e]),I=async()=>{if(L){y(!0),A(""),w("");try{let l=(()=>{for(let e of["claude","codex"]){let t=M.cloud[e];if(!t.enabled)continue;let l=(0,c.H1)(e);if(!String(t.models?.coder?.model||"").trim())return`${m[e].badge}: cần nhập Coder model.`;for(let o of c.pA){let a=String(t.models?.[o]?.model||"").trim();if(a&&!a.startsWith(l))return`${m[e].badge}: ${o} model phải bắt đầu bằng ${l}`}}return""})();if(l)throw Error(l);let o=await fetch("/api/cli-model-profiles",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})}),a=await o.json().catch(()=>({}));if(!o.ok)throw Error(a.error||"Kh\xf4ng lưu được CLI Model Profiles");t(x(a.profiles)),w("Đ\xe3 lưu. Cloud model mapping kh\xf4ng c\xf2n phụ thuộc Personal Auth của admin.")}catch(e){A(e.message||"Kh\xf4ng lưu được CLI Model Profiles")}finally{y(!1)}}};return j?(0,o.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải CLI Model Settings..."}):L?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsx)("datalist",{id:"cli-local-model-catalog",children:l.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsx)("datalist",{id:"cli-cloud-claude-catalog",children:i.claude.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsx)("datalist",{id:"cli-cloud-codex-catalog",children:i.codex.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,o.jsx)(r(),{href:"/dashboard/cli-tools",className:"hover:text-primary",children:"CLI Tools"}),(0,o.jsx)("span",{children:"/"}),(0,o.jsx)("span",{children:"Model Settings"})]}),(0,o.jsx)("h1",{className:"mt-1 text-2xl font-semibold text-text-main",children:"CLI Model Settings"}),(0,o.jsxs)("p",{className:"mt-1 max-w-4xl text-sm text-text-muted",children:["Local profile d\xf9ng chung cho 4 CLI. Cloud profile l\xe0 global admin setting: Claude Code chỉ d\xf9ng ",(0,o.jsx)("span",{className:"font-mono",children:"claude/"}),", Codex chỉ d\xf9ng ",(0,o.jsx)("span",{className:"font-mono",children:"codex/"}),". Việc cấu h\xecnh kh\xf4ng y\xeau cầu admin phải c\xf3 Personal Auth."]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,o.jsx)(s.$n,{variant:"outline",onClick:()=>{t(x(c.O0)),w(""),A("")},children:"Reset form"}),(0,o.jsx)(s.$n,{onClick:I,disabled:v,children:v?"Đang lưu...":"Lưu settings"})]})]}),(0,o.jsx)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 p-3 text-sm text-text-muted",children:"Setting n\xe0y chỉ sinh config/hướng dẫn CLI ở Dashboard. Kh\xf4ng thay đổi request handling, runtime model routing, provider routing, combo, circuit breaker hay load balancing."}),(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-surface/50 p-3 text-xs text-text-muted",children:["Cloud catalog hiện gợi \xfd ",(0,o.jsxs)("span",{className:"font-medium text-text-main",children:[i.claude.length," model claude/"]})," v\xe0 ",(0,o.jsxs)("span",{className:"font-medium text-text-main",children:[i.codex.length," model codex/"]}),". Danh s\xe1ch được hợp nhất từ provider catalog + model đ\xe3 import tr\xean to\xe0n bộ Personal Cloud connections; đ\xe2y chỉ l\xe0 gợi \xfd, kh\xf4ng phải điều kiện để admin lưu mapping."]}),k?(0,o.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:k}):null,C?(0,o.jsx)("div",{className:"rounded-xl border border-emerald-500/30 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-300",children:C}):null,(0,o.jsx)(h,{profile:e.local,setProfiles:t}),(0,o.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,o.jsx)(g,{tool:"claude",profile:e.cloud.claude,options:i.claude,catalogWarning:p,setProfiles:t}),(0,o.jsx)(g,{tool:"codex",profile:e.cloud.codex,options:i.codex,catalogWarning:p,setProfiles:t})]}),(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h2",{className:"font-semibold text-text-main",children:"Preview resolved mapping"}),(0,o.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,o.jsx)(f,{title:"Local \xb7 all CLI",profile:M.local}),(0,o.jsx)(f,{title:"Cloud \xb7 Claude Code",profile:M.cloud.claude}),(0,o.jsx)(f,{title:"Cloud \xb7 Codex",profile:M.cloud.codex})]})]})})]}):(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"CLI Model Settings"}),(0,o.jsx)("p",{className:"text-sm text-text-muted",children:"Chỉ admin/API-key admin được thay đổi CLI model mapping."}),(0,o.jsx)(r(),{href:"/dashboard/cli-tools",className:"text-sm font-medium text-primary hover:underline",children:"← Quay lại CLI Tools"})]})})}},89053:(e,t,l)=>{"use strict";l.d(t,{default:()=>n});var o=l(95155),a=l(12115),r=l(35497),d=l(94027);let s="/api/cli-model-profiles/model-catalog";function n(){let e,[t,l]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1),[i,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),{isAdmin:h,canManageApiKeys:p}=(0,d.s)(),g=h||p;(0,a.useEffect)(()=>{if(!g)return;let e=!1;return fetch(`${s}?meta=1`,{cache:"no-store"}).then(async t=>{let o=await t.json().catch(()=>({}));if(!t.ok)throw Error(o.error||"Kh\xf4ng tải được model catalog status");e||l(o.catalog||null)}).catch(t=>{e||u(t.message||"Kh\xf4ng tải được model catalog status")}),()=>{e=!0}},[g]);let f=async e=>{let t=e.target.files?.[0];if(e.target.value="",t&&g){c(!0),m(""),u("");try{let e=await t.text(),o=await fetch(s,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})}),a=await o.json().catch(()=>({}));if(!o.ok)throw Error(a.error||"Kh\xf4ng upload được model_catalog.json");l(a.catalog||null),m(`Đ\xe3 upload model_catalog.json (${a.catalog?.modelCount||0} models).`)}catch(e){u(e.message||"Kh\xf4ng upload được model_catalog.json")}finally{c(!1)}}};return g?(0,o.jsx)(r.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Codex Local"}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"model_catalog.json"})]}),(0,o.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Upload catalog d\xe0nh cho Codex Local. User sẽ download file n\xe0y v\xe0 đặt cạnh ",(0,o.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),"."]})]}),(0,o.jsx)("div",{className:"rounded-xl border border-border bg-background p-3 text-sm text-text-muted",children:t?.available?(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,o.jsxs)("span",{children:["Hiện tại: ",(0,o.jsx)("span",{className:"font-mono font-medium text-text-main",children:"model_catalog.json"})," \xb7 ",t.modelCount," models \xb7 ",(e=Number(t.size||0))<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:`${(e/1048576).toFixed(1)} MiB`,t.uploadedAt?` \xb7 ${new Date(t.uploadedAt).toLocaleString()}`:""]}),(0,o.jsx)("a",{href:s,download:"model_catalog.json",className:"font-medium text-primary hover:underline",children:"Download"})]}):(0,o.jsx)("span",{children:"Chưa c\xf3 catalog. Upload file JSON để Local Codex guide c\xf3 file cho user download."})}),(0,o.jsxs)("label",{className:"inline-flex w-fit cursor-pointer items-center rounded-xl border border-border bg-background px-3 py-2 text-sm font-medium text-text-main transition hover:border-primary/50 hover:text-primary",children:[n?"Đang upload...":t?.available?"Thay model_catalog.json":"Upload model_catalog.json",(0,o.jsx)("input",{type:"file",accept:".json,application/json",className:"hidden",disabled:n,onChange:f})]}),x?(0,o.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:x}):null,i?(0,o.jsx)("div",{className:"rounded-xl border border-emerald-500/30 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-300",children:i}):null]})}):null}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=11659)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4845],{9385:(e,t,l)=>{"use strict";l.d(t,{Ek:()=>h,FY:()=>b,H1:()=>p,O0:()=>s,Zn:()=>j,cL:()=>g,j5:()=>u,pA:()=>o,u1:()=>f});let o=["coder","fast","thinking"],a=["claude","codex"],r={claude:"claude/",codex:"codex/"},d={coder:{model:"",contextWindow:0},fast:{model:"",contextWindow:0},thinking:{model:"",contextWindow:0}},s={version:2,local:{enabled:!0,providerName:"Local AI",autoCompactPct:75,models:{coder:{model:"programmer",contextWindow:12e4},fast:{model:"programmer-fast",contextWindow:12e4},thinking:{model:"programmer",contextWindow:12e4}}},cloud:{claude:{enabled:!1,providerName:"Claude Code Cloud",models:d},codex:{enabled:!1,providerName:"Codex Cloud",models:d}}};function n(e,t=300){return String(e??"").trim().slice(0,t)}function c(e,t){let l=Number(e);return!Number.isFinite(l)||l<=0?t:Math.floor(l)}function i(e,t=75){let l=Number(e);return Number.isFinite(l)?Math.min(100,Math.max(1,Math.floor(l))):t}function m(e,t,{local:l}){let a=e&&"object"==typeof e&&!Array.isArray(e)?e:{},r=a.models&&"object"==typeof a.models&&!Array.isArray(a.models)?a.models:{},d={};for(let e of o)d[e]=function(e,t,{local:l}){let o=e&&"object"==typeof e&&!Array.isArray(e)?e:{};return{model:n(Object.prototype.hasOwnProperty.call(o,"model")?o.model:t.model),contextWindow:l?c(o.contextWindow,t.contextWindow||12e4):0}}(r[e],t.models[e],{local:l});let s={enabled:Object.prototype.hasOwnProperty.call(a,"enabled")?!0===a.enabled:t.enabled,providerName:n(Object.prototype.hasOwnProperty.call(a,"providerName")?a.providerName:t.providerName,80)||t.providerName,models:d};return l&&(s.autoCompactPct=i(a.autoCompactPct,t.autoCompactPct)),s}function x(e,t){if(!e||"object"!=typeof e||Array.isArray(e)||e.claude||e.codex)return null;let l=e.models&&"object"==typeof e.models&&!Array.isArray(e.models)?e.models:{},a=o.map(e=>n(l?.[e]?.model)).filter(Boolean),d=r[t];return d&&0!==a.length&&a.every(e=>e.startsWith(d))?e:null}function u(e={}){let t=e&&"object"==typeof e&&!Array.isArray(e)?e:{},l=t.cloud&&"object"==typeof t.cloud&&!Array.isArray(t.cloud)?t.cloud:{};return{version:2,local:m(t.local,s.local,{local:!0}),cloud:{claude:m(l.claude||x(l,"claude"),s.cloud.claude,{local:!1}),codex:m(l.codex||x(l,"codex"),s.cloud.codex,{local:!1})}}}function h(e,t){return a.includes(t)&&e?.cloud?.[t]||null}function p(e){return r[e]||""}function g(e,t,l=""){return n(e?.models?.[t]?.model)||l}function f(e,t,l=12e4){return c(e?.models?.[t]?.contextWindow,l)}function b(e){return[...new Set(o.map(t=>g(e,t)).filter(Boolean))]}function j(e){return Math.max(1,Math.floor(f(e,"coder")*i(e?.autoCompactPct)/100))}},11659:(e,t,l)=>{Promise.resolve().then(l.bind(l,59305)),Promise.resolve().then(l.bind(l,89053))},59305:(e,t,l)=>{"use strict";l.d(t,{default:()=>b});var o=l(95155),a=l(98500),r=l.n(a),d=l(12115),s=l(35497),n=l(94027),c=l(9385);let i={coder:{label:"Coder",hint:"Model ch\xednh cho coding/generation."},fast:{label:"Fast",hint:"Model nhanh cho explorer/small/haiku profile."},thinking:{label:"Thinking",hint:"Model reasoning/opus/thinking profile."}},m={claude:{title:"Claude Code Cloud Settings",badge:"Claude Code",description:"D\xf9ng route model claude/. Catalog chỉ để gợi \xfd; admin kh\xf4ng cần c\xf3 Claude Personal Auth ri\xeang."},codex:{title:"Codex Cloud Settings",badge:"Codex",description:"D\xf9ng route model codex/. Catalog chỉ để gợi \xfd; admin kh\xf4ng cần c\xf3 Codex Personal Auth ri\xeang."}};function x(e){return JSON.parse(JSON.stringify((0,c.j5)(e)))}function u({role:e,value:t,contextWindow:l,onModelChange:a,onContextChange:r}){let d=i[e];return(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,o.jsxs)("div",{className:"mb-2",children:[(0,o.jsx)("div",{className:"text-sm font-medium text-text-main",children:d.label}),(0,o.jsx)("div",{className:"text-xs text-text-muted",children:d.hint})]}),(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[minmax(0,1fr)_170px]",children:[(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Local model ID / alias"}),(0,o.jsx)("input",{list:"cli-local-model-catalog",value:t||"",onChange:e=>a(e.target.value),placeholder:"coder"===e?"programmer":"fast"===e?"programmer-fast":"programmer-thinking",className:"w-full rounded-xl border border-border bg-surface px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Max context"}),(0,o.jsx)("input",{type:"number",min:"1",max:"10000000",value:l||"",onChange:e=>r(e.target.value),className:"w-full rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]})]})]})}function h({profile:e,setProfiles:t}){let l=e=>t(t=>({...t,local:{...t.local,...e}})),a=(e,l)=>t(t=>({...t,local:{...t.local,models:{...t.local.models,[e]:{...t.local.models[e],...l}}}}));return(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Local"}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"Shared Local AI Settings"})]}),(0,o.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng chung cho Claude Code, Codex, OpenCode v\xe0 Qwen Code. Context/auto-compact chỉ sinh v\xe0o CLI config, kh\xf4ng đổi runtime routing."})]}),(0,o.jsxs)("label",{className:"inline-flex items-center gap-2 text-sm text-text-main",children:[(0,o.jsx)("input",{type:"checkbox",checked:!0===e.enabled,onChange:e=>l({enabled:e.target.checked}),className:"size-4"}),"Enabled"]})]}),(0,o.jsxs)("label",{className:"block",children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"T\xean profile hiển thị"}),(0,o.jsx)("input",{value:e.providerName||"",onChange:e=>l({providerName:e.target.value}),placeholder:"Local AI",className:"w-full rounded-xl border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsx)("div",{className:"space-y-3",children:c.pA.map(t=>(0,o.jsx)(u,{role:t,value:e.models?.[t]?.model,contextWindow:e.models?.[t]?.contextWindow,onModelChange:e=>a(t,{model:e}),onContextChange:e=>a(t,{contextWindow:e})},t))}),(0,o.jsx)("div",{className:"rounded-xl border border-border bg-background p-3",children:(0,o.jsxs)("div",{className:"grid gap-3 sm:grid-cols-[180px_minmax(0,1fr)] sm:items-end",children:[(0,o.jsxs)("label",{children:[(0,o.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Auto compact %"}),(0,o.jsx)("input",{type:"number",min:"1",max:"100",value:e.autoCompactPct||75,onChange:e=>l({autoCompactPct:e.target.value}),className:"w-full rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]}),(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-surface px-3 py-2 text-sm text-text-muted",children:["Derived Codex compact limit: ",(0,o.jsx)("span",{className:"font-mono font-medium text-text-main",children:(0,c.Zn)(e).toLocaleString()})," tokens."]})]})})]})})}function p({tool:e,role:t,value:l,onChange:a}){let r=i[t],d=(0,c.H1)(e);return(0,o.jsxs)("label",{className:"block rounded-xl border border-border bg-background p-3",children:[(0,o.jsx)("span",{className:"block text-sm font-medium text-text-main",children:r.label}),(0,o.jsx)("span",{className:"mb-2 block text-xs text-text-muted",children:"coder"===t?`${r.hint} Nhập hoặc chọn model ${d}.`:`${r.hint} Để trống = d\xf9ng Coder.`}),(0,o.jsx)("input",{list:`cli-cloud-${e}-catalog`,value:l||"",onChange:e=>a(e.target.value),placeholder:"coder"===t?`${d}...`:"Để trống = d\xf9ng Coder",className:"w-full rounded-xl border border-border bg-surface px-3 py-2 font-mono text-sm text-text-main outline-none focus:border-primary"})]})}function g({tool:e,profile:t,options:l,catalogWarning:a,setProfiles:r}){let d=m[e],n=(0,c.H1)(e);return(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-4",children:[(0,o.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Cloud"}),(0,o.jsx)("span",{className:"rounded-full border border-primary/20 bg-primary/5 px-2 py-1 text-[11px] font-medium text-primary",children:d.badge}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:d.title})]}),(0,o.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:d.description})]}),(0,o.jsxs)("label",{className:"inline-flex items-center gap-2 text-sm text-text-main",children:[(0,o.jsx)("input",{type:"checkbox",checked:!0===t.enabled,onChange:t=>{let l;return l={enabled:t.target.checked},r(t=>({...t,cloud:{...t.cloud,[e]:{...t.cloud[e],...l}}}))},className:"size-4"}),"Enabled"]})]}),(0,o.jsxs)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 p-3 text-xs text-text-muted",children:["C\xf3 ",l.length," model ",(0,o.jsx)("span",{className:"font-mono",children:n})," gợi \xfd từ catalog hệ thống + model đ\xe3 import của mọi Personal Cloud account. Admin c\xf3 thể nhập trực tiếp model ",(0,o.jsxs)("span",{className:"font-mono",children:[n,"..."]})," chưa c\xf3 trong danh s\xe1ch; kh\xf4ng phụ thuộc Personal Auth của ch\xednh admin."]}),a?(0,o.jsxs)("div",{className:"rounded-xl border border-amber-500/30 bg-amber-500/10 p-3 text-xs text-amber-700 dark:text-amber-300",children:[a," Vẫn c\xf3 thể nhập model cloud thủ c\xf4ng đ\xfang prefix v\xe0 lưu settings."]}):null,(0,o.jsx)("div",{className:"space-y-3",children:c.pA.map(l=>(0,o.jsx)(p,{tool:e,role:l,value:t.models?.[l]?.model||"",onChange:t=>{let o;return o={model:t},r(t=>({...t,cloud:{...t.cloud,[e]:{...t.cloud[e],models:{...t.cloud[e].models,[l]:{...t.cloud[e].models[l],...o}}}}}))}},l))})]})})}function f({title:e,profile:t}){return(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3 text-sm",children:[(0,o.jsxs)("div",{className:"font-medium text-text-main",children:[e," \xb7 ",t.providerName," \xb7 ",t.enabled?"enabled":"disabled"]}),(0,o.jsxs)("div",{className:"mt-2 space-y-1 font-mono text-xs text-text-muted",children:[(0,o.jsxs)("div",{children:["coder = ",t.models.coder.model||"—"]}),(0,o.jsxs)("div",{children:["fast = ",t.models.fast.model||"coder"]}),(0,o.jsxs)("div",{children:["thinking = ",t.models.thinking.model||"coder"]})]})]})}function b(){let[e,t]=(0,d.useState)(()=>x(c.O0)),[l,a]=(0,d.useState)([]),[i,u]=(0,d.useState)({claude:[],codex:[]}),[p,b]=(0,d.useState)(""),[j,N]=(0,d.useState)(!0),[v,y]=(0,d.useState)(!1),[C,w]=(0,d.useState)(""),[k,A]=(0,d.useState)(""),{isAdmin:S,canManageApiKeys:P}=(0,n.s)(),L=S||P;(0,d.useEffect)(()=>{let e=!1;return Promise.allSettled([fetch("/api/cli-model-profiles",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được CLI Model Profiles");return t.profiles}),fetch("/api/models",{cache:"no-store"}).then(async e=>e.ok&&(await e.json().catch(()=>({}))).models||[]),fetch("/api/cli-model-profiles/cloud-models",{cache:"no-store"}).then(async e=>{let t=await e.json().catch(()=>({}));if(!e.ok)throw Error(t.error||"Kh\xf4ng tải được cloud model catalog");return t.models||{}})]).then(([l,o,r])=>{e||("fulfilled"===l.status?t(x(l.value)):A(l.reason?.message||"Kh\xf4ng tải được CLI Model Profiles"),"fulfilled"===o.status&&a(function(e){let t=[];for(let l of Array.isArray(e)?e:[])for(let e of[l?.fullModel,l?.alias,l?.model]){let l=String(e||"").trim();l&&t.push(l)}return[...new Set(t)].sort((e,t)=>e.localeCompare(t))}(o.value)),"fulfilled"===r.status?u(function(e){let t={claude:[],codex:[]};for(let l of Object.keys(t)){let o=(0,c.H1)(l);t[l]=[...new Set((Array.isArray(e?.[l])?e[l]:[]).map(e=>String(e||"").trim()).filter(e=>e.startsWith(o)))].sort((e,t)=>e.localeCompare(t))}return t}(r.value)):b(r.reason?.message||"Kh\xf4ng tải được cloud model catalog."),N(!1))}),()=>{e=!0}},[]);let M=(0,d.useMemo)(()=>(0,c.j5)(e),[e]),I=async()=>{if(L){y(!0),A(""),w("");try{let l=(()=>{for(let e of["claude","codex"]){let t=M.cloud[e];if(!t.enabled)continue;let l=(0,c.H1)(e);if(!String(t.models?.coder?.model||"").trim())return`${m[e].badge}: cần nhập Coder model.`;for(let o of c.pA){let a=String(t.models?.[o]?.model||"").trim();if(a&&!a.startsWith(l))return`${m[e].badge}: ${o} model phải bắt đầu bằng ${l}`}}return""})();if(l)throw Error(l);let o=await fetch("/api/cli-model-profiles",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({profiles:e})}),a=await o.json().catch(()=>({}));if(!o.ok)throw Error(a.error||"Kh\xf4ng lưu được CLI Model Profiles");t(x(a.profiles)),w("Đ\xe3 lưu. Cloud model mapping kh\xf4ng c\xf2n phụ thuộc Personal Auth của admin.")}catch(e){A(e.message||"Kh\xf4ng lưu được CLI Model Profiles")}finally{y(!1)}}};return j?(0,o.jsx)("div",{className:"rounded-2xl border border-dashed border-border p-8 text-center text-sm text-text-muted",children:"Đang tải CLI Model Settings..."}):L?(0,o.jsxs)("div",{className:"space-y-5",children:[(0,o.jsx)("datalist",{id:"cli-local-model-catalog",children:l.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsx)("datalist",{id:"cli-cloud-claude-catalog",children:i.claude.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsx)("datalist",{id:"cli-cloud-codex-catalog",children:i.codex.map(e=>(0,o.jsx)("option",{value:e},e))}),(0,o.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-start lg:justify-between",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,o.jsx)(r(),{href:"/dashboard/cli-tools",className:"hover:text-primary",children:"CLI Tools"}),(0,o.jsx)("span",{children:"/"}),(0,o.jsx)("span",{children:"Model Settings"})]}),(0,o.jsx)("h1",{className:"mt-1 text-2xl font-semibold text-text-main",children:"CLI Model Settings"}),(0,o.jsxs)("p",{className:"mt-1 max-w-4xl text-sm text-text-muted",children:["Local profile d\xf9ng chung cho 4 CLI. Cloud profile l\xe0 global admin setting: Claude Code chỉ d\xf9ng ",(0,o.jsx)("span",{className:"font-mono",children:"claude/"}),", Codex chỉ d\xf9ng ",(0,o.jsx)("span",{className:"font-mono",children:"codex/"}),". Việc cấu h\xecnh kh\xf4ng y\xeau cầu admin phải c\xf3 Personal Auth."]})]}),(0,o.jsxs)("div",{className:"flex flex-wrap gap-2",children:[(0,o.jsx)(s.$n,{variant:"outline",onClick:()=>{t(x(c.O0)),w(""),A("")},children:"Reset form"}),(0,o.jsx)(s.$n,{onClick:I,disabled:v,children:v?"Đang lưu...":"Lưu settings"})]})]}),(0,o.jsx)("div",{className:"rounded-xl border border-blue-500/20 bg-blue-500/5 p-3 text-sm text-text-muted",children:"Setting n\xe0y chỉ sinh config/hướng dẫn CLI ở Dashboard. Kh\xf4ng thay đổi request handling, runtime model routing, provider routing, combo, circuit breaker hay load balancing."}),(0,o.jsxs)("div",{className:"rounded-xl border border-border bg-surface/50 p-3 text-xs text-text-muted",children:["Cloud catalog hiện gợi \xfd ",(0,o.jsxs)("span",{className:"font-medium text-text-main",children:[i.claude.length," model claude/"]})," v\xe0 ",(0,o.jsxs)("span",{className:"font-medium text-text-main",children:[i.codex.length," model codex/"]}),". Danh s\xe1ch được hợp nhất từ provider catalog + model đ\xe3 import tr\xean to\xe0n bộ Personal Cloud connections; đ\xe2y chỉ l\xe0 gợi \xfd, kh\xf4ng phải điều kiện để admin lưu mapping."]}),k?(0,o.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:k}):null,C?(0,o.jsx)("div",{className:"rounded-xl border border-emerald-500/30 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-300",children:C}):null,(0,o.jsx)(h,{profile:e.local,setProfiles:t}),(0,o.jsxs)("div",{className:"grid gap-5 xl:grid-cols-2",children:[(0,o.jsx)(g,{tool:"claude",profile:e.cloud.claude,options:i.claude,catalogWarning:p,setProfiles:t}),(0,o.jsx)(g,{tool:"codex",profile:e.cloud.codex,options:i.codex,catalogWarning:p,setProfiles:t})]}),(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h2",{className:"font-semibold text-text-main",children:"Preview resolved mapping"}),(0,o.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,o.jsx)(f,{title:"Local \xb7 all CLI",profile:M.local}),(0,o.jsx)(f,{title:"Cloud \xb7 Claude Code",profile:M.cloud.claude}),(0,o.jsx)(f,{title:"Cloud \xb7 Codex",profile:M.cloud.codex})]})]})})]}):(0,o.jsx)(s.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsx)("h1",{className:"text-xl font-semibold text-text-main",children:"CLI Model Settings"}),(0,o.jsx)("p",{className:"text-sm text-text-muted",children:"Chỉ admin/API-key admin được thay đổi CLI model mapping."}),(0,o.jsx)(r(),{href:"/dashboard/cli-tools",className:"text-sm font-medium text-primary hover:underline",children:"← Quay lại CLI Tools"})]})})}},89053:(e,t,l)=>{"use strict";l.d(t,{default:()=>n});var o=l(95155),a=l(12115),r=l(35497),d=l(94027);let s="/api/cli-model-profiles/model-catalog";function n(){let e,[t,l]=(0,a.useState)(null),[n,c]=(0,a.useState)(!1),[i,m]=(0,a.useState)(""),[x,u]=(0,a.useState)(""),{isAdmin:h,canManageApiKeys:p}=(0,d.s)(),g=h||p;(0,a.useEffect)(()=>{if(!g)return;let e=!1;return fetch(`${s}?meta=1`,{cache:"no-store"}).then(async t=>{let o=await t.json().catch(()=>({}));if(!t.ok)throw Error(o.error||"Kh\xf4ng tải được model catalog status");e||l(o.catalog||null)}).catch(t=>{e||u(t.message||"Kh\xf4ng tải được model catalog status")}),()=>{e=!0}},[g]);let f=async e=>{let t=e.target.files?.[0];if(e.target.value="",t&&g){c(!0),m(""),u("");try{let e=await t.text(),o=await fetch(s,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e})}),a=await o.json().catch(()=>({}));if(!o.ok)throw Error(a.error||"Kh\xf4ng upload được model_catalog.json");l(a.catalog||null),m(`Đ\xe3 upload model_catalog.json (${a.catalog?.modelCount||0} models).`)}catch(e){u(e.message||"Kh\xf4ng upload được model_catalog.json")}finally{c(!1)}}};return g?(0,o.jsx)(r.Zp,{children:(0,o.jsxs)("div",{className:"space-y-3",children:[(0,o.jsxs)("div",{children:[(0,o.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,o.jsx)("span",{className:"rounded-full border border-border bg-surface px-2 py-1 text-[11px] font-medium uppercase tracking-wide text-text-muted",children:"Codex Local"}),(0,o.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:"model_catalog.json"})]}),(0,o.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:["Upload catalog d\xe0nh cho Codex Local. User sẽ download file n\xe0y v\xe0 đặt cạnh ",(0,o.jsx)("span",{className:"font-mono",children:"%USERPROFILE%\\.codex\\config.toml"}),"."]})]}),(0,o.jsx)("div",{className:"rounded-xl border border-border bg-background p-3 text-sm text-text-muted",children:t?.available?(0,o.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[(0,o.jsxs)("span",{children:["Hiện tại: ",(0,o.jsx)("span",{className:"font-mono font-medium text-text-main",children:"model_catalog.json"})," \xb7 ",t.modelCount," models \xb7 ",(e=Number(t.size||0))<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KiB`:`${(e/1048576).toFixed(1)} MiB`,t.uploadedAt?` \xb7 ${new Date(t.uploadedAt).toLocaleString()}`:""]}),(0,o.jsx)("a",{href:s,download:"model_catalog.json",className:"font-medium text-primary hover:underline",children:"Download"})]}):(0,o.jsx)("span",{children:"Chưa c\xf3 catalog. Upload file JSON để Local Codex guide c\xf3 file cho user download."})}),(0,o.jsxs)("label",{className:"inline-flex w-fit cursor-pointer items-center rounded-xl border border-border bg-background px-3 py-2 text-sm font-medium text-text-main transition hover:border-primary/50 hover:text-primary",children:[n?"Đang upload...":t?.available?"Thay model_catalog.json":"Upload model_catalog.json",(0,o.jsx)("input",{type:"file",accept:".json,application/json",className:"hidden",disabled:n,onChange:f})]}),x?(0,o.jsx)("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-3 text-sm text-red-600",children:x}):null,i?(0,o.jsx)("div",{className:"rounded-xl border border-emerald-500/30 bg-emerald-500/10 p-3 text-sm text-emerald-700 dark:text-emerald-300",children:i}):null]})}):null}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=11659)),_N_E=e.O()}]);
@@ -20,4 +20,4 @@ amp --model "{{model}}"
20
20
  "model": {
21
21
  "name": "{{model}}"
22
22
  }
23
- }`}},"deepseek-tui":{id:"deepseek-tui",name:"DeepSeek TUI",image:"/providers/deepseek-tui.png",color:"#4D6BFE",description:"DeepSeek Terminal Coding Agent (Rust TUI)",docsUrl:"https://github.com/DeepSeek-TUI/DeepSeek-TUI",configType:"custom",defaultCommand:"deepseek",modelAliases:["deepseek-v4-pro","deepseek-v4-flash","deepseek-chat","deepseek-reasoner"],defaultModels:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",alias:"deepseek-v4-pro"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",alias:"deepseek-v4-flash"},{id:"deepseek-chat",name:"DeepSeek V3 Chat",alias:"deepseek-chat"}],notes:[{type:"info",text:"DeepSeek TUI uses ~/.deepseek/config.toml for configuration. Bluerouter will update the provider to 'openai' mode with your base_url, api_key, and model."},{type:"warning",text:"Config path: Linux/macOS ~/.deepseek/config.toml • Windows %USERPROFILE%\\.deepseek\\config.toml"}]},jcode:{id:"jcode",name:"jcode",image:"/providers/jcode.png",color:"#FF6B35",description:"High-performance Rust-based coding agent harness",configType:"custom",docsUrl:"https://github.com/1jehuang/jcode",notes:[{type:"info",text:"jcode is a Rust-based coding agent with semantic memory, multi-agent swarms, and extreme performance (27.8 MB RAM, 14ms boot)."},{type:"info",text:"Configure bluerouter as an OpenAI-compatible provider to route all jcode requests through bluerouter's optimization layer."},{type:"warning",text:"Requires jcode installed. Install via: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash"}],defaultModels:[{id:"claude-opus-4-7",name:"Claude Opus 4.7",alias:"opus",defaultValue:"cc/claude-opus-4-7"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"sonnet",defaultValue:"cc/claude-sonnet-4-6"},{id:"gpt-5.5",name:"GPT 5.5",alias:"gpt5",defaultValue:"cx/gpt-5.5"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",alias:"gemini",defaultValue:"gemini/gemini-3.1-pro"}]}}},4987:(e,o,t)=>{Promise.resolve().then(t.bind(t,53501))},53501:(e,o,t)=>{"use strict";t.d(o,{default:()=>u});var s=t(95155),i=t(98500),l=t.n(i),a=t(12115),n=t(35497),d=t(94027),r=t(3534),c=t(5772);function p({toolId:e,tool:o,status:t}){let i=t?t.installed?t.hasBluerouter?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-red-500/10 text-red-600 dark:text-red-400"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,s.jsx)(l(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,s.jsx)(n.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,s.jsxs)("div",{className:"flex h-full flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:o.image?(0,s.jsx)(c.default,{src:o.image,alt:o.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):o.icon?(0,s.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:o.color},children:o.icon}):null}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h3",{className:"font-medium text-sm truncate",children:o.name}),(0,s.jsx)("span",{className:`inline-block mt-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${i.cls}`,children:i.label})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted line-clamp-2",children:o.description})]})})})}function u({machineId:e}){let[o,t]=(0,a.useState)(!0),[i,c]=(0,a.useState)({}),{isAdmin:m,canManageApiKeys:g}=(0,d.s)();if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let o=await fetch("/api/cli-tools/all-statuses");o.ok&&e&&c(await o.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&t(!1)}})(),()=>{e=!1}},[]),o)return(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let h=Object.entries(r.d);return(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[m||g?(0,s.jsxs)(l(),{href:"/dashboard/cli-tools/model-profiles",className:"group flex flex-col gap-3 rounded-2xl border border-primary/20 bg-primary/5 p-4 transition hover:border-primary/40 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl border border-primary/20 bg-surface p-2 text-primary",children:"tune"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-semibold text-text-main",children:"CLI Model Settings"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Set Local model d\xf9ng chung; Claude Code v\xe0 Codex c\xf3 Cloud model global, kh\xf4ng phụ thuộc Personal Auth của admin."})]})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted transition group-hover:translate-x-0.5 group-hover:text-primary",children:"arrow_forward"})]}):null,(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:h.map(([e,o])=>(0,s.jsx)(p,{toolId:e,tool:o,status:i[e]},e))})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,5772,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=4987)),_N_E=e.O()}]);
23
+ }`}},"deepseek-tui":{id:"deepseek-tui",name:"DeepSeek TUI",image:"/providers/deepseek-tui.png",color:"#4D6BFE",description:"DeepSeek Terminal Coding Agent (Rust TUI)",docsUrl:"https://github.com/DeepSeek-TUI/DeepSeek-TUI",configType:"custom",defaultCommand:"deepseek",modelAliases:["deepseek-v4-pro","deepseek-v4-flash","deepseek-chat","deepseek-reasoner"],defaultModels:[{id:"deepseek-v4-pro",name:"DeepSeek V4 Pro",alias:"deepseek-v4-pro"},{id:"deepseek-v4-flash",name:"DeepSeek V4 Flash",alias:"deepseek-v4-flash"},{id:"deepseek-chat",name:"DeepSeek V3 Chat",alias:"deepseek-chat"}],notes:[{type:"info",text:"DeepSeek TUI uses ~/.deepseek/config.toml for configuration. Bluerouter will update the provider to 'openai' mode with your base_url, api_key, and model."},{type:"warning",text:"Config path: Linux/macOS ~/.deepseek/config.toml • Windows %USERPROFILE%\\.deepseek\\config.toml"}]},jcode:{id:"jcode",name:"jcode",image:"/providers/jcode.png",color:"#FF6B35",description:"High-performance Rust-based coding agent harness",configType:"custom",docsUrl:"https://github.com/1jehuang/jcode",notes:[{type:"info",text:"jcode is a Rust-based coding agent with semantic memory, multi-agent swarms, and extreme performance (27.8 MB RAM, 14ms boot)."},{type:"info",text:"Configure bluerouter as an OpenAI-compatible provider to route all jcode requests through bluerouter's optimization layer."},{type:"warning",text:"Requires jcode installed. Install via: curl -fsSL https://raw.githubusercontent.com/1jehuang/jcode/master/scripts/install.sh | bash"}],defaultModels:[{id:"claude-opus-4-7",name:"Claude Opus 4.7",alias:"opus",defaultValue:"cc/claude-opus-4-7"},{id:"claude-sonnet-4-6",name:"Claude Sonnet 4.6",alias:"sonnet",defaultValue:"cc/claude-sonnet-4-6"},{id:"gpt-5.5",name:"GPT 5.5",alias:"gpt5",defaultValue:"cx/gpt-5.5"},{id:"gemini-3.1-pro",name:"Gemini 3.1 Pro",alias:"gemini",defaultValue:"gemini/gemini-3.1-pro"}]}}},4987:(e,o,t)=>{Promise.resolve().then(t.bind(t,53501))},53501:(e,o,t)=>{"use strict";t.d(o,{default:()=>u});var s=t(95155),i=t(98500),l=t.n(i),a=t(12115),n=t(35497),d=t(94027),r=t(3534),c=t(5772);function p({toolId:e,tool:o,status:t}){let i=t?t.installed?t.hasBluerouter?{label:"Connected",cls:"bg-green-500/10 text-green-600 dark:text-green-400"}:{label:"Not configured",cls:"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400"}:{label:"Not installed",cls:"bg-red-500/10 text-red-600 dark:text-red-400"}:{label:"Unknown",cls:"bg-gray-500/10 text-gray-500"};return(0,s.jsx)(l(),{href:`/dashboard/cli-tools/${e}`,className:"block",children:(0,s.jsx)(n.Zp,{padding:"sm",className:"h-full overflow-hidden hover:border-primary/50 transition-colors cursor-pointer",children:(0,s.jsxs)("div",{className:"flex h-full flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("div",{className:"size-8 flex items-center justify-center shrink-0",children:o.image?(0,s.jsx)(c.default,{src:o.image,alt:o.name,width:32,height:32,className:"size-8 object-contain rounded-lg",sizes:"32px",onError:e=>{e.target.style.display="none"}}):o.icon?(0,s.jsx)("span",{className:"material-symbols-outlined text-[28px]",style:{color:o.color},children:o.icon}):null}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("h3",{className:"font-medium text-sm truncate",children:o.name}),(0,s.jsx)("span",{className:`inline-block mt-0.5 px-1.5 py-0.5 text-[10px] font-medium rounded-full ${i.cls}`,children:i.label})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px] shrink-0",children:"chevron_right"})]}),(0,s.jsx)("p",{className:"text-xs text-text-muted line-clamp-2",children:o.description})]})})})}function u({machineId:e}){let[o,t]=(0,a.useState)(!0),[i,c]=(0,a.useState)({}),{isAdmin:m,canManageApiKeys:g}=(0,d.s)();if((0,a.useEffect)(()=>{let e=!0;return(async()=>{try{let o=await fetch("/api/cli-tools/all-statuses");o.ok&&e&&c(await o.json())}catch(e){console.log("Error fetching tool statuses:",e)}finally{e&&t(!1)}})(),()=>{e=!1}},[]),o)return(0,s.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:[(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{}),(0,s.jsx)(n.Qv,{})]});let h=Object.entries(r.d);return(0,s.jsxs)("div",{className:"mx-auto flex w-full max-w-5xl flex-col gap-6 px-1 sm:px-0",children:[m||g?(0,s.jsxs)(l(),{href:"/dashboard/cli-tools/model-profiles",className:"group flex flex-col gap-3 rounded-2xl border border-primary/20 bg-primary/5 p-4 transition hover:border-primary/40 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined rounded-xl border border-primary/20 bg-surface p-2 text-primary",children:"tune"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("div",{className:"font-semibold text-text-main",children:"CLI Model Settings"}),(0,s.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Set Local model d\xf9ng chung; Claude Code v\xe0 Codex c\xf3 Cloud model global, kh\xf4ng phụ thuộc Personal Auth của admin."})]})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-text-muted transition group-hover:translate-x-0.5 group-hover:text-primary",children:"arrow_forward"})]}):null,(0,s.jsx)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3 sm:gap-4",children:h.map(([e,o])=>(0,s.jsx)(p,{toolId:e,tool:o,status:i[e]},e))})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,5772,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=4987)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{20061:(e,t,n)=>{Promise.resolve().then(n.bind(n,47295))},47295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Y});var a=n(95155),r=n(12115),l=n(44923),i=n(87256),s=n(39768),o=n(5020),d=n(35497),c=n(11059),m=n(28777),u=n(52679);let p=/^[a-zA-Z0-9_.\-]+$/,x=[{value:"global",label:"To\xe0n cục / h\xe0nh vi hiện tại",description:"Giữ h\xe0nh vi hiện tại: mọi request d\xf9ng chung v\xf2ng xoay combo to\xe0n cục."},{value:"client_ip",label:"IP client",description:"Giữ c\xf9ng model khởi đầu cho c\xf9ng IP client cho đến khi hết TTL."},{value:"client_session",label:"IP client + phi\xean chat",description:"Ph\xf9 hợp nhất cho c\xf4ng cụ chat. Giữ c\xf9ng model cho c\xf9ng m\xe1y v\xe0 c\xf9ng phi\xean chat."}],h=[{value:"fallback",label:"Ưu ti\xean fallback",description:"Thử model trong combo theo đ\xfang thứ tự hiển thị, lỗi th\xec fallback."},{value:"round-robin",label:"Round Robin",description:"Lu\xe2n phi\xean model đang bật được thử đầu ti\xean. C\xe1c t\xf9y chọn giữ d\xednh b\xean dưới vẫn được \xe1p dụng."},{value:"least-latency",label:"Độ trễ thấp nhất",description:"Ưu ti\xean target c\xf3 điểm health/độ trễ tốt nhất. Hữu \xedch cho LAN Ollama."},{value:"p2c",label:"P2C",description:"Power of Two Choices: lấy mẫu hai target khỏe rồi chọn target \xedt bận hơn."}],b=[{card:"border-sky-100 bg-sky-50/55 dark:border-sky-400/15 dark:bg-sky-950/10",panel:"border-sky-100/80 bg-white/80 dark:border-sky-400/15 dark:bg-zinc-950/60"},{card:"border-slate-200 bg-slate-50/80 dark:border-slate-500/15 dark:bg-slate-900/35",panel:"border-slate-200/80 bg-white/80 dark:border-slate-500/15 dark:bg-zinc-950/60"},{card:"border-emerald-100 bg-emerald-50/45 dark:border-emerald-400/15 dark:bg-emerald-950/10",panel:"border-emerald-100/80 bg-white/80 dark:border-emerald-400/15 dark:bg-zinc-950/60"},{card:"border-violet-100 bg-violet-50/45 dark:border-violet-400/15 dark:bg-violet-950/10",panel:"border-violet-100/80 bg-white/80 dark:border-violet-400/15 dark:bg-zinc-950/60"}],g=Object.freeze({temperature:.7,top_p:.8,top_k:20,min_p:0,presence_penalty:1.5,max_tokens:4096,reasoning_budget:0,thinkingMode:"off"}),f=Object.freeze({temperature:.6,top_p:.95,top_k:20,min_p:0,presence_penalty:0,max_tokens:4096}),y=Object.freeze({temperature:.7,top_p:.8,top_k:20,min_p:0,presence_penalty:1.5,max_tokens:4096}),k=Object.freeze({think:"inheritThinkRequestOverrides",nothink:"inheritNoThinkRequestOverrides"}),v=[{key:"temperature",label:"temp",min:0,max:2,step:.05},{key:"top_p",label:"top_p",min:.01,max:1,step:.01},{key:"top_k",label:"top_k",min:0,max:1e3,step:1},{key:"min_p",label:"min_p",min:0,max:1,step:.01},{key:"presence_penalty",label:"presence_penalty",min:-2,max:2,step:.05},{key:"max_tokens",label:"max_tokens",min:1,max:262144,step:1}],j=[{value:"inherit",label:"Theo request gốc",description:"Theo cờ thinking client gửi l\xean; client kh\xf4ng khai b\xe1o th\xec gateway tắt thinking."},{value:"off",label:"Tắt thinking",description:"Gửi chat_template_kwargs.enable_thinking = false."},{value:"on",label:"Bật thinking",description:"Gửi chat_template_kwargs.enable_thinking = true."}],N=[{value:"inherit",label:"Theo cấu h\xecnh hệ thống",description:"Sử dụng ch\xednh s\xe1ch lưu Prompt Logs chung của hệ thống."},{value:"enabled",label:"Lưu đầy đủ nội dung",description:"Cho ph\xe9p quản trị vi\xean xem lại to\xe0n bộ prompt v\xe0 phản hồi của c\xe1c request thuộc combo n\xe0y."},{value:"disabled",label:"Chỉ lưu thống k\xea",description:"Kh\xf4ng lưu nội dung hội thoại. Chỉ lưu metadata, model, provider, token, thời gian xử l\xfd v\xe0 c\xe1c thống k\xea vận h\xe0nh."}];function _(e){return e&&"object"==typeof e&&!Array.isArray(e)}function w(e,t){return Object.prototype.hasOwnProperty.call(e||{},t)}function C(e,{min:t,max:n,precision:a=3}={}){if(null==e||""===e)return;let r=Number(e);if(Number.isFinite(r))return Number(Math.min(n,Math.max(t,r)).toFixed(a))}function T(e,{min:t,max:n}={}){let a=C(e,{min:t,max:n,precision:0});return void 0===a?void 0:Math.trunc(a)}function O(e){let t=R(e).toLowerCase();return"enabled"===t||"disabled"===t?t:"inherit"}let S=["temperature","top_p","top_k","min_p","presence_penalty","max_tokens"];function $(e={}){let t=_(e)?e:{},n={};if(w(t,"temperature")){let e=C(t.temperature,{min:0,max:2});void 0!==e&&(n.temperature=e)}if(w(t,"top_p")||w(t,"topP")){let e=C(t.top_p??t.topP,{min:.01,max:1});void 0!==e&&(n.top_p=e)}if(w(t,"top_k")||w(t,"topK")){let e=T(t.top_k??t.topK,{min:0,max:1e3});void 0!==e&&(n.top_k=e)}if(w(t,"min_p")||w(t,"minP")){let e=C(t.min_p??t.minP,{min:0,max:1});void 0!==e&&(n.min_p=e)}let a=t.presence_penalty??t.presencePenalty??t["presence-penalty"];if(w(t,"presence_penalty")||w(t,"presencePenalty")||w(t,"presence-penalty")){let e=C(a,{min:-2,max:2});void 0!==e&&(n.presence_penalty=e)}let r=t.max_tokens??t.maxTokens??t.max_token;if(w(t,"max_tokens")||w(t,"maxTokens")||w(t,"max_token")){let e=T(r,{min:1,max:262144});void 0!==e&&(n.max_tokens=e)}return n}function q(e={}){let t=_(e)?e:{},n={};if(w(t,"temperature")){let e=C(t.temperature,{min:0,max:2});void 0!==e&&(n.temperature=e)}if(w(t,"top_p")){let e=C(t.top_p,{min:.01,max:1});void 0!==e&&(n.top_p=e)}if(w(t,"top_k")||w(t,"topK")){let e=T(t.top_k??t.topK,{min:0,max:1e3});void 0!==e&&(n.top_k=e)}if(w(t,"min_p")||w(t,"minP")){let e=C(t.min_p??t.minP,{min:0,max:1});void 0!==e&&(n.min_p=e)}let a=t.presence_penalty??t.presencePenalty??t["presence-penalty"];if(w(t,"presence_penalty")||w(t,"presencePenalty")||w(t,"presence-penalty")){let e=C(a,{min:-2,max:2});void 0!==e&&(n.presence_penalty=e)}let r=t.max_tokens??t.maxTokens??t.max_token;if(w(t,"max_tokens")||w(t,"maxTokens")||w(t,"max_token")){let e=T(r,{min:1,max:262144});void 0!==e&&(n.max_tokens=e)}let l=t.reasoning_budget??t.reasoningBudget??t["reasoning-budget"];if(w(t,"reasoning_budget")||w(t,"reasoningBudget")||w(t,"reasoning-budget")){let e=T(l,{min:0,max:262144});void 0!==e&&(n.reasoning_budget=e)}let i=t.inheritThinkRequestOverrides??t.thinkRequestOverrides??t.thinkingOnRequestOverrides;if(w(t,"inheritThinkRequestOverrides")||w(t,"thinkRequestOverrides")||w(t,"thinkingOnRequestOverrides")){let e=$(i);Object.keys(e).length>0&&(n.inheritThinkRequestOverrides=e)}let s=t.inheritNoThinkRequestOverrides??t.noThinkRequestOverrides??t.thinkingOffRequestOverrides;if(w(t,"inheritNoThinkRequestOverrides")||w(t,"noThinkRequestOverrides")||w(t,"thinkingOffRequestOverrides")){let e=$(s);Object.keys(e).length>0&&(n.inheritNoThinkRequestOverrides=e)}let o=function(e){if(!0===e)return"on";if(!1===e)return"off";let t=R(e).toLowerCase();return["on","true","1","enable","enabled"].includes(t)?"on":["off","false","0","disable","disabled"].includes(t)?"off":void 0}(t.thinkingMode??t.thinking);if(o&&(n.thinkingMode=o),"off"===n.thinkingMode&&delete n.reasoning_budget,!n.thinkingMode){let e=$(n);if(Object.keys(e).length>0)for(let t of(n.inheritThinkRequestOverrides={...e,...n.inheritThinkRequestOverrides||{}},n.inheritNoThinkRequestOverrides={...e,...n.inheritNoThinkRequestOverrides||{}},S))delete n[t]}return n}function M(e={}){let t=$(e||{}),n=[];return void 0!==t.temperature&&n.push(`temp ${t.temperature}`),void 0!==t.top_p&&n.push(`top_p ${t.top_p}`),void 0!==t.top_k&&n.push(`top_k ${t.top_k}`),void 0!==t.min_p&&n.push(`min_p ${t.min_p}`),void 0!==t.presence_penalty&&n.push(`presence ${t.presence_penalty}`),void 0!==t.max_tokens&&n.push(`max ${t.max_tokens}`),n}function R(e){return String(e||"").trim()}function L(e={}){return Array.isArray(e.disabledModels)?[...new Set(e.disabledModels.map(e=>R(e)).filter(Boolean))]:[]}function E(e={}){let t=e.fallbackStrategy||"fallback";return{...e,fallbackStrategy:t,stickyScope:e.stickyScope||"global",stickyTtlMinutes:Number(e.stickyTtlMinutes||120),stickyFallbackToClientIp:!1!==e.stickyFallbackToClientIp,lanHealthEnabled:!1!==e.lanHealthEnabled,healthCheckPath:e.healthCheckPath||"/api/tags",healthCheckIntervalMs:Number(e.healthCheckIntervalMs||15e3),requiredTags:Array.isArray(e.requiredTags)?e.requiredTags:[],modelTagRules:e.modelTagRules||e.modelTags||e.tagRules||{},disabledModels:L(e),requestOverrides:q(e.requestOverrides||{}),contentLoggingMode:O(e.contentLoggingMode)}}function P(e={}){let t={...e};t.disabledModels=L(e),"fallback"===(t.fallbackStrategy||"fallback")&&delete t.fallbackStrategy,t.disabledModels.length||delete t.disabledModels;let n=O(t.contentLoggingMode);"inherit"===n?delete t.contentLoggingMode:t.contentLoggingMode=n,t.requiredTags?.length||delete t.requiredTags;let a=q(t.requestOverrides||{});return Object.keys(a).length?t.requestOverrides=a:delete t.requestOverrides,t.modelTagRules&&0!==Object.keys(t.modelTagRules).length||delete t.modelTagRules,"/api/tags"===t.healthCheckPath&&delete t.healthCheckPath,15e3===Number(t.healthCheckIntervalMs)&&delete t.healthCheckIntervalMs,!0===t.lanHealthEnabled&&delete t.lanHealthEnabled,Object.keys(t).length?t:null}function I(e){return Array.isArray(e)?`[${e.map(I).join(",")}]`:e&&"object"==typeof e?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${I(e[t])}`).join(",")}}`:JSON.stringify(void 0===e?null:e)}function A(e=[]){return Array.isArray(e)?e.join(", "):String(e||"")}function z(e=""){return String(e||"").split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean)}function B(e={}){return e&&"object"==typeof e?Object.entries(e).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(", "):String(t||"")}`).join("\n"):""}function F(e){return"string"==typeof e?e:e&&"object"==typeof e&&(e.value||e.model||e.id)||""}function D(e={}){let t=R(e.provider);return R(e.providerSpecificData?.prefix)||R(e.prefix)||R((0,u.wG)(t))||t}function K(e={}){return R(e.email)||R(e.accountName)||R(e.displayName)||R(e.name)||R(e.providerSpecificData?.nodeName)||R(e.id)}function H(e){return e&&"object"==typeof e?R(e.connectionId||e.connection_id):""}function G(e){let t=F(e),n=H(e);return t?n?`${t}@@${n}`:t:""}function J(e){return"string"==typeof e?e:e&&"object"==typeof e?R(e.label)||R(e.displayName)||R(e.name)||F(e):""}function X(e){if(!e||"object"!=typeof e)return F(e);let t=F(e);return t?Object.fromEntries(Object.entries({model:t,connectionId:H(e)||void 0,label:J(e)||void 0,provider:R(e.provider)||void 0,accountName:R(e.accountName||e.account_name)||void 0,weight:Number(e.weight||0)>0?Number(e.weight):void 0}).filter(([,e])=>void 0!==e&&""!==e)):""}function Q(e,t=!0){let n=X(e),a=G(n);return{value:a,enabled:t,target:n,label:J(n)||a,subtitle:function(e){if(!e||"object"!=typeof e)return"";let t=H(e),n=F(e);return t?`T\xe0i khoản cố định • ${t}${n?` • ${n}`:""}`:""}(n)}}function U(e={}){return R(e.defaultModel)||R(e.providerSpecificData?.defaultModel)||R(e.model)||""}function W(e,t,n,a=""){let r=R(n);!r||t.has(r)||(t.add(r),e.push({value:r,label:R(a)||r}))}function V(e={},t={}){let n=[],a=new Set,r=R(e.provider),l=[...new Set([D(e),R((0,u.wG)(r)),r].filter(Boolean))];for(let e of(0,m.KC)(r)||[])e?.type&&"llm"!==e.type||W(n,a,e.id,e.name||e.id);for(let[e,r]of Object.entries(t||{})){let t=R(r),i=l.find(e=>e&&t.startsWith(`${e}/`));if(!i)continue;let s=t.slice(i.length+1);W(n,a,s,e||s)}return W(n,a,U(e),"Model mặc định"),n}function Z(e={},{disabledModels:t=[],requestOverrides:n,contentLoggingMode:a}={}){let r={...e},l=[...new Set((t||[]).map(e=>R(e)).filter(Boolean))];if(l.length>0?r.disabledModels=l:delete r.disabledModels,void 0!==n){let e=q(n||{});Object.keys(e).length?r.requestOverrides=e:delete r.requestOverrides}if(void 0!==a){let e=O(a);"inherit"===e?delete r.contentLoggingMode:r.contentLoggingMode=e}return P(r)}function Y(){let[e,t]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0),[i,s]=(0,r.useState)(!1),[o,m]=(0,r.useState)(null),[u,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1),[b,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)({}),[k,v]=(0,r.useState)(""),[j,N]=(0,r.useState)(null),{copied:_,copy:w}=(0,c.C)();(0,r.useEffect)(()=>{C()},[]),(0,r.useEffect)(()=>{if(0===e.length){k&&v("");return}let t=e.some(e=>e.name===k);k&&t||v(e[0].name)},[e,k]);let C=async()=>{try{let e=await fetch("/api/dashboard/combos",{cache:"no-store"}),n=await e.json();e.ok&&(t(n.combos||[]),y(n.comboStrategies||{}))}catch(e){console.log("Error fetching combo data:",e)}finally{l(!1)}},T=async()=>{if(!x&&!b){g(!0);try{let e=await fetch("/api/providers",{cache:"no-store"}),t=await e.json();e.ok&&(p(t.connections||[]),h(!0))}catch(e){console.log("Error loading provider accounts:",e)}finally{g(!1)}}},O=async()=>{s(!0),T()},S=async e=>{m(e),T()},$=async e=>{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:e})});if(!t.ok)throw Error(`Save combo strategies failed: ${t.status}`);y(e)},q=async e=>{let{disabledModels:t=[],requestOverrides:n,contentLoggingMode:a,...r}=e;try{let e=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(e.ok){let e=Z({},{disabledModels:t,requestOverrides:n,contentLoggingMode:a});e&&await $({...f,[r.name]:e}),await C(),v(r.name),s(!1)}else{let t=await e.json();alert(t.error||"Tạo combo thất bại")}}catch(e){console.log("Error creating combo:",e)}},M=async(e,t)=>{let{disabledModels:n=[],requestOverrides:a,contentLoggingMode:r,...l}=t,i=o?.name;try{let t=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(t.ok){let e={...f};i&&i!==l.name&&e[i]&&(e[l.name]=e[i],delete e[i]);let t=Z(e[l.name]||{},{disabledModels:n,requestOverrides:a,contentLoggingMode:r});t?e[l.name]=t:delete e[l.name],await $(e),await C(),v(l.name),m(null)}else{let e=await t.json();alert(e.error||"Cập nhật combo thất bại")}}catch(e){console.log("Error updating combo:",e)}},R=async n=>{let a=e.find(e=>e.id===n);N({title:"X\xf3a combo",message:"Bạn c\xf3 chắc muốn x\xf3a combo n\xe0y?",onConfirm:async()=>{N(null);try{if((await fetch(`/api/combos/${n}`,{method:"DELETE"})).ok){if(a?.name&&f[a.name]){let e={...f};delete e[a.name],await $(e)}t(e=>{let t=e.filter(e=>e.id!==n);return a?.name===k&&v(t[0]?.name||""),t})}}catch(e){console.log("Error deleting combo:",e)}}})},L=async(e,t)=>{try{let n={...f},a=P({...E(n[e]),...t});return a?n[e]=a:delete n[e],await $(n),!0}catch(e){return console.log("Error updating combo routing settings:",e),!1}},I=e.find(e=>e.name===k)||e[0]||null,A=I?Math.max(0,e.findIndex(e=>e.id===I.id)):0;return n?(0,a.jsx)("div",{className:"grid gap-4",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-36 animate-pulse rounded-2xl border border-border bg-surface"},e))}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Combo model"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model với fallback, round-robin, độ trễ thấp nhất, P2C v\xe0 routing theo trạng th\xe1i health của LAN Ollama."})]}),(0,a.jsxs)("button",{type:"button",onClick:O,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Tạo combo"]})]}),0===e.length?(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-border bg-surface p-12 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"layers"}),(0,a.jsx)("h2",{className:"mt-3 text-lg font-semibold text-text-main",children:"Chưa c\xf3 combo n\xe0o"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model c\xf3 hỗ trợ fallback."}),(0,a.jsx)("button",{type:"button",onClick:O,className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:"Tạo combo"})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-2xl border border-border bg-surface/80 p-4 shadow-sm dark:bg-zinc-950/70",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[(0,a.jsxs)("label",{className:"block min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Combo đang xem"}),(0,a.jsx)("select",{value:I?.name||"",onChange:e=>v(e.target.value),className:"w-full rounded-xl border border-border bg-white px-4 py-2.5 text-sm font-semibold text-text-main outline-none transition focus:border-primary dark:bg-zinc-900",children:e.map(e=>(0,a.jsxs)("option",{value:e.name,children:[e.name," • ",(e.models||[]).length," model"]},e.id))})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"rounded-full bg-background px-3 py-1 dark:bg-zinc-900",children:["Tổng ",e.length," combo"]}),I?(0,a.jsxs)("span",{className:"rounded-full bg-primary/10 px-3 py-1 font-medium text-primary",children:["Đang hiển thị: ",I.name]}):null]})]})}),I?(0,a.jsx)(ee,{combo:I,comboIndex:A,copied:_,onCopy:w,onEdit:()=>S(I),onDelete:()=>R(I.id),comboStrategy:f[I.name]||{},onUpdateComboStrategy:e=>L(I.name,e)},I.id):null]}),(0,a.jsx)(es,{isOpen:i,comboStrategy:{},onClose:()=>s(!1),onSave:q,activeProviders:u,providersLoading:b}),(0,a.jsx)(es,{isOpen:!!o,combo:o,comboStrategy:f[o?.name]||{},onClose:()=>m(null),onSave:e=>M(o.id,e),activeProviders:u,providersLoading:b}),(0,a.jsx)(d.uo,{isOpen:!!j,onClose:()=>N(null),onConfirm:j?.onConfirm,title:j?.title||"X\xe1c nhận",message:j?.message,variant:"danger"})]})}function ee({combo:e,comboIndex:t=0,copied:n,onCopy:l,onEdit:i,onDelete:s,comboStrategy:o={},onUpdateComboStrategy:d}){let[c,m]=(0,r.useState)({}),[u,p]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),y=E(o||{}),k=E({...o||{},...c}),v=!function(e={},t={}){return I(P(e)||{})===I(P(t)||{})}(k,y),j=k.fallbackStrategy||"fallback",N=h.find(e=>e.value===j)||h[0],_=k.stickyScope||"global",w=x.find(e=>e.value===_)||x[0],C=L(o),T=b[t%b.length],[O,S]=(0,r.useState)(A(k.requiredTags)),[$,R]=(0,r.useState)(B(k.modelTagRules)),F=e=>{f(""),m(t=>({...t,...e}))},D=async()=>{if(!v||u)return;p(!0);let e=await d(c);(p(!1),!1===e)?f("Lưu thất bại, thử lại."):m({})};return(0,r.useEffect)(()=>{m({}),f("")},[e.name]),(0,r.useEffect)(()=>{S(A(k.requiredTags)),R(B(k.modelTagRules))},[e.name,JSON.stringify(k.requiredTags||[]),JSON.stringify(k.modelTagRules||{})]),(0,a.jsxs)("div",{className:`rounded-2xl border p-5 shadow-sm transition-colors ${T.card}`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"}),(0,a.jsx)("h3",{className:"truncate text-lg font-semibold text-text-main",children:e.name})]}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[(e.models||[]).length," model đang bật",C.length>0?` • ${C.length} đ\xe3 tắt`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(et,{icon:n===`combo-${e.id}`?"check":"content_copy",title:"Copy t\xean combo",onClick:()=>l(e.name,`combo-${e.id}`)}),(0,a.jsx)(et,{icon:"edit",title:"Chỉnh sửa",onClick:i}),(0,a.jsx)(et,{icon:"delete",title:"X\xf3a",onClick:s,danger:!0})]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[0===(e.models||[]).length?(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:"Chưa c\xf3 model đang bật"}):(e.models||[]).slice(0,5).map((e,t)=>(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 font-mono text-xs text-text-main",children:J(e)},`${G(e)}-${t}`)),(e.models||[]).length>5&&(0,a.jsxs)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:["+",e.models.length-5," model nữa"]}),C.length>0&&(0,a.jsxs)("span",{className:"rounded-lg bg-red-500/10 px-2 py-1 text-xs text-red-500",children:[C.length," đ\xe3 tắt"]}),(function(e={}){let t=q(e),n=[];if(void 0!==t.temperature&&n.push(`temp ${t.temperature}`),void 0!==t.top_p&&n.push(`top_p ${t.top_p}`),void 0!==t.top_k&&n.push(`top_k ${t.top_k}`),void 0!==t.min_p&&n.push(`min_p ${t.min_p}`),void 0!==t.presence_penalty&&n.push(`presence ${t.presence_penalty}`),void 0!==t.max_tokens&&n.push(`max ${t.max_tokens}`),void 0!==t.reasoning_budget&&n.push(`reasoning ${t.reasoning_budget}`),"off"===t.thinkingMode&&n.push("thinking off"),"on"===t.thinkingMode&&n.push("thinking on"),!t.thinkingMode){let e=M(t.inheritThinkRequestOverrides),a=M(t.inheritNoThinkRequestOverrides);e.length&&n.push(`think: ${e.join(", ")}`),a.length&&n.push(`nothink: ${a.join(", ")}`)}return n})(y.requestOverrides).map(e=>(0,a.jsx)("span",{className:"rounded-lg bg-primary/10 px-2 py-1 text-xs font-medium text-primary",children:e},e)),"inherit"!==y.contentLoggingMode?(0,a.jsxs)("span",{className:`rounded-lg px-2 py-1 text-xs font-medium ${"disabled"===y.contentLoggingMode?"bg-amber-500/10 text-amber-600":"bg-emerald-500/10 text-emerald-600"}`,children:["prompt logs ",y.contentLoggingMode]}):null]}),(0,a.jsxs)("div",{className:`mt-5 rounded-xl border p-4 ${T.panel}`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-text-main",children:"Chiến lược routing"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:N.description})]}),(0,a.jsx)("select",{value:j,onChange:e=>F({fallbackStrategy:e.target.value}),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:h.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsx)(ei,{value:k.requestOverrides||{},onChange:e=>F({requestOverrides:e}),compact:!0}),(0,a.jsx)(ea,{value:k.contentLoggingMode,onChange:e=>F({contentLoggingMode:e}),compact:!0}),("least-latency"===j||"p2c"===j)&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==k.lanHealthEnabled,onChange:e=>F({lanHealthEnabled:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Routing theo trạng th\xe1i health LAN"}),(0,a.jsx)("span",{className:"mt-1 block text-xs",children:"D\xf9ng dữ liệu health v\xe0 circuit breaker khi xếp hạng target trong combo."})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Đường dẫn health"}),(0,a.jsx)("input",{value:k.healthCheckPath||"/api/tags",onChange:e=>F({healthCheckPath:e.target.value||"/api/tags"}),placeholder:"/api/tags",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chu kỳ kiểm tra (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",value:k.healthCheckIntervalMs||15e3,onChange:e=>F({healthCheckIntervalMs:Number(e.target.value)||15e3}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Tag endpoint bắt buộc"}),(0,a.jsx)("input",{value:O,onChange:e=>S(e.target.value),onBlur:()=>F({requiredTags:z(O)}),onKeyDown:e=>"Enter"===e.key&&e.currentTarget.blur(),placeholder:"gpu, vram:8gb",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Mọi endpoint được route đều phải c\xf3 c\xe1c tag n\xe0y."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Quy tắc tag theo model"}),(0,a.jsx)("textarea",{value:$,onChange:e=>R(e.target.value),onBlur:()=>F({modelTagRules:function(e=""){let t={};for(let n of String(e||"").split(/\n+/)){let e=n.trim();if(!e)continue;let a=e.indexOf(":");if(-1===a)continue;let r=e.slice(0,a).trim(),l=z(e.slice(a+1));r&&l.length&&(t[r]=l)}return t}($)}),placeholder:"qwen3:32b: gpu, vram:16gb\nqwen3:8b: model_support:qwen3:8b",rows:3,className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]})]})]}),"round-robin"===j&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"sticky_note_2"}),"Round Robin giữ d\xednh"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:"round-robin"===j,onChange:e=>F({fallbackStrategy:e.target.checked?"round-robin":"fallback"}),className:"h-3.5 w-3.5 accent-primary"}),"Bật"]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chế độ giữ d\xednh"}),(0,a.jsx)("select",{value:_,onChange:e=>F({stickyScope:e.target.value}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary",children:x.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:w.description})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"TTL giữ d\xednh (ph\xfat)"}),(0,a.jsx)("input",{type:"number",min:"1",value:k.stickyTtlMinutes||120,onChange:e=>F({stickyTtlMinutes:Number(e.target.value)||120}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("label",{className:"mt-3 flex items-start gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==k.stickyFallbackToClientIp,onChange:e=>F({stickyFallbackToClientIp:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),"Nếu thiếu chat session id, fallback về IP client thay v\xec xoay to\xe0n cục."]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 border-t border-border pt-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("span",{className:`text-xs ${g?"text-red-500":v?"text-amber-600":"text-text-muted"}`,children:g||(v?"C\xf3 thay đổi chưa lưu — chỉ \xe1p dụng sau khi bấm Lưu.":"Đang \xe1p dụng cho request mới.")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{f(""),m({})},disabled:!v||u,className:"rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-text-muted transition hover:text-text-main disabled:opacity-40",children:"Ho\xe0n t\xe1c"}),(0,a.jsxs)("button",{type:"button",onClick:D,disabled:!v||u,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:opacity-40",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"save"}),u?"Đang lưu…":"Lưu thay đổi"]})]})]})]})]})}function et({icon:e,title:t,onClick:n,danger:r=!1}){return(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),n?.()},className:`rounded-lg p-2 transition ${r?"text-red-500 hover:bg-red-500/10":"text-text-muted hover:bg-background hover:text-primary"}`,title:t,"aria-label":t,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:e})})}function en({id:e,index:t,model:n,subtitle:l="",enabled:o,isFirst:d,isLast:c,onEdit:m,onMoveUp:u,onMoveDown:p,onRemove:x,onToggleEnabled:h}){let{attributes:b,listeners:g,setNodeRef:f,transform:y,isDragging:k}=(0,i.gl)({id:e}),v={transform:s.Ks.Transform.toString(y),opacity:k?.4:1,zIndex:k?999:void 0},[j,N]=(0,r.useState)(!1),[_,w]=(0,r.useState)(n);(0,r.useEffect)(()=>{w(n)},[n]);let C=()=>{let e=_.trim();e&&e!==n?m(e):w(n),N(!1)};return(0,a.jsxs)("div",{ref:f,style:v,className:`flex items-center gap-3 rounded-xl border p-3 transition ${o?"border-border bg-background":"border-red-200 bg-red-50/70 opacity-75 dark:border-red-500/30 dark:bg-red-500/10"}`,children:[(0,a.jsx)("button",{type:"button",className:"cursor-grab text-text-muted active:cursor-grabbing",...b,...g,title:"K\xe9o để sắp xếp lại",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"drag_indicator"})}),(0,a.jsx)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${o?"bg-primary/10 text-primary":"bg-red-100 text-red-600 dark:bg-red-500/20 dark:text-red-300"}`,children:t+1}),j?(0,a.jsx)("input",{autoFocus:!0,value:_,onChange:e=>w(e.target.value),onBlur:C,onKeyDown:e=>{"Enter"===e.key&&C(),"Escape"===e.key&&(w(n),N(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-background px-2 py-1 font-mono text-xs text-text-main outline-none"}):(0,a.jsxs)("button",{type:"button",onClick:()=>N(!0),className:"min-w-0 flex-1 text-left",title:"Bấm để sửa model",children:[(0,a.jsx)("span",{className:`block truncate font-mono text-xs ${o?"text-text-main":"text-text-muted line-through"}`,children:n}),l?(0,a.jsx)("span",{className:"mt-0.5 block truncate text-[11px] text-text-muted",children:l}):null]}),(0,a.jsx)("button",{type:"button",onClick:h,className:`rounded-lg p-1.5 transition ${o?"text-green-600 hover:bg-green-500/10":"text-red-500 hover:bg-red-500/10"}`,title:o?"Tắt model trong combo":"Bật model trong combo",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:o?"toggle_on":"toggle_off"})}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển l\xean",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_upward"})}),(0,a.jsx)("button",{type:"button",onClick:p,disabled:c,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển xuống",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_downward"})}),(0,a.jsx)("button",{type:"button",onClick:x,className:"rounded-lg p-1.5 text-red-500 transition hover:bg-red-500/10",title:"X\xf3a",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function ea({value:e="inherit",onChange:t,compact:n=!1}){let r=O(e),l=N.find(e=>e.value===r)||N[0];return(0,a.jsx)("div",{className:n?"mt-4 rounded-xl border border-amber-500/15 bg-surface p-3":"rounded-xl border border-amber-500/15 bg-amber-500/5 p-4",children:(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_280px] md:items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500",children:"manage_search"}),"Prompt Logs cho combo n\xe0y"]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:l.description}),"disabled"===r?(0,a.jsx)("p",{className:"mt-1 text-[11px] font-medium text-amber-600",children:"Khi chạy request, Prompt Logs sẽ chỉ ghi metadata v\xe0 hiển thị [promptlogs disabled on this combo]."}):null]}),(0,a.jsx)("select",{value:r,onChange:e=>t?.(O(e.target.value)),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:N.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})})}function er({icon:e,label:t,children:n,active:r,muted:l=!1,className:i=""}){return(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${r?"border-primary/30 bg-background shadow-sm":"border-border bg-background/60"} ${i}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${r?"text-primary":"text-text-muted"}`,children:e}),(0,a.jsx)("span",{className:"truncate",children:t})]}),n?.toggle]}),n?.control,n?.hint?(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:n.hint}):null]})}function el({icon:e,title:t,values:n={},defaults:r={},onToggleField:l,onChangeField:i,inputClass:s}){let o=Object.keys(n||{}).length>0;return(0,a.jsxs)("div",{className:`rounded-lg border p-2 transition ${o?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold text-text-main",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${o?"text-primary":"text-text-muted"}`,children:e}),(0,a.jsx)("span",{className:"truncate",children:t})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:v.map(e=>{let t=n?.[e.key]!==void 0;return(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between gap-1 text-[11px] font-medium text-text-main",children:[(0,a.jsx)("span",{className:"truncate",children:e.label}),(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>l?.(e.key,t.target.checked,r[e.key]),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:e.min,max:e.max,step:e.step,disabled:!t,value:t?n[e.key]:r[e.key],onChange:t=>i?.(e.key,t.target.value),className:s})]},e.key)})})]})}function ei({value:e={},onChange:t,compact:n=!1}){let r=q(e),l=void 0!==r.temperature,i=void 0!==r.top_p,s=void 0!==r.top_k,o=void 0!==r.min_p,d=void 0!==r.presence_penalty,c=void 0!==r.max_tokens,m=void 0!==r.reasoning_budget,u=r.thinkingMode||"inherit",p="inherit"!==u,x="off"===u,h=r.inheritThinkRequestOverrides||{},b=r.inheritNoThinkRequestOverrides||{},v=Object.keys(h).length>0||Object.keys(b).length>0,N=l||i||s||o||d||c||!p&&v,_=p||m,w=e=>{t?.(q({...r,...e}))},C=(e,n,a)=>{if(!n){let n={...r};delete n[e],t?.(q(n));return}w({[e]:a})},T=(e,t,n,a)=>{let l=k[e],i={...r[l]||{}};if(!n){delete i[t],w({[l]:i});return}i[t]=a,w({[l]:$(i)})},O=(e,t,n)=>{let a=k[e];w({[a]:$({...r[a]||{},[t]:n})})},S="w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50";return(0,a.jsxs)("div",{className:n?"mt-4 rounded-xl border border-sky-500/15 bg-surface p-3":"rounded-xl border border-sky-500/15 bg-sky-500/5 p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-sky-500",children:"tune"}),"Tham số request Local endpoint"]}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Chỉ inject khi combo route 100% tới local endpoint: ",(0,a.jsx)("span",{className:"font-mono",children:"llama.cpp"}),", ",(0,a.jsx)("span",{className:"font-mono",children:"vLLM"})," hoặc ",(0,a.jsx)("span",{className:"font-mono",children:"Ollama"}),". Nếu combo mix local + cloud/provider kh\xe1c, BlueRouter bỏ qua block n\xe0y v\xe0 giữ nguy\xean request gốc."]})]}),!function(e={}){return Object.keys(q(e)).length>0}(r)?(0,a.jsx)("span",{className:"inline-flex shrink-0 items-center rounded-full bg-background px-2 py-1 text-[11px] font-semibold text-text-muted",children:"Kh\xf4ng override"}):(0,a.jsx)("span",{className:"inline-flex shrink-0 items-center rounded-full bg-primary/10 px-2 py-1 text-[11px] font-semibold text-primary",children:"C\xf3 override"})]}),(0,a.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,a.jsxs)("div",{className:`rounded-xl border p-3 ${N?"border-primary/20 bg-primary/5":"border-border bg-background/40"}`,children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-xs font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"graphic_eq"}),"Sampling ",(0,a.jsx)("span",{className:"font-normal text-text-muted",children:"(điều khiển lựa chọn token)"})]}),p?(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 2xl:grid-cols-3",children:[(0,a.jsx)(er,{icon:"thermostat",label:"Temperature",active:l,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:l,onChange:e=>C("temperature",e.target.checked,g.temperature),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"2",step:"0.05",disabled:!l,value:l?r.temperature:g.temperature,onChange:e=>w({temperature:e.target.value}),className:S}),hint:"0 = ổn định, 2 = s\xe1ng tạo."}}),(0,a.jsx)(er,{icon:"filter_alt",label:"top_p",active:i,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:i,onChange:e=>C("top_p",e.target.checked,g.top_p),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0.01",max:"1",step:"0.01",disabled:!i,value:i?r.top_p:g.top_p,onChange:e=>w({top_p:e.target.value}),className:S}),hint:"0.01–1.0; 0.9–0.95 thường hợp coder/chat."}}),(0,a.jsx)(er,{icon:"filter_list",label:"top_k",active:s,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:e=>C("top_k",e.target.checked,g.top_k),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"1000",step:"1",disabled:!s,value:s?r.top_k:g.top_k,onChange:e=>w({top_k:e.target.value}),className:S}),hint:"Qwen3 khuyến nghị 20. Chỉ gửi tới llama.cpp/vLLM."}}),(0,a.jsx)(er,{icon:"vertical_align_bottom",label:"min_p",active:o,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:o,onChange:e=>C("min_p",e.target.checked,g.min_p),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"1",step:"0.01",disabled:!o,value:o?r.min_p:g.min_p,onChange:e=>w({min_p:e.target.value}),className:S}),hint:"Qwen3 khuyến nghị 0. Chỉ gửi tới llama.cpp/vLLM."}}),(0,a.jsx)(er,{icon:"repeat",label:"presence_penalty",active:d,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:d,onChange:e=>C("presence_penalty",e.target.checked,g.presence_penalty),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"-2",max:"2",step:"0.05",disabled:!d,value:d?r.presence_penalty:g.presence_penalty,onChange:e=>w({presence_penalty:e.target.value}),className:S}),hint:"-2–2; coder thường để 0, chỉ tăng nhẹ nếu hay lặp."}}),(0,a.jsx)(er,{icon:"output",label:"max_tokens",active:c,className:"sm:col-span-2 2xl:col-span-1",children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:c,onChange:e=>C("max_tokens",e.target.checked,g.max_tokens),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"1",max:"262144",step:"1",disabled:!c,value:c?r.max_tokens:g.max_tokens,onChange:e=>w({max_tokens:e.target.value}),className:S}),hint:"Giới hạn output cho request."}})]}):(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"grid gap-3 2xl:grid-cols-2",children:[(0,a.jsx)(el,{icon:"psychology",title:"Khi request bật thinking",values:h,defaults:f,onToggleField:(e,t,n)=>T("think",e,t,n),onChangeField:(e,t)=>O("think",e,t),inputClass:S}),(0,a.jsx)(el,{icon:"bolt",title:"Khi request tắt thinking",values:b,defaults:y,onToggleField:(e,t,n)=>T("nothink",e,t,n),onChangeField:(e,t)=>O("nothink",e,t),inputClass:S})]}),(0,a.jsx)("span",{className:"block text-[11px] text-text-muted",children:"Thinking đang theo request gốc n\xean mỗi nh\xe1nh c\xf3 bộ sampling ri\xeang, chọn theo đ\xfang cờ thinking client gửi l\xean. Request kh\xf4ng khai b\xe1o thinking th\xec gateway tắt thinking v\xe0 d\xf9ng nh\xe1nh dưới. Field kh\xf4ng tick th\xec giữ nguy\xean gi\xe1 trị client gửi. top_k/min_p chỉ gửi tới llama.cpp v\xe0 vLLM."})]})]}),(0,a.jsxs)("div",{className:`rounded-xl border p-3 ${_?"border-primary/20 bg-primary/5":"border-border bg-background/40"}`,children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-xs font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"psychology"}),"Thinking ",(0,a.jsx)("span",{className:"font-normal text-text-muted",children:"(suy luận nội bộ)"})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${p?"border-primary/30 bg-background shadow-sm":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium text-text-main",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${p?"text-primary":"text-text-muted"}`,children:"psychology_alt"}),"Thinking"]}),(0,a.jsx)("select",{value:u,onChange:e=>(e=>{if("inherit"===e)return void w({thinkingMode:void 0});let n="on"===e?h:b;t?.(q({...r,...n,inheritThinkRequestOverrides:{},inheritNoThinkRequestOverrides:{},thinkingMode:e}))})(e.target.value),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary",children:j.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:j.find(e=>e.value===u)?.description||j[0].description})]}),(0,a.jsx)(er,{icon:"account_balance_wallet",label:"reasoning_budget",active:m,className:x?"opacity-60":"",children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:m,disabled:x,onChange:e=>C("reasoning_budget",e.target.checked,g.reasoning_budget),className:"h-3.5 w-3.5 accent-primary disabled:opacity-50"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"262144",step:"1",disabled:x||!m,value:m?r.reasoning_budget:g.reasoning_budget,onChange:e=>w({reasoning_budget:e.target.value}),className:S}),hint:x?"Thinking đang tắt n\xean budget kh\xf4ng được gửi.":"Chỉ d\xf9ng cho llama.cpp/vLLM local; runtime sẽ map đ\xfang field."}})]})]})]})]})}function es({isOpen:e,combo:t,comboStrategy:n={},onClose:s,onSave:c,activeProviders:m,providersLoading:x=!1,kindFilter:h=null}){let[b,f]=(0,r.useState)(t?.name||""),[y,k]=(0,r.useState)([]),[v,j]=(0,r.useState)(!1),[N,_]=(0,r.useState)(!1),[w,C]=(0,r.useState)(""),[T,S]=(0,r.useState)({}),[$,M]=(0,r.useState)(""),[E,P]=(0,r.useState)(""),[I,A]=(0,r.useState)(()=>t?q(n?.requestOverrides||{}):q(g)),[z,B]=(0,r.useState)(()=>O(n?.contentLoggingMode)),F=n||{},H=(0,l.FR)((0,l.MS)(l.AN,{activationConstraint:{distance:5}}),(0,l.MS)(l.uN,{coordinateGetter:i.JR}));(0,r.useEffect)(()=>{e&&(f(t?.name||""),k(function(e,t={}){let n=(e?.models||[]).map(e=>Q(e,!0)).filter(e=>e.value),a=new Set(n.map(e=>e.value));return[...n,...L(t).filter(e=>!a.has(e)).map(e=>Q(e,!1)).filter(e=>e.value)]}(t,F)),C(""),M(""),P(""),A(t?q(F.requestOverrides||{}):q(g)),B(O(F.contentLoggingMode)))},[e,t?.id,t?.name,F.contentLoggingMode]),(0,r.useEffect)(()=>{e&&J()},[e]);let J=async()=>{try{let e=await fetch("/api/models/alias",{cache:"no-store"});if(!e.ok)return;let t=await e.json();S(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}},W=y.map((e,t)=>({uid:`item-${t}-${e.value}`,row:e})),Z=y.map(e=>e.value),Y=y.filter(e=>e.enabled).length,ee=y.filter(e=>!e.enabled).length,et=(m||[]).filter(e=>e?.isActive!==!1),er=et.find(e=>e.id===$)||null,el=er?V(er,T):[],eo=el[0]?.value||(er?U(er):""),ed=e=>e.trim()?p.test(e)?(C(""),!0):(C("Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."),!1):(C("Bắt buộc nhập t\xean"),!1),ec=async()=>{if(!ed(b))return;let{models:e,disabledModels:t}=function(e=[]){let t=[],n=new Set;for(let a of e){let e=R(a?.value||G(a?.target));!e||n.has(e)||(n.add(e),t.push({...a,value:e,enabled:a?.enabled!==!1,target:X(a?.target||a?.value)}))}return{models:t.filter(e=>e.enabled).map(e=>e.target).filter(Boolean),disabledModels:t.filter(e=>!e.enabled).map(e=>e.value)}}(y);_(!0),await c({name:b.trim(),models:e,disabledModels:t,requestOverrides:q(I),contentLoggingMode:z}),_(!1)};if(!e)return null;let em=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/45 p-3 backdrop-blur-[1px] sm:p-4",children:(0,a.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-7xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between border-b border-border px-5 py-4 sm:px-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:em?"Chỉnh sửa combo":"Tạo combo"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Chọn model, tắt tạm thời khi cần v\xe0 sắp xếp thứ tự ưu ti\xean fallback đang bật."})]}),(0,a.jsx)("button",{type:"button",onClick:s,className:"rounded-lg p-1 text-text-muted transition hover:bg-surface hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,a.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto bg-white px-5 py-4 dark:bg-zinc-950 sm:px-6",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-2 block text-sm font-semibold text-text-main",children:"T\xean"}),(0,a.jsx)("input",{value:b,onChange:e=>{let t=e.target.value;f(t),t?ed(t):C("")},placeholder:"premium-coding",className:`w-full rounded-xl border bg-white px-4 py-2.5 text-text-main outline-none transition focus:border-primary dark:bg-zinc-900 ${w?"border-red-400":"border-border"}`}),(0,a.jsx)("span",{className:`mt-1 block text-xs ${w?"text-red-500":"text-text-muted"}`,children:w||"Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."})]}),(0,a.jsx)(ei,{value:I,onChange:A,defaultEnabled:!em}),(0,a.jsx)(ea,{value:z,onChange:B}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Danh s\xe1ch model"}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[Y," đang bật",ee>0?`, ${ee} đ\xe3 tắt`:"",". Model đ\xe3 tắt vẫn nằm trong combo nhưng kh\xf4ng được route."]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>j(!0),className:"inline-flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-primary hover:border-primary/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Th\xeam model"]})]}),(0,a.jsxs)("div",{className:"mb-4 rounded-xl border border-primary/15 bg-primary/5 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"account_tree"}),"Th\xeam target theo provider account"]}),(0,a.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Cố định bước combo n\xe0y v\xe0o một provider account cụ thể. Danh s\xe1ch account chỉ được load khi mở modal để trang combo nhẹ hơn."}),(0,a.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_auto]",children:[(0,a.jsxs)("select",{value:$,onChange:e=>{let t=e.target.value,n=et.find(e=>e.id===t),a=n?V(n,T):[];M(t),P(a[0]?.value||U(n||{})||"")},className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:x?"Đang tải provider account...":"Chọn provider account"}),et.map(e=>{let t=D(e),n=K(e),r=n&&n!==t?`${t} / ${n}`:t;return(0,a.jsx)("option",{value:e.id,children:r},e.id)})]}),(0,a.jsxs)("select",{value:E,onChange:e=>P(e.target.value),disabled:!$||0===el.length,className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",children:[(0,a.jsx)("option",{value:"",children:$?el.length>0?"Chọn model":"Kh\xf4ng t\xecm thấy model của provider":"Chọn account trước"}),el.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},`${e.value}-${e.label}`))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{if(!er)return;let e=function(e,t){let n=D(e),a=function(e={}){let t=R(e.provider),n=D(e);return(0,u.mq)(t)||(0,u.gb)(t)?n||t:t||n}(e),r=K(e),l=R(t||U(e));if(!n||!e?.id||!l)return null;let i=l.includes("/"),s=i?l:`${n}/${l}`,o=i&&l.startsWith(`${n}/`)?l.slice(n.length+1):l,d=r&&r!==a?`${a}/${r}/${o}`:`${a}/${o}`;return{model:s,connectionId:e.id,provider:a||n,accountName:r||void 0,label:d}}(er,E||eo);if(!e)return void alert("H\xe3y chọn provider account v\xe0 model cho target cố định n\xe0y.");let t=Q(e,!0);k(e=>{let n=e.findIndex(e=>e.value===t.value);if(-1!==n){let a=[...e];return a[n]={...a[n],...t,enabled:!0},a}return[...e,t]}),P("")},disabled:!$||!E,className:"inline-flex items-center justify-center gap-1 rounded-lg bg-primary px-3 py-2 text-xs font-semibold text-white disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_link"}),"Th\xeam account"]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"layers"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Chưa th\xeam model n\xe0o"})]}):(0,a.jsx)(l.Mp,{sensors:H,collisionDetection:l.fp,modifiers:[o.FN,o.gj],onDragEnd:e=>{let{active:t,over:n}=e;if(n&&t.id!==n.id){let e=W.findIndex(e=>e.uid===t.id),a=W.findIndex(e=>e.uid===n.id);-1!==e&&-1!==a&&k(t=>(0,i.be)(t,e,a))}},children:(0,a.jsx)(i.gB,{items:W.map(e=>e.uid),strategy:i._G,children:(0,a.jsx)("div",{className:"space-y-3",children:W.map(({uid:e,row:t},n)=>(0,a.jsx)(en,{id:e,index:n,model:t.label||t.value,subtitle:t.subtitle,enabled:t.enabled,isFirst:0===n,isLast:n===y.length-1,onEdit:e=>{let t=e.trim();if(!t)return;let a=[...y],r=a[n];if(r?.target&&"object"==typeof r.target){let e=X({...r.target,model:t});a[n]=Q(e,!1!==r.enabled)}else a[n]=Q(t,r?.enabled!==!1);k(a)},onMoveUp:()=>{if(0===n)return;let e=[...y];[e[n-1],e[n]]=[e[n],e[n-1]],k(e)},onMoveDown:()=>{if(n===y.length-1)return;let e=[...y];[e[n],e[n+1]]=[e[n+1],e[n]],k(e)},onToggleEnabled:()=>{let e=[...y];e[n]={...e[n],enabled:!e[n].enabled},k(e)},onRemove:()=>k(y.filter((e,t)=>t!==n))},e))})})})]})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border bg-white px-5 py-4 dark:bg-zinc-950 sm:px-6",children:[(0,a.jsx)("button",{type:"button",onClick:s,className:"rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",children:"Hủy"}),(0,a.jsx)("button",{type:"button",onClick:ec,disabled:N,className:"rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:N?"Đang lưu...":em?"Lưu":"Tạo"})]})]})}),(0,a.jsx)(d.rq,{isOpen:v,onClose:()=>j(!1),onSelect:e=>{let t=e.value;k(e=>{let n=e.findIndex(e=>e.value===t);if(-1!==n){let t=[...e];return t[n]={...t[n],enabled:!0},t}return[...e,Q(t,!0)]})},onDeselect:e=>{k(t=>t.filter(t=>t.value!==e.value))},activeProviders:m,modelAliases:T,title:"Th\xeam model v\xe0o combo",kindFilter:h,addedModelValues:Z,closeOnSelect:!1})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,7055,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=20061)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{20061:(e,t,n)=>{Promise.resolve().then(n.bind(n,47295))},47295:(e,t,n)=>{"use strict";n.r(t),n.d(t,{default:()=>Y});var a=n(95155),r=n(12115),l=n(44923),i=n(87256),s=n(39768),o=n(5020),d=n(35497),c=n(11059),m=n(28777),u=n(52679);let p=/^[a-zA-Z0-9_.\-]+$/,x=[{value:"global",label:"To\xe0n cục / h\xe0nh vi hiện tại",description:"Giữ h\xe0nh vi hiện tại: mọi request d\xf9ng chung v\xf2ng xoay combo to\xe0n cục."},{value:"client_ip",label:"IP client",description:"Giữ c\xf9ng model khởi đầu cho c\xf9ng IP client cho đến khi hết TTL."},{value:"client_session",label:"IP client + phi\xean chat",description:"Ph\xf9 hợp nhất cho c\xf4ng cụ chat. Giữ c\xf9ng model cho c\xf9ng m\xe1y v\xe0 c\xf9ng phi\xean chat."}],h=[{value:"fallback",label:"Ưu ti\xean fallback",description:"Thử model trong combo theo đ\xfang thứ tự hiển thị, lỗi th\xec fallback."},{value:"round-robin",label:"Round Robin",description:"Lu\xe2n phi\xean model đang bật được thử đầu ti\xean. C\xe1c t\xf9y chọn giữ d\xednh b\xean dưới vẫn được \xe1p dụng."},{value:"least-latency",label:"Độ trễ thấp nhất",description:"Ưu ti\xean target c\xf3 điểm health/độ trễ tốt nhất. Hữu \xedch cho LAN Ollama."},{value:"p2c",label:"P2C",description:"Power of Two Choices: lấy mẫu hai target khỏe rồi chọn target \xedt bận hơn."}],b=[{card:"border-sky-100 bg-sky-50/55 dark:border-sky-400/15 dark:bg-sky-950/10",panel:"border-sky-100/80 bg-white/80 dark:border-sky-400/15 dark:bg-zinc-950/60"},{card:"border-slate-200 bg-slate-50/80 dark:border-slate-500/15 dark:bg-slate-900/35",panel:"border-slate-200/80 bg-white/80 dark:border-slate-500/15 dark:bg-zinc-950/60"},{card:"border-emerald-100 bg-emerald-50/45 dark:border-emerald-400/15 dark:bg-emerald-950/10",panel:"border-emerald-100/80 bg-white/80 dark:border-emerald-400/15 dark:bg-zinc-950/60"},{card:"border-violet-100 bg-violet-50/45 dark:border-violet-400/15 dark:bg-violet-950/10",panel:"border-violet-100/80 bg-white/80 dark:border-violet-400/15 dark:bg-zinc-950/60"}],g=Object.freeze({temperature:.7,top_p:.8,top_k:20,min_p:0,presence_penalty:1.5,max_tokens:4096,reasoning_budget:0,thinkingMode:"off"}),f=Object.freeze({temperature:.6,top_p:.95,top_k:20,min_p:0,presence_penalty:0,max_tokens:4096}),y=Object.freeze({temperature:.7,top_p:.8,top_k:20,min_p:0,presence_penalty:1.5,max_tokens:4096}),k=Object.freeze({think:"inheritThinkRequestOverrides",nothink:"inheritNoThinkRequestOverrides"}),v=[{key:"temperature",label:"temp",min:0,max:2,step:.05},{key:"top_p",label:"top_p",min:.01,max:1,step:.01},{key:"top_k",label:"top_k",min:0,max:1e3,step:1},{key:"min_p",label:"min_p",min:0,max:1,step:.01},{key:"presence_penalty",label:"presence_penalty",min:-2,max:2,step:.05},{key:"max_tokens",label:"max_tokens",min:1,max:262144,step:1}],j=[{value:"inherit",label:"Theo request gốc",description:"Theo cờ thinking client gửi l\xean; client kh\xf4ng khai b\xe1o th\xec gateway tắt thinking."},{value:"off",label:"Tắt thinking",description:"Gửi chat_template_kwargs.enable_thinking = false."},{value:"on",label:"Bật thinking",description:"Gửi chat_template_kwargs.enable_thinking = true."}],N=[{value:"inherit",label:"Theo cấu h\xecnh hệ thống",description:"Sử dụng ch\xednh s\xe1ch lưu Prompt Logs chung của hệ thống."},{value:"enabled",label:"Lưu đầy đủ nội dung",description:"Cho ph\xe9p quản trị vi\xean xem lại to\xe0n bộ prompt v\xe0 phản hồi của c\xe1c request thuộc combo n\xe0y."},{value:"disabled",label:"Chỉ lưu thống k\xea",description:"Kh\xf4ng lưu nội dung hội thoại. Chỉ lưu metadata, model, provider, token, thời gian xử l\xfd v\xe0 c\xe1c thống k\xea vận h\xe0nh."}];function _(e){return e&&"object"==typeof e&&!Array.isArray(e)}function w(e,t){return Object.prototype.hasOwnProperty.call(e||{},t)}function C(e,{min:t,max:n,precision:a=3}={}){if(null==e||""===e)return;let r=Number(e);if(Number.isFinite(r))return Number(Math.min(n,Math.max(t,r)).toFixed(a))}function T(e,{min:t,max:n}={}){let a=C(e,{min:t,max:n,precision:0});return void 0===a?void 0:Math.trunc(a)}function O(e){let t=R(e).toLowerCase();return"enabled"===t||"disabled"===t?t:"inherit"}let S=["temperature","top_p","top_k","min_p","presence_penalty","max_tokens"];function $(e={}){let t=_(e)?e:{},n={};if(w(t,"temperature")){let e=C(t.temperature,{min:0,max:2});void 0!==e&&(n.temperature=e)}if(w(t,"top_p")||w(t,"topP")){let e=C(t.top_p??t.topP,{min:.01,max:1});void 0!==e&&(n.top_p=e)}if(w(t,"top_k")||w(t,"topK")){let e=T(t.top_k??t.topK,{min:0,max:1e3});void 0!==e&&(n.top_k=e)}if(w(t,"min_p")||w(t,"minP")){let e=C(t.min_p??t.minP,{min:0,max:1});void 0!==e&&(n.min_p=e)}let a=t.presence_penalty??t.presencePenalty??t["presence-penalty"];if(w(t,"presence_penalty")||w(t,"presencePenalty")||w(t,"presence-penalty")){let e=C(a,{min:-2,max:2});void 0!==e&&(n.presence_penalty=e)}let r=t.max_tokens??t.maxTokens??t.max_token;if(w(t,"max_tokens")||w(t,"maxTokens")||w(t,"max_token")){let e=T(r,{min:1,max:262144});void 0!==e&&(n.max_tokens=e)}return n}function q(e={}){let t=_(e)?e:{},n={};if(w(t,"temperature")){let e=C(t.temperature,{min:0,max:2});void 0!==e&&(n.temperature=e)}if(w(t,"top_p")){let e=C(t.top_p,{min:.01,max:1});void 0!==e&&(n.top_p=e)}if(w(t,"top_k")||w(t,"topK")){let e=T(t.top_k??t.topK,{min:0,max:1e3});void 0!==e&&(n.top_k=e)}if(w(t,"min_p")||w(t,"minP")){let e=C(t.min_p??t.minP,{min:0,max:1});void 0!==e&&(n.min_p=e)}let a=t.presence_penalty??t.presencePenalty??t["presence-penalty"];if(w(t,"presence_penalty")||w(t,"presencePenalty")||w(t,"presence-penalty")){let e=C(a,{min:-2,max:2});void 0!==e&&(n.presence_penalty=e)}let r=t.max_tokens??t.maxTokens??t.max_token;if(w(t,"max_tokens")||w(t,"maxTokens")||w(t,"max_token")){let e=T(r,{min:1,max:262144});void 0!==e&&(n.max_tokens=e)}let l=t.reasoning_budget??t.reasoningBudget??t["reasoning-budget"];if(w(t,"reasoning_budget")||w(t,"reasoningBudget")||w(t,"reasoning-budget")){let e=T(l,{min:0,max:262144});void 0!==e&&(n.reasoning_budget=e)}let i=t.inheritThinkRequestOverrides??t.thinkRequestOverrides??t.thinkingOnRequestOverrides;if(w(t,"inheritThinkRequestOverrides")||w(t,"thinkRequestOverrides")||w(t,"thinkingOnRequestOverrides")){let e=$(i);Object.keys(e).length>0&&(n.inheritThinkRequestOverrides=e)}let s=t.inheritNoThinkRequestOverrides??t.noThinkRequestOverrides??t.thinkingOffRequestOverrides;if(w(t,"inheritNoThinkRequestOverrides")||w(t,"noThinkRequestOverrides")||w(t,"thinkingOffRequestOverrides")){let e=$(s);Object.keys(e).length>0&&(n.inheritNoThinkRequestOverrides=e)}let o=function(e){if(!0===e)return"on";if(!1===e)return"off";let t=R(e).toLowerCase();return["on","true","1","enable","enabled"].includes(t)?"on":["off","false","0","disable","disabled"].includes(t)?"off":void 0}(t.thinkingMode??t.thinking);if(o&&(n.thinkingMode=o),"off"===n.thinkingMode&&delete n.reasoning_budget,!n.thinkingMode){let e=$(n);if(Object.keys(e).length>0)for(let t of(n.inheritThinkRequestOverrides={...e,...n.inheritThinkRequestOverrides||{}},n.inheritNoThinkRequestOverrides={...e,...n.inheritNoThinkRequestOverrides||{}},S))delete n[t]}return n}function M(e={}){let t=$(e||{}),n=[];return void 0!==t.temperature&&n.push(`temp ${t.temperature}`),void 0!==t.top_p&&n.push(`top_p ${t.top_p}`),void 0!==t.top_k&&n.push(`top_k ${t.top_k}`),void 0!==t.min_p&&n.push(`min_p ${t.min_p}`),void 0!==t.presence_penalty&&n.push(`presence ${t.presence_penalty}`),void 0!==t.max_tokens&&n.push(`max ${t.max_tokens}`),n}function R(e){return String(e||"").trim()}function L(e={}){return Array.isArray(e.disabledModels)?[...new Set(e.disabledModels.map(e=>R(e)).filter(Boolean))]:[]}function E(e={}){let t=e.fallbackStrategy||"fallback";return{...e,fallbackStrategy:t,stickyScope:e.stickyScope||"global",stickyTtlMinutes:Number(e.stickyTtlMinutes||120),stickyFallbackToClientIp:!1!==e.stickyFallbackToClientIp,lanHealthEnabled:!1!==e.lanHealthEnabled,healthCheckPath:e.healthCheckPath||"/api/tags",healthCheckIntervalMs:Number(e.healthCheckIntervalMs||15e3),requiredTags:Array.isArray(e.requiredTags)?e.requiredTags:[],modelTagRules:e.modelTagRules||e.modelTags||e.tagRules||{},disabledModels:L(e),requestOverrides:q(e.requestOverrides||{}),contentLoggingMode:O(e.contentLoggingMode)}}function P(e={}){let t={...e};t.disabledModels=L(e),"fallback"===(t.fallbackStrategy||"fallback")&&delete t.fallbackStrategy,t.disabledModels.length||delete t.disabledModels;let n=O(t.contentLoggingMode);"inherit"===n?delete t.contentLoggingMode:t.contentLoggingMode=n,t.requiredTags?.length||delete t.requiredTags;let a=q(t.requestOverrides||{});return Object.keys(a).length?t.requestOverrides=a:delete t.requestOverrides,t.modelTagRules&&0!==Object.keys(t.modelTagRules).length||delete t.modelTagRules,"/api/tags"===t.healthCheckPath&&delete t.healthCheckPath,15e3===Number(t.healthCheckIntervalMs)&&delete t.healthCheckIntervalMs,!0===t.lanHealthEnabled&&delete t.lanHealthEnabled,Object.keys(t).length?t:null}function I(e){return Array.isArray(e)?`[${e.map(I).join(",")}]`:e&&"object"==typeof e?`{${Object.keys(e).sort().map(t=>`${JSON.stringify(t)}:${I(e[t])}`).join(",")}}`:JSON.stringify(void 0===e?null:e)}function A(e=[]){return Array.isArray(e)?e.join(", "):String(e||"")}function z(e=""){return String(e||"").split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean)}function B(e={}){return e&&"object"==typeof e?Object.entries(e).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(", "):String(t||"")}`).join("\n"):""}function F(e){return"string"==typeof e?e:e&&"object"==typeof e&&(e.value||e.model||e.id)||""}function D(e={}){let t=R(e.provider);return R(e.providerSpecificData?.prefix)||R(e.prefix)||R((0,u.wG)(t))||t}function K(e={}){return R(e.email)||R(e.accountName)||R(e.displayName)||R(e.name)||R(e.providerSpecificData?.nodeName)||R(e.id)}function H(e){return e&&"object"==typeof e?R(e.connectionId||e.connection_id):""}function G(e){let t=F(e),n=H(e);return t?n?`${t}@@${n}`:t:""}function J(e){return"string"==typeof e?e:e&&"object"==typeof e?R(e.label)||R(e.displayName)||R(e.name)||F(e):""}function X(e){if(!e||"object"!=typeof e)return F(e);let t=F(e);return t?Object.fromEntries(Object.entries({model:t,connectionId:H(e)||void 0,label:J(e)||void 0,provider:R(e.provider)||void 0,accountName:R(e.accountName||e.account_name)||void 0,weight:Number(e.weight||0)>0?Number(e.weight):void 0}).filter(([,e])=>void 0!==e&&""!==e)):""}function Q(e,t=!0){let n=X(e),a=G(n);return{value:a,enabled:t,target:n,label:J(n)||a,subtitle:function(e){if(!e||"object"!=typeof e)return"";let t=H(e),n=F(e);return t?`T\xe0i khoản cố định • ${t}${n?` • ${n}`:""}`:""}(n)}}function U(e={}){return R(e.defaultModel)||R(e.providerSpecificData?.defaultModel)||R(e.model)||""}function W(e,t,n,a=""){let r=R(n);!r||t.has(r)||(t.add(r),e.push({value:r,label:R(a)||r}))}function V(e={},t={}){let n=[],a=new Set,r=R(e.provider),l=[...new Set([D(e),R((0,u.wG)(r)),r].filter(Boolean))];for(let e of(0,m.KC)(r)||[])e?.type&&"llm"!==e.type||W(n,a,e.id,e.name||e.id);for(let[e,r]of Object.entries(t||{})){let t=R(r),i=l.find(e=>e&&t.startsWith(`${e}/`));if(!i)continue;let s=t.slice(i.length+1);W(n,a,s,e||s)}return W(n,a,U(e),"Model mặc định"),n}function Z(e={},{disabledModels:t=[],requestOverrides:n,contentLoggingMode:a}={}){let r={...e},l=[...new Set((t||[]).map(e=>R(e)).filter(Boolean))];if(l.length>0?r.disabledModels=l:delete r.disabledModels,void 0!==n){let e=q(n||{});Object.keys(e).length?r.requestOverrides=e:delete r.requestOverrides}if(void 0!==a){let e=O(a);"inherit"===e?delete r.contentLoggingMode:r.contentLoggingMode=e}return P(r)}function Y(){let[e,t]=(0,r.useState)([]),[n,l]=(0,r.useState)(!0),[i,s]=(0,r.useState)(!1),[o,m]=(0,r.useState)(null),[u,p]=(0,r.useState)([]),[x,h]=(0,r.useState)(!1),[b,g]=(0,r.useState)(!1),[f,y]=(0,r.useState)({}),[k,v]=(0,r.useState)(""),[j,N]=(0,r.useState)(null),{copied:_,copy:w}=(0,c.C)();(0,r.useEffect)(()=>{C()},[]),(0,r.useEffect)(()=>{if(0===e.length){k&&v("");return}let t=e.some(e=>e.name===k);k&&t||v(e[0].name)},[e,k]);let C=async()=>{try{let e=await fetch("/api/dashboard/combos",{cache:"no-store"}),n=await e.json();e.ok&&(t(n.combos||[]),y(n.comboStrategies||{}))}catch(e){console.log("Error fetching combo data:",e)}finally{l(!1)}},T=async()=>{if(!x&&!b){g(!0);try{let e=await fetch("/api/providers",{cache:"no-store"}),t=await e.json();e.ok&&(p(t.connections||[]),h(!0))}catch(e){console.log("Error loading provider accounts:",e)}finally{g(!1)}}},O=async()=>{s(!0),T()},S=async e=>{m(e),T()},$=async e=>{let t=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:e})});if(!t.ok)throw Error(`Save combo strategies failed: ${t.status}`);y(e)},q=async e=>{let{disabledModels:t=[],requestOverrides:n,contentLoggingMode:a,...r}=e;try{let e=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(e.ok){let e=Z({},{disabledModels:t,requestOverrides:n,contentLoggingMode:a});e&&await $({...f,[r.name]:e}),await C(),v(r.name),s(!1)}else{let t=await e.json();alert(t.error||"Tạo combo thất bại")}}catch(e){console.log("Error creating combo:",e)}},M=async(e,t)=>{let{disabledModels:n=[],requestOverrides:a,contentLoggingMode:r,...l}=t,i=o?.name;try{let t=await fetch(`/api/combos/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(l)});if(t.ok){let e={...f};i&&i!==l.name&&e[i]&&(e[l.name]=e[i],delete e[i]);let t=Z(e[l.name]||{},{disabledModels:n,requestOverrides:a,contentLoggingMode:r});t?e[l.name]=t:delete e[l.name],await $(e),await C(),v(l.name),m(null)}else{let e=await t.json();alert(e.error||"Cập nhật combo thất bại")}}catch(e){console.log("Error updating combo:",e)}},R=async n=>{let a=e.find(e=>e.id===n);N({title:"X\xf3a combo",message:"Bạn c\xf3 chắc muốn x\xf3a combo n\xe0y?",onConfirm:async()=>{N(null);try{if((await fetch(`/api/combos/${n}`,{method:"DELETE"})).ok){if(a?.name&&f[a.name]){let e={...f};delete e[a.name],await $(e)}t(e=>{let t=e.filter(e=>e.id!==n);return a?.name===k&&v(t[0]?.name||""),t})}}catch(e){console.log("Error deleting combo:",e)}}})},L=async(e,t)=>{try{let n={...f},a=P({...E(n[e]),...t});return a?n[e]=a:delete n[e],await $(n),!0}catch(e){return console.log("Error updating combo routing settings:",e),!1}},I=e.find(e=>e.name===k)||e[0]||null,A=I?Math.max(0,e.findIndex(e=>e.id===I.id)):0;return n?(0,a.jsx)("div",{className:"grid gap-4",children:[1,2,3].map(e=>(0,a.jsx)("div",{className:"h-36 animate-pulse rounded-2xl border border-border bg-surface"},e))}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Combo model"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model với fallback, round-robin, độ trễ thấp nhất, P2C v\xe0 routing theo trạng th\xe1i health của LAN Ollama."})]}),(0,a.jsxs)("button",{type:"button",onClick:O,className:"inline-flex items-center justify-center gap-2 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Tạo combo"]})]}),0===e.length?(0,a.jsxs)("div",{className:"rounded-2xl border border-dashed border-border bg-surface p-12 text-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"layers"}),(0,a.jsx)("h2",{className:"mt-3 text-lg font-semibold text-text-main",children:"Chưa c\xf3 combo n\xe0o"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Tạo combo model c\xf3 hỗ trợ fallback."}),(0,a.jsx)("button",{type:"button",onClick:O,className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:"Tạo combo"})]}):(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)("div",{className:"rounded-2xl border border-border bg-surface/80 p-4 shadow-sm dark:bg-zinc-950/70",children:(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[(0,a.jsxs)("label",{className:"block min-w-0 flex-1",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-semibold uppercase tracking-wide text-text-muted",children:"Combo đang xem"}),(0,a.jsx)("select",{value:I?.name||"",onChange:e=>v(e.target.value),className:"w-full rounded-xl border border-border bg-white px-4 py-2.5 text-sm font-semibold text-text-main outline-none transition focus:border-primary dark:bg-zinc-900",children:e.map(e=>(0,a.jsxs)("option",{value:e.name,children:[e.name," • ",(e.models||[]).length," model"]},e.id))})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[(0,a.jsxs)("span",{className:"rounded-full bg-background px-3 py-1 dark:bg-zinc-900",children:["Tổng ",e.length," combo"]}),I?(0,a.jsxs)("span",{className:"rounded-full bg-primary/10 px-3 py-1 font-medium text-primary",children:["Đang hiển thị: ",I.name]}):null]})]})}),I?(0,a.jsx)(ee,{combo:I,comboIndex:A,copied:_,onCopy:w,onEdit:()=>S(I),onDelete:()=>R(I.id),comboStrategy:f[I.name]||{},onUpdateComboStrategy:e=>L(I.name,e)},I.id):null]}),(0,a.jsx)(es,{isOpen:i,comboStrategy:{},onClose:()=>s(!1),onSave:q,activeProviders:u,providersLoading:b}),(0,a.jsx)(es,{isOpen:!!o,combo:o,comboStrategy:f[o?.name]||{},onClose:()=>m(null),onSave:e=>M(o.id,e),activeProviders:u,providersLoading:b}),(0,a.jsx)(d.uo,{isOpen:!!j,onClose:()=>N(null),onConfirm:j?.onConfirm,title:j?.title||"X\xe1c nhận",message:j?.message,variant:"danger"})]})}function ee({combo:e,comboIndex:t=0,copied:n,onCopy:l,onEdit:i,onDelete:s,comboStrategy:o={},onUpdateComboStrategy:d}){let[c,m]=(0,r.useState)({}),[u,p]=(0,r.useState)(!1),[g,f]=(0,r.useState)(""),y=E(o||{}),k=E({...o||{},...c}),v=!function(e={},t={}){return I(P(e)||{})===I(P(t)||{})}(k,y),j=k.fallbackStrategy||"fallback",N=h.find(e=>e.value===j)||h[0],_=k.stickyScope||"global",w=x.find(e=>e.value===_)||x[0],C=L(o),T=b[t%b.length],[O,S]=(0,r.useState)(A(k.requiredTags)),[$,R]=(0,r.useState)(B(k.modelTagRules)),F=e=>{f(""),m(t=>({...t,...e}))},D=async()=>{if(!v||u)return;p(!0);let e=await d(c);(p(!1),!1===e)?f("Lưu thất bại, thử lại."):m({})};return(0,r.useEffect)(()=>{m({}),f("")},[e.name]),(0,r.useEffect)(()=>{S(A(k.requiredTags)),R(B(k.modelTagRules))},[e.name,JSON.stringify(k.requiredTags||[]),JSON.stringify(k.modelTagRules||{})]),(0,a.jsxs)("div",{className:`rounded-2xl border p-5 shadow-sm transition-colors ${T.card}`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"}),(0,a.jsx)("h3",{className:"truncate text-lg font-semibold text-text-main",children:e.name})]}),(0,a.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[(e.models||[]).length," model đang bật",C.length>0?` • ${C.length} đ\xe3 tắt`:""]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-1",children:[(0,a.jsx)(et,{icon:n===`combo-${e.id}`?"check":"content_copy",title:"Copy t\xean combo",onClick:()=>l(e.name,`combo-${e.id}`)}),(0,a.jsx)(et,{icon:"edit",title:"Chỉnh sửa",onClick:i}),(0,a.jsx)(et,{icon:"delete",title:"X\xf3a",onClick:s,danger:!0})]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-wrap gap-2",children:[0===(e.models||[]).length?(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:"Chưa c\xf3 model đang bật"}):(e.models||[]).slice(0,5).map((e,t)=>(0,a.jsx)("span",{className:"rounded-lg bg-background px-2 py-1 font-mono text-xs text-text-main",children:J(e)},`${G(e)}-${t}`)),(e.models||[]).length>5&&(0,a.jsxs)("span",{className:"rounded-lg bg-background px-2 py-1 text-xs text-text-muted",children:["+",e.models.length-5," model nữa"]}),C.length>0&&(0,a.jsxs)("span",{className:"rounded-lg bg-red-500/10 px-2 py-1 text-xs text-red-500",children:[C.length," đ\xe3 tắt"]}),(function(e={}){let t=q(e),n=[];if(void 0!==t.temperature&&n.push(`temp ${t.temperature}`),void 0!==t.top_p&&n.push(`top_p ${t.top_p}`),void 0!==t.top_k&&n.push(`top_k ${t.top_k}`),void 0!==t.min_p&&n.push(`min_p ${t.min_p}`),void 0!==t.presence_penalty&&n.push(`presence ${t.presence_penalty}`),void 0!==t.max_tokens&&n.push(`max ${t.max_tokens}`),void 0!==t.reasoning_budget&&n.push(`reasoning ${t.reasoning_budget}`),"off"===t.thinkingMode&&n.push("thinking off"),"on"===t.thinkingMode&&n.push("thinking on"),!t.thinkingMode){let e=M(t.inheritThinkRequestOverrides),a=M(t.inheritNoThinkRequestOverrides);e.length&&n.push(`think: ${e.join(", ")}`),a.length&&n.push(`nothink: ${a.join(", ")}`)}return n})(y.requestOverrides).map(e=>(0,a.jsx)("span",{className:"rounded-lg bg-primary/10 px-2 py-1 text-xs font-medium text-primary",children:e},e)),"inherit"!==y.contentLoggingMode?(0,a.jsxs)("span",{className:`rounded-lg px-2 py-1 text-xs font-medium ${"disabled"===y.contentLoggingMode?"bg-amber-500/10 text-amber-600":"bg-emerald-500/10 text-emerald-600"}`,children:["prompt logs ",y.contentLoggingMode]}):null]}),(0,a.jsxs)("div",{className:`mt-5 rounded-xl border p-4 ${T.panel}`,children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 md:flex-row md:items-center md:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h4",{className:"font-semibold text-text-main",children:"Chiến lược routing"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:N.description})]}),(0,a.jsx)("select",{value:j,onChange:e=>F({fallbackStrategy:e.target.value}),className:"rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:h.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]}),(0,a.jsx)(ei,{value:k.requestOverrides||{},onChange:e=>F({requestOverrides:e}),compact:!0}),(0,a.jsx)(ea,{value:k.contentLoggingMode,onChange:e=>F({contentLoggingMode:e}),compact:!0}),("least-latency"===j||"p2c"===j)&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("label",{className:"flex items-start gap-2 text-sm text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==k.lanHealthEnabled,onChange:e=>F({lanHealthEnabled:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"font-medium text-text-main",children:"Routing theo trạng th\xe1i health LAN"}),(0,a.jsx)("span",{className:"mt-1 block text-xs",children:"D\xf9ng dữ liệu health v\xe0 circuit breaker khi xếp hạng target trong combo."})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Đường dẫn health"}),(0,a.jsx)("input",{value:k.healthCheckPath||"/api/tags",onChange:e=>F({healthCheckPath:e.target.value||"/api/tags"}),placeholder:"/api/tags",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chu kỳ kiểm tra (ms)"}),(0,a.jsx)("input",{type:"number",min:"1000",value:k.healthCheckIntervalMs||15e3,onChange:e=>F({healthCheckIntervalMs:Number(e.target.value)||15e3}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("div",{className:"mt-3 grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Tag endpoint bắt buộc"}),(0,a.jsx)("input",{value:O,onChange:e=>S(e.target.value),onBlur:()=>F({requiredTags:z(O)}),onKeyDown:e=>"Enter"===e.key&&e.currentTarget.blur(),placeholder:"gpu, vram:8gb",className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Mọi endpoint được route đều phải c\xf3 c\xe1c tag n\xe0y."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Quy tắc tag theo model"}),(0,a.jsx)("textarea",{value:$,onChange:e=>R(e.target.value),onBlur:()=>F({modelTagRules:function(e=""){let t={};for(let n of String(e||"").split(/\n+/)){let e=n.trim();if(!e)continue;let a=e.indexOf(":");if(-1===a)continue;let r=e.slice(0,a).trim(),l=z(e.slice(a+1));r&&l.length&&(t[r]=l)}return t}($)}),placeholder:"qwen3:32b: gpu, vram:16gb\nqwen3:8b: model_support:qwen3:8b",rows:3,className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 font-mono text-xs text-text-main outline-none focus:border-primary"})]})]})]}),"round-robin"===j&&(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-surface p-3",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"sticky_note_2"}),"Round Robin giữ d\xednh"]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:"round-robin"===j,onChange:e=>F({fallbackStrategy:e.target.checked?"round-robin":"fallback"}),className:"h-3.5 w-3.5 accent-primary"}),"Bật"]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"Chế độ giữ d\xednh"}),(0,a.jsx)("select",{value:_,onChange:e=>F({stickyScope:e.target.value}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary",children:x.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:w.description})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-xs font-medium text-text-muted",children:"TTL giữ d\xednh (ph\xfat)"}),(0,a.jsx)("input",{type:"number",min:"1",value:k.stickyTtlMinutes||120,onChange:e=>F({stickyTtlMinutes:Number(e.target.value)||120}),className:"w-full rounded-lg border border-border bg-background px-2 py-1.5 text-xs text-text-main outline-none focus:border-primary"})]})]}),(0,a.jsxs)("label",{className:"mt-3 flex items-start gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==k.stickyFallbackToClientIp,onChange:e=>F({stickyFallbackToClientIp:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),"Nếu thiếu chat session id, fallback về IP client thay v\xec xoay to\xe0n cục."]})]}),(0,a.jsxs)("div",{className:"mt-4 flex flex-col gap-2 border-t border-border pt-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("span",{className:`text-xs ${g?"text-red-500":v?"text-amber-600":"text-text-muted"}`,children:g||(v?"C\xf3 thay đổi chưa lưu — chỉ \xe1p dụng sau khi bấm Lưu.":"Đang \xe1p dụng cho request mới.")}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>{f(""),m({})},disabled:!v||u,className:"rounded-lg border border-border px-3 py-1.5 text-sm font-medium text-text-muted transition hover:text-text-main disabled:opacity-40",children:"Ho\xe0n t\xe1c"}),(0,a.jsxs)("button",{type:"button",onClick:D,disabled:!v||u,className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-4 py-1.5 text-sm font-medium text-white transition hover:opacity-90 disabled:opacity-40",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"save"}),u?"Đang lưu…":"Lưu thay đổi"]})]})]})]})]})}function et({icon:e,title:t,onClick:n,danger:r=!1}){return(0,a.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),n?.()},className:`rounded-lg p-2 transition ${r?"text-red-500 hover:bg-red-500/10":"text-text-muted hover:bg-background hover:text-primary"}`,title:t,"aria-label":t,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:e})})}function en({id:e,index:t,model:n,subtitle:l="",enabled:o,isFirst:d,isLast:c,onEdit:m,onMoveUp:u,onMoveDown:p,onRemove:x,onToggleEnabled:h}){let{attributes:b,listeners:g,setNodeRef:f,transform:y,isDragging:k}=(0,i.gl)({id:e}),v={transform:s.Ks.Transform.toString(y),opacity:k?.4:1,zIndex:k?999:void 0},[j,N]=(0,r.useState)(!1),[_,w]=(0,r.useState)(n);(0,r.useEffect)(()=>{w(n)},[n]);let C=()=>{let e=_.trim();e&&e!==n?m(e):w(n),N(!1)};return(0,a.jsxs)("div",{ref:f,style:v,className:`flex items-center gap-3 rounded-xl border p-3 transition ${o?"border-border bg-background":"border-red-200 bg-red-50/70 opacity-75 dark:border-red-500/30 dark:bg-red-500/10"}`,children:[(0,a.jsx)("button",{type:"button",className:"cursor-grab text-text-muted active:cursor-grabbing",...b,...g,title:"K\xe9o để sắp xếp lại",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"drag_indicator"})}),(0,a.jsx)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${o?"bg-primary/10 text-primary":"bg-red-100 text-red-600 dark:bg-red-500/20 dark:text-red-300"}`,children:t+1}),j?(0,a.jsx)("input",{autoFocus:!0,value:_,onChange:e=>w(e.target.value),onBlur:C,onKeyDown:e=>{"Enter"===e.key&&C(),"Escape"===e.key&&(w(n),N(!1))},className:"min-w-0 flex-1 rounded border border-primary/40 bg-background px-2 py-1 font-mono text-xs text-text-main outline-none"}):(0,a.jsxs)("button",{type:"button",onClick:()=>N(!0),className:"min-w-0 flex-1 text-left",title:"Bấm để sửa model",children:[(0,a.jsx)("span",{className:`block truncate font-mono text-xs ${o?"text-text-main":"text-text-muted line-through"}`,children:n}),l?(0,a.jsx)("span",{className:"mt-0.5 block truncate text-[11px] text-text-muted",children:l}):null]}),(0,a.jsx)("button",{type:"button",onClick:h,className:`rounded-lg p-1.5 transition ${o?"text-green-600 hover:bg-green-500/10":"text-red-500 hover:bg-red-500/10"}`,title:o?"Tắt model trong combo":"Bật model trong combo",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:o?"toggle_on":"toggle_off"})}),(0,a.jsx)("button",{type:"button",onClick:u,disabled:d,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển l\xean",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_upward"})}),(0,a.jsx)("button",{type:"button",onClick:p,disabled:c,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Di chuyển xuống",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_downward"})}),(0,a.jsx)("button",{type:"button",onClick:x,className:"rounded-lg p-1.5 text-red-500 transition hover:bg-red-500/10",title:"X\xf3a",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function ea({value:e="inherit",onChange:t,compact:n=!1}){let r=O(e),l=N.find(e=>e.value===r)||N[0];return(0,a.jsx)("div",{className:n?"mt-4 rounded-xl border border-amber-500/15 bg-surface p-3":"rounded-xl border border-amber-500/15 bg-amber-500/5 p-4",children:(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-[minmax(0,1fr)_280px] md:items-center",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-amber-500",children:"manage_search"}),"Prompt Logs cho combo n\xe0y"]}),(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:l.description}),"disabled"===r?(0,a.jsx)("p",{className:"mt-1 text-[11px] font-medium text-amber-600",children:"Khi chạy request, Prompt Logs sẽ chỉ ghi metadata v\xe0 hiển thị [promptlogs disabled on this combo]."}):null]}),(0,a.jsx)("select",{value:r,onChange:e=>t?.(O(e.target.value)),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:N.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))})]})})}function er({icon:e,label:t,children:n,active:r,muted:l=!1,className:i=""}){return(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${r?"border-primary/30 bg-background shadow-sm":"border-border bg-background/60"} ${i}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center justify-between gap-2 text-xs font-medium text-text-main",children:[(0,a.jsxs)("span",{className:"flex min-w-0 items-center gap-1.5",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${r?"text-primary":"text-text-muted"}`,children:e}),(0,a.jsx)("span",{className:"truncate",children:t})]}),n?.toggle]}),n?.control,n?.hint?(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:n.hint}):null]})}function el({icon:e,title:t,values:n={},defaults:r={},onToggleField:l,onChangeField:i,inputClass:s}){let o=Object.keys(n||{}).length>0;return(0,a.jsxs)("div",{className:`rounded-lg border p-2 transition ${o?"border-primary/30 bg-background":"border-border bg-background/60"}`,children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-1.5 text-[11px] font-semibold text-text-main",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[15px] ${o?"text-primary":"text-text-muted"}`,children:e}),(0,a.jsx)("span",{className:"truncate",children:t})]}),(0,a.jsx)("div",{className:"grid gap-2 sm:grid-cols-2 xl:grid-cols-3",children:v.map(e=>{let t=n?.[e.key]!==void 0;return(0,a.jsxs)("label",{className:"space-y-1",children:[(0,a.jsxs)("span",{className:"flex items-center justify-between gap-1 text-[11px] font-medium text-text-main",children:[(0,a.jsx)("span",{className:"truncate",children:e.label}),(0,a.jsx)("input",{type:"checkbox",checked:t,onChange:t=>l?.(e.key,t.target.checked,r[e.key]),className:"h-3.5 w-3.5 accent-primary"})]}),(0,a.jsx)("input",{type:"number",min:e.min,max:e.max,step:e.step,disabled:!t,value:t?n[e.key]:r[e.key],onChange:t=>i?.(e.key,t.target.value),className:s})]},e.key)})})]})}function ei({value:e={},onChange:t,compact:n=!1}){let r=q(e),l=void 0!==r.temperature,i=void 0!==r.top_p,s=void 0!==r.top_k,o=void 0!==r.min_p,d=void 0!==r.presence_penalty,c=void 0!==r.max_tokens,m=void 0!==r.reasoning_budget,u=r.thinkingMode||"inherit",p="inherit"!==u,x="off"===u,h=r.inheritThinkRequestOverrides||{},b=r.inheritNoThinkRequestOverrides||{},v=Object.keys(h).length>0||Object.keys(b).length>0,N=l||i||s||o||d||c||!p&&v,_=p||m,w=e=>{t?.(q({...r,...e}))},C=(e,n,a)=>{if(!n){let n={...r};delete n[e],t?.(q(n));return}w({[e]:a})},T=(e,t,n,a)=>{let l=k[e],i={...r[l]||{}};if(!n){delete i[t],w({[l]:i});return}i[t]=a,w({[l]:$(i)})},O=(e,t,n)=>{let a=k[e];w({[a]:$({...r[a]||{},[t]:n})})},S="w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50";return(0,a.jsxs)("div",{className:n?"mt-4 rounded-xl border border-sky-500/15 bg-surface p-3":"rounded-xl border border-sky-500/15 bg-sky-500/5 p-4",children:[(0,a.jsxs)("div",{className:"mb-3 flex flex-col gap-2 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm font-semibold text-text-main",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-sky-500",children:"tune"}),"Tham số request Local endpoint"]}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Chỉ inject khi combo route 100% tới local endpoint: ",(0,a.jsx)("span",{className:"font-mono",children:"llama.cpp"}),", ",(0,a.jsx)("span",{className:"font-mono",children:"vLLM"})," hoặc ",(0,a.jsx)("span",{className:"font-mono",children:"Ollama"}),". Nếu combo mix local + cloud/provider kh\xe1c, BlueRouter bỏ qua block n\xe0y v\xe0 giữ nguy\xean request gốc."]})]}),!function(e={}){return Object.keys(q(e)).length>0}(r)?(0,a.jsx)("span",{className:"inline-flex shrink-0 items-center rounded-full bg-background px-2 py-1 text-[11px] font-semibold text-text-muted",children:"Kh\xf4ng override"}):(0,a.jsx)("span",{className:"inline-flex shrink-0 items-center rounded-full bg-primary/10 px-2 py-1 text-[11px] font-semibold text-primary",children:"C\xf3 override"})]}),(0,a.jsxs)("div",{className:"grid gap-3 xl:grid-cols-2",children:[(0,a.jsxs)("div",{className:`rounded-xl border p-3 ${N?"border-primary/20 bg-primary/5":"border-border bg-background/40"}`,children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-xs font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"graphic_eq"}),"Sampling ",(0,a.jsx)("span",{className:"font-normal text-text-muted",children:"(điều khiển lựa chọn token)"})]}),p?(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2 2xl:grid-cols-3",children:[(0,a.jsx)(er,{icon:"thermostat",label:"Temperature",active:l,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:l,onChange:e=>C("temperature",e.target.checked,g.temperature),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"2",step:"0.05",disabled:!l,value:l?r.temperature:g.temperature,onChange:e=>w({temperature:e.target.value}),className:S}),hint:"0 = ổn định, 2 = s\xe1ng tạo."}}),(0,a.jsx)(er,{icon:"filter_alt",label:"top_p",active:i,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:i,onChange:e=>C("top_p",e.target.checked,g.top_p),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0.01",max:"1",step:"0.01",disabled:!i,value:i?r.top_p:g.top_p,onChange:e=>w({top_p:e.target.value}),className:S}),hint:"0.01–1.0; 0.9–0.95 thường hợp coder/chat."}}),(0,a.jsx)(er,{icon:"filter_list",label:"top_k",active:s,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:s,onChange:e=>C("top_k",e.target.checked,g.top_k),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"1000",step:"1",disabled:!s,value:s?r.top_k:g.top_k,onChange:e=>w({top_k:e.target.value}),className:S}),hint:"Qwen3 khuyến nghị 20. Chỉ gửi tới llama.cpp/vLLM."}}),(0,a.jsx)(er,{icon:"vertical_align_bottom",label:"min_p",active:o,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:o,onChange:e=>C("min_p",e.target.checked,g.min_p),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"1",step:"0.01",disabled:!o,value:o?r.min_p:g.min_p,onChange:e=>w({min_p:e.target.value}),className:S}),hint:"Qwen3 khuyến nghị 0. Chỉ gửi tới llama.cpp/vLLM."}}),(0,a.jsx)(er,{icon:"repeat",label:"presence_penalty",active:d,children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:d,onChange:e=>C("presence_penalty",e.target.checked,g.presence_penalty),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"-2",max:"2",step:"0.05",disabled:!d,value:d?r.presence_penalty:g.presence_penalty,onChange:e=>w({presence_penalty:e.target.value}),className:S}),hint:"-2–2; coder thường để 0, chỉ tăng nhẹ nếu hay lặp."}}),(0,a.jsx)(er,{icon:"output",label:"max_tokens",active:c,className:"sm:col-span-2 2xl:col-span-1",children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:c,onChange:e=>C("max_tokens",e.target.checked,g.max_tokens),className:"h-3.5 w-3.5 accent-primary"}),control:(0,a.jsx)("input",{type:"number",min:"1",max:"262144",step:"1",disabled:!c,value:c?r.max_tokens:g.max_tokens,onChange:e=>w({max_tokens:e.target.value}),className:S}),hint:"Giới hạn output cho request."}})]}):(0,a.jsxs)("div",{className:"space-y-2",children:[(0,a.jsxs)("div",{className:"grid gap-3 2xl:grid-cols-2",children:[(0,a.jsx)(el,{icon:"psychology",title:"Khi request bật thinking",values:h,defaults:f,onToggleField:(e,t,n)=>T("think",e,t,n),onChangeField:(e,t)=>O("think",e,t),inputClass:S}),(0,a.jsx)(el,{icon:"bolt",title:"Khi request tắt thinking",values:b,defaults:y,onToggleField:(e,t,n)=>T("nothink",e,t,n),onChangeField:(e,t)=>O("nothink",e,t),inputClass:S})]}),(0,a.jsx)("span",{className:"block text-[11px] text-text-muted",children:"Thinking đang theo request gốc n\xean mỗi nh\xe1nh c\xf3 bộ sampling ri\xeang, chọn theo đ\xfang cờ thinking client gửi l\xean. Request kh\xf4ng khai b\xe1o thinking th\xec gateway tắt thinking v\xe0 d\xf9ng nh\xe1nh dưới. Field kh\xf4ng tick th\xec giữ nguy\xean gi\xe1 trị client gửi. top_k/min_p chỉ gửi tới llama.cpp v\xe0 vLLM."})]})]}),(0,a.jsxs)("div",{className:`rounded-xl border p-3 ${_?"border-primary/20 bg-primary/5":"border-border bg-background/40"}`,children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-xs font-semibold text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"psychology"}),"Thinking ",(0,a.jsx)("span",{className:"font-normal text-text-muted",children:"(suy luận nội bộ)"})]}),(0,a.jsxs)("div",{className:"grid gap-3 sm:grid-cols-2",children:[(0,a.jsxs)("label",{className:`rounded-lg border p-3 transition ${p?"border-primary/30 bg-background shadow-sm":"border-border bg-background/60"}`,children:[(0,a.jsxs)("span",{className:"mb-2 flex items-center gap-1.5 text-xs font-medium text-text-main",children:[(0,a.jsx)("span",{className:`material-symbols-outlined text-[16px] ${p?"text-primary":"text-text-muted"}`,children:"psychology_alt"}),"Thinking"]}),(0,a.jsx)("select",{value:u,onChange:e=>(e=>{if("inherit"===e)return void w({thinkingMode:void 0});let n="on"===e?h:b;t?.(q({...r,...n,inheritThinkRequestOverrides:{},inheritNoThinkRequestOverrides:{},thinkingMode:e}))})(e.target.value),className:"w-full rounded-lg border border-border bg-surface px-2 py-1.5 text-sm text-text-main outline-none focus:border-primary",children:j.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:j.find(e=>e.value===u)?.description||j[0].description})]}),(0,a.jsx)(er,{icon:"account_balance_wallet",label:"reasoning_budget",active:m,className:x?"opacity-60":"",children:{toggle:(0,a.jsx)("input",{type:"checkbox",checked:m,disabled:x,onChange:e=>C("reasoning_budget",e.target.checked,g.reasoning_budget),className:"h-3.5 w-3.5 accent-primary disabled:opacity-50"}),control:(0,a.jsx)("input",{type:"number",min:"0",max:"262144",step:"1",disabled:x||!m,value:m?r.reasoning_budget:g.reasoning_budget,onChange:e=>w({reasoning_budget:e.target.value}),className:S}),hint:x?"Thinking đang tắt n\xean budget kh\xf4ng được gửi.":"Chỉ d\xf9ng cho llama.cpp/vLLM local; runtime sẽ map đ\xfang field."}})]})]})]})]})}function es({isOpen:e,combo:t,comboStrategy:n={},onClose:s,onSave:c,activeProviders:m,providersLoading:x=!1,kindFilter:h=null}){let[b,f]=(0,r.useState)(t?.name||""),[y,k]=(0,r.useState)([]),[v,j]=(0,r.useState)(!1),[N,_]=(0,r.useState)(!1),[w,C]=(0,r.useState)(""),[T,S]=(0,r.useState)({}),[$,M]=(0,r.useState)(""),[E,P]=(0,r.useState)(""),[I,A]=(0,r.useState)(()=>t?q(n?.requestOverrides||{}):q(g)),[z,B]=(0,r.useState)(()=>O(n?.contentLoggingMode)),F=n||{},H=(0,l.FR)((0,l.MS)(l.AN,{activationConstraint:{distance:5}}),(0,l.MS)(l.uN,{coordinateGetter:i.JR}));(0,r.useEffect)(()=>{e&&(f(t?.name||""),k(function(e,t={}){let n=(e?.models||[]).map(e=>Q(e,!0)).filter(e=>e.value),a=new Set(n.map(e=>e.value));return[...n,...L(t).filter(e=>!a.has(e)).map(e=>Q(e,!1)).filter(e=>e.value)]}(t,F)),C(""),M(""),P(""),A(t?q(F.requestOverrides||{}):q(g)),B(O(F.contentLoggingMode)))},[e,t?.id,t?.name,F.contentLoggingMode]),(0,r.useEffect)(()=>{e&&J()},[e]);let J=async()=>{try{let e=await fetch("/api/models/alias",{cache:"no-store"});if(!e.ok)return;let t=await e.json();S(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}},W=y.map((e,t)=>({uid:`item-${t}-${e.value}`,row:e})),Z=y.map(e=>e.value),Y=y.filter(e=>e.enabled).length,ee=y.filter(e=>!e.enabled).length,et=(m||[]).filter(e=>e?.isActive!==!1),er=et.find(e=>e.id===$)||null,el=er?V(er,T):[],eo=el[0]?.value||(er?U(er):""),ed=e=>e.trim()?p.test(e)?(C(""),!0):(C("Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."),!1):(C("Bắt buộc nhập t\xean"),!1),ec=async()=>{if(!ed(b))return;let{models:e,disabledModels:t}=function(e=[]){let t=[],n=new Set;for(let a of e){let e=R(a?.value||G(a?.target));!e||n.has(e)||(n.add(e),t.push({...a,value:e,enabled:a?.enabled!==!1,target:X(a?.target||a?.value)}))}return{models:t.filter(e=>e.enabled).map(e=>e.target).filter(Boolean),disabledModels:t.filter(e=>!e.enabled).map(e=>e.value)}}(y);_(!0),await c({name:b.trim(),models:e,disabledModels:t,requestOverrides:q(I),contentLoggingMode:z}),_(!1)};if(!e)return null;let em=!!t;return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/45 p-3 backdrop-blur-[1px] sm:p-4",children:(0,a.jsxs)("div",{className:"flex max-h-[92vh] w-full max-w-7xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",children:[(0,a.jsxs)("div",{className:"flex items-start justify-between border-b border-border px-5 py-4 sm:px-6",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:em?"Chỉnh sửa combo":"Tạo combo"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Chọn model, tắt tạm thời khi cần v\xe0 sắp xếp thứ tự ưu ti\xean fallback đang bật."})]}),(0,a.jsx)("button",{type:"button",onClick:s,className:"rounded-lg p-1 text-text-muted transition hover:bg-surface hover:text-text-main",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,a.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto bg-white px-5 py-4 dark:bg-zinc-950 sm:px-6",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-2 block text-sm font-semibold text-text-main",children:"T\xean"}),(0,a.jsx)("input",{value:b,onChange:e=>{let t=e.target.value;f(t),t?ed(t):C("")},placeholder:"premium-coding",className:`w-full rounded-xl border bg-white px-4 py-2.5 text-text-main outline-none transition focus:border-primary dark:bg-zinc-900 ${w?"border-red-400":"border-border"}`}),(0,a.jsx)("span",{className:`mt-1 block text-xs ${w?"text-red-500":"text-text-muted"}`,children:w||"Chỉ cho ph\xe9p chữ, số, dấu -, _ v\xe0 ."})]}),(0,a.jsx)(ei,{value:I,onChange:A,defaultEnabled:!em}),(0,a.jsx)(ea,{value:z,onChange:B}),(0,a.jsxs)("div",{children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Danh s\xe1ch model"}),(0,a.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[Y," đang bật",ee>0?`, ${ee} đ\xe3 tắt`:"",". Model đ\xe3 tắt vẫn nằm trong combo nhưng kh\xf4ng được route."]})]}),(0,a.jsxs)("button",{type:"button",onClick:()=>j(!0),className:"inline-flex items-center gap-1 rounded-lg border border-border px-3 py-1.5 text-xs font-medium text-primary hover:border-primary/50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Th\xeam model"]})]}),(0,a.jsxs)("div",{className:"mb-4 rounded-xl border border-primary/15 bg-primary/5 p-3",children:[(0,a.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-primary",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"account_tree"}),"Th\xeam target theo provider account"]}),(0,a.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Cố định bước combo n\xe0y v\xe0o một provider account cụ thể. Danh s\xe1ch account chỉ được load khi mở modal để trang combo nhẹ hơn."}),(0,a.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_auto]",children:[(0,a.jsxs)("select",{value:$,onChange:e=>{let t=e.target.value,n=et.find(e=>e.id===t),a=n?V(n,T):[];M(t),P(a[0]?.value||U(n||{})||"")},className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 text-xs text-text-main outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"",children:x?"Đang tải provider account...":"Chọn provider account"}),et.map(e=>{let t=D(e),n=K(e),r=n&&n!==t?`${t} / ${n}`:t;return(0,a.jsx)("option",{value:e.id,children:r},e.id)})]}),(0,a.jsxs)("select",{value:E,onChange:e=>P(e.target.value),disabled:!$||0===el.length,className:"min-w-0 rounded-lg border border-border bg-background px-3 py-2 font-mono text-xs text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-60",children:[(0,a.jsx)("option",{value:"",children:$?el.length>0?"Chọn model":"Kh\xf4ng t\xecm thấy model của provider":"Chọn account trước"}),el.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},`${e.value}-${e.label}`))]}),(0,a.jsxs)("button",{type:"button",onClick:()=>{if(!er)return;let e=function(e,t){let n=D(e),a=function(e={}){let t=R(e.provider),n=D(e);return(0,u.mq)(t)||(0,u.gb)(t)?n||t:t||n}(e),r=K(e),l=R(t||U(e));if(!n||!e?.id||!l)return null;let i=l.includes("/"),s=i?l:`${n}/${l}`,o=i&&l.startsWith(`${n}/`)?l.slice(n.length+1):l,d=r&&r!==a?`${a}/${r}/${o}`:`${a}/${o}`;return{model:s,connectionId:e.id,provider:a||n,accountName:r||void 0,label:d}}(er,E||eo);if(!e)return void alert("H\xe3y chọn provider account v\xe0 model cho target cố định n\xe0y.");let t=Q(e,!0);k(e=>{let n=e.findIndex(e=>e.value===t.value);if(-1!==n){let a=[...e];return a[n]={...a[n],...t,enabled:!0},a}return[...e,t]}),P("")},disabled:!$||!E,className:"inline-flex items-center justify-center gap-1 rounded-lg bg-primary px-3 py-2 text-xs font-semibold text-white disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_link"}),"Th\xeam account"]})]})]}),0===y.length?(0,a.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-text-muted",children:[(0,a.jsx)("span",{className:"material-symbols-outlined",children:"layers"}),(0,a.jsx)("p",{className:"mt-2 text-sm",children:"Chưa th\xeam model n\xe0o"})]}):(0,a.jsx)(l.Mp,{sensors:H,collisionDetection:l.fp,modifiers:[o.FN,o.gj],onDragEnd:e=>{let{active:t,over:n}=e;if(n&&t.id!==n.id){let e=W.findIndex(e=>e.uid===t.id),a=W.findIndex(e=>e.uid===n.id);-1!==e&&-1!==a&&k(t=>(0,i.be)(t,e,a))}},children:(0,a.jsx)(i.gB,{items:W.map(e=>e.uid),strategy:i._G,children:(0,a.jsx)("div",{className:"space-y-3",children:W.map(({uid:e,row:t},n)=>(0,a.jsx)(en,{id:e,index:n,model:t.label||t.value,subtitle:t.subtitle,enabled:t.enabled,isFirst:0===n,isLast:n===y.length-1,onEdit:e=>{let t=e.trim();if(!t)return;let a=[...y],r=a[n];if(r?.target&&"object"==typeof r.target){let e=X({...r.target,model:t});a[n]=Q(e,!1!==r.enabled)}else a[n]=Q(t,r?.enabled!==!1);k(a)},onMoveUp:()=>{if(0===n)return;let e=[...y];[e[n-1],e[n]]=[e[n],e[n-1]],k(e)},onMoveDown:()=>{if(n===y.length-1)return;let e=[...y];[e[n],e[n+1]]=[e[n+1],e[n]],k(e)},onToggleEnabled:()=>{let e=[...y];e[n]={...e[n],enabled:!e[n].enabled},k(e)},onRemove:()=>k(y.filter((e,t)=>t!==n))},e))})})})]})]}),(0,a.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border bg-white px-5 py-4 dark:bg-zinc-950 sm:px-6",children:[(0,a.jsx)("button",{type:"button",onClick:s,className:"rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",children:"Hủy"}),(0,a.jsx)("button",{type:"button",onClick:ec,disabled:N,className:"rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:N?"Đang lưu...":em?"Lưu":"Tạo"})]})]})}),(0,a.jsx)(d.rq,{isOpen:v,onClose:()=>j(!1),onSelect:e=>{let t=e.value;k(e=>{let n=e.findIndex(e=>e.value===t);if(-1!==n){let t=[...e];return t[n]={...t[n],enabled:!0},t}return[...e,Q(t,!0)]})},onDeselect:e=>{k(t=>t.filter(t=>t.value!==e.value))},activeProviders:m,modelAliases:T,title:"Th\xeam model v\xe0o combo",kindFilter:h,addedModelValues:Z,closeOnSelect:!1})]})}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,7055,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=20061)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},68678:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=68678)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[712],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},68678:(e,t,l)=>{Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=68678)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099,6337],{18032:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(14051),i=s.n(n),r=s(35497),d=s(11059);let o=[{id:"lite",label:"Lite",desc:"N\xe9n nhẹ, vẫn giữ ngữ ph\xe1p dễ đọc."},{id:"full",label:"Full",desc:"N\xe9n c\xe2n bằng, giảm token r\xf5 hơn."},{id:"ultra",label:"Ultra",desc:"N\xe9n tối đa, c\xe2u cực ngắn."}];function c({label:e,value:t,copiedKey:s,copied:l,copy:n}){return(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsx)("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-lg bg-surface px-3 py-2 font-mono text-xs text-text-main",children:t}),(0,a.jsx)("button",{type:"button",onClick:()=>n(t,s),className:"rounded-lg border border-border px-2 py-2 text-text-muted transition hover:border-primary hover:text-primary",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})})]})]})}function m({machineId:e}){let[t,s]=(0,l.useState)(!0),[n,i]=(0,l.useState)(""),[x,p]=(0,l.useState)(""),[h,u]=(0,l.useState)({hasPassword:!0,rtkEnabled:!0,cavemanEnabled:!1,cavemanLevel:"full",apiKeyDefaultModel:""}),{copied:b,copy:v}=(0,d.C)(),j=(0,l.useMemo)(()=>(function(e=""){let t=e?`${e.replace(/\/$/,"")}/v1`:"/v1";return{base:t,chat:`${t}/chat/completions`,models:`${t}/models`,health:e?`${e.replace(/\/$/,"")}/api/health`:"/api/health"}})(x),[x]);(0,l.useEffect)(()=>{p(window.location.origin),y()},[]);let y=async()=>{s(!0);try{let e=await fetch("/api/dashboard/endpoint",{cache:"no-store"}),t=await e.json();e.ok&&u(e=>({...e,...t}))}catch(e){console.log("Error loading endpoint settings:",e)}finally{s(!1)}},g=async(e,t="")=>{i(t);try{let t=await fetch("/api/dashboard/endpoint",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok?u(e=>({...e,...s})):alert(s.error||"Cập nhật thiết lập thất bại")}catch(e){console.log("Error updating endpoint settings:",e),alert("Cập nhật thiết lập thất bại")}finally{i("")}};return t?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Endpoint"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Endpoint nội bộ để tool gọi BlueRouter theo chuẩn OpenAI-compatible."})]}),(0,a.jsxs)(r.$n,{onClick:y,variant:"ghost",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"}),"L\xe0m mới"]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"rounded-2xl bg-primary/10 p-3 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"hub"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:"Th\xf4ng tin API endpoint"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng c\xe1c URL dưới đ\xe2y cho LibreChat, VSCode, Copilot proxy, Antigravity hoặc tool OpenAI-compatible kh\xe1c."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsx)(c,{label:"Base URL",value:j.base,copiedKey:"base",copied:b,copy:v}),(0,a.jsx)(c,{label:"Chat Completions",value:j.chat,copiedKey:"chat",copied:b,copy:v}),(0,a.jsx)(c,{label:"Models",value:j.models,copiedKey:"models",copied:b,copy:v}),(0,a.jsx)(c,{label:"Health",value:j.health,copiedKey:"health",copied:b,copy:v})]}),(0,a.jsxs)("p",{className:"mt-4 text-xs text-text-muted",children:["Machine ID: ",(0,a.jsx)("code",{className:"rounded bg-surface px-1.5 py-0.5",children:e||"unknown"})]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"rounded-2xl bg-primary/10 p-3 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"bolt"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:"Token Saver"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Giảm token cho output từ tool v\xe0 phản hồi model. Bật/tắt tại đ\xe2y kh\xf4ng cần load API keys hoặc provider status."})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"RTK tool output compression"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"N\xe9n output của git/grep/ls/tree/logs trước khi gửi v\xe0o model."})]}),(0,a.jsx)(r.lM,{checked:!1!==h.rtkEnabled,onChange:e=>g({rtkEnabled:e},"rtkEnabled"),disabled:"rtkEnabled"===n})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Caveman output compression"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Th\xeam style prompt để model trả lời ngắn hơn, giảm output token."})]}),(0,a.jsx)(r.lM,{checked:!!h.cavemanEnabled,onChange:e=>g({cavemanEnabled:e},"cavemanEnabled"),disabled:"cavemanEnabled"===n})]}),h.cavemanEnabled&&(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:o.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>g({cavemanLevel:e.id},"cavemanLevel"),title:e.desc,className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition ${h.cavemanLevel===e.id?"border-primary bg-primary text-white":"border-border text-text-muted hover:border-primary hover:text-primary"}`,children:e.label},e.id))})]})]})]})]})}c.propTypes={label:i().string.isRequired,value:i().string.isRequired,copiedKey:i().string.isRequired,copied:i().string,copy:i().func.isRequired},m.propTypes={machineId:i().string}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=18032)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6099,6337],{18032:(e,t,s)=>{Promise.resolve().then(s.bind(s,95907))},95907:(e,t,s)=>{"use strict";s.d(t,{default:()=>m});var a=s(95155),l=s(12115),n=s(14051),i=s.n(n),r=s(35497),d=s(11059);let o=[{id:"lite",label:"Lite",desc:"N\xe9n nhẹ, vẫn giữ ngữ ph\xe1p dễ đọc."},{id:"full",label:"Full",desc:"N\xe9n c\xe2n bằng, giảm token r\xf5 hơn."},{id:"ultra",label:"Ultra",desc:"N\xe9n tối đa, c\xe2u cực ngắn."}];function c({label:e,value:t,copiedKey:s,copied:l,copy:n}){return(0,a.jsxs)("div",{className:"rounded-xl border border-border bg-background p-3",children:[(0,a.jsx)("div",{className:"mb-1 text-xs font-semibold uppercase tracking-wide text-text-muted",children:e}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-2",children:[(0,a.jsx)("code",{className:"min-w-0 flex-1 truncate rounded-lg bg-surface px-3 py-2 font-mono text-xs text-text-main",children:t}),(0,a.jsx)("button",{type:"button",onClick:()=>n(t,s),className:"rounded-lg border border-border px-2 py-2 text-text-muted transition hover:border-primary hover:text-primary",title:"Copy",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===s?"check":"content_copy"})})]})]})}function m({machineId:e}){let[t,s]=(0,l.useState)(!0),[n,i]=(0,l.useState)(""),[x,p]=(0,l.useState)(""),[h,u]=(0,l.useState)({hasPassword:!0,rtkEnabled:!0,cavemanEnabled:!1,cavemanLevel:"full",apiKeyDefaultModel:""}),{copied:b,copy:v}=(0,d.C)(),j=(0,l.useMemo)(()=>(function(e=""){let t=e?`${e.replace(/\/$/,"")}/v1`:"/v1";return{base:t,chat:`${t}/chat/completions`,models:`${t}/models`,health:e?`${e.replace(/\/$/,"")}/api/health`:"/api/health"}})(x),[x]);(0,l.useEffect)(()=>{p(window.location.origin),y()},[]);let y=async()=>{s(!0);try{let e=await fetch("/api/dashboard/endpoint",{cache:"no-store"}),t=await e.json();e.ok&&u(e=>({...e,...t}))}catch(e){console.log("Error loading endpoint settings:",e)}finally{s(!1)}},g=async(e,t="")=>{i(t);try{let t=await fetch("/api/dashboard/endpoint",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok?u(e=>({...e,...s})):alert(s.error||"Cập nhật thiết lập thất bại")}catch(e){console.log("Error updating endpoint settings:",e),alert("Cập nhật thiết lập thất bại")}finally{i("")}};return t?(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsx)(r.Qv,{}),(0,a.jsx)(r.Qv,{})]}):(0,a.jsxs)("div",{className:"space-y-6",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h1",{className:"text-2xl font-bold text-text-main",children:"Endpoint"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Endpoint nội bộ để tool gọi BlueRouter theo chuẩn OpenAI-compatible."})]}),(0,a.jsxs)(r.$n,{onClick:y,variant:"ghost",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"refresh"}),"L\xe0m mới"]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"rounded-2xl bg-primary/10 p-3 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"hub"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:"Th\xf4ng tin API endpoint"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"D\xf9ng c\xe1c URL dưới đ\xe2y cho LibreChat, VSCode, Copilot proxy, Antigravity hoặc tool OpenAI-compatible kh\xe1c."})]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsx)(c,{label:"Base URL",value:j.base,copiedKey:"base",copied:b,copy:v}),(0,a.jsx)(c,{label:"Chat Completions",value:j.chat,copiedKey:"chat",copied:b,copy:v}),(0,a.jsx)(c,{label:"Models",value:j.models,copiedKey:"models",copied:b,copy:v}),(0,a.jsx)(c,{label:"Health",value:j.health,copiedKey:"health",copied:b,copy:v})]}),(0,a.jsxs)("p",{className:"mt-4 text-xs text-text-muted",children:["Machine ID: ",(0,a.jsx)("code",{className:"rounded bg-surface px-1.5 py-0.5",children:e||"unknown"})]})]}),(0,a.jsxs)(r.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex items-start gap-3",children:[(0,a.jsx)("div",{className:"rounded-2xl bg-primary/10 p-3 text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined",children:"bolt"})}),(0,a.jsxs)("div",{children:[(0,a.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:"Token Saver"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Giảm token cho output từ tool v\xe0 phản hồi model. Bật/tắt tại đ\xe2y kh\xf4ng cần load API keys hoặc provider status."})]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3 rounded-xl border border-border p-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"RTK tool output compression"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"N\xe9n output của git/grep/ls/tree/logs trước khi gửi v\xe0o model."})]}),(0,a.jsx)(r.lM,{checked:!1!==h.rtkEnabled,onChange:e=>g({rtkEnabled:e},"rtkEnabled"),disabled:"rtkEnabled"===n})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border p-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("h3",{className:"font-semibold text-text-main",children:"Caveman output compression"}),(0,a.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Th\xeam style prompt để model trả lời ngắn hơn, giảm output token."})]}),(0,a.jsx)(r.lM,{checked:!!h.cavemanEnabled,onChange:e=>g({cavemanEnabled:e},"cavemanEnabled"),disabled:"cavemanEnabled"===n})]}),h.cavemanEnabled&&(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:o.map(e=>(0,a.jsx)("button",{type:"button",onClick:()=>g({cavemanLevel:e.id},"cavemanLevel"),title:e.desc,className:`rounded-lg border px-3 py-1.5 text-xs font-medium transition ${h.cavemanLevel===e.id?"border-primary bg-primary text-white":"border-border text-text-muted hover:border-primary hover:text-primary"}`,children:e.label},e.id))})]})]})]})]})}c.propTypes={label:i().string.isRequired,value:i().string.isRequired,copiedKey:i().string.isRequired,copied:i().string,copy:i().func.isRequired},m.propTypes={machineId:i().string}}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=18032)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},98537:(e,t,l)=>{Promise.resolve().then(l.t.bind(l,98500,23)),Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=98537)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[39],{44493:(e,t,l)=>{"use strict";l.d(t,{default:()=>o});var s=l(95155),n=l(12115),r=l(35497),a=l(90620);let c={LOG:"text-green-400",INFO:"text-blue-400",WARN:"text-yellow-400",ERROR:"text-red-400",DEBUG:"text-purple-400"};function o(){let[e,t]=(0,n.useState)([]),[l,o]=(0,n.useState)(!1),i=(0,n.useRef)(null),u=async()=>{try{await fetch("/api/translator/console-logs",{method:"DELETE"})}catch(e){console.error("Failed to clear console logs:",e)}};return(0,n.useEffect)(()=>{let e=new EventSource("/api/translator/console-logs/stream");return e.onopen=()=>o(!0),e.onmessage=e=>{let l=JSON.parse(e.data);"init"===l.type?t(l.logs.slice(-a.UY.maxLines)):"line"===l.type?t(e=>{let t=[...e,l.line];return t.length>a.UY.maxLines?t.slice(-a.UY.maxLines):t}):"clear"===l.type&&t([])},e.onerror=()=>o(!1),()=>e.close()},[]),(0,n.useEffect)(()=>{i.current&&(i.current.scrollTop=i.current.scrollHeight)},[e]),(0,s.jsx)("div",{className:"",children:(0,s.jsxs)(r.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-end px-4 pt-3 pb-2",children:(0,s.jsx)(r.$n,{size:"sm",variant:"outline",icon:"delete",onClick:u,children:"Clear"})}),(0,s.jsx)("div",{ref:i,className:"bg-black rounded-b-lg p-4 text-xs font-mono h-[calc(100vh-220px)] overflow-y-auto",children:0===e.length?(0,s.jsx)("span",{className:"text-text-muted",children:"No console logs yet."}):(0,s.jsx)("div",{className:"space-y-0.5",children:e.map((e,t)=>{let l,n;return(0,s.jsx)("div",{children:(n=c[(l=e.match(/\[(\w+)\]/g))?l[1]?.replace(/\[|\]/g,""):null]||"text-green-400",(0,s.jsx)("span",{className:n,children:e}))},t)})})})]})})}},98537:(e,t,l)=>{Promise.resolve().then(l.t.bind(l,98500,23)),Promise.resolve().then(l.bind(l,44493))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=98537)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{95364:(e,s,_)=>{Promise.resolve().then(_.bind(_,94588))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,2207,8441,3794,7358],()=>e(e.s=95364)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{95364:(e,s,_)=>{Promise.resolve().then(_.bind(_,94588))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,2207,8441,3794,7358],()=>e(e.s=95364)),_N_E=e.O()}]);
@@ -1 +1 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[166,1316,2006,6526,6620,8982],{32239:(e,s,t)=>{"use strict";t.d(s,{default:()=>f});var i=t(95155),n=t(73321),o=t(98500),a=t.n(o),r=t(12115),l=t(35497),c=t(57250),d=t(52679);let m=new Set(["image"]),x={image:"image-combo",tts:"tts-combo"};function h(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function p({provider:e,kind:s,connections:t,isCustom:n,onToggle:o}){var r;let m,x=d.Q2[e.id],u=!!x?.noAuth,f=t.filter(s=>s.provider===e.id),j=f.filter(e=>{let s=h(e);return"active"===s||"success"===s}).length,g=f.filter(e=>{let s=h(e);return"error"===s||"expired"===s||"unavailable"===s}).length,b=f.length,v=b>0&&f.every(e=>!1===e.isActive);return(0,i.jsx)(a(),{href:(r=e.id,(m=d.dV[s])?`${m}/${r}`:`/dashboard/media-providers/${s}/${r}`),className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${v?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[n&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),n&&("stt"===s||"tts"===s)||u?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):v?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===b?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[j>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[j," Connected"]}),g>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[g," Error"]}),0===j&&0===g&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[b," Added"]})]})]})]})]}),b>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),o&&o(e.id,v)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!v,onChange:()=>{},title:v?"Enable provider":"Disable provider"})})]})})})}function u({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(a(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",n=d.Q2[t];return(0,i.jsx)("div",{title:n?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${n?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:`/providers/${t}.png`,alt:n?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:n?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:n?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function f({forcedKind:e}){let s=(0,n.useParams)(),t=e||s.kind,o=(0,n.useRouter)(),[a,c]=(0,r.useState)([]),[h,j]=(0,r.useState)([]),[g,b]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[C,N]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1);(0,r.useEffect)(()=>{("webSearch"===t||"webFetch"===t)&&o.replace("/dashboard/media-providers/web")},[t,o]);let S=d.rj.find(e=>e.id===t),$="embedding"===t,E="stt"===t,T="tts"===t,z=m.has(t);if((0,r.useEffect)(()=>{S&&(fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>c(e.connections||[])).catch(()=>{}),($||E||T)&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>j((e.nodes||[]).filter(e=>e.type===(E?"custom-stt":T?"custom-tts":"custom-embedding")))).catch(()=>{}),z&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>b(e.combos||[])).catch(()=>{}))},[$,E,T,z,S]),!S)return(0,n.notFound)();let A=(0,d.o5)(t),O=g.filter(e=>e.kind===t),_=h.map(e=>({id:e.id,name:e.name||("custom-stt"===e.type?"Custom STT":"custom-tts"===e.type?"Custom TTS":"Custom Embedding"),color:"custom-stt"===e.type||"custom-tts"===e.type?"#0EA5E9":"#6366F1",textIcon:"custom-stt"===e.type?"CS":"custom-tts"===e.type?"CT":"CE"})),F=[...A,..._],P=async(e,s)=>{let t=a.filter(s=>s.provider===e);c(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(t.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},D=async()=>{let e=x[t]||`${t}-combo`,s=e,i=1,n=new Set(g.map(e=>e.name));for(;n.has(s);)s=`${e}-${i++}`;let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,models:[],kind:t})});if(a.ok){let e=await a.json();o.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await a.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[($||E||T||z)&&(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[z&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:D,children:"Create Combo"}),$&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add Custom Embedding"}),E&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>N(!0),children:"Add Custom STT"}),T&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>w(!0),children:"Add Custom TTS"})]}),z&&O.length>0&&(0,i.jsx)(u,{combos:O}),0===F.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:S.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[A.map(e=>(0,i.jsx)(p,{provider:e,kind:t,connections:a,onToggle:P},e.id)),_.map(e=>(0,i.jsx)(p,{provider:e,kind:t,connections:a,isCustom:!0,onToggle:P},e.id))]}),$&&(0,i.jsx)(l.Jz,{isOpen:v,onClose:()=>y(!1),onSaved:e=>{j(s=>[...s,e]),y(!1)}}),E&&(0,i.jsx)(l.F8,{isOpen:C,onClose:()=>N(!1),onCreated:e=>{j(s=>[...s,e]),N(!1)}}),T&&(0,i.jsx)(l.b1,{isOpen:k,onClose:()=>w(!1),onCreated:e=>{j(s=>[...s,e]),w(!1)}})]})}},78521:(e,s,t)=>{Promise.resolve().then(t.bind(t,32239))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,2793,5263,7033,5497,8441,3794,7358],()=>e(e.s=78521)),_N_E=e.O()}]);
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[166,1316,2006,6526,6620,8982],{32239:(e,s,t)=>{"use strict";t.d(s,{default:()=>f});var i=t(95155),n=t(73321),o=t(98500),a=t.n(o),r=t(12115),l=t(35497),c=t(57250),d=t(52679);let m=new Set(["image"]),x={image:"image-combo",tts:"tts-combo"};function h(e){let s=Object.entries(e).some(([e,s])=>e.startsWith("modelLock_")&&s&&new Date(s).getTime()>Date.now());return"unavailable"!==e.testStatus||s?e.testStatus:"active"}function p({provider:e,kind:s,connections:t,isCustom:n,onToggle:o}){var r;let m,x=d.Q2[e.id],u=!!x?.noAuth,f=t.filter(s=>s.provider===e.id),j=f.filter(e=>{let s=h(e);return"active"===s||"success"===s}).length,g=f.filter(e=>{let s=h(e);return"error"===s||"expired"===s||"unavailable"===s}).length,b=f.length,v=b>0&&f.every(e=>!1===e.isActive);return(0,i.jsx)(a(),{href:(r=e.id,(m=d.dV[s])?`${m}/${r}`:`/dashboard/media-providers/${s}/${r}`),className:"group",children:(0,i.jsx)(l.Zp,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${v?"opacity-50":""}`,children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${e.color?.length>7?e.color:(e.color??"#888")+"15"}`},children:(0,i.jsx)(c.A,{src:`/providers/${e.id}.png`,alt:e.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:e.textIcon||e.id.slice(0,2).toUpperCase(),fallbackColor:e.color})}),(0,i.jsxs)("div",{className:"min-w-0",children:[(0,i.jsx)("h3",{className:"font-semibold text-sm",children:e.name}),(0,i.jsxs)("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[n&&(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Custom"}),n&&("stt"===s||"tts"===s)||u?(0,i.jsx)(l.Ex,{variant:"success",size:"sm",children:"Ready"}):v?(0,i.jsx)(l.Ex,{variant:"default",size:"sm",children:"Disabled"}):0===b?(0,i.jsx)("span",{className:"text-xs text-text-muted",children:"No connections"}):(0,i.jsxs)(i.Fragment,{children:[j>0&&(0,i.jsxs)(l.Ex,{variant:"success",size:"sm",dot:!0,children:[j," Connected"]}),g>0&&(0,i.jsxs)(l.Ex,{variant:"error",size:"sm",dot:!0,children:[g," Error"]}),0===j&&0===g&&(0,i.jsxs)(l.Ex,{variant:"default",size:"sm",children:[b," Added"]})]})]})]})]}),b>0&&(0,i.jsx)("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:s=>{s.preventDefault(),s.stopPropagation(),o&&o(e.id,v)},children:(0,i.jsx)(l.lM,{size:"sm",checked:!v,onChange:()=>{},title:v?"Enable provider":"Disable provider"})})]})})})}function u({combos:e}){return 0===e.length?null:(0,i.jsx)("div",{className:"flex flex-col gap-2",children:e.map(e=>(0,i.jsx)(a(),{href:`/dashboard/media-providers/combo/${e.id}`,children:(0,i.jsx)(l.Zp,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:(0,i.jsxs)("div",{className:"flex min-w-0 items-center gap-3",children:[(0,i.jsx)("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),(0,i.jsx)("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:e.name}),(0,i.jsxs)("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[e.models.slice(0,6).map((e,s)=>{let t="string"==typeof e?e.split("/")[0]:"",n=d.Q2[t];return(0,i.jsx)("div",{title:n?.name||e,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${n?.color??"#888"}15`},children:(0,i.jsx)(c.A,{src:`/providers/${t}.png`,alt:n?.name||t,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:n?.textIcon||t.slice(0,2).toUpperCase(),fallbackColor:n?.color})},`${e}-${s}`)}),e.models.length>6&&(0,i.jsxs)("span",{className:"text-[10px] text-text-muted ml-1",children:["+",e.models.length-6]})]}),(0,i.jsx)("span",{className:"text-[11px] text-text-muted shrink-0",children:e.models.length}),(0,i.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},e.id))})}function f({forcedKind:e}){let s=(0,n.useParams)(),t=e||s.kind,o=(0,n.useRouter)(),[a,c]=(0,r.useState)([]),[h,j]=(0,r.useState)([]),[g,b]=(0,r.useState)([]),[v,y]=(0,r.useState)(!1),[C,N]=(0,r.useState)(!1),[k,w]=(0,r.useState)(!1);(0,r.useEffect)(()=>{("webSearch"===t||"webFetch"===t)&&o.replace("/dashboard/media-providers/web")},[t,o]);let S=d.rj.find(e=>e.id===t),$="embedding"===t,E="stt"===t,T="tts"===t,z=m.has(t);if((0,r.useEffect)(()=>{S&&(fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(e=>c(e.connections||[])).catch(()=>{}),($||E||T)&&fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(e=>j((e.nodes||[]).filter(e=>e.type===(E?"custom-stt":T?"custom-tts":"custom-embedding")))).catch(()=>{}),z&&fetch("/api/combos",{cache:"no-store"}).then(e=>e.json()).then(e=>b(e.combos||[])).catch(()=>{}))},[$,E,T,z,S]),!S)return(0,n.notFound)();let A=(0,d.o5)(t),O=g.filter(e=>e.kind===t),_=h.map(e=>({id:e.id,name:e.name||("custom-stt"===e.type?"Custom STT":"custom-tts"===e.type?"Custom TTS":"Custom Embedding"),color:"custom-stt"===e.type||"custom-tts"===e.type?"#0EA5E9":"#6366F1",textIcon:"custom-stt"===e.type?"CS":"custom-tts"===e.type?"CT":"CE"})),F=[...A,..._],P=async(e,s)=>{let t=a.filter(s=>s.provider===e);c(t=>t.map(t=>t.provider===e?{...t,isActive:s}:t)),await Promise.allSettled(t.map(e=>fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:s})})))},D=async()=>{let e=x[t]||`${t}-combo`,s=e,i=1,n=new Set(g.map(e=>e.name));for(;n.has(s);)s=`${e}-${i++}`;let a=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:s,models:[],kind:t})});if(a.ok){let e=await a.json();o.push(`/dashboard/media-providers/combo/${e.id}`)}else alert((await a.json()).error||"Failed to create combo")};return(0,i.jsxs)("div",{className:"flex flex-col gap-6",children:[($||E||T||z)&&(0,i.jsxs)("div",{className:"flex items-center justify-end gap-2",children:[z&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:D,children:"Create Combo"}),$&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>y(!0),children:"Add Custom Embedding"}),E&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>N(!0),children:"Add Custom STT"}),T&&(0,i.jsx)(l.$n,{size:"sm",icon:"add",onClick:()=>w(!0),children:"Add Custom TTS"})]}),z&&O.length>0&&(0,i.jsx)(u,{combos:O}),0===F.length?(0,i.jsxs)("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",(0,i.jsx)("strong",{children:S.label})," yet."]}):(0,i.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[A.map(e=>(0,i.jsx)(p,{provider:e,kind:t,connections:a,onToggle:P},e.id)),_.map(e=>(0,i.jsx)(p,{provider:e,kind:t,connections:a,isCustom:!0,onToggle:P},e.id))]}),$&&(0,i.jsx)(l.Jz,{isOpen:v,onClose:()=>y(!1),onSaved:e=>{j(s=>[...s,e]),y(!1)}}),E&&(0,i.jsx)(l.F8,{isOpen:C,onClose:()=>N(!1),onCreated:e=>{j(s=>[...s,e]),N(!1)}}),T&&(0,i.jsx)(l.b1,{isOpen:k,onClose:()=>w(!1),onCreated:e=>{j(s=>[...s,e]),w(!1)}})]})}},78521:(e,s,t)=>{Promise.resolve().then(t.bind(t,32239))}},e=>{e.O(0,[6373,3862,8500,506,9959,7050,8723,5263,7033,5497,8441,3794,7358],()=>e(e.s=78521)),_N_E=e.O()}]);