@jheavenknows/bluerouter 1.0.82 → 1.0.85

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 (497) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +2 -2
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/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/profile/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/prompt-logs/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page.js.nft.json +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/provider-health/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +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/new/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  54. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  55. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  56. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  57. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  58. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  59. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  60. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  61. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  64. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  65. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  66. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +4 -4
  68. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  69. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  70. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  71. package/app/.next-cli-build/server/app/api/auth/ldap/test/route.js.nft.json +1 -1
  72. package/app/.next-cli-build/server/app/api/auth/ldap/users/route.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  75. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  79. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  81. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/autostart/route.js.nft.json +1 -1
  82. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/prompt-log-db/route.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/root-ca/route.js.nft.json +1 -1
  84. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  85. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  87. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  88. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  90. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  91. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  93. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  96. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  98. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  102. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/[id]/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/dashboard/prompt-logs/route.js.nft.json +1 -1
  104. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  108. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  110. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  112. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  113. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  114. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  116. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  117. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  118. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  120. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  122. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  123. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  125. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  127. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  129. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  130. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  132. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/provider-health/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/provider-health/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  149. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  162. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  164. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  166. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  168. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  172. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  174. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  178. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/tunnel/tailscale-login/route.js.nft.json +1 -1
  188. package/app/.next-cli-build/server/app/api/tunnel/tailscale-start-daemon/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  192. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  194. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  201. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  212. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  213. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  214. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  216. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  227. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/version/restart/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/version/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.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  238. package/app/.next-cli-build/server/app/callback.html +1 -1
  239. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  240. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  241. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  242. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +4 -4
  243. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  244. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  245. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  246. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  248. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  249. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  250. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  252. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  253. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  254. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +4 -4
  255. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  256. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  258. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  259. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  260. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  262. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  263. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +4 -4
  265. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  266. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  267. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  268. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  269. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  272. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  273. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +4 -4
  275. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  276. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  277. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +7 -7
  278. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +3 -3
  279. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  280. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  281. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  282. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +7 -7
  283. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +4 -4
  285. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  286. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  287. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  288. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  289. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  290. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  291. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  293. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  294. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +4 -4
  296. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  297. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  299. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  300. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  301. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  303. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  304. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  305. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +4 -4
  306. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  307. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  309. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +1 -1
  310. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  311. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  313. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  314. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +4 -4
  316. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  317. package/app/.next-cli-build/server/app/dashboard/prompt-logs.html +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/prompt-logs.rsc +5 -5
  319. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs/__PAGE__.segment.rsc +1 -1
  320. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard/prompt-logs.segment.rsc +1 -1
  321. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  323. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_full.segment.rsc +5 -5
  324. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_head.segment.rsc +1 -1
  325. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_index.segment.rsc +4 -4
  326. package/app/.next-cli-build/server/app/dashboard/prompt-logs.segments/_tree.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard/provider-health.html +1 -1
  328. package/app/.next-cli-build/server/app/dashboard/provider-health.rsc +5 -5
  329. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health/__PAGE__.segment.rsc +1 -1
  330. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard/provider-health.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  332. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  333. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_full.segment.rsc +5 -5
  334. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_head.segment.rsc +1 -1
  335. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_index.segment.rsc +4 -4
  336. package/app/.next-cli-build/server/app/dashboard/provider-health.segments/_tree.segment.rsc +2 -2
  337. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  338. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  339. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  340. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  341. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  342. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  343. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  344. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  345. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  346. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +4 -4
  347. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  348. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  349. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  350. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  351. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  352. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  353. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  354. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  355. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +4 -4
  357. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  358. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  359. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  360. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  361. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  362. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  363. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  364. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  365. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  366. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +4 -4
  367. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  368. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  369. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  370. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  371. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  372. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  373. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  374. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  375. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  376. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +4 -4
  377. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  378. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  380. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  381. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  382. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  383. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  384. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +4 -4
  385. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  386. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  387. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  388. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  389. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  390. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  391. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  392. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  393. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  394. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  395. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  396. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  397. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  398. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +4 -4
  399. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  400. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  401. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  402. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  403. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  404. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  405. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  406. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  407. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  408. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +4 -4
  409. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  410. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  411. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  412. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  413. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  414. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  415. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  416. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  417. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  418. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +4 -4
  419. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  420. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  421. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  422. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  423. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  424. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  425. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  426. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  427. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +4 -4
  428. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  429. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  430. package/app/.next-cli-build/server/app/index.html +1 -1
  431. package/app/.next-cli-build/server/app/index.rsc +4 -4
  432. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  433. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  434. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  435. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +4 -4
  436. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  437. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  438. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  439. package/app/.next-cli-build/server/app/landing.html +1 -1
  440. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  441. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  442. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  443. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +4 -4
  444. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  445. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  446. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  447. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  448. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  449. package/app/.next-cli-build/server/app/login.html +1 -1
  450. package/app/.next-cli-build/server/app/login.rsc +4 -4
  451. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  452. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  453. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +4 -4
  454. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  455. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +1 -1
  456. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  457. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  458. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  460. package/app/.next-cli-build/server/app-paths-manifest.json +2 -2
  461. package/app/.next-cli-build/server/chunks/{1850.js → 1336.js} +1 -1
  462. package/app/.next-cli-build/server/chunks/2549.js +1 -0
  463. package/app/.next-cli-build/server/chunks/3104.js +1 -1
  464. package/app/.next-cli-build/server/chunks/3110.js +1 -1
  465. package/app/.next-cli-build/server/chunks/4632.js +1 -1
  466. package/app/.next-cli-build/server/chunks/4746.js +1 -1
  467. package/app/.next-cli-build/server/chunks/4867.js +1 -0
  468. package/app/.next-cli-build/server/chunks/4884.js +2 -2
  469. package/app/.next-cli-build/server/chunks/6604.js +1 -1
  470. package/app/.next-cli-build/server/chunks/7130.js +1 -1
  471. package/app/.next-cli-build/server/chunks/7153.js +1 -1
  472. package/app/.next-cli-build/server/chunks/918.js +1 -1
  473. package/app/.next-cli-build/server/chunks/9489.js +1 -1
  474. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  475. package/app/.next-cli-build/server/middleware.js +2 -2
  476. package/app/.next-cli-build/server/pages/404.html +1 -1
  477. package/app/.next-cli-build/server/pages/500.html +1 -1
  478. package/app/.next-cli-build/static/chunks/{1321-ec91d8042c9c4ec5.js → 1321-fb67d640116d0bbf.js} +1 -1
  479. package/app/.next-cli-build/static/chunks/{5497-31de2efdeddd7fc5.js → 5497-d2701f95536e24cc.js} +3 -3
  480. package/app/.next-cli-build/static/chunks/7055-827f7946161347b5.js +1 -0
  481. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-82be3137baaf2025.js +1 -0
  482. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-ab056ee5037345c4.js +3 -0
  483. package/app/.next-cli-build/static/css/3a67cc4681c0b941.css +1 -0
  484. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-1.0.83-to-1.0.84-1.0.84-20260609-082756/data.sqlite +0 -0
  485. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/upgrade-1.0.84-to-1.0.85-1.0.85-20260609-084951/data.sqlite +0 -0
  486. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-shm +0 -0
  487. package/app/cli/.build-home/AppData/Roaming/bluerouter/db/data.sqlite-wal +0 -0
  488. package/app/package.json +1 -1
  489. package/package.json +1 -1
  490. package/app/.next-cli-build/server/chunks/4177.js +0 -1
  491. package/app/.next-cli-build/static/chunks/7055-e70807a3a34c0ede.js +0 -1
  492. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-fa7f1ff2429b81f1.js +0 -1
  493. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-322409a7d067a9ba.js +0 -3
  494. package/app/.next-cli-build/static/css/9fe572f5db18fa52.css +0 -1
  495. /package/app/.next-cli-build/static/{R24qfjQevGqknodafpTPA → M7HJgyu3JZrBGy679ouOd}/_buildManifest.js +0 -0
  496. /package/app/.next-cli-build/static/{R24qfjQevGqknodafpTPA → M7HJgyu3JZrBGy679ouOd}/_ssgManifest.js +0 -0
  497. /package/app/cli/.build-home/AppData/Roaming/bluerouter/db/backups/{upgrade-1.0.79-to-1.0.80-1.0.80-20260608-234103 → upgrade-1.0.82-to-1.0.83-1.0.83-20260609-082618}/data.sqlite +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7055],{39768:(e,t,n)=>{n.d(t,{$$:()=>p,Es:()=>f,KG:()=>b,Ks:()=>R,Ll:()=>o,Re:()=>C,Sw:()=>i,TW:()=>h,WQ:()=>D,YG:()=>x,YN:()=>v,ZC:()=>y,_q:()=>g,ag:()=>T,e_:()=>S,jn:()=>l,kx:()=>M,l6:()=>a,lk:()=>m,sb:()=>c,wz:()=>s,xZ:()=>d,zk:()=>u});var r=n(12115);function l(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,r.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}let i="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function a(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function o(e){return"nodeType"in e}function u(e){var t,n;return e?a(e)?e:o(e)&&null!=(t=null==(n=e.ownerDocument)?void 0:n.defaultView)?t:window:window}function s(e){let{Document:t}=u(e);return e instanceof t}function c(e){return!a(e)&&e instanceof u(e).HTMLElement}function d(e){return e instanceof u(e).SVGElement}function h(e){return e?a(e)?e.document:o(e)?s(e)?e:c(e)||d(e)?e.ownerDocument:document:document:document}let f=i?r.useLayoutEffect:r.useEffect;function g(e){let t=(0,r.useRef)(e);return f(()=>{t.current=e}),(0,r.useCallback)(function(){for(var e=arguments.length,n=Array(e),r=0;r<e;r++)n[r]=arguments[r];return null==t.current?void 0:t.current(...n)},[])}function p(){let e=(0,r.useRef)(null);return[(0,r.useCallback)((t,n)=>{e.current=setInterval(t,n)},[]),(0,r.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function v(e,t){void 0===t&&(t=[e]);let n=(0,r.useRef)(e);return f(()=>{n.current!==e&&(n.current=e)},t),n}function b(e,t){let n=(0,r.useRef)();return(0,r.useMemo)(()=>{let t=e(n.current);return n.current=t,t},[...t])}function m(e){let t=g(e),n=(0,r.useRef)(null),l=(0,r.useCallback)(e=>{e!==n.current&&(null==t||t(e,n.current)),n.current=e},[]);return[n,l]}function y(e){let t=(0,r.useRef)();return(0,r.useEffect)(()=>{t.current=e},[e]),t.current}let w={};function x(e,t){return(0,r.useMemo)(()=>{if(t)return t;let n=null==w[e]?0:w[e]+1;return w[e]=n,e+"-"+n},[e,t])}function E(e){return function(t){for(var n=arguments.length,r=Array(n>1?n-1:0),l=1;l<n;l++)r[l-1]=arguments[l];return r.reduce((t,n)=>{for(let[r,l]of Object.entries(n)){let n=t[r];null!=n&&(t[r]=n+e*l)}return t},{...t})}}let D=E(1),C=E(-1);function M(e){if(!e)return!1;let{KeyboardEvent:t}=u(e.target);return t&&e instanceof t}function S(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=u(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let R=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[R.Translate.toString(e),R.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),k="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function T(e){return e.matches(k)?e:e.querySelector(k)}},44923:(e,t,n)=>{n.d(t,{Mp:()=>eG,vL:()=>p,uN:()=>eg,AN:()=>ey,fp:()=>j,y$:()=>U,Sj:()=>H,Vy:()=>F,sl:()=>J,fF:()=>eJ,PM:()=>eV,zM:()=>eZ,MS:()=>I,FR:()=>z});var r,l,i,a,o,u,s,c,d,h,f,g,p,v,b,m,y,w,x,E=n(12115),D=n(47650),C=n(39768);let M={display:"none"};function S(e){let{id:t,value:n}=e;return E.createElement("div",{id:t,style:M},n)}function R(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;return E.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":r,"aria-atomic":!0},n)}let k=(0,E.createContext)(null),T={draggable:"\n To pick up a draggable item, press the space bar.\n While dragging, use the arrow keys to move the item.\n Press space again to drop the item in its new position, or press escape to cancel.\n "},L={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function N(e){var t;let n,{announcements:r=L,container:l,hiddenTextDescribedById:i,screenReaderInstructions:a=T}=e,{announce:o,announcement:u}=function(){let[e,t]=(0,E.useState)("");return{announce:(0,E.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),s=(0,C.YG)("DndLiveRegion"),[c,d]=(0,E.useState)(!1);if((0,E.useEffect)(()=>{d(!0)},[]),t=(0,E.useMemo)(()=>({onDragStart(e){let{active:t}=e;o(r.onDragStart({active:t}))},onDragMove(e){let{active:t,over:n}=e;r.onDragMove&&o(r.onDragMove({active:t,over:n}))},onDragOver(e){let{active:t,over:n}=e;o(r.onDragOver({active:t,over:n}))},onDragEnd(e){let{active:t,over:n}=e;o(r.onDragEnd({active:t,over:n}))},onDragCancel(e){let{active:t,over:n}=e;o(r.onDragCancel({active:t,over:n}))}}),[o,r]),n=(0,E.useContext)(k),(0,E.useEffect)(()=>{if(!n)throw Error("useDndMonitor must be used within a children of <DndContext>");return n(t)},[t,n]),!c)return null;let h=E.createElement(E.Fragment,null,E.createElement(S,{id:i,value:a.draggable}),E.createElement(R,{id:s,announcement:u}));return l?(0,D.createPortal)(h,l):h}function O(){}function I(e,t){return(0,E.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function z(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,E.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(r=h||(h={})).DragStart="dragStart",r.DragMove="dragMove",r.DragEnd="dragEnd",r.DragCancel="dragCancel",r.DragOver="dragOver",r.RegisterDroppable="registerDroppable",r.SetDroppableDisabled="setDroppableDisabled",r.UnregisterDroppable="unregisterDroppable";let A=Object.freeze({x:0,y:0});function P(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function W(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Y(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function B(e){let{left:t,top:n,height:r,width:l}=e;return[{x:t,y:n},{x:t+l,y:n},{x:t,y:n+r},{x:t+l,y:n+r}]}function F(e,t){if(!e||0===e.length)return null;let[n]=e;return t?n[t]:n}function K(e,t,n){return void 0===t&&(t=e.left),void 0===n&&(n=e.top),{x:t+.5*e.width,y:n+.5*e.height}}let j=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=K(t,t.left,t.top),i=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=P(K(r),l);i.push({id:t,data:{droppableContainer:e,value:n}})}}return i.sort(W)},U=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=B(t),i=[];for(let e of r){let{id:t}=e,r=n.get(t);if(r){let n=B(r),a=Number((l.reduce((e,t,r)=>e+P(n[r],t),0)/4).toFixed(4));i.push({id:t,data:{droppableContainer:e,value:a}})}}return i.sort(W)},_=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e,l=[];for(let e of r){let{id:r}=e,i=n.get(r);if(i){let n=function(e,t){let n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),l=Math.min(t.left+t.width,e.left+e.width),i=Math.min(t.top+t.height,e.top+e.height);if(r<l&&n<i){let a=t.width*t.height,o=e.width*e.height,u=(l-r)*(i-n);return Number((u/(a+o-u)).toFixed(4))}return 0}(i,t);n>0&&l.push({id:r,data:{droppableContainer:e,value:n}})}}return l.sort(Y)};function X(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:A}let G=function(e){for(var t=arguments.length,n=Array(t>1?t-1:0),r=1;r<t;r++)n[r-1]=arguments[r];return n.reduce((e,t)=>({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})},q={ignoreTransform:!1};function H(e,t){void 0===t&&(t=q);let n=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:r}=(0,C.zk)(e).getComputedStyle(e);t&&(n=function(e,t,n){let r=function(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}(t);if(!r)return e;let{scaleX:l,scaleY:i,x:a,y:o}=r,u=e.left-a-(1-l)*parseFloat(n),s=e.top-o-(1-i)*parseFloat(n.slice(n.indexOf(" ")+1)),c=l?e.width/l:e.width,d=i?e.height/i:e.height;return{width:c,height:d,top:s,right:u+c,bottom:s+d,left:u}}(n,t,r))}let{top:r,left:l,width:i,height:a,bottom:o,right:u}=n;return{top:r,left:l,width:i,height:a,bottom:o,right:u}}function V(e){return H(e,{ignoreTransform:!0})}function J(e,t){let n=[];return e?function r(l){var i,a;let o;if(null!=t&&n.length>=t||!l)return n;if((0,C.wz)(l)&&null!=l.scrollingElement&&!n.includes(l.scrollingElement))return n.push(l.scrollingElement),n;if(!(0,C.sb)(l)||(0,C.xZ)(l)||n.includes(l))return n;let u=(0,C.zk)(e).getComputedStyle(l);return(l!==e&&(void 0===(i=u)&&(i=(0,C.zk)(l).getComputedStyle(l)),o=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=i[e];return"string"==typeof t&&o.test(t)}))&&n.push(l),void 0===(a=u)&&(a=(0,C.zk)(l).getComputedStyle(l)),"fixed"===a.position)?n:r(l.parentNode)}(e):n}function Q(e){let[t]=J(e,1);return null!=t?t:null}function Z(e){return C.Sw&&e?(0,C.l6)(e)?e:(0,C.Ll)(e)?(0,C.wz)(e)||e===(0,C.TW)(e).scrollingElement?window:(0,C.sb)(e)?e:null:null:null}function $(e){return(0,C.l6)(e)?e.scrollX:e.scrollLeft}function ee(e){return(0,C.l6)(e)?e.scrollY:e.scrollTop}function et(e){return{x:$(e),y:ee(e)}}function en(e){return!!C.Sw&&!!e&&e===document.scrollingElement}function er(e){let t={x:0,y:0},n=en(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},l=e.scrollTop<=t.y,i=e.scrollLeft<=t.x;return{isTop:l,isLeft:i,isBottom:e.scrollTop>=r.y,isRight:e.scrollLeft>=r.x,maxScroll:r,minScroll:t}}(l=f||(f={}))[l.Forward=1]="Forward",l[l.Backward=-1]="Backward";let el={x:.2,y:.2};function ei(e){return e.reduce((e,t)=>(0,C.WQ)(e,et(t)),A)}let ea=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+$(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+ee(t),0)}]];class eo{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const n=J(t),r=ei(n);for(const[t,l,i]of(this.rect={...e},this.width=e.width,this.height=e.height,ea))for(const e of l)Object.defineProperty(this,e,{get:()=>{let l=i(n),a=r[t]-l;return this.rect[e]+a},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class eu{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,n){var r;null==(r=this.target)||r.addEventListener(e,t,n),this.listeners.push([e,t,n])}}function es(e,t){let n=Math.abs(e.x),r=Math.abs(e.y);return"number"==typeof t?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t&&r>t.y}function ec(e){e.preventDefault()}function ed(e){e.stopPropagation()}(i=g||(g={})).Click="click",i.DragStart="dragstart",i.Keydown="keydown",i.ContextMenu="contextmenu",i.Resize="resize",i.SelectionChange="selectionchange",i.VisibilityChange="visibilitychange",(a=p||(p={})).Space="Space",a.Down="ArrowDown",a.Right="ArrowRight",a.Left="ArrowLeft",a.Up="ArrowUp",a.Esc="Escape",a.Enter="Enter",a.Tab="Tab";let eh={start:[p.Space,p.Enter],cancel:[p.Esc],end:[p.Space,p.Enter,p.Tab]},ef=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case p.Right:return{...n,x:n.x+25};case p.Left:return{...n,x:n.x-25};case p.Down:return{...n,y:n.y+25};case p.Up:return{...n,y:n.y-25}}};class eg{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new eu((0,C.TW)(t)),this.windowListeners=new eu((0,C.zk)(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(g.Resize,this.handleCancel),this.windowListeners.add(g.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(g.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,n=e.node.current;n&&function(e,t){if(void 0===t&&(t=H),!e)return;let{top:n,left:r,bottom:l,right:i}=t(e);Q(e)&&(l<=0||i<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}(n),t(A)}handleKeyDown(e){if((0,C.kx)(e)){let{active:t,context:n,options:r}=this.props,{keyboardCodes:l=eh,coordinateGetter:i=ef,scrollBehavior:a="smooth"}=r,{code:o}=e;if(l.end.includes(o))return void this.handleEnd(e);if(l.cancel.includes(o))return void this.handleCancel(e);let{collisionRect:u}=n.current,s=u?{x:u.left,y:u.top}:A;this.referenceCoordinates||(this.referenceCoordinates=s);let c=i(e,{active:t,context:n.current,currentCoordinates:s});if(c){let t=(0,C.Re)(c,s),r={x:0,y:0},{scrollableAncestors:l}=n.current;for(let n of l){let l=e.code,{isTop:i,isRight:o,isLeft:u,isBottom:s,maxScroll:d,minScroll:h}=er(n),f=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:n,right:r,bottom:l}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:l,width:e.clientWidth,height:e.clientHeight}}(n),g={x:Math.min(l===p.Right?f.right-f.width/2:f.right,Math.max(l===p.Right?f.left:f.left+f.width/2,c.x)),y:Math.min(l===p.Down?f.bottom-f.height/2:f.bottom,Math.max(l===p.Down?f.top:f.top+f.height/2,c.y))},v=l===p.Right&&!o||l===p.Left&&!u,b=l===p.Down&&!s||l===p.Up&&!i;if(v&&g.x!==c.x){let e=n.scrollLeft+t.x,i=l===p.Right&&e<=d.x||l===p.Left&&e>=h.x;if(i&&!t.y)return void n.scrollTo({left:e,behavior:a});i?r.x=n.scrollLeft-e:r.x=l===p.Right?n.scrollLeft-d.x:n.scrollLeft-h.x,r.x&&n.scrollBy({left:-r.x,behavior:a});break}if(b&&g.y!==c.y){let e=n.scrollTop+t.y,i=l===p.Down&&e<=d.y||l===p.Up&&e>=h.y;if(i&&!t.x)return void n.scrollTo({top:e,behavior:a});i?r.y=n.scrollTop-e:r.y=l===p.Down?n.scrollTop-d.y:n.scrollTop-h.y,r.y&&n.scrollBy({top:-r.y,behavior:a});break}}this.handleMove(e,(0,C.WQ)((0,C.Re)(c,this.referenceCoordinates),r))}}}handleMove(e,t){let{onMove:n}=this.props;e.preventDefault(),n(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function ep(e){return!!(e&&"distance"in e)}function ev(e){return!!(e&&"delay"in e)}eg.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=eh,onActivation:l}=t,{active:i}=n,{code:a}=e.nativeEvent;if(r.start.includes(a)){let t=i.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==l||l({event:e.nativeEvent}),!0)}return!1}}];class eb{constructor(e,t,n){var r;void 0===n&&(n=function(e){let{EventTarget:t}=(0,C.zk)(e);return e instanceof t?e:(0,C.TW)(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:l}=e,{target:i}=l;this.props=e,this.events=t,this.document=(0,C.TW)(i),this.documentListeners=new eu(this.document),this.listeners=new eu(n),this.windowListeners=new eu((0,C.zk)(i)),this.initialCoordinates=null!=(r=(0,C.e_)(l))?r:A,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:n}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(g.Resize,this.handleCancel),this.windowListeners.add(g.DragStart,ec),this.windowListeners.add(g.VisibilityChange,this.handleCancel),this.windowListeners.add(g.ContextMenu,ec),this.documentListeners.add(g.Keydown,this.handleKeydown),t){if(null!=n&&n({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(ev(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(ep(t))return void this.handlePending(t)}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:n,onPending:r}=this.props;r(n,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(g.Click,ed,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(g.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:n,initialCoordinates:r,props:l}=this,{onMove:i,options:{activationConstraint:a}}=l;if(!r)return;let o=null!=(t=(0,C.e_)(e))?t:A,u=(0,C.Re)(r,o);if(!n&&a){if(ep(a)){if(null!=a.tolerance&&es(u,a.tolerance))return this.handleCancel();if(es(u,a.distance))return this.handleStart()}return ev(a)&&es(u,a.tolerance)?this.handleCancel():void this.handlePending(a,u)}e.cancelable&&e.preventDefault(),i(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===p.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let em={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class ey extends eb{constructor(e){const{event:t}=e;super(e,em,(0,C.TW)(t.target))}}ey.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!!n.isPrimary&&0===n.button&&(null==r||r({event:n}),!0)}}];let ew={move:{name:"mousemove"},end:{name:"mouseup"}};(o=v||(v={}))[o.RightClick=2]="RightClick";class ex extends eb{constructor(e){super(e,ew,(0,C.TW)(e.event.target))}}ex.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button!==v.RightClick&&(null==r||r({event:n}),!0)}}];let eE={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class eD extends eb{constructor(e){super(e,eE)}static setup(){return window.addEventListener(eE.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(eE.move.name,e)};function e(){}}}eD.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t,{touches:l}=n;return!(l.length>1)&&(null==r||r({event:n}),!0)}}],(u=b||(b={}))[u.Pointer=0]="Pointer",u[u.DraggableRect=1]="DraggableRect",(s=m||(m={}))[s.TreeOrder=0]="TreeOrder",s[s.ReversedTreeOrder=1]="ReversedTreeOrder";let eC={x:{[f.Backward]:!1,[f.Forward]:!1},y:{[f.Backward]:!1,[f.Forward]:!1}};(c=y||(y={}))[c.Always=0]="Always",c[c.BeforeDragging=1]="BeforeDragging",c[c.WhileDragging=2]="WhileDragging",(w||(w={})).Optimized="optimized";let eM=new Map;function eS(e,t){return(0,C.KG)(n=>e?n||("function"==typeof t?t(e):e):null,[t,e])}function eR(e){let{callback:t,disabled:n}=e,r=(0,C._q)(t),l=(0,E.useMemo)(()=>{if(n||"u"<typeof window||void 0===window.ResizeObserver)return;let{ResizeObserver:e}=window;return new e(r)},[n]);return(0,E.useEffect)(()=>()=>null==l?void 0:l.disconnect(),[l]),l}function ek(e){return new eo(H(e),e)}function eT(e,t,n){void 0===t&&(t=ek);let[r,l]=(0,E.useState)(null);function i(){l(r=>{if(!e)return null;if(!1===e.isConnected){var l;return null!=(l=null!=r?r:n)?l:null}let i=t(e);return JSON.stringify(r)===JSON.stringify(i)?r:i})}let a=function(e){let{callback:t,disabled:n}=e,r=(0,C._q)(t),l=(0,E.useMemo)(()=>{if(n||"u"<typeof window||void 0===window.MutationObserver)return;let{MutationObserver:e}=window;return new e(r)},[r,n]);return(0,E.useEffect)(()=>()=>null==l?void 0:l.disconnect(),[l]),l}({callback(t){if(e)for(let n of t){let{type:t,target:r}=n;if("childList"===t&&r instanceof HTMLElement&&r.contains(e)){i();break}}}}),o=eR({callback:i});return(0,C.Es)(()=>{i(),e?(null==o||o.observe(e),null==a||a.observe(document.body,{childList:!0,subtree:!0})):(null==o||o.disconnect(),null==a||a.disconnect())},[e]),r}let eL=[];function eN(e,t){void 0===t&&(t=[]);let n=(0,E.useRef)(null);return(0,E.useEffect)(()=>{n.current=null},t),(0,E.useEffect)(()=>{let t=e!==A;t&&!n.current&&(n.current=e),!t&&n.current&&(n.current=null)},[e]),n.current?(0,C.Re)(e,n.current):A}function eO(e){return(0,E.useMemo)(()=>{let t,n;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:n=e.innerHeight,width:t,height:n}):null},[e])}let eI=[],ez=[{sensor:ey,options:{}},{sensor:eg,options:{}}],eA={current:{}},eP={draggable:{measure:V},droppable:{measure:V,strategy:y.WhileDragging,frequency:w.Optimized},dragOverlay:{measure:H}};class eW extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,n;return null!=(t=null==(n=this.get(e))?void 0:n.node.current)?t:void 0}}let eY={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new eW,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:O},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:eP,measureDroppableContainers:O,windowRect:null,measuringScheduled:!1},eB={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:O,draggableNodes:new Map,over:null,measureDroppableContainers:O},eF=(0,E.createContext)(eB),eK=(0,E.createContext)(eY);function ej(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new eW}}}function eU(e,t){switch(t.type){case h.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case h.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case h.DragEnd:case h.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case h.RegisterDroppable:{let{element:n}=t,{id:r}=n,l=new eW(e.droppable.containers);return l.set(r,n),{...e,droppable:{...e.droppable,containers:l}}}case h.SetDroppableDisabled:{let{id:n,key:r,disabled:l}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;let a=new eW(e.droppable.containers);return a.set(n,{...i,disabled:l}),{...e,droppable:{...e.droppable,containers:a}}}case h.UnregisterDroppable:{let{id:n,key:r}=t,l=e.droppable.containers.get(n);if(!l||r!==l.key)return e;let i=new eW(e.droppable.containers);return i.delete(n),{...e,droppable:{...e.droppable,containers:i}}}default:return e}}function e_(e){let{disabled:t}=e,{active:n,activatorEvent:r,draggableNodes:l}=(0,E.useContext)(eF),i=(0,C.ZC)(r),a=(0,C.ZC)(null==n?void 0:n.id);return(0,E.useEffect)(()=>{if(!t&&!r&&i&&null!=a){if(!(0,C.kx)(i)||document.activeElement===i.target)return;let e=l.get(a);if(!e)return;let{activatorNode:t,node:n}=e;(t.current||n.current)&&requestAnimationFrame(()=>{for(let e of[t.current,n.current]){if(!e)continue;let t=(0,C.ag)(e);if(t){t.focus();break}}})}},[r,t,l,a,i]),null}let eX=(0,E.createContext)({...A,scaleX:1,scaleY:1});(d=x||(x={}))[d.Uninitialized=0]="Uninitialized",d[d.Initializing=1]="Initializing",d[d.Initialized=2]="Initialized";let eG=(0,E.memo)(function(e){var t,n,r,l,i,a,o,u;let s,c,d,g,p,v,w,M,{id:S,accessibility:R,autoScroll:T=!0,children:L,sensors:O=ez,collisionDetection:I=_,measuring:z,modifiers:P,...W}=e,[Y,B]=(0,E.useReducer)(eU,void 0,ej),[K,j]=function(){let[e]=(0,E.useState)(()=>new Set),t=(0,E.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,E.useCallback)(t=>{let{type:n,event:r}=t;e.forEach(e=>{var t;return null==(t=e[n])?void 0:t.call(e,r)})},[e]),t]}(),[U,q]=(0,E.useState)(x.Uninitialized),V=U===x.Initialized,{draggable:{active:$,nodes:ee,translate:ea},droppable:{containers:eu}}=Y,es=null!=$?ee.get($):null,ec=(0,E.useRef)({initial:null,translated:null}),ed=(0,E.useMemo)(()=>{var e;return null!=$?{id:$,data:null!=(e=null==es?void 0:es.data)?e:eA,rect:ec}:null},[$,es]),eh=(0,E.useRef)(null),[ef,eg]=(0,E.useState)(null),[ep,ev]=(0,E.useState)(null),eb=(0,C.YN)(W,Object.values(W)),em=(0,C.YG)("DndDescribedBy",S),ey=(0,E.useMemo)(()=>eu.getEnabled(),[eu]),ew=(0,E.useMemo)(()=>({draggable:{...eP.draggable,...null==z?void 0:z.draggable},droppable:{...eP.droppable,...null==z?void 0:z.droppable},dragOverlay:{...eP.dragOverlay,...null==z?void 0:z.dragOverlay}}),[null==z?void 0:z.draggable,null==z?void 0:z.droppable,null==z?void 0:z.dragOverlay]),{droppableRects:ex,measureDroppableContainers:eE,measuringScheduled:eD}=function(e,t){let{dragging:n,dependencies:r,config:l}=t,[i,a]=(0,E.useState)(null),{frequency:o,measure:u,strategy:s}=l,c=(0,E.useRef)(e),d=function(){switch(s){case y.Always:return!1;case y.BeforeDragging:return n;default:return!n}}(),h=(0,C.YN)(d),f=(0,E.useCallback)(function(e){void 0===e&&(e=[]),h.current||a(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))},[h]),g=(0,E.useRef)(null),p=(0,C.KG)(t=>{if(d&&!n)return eM;if(!t||t===eM||c.current!==e||null!=i){let t=new Map;for(let n of e){if(!n)continue;if(i&&i.length>0&&!i.includes(n.id)&&n.rect.current){t.set(n.id,n.rect.current);continue}let e=n.node.current,r=e?new eo(u(e),e):null;n.rect.current=r,r&&t.set(n.id,r)}return t}return t},[e,i,n,d,u]);return(0,E.useEffect)(()=>{c.current=e},[e]),(0,E.useEffect)(()=>{d||f()},[n,d]),(0,E.useEffect)(()=>{i&&i.length>0&&a(null)},[JSON.stringify(i)]),(0,E.useEffect)(()=>{d||"number"!=typeof o||null!==g.current||(g.current=setTimeout(()=>{f(),g.current=null},o))},[o,d,f,...r]),{droppableRects:p,measureDroppableContainers:f,measuringScheduled:null!=i}}(ey,{dragging:V,dependencies:[ea.x,ea.y],config:ew.droppable}),ek=(p=(g=null!=$?ee.get($):void 0)?g.node.current:null,(0,C.KG)(e=>{var t;return null==$?null:null!=(t=null!=p?p:e)?t:null},[p,$])),eW=(0,E.useMemo)(()=>ep?(0,C.e_)(ep):null,[ep]),eY=(s=(null==ef?void 0:ef.autoScrollEnabled)===!1,c="object"==typeof T?!1===T.enabled:!1===T,d=V&&!s&&!c,"object"==typeof T?{...T,enabled:d}:{enabled:d}),eB=eS(ek,ew.draggable.measure);!function(e){let{activeNode:t,measure:n,initialRect:r,config:l=!0}=e,i=(0,E.useRef)(!1),{x:a,y:o}="boolean"==typeof l?{x:l,y:l}:l;(0,C.Es)(()=>{if(!a&&!o||!t){i.current=!1;return}if(i.current||!r)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let l=X(n(e),r);if(a||(l.x=0),o||(l.y=0),i.current=!0,Math.abs(l.x)>0||Math.abs(l.y)>0){let t=Q(e);t&&t.scrollBy({top:l.y,left:l.x})}},[t,a,o,r,n])}({activeNode:null!=$?ee.get($):null,config:eY.layoutShiftCompensation,initialRect:eB,measure:ew.draggable.measure});let eG=eT(ek,ew.draggable.measure,eB),eq=eT(ek?ek.parentElement:null),eH=(0,E.useRef)({activatorEvent:null,active:null,activeNode:ek,collisionRect:null,collisions:null,droppableRects:ex,draggableNodes:ee,draggingNode:null,draggingNodeRect:null,droppableContainers:eu,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),eV=eu.getNodeFor(null==(t=eH.current.over)?void 0:t.id),eJ=function(e){let{measure:t}=e,[n,r]=(0,E.useState)(null),l=eR({callback:(0,E.useCallback)(e=>{for(let{target:n}of e)if((0,C.sb)(n)){r(e=>{let r=t(n);return e?{...e,width:r.width,height:r.height}:r});break}},[t])}),i=(0,E.useCallback)(e=>{let n=function(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return(0,C.sb)(t)?t:e}(e);null==l||l.disconnect(),n&&(null==l||l.observe(n)),r(n?t(n):null)},[t,l]),[a,o]=(0,C.lk)(i);return(0,E.useMemo)(()=>({nodeRef:a,rect:n,setRef:o}),[n,a,o])}({measure:ew.dragOverlay.measure}),eQ=null!=(n=eJ.nodeRef.current)?n:ek,eZ=V?null!=(r=eJ.rect)?r:eG:null,e$=!!(eJ.nodeRef.current&&eJ.rect),e0=(v=eS(i=e$?null:eG),X(i,v)),e1=eO(eQ?(0,C.zk)(eQ):null),e2=(a=V?null!=eV?eV:ek:null,w=(0,E.useRef)(a),M=(0,C.KG)(e=>a?e&&e!==eL&&a&&w.current&&a.parentNode===w.current.parentNode?e:J(a):eL,[a]),(0,E.useEffect)(()=>{w.current=a},[a]),M),e5=function(e,t){void 0===t&&(t=H);let[n]=e,r=eO(n?(0,C.zk)(n):null),[l,i]=(0,E.useState)(eI);function a(){i(()=>e.length?e.map(e=>en(e)?r:new eo(t(e),e)):eI)}let o=eR({callback:a});return(0,C.Es)(()=>{null==o||o.disconnect(),a(),e.forEach(e=>null==o?void 0:o.observe(e))},[e]),l}(e2),e3=function(e,t){let{transform:n,...r}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...r}),n):n}(P,{transform:{x:ea.x-e0.x,y:ea.y-e0.y,scaleX:1,scaleY:1},activatorEvent:ep,active:ed,activeNodeRect:eG,containerNodeRect:eq,draggingNodeRect:eZ,over:eH.current.over,overlayNodeRect:eJ.rect,scrollableAncestors:e2,scrollableAncestorRects:e5,windowRect:e1}),e6=eW?(0,C.WQ)(eW,ea):null,e4=function(e){let[t,n]=(0,E.useState)(null),r=(0,E.useRef)(e),l=(0,E.useCallback)(e=>{let t=Z(e.target);t&&n(e=>e?(e.set(t,et(t)),new Map(e)):null)},[]);return(0,E.useEffect)(()=>{let t=r.current;if(e!==t){i(t);let a=e.map(e=>{let t=Z(e);return t?(t.addEventListener("scroll",l,{passive:!0}),[t,et(t)]):null}).filter(e=>null!=e);n(a.length?new Map(a):null),r.current=e}return()=>{i(e),i(t)};function i(e){e.forEach(e=>{let t=Z(e);null==t||t.removeEventListener("scroll",l)})}},[l,e]),(0,E.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>(0,C.WQ)(e,t),A):ei(e):A,[e,t])}(e2),e7=eN(e4),e9=eN(e4,[eG]),e8=(0,C.WQ)(e3,e7),te=eZ?G(eZ,e3):null,tt=ed&&te?I({active:ed,collisionRect:te,droppableRects:ex,droppableContainers:ey,pointerCoordinates:e6}):null,tn=F(tt,"id"),[tr,tl]=(0,E.useState)(null),ti=(o=e$?e3:(0,C.WQ)(e3,e9),u=null!=(l=null==tr?void 0:tr.rect)?l:null,{...o,scaleX:u&&eG?u.width/eG.width:1,scaleY:u&&eG?u.height/eG.height:1}),ta=(0,E.useRef)(null),to=(0,E.useCallback)((e,t)=>{let{sensor:n,options:r}=t;if(null==eh.current)return;let l=ee.get(eh.current);if(!l)return;let i=e.nativeEvent,a=new n({active:eh.current,activeNode:l,event:i,options:r,context:eH,onAbort(e){if(!ee.get(e))return;let{onDragAbort:t}=eb.current,n={id:e};null==t||t(n),K({type:"onDragAbort",event:n})},onPending(e,t,n,r){if(!ee.get(e))return;let{onDragPending:l}=eb.current,i={id:e,constraint:t,initialCoordinates:n,offset:r};null==l||l(i),K({type:"onDragPending",event:i})},onStart(e){let t=eh.current;if(null==t)return;let n=ee.get(t);if(!n)return;let{onDragStart:r}=eb.current,l={activatorEvent:i,active:{id:t,data:n.data,rect:ec}};(0,D.unstable_batchedUpdates)(()=>{null==r||r(l),q(x.Initializing),B({type:h.DragStart,initialCoordinates:e,active:t}),K({type:"onDragStart",event:l}),eg(ta.current),ev(i)})},onMove(e){B({type:h.DragMove,coordinates:e})},onEnd:o(h.DragEnd),onCancel:o(h.DragCancel)});function o(e){return async function(){let{active:t,collisions:n,over:r,scrollAdjustedTranslate:l}=eH.current,a=null;if(t&&l){let{cancelDrop:o}=eb.current;a={activatorEvent:i,active:t,collisions:n,delta:l,over:r},e===h.DragEnd&&"function"==typeof o&&await Promise.resolve(o(a))&&(e=h.DragCancel)}eh.current=null,(0,D.unstable_batchedUpdates)(()=>{B({type:e}),q(x.Uninitialized),tl(null),eg(null),ev(null),ta.current=null;let t=e===h.DragEnd?"onDragEnd":"onDragCancel";if(a){let e=eb.current[t];null==e||e(a),K({type:t,event:a})}})}}ta.current=a},[ee]),tu=(0,E.useCallback)((e,t)=>(n,r)=>{let l=n.nativeEvent,i=ee.get(r);null!==eh.current||!i||l.dndKit||l.defaultPrevented||!0===e(n,t.options,{active:i})&&(l.dndKit={capturedBy:t.sensor},eh.current=r,to(n,t))},[ee,to]),ts=(0,E.useMemo)(()=>O.reduce((e,t)=>{let{sensor:n}=t;return[...e,...n.activators.map(e=>({eventName:e.eventName,handler:tu(e.handler,t)}))]},[]),[O,tu]);(0,E.useEffect)(()=>{if(!C.Sw)return;let e=O.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},O.map(e=>{let{sensor:t}=e;return t})),(0,C.Es)(()=>{eG&&U===x.Initializing&&q(x.Initialized)},[eG,U]),(0,E.useEffect)(()=>{let{onDragMove:e}=eb.current,{active:t,activatorEvent:n,collisions:r,over:l}=eH.current;if(!t||!n)return;let i={active:t,activatorEvent:n,collisions:r,delta:{x:e8.x,y:e8.y},over:l};(0,D.unstable_batchedUpdates)(()=>{null==e||e(i),K({type:"onDragMove",event:i})})},[e8.x,e8.y]),(0,E.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:n,droppableContainers:r,scrollAdjustedTranslate:l}=eH.current;if(!e||null==eh.current||!t||!l)return;let{onDragOver:i}=eb.current,a=r.get(tn),o=a&&a.rect.current?{id:a.id,rect:a.rect.current,data:a.data,disabled:a.disabled}:null,u={active:e,activatorEvent:t,collisions:n,delta:{x:l.x,y:l.y},over:o};(0,D.unstable_batchedUpdates)(()=>{tl(o),null==i||i(u),K({type:"onDragOver",event:u})})},[tn]),(0,C.Es)(()=>{eH.current={activatorEvent:ep,active:ed,activeNode:ek,collisionRect:te,collisions:tt,droppableRects:ex,draggableNodes:ee,draggingNode:eQ,draggingNodeRect:eZ,droppableContainers:eu,over:tr,scrollableAncestors:e2,scrollAdjustedTranslate:e8},ec.current={initial:eZ,translated:te}},[ed,ek,tt,te,ee,eQ,eZ,ex,eu,tr,e2,e8]),function(e){let{acceleration:t,activator:n=b.Pointer,canScroll:r,draggingRect:l,enabled:i,interval:a=5,order:o=m.TreeOrder,pointerCoordinates:u,scrollableAncestors:s,scrollableAncestorRects:c,delta:d,threshold:h}=e,g=function(e){let{delta:t,disabled:n}=e,r=(0,C.ZC)(t);return(0,C.KG)(e=>{if(n||!r||!e)return eC;let l={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[f.Backward]:e.x[f.Backward]||-1===l.x,[f.Forward]:e.x[f.Forward]||1===l.x},y:{[f.Backward]:e.y[f.Backward]||-1===l.y,[f.Forward]:e.y[f.Forward]||1===l.y}}},[n,t,r])}({delta:d,disabled:!i}),[p,v]=(0,C.$$)(),y=(0,E.useRef)({x:0,y:0}),w=(0,E.useRef)({x:0,y:0}),x=(0,E.useMemo)(()=>{switch(n){case b.Pointer:return u?{top:u.y,bottom:u.y,left:u.x,right:u.x}:null;case b.DraggableRect:return l}},[n,l,u]),D=(0,E.useRef)(null),M=(0,E.useCallback)(()=>{let e=D.current;if(!e)return;let t=y.current.x*w.current.x,n=y.current.y*w.current.y;e.scrollBy(t,n)},[]),S=(0,E.useMemo)(()=>o===m.TreeOrder?[...s].reverse():s,[o,s]);(0,E.useEffect)(()=>{if(!i||!s.length||!x)return void v();for(let e of S){if((null==r?void 0:r(e))===!1)continue;let n=c[s.indexOf(e)];if(!n)continue;let{direction:l,speed:i}=function(e,t,n,r,l){let{top:i,left:a,right:o,bottom:u}=n;void 0===r&&(r=10),void 0===l&&(l=el);let{isTop:s,isBottom:c,isLeft:d,isRight:h}=er(e),g={x:0,y:0},p={x:0,y:0},v={height:t.height*l.y,width:t.width*l.x};return!s&&i<=t.top+v.height?(g.y=f.Backward,p.y=r*Math.abs((t.top+v.height-i)/v.height)):!c&&u>=t.bottom-v.height&&(g.y=f.Forward,p.y=r*Math.abs((t.bottom-v.height-u)/v.height)),!h&&o>=t.right-v.width?(g.x=f.Forward,p.x=r*Math.abs((t.right-v.width-o)/v.width)):!d&&a<=t.left+v.width&&(g.x=f.Backward,p.x=r*Math.abs((t.left+v.width-a)/v.width)),{direction:g,speed:p}}(e,n,x,t,h);for(let e of["x","y"])g[e][l[e]]||(i[e]=0,l[e]=0);if(i.x>0||i.y>0){v(),D.current=e,p(M,a),y.current=i,w.current=l;return}}y.current={x:0,y:0},w.current={x:0,y:0},v()},[t,M,r,v,i,a,JSON.stringify(x),JSON.stringify(g),p,s,S,c,JSON.stringify(h)])}({...eY,delta:ea,draggingRect:te,pointerCoordinates:e6,scrollableAncestors:e2,scrollableAncestorRects:e5});let tc=(0,E.useMemo)(()=>({active:ed,activeNode:ek,activeNodeRect:eG,activatorEvent:ep,collisions:tt,containerNodeRect:eq,dragOverlay:eJ,draggableNodes:ee,droppableContainers:eu,droppableRects:ex,over:tr,measureDroppableContainers:eE,scrollableAncestors:e2,scrollableAncestorRects:e5,measuringConfiguration:ew,measuringScheduled:eD,windowRect:e1}),[ed,ek,eG,ep,tt,eq,eJ,ee,eu,ex,tr,eE,e2,e5,ew,eD,e1]),td=(0,E.useMemo)(()=>({activatorEvent:ep,activators:ts,active:ed,activeNodeRect:eG,ariaDescribedById:{draggable:em},dispatch:B,draggableNodes:ee,over:tr,measureDroppableContainers:eE}),[ep,ts,ed,eG,B,em,ee,tr,eE]);return E.createElement(k.Provider,{value:j},E.createElement(eF.Provider,{value:td},E.createElement(eK.Provider,{value:tc},E.createElement(eX.Provider,{value:ti},L)),E.createElement(e_,{disabled:(null==R?void 0:R.restoreFocus)===!1})),E.createElement(N,{...R,hiddenTextDescribedById:em}))}),eq=(0,E.createContext)(null),eH="button";function eV(e){let{id:t,data:n,disabled:r=!1,attributes:l}=e,i=(0,C.YG)("Draggable"),{activators:a,activatorEvent:o,active:u,activeNodeRect:s,ariaDescribedById:c,draggableNodes:d,over:h}=(0,E.useContext)(eF),{role:f=eH,roleDescription:g="draggable",tabIndex:p=0}=null!=l?l:{},v=(null==u?void 0:u.id)===t,b=(0,E.useContext)(v?eX:eq),[m,y]=(0,C.lk)(),[w,x]=(0,C.lk)(),D=(0,E.useMemo)(()=>a.reduce((e,n)=>{let{eventName:r,handler:l}=n;return e[r]=e=>{l(e,t)},e},{}),[a,t]),M=(0,C.YN)(n);return(0,C.Es)(()=>(d.set(t,{id:t,key:i,node:m,activatorNode:w,data:M}),()=>{let e=d.get(t);e&&e.key===i&&d.delete(t)}),[d,t]),{active:u,activatorEvent:o,activeNodeRect:s,attributes:(0,E.useMemo)(()=>({role:f,tabIndex:p,"aria-disabled":r,"aria-pressed":!!v&&f===eH||void 0,"aria-roledescription":g,"aria-describedby":c.draggable}),[r,f,p,v,g,c.draggable]),isDragging:v,listeners:r?void 0:D,node:m,over:h,setNodeRef:y,setActivatorNodeRef:x,transform:b}}function eJ(){return(0,E.useContext)(eK)}let eQ={timeout:25};function eZ(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:l}=e,i=(0,C.YG)("Droppable"),{active:a,dispatch:o,over:u,measureDroppableContainers:s}=(0,E.useContext)(eF),c=(0,E.useRef)({disabled:n}),d=(0,E.useRef)(!1),f=(0,E.useRef)(null),g=(0,E.useRef)(null),{disabled:p,updateMeasurementsFor:v,timeout:b}={...eQ,...l},m=(0,C.YN)(null!=v?v:r),y=eR({callback:(0,E.useCallback)(()=>{if(!d.current){d.current=!0;return}null!=g.current&&clearTimeout(g.current),g.current=setTimeout(()=>{s(Array.isArray(m.current)?m.current:[m.current]),g.current=null},b)},[b]),disabled:p||!a}),w=(0,E.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),d.current=!1),e&&y.observe(e))},[y]),[x,D]=(0,C.lk)(w),M=(0,C.YN)(t);return(0,E.useEffect)(()=>{y&&x.current&&(y.disconnect(),d.current=!1,y.observe(x.current))},[x,y]),(0,E.useEffect)(()=>(o({type:h.RegisterDroppable,element:{id:r,key:i,disabled:n,node:x,rect:f,data:M}}),()=>o({type:h.UnregisterDroppable,key:i,id:r})),[r]),(0,E.useEffect)(()=>{n!==c.current.disabled&&(o({type:h.SetDroppableDisabled,id:r,key:i,disabled:n}),c.current.disabled=n)},[r,i,n,o]),{active:a,rect:f,isOver:(null==u?void 0:u.id)===r,node:x,over:u,setNodeRef:D}}},82639:(e,t,n)=>{n.d(t,{FN:()=>l,gj:()=>r}),n(39768);let r=e=>{let t,{containerNodeRect:n,draggingNodeRect:r,transform:l}=e;return r&&n?(t={...l},r.top+l.y<=n.top?t.y=n.top-r.top:r.bottom+l.y>=n.top+n.height&&(t.y=n.top+n.height-r.bottom),r.left+l.x<=n.left?t.x=n.left-r.left:r.right+l.x>=n.left+n.width&&(t.x=n.left+n.width-r.right),t):l},l=e=>{let{transform:t}=e;return{...t,x:0}}},87256:(e,t,n)=>{n.d(t,{JR:()=>D,_G:()=>c,be:()=>a,gB:()=>f,gl:()=>w});var r=n(12115),l=n(44923),i=n(39768);function a(e,t,n){let r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function o(e){return null!==e&&e>=0}let u=e=>{let{rects:t,activeIndex:n,overIndex:r,index:l}=e,i=a(t,r,n),o=t[l],u=i[l];return u&&o?{x:u.left-o.left,y:u.top-o.top,scaleX:u.width/o.width,scaleY:u.height/o.height}:null},s={scaleX:1,scaleY:1},c=e=>{var t,n,r,l;let i,a,o,{activeIndex:u,activeNodeRect:c,index:d,rects:h,overIndex:f}=e,g=null!=(t=h[u])?t:c;if(!g)return null;if(d===u){let e=h[f];return e?{x:0,y:u<f?e.top+e.height-(g.top+g.height):e.top-g.top,...s}:null}let p=(n=h,r=d,l=u,i=n[r],a=n[r-1],o=n[r+1],i?l<r?a?i.top-(a.top+a.height):o?o.top-(i.top+i.height):0:o?o.top-(i.top+i.height):a?i.top-(a.top+a.height):0:0);return d>u&&d<=f?{x:0,y:-g.height-p,...s}:d<u&&d>=f?{x:0,y:g.height+p,...s}:{x:0,y:0,...s}},d="Sortable",h=r.createContext({activeIndex:-1,containerId:d,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:u,disabled:{draggable:!1,droppable:!1}});function f(e){let{children:t,id:n,items:a,strategy:o=u,disabled:s=!1}=e,{active:c,dragOverlay:f,droppableRects:g,over:p,measureDroppableContainers:v}=(0,l.fF)(),b=(0,i.YG)(d,n),m=null!==f.rect,y=(0,r.useMemo)(()=>a.map(e=>"object"==typeof e&&"id"in e?e.id:e),[a]),w=null!=c,x=c?y.indexOf(c.id):-1,E=p?y.indexOf(p.id):-1,D=(0,r.useRef)(y),C=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}(y,D.current),M=-1!==E&&-1===x||C,S="boolean"==typeof s?{draggable:s,droppable:s}:s;(0,i.Es)(()=>{C&&w&&v(y)},[C,y,w,v]),(0,r.useEffect)(()=>{D.current=y},[y]);let R=(0,r.useMemo)(()=>({activeIndex:x,containerId:b,disabled:S,disableTransforms:M,items:y,overIndex:E,useDragOverlay:m,sortedRects:y.reduce((e,t,n)=>{let r=g.get(t);return r&&(e[n]=r),e},Array(y.length)),strategy:o}),[x,b,S.draggable,S.droppable,M,y,E,g,m,o]);return r.createElement(h.Provider,{value:R},t)}let g=e=>{let{id:t,items:n,activeIndex:r,overIndex:l}=e;return a(n,r,l).indexOf(t)},p=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:l,items:i,newIndex:a,previousItems:o,previousContainerId:u,transition:s}=e;return!!s&&!!r&&(o===i||l!==a)&&(!!n||a!==l&&t===u)},v={duration:200,easing:"ease"},b="transform",m=i.Ks.Transition.toString({property:b,duration:0,easing:"linear"}),y={roleDescription:"sortable"};function w(e){var t,n,a,u;let{animateLayoutChanges:s=p,attributes:c,disabled:d,data:f,getNewIndex:w=g,id:x,strategy:E,resizeObserverConfig:D,transition:C=v}=e,{items:M,containerId:S,activeIndex:R,disabled:k,disableTransforms:T,sortedRects:L,overIndex:N,useDragOverlay:O,strategy:I}=(0,r.useContext)(h),z=(t=d,n=k,"boolean"==typeof t?{draggable:t,droppable:!1}:{draggable:null!=(a=null==t?void 0:t.draggable)?a:n.draggable,droppable:null!=(u=null==t?void 0:t.droppable)?u:n.droppable}),A=M.indexOf(x),P=(0,r.useMemo)(()=>({sortable:{containerId:S,index:A,items:M},...f}),[S,f,A,M]),W=(0,r.useMemo)(()=>M.slice(M.indexOf(x)),[M,x]),{rect:Y,node:B,isOver:F,setNodeRef:K}=(0,l.zM)({id:x,data:P,disabled:z.droppable,resizeObserverConfig:{updateMeasurementsFor:W,...D}}),{active:j,activatorEvent:U,activeNodeRect:_,attributes:X,setNodeRef:G,listeners:q,isDragging:H,over:V,setActivatorNodeRef:J,transform:Q}=(0,l.PM)({id:x,data:P,attributes:{...y,...c},disabled:z.draggable}),Z=(0,i.jn)(K,G),$=!!j,ee=$&&!T&&o(R)&&o(N),et=!O&&H,en=et&&ee?Q:null,er=ee?null!=en?en:(null!=E?E:I)({rects:L,activeNodeRect:_,activeIndex:R,overIndex:N,index:A}):null,el=o(R)&&o(N)?w({id:x,items:M,activeIndex:R,overIndex:N}):A,ei=null==j?void 0:j.id,ea=(0,r.useRef)({activeId:ei,items:M,newIndex:el,containerId:S}),eo=M!==ea.current.items,eu=s({active:j,containerId:S,isDragging:H,isSorting:$,id:x,index:A,items:M,newIndex:ea.current.newIndex,previousItems:ea.current.items,previousContainerId:ea.current.containerId,transition:C,wasDragging:null!=ea.current.activeId}),es=function(e){let{disabled:t,index:n,node:a,rect:o}=e,[u,s]=(0,r.useState)(null),c=(0,r.useRef)(n);return(0,i.Es)(()=>{if(!t&&n!==c.current&&a.current){let e=o.current;if(e){let t=(0,l.Sj)(a.current,{ignoreTransform:!0}),n={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(n.x||n.y)&&s(n)}}n!==c.current&&(c.current=n)},[t,n,a,o]),(0,r.useEffect)(()=>{u&&s(null)},[u]),u}({disabled:!eu,index:A,node:B,rect:Y});return(0,r.useEffect)(()=>{$&&ea.current.newIndex!==el&&(ea.current.newIndex=el),S!==ea.current.containerId&&(ea.current.containerId=S),M!==ea.current.items&&(ea.current.items=M)},[$,el,S,M]),(0,r.useEffect)(()=>{if(ei===ea.current.activeId)return;if(ei&&!ea.current.activeId){ea.current.activeId=ei;return}let e=setTimeout(()=>{ea.current.activeId=ei},50);return()=>clearTimeout(e)},[ei]),{active:j,activeIndex:R,attributes:X,data:P,rect:Y,index:A,newIndex:el,items:M,isOver:F,isSorting:$,isDragging:H,listeners:q,node:B,overIndex:N,over:V,setNodeRef:Z,setActivatorNodeRef:J,setDroppableNodeRef:K,setDraggableNodeRef:G,transform:null!=es?es:er,transition:es||eo&&ea.current.newIndex===A?m:(!et||(0,i.kx)(U))&&C&&($||eu)?i.Ks.Transition.toString({...C,property:b}):void 0}}function x(e){if(!e)return!1;let t=e.data.current;return!!t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable}let E=[l.vL.Down,l.vL.Right,l.vL.Up,l.vL.Left],D=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:a,droppableContainers:o,over:u,scrollableAncestors:s}}=t;if(E.includes(e.code)){if(e.preventDefault(),!n||!r)return;let t=[];o.getEnabled().forEach(n=>{if(!n||null!=n&&n.disabled)return;let i=a.get(n.id);if(i)switch(e.code){case l.vL.Down:r.top<i.top&&t.push(n);break;case l.vL.Up:r.top>i.top&&t.push(n);break;case l.vL.Left:r.left>i.left&&t.push(n);break;case l.vL.Right:r.left<i.left&&t.push(n)}});let h=(0,l.y$)({active:n,collisionRect:r,droppableRects:a,droppableContainers:t,pointerCoordinates:null}),f=(0,l.Vy)(h,"id");if(f===(null==u?void 0:u.id)&&h.length>1&&(f=h[1].id),null!=f){let e=o.get(n.id),t=o.get(f),u=t?a.get(t.id):null,h=null==t?void 0:t.node.current;if(h&&u&&e&&t){var c,d;let n=(0,l.sl)(h).some((e,t)=>s[t]!==e),a=C(e,t),o=(c=e,d=t,!!x(c)&&!!x(d)&&!!C(c,d)&&c.data.current.sortable.index<d.data.current.sortable.index),f=n||!a?{x:0,y:0}:{x:o?r.width-u.width:0,y:o?r.height-u.height:0},g={x:u.left,y:u.top};return f.x&&f.y?g:(0,i.Re)(g,f)}}}};function C(e,t){return!!x(e)&&!!x(t)&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}}}]);
@@ -0,0 +1 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3649],{20061:(e,t,a)=>{Promise.resolve().then(a.bind(a,47295))},47295:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>A});var l=a(95155),r=a(12115),n=a(44923),s=a(87256),o=a(39768),i=a(82639),d=a(35497),c=a(11059),m=a(28777),u=a(52679);let x=/^[a-zA-Z0-9_.\-]+$/,b=[{value:"global",label:"Global / current behavior",description:"Keep the existing behavior: every request advances the combo rotation globally."},{value:"client_ip",label:"Client IP",description:"Keep the same starting model for the same client IP until TTL expires."},{value:"client_session",label:"Client IP + chat session",description:"Best for chat tools. Keeps the same model for the same machine and chat session."}],p=[{value:"fallback",label:"Fallback priority",description:"Current behavior: try combo models in the order shown, then fallback on failure."},{value:"round-robin",label:"Round Robin",description:"Rotate which active model starts first. Sticky options below still apply."},{value:"least-latency",label:"Least latency",description:"Prefer the target with the best health/latency score. Useful for LAN Ollama."},{value:"p2c",label:"P2C",description:"Power of Two Choices: sample two healthy targets and pick the less busy one."}];function h(e={}){return Array.isArray(e.disabledModels)?[...new Set(e.disabledModels.map(e=>String(e||"").trim()).filter(Boolean))]:[]}function g(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:h(e)}}function f(e=[]){return Array.isArray(e)?e.join(", "):String(e||"")}function y(e=""){return String(e||"").split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean)}function v(e={}){return e&&"object"==typeof e?Object.entries(e).map(([e,t])=>`${e}: ${Array.isArray(t)?t.join(", "):String(t||"")}`).join("\n"):""}function j(e){return String(e||"").trim()}function k(e){return"string"==typeof e?e:e&&"object"==typeof e&&(e.value||e.model||e.id)||""}function N(e={}){let t=j(e.provider);return j(e.providerSpecificData?.prefix)||j(e.prefix)||j((0,u.wG)(t))||t}function w(e={}){return j(e.email)||j(e.accountName)||j(e.displayName)||j(e.name)||j(e.providerSpecificData?.nodeName)||j(e.id)}function C(e){return e&&"object"==typeof e?j(e.connectionId||e.connection_id):""}function S(e){let t=k(e),a=C(e);return t?a?`${t}@@${a}`:t:""}function T(e){return"string"==typeof e?e:e&&"object"==typeof e?j(e.label)||j(e.displayName)||j(e.name)||k(e):""}function $(e){if(!e||"object"!=typeof e)return k(e);let t=k(e);return t?Object.fromEntries(Object.entries({model:t,connectionId:C(e)||void 0,label:T(e)||void 0,provider:j(e.provider)||void 0,accountName:j(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 E(e,t=!0){let a=$(e),l=S(a);return{value:l,enabled:t,target:a,label:T(a)||l,subtitle:function(e){if(!e||"object"!=typeof e)return"";let t=C(e),a=k(e);return t?`Pinned account • ${t}${a?` • ${a}`:""}`:""}(a)}}function M(e={}){return j(e.defaultModel)||j(e.providerSpecificData?.defaultModel)||j(e.model)||""}function O(e,t,a,l=""){let r=j(a);if(!r)return;let n=j(l)||r;t.has(r)||(t.add(r),e.push({value:r,label:n}))}function _(e={},t={}){let a=[],l=new Set,r=j(e.provider),n=[...new Set([N(e),j((0,u.wG)(r)),r].filter(Boolean))];for(let e of(0,m.KC)(r)||[])e?.type&&"llm"!==e.type||O(a,l,e.id,e.name||e.id);for(let[e,r]of Object.entries(t||{})){let t=j(r),s=n.find(e=>e&&t.startsWith(`${e}/`));if(!s)continue;let o=t.slice(s.length+1);O(a,l,o,e||o)}return O(a,l,M(e),"Default model"),a}function P(e={},t=[]){let a={...e},l=[...new Set((t||[]).map(e=>String(e||"").trim()).filter(Boolean))];return l.length>0?a.disabledModels=l:delete a.disabledModels,Object.keys(a).length?a:null}function A(){let[e,t]=(0,r.useState)([]),[a,n]=(0,r.useState)(!0),[s,o]=(0,r.useState)(!1),[i,m]=(0,r.useState)(null),[u,x]=(0,r.useState)([]),[b,p]=(0,r.useState)({}),[f,y]=(0,r.useState)(null),{copied:v,copy:j}=(0,c.C)();(0,r.useEffect)(()=>{k()},[]);let k=async()=>{try{let[e,a,l]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),r=await e.json(),n=await a.json(),s=l.ok?await l.json():{};e.ok&&t((r.combos||[]).filter(e=>!e.kind)),a.ok&&x(n.connections||[]),p(s.comboStrategies||{})}catch(e){console.log("Error fetching data:",e)}finally{n(!1)}},N=async e=>{await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:e})}),p(e)},w=async(e,t)=>{let a={...b},l=P(a[e]||{},t);l?a[e]=l:delete a[e],await N(a)},C=async e=>{let{disabledModels:t=[],...a}=e;try{let e=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(a)});if(e.ok)t.length>0&&await w(a.name,t),await k(),o(!1);else{let t=await e.json();alert(t.error||"Failed to create combo")}}catch(e){console.log("Error creating combo:",e)}},S=async(e,t)=>{let{disabledModels:a=[],...l}=t,r=i?.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={...b};r&&r!==l.name&&e[r]&&(e[l.name]=e[r],delete e[r]);let t=P(e[l.name]||{},a);t?e[l.name]=t:delete e[l.name],await N(e),await k(),m(null)}else{let e=await t.json();alert(e.error||"Failed to update combo")}}catch(e){console.log("Error updating combo:",e)}},T=async a=>{let l=e.find(e=>e.id===a);y({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{y(null);try{if((await fetch(`/api/combos/${a}`,{method:"DELETE"})).ok){if(l?.name&&b[l.name]){let e={...b};delete e[l.name],await N(e)}t(e.filter(e=>e.id!==a))}}catch(e){console.log("Error deleting combo:",e)}}})},$=async(e,t)=>{try{let a={...b},l=function(e={}){let t={...e};return t.disabledModels=h(e),"fallback"===(t.fallbackStrategy||"fallback")&&delete t.fallbackStrategy,t.disabledModels.length||delete t.disabledModels,t.requiredTags?.length||delete t.requiredTags,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}({...g(a[e]),...t});l?a[e]=l:delete a[e],await N(a)}catch(e){console.log("Error updating combo routing settings:",e)}};return a?(0,l.jsx)("div",{className:"space-y-6",children:[1,2,3].map(e=>(0,l.jsx)("div",{className:"h-40 animate-pulse rounded-2xl bg-surface"},e))}):(0,l.jsxs)("div",{className:"space-y-8",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between gap-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h1",{className:"text-2xl font-semibold text-text-main",children:"Combos"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Create model combos with fallback, round-robin, least-latency, P2C, and LAN Ollama health-aware routing."})]}),(0,l.jsxs)("button",{type:"button",onClick:()=>o(!0),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,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Create Combo"]})]}),0===e.length?(0,l.jsxs)("div",{className:"rounded-2xl border border-dashed border-border p-10 text-center",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-4xl text-text-muted",children:"layers"}),(0,l.jsx)("h2",{className:"mt-3 text-lg font-semibold text-text-main",children:"No combos yet"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Create model combos with fallback support."}),(0,l.jsx)("button",{type:"button",onClick:()=>o(!0),className:"mt-4 rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90",children:"Create Combo"})]}):(0,l.jsx)("div",{className:"grid gap-5 md:grid-cols-2 xl:grid-cols-3",children:e.map(e=>(0,l.jsx)(I,{combo:e,copied:v,onCopy:j,onEdit:()=>m(e),onDelete:()=>T(e.id),comboStrategy:b[e.name]||{},onUpdateComboStrategy:t=>$(e.name,t)},e.id))}),(0,l.jsx)(q,{isOpen:s,onClose:()=>o(!1),onSave:C,activeProviders:u}),(0,l.jsx)(q,{isOpen:!!i,combo:i,comboStrategy:i&&b[i.name]||{},onClose:()=>m(null),onSave:e=>S(i.id,e),activeProviders:u}),(0,l.jsx)(d.uo,{isOpen:!!f,onClose:()=>y(null),onConfirm:f?.onConfirm,title:f?.title||"Confirm",message:f?.message,variant:"danger"})]})}function I({combo:e,copied:t,onCopy:a,onEdit:n,onDelete:s,comboStrategy:o={},onUpdateComboStrategy:i}){let d=g(o||{}),c=d.fallbackStrategy||"fallback",m=p.find(e=>e.value===c)||p[0],u=d.stickyScope||"global",x=b.find(e=>e.value===u)||b[0],j=h(o),[N,w]=(0,r.useState)(f(d.requiredTags)),[C,$]=(0,r.useState)(v(d.modelTagRules));return(0,r.useEffect)(()=>{w(f(d.requiredTags)),$(v(d.modelTagRules))},[e.name,JSON.stringify(d.requiredTags||[]),JSON.stringify(d.modelTagRules||{})]),(0,l.jsxs)("div",{className:"rounded-2xl border border-border bg-background p-5 shadow-sm",children:[(0,l.jsxs)("div",{className:"mb-4 flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{className:"min-w-0",children:[(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-primary",children:"layers"}),(0,l.jsx)("h3",{className:"truncate text-lg font-semibold text-text-main",children:e.name})]}),(0,l.jsxs)("p",{className:"mt-1 text-sm text-text-muted",children:[e.models.length," active model(s)",j.length>0?` • ${j.length} disabled`:""]})]}),(0,l.jsxs)("div",{className:"flex items-center gap-1",children:[(0,l.jsx)(R,{icon:t===`combo-${e.id}`?"check":"content_copy",title:"Copy combo name",onClick:()=>a(e.name,`combo-${e.id}`)}),(0,l.jsx)(R,{icon:"edit",title:"Edit",onClick:n}),(0,l.jsx)(R,{icon:"delete",title:"Delete",onClick:s,danger:!0})]})]}),(0,l.jsxs)("div",{className:"mb-4 flex flex-wrap gap-2",children:[0===e.models.length?(0,l.jsx)("span",{className:"rounded-lg border border-border px-3 py-1 text-xs text-text-muted",children:"No active models"}):e.models.slice(0,5).map(e=>(0,l.jsx)("span",{className:"rounded-lg border border-border bg-surface px-3 py-1 font-mono text-xs text-text-main",title:k(e),children:T(e)},S(e))),e.models.length>5&&(0,l.jsxs)("span",{className:"rounded-lg border border-border px-3 py-1 text-xs text-text-muted",children:["+",e.models.length-5," more"]}),j.length>0&&(0,l.jsxs)("span",{className:"rounded-lg border border-red-200 bg-red-50 px-3 py-1 text-xs font-medium text-red-600 dark:border-red-500/30 dark:bg-red-500/10 dark:text-red-300",children:[j.length," disabled"]})]}),(0,l.jsxs)("div",{className:"rounded-xl border border-border bg-surface/50 p-4",children:[(0,l.jsxs)("div",{className:"mb-3 flex items-start justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h4",{className:"font-semibold text-text-main",children:"Routing Strategy"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:m.description})]}),(0,l.jsx)("span",{className:"rounded-lg border border-primary/20 bg-primary/10 px-2 py-1 text-[11px] font-semibold text-primary",children:m.label})]}),(0,l.jsxs)("label",{className:"mb-3 block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Strategy"}),(0,l.jsx)("select",{value:c,onChange:e=>i({fallbackStrategy:e.target.value}),className:"w-full rounded-lg border border-border bg-background px-2 py-2 text-sm text-text-main outline-none focus:border-primary",children:p.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))})]}),("least-latency"===c||"p2c"===c)&&(0,l.jsxs)("div",{className:"mb-3 rounded-xl border border-emerald-500/20 bg-emerald-500/5 p-3",children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-sm font-semibold text-emerald-600 dark:text-emerald-300",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"monitor_heart"}),"LAN health aware routing"]}),(0,l.jsxs)("label",{className:"mb-3 flex items-start gap-2 text-xs text-text-muted",children:[(0,l.jsx)("input",{type:"checkbox",checked:!1!==d.lanHealthEnabled,onChange:e=>i({lanHealthEnabled:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),"Use active health state and circuit breaker data when ranking combo targets."]}),(0,l.jsxs)("div",{className:"grid gap-2 sm:grid-cols-2",children:[(0,l.jsxs)("label",{className:"block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Health path"}),(0,l.jsx)("input",{value:d.healthCheckPath||"/api/tags",onChange:e=>i({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,l.jsxs)("label",{className:"block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Check interval ms"}),(0,l.jsx)("input",{type:"number",min:"1000",value:d.healthCheckIntervalMs||15e3,onChange:e=>i({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,l.jsxs)("label",{className:"mt-3 block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Required endpoint tags"}),(0,l.jsx)("input",{value:N,onChange:e=>w(e.target.value),onBlur:()=>i({requiredTags:y(N)}),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,l.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Optional. Every routed endpoint must contain these tags."})]}),(0,l.jsxs)("label",{className:"mt-3 block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Model tag rules"}),(0,l.jsx)("textarea",{value:C,onChange:e=>$(e.target.value),onBlur:()=>i({modelTagRules:function(e=""){let t={};for(let a of String(e||"").split(/\n+/)){let e=a.trim();if(!e)continue;let l=e.indexOf(":");if(-1===l)continue;let r=e.slice(0,l).trim(),n=y(e.slice(l+1));r&&n.length&&(t[r]=n)}return t}(C)}),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"}),(0,l.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"One rule per line: model: tag1, tag2. Large models can be forced to GPU/VRAM endpoints."})]})]}),"round-robin"===c&&(0,l.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/15 bg-background p-3",children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center gap-2 text-sm font-semibold text-primary",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"sticky_note_2"}),"Sticky Round Robin"]}),(0,l.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Optional sticky behavior for this combo only. Leave it on Global to keep the current behavior."}),(0,l.jsxs)("label",{className:"mb-3 block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Sticky mode"}),(0,l.jsx)("select",{value:u,onChange:e=>i({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:b.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,l.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:x.description})]}),(0,l.jsxs)("label",{className:"mb-3 block",children:[(0,l.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Sticky TTL minutes"}),(0,l.jsx)("input",{type:"number",min:"1",value:d.stickyTtlMinutes||120,onChange:e=>i({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,l.jsx)("span",{className:"mt-1 block text-[11px] text-text-muted",children:"Sticky assignments are in-memory and expire after this time. 120 minutes is recommended."})]}),(0,l.jsxs)("label",{className:"flex items-start gap-2 text-xs text-text-muted",children:[(0,l.jsx)("input",{type:"checkbox",checked:!1!==d.stickyFallbackToClientIp,onChange:e=>i({stickyFallbackToClientIp:e.target.checked}),className:"mt-0.5 h-3.5 w-3.5 accent-primary"}),"If chat session id is missing, fall back to Client IP instead of global rotation."]})]})]})]})}function R({icon:e,title:t,onClick:a,danger:r=!1}){return(0,l.jsx)("button",{type:"button",onClick:e=>{e.stopPropagation(),a?.()},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,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:e})})}function D({id:e,index:t,model:a,subtitle:n="",enabled:i,isFirst:d,isLast:c,onEdit:m,onMoveUp:u,onMoveDown:x,onRemove:b,onToggleEnabled:p}){let{attributes:h,listeners:g,setNodeRef:f,transform:y,isDragging:v}=(0,s.gl)({id:e}),j={transform:o.Ks.Transform.toString(y),opacity:v?.4:1,zIndex:v?999:void 0},[k,N]=(0,r.useState)(!1),[w,C]=(0,r.useState)(a);(0,r.useEffect)(()=>{C(a)},[a]);let S=()=>{let e=w.trim();e&&e!==a?m(e):C(a),N(!1)};return(0,l.jsxs)("div",{ref:f,style:j,className:`flex items-center gap-3 rounded-xl border p-3 transition ${i?"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,l.jsx)("button",{type:"button",className:"cursor-grab text-text-muted active:cursor-grabbing",...h,...g,title:"Drag to reorder",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"drag_indicator"})}),(0,l.jsx)("span",{className:`flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-xs font-semibold ${i?"bg-primary/10 text-primary":"bg-red-100 text-red-600 dark:bg-red-500/20 dark:text-red-300"}`,children:t+1}),k?(0,l.jsx)("input",{autoFocus:!0,value:w,onChange:e=>C(e.target.value),onBlur:S,onKeyDown:e=>{"Enter"===e.key&&S(),"Escape"===e.key&&(C(a),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,l.jsxs)("button",{type:"button",onClick:()=>N(!0),className:"min-w-0 flex-1 text-left",title:"Click to edit model",children:[(0,l.jsx)("span",{className:`block truncate font-mono text-xs ${i?"text-text-main":"text-text-muted line-through"}`,children:a}),n?(0,l.jsx)("span",{className:"mt-0.5 block truncate text-[11px] text-text-muted",children:n}):null]}),(0,l.jsx)("button",{type:"button",onClick:p,className:`rounded-lg p-1.5 transition ${i?"text-green-600 hover:bg-green-500/10":"text-red-500 hover:bg-red-500/10"}`,title:i?"Disable this model in combo":"Enable this model in combo",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:i?"toggle_on":"toggle_off"})}),(0,l.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:"Move up",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_upward"})}),(0,l.jsx)("button",{type:"button",onClick:x,disabled:c,className:"rounded-lg p-1.5 text-text-muted transition hover:bg-surface disabled:opacity-30",title:"Move down",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"arrow_downward"})}),(0,l.jsx)("button",{type:"button",onClick:b,className:"rounded-lg p-1.5 text-red-500 transition hover:bg-red-500/10",title:"Remove",children:(0,l.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]})}function q({isOpen:e,combo:t,comboStrategy:a={},onClose:o,onSave:c,activeProviders:m,kindFilter:b=null}){let[p,g]=(0,r.useState)(t?.name||""),[f,y]=(0,r.useState)([]),[v,k]=(0,r.useState)(!1),[C,T]=(0,r.useState)(!1),[O,P]=(0,r.useState)(""),[A,I]=(0,r.useState)({}),[R,F]=(0,r.useState)(""),[B,L]=(0,r.useState)(""),H=a||{},z=(0,n.FR)((0,n.MS)(n.AN,{activationConstraint:{distance:5}}),(0,n.MS)(n.uN,{coordinateGetter:s.JR}));(0,r.useEffect)(()=>{e&&(g(t?.name||""),y(function(e,t={}){let a=(e?.models||[]).map(e=>E(e,!0)).filter(e=>e.value),l=new Set(a.map(e=>e.value));return[...a,...h(t).filter(e=>!l.has(e)).map(e=>E(e,!1)).filter(e=>e.value)]}(t,H)),P(""),F(""),L(""))},[e,t?.id,t?.name]),(0,r.useEffect)(()=>{e&&G()},[e]);let G=async()=>{try{let e=await fetch("/api/models/alias");if(!e.ok)return;let t=await e.json();I(t.aliases||{})}catch(e){console.error("Error fetching modal data:",e)}},K=f.map((e,t)=>({uid:`item-${t}-${e.value}`,row:e})),J=f.map(e=>e.value),U=f.filter(e=>e.enabled).length,V=f.filter(e=>!e.enabled).length,W=(m||[]).filter(e=>e?.isActive!==!1),Z=W.find(e=>e.id===R)||null,Q=Z?_(Z,A):[],X=Q[0]?.value||(Z?M(Z):""),Y=e=>e.trim()?x.test(e)?(P(""),!0):(P("Only letters, numbers, -, _ and . allowed"),!1):(P("Name is required"),!1),ee=async()=>{if(!Y(p))return;let{models:e,disabledModels:t}=function(e=[]){let t=[],a=new Set;for(let l of e){let e=j(l?.value||S(l?.target));!e||a.has(e)||(a.add(e),t.push({...l,value:e,enabled:l?.enabled!==!1,target:$(l?.target||l?.value)}))}return{models:t.filter(e=>e.enabled).map(e=>e.target).filter(Boolean),disabledModels:t.filter(e=>!e.enabled).map(e=>e.value)}}(f);T(!0),await c({name:p.trim(),models:e,disabledModels:t}),T(!1)};if(!e)return null;let et=!!t;return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("div",{className:"fixed inset-0 z-[100] flex items-center justify-center bg-black/45 p-4 backdrop-blur-[1px]",children:(0,l.jsxs)("div",{className:"flex max-h-[88vh] w-full max-w-3xl flex-col overflow-hidden rounded-2xl border border-border bg-white shadow-2xl dark:bg-zinc-950",children:[(0,l.jsxs)("div",{className:"flex items-start justify-between border-b border-border px-5 py-4",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h2",{className:"text-xl font-semibold text-text-main",children:et?"Edit Combo":"Create Combo"}),(0,l.jsx)("p",{className:"mt-1 text-sm text-text-muted",children:"Choose models, disable temporarily, and order active fallback priority."})]}),(0,l.jsx)("button",{type:"button",onClick:o,className:"rounded-lg p-1 text-text-muted transition hover:bg-surface hover:text-text-main",children:(0,l.jsx)("span",{className:"material-symbols-outlined",children:"close"})})]}),(0,l.jsxs)("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto bg-white px-5 py-4 dark:bg-zinc-950",children:[(0,l.jsxs)("label",{className:"block",children:[(0,l.jsx)("span",{className:"mb-2 block text-sm font-semibold text-text-main",children:"Name"}),(0,l.jsx)("input",{value:p,onChange:e=>{let t=e.target.value;g(t),t?Y(t):P("")},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 ${O?"border-red-400":"border-border"}`}),(0,l.jsx)("span",{className:`mt-1 block text-xs ${O?"text-red-500":"text-text-muted"}`,children:O||"Only letters, numbers, -, _ and . allowed"})]}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"mb-3 flex items-center justify-between gap-3",children:[(0,l.jsxs)("div",{children:[(0,l.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Models"}),(0,l.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:[U," active",V>0?`, ${V} disabled`:"",". Disabled models stay in this combo but are not routed."]})]}),(0,l.jsxs)("button",{type:"button",onClick:()=>k(!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,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add"}),"Add Model"]})]}),(0,l.jsxs)("div",{className:"mb-4 rounded-xl border border-primary/15 bg-primary/5 p-3",children:[(0,l.jsxs)("div",{className:"mb-2 flex items-center gap-2 text-xs font-semibold uppercase tracking-wide text-primary",children:[(0,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"account_tree"}),"Add Provider Account Target"]}),(0,l.jsx)("p",{className:"mb-3 text-xs text-text-muted",children:"Pin this combo step to a specific provider account. Models come from the provider; the account only pins routing/load balancing."}),(0,l.jsxs)("div",{className:"grid gap-2 md:grid-cols-[minmax(0,1.5fr)_minmax(0,1fr)_auto]",children:[(0,l.jsxs)("select",{value:R,onChange:e=>{let t=e.target.value,a=W.find(e=>e.id===t),l=a?_(a,A):[];F(t),L(l[0]?.value||M(a||{})||"")},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,l.jsx)("option",{value:"",children:"Select provider account"}),W.map(e=>{let t=N(e),a=w(e),r=a&&a!==t?`${t} / ${a}`:t;return(0,l.jsx)("option",{value:e.id,children:r},e.id)})]}),(0,l.jsxs)("select",{value:B,onChange:e=>L(e.target.value),disabled:!R||0===Q.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,l.jsx)("option",{value:"",children:R?Q.length>0?"Select model":"No provider models found":"Select account first"}),Q.map(e=>(0,l.jsx)("option",{value:e.value,children:e.label},`${e.value}-${e.label}`))]}),(0,l.jsxs)("button",{type:"button",onClick:()=>{if(!Z)return;let e=function(e,t){let a=N(e),l=function(e={}){let t=j(e.provider),a=N(e);return(0,u.mq)(t)||(0,u.gb)(t)?a||t:t||a}(e),r=w(e),n=j(t||M(e));if(!a||!e?.id||!n)return null;let s=n.includes("/"),o=s?n:`${a}/${n}`,i=s&&n.startsWith(`${a}/`)?n.slice(a.length+1):n,d=r&&r!==l?`${l}/${r}/${i}`:`${l}/${i}`;return{model:o,connectionId:e.id,provider:l||a,accountName:r||void 0,label:d}}(Z,B||X);if(!e)return void alert("Select a provider account and model for this pinned target.");let t=E(e,!0);y(e=>{let a=e.findIndex(e=>e.value===t.value);if(-1!==a){let l=[...e];return l[a]={...l[a],...t,enabled:!0},l}return[...e,t]}),L("")},disabled:!R||!B,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,l.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"add_link"}),"Add Account"]})]})]}),0===f.length?(0,l.jsxs)("div",{className:"rounded-xl border border-dashed border-border p-8 text-center text-text-muted",children:[(0,l.jsx)("span",{className:"material-symbols-outlined",children:"layers"}),(0,l.jsx)("p",{className:"mt-2 text-sm",children:"No models added yet"})]}):(0,l.jsx)(n.Mp,{sensors:z,collisionDetection:n.fp,modifiers:[i.FN,i.gj],onDragEnd:e=>{let{active:t,over:a}=e;if(a&&t.id!==a.id){let e=K.findIndex(e=>e.uid===t.id),l=K.findIndex(e=>e.uid===a.id);-1!==e&&-1!==l&&y(t=>(0,s.be)(t,e,l))}},children:(0,l.jsx)(s.gB,{items:K.map(e=>e.uid),strategy:s._G,children:(0,l.jsx)("div",{className:"space-y-3",children:K.map(({uid:e,row:t},a)=>(0,l.jsx)(D,{id:e,index:a,model:t.label||t.value,subtitle:t.subtitle,enabled:t.enabled,isFirst:0===a,isLast:a===f.length-1,onEdit:e=>{let t=e.trim();if(!t)return;let l=[...f],r=l[a];if(r?.target&&"object"==typeof r.target){let e=$({...r.target,model:t});l[a]=E(e,!1!==r.enabled)}else l[a]=E(t,r?.enabled!==!1);y(l)},onMoveUp:()=>{if(0===a)return;let e=[...f];[e[a-1],e[a]]=[e[a],e[a-1]],y(e)},onMoveDown:()=>{if(a===f.length-1)return;let e=[...f];[e[a],e[a+1]]=[e[a+1],e[a]],y(e)},onToggleEnabled:()=>{let e=[...f];e[a]={...e[a],enabled:!e[a].enabled},y(e)},onRemove:()=>y(f.filter((e,t)=>t!==a))},e))})})})]})]}),(0,l.jsxs)("div",{className:"flex justify-end gap-3 border-t border-border bg-white px-5 py-4 dark:bg-zinc-950",children:[(0,l.jsx)("button",{type:"button",onClick:o,className:"rounded-xl border border-border px-4 py-2 text-sm font-medium text-text-main hover:bg-surface",children:"Cancel"}),(0,l.jsx)("button",{type:"button",onClick:ee,disabled:C,className:"rounded-xl bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 disabled:opacity-50",children:C?"Saving...":et?"Save":"Create"})]})]})}),(0,l.jsx)(d.rq,{isOpen:v,onClose:()=>k(!1),onSelect:e=>{let t=e.value;y(e=>{let a=e.findIndex(e=>e.value===t);if(-1!==a){let t=[...e];return t[a]={...t[a],enabled:!0},t}return[...e,E(t,!0)]})},onDeselect:e=>{y(t=>t.filter(t=>t.value!==e.value))},activeProviders:m,modelAliases:A,title:"Add Model to Combo",kindFilter:b,addedModelValues:J,closeOnSelect:!1})]})}}},e=>{e.O(0,[2574,3862,1051,7055,1321,5497,8441,3794,7358],()=>e(e.s=20061)),_N_E=e.O()}]);
@@ -0,0 +1,3 @@
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{5020:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>U});var a=s(95155),i=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(35497),c=s(52679),m=s(28777),p=s(11059);let x=new Map;async function u(e){if(!e?.url||!e?.type)return[];let t=x.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return x.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}var h=s(14051),b=s.n(h);function g({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:c,isTesting:m,onDisable:p}){let x="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:x?{color:x}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:t}),e.name&&(0,a.jsx)("span",{className:"truncate pl-1 text-[9px] italic text-text-muted/70",children:e.name})]}),c&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:c,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(t,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):p?(0,a.jsx)("button",{onClick:p,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function f({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d=`model_support:${e}`,c="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:c?{color:c}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]}),(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-1.5",children:[(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"LAN tag:"}),(0,a.jsx)("code",{className:"rounded bg-primary/10 px-1.5 py-0.5 font-mono text-[10px] text-primary",children:d}),(0,a.jsx)("button",{type:"button",onClick:()=>i(d,`tag-${e}`),className:"rounded px-1 py-0.5 text-[10px] text-text-muted hover:bg-sidebar hover:text-primary",title:"Copy model_support tag",children:s===`tag-${e}`?"Copied":"Copy tag"})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function y({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,copied:l,onCopy:r,onSetAlias:n,onDeleteAlias:o,connections:c,isAnthropic:m}){let[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(!1),[b,g]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[k,N]=(0,i.useState)({}),w=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();N(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{N(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=Object.entries(s).filter(([,t])=>t.startsWith(`${e}/`)).map(([t,s])=>({modelId:s.replace(`${e}/`,""),fullModel:s,alias:t})),S=a=>{let i,l=`${e}/${a}`;if(Object.values(s).includes(l))return null;let r=(i=a.split("/"))[i.length-1];if(!s[r])return r;let n=`${t}-${r}`;return s[n]?null:n},T=async()=>{if(!p.trim()||u)return;let t=p.trim(),s=S(t);if(!s)return void alert("All suggested aliases already exist. Please choose a different model or remove conflicting aliases.");h(!0);try{await n(t,s,e),x("")}catch(e){console.log("Error adding model:",e)}finally{h(!1)}},A=async()=>{if(b)return;let t=c.find(e=>!1!==e.isActive);if(t){g(!0);try{let s=await fetch(`/api/providers/${t.id}/models`),a=await s.json();if(!s.ok)return void alert(a.error||"Failed to import models");let i=a.models||[];if(0===i.length)return void alert("No models returned from /models.");let l=0;for(let t of i){let s=t.id||t.name||t.model;if(!s)continue;let a=S(s);a&&(await n(s,a,e),l+=1)}0===l&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{g(!1)}}},$=c.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",m?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint. Each model also shows a ",(0,a.jsx)("code",{className:"rounded bg-sidebar px-1 py-0.5 font-mono text-xs",children:"model_support:*"})," tag you can paste into an Ollama endpoint label for Combo tag routing."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:p,onChange:e=>x(e.target.value),onKeyDown:e=>"Enter"===e.key&&T(),placeholder:m?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:T,disabled:!p.trim()||u,children:u?"Adding...":"Add"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"download",onClick:A,disabled:!$||b,children:b?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({modelId:e,fullModel:s,alias:i})=>(0,a.jsx)(f,{modelId:e,fullModel:`${t}/${e}`,copied:l,onCopy:r,onDeleteAlias:()=>o(i),onTest:c.length>0?()=>w(e):void 0,testStatus:k[e],isTesting:v===e},s))})]})}function v({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function j(e){if(!e)return"never";try{return new Date(e).toLocaleString()}catch{return e}}function k({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:c,onUpdateProxy:m,onEdit:p,onDelete:x,oneByOneStatus:u=null,providerHealthConfig:h=null,healthCheckRunning:b=!1,onRunHealthCheck:g=null}){var f;let[y,N]=(0,i.useState)(!1),[w,C]=(0,i.useState)(!1),S=(0,i.useRef)(null),T=new Map((t||[]).map(e=>[e.id,e])),A=e.providerSpecificData?.proxyPoolId||null,$=A?T.get(A):null,I=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,O=!!A||I,P=$?`Pool: ${$.name}`:A?`Pool: ${A} (inactive/missing)`:I?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",R="";if($?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=$?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);R=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{R=t}}let E=$?.noProxy||e.providerSpecificData?.connectionNoProxy||"",D=function(e={}){let t=e.tags||e.labels||e.providerSpecificData?.routingTags||e.providerSpecificData?.tags||e.providerSpecificData?.labels||[];return Array.isArray(t)?t.map(e=>String(e||"").trim()).filter(Boolean):"string"==typeof t?t.split(/[\n,;\s]+/).map(e=>e.trim()).filter(Boolean):t&&"object"==typeof t?Object.entries(t).filter(([,e])=>!1!==e&&null!=e).map(([e,t])=>!0===t?e:`${e}:${t}`):[]}(e),F=e.providerSpecificData?.maxInFlight||e.maxInFlight||null,U="default";$?.isActive===!0?U="success":(A||I)&&(U="error"),(0,i.useEffect)(()=>{if(!y)return;let e=e=>{S.current&&!S.current.contains(e.target)&&N(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[y]);let _=async e=>{C(!0);try{await m("__none__"===e?null:e)}finally{C(!1),N(!1)}},M=e.authType||(s?"oauth":"apikey"),z="oauth"===M,L="cookie"===M,q=e=>"string"==typeof e&&/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e),K=z?q(e.email)?e.email:q(e.name)?e.name:e.name||e.email||e.displayName||"OAuth Account":e.name||e.email||e.displayName||"API Key",[J,W]=(0,i.useState)(!1),H=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{W(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=H?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[H]);let B="unavailable"!==e.testStatus||J?e.testStatus:"active",G=()=>u?"queued"===u.state?"queued":"testing"===u.state?"testing":"success"===u.state?"success":"failed"===u.state?u.error?`failed: ${u.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:L?"cookie":z?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:K}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(d.Ex,{variant:!1===e.isActive?"default":"active"===B||"success"===B?"success":"error"===B||"expired"===B||"unavailable"===B?"error":"default",size:"sm",dot:!0,children:!1===e.isActive?"disabled":B||"Unknown"}),(0,a.jsx)(d.Ex,{variant:"default",size:"sm",children:z?"OAuth":L?"Cookie":"API Key"}),O&&(0,a.jsx)(d.Ex,{variant:U,size:"sm",children:"Proxy"}),F&&(0,a.jsxs)(d.Ex,{variant:"default",size:"sm",children:["max ",F," in-flight"]}),D.slice(0,3).map(e=>(0,a.jsx)(d.Ex,{variant:"primary",size:"sm",children:e},e)),D.length>3&&(0,a.jsxs)(d.Ex,{variant:"default",size:"sm",children:["+",D.length-3," tags"]}),J&&!1!==e.isActive&&(0,a.jsx)(v,{until:H}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),G()&&(0,a.jsx)(d.Ex,{variant:u?"success"===u.state?"success":"failed"===u.state?"error":"testing"===u.state?"primary":"default":"default",size:"sm",children:G()})]}),healthEnabled&&(0,a.jsxs)("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-text-muted",children:[" ",(0,a.jsx)(d.Ex,{variant:"alive"===(f=healthStatus)?"success":"dead"===f?"error":"default",children:healthLabel})," ",(0,a.jsx)("span",{children:effectiveHealth.override?"provider policy":"account policy"})," ",(0,a.jsxs)("span",{children:["last check: ",j(e.healthLastCheckedAt)]})," ",null!=e.healthLastLatencyMs&&(0,a.jsxs)("span",{children:[e.healthLastLatencyMs,"ms"]})," ",e.healthLastRecoveredAt&&(0,a.jsxs)("span",{children:["recovered: ",j(e.healthLastRecoveredAt)]})," ",e.healthLastError&&(0,a.jsx)("span",{className:"text-red-500",children:e.healthLastError})," ",(0,a.jsx)("button",{type:"button",onClick:g||void 0,disabled:!g||b,className:"rounded border border-border px-2 py-1 text-xs text-text-main transition-colors hover:border-primary hover:text-primary disabled:cursor-not-allowed disabled:opacity-50",children:b?"Checking...":"Run health check now"})," "]})," ",D.length>0&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-1.5 flex-wrap",children:[(0,a.jsx)("span",{className:"text-[11px] text-text-muted",children:"routing tags:"}),D.map(e=>(0,a.jsx)("code",{className:"rounded bg-primary/10 px-1 py-0.5 font-mono text-[10px] text-primary",children:e},e))]}),O&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:P,children:P}),R&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:R}),E&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:E,children:["no_proxy: ",E]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:S,children:[(0,a.jsxs)("button",{onClick:()=>N(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${O?"text-primary":"text-text-muted hover:text-primary"}`,disabled:w,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:w?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),y&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>_("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!A?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>_(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${A===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:x,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(d.lM,{size:"sm",checked:e.isActive??!0,onChange:c,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}g.propTypes={model:b().shape({id:b().string.isRequired}).isRequired,fullModel:b().string.isRequired,alias:b().string,copied:b().string,onCopy:b().func.isRequired,testStatus:b().oneOf(["ok","error"]),isCustom:b().bool,isFree:b().bool,onDeleteAlias:b().func,onTest:b().func,isTesting:b().bool,onDisable:b().func},b().string.isRequired,b().string.isRequired,b().string,b().func.isRequired,b().func.isRequired,b().func,b().oneOf(["ok","error"]),b().bool,b().string.isRequired,b().object.isRequired,b().string,b().func.isRequired,b().func.isRequired,b().func.isRequired,y.propTypes={providerStorageAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,modelAliases:b().object.isRequired,copied:b().string,onCopy:b().func.isRequired,onSetAlias:b().func.isRequired,onDeleteAlias:b().func.isRequired,connections:b().arrayOf(b().shape({id:b().string,isActive:b().bool})).isRequired,isAnthropic:b().bool},v.propTypes={until:b().string.isRequired},k.propTypes={connection:b().shape({id:b().string,name:b().string,email:b().string,displayName:b().string,modelLockUntil:b().string,testStatus:b().string,isActive:b().bool,lastError:b().string,priority:b().number,globalPriority:b().number,providerSpecificData:b().object,tags:b().oneOfType([b().string,b().array]),labels:b().oneOfType([b().string,b().array]),maxInFlight:b().oneOfType([b().string,b().number]),healthCheck:b().object,healthStatus:b().string,healthConsecutiveFailures:b().number,healthLastCheckedAt:b().string,healthLastOkAt:b().string,healthLastRecoveredAt:b().string,healthLastLatencyMs:b().number,healthLastError:b().string}).isRequired,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string,proxyUrl:b().string,noProxy:b().string,isActive:b().bool})),isOAuth:b().bool.isRequired,isFirst:b().bool.isRequired,isLast:b().bool.isRequired,onMoveUp:b().func.isRequired,onMoveDown:b().func.isRequired,onToggleActive:b().func.isRequired,onUpdateProxy:b().func,onEdit:b().func.isRequired,onDelete:b().func.isRequired,oneByOneStatus:b().shape({state:b().string,error:b().string})};let N=[{value:1,label:"Mon"},{value:2,label:"Tue"},{value:3,label:"Wed"},{value:4,label:"Thu"},{value:5,label:"Fri"},{value:6,label:"Sat"},{value:0,label:"Sun"}],w=[0,1,2,3,4,5,6],C={enabled:!0,weekdays:w,fromTime:"00:00",toTime:"23:59"},S={enabled:!1,intervalSec:60,failureThreshold:3,timeoutMs:15e3,prompt:"Say hi",disableThinking:!0};function T(e,t){let s=String(e||"").trim();return/^([01]\d|2[0-3]):([0-5]\d)$/.test(s)?s:t}function A(e={}){let t=e&&"object"==typeof e?e:{},s=Array.isArray(t.weekdays)&&t.weekdays.length?t.weekdays.map(Number).filter(e=>e>=0&&e<=6):w;return{enabled:!1!==t.enabled,weekdays:[...new Set(s)].sort((e,t)=>e-t),fromTime:T(t.fromTime||t.from,"00:00"),toTime:T(t.toTime||t.to,"23:59")}}function $(e={}){return{overrideConnections:!0===e.overrideConnections,schedule:A(e.schedule||C)}}function I(e={}){let t=e&&"object"==typeof e?e:{};return{enabled:!0===t.enabled,intervalSec:Math.max(10,Number.parseInt(t.intervalSec||S.intervalSec,10)||S.intervalSec),failureThreshold:Math.max(1,Number.parseInt(t.failureThreshold||S.failureThreshold,10)||S.failureThreshold),timeoutMs:Math.max(1e3,Number.parseInt(t.timeoutMs||S.timeoutMs,10)||S.timeoutMs),prompt:"string"==typeof t.prompt&&t.prompt.trim()?t.prompt.trim():S.prompt,disableThinking:!1!==t.disableThinking}}function O(e={}){return{overrideConnections:!0===e.overrideConnections,healthCheck:I(e.healthCheck||e||S)}}function P({providerId:e,onSaved:t}){let[s,l]=(0,i.useState)($()),[r,n]=(0,i.useState)(O()),[o,d]=(0,i.useState)(!0),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let t=!1;return async function(){try{let s=await fetch("/api/settings",{cache:"no-store"}),a=s.ok?await s.json():{};t||(l($((a.providerSchedules||{})[e]||{})),n(O((a.providerHealthChecks||{})[e]||{})))}finally{t||d(!1)}}(),()=>{t=!0}},[e]);let u=e=>{l(t=>({...t,schedule:A({...t.schedule,...e})})),x(!1)},h=e=>{n(t=>({...t,healthCheck:I({...t.healthCheck,...e})})),x(!1)},b=async()=>{m(!0),x(!1);try{let a=await fetch("/api/settings",{cache:"no-store"}),i=a.ok?await a.json():{},l={...i.providerSchedules||{},[e]:$(s)},n={...i.providerHealthChecks||{},[e]:O(r)};(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerSchedules:l,providerHealthChecks:n})})).ok&&(x(!0),"function"==typeof t&&await t())}finally{m(!1)}};return o?null:(0,a.jsxs)("div",{className:"mb-4 space-y-4 rounded-xl border border-border bg-card p-4",children:[(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 p-3",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.jsx)("h3",{className:"font-semibold text-text-main",children:"Provider Scheduler Override"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When enabled, every account in this provider uses this provider-level schedule and account schedulers are locked."})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-main",children:[(0,a.jsx)("input",{type:"checkbox",checked:s.overrideConnections,onChange:e=>{l(t=>({...t,overrideConnections:e.target.checked})),x(!1)}}),"Override all accounts"]})]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-2",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("div",{className:"mb-1 text-xs font-medium text-text-muted",children:"Weekdays"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:N.map(e=>(0,a.jsxs)("label",{className:"flex items-center gap-1 rounded-lg border border-border px-2 py-1 text-xs",children:[(0,a.jsx)("input",{type:"checkbox",checked:(s.schedule.weekdays||w).includes(e.value),onChange:()=>{var t;return t=e.value,void(l(e=>{let s=new Set(e.schedule.weekdays||w);s.has(t)?s.delete(t):s.add(t);let a=[...s].sort((e,t)=>e-t);return{...e,schedule:{...e.schedule,weekdays:a.length?a:w}}}),x(!1))}}),e.label]},e.value))})]}),(0,a.jsxs)("div",{className:"grid grid-cols-2 gap-3",children:[(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["From time",(0,a.jsx)("input",{type:"time",value:s.schedule.fromTime,onChange:e=>u({fromTime:e.target.value}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]}),(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["To time",(0,a.jsx)("input",{type:"time",value:s.schedule.toTime,onChange:e=>u({toTime:e.target.value}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"})]})]})]})]}),(0,a.jsxs)("div",{className:"rounded-xl border border-border/70 p-3",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.jsx)("h3",{className:"font-semibold text-text-main",children:"Provider Health Check Override"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"When enabled, every account in this provider uses the same periodic ping policy and account health settings are locked."})]}),(0,a.jsxs)("label",{className:"flex items-center gap-2 text-sm text-text-main",children:[(0,a.jsx)("input",{type:"checkbox",checked:r.overrideConnections,onChange:e=>{n(t=>({...t,overrideConnections:e.target.checked})),x(!1)}}),"Override all accounts"]})]}),(0,a.jsxs)("label",{className:"mb-3 flex items-center gap-2 text-sm text-text-main",children:[(0,a.jsx)("input",{type:"checkbox",checked:!0===r.healthCheck.enabled,onChange:e=>h({enabled:e.target.checked})}),"Enable periodic ping healthcheck"]}),(0,a.jsxs)("div",{className:"grid gap-3 md:grid-cols-4",children:[(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["Interval seconds",(0,a.jsx)("input",{type:"number",min:"10",value:r.healthCheck.intervalSec,disabled:!r.healthCheck.enabled,onChange:e=>h({intervalSec:Math.max(10,Number.parseInt(e.target.value,10)||60)}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"})]}),(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["Fail threshold",(0,a.jsx)("input",{type:"number",min:"1",max:"20",value:r.healthCheck.failureThreshold,disabled:!r.healthCheck.enabled,onChange:e=>h({failureThreshold:Math.max(1,Number.parseInt(e.target.value,10)||3)}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"})]}),(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["Timeout ms",(0,a.jsx)("input",{type:"number",min:"1000",step:"1000",value:r.healthCheck.timeoutMs,disabled:!r.healthCheck.enabled,onChange:e=>h({timeoutMs:Math.max(1e3,Number.parseInt(e.target.value,10)||15e3)}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"})]}),(0,a.jsxs)("label",{className:"text-xs font-medium text-text-muted",children:["Prompt",(0,a.jsx)("input",{type:"text",value:r.healthCheck.prompt,disabled:!r.healthCheck.enabled,onChange:e=>h({prompt:e.target.value}),className:"mt-1 w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:opacity-50"})]})]}),(0,a.jsxs)("label",{className:"mt-3 flex items-center gap-2 text-xs text-text-muted",children:[(0,a.jsx)("input",{type:"checkbox",checked:!1!==r.healthCheck.disableThinking,disabled:!r.healthCheck.enabled,onChange:e=>h({disableThinking:e.target.checked})}),"Force lightweight test payload / disable thinking when provider supports it"]})]}),(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("button",{type:"button",onClick:b,disabled:c,className:"rounded-lg bg-primary px-3 py-2 text-sm font-medium text-white disabled:cursor-not-allowed disabled:opacity-60",children:c?"Saving...":"Save Provider Policy"}),p&&(0,a.jsx)("span",{className:"text-sm text-green-600",children:"Saved"})]})]})}let R=`name1|sk-key1
2
+ name2|sk-key2
3
+ sk-key-only-auto-named`;function E({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:m,proxyPools:p,error:x,onSave:u,onBulkDone:h,onClose:b}){let g="__none__",f="ollama-local"===t,y="cookie"===n,v="xai"===t&&!y,j=y?"Cookie Value":"API Key",k="azure"===t,N="cloudflare-ai"===t,w=c.Q2?.[t]?.regions||null,C=c.Q2?.[t]?.defaultRegion||w?.[0]?.id||"",[S,T]=(0,i.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:g,ollamaHostUrl:""}),[A,$]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[I,O]=(0,i.useState)({accountId:""}),[P,D]=(0,i.useState)(C),[F,U]=(0,i.useState)(!1),[_,M]=(0,i.useState)(null),[z,L]=(0,i.useState)(!1),[q,K]=(0,i.useState)("single"),[J,W]=(0,i.useState)(""),[H,B]=(0,i.useState)(null),G=()=>f&&S.ollamaHostUrl.trim()?{baseUrl:S.ollamaHostUrl.trim()}:k?{azureEndpoint:A.azureEndpoint,apiVersion:A.apiVersion,deployment:A.deployment,organization:A.organization}:N?{accountId:I.accountId}:w&&P?{region:P}:void 0,V=async()=>{U(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:S.apiKey,providerSpecificData:G()})}),s=await e.json();M(s.valid?"success":"failed")}catch{M("failed")}finally{U(!1)}},Q=async()=>{if(t&&(f||S.apiKey)&&(f||S.name)&&(!l||S.defaultModel.trim())){L(!0);try{let e=!1;try{U(!0),M(null);let s=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:S.apiKey,providerSpecificData:G()})});e=!!(await s.json()).valid,M(e?"success":"failed")}catch{M("failed")}finally{U(!1)}await u({name:S.name||(f?"Ollama Local":""),apiKey:S.apiKey,defaultModel:l?S.defaultModel.trim():void 0,priority:S.priority,proxyPoolId:S.proxyPoolId===g?null:S.proxyPoolId,testStatus:e?"active":"unknown",providerSpecificData:G()})}finally{L(!1)}}},Z=async()=>{let e=J.split("\n").map(e=>e.trim()).filter(Boolean);if(!e.length)return;L(!0),B(null);let s=0,a=0;for(let i=0;i<e.length;i++){let l=e[i].split("|"),r=l.length>=2?l.slice(1).join("|").trim():l[0].trim(),n=l.length>=2?l[0].trim():"Key",o=`${n} ${i+1}`;try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:r,name:o,priority:1,testStatus:"unknown"})})).ok?s++:a++}catch{a++}}L(!1),B({success:s,failed:a}),s>0&&h&&h()};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Add ${s||t} ${j}`,onClose:b,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{size:"sm",variant:"single"===q?"primary":"ghost",onClick:()=>{K("single"),B(null)},children:"Single"}),(0,a.jsx)(d.$n,{size:"sm",variant:"bulk"===q?"primary":"ghost",onClick:()=>{K("bulk"),B(null)},children:"Bulk Add"})]}),"bulk"===q&&(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["One key per line. Format: ",(0,a.jsx)("code",{children:"name|apiKey"})," or just ",(0,a.jsx)("code",{children:"apiKey"})," (auto-named by index)."]}),(0,a.jsx)("textarea",{className:"w-full rounded border border-accent/30 bg-sidebar p-2 text-sm font-mono resize-y min-h-[140px] focus:outline-none focus:ring-1 focus:ring-primary",placeholder:R,value:J,onChange:e=>W(e.target.value)}),H&&(0,a.jsxs)("div",{className:`text-sm font-medium ${H.failed>0?"text-yellow-400":"text-green-400"}`,children:["✓ ",H.success," added",H.failed>0?`, ✗ ${H.failed} failed`:""]}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Z,fullWidth:!0,disabled:z||!J.trim(),children:z?"Adding...":"Add All Keys"}),(0,a.jsx)(d.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"single"===q&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.pd,{label:"Name",value:S.name,onChange:e=>T({...S,name:e.target.value}),placeholder:f?"Ollama Local":"Production Key"}),f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"Ollama Host URL",value:S.ollamaHostUrl,onChange:e=>T({...S,ollamaHostUrl:e.target.value}),placeholder:"http://localhost:11434",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:V,disabled:F||z,variant:"secondary",children:F?"Checking...":"Check"})})]}),!f&&(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:j,type:y?"text":"password",value:S.apiKey,onChange:e=>T({...S,apiKey:e.target.value}),placeholder:y?"grok-web"===t?"sso=xxxxx... or just the raw value":"eyJhbGciOi...":v?"xai-...":"",className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:V,disabled:!S.apiKey||F||z,variant:"secondary",children:F?"Checking...":"Check"})})]}),v&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Use a direct xAI API key from console.x.ai. This is separate from Grok Build OAuth."}),y&&o&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:[o,m&&(0,a.jsxs)(a.Fragment,{children:[" ",(0,a.jsxs)("a",{href:m,target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:["Open ",m.replace(/^https?:\/\//,"")]})]})]}),w&&(0,a.jsx)(d.l6,{label:"Region",value:P,onChange:e=>D(e.target.value),options:w.map(e=>({value:e.id,label:e.label}))}),l&&(0,a.jsx)(d.pd,{label:"Default Model",value:S.defaultModel,onChange:e=>T({...S,defaultModel:e.target.value}),placeholder:r?"claude-3-5-sonnet-latest":"gpt-4o-mini"}),f&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Leave blank to use ",(0,a.jsx)("code",{children:"http://localhost:11434"}),". For remote Ollama, enter the full host URL (e.g. ",(0,a.jsx)("code",{children:"http://192.168.1.10:11434"}),")."]}),_&&(0,a.jsx)(d.Ex,{variant:"success"===_?"success":"error",children:"success"===_?"Valid":"Invalid"}),x&&(0,a.jsx)("p",{className:"text-xs text-red-500 break-words",children:x}),l&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Enter the model ID exactly as your compatible endpoint expects it. This model will be saved as the connection default."}),N&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Cloudflare Workers AI"}),(0,a.jsx)(d.pd,{label:"Account ID",value:I.accountId,onChange:e=>O({...I,accountId:e.target.value}),placeholder:"abc123def456..."}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-2",children:["Find your Account ID in the right sidebar of ",(0,a.jsx)("a",{href:"https://dash.cloudflare.com",target:"_blank",rel:"noopener noreferrer",className:"text-primary underline",children:"dash.cloudflare.com"})]})]}),k&&(0,a.jsxs)("div",{className:"bg-sidebar/50 p-4 rounded-lg border border-accent/20",children:[(0,a.jsx)("h3",{className:"font-semibold mb-3 text-sm",children:"Azure OpenAI Configuration"}),(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsx)(d.pd,{label:"Azure Endpoint",value:A.azureEndpoint,onChange:e=>$({...A,azureEndpoint:e.target.value}),placeholder:"https://your-resource.openai.azure.com"}),(0,a.jsx)(d.pd,{label:"Deployment Name",value:A.deployment,onChange:e=>$({...A,deployment:e.target.value}),placeholder:"gpt-4"}),(0,a.jsx)(d.pd,{label:"API Version",value:A.apiVersion,onChange:e=>$({...A,apiVersion:e.target.value}),placeholder:"2024-10-01-preview"}),(0,a.jsx)(d.pd,{label:"Organization",value:A.organization,onChange:e=>$({...A,organization:e.target.value}),placeholder:"Organization ID"})]})]}),(0,a.jsx)(d.pd,{label:"Priority",type:"number",value:S.priority,onChange:e=>T({...S,priority:Number.parseInt(e.target.value)||1})}),(0,a.jsx)(d.l6,{label:"Proxy Pool",value:S.proxyPoolId,onChange:e=>T({...S,proxyPoolId:e.target.value}),options:[{value:g,label:"None"},...(p||[]).map(e=>({value:e.id,label:e.name}))],placeholder:"None"}),0===(p||[]).length&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"No active proxy pools available. Create one in Proxy Pools page first."}),(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Legacy manual proxy fields are still accepted by API for backward compatibility."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:Q,fullWidth:!0,disabled:z||!f&&(!S.name||!S.apiKey)||l&&!S.defaultModel.trim()||k&&(!A.azureEndpoint||!A.deployment||!A.organization)||N&&!I.accountId,children:z?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}function D({isOpen:e,node:t,onSave:s,onClose:l,isAnthropic:r}){let[n,o]=(0,i.useState)({name:"",prefix:"",apiType:"chat",baseUrl:"https://api.openai.com/v1",routingTags:"",maxInFlight:""}),[c,m]=(0,i.useState)(!1),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(""),[b,g]=(0,i.useState)(!1),[f,y]=(0,i.useState)(null);(0,i.useEffect)(()=>{t&&o({name:t.name||"",prefix:t.prefix||"",apiType:t.apiType||"chat",baseUrl:t.baseUrl||(r?"https://api.anthropic.com/v1":"https://api.openai.com/v1"),routingTags:Array.isArray(t.providerSpecificData?.routingTags||t.providerSpecificData?.tags||t.tags)?(t.providerSpecificData?.routingTags||t.providerSpecificData?.tags||t.tags).join(", "):t.providerSpecificData?.routingTags||t.providerSpecificData?.tags||t.tags||"",maxInFlight:t.providerSpecificData?.maxInFlight||t.maxInFlight||""})},[t,r]);let v=async()=>{if(n.name.trim()&&n.prefix.trim()&&n.baseUrl.trim()){m(!0);try{let e=String(n.routingTags||"").split(/[\n,;]+/).map(e=>e.trim()).filter(Boolean),a=Number(n.maxInFlight),i={...t.providerSpecificData||{},routingTags:e,tags:e};Number.isFinite(a)&&a>0?i.maxInFlight=a:delete i.maxInFlight;let l={name:n.name,prefix:n.prefix,baseUrl:n.baseUrl,routingTags:e,tags:e,providerSpecificData:i};r||(l.apiType=n.apiType),await s(l)}finally{m(!1)}}},j=async()=>{g(!0);try{let e=await fetch("/api/provider-nodes/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({baseUrl:n.baseUrl,apiKey:p,type:r?"anthropic-compatible":"openai-compatible",modelId:u.trim()||void 0})}),t=await e.json();y(t.valid?"success":"failed")}catch{y("failed")}finally{g(!1)}};return t?(0,a.jsx)(d.aF,{isOpen:e,title:`Edit ${r?"Anthropic":"OpenAI"} Compatible`,onClose:l,children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsx)(d.pd,{label:"Name",value:n.name,onChange:e=>o({...n,name:e.target.value}),placeholder:`${r?"Anthropic":"OpenAI"} Compatible (Prod)`,hint:"Required. A friendly label for this node."}),(0,a.jsx)(d.pd,{label:"Prefix",value:n.prefix,onChange:e=>o({...n,prefix:e.target.value}),placeholder:r?"ac-prod":"oc-prod",hint:"Required. Used as the provider prefix for model IDs."}),!r&&(0,a.jsx)(d.l6,{label:"API Type",options:[{value:"chat",label:"Chat Completions"},{value:"responses",label:"Responses API"}],value:n.apiType,onChange:e=>o({...n,apiType:e.target.value})}),(0,a.jsx)(d.pd,{label:"Base URL",value:n.baseUrl,onChange:e=>o({...n,baseUrl:e.target.value}),placeholder:r?"https://api.anthropic.com/v1":"https://api.openai.com/v1",hint:`Use the base URL (ending in /v1) for your ${r?"Anthropic":"OpenAI"}-compatible API.`}),(0,a.jsx)(d.pd,{label:"Routing Tags / Labels",value:n.routingTags,onChange:e=>o({...n,routingTags:e.target.value}),placeholder:"gpu, vram:8gb, model_support:qwen3:8b",hint:"Comma or newline separated. Used by Combo least-latency/P2C tag rules for LAN Ollama."}),(0,a.jsx)(d.pd,{label:"Max In-flight Requests",type:"number",value:n.maxInFlight,onChange:e=>o({...n,maxInFlight:e.target.value}),placeholder:"2",hint:"Optional per-endpoint concurrency cap used by P2C and circuit-aware routing."}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.pd,{label:"API Key (for Check)",type:"password",value:p,onChange:e=>x(e.target.value),className:"flex-1"}),(0,a.jsx)("div",{className:"pt-6",children:(0,a.jsx)(d.$n,{onClick:j,disabled:!p||b||!n.baseUrl.trim(),variant:"secondary",children:b?"Checking...":"Check"})})]}),(0,a.jsx)(d.pd,{label:"Model ID (optional)",value:u,onChange:e=>h(e.target.value),placeholder:"e.g. my-model-id",hint:"If provider lacks /models endpoint, enter a model ID to validate via chat/completions instead."}),f&&(0,a.jsx)(d.Ex,{variant:"success"===f?"success":"error",children:"success"===f?"Valid":"Invalid"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)(d.$n,{onClick:v,fullWidth:!0,disabled:!n.name.trim()||!n.prefix.trim()||!n.baseUrl.trim()||c,children:c?"Saving...":"Save"}),(0,a.jsx)(d.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function F({isOpen:e,providerAlias:t,providerDisplayAlias:s,onSave:l,onClose:r}){let[n,o]=(0,i.useState)(""),[c,m]=(0,i.useState)(null),[p,x]=(0,i.useState)(""),[u,h]=(0,i.useState)(!1);(0,i.useEffect)(()=>{e&&(o(""),m(null),x(""))},[e]);let b=e=>{let s=`${t}/`;return e.startsWith(s)?e.slice(s.length):e},g=async()=>{let e=b(n.trim());if(e){m("testing"),x("");try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${t}/${e}`})}),a=await s.json();m(a.ok?"ok":"error"),x(a.error||"")}catch(e){m("error"),x(e.message)}}},f=async()=>{let e=b(n.trim());if(e&&!u){h(!0);try{await l(e)}finally{h(!1)}}};return(0,a.jsx)(d.aF,{isOpen:e,onClose:r,title:"Add Custom Model",children:(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("div",{children:[(0,a.jsx)("label",{className:"text-sm font-medium mb-1.5 block",children:"Model ID"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>{o(e.target.value),m(null),x("")},onKeyDown:e=>{"Enter"===e.key&&g()},placeholder:"e.g. claude-opus-4-5",className:"flex-1 px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",autoFocus:!0}),(0,a.jsx)(d.$n,{variant:"secondary",icon:"science",loading:"testing"===c,onClick:g,disabled:!n.trim()||"testing"===c,children:"testing"===c?"Testing...":"Test"})]}),(0,a.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:["Sent to provider as: ",(0,a.jsx)("code",{className:"font-mono bg-sidebar px-1 rounded",children:b(n.trim())||"model-id"})]})]}),"ok"===c&&(0,a.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base",children:"check_circle"}),"Model is reachable"]}),"error"===c&&(0,a.jsxs)("div",{className:"flex items-start gap-2 text-sm text-red-500",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base shrink-0",children:"cancel"}),(0,a.jsx)("span",{children:p||"Model not reachable"})]}),(0,a.jsxs)("div",{className:"flex gap-2 pt-1",children:[(0,a.jsx)(d.$n,{onClick:r,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),(0,a.jsx)(d.$n,{onClick:f,fullWidth:!0,size:"sm",disabled:!n.trim()||u,children:u?"Adding...":"Add Model"})]})]})})}function U(){let e,t=(0,l.useParams)(),s=(0,l.useRouter)(),r=t.id,[x,h]=(0,i.useState)([]),[b,f]=(0,i.useState)(!0),[v,j]=(0,i.useState)(null),[N,w]=(0,i.useState)([]),[C,S]=(0,i.useState)(!1),[T,A]=(0,i.useState)(!1),[$,I]=(0,i.useState)(!1),[O,R]=(0,i.useState)(""),[U,_]=(0,i.useState)(!1),[M,z]=(0,i.useState)(!1),[L,q]=(0,i.useState)(!1),[K,J]=(0,i.useState)(null),[W,H]=(0,i.useState)({}),[B,G]=(0,i.useState)(!1),[V,Q]=(0,i.useState)({}),[Z,X]=(0,i.useState)(""),[Y,ee]=(0,i.useState)(null),[et,es]=(0,i.useState)(!1),[ea,ei]=(0,i.useState)([]),[el,er]=(0,i.useState)("__none__"),[en,eo]=(0,i.useState)(!1),[ed,ec]=(0,i.useState)(null),[em,ep]=(0,i.useState)({}),[ex,eu]=(0,i.useState)(null),[eh,eb]=(0,i.useState)(""),[eg,ef]=(0,i.useState)("global"),[ey,ev]=(0,i.useState)("120"),[ej,ek]=(0,i.useState)(!0),[eN,ew]=(0,i.useState)(!0),[eC,eS]=(0,i.useState)("3"),[eT,eA]=(0,i.useState)("auto"),[e$,eI]=(0,i.useState)([]),[eO,eP]=(0,i.useState)([]),[eR,eE]=(0,i.useState)([]),[eD,eF]=(0,i.useState)(null),[eU,e_]=(0,i.useState)(!1),[eM,ez]=(0,i.useState)(!1),[eL,eq]=(0,i.useState)(!1),[eK,eJ]=(0,i.useState)(null),[eW,eH]=(0,i.useState)({}),[eB,eG]=(0,i.useState)(null),eV=(0,i.useRef)(!1),{copied:eQ,copy:eZ}=(0,p.C)(),eX="ag_risk_confirmed",eY=()=>{S(!0)},e0=()=>{"antigravity"===r&&"true"!==window.localStorage.getItem(eX)?e_(!0):e4?eY():(R(""),I(!0))},e1=()=>{R(""),I(!0)},e2=()=>{e4?e0():e1()},e5=v?{id:v.id,name:v.name||("anthropic-compatible"===v.type?"Anthropic Compatible":"OpenAI Compatible"),color:"anthropic-compatible"===v.type?"#D97757":"#10A37F",textIcon:"anthropic-compatible"===v.type?"AC":"OC",apiType:v.apiType,baseUrl:v.baseUrl,type:v.type}:c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r]||c.br[r],e3=e5?.authModes||[],e4=!!c.zN[r]||!!c.IS[r]||e3.includes("oauth"),e6=!!c.fg[r]||e3.includes("apikey"),e7=!!c.IS[r]?.noAuth,e8=(0,m.KC)(r),e9=(0,c.wG)(r),te=(0,c.mq)(r),tt=(0,c.gb)(r),ts=te||tt,ta=!ts&&e4&&e6,ti="xai"===r?"Grok Build OAuth":"OAuth",tl="xai"===r?"xAI API Key":"API Key";c.Q2[r]?.thinkingConfig||c.s9.extended;let tr=ts?r:e9,tn=ts?v?.prefix||r:e9,to=(0,i.useCallback)(async()=>{try{let e=await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}`,{cache:"no-store"}),t=await e.json();e.ok&&eE(t.ids||[])}catch(e){console.log("Error fetching disabled models:",e)}},[tr]),td=async e=>{try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tr,ids:[e]})})).ok&&await to()}catch(e){console.log("Error disabling model:",e)}},tc=async e=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}&id=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling model:",e)}},tm=async e=>{e.length&&eF({title:"Disable All Models",message:`Disable all ${e.length} model(s)?`,onConfirm:async()=>{eF(null);try{(await fetch("/api/models/disabled",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:tr,ids:e})})).ok&&await to()}catch(e){console.log("Error disabling all models:",e)}}})},tp=async()=>{try{(await fetch(`/api/models/disabled?providerAlias=${encodeURIComponent(tr)}`,{method:"DELETE"})).ok&&await to()}catch(e){console.log("Error enabling all models:",e)}},tx=(0,i.useCallback)(async()=>{try{let e=await fetch("/api/models/alias"),t=await e.json();e.ok&&H(t.aliases||{})}catch(e){console.log("Error fetching aliases:",e)}},[]);(0,i.useEffect)(()=>{"kilocode"===r&&fetch("/api/providers/kilo/free-models").then(e=>e.json()).then(e=>{e.models?.length&&eP(e.models)}).catch(()=>{})},[r]);let tu=(0,i.useCallback)(async()=>{try{let[e,t,s,a]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/provider-nodes",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),i=await e.json(),l=await t.json(),n=await s.json(),o=a.ok?await a.json():{};if(e.ok){let e=(i.connections||[]).filter(e=>e.provider===r);h(e)}s.ok&&w(n.proxyPools||[]),ec((o.providerHealthChecks||{})[r]||null);let d=(o.providerStrategies||{})[r]||{};eu(d.fallbackStrategy||null),eb(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1"),ef(d.stickyScope||"global"),ev(null!=d.stickyTtlMinutes?String(d.stickyTtlMinutes):"120"),ek(!1!==d.stickyFallbackToClientIp),ew(!1!==d.stickyRebindOnFailure),eS(null!=d.stickyRebindFailureThreshold?String(d.stickyRebindFailureThreshold):"3");let c=(o.providerThinking||{})[r]||{};if(eA(c.mode||"auto"),t.ok){let e=(l.nodes||[]).find(e=>e.id===r)||null;if(!e&&ts)for(let t=0;t<3;t+=1){await new Promise(e=>setTimeout(e,150));let t=await fetch("/api/provider-nodes",{cache:"no-store"});if(t.ok&&(e=((await t.json()).nodes||[]).find(e=>e.id===r)||null))break}j(e)}}catch(e){console.log("Error fetching connections:",e)}finally{f(!1)}},[r,ts]),th=async e=>{try{let t=await fetch(`/api/provider-nodes/${r}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)}),s=await t.json();t.ok&&(j(s.node),await tu(),z(!1))}catch(e){console.log("Error updating provider node:",e)}},tb=async(e,t,s={})=>{try{let a=await fetch("/api/settings",{cache:"no-store"}),i=(a.ok?await a.json():{}).providerStrategies||{},l={...i[r]||{}};delete l.fallbackStrategy,delete l.stickyRoundRobinLimit,delete l.stickyScope,delete l.stickyTtlMinutes,delete l.stickyFallbackToClientIp,delete l.stickyRebindOnFailure,delete l.stickyRebindFailureThreshold,e&&(l.fallbackStrategy=e),"round-robin"===e&&(l.stickyRoundRobinLimit=Number(t||eh||1)||1,l.stickyScope=s.stickyScope??eg??"global",l.stickyTtlMinutes=Number(s.stickyTtlMinutes??ey??120)||120,l.stickyFallbackToClientIp=void 0!==s.stickyFallbackToClientIp?!!s.stickyFallbackToClientIp:!1!==ej,l.stickyRebindOnFailure=void 0!==s.stickyRebindOnFailure?!!s.stickyRebindOnFailure:!1!==eN,l.stickyRebindFailureThreshold=Number(s.stickyRebindFailureThreshold??eC??3)||3);let n={...i};0===Object.keys(l).length?delete n[r]:n[r]=l,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:n})})}catch(e){console.log("Error saving provider strategy:",e)}};(0,i.useEffect)(()=>{tu(),tx(),to()},[tu,tx,to]),(0,i.useEffect)(()=>{let e=(c.zN[r]||c.fg[r]||c.IS[r]||c.nJ[r])?.modelsFetcher;e&&u(e).then(eI)},[r]);let tg=async(e,t,s=e9)=>{let a=`${s}/${e}`;try{let e=await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})});if(e.ok)await tx();else{let t=await e.json();alert(t.error||"Failed to set alias")}}catch(e){console.log("Error setting alias:",e)}},tf=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await tx()}catch(e){console.log("Error deleting alias:",e)}},ty=async()=>{if(eM||0===x.length)return;let e=Object.fromEntries(x.map(e=>[e.id,{state:"queued",error:null}]));eV.current=!1,ez(!0),eq(!1),eJ(null),eH(e),eG({total:x.length,completed:0,passed:0,failed:0,stopped:!1});let t=0,s=0;try{for(let e=0;e<x.length;e+=1){if(eV.current){eG({total:x.length,completed:e,passed:t,failed:s,stopped:!0});break}let a=x[e];eJ(a.id),eH(e=>({...e,[a.id]:{state:"testing",error:null}}));try{let e=await fetch(`/api/providers/${a.id}/test`,{method:"POST"}),i=await e.json(),l=!!i.valid;l?t+=1:s+=1,eH(e=>({...e,[a.id]:{state:l?"success":"failed",error:l?null:i.error||null}}))}catch(e){s+=1,eH(t=>({...t,[a.id]:{state:"failed",error:e.message||"Test failed"}}))}eG({total:x.length,completed:e+1,passed:t,failed:s,stopped:!1}),e<x.length-1&&await new Promise(e=>setTimeout(e,1e3))}}finally{eJ(null),ez(!1),eq(!1),eV.current=!1}},tv=async e=>{eF({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{eF(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&h(x.filter(t=>t.id!==e))}catch(e){console.log("Error deleting connection:",e)}}})},tj=()=>{tu(),S(!1)},tk=async e=>{R("");try{let t=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:r,...e})}),s=null;try{s=await t.json()}catch{s=null}if(t.ok){await tu(),I(!1);return}R(s?.error||"Failed to save connection")}catch(e){console.log("Error saving connection:",e),R("Failed to save connection")}},tN=async e=>{try{(await fetch(`/api/providers/${K.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await tu(),_(!1))}catch(e){console.log("Error updating connection:",e)}},tw=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&h(s=>s.map(s=>s.id===e?{...s,isActive:t}:s))}catch(e){console.log("Error updating connection status:",e)}},tC=async(e,t)=>{let s=[...x];[s[e],s[t]]=[s[t],s[e]],h(s);try{await Promise.all([fetch(`/api/providers/${s[e].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:e})}),fetch(`/api/providers/${s[t].id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({priority:t})})])}catch(e){console.log("Error swapping priority:",e),await tu()}},tS=x.filter(e=>ea.includes(e.id));x.length>0&&(ea.length,x.length),(0,i.useEffect)(()=>{ei(e=>e.filter(e=>x.some(t=>t.id===e)))},[x]),(()=>{if(0===tS.length)return;let e=new Set(tS.map(e=>e.providerSpecificData?.proxyPoolId||"__none__"));if(1===e.size){let t=[...e][0];if("__none__"===t)return;let s=N.find(e=>e.id===t);return s?.name}})();let tT=()=>{en||q(!1)},tA=async e=>{eo(!0);try{let t=0;for(let{connectionId:s,proxyPoolId:a}of e)try{(await fetch(`/api/providers/${s}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:a})})).ok||(t+=1)}catch(e){console.log("Error applying proxy for",s,e),t+=1}t>0&&alert(`Updated with ${t} failed request(s).`),await tu(),q(!1)}finally{eo(!1)}},t$=e=>tA(x.map(t=>({connectionId:t.id,proxyPoolId:e}))),tI=(0,a.jsx)("div",{className:"flex min-w-0 flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03]",children:x.map((e,t)=>(0,a.jsx)("div",{className:"flex min-w-0 items-stretch",children:(0,a.jsx)("div",{className:"flex-1 min-w-0",children:(0,a.jsx)(k,{connection:e,proxyPools:N,isOAuth:e4,isFirst:0===t,isLast:t===x.length-1,onMoveUp:()=>tC(t,t-1),onMoveDown:()=>tC(t,t+1),onToggleActive:t=>tw(e.id,t),onUpdateProxy:async t=>{try{(await fetch(`/api/providers/${e.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&h(s=>s.map(s=>s.id===e.id?{...s,providerSpecificData:{...s.providerSpecificData,proxyPoolId:t||null}}:s))}catch(e){console.log("Error updating proxy:",e)}},onEdit:()=>{J(e),_(!0)},onDelete:()=>tv(e.id),oneByOneStatus:eW[e.id]||null})})},e.id))}),tO=N.filter(e=>!0===e.isActive),tP=(0,a.jsx)(d.aF,{isOpen:L,onClose:tT,title:`Apply Proxy (${x.length} connections)`,children:(0,a.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsxs)("button",{onClick:()=>{let e=N.filter(e=>!0===e.isActive);return 0===e.length?void alert("No active proxy pools available."):tA(x.map((t,s)=>({connectionId:t.id,proxyPoolId:e[s%e.length].id})))},disabled:en||0===tO.length,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"sync_alt"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"One-to-one (rotate)"})]}),(0,a.jsxs)("button",{onClick:()=>t$(null),disabled:en,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"link_off"}),(0,a.jsx)("span",{className:"text-sm text-text-main",children:"None (unbind all)"})]}),N.map(e=>(0,a.jsxs)("button",{onClick:()=>t$(e.id),disabled:en||!0!==e.isActive,className:"flex items-center gap-2 rounded-lg px-3 py-2 text-left transition-colors hover:bg-black/[0.04] dark:hover:bg-white/[0.04] disabled:cursor-not-allowed disabled:opacity-50",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-text-muted text-[18px]",children:"lan"}),(0,a.jsx)("span",{className:"truncate text-sm text-text-main",children:e.name}),!0!==e.isActive&&(0,a.jsx)("span",{className:"text-[10px] text-text-muted",children:"(inactive)"})]},e.id))]}),en&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Applying..."}),(0,a.jsx)(d.$n,{onClick:tT,variant:"ghost",fullWidth:!0,disabled:en,children:"Cancel"})]})}),tR=async e=>{if(!Y){ee(e);try{let t=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${tr}/${e}`})}),s=await t.json();Q(t=>({...t,[e]:s.ok?"ok":"error"})),X(s.ok?"":s.error||"Model not reachable")}catch{Q(t=>({...t,[e]:"error"})),X("Network error")}finally{ee(null)}}};return b?(0,a.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,a.jsx)(d.Qv,{}),(0,a.jsx)(d.Qv,{})]}):e5?(0,a.jsxs)("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:gap-8 sm:px-0",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)(n(),{href:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),(0,a.jsxs)("div",{className:"flex min-w-0 items-center gap-3 sm:gap-4",children:[(0,a.jsx)("div",{className:"flex size-12 shrink-0 items-center justify-center rounded-lg",style:{backgroundColor:`${e5.color}15`},children:B?(0,a.jsx)("span",{className:"text-sm font-bold",style:{color:e5.color},children:e5.textIcon||e5.id.slice(0,2).toUpperCase()}):(0,a.jsx)(o.default,{src:te&&e5.apiType?"responses"===e5.apiType?"/providers/oai-r.png":"/providers/oai-cc.png":tt?"/providers/anthropic-m.png":`/providers/${e5.id}.png`,alt:e5.name,width:48,height:48,className:"max-h-12 max-w-12 rounded-lg object-contain",sizes:"48px",onError:()=>G(!0)})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3 flex-wrap",children:[(0,a.jsx)("h1",{className:"truncate text-2xl font-semibold tracking-tight sm:text-3xl",children:e5.name}),(e5.notice?.apiKeyUrl||e5.notice?.signupUrl||e5.website)&&(0,a.jsxs)("a",{href:e5.notice?.apiKeyUrl||e5.notice?.signupUrl||e5.website,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),e5.notice?.apiKeyUrl?"Get API Key":"Sign up / Learn more"]})]}),(0,a.jsxs)("p",{className:"text-text-muted",children:[x.length," connection",1===x.length?"":"s"]})]})]})]}),e5.deprecated&&(0,a.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-yellow-500/10 border border-yellow-500/30",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-yellow-500 mt-0.5 shrink-0",children:"warning"}),(0,a.jsx)("p",{className:"text-xs text-red-600 dark:text-yellow-400 leading-relaxed",children:e5.deprecationNotice})]}),e5.notice?.text&&!e5.deprecated&&(0,a.jsxs)("div",{className:"flex flex-col gap-2 rounded-lg border border-blue-500/30 bg-blue-500/10 px-3 py-2 sm:flex-row sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,a.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:e5.notice.text}),e5.notice.apiKeyUrl&&(0,a.jsx)("a",{href:e5.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"inline-flex justify-center rounded bg-blue-500 px-2 py-1 text-xs font-medium text-white transition-colors hover:bg-blue-600 sm:py-0.5",children:"Get API Key →"})]}),ts&&v&&(0,a.jsx)(d.Zp,{children:(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:tt?"Anthropic Compatible Details":"OpenAI Compatible Details"}),(0,a.jsxs)("p",{className:"break-all text-sm text-text-muted",children:[tt?"Messages API":"responses"===v.apiType?"Responses API":"Chat Completions"," \xb7 ",(v.baseUrl||"").replace(/\/$/,""),"/",tt?"messages":"responses"===v.apiType?"responses":"chat/completions"]})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 gap-2 sm:flex sm:items-center",children:[(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:()=>{R(""),I(!0)},className:"w-full sm:w-auto",children:"Add API Key"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>z(!0),className:"w-full sm:w-auto",children:"Edit"}),(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:async()=>{eF({title:"Delete Compatible Node",message:`Delete this ${tt?"Anthropic":"OpenAI"} Compatible node?`,onConfirm:async()=>{eF(null);try{(await fetch(`/api/provider-nodes/${r}`,{method:"DELETE"})).ok&&s.push("/dashboard/providers")}catch(e){console.log("Error deleting provider node:",e)}}})},className:"w-full sm:w-auto",children:"Delete"})]})]})}),e7?(0,a.jsx)(d.gw,{providerId:r}):(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-5 flex flex-col gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),"round-robin"===ex&&(0,a.jsx)("p",{className:"mt-1 text-xs text-text-muted",children:"Round Robin distributes requests across active accounts for this provider."})]}),(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-2 lg:justify-end",children:[x.length>0&&N.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"lan",onClick:()=>q(!0),children:"Apply Proxy"}),x.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"sync",onClick:ty,disabled:eM,children:eM?"Testing Connection One-by-One...":"Test Connection One-by-One"}),eM&&(0,a.jsx)(d.$n,{size:"sm",variant:"ghost",icon:"stop",onClick:()=>{eM&&(eV.current=!0,eq(!0))},disabled:eL,children:eL?"Stopping...":"Stop"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2 rounded-xl border border-border bg-surface/60 px-3 py-2 shadow-sm",children:[(0,a.jsx)("span",{className:"text-xs font-medium text-text-muted",children:"Round Robin"}),(0,a.jsx)(d.lM,{checked:"round-robin"===ex,onChange:e=>{let t=e?"round-robin":null,s=e?eh||"1":eh;e&&!eh&&eb("1"),eu(t),tb(t,s)}}),"round-robin"===ex&&(0,a.jsxs)("label",{className:"flex items-center gap-1.5 border-l border-border pl-2",children:[(0,a.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,a.jsx)("input",{type:"number",min:1,value:eh,onChange:e=>{var t;eb(t=e.target.value),tb("round-robin",t)},placeholder:"1",className:"w-14 rounded-md border border-border bg-background px-2 py-1 text-xs focus:border-primary focus:outline-none",title:"How many selections/sessions use the same account before global round-robin advances."})]})]})]})]}),"round-robin"===ex&&(0,a.jsxs)("div",{className:"rounded-2xl border border-border bg-surface/70 p-4 shadow-sm",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 lg:flex-row lg:items-start lg:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px] text-primary",children:"sticky_note_2"}),(0,a.jsx)("h3",{className:"text-sm font-semibold text-text-main",children:"Provider Round Robin Sticky"})]}),(0,a.jsx)("p",{className:"mt-1 max-w-3xl text-xs leading-relaxed text-text-muted",children:"Choose how this provider keeps the same account/API key/OAuth connection for a client. Leave it on Global to keep the current behavior."})]}),(0,a.jsx)(d.Ex,{variant:"secondary",className:"w-fit shrink-0",children:"Per provider"})]}),(0,a.jsxs)("div",{className:"grid gap-4 lg:grid-cols-3",children:[(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Sticky mode"}),(0,a.jsxs)("select",{value:eg,onChange:e=>{var t;ef(t=e.target.value),tb("round-robin",eh||"1",{stickyScope:t})},className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary",children:[(0,a.jsx)("option",{value:"global",children:"Global / current behavior"}),(0,a.jsx)("option",{value:"client_ip",children:"Client IP"}),(0,a.jsx)("option",{value:"client_session",children:"Client IP + chat session"})]}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Global rotates like before. Client/session modes keep account identity more stable."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Sticky TTL minutes"}),(0,a.jsx)("input",{type:"number",min:1,max:10080,value:ey,onChange:e=>{var t;ev(t=e.target.value),tb("round-robin",eh||"1",{stickyTtlMinutes:Number(t)||120})},className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"Sticky assignments stay in memory and expire after this time."})]}),(0,a.jsxs)("label",{className:"block",children:[(0,a.jsx)("span",{className:"mb-1 block text-[11px] font-semibold uppercase tracking-wide text-text-muted",children:"Rebind after fallback count"}),(0,a.jsx)("input",{type:"number",min:1,max:50,value:eC,onChange:e=>{var t;eS(t=e.target.value),tb("round-robin",eh||"1",{stickyRebindFailureThreshold:Number(t)||3})},disabled:!eN,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-text-main outline-none focus:border-primary disabled:cursor-not-allowed disabled:opacity-50"}),(0,a.jsx)("p",{className:"mt-1 text-[11px] leading-relaxed text-text-muted",children:"After this many temporary fallbacks, the session is rebound to the fallback account."})]})]}),(0,a.jsxs)("div",{className:"mt-4 grid gap-3 lg:grid-cols-2",children:[(0,a.jsxs)("label",{className:"flex items-start gap-3 rounded-xl border border-border bg-background/70 p-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:ej,onChange:e=>{var t;ek(t=e.target.checked),tb("round-robin",eh||"1",{stickyFallbackToClientIp:t})},className:"mt-0.5"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-xs font-medium text-text-main",children:"Fallback to Client IP when session id is missing"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-relaxed text-text-muted",children:"Useful when the app does not send a stable chat session id."})]})]}),(0,a.jsxs)("label",{className:"flex items-start gap-3 rounded-xl border border-border bg-background/70 p-3",children:[(0,a.jsx)("input",{type:"checkbox",checked:eN,onChange:e=>{var t;ew(t=e.target.checked),tb("round-robin",eh||"1",{stickyRebindOnFailure:t})},className:"mt-0.5"}),(0,a.jsxs)("span",{children:[(0,a.jsx)("span",{className:"block text-xs font-medium text-text-main",children:"Rebind session after repeated unavailable/rate-limited hits"}),(0,a.jsx)("span",{className:"mt-1 block text-[11px] leading-relaxed text-text-muted",children:"First fallbacks are temporary; repeated failures switch that sticky session to a healthier account."})]})]})]}),(0,a.jsxs)("div",{className:"mt-4 rounded-xl border border-primary/20 bg-primary/5 px-3 py-2 text-[11px] leading-relaxed text-text-muted",children:["Recommended for Codex/Copilot-style OAuth providers:",(0,a.jsx)("span",{className:"font-medium text-text-main",children:" Client IP + chat session"}),", TTL 120 minutes, Client IP fallback enabled, rebind enabled after 3 fallbacks."]})]})]}),(0,a.jsx)(P,{providerId:r,onSaved:tu})," ",0===x.length?(0,a.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsxs)("div",{className:"flex items-center gap-3",children:[(0,a.jsx)("div",{className:"inline-flex items-center justify-center w-9 h-9 rounded-full bg-primary/10 text-primary shrink-0",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:e4?"lock":"key"})}),(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),ta&&(0,a.jsxs)("p",{className:"text-xs text-text-muted",children:["Choose ",ti," or ",tl,"."]})]})]}),(0,a.jsx)("div",{className:"flex gap-2",children:ta?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e0,children:ti}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e1,children:tl})]}):(0,a.jsxs)(a.Fragment,{children:[!ts&&"iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>A(!0),children:"Cookie"}),(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e2,children:ts?"Add API Key":"iflow"===r?"OAuth":"Add Connection"})]})})]}):(0,a.jsxs)(a.Fragment,{children:[eB&&(0,a.jsx)("div",{className:"mb-4 rounded-lg border border-black/10 bg-black/[0.02] px-3 py-2 text-xs text-text-muted dark:border-white/10 dark:bg-white/[0.03]",children:(0,a.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,a.jsxs)("span",{children:["Total: ",eB.total]}),(0,a.jsxs)("span",{children:["Completed: ",eB.completed]}),(0,a.jsxs)("span",{children:["Passed: ",eB.passed]}),(0,a.jsxs)("span",{children:["Failed: ",eB.failed]}),eB.stopped&&(0,a.jsx)("span",{className:"text-amber-600 dark:text-amber-400",children:"Stopped"}),eM&&eK&&(0,a.jsxs)("span",{children:["Running: ",x.find(e=>e.id===eK)?.name||eK]})]})}),tI,!ts&&(0,a.jsxs)("div",{className:"mt-4 grid grid-cols-1 gap-2 sm:flex",children:["iflow"===r&&(0,a.jsx)(d.$n,{size:"sm",icon:"cookie",variant:"secondary",onClick:()=>A(!0),title:"Add connection using browser cookie",className:"w-full sm:w-auto",children:"Cookie"}),ta?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(d.$n,{size:"sm",icon:"lock",variant:"secondary",onClick:e0,className:"w-full sm:w-auto",children:ti}),(0,a.jsx)(d.$n,{size:"sm",icon:"key",onClick:e1,className:"w-full sm:w-auto",children:tl})]}):(0,a.jsx)(d.$n,{size:"sm",icon:"add",onClick:e2,className:"w-full sm:w-auto",children:"Add"})]})]})]}),(0,a.jsxs)(d.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Available Models"}),!ts&&(e=[...e8,...eO.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type).map(e=>e.id).filter(e=>!eR.includes(e)),(0,a.jsxs)("div",{className:"flex gap-2",children:[eR.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"restart_alt",onClick:tp,children:"Active All"}),e.length>0&&(0,a.jsx)(d.$n,{size:"sm",variant:"secondary",icon:"block",onClick:()=>tm(e),children:"Disable All"})]}))]}),!!Z&&(0,a.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:Z}),(()=>{let e,t,s;if(ts)return(0,a.jsx)(y,{providerStorageAlias:tr,providerDisplayAlias:tn,modelAliases:W,copied:eQ,onCopy:eZ,onSetAlias:tg,onDeleteAlias:tf,connections:x,isAnthropic:tt});let i=[...e8,...eO.filter(e=>!e8.some(t=>t.id===e.id))].filter(e=>!e.type||"llm"===e.type),l=new Set(eR),n=i.filter(e=>!l.has(e.id)),o=i.filter(e=>l.has(e.id)),d=Object.entries(W).filter(([e,t])=>{let s=`${tr}/`;if(!t.startsWith(s))return!1;let a=t.slice(s.length);return e5.passthroughModels?!e8.some(e=>e.id===a):!e8.some(e=>e.id===a)&&e===a}).map(([e,t])=>({id:t.slice(`${tr}/`.length),alias:e,fullModel:t}));return(0,a.jsxs)("div",{className:"flex flex-wrap gap-3",children:[d.map(e=>(0,a.jsx)(g,{model:{id:e.id},fullModel:`${tn}/${e.id}`,alias:e.alias,copied:eQ,onCopy:eZ,onSetAlias:()=>{},onDeleteAlias:()=>tf(e.alias),testStatus:V[e.id],onTest:x.length>0||e7?()=>tR(e.id):void 0,isTesting:Y===e.id,isCustom:!0,isFree:!1},e.id)),n.map(e=>{let t=`${tr}/${e.id}`,s=`${r}/${e.id}`,i=Object.entries(W).find(([,e])=>e===t||e===s)?.[0];return(0,a.jsx)(g,{model:e,fullModel:`${tn}/${e.id}`,alias:i,copied:eQ,onCopy:eZ,onSetAlias:t=>tg(e.id,t,tr),onDeleteAlias:()=>tf(i),testStatus:V[e.id],onTest:x.length>0||e7?()=>tR(e.id):void 0,isTesting:Y===e.id,isFree:e.isFree,onDisable:()=>td(e.id)},e.id)}),(0,a.jsxs)("button",{onClick:()=>es(!0),className:"flex w-full items-center justify-center gap-1.5 rounded-lg border border-dashed border-primary/40 px-3 py-2 text-xs text-primary transition-colors hover:border-primary hover:bg-primary/5 sm:w-auto",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]}),e$.length>0&&(e=new Set(Object.values(W)),t=new Set(e8.map(e=>e.id)),0===(s=e$.filter(s=>!e.has(`${tr}/${s.id}`)&&!t.has(s.id))).length?null:(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"Suggested free models (≥200k context):"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:s.map(e=>(0,a.jsxs)("button",{onClick:async()=>{let t=e.id.split("/").pop();await tg(e.id,t,tr)},className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:`${e.name} \xb7 ${(e.contextLength/1e3).toFixed(0)}k ctx`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id.split("/").pop()]},e.id))})]})),o.length>0&&(0,a.jsxs)("div",{className:"w-full mt-2",children:[(0,a.jsxs)("p",{className:"text-xs text-text-muted mb-2",children:["Disabled models (",o.length,"):"]}),(0,a.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>(0,a.jsxs)("button",{onClick:()=>tc(e.id),className:"flex items-center gap-1 px-2.5 py-1.5 rounded-lg border border-dashed border-black/10 dark:border-white/10 text-xs text-text-muted hover:text-primary hover:border-primary/40 hover:bg-primary/5 transition-colors",title:"Restore model",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"add"}),e.id]},e.id))})]})]})})()]}),tP,"kiro"===r?(0,a.jsx)(d.Mh,{isOpen:C,providerInfo:e5,onSuccess:tj,onClose:()=>S(!1)}):"cursor"===r?(0,a.jsx)(d.G9,{isOpen:C,onSuccess:tj,onClose:()=>S(!1)}):"gitlab"===r?(0,a.jsx)(d.vj,{isOpen:C,providerInfo:e5,onSuccess:tj,onClose:()=>S(!1)}):(0,a.jsx)(d.LF,{isOpen:C,provider:r,providerInfo:e5,onSuccess:tj,onClose:()=>S(!1)}),"iflow"===r&&(0,a.jsx)(d.vE,{isOpen:T,onSuccess:()=>{tu(),A(!1)},onClose:()=>A(!1)}),(0,a.jsx)(E,{isOpen:$,provider:r,providerName:e5.name,isCompatible:ts,isAnthropic:tt,authType:e5?.authType,authHint:e5?.authHint,website:e5?.website,proxyPools:N,error:O,onSave:tk,onBulkDone:tu,onClose:()=>{R(""),I(!1)}}),(0,a.jsx)(d.wI,{isOpen:U,connection:K,proxyPools:N,onSave:tN,onClose:()=>_(!1)}),ts&&(0,a.jsx)(D,{isOpen:M,node:v,onSave:th,onClose:()=>z(!1),isAnthropic:tt}),!ts&&(0,a.jsx)(F,{isOpen:et,providerAlias:tr,providerDisplayAlias:tn,onSave:async e=>{let t=e5?.passthroughModels?e.split("/").pop():e;await tg(e,t,tr),es(!1)},onClose:()=>es(!1)}),(0,a.jsx)(d.uo,{isOpen:eU,onClose:()=>e_(!1),onConfirm:()=>{(window.localStorage.setItem(eX,"true"),e_(!1),e4)?eY():e1()},title:"Risk Notice",message:e5?.deprecationNotice,confirmText:"I Understand, Continue",cancelText:"Cancel",variant:"danger"}),(0,a.jsx)(d.uo,{isOpen:!!eD,onClose:()=>eF(null),onConfirm:eD?.onConfirm,title:eD?.title||"Confirm",message:eD?.message,variant:"danger"})]}):(0,a.jsxs)("div",{className:"text-center py-20",children:[(0,a.jsx)("p",{className:"text-text-muted",children:"Provider not found"}),(0,a.jsx)(n(),{href:"/dashboard/providers",className:"text-primary mt-4 inline-block",children:"Back to Providers"})]})}E.propTypes={isOpen:b().bool.isRequired,provider:b().string,providerName:b().string,isCompatible:b().bool,isAnthropic:b().bool,authType:b().string,authHint:b().string,website:b().string,proxyPools:b().arrayOf(b().shape({id:b().string,name:b().string})),error:b().string,onSave:b().func.isRequired,onBulkDone:b().func,onClose:b().func.isRequired},D.propTypes={isOpen:b().bool.isRequired,node:b().shape({id:b().string,name:b().string,prefix:b().string,apiType:b().string,baseUrl:b().string,providerSpecificData:b().object,tags:b().oneOfType([b().string,b().array]),maxInFlight:b().oneOfType([b().string,b().number])}),onSave:b().func.isRequired,onClose:b().func.isRequired,isAnthropic:b().bool},F.propTypes={isOpen:b().bool.isRequired,providerAlias:b().string.isRequired,providerDisplayAlias:b().string.isRequired,onSave:b().func.isRequired,onClose:b().func.isRequired}},18205:(e,t,s)=>{Promise.resolve().then(s.bind(s,5020))}},e=>{e.O(0,[2574,3862,1051,5772,1321,5497,8441,3794,7358],()=>e(e.s=18205)),_N_E=e.O()}]);