@rabbi696/ezrouter 0.6.6 → 0.6.7

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 (1289) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +21 -19
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +3 -3
  5. package/app/.next-cli-build/routes-manifest.json +12 -0
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +2 -2
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +3 -3
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +2 -2
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +2 -2
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +2 -2
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js +2 -2
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page.js.nft.json +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +2 -2
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js +2 -2
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page.js.nft.json +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js +2 -2
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page.js.nft.json +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js +2 -2
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page.js.nft.json +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js +2 -2
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page.js.nft.json +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +16 -16
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +2 -2
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +3 -3
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +2 -2
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +2 -2
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +2 -2
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +2 -2
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +6 -6
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +2 -2
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +2 -2
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +2 -2
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +2 -2
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +2 -2
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  77. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  78. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js +2 -2
  79. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page.js.nft.json +1 -1
  80. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  81. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +2 -2
  82. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  83. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  84. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +2 -2
  85. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +2 -2
  88. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  89. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  90. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +2 -2
  91. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  92. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  93. package/app/.next-cli-build/server/app/_global-error/page.js +3 -3
  94. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  96. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  97. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  98. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  100. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  102. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/_not-found/page.js +2 -2
  105. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  106. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  107. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  108. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  109. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  110. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  112. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  115. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/auth/logout/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  124. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  126. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  128. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  134. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  136. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/changelog/route.js +1 -1
  138. package/app/.next-cli-build/server/app/api/changelog/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js +1 -1
  140. package/app/.next-cli-build/server/app/api/cli/providers/codex/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +6 -6
  142. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  143. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +2 -2
  144. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  145. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  146. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  147. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js +2 -2
  148. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js +2 -2
  150. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  151. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js +1 -1
  152. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/models/route.js.nft.json +1 -1
  153. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js +1 -1
  154. package/app/.next-cli-build/server/app/api/cli-tools/codex-native/readiness/route.js.nft.json +1 -1
  155. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js +1 -1
  156. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  157. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js +2 -2
  158. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js +2 -2
  160. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js +2 -2
  166. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js +2 -2
  168. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js +2 -2
  170. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  171. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js +2 -2
  172. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  173. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js +2 -2
  174. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  175. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js +3 -3
  176. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  177. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js +2 -2
  178. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  179. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js +2 -2
  180. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  181. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  182. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  183. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js +1 -1
  184. package/app/.next-cli-build/server/app/api/cli-tools/pi-settings/route.js.nft.json +1 -1
  185. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  186. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/combos/[id]/test/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/combos/export/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/combos/export/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/combos/import/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/combos/import/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/combos/test/route.js +1 -1
  196. package/app/.next-cli-build/server/app/api/combos/test/route.js.nft.json +1 -1
  197. package/app/.next-cli-build/server/app/api/convoy/rules/route.js +2 -2
  198. package/app/.next-cli-build/server/app/api/convoy/rules/route.js.nft.json +1 -1
  199. package/app/.next-cli-build/server/app/api/headroom/extras/route.js +1 -1
  200. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  202. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  203. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  204. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  205. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  206. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  207. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  208. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/headroom/stop/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/health/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/init/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/internal/codex-native/lease/[action]/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  218. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  219. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  220. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  221. package/app/.next-cli-build/server/app/api/locale/route.js +1 -1
  222. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  223. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js +1 -1
  224. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  225. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js +2 -2
  226. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js +1 -1
  228. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/route.js.nft.json +1 -1
  229. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js +1 -1
  230. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/[id]/test/route.js.nft.json +1 -1
  231. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js +1 -1
  232. package/app/.next-cli-build/server/app/api/mcp-gateway/instances/route.js.nft.json +1 -1
  233. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js +1 -1
  234. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/[id]/route.js.nft.json +1 -1
  235. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js +1 -1
  236. package/app/.next-cli-build/server/app/api/mcp-gateway/keys/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js +2 -2
  238. package/app/.next-cli-build/server/app/api/mcp-gateway/message/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js +2 -2
  240. package/app/.next-cli-build/server/app/api/mcp-gateway/oauth/[id]/[action]/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/mcp-gateway/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/mcp-gateway/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js +2 -2
  244. package/app/.next-cli-build/server/app/api/mcp-gateway/sse/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js +1 -1
  260. package/app/.next-cli-build/server/app/api/models/catalog-sync/route.js.nft.json +1 -1
  261. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  262. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/oauth/callback/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/oauth/callback/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js +2 -2
  278. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  280. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  282. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/oauth/grok-cli/bulk-import/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  286. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  287. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  288. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  296. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  297. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  298. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  299. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -0
  300. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -0
  301. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route_client-reference-manifest.js +1 -0
  302. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +4 -0
  303. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -0
  304. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route_client-reference-manifest.js +1 -0
  305. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  306. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  308. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  309. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  310. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  311. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  312. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  313. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  314. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  315. package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js +1 -1
  316. package/app/.next-cli-build/server/app/api/providers/[id]/refresh-profile/route.js.nft.json +1 -1
  317. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  318. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  319. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  320. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  321. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  322. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  323. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  324. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  325. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js +1 -1
  326. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  327. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  328. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  329. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js +1 -1
  330. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  331. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  332. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  333. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  334. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  335. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  336. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  337. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  338. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  339. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +14 -14
  340. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  341. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +14 -14
  342. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  343. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  344. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  345. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +14 -14
  346. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  347. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js +2 -2
  348. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  349. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js +2 -2
  350. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  351. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js +2 -2
  352. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  353. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js +2 -2
  354. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  355. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +2 -2
  356. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  357. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js +2 -2
  358. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  359. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +2 -2
  360. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  361. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js +2 -2
  362. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  363. package/app/.next-cli-build/server/app/api/routing-health/route.js +1 -1
  364. package/app/.next-cli-build/server/app/api/routing-health/route.js.nft.json +1 -1
  365. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  366. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/settings/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/shutdown/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/tags/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/token-saver/stats/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/token-saver/stats/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/token-saver/stream/route.js +2 -2
  380. package/app/.next-cli-build/server/app/api/token-saver/stream/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/tool-disclosure/stats/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  386. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/translator/load/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/translator/save/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  404. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  405. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  406. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  407. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +2 -2
  408. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  409. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  410. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  411. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  412. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  413. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  414. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  415. package/app/.next-cli-build/server/app/api/usage/error-logs/route.js +3 -3
  416. package/app/.next-cli-build/server/app/api/usage/error-logs/route.js.nft.json +1 -1
  417. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  418. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  419. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  420. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  421. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  422. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  423. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  424. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  425. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  426. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  427. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  428. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  429. package/app/.next-cli-build/server/app/api/usage/stream/route.js +2 -2
  430. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  431. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js +1 -1
  432. package/app/.next-cli-build/server/app/api/v1/alpha/search/route.js.nft.json +1 -1
  433. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  434. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  435. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  436. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  437. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  438. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  439. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  440. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  441. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  442. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  443. package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js +1 -1
  444. package/app/.next-cli-build/server/app/api/v1/codex/alpha/search/route.js.nft.json +1 -1
  445. package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js +1 -1
  446. package/app/.next-cli-build/server/app/api/v1/codex/images/edits/route.js.nft.json +1 -1
  447. package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js +1 -1
  448. package/app/.next-cli-build/server/app/api/v1/codex/images/generations/route.js.nft.json +1 -1
  449. package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js +1 -1
  450. package/app/.next-cli-build/server/app/api/v1/codex/memories/trace_summarize/route.js.nft.json +1 -1
  451. package/app/.next-cli-build/server/app/api/v1/codex/models/route.js +1 -1
  452. package/app/.next-cli-build/server/app/api/v1/codex/models/route.js.nft.json +1 -1
  453. package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js +1 -1
  454. package/app/.next-cli-build/server/app/api/v1/codex/responses/compact/route.js.nft.json +1 -1
  455. package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js +1 -1
  456. package/app/.next-cli-build/server/app/api/v1/codex/responses/route.js.nft.json +1 -1
  457. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  458. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  459. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +3 -3
  460. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  461. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js +1 -1
  462. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  463. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  464. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  465. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js +1 -1
  466. package/app/.next-cli-build/server/app/api/v1/models/[...model]/route.js.nft.json +1 -1
  467. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  468. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  469. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  470. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  471. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  472. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  473. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  474. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  475. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  476. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  477. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  478. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  479. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  480. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  481. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  482. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  484. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  485. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  486. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  487. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  488. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  489. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  490. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  491. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  492. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  493. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  494. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  495. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  496. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  497. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  498. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  499. package/app/.next-cli-build/server/app/callback/page.js +2 -2
  500. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  501. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  502. package/app/.next-cli-build/server/app/callback.html +1 -1
  503. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  504. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  505. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  506. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  507. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  508. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  509. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  510. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  511. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  512. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  513. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  514. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  515. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  516. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  517. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  518. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  519. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  520. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  521. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  522. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  523. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  524. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  525. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  526. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  527. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  528. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  529. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  530. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  531. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  532. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  533. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  534. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  535. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  536. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  537. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  538. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  539. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  540. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  541. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
  542. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  543. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  544. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  545. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  546. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
  547. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  548. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
  549. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
  550. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  551. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  552. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  553. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  554. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  555. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  556. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  557. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  558. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  559. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  560. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
  561. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +5 -5
  562. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
  563. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
  564. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  565. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  566. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  567. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +5 -5
  568. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
  569. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +3 -3
  570. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +1 -1
  571. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
  572. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +5 -5
  573. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
  574. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
  575. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  576. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  577. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  578. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +5 -5
  579. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
  580. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +3 -3
  581. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +1 -1
  582. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
  583. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +5 -5
  584. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
  585. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  586. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  587. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  588. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +5 -5
  589. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
  590. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +3 -3
  591. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +1 -1
  592. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  593. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  594. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  595. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  596. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  597. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  598. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  599. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  600. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  601. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  602. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  603. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  604. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  605. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  606. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  607. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  608. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  609. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  610. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  611. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  612. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  613. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  614. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  615. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  616. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  617. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  618. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  619. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  620. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  621. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  622. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  623. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  624. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  625. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  626. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  627. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  628. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  629. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  630. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  631. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  632. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  633. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  634. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  635. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  636. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  637. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  638. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  639. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  640. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  641. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  642. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  643. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  644. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  645. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  646. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  647. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  648. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  649. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  650. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  651. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  652. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  653. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  654. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  655. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  656. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  657. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  658. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  659. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  660. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  661. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  662. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  663. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  664. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  665. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  666. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  667. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  668. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  669. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  670. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  671. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  672. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  673. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  674. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  675. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
  676. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  677. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  678. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  679. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  680. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
  681. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  682. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
  683. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
  684. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +2 -2
  685. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  686. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  687. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  688. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  689. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  690. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  691. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  692. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  693. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  694. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  695. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  696. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  697. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  698. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  699. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  700. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  701. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  702. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  703. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  704. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  705. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  706. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  707. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  708. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  709. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  710. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  711. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  712. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  713. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  714. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  715. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  716. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  717. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  718. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  719. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  720. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  721. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  722. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  723. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  724. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  725. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  726. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  727. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  728. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  729. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  730. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  731. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  732. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  733. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  734. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  735. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  736. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  737. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  738. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  739. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  740. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  741. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  742. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  743. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  744. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  745. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  746. package/app/.next-cli-build/server/app/favicon.ico/route.js +1 -1
  747. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  748. package/app/.next-cli-build/server/app/index.html +1 -1
  749. package/app/.next-cli-build/server/app/index.rsc +3 -3
  750. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  751. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  752. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  753. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  754. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  755. package/app/.next-cli-build/server/app/landing/page.js +2 -2
  756. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  757. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  758. package/app/.next-cli-build/server/app/landing.html +1 -1
  759. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  760. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  761. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  762. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  763. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  764. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  765. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  766. package/app/.next-cli-build/server/app/login/page.js +2 -2
  767. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  768. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  769. package/app/.next-cli-build/server/app/login.html +1 -1
  770. package/app/.next-cli-build/server/app/login.rsc +4 -4
  771. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  772. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  773. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  774. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  775. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  776. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  777. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js +2 -2
  778. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  779. package/app/.next-cli-build/server/app/page.js +2 -2
  780. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  781. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  782. package/app/.next-cli-build/server/app-paths-manifest.json +21 -19
  783. package/app/.next-cli-build/server/chunks/1133.js +1 -1
  784. package/app/.next-cli-build/server/chunks/1273.js +1 -0
  785. package/app/.next-cli-build/server/chunks/1482.js +2 -2
  786. package/app/.next-cli-build/server/chunks/1531.js +1 -1
  787. package/app/.next-cli-build/server/chunks/{7306.js → 1744.js} +18 -18
  788. package/app/.next-cli-build/server/chunks/1847.js +1 -1
  789. package/app/.next-cli-build/server/chunks/2021.js +1 -1
  790. package/app/.next-cli-build/server/chunks/2348.js +1 -1
  791. package/app/.next-cli-build/server/chunks/2892.js +1 -1
  792. package/app/.next-cli-build/server/chunks/2898.js +22 -3
  793. package/app/.next-cli-build/server/chunks/3148.js +1 -1
  794. package/app/.next-cli-build/server/chunks/3245.js +1 -1
  795. package/app/.next-cli-build/server/chunks/3311.js +1 -1
  796. package/app/.next-cli-build/server/chunks/3433.js +4 -4
  797. package/app/.next-cli-build/server/chunks/3547.js +1 -1
  798. package/app/.next-cli-build/server/chunks/3583.js +2 -2
  799. package/app/.next-cli-build/server/chunks/369.js +22 -28
  800. package/app/.next-cli-build/server/chunks/3698.js +1 -1
  801. package/app/.next-cli-build/server/chunks/3886.js +1 -1
  802. package/app/.next-cli-build/server/chunks/3977.js +2 -2
  803. package/app/.next-cli-build/server/chunks/412.js +5 -5
  804. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  805. package/app/.next-cli-build/server/chunks/4152.js +1 -0
  806. package/app/.next-cli-build/server/chunks/4574.js +1 -1
  807. package/app/.next-cli-build/server/chunks/4827.js +1 -1
  808. package/app/.next-cli-build/server/chunks/4878.js +1 -1
  809. package/app/.next-cli-build/server/chunks/4924.js +300 -0
  810. package/app/.next-cli-build/server/chunks/5130.js +1 -0
  811. package/app/.next-cli-build/server/chunks/5224.js +1 -0
  812. package/app/.next-cli-build/server/chunks/5315.js +1 -1
  813. package/app/.next-cli-build/server/chunks/576.js +1 -0
  814. package/app/.next-cli-build/server/chunks/5849.js +1 -1
  815. package/app/.next-cli-build/server/chunks/6000.js +1 -0
  816. package/app/.next-cli-build/server/chunks/6330.js +1 -0
  817. package/app/.next-cli-build/server/chunks/6816.js +4 -4
  818. package/app/.next-cli-build/server/chunks/6875.js +1 -0
  819. package/app/.next-cli-build/server/chunks/6892.js +1 -1
  820. package/app/.next-cli-build/server/chunks/6947.js +1 -1
  821. package/app/.next-cli-build/server/chunks/7239.js +3 -3
  822. package/app/.next-cli-build/server/chunks/7353.js +1 -1
  823. package/app/.next-cli-build/server/chunks/7362.js +1 -1
  824. package/app/.next-cli-build/server/chunks/{6535.js → 7524.js} +3 -3
  825. package/app/.next-cli-build/server/chunks/7603.js +1 -1
  826. package/app/.next-cli-build/server/chunks/7677.js +1 -1
  827. package/app/.next-cli-build/server/chunks/7774.js +8 -8
  828. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  829. package/app/.next-cli-build/server/chunks/8129.js +1 -1
  830. package/app/.next-cli-build/server/chunks/823.js +1 -1
  831. package/app/.next-cli-build/server/chunks/8243.js +7 -7
  832. package/app/.next-cli-build/server/chunks/8299.js +1 -0
  833. package/app/.next-cli-build/server/chunks/8306.js +1 -1
  834. package/app/.next-cli-build/server/chunks/8459.js +1 -1
  835. package/app/.next-cli-build/server/chunks/8586.js +1 -1
  836. package/app/.next-cli-build/server/chunks/8658.js +1 -1
  837. package/app/.next-cli-build/server/chunks/880.js +7 -7
  838. package/app/.next-cli-build/server/chunks/8946.js +1 -1
  839. package/app/.next-cli-build/server/chunks/8976.js +1 -1
  840. package/app/.next-cli-build/server/chunks/9062.js +1 -1
  841. package/app/.next-cli-build/server/chunks/9217.js +1 -1
  842. package/app/.next-cli-build/server/chunks/9303.js +1 -1
  843. package/app/.next-cli-build/server/chunks/9485.js +1 -1
  844. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  845. package/app/.next-cli-build/server/middleware.js +4 -4
  846. package/app/.next-cli-build/server/pages/404.html +1 -1
  847. package/app/.next-cli-build/server/pages/500.html +1 -1
  848. package/app/.next-cli-build/server/server-reference-manifest.js +1 -1
  849. package/app/.next-cli-build/server/server-reference-manifest.json +1 -1
  850. package/app/.next-cli-build/static/caISOCVUmfRaqJe0JjnZh/_buildManifest.js +1 -0
  851. package/app/.next-cli-build/static/chunks/{1321-f082c0cd9fbb2097.js → 1321-b8a4f80390cd3ea3.js} +1 -1
  852. package/app/.next-cli-build/static/chunks/2852-c263bdffcaa33c2a.js +95 -0
  853. package/app/.next-cli-build/static/chunks/{316-89ef881941b53b2c.js → 316-54e07b35de6154b5.js} +1 -1
  854. package/app/.next-cli-build/static/chunks/{5497-f328c487bfcc0d0e.js → 5497-a4fcd9746123edae.js} +5 -5
  855. package/app/.next-cli-build/static/chunks/{8010-5892efa7a8d0bb03.js → 8010-4f17bcbf4cac2817.js} +2 -2
  856. package/app/.next-cli-build/static/chunks/8105-914b0eb9e3a50b9d.js +1 -0
  857. package/app/.next-cli-build/static/chunks/9227-0d7e658f80553659.js +3 -0
  858. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/[toolId]/{page-ce0b5b8882899119.js → page-5c9ac89a0fd078b6.js} +1 -1
  859. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/cli-tools/{page-257aaa1374d529b4.js → page-7a5b3f43946719b9.js} +1 -1
  860. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-12452d79eba6c182.js +1 -0
  861. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-90a4f789d907db25.js → page-8236097df15d7be9.js} +16 -16
  862. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/mitm/{page-e44166090e05cfb3.js → page-694c3b4cef7d111e.js} +1 -1
  863. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-11a1a4053a30913f.js +27 -0
  864. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-679ec0628cd9d54f.js +1 -0
  865. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-6f16a27a86240648.js +1 -0
  866. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-f744066e8709b6c1.js +1 -0
  867. package/app/.next-cli-build/static/chunks/app/(dashboard)/{layout-100d6d3c6c7256f1.js → layout-fa3153761cc595bb.js} +1 -1
  868. package/app/.next-cli-build/static/chunks/app/_global-error/page-116cfb93931e646f.js +1 -0
  869. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-116cfb93931e646f.js +1 -0
  870. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-116cfb93931e646f.js +1 -0
  871. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-116cfb93931e646f.js +1 -0
  872. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-116cfb93931e646f.js +1 -0
  873. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-116cfb93931e646f.js +1 -0
  874. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-116cfb93931e646f.js +1 -0
  875. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-116cfb93931e646f.js +1 -0
  876. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-116cfb93931e646f.js +1 -0
  877. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-116cfb93931e646f.js +1 -0
  878. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-116cfb93931e646f.js +1 -0
  879. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-116cfb93931e646f.js +1 -0
  880. package/app/.next-cli-build/static/chunks/app/api/changelog/route-116cfb93931e646f.js +1 -0
  881. package/app/.next-cli-build/static/chunks/app/api/cli/providers/codex/route-116cfb93931e646f.js +1 -0
  882. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-116cfb93931e646f.js +1 -0
  883. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-116cfb93931e646f.js +1 -0
  884. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-116cfb93931e646f.js +1 -0
  885. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-116cfb93931e646f.js +1 -0
  886. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-116cfb93931e646f.js +1 -0
  887. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-native/models/route-116cfb93931e646f.js +1 -0
  888. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-native/readiness/route-116cfb93931e646f.js +1 -0
  889. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-116cfb93931e646f.js +1 -0
  890. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-116cfb93931e646f.js +1 -0
  891. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-116cfb93931e646f.js +1 -0
  892. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-116cfb93931e646f.js +1 -0
  893. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-116cfb93931e646f.js +1 -0
  894. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-116cfb93931e646f.js +1 -0
  895. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-116cfb93931e646f.js +1 -0
  896. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-116cfb93931e646f.js +1 -0
  897. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-116cfb93931e646f.js +1 -0
  898. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-116cfb93931e646f.js +1 -0
  899. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-116cfb93931e646f.js +1 -0
  900. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-116cfb93931e646f.js +1 -0
  901. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-116cfb93931e646f.js +1 -0
  902. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-116cfb93931e646f.js +1 -0
  903. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-116cfb93931e646f.js +1 -0
  904. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-116cfb93931e646f.js +1 -0
  905. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/test/route-116cfb93931e646f.js +1 -0
  906. package/app/.next-cli-build/static/chunks/app/api/combos/export/route-116cfb93931e646f.js +1 -0
  907. package/app/.next-cli-build/static/chunks/app/api/combos/import/route-116cfb93931e646f.js +1 -0
  908. package/app/.next-cli-build/static/chunks/app/api/combos/route-116cfb93931e646f.js +1 -0
  909. package/app/.next-cli-build/static/chunks/app/api/combos/test/route-116cfb93931e646f.js +1 -0
  910. package/app/.next-cli-build/static/chunks/app/api/convoy/rules/route-116cfb93931e646f.js +1 -0
  911. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-116cfb93931e646f.js +1 -0
  912. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-116cfb93931e646f.js +1 -0
  913. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-116cfb93931e646f.js +1 -0
  914. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-116cfb93931e646f.js +1 -0
  915. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-116cfb93931e646f.js +1 -0
  916. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-116cfb93931e646f.js +1 -0
  917. package/app/.next-cli-build/static/chunks/app/api/health/route-116cfb93931e646f.js +1 -0
  918. package/app/.next-cli-build/static/chunks/app/api/init/route-116cfb93931e646f.js +1 -0
  919. package/app/.next-cli-build/static/chunks/app/api/internal/codex-native/lease/[action]/route-116cfb93931e646f.js +1 -0
  920. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-116cfb93931e646f.js +1 -0
  921. package/app/.next-cli-build/static/chunks/app/api/keys/route-116cfb93931e646f.js +1 -0
  922. package/app/.next-cli-build/static/chunks/app/api/locale/route-116cfb93931e646f.js +1 -0
  923. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-116cfb93931e646f.js +1 -0
  924. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-116cfb93931e646f.js +1 -0
  925. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/[id]/route-116cfb93931e646f.js +1 -0
  926. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/[id]/test/route-116cfb93931e646f.js +1 -0
  927. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/route-116cfb93931e646f.js +1 -0
  928. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/keys/[id]/route-116cfb93931e646f.js +1 -0
  929. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/keys/route-116cfb93931e646f.js +1 -0
  930. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/message/route-116cfb93931e646f.js +1 -0
  931. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/oauth/[id]/[action]/route-116cfb93931e646f.js +1 -0
  932. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/route-116cfb93931e646f.js +1 -0
  933. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/sse/route-116cfb93931e646f.js +1 -0
  934. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-116cfb93931e646f.js +1 -0
  935. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-116cfb93931e646f.js +1 -0
  936. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-116cfb93931e646f.js +1 -0
  937. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-116cfb93931e646f.js +1 -0
  938. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-116cfb93931e646f.js +1 -0
  939. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-116cfb93931e646f.js +1 -0
  940. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-116cfb93931e646f.js +1 -0
  941. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-116cfb93931e646f.js +1 -0
  942. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-116cfb93931e646f.js +1 -0
  943. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-116cfb93931e646f.js +1 -0
  944. package/app/.next-cli-build/static/chunks/app/api/models/route-116cfb93931e646f.js +1 -0
  945. package/app/.next-cli-build/static/chunks/app/api/models/test/route-116cfb93931e646f.js +1 -0
  946. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-116cfb93931e646f.js +1 -0
  947. package/app/.next-cli-build/static/chunks/app/api/oauth/callback/route-116cfb93931e646f.js +1 -0
  948. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-116cfb93931e646f.js +1 -0
  949. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-116cfb93931e646f.js +1 -0
  950. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-116cfb93931e646f.js +1 -0
  951. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-116cfb93931e646f.js +1 -0
  952. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-116cfb93931e646f.js +1 -0
  953. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-116cfb93931e646f.js +1 -0
  954. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-116cfb93931e646f.js +1 -0
  955. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-116cfb93931e646f.js +1 -0
  956. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-116cfb93931e646f.js +1 -0
  957. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-116cfb93931e646f.js +1 -0
  958. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-116cfb93931e646f.js +1 -0
  959. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-116cfb93931e646f.js +1 -0
  960. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-116cfb93931e646f.js +1 -0
  961. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/api-key/route-116cfb93931e646f.js +1 -0
  962. package/app/.next-cli-build/static/chunks/app/api/oauth/xiaomi-mimo/auto-import/route-116cfb93931e646f.js +1 -0
  963. package/app/.next-cli-build/static/chunks/app/api/pricing/route-116cfb93931e646f.js +1 -0
  964. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-116cfb93931e646f.js +1 -0
  965. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-116cfb93931e646f.js +1 -0
  966. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-116cfb93931e646f.js +1 -0
  967. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-116cfb93931e646f.js +1 -0
  968. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/refresh-profile/route-116cfb93931e646f.js +1 -0
  969. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-116cfb93931e646f.js +1 -0
  970. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-116cfb93931e646f.js +1 -0
  971. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-116cfb93931e646f.js +1 -0
  972. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-116cfb93931e646f.js +1 -0
  973. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-116cfb93931e646f.js +1 -0
  974. package/app/.next-cli-build/static/chunks/app/api/providers/route-116cfb93931e646f.js +1 -0
  975. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-116cfb93931e646f.js +1 -0
  976. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-116cfb93931e646f.js +1 -0
  977. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-116cfb93931e646f.js +1 -0
  978. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-116cfb93931e646f.js +1 -0
  979. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-116cfb93931e646f.js +1 -0
  980. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-116cfb93931e646f.js +1 -0
  981. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-116cfb93931e646f.js +1 -0
  982. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-116cfb93931e646f.js +1 -0
  983. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-116cfb93931e646f.js +1 -0
  984. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-116cfb93931e646f.js +1 -0
  985. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-116cfb93931e646f.js +1 -0
  986. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-116cfb93931e646f.js +1 -0
  987. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-116cfb93931e646f.js +1 -0
  988. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-116cfb93931e646f.js +1 -0
  989. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-116cfb93931e646f.js +1 -0
  990. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-116cfb93931e646f.js +1 -0
  991. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-116cfb93931e646f.js +1 -0
  992. package/app/.next-cli-build/static/chunks/app/api/routing-health/route-116cfb93931e646f.js +1 -0
  993. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-116cfb93931e646f.js +1 -0
  994. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-116cfb93931e646f.js +1 -0
  995. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-116cfb93931e646f.js +1 -0
  996. package/app/.next-cli-build/static/chunks/app/api/settings/route-116cfb93931e646f.js +1 -0
  997. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-116cfb93931e646f.js +1 -0
  998. package/app/.next-cli-build/static/chunks/app/api/tags/route-116cfb93931e646f.js +1 -0
  999. package/app/.next-cli-build/static/chunks/app/api/token-saver/stats/route-116cfb93931e646f.js +1 -0
  1000. package/app/.next-cli-build/static/chunks/app/api/token-saver/stream/route-116cfb93931e646f.js +1 -0
  1001. package/app/.next-cli-build/static/chunks/app/api/tool-disclosure/stats/route-116cfb93931e646f.js +1 -0
  1002. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-116cfb93931e646f.js +1 -0
  1003. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-116cfb93931e646f.js +1 -0
  1004. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-116cfb93931e646f.js +1 -0
  1005. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-116cfb93931e646f.js +1 -0
  1006. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-116cfb93931e646f.js +1 -0
  1007. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-116cfb93931e646f.js +1 -0
  1008. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-116cfb93931e646f.js +1 -0
  1009. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-116cfb93931e646f.js +1 -0
  1010. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-116cfb93931e646f.js +1 -0
  1011. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-116cfb93931e646f.js +1 -0
  1012. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-116cfb93931e646f.js +1 -0
  1013. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-116cfb93931e646f.js +1 -0
  1014. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-116cfb93931e646f.js +1 -0
  1015. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-116cfb93931e646f.js +1 -0
  1016. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-116cfb93931e646f.js +1 -0
  1017. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-116cfb93931e646f.js +1 -0
  1018. package/app/.next-cli-build/static/chunks/app/api/usage/error-logs/route-116cfb93931e646f.js +1 -0
  1019. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-116cfb93931e646f.js +1 -0
  1020. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-116cfb93931e646f.js +1 -0
  1021. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-116cfb93931e646f.js +1 -0
  1022. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-116cfb93931e646f.js +1 -0
  1023. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-116cfb93931e646f.js +1 -0
  1024. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-116cfb93931e646f.js +1 -0
  1025. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-116cfb93931e646f.js +1 -0
  1026. package/app/.next-cli-build/static/chunks/app/api/v1/alpha/search/route-116cfb93931e646f.js +1 -0
  1027. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-116cfb93931e646f.js +1 -0
  1028. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-116cfb93931e646f.js +1 -0
  1029. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-116cfb93931e646f.js +1 -0
  1030. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-116cfb93931e646f.js +1 -0
  1031. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-116cfb93931e646f.js +1 -0
  1032. package/app/.next-cli-build/static/chunks/app/api/v1/codex/alpha/search/route-116cfb93931e646f.js +1 -0
  1033. package/app/.next-cli-build/static/chunks/app/api/v1/codex/images/edits/route-116cfb93931e646f.js +1 -0
  1034. package/app/.next-cli-build/static/chunks/app/api/v1/codex/images/generations/route-116cfb93931e646f.js +1 -0
  1035. package/app/.next-cli-build/static/chunks/app/api/v1/codex/memories/trace_summarize/route-116cfb93931e646f.js +1 -0
  1036. package/app/.next-cli-build/static/chunks/app/api/v1/codex/models/route-116cfb93931e646f.js +1 -0
  1037. package/app/.next-cli-build/static/chunks/app/api/v1/codex/responses/compact/route-116cfb93931e646f.js +1 -0
  1038. package/app/.next-cli-build/static/chunks/app/api/v1/codex/responses/route-116cfb93931e646f.js +1 -0
  1039. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-116cfb93931e646f.js +1 -0
  1040. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-116cfb93931e646f.js +1 -0
  1041. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-116cfb93931e646f.js +1 -0
  1042. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-116cfb93931e646f.js +1 -0
  1043. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-116cfb93931e646f.js +1 -0
  1044. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-116cfb93931e646f.js +1 -0
  1045. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-116cfb93931e646f.js +1 -0
  1046. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-116cfb93931e646f.js +1 -0
  1047. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-116cfb93931e646f.js +1 -0
  1048. package/app/.next-cli-build/static/chunks/app/api/v1/route-116cfb93931e646f.js +1 -0
  1049. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-116cfb93931e646f.js +1 -0
  1050. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-116cfb93931e646f.js +1 -0
  1051. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-116cfb93931e646f.js +1 -0
  1052. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-116cfb93931e646f.js +1 -0
  1053. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-116cfb93931e646f.js +1 -0
  1054. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-116cfb93931e646f.js +1 -0
  1055. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-116cfb93931e646f.js +1 -0
  1056. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-116cfb93931e646f.js +1 -0
  1057. package/app/.next-cli-build/static/chunks/app/api/version/route-116cfb93931e646f.js +1 -0
  1058. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-116cfb93931e646f.js +1 -0
  1059. package/app/.next-cli-build/static/chunks/app/api/version/update/route-116cfb93931e646f.js +1 -0
  1060. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-116cfb93931e646f.js +1 -0
  1061. package/app/.next-cli-build/static/chunks/app/page-116cfb93931e646f.js +1 -0
  1062. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-116cfb93931e646f.js +1 -0
  1063. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-116cfb93931e646f.js +1 -0
  1064. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-116cfb93931e646f.js +1 -0
  1065. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-116cfb93931e646f.js +1 -0
  1066. package/app/CHANGELOG.md +14 -0
  1067. package/app/package.json +1 -1
  1068. package/app/public/CHANGELOG.md +14 -0
  1069. package/app/src/lib/db/migrate.js +22 -1
  1070. package/app/src/lib/oauth/providers/xiaomi-mimo.js +123 -0
  1071. package/app/src/mitm/server.js +31 -31
  1072. package/app/src/sse/services/backgroundTokenRefresh.js +9 -6
  1073. package/cli.js +4 -3
  1074. package/package.json +1 -1
  1075. package/src/cli/tray/autostart.js +65 -3
  1076. package/src/cli/utils/modelSelector.js +182 -45
  1077. package/app/.next-cli-build/server/chunks/1012.js +0 -1
  1078. package/app/.next-cli-build/server/chunks/2221.js +0 -300
  1079. package/app/.next-cli-build/server/chunks/5681.js +0 -1
  1080. package/app/.next-cli-build/server/chunks/5822.js +0 -1
  1081. package/app/.next-cli-build/server/chunks/6030.js +0 -1
  1082. package/app/.next-cli-build/server/chunks/8540.js +0 -1
  1083. package/app/.next-cli-build/server/chunks/9637.js +0 -1
  1084. package/app/.next-cli-build/static/3kPJjWzmNgPDoa5VgYHwk/_buildManifest.js +0 -1
  1085. package/app/.next-cli-build/static/chunks/2595-a258abe0d4a34649.js +0 -95
  1086. package/app/.next-cli-build/static/chunks/8105-b488efe0a830e2a7.js +0 -1
  1087. package/app/.next-cli-build/static/chunks/9227-bb7d883d6cd67632.js +0 -3
  1088. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/console-log/page-2c65df20769d31df.js +0 -1
  1089. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-c2fb956227849ef3.js +0 -27
  1090. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/page-10cfe308dcee550e.js +0 -1
  1091. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c55b823e44230396.js +0 -1
  1092. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/token-saver/page-e38b4f8ebf6a3d47.js +0 -1
  1093. package/app/.next-cli-build/static/chunks/app/_global-error/page-25eef5877853a92d.js +0 -1
  1094. package/app/.next-cli-build/static/chunks/app/api/auth/login/route-25eef5877853a92d.js +0 -1
  1095. package/app/.next-cli-build/static/chunks/app/api/auth/logout/route-25eef5877853a92d.js +0 -1
  1096. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/callback/route-25eef5877853a92d.js +0 -1
  1097. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/start/route-25eef5877853a92d.js +0 -1
  1098. package/app/.next-cli-build/static/chunks/app/api/auth/oidc/test/route-25eef5877853a92d.js +0 -1
  1099. package/app/.next-cli-build/static/chunks/app/api/auth/reset-password/route-25eef5877853a92d.js +0 -1
  1100. package/app/.next-cli-build/static/chunks/app/api/auth/saml/acs/route-25eef5877853a92d.js +0 -1
  1101. package/app/.next-cli-build/static/chunks/app/api/auth/saml/metadata/route-25eef5877853a92d.js +0 -1
  1102. package/app/.next-cli-build/static/chunks/app/api/auth/saml/start/route-25eef5877853a92d.js +0 -1
  1103. package/app/.next-cli-build/static/chunks/app/api/auth/saml/test/route-25eef5877853a92d.js +0 -1
  1104. package/app/.next-cli-build/static/chunks/app/api/auth/status/route-25eef5877853a92d.js +0 -1
  1105. package/app/.next-cli-build/static/chunks/app/api/changelog/route-25eef5877853a92d.js +0 -1
  1106. package/app/.next-cli-build/static/chunks/app/api/cli/providers/codex/route-25eef5877853a92d.js +0 -1
  1107. package/app/.next-cli-build/static/chunks/app/api/cli-tools/all-statuses/route-25eef5877853a92d.js +0 -1
  1108. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/alias/route-25eef5877853a92d.js +0 -1
  1109. package/app/.next-cli-build/static/chunks/app/api/cli-tools/antigravity-mitm/route-25eef5877853a92d.js +0 -1
  1110. package/app/.next-cli-build/static/chunks/app/api/cli-tools/claude-settings/route-25eef5877853a92d.js +0 -1
  1111. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cline-settings/route-25eef5877853a92d.js +0 -1
  1112. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-native/models/route-25eef5877853a92d.js +0 -1
  1113. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-native/readiness/route-25eef5877853a92d.js +0 -1
  1114. package/app/.next-cli-build/static/chunks/app/api/cli-tools/codex-settings/route-25eef5877853a92d.js +0 -1
  1115. package/app/.next-cli-build/static/chunks/app/api/cli-tools/copilot-settings/route-25eef5877853a92d.js +0 -1
  1116. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-registry/route-25eef5877853a92d.js +0 -1
  1117. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-mcp-tools/route-25eef5877853a92d.js +0 -1
  1118. package/app/.next-cli-build/static/chunks/app/api/cli-tools/cowork-settings/route-25eef5877853a92d.js +0 -1
  1119. package/app/.next-cli-build/static/chunks/app/api/cli-tools/deepseek-tui-settings/route-25eef5877853a92d.js +0 -1
  1120. package/app/.next-cli-build/static/chunks/app/api/cli-tools/devin-settings/route-25eef5877853a92d.js +0 -1
  1121. package/app/.next-cli-build/static/chunks/app/api/cli-tools/droid-settings/route-25eef5877853a92d.js +0 -1
  1122. package/app/.next-cli-build/static/chunks/app/api/cli-tools/grok-build-settings/route-25eef5877853a92d.js +0 -1
  1123. package/app/.next-cli-build/static/chunks/app/api/cli-tools/hermes-settings/route-25eef5877853a92d.js +0 -1
  1124. package/app/.next-cli-build/static/chunks/app/api/cli-tools/jcode-settings/route-25eef5877853a92d.js +0 -1
  1125. package/app/.next-cli-build/static/chunks/app/api/cli-tools/kilo-settings/route-25eef5877853a92d.js +0 -1
  1126. package/app/.next-cli-build/static/chunks/app/api/cli-tools/openclaw-settings/route-25eef5877853a92d.js +0 -1
  1127. package/app/.next-cli-build/static/chunks/app/api/cli-tools/opencode-settings/route-25eef5877853a92d.js +0 -1
  1128. package/app/.next-cli-build/static/chunks/app/api/cli-tools/pi-settings/route-25eef5877853a92d.js +0 -1
  1129. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/route-25eef5877853a92d.js +0 -1
  1130. package/app/.next-cli-build/static/chunks/app/api/combos/[id]/test/route-25eef5877853a92d.js +0 -1
  1131. package/app/.next-cli-build/static/chunks/app/api/combos/export/route-25eef5877853a92d.js +0 -1
  1132. package/app/.next-cli-build/static/chunks/app/api/combos/import/route-25eef5877853a92d.js +0 -1
  1133. package/app/.next-cli-build/static/chunks/app/api/combos/route-25eef5877853a92d.js +0 -1
  1134. package/app/.next-cli-build/static/chunks/app/api/combos/test/route-25eef5877853a92d.js +0 -1
  1135. package/app/.next-cli-build/static/chunks/app/api/convoy/rules/route-25eef5877853a92d.js +0 -1
  1136. package/app/.next-cli-build/static/chunks/app/api/headroom/extras/route-25eef5877853a92d.js +0 -1
  1137. package/app/.next-cli-build/static/chunks/app/api/headroom/proxy/[...path]/route-25eef5877853a92d.js +0 -1
  1138. package/app/.next-cli-build/static/chunks/app/api/headroom/restart/route-25eef5877853a92d.js +0 -1
  1139. package/app/.next-cli-build/static/chunks/app/api/headroom/start/route-25eef5877853a92d.js +0 -1
  1140. package/app/.next-cli-build/static/chunks/app/api/headroom/status/route-25eef5877853a92d.js +0 -1
  1141. package/app/.next-cli-build/static/chunks/app/api/headroom/stop/route-25eef5877853a92d.js +0 -1
  1142. package/app/.next-cli-build/static/chunks/app/api/health/route-25eef5877853a92d.js +0 -1
  1143. package/app/.next-cli-build/static/chunks/app/api/init/route-25eef5877853a92d.js +0 -1
  1144. package/app/.next-cli-build/static/chunks/app/api/internal/codex-native/lease/[action]/route-25eef5877853a92d.js +0 -1
  1145. package/app/.next-cli-build/static/chunks/app/api/keys/[id]/route-25eef5877853a92d.js +0 -1
  1146. package/app/.next-cli-build/static/chunks/app/api/keys/route-25eef5877853a92d.js +0 -1
  1147. package/app/.next-cli-build/static/chunks/app/api/locale/route-25eef5877853a92d.js +0 -1
  1148. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/message/route-25eef5877853a92d.js +0 -1
  1149. package/app/.next-cli-build/static/chunks/app/api/mcp/[plugin]/sse/route-25eef5877853a92d.js +0 -1
  1150. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/[id]/route-25eef5877853a92d.js +0 -1
  1151. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/[id]/test/route-25eef5877853a92d.js +0 -1
  1152. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/instances/route-25eef5877853a92d.js +0 -1
  1153. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/keys/[id]/route-25eef5877853a92d.js +0 -1
  1154. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/keys/route-25eef5877853a92d.js +0 -1
  1155. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/message/route-25eef5877853a92d.js +0 -1
  1156. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/oauth/[id]/[action]/route-25eef5877853a92d.js +0 -1
  1157. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/route-25eef5877853a92d.js +0 -1
  1158. package/app/.next-cli-build/static/chunks/app/api/mcp-gateway/sse/route-25eef5877853a92d.js +0 -1
  1159. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/deepgram/voices/route-25eef5877853a92d.js +0 -1
  1160. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/elevenlabs/voices/route-25eef5877853a92d.js +0 -1
  1161. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/inworld/voices/route-25eef5877853a92d.js +0 -1
  1162. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/minimax/voices/route-25eef5877853a92d.js +0 -1
  1163. package/app/.next-cli-build/static/chunks/app/api/media-providers/tts/voices/route-25eef5877853a92d.js +0 -1
  1164. package/app/.next-cli-build/static/chunks/app/api/models/alias/route-25eef5877853a92d.js +0 -1
  1165. package/app/.next-cli-build/static/chunks/app/api/models/availability/route-25eef5877853a92d.js +0 -1
  1166. package/app/.next-cli-build/static/chunks/app/api/models/catalog-sync/route-25eef5877853a92d.js +0 -1
  1167. package/app/.next-cli-build/static/chunks/app/api/models/custom/route-25eef5877853a92d.js +0 -1
  1168. package/app/.next-cli-build/static/chunks/app/api/models/disabled/route-25eef5877853a92d.js +0 -1
  1169. package/app/.next-cli-build/static/chunks/app/api/models/route-25eef5877853a92d.js +0 -1
  1170. package/app/.next-cli-build/static/chunks/app/api/models/test/route-25eef5877853a92d.js +0 -1
  1171. package/app/.next-cli-build/static/chunks/app/api/oauth/[provider]/[action]/route-25eef5877853a92d.js +0 -1
  1172. package/app/.next-cli-build/static/chunks/app/api/oauth/callback/route-25eef5877853a92d.js +0 -1
  1173. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/bulk-import/route-25eef5877853a92d.js +0 -1
  1174. package/app/.next-cli-build/static/chunks/app/api/oauth/codex/import-token/route-25eef5877853a92d.js +0 -1
  1175. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/auto-import/route-25eef5877853a92d.js +0 -1
  1176. package/app/.next-cli-build/static/chunks/app/api/oauth/cursor/import/route-25eef5877853a92d.js +0 -1
  1177. package/app/.next-cli-build/static/chunks/app/api/oauth/gitlab/pat/route-25eef5877853a92d.js +0 -1
  1178. package/app/.next-cli-build/static/chunks/app/api/oauth/grok-cli/bulk-import/route-25eef5877853a92d.js +0 -1
  1179. package/app/.next-cli-build/static/chunks/app/api/oauth/iflow/cookie/route-25eef5877853a92d.js +0 -1
  1180. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/api-key/route-25eef5877853a92d.js +0 -1
  1181. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/auto-import/route-25eef5877853a92d.js +0 -1
  1182. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import/route-25eef5877853a92d.js +0 -1
  1183. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/import-cli-proxy/route-25eef5877853a92d.js +0 -1
  1184. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-authorize/route-25eef5877853a92d.js +0 -1
  1185. package/app/.next-cli-build/static/chunks/app/api/oauth/kiro/social-exchange/route-25eef5877853a92d.js +0 -1
  1186. package/app/.next-cli-build/static/chunks/app/api/pricing/route-25eef5877853a92d.js +0 -1
  1187. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/[id]/route-25eef5877853a92d.js +0 -1
  1188. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/route-25eef5877853a92d.js +0 -1
  1189. package/app/.next-cli-build/static/chunks/app/api/provider-nodes/validate/route-25eef5877853a92d.js +0 -1
  1190. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/models/route-25eef5877853a92d.js +0 -1
  1191. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/refresh-profile/route-25eef5877853a92d.js +0 -1
  1192. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/route-25eef5877853a92d.js +0 -1
  1193. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test/route-25eef5877853a92d.js +0 -1
  1194. package/app/.next-cli-build/static/chunks/app/api/providers/[id]/test-models/route-25eef5877853a92d.js +0 -1
  1195. package/app/.next-cli-build/static/chunks/app/api/providers/client/route-25eef5877853a92d.js +0 -1
  1196. package/app/.next-cli-build/static/chunks/app/api/providers/kilo/free-models/route-25eef5877853a92d.js +0 -1
  1197. package/app/.next-cli-build/static/chunks/app/api/providers/route-25eef5877853a92d.js +0 -1
  1198. package/app/.next-cli-build/static/chunks/app/api/providers/suggested-models/route-25eef5877853a92d.js +0 -1
  1199. package/app/.next-cli-build/static/chunks/app/api/providers/test-batch/route-25eef5877853a92d.js +0 -1
  1200. package/app/.next-cli-build/static/chunks/app/api/providers/validate/route-25eef5877853a92d.js +0 -1
  1201. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/route-25eef5877853a92d.js +0 -1
  1202. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/[id]/test/route-25eef5877853a92d.js +0 -1
  1203. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/cloudflare-deploy/route-25eef5877853a92d.js +0 -1
  1204. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/deno-deploy/route-25eef5877853a92d.js +0 -1
  1205. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/route-25eef5877853a92d.js +0 -1
  1206. package/app/.next-cli-build/static/chunks/app/api/proxy-pools/vercel-deploy/route-25eef5877853a92d.js +0 -1
  1207. package/app/.next-cli-build/static/chunks/app/api/pxpipe/health/route-25eef5877853a92d.js +0 -1
  1208. package/app/.next-cli-build/static/chunks/app/api/pxpipe/install/route-25eef5877853a92d.js +0 -1
  1209. package/app/.next-cli-build/static/chunks/app/api/pxpipe/logs/route-25eef5877853a92d.js +0 -1
  1210. package/app/.next-cli-build/static/chunks/app/api/pxpipe/restart/route-25eef5877853a92d.js +0 -1
  1211. package/app/.next-cli-build/static/chunks/app/api/pxpipe/start/route-25eef5877853a92d.js +0 -1
  1212. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stats/route-25eef5877853a92d.js +0 -1
  1213. package/app/.next-cli-build/static/chunks/app/api/pxpipe/status/route-25eef5877853a92d.js +0 -1
  1214. package/app/.next-cli-build/static/chunks/app/api/pxpipe/stop/route-25eef5877853a92d.js +0 -1
  1215. package/app/.next-cli-build/static/chunks/app/api/routing-health/route-25eef5877853a92d.js +0 -1
  1216. package/app/.next-cli-build/static/chunks/app/api/settings/database/route-25eef5877853a92d.js +0 -1
  1217. package/app/.next-cli-build/static/chunks/app/api/settings/proxy-test/route-25eef5877853a92d.js +0 -1
  1218. package/app/.next-cli-build/static/chunks/app/api/settings/require-login/route-25eef5877853a92d.js +0 -1
  1219. package/app/.next-cli-build/static/chunks/app/api/settings/route-25eef5877853a92d.js +0 -1
  1220. package/app/.next-cli-build/static/chunks/app/api/shutdown/route-25eef5877853a92d.js +0 -1
  1221. package/app/.next-cli-build/static/chunks/app/api/tags/route-25eef5877853a92d.js +0 -1
  1222. package/app/.next-cli-build/static/chunks/app/api/token-saver/stats/route-25eef5877853a92d.js +0 -1
  1223. package/app/.next-cli-build/static/chunks/app/api/token-saver/stream/route-25eef5877853a92d.js +0 -1
  1224. package/app/.next-cli-build/static/chunks/app/api/tool-disclosure/stats/route-25eef5877853a92d.js +0 -1
  1225. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/route-25eef5877853a92d.js +0 -1
  1226. package/app/.next-cli-build/static/chunks/app/api/translator/console-logs/stream/route-25eef5877853a92d.js +0 -1
  1227. package/app/.next-cli-build/static/chunks/app/api/translator/load/route-25eef5877853a92d.js +0 -1
  1228. package/app/.next-cli-build/static/chunks/app/api/translator/save/route-25eef5877853a92d.js +0 -1
  1229. package/app/.next-cli-build/static/chunks/app/api/translator/send/route-25eef5877853a92d.js +0 -1
  1230. package/app/.next-cli-build/static/chunks/app/api/translator/translate/route-25eef5877853a92d.js +0 -1
  1231. package/app/.next-cli-build/static/chunks/app/api/tunnel/disable/route-25eef5877853a92d.js +0 -1
  1232. package/app/.next-cli-build/static/chunks/app/api/tunnel/enable/route-25eef5877853a92d.js +0 -1
  1233. package/app/.next-cli-build/static/chunks/app/api/tunnel/status/route-25eef5877853a92d.js +0 -1
  1234. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-check/route-25eef5877853a92d.js +0 -1
  1235. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-disable/route-25eef5877853a92d.js +0 -1
  1236. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-enable/route-25eef5877853a92d.js +0 -1
  1237. package/app/.next-cli-build/static/chunks/app/api/tunnel/tailscale-install/route-25eef5877853a92d.js +0 -1
  1238. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/codex-reset-credits/route-25eef5877853a92d.js +0 -1
  1239. package/app/.next-cli-build/static/chunks/app/api/usage/[connectionId]/route-25eef5877853a92d.js +0 -1
  1240. package/app/.next-cli-build/static/chunks/app/api/usage/chart/route-25eef5877853a92d.js +0 -1
  1241. package/app/.next-cli-build/static/chunks/app/api/usage/error-logs/route-25eef5877853a92d.js +0 -1
  1242. package/app/.next-cli-build/static/chunks/app/api/usage/history/route-25eef5877853a92d.js +0 -1
  1243. package/app/.next-cli-build/static/chunks/app/api/usage/logs/route-25eef5877853a92d.js +0 -1
  1244. package/app/.next-cli-build/static/chunks/app/api/usage/providers/route-25eef5877853a92d.js +0 -1
  1245. package/app/.next-cli-build/static/chunks/app/api/usage/request-details/route-25eef5877853a92d.js +0 -1
  1246. package/app/.next-cli-build/static/chunks/app/api/usage/request-logs/route-25eef5877853a92d.js +0 -1
  1247. package/app/.next-cli-build/static/chunks/app/api/usage/stats/route-25eef5877853a92d.js +0 -1
  1248. package/app/.next-cli-build/static/chunks/app/api/usage/stream/route-25eef5877853a92d.js +0 -1
  1249. package/app/.next-cli-build/static/chunks/app/api/v1/alpha/search/route-25eef5877853a92d.js +0 -1
  1250. package/app/.next-cli-build/static/chunks/app/api/v1/api/chat/route-25eef5877853a92d.js +0 -1
  1251. package/app/.next-cli-build/static/chunks/app/api/v1/audio/speech/route-25eef5877853a92d.js +0 -1
  1252. package/app/.next-cli-build/static/chunks/app/api/v1/audio/transcriptions/route-25eef5877853a92d.js +0 -1
  1253. package/app/.next-cli-build/static/chunks/app/api/v1/audio/voices/route-25eef5877853a92d.js +0 -1
  1254. package/app/.next-cli-build/static/chunks/app/api/v1/chat/completions/route-25eef5877853a92d.js +0 -1
  1255. package/app/.next-cli-build/static/chunks/app/api/v1/codex/alpha/search/route-25eef5877853a92d.js +0 -1
  1256. package/app/.next-cli-build/static/chunks/app/api/v1/codex/images/edits/route-25eef5877853a92d.js +0 -1
  1257. package/app/.next-cli-build/static/chunks/app/api/v1/codex/images/generations/route-25eef5877853a92d.js +0 -1
  1258. package/app/.next-cli-build/static/chunks/app/api/v1/codex/memories/trace_summarize/route-25eef5877853a92d.js +0 -1
  1259. package/app/.next-cli-build/static/chunks/app/api/v1/codex/models/route-25eef5877853a92d.js +0 -1
  1260. package/app/.next-cli-build/static/chunks/app/api/v1/codex/responses/compact/route-25eef5877853a92d.js +0 -1
  1261. package/app/.next-cli-build/static/chunks/app/api/v1/codex/responses/route-25eef5877853a92d.js +0 -1
  1262. package/app/.next-cli-build/static/chunks/app/api/v1/embeddings/route-25eef5877853a92d.js +0 -1
  1263. package/app/.next-cli-build/static/chunks/app/api/v1/images/generations/route-25eef5877853a92d.js +0 -1
  1264. package/app/.next-cli-build/static/chunks/app/api/v1/messages/count_tokens/route-25eef5877853a92d.js +0 -1
  1265. package/app/.next-cli-build/static/chunks/app/api/v1/messages/route-25eef5877853a92d.js +0 -1
  1266. package/app/.next-cli-build/static/chunks/app/api/v1/models/[...model]/route-25eef5877853a92d.js +0 -1
  1267. package/app/.next-cli-build/static/chunks/app/api/v1/models/info/route-25eef5877853a92d.js +0 -1
  1268. package/app/.next-cli-build/static/chunks/app/api/v1/models/route-25eef5877853a92d.js +0 -1
  1269. package/app/.next-cli-build/static/chunks/app/api/v1/responses/compact/route-25eef5877853a92d.js +0 -1
  1270. package/app/.next-cli-build/static/chunks/app/api/v1/responses/route-25eef5877853a92d.js +0 -1
  1271. package/app/.next-cli-build/static/chunks/app/api/v1/route-25eef5877853a92d.js +0 -1
  1272. package/app/.next-cli-build/static/chunks/app/api/v1/search/route-25eef5877853a92d.js +0 -1
  1273. package/app/.next-cli-build/static/chunks/app/api/v1/videos/[id]/route-25eef5877853a92d.js +0 -1
  1274. package/app/.next-cli-build/static/chunks/app/api/v1/videos/edits/route-25eef5877853a92d.js +0 -1
  1275. package/app/.next-cli-build/static/chunks/app/api/v1/videos/extensions/route-25eef5877853a92d.js +0 -1
  1276. package/app/.next-cli-build/static/chunks/app/api/v1/videos/generations/route-25eef5877853a92d.js +0 -1
  1277. package/app/.next-cli-build/static/chunks/app/api/v1/web/fetch/route-25eef5877853a92d.js +0 -1
  1278. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/[...path]/route-25eef5877853a92d.js +0 -1
  1279. package/app/.next-cli-build/static/chunks/app/api/v1beta/models/route-25eef5877853a92d.js +0 -1
  1280. package/app/.next-cli-build/static/chunks/app/api/version/route-25eef5877853a92d.js +0 -1
  1281. package/app/.next-cli-build/static/chunks/app/api/version/shutdown/route-25eef5877853a92d.js +0 -1
  1282. package/app/.next-cli-build/static/chunks/app/api/version/update/route-25eef5877853a92d.js +0 -1
  1283. package/app/.next-cli-build/static/chunks/app/manifest.webmanifest/route-25eef5877853a92d.js +0 -1
  1284. package/app/.next-cli-build/static/chunks/app/page-25eef5877853a92d.js +0 -1
  1285. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/app-error-25eef5877853a92d.js +0 -1
  1286. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/forbidden-25eef5877853a92d.js +0 -1
  1287. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/not-found-25eef5877853a92d.js +0 -1
  1288. package/app/.next-cli-build/static/chunks/next/dist/client/components/builtin/unauthorized-25eef5877853a92d.js +0 -1
  1289. /package/app/.next-cli-build/static/{3kPJjWzmNgPDoa5VgYHwk → caISOCVUmfRaqJe0JjnZh}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1389:(e,t,a)=>{Promise.resolve().then(a.bind(a,13663))},13663:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>en});var s=a(95155),r=a(73321),n=a(98500),l=a.n(n),i=a(12115),o=a(35497),d=a(57250),c=a(88105),m=a(70217);[{voice_id:"9BWtsMINqrJLrRacOk9x",name:"Aria",free:!1,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",free:!0,labels:{gender:"male",accent:"australian",language:"en"}},{voice_id:"JBFqnCBsd6RMkjVDRZzb",name:"George",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"N2lVS1w4EtoT3dr4eOWO",name:"Callum",free:!0,labels:{gender:"male",accent:"transatlantic",language:"en"}},{voice_id:"SAz9YHcvj6GT2YYXdXww",name:"River",free:!0,labels:{gender:"neutral",accent:"american",language:"en"}},{voice_id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",free:!1,labels:{gender:"female",accent:"swedish",language:"en"}},{voice_id:"Xb7hH8MSUJpSbSDYk0k2",name:"Alice",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"XrExE9yKIg1WjnnlVkGX",name:"Matilda",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"bIHbv24MWmeRgasZH58o",name:"Will",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"cgSgspJ2msm6clMCkdW9",name:"Jessica",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"cjVigY5qzO86Huf0OWal",name:"Eric",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"iP95p4xoKVk53GoZ742B",name:"Chris",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"nPczCjzI2devNBz1zQrb",name:"Brian",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"pqHfZKP75CvOlQylNhV4",name:"Bill",free:!0,labels:{gender:"male",accent:"american",language:"en"}}].map(e=>({...e,category:"premade",lang:e.labels.language,free_users_allowed:e.free}));let u="tts-generated",p={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices",defaultVoiceId:"pNInz6obpgDQGcFmaJgB"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0},"xiaomi-mimo":{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!1,hasStyleInput:!0,hasLanguageHint:!0,languageOptions:["Chinese","English"],voiceSource:"hardcoded",modelKey:"xiaomi-mimo-tts-models",voicesPerModel:!0}};var x=a(14051),h=a.n(x),g=a(78177);function b({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}b.propTypes={until:h().string.isRequired};let f=e=>Number(e||0).toLocaleString();function y({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:n,onMoveUp:l,onMoveDown:d,onToggleActive:p,onUpdateProxy:x,onEdit:h,onDelete:v,onClearError:j}){let[w,N]=(0,i.useState)(!1),[k,S]=(0,i.useState)(!1),[C,$]=(0,i.useState)(!1),[A,E]=(0,i.useState)(null),[P,_]=(0,i.useState)(!1),I=(0,i.useRef)(null);(0,i.useEffect)(()=>{let t=()=>_(!!e.lastError&&!1!==e.isActive&&!!e.lastErrorAt&&Date.now()-new Date(e.lastErrorAt).getTime()<6e5);if(t(),!e.lastError||!e.lastErrorAt)return;let a=6e5-(Date.now()-new Date(e.lastErrorAt).getTime());if(a<=0)return;let s=setTimeout(t,a);return()=>clearTimeout(s)},[e.lastError,e.lastErrorAt,e.isActive]),(0,i.useEffect)(()=>{if(a||!1===e.isActive||!c.jO.includes(e.provider))return;let t=!1,s=null,r=0,n=()=>{document.hidden||(r=Date.now(),fetch(`/api/usage/${e.id}`).then(e=>e.ok?e.json():null).then(e=>{if(t||!e?.quotas)return;let a=Object.entries(e.quotas)[0];a&&E({label:a[1]?.displayName||a[0],...a[1]})}).catch(()=>{}))};n();let l=()=>{!document.hidden&&Date.now()-r>6e4&&n()},i=t=>{t?.detail?.provider&&t.detail.provider!==e.provider||(clearTimeout(s),s=setTimeout(n,1500))};return document.addEventListener("visibilitychange",l),window.addEventListener(u,i),()=>{t=!0,clearTimeout(s),document.removeEventListener("visibilitychange",l),window.removeEventListener(u,i)}},[e.id,e.provider,a,e.isActive]);let T=new Map((t||[]).map(e=>[e.id,e])),R=e.providerSpecificData?.proxyPoolId||null,L=R?T.get(R):null,O=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,M=!!R||O,D=L?`Pool: ${L.name}`:R?`Pool: ${R} (inactive/missing)`:O?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",B="",U=L?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(U)try{let e=new URL(U);B=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{B=U}let K=L?.noProxy||e.providerSpecificData?.connectionNoProxy||"",F=L?.isActive===!0?"success":R||O?"error":"default",q=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(Boolean).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{$(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let a=q?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[q]),(0,i.useEffect)(()=>{if(!w)return;let e=e=>{I.current&&!I.current.contains(e.target)&&N(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[w]);let z="unavailable"!==e.testStatus||C?e.testStatus:"active",V=(0,g.XD)(e),H=a?e.name||e.email||e.displayName||"OAuth Account":e.name,J=async e=>{S(!0);try{await x("__none__"===e?null:e)}finally{S(!1),N(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:H}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(o.Ex,{variant:(0,m.g)(e.isActive,z),size:"sm",dot:!0,children:!1===e.isActive?"disabled":z||"Unknown"}),M&&(0,s.jsx)(o.Ex,{variant:F,size:"sm",children:"Proxy"}),C&&!1!==e.isActive&&(0,s.jsx)(b,{until:q}),V.paused&&!1!==e.isActive&&(0,s.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Paused (quota)"}),P&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 max-w-[320px]",children:[(0,s.jsx)("span",{className:"text-xs text-red-500 truncate",title:e.lastError,children:e.lastError}),(0,s.jsx)("button",{type:"button",onClick:j,title:"Dismiss this error",className:"shrink-0 text-red-400 hover:text-red-600 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),A&&(0,s.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",title:A.resetAt?`Reset: ${new Date(A.resetAt).toLocaleString()}`:void 0,children:[!A.unlimited&&A.total>0&&(0,s.jsx)("div",{className:"h-1.5 w-24 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden shrink-0",children:(0,s.jsx)("div",{className:`h-full ${A.remainingPercentage<=10?"bg-red-500":A.remainingPercentage<=30?"bg-amber-500":"bg-primary"}`,style:{width:`${A.remainingPercentage}%`}})}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:[A.unlimited?"Credits: Unlimited":(0,s.jsxs)(s.Fragment,{children:[f(A.remaining)," / ",f(A.total)," ","credits left"]}),A.resetAt&&(0,s.jsxs)("span",{className:"text-text-muted/70",children:[" \xb7 ","resets"," ",new Date(A.resetAt).toLocaleDateString()]})]})]}),M&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:D,children:D}),B&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:B}),K&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:K,children:["no_proxy: ",K]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:I,children:[(0,s.jsxs)("button",{onClick:()=>N(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${M?"text-primary":"text-text-muted hover:text-primary"}`,disabled:k,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:k?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),w&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>J("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!R?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>J(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${R===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:v,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:p,title:e.isActive??!0?"Disable":"Enable"})]})]})}function v({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:n,onClose:l}){let d="__none__",[c,m]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(null),[g,b]=(0,i.useState)(!1),f=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();h(a.valid?"success":"failed")}catch{h("failed")}finally{p(!1)}},y=async()=>{if(t&&c.apiKey){b(!0);try{let e=!1;try{p(!0),h(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{p(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{b(!1)}}};return t?(0,s.jsx)(o.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(o.$n,{onClick:f,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),x&&(0,s.jsx)(o.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(o.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:y,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(o.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function j({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[n,l]=(0,i.useState)([]),[d,c]=(0,i.useState)(!0),[m,u]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(null),[w,N]=(0,i.useState)("1"),[k,S]=(0,i.useState)(null),C=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),n=await t.json(),i=await a.json(),o=s.ok?await s.json():{};t.ok&&r((n.connections||[]).filter(t=>t.provider===e)),a.ok&&l(i.proxyPools||[]);let d=(o.providerStrategies||{})[e]||{};f(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,i.useEffect)(()=>{C()},[C]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},n={};t&&(n.fallbackStrategy=t),"round-robin"===t&&""!==a&&(n.stickyRoundRobinLimit=Number(a)||3);let l={...r};0===Object.keys(n).length?delete l[e]:l[e]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},A=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await C()}},E=async e=>{S({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{S(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},P=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},_=async e=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({lastError:null,lastErrorAt:null})})).ok&&r(t=>t.map(t=>t.id===e?{...t,lastError:null,lastErrorAt:null}:t))}catch(e){console.log("clear error:",e)}},I=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},T=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await C(),u(!1))}catch(e){console.log("save apikey error:",e)}},R=async e=>{try{(await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await C(),x(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(o.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(o.lM,{checked:"round-robin"===b,onChange:e=>{let t=e?"round-robin":null;f(t),e&&!w&&N("1"),$(t,e?w||"1":w)}}),"round-robin"===b&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:w,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:a.map((e,r)=>(0,s.jsx)(y,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>A(r,r-1),onMoveDown:()=>A(r,r+1),onToggleActive:t=>P(e.id,t),onUpdateProxy:t=>I(e.id,t),onEdit:()=>{g(e),x(!0)},onDelete:()=>E(e.id),onClearError:()=>_(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(v,{isOpen:m,provider:e,proxyPools:n,onSave:T,onClose:()=>u(!1)}),(0,s.jsx)(o.wI,{isOpen:p,connection:h,proxyPools:n,onSave:R,onClose:()=>x(!1)}),(0,s.jsx)(o.uo,{isOpen:!!k,onClose:()=>S(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}y.propTypes={connection:h().shape({id:h().string,name:h().string,email:h().string,displayName:h().string,testStatus:h().string,isActive:h().bool,lastError:h().string,priority:h().number}).isRequired,proxyPools:h().array,isOAuth:h().bool.isRequired,isFirst:h().bool.isRequired,isLast:h().bool.isRequired,onMoveUp:h().func.isRequired,onMoveDown:h().func.isRequired,onToggleActive:h().func.isRequired,onUpdateProxy:h().func,onEdit:h().func.isRequired,onDelete:h().func.isRequired,onClearError:h().func},v.propTypes={isOpen:h().bool.isRequired,provider:h().string,providerName:h().string,proxyPools:h().array,onSave:h().func.isRequired,onClose:h().func.isRequired},j.propTypes={providerId:h().string.isRequired,isOAuth:h().bool};var w=a(28777),N=a(11059);function k({model:e,fullModel:t,copied:a,onCopy:r,testStatus:n,isCustom:l,isFree:i,onDeleteAlias:o,onTest:d,isTesting:c}){let m="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,s.jsx)("button",{onClick:o,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function S({isOpen:e,onSave:t,onClose:a}){let[r,n]=(0,i.useState)(""),l=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,s.jsx)(o.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&l(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:l,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(o.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function C({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:n}=(0,N.C)(),[l,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(""),[y,v]=(0,i.useState)(!1),j=a||(0,c.wG)(e),$=t||"llm",A=(0,i.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,i.useEffect)(()=>{A()},[A]);let E=async(e,t)=>{let a=`${j}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await A()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}catch(e){console.log("delete alias error:",e)}},_=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:j,id:e,type:$})})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},I=async e=>{try{let t=new URLSearchParams({providerAlias:j,id:e,type:$});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h){g(e);try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${j}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),f(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{g(null)}}},R=(0,w.KC)(e),L=t?R.filter(e=>e.kinds?e.kinds.includes(t):(0,w.CP)(e,"llm")===t):R,O=m.filter(e=>e.providerAlias===j&&(0,w.CP)(e,"llm")===$&&!L.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),b&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:b}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[L.map(e=>{let t=`${j}/${e.id}`,a=Object.entries(l).find(([,e])=>e===t)?.[0];return(0,s.jsx)(k,{model:e,fullModel:`${j}/${e.id}`,alias:a,copied:r,onCopy:n,onSetAlias:t=>E(e.id,t),onDeleteAlias:()=>P(a),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(k,{model:{id:e.id,name:e.name},fullModel:`${j}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>I(e.id),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h===e.id,isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(S,{isOpen:y,onSave:async e=>{await _(e),v(!1)},onClose:()=>v(!1)})]})}function $({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}k.propTypes={model:h().shape({id:h().string.isRequired}).isRequired,fullModel:h().string.isRequired,copied:h().string,onCopy:h().func.isRequired,testStatus:h().oneOf(["ok","error"]),isCustom:h().bool,isFree:h().bool,onDeleteAlias:h().func,onTest:h().func,isTesting:h().bool},S.propTypes={isOpen:h().bool.isRequired,onSave:h().func.isRequired,onClose:h().func.isRequired},C.propTypes={providerId:h().string.isRequired,kindFilter:h().string,providerAliasOverride:h().string};let A={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[182],{1389:(e,t,a)=>{Promise.resolve().then(a.bind(a,13663))},13663:(e,t,a)=>{"use strict";a.r(t),a.d(t,{default:()=>el});var s=a(95155),r=a(73321),n=a(98500),l=a.n(n),i=a(12115),o=a(35497),d=a(57250),c=a(88105),m=a(70217);[{voice_id:"9BWtsMINqrJLrRacOk9x",name:"Aria",free:!1,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"CwhRBWXzGAHq8TQ4Fs17",name:"Roger",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"EXAVITQu4vr4xnSDxMaL",name:"Sarah",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"FGY2WhTYpPnrIDTdsKH5",name:"Laura",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"IKne3meq5aSn9XLyUdCD",name:"Charlie",free:!0,labels:{gender:"male",accent:"australian",language:"en"}},{voice_id:"JBFqnCBsd6RMkjVDRZzb",name:"George",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"N2lVS1w4EtoT3dr4eOWO",name:"Callum",free:!0,labels:{gender:"male",accent:"transatlantic",language:"en"}},{voice_id:"SAz9YHcvj6GT2YYXdXww",name:"River",free:!0,labels:{gender:"neutral",accent:"american",language:"en"}},{voice_id:"TX3LPaxmHKxFdv7VOQHJ",name:"Liam",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"XB0fDUnXU5powFXDhCwa",name:"Charlotte",free:!1,labels:{gender:"female",accent:"swedish",language:"en"}},{voice_id:"Xb7hH8MSUJpSbSDYk0k2",name:"Alice",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"XrExE9yKIg1WjnnlVkGX",name:"Matilda",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"bIHbv24MWmeRgasZH58o",name:"Will",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"cgSgspJ2msm6clMCkdW9",name:"Jessica",free:!0,labels:{gender:"female",accent:"american",language:"en"}},{voice_id:"cjVigY5qzO86Huf0OWal",name:"Eric",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"iP95p4xoKVk53GoZ742B",name:"Chris",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"nPczCjzI2devNBz1zQrb",name:"Brian",free:!0,labels:{gender:"male",accent:"american",language:"en"}},{voice_id:"onwK4e9ZLuTAKqWW03F9",name:"Daniel",free:!0,labels:{gender:"male",accent:"british",language:"en"}},{voice_id:"pFZP5JQG7iQjIQuC4Bku",name:"Lily",free:!0,labels:{gender:"female",accent:"british",language:"en"}},{voice_id:"pqHfZKP75CvOlQylNhV4",name:"Bill",free:!0,labels:{gender:"male",accent:"american",language:"en"}}].map(e=>({...e,category:"premade",lang:e.labels.language,free_users_allowed:e.free}));let u="tts-generated",p={"google-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"hardcoded"},openai:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openai-tts-models",voiceKey:"openai-tts-voices",voicesPerModel:!0},openrouter:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"openrouter-tts-models",voiceKey:"openrouter-tts-voices",voicesPerModel:!0},elevenlabs:{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"elevenlabs-tts-models",apiEndpoint:"/api/media-providers/tts/elevenlabs/voices",defaultVoiceId:"pNInz6obpgDQGcFmaJgB"},"edge-tts":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},"local-device":{hasLanguageDropdown:!1,hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language"},nvidia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},hyperbolic:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},deepgram:{hasModelSelector:!1,hasBrowseButton:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/deepgram/voices"},huggingface:{hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"config"},cartesia:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},playht:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},coqui:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},tortoise:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},inworld:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",modelKey:"inworld-tts-models",apiEndpoint:"/api/media-providers/tts/inworld/voices"},qwen:{hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!0,voiceSource:"config"},minimax:{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices",defaultVoiceId:"English_expressive_narrator"},"minimax-cn":{hasModelSelector:!0,hasBrowseButton:!0,hasVoiceIdInput:!0,voiceSource:"api-language",apiEndpoint:"/api/media-providers/tts/minimax/voices?provider=minimax-cn",defaultVoiceId:"English_expressive_narrator"},gemini:{hasLanguageDropdown:!1,hasLanguageHint:!0,hasModelSelector:!0,hasBrowseButton:!1,voiceSource:"hardcoded",modelKey:"gemini-tts-models",voiceKey:"gemini-tts-voices",voicesPerModel:!0},"xiaomi-mimo":{hasLanguageDropdown:!1,hasModelSelector:!0,hasBrowseButton:!1,hasVoiceIdInput:!1,hasStyleInput:!0,hasLanguageHint:!0,languageOptions:["Chinese","English"],voiceSource:"hardcoded",modelKey:"xiaomi-mimo-tts-models",voicesPerModel:!0}};var x=a(14051),h=a.n(x),g=a(78177),b=a(64827);function f({until:e}){let[t,a]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void a("");let s=Math.floor(t/1e3);s<60?a(`${s}s`):s<3600?a(`${Math.floor(s/60)}m ${s%60}s`):a(`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`)};t();let s=setInterval(t,1e3);return()=>clearInterval(s)},[e]),t)?(0,s.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}f.propTypes={until:h().string.isRequired};let y=e=>Number(e||0).toLocaleString();function v({connection:e,proxyPools:t,isOAuth:a,isFirst:r,isLast:n,onMoveUp:l,onMoveDown:d,onToggleActive:p,onUpdateProxy:x,onEdit:h,onDelete:j,onClearError:w}){let[N,k]=(0,i.useState)(!1),[S,C]=(0,i.useState)(!1),[$,A]=(0,i.useState)(!1),[E,P]=(0,i.useState)(null),[I,_]=(0,i.useState)(!1),T=(0,i.useRef)(null);(0,i.useEffect)(()=>{let t=()=>_(!!e.lastError&&!1!==e.isActive&&!!e.lastErrorAt&&Date.now()-new Date(e.lastErrorAt).getTime()<6e5);if(t(),!e.lastError||!e.lastErrorAt)return;let a=6e5-(Date.now()-new Date(e.lastErrorAt).getTime());if(a<=0)return;let s=setTimeout(t,a);return()=>clearTimeout(s)},[e.lastError,e.lastErrorAt,e.isActive]),(0,i.useEffect)(()=>{if(a||!1===e.isActive||!c.jO.includes(e.provider))return;let t=!1,s=null,r=0,n=()=>{document.hidden||(r=Date.now(),fetch(`/api/usage/${e.id}`).then(e=>e.ok?e.json():null).then(e=>{if(t||!e?.quotas)return;let a=Object.entries(e.quotas)[0];a&&P({label:a[1]?.displayName||a[0],...a[1]})}).catch(()=>{}))};n();let l=()=>{!document.hidden&&Date.now()-r>6e4&&n()},i=t=>{t?.detail?.provider&&t.detail.provider!==e.provider||(clearTimeout(s),s=setTimeout(n,1500))};return document.addEventListener("visibilitychange",l),window.addEventListener(u,i),()=>{t=!0,clearTimeout(s),document.removeEventListener("visibilitychange",l),window.removeEventListener(u,i)}},[e.id,e.provider,a,e.isActive]);let R=new Map((t||[]).map(e=>[e.id,e])),L=e.providerSpecificData?.proxyPoolId||null,O=L?R.get(L):null,M=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,D=!!L||M,B=O?`Pool: ${O.name}`:L?`Pool: ${L} (inactive/missing)`:M?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",U="",K=O?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;if(K)try{let e=new URL(K);U=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{U=K}let F=O?.noProxy||e.providerSpecificData?.connectionNoProxy||"",q=O?.isActive===!0?"success":L||M?"error":"default",z=(0,b.kJ)(e);(0,i.useEffect)(()=>{let t=()=>{A(!!(0,b.kJ)(e))};t();let a=z?setInterval(t,1e3):null;return()=>{a&&clearInterval(a)}},[z]),(0,i.useEffect)(()=>{if(!N)return;let e=e=>{T.current&&!T.current.contains(e.target)&&k(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[N]);let J="unavailable"!==e.testStatus||$?e.testStatus:"active",V=(0,g.XD)(e),H=a?e.name||e.email||e.displayName||"OAuth Account":e.name,W=async e=>{C(!0);try{await x("__none__"===e?null:e)}finally{C(!1),k(!1)}};return(0,s.jsxs)("div",{className:`group flex flex-col gap-3 p-2 rounded-lg sm:flex-row sm:items-center sm:justify-between hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors ${!1===e.isActive?"opacity-60":""}`,children:[(0,s.jsxs)("div",{className:"flex w-full min-w-0 flex-1 items-start gap-3 sm:items-center",children:[(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("button",{onClick:l,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,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,s.jsx)("button",{onClick:d,disabled:n,className:`p-0.5 rounded ${n?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",children:a?"lock":"key"}),(0,s.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,s.jsx)("p",{className:"text-sm font-medium truncate",children:H}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mt-1",children:[(0,s.jsx)(o.Ex,{variant:(0,m.g)(e.isActive,J),size:"sm",dot:!0,children:!1===e.isActive?"disabled":J||"Unknown"}),D&&(0,s.jsx)(o.Ex,{variant:q,size:"sm",children:"Proxy"}),$&&!1!==e.isActive&&(0,s.jsx)(f,{until:z}),V.paused&&!1!==e.isActive&&(0,s.jsx)(o.Ex,{variant:"warning",size:"sm",children:"Paused (quota)"}),I&&(0,s.jsxs)("span",{className:"inline-flex items-center gap-1 max-w-[320px]",children:[(0,s.jsx)("span",{className:"text-xs text-red-500 truncate",title:e.lastError,children:e.lastError}),(0,s.jsx)("button",{type:"button",onClick:w,title:"Dismiss this error",className:"shrink-0 text-red-400 hover:text-red-600 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]})]}),E&&(0,s.jsxs)("div",{className:"mt-1.5 flex items-center gap-2",title:E.resetAt?`Reset: ${new Date(E.resetAt).toLocaleString()}`:void 0,children:[!E.unlimited&&E.total>0&&(0,s.jsx)("div",{className:"h-1.5 w-24 rounded-full bg-black/10 dark:bg-white/10 overflow-hidden shrink-0",children:(0,s.jsx)("div",{className:`h-full ${E.remainingPercentage<=10?"bg-red-500":E.remainingPercentage<=30?"bg-amber-500":"bg-primary"}`,style:{width:`${E.remainingPercentage}%`}})}),(0,s.jsxs)("span",{className:"text-[11px] text-text-muted",children:[E.unlimited?"Credits: Unlimited":(0,s.jsxs)(s.Fragment,{children:[y(E.remaining)," / ",y(E.total)," ","credits left"]}),E.resetAt&&(0,s.jsxs)("span",{className:"text-text-muted/70",children:[" \xb7 ","resets"," ",new Date(E.resetAt).toLocaleDateString()]})]})]}),D&&(0,s.jsxs)("div",{className:"mt-1 flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-[11px] text-text-muted truncate max-w-[420px]",title:B,children:B}),U&&(0,s.jsx)("code",{className:"text-[10px] font-mono bg-black/5 dark:bg-white/5 px-1 py-0.5 rounded text-text-muted",children:U}),F&&(0,s.jsxs)("span",{className:"text-[11px] text-text-muted truncate max-w-[320px]",title:F,children:["no_proxy: ",F]})]})]})]}),(0,s.jsxs)("div",{className:"flex w-full flex-wrap items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,s.jsxs)("div",{className:"flex flex-wrap gap-1",children:[(t||[]).length>0&&(0,s.jsxs)("div",{className:"relative",ref:T,children:[(0,s.jsxs)("button",{onClick:()=>k(e=>!e),className:`flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 transition-colors ${D?"text-primary":"text-text-muted hover:text-primary"}`,disabled:S,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:S?"progress_activity":"lan"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),N&&(0,s.jsxs)("div",{className:"absolute right-0 top-full mt-1 z-50 bg-bg border border-border rounded-lg shadow-lg py-1 min-w-[160px]",children:[(0,s.jsx)("button",{onClick:()=>W("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!L?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,s.jsx)("button",{onClick:()=>W(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${L===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),(0,s.jsxs)("button",{onClick:h,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-black/5 dark:hover:bg-white/5 text-text-muted hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,s.jsxs)("button",{onClick:j,className:"flex flex-col items-center px-2 py-1 rounded hover:bg-red-500/10 text-red-500",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,s.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,s.jsx)(o.lM,{size:"sm",checked:e.isActive??!0,onChange:p,title:e.isActive??!0?"Disable":"Enable"})]})]})}function j({isOpen:e,provider:t,providerName:a,proxyPools:r,onSave:n,onClose:l}){let d="__none__",[c,m]=(0,i.useState)({name:"",apiKey:"",priority:1,proxyPoolId:d}),[u,p]=(0,i.useState)(!1),[x,h]=(0,i.useState)(null),[g,b]=(0,i.useState)(!1),f=async()=>{p(!0);try{let e=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})}),a=await e.json();h(a.valid?"success":"failed")}catch{h("failed")}finally{p(!1)}},y=async()=>{if(t&&c.apiKey){b(!0);try{let e=!1;try{p(!0),h(null);let a=await fetch("/api/providers/validate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:t,apiKey:c.apiKey})});e=!!(await a.json()).valid,h(e?"success":"failed")}catch{h("failed")}finally{p(!1)}await n({name:c.name,apiKey:c.apiKey,priority:c.priority,proxyPoolId:c.proxyPoolId===d?null:c.proxyPoolId,testStatus:e?"active":"unknown"})}finally{b(!1)}}};return t?(0,s.jsx)(o.aF,{isOpen:e,title:`Add ${a||t} API Key`,onClose:l,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Name"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.name,onChange:e=>m({...c,name:e.target.value}),placeholder:"Production Key"})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"API Key"}),(0,s.jsx)("input",{type:"password",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.apiKey,onChange:e=>m({...c,apiKey:e.target.value})})]}),(0,s.jsx)("div",{className:"pt-6",children:(0,s.jsx)(o.$n,{onClick:f,disabled:!c.apiKey||u||g,variant:"secondary",children:u?"Checking...":"Check"})})]}),x&&(0,s.jsx)(o.Ex,{variant:"success"===x?"success":"error",children:"success"===x?"Valid":"Invalid"}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Priority"}),(0,s.jsx)("input",{type:"number",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:c.priority,onChange:e=>m({...c,priority:Number.parseInt(e.target.value)||1})})]}),(0,s.jsx)(o.l6,{label:"Proxy Pool",value:c.proxyPoolId,onChange:e=>m({...c,proxyPoolId:e.target.value}),options:[{value:d,label:"None"},...(r||[]).map(e=>({value:e.id,label:e.name}))]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:y,fullWidth:!0,disabled:!c.name||!c.apiKey||g,children:g?"Saving...":"Save"}),(0,s.jsx)(o.$n,{onClick:l,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})}):null}function w({providerId:e,isOAuth:t}){let[a,r]=(0,i.useState)([]),[n,l]=(0,i.useState)([]),[d,c]=(0,i.useState)(!0),[m,u]=(0,i.useState)(!1),[p,x]=(0,i.useState)(!1),[h,g]=(0,i.useState)(null),[b,f]=(0,i.useState)(null),[y,N]=(0,i.useState)("1"),[k,S]=(0,i.useState)(null),C=(0,i.useCallback)(async()=>{try{let[t,a,s]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/proxy-pools?isActive=true",{cache:"no-store"}),fetch("/api/settings",{cache:"no-store"})]),n=await t.json(),i=await a.json(),o=s.ok?await s.json():{};t.ok&&r((n.connections||[]).filter(t=>t.provider===e)),a.ok&&l(i.proxyPools||[]);let d=(o.providerStrategies||{})[e]||{};f(d.fallbackStrategy||null),N(null!=d.stickyRoundRobinLimit?String(d.stickyRoundRobinLimit):"1")}catch(e){console.log("ConnectionsCard fetch error:",e)}finally{c(!1)}},[e]);(0,i.useEffect)(()=>{C()},[C]);let $=async(t,a)=>{try{let s=await fetch("/api/settings",{cache:"no-store"}),r=(s.ok?await s.json():{}).providerStrategies||{},n={};t&&(n.fallbackStrategy=t),"round-robin"===t&&""!==a&&(n.stickyRoundRobinLimit=Number(a)||3);let l={...r};0===Object.keys(n).length?delete l[e]:l[e]=n,await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerStrategies:l})})}catch(e){console.log("saveStrategy error:",e)}},A=async(e,t)=>{let s=[...a];[s[e],s[t]]=[s[t],s[e]],r(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{await C()}},E=async e=>{S({title:"Delete Connection",message:"Delete this connection?",onConfirm:async()=>{S(null);try{(await fetch(`/api/providers/${e}`,{method:"DELETE"})).ok&&r(t=>t.filter(t=>t.id!==e))}catch(e){console.log("delete error:",e)}}})},P=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:t})})).ok&&r(a=>a.map(a=>a.id===e?{...a,isActive:t}:a))}catch(e){console.log("toggle error:",e)}},I=async e=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({lastError:null,lastErrorAt:null})})).ok&&r(t=>t.map(t=>t.id===e?{...t,lastError:null,lastErrorAt:null}:t))}catch(e){console.log("clear error:",e)}},_=async(e,t)=>{try{(await fetch(`/api/providers/${e}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyPoolId:t||null})})).ok&&r(a=>a.map(a=>a.id===e?{...a,providerSpecificData:{...a.providerSpecificData,proxyPoolId:t||null}}:a))}catch(e){console.log("proxy error:",e)}},T=async t=>{try{(await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,...t})})).ok&&(await C(),u(!1))}catch(e){console.log("save apikey error:",e)}},R=async e=>{try{(await fetch(`/api/providers/${h.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)})).ok&&(await C(),x(!1))}catch(e){console.log("update connection error:",e)}};return d?(0,s.jsx)(o.Zp,{children:(0,s.jsx)("div",{className:"h-20 animate-pulse bg-black/5 rounded-lg"})}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between mb-4",children:[(0,s.jsx)("h2",{className:"text-lg font-semibold",children:"Connections"}),(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted font-medium",children:"Round Robin"}),(0,s.jsx)(o.lM,{checked:"round-robin"===b,onChange:e=>{let t=e?"round-robin":null;f(t),e&&!y&&N("1"),$(t,e?y||"1":y)}}),"round-robin"===b&&(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-1.5",children:[(0,s.jsx)("span",{className:"text-xs text-text-muted",children:"Sticky:"}),(0,s.jsx)("input",{type:"number",min:1,value:y,onChange:e=>{N(e.target.value),$("round-robin",e.target.value)},className:"w-16 px-2 py-1 text-xs border border-border rounded-md bg-background focus:outline-none focus:border-primary"})]})]})]}),0===a.length?(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"No connections yet"}),(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add Connection"})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("div",{className:"flex flex-col divide-y divide-black/[0.03] dark:divide-white/[0.03] max-h-[500px] overflow-y-auto pr-1",children:a.map((e,r)=>(0,s.jsx)(v,{connection:e,proxyPools:n,isOAuth:t,isFirst:0===r,isLast:r===a.length-1,onMoveUp:()=>A(r,r-1),onMoveDown:()=>A(r,r+1),onToggleActive:t=>P(e.id,t),onUpdateProxy:t=>_(e.id,t),onEdit:()=>{g(e),x(!0)},onDelete:()=>E(e.id),onClearError:()=>I(e.id)},e.id))}),(0,s.jsx)("div",{className:"mt-4 flex justify-stretch sm:justify-start",children:(0,s.jsx)(o.$n,{size:"sm",icon:"add",onClick:()=>u(!0),children:"Add"})})]})]}),(0,s.jsx)(j,{isOpen:m,provider:e,proxyPools:n,onSave:T,onClose:()=>u(!1)}),(0,s.jsx)(o.wI,{isOpen:p,connection:h,proxyPools:n,onSave:R,onClose:()=>x(!1)}),(0,s.jsx)(o.uo,{isOpen:!!k,onClose:()=>S(null),onConfirm:k?.onConfirm,title:k?.title||"Confirm",message:k?.message,variant:"danger"})]})}v.propTypes={connection:h().shape({id:h().string,name:h().string,email:h().string,displayName:h().string,testStatus:h().string,isActive:h().bool,lastError:h().string,priority:h().number}).isRequired,proxyPools:h().array,isOAuth:h().bool.isRequired,isFirst:h().bool.isRequired,isLast:h().bool.isRequired,onMoveUp:h().func.isRequired,onMoveDown:h().func.isRequired,onToggleActive:h().func.isRequired,onUpdateProxy:h().func,onEdit:h().func.isRequired,onDelete:h().func.isRequired,onClearError:h().func},j.propTypes={isOpen:h().bool.isRequired,provider:h().string,providerName:h().string,proxyPools:h().array,onSave:h().func.isRequired,onClose:h().func.isRequired},w.propTypes={providerId:h().string.isRequired,isOAuth:h().bool};var N=a(28777),k=a(11059);function S({model:e,fullModel:t,copied:a,onCopy:r,testStatus:n,isCustom:l,isFree:i,onDeleteAlias:o,onTest:d,isTesting:c}){let m="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,s.jsx)("div",{className:`group px-3 py-2 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-base",style:m?{color:m}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),e.name&&(0,s.jsx)("span",{className:"text-[9px] text-text-muted/70 italic pl-1",children:e.name})]}),d&&(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:d,disabled:c,className:`p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-opacity ${c?"opacity-100":"opacity-0 group-hover:opacity-100"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",style:c?{animation:"spin 1s linear infinite"}:void 0,children:c?"progress_activity":"science"})}),(0,s.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:c?"Testing...":"Test"})]}),(0,s.jsxs)("div",{className:"relative group/btn",children:[(0,s.jsx)("button",{onClick:()=>r(t,`model-${e.id}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:a===`model-${e.id}`?"check":"content_copy"})}),(0,s.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:a===`model-${e.id}`?"Copied!":"Copy"})]}),i&&(0,s.jsx)("span",{className:"text-[10px] font-bold text-green-500 bg-green-500/10 px-1.5 py-0.5 rounded",children:"FREE"}),l&&(0,s.jsx)("button",{onClick:o,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 opacity-0 group-hover:opacity-100 transition-opacity ml-auto",title:"Remove custom model",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})})]})})}function C({isOpen:e,onSave:t,onClose:a}){let[r,n]=(0,i.useState)(""),l=()=>{r.trim()&&(t(r.trim()),n(""))};return(0,s.jsx)(o.aF,{isOpen:e,title:"Add Custom Model",onClose:a,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,s.jsx)("input",{className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",value:r,onChange:e=>n(e.target.value),onKeyDown:e=>"Enter"===e.key&&l(),placeholder:"e.g. tts-1-hd",autoFocus:!0})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(o.$n,{onClick:l,fullWidth:!0,disabled:!r.trim(),children:"Add"}),(0,s.jsx)(o.$n,{onClick:a,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})})}function $({providerId:e,kindFilter:t,providerAliasOverride:a}){let{copied:r,copy:n}=(0,k.C)(),[l,d]=(0,i.useState)({}),[m,u]=(0,i.useState)([]),[p,x]=(0,i.useState)({}),[h,g]=(0,i.useState)(()=>new Set),[b,f]=(0,i.useState)(""),[y,v]=(0,i.useState)(!1),j=a||(0,c.wG)(e),w=t||"llm",A=(0,i.useCallback)(async()=>{try{let[e,t]=await Promise.all([fetch("/api/models/alias"),fetch("/api/models/custom",{cache:"no-store"})]),a=await e.json(),s=await t.json();e.ok&&d(a.aliases||{}),t.ok&&u(s.models||[])}catch(e){console.log("ModelsCard fetch error:",e)}},[]);(0,i.useEffect)(()=>{A()},[A]);let E=async(e,t)=>{let a=`${j}/${e}`;try{(await fetch("/api/models/alias",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:a,alias:t})})).ok&&await A()}catch(e){console.log("set alias error:",e)}},P=async e=>{try{(await fetch(`/api/models/alias?alias=${encodeURIComponent(e)}`,{method:"DELETE"})).ok&&await A()}catch(e){console.log("delete alias error:",e)}},I=async e=>{try{(await fetch("/api/models/custom",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:j,id:e,type:w})})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("add custom model error:",e)}},_=async e=>{try{let t=new URLSearchParams({providerAlias:j,id:e,type:w});(await fetch(`/api/models/custom?${t}`,{method:"DELETE"})).ok&&(await A(),window.dispatchEvent(new CustomEvent("customModelChanged")))}catch(e){console.log("delete custom model error:",e)}},T=async e=>{if(!h.has(e)){g(t=>new Set(t).add(e));try{let a=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${j}/${e}`,kind:t})}),s=await a.json();x(t=>({...t,[e]:s.ok?"ok":"error"})),f(s.ok?"":s.error||"Model not reachable")}catch{x(t=>({...t,[e]:"error"})),f("Network error")}finally{g(t=>{let a=new Set(t);return a.delete(e),a})}}},R=(0,N.KC)(e),L=t?R.filter(e=>e.kinds?e.kinds.includes(t):(0,N.CP)(e,"llm")===t):R,O=m.filter(e=>e.providerAlias===j&&(0,N.CP)(e,"llm")===w&&!L.some(t=>t.id===e.id));return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,s.jsxs)("h2",{className:"text-lg font-semibold",children:["Models",t?` — ${t.toUpperCase()}`:""]})}),b&&(0,s.jsx)("p",{className:"text-xs text-red-500 mb-3 break-words",children:b}),(0,s.jsxs)("div",{className:"flex flex-wrap gap-3",children:[L.map(e=>{let t=`${j}/${e.id}`,a=Object.entries(l).find(([,e])=>e===t)?.[0];return(0,s.jsx)(S,{model:e,fullModel:`${j}/${e.id}`,alias:a,copied:r,onCopy:n,onSetAlias:t=>E(e.id,t),onDeleteAlias:()=>P(a),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isFree:e.isFree},e.id)}),O.map(e=>(0,s.jsx)(S,{model:{id:e.id,name:e.name},fullModel:`${j}/${e.id}`,copied:r,onCopy:n,onSetAlias:()=>{},onDeleteAlias:()=>_(e.id),testStatus:p[e.id],onTest:()=>T(e.id),isTesting:h.has(e.id),isCustom:!0},`${e.id}-${e.type}`)),(0,s.jsxs)("button",{onClick:()=>v(!0),className:"flex items-center gap-1.5 px-3 py-2 rounded-lg border border-dashed border-black/15 dark:border-white/15 text-xs text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"add"}),"Add Model"]})]})]}),(0,s.jsx)(C,{isOpen:y,onSave:async e=>{await I(e),v(!1)},onClose:()=>v(!1)})]})}function A({label:e,children:t}){return(0,s.jsxs)("div",{className:"flex min-w-0 flex-col gap-1.5 sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"w-full text-xs font-medium text-text-muted sm:w-20 sm:shrink-0",children:e}),(0,s.jsx)("div",{className:"w-full min-w-0 flex-1",children:t})]})}S.propTypes={model:h().shape({id:h().string.isRequired}).isRequired,fullModel:h().string.isRequired,copied:h().string,onCopy:h().func.isRequired,testStatus:h().oneOf(["ok","error"]),isCustom:h().bool,isFree:h().bool,onDeleteAlias:h().func,onTest:h().func,isTesting:h().bool},C.propTypes={isOpen:h().bool.isRequired,onSave:h().func.isRequired,onClose:h().func.isRequired},$.propTypes={providerId:h().string.isRequired,kindFilter:h().string,providerAliasOverride:h().string};let E={webSearch:{inputLabel:"Query",inputPlaceholder:"What is the latest news about AI?",defaultInput:"What is the latest news about AI?",bodyKey:"query",defaultResponse:`{
2
2
  "results": [
3
3
  { "title": "...", "url": "...", "snippet": "..." }
4
4
  ]
@@ -21,7 +21,7 @@
21
21
  "data": [
22
22
  { "url": "...", "format": "mp3" }
23
23
  ]
24
- }`}},E=`{
24
+ }`}},P=`{
25
25
  "object": "list",
26
26
  "data": [{
27
27
  "object": "embedding",
@@ -30,10 +30,10 @@
30
30
  }],
31
31
  "model": "...",
32
32
  "usage": { "prompt_tokens": 9, "total_tokens": 9 }
33
- }`;function P({providerId:e,customAlias:t}){let a=(0,c.gC)(e),r=a?t||e:(0,c.wG)(e),n=a?[]:(0,w.KC)(e).filter(e=>"embedding"===(0,w.CP)(e)),[l,d]=(0,i.useState)(n[0]?.id??""),[m,u]=(0,i.useState)("The quick brown fox jumps over the lazy dog"),[p,x]=(0,i.useState)(""),[h,g]=(0,i.useState)(""),[b,f]=(0,i.useState)(!1),[y,v]=(0,i.useState)(""),[j,k]=(0,i.useState)(""),[S,C]=(0,i.useState)(null),[A,_]=(0,i.useState)(!1),[I,T]=(0,i.useState)(""),{copied:R,copy:L}=(0,N.C)(),{copied:O,copy:M}=(0,N.C)();(0,i.useEffect)(()=>{v(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{g((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&k(e.publicUrl)}).catch(()=>{})},[]);let D=b?j:y,B=l?`${r}/${l}`:"",U=()=>{let e={model:B,input:m.trim()},t=Number(p);return p&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},K=`curl -X POST ${D}/v1/embeddings \\
33
+ }`;function I({providerId:e,customAlias:t}){let a=(0,c.gC)(e),r=a?t||e:(0,c.wG)(e),n=a?[]:(0,N.KC)(e).filter(e=>"embedding"===(0,N.CP)(e)),[l,d]=(0,i.useState)(n[0]?.id??""),[m,u]=(0,i.useState)("The quick brown fox jumps over the lazy dog"),[p,x]=(0,i.useState)(""),[h,g]=(0,i.useState)(""),[b,f]=(0,i.useState)(!1),[y,v]=(0,i.useState)(""),[j,w]=(0,i.useState)(""),[S,C]=(0,i.useState)(null),[$,E]=(0,i.useState)(!1),[_,T]=(0,i.useState)(""),{copied:R,copy:L}=(0,k.C)(),{copied:O,copy:M}=(0,k.C)();(0,i.useEffect)(()=>{v(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{g((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&w(e.publicUrl)}).catch(()=>{})},[]);let D=b?j:y,B=l?`${r}/${l}`:"",U=()=>{let e={model:B,input:m.trim()},t=Number(p);return p&&Number.isFinite(t)&&t>0&&(e.dimensions=t),e},K=`curl -X POST ${D}/v1/embeddings \\
34
34
  -H "Content-Type: application/json" \\
35
35
  -H "Authorization: Bearer ${h||"YOUR_KEY"}" \\
36
- -d '${JSON.stringify(U())}'`,F=async()=>{if(!m.trim()||!B)return;_(!0),T(""),C(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let a=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(U())}),s=Date.now()-e,r=await a.json();if(!a.ok)return void T(r?.error?.message||r?.error||`HTTP ${a.status}`);C({data:r,latencyMs:s})}catch(e){T(e.message||"Network error")}finally{_(!1)}},q=S?JSON.stringify(S.data,null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)($,{label:"Model",children:a?(0,s.jsx)("input",{value:l,onChange:e=>d(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,s.jsx)("select",{value:l,onChange:e=>d(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:n.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:D,onChange:e=>b?k(e.target.value):v(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"}),j&&(0,s.jsxs)("button",{onClick:()=>f(e=>!e),title:b?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${b?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)($,{label:"API Key",children:(0,s.jsx)("input",{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:"sk-...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)($,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:m,onChange:e=>u(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,s.jsx)("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)($,{label:"Dimensions",children:(0,s.jsx)("input",{type:"number",min:"1",value:p,onChange:e=>x(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>L(K),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:R?"check":"content_copy"}),R?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:F,disabled:A||!m.trim()||!B,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:A?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),A?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:K})]}),I&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:I}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",S&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",S.latencyMs,"ms"]})]}),S&&(0,s.jsxs)("button",{onClick:()=>M(q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:O?"check":"content_copy"}),O?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return E;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(S?.data)})]})]})]})}var _=a(73006),I=a(63935),T=a(14683),R=a(28915);let L="clips",O=null;async function M(e,t){let a=await (!O&&(O=new Promise((e,t)=>{if("u"<typeof indexedDB)return void t(Error("IndexedDB unavailable"));let a=indexedDB.open("9router-tts-history",2);a.onupgradeneeded=()=>{let e=a.result,t=e.objectStoreNames.contains(L)?a.transaction.objectStore(L):e.createObjectStore(L,{keyPath:"id"});t.indexNames.contains("createdAt")||t.createIndex("createdAt","createdAt"),t.indexNames.contains("provider")||t.createIndex("provider","provider")},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)}).catch(e=>{throw O=null,e})),O);return new Promise((s,r)=>{let n,l=a.transaction(L,e),i=t(l.objectStore(L));i&&(i.onsuccess=()=>{n=i.result}),l.oncomplete=()=>s(n),l.onerror=()=>r(l.error),l.onabort=()=>r(l.error)})}let D=[{code:"en",name:"English"},{code:"vi",name:"Tiếng Việt"},{code:"zh",name:"中文 (Chinese)"},{code:"ja",name:"日本語 (Japanese)"},{code:"ko",name:"한국어 (Korean)"},{code:"es",name:"Espa\xf1ol"},{code:"pt",name:"Portugu\xeas"},{code:"fr",name:"Fran\xe7ais"},{code:"de",name:"Deutsch"},{code:"it",name:"Italiano"},{code:"ru",name:"Русский"},{code:"ar",name:"العربية (Arabic)"},{code:"hi",name:"हिन्दी (Hindi)"},{code:"id",name:"Bahasa Indonesia"},{code:"th",name:"ไทย (Thai)"},{code:"tl",name:"Tagalog"},{code:"nl",name:"Nederlands"},{code:"pl",name:"Polski"},{code:"tr",name:"T\xfcrk\xe7e"},{code:"uk",name:"Українська"},{code:"cs",name:"Čeština"},{code:"he",name:"עברית (Hebrew)"},{code:"bn",name:"বাংলা (Bengali)"},{code:"ur",name:"اردو (Urdu)"},{code:"ro",name:"Rom\xe2nă"},{code:"sv",name:"Svenska"},{code:"el",name:"Ελληνικά (Greek)"},{code:"hu",name:"Magyar"},{code:"fi",name:"Suomi"},{code:"da",name:"Dansk"},{code:"no",name:"Norsk"},{code:"sk",name:"Slovenčina"},{code:"hr",name:"Hrvatski"},{code:"ms",name:"Bahasa Melayu"},{code:"ta",name:"தமிழ் (Tamil)"},{code:"bg",name:"Български"}],B=[{label:"Emotions",tags:["[happy]","[excited]","[cheerful]","[energetic]","[calm]","[relaxed]","[soft]","[gentle]","[sad]","[emotional]","[serious]","[dramatic]","[angry]","[frustrated]","[scared]","[nervous]","[confident]","[mysterious]","[sarcastic]","[playful]","[seductive]","[romantic]","[inspirational]","[motivational]","[professional]","[authoritative]","[cinematic]","[epic]","[funny]","[awkward]","[whispering]","[crying]","[shouting]"]},{label:"Delivery",tags:["[laughing]","[chuckles]","[giggles]","[sighs]","[gasping]","[breathing heavily]","[stuttering]","[pausing]","[yelling]","[murmuring]","[speaking fast]","[speaking slowly]","[monotone]","[storytelling]","[conversational]","[announcer style]","[trailer voice]","[podcast tone]","[ASMR style]"]},{label:"Sounds",tags:["haha","hmm","ahh","oh","uh","um","eh","tch","mhm","[gasp]","[sniff]","[sob]","[cough]","[clears throat]","[lip smack]","[exhale]","[inhale]"]}].map(e=>({...e,tags:e.tags.map(e=>({ins:e,label:e.replace(/[[\]]/g,"")}))})),U=B.map(e=>`${e.label}: ${e.tags.map(e=>e.ins).join(", ")}`).join("\n"),K=[{id:"auto",label:"Auto",hint:"Let AI pick the best emotional arc",directive:"Choose whatever emotional arc best fits the content."},{id:"dramatic",label:"Dramatic",hint:"Cinematic, suspenseful, weighty pauses",directive:"Go cinematic and suspenseful: weighty pauses before reveals, low intense tone, building tension, a powerful payoff."},{id:"energetic",label:"Energetic",hint:"Upbeat, fast, hype — great for Shorts",directive:"Go high-energy and hook-driven: punchy emphasis, fast excited pacing, big reactions — ideal for short-form social videos."},{id:"storytelling",label:"Storytelling",hint:"Warm, immersive narrator",directive:"Be a warm, immersive narrator: natural conversational flow, gentle rises and falls, pull the listener into the story."},{id:"asmr",label:"ASMR",hint:"Soft, intimate, whispered",directive:"Keep it soft, slow and intimate: whispered, gentle, calming ASMR delivery."},{id:"funny",label:"Funny",hint:"Playful, comedic timing",directive:"Be playful and comedic: light tone, well-timed laughs and beats, a little exaggeration."}],F=e=>K.find(t=>t.id===e)||K[0],q=({label:e,hint:t,children:a})=>(0,s.jsx)($,{label:e,children:(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[a,(0,s.jsx)("span",{className:"text-[11px] text-text-muted",children:t})]})}),z=e=>`You are a world-class voice-acting director for ElevenLabs Eleven v3 text-to-speech.
36
+ -d '${JSON.stringify(U())}'`,F=async()=>{if(!m.trim()||!B)return;E(!0),T(""),C(null);let e=Date.now();try{let t={"Content-Type":"application/json"};h&&(t.Authorization=`Bearer ${h}`);let a=await fetch("/api/v1/embeddings",{method:"POST",headers:t,body:JSON.stringify(U())}),s=Date.now()-e,r=await a.json();if(!a.ok)return void T(r?.error?.message||r?.error||`HTTP ${a.status}`);C({data:r,latencyMs:s})}catch(e){T(e.message||"Network error")}finally{E(!1)}},q=S?JSON.stringify(S.data,null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(A,{label:"Model",children:a?(0,s.jsx)("input",{value:l,onChange:e=>d(e.target.value),placeholder:"e.g. voyage-3, embed-english-v3.0, text-embedding-3-small",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}):(0,s.jsx)("select",{value:l,onChange:e=>d(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:n.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(A,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("input",{value:D,onChange:e=>b?w(e.target.value):v(e.target.value),className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono",placeholder:"http://localhost:3000"}),j&&(0,s.jsxs)("button",{onClick:()=>f(e=>!e),title:b?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${b?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(A,{label:"API Key",children:(0,s.jsx)("input",{type:"password",value:h,onChange:e=>g(e.target.value),placeholder:"sk-...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(A,{label:"Input",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:m,onChange:e=>u(e.target.value),className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),m&&(0,s.jsx)("button",{type:"button",onClick:()=>u(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),(0,s.jsx)(A,{label:"Dimensions",children:(0,s.jsx)("input",{type:"number",min:"1",value:p,onChange:e=>x(e.target.value),placeholder:"optional, e.g. 512, 1024 (leave empty for default)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>L(K),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:R?"check":"content_copy"}),R?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:F,disabled:$||!m.trim()||!B,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:$?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),$?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:K})]}),_&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:_}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",S&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",S.latencyMs,"ms"]})]}),S&&(0,s.jsxs)("button",{onClick:()=>M(q),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:O?"check":"content_copy"}),O?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:(e=>{if(!e)return P;let t=JSON.parse(JSON.stringify(e));return(t.data||[]).forEach(e=>{Array.isArray(e.embedding)&&e.embedding.length>4&&(e.embedding=[...e.embedding.slice(0,4).map(e=>parseFloat(e.toFixed(6))),`... (${e.embedding.length} dims)`])}),JSON.stringify(t,null,2)})(S?.data)})]})]})]})}var _=a(73006),T=a(63935),R=a(14683),L=a(28915);let O="clips",M=null;async function D(e,t){let a=await (!M&&(M=new Promise((e,t)=>{if("u"<typeof indexedDB)return void t(Error("IndexedDB unavailable"));let a=indexedDB.open("9router-tts-history",2);a.onupgradeneeded=()=>{let e=a.result,t=e.objectStoreNames.contains(O)?a.transaction.objectStore(O):e.createObjectStore(O,{keyPath:"id"});t.indexNames.contains("createdAt")||t.createIndex("createdAt","createdAt"),t.indexNames.contains("provider")||t.createIndex("provider","provider")},a.onsuccess=()=>e(a.result),a.onerror=()=>t(a.error)}).catch(e=>{throw M=null,e})),M);return new Promise((s,r)=>{let n,l=a.transaction(O,e),i=t(l.objectStore(O));i&&(i.onsuccess=()=>{n=i.result}),l.oncomplete=()=>s(n),l.onerror=()=>r(l.error),l.onabort=()=>r(l.error)})}let B=[{code:"en",name:"English"},{code:"vi",name:"Tiếng Việt"},{code:"zh",name:"中文 (Chinese)"},{code:"ja",name:"日本語 (Japanese)"},{code:"ko",name:"한국어 (Korean)"},{code:"es",name:"Espa\xf1ol"},{code:"pt",name:"Portugu\xeas"},{code:"fr",name:"Fran\xe7ais"},{code:"de",name:"Deutsch"},{code:"it",name:"Italiano"},{code:"ru",name:"Русский"},{code:"ar",name:"العربية (Arabic)"},{code:"hi",name:"हिन्दी (Hindi)"},{code:"id",name:"Bahasa Indonesia"},{code:"th",name:"ไทย (Thai)"},{code:"tl",name:"Tagalog"},{code:"nl",name:"Nederlands"},{code:"pl",name:"Polski"},{code:"tr",name:"T\xfcrk\xe7e"},{code:"uk",name:"Українська"},{code:"cs",name:"Čeština"},{code:"he",name:"עברית (Hebrew)"},{code:"bn",name:"বাংলা (Bengali)"},{code:"ur",name:"اردو (Urdu)"},{code:"ro",name:"Rom\xe2nă"},{code:"sv",name:"Svenska"},{code:"el",name:"Ελληνικά (Greek)"},{code:"hu",name:"Magyar"},{code:"fi",name:"Suomi"},{code:"da",name:"Dansk"},{code:"no",name:"Norsk"},{code:"sk",name:"Slovenčina"},{code:"hr",name:"Hrvatski"},{code:"ms",name:"Bahasa Melayu"},{code:"ta",name:"தமிழ் (Tamil)"},{code:"bg",name:"Български"}],U=[{label:"Emotions",tags:["[happy]","[excited]","[cheerful]","[energetic]","[calm]","[relaxed]","[soft]","[gentle]","[sad]","[emotional]","[serious]","[dramatic]","[angry]","[frustrated]","[scared]","[nervous]","[confident]","[mysterious]","[sarcastic]","[playful]","[seductive]","[romantic]","[inspirational]","[motivational]","[professional]","[authoritative]","[cinematic]","[epic]","[funny]","[awkward]","[whispering]","[crying]","[shouting]"]},{label:"Delivery",tags:["[laughing]","[chuckles]","[giggles]","[sighs]","[gasping]","[breathing heavily]","[stuttering]","[pausing]","[yelling]","[murmuring]","[speaking fast]","[speaking slowly]","[monotone]","[storytelling]","[conversational]","[announcer style]","[trailer voice]","[podcast tone]","[ASMR style]"]},{label:"Sounds",tags:["haha","hmm","ahh","oh","uh","um","eh","tch","mhm","[gasp]","[sniff]","[sob]","[cough]","[clears throat]","[lip smack]","[exhale]","[inhale]"]}].map(e=>({...e,tags:e.tags.map(e=>({ins:e,label:e.replace(/[[\]]/g,"")}))})),K=U.map(e=>`${e.label}: ${e.tags.map(e=>e.ins).join(", ")}`).join("\n"),F=[{id:"auto",label:"Auto",hint:"Let AI pick the best emotional arc",directive:"Choose whatever emotional arc best fits the content."},{id:"dramatic",label:"Dramatic",hint:"Cinematic, suspenseful, weighty pauses",directive:"Go cinematic and suspenseful: weighty pauses before reveals, low intense tone, building tension, a powerful payoff."},{id:"energetic",label:"Energetic",hint:"Upbeat, fast, hype — great for Shorts",directive:"Go high-energy and hook-driven: punchy emphasis, fast excited pacing, big reactions — ideal for short-form social videos."},{id:"storytelling",label:"Storytelling",hint:"Warm, immersive narrator",directive:"Be a warm, immersive narrator: natural conversational flow, gentle rises and falls, pull the listener into the story."},{id:"asmr",label:"ASMR",hint:"Soft, intimate, whispered",directive:"Keep it soft, slow and intimate: whispered, gentle, calming ASMR delivery."},{id:"funny",label:"Funny",hint:"Playful, comedic timing",directive:"Be playful and comedic: light tone, well-timed laughs and beats, a little exaggeration."}],q=e=>F.find(t=>t.id===e)||F[0],z=({label:e,hint:t,children:a})=>(0,s.jsx)(A,{label:e,children:(0,s.jsxs)("div",{className:"flex flex-col gap-1.5",children:[a,(0,s.jsx)("span",{className:"text-[11px] text-text-muted",children:t})]})}),J=e=>`You are a world-class voice-acting director for ElevenLabs Eleven v3 text-to-speech.
37
37
  Direct a captivating, emotionally dynamic performance of the user's text by inserting inline audio tags and natural vocal sounds between the existing words.
38
38
 
39
39
  TECHNIQUES (apply tastefully, not on every line):
@@ -48,10 +48,10 @@ VOCAL SOUNDS — this is what makes a read feel human, so actually use them:
48
48
  - Bare sounds (haha, hmm, ahh, oh, uh, eh, mhm) are SPOKEN aloud, so they land as real speech. Put them where a person would genuinely react: before a surprise, mid-realisation, after a joke, on a reluctant admission.
49
49
  - Anything longer than one sentence should carry at least two vocal sounds. Match them to the direction below — laughs for playful, breaths and sighs for dramatic or intimate, hesitation sounds for conversational.
50
50
 
51
- DIRECTION: ${F(e).directive}
51
+ DIRECTION: ${q(e).directive}
52
52
 
53
53
  ALLOWED TAGS — use ONLY these, copied exactly as written:
54
- ${U}
54
+ ${K}
55
55
 
56
56
  HARD RULES:
57
57
  - Keep every original word and the original language EXACTLY — never translate, reword, reorder or delete the user's words.
@@ -63,27 +63,27 @@ EXAMPLE
63
63
  Input: Wait... you're telling me we actually won?
64
64
  Output: [calm] Wait... [gasp] [pausing] [excited] you're telling me we actually won? haha [laughing]
65
65
 
66
- Return ONLY the resulting tagged text.`,V=/\b(flash|mini|haiku|lite|nano|small|turbo|8b|9b)\b/,H=/\b(pro|opus|ultra|max|405b|70b)\b/,J=/(preview|exp|beta)/,W=[{id:"ai-tech",label:"Examine AI tech",icon:"neurology",vibe:"storytelling",stability:.5,text:"[professional] Artificial intelligence is moving faster than ever. [pausing] From voices that sound truly human, to models that reason in real time — [confident] the line between machine and human is blurring. [pausing] So the real question is: are we ready for what comes next?"},{id:"your-voice",label:"Discover your voice",icon:"mic",vibe:"storytelling",stability:.5,text:"[calm] Close your eyes for a second. [pausing] Everyone has a voice — [emotional] a sound that is entirely their own. [confident] Today, you get to discover yours. [excited] So take a breath… and let us begin."},{id:"laugh",label:"Laugh uncontrollably",icon:"sentiment_very_satisfied",vibe:"funny",stability:0,text:"[laughing] Oh my gosh, did you actually just do that? [giggles] I can't— [laughing] I can't breathe! [chuckles] Stop, stop, you're killing me! haha [laughing] this is the funniest thing I have ever seen!"},{id:"dialogue",label:"Construct a dialogue",icon:"forum",vibe:"energetic",stability:.5,text:"[conversational] — Hey, did you hear the news? [excited] We got the job! [happy] — Wait, seriously? [excited] That is incredible! [laughing] — I know, right? [confident] Let us go celebrate."},{id:"memory",label:"Recall a haunting memory",icon:"menu_book",vibe:"dramatic",stability:0,text:"[whispering] I still remember that night. [pausing] [sighs] The hallway was silent… [mysterious] too silent. [nervous] And then I heard it — [dramatic] a voice that was not mine, whispering my name."},{id:"overlap",label:"Overlap speech",icon:"graphic_eq",vibe:"energetic",stability:.5,text:"[speaking fast] No no no, listen— [excited] — but that is exactly what I— [laughing] would you let me finish? [chuckles] — okay, okay, go ahead, [conversational] I am listening."}],G=`// Audio will appear here after running.
66
+ Return ONLY the resulting tagged text.`,V=/\b(flash|mini|haiku|lite|nano|small|turbo|8b|9b)\b/,H=/\b(pro|opus|ultra|max|405b|70b)\b/,W=/(preview|exp|beta)/,G=[{id:"ai-tech",label:"Examine AI tech",icon:"neurology",vibe:"storytelling",stability:.5,text:"[professional] Artificial intelligence is moving faster than ever. [pausing] From voices that sound truly human, to models that reason in real time — [confident] the line between machine and human is blurring. [pausing] So the real question is: are we ready for what comes next?"},{id:"your-voice",label:"Discover your voice",icon:"mic",vibe:"storytelling",stability:.5,text:"[calm] Close your eyes for a second. [pausing] Everyone has a voice — [emotional] a sound that is entirely their own. [confident] Today, you get to discover yours. [excited] So take a breath… and let us begin."},{id:"laugh",label:"Laugh uncontrollably",icon:"sentiment_very_satisfied",vibe:"funny",stability:0,text:"[laughing] Oh my gosh, did you actually just do that? [giggles] I can't— [laughing] I can't breathe! [chuckles] Stop, stop, you're killing me! haha [laughing] this is the funniest thing I have ever seen!"},{id:"dialogue",label:"Construct a dialogue",icon:"forum",vibe:"energetic",stability:.5,text:"[conversational] — Hey, did you hear the news? [excited] We got the job! [happy] — Wait, seriously? [excited] That is incredible! [laughing] — I know, right? [confident] Let us go celebrate."},{id:"memory",label:"Recall a haunting memory",icon:"menu_book",vibe:"dramatic",stability:0,text:"[whispering] I still remember that night. [pausing] [sighs] The hallway was silent… [mysterious] too silent. [nervous] And then I heard it — [dramatic] a voice that was not mine, whispering my name."},{id:"overlap",label:"Overlap speech",icon:"graphic_eq",vibe:"energetic",stability:.5,text:"[speaking fast] No no no, listen— [excited] — but that is exactly what I— [laughing] would you let me finish? [chuckles] — okay, okay, go ahead, [conversational] I am listening."}],Y=`// Audio will appear here after running.
67
67
  // Example JSON response (response_format=json):
68
68
  {
69
69
  "format": "mp3",
70
70
  "audio": "//NExAANaAIIAUAAANNNNNNNN..." // base64 encoded MP3
71
- }`,Y=[{key:"play",icon:"play_arrow",title:"Play"},{key:"reuse",icon:"refresh",title:"Reuse"},{key:"download",icon:"download",title:"Download"},{key:"delete",icon:"close",title:"Delete",danger:!0}];function X({providerId:e}){let t,a,r=(0,c.wG)(e),n="elevenlabs"===e,l=p[e]||p["edge-tts"],[d,m]=(0,i.useState)(l.defaultVoiceId||""),[x,h]=(0,i.useState)(""),[g,b]=(0,i.useState)(l.defaultVoiceId||""),[f,y]=(0,i.useState)([]),[v,j]=(0,i.useState)(""),[k,S]=(0,i.useState)(()=>{let t=c.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(l.hasModelSelector&&l.modelKey){let e=(0,w.KC)(l.modelKey);return e?.[0]?.id||""}return""}),[C,A]=(0,i.useState)("Hello, this is a text to speech test."),[E,P]=(0,i.useState)(""),[L,O]=(0,i.useState)(""),[U,Q]=(0,i.useState)(!1),[Z,ee]=(0,i.useState)(""),[et,ea]=(0,i.useState)(""),[es,er]=(0,i.useState)("mp3"),[en,el]=(0,i.useState)(.5),[ei,eo]=(0,i.useState)(1),[ed,ec]=(0,i.useState)(""),[em,eu]=(0,i.useState)(!1),[ep,ex]=(0,i.useState)("vi"),[eh,eg]=(0,i.useState)(""),[eb,ef]=(0,i.useState)(null),[ey,ev]=(0,i.useState)(!1),[ej,ew]=(0,i.useState)(!1),[eN,ek]=(0,i.useState)("auto"),[eS,eC]=(0,i.useState)(!1),e$=(0,i.useRef)(null),[eA,eE]=(0,i.useState)(""),eP=(0,i.useRef)(null),e_=(0,i.useRef)(null),eI=(0,i.useRef)(null),[eT,eR]=(0,i.useState)([]),eL=()=>{M("readonly",t=>e?t.index("provider").getAll(e):t.getAll()).then(e=>(e||[]).sort((e,t)=>t.createdAt-e.createdAt)).then(eR).catch(()=>{})};(0,i.useEffect)(()=>{eL()},[e]),(0,i.useEffect)(()=>{if(!eS)return;let e=e=>{e$.current&&!e$.current.contains(e.target)&&eC(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[eS]);let[eO,eM]=(0,i.useState)(null),{copied:eD,copy:eB}=(0,N.C)(),[eU,eK]=(0,i.useState)(!1),[eF,eq]=(0,i.useState)([]),[ez,eV]=(0,i.useState)(!1),[eH,eJ]=(0,i.useState)(""),[eW,eG]=(0,i.useState)(""),[eY,eX]=(0,i.useState)({}),[eQ,eZ]=(0,i.useState)(""),[e0,e1]=(0,i.useState)(0);(0,i.useEffect)(()=>{if(ee(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{O((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(t=>{e1((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive).length)}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&ea(e.publicUrl)}).catch(()=>{}),"hardcoded"===l.voiceSource){let t=l.hasModelSelector&&l.modelKey&&(0,w.KC)(l.modelKey)?.[0]?.id||"",a=l.voicesPerModel&&t?(0,I.jY)(e,t)||[]:(0,w.KC)(l.voiceKey||e).filter(e=>"tts"===(0,w.CP)(e));if(a.length)if(l.hasBrowseButton){let e=a.find(e=>"en"===e.id)||a[0];j(e.id),m(e.id),h(e.name),y([{id:e.id,name:e.name}])}else y(a),m(a[0].id),h(a[0].name||a[0].id)}},[e]),(0,i.useEffect)(()=>{if(!l.voicesPerModel||!k)return;let t=(0,I.jY)(e,k)||[];y(t),t.length?(m(t[0].id),h(t[0].name||t[0].id)):(m(""),h(""))},[k]);let e5=async()=>{if(eK(!0),eJ(""),eG(""),!eF.length){eV(!0);try{if("hardcoded"===l.voiceSource){let t=l.voiceKey||e,a=(0,w.KC)(t).filter(e=>"tts"===(0,w.CP)(e)),s={};for(let e of a)s[e.id]||(s[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});eX(s),eq(Object.values(s).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=l.apiEndpoint?l.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,a=await fetch(t),s=await a.json();if(s.error)return void eG(s.error);eq(s.languages||[]),eX(s.byLang||{})}}catch(e){eG(e.message)}finally{eV(!1)}}},e2=eH?eF.filter(e=>e.name.toLowerCase().includes(eH.toLowerCase())||e.code.toLowerCase().includes(eH.toLowerCase())):eF,e3=U?et:Z,e4=l.hasVoiceIdInput&&g||d,e6=l.hasModelSelector&&k&&e4?`${r}/${k}/${e4}`:l.hasModelSelector&&k?`${r}/${k}`:e4?`${r}/${e4}`:"",e7=(0,I.P9)(k),e8=n?e7.maxChars:1/0,e9=C.length>e8,te=n&&"eleven_v3"===k,tt=n&&e7.langCode,ta=n&&e7.classic,ts=F(eN),tr=(t={model:e6,input:C},l.hasLanguageHint&&eQ&&(t.language=eQ),l.hasStyleInput&&E.trim()&&(t.style=E.trim()),n&&(t.stability=en),tt&&em&&ep&&(t.language_code=ep),ta&&1!==ei&&(t.speed=ei),n&&ed&&(t.output_format=ed),t),tn=(0,i.useDeferredValue)(C),tl=`curl -X POST ${e3}/v1/audio/speech${"json"===es?"?response_format=json":""} \\
71
+ }`,X=[{key:"play",icon:"play_arrow",title:"Play"},{key:"reuse",icon:"refresh",title:"Reuse"},{key:"download",icon:"download",title:"Download"},{key:"delete",icon:"close",title:"Delete",danger:!0}];function Q({providerId:e}){let t,a,r=(0,c.wG)(e),n="elevenlabs"===e,l=p[e]||p["edge-tts"],[d,m]=(0,i.useState)(l.defaultVoiceId||""),[x,h]=(0,i.useState)(""),[g,b]=(0,i.useState)(l.defaultVoiceId||""),[f,y]=(0,i.useState)([]),[v,j]=(0,i.useState)(""),[w,S]=(0,i.useState)(()=>{let t=c.Q2[e]?.ttsConfig?.models;if(t?.length)return t[0].id;if(l.hasModelSelector&&l.modelKey){let e=(0,N.KC)(l.modelKey);return e?.[0]?.id||""}return""}),[C,$]=(0,i.useState)("Hello, this is a text to speech test."),[E,P]=(0,i.useState)(""),[I,O]=(0,i.useState)(""),[M,K]=(0,i.useState)(!1),[Z,ee]=(0,i.useState)(""),[et,ea]=(0,i.useState)(""),[es,er]=(0,i.useState)("mp3"),[en,el]=(0,i.useState)(.5),[ei,eo]=(0,i.useState)(1),[ed,ec]=(0,i.useState)(""),[em,eu]=(0,i.useState)(!1),[ep,ex]=(0,i.useState)("vi"),[eh,eg]=(0,i.useState)(""),[eb,ef]=(0,i.useState)(null),[ey,ev]=(0,i.useState)(!1),[ej,ew]=(0,i.useState)(!1),[eN,ek]=(0,i.useState)("auto"),[eS,eC]=(0,i.useState)(!1),e$=(0,i.useRef)(null),[eA,eE]=(0,i.useState)(""),eP=(0,i.useRef)(null),eI=(0,i.useRef)(null),e_=(0,i.useRef)(null),[eT,eR]=(0,i.useState)([]),eL=()=>{D("readonly",t=>e?t.index("provider").getAll(e):t.getAll()).then(e=>(e||[]).sort((e,t)=>t.createdAt-e.createdAt)).then(eR).catch(()=>{})};(0,i.useEffect)(()=>{eL()},[e]),(0,i.useEffect)(()=>{if(!eS)return;let e=e=>{e$.current&&!e$.current.contains(e.target)&&eC(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[eS]);let[eO,eM]=(0,i.useState)(null),{copied:eD,copy:eB}=(0,k.C)(),[eU,eK]=(0,i.useState)(!1),[eF,eq]=(0,i.useState)([]),[ez,eJ]=(0,i.useState)(!1),[eV,eH]=(0,i.useState)(""),[eW,eG]=(0,i.useState)(""),[eY,eX]=(0,i.useState)({}),[eQ,eZ]=(0,i.useState)(""),[e0,e1]=(0,i.useState)(0);(0,i.useEffect)(()=>{if(ee(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{O((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/providers",{cache:"no-store"}).then(e=>e.json()).then(t=>{e1((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive).length)}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&ea(e.publicUrl)}).catch(()=>{}),"hardcoded"===l.voiceSource){let t=l.hasModelSelector&&l.modelKey&&(0,N.KC)(l.modelKey)?.[0]?.id||"",a=l.voicesPerModel&&t?(0,T.jY)(e,t)||[]:(0,N.KC)(l.voiceKey||e).filter(e=>"tts"===(0,N.CP)(e));if(a.length)if(l.hasBrowseButton){let e=a.find(e=>"en"===e.id)||a[0];j(e.id),m(e.id),h(e.name),y([{id:e.id,name:e.name}])}else y(a),m(a[0].id),h(a[0].name||a[0].id)}},[e]),(0,i.useEffect)(()=>{if(!l.voicesPerModel||!w)return;let t=(0,T.jY)(e,w)||[];y(t),t.length?(m(t[0].id),h(t[0].name||t[0].id)):(m(""),h(""))},[w]);let e5=async()=>{if(eK(!0),eH(""),eG(""),!eF.length){eJ(!0);try{if("hardcoded"===l.voiceSource){let t=l.voiceKey||e,a=(0,N.KC)(t).filter(e=>"tts"===(0,N.CP)(e)),s={};for(let e of a)s[e.id]||(s[e.id]={code:e.id,name:e.name,voices:[{id:e.id,name:e.name}]});eX(s),eq(Object.values(s).sort((e,t)=>e.name.localeCompare(t.name)))}else{let t=l.apiEndpoint?l.apiEndpoint:`/api/media-providers/tts/voices?provider=${"local-device"===e?"local-device":"edge-tts"}`,a=await fetch(t),s=await a.json();if(s.error)return void eG(s.error);eq(s.languages||[]),eX(s.byLang||{})}}catch(e){eG(e.message)}finally{eJ(!1)}}},e2=eV?eF.filter(e=>e.name.toLowerCase().includes(eV.toLowerCase())||e.code.toLowerCase().includes(eV.toLowerCase())):eF,e3=M?et:Z,e4=l.hasVoiceIdInput&&g||d,e6=l.hasModelSelector&&w&&e4?`${r}/${w}/${e4}`:l.hasModelSelector&&w?`${r}/${w}`:e4?`${r}/${e4}`:"",e7=(0,T.P9)(w),e8=n?e7.maxChars:1/0,e9=C.length>e8,te=n&&"eleven_v3"===w,tt=n&&e7.langCode,ta=n&&e7.classic,ts=q(eN),tr=(t={model:e6,input:C},l.hasLanguageHint&&eQ&&(t.language=eQ),l.hasStyleInput&&E.trim()&&(t.style=E.trim()),n&&(t.stability=en),tt&&em&&ep&&(t.language_code=ep),ta&&1!==ei&&(t.speed=ei),n&&ed&&(t.output_format=ed),t),tn=(0,i.useDeferredValue)(C),tl=`curl -X POST ${e3}/v1/audio/speech${"json"===es?"?response_format=json":""} \\
72
72
  -H "Content-Type: application/json" \\
73
- -H "Authorization: Bearer ${L||"YOUR_KEY"}" \\
73
+ -H "Authorization: Bearer ${I||"YOUR_KEY"}" \\
74
74
  -d '${JSON.stringify({...tr,input:tn})}' \\
75
- ${"json"===es?"":"--output speech.mp3"}`;(0,i.useEffect)(()=>{if(null==e_.current||!eP.current)return;let e=e_.current;e_.current=null,eP.current.focus(),eP.current.setSelectionRange(e,e)},[C]),(0,i.useEffect)(()=>{if(eh?.startsWith("blob:"))return()=>URL.revokeObjectURL(eh)},[eh]);let ti=async()=>{if(C.trim()&&!ej){ew(!0),eE("");try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).filter(Boolean);if(!t.length)return void eE("Enhance needs an LLM provider — connect one in Providers first.");let a=t.map(e=>{let t,a;return{id:e,score:(t=(e.includes("/")?e.slice(e.indexOf("/")+1):e).toLowerCase(),a=0,V.test(t)&&(a+=3),H.test(t)&&(a-=3),J.test(t)&&(a-=1),a)}}).sort((e,t)=>t.score-e.score).slice(0,4).map(e=>e.id),s=0,r="";for(let e of a){let t=await fetch("/api/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",...L?{Authorization:`Bearer ${L}`}:{}},body:JSON.stringify({model:e,messages:[{role:"system",content:z(eN)},{role:"user",content:C.trim()}],stream:!1,temperature:.7})}),a=await t.json().catch(()=>({}));if(t.ok){let e=a?.choices?.[0]?.message?.content?.trim();if(e)return void A(e)}s=t.status,r="string"==typeof a?.error?a.error:a?.error?.message||""}eE(429===s?`Every model tried is rate-limited or out of quota (tried ${a.length}). Wait a moment or connect another LLM provider.`:r.slice(0,200)||`Enhance failed (HTTP ${s||"no response"})`)}catch(e){eE(e.message||"Enhance failed")}finally{ew(!1)}}},to=async()=>{if(!C.trim()||!e6||e9)return;ev(!0),eE(""),eg(""),ef(null);let t=Date.now();try{let s,r={"Content-Type":"application/json"};L&&(r.Authorization=`Bearer ${L}`);let l=`/api/v1/audio/speech${"json"===es?"?response_format=json":""}`,i=await fetch(l,{method:"POST",headers:r,body:JSON.stringify({...tr,input:C.trim()})});if(eM(Date.now()-t),!i.ok){let e=await i.json().catch(()=>({}));eE(e?.error?.message||e?.error||`HTTP ${i.status}`);return}if("json"===es){let e=await i.json();ef({format:e.format,audioPreview:e.audio?`${e.audio.substring(0,100)}...`:""});let t=e.format||"mp3";s=await fetch(`data:audio/${t};base64,${e.audio}`).then(e=>e.blob())}else s=await i.blob();eg(URL.createObjectURL(s));try{var a;await (a={id:`${t}-${Math.round(1e6*Math.random())}`,provider:e,model:k||"",voiceId:e4||"",voiceName:x||e4||"",text:C.trim(),stability:n?en:void 0,blob:s,size:s.size,latency:Date.now()-t,createdAt:Date.now()},M("readwrite",e=>{let t,s,r;e.put(a),t=e.index("createdAt").openCursor(null,"prev"),s=0,r=0,t.onsuccess=()=>{let e=t.result;e&&(s+=1,r+=Number(e.value?.size)||0,(s>50||r>0xc800000)&&e.delete(),e.continue())}}).then(()=>a)),eL()}catch{}window.dispatchEvent(new CustomEvent(u,{detail:{provider:e}}))}catch(e){eE(e.message||"Network error")}finally{ev(!1)}},td=async e=>{try{await M("readwrite",t=>{t.delete(e)}),eR(t=>t.filter(t=>t.id!==e))}catch{}},tc=async()=>{if(confirm("Clear all audio history for this provider?"))try{await M("readwrite",t=>{if(!e)return void t.clear();let a=t.index("provider").getAllKeys(e);a.onsuccess=()=>{for(let e of a.result||[])t.delete(e)}}),eL()}catch{}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[e3,"/v1/audio/speech"]}),et&&(0,s.jsxs)("button",{onClick:()=>Q(e=>!e),title:U?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${U?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)($,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:L?`${L.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,L.length-8)))}`:e0>0?(0,s.jsxs)("span",{className:"text-text-muted italic",children:["Using stored key(s) \xb7 ",e0," connection",e0>1?"s":""]}):(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),l.hasModelSelector&&(l.modelKey||(0,w.KC)(e).some(e=>"tts"===(0,w.CP)(e)))&&(0,s.jsx)($,{label:"Model",children:(0,s.jsx)("select",{value:k,onChange:e=>S(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,w.KC)(e).filter(e=>"tts"===(0,w.CP)(e))).length?a:(0,w.KC)(l.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),l.hasLanguageHint&&(0,s.jsx)($,{label:"Language",children:(0,s.jsxs)("select",{value:eQ,onChange:e=>eZ(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),(l.languageOptions||T.I).map(e=>"string"==typeof e?(0,s.jsx)("option",{value:e,children:e},e):(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),l.hasBrowseButton&&(0,s.jsx)($,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:e5,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:v?(0,s.jsx)("span",{className:"text-text-main",children:eF.find(e=>e.code===v)?.name||v}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:e5,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),f.length>0&&(0,s.jsx)($,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:f.map(e=>(0,s.jsxs)("button",{onClick:()=>{m(e.id),h(e.name),l.hasVoiceIdInput&&b(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${d===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.language?` \xb7 ${e.language}`:"",e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),l.hasVoiceIdInput&&(0,s.jsx)($,{label:"Voice ID",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:g,onChange:e=>{b(e.target.value),m(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),g&&(0,s.jsx)("button",{type:"button",onClick:()=>{b(""),m("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),l.hasLanguageDropdown&&(0,s.jsx)($,{label:"Language",children:(0,s.jsx)("select",{value:d,onChange:t=>{let a=(0,w.KC)(e).filter(e=>"tts"===(0,w.CP)(e)).find(e=>e.id===t.target.value);m(t.target.value),h(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,w.KC)(e).filter(e=>"tts"===(0,w.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)($,{label:"Input",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("textarea",{ref:eP,value:C,onChange:e=>A(e.target.value),rows:4,className:`w-full resize-y min-h-[88px] px-3 py-1.5 pr-7 text-sm leading-relaxed border rounded-lg bg-background focus:outline-none ${e9?"border-red-500 focus:border-red-500":"border-border focus:border-primary"}`}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>A(""),title:(0,_.Tl)("Clear input"),className:"absolute right-2 top-2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2 text-[10px]",children:[n&&C.length>0&&(0,s.jsxs)("span",{className:"text-text-muted",title:(0,_.Tl)("Estimate (1 character ≈ 1 credit)"),children:["≈ ",C.length.toLocaleString()," credits"]}),(0,s.jsxs)("span",{className:e9?"text-red-500 font-medium":"text-text-muted",children:[n?`${C.length.toLocaleString()} / ${e8.toLocaleString()}`:C.length," ","characters"]})]}),e9&&(0,s.jsx)("span",{className:"text-[11px] text-red-500",children:"Over the model's character limit — shorten the text or switch model (Flash/Turbo allow 40,000)."})]})}),l.hasStyleInput&&(0,s.jsx)($,{label:(0,_.Tl)("Style"),children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("textarea",{value:E,onChange:e=>P(e.target.value),placeholder:(0,_.Tl)("e.g. a warm, gentle voice, speaking slowly with a British accent"),rows:2,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"}),E&&(0,s.jsx)("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),n&&(0,s.jsx)(q,{label:"Stability",hint:"Voice expressiveness. Creative follows audio tags most closely; Robust is the steadiest but responds least to them.",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[{v:0,name:"Creative",hint:"Expressive and varied — can even sing"},{v:.5,name:"Natural",hint:"Balanced, natural conversation"},{v:1,name:"Robust",hint:"Accurate, stable, predictable"}].map(e=>(0,s.jsx)("button",{type:"button",title:(0,_.Tl)(e.hint),onClick:()=>el(e.v),className:`px-3 py-1 rounded-lg text-xs border transition-colors ${en===e.v?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:e.name},e.v))})}),ta&&(0,s.jsx)(q,{label:"Speed",hint:"Playback rate, 0.70\xd7 to 1.20\xd7. Values far from 1 can affect quality.",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"range",min:"0.7",max:"1.2",step:"0.05",value:ei,onChange:e=>eo(Number(e.target.value)),className:"w-40 accent-primary"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[ei.toFixed(2),"\xd7"]}),1!==ei&&(0,s.jsx)("button",{type:"button",onClick:()=>eo(1),className:"text-[11px] text-text-muted hover:text-primary transition-colors",children:(0,_.Tl)("Reset")})]})}),n&&(0,s.jsx)(q,{label:"Audio Quality",hint:"Higher MP3 bitrates and PCM require a paid plan; \xb5-law 8 kHz is for telephony.",children:(0,s.jsxs)("select",{value:ed,onChange:e=>ec(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Provider default (MP3 44.1 kHz 128 kbps)"}),I.RB.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})}),tt&&(0,s.jsx)(q,{label:"Language Override",hint:"Off: the model auto-detects the language. On: force the chosen language (best with Eleven v3).",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)(o.lM,{size:"sm",checked:em,onChange:eu}),em&&(0,s.jsx)("select",{value:ep,onChange:e=>ex(e.target.value),className:"px-2 py-1 text-xs border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:D.map(e=>(0,s.jsxs)("option",{value:e.code,children:[e.name," (",e.code,")"]},e.code))})]})}),te&&(0,s.jsx)($,{label:"Get started",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:W.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{A(e.text),el(e.stability),ek(e.vibe),requestAnimationFrame(()=>{let t=eP.current;t&&(t.focus(),t.setSelectionRange(e.text.length,e.text.length))})},className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-xs text-text-main hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:e.icon}),e.label]},e.id))})}),te&&(0,s.jsx)($,{label:"Audio Tags",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[B.map(e=>(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-wider",children:e.label}),(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:e.tags.map(e=>(0,s.jsx)("button",{type:"button",title:e.ins,onClick:()=>{var t;let a,s,r,n,l,i,o,d,c;return t=e.ins,r=(s=(a=eP.current)&&"number"==typeof a.selectionStart)?a.selectionStart:C.length,n=s?a.selectionEnd:C.length,l=C.slice(0,r),i=C.slice(n),o=l&&!/\s$/.test(l)?" ":"",d=i&&!/^\s/.test(i)?" ":"",void(e_.current=r+(c=`${o}${t}${d}`).length,A(l+c+i))},className:"px-2 py-0.5 rounded-full text-[11px] border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:e.label},e.ins))})]},e.label)),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("button",{type:"button",onClick:ti,disabled:ej||!C.trim(),className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-lg border border-primary/40 bg-primary/10 text-primary text-xs font-medium hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:ej?{animation:"spin 1s linear infinite"}:void 0,children:ej?"progress_activity":"auto_awesome"}),ej?"Enhancing…":"Enhance with AI"]}),(0,s.jsxs)("div",{ref:e$,className:"relative",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>eC(e=>!e),disabled:ej,title:(0,_.Tl)("Performance style the AI should aim for"),className:"inline-flex items-center gap-1.5 pl-2 pr-1.5 py-1 text-xs font-medium rounded-lg border border-primary/40 bg-primary/5 text-primary hover:bg-primary/10 focus:outline-none transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary/70",children:"tune"}),ts.label,(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] text-primary/70 transition-transform ${eS?"rotate-180":""}`,children:"expand_more"})]}),eS&&(0,s.jsx)("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-52 rounded-xl border border-border bg-bg shadow-lg overflow-hidden py-1",children:K.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{ek(e.id),eC(!1)},className:`w-full text-left px-3 py-1.5 transition-colors ${eN===e.id?"bg-primary/10":"hover:bg-sidebar"}`,children:[(0,s.jsxs)("span",{className:`flex items-center gap-1.5 text-xs font-medium ${eN===e.id?"text-primary":"text-text-main"}`,children:[eN===e.id&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check"}),e.label]}),(0,s.jsx)("span",{className:"block text-[10px] text-text-muted mt-0.5",children:e.hint})]},e.id))})]})]}),(0,s.jsx)("span",{className:"text-[11px] text-text-muted",children:"Click a tag to insert it, or let AI add tags automatically (uses your configured LLM via 9router)."})]})}),(0,s.jsx)($,{label:"Output Format",children:(0,s.jsxs)("select",{value:es,onChange:e=>er(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>eB(tl),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eD?"check":"content_copy"}),eD?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:to,disabled:ey||!C.trim()||!e6||e9,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:ey?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),ey?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:tl})]}),eA&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:eA}),eh?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",eO&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",eO,"ms"]})]}),(0,s.jsxs)("a",{href:eh,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{ref:eI,controls:!0,src:eh,className:"w-full"}),eb&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:eb.format,audio:eb.audioPreview},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:G})]}),eT.length>0&&(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["History ",(0,s.jsxs)("span",{className:"font-normal normal-case",children:["(",eT.length,")"]})]}),(0,s.jsxs)("button",{onClick:tc,className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-red-500 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete_sweep"}),"Clear all"]})]}),(0,s.jsx)("div",{className:"flex flex-col gap-1.5 max-h-72 overflow-y-auto",children:eT.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-2 rounded-lg border border-border bg-sidebar/50",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-xs text-text-main truncate",title:e.text,children:e.text}),(0,s.jsxs)("p",{className:"text-[10px] text-text-muted truncate",children:[e.voiceName||e.voiceId||"—",e.model?` \xb7 ${e.model}`:"",` \xb7 ${(0,R.gs)(e.createdAt)}`]})]}),(0,s.jsx)("div",{className:"flex items-center gap-0.5 shrink-0",children:Y.map(t=>(0,s.jsx)("button",{onClick:()=>((e,t)=>{if("play"===e)return void(t?.blob&&(ef(null),eg(URL.createObjectURL(t.blob)),requestAnimationFrame(()=>{eI.current?.play().catch(()=>{})})));if("reuse"===e)return void(A(t.text),t.voiceId&&(m(t.voiceId),l.hasVoiceIdInput&&b(t.voiceId)),t.voiceName&&h(t.voiceName),t.model&&l.hasModelSelector&&S(t.model),"number"==typeof t.stability&&el(t.stability));if("download"===e){let e,a;return e=URL.createObjectURL(t.blob),void((a=document.createElement("a")).href=e,a.download=`speech-${t.createdAt}.mp3`,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(e),1e3))}return td(t.id)})(t.key,e),title:(0,_.Tl)(t.title),className:`p-1 rounded text-text-muted transition-colors ${t.danger?"hover:text-red-500":"hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:t.icon})},t.key))})]},e.id))})]})]})]}),eU&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>eK(!1),children:(0,s.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>eK(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,value:eH,onChange:e=>eJ(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[eW&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:eW}),ez?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[e2.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return eK(!1),j(e.code),void(y(t=eY[e.code]?.voices||[]),t.length&&(m(t[0].id),h(t[0].name),l.hasVoiceIdInput&&b(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${v===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),v===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===e2.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let Q="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png",Z=new Set(["antigravity/gemini-3.1-flash-image","codex/gpt-5.5-image","codex/gpt-5.4-image","codex/gpt-5.3-image"]);function ee(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function et(e){if("string"!=typeof e||!e.startsWith("data:image/"))return e;let t=e.indexOf(","),a=e.indexOf(";"),s=a>5?e.slice(5,a):"image",r=t>=0?e.length-t-1:e.length;return`<${s} base64 hidden: ${r.toLocaleString("en-US")} chars>`}function ea({method:e,endpoint:t,apiPath:a,headers:s,body:r,wantBinary:n}){return`curl -X ${e} ${t}${a} \\
75
+ ${"json"===es?"":"--output speech.mp3"}`;(0,i.useEffect)(()=>{if(null==eI.current||!eP.current)return;let e=eI.current;eI.current=null,eP.current.focus(),eP.current.setSelectionRange(e,e)},[C]),(0,i.useEffect)(()=>{if(eh?.startsWith("blob:"))return()=>URL.revokeObjectURL(eh)},[eh]);let ti=async()=>{if(C.trim()&&!ej){ew(!0),eE("");try{let e=await fetch("/api/v1/models"),t=((await e.json()).data||[]).map(e=>e.id).filter(Boolean);if(!t.length)return void eE("Enhance needs an LLM provider — connect one in Providers first.");let a=t.map(e=>{let t,a;return{id:e,score:(t=(e.includes("/")?e.slice(e.indexOf("/")+1):e).toLowerCase(),a=0,V.test(t)&&(a+=3),H.test(t)&&(a-=3),W.test(t)&&(a-=1),a)}}).sort((e,t)=>t.score-e.score).slice(0,4).map(e=>e.id),s=0,r="";for(let e of a){let t=await fetch("/api/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",...I?{Authorization:`Bearer ${I}`}:{}},body:JSON.stringify({model:e,messages:[{role:"system",content:J(eN)},{role:"user",content:C.trim()}],stream:!1,temperature:.7})}),a=await t.json().catch(()=>({}));if(t.ok){let e=a?.choices?.[0]?.message?.content?.trim();if(e)return void $(e)}s=t.status,r="string"==typeof a?.error?a.error:a?.error?.message||""}eE(429===s?`Every model tried is rate-limited or out of quota (tried ${a.length}). Wait a moment or connect another LLM provider.`:r.slice(0,200)||`Enhance failed (HTTP ${s||"no response"})`)}catch(e){eE(e.message||"Enhance failed")}finally{ew(!1)}}},to=async()=>{if(!C.trim()||!e6||e9)return;ev(!0),eE(""),eg(""),ef(null);let t=Date.now();try{let s,r={"Content-Type":"application/json"};I&&(r.Authorization=`Bearer ${I}`);let l=`/api/v1/audio/speech${"json"===es?"?response_format=json":""}`,i=await fetch(l,{method:"POST",headers:r,body:JSON.stringify({...tr,input:C.trim()})});if(eM(Date.now()-t),!i.ok){let e=await i.json().catch(()=>({}));eE(e?.error?.message||e?.error||`HTTP ${i.status}`);return}if("json"===es){let e=await i.json();ef({format:e.format,audioPreview:e.audio?`${e.audio.substring(0,100)}...`:""});let t=e.format||"mp3";s=await fetch(`data:audio/${t};base64,${e.audio}`).then(e=>e.blob())}else s=await i.blob();eg(URL.createObjectURL(s));try{var a;await (a={id:`${t}-${Math.round(1e6*Math.random())}`,provider:e,model:w||"",voiceId:e4||"",voiceName:x||e4||"",text:C.trim(),stability:n?en:void 0,blob:s,size:s.size,latency:Date.now()-t,createdAt:Date.now()},D("readwrite",e=>{let t,s,r;e.put(a),t=e.index("createdAt").openCursor(null,"prev"),s=0,r=0,t.onsuccess=()=>{let e=t.result;e&&(s+=1,r+=Number(e.value?.size)||0,(s>50||r>0xc800000)&&e.delete(),e.continue())}}).then(()=>a)),eL()}catch{}window.dispatchEvent(new CustomEvent(u,{detail:{provider:e}}))}catch(e){eE(e.message||"Network error")}finally{ev(!1)}},td=async e=>{try{await D("readwrite",t=>{t.delete(e)}),eR(t=>t.filter(t=>t.id!==e))}catch{}},tc=async()=>{if(confirm("Clear all audio history for this provider?"))try{await D("readwrite",t=>{if(!e)return void t.clear();let a=t.index("provider").getAllKeys(e);a.onsuccess=()=>{for(let e of a.result||[])t.delete(e)}}),eL()}catch{}};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[(0,s.jsx)(A,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[e3,"/v1/audio/speech"]}),et&&(0,s.jsxs)("button",{onClick:()=>K(e=>!e),title:M?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${M?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(A,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:I?`${I.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,I.length-8)))}`:e0>0?(0,s.jsxs)("span",{className:"text-text-muted italic",children:["Using stored key(s) \xb7 ",e0," connection",e0>1?"s":""]}):(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),l.hasModelSelector&&(l.modelKey||(0,N.KC)(e).some(e=>"tts"===(0,N.CP)(e)))&&(0,s.jsx)(A,{label:"Model",children:(0,s.jsx)("select",{value:w,onChange:e=>S(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:((a=(0,N.KC)(e).filter(e=>"tts"===(0,N.CP)(e))).length?a:(0,N.KC)(l.modelKey)||[]).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),l.hasLanguageHint&&(0,s.jsx)(A,{label:"Language",children:(0,s.jsxs)("select",{value:eQ,onChange:e=>eZ(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto-detect"}),(l.languageOptions||R.I).map(e=>"string"==typeof e?(0,s.jsx)("option",{value:e,children:e},e):(0,s.jsx)("option",{value:e.name,children:e.name},e.id))]})}),l.hasBrowseButton&&(0,s.jsx)(A,{label:"Language",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)("button",{onClick:e5,className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm border border-border rounded-lg bg-background font-mono truncate text-left hover:border-primary/40 transition-colors",children:v?(0,s.jsx)("span",{className:"text-text-main",children:eF.find(e=>e.code===v)?.name||v}):(0,s.jsx)("span",{className:"text-text-muted",children:"No language selected"})}),(0,s.jsxs)("button",{onClick:e5,className:"flex w-full items-center justify-center gap-1 text-xs px-2.5 py-1.5 rounded-lg border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors sm:w-auto sm:shrink-0",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"language"}),"Select language"]})]})}),f.length>0&&(0,s.jsx)(A,{label:"Voice",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:f.map(e=>(0,s.jsxs)("button",{onClick:()=>{m(e.id),h(e.name),l.hasVoiceIdInput&&b(e.id)},className:`px-2.5 py-1 rounded-full text-xs border transition-colors ${d===e.id?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:[e.name,e.language?` \xb7 ${e.language}`:"",e.gender?` \xb7 ${e.gender[0].toUpperCase()}`:"",!0===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-green-500/15 text-green-600 border border-green-500/20",children:"Free"}),!1===e.free_users_allowed&&(0,s.jsx)("span",{className:"ml-1.5 px-1 py-0.5 text-[9px] font-semibold rounded bg-amber-500/15 text-amber-600 border border-amber-500/20",children:"Paid"})]},e.id))})}),l.hasVoiceIdInput&&(0,s.jsx)(A,{label:"Voice ID",children:(0,s.jsx)("div",{className:"flex flex-col gap-1",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:g,onChange:e=>{b(e.target.value),m(e.target.value)},placeholder:"e.g. CwhRBWXzGAHq8TQ4Fs17",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"}),g&&(0,s.jsx)("button",{type:"button",onClick:()=>{b(""),m("")},className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})})}),l.hasLanguageDropdown&&(0,s.jsx)(A,{label:"Language",children:(0,s.jsx)("select",{value:d,onChange:t=>{let a=(0,N.KC)(e).filter(e=>"tts"===(0,N.CP)(e)).find(e=>e.id===t.target.value);m(t.target.value),h(a?.name||t.target.value)},className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(0,N.KC)(e).filter(e=>"tts"===(0,N.CP)(e)).map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}),(0,s.jsx)(A,{label:"Input",children:(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("textarea",{ref:eP,value:C,onChange:e=>$(e.target.value),rows:4,className:`w-full resize-y min-h-[88px] px-3 py-1.5 pr-7 text-sm leading-relaxed border rounded-lg bg-background focus:outline-none ${e9?"border-red-500 focus:border-red-500":"border-border focus:border-primary"}`}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>$(""),title:(0,_.Tl)("Clear input"),className:"absolute right-2 top-2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("div",{className:"flex items-center justify-end gap-2 text-[10px]",children:[n&&C.length>0&&(0,s.jsxs)("span",{className:"text-text-muted",title:(0,_.Tl)("Estimate (1 character ≈ 1 credit)"),children:["≈ ",C.length.toLocaleString()," credits"]}),(0,s.jsxs)("span",{className:e9?"text-red-500 font-medium":"text-text-muted",children:[n?`${C.length.toLocaleString()} / ${e8.toLocaleString()}`:C.length," ","characters"]})]}),e9&&(0,s.jsx)("span",{className:"text-[11px] text-red-500",children:"Over the model's character limit — shorten the text or switch model (Flash/Turbo allow 40,000)."})]})}),l.hasStyleInput&&(0,s.jsx)(A,{label:(0,_.Tl)("Style"),children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("textarea",{value:E,onChange:e=>P(e.target.value),placeholder:(0,_.Tl)("e.g. a warm, gentle voice, speaking slowly with a British accent"),rows:2,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"}),E&&(0,s.jsx)("button",{type:"button",onClick:()=>P(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),n&&(0,s.jsx)(z,{label:"Stability",hint:"Voice expressiveness. Creative follows audio tags most closely; Robust is the steadiest but responds least to them.",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:[{v:0,name:"Creative",hint:"Expressive and varied — can even sing"},{v:.5,name:"Natural",hint:"Balanced, natural conversation"},{v:1,name:"Robust",hint:"Accurate, stable, predictable"}].map(e=>(0,s.jsx)("button",{type:"button",title:(0,_.Tl)(e.hint),onClick:()=>el(e.v),className:`px-3 py-1 rounded-lg text-xs border transition-colors ${en===e.v?"bg-primary/15 border-primary/40 text-primary font-medium":"border-border text-text-muted hover:text-primary hover:border-primary/40"}`,children:e.name},e.v))})}),ta&&(0,s.jsx)(z,{label:"Speed",hint:"Playback rate, 0.70\xd7 to 1.20\xd7. Values far from 1 can affect quality.",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("input",{type:"range",min:"0.7",max:"1.2",step:"0.05",value:ei,onChange:e=>eo(Number(e.target.value)),className:"w-40 accent-primary"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted tabular-nums",children:[ei.toFixed(2),"\xd7"]}),1!==ei&&(0,s.jsx)("button",{type:"button",onClick:()=>eo(1),className:"text-[11px] text-text-muted hover:text-primary transition-colors",children:(0,_.Tl)("Reset")})]})}),n&&(0,s.jsx)(z,{label:"Audio Quality",hint:"Higher MP3 bitrates and PCM require a paid plan; \xb5-law 8 kHz is for telephony.",children:(0,s.jsxs)("select",{value:ed,onChange:e=>ec(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Provider default (MP3 44.1 kHz 128 kbps)"}),T.RB.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name},e.id))]})}),tt&&(0,s.jsx)(z,{label:"Language Override",hint:"Off: the model auto-detects the language. On: force the chosen language (best with Eleven v3).",children:(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsx)(o.lM,{size:"sm",checked:em,onChange:eu}),em&&(0,s.jsx)("select",{value:ep,onChange:e=>ex(e.target.value),className:"px-2 py-1 text-xs border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:B.map(e=>(0,s.jsxs)("option",{value:e.code,children:[e.name," (",e.code,")"]},e.code))})]})}),te&&(0,s.jsx)(A,{label:"Get started",children:(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:G.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{$(e.text),el(e.stability),ek(e.vibe),requestAnimationFrame(()=>{let t=eP.current;t&&(t.focus(),t.setSelectionRange(e.text.length,e.text.length))})},className:"inline-flex items-center gap-1.5 px-2.5 py-1 rounded-lg border border-border text-xs text-text-main hover:text-primary hover:border-primary/40 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted",children:e.icon}),e.label]},e.id))})}),te&&(0,s.jsx)(A,{label:"Audio Tags",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[U.map(e=>(0,s.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,s.jsx)("span",{className:"text-[10px] font-semibold text-text-muted uppercase tracking-wider",children:e.label}),(0,s.jsx)("div",{className:"flex flex-wrap items-center gap-1.5",children:e.tags.map(e=>(0,s.jsx)("button",{type:"button",title:e.ins,onClick:()=>{var t;let a,s,r,n,l,i,o,d,c;return t=e.ins,r=(s=(a=eP.current)&&"number"==typeof a.selectionStart)?a.selectionStart:C.length,n=s?a.selectionEnd:C.length,l=C.slice(0,r),i=C.slice(n),o=l&&!/\s$/.test(l)?" ":"",d=i&&!/^\s/.test(i)?" ":"",void(eI.current=r+(c=`${o}${t}${d}`).length,$(l+c+i))},className:"px-2 py-0.5 rounded-full text-[11px] border border-border text-text-muted hover:text-primary hover:border-primary/40 transition-colors",children:e.label},e.ins))})]},e.label)),(0,s.jsxs)("div",{className:"flex items-center gap-2 flex-wrap",children:[(0,s.jsxs)("button",{type:"button",onClick:ti,disabled:ej||!C.trim(),className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-lg border border-primary/40 bg-primary/10 text-primary text-xs font-medium hover:bg-primary/20 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:ej?{animation:"spin 1s linear infinite"}:void 0,children:ej?"progress_activity":"auto_awesome"}),ej?"Enhancing…":"Enhance with AI"]}),(0,s.jsxs)("div",{ref:e$,className:"relative",children:[(0,s.jsxs)("button",{type:"button",onClick:()=>eC(e=>!e),disabled:ej,title:(0,_.Tl)("Performance style the AI should aim for"),className:"inline-flex items-center gap-1.5 pl-2 pr-1.5 py-1 text-xs font-medium rounded-lg border border-primary/40 bg-primary/5 text-primary hover:bg-primary/10 focus:outline-none transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px] text-primary/70",children:"tune"}),ts.label,(0,s.jsx)("span",{className:`material-symbols-outlined text-[16px] text-primary/70 transition-transform ${eS?"rotate-180":""}`,children:"expand_more"})]}),eS&&(0,s.jsx)("div",{className:"absolute left-0 top-full mt-1 z-50 min-w-52 rounded-xl border border-border bg-bg shadow-lg overflow-hidden py-1",children:F.map(e=>(0,s.jsxs)("button",{type:"button",onClick:()=>{ek(e.id),eC(!1)},className:`w-full text-left px-3 py-1.5 transition-colors ${eN===e.id?"bg-primary/10":"hover:bg-sidebar"}`,children:[(0,s.jsxs)("span",{className:`flex items-center gap-1.5 text-xs font-medium ${eN===e.id?"text-primary":"text-text-main"}`,children:[eN===e.id&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"check"}),e.label]}),(0,s.jsx)("span",{className:"block text-[10px] text-text-muted mt-0.5",children:e.hint})]},e.id))})]})]}),(0,s.jsx)("span",{className:"text-[11px] text-text-muted",children:"Click a tag to insert it, or let AI add tags automatically (uses your configured LLM via 9router)."})]})}),(0,s.jsx)(A,{label:"Output Format",children:(0,s.jsxs)("select",{value:es,onChange:e=>er(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"mp3",children:"MP3 (Binary)"}),(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>eB(tl),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eD?"check":"content_copy"}),eD?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:to,disabled:ey||!C.trim()||!e6||e9,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:ey?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),ey?"Generating...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:tl})]}),eA&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:eA}),eh?(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",eO&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",eO,"ms"]})]}),(0,s.jsxs)("a",{href:eh,download:"speech.mp3",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})]}),(0,s.jsx)("audio",{ref:e_,controls:!0,src:eh,className:"w-full"}),eb&&(0,s.jsxs)("div",{className:"mt-3",children:[(0,s.jsx)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"JSON Response"})}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:JSON.stringify({format:eb.format,audio:eb.audioPreview},null,2)})]})]}):(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Response"}),(0,s.jsx)("pre",{className:"mt-1.5 bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-50",children:Y})]}),eT.length>0&&(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex items-center justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["History ",(0,s.jsxs)("span",{className:"font-normal normal-case",children:["(",eT.length,")"]})]}),(0,s.jsxs)("button",{onClick:tc,className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-red-500 transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"delete_sweep"}),"Clear all"]})]}),(0,s.jsx)("div",{className:"flex flex-col gap-1.5 max-h-72 overflow-y-auto",children:eT.map(e=>(0,s.jsxs)("div",{className:"flex items-center gap-2 px-2.5 py-2 rounded-lg border border-border bg-sidebar/50",children:[(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,s.jsx)("p",{className:"text-xs text-text-main truncate",title:e.text,children:e.text}),(0,s.jsxs)("p",{className:"text-[10px] text-text-muted truncate",children:[e.voiceName||e.voiceId||"—",e.model?` \xb7 ${e.model}`:"",` \xb7 ${(0,L.gs)(e.createdAt)}`]})]}),(0,s.jsx)("div",{className:"flex items-center gap-0.5 shrink-0",children:X.map(t=>(0,s.jsx)("button",{onClick:()=>((e,t)=>{if("play"===e)return void(t?.blob&&(ef(null),eg(URL.createObjectURL(t.blob)),requestAnimationFrame(()=>{e_.current?.play().catch(()=>{})})));if("reuse"===e)return void($(t.text),t.voiceId&&(m(t.voiceId),l.hasVoiceIdInput&&b(t.voiceId)),t.voiceName&&h(t.voiceName),t.model&&l.hasModelSelector&&S(t.model),"number"==typeof t.stability&&el(t.stability));if("download"===e){let e,a;return e=URL.createObjectURL(t.blob),void((a=document.createElement("a")).href=e,a.download=`speech-${t.createdAt}.mp3`,document.body.appendChild(a),a.click(),a.remove(),setTimeout(()=>URL.revokeObjectURL(e),1e3))}return td(t.id)})(t.key,e),title:(0,_.Tl)(t.title),className:`p-1 rounded text-text-muted transition-colors ${t.danger?"hover:text-red-500":"hover:text-primary"}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:t.icon})},t.key))})]},e.id))})]})]})]}),eU&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-end justify-center sm:items-center",style:{backgroundColor:"rgba(0,0,0,0.6)",backdropFilter:"blur(2px)"},onClick:()=>eK(!1),children:(0,s.jsxs)("div",{className:"border border-border rounded-xl shadow-2xl w-full max-w-md mx-4 flex flex-col max-h-[80vh]",style:{backgroundColor:"var(--color-bg)",isolation:"isolate"},onClick:e=>e.stopPropagation(),children:[(0,s.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border shrink-0 rounded-t-xl",children:[(0,s.jsx)("h3",{className:"text-sm font-semibold",children:"Select Language"}),(0,s.jsx)("button",{onClick:()=>eK(!1),className:"text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"px-4 py-2.5 border-b border-border shrink-0",children:(0,s.jsx)("input",{autoFocus:!0,value:eV,onChange:e=>eH(e.target.value),placeholder:"Search language...",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),(0,s.jsxs)("div",{className:"overflow-y-auto flex-1 p-2",children:[eW&&(0,s.jsx)("p",{className:"text-xs text-red-500 px-2 py-1",children:eW}),ez?(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"Loading..."}):(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[e2.map(e=>(0,s.jsxs)("button",{onClick:()=>{let t;return eK(!1),j(e.code),void(y(t=eY[e.code]?.voices||[]),t.length&&(m(t[0].id),h(t[0].name),l.hasVoiceIdInput&&b(t[0].id)))},className:`flex items-center justify-between w-full px-3 py-2 rounded-lg text-left hover:bg-sidebar transition-colors ${v===e.code?"bg-primary/10 text-primary":""}`,children:[(0,s.jsx)("span",{className:"text-sm",children:e.name}),(0,s.jsxs)("div",{className:"flex items-center gap-2 shrink-0",children:[(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[e.voices.length," voices"]}),v===e.code&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"check"})]})]},e.code)),0===e2.length&&(0,s.jsx)("p",{className:"text-xs text-text-muted px-2 py-3",children:"No languages found."})]})]})]})})]})}let Z="https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog.png",ee=new Set(["antigravity/gemini-3.1-flash-image","codex/gpt-5.5-image","codex/gpt-5.4-image","codex/gpt-5.3-image"]);function et(e){let t="string"==typeof e?e.trim():"";return t?/^(data:image\/|https?:\/\/)/i.test(t)?t:`data:image/png;base64,${t}`:""}function ea(e){if("string"!=typeof e||!e.startsWith("data:image/"))return e;let t=e.indexOf(","),a=e.indexOf(";"),s=a>5?e.slice(5,a):"image",r=t>=0?e.length-t-1:e.length;return`<${s} base64 hidden: ${r.toLocaleString("en-US")} chars>`}function es({method:e,endpoint:t,apiPath:a,headers:s,body:r,wantBinary:n}){return`curl -X ${e} ${t}${a} \\
76
76
  ${s.replace(/\\\n /g,"\\\n ")} \\
77
- -d '${JSON.stringify(r)}'${n?" \\\n --output image.png":""}`}function es({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a),n=r===e?a:e,l=c.rj.find(e=>e.id===t),d=A[t],m=d||{},u=(0,w.KC)(e).filter(e=>(0,w.CP)(e)===t),p=new Set(["image","video","music","imageToText"]).has(t),x=p&&0===u.length,[h,g]=(0,i.useState)(u[0]?.id??""),b=u.find(e=>e.id===h),f=`${r}/${h}`,y=!!b?.capabilities?.includes("multiImage")||Z.has(f),v=!!b?.capabilities?.includes("edit")||y,j=!!b?.capabilities?.includes("mask"),[k,S]=(0,i.useState)(m.defaultInput||""),[C,E]=(0,i.useState)(""),[P,_]=(0,i.useState)([]),[I,T]=(0,i.useState)(""),[R,L]=(0,i.useState)(()=>(m.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[O,M]=(0,i.useState)(""),[D,B]=(0,i.useState)(!1),[U,K]=(0,i.useState)(""),[F,q]=(0,i.useState)(""),[z,V]=(0,i.useState)(null),[H,J]=(0,i.useState)(null),[W,G]=(0,i.useState)(null),[Y,X]=(0,i.useState)("json"),[er,en]=(0,i.useState)(""),[el,ei]=(0,i.useState)(!1),[eo,ed]=(0,i.useState)(""),[ec,em]=(0,i.useState)([]),[eu,ep]=(0,i.useState)(""),{copied:ex,copy:eh}=(0,N.C)(),{copied:eg,copy:eb}=(0,N.C)();if((0,i.useEffect)(()=>{K(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{M((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&q(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{em((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!l||!d)return null;let ef=D?F:U,ey=l.endpoint.path,ev=p?h?`${n}/${h}`:x?"":n:n,ej="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===h?{image:Q}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===h?{image:Q,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ew=y?P:P.slice(0,1),eN=[...C.trim()?[C.trim()]:[],...ew.map(e=>e.dataUrl).filter(Boolean)],ek=eN.length>0?eN:ej.image?[ej.image]:[],eS=ek[0]||"",eC=I.trim()||ej.mask_image||"",e$=ee(C.trim()||(0===eN.length?ej.image:"")),eA=ee(eC),eE=Object.entries(R).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),eP={model:ev,[d.bodyKey]:k,...d.extraBody,...eE,...v&&y&&ek.length>1?{images:ek}:{},...v&&(!y||1===ek.length)&&eS?{image:eS}:{},...j&&eC?{mask_image:eC}:{}},e_=async e=>{let t=Array.from(e.target.files||[]).filter(e=>e.type.startsWith("image/"));if(e.target.value="",0===t.length)return;let a=await Promise.all(t.map(async e=>({id:globalThis.crypto?.randomUUID?.()||`ref_${Date.now()}_${Math.random().toString(16).slice(2)}`,name:e.name,dataUrl:await new Promise((t,a)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>a(s.error||Error("Failed to read image")),s.readAsDataURL(e)})})));_(e=>y?[...e,...a]:a.slice(0,1)),y||E("")},eI="image"===t&&"binary"===Y,eT="image"===t&&"codex"===e&&!eI,eR=`${ey}${eI?"?response_format=binary":""}`,eL=`-H "Content-Type: application/json" \\
77
+ -d '${JSON.stringify(r)}'${n?" \\\n --output image.png":""}`}function er({providerId:e,kind:t}){let a=(0,c.wG)(e),r=(0,c.rs)(a),n=r===e?a:e,l=c.rj.find(e=>e.id===t),d=E[t],m=d||{},u=(0,N.KC)(e).filter(e=>(0,N.CP)(e)===t),p=new Set(["image","video","music","imageToText"]).has(t),x=p&&0===u.length,[h,g]=(0,i.useState)(u[0]?.id??""),b=u.find(e=>e.id===h),f=`${r}/${h}`,y=!!b?.capabilities?.includes("multiImage")||ee.has(f),v=!!b?.capabilities?.includes("edit")||y,j=!!b?.capabilities?.includes("mask"),[w,S]=(0,i.useState)(m.defaultInput||""),[C,$]=(0,i.useState)(""),[P,I]=(0,i.useState)([]),[_,T]=(0,i.useState)(""),[R,L]=(0,i.useState)(()=>(m.extraFields||[]).reduce((e,t)=>(e[t.key]=t.default??"",e),{})),[O,M]=(0,i.useState)(""),[D,B]=(0,i.useState)(!1),[U,K]=(0,i.useState)(""),[F,q]=(0,i.useState)(""),[z,J]=(0,i.useState)(null),[V,H]=(0,i.useState)(null),[W,G]=(0,i.useState)(null),[Y,X]=(0,i.useState)("json"),[Q,en]=(0,i.useState)(""),[el,ei]=(0,i.useState)(!1),[eo,ed]=(0,i.useState)(""),[ec,em]=(0,i.useState)([]),[eu,ep]=(0,i.useState)(""),{copied:ex,copy:eh}=(0,k.C)(),{copied:eg,copy:eb}=(0,k.C)();if((0,i.useEffect)(()=>{K(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{M((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&q(e.publicUrl)}).catch(()=>{}),fetch("/api/providers/client").then(e=>e.json()).then(t=>{em((t.connections||[]).filter(t=>t.provider===e&&!1!==t.isActive))}).catch(()=>{})},[e]),!l||!d)return null;let ef=D?F:U,ey=l.endpoint.path,ev=p?h?`${n}/${h}`:x?"":n:n,ej="cloudflare-ai"!==e?{}:"@cf/runwayml/stable-diffusion-v1-5-img2img"===h?{image:Z}:"@cf/runwayml/stable-diffusion-v1-5-inpainting"===h?{image:Z,mask_image:"https://pub-1fb693cb11cc46b2b2f656f51e015a2c.r2.dev/dog-mask.png"}:{},ew=y?P:P.slice(0,1),eN=[...C.trim()?[C.trim()]:[],...ew.map(e=>e.dataUrl).filter(Boolean)],ek=eN.length>0?eN:ej.image?[ej.image]:[],eS=ek[0]||"",eC=_.trim()||ej.mask_image||"",e$=et(C.trim()||(0===eN.length?ej.image:"")),eA=et(eC),eE=Object.entries(R).reduce((e,[t,a])=>(""===a||null==a||"number"==typeof a&&Number.isNaN(a)||(e[t]=a),e),{}),eP={model:ev,[d.bodyKey]:w,...d.extraBody,...eE,...v&&y&&ek.length>1?{images:ek}:{},...v&&(!y||1===ek.length)&&eS?{image:eS}:{},...j&&eC?{mask_image:eC}:{}},eI=async e=>{let t=Array.from(e.target.files||[]).filter(e=>e.type.startsWith("image/"));if(e.target.value="",0===t.length)return;let a=await Promise.all(t.map(async e=>({id:globalThis.crypto?.randomUUID?.()||`ref_${Date.now()}_${Math.random().toString(16).slice(2)}`,name:e.name,dataUrl:await new Promise((t,a)=>{let s=new FileReader;s.onload=()=>t(String(s.result||"")),s.onerror=()=>a(s.error||Error("Failed to read image")),s.readAsDataURL(e)})})));I(e=>y?[...e,...a]:a.slice(0,1)),y||$("")},e_="image"===t&&"binary"===Y,eT="image"===t&&"codex"===e&&!e_,eR=`${ey}${e_?"?response_format=binary":""}`,eL=`-H "Content-Type: application/json" \\
78
78
  -H "Authorization: Bearer ${O||"YOUR_KEY"}"${eu?` \\
79
79
  -H "x-connection-id: ${eu}"`:""}${eT?` \\
80
- -H "Accept: text/event-stream"`:""}`,eO=ea({method:l.endpoint.method,endpoint:ef,apiPath:eR,headers:eL,body:{...eP,...eP.image?{image:et(eP.image)}:{},...Array.isArray(eP.images)?{images:eP.images.map(et)}:{},...eP.mask_image?{mask_image:et(eP.mask_image)}:{}},wantBinary:eI}),eM=async()=>{if(!k.trim()||!ev)return;let e=ek.findIndex(e=>!function(e){let t="string"==typeof e?e.trim():"";if(!t)return!1;if(/^https?:\/\//i.test(t))return!0;let a=t.match(/^data:image\/[^;]+;base64,([\s\S]+)$/i),s=(a?.[1]||t).replace(/\s+/g,"");return s.length>=8&&s.length%4!=1&&/^[A-Za-z0-9+/]+={0,2}$/.test(s)}(e));if(e>=0)return void ed(`Reference image ${e+1} is invalid. Use an image URL or attach an image file.`);if(ei(!0),ed(""),V(null),J(null),G(null),er){try{URL.revokeObjectURL(er)}catch{}en("")}let t=Date.now();try{let e={"Content-Type":"application/json"};O&&(e.Authorization=`Bearer ${O}`),eu&&(e["x-connection-id"]=eu),eT&&(e.Accept="text/event-stream");let a={...eP,model:ev},s=await fetch(`/api${eR}`,{method:l.endpoint.method,headers:e,body:JSON.stringify(a)}),r=s.headers.get("x-connection-id")||"",n=ec.find(e=>e.id===r),i=n?n.email||n.name||n.id.slice(0,8):r?r.slice(0,8):"",o=r?{connectionId:r,connectionLabel:i}:{};if(!s.ok){let e=await s.json().catch(()=>({}));ed(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let d=s.headers.get("content-type")||"";if(d.startsWith("image/")){let e=await s.blob(),a=URL.createObjectURL(e);en(a),V({data:{binary:!0,mime:d,size:e.size},latencyMs:Date.now()-t,...o});return}if(d.includes("text/event-stream")&&s.body){let e=s.body.getReader(),a=new TextDecoder,r="",n=null,l=null;for(;;){let t,{done:s,value:i}=await e.read();if(s)break;for(r+=a.decode(i,{stream:!0});-1!==(t=r.indexOf("\n\n"));){let e=r.slice(0,t);r=r.slice(t+2);let a=null,s="";for(let t of e.split("\n"))t.startsWith("event:")?a=t.slice(6).trim():t.startsWith("data:")&&(s+=t.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?J(e):"partial_image"===a?G(e):"done"===a?n=e:"error"===a&&(l=e?.message||"Stream error")}catch{}}}let i=Date.now()-t;if(l)return void ed(l);n&&V({data:n,latencyMs:i,...o})}else{let e=await s.json(),a=Date.now()-t;V({data:e,latencyMs:a,...o})}}catch(e){ed(e.message||"Network error")}finally{ei(!1)}},eD=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eD);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:eD(s);return t},eB=z?JSON.stringify(eD(z.data),null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[u.length>0?(0,s.jsx)($,{label:"Model",children:(0,s.jsx)("select",{value:h,onChange:e=>g(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:u.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):x?(0,s.jsx)($,{label:"Model",children:(0,s.jsx)("input",{value:h,onChange:e=>g(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ef,ey]}),F&&(0,s.jsxs)("button",{onClick:()=>B(e=>!e),title:D?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${D?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)($,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:O?`${O.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,O.length-8)))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),ec.length>0&&(0,s.jsx)($,{label:"Connection",children:(0,s.jsxs)("select",{value:eu,onChange:e=>ep(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),ec.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)($,{label:d.inputLabel,children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:k,onChange:e=>S(e.target.value),placeholder:d.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),k&&(0,s.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),v&&(0,s.jsx)($,{label:y?"Reference Images":"Ref Image",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:C,onChange:e=>{E(e.target.value),y||_([])},placeholder:ej.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>E(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("label",{className:"flex cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-dashed border-border px-3 py-2 text-xs text-text-muted transition-colors hover:border-primary hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add_photo_alternate"}),y?"Attach one or more images":"Attach image",(0,s.jsx)("input",{type:"file",accept:"image/*",multiple:y,onChange:e_,className:"hidden"})]}),e$&&(0,s.jsx)("img",{src:e$,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"},loading:"lazy",decoding:"async"}),ew.length>0&&(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ew.map(e=>(0,s.jsxs)("div",{className:"group relative overflow-hidden rounded-lg border border-border bg-sidebar",children:[(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover",loading:"lazy",decoding:"async"}),(0,s.jsx)("button",{type:"button",onClick:()=>_(t=>t.filter(t=>t.id!==e.id)),className:"absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded-full bg-black/65 text-white transition hover:bg-black","aria-label":`Remove ${e.name}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"close"})}),(0,s.jsx)("span",{className:"block truncate px-2 py-1.5 text-[11px] text-text-muted",children:e.name})]},e.id))}),y&&ek.length>0&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:1===ek.length?"Request uses image":`Request uses images[] with ${ek.length} references`})]})}),j&&(0,s.jsx)($,{label:"Mask (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:I,onChange:e=>T(e.target.value),placeholder:ej.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),I&&(0,s.jsx)("button",{type:"button",onClick:()=>T(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eA&&(0,s.jsx)("img",{src:eA,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"},loading:"lazy",decoding:"async"})]})}),(d.extraFields||[]).filter(e=>0===u.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,s.jsx)($,{label:e.label,children:"select"===e.type?(0,s.jsx)("select",{value:R[e.key]??"",onChange:t=>L(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{type:"text",value:R[e.key]??"",placeholder:e.placeholder,onChange:t=>L(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{type:"number",value:R[e.key]??"",min:e.min,max:e.max,onChange:t=>L(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)($,{label:"Output Format",children:(0,s.jsxs)("select",{value:Y,onChange:e=>X(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>{eh(ea({method:l.endpoint.method,endpoint:ef,apiPath:eR,headers:eL,body:eP,wantBinary:eI}))},className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ex?"check":"content_copy"}),ex?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eM,disabled:el||!k.trim()||!ev,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:el?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),el?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-lg bg-sidebar px-3 py-2.5 font-mono text-xs text-text-main",children:eO}),(eP.image||eP.images||eP.mask_image)&&(0,s.jsx)("p",{className:"mt-1.5 text-[11px] text-text-muted",children:"Base64 is hidden in the preview. Copy and Run still include the full image payload."})]}),(el||H)&&eT&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:el?{animation:"spin 1s linear infinite"}:void 0,children:el?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[H?.stage||"starting",!el&&H?.bytesReceived?` \xb7 ${(H.bytesReceived/1024).toFixed(1)} KB`:""]})]}),W?.b64_json&&!z&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)("img",{src:`data:image/png;base64,${W.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80",loading:"lazy",decoding:"async"})]}),eo&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:eo}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",z&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",z.latencyMs,"ms",z.connectionLabel?` | account: ${z.connectionLabel}`:""]})]}),z&&(0,s.jsxs)("button",{onClick:()=>eb(eB),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eg?"check":"content_copy"}),eg?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:z?eB:d.defaultResponse}),"image"===t&&(er||z?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:er||(z?.data?.data?.[0]?.b64_json?`data:image/png;base64,${z.data.data[0].b64_json}`:z?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("img",{src:er||(z?.data?.data?.[0]?.b64_json?`data:image/png;base64,${z.data.data[0].b64_json}`:z?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border",loading:"lazy",decoding:"async"})]})]})]})]})}function er({providerId:e}){let t=(0,c.wG)(e),a=(0,w.KC)(e).filter(e=>"stt"===(0,w.CP)(e)),[r,n]=(0,i.useState)([]),l=[...a,...r],[d,m]=(0,i.useState)(a[0]?.id??""),u=l.find(e=>e.id===d),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,i.useState)(null),[g,b]=(0,i.useState)(""),[f,y]=(0,i.useState)(""),[v,j]=(0,i.useState)("json"),[k,S]=(0,i.useState)(""),[C,A]=(0,i.useState)(""),[E,P]=(0,i.useState)(!1),[_,I]=(0,i.useState)(""),[T,R]=(0,i.useState)(""),[L,O]=(0,i.useState)(null),[M,D]=(0,i.useState)(null),[B,U]=(0,i.useState)(!1),[K,F]=(0,i.useState)(""),{copied:q,copy:z}=(0,N.C)(),{copied:V,copy:H}=(0,N.C)();(0,i.useEffect)(()=>{I(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{A((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&R(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{n((e.models||[]).filter(e=>"stt"===(0,w.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let J=E?T:_,W=d?`${t}/${d}`:"",G=`curl -X POST ${J}/v1/audio/transcriptions \\
80
+ -H "Accept: text/event-stream"`:""}`,eO=es({method:l.endpoint.method,endpoint:ef,apiPath:eR,headers:eL,body:{...eP,...eP.image?{image:ea(eP.image)}:{},...Array.isArray(eP.images)?{images:eP.images.map(ea)}:{},...eP.mask_image?{mask_image:ea(eP.mask_image)}:{}},wantBinary:e_}),eM=async()=>{if(!w.trim()||!ev)return;let e=ek.findIndex(e=>!function(e){let t="string"==typeof e?e.trim():"";if(!t)return!1;if(/^https?:\/\//i.test(t))return!0;let a=t.match(/^data:image\/[^;]+;base64,([\s\S]+)$/i),s=(a?.[1]||t).replace(/\s+/g,"");return s.length>=8&&s.length%4!=1&&/^[A-Za-z0-9+/]+={0,2}$/.test(s)}(e));if(e>=0)return void ed(`Reference image ${e+1} is invalid. Use an image URL or attach an image file.`);if(ei(!0),ed(""),J(null),H(null),G(null),Q){try{URL.revokeObjectURL(Q)}catch{}en("")}let t=Date.now();try{let e={"Content-Type":"application/json"};O&&(e.Authorization=`Bearer ${O}`),eu&&(e["x-connection-id"]=eu),eT&&(e.Accept="text/event-stream");let a={...eP,model:ev},s=await fetch(`/api${eR}`,{method:l.endpoint.method,headers:e,body:JSON.stringify(a)}),r=s.headers.get("x-connection-id")||"",n=ec.find(e=>e.id===r),i=n?n.email||n.name||n.id.slice(0,8):r?r.slice(0,8):"",o=r?{connectionId:r,connectionLabel:i}:{};if(!s.ok){let e=await s.json().catch(()=>({}));ed(e?.error?.message||e?.error||`HTTP ${s.status}`);return}let d=s.headers.get("content-type")||"";if(d.startsWith("image/")){let e=await s.blob(),a=URL.createObjectURL(e);en(a),J({data:{binary:!0,mime:d,size:e.size},latencyMs:Date.now()-t,...o});return}if(d.includes("text/event-stream")&&s.body){let e=s.body.getReader(),a=new TextDecoder,r="",n=null,l=null;for(;;){let t,{done:s,value:i}=await e.read();if(s)break;for(r+=a.decode(i,{stream:!0});-1!==(t=r.indexOf("\n\n"));){let e=r.slice(0,t);r=r.slice(t+2);let a=null,s="";for(let t of e.split("\n"))t.startsWith("event:")?a=t.slice(6).trim():t.startsWith("data:")&&(s+=t.slice(5).trim());if(a)try{let e=s?JSON.parse(s):{};"progress"===a?H(e):"partial_image"===a?G(e):"done"===a?n=e:"error"===a&&(l=e?.message||"Stream error")}catch{}}}let i=Date.now()-t;if(l)return void ed(l);n&&J({data:n,latencyMs:i,...o})}else{let e=await s.json(),a=Date.now()-t;J({data:e,latencyMs:a,...o})}}catch(e){ed(e.message||"Network error")}finally{ei(!1)}},eD=e=>{if(!e||"object"!=typeof e)return e;if(Array.isArray(e))return e.map(eD);let t={};for(let[a,s]of Object.entries(e))t[a]="b64_json"===a&&"string"==typeof s&&s.length>100?`<${s.length} chars base64>`:eD(s);return t},eB=z?JSON.stringify(eD(z.data),null,2):"";return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[u.length>0?(0,s.jsx)(A,{label:"Model",children:(0,s.jsx)("select",{value:h,onChange:e=>g(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:u.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):x?(0,s.jsx)(A,{label:"Model",children:(0,s.jsx)("input",{value:h,onChange:e=>g(e.target.value),placeholder:"Enter model id (provider-specific)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}):null,(0,s.jsx)(A,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[ef,ey]}),F&&(0,s.jsxs)("button",{onClick:()=>B(e=>!e),title:D?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${D?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(A,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:O?`${O.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,O.length-8)))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),ec.length>0&&(0,s.jsx)(A,{label:"Connection",children:(0,s.jsxs)("select",{value:eu,onChange:e=>ep(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"",children:"Auto (by priority)"}),ec.map(e=>{let t=e.providerSpecificData?.chatgptPlanType,a=e.email||e.name||e.id.slice(0,8);return(0,s.jsxs)("option",{value:e.id,children:[a,t?` [${t}]`:""]},e.id)})]})}),(0,s.jsx)(A,{label:d.inputLabel,children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:w,onChange:e=>S(e.target.value),placeholder:d.inputPlaceholder,className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),w&&(0,s.jsx)("button",{type:"button",onClick:()=>S(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]})}),v&&(0,s.jsx)(A,{label:y?"Reference Images":"Ref Image",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:C,onChange:e=>{$(e.target.value),y||I([])},placeholder:ej.image||"https://example.com/source.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),C&&(0,s.jsx)("button",{type:"button",onClick:()=>$(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),(0,s.jsxs)("label",{className:"flex cursor-pointer items-center justify-center gap-1.5 rounded-lg border border-dashed border-border px-3 py-2 text-xs text-text-muted transition-colors hover:border-primary hover:text-primary",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"add_photo_alternate"}),y?"Attach one or more images":"Attach image",(0,s.jsx)("input",{type:"file",accept:"image/*",multiple:y,onChange:eI,className:"hidden"})]}),e$&&(0,s.jsx)("img",{src:e$,alt:"Reference",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"},loading:"lazy",decoding:"async"}),ew.length>0&&(0,s.jsx)("div",{className:"grid grid-cols-2 gap-2 sm:grid-cols-3",children:ew.map(e=>(0,s.jsxs)("div",{className:"group relative overflow-hidden rounded-lg border border-border bg-sidebar",children:[(0,s.jsx)("img",{src:e.dataUrl,alt:e.name,className:"h-28 w-full object-cover",loading:"lazy",decoding:"async"}),(0,s.jsx)("button",{type:"button",onClick:()=>I(t=>t.filter(t=>t.id!==e.id)),className:"absolute right-1.5 top-1.5 flex h-6 w-6 items-center justify-center rounded-full bg-black/65 text-white transition hover:bg-black","aria-label":`Remove ${e.name}`,children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[15px]",children:"close"})}),(0,s.jsx)("span",{className:"block truncate px-2 py-1.5 text-[11px] text-text-muted",children:e.name})]},e.id))}),y&&ek.length>0&&(0,s.jsx)("p",{className:"text-[11px] text-text-muted",children:1===ek.length?"Request uses image":`Request uses images[] with ${ek.length} references`})]})}),j&&(0,s.jsx)(A,{label:"Mask (URL)",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("input",{value:_,onChange:e=>T(e.target.value),placeholder:ej.mask_image||"https://example.com/mask.png",className:"w-full px-3 py-1.5 pr-7 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),_&&(0,s.jsx)("button",{type:"button",onClick:()=>T(""),className:"absolute right-2 top-1/2 -translate-y-1/2 text-text-muted hover:text-primary transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"close"})})]}),eA&&(0,s.jsx)("img",{src:eA,alt:"Mask",className:"max-h-40 rounded-lg border border-border object-contain bg-sidebar",onError:e=>{e.currentTarget.style.display="none"},onLoad:e=>{e.currentTarget.style.display="block"},loading:"lazy",decoding:"async"})]})}),(d.extraFields||[]).filter(e=>0===u.length||Array.isArray(b?.params)&&b.params.includes(e.key)).map(e=>(0,s.jsx)(A,{label:e.label,children:"select"===e.type?(0,s.jsx)("select",{value:R[e.key]??"",onChange:t=>L(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:(e.options||[]).map(e=>(0,s.jsx)("option",{value:e,children:""===e?"(default)":e},e))}):"text"===e.type?(0,s.jsx)("input",{type:"text",value:R[e.key]??"",placeholder:e.placeholder,onChange:t=>L(a=>({...a,[e.key]:t.target.value})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}):(0,s.jsx)("input",{type:"number",value:R[e.key]??"",min:e.min,max:e.max,onChange:t=>L(a=>({...a,[e.key]:""===t.target.value?"":Number(t.target.value)})),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})},e.key)),"image"===t&&(0,s.jsx)(A,{label:"Output Format",children:(0,s.jsxs)("select",{value:Y,onChange:e=>X(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"JSON (Base64)"}),(0,s.jsx)("option",{value:"binary",children:"Binary File"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>{eh(es({method:l.endpoint.method,endpoint:ef,apiPath:eR,headers:eL,body:eP,wantBinary:e_}))},className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:ex?"check":"content_copy"}),ex?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:eM,disabled:el||!w.trim()||!ev,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:el?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),el?"Running...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"max-h-56 overflow-auto whitespace-pre-wrap break-all rounded-lg bg-sidebar px-3 py-2.5 font-mono text-xs text-text-main",children:eO}),(eP.image||eP.images||eP.mask_image)&&(0,s.jsx)("p",{className:"mt-1.5 text-[11px] text-text-muted",children:"Base64 is hidden in the preview. Copy and Run still include the full image payload."})]}),(el||V)&&eT&&(0,s.jsxs)("div",{className:"flex flex-col gap-2 px-3 py-2 rounded-lg bg-sidebar border border-border sm:flex-row sm:items-center sm:gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-primary",style:el?{animation:"spin 1s linear infinite"}:void 0,children:el?"progress_activity":"check_circle"}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:[V?.stage||"starting",!el&&V?.bytesReceived?` \xb7 ${(V.bytesReceived/1024).toFixed(1)} KB`:""]})]}),W?.b64_json&&!z&&(0,s.jsxs)("div",{children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Partial preview"}),(0,s.jsx)("img",{src:`data:image/png;base64,${W.b64_json}`,alt:"Partial",className:"max-w-full rounded-lg border border-border mt-1.5 opacity-80",loading:"lazy",decoding:"async"})]}),eo&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:eo}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",z&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",z.latencyMs,"ms",z.connectionLabel?` | account: ${z.connectionLabel}`:""]})]}),z&&(0,s.jsxs)("button",{onClick:()=>eb(eB),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:eg?"check":"content_copy"}),eg?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:z?eB:d.defaultResponse}),"image"===t&&(Q||z?.data?.data?.[0])&&(0,s.jsxs)("div",{className:"mt-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-end mb-1.5",children:(0,s.jsxs)("a",{href:Q||(z?.data?.data?.[0]?.b64_json?`data:image/png;base64,${z.data.data[0].b64_json}`:z?.data?.data?.[0]?.url||""),download:"image.png",className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"download"}),"Download"]})}),(0,s.jsx)("img",{src:Q||(z?.data?.data?.[0]?.b64_json?`data:image/png;base64,${z.data.data[0].b64_json}`:z?.data?.data?.[0]?.url),alt:"Generated",className:"max-w-full rounded-lg border border-border",loading:"lazy",decoding:"async"})]})]})]})]})}function en({providerId:e}){let t=(0,c.wG)(e),a=(0,N.KC)(e).filter(e=>"stt"===(0,N.CP)(e)),[r,n]=(0,i.useState)([]),l=[...a,...r],[d,m]=(0,i.useState)(a[0]?.id??""),u=l.find(e=>e.id===d),p=Array.isArray(u?.params)?u.params:[],[x,h]=(0,i.useState)(null),[g,b]=(0,i.useState)(""),[f,y]=(0,i.useState)(""),[v,j]=(0,i.useState)("json"),[w,S]=(0,i.useState)(""),[C,$]=(0,i.useState)(""),[E,P]=(0,i.useState)(!1),[I,_]=(0,i.useState)(""),[T,R]=(0,i.useState)(""),[L,O]=(0,i.useState)(null),[M,D]=(0,i.useState)(null),[B,U]=(0,i.useState)(!1),[K,F]=(0,i.useState)(""),{copied:q,copy:z}=(0,k.C)(),{copied:J,copy:V}=(0,k.C)();(0,i.useEffect)(()=>{_(window.location.origin),fetch("/api/keys").then(e=>e.json()).then(e=>{$((e.keys||[]).find(e=>!1!==e.isActive)?.key||"")}).catch(()=>{}),fetch("/api/tunnel/status").then(e=>e.json()).then(e=>{e.publicUrl&&R(e.publicUrl)}).catch(()=>{});let e=()=>{fetch("/api/models/custom",{cache:"no-store"}).then(e=>e.json()).then(e=>{n((e.models||[]).filter(e=>"stt"===(0,N.CP)(e)&&e.providerAlias===t))}).catch(()=>{})};return e(),window.addEventListener("focus",e),window.addEventListener("customModelChanged",e),()=>{window.removeEventListener("focus",e),window.removeEventListener("customModelChanged",e)}},[t]);let H=E?T:I,W=d?`${t}/${d}`:"",G=`curl -X POST ${H}/v1/audio/transcriptions \\
81
81
  -H "Authorization: Bearer ${C||"YOUR_KEY"}" \\
82
82
  -F "file=@${x?.name||"audio.mp3"}" \\
83
83
  -F "model=${W}"${p.includes("language")&&g?` \\
84
84
  -F "language=${g}"`:""}${p.includes("response_format")?` \\
85
- -F "response_format=${v}"`:""}${p.includes("temperature")&&k?` \\
86
- -F "temperature=${k}"`:""}${p.includes("prompt")&&f?` \\
87
- -F "prompt=${f}"`:""}`,Y=async()=>{if(!x||!W)return;U(!0),F(""),O(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",W),p.includes("language")&&g&&t.append("language",g),p.includes("response_format")&&t.append("response_format",v),p.includes("temperature")&&k&&t.append("temperature",k),p.includes("prompt")&&f&&t.append("prompt",f);let a={};C&&(a.Authorization=`Bearer ${C}`);let s=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:a,body:t});D(Date.now()-e);let r=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();if(!s.ok)return void F(r?.error?.message||r?.error||r||`HTTP ${s.status}`);O(r)}catch(e){F(e.message||"Network error")}finally{U(!1)}},X="string"==typeof L?L:L?JSON.stringify(L,null,2):`{
85
+ -F "response_format=${v}"`:""}${p.includes("temperature")&&w?` \\
86
+ -F "temperature=${w}"`:""}${p.includes("prompt")&&f?` \\
87
+ -F "prompt=${f}"`:""}`,Y=async()=>{if(!x||!W)return;U(!0),F(""),O(null);let e=Date.now();try{let t=new FormData;t.append("file",x),t.append("model",W),p.includes("language")&&g&&t.append("language",g),p.includes("response_format")&&t.append("response_format",v),p.includes("temperature")&&w&&t.append("temperature",w),p.includes("prompt")&&f&&t.append("prompt",f);let a={};C&&(a.Authorization=`Bearer ${C}`);let s=await fetch("/api/v1/audio/transcriptions",{method:"POST",headers:a,body:t});D(Date.now()-e);let r=(s.headers.get("content-type")||"").includes("application/json")?await s.json():await s.text();if(!s.ok)return void F(r?.error?.message||r?.error||r||`HTTP ${s.status}`);O(r)}catch(e){F(e.message||"Network error")}finally{U(!1)}},X="string"==typeof L?L:L?JSON.stringify(L,null,2):`{
88
88
  "text": "Hello world..."
89
- }`;return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[l.length>0?(0,s.jsx)($,{label:"Model",children:(0,s.jsx)("select",{value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:l.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)($,{label:"Model",children:(0,s.jsx)("input",{value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)($,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[J,"/v1/audio/transcriptions"]}),T&&(0,s.jsxs)("button",{onClick:()=>P(e=>!e),title:E?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${E?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)($,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:C?`${C.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,C.length-8)))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,s.jsx)($,{label:"Audio File",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,s.jsx)($,{label:"Language",children:(0,s.jsx)("input",{value:g,onChange:e=>b(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,s.jsx)($,{label:"Prompt",children:(0,s.jsx)("input",{value:f,onChange:e=>y(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,s.jsx)($,{label:"Temperature",children:(0,s.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:k,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,s.jsx)($,{label:"Response Format",children:(0,s.jsxs)("select",{value:v,onChange:e=>j(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:q?"check":"content_copy"}),q?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:Y,disabled:B||!x||!W,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:B?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),B?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),K&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:K}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",L&&M&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",M,"ms"]})]}),L&&(0,s.jsxs)("button",{onClick:()=>H(X),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:V?"check":"content_copy"}),V?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:X})]})]})]})}function en(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),n=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,u=(0,c.AR)(t)&&"video"===e,p=m||u,x=u?"Custom Video":"Custom Embedding",h=async()=>{if(confirm(`Delete this ${x} node?`))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&a.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom node:",e)}},[g,b]=(0,i.useState)(null),[f,y]=(0,i.useState)(p),[v,w]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(!p)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(b((a.nodes||[]).find(e=>e.id===t)||null),y(!1))}).catch(()=>{e||y(!1)}),()=>{e=!0}},[t,p]),!n)return(0,r.notFound)();let N=c.Q2[t],k=u?"#EC4899":"#6366F1",S=u?"CV":"CE",$=p?g?{id:t,name:g.name||x,color:k,textIcon:S}:null:N;if(!p&&!N||p&&!f&&!g)return(0,r.notFound)();if(p&&f)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let E=p?[e]:$.serviceKinds??["llm"];return p||E.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(l(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),n.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${$.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${$.id}.png`,alt:$.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:$.textIcon||$.id.slice(0,2).toUpperCase(),fallbackColor:$.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:$.name}),!p&&$.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:$.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[p&&(0,s.jsxs)(o.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",g?.prefix]}),E.map(t=>(0,s.jsx)(o.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),p&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>w(!0),children:"Edit"}),(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:h,children:"Delete"})]})]})]}),!p&&$.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:$.kindNotice[e]})]}),!p&&$.notice?.text&&!$.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:$.notice.text}),$.notice.apiKeyUrl&&(0,s.jsx)("a",{href:$.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 →"})]}),!p&&$.noAuth?(0,s.jsx)(o.gw,{providerId:t}):(0,s.jsx)(j,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)(C,{providerId:t,kindFilter:e,providerAliasOverride:p?g?.prefix:void 0}),!p&&($.searchConfig||$.fetchConfig||$.ttsConfig||$.sttConfig||$.embeddingConfig||$.searchViaChat)&&(0,s.jsx)(o.Wx,{config:"webFetch"===e?$.fetchConfig:"tts"===e?$.ttsConfig:"stt"===e?$.sttConfig:"embedding"===e?$.embeddingConfig:$.searchConfig||{mode:"chat-completions",defaultModel:$.searchViaChat?.defaultModel,pricingUrl:$.searchViaChat?.pricingUrl,freeTier:$.searchViaChat?.freeTier},provider:$,title:`${n.label} Config`}),"embedding"===e&&(0,s.jsx)(P,{providerId:t,customAlias:g?.prefix}),"tts"===e&&(0,s.jsx)(X,{providerId:t}),"stt"===e&&!p&&(0,s.jsx)(er,{providerId:t}),!p&&A[e]&&(0,s.jsx)(es,{providerId:t,kind:e}),m&&(0,s.jsx)(o.x0,{isOpen:v,node:g,onClose:()=>w(!1),onSaved:e=>{b(e),w(!1)}}),u&&(0,s.jsx)(o.fA,{isOpen:v,node:g,onClose:()=>w(!1),onSaved:e=>{b(e),w(!1)}})]}):(0,r.notFound)()}},28915:(e,t,a)=>{"use strict";a.d(t,{E2:()=>s,gs:()=>r});function s(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function r(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let a=Math.floor(t/60);if(a<24)return`${a}h ago`;let s=Math.floor(a/24);return`${s}d ago`}a(8247)},70217:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})}},e=>{e.O(0,[8010,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=1389)),_N_E=e.O()}]);
89
+ }`;return(0,s.jsxs)(o.Zp,{children:[(0,s.jsx)("h2",{className:"text-lg font-semibold mb-4",children:"Example"}),(0,s.jsxs)("div",{className:"flex flex-col gap-2.5",children:[l.length>0?(0,s.jsx)(A,{label:"Model",children:(0,s.jsx)("select",{value:d,onChange:e=>m(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:l.map(e=>(0,s.jsx)("option",{value:e.id,children:e.name||e.id},e.id))})}):(0,s.jsx)(A,{label:"Model",children:(0,s.jsx)("input",{value:d,onChange:e=>m(e.target.value),placeholder:"Enter model id",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),(0,s.jsx)(A,{label:"Endpoint",children:(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("span",{className:"w-full min-w-0 flex-1 px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate",children:[H,"/v1/audio/transcriptions"]}),T&&(0,s.jsxs)("button",{onClick:()=>P(e=>!e),title:E?"Using tunnel":"Using local",className:`flex items-center gap-1 text-xs px-2 py-1.5 rounded-lg border shrink-0 transition-colors ${E?"border-primary/40 bg-primary/10 text-primary":"border-border text-text-muted hover:text-primary"}`,children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"wifi_tethering"}),"Tunnel"]})]})}),(0,s.jsx)(A,{label:"API Key",children:(0,s.jsx)("span",{className:"px-3 py-1.5 text-sm font-mono text-text-main bg-sidebar rounded-lg truncate block",children:C?`${C.slice(0,8)}${"•".repeat(Math.min(20,Math.max(0,C.length-8)))}`:(0,s.jsx)("span",{className:"text-text-muted italic",children:"No key configured"})})}),(0,s.jsx)(A,{label:"Audio File",children:(0,s.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,s.jsx)("input",{type:"file",accept:"audio/*,video/mp4,.m4a,.mp3,.wav,.ogg,.flac,.webm,.opus",onChange:e=>h(e.target.files?.[0]||null),className:"w-full text-xs text-text-muted file:mr-2 file:py-1 file:px-2.5 file:rounded-lg file:border file:border-border file:bg-background file:text-text-main hover:file:bg-sidebar file:cursor-pointer"}),x&&(0,s.jsxs)("span",{className:"text-xs text-text-muted font-mono",children:[x.name," \xb7 ",(x.size/1024).toFixed(1)," KB"]})]})}),p.includes("language")&&(0,s.jsx)(A,{label:"Language",children:(0,s.jsx)("input",{value:g,onChange:e=>b(e.target.value),placeholder:"e.g. en, vi, ja (auto-detect if empty)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary font-mono"})}),p.includes("prompt")&&(0,s.jsx)(A,{label:"Prompt",children:(0,s.jsx)("input",{value:f,onChange:e=>y(e.target.value),placeholder:"optional context to improve accuracy",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("temperature")&&(0,s.jsx)(A,{label:"Temperature",children:(0,s.jsx)("input",{type:"number",step:"0.1",min:"0",max:"1",value:w,onChange:e=>S(e.target.value),placeholder:"0 - 1 (default 0)",className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})}),p.includes("response_format")&&(0,s.jsx)(A,{label:"Response Format",children:(0,s.jsxs)("select",{value:v,onChange:e=>j(e.target.value),className:"w-full px-3 py-1.5 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary",children:[(0,s.jsx)("option",{value:"json",children:"json"}),(0,s.jsx)("option",{value:"text",children:"text"}),(0,s.jsx)("option",{value:"srt",children:"srt"}),(0,s.jsx)("option",{value:"verbose_json",children:"verbose_json"}),(0,s.jsx)("option",{value:"vtt",children:"vtt"})]})}),(0,s.jsxs)("div",{className:"mt-1",children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsx)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:"Request"}),(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsxs)("button",{onClick:()=>z(G),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:q?"check":"content_copy"}),q?"Copied":"Copy"]}),(0,s.jsxs)("button",{onClick:Y,disabled:B||!x||!W,className:"flex w-full sm:w-auto items-center justify-center gap-1.5 px-3 py-1 rounded-lg bg-primary text-white text-xs font-medium hover:bg-primary/90 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",style:B?{animation:"spin 1s linear infinite"}:void 0,children:"play_arrow"}),B?"Transcribing...":"Run"]})]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all",children:G})]}),K&&(0,s.jsx)("p",{className:"text-xs text-red-500 break-words",children:K}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between mb-1.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider",children:["Response ",L&&M&&(0,s.jsxs)("span",{className:"font-normal normal-case",children:["⚡ ",M,"ms"]})]}),L&&(0,s.jsxs)("button",{onClick:()=>V(X),className:"inline-flex items-center gap-1 text-xs text-text-muted hover:text-primary transition-colors",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:J?"check":"content_copy"}),J?"Copied":"Copy"]})]}),(0,s.jsx)("pre",{className:"bg-sidebar rounded-lg px-3 py-2.5 text-xs font-mono text-text-main overflow-x-auto whitespace-pre-wrap break-all opacity-70",children:X})]})]})]})}function el(){let{kind:e,id:t}=(0,r.useParams)(),a=(0,r.useRouter)(),n=c.rj.find(t=>t.id===e),m=(0,c.gC)(t)&&"embedding"===e,u=(0,c.AR)(t)&&"video"===e,p=m||u,x=u?"Custom Video":"Custom Embedding",h=async()=>{if(confirm(`Delete this ${x} node?`))try{(await fetch(`/api/provider-nodes/${t}`,{method:"DELETE"})).ok&&a.push(`/dashboard/media-providers/${e}`)}catch(e){console.log("Error deleting custom node:",e)}},[g,b]=(0,i.useState)(null),[f,y]=(0,i.useState)(p),[v,j]=(0,i.useState)(!1);if((0,i.useEffect)(()=>{if(!p)return;let e=!1;return fetch("/api/provider-nodes",{cache:"no-store"}).then(e=>e.json()).then(a=>{e||(b((a.nodes||[]).find(e=>e.id===t)||null),y(!1))}).catch(()=>{e||y(!1)}),()=>{e=!0}},[t,p]),!n)return(0,r.notFound)();let N=c.Q2[t],k=u?"#EC4899":"#6366F1",S=u?"CV":"CE",C=p?g?{id:t,name:g.name||x,color:k,textIcon:S}:null:N;if(!p&&!N||p&&!f&&!g)return(0,r.notFound)();if(p&&f)return(0,s.jsx)("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."});let A=p?[e]:C.serviceKinds??["llm"];return p||A.includes(e)?(0,s.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)(l(),{href:`/dashboard/media-providers/${e}`,className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),n.label]}),(0,s.jsxs)("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:gap-4",children:[(0,s.jsx)("div",{className:"size-12 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${C.color}15`},children:(0,s.jsx)(d.A,{src:`/providers/${C.id}.png`,alt:C.name,size:48,className:"object-contain rounded-lg max-w-[48px] max-h-[48px]",fallbackText:C.textIcon||C.id.slice(0,2).toUpperCase(),fallbackColor:C.color})}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsxs)("div",{className:"flex flex-wrap items-center gap-2 sm:gap-3",children:[(0,s.jsx)("h1",{className:"text-3xl font-semibold tracking-tight",children:C.name}),!p&&C.notice?.apiKeyUrl&&(0,s.jsxs)("a",{href:C.notice.apiKeyUrl,target:"_blank",rel:"noopener noreferrer",className:"text-xs text-primary hover:underline inline-flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-sm",children:"open_in_new"}),"Get API Key"]})]}),(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mt-1 flex-wrap",children:[p&&(0,s.jsxs)(o.Ex,{variant:"default",size:"sm",children:["Custom \xb7 ",g?.prefix]}),A.map(t=>(0,s.jsx)(o.Ex,{variant:t===e?"primary":"default",size:"sm",children:t.toUpperCase()},t))]})]}),p&&(0,s.jsxs)("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center",children:[(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"edit",onClick:()=>j(!0),children:"Edit"}),(0,s.jsx)(o.$n,{size:"sm",variant:"secondary",icon:"delete",onClick:h,children:"Delete"})]})]})]}),!p&&C.kindNotice?.[e]&&(0,s.jsxs)("div",{className:"flex items-start gap-3 px-4 py-3 rounded-lg bg-amber-500/10 border border-amber-500/30 text-amber-700 dark:text-amber-400",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px] mt-0.5",children:"warning"}),(0,s.jsx)("p",{className:"text-sm",children:C.kindNotice[e]})]}),!p&&C.notice?.text&&!C.deprecated&&(0,s.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,s.jsx)("span",{className:"material-symbols-outlined text-[16px] text-blue-500 shrink-0",children:"info"}),(0,s.jsx)("p",{className:"min-w-0 flex-1 text-xs leading-relaxed text-blue-600 dark:text-blue-400",children:C.notice.text}),C.notice.apiKeyUrl&&(0,s.jsx)("a",{href:C.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 →"})]}),!p&&C.noAuth?(0,s.jsx)(o.gw,{providerId:t}):(0,s.jsx)(w,{providerId:t,isOAuth:!1}),"tts"!==e&&"webSearch"!==e&&"webFetch"!==e&&(0,s.jsx)($,{providerId:t,kindFilter:e,providerAliasOverride:p?g?.prefix:void 0}),!p&&(C.searchConfig||C.fetchConfig||C.ttsConfig||C.sttConfig||C.embeddingConfig||C.searchViaChat)&&(0,s.jsx)(o.Wx,{config:"webFetch"===e?C.fetchConfig:"tts"===e?C.ttsConfig:"stt"===e?C.sttConfig:"embedding"===e?C.embeddingConfig:C.searchConfig||{mode:"chat-completions",defaultModel:C.searchViaChat?.defaultModel,pricingUrl:C.searchViaChat?.pricingUrl,freeTier:C.searchViaChat?.freeTier},provider:C,title:`${n.label} Config`}),"embedding"===e&&(0,s.jsx)(I,{providerId:t,customAlias:g?.prefix}),"tts"===e&&(0,s.jsx)(Q,{providerId:t}),"stt"===e&&!p&&(0,s.jsx)(en,{providerId:t}),!p&&E[e]&&(0,s.jsx)(er,{providerId:t,kind:e}),m&&(0,s.jsx)(o.x0,{isOpen:v,node:g,onClose:()=>j(!1),onSaved:e=>{b(e),j(!1)}}),u&&(0,s.jsx)(o.fA,{isOpen:v,node:g,onClose:()=>j(!1),onSaved:e=>{b(e),j(!1)}})]}):(0,r.notFound)()}},28915:(e,t,a)=>{"use strict";a.d(t,{E2:()=>s,gs:()=>r});function s(e){if(!e)return null;let t=e.match(/\b([45]\d{2})\b/);return t?t[1]:"ERR"}function r(e){if(!e)return"";let t=Math.floor((Date.now()-new Date(e).getTime())/6e4);if(t<1)return"just now";if(t<60)return`${t}m ago`;let a=Math.floor(t/60);if(a<24)return`${a}h ago`;let s=Math.floor(a/24);return`${s}d ago`}a(8247)},64827:(e,t,a)=>{"use strict";function s(e){if(!e)return null;let t=null,a=Date.now();for(let[s,r]of Object.entries(e)){if(!s.startsWith("modelLock_")||!r)continue;let e=new Date(r).getTime();e<=a||(!t||e<t)&&(t=e)}return t?new Date(t).toISOString():null}a.d(t,{kJ:()=>s}),a(10904)},70217:(e,t,a)=>{"use strict";function s(e,t){return!1===e?"default":"active"===t||"success"===t?"success":"error"===t||"expired"===t||"unavailable"===t?"error":"default"}a.d(t,{g:()=>s})}},e=>{e.O(0,[8010,8105,801,1321,5497,8441,3794,7358],()=>e(e.s=1389)),_N_E=e.O()}]);