@rabbi696/ezrouter 0.6.27 → 0.6.28

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 (379) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +3 -3
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/convoy/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/error-log/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/ha/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/keys/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mcp-gateway/servers/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/models/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/routing-health/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/wakeup/page_client-reference-manifest.js +1 -1
  37. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  39. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  40. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  41. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  42. package/app/.next-cli-build/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
  43. package/app/.next-cli-build/server/app/_global-error.segments/_head.segment.rsc +1 -1
  44. package/app/.next-cli-build/server/app/_global-error.segments/_index.segment.rsc +1 -1
  45. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  46. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  48. package/app/.next-cli-build/server/app/_not-found.rsc +3 -3
  49. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +3 -3
  50. package/app/.next-cli-build/server/app/_not-found.segments/_head.segment.rsc +1 -1
  51. package/app/.next-cli-build/server/app/_not-found.segments/_index.segment.rsc +3 -3
  52. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  53. package/app/.next-cli-build/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  54. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  55. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  56. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  57. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  58. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +1 -1
  59. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  60. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  61. package/app/.next-cli-build/server/app/callback.html +1 -1
  62. package/app/.next-cli-build/server/app/callback.rsc +3 -3
  63. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +3 -3
  64. package/app/.next-cli-build/server/app/callback.segments/_head.segment.rsc +1 -1
  65. package/app/.next-cli-build/server/app/callback.segments/_index.segment.rsc +3 -3
  66. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  67. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +1 -1
  68. package/app/.next-cli-build/server/app/callback.segments/callback.segment.rsc +1 -1
  69. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  70. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +5 -5
  71. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +2 -2
  72. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat.segment.rsc +1 -1
  73. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  74. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  75. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +5 -5
  76. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_head.segment.rsc +1 -1
  77. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_index.segment.rsc +3 -3
  78. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  79. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  80. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +5 -5
  81. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +2 -2
  82. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  85. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +5 -5
  86. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_head.segment.rsc +1 -1
  87. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_index.segment.rsc +3 -3
  88. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  89. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  90. package/app/.next-cli-build/server/app/dashboard/combos.rsc +5 -5
  91. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +2 -2
  92. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos.segment.rsc +1 -1
  93. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  94. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  95. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +5 -5
  96. package/app/.next-cli-build/server/app/dashboard/combos.segments/_head.segment.rsc +1 -1
  97. package/app/.next-cli-build/server/app/dashboard/combos.segments/_index.segment.rsc +3 -3
  98. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  99. package/app/.next-cli-build/server/app/dashboard/convoy.html +1 -1
  100. package/app/.next-cli-build/server/app/dashboard/convoy.rsc +5 -5
  101. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy/__PAGE__.segment.rsc +2 -2
  102. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard/convoy.segment.rsc +1 -1
  103. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  104. package/app/.next-cli-build/server/app/dashboard/convoy.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  105. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_full.segment.rsc +5 -5
  106. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_head.segment.rsc +1 -1
  107. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_index.segment.rsc +3 -3
  108. package/app/.next-cli-build/server/app/dashboard/convoy.segments/_tree.segment.rsc +1 -1
  109. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  110. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +5 -5
  111. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +2 -2
  112. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint.segment.rsc +1 -1
  113. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  114. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  115. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +5 -5
  116. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_head.segment.rsc +1 -1
  117. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_index.segment.rsc +3 -3
  118. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  119. package/app/.next-cli-build/server/app/dashboard/ha.html +1 -1
  120. package/app/.next-cli-build/server/app/dashboard/ha.rsc +4 -4
  121. package/app/.next-cli-build/server/app/dashboard/ha.segments/!KGRhc2hib2FyZCk/dashboard/ha/__PAGE__.segment.rsc +1 -1
  122. package/app/.next-cli-build/server/app/dashboard/ha.segments/!KGRhc2hib2FyZCk/dashboard/ha.segment.rsc +1 -1
  123. package/app/.next-cli-build/server/app/dashboard/ha.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  124. package/app/.next-cli-build/server/app/dashboard/ha.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  125. package/app/.next-cli-build/server/app/dashboard/ha.segments/_full.segment.rsc +4 -4
  126. package/app/.next-cli-build/server/app/dashboard/ha.segments/_head.segment.rsc +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/ha.segments/_index.segment.rsc +3 -3
  128. package/app/.next-cli-build/server/app/dashboard/ha.segments/_tree.segment.rsc +1 -1
  129. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.html +1 -1
  130. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.rsc +5 -5
  131. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys/__PAGE__.segment.rsc +2 -2
  132. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/keys.segment.rsc +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  134. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  135. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  136. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_full.segment.rsc +5 -5
  137. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_head.segment.rsc +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_index.segment.rsc +3 -3
  139. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/keys.segments/_tree.segment.rsc +1 -1
  140. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.html +1 -1
  141. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.rsc +5 -5
  142. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers/__PAGE__.segment.rsc +2 -2
  143. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/servers.segment.rsc +1 -1
  144. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  145. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  146. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  147. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_full.segment.rsc +5 -5
  148. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_head.segment.rsc +1 -1
  149. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_index.segment.rsc +3 -3
  150. package/app/.next-cli-build/server/app/dashboard/mcp-gateway/servers.segments/_tree.segment.rsc +1 -1
  151. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.html +1 -1
  152. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.rsc +5 -5
  153. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway/__PAGE__.segment.rsc +2 -2
  154. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard/mcp-gateway.segment.rsc +1 -1
  155. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  156. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  157. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_full.segment.rsc +5 -5
  158. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_head.segment.rsc +1 -1
  159. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_index.segment.rsc +3 -3
  160. package/app/.next-cli-build/server/app/dashboard/mcp-gateway.segments/_tree.segment.rsc +1 -1
  161. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  162. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +5 -5
  163. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +2 -2
  164. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web.segment.rsc +1 -1
  165. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers.segment.rsc +1 -1
  166. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  167. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  168. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +5 -5
  169. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_head.segment.rsc +1 -1
  170. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_index.segment.rsc +3 -3
  171. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  172. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  173. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +5 -5
  174. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +2 -2
  175. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm.segment.rsc +1 -1
  176. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  177. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  178. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +5 -5
  179. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_head.segment.rsc +1 -1
  180. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_index.segment.rsc +3 -3
  181. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  182. package/app/.next-cli-build/server/app/dashboard/models.html +1 -1
  183. package/app/.next-cli-build/server/app/dashboard/models.rsc +5 -5
  184. package/app/.next-cli-build/server/app/dashboard/models.segments/!KGRhc2hib2FyZCk/dashboard/models/__PAGE__.segment.rsc +2 -2
  185. package/app/.next-cli-build/server/app/dashboard/models.segments/!KGRhc2hib2FyZCk/dashboard/models.segment.rsc +1 -1
  186. package/app/.next-cli-build/server/app/dashboard/models.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  187. package/app/.next-cli-build/server/app/dashboard/models.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  188. package/app/.next-cli-build/server/app/dashboard/models.segments/_full.segment.rsc +5 -5
  189. package/app/.next-cli-build/server/app/dashboard/models.segments/_head.segment.rsc +1 -1
  190. package/app/.next-cli-build/server/app/dashboard/models.segments/_index.segment.rsc +3 -3
  191. package/app/.next-cli-build/server/app/dashboard/models.segments/_tree.segment.rsc +1 -1
  192. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  193. package/app/.next-cli-build/server/app/dashboard/profile.rsc +5 -5
  194. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +2 -2
  195. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile.segment.rsc +1 -1
  196. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  197. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  198. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +5 -5
  199. package/app/.next-cli-build/server/app/dashboard/profile.segments/_head.segment.rsc +1 -1
  200. package/app/.next-cli-build/server/app/dashboard/profile.segments/_index.segment.rsc +3 -3
  201. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  202. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  203. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +5 -5
  204. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +2 -2
  205. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new.segment.rsc +1 -1
  206. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  207. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  208. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  209. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +5 -5
  210. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_head.segment.rsc +1 -1
  211. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_index.segment.rsc +3 -3
  212. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  213. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  214. package/app/.next-cli-build/server/app/dashboard/providers.rsc +5 -5
  215. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +2 -2
  216. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers.segment.rsc +1 -1
  217. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  218. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  219. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +5 -5
  220. package/app/.next-cli-build/server/app/dashboard/providers.segments/_head.segment.rsc +1 -1
  221. package/app/.next-cli-build/server/app/dashboard/providers.segments/_index.segment.rsc +3 -3
  222. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  223. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  224. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +5 -5
  225. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +2 -2
  226. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools.segment.rsc +1 -1
  227. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  228. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  229. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +5 -5
  230. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_head.segment.rsc +1 -1
  231. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_index.segment.rsc +3 -3
  232. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  233. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  234. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +5 -5
  235. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +2 -2
  236. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe.segment.rsc +1 -1
  237. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  238. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  239. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +5 -5
  240. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_head.segment.rsc +1 -1
  241. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_index.segment.rsc +3 -3
  242. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  243. package/app/.next-cli-build/server/app/dashboard/quota.html +1 -1
  244. package/app/.next-cli-build/server/app/dashboard/quota.rsc +6 -6
  245. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +3 -3
  246. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota.segment.rsc +1 -1
  247. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  248. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  249. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +6 -6
  250. package/app/.next-cli-build/server/app/dashboard/quota.segments/_head.segment.rsc +1 -1
  251. package/app/.next-cli-build/server/app/dashboard/quota.segments/_index.segment.rsc +3 -3
  252. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  253. package/app/.next-cli-build/server/app/dashboard/routing-health.html +1 -1
  254. package/app/.next-cli-build/server/app/dashboard/routing-health.rsc +5 -5
  255. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health/__PAGE__.segment.rsc +2 -2
  256. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard/routing-health.segment.rsc +1 -1
  257. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  258. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  259. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_full.segment.rsc +5 -5
  260. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_head.segment.rsc +1 -1
  261. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_index.segment.rsc +3 -3
  262. package/app/.next-cli-build/server/app/dashboard/routing-health.segments/_tree.segment.rsc +1 -1
  263. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  264. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  265. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +3 -3
  266. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +3 -3
  267. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_head.segment.rsc +1 -1
  268. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_index.segment.rsc +3 -3
  269. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  270. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +1 -1
  271. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing.segment.rsc +1 -1
  272. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings.segment.rsc +1 -1
  273. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard.segment.rsc +1 -1
  274. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  275. package/app/.next-cli-build/server/app/dashboard/skills.rsc +5 -5
  276. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +2 -2
  277. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills.segment.rsc +1 -1
  278. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  279. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  280. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +5 -5
  281. package/app/.next-cli-build/server/app/dashboard/skills.segments/_head.segment.rsc +1 -1
  282. package/app/.next-cli-build/server/app/dashboard/skills.segments/_index.segment.rsc +3 -3
  283. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  284. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  285. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +5 -5
  286. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +2 -2
  287. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver.segment.rsc +1 -1
  288. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  289. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  290. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +5 -5
  291. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_head.segment.rsc +1 -1
  292. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_index.segment.rsc +3 -3
  293. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  294. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  295. package/app/.next-cli-build/server/app/dashboard/translator.rsc +5 -5
  296. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +2 -2
  297. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator.segment.rsc +1 -1
  298. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  299. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  300. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +5 -5
  301. package/app/.next-cli-build/server/app/dashboard/translator.segments/_head.segment.rsc +1 -1
  302. package/app/.next-cli-build/server/app/dashboard/translator.segments/_index.segment.rsc +3 -3
  303. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  304. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  305. package/app/.next-cli-build/server/app/dashboard/usage.rsc +5 -5
  306. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +2 -2
  307. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage.segment.rsc +1 -1
  308. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  309. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  310. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +5 -5
  311. package/app/.next-cli-build/server/app/dashboard/usage.segments/_head.segment.rsc +1 -1
  312. package/app/.next-cli-build/server/app/dashboard/usage.segments/_index.segment.rsc +3 -3
  313. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  314. package/app/.next-cli-build/server/app/dashboard/wakeup.html +1 -1
  315. package/app/.next-cli-build/server/app/dashboard/wakeup.rsc +4 -4
  316. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup/__PAGE__.segment.rsc +1 -1
  317. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard/wakeup.segment.rsc +1 -1
  318. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  319. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  320. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_full.segment.rsc +4 -4
  321. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_head.segment.rsc +1 -1
  322. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_index.segment.rsc +3 -3
  323. package/app/.next-cli-build/server/app/dashboard/wakeup.segments/_tree.segment.rsc +1 -1
  324. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  325. package/app/.next-cli-build/server/app/dashboard.rsc +5 -5
  326. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +2 -2
  327. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard.segment.rsc +1 -1
  328. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
  329. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +5 -5
  330. package/app/.next-cli-build/server/app/dashboard.segments/_head.segment.rsc +1 -1
  331. package/app/.next-cli-build/server/app/dashboard.segments/_index.segment.rsc +3 -3
  332. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  333. package/app/.next-cli-build/server/app/index.html +1 -1
  334. package/app/.next-cli-build/server/app/index.rsc +3 -3
  335. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  336. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +3 -3
  337. package/app/.next-cli-build/server/app/index.segments/_head.segment.rsc +1 -1
  338. package/app/.next-cli-build/server/app/index.segments/_index.segment.rsc +3 -3
  339. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  340. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  341. package/app/.next-cli-build/server/app/landing.html +1 -1
  342. package/app/.next-cli-build/server/app/landing.rsc +3 -3
  343. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +3 -3
  344. package/app/.next-cli-build/server/app/landing.segments/_head.segment.rsc +1 -1
  345. package/app/.next-cli-build/server/app/landing.segments/_index.segment.rsc +3 -3
  346. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  347. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +1 -1
  348. package/app/.next-cli-build/server/app/landing.segments/landing.segment.rsc +1 -1
  349. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  350. package/app/.next-cli-build/server/app/login.html +1 -1
  351. package/app/.next-cli-build/server/app/login.rsc +4 -4
  352. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +4 -4
  353. package/app/.next-cli-build/server/app/login.segments/_head.segment.rsc +1 -1
  354. package/app/.next-cli-build/server/app/login.segments/_index.segment.rsc +3 -3
  355. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  356. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +2 -2
  357. package/app/.next-cli-build/server/app/login.segments/login.segment.rsc +1 -1
  358. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  359. package/app/.next-cli-build/server/app-paths-manifest.json +3 -3
  360. package/app/.next-cli-build/server/chunks/5461.js +1 -1
  361. package/app/.next-cli-build/server/chunks/5749.js +1 -1
  362. package/app/.next-cli-build/server/chunks/6038.js +1 -1
  363. package/app/.next-cli-build/server/chunks/6283.js +1 -1
  364. package/app/.next-cli-build/server/chunks/6328.js +1 -1
  365. package/app/.next-cli-build/server/chunks/6644.js +1 -1
  366. package/app/.next-cli-build/server/chunks/7775.js +1 -1
  367. package/app/.next-cli-build/server/chunks/8238.js +1 -1
  368. package/app/.next-cli-build/server/chunks/9900.js +1 -1
  369. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  370. package/app/.next-cli-build/server/pages/404.html +1 -1
  371. package/app/.next-cli-build/server/pages/500.html +1 -1
  372. package/app/.next-cli-build/static/chunks/{1321-e213e7e1bf3a7765.js → 1321-4b31ce80e6ca3c02.js} +1 -1
  373. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-d08c7e6e5aac5fe2.js → page-f894f779f1b97e44.js} +1 -1
  374. package/app/CHANGELOG.md +11 -2
  375. package/app/package.json +1 -1
  376. package/app/public/CHANGELOG.md +11 -2
  377. package/package.json +1 -1
  378. /package/app/.next-cli-build/static/{QraJFuTUjRVVcGfufFpWk → BBHPCyd1tb1Fl4SRcejMy}/_buildManifest.js +0 -0
  379. /package/app/.next-cli-build/static/{QraJFuTUjRVVcGfufFpWk → BBHPCyd1tb1Fl4SRcejMy}/_ssgManifest.js +0 -0
@@ -10,7 +10,7 @@ ${k.join("\n")}`);a=l,b=a=>Array.isArray(a)?a.map(e):a,l={...a,run:(c,d=[])=>a.r
10
10
  provider=excluded.provider, authType=excluded.authType, name=excluded.name,
11
11
  email=excluded.email, priority=excluded.priority, isActive=excluded.isActive,
12
12
  data=excluded.data, updatedAt=excluded.updatedAt`,[c.id,c.provider,c.authType,c.name,c.email,c.priority,c.isActive,c.data,c.createdAt,c.updatedAt])}async function s(a={}){let b=await (0,e.c)(),c=[],d=[];a.provider&&(c.push("provider = ?"),d.push(a.provider)),void 0!==a.isActive&&(c.push("isActive = ?"),d.push(+!!a.isActive));let f=`SELECT * FROM providerConnections${c.length?` WHERE ${c.join(" AND ")}`:""}`,g=b.all(f,d).map(q).filter(c=>!0!==a.isActive||!b.ha||b.ha.canUseConnection(c));return g.sort((a,b)=>(a.priority||999)-(b.priority||999)),g}async function t(a){return q((await (0,e.c)()).get("SELECT * FROM providerConnections WHERE id = ?",[a]))}function u(a,b){let c=a.all("SELECT * FROM providerConnections WHERE provider = ?",[b]).map(q);c.sort((a,b)=>{let c=(a.priority||0)-(b.priority||0);return 0!==c?c:new Date(b.updatedAt||0)-new Date(a.updatedAt||0)}),c.forEach((b,c)=>{let d=c+1;(b.priority||0)!==d&&a.run("UPDATE providerConnections SET priority = ? WHERE id = ?",[d,b.id])})}async function v(a){let b,c=await (0,e.c)(),f=new Date().toISOString();return c.transaction(()=>{var e;let g="apikey"===a.authType&&!!a.name,h=g?c.all("SELECT * FROM providerConnections WHERE provider = ? AND authType = ? AND name = ?",[a.provider,"apikey",a.name]).map(q):c.all("SELECT * FROM providerConnections WHERE provider = ?",[a.provider]).map(q),i=g?c.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a.provider])?.n??h.length:h.length,j=null;if("oauth"===a.authType&&a.email){let b=a.providerSpecificData?.username,c=a.providerSpecificData?.chatgptAccountId;j=h.find(d=>{if("oauth"!==d.authType||d.email!==a.email)return!1;if("codex"===a.provider){let a=d.providerSpecificData?.chatgptAccountId;return!!c&&!!a&&c===a}let e=d.providerSpecificData?.chatgptAccountId;if(c&&e)return c===e;if(c&&!e||!c&&e)return!1;let f=d.providerSpecificData?.username;return b&&f?b===f:!b&&!f})}else"apikey"===a.authType&&a.name&&(j=h.find(b=>"apikey"===b.authType&&b.name===a.name));if(j){if(!1===a.allowOverwrite){let b=Error(`A connection named "${j.name}" already exists for provider "${a.provider}". Pass allowOverwrite: true to replace it.`);throw b.code="PROVIDER_NAME_CONFLICT",b.existingId=j.id,b.existingName=j.name,b}let d=p(j,a),e="codex"===a.provider&&"oauth"===a.authType&&a.accessToken?function(a,b,c){let d={...a,...b,updatedAt:c,isActive:!0,testStatus:"active"};for(let a of["lastError","lastErrorAt","errorCode","backoffLevel"])delete d[a];for(let a of Object.keys(d))a.startsWith("modelLock_")&&delete d[a];return d}(j,d,f):{...j,...d,updatedAt:f};r(c,e),b=e;return}let k=a.name||null;k||"oauth"!==a.authType&&"access_token"!==a.authType||(e=a.email||`Account ${i+1}`,k="github"===a.provider&&(a.providerSpecificData?.githubLogin||a.providerSpecificData?.githubEmail||a.email||a.providerSpecificData?.githubName)||e);let l=a.priority;if(!l){let b=c.get("SELECT MAX(priority) AS m FROM providerConnections WHERE provider = ?",[a.provider]);l=(b?.m||0)+1}let m={id:(0,d.A)(),provider:a.provider,authType:a.authType||"oauth",name:k,priority:l,isActive:void 0===a.isActive||a.isActive,createdAt:f,updatedAt:f};for(let b of o)void 0!==a[b]&&null!==a[b]&&(m[b]=a[b]);a.providerSpecificData&&Object.keys(a.providerSpecificData).length>0&&(m.providerSpecificData=a.providerSpecificData),void 0!==a.email&&(m.email=a.email),r(c,m),b=m}),b}async function w(a,b){let c,d=await (0,e.c)();return d.transaction(()=>{let e=d.get("SELECT * FROM providerConnections WHERE id = ?",[a]);if(!e){c=null;return}let f=q(e),g=p(f,b),h={...f,...g,updatedAt:new Date().toISOString()};r(d,h),void 0!==b.priority&&u(d,f.provider),c=h}),c}async function x(a){let b=await (0,e.c)(),c=b.get("SELECT provider FROM providerConnections WHERE id = ?",[a]);if(!c)return!1;let d=c.provider,h=!1;if(b.transaction(()=>{let c=b.run("DELETE FROM providerConnections WHERE id = ?",[a]);u(b,d),h=c.changes>0}),h)for(let a of(0,g.Uv)()){if(!a.models||!Array.isArray(a.models))continue;let c=a.models.length,e=a.models.filter(a=>{let b=m(a,{});return b?.provider!==d});e.length!==c&&(0===e.length?b.run("DELETE FROM combos WHERE name = ?",[a.name]):b.run("UPDATE combos SET models = ?, updatedAt = datetime('now') WHERE name = ?",[(0,f.s)(e),a.name]))}return h}async function y(a){let b=await (0,e.c)(),c=b.get("SELECT COUNT(*) AS n FROM providerConnections WHERE provider = ?",[a]);return b.run("DELETE FROM providerConnections WHERE provider = ?",[a]),c?.n||0}async function z(a){let b=await (0,e.c)();b.transaction(()=>u(b,a))}async function A(){let a=await (0,e.c)(),b=["displayName","email","globalPriority","defaultModel","accessToken","refreshToken","expiresAt","tokenType","scope","projectId","apiKey","testStatus","lastTested","lastError","lastErrorAt","rateLimitedUntil","expiresIn","consecutiveUseCount"],c=0;return a.transaction(()=>{for(let d of a.all("SELECT * FROM providerConnections")){let e=q(d),f=!1;for(let a of b)(null===e[a]||void 0===e[a])&&a in e&&(delete e[a],c++,f=!0);e.providerSpecificData&&0===Object.keys(e.providerSpecificData).length&&(delete e.providerSpecificData,c++,f=!0),f&&r(a,e)}}),c}},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},52519:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>O,handler:()=>Q,routeModule:()=>P});var d=c(7553),e=c(84006),f=c(67798),g=c(34775),h=c(99373),i=c(73461),j=c(1020),k=c(26349),l=c(54365),m=c(16023),n=c(14965),o=c(63747),p=c(24235),q=c(23938),r=c(261),s=c(66758),t=c(77243),u=c(26713),v=c(37527),w=c(22820),x=c(88216),y=c(47929),z=c(79551),A=c(71797),B=c(89125),C=c(86439),D=c(77068),E=c(27269),F=c(37525),G=c(61287),H=c(81494),I=c(70722),J=c(70753),K=c(43954),L=c(17891),M={};for(let a in G)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(M[a]=()=>G[a]);c.d(b,M);let N={children:["",{children:["(dashboard)",{children:["dashboard",{children:["providers",{children:["[id]",{children:["__PAGE__",{},{page:[()=>Promise.resolve().then(c.bind(c,93110)),"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/dashboard/providers/[id]/page.js"]}]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},["new"]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,30508)),"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/(dashboard)/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[()=>Promise.resolve().then(c.bind(c,57529)),"/Volumes/Files/Projects/EzRouter/EzRouter/src/app/layout.js"],"global-error":[()=>Promise.resolve().then(c.t.bind(c,95547,23)),"next/dist/client/components/builtin/global-error.js"],"not-found":[()=>Promise.resolve().then(c.t.bind(c,55091,23)),"next/dist/client/components/builtin/not-found.js"],forbidden:[()=>Promise.resolve().then(c.t.bind(c,45270,23)),"next/dist/client/components/builtin/forbidden.js"],unauthorized:[()=>Promise.resolve().then(c.t.bind(c,28193,23)),"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[async a=>(await Promise.resolve().then(c.bind(c,70440))).default(a)],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,O={require:c,loadChunk:()=>Promise.resolve()},P=new d.AppPageRouteModule({definition:{kind:e.RouteKind.APP_PAGE,page:"/(dashboard)/dashboard/providers/[id]/page",pathname:"/dashboard/providers/[id]",bundlePath:"",filename:"",appPaths:[]},userland:{loaderTree:N},distDir:".next-cli-build",relativeProjectDir:""});async function Q(a,b,d){var M,R,S,T,U;d.requestMeta&&(0,h.setRequestMeta)(a,d.requestMeta),P.isDev&&(0,h.addRequestMeta)(a,"devRequestTimingInternalsEnd",process.hrtime.bigint());let V=!!(0,h.getRequestMeta)(a,"minimalMode"),W="/(dashboard)/dashboard/providers/[id]/page";"/index"===W&&(W="/");let X=await P.prepare(a,b,{srcPage:W,multiZoneDraftMode:!1});if(!X)return b.statusCode=400,b.end("Bad Request"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let{buildId:Y,query:Z,params:$,pageIsDynamic:_,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,serverActionsManifest:ad,clientReferenceManifest:ae,subresourceIntegrityManifest:af,prerenderManifest:ag,isDraftMode:ah,resolvedPathname:ai,revalidateOnlyGenerated:aj,routerServerContext:ak,nextConfig:al,parsedUrl:am,interceptionRoutePatterns:an,deploymentId:ao,clientAssetToken:ap}=X,aq=(0,r.normalizeAppPath)(W),{isOnDemandRevalidate:ar}=X,as=al.experimental.ppr&&!al.cacheComponents&&(0,K.isInterceptionRouteAppPath)(ai)?null:P.match(ai,ag),at=(null==as?void 0:as.route)??null,au=!!ag.routes[ai],av=a.headers["user-agent"]||"",aw=(0,u.getBotType)(av),ax=(0,q.isHtmlBotRequest)(a),ay=(0,h.getRequestMeta)(a,"isPrefetchRSCRequest")??"1"===a.headers[t.NEXT_ROUTER_PREFETCH_HEADER],az=(0,h.getRequestMeta)(a,"isRSCRequest")??(0,n.f)(a.headers[t.RSC_HEADER]),aA=(0,s.getIsPossibleServerAction)(a),aB=(0,m.checkIsAppPPREnabled)(al.experimental.ppr),aC=a.headers[y.NEXT_RESUME_STATE_LENGTH_HEADER];if(!(0,h.getRequestMeta)(a,"postponed")&&V&&aB&&aA&&aC&&"string"==typeof aC){let e=parseInt(aC,10),{maxPostponedStateSize:f,maxPostponedStateSizeBytes:g}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize);if(!isNaN(e)&&e>0){if(e>g)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(f)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let i="1 MB",j=(null==(U=al.experimental.serverActions)?void 0:U.bodySizeLimit)??i,k=e+(j!==i?c(95726).parse(j):1048576),l=await (0,E.readBodyWithSizeLimit)(a,k);if(null===l)return b.statusCode=413,b.end("Request body exceeded limit. To configure the body size limit for Server Actions, see: https://nextjs.org/docs/app/api-reference/next-config-js/serverActions#bodysizelimit"),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;if(l.length>=e){let b=l.subarray(0,e).toString("utf8");(0,h.addRequestMeta)(a,"postponed",b);let c=l.subarray(e);(0,h.addRequestMeta)(a,"actionBody",c)}else throw Object.defineProperty(Error(`invariant: expected ${e} bytes of postponed state but only received ${l.length} bytes`),"__NEXT_ERROR_CODE",{value:"E979",enumerable:!1,configurable:!0})}}if(!(0,h.getRequestMeta)(a,"postponed")&&aB&&"1"===a.headers[y.NEXT_RESUME_HEADER]&&"POST"===a.method){let{maxPostponedStateSize:c,maxPostponedStateSizeBytes:e}=(0,E.getMaxPostponedStateSize)(al.experimental.maxPostponedStateSize),f=await (0,E.readBodyWithSizeLimit)(a,e);if(null===f)return b.statusCode=413,b.end((0,E.getPostponedStateExceededErrorMessage)(c)),null==d.waitUntil||d.waitUntil.call(d,Promise.resolve()),null;let g=f.toString("utf8");(0,h.addRequestMeta)(a,"postponed",g)}let aD=!0===P.isDev||!0===al.experimental.exposeTestingApiInProductionBuild,aE=aD&&("1"===a.headers[t.NEXT_INSTANT_PREFETCH_HEADER]||!(0,n.f)(a.headers[t.RSC_HEADER])&&"string"==typeof a.headers.cookie&&a.headers.cookie.includes(t.NEXT_INSTANT_TEST_COOKIE+"=")),aF=(aB||aE)&&((null==(M=ag.routes[aq]??ag.dynamicRoutes[aq])?void 0:M.renderingMode)==="PARTIALLY_STATIC"||aE&&(aD||(null==ak?void 0:ak.experimentalTestProxy)===!0)),aG=aE&&aF,aH=aG&&!0===P.isDev,aI=!1,aJ=aF?(0,h.getRequestMeta)(a,"postponed"):void 0,aK=null==(R=ag.routes[ai])?void 0:R.prefetchDataRoute,aL=aF&&az&&!ay&&!aK;V&&(aL=aL&&!!aJ);let aM=(0,h.getRequestMeta)(a,"segmentPrefetchRSCRequest"),aN=(!aw||!aF)&&(!av||(0,q.shouldServeStreamingMetadata)(av,al.htmlLimitedBots)),aO=!!((at||au||ag.routes[aq])&&!(aw&&aF)),aP=aF&&!0===al.cacheComponents,aQ=!0===P.isDev||!aO||"string"==typeof aJ||(aP&&(0,h.getRequestMeta)(a,"onCacheEntryV2")?aL&&!V:aL),aR=!!aw&&aF,aS=(null==at?void 0:at.remainingPrerenderableParams)??[],aT=(null==at?void 0:at.fallback)===null&&((null==(S=at.fallbackRootParams)?void 0:S.length)??0)>0,aU=null;if(!ah&&aO&&!aQ&&!aA&&!aJ&&!aL){let a=as?"string"==typeof(null==at?void 0:at.fallback)?at.fallback:as.source:null;if(!0===al.experimental.partialFallbacks&&a&&(null==at?void 0:at.fallbackRouteParams)&&!aT){if(aS.length>0){let b,c=(b=new Map(aS.map(a=>[a.paramName,a])),a.split("/").map(a=>{let c=(0,L.getSegmentParam)(a);if(!c)return a;let d=b.get(c.paramName);if(!d)return a;let e=null==$?void 0:$[d.paramName];if(!e)return a;let f=Array.isArray(e)?e.map(a=>encodeURIComponent(a)).join("/"):encodeURIComponent(e);return a.replace((0,o.buildDynamicSegmentPlaceholder)(d),f)}).join("/")||"/");aU=c!==a?c:null}}else aU=ai}let aV=aU;!aV&&(P.isDev||aO&&_&&(null==at?void 0:at.fallbackRouteParams)&&!aA)&&(aV=ai),P.isDev||ah||!aO||!az||aL||(0,k.d)(a.headers);let aW={...G,tree:N,handler:Q,routeModule:P,__next_app__:O};ad&&ae&&(0,p.setManifestsSingleton)({page:W,clientReferenceManifest:ae,serverActionsManifest:ad});let aX=a.method||"GET",aY=(0,g.getTracer)(),aZ=aY.getActiveScopeSpan(),a$=!!(null==ak?void 0:ak.isWrappedByNextServer),a_=!0===al.experimental.partialFallbacks&&aS.length>0?(null==at||null==(T=at.fallbackRouteParams)?void 0:T.filter(a=>!aS.some(b=>b.paramName===a.paramName)))??[]:[],a0=async()=>((null==ak?void 0:ak.render404)?await ak.render404(a,b,am,!1):b.end("This page could not be found"),null);try{let k,m=P.getVaryHeader(ai,an);b.setHeader("Vary",m);let n=async(c,d)=>{let e=new l.NodeNextRequest(a),f=new l.NodeNextResponse(b);return P.render(e,f,d).finally(()=>{if(!c)return;c.setAttributes({"http.status_code":b.statusCode,"next.rsc":!1});let a=aY.getRootSpanAttributes();if(!a)return;if(a.get("next.span_type")!==i.BaseServerSpan.handleRequest)return void console.warn(`Unexpected root span type '${a.get("next.span_type")}'. Please report this Next.js issue https://github.com/vercel/next.js`);let d=a.get("next.route");if(d){let a=`${aX} ${d}`;c.setAttributes({"next.route":d,"http.route":d,"next.span_name":a}),c.updateName(a),k&&k!==c&&(k.setAttribute("http.route",d),k.updateName(a))}else c.updateName(`${aX} ${W}`)})},p=(0,h.getRequestMeta)(a,"incrementalCache")||await P.getIncrementalCache(a,al,ag,V);null==p||p.resetRequestCache(),globalThis.__incrementalCache=p;let q=async({span:e,postponed:f,fallbackRouteParams:g,forceStaticRender:i})=>{let k={query:Z,params:$,page:aq,sharedContext:{buildId:Y,deploymentId:ao,clientAssetToken:ap},serverComponentsHmrCache:(0,h.getRequestMeta)(a,"serverComponentsHmrCache"),fallbackRouteParams:g,renderOpts:{App:()=>null,Document:()=>null,pageConfig:{},ComponentMod:aW,Component:(0,j.T)(aW),params:$,routeModule:P,page:W,postponed:f,shouldWaitOnAllReady:aR,serveStreamingMetadata:aN,supportsDynamicResponse:"string"==typeof f||aQ,buildManifest:aa,nextFontManifest:ab,reactLoadableManifest:ac,subresourceIntegrityManifest:af,setCacheStatus:null==ak?void 0:ak.setCacheStatus,setIsrStatus:null==ak?void 0:ak.setIsrStatus,setReactDebugChannel:null==ak?void 0:ak.setReactDebugChannel,sendErrorsToBrowser:null==ak?void 0:ak.sendErrorsToBrowser,dir:c(33873).join(process.cwd(),P.relativeProjectDir),isDraftMode:ah,botType:aw,isOnDemandRevalidate:ar,isPossibleServerAction:aA,assetPrefix:al.assetPrefix,nextConfigOutput:al.output,crossOrigin:al.crossOrigin,trailingSlash:al.trailingSlash,images:al.images,previewProps:ag.preview,enableTainting:al.experimental.taint,htmlLimitedBots:al.htmlLimitedBots,reactMaxHeadersLength:al.reactMaxHeadersLength,multiZoneDraftMode:!1,incrementalCache:p,cacheLifeProfiles:al.cacheLife,basePath:al.basePath,serverActions:al.experimental.serverActions,logServerFunctions:"object"==typeof al.logging&&!!al.logging.serverFunctions,...aG||aH||aI?{isBuildTimePrerendering:!0,supportsDynamicResponse:!1,isStaticGeneration:!0,isDebugDynamicAccesses:aH}:{},cacheComponents:!!al.cacheComponents,experimental:{isRoutePPREnabled:aF,expireTime:al.expireTime,staleTimes:al.experimental.staleTimes,dynamicOnHover:!!al.experimental.dynamicOnHover,optimisticRouting:!!al.experimental.optimisticRouting,inlineCss:!!al.experimental.inlineCss,prefetchInlining:al.experimental.prefetchInlining??!1,authInterrupts:!!al.experimental.authInterrupts,cachedNavigations:!!al.experimental.cachedNavigations,clientTraceMetadata:al.experimental.clientTraceMetadata||[],clientParamParsingOrigins:al.experimental.clientParamParsingOrigins,maxPostponedStateSizeBytes:(0,D.parseMaxPostponedStateSize)(al.experimental.maxPostponedStateSize)},waitUntil:d.waitUntil,onClose:a=>{b.on("close",a)},onAfterTaskError:()=>{},onInstrumentationRequestError:(b,c,d,e)=>P.onRequestError(a,b,d,e,ak),err:(0,h.getRequestMeta)(a,"invokeError")}};i&&(k.renderOpts.supportsDynamicResponse=!1);let l=await n(e,k),{metadata:m}=l,{cacheControl:o,headers:q={},fetchTags:r,fetchMetrics:s}=m;if(r&&(q[y.NEXT_CACHE_TAGS_HEADER]=r),a.fetchMetrics=s,aO&&(null==o?void 0:o.revalidate)===0&&!P.isDev&&!aF){let a=m.staticBailoutInfo,b=Object.defineProperty(Error(`Page changed from static to dynamic at runtime ${ai}${(null==a?void 0:a.description)?`, reason: ${a.description}`:""}
13
- see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:o}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===P.isDev,m=c||b.writableEnded;try{var n;let f;if(ar&&aj&&!g&&!V)return(null==ak?void 0:ak.render404)?await ak.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(at&&(f=(0,w.parseFallbackField)(at.fallback)),!0===al.experimental.partialFallbacks&&(null==at?void 0:at.fallback)===null&&!aT&&aS.length>0&&(f=w.FallbackMode.PRERENDER),f===w.FallbackMode.PRERENDER&&(0,u.isBot)(av)&&(!aF||ax)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ar=!0),ar&&(f!==w.FallbackMode.NOT_FOUND||g)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),!V&&f!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aV&&!m&&!ah&&_&&(l||!au)){if((l||at)&&f===w.FallbackMode.NOT_FOUND){if(al.adapterPath)return await a0();throw new C.NoFallbackError}if(aF&&(al.cacheComponents?!aL:!az)){let b=l&&"string"==typeof(null==at?void 0:at.fallback)?at.fallback:aq,f=(l||aG)&&(null==at?void 0:at.fallbackRouteParams)?(0,o.createOpaqueFallbackRouteParams)(at.fallbackRouteParams):aI?(0,o.getFallbackRouteParams)(aq,P):null;aG&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await P.handleResponse({cacheKey:b,req:a,nextConfig:al,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ag,isRoutePPREnabled:aF,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:V});if(null===g)return null;if(g)return V||!aF||!(aS.length>0)||!0!==al.experimental.partialFallbacks||!aU||!p||ar||aI||aD||aE||ay||(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(aU,p,aF,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:a_.length>0?(0,o.createOpaqueFallbackRouteParams)(a_):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let s=ar||i||!aJ?void 0:aJ;if(aP&&!V&&p&&(aL||aA)&&!k){let b=await p.get(ai,{kind:v.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===v.CachedRouteKind.APP_PAGE&&(s=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(ai,p,aF,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aG||aH)&&void 0!==s)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let t=!P.isDev&&_&&(null==at?void 0:at.fallbackRouteParams)?(0,o.getPlaceholderFallbackRouteParams)($,at.fallbackRouteParams):null,y=t&&t.length>0?t:null==at?void 0:at.fallbackRouteParams,z=null!=t&&t.length>0,A=null;if(al.cacheComponents&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,h.getRequestMeta)(a,"resolvedRouteParamKeys");b&&b.size>0&&(A=at.fallbackRouteParams.filter(a=>!b.has(a.paramName)))}let B=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||z||aG&&!au)&&y?(0,o.createOpaqueFallbackRouteParams)(y):A&&A.length>0&&A.length<((null==at||null==(n=at.fallbackRouteParams)?void 0:n.length)??0)?(0,o.createOpaqueFallbackRouteParams)(A):aI?(0,o.getFallbackRouteParams)(aq,P):null;if((l||aG)&&al.cacheComponents&&!au&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,o.createOpaqueFallbackRouteParams)(y??at.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:s,fallbackRouteParams:B,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}},s=async c=>{var f,g,i,j,k,l;let m,n=await P.handleResponse({cacheKey:aU,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ar,isRoutePPREnabled:aF,req:a,nextConfig:al,prerenderManifest:ag,waitUntil:d.waitUntil,isMinimalMode:V});if(ah&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),P.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!n){if(aU)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let o="string"==typeof n.value.postponed;az&&!aA&&ao&&b.setHeader(y.NEXT_NAV_DEPLOYMENT_ID_HEADER,ao),aO&&!aL&&(!o||ay)&&(V||b.setHeader("x-nextjs-cache",ar?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:p}=n;if(aJ)m={revalidate:0,expire:void 0};else if(aL)m={revalidate:0,expire:void 0};else if(!P.isDev)if(ah)m={revalidate:0,expire:void 0};else if(aO){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??al.expireTime}}else m={revalidate:y.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(n.cacheControl=m,"string"==typeof aM&&(null==p?void 0:p.kind)===v.CachedRouteKind.APP_PAGE&&p.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=p.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];V&&aO&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=p.segmentData.get(aM);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let s=aP?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(s){let b=(0,h.getRequestMeta)(a,"initURL")??a.url,c=b?(null==(l=(0,F.parseUrl)(b))?void 0:l.pathname)??b:void 0;if(await s(n,{url:c}))return null}if(p.headers){let a={...p.headers};for(let[c,d]of(V&&aO||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let u=null==(g=p.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(V&&aO&&u&&"string"==typeof u&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,u),!p.status||az&&aF||(b.statusCode=p.status),!V&&p.status&&H.RedirectStatusCode[p.status]&&az&&(b.statusCode=200),o&&!aL&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),az&&!ah){if(void 0===p.rscData){if(p.html.contentType!==t.RSC_CONTENT_TYPE_HEADER)if(al.cacheComponents)return b.statusCode=404,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl});else throw Object.defineProperty(new I.InvariantError(`Expected RSC response, got ${p.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:p.html,cacheControl:n.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(p.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let w=p.html;if(aE&&aG){let c=!0===P.isDev?crypto.randomUUID():null;return w.pipeThrough(await (0,A.createInstantTestScriptInsertionTransformStream)(c)),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})}if(!o||V||az)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:n.cacheControl});if(aG||aH)return w.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}});let C=new TransformStream;return w.push(C.readable),q({span:c,postponed:p.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(C.writable)}).catch(a=>{C.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})};if(!a$||!aZ)return k=aY.getActiveScopeSpan(),await aY.withPropagatedContext(a.headers,()=>aY.trace(i.BaseServerSpan.handleRequest,{spanName:`${aX} ${W}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aX,"http.target":a.url}},s),void 0,!a$);await s(aZ)}catch(b){throw b instanceof C.NoFallbackError||await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}}},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53471:(a,b,c)=>{"use strict";function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(8689)},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},56015:(a,b,c)=>{"use strict";c.d(b,{aB:()=>g,xE:()=>f});var d=c(24987);function e(a){if(!Array.isArray(a))return[];let b=new Set,c=[];for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e=a.toLowerCase();b.has(e)||(b.add(e),c.push(a))}return c}function f(a,b){if(1!==a&&!0!==a)return{restricted:!1,allow:[]};let c=[];if("string"==typeof b&&b)try{c=JSON.parse(b)}catch{c=[]}return{restricted:!0,allow:e(c)}}function g(a){let b=a||d.M0;return{accessRestricted:+!!b.restricted,accessAllow:JSON.stringify(b.restricted?e(b.allow):[])}}},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60396:(a,b,c)=>{"use strict";let d;c.r(b),c.d(b,{"405b7b833b5fbb4a342041e03e42294fe2a97a6aca":()=>aD});var e=c(95349),f=c(81200);c(70339),c(36888);let g=(a,b="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${b} must be ${a}`);async function h(a,b,c){return b instanceof Uint8Array?crypto.subtle.importKey("raw",b,a.subtle,!1,[c]):(!function(a,b,c){let d=a.algorithm;if(d.name!==b.name)throw g(b.name);if(b.hash&&d.hash?.name!==b.hash)throw g(b.hash,"algorithm.hash");if(b.namedCurve&&d.namedCurve!==b.namedCurve)throw g(b.namedCurve,"algorithm.namedCurve");if(void 0!==b.length&&d.length!==b.length)throw g(b.length,"algorithm.length");if(c&&!a.usages.includes(c))throw TypeError(`CryptoKey does not support this operation, its usages must include ${c}.`)}(b,a.subtle,c),a.minRsaBits&&function(a,b){let{modulusLength:c}=b.algorithm;if("number"!=typeof c||c<2048)throw TypeError(`${a} requires key modulusLength to be 2048 bits or larger`)}(a.alg,b),b)}async function i(a,b,c,d){let e=await h(a,b,"verify");try{return await crypto.subtle.verify(a.signing,e,c,d)}catch{return!1}}class j extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(a,b){super(a,b),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class k extends j{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(a,b,c="unspecified",d="unspecified"){super(a,{cause:{claim:c,reason:d,payload:b}}),this.claim=c,this.reason=d,this.payload=b}}class l extends j{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(a,b,c="unspecified",d="unspecified"){super(a,{cause:{claim:c,reason:d,payload:b}}),this.claim=c,this.reason=d,this.payload=b}}class m extends j{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class n extends j{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class o extends j{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class p extends j{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class q extends j{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(a="multiple matching keys found in the JSON Web Key Set",b){super(a,b)}}class r extends j{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(a="signature verification failed",b){super(a,b)}}let s=[["verify"],["sign"]];function t(a){let b={name:"HMAC",hash:`SHA-${a}`};return{kty:["oct"],secret:!0,subtle:b,signing:b,usages:s}}function u(a,b){let c={name:b?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${a}`};return{kty:["RSA"],subtle:c,signing:b?{...c,saltLength:b}:c,usages:s,minRsaBits:2048}}function v(a,b){return{kty:["EC"],crv:a,subtle:{name:"ECDSA",namedCurve:a},signing:{name:"ECDSA",hash:`SHA-${b}`},usages:s}}function w(){let a={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:a,signing:a,usages:s}}function x(a){let b={name:`ML-DSA-${a}`};return{kty:["AKP"],subtle:b,signing:b,usages:s}}let y=function(a){let b={__proto__:null};for(let c in a)b[c]={...a[c],alg:c};return b}({HS256:t(256),HS384:t(384),HS512:t(512),RS256:u(256),RS384:u(384),RS512:u(512),PS256:u(256,32),PS384:u(384,48),PS512:u(512,64),ES256:v("P-256",256),ES384:v("P-384",384),ES512:v("P-521",512),EdDSA:w(),Ed25519:w(),"ML-DSA-44":x(44),"ML-DSA-65":x(65),"ML-DSA-87":x(87)}),z=new TextEncoder,A=new TextDecoder,B=new TextDecoder("utf-8",{fatal:!0});function C(a){let b=new Uint8Array(a.length);for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);if(d>127)throw TypeError("non-ASCII string encountered in encode()");b[c]=d}return b}let D="The input to be decoded is not correctly encoded.";function E(a){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64("string"==typeof a?a:A.decode(a),{alphabet:"base64url"})}catch(a){throw TypeError(D,{cause:a})}let b=a;if(b instanceof Uint8Array&&(b=A.decode(b)),b.includes("+")||b.includes("/"))throw TypeError(D);b=b.replace(/-/g,"+").replace(/_/g,"/");try{var c=b;if(Uint8Array.fromBase64)return Uint8Array.fromBase64(c);let a=atob(c),d=new Uint8Array(a.length);for(let b=0;b<a.length;b++)d[b]=a.charCodeAt(b);return d}catch{throw TypeError(D)}}function F(a){if("object"!=typeof a||null===a||"[object Object]"!==Object.prototype.toString.call(a))return!1;let b=Object.getPrototypeOf(a);if(null===b)return!0;let c=b;for(;null!==Object.getPrototypeOf(c);)c=Object.getPrototypeOf(c);return b===c}function G(a,b,c){try{return E(a)}catch{throw new c(`Failed to base64url decode the ${b}`)}}Symbol();let H={__proto__:null,b64:!0},I=(a,b,...c)=>(function(a,b,...c){if(c.length>2){let b=c.pop();a+=`one of type ${c.join(", ")}, or ${b}.`}else 2===c.length?a+=`one of type ${c[0]} or ${c[1]}.`:a+=`of type ${c[0]}.`;return null==b?a+=` Received ${b}`:"function"==typeof b&&b.name?a+=` Received function ${b.name}`:"object"==typeof b&&null!=b&&b.constructor?.name&&(a+=` Received an instance of ${b.constructor.name}`),a})(`Key for the ${a} algorithm must be `,b,...c),J=a=>{if(a?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return a instanceof CryptoKey}catch{return!1}};async function K(a,b){if("RSA"===b.kty&&"oth"in b&&void 0!==b.oth)throw new n('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!a.kty.includes(b.kty))throw new n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let c=a.resolve?.({kty:b.kty,crv:b.crv})??a.subtle,d=!!(b.d||b.priv),e={...b};return"AKP"!==e.kty&&delete e.alg,delete e.use,crypto.subtle.importKey("jwk",e,c,b.ext??!d,b.key_ops??a.usages[+!!d])}let L=a=>a[Symbol.toStringTag],M={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function N(a,b,c){let e=(d||=new WeakMap).get(a);return c&&(e?e[b]=c:d.set(a,{[b]:c})),c??e?.[b]}let O=async(a,b,c)=>N(a,c.alg)??N(a,c.alg,await K(c,{...b,alg:c.alg}));async function P(a,b,c){let d=function(a,b,c){let{alg:d,secret:e}=a,f="decrypt"===c||"sign"===c;if(e&&b instanceof Uint8Array)return[0,b];if(F(b)&&"string"==typeof b.kty){if(e?"oct"!==b.kty||"string"!=typeof b.k:!(f?"oct"!==b.kty&&("AKP"===b.kty&&"string"==typeof b.priv||"string"==typeof b.d):"oct"!==b.kty&&void 0===b.d&&void 0===b.priv))throw TypeError(e?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${f?"private":"public"} JWK`);return((a,b,c)=>{let{alg:d}=a;if(void 0!==b.use){let a="sign"===c||"verify"===c?"sig":"enc";if(b.use!==a)throw TypeError(`Invalid key for this operation, its "use" must be "${a}" when present`)}if(void 0!==b.alg&&b.alg!==d)throw TypeError(`Invalid key for this operation, its "alg" must be "${d}" when present`);if(Array.isArray(b.key_ops)){let d="encrypt"===c||"decrypt"===c?a.ops?.[+("encrypt"!==c)]:c;if(d&&!b.key_ops.includes(d))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${d}" when present`)}})(a,b,c),[3,b]}if(!(J(b)||b?.[Symbol.toStringTag]==="KeyObject"))throw TypeError(e?I(d,b,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):I(d,b,"CryptoKey","KeyObject","JSON Web Key"));if(e){if("secret"!==b.type)throw TypeError(`${L(b)} instances for symmetric algorithms must be of type "secret"`)}else{if("secret"===b.type)throw TypeError(`${L(b)} instances for asymmetric algorithms must not be of type "secret"`);let a=f?"private":"public";if(("public"===b.type||"private"===b.type)&&b.type!==a){let d="sign"===c?"signing":"verify"===c?"verifying":`${c.slice(0,-1)}tion`;throw TypeError(`${L(b)} instances for asymmetric algorithm ${d} must be of type "${a}"`)}}return J(b)?[1,b]:[2,b]}(a,b,c);switch(d[0]){case 0:case 1:return d[1];case 3:{let b=d[1];if(b.k)return E(b.k);if(!Object.isFrozen(b)){let{key_ops:a}=b;Array.isArray(a)&&Object.freeze(a),Object.freeze(b)}return O(b,b,a)}case 2:{let b=d[1];if("secret"===b.type)return b.export();if("toCryptoKey"in b&&"function"==typeof b.toCryptoKey)return((a,b)=>{let c=N(a,b.alg);if(c)return c;let d="public"===a.type,e=b.usages[+!d],{asymmetricKeyType:f}=a,g=M[a.asymmetricKeyDetails?.namedCurve],h=b.resolve?.({crv:g,asymmetricKeyType:f})??b.subtle;return N(a,b.alg,a.toCryptoKey(h,d,e))})(b,a);return O(b,b.export({format:"jwk"}),a)}}}async function Q(a,b,c){let d,{protected:e,header:f,payload:g}=a,h={};if(e&&(h=function(a,b,c){let d;try{d=JSON.parse(B.decode(E(a)))}catch{throw new b(c)}if(!F(d))throw new b(c);return d}(e,o,"JWS Protected Header is invalid")),void 0!==f){if(!function(...a){let b=new Set;for(let c of a)if(c)for(let a of Object.keys(c)){if(b.has(a))return!1;b.add(a)}return!0}(h,f))throw new o("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");d={...h,...f}}else d=h;let j=function(a,b,c,d,e){if(void 0!==e.crit&&d?.crit===void 0)throw new a('"crit" (Critical) Header Parameter MUST be integrity protected');if(!d||void 0===d.crit)return[];if(!Array.isArray(d.crit)||0===d.crit.length||d.crit.some(a=>"string"!=typeof a||0===a.length))throw new a('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let f=void 0===c?b:{__proto__:null,...c,...b};for(let b of d.crit){if(!(b in f))throw new n(`Extension Header Parameter "${b}" is not recognized`);if(!Object.hasOwn(e,b)||void 0===e[b])throw new a(`Extension Header Parameter "${b}" is missing`);if(f[b]&&(!Object.hasOwn(d,b)||void 0===d[b]))throw new a(`Extension Header Parameter "${b}" MUST be integrity protected`)}return d.crit}(o,H,b[1],h,d),k=!0;if(j.includes("b64")&&"boolean"!=typeof(k=h.b64))throw new o('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:l}=d;if("string"!=typeof l||!l)throw new o('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(l))throw new m('"alg" (Algorithm) Header Parameter value not allowed');if(k){if("string"!=typeof g)throw new o("JWS Payload must be a string")}else if("string"!=typeof g&&!(g instanceof Uint8Array))throw new o("JWS Payload must be a string or an Uint8Array instance");let p=!1;"function"==typeof c&&(c=await c(h,a),p=!0);let q=function(a){let b=y[a];if(!b)throw new n(`alg ${a} is not supported either by JOSE or your javascript runtime`);return b}(l),s=function(...a){let b=new Uint8Array(a.reduce((a,{length:b})=>a+b,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}(void 0!==e?C(e):new Uint8Array,C("."),"string"==typeof g?k?b[2]??=function(a,b,c){try{return C(a)}catch{throw new c(`The ${b} is not a valid base64url string`)}}(g,"payload",o):z.encode(g):g),t=G(a.signature,"signature",o),u=await P(q,c,"verify");if(!await i(q,u,t,s))throw new r;return[k?G(g,"payload",o):"string"==typeof g?z.encode(g):g,h,k,u,p]}async function R(a,b,c){if(a instanceof Uint8Array&&(a=A.decode(a)),"string"!=typeof a)throw new o("Compact JWS must be a string or Uint8Array");let{0:d,1:e,2:f,length:g}=a.split(".");if(3!==g)throw new o("Invalid Compact JWS");return Q({payload:e,protected:d,signature:f},b,c)}let S={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},T=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,U="check_failed";function V(a){let b=T.exec(a);if(!b||b[4]&&b[1])throw TypeError("Invalid time period format");let c=Math.round(parseFloat(b[2])*S[b[3][0].toLowerCase()]);return"-"===b[1]||"ago"===b[4]?-c:c}function W(a,b){if(!Number.isFinite(b))throw TypeError(`Invalid ${a} input`);return b}let X=a=>a.includes("/")?a.toLowerCase():`application/${a.toLowerCase()}`;function Y(a,b,c=!1){let d=a[b];if(void 0!==d||c){if("number"!=typeof d)throw new k(`"${b}" claim must be a number`,a,b,"invalid");return d}}function Z(a,b){throw new k(`unexpected "${b}" claim value`,a,b,U)}async function $(a,b,c){let d=await R(a,[c&&function(a,b){if(void 0!==b&&(!Array.isArray(b)||b.some(a=>"string"!=typeof a)))throw TypeError(`"${a}" option must be an array of strings`);if(b)return new Set(b)}("algorithms",c.algorithms),c?.crit],b);if(!d[2])throw new p("JWTs MUST NOT use unencoded payload");let e={payload:function(a,b,c={}){var d,e;let f;try{f=JSON.parse(B.decode(b))}catch{}if(!F(f))throw new p("JWT Claims Set must be a top-level JSON object");let{typ:g}=c;if(g&&("string"!=typeof a.typ||X(a.typ)!==X(g)))throw new k('unexpected "typ" JWT header value',f,"typ",U);let{requiredClaims:h=[],issuer:i,subject:j,audience:m,maxTokenAge:n}=c,o=[...h];for(let a of(void 0!==n&&o.push("iat"),void 0!==m&&o.push("aud"),void 0!==j&&o.push("sub"),void 0!==i&&o.push("iss"),new Set(o.reverse())))if(!Object.hasOwn(f,a))throw new k(`missing required "${a}" claim`,f,a,"missing");void 0===i||(Array.isArray(i)?i:[i]).includes(f.iss)||Z(f,"iss"),void 0!==j&&f.sub!==j&&Z(f,"sub"),void 0===m||(d=f.aud,e="string"==typeof m?[m]:m,"string"==typeof d?e.includes(d):!!Array.isArray(d)&&e.some(a=>d.includes(a)))||Z(f,"aud");let{clockTolerance:q}=c,r=0;if("string"==typeof q)r=V(q);else if(void 0!==q){if("number"!=typeof q)throw TypeError("Invalid clockTolerance option type");r=q}W("clockTolerance option",r);let{currentDate:s}=c,t=W("currentDate option",Math.floor((s||new Date).getTime()/1e3)),u=Y(f,"iat",void 0!==n),v=Y(f,"nbf");if(void 0!==v&&v>t+r)throw new k('"nbf" claim timestamp check failed',f,"nbf",U);let w=Y(f,"exp");if(void 0!==w&&w<=t-r)throw new l('"exp" claim timestamp check failed',f,"exp",U);if(void 0!==n){let a=t-u;if(a-r>("number"==typeof n?n:V(n)))throw new l('"iat" claim timestamp check failed (too far in the past)',f,"iat",U);if(a<0-r)throw new k('"iat" claim timestamp check failed (it should be in the past)',f,"iat",U)}return f}(d[1],d[0],c),protectedHeader:d[1]};return"function"==typeof b?{...e,key:d[3]}:e}c(55511);"function"==typeof setImmediate||"object"==typeof scheduler&&"function"==typeof scheduler.postTask&&scheduler.postTask.bind(scheduler);var _=c(73024),aa=c.n(_),ab=c(76760),ac=c.n(ab),ad=c(77598),ae=c.n(ad),af=c(28817),ag=c(8689);c(56015),c(24987),c(67576);var ah=c(46737);c(93454),c(25129),c(24362);var ai=c(65003);(0,ai.U)("modelAliases"),(0,ai.U)("customModels"),(0,ai.U)("mitmAlias"),(0,ai.U)("modelCaps"),c(11015);var aj=c(94735);c(53471),global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new aj.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._pendingRequests,global._lastErrorProvider,global._pendingTimers,global._recentRing,global._connectionMapCache,global._statsEmitTimers,global._statsEmitter;var ak=c(37461),al=c(86734);let am=null,an=0;function ao(a,b){let c=a[b];return void 0===c||""===c.trim()?null:"true"===c.trim().toLowerCase()}async function ap(){if(am&&Date.now()-an<5e3)return am;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,67576)),b=await a();am={enabled:function(a,b=process.env){let c=ao(b,"OBSERVABILITY_ENABLED");if(null!==c)return c;let d=ao(b,"ENABLE_REQUEST_LOGS");return null!==d?d:a?.enableObservability===!0}(b),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{am={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return an=Date.now(),am}let aq=[],ar=null,as=!1;function at(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}function au(a,b){let c=at(a,b);return c?._truncated&&a&&"object"==typeof a&&void 0!==a.tools?{...c,tools:at(a.tools,65536)}:c}async function av(){if(!as&&0!==aq.length){as=!0;try{for(;aq.length>0;){let a=aq.splice(0,aq.length),b=await (0,ag.c)(),c=await ap();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,apiKey:d.apiKey||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:au(d.request,c.maxJsonSize),providerRequest:au(d.providerRequest,c.maxJsonSize),providerResponse:at(d.providerResponse,c.maxJsonSize),response:at(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0,convoy:d.convoy||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,ak.s)(a)])}}),setImmediate(()=>{aw(b,c.maxRecords).catch(a=>console.error("[requestDetailsRepo] async prune failed:",a))})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{as=!1}}}async function aw(a,b){try{let c=a.get("SELECT COUNT(*) as c FROM requestDetails");c&&c.c>b&&a.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[c.c-b])}catch(a){console.error("[requestDetailsRepo] pruneOldRecords error:",a)}}let ax=async()=>{ar&&(clearTimeout(ar),ar=null),aq.length>0&&await av()};async function ay(a){return!!(await (0,ag.c)()).get("SELECT 1 FROM kv WHERE scope = ? AND key = ?",["revokedDashboardSessions",a])}(0,al.Bb)(ax);let az=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=ac().join(af.n,"jwt-secret");try{let b=aa().readFileSync(a,"utf8").trim();if(b)return b}catch{}try{aa().mkdirSync(af.n,{recursive:!0});let b=ae().randomBytes(32).toString("hex");return aa().writeFileSync(a,b,{mode:384}),b}catch{return"ezrouter-fallback-jwt-secret-key-32-chars-minimum"}}());async function aA(a){return await aC(a)!==null}async function aB(a){if("string"!=typeof a||!a)return null;try{let{payload:b}=await $(a,az,{algorithms:["HS256"]});return!0===b.authenticated&&Number.isFinite(b.exp)?b:null}catch{return null}}async function aC(a){let b=await aB(a);if(!b)return null;try{return await ay(ae().createHash("sha256").update(a).digest("hex"))?null:b}catch{return null}}async function aD(a){let b=(await (0,f.U)()).get("auth_token")?.value;return await aA(b)?"string"==typeof a&&a?{connections:(await (0,ah.getProviderConnections)({provider:a})).map(a=>({id:a.id,name:a.displayName||a.name||a.email||a.id,authType:a.authType,key:a.apiKey||a.accessToken||""}))}:{error:"Bad provider"}:{error:"Unauthorized"}}(0,c(89337).D)([aD]),(0,e.A)(aD,"405b7b833b5fbb4a342041e03e42294fe2a97a6aca",null)},60944:(a,b,c)=>{"use strict";a.exports=c(7553).vendored["react-rsc"].ReactServerDOMWebpackServer},61745:(a,b,c)=>{"use strict";c.d(b,{cI:()=>h,pH:()=>g,Ps:()=>f});function d(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}function e(a,b){let c=process.env[a]?.trim().toLowerCase();return"true"===c||"1"===c||"false"!==c&&"0"!==c&&b}[...["model is not supported","model not supported","model not found","model does not exist","unknown model","invalid model","modelerror"].map(a=>({text:a,permanent:!0})),...[/\bmodel\s+\S+\s+is\s+not\s+supported\b/,/\bmodel\s+\S+\s+(?:does\s+not\s+exist|not\s+found)\b/].map(a=>({pattern:a,permanent:!0})),...[/upstream request failed:\s*\[invalid_request_error\]/].map(a=>({pattern:a,permanent:!0}))];let f=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search";d("STREAM_STALL_TIMEOUT_MS",36e4),d("STREAM_FIRST_CHUNK_TIMEOUT_MS",3e4),(()=>{let a=process.env.SSE_KEEPALIVE_MS;if(null!=a&&""!==a)return Number.isFinite(parseInt(a,10))})(),e("ALLOW_INSECURE_TLS_FALLBACK",!1)&&e("STRICT_SSL",!1),d("EMPTY_PEEK_DEADLINE_MS",45e3);let g=d("FETCH_CONNECT_TIMEOUT_MS",6e4);d("RESPONSE_BODY_TIMEOUT_MS",3e5),d("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3);let h={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65003:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(8689),e=c(37461);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},65242:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>aw});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(29225),k=c(50412),l=c(92592),m=c(91431),n=c(25144),o=c(80212),p=c(24630),q=c(41739);let r=["none","low","medium","high"],s=["none","thinking"],t=["none","low","medium","high","max"],u=["none","low","medium","high","xhigh","max"],v={qoder:u,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":u,"claude-budget":u,"gemini-level":["minimal","low","medium","high"],"gemini-budget":r,zai:s,qwen:r,kimi:t,opencode:t,deepseek:["none","high","max"],minimax:s,hunyuan:r,step:r,nous:r,meta:["minimal","low","medium","high","xhigh"],ollama:t},w=["none","minimal","low","medium","high","xhigh","max"],x=["none","low","medium","high","max"],y=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:x},{pattern:"*claude*4-6*",levels:x},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"qoder",pattern:"*",levels:u},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]},{pattern:"*glm-5.3",levels:["low","high","max"]}];function z(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,n.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,q.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=y.find(c=>(!c.providers||!a||c.providers.includes(a))&&(!c.provider||c.provider===a)&&(0,o.gH)(c.pattern,b)),g=(a?p.xq[a]?.thinkingFormat:null)||c.thinkingFormat,h=e||c.thinkingLevels||f?.levels||v[g]||r;return!1===c.thinkingCanDisable&&(h=h.filter(a=>"none"!==a)),h}var A=c(50377),B=c(29476),C=c(99258);function D({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var E=c(49885),F=c.n(E),G=c(74869),H=c(30389);function I({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let{getPricing:q}=(0,G.e)(),r=p?`${b}(${p})`:b,s=b.includes("/")?b.slice(0,b.indexOf("/")):null,t=(0,H.M4)(o,q(s,a.id)),u="ok"===g?"#22c55e":"error"===g?"#ef4444":"slow"===g||"rate_limited"===g?"#f59e0b":void 0;return(0,d.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"slow"===g||"rate_limited"===g?"border-amber-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:u?{color:u}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"slow"===g||"rate_limited"===g?"warning":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:r}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(k.nh,{caps:o,colorOverride:"text-text-muted/70",size:12}),t&&(0,d.jsx)("span",{className:"truncate text-[9px] text-text-muted/70",children:t})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(r,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function J({isOpen:a,onClose:b,connectionId:c,providerStorageAlias:f,existingIds:g,transformId:h,onImported:i}){let[j,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)(()=>new Set),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),A=(0,e.useMemo)(()=>q.map(a=>({...a,added:g?.has(a.id)===!0})),[q,g]),B=(0,e.useMemo)(()=>{let a=u.trim().toLowerCase();return a?A.filter(b=>b.id.toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)):A},[A,u]),C=B.filter(a=>!a.added),D=C.length>0&&C.every(a=>s.has(a.id)),E=async()=>{if(!w&&0!==s.size){x(!0),n("");try{let a=await fetch("/api/models/custom/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:f,type:"llm",ids:[...s]})}),b=await a.json();if(!a.ok)return void n(b.error||"Import failed");z(b),i?.()}catch(a){n(a.message||"Network error")}finally{x(!1)}}};return(0,d.jsx)(k.aF,{isOpen:a,title:"Import Models from Provider",onClose:b,children:(0,d.jsx)("div",{className:"flex flex-col gap-3",children:y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-sm text-text-main",children:["Imported ",y.added," model",1===y.added?"":"s",y.skipped>0?`, ${y.skipped} already existed`:"","."]}),(0,d.jsx)(k.$n,{onClick:b,fullWidth:!0,children:"Done"})]}):(0,d.jsxs)(d.Fragment,{children:[m&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:m}),o&&!m&&(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400 break-words",children:o}),j?(0,d.jsxs)("p",{className:"text-sm text-text-muted py-6 text-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm align-middle mr-1",style:{animation:"spin 1s linear infinite"},children:"progress_activity"}),"Fetching models from provider..."]}):q.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"Search models...",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:D,onChange:()=>{t(a=>{let b=new Set(a);if(D)for(let a of C)b.delete(a.id);else for(let a of C)b.add(a.id);return b})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All (",C.length," available",B.length!==A.length?`, ${B.length} shown`:"",")"]}),(0,d.jsxs)("div",{className:"flex max-h-72 flex-col gap-1 overflow-y-auto custom-scrollbar pr-1",children:[B.map(a=>(0,d.jsxs)("label",{className:`flex items-center gap-2 rounded-lg border px-2.5 py-1.5 text-xs ${a.added?"border-border opacity-50":"border-border hover:border-primary/40 cursor-pointer"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:a.added||s.has(a.id),disabled:a.added,onChange:()=>{var b;return b=a.id,void t(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",children:a.id}),a.name&&(0,d.jsx)("span",{className:"truncate text-text-muted/70 italic",children:a.name}),a.added&&(0,d.jsx)("span",{className:"shrink-0 text-[10px] text-text-muted",children:"added"})]},a.id)),0===B.length&&(0,d.jsx)("p",{className:"py-4 text-center text-xs text-text-muted",children:"No models match the search"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:E,fullWidth:!0,disabled:0===s.size||w,children:w?"Importing...":`Import Selected (${s.size})`}),(0,d.jsx)(k.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:w,children:"Cancel"})]})]}),!j&&0===q.length&&!m&&(0,d.jsx)(k.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Close"})]})})})}function K({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/50":"error"===h?"border-red-500/50":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function L({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:l,connections:m,isAnthropic:n,onModelsChanged:o,importSupported:p=!1}){let[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)({}),A=async b=>{if(!w){x(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();z(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{z(a=>({...a,[b]:"error"}))}finally{x(null)}}},B=D({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),C=async()=>{if(!q.trim()||s)return;let a=q.trim();if(B.some(b=>b.id===a))return void alert("Model already exists for this provider.");t(!0);try{await j(a),r("")}catch(a){console.log("Error adding model:",a)}finally{t(!1)}},E=m.find(a=>!1!==a.isActive)?.id||null,F=!!E&&!0===p,G=new Set(B.map(a=>a.id));return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:n?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:C,disabled:!q.trim()||s,children:s?"Adding...":"Add"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"download",onClick:()=>v(!0),disabled:!F,children:"Import from /models"})]}),!F&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:E?"Set a Base URL on the active connection to enable importing models.":"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({id:c,alias:e,source:f})=>(0,d.jsx)(K,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>A(c):void 0,testStatus:y[c],isTesting:w===c},`${f}-${a}/${c}`))}),(0,d.jsx)(J,{isOpen:u,onClose:()=>v(!1),connectionId:E,providerStorageAlias:a,existingIds:G,onImported:o})]})}function M({isOpen:a,onClose:b,providerId:c,providerAlias:f,connections:g,customModels:h,disabledModelIds:i,onSaved:j}){let[l,m]=(0,e.useState)([]),[n,o]=(0,e.useState)(()=>new Set),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)("");(0,e.useMemo)(()=>(g||[]).filter(a=>!1!==a.isActive&&a.id).map(a=>a.id),[g]);let x=(0,e.useMemo)(()=>(h||[]).filter(a=>a.providerAlias===f&&"llm"===(a.kind||a.type||"llm")).map(a=>({id:String(a.id).trim(),name:a.name||a.id})).filter(a=>a.id),[h,f]),y=(0,e.useMemo)(()=>{let a=p.trim().toLowerCase();return a?l.filter(b=>b.id.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)):l},[l,p]),z=async()=>{u(!0),w("");try{let a=Array.from(n),c=await fetch("/api/models/enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:f,ids:a})});if(!c.ok){let a=await c.json().catch(()=>({}));throw Error(a.error||`Failed to save (${c.status})`)}j?.(a),b()}catch(a){w(a?.message||"Failed to save visible models")}finally{u(!1)}};return(0,d.jsx)(k.aF,{isOpen:a,onClose:b,title:"Visible models",size:"lg",footer:null,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/8 px-2.5 py-2 text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-primary",style:{fontSize:"14px"},children:"info"}),(0,d.jsxs)("span",{children:["Only the checked models are exposed on ",(0,d.jsx)("code",{className:"font-mono",children:"/v1/models"}),". Leave everything unchecked to expose all of them. Custom models are always exposed."]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:p,onChange:a=>q(a.target.value),className:"w-full rounded border border-border bg-surface py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:()=>o(new Set(l.map(a=>a.id))),disabled:r||t,children:"Select all"}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:()=>o(new Set),disabled:r||t,children:"Clear"})]}),v&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:v}),r?(0,d.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"Loading models…"}):(0,d.jsxs)("div",{className:"max-h-[360px] overflow-y-auto rounded-lg border border-border",children:[y.map(a=>(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 border-b border-border/50 px-3 py-2 last:border-b-0 hover:bg-sidebar/50",children:[(0,d.jsx)("input",{type:"checkbox",checked:n.has(a.id),onChange:()=>{var b;return b=a.id,void o(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"size-3.5 accent-primary cursor-pointer"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-main",children:a.name}),(0,d.jsx)("code",{className:"truncate font-mono text-[11px] text-text-muted",children:a.id}),a.live&&!a.stale&&(0,d.jsx)("span",{className:"ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"live"}),a.stale&&(0,d.jsx)("span",{className:"ml-auto shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:"not in catalog"})]},a.id)),0===y.length&&(0,d.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"No models found"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("p",{className:"mb-1 text-[11px] text-text-muted",children:"Always exposed (custom models)"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:x.map(a=>(0,d.jsx)("span",{className:"rounded bg-sidebar px-1.5 py-0.5 font-mono text-[11px] text-text-muted",children:a.id},a.id))})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-[11px] text-text-muted",children:0===n.size?"Nothing selected — all models stay visible.":`${n.size} of ${l.length} selected`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:b,disabled:t,children:"Cancel"}),(0,d.jsx)(k.$n,{variant:"primary",size:"sm",onClick:z,loading:t,disabled:r,children:"Save"})]})]})]})})}I.propTypes={model:F().shape({id:F().string.isRequired}).isRequired,fullModel:F().string.isRequired,alias:F().string,copied:F().string,onCopy:F().func.isRequired,testStatus:F().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:F().bool,isFree:F().bool,onDeleteAlias:F().func,onTest:F().func,isTesting:F().bool,onDisable:F().func,caps:F().object,thinkingSuffix:F().string},F().string.isRequired,F().string.isRequired,F().string,F().func.isRequired,F().func.isRequired,F().func,F().oneOf(["ok","error"]),F().bool,F().string.isRequired,F().object.isRequired,F().arrayOf(F().object),F().string,F().func.isRequired,F().func.isRequired,F().func.isRequired,F().func.isRequired,J.propTypes={isOpen:F().bool.isRequired,onClose:F().func.isRequired,connectionId:F().string,providerStorageAlias:F().string.isRequired,existingIds:F().instanceOf(Set),transformId:F().func,onImported:F().func},K.propTypes={modelId:F().string.isRequired,fullModel:F().string.isRequired,copied:F().string,onCopy:F().func.isRequired,onDeleteAlias:F().func.isRequired,onTest:F().func,testStatus:F().string,isTesting:F().bool},L.propTypes={providerStorageAlias:F().string.isRequired,providerDisplayAlias:F().string.isRequired,modelAliases:F().object.isRequired,customModels:F().arrayOf(F().object),copied:F().string,onCopy:F().func.isRequired,onDeleteAlias:F().func.isRequired,onAddCustomModel:F().func.isRequired,onDeleteCustomModel:F().func.isRequired,connections:F().arrayOf(F().shape({id:F().string,isActive:F().bool})).isRequired,isAnthropic:F().bool,onModelsChanged:F().func,importSupported:F().bool},M.propTypes={isOpen:F().bool.isRequired,onClose:F().func.isRequired,providerId:F().string.isRequired,providerAlias:F().string.isRequired,connections:F().arrayOf(F().object),customModels:F().arrayOf(F().object),disabledModelIds:F().arrayOf(F().string),onSaved:F().func};var N=c(74429),O=c(74875);function P({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}P.propTypes={until:F().string.isRequired};var Q=c(26177),R=c(7859),S=c(94916);let T=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function U(a){if(!a||"string"!=typeof a)return!1;let b=a.toLowerCase();return T.some(a=>b.includes(a))}function V({connection:a,plan:b=null,proxyPools:c,isOAuth:f,isFirst:g,isLast:h,onMoveUp:i,onMoveDown:j,onToggleActive:l,onUpdateProxy:m,onEdit:n,onDelete:o,onReconnect:p=null,oneByOneStatus:q=null,autoPing:r=null,fastMode:s=null}){let[t,u]=(0,e.useState)(!1),v=(0,S.gr)(a.providerSpecificData?.quotaReserve),w=S.vP.filter(a=>v[a.id]).map(a=>`${a.label} ${v[a.id]}%`).join(" \xb7 "),[x,y]=(0,e.useState)(!1),[z,B]=(0,e.useState)(!1),C=(0,e.useRef)(null),D=(0,e.useRef)(null),[E,F]=(0,e.useState)(null),{copied:G,copy:H}=(0,A.C)(),I=`conn-id-${a.id}`,J=async()=>{if(s?.onToggle&&!z){B(!0);try{await s.onToggle(!s.on)}catch(a){console.error("Failed to toggle fast mode:",a)}finally{B(!1)}}},K=new Map((c||[]).map(a=>[a.id,a])),L=a.providerSpecificData?.proxyPoolId||null,M=L?K.get(L):null,T=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,W=!!L||T,X=M?`Pool: ${M.name}`:L?`Pool: ${L} (inactive/missing)`:T?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",Y=(()=>{if(!r)return"";let a=[];return(r.reactiveOn&&a.push("On reset"),r.scheduleOn&&a.push(`Scheduled (${r.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===r.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),Z="";if(M?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=M?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);Z=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{Z=b}}let $=M?.noProxy||a.providerSpecificData?.connectionNoProxy||"",_="default";M?.isActive===!0?_="success":(L||T)&&(_="error");let aa=async a=>{y(!0);try{await m("__none__"===a?null:a)}finally{y(!1),u(!1)}},ab=a.authType||(f?"oauth":"apikey"),ac="oauth"===ab,ad="cookie"===ab,ae=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(ac?"OAuth Account":ad?"Cookie Account":"API Key"),af=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,ag=b?.trim(),ah=a.providerSpecificData?.chatgptPlanType?.trim(),ai="codex"===a.provider?ag&&"unknown"!==ag.toLowerCase()?ag:ah:null,[aj,ak]=(0,e.useState)(!1),al=(0,Q.kJ)(a),am="unavailable"!==a.testStatus||aj?a.testStatus:"active",an=(ac||ad)&&"unavailable"===a.testStatus&&function(a,b){if(401===a||403===a)return!0;if(!b||"string"!=typeof b)return!1;let c=b.toLowerCase();return c.includes("unauthorized")||c.includes("token")||c.includes("invalid api key")||c.includes("revoked")||c.includes("auth")||U(b)}(a.errorCode,a.lastError),ao=U(a.lastError)?"Auth expired — reconnect required":a.lastError,ap=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:j,disabled:h,className:`p-0.5 rounded ${h?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:ad?"cookie":ac?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:ae}),af&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:af}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(k.Ex,{variant:(0,O.g)(a.isActive,am),size:"sm",dot:!0,children:!1===a.isActive?"disabled":am||"Unknown"}),(0,d.jsx)(k.Ex,{variant:"default",size:"sm",children:ac?"OAuth":ad?"Cookie":"API Key"}),ai&&"unknown"!==ai.toLowerCase()&&(0,d.jsx)(k.Ex,{variant:"primary",size:"sm",children:ai}),W&&(0,d.jsx)(k.Ex,{variant:_,size:"sm",children:"Proxy"}),aj&&!1!==a.isActive&&(0,d.jsx)(P,{until:al}),a.lastError&&!1!==a.isActive&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:ao}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),(0,d.jsxs)("button",{type:"button",onClick:()=>H(a.id||"",I),title:"Copy connection ID — send it as the x-connection-id request header to pin requests to this account (falls back to other accounts when it is unavailable)",className:"flex items-center gap-0.5 rounded font-mono text-[11px] text-text-muted transition-colors hover:text-primary",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xs",children:G===I?"check":"content_copy"}),G===I?"copied":`${(a.id||"").slice(0,8)}…`]}),w&&(0,d.jsx)(k.m_,{text:"Quota kept in reserve: requests move to the next account at this share",children:(0,d.jsx)(k.Ex,{variant:"default",size:"sm",icon:"savings",children:w})}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),ap()&&(0,d.jsx)(k.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:ap()})]}),W&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:X,children:X}),Z&&(0,d.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:Z}),$&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(c||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:D,onClick:()=>{if(t)return void u(!1);let a=D.current?.getBoundingClientRect();if(!a)return void u(!0);let b=((c?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<b&&a.top>d;F({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),u(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${W?"text-primary":"text-text-muted hover:text-primary"}`,disabled:x,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:x?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),t&&(0,N.createPortal)((0,d.jsxs)("div",{ref:C,style:E,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>aa("__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"}),(c||[]).map(a=>(0,d.jsx)("button",{onClick:()=>aa(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${L===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),s&&(0,d.jsx)(k.m_,{text:"codex"===a.provider?s.on?"Fast mode ON — Codex requests on this account use the priority tier. Click to disable.":"Force fast mode — Codex requests on this account use the priority tier.":"Uses the provider's faster processing mode for this account at a higher token cost. Off by default.",children:(0,d.jsxs)("button",{type:"button",role:"switch","aria-label":"Fast mode","aria-checked":s.on,disabled:z,onClick:J,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 disabled:opacity-50 ${s.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:z?"progress_activity":"speed"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast"})]})}),r&&(0,d.jsx)(k.m_,{text:Y,children:(0,d.jsxs)("button",{onClick:r.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${r.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),an&&p&&(0,d.jsxs)("button",{onClick:()=>p(a),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),r&&(0,d.jsx)(R.A,{connectionId:a.id,disabled:!1===a.isActive}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(k.lM,{size:"sm",checked:a.isActive??!0,onChange:l,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}V.propTypes={connection:F().shape({id:F().string,name:F().string,email:F().string,displayName:F().string,modelLockUntil:F().string,testStatus:F().string,isActive:F().bool,lastError:F().string,priority:F().number,globalPriority:F().number}).isRequired,plan:F().string,proxyPools:F().arrayOf(F().shape({id:F().string,name:F().string,proxyUrl:F().string,noProxy:F().string,isActive:F().bool})),isOAuth:F().bool.isRequired,isFirst:F().bool.isRequired,isLast:F().bool.isRequired,onMoveUp:F().func.isRequired,onMoveDown:F().func.isRequired,onToggleActive:F().func.isRequired,onUpdateProxy:F().func,onEdit:F().func.isRequired,onDelete:F().func.isRequired,onReconnect:F().func,oneByOneStatus:F().shape({state:F().string,error:F().string}),autoPing:F().shape({isActive:F().bool,provider:F().string,reactiveOn:F().bool,scheduleOn:F().bool,scheduleSummary:F().string,onConfigure:F().func}),fastMode:F().shape({on:F().bool,onToggle:F().func})};var W=c(99829);function X({isOpen:a,providerId:b,providerName:c,onClose:f}){let[g,h]=(0,e.useState)([]),[i,j]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),n=async a=>{try{await navigator.clipboard.writeText(a.key),m(a.id),setTimeout(()=>m(b=>b===a.id?null:b),1500)}catch{}},o=async()=>{let a=g.filter(a=>a.key).map(a=>`${a.name}: ${a.key}`).join("\n");try{await navigator.clipboard.writeText(a),m("__all__"),setTimeout(()=>m(a=>"__all__"===a?null:a),1500)}catch{}},p=g.filter(a=>a.key);return(0,d.jsx)(k.aF,{isOpen:a,title:`Export Keys — ${c||b}`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[i&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Loading…"}),!i&&0===p.length&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No keys stored for this provider."}),!i&&p.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-sidebar px-3 py-2",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-xs text-text-muted",children:a.name}),(0,d.jsx)("p",{className:"break-all text-sm font-mono text-text-main",children:a.key})]}),(0,d.jsx)("button",{onClick:()=>n(a),title:"Copy key",className:`shrink-0 rounded p-1.5 hover:bg-black/5 dark:hover:bg-white/5 ${l===a.id?"text-green-500":"text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===a.id?"check":"content_copy"})})]},a.id)),!i&&p.length>0&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{size:"sm",icon:"__all__"===l?"check":"content_copy",onClick:o,children:"__all__"===l?"Copied":"Copy All"}),(0,d.jsx)(k.$n,{size:"sm",variant:"ghost",onClick:f,children:"Close"})]})]})})}W.callServer,W.findSourceMapURL;let Y=`name1|sk-key1
13
+ see more here https://nextjs.org/docs/messages/app-static-to-dynamic-error`),"__NEXT_ERROR_CODE",{value:"E132",enumerable:!1,configurable:!0});if(null==a?void 0:a.stack){let c=a.stack;b.stack=b.message+c.substring(c.indexOf("\n"))}throw b}return{value:{kind:v.CachedRouteKind.APP_PAGE,html:l,headers:q,rscData:m.flightData,postponed:m.postponed,status:m.statusCode,segmentData:m.segmentData},cacheControl:o}},r=async({hasResolved:c,previousCacheEntry:g,isRevalidating:i,span:j,forceStaticRender:k=!1})=>{let l=!1===P.isDev,m=c||b.writableEnded;try{var n;let f;if(ar&&aj&&!g&&!V)return(null==ak?void 0:ak.render404)?await ak.render404(a,b):(b.statusCode=404,b.end("This page could not be found")),null;if(at&&(f=(0,w.parseFallbackField)(at.fallback)),!0===al.experimental.partialFallbacks&&(null==at?void 0:at.fallback)===null&&!aT&&aS.length>0&&(f=w.FallbackMode.PRERENDER),f===w.FallbackMode.PRERENDER&&(0,u.isBot)(av)&&(!aF||ax)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),(null==g?void 0:g.isStale)===-1&&(ar=!0),ar&&(f!==w.FallbackMode.NOT_FOUND||g)&&(f=w.FallbackMode.BLOCKING_STATIC_RENDER),!V&&f!==w.FallbackMode.BLOCKING_STATIC_RENDER&&aV&&!m&&!ah&&_&&(l||!au)){if((l||at)&&f===w.FallbackMode.NOT_FOUND){if(al.adapterPath)return await a0();throw new C.NoFallbackError}if(aF&&(al.cacheComponents?!aL:!az)){let b=l&&"string"==typeof(null==at?void 0:at.fallback)?at.fallback:aq,f=(l||aG)&&(null==at?void 0:at.fallbackRouteParams)?(0,o.createOpaqueFallbackRouteParams)(at.fallbackRouteParams):aI?(0,o.getFallbackRouteParams)(aq,P):null;aG&&f&&(0,h.addRequestMeta)(a,"fallbackParams",f);let g=await P.handleResponse({cacheKey:b,req:a,nextConfig:al,routeKind:e.RouteKind.APP_PAGE,isFallback:!0,prerenderManifest:ag,isRoutePPREnabled:aF,responseGenerator:async()=>q({span:j,postponed:void 0,fallbackRouteParams:f,forceStaticRender:!0}),waitUntil:d.waitUntil,isMinimalMode:V});if(null===g)return null;if(g)return V||!aF||!(aS.length>0)||!0!==al.experimental.partialFallbacks||!aU||!p||ar||aI||aD||aE||ay||(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(aU,p,aF,!1,a=>q({span:a.span,postponed:void 0,fallbackRouteParams:a_.length>0?(0,o.createOpaqueFallbackRouteParams)(a_):null,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}),delete g.cacheControl,g}}let s=ar||i||!aJ?void 0:aJ;if(aP&&!V&&p&&(aL||aA)&&!k){let b=await p.get(ai,{kind:v.IncrementalCacheKind.APP_PAGE,isRoutePPREnabled:!0,isFallback:!1});b&&b.value&&b.value.kind===v.CachedRouteKind.APP_PAGE&&(s=b.value.postponed,b&&(-1===b.isStale||!0===b.isStale)&&(0,J.scheduleOnNextTick)(async()=>{let b=P.getResponseCache(a);try{await b.revalidate(ai,p,aF,!1,a=>r({...a,forceStaticRender:!0}),null,c,d.waitUntil)}catch(a){console.error("Error revalidating the page in the background",a)}}))}if((aG||aH)&&void 0!==s)return{cacheControl:{revalidate:1,expire:void 0},value:{kind:v.CachedRouteKind.PAGES,html:x.default.EMPTY,pageData:{},headers:void 0,status:void 0}};let t=!P.isDev&&_&&(null==at?void 0:at.fallbackRouteParams)?(0,o.getPlaceholderFallbackRouteParams)($,at.fallbackRouteParams):null,y=t&&t.length>0?t:null==at?void 0:at.fallbackRouteParams,z=null!=t&&t.length>0,A=null;if(al.cacheComponents&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,h.getRequestMeta)(a,"resolvedRouteParamKeys");b&&b.size>0&&(A=at.fallbackRouteParams.filter(a=>!b.has(a.paramName)))}let B=(l&&(0,h.getRequestMeta)(a,"renderFallbackShell")||z||aG&&!au)&&y?(0,o.createOpaqueFallbackRouteParams)(y):A&&A.length>0&&A.length<((null==at||null==(n=at.fallbackRouteParams)?void 0:n.length)??0)?(0,o.createOpaqueFallbackRouteParams)(A):aI?(0,o.getFallbackRouteParams)(aq,P):null;if((l||aG)&&al.cacheComponents&&!au&&(null==at?void 0:at.fallbackRouteParams)){let b=(0,o.createOpaqueFallbackRouteParams)(y??at.fallbackRouteParams);b&&(0,h.addRequestMeta)(a,"fallbackParams",b)}return q({span:j,postponed:s,fallbackRouteParams:B,forceStaticRender:k})}catch(b){throw(null==g?void 0:g.isStale)&&await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}},s=async c=>{var f,g,i,j,k,l;let m,n=await P.handleResponse({cacheKey:aU,responseGenerator:a=>r({span:c,...a}),routeKind:e.RouteKind.APP_PAGE,isOnDemandRevalidate:ar,isRoutePPREnabled:aF,req:a,nextConfig:al,prerenderManifest:ag,waitUntil:d.waitUntil,isMinimalMode:V});if(ah&&b.setHeader("Cache-Control","private, no-cache, no-store, max-age=0, must-revalidate"),P.isDev&&b.setHeader("Cache-Control","no-cache, must-revalidate"),!n){if(aU)throw Object.defineProperty(Error("invariant: cache entry required but not generated"),"__NEXT_ERROR_CODE",{value:"E62",enumerable:!1,configurable:!0});return null}if((null==(f=n.value)?void 0:f.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant app-page handler received invalid cache entry ${null==(i=n.value)?void 0:i.kind}`),"__NEXT_ERROR_CODE",{value:"E707",enumerable:!1,configurable:!0});let o="string"==typeof n.value.postponed;az&&!aA&&ao&&b.setHeader(y.NEXT_NAV_DEPLOYMENT_ID_HEADER,ao),aO&&!aL&&(!o||ay)&&(V||b.setHeader("x-nextjs-cache",ar?"REVALIDATED":n.isMiss?"MISS":n.isStale?"STALE":"HIT"),b.setHeader(t.NEXT_IS_PRERENDER_HEADER,"1"));let{value:p}=n;if(aJ)m={revalidate:0,expire:void 0};else if(aL)m={revalidate:0,expire:void 0};else if(!P.isDev)if(ah)m={revalidate:0,expire:void 0};else if(aO){if(n.cacheControl)if("number"==typeof n.cacheControl.revalidate){if(n.cacheControl.revalidate<1)throw Object.defineProperty(Error(`Invalid revalidate configuration provided: ${n.cacheControl.revalidate} < 1`),"__NEXT_ERROR_CODE",{value:"E22",enumerable:!1,configurable:!0});m={revalidate:n.cacheControl.revalidate,expire:(null==(j=n.cacheControl)?void 0:j.expire)??al.expireTime}}else m={revalidate:y.CACHE_ONE_YEAR_SECONDS,expire:void 0}}else b.getHeader("Cache-Control")||(m={revalidate:0,expire:void 0});if(n.cacheControl=m,"string"==typeof aM&&(null==p?void 0:p.kind)===v.CachedRouteKind.APP_PAGE&&p.segmentData){b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"2");let c=null==(k=p.headers)?void 0:k[y.NEXT_CACHE_TAGS_HEADER];V&&aO&&c&&"string"==typeof c&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,c);let d=p.segmentData.get(aM);return void 0!==d?(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(d,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl}):(b.statusCode=204,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl}))}let s=aP?(0,h.getRequestMeta)(a,"onCacheEntryV2")??(0,h.getRequestMeta)(a,"onCacheEntry"):(0,h.getRequestMeta)(a,"onCacheEntry");if(s){let b=(0,h.getRequestMeta)(a,"initURL")??a.url,c=b?(null==(l=(0,F.parseUrl)(b))?void 0:l.pathname)??b:void 0;if(await s(n,{url:c}))return null}if(p.headers){let a={...p.headers};for(let[c,d]of(V&&aO||delete a[y.NEXT_CACHE_TAGS_HEADER],Object.entries(a)))if(void 0!==d)if(Array.isArray(d))for(let a of d)b.appendHeader(c,a);else"number"==typeof d&&(d=d.toString()),b.appendHeader(c,d)}let u=null==(g=p.headers)?void 0:g[y.NEXT_CACHE_TAGS_HEADER];if(V&&aO&&u&&"string"==typeof u&&b.setHeader(y.NEXT_CACHE_TAGS_HEADER,u),!p.status||az&&aF||(b.statusCode=p.status),!V&&p.status&&H.RedirectStatusCode[p.status]&&az&&(b.statusCode=200),o&&!aL&&b.setHeader(t.NEXT_DID_POSTPONE_HEADER,"1"),az&&!ah){if(void 0===p.rscData){if(p.html.contentType!==t.RSC_CONTENT_TYPE_HEADER)if(al.cacheComponents)return b.statusCode=404,(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.EMPTY,cacheControl:n.cacheControl});else throw Object.defineProperty(new I.InvariantError(`Expected RSC response, got ${p.html.contentType}`),"__NEXT_ERROR_CODE",{value:"E789",enumerable:!1,configurable:!0});return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:p.html,cacheControl:n.cacheControl})}return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:x.default.fromStatic(p.rscData,t.RSC_CONTENT_TYPE_HEADER),cacheControl:n.cacheControl})}let w=p.html;if(aE&&aG){let c=!0===P.isDev?crypto.randomUUID():null;return w.pipeThrough(await (0,A.createInstantTestScriptInsertionTransformStream)(c)),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})}if(!o||V||az)return(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:n.cacheControl});if(aG||aH)return w.push(new ReadableStream({start(a){a.enqueue(z.ENCODED_TAGS.CLOSED.BODY_AND_HTML),a.close()}})),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}});let C=new TransformStream;return w.push(C.readable),q({span:c,postponed:p.postponed,fallbackRouteParams:null,forceStaticRender:!1}).then(async a=>{var b,c;if(!a)throw Object.defineProperty(Error("Invariant: expected a result to be returned"),"__NEXT_ERROR_CODE",{value:"E463",enumerable:!1,configurable:!0});if((null==(b=a.value)?void 0:b.kind)!==v.CachedRouteKind.APP_PAGE)throw Object.defineProperty(Error(`Invariant: expected a page response, got ${null==(c=a.value)?void 0:c.kind}`),"__NEXT_ERROR_CODE",{value:"E305",enumerable:!1,configurable:!0});await a.value.html.pipeTo(C.writable)}).catch(a=>{C.writable.abort(a).catch(a=>{console.error("couldn't abort transformer",a)})}),(0,B.sendRenderResult)({req:a,res:b,generateEtags:al.generateEtags,poweredByHeader:al.poweredByHeader,result:w,cacheControl:{revalidate:0,expire:void 0}})};if(!a$||!aZ)return k=aY.getActiveScopeSpan(),await aY.withPropagatedContext(a.headers,()=>aY.trace(i.BaseServerSpan.handleRequest,{spanName:`${aX} ${W}`,kind:g.SpanKind.SERVER,attributes:{"http.method":aX,"http.target":a.url}},s),void 0,!a$);await s(aZ)}catch(b){throw b instanceof C.NoFallbackError||await P.onRequestError(a,b,{routerKind:"App Router",routePath:W,routeType:"render",revalidateReason:(0,f.c)({isStaticGeneration:aO,isOnDemandRevalidate:ar})},!1,ak),b}}},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},53471:(a,b,c)=>{"use strict";function d(a,b,c=null){let e=a.get("SELECT value FROM _meta WHERE key = ?",[b]);return e?e.value:c}function e(a,b,c){a.run("INSERT INTO _meta(key, value) VALUES(?, ?) ON CONFLICT(key) DO UPDATE SET value = excluded.value",[b,String(c)])}c.d(b,{dy:()=>d,np:()=>e}),c(8689)},54589:(a,b,c)=>{"use strict";function d(){try{return Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}catch{return"UTC"}}c.d(b,{JW:()=>i,Vm:()=>d,fB:()=>f,gy:()=>e,nz:()=>g});let e={anchor:"09:30",timezone:d(),windowHours:5,slotsPerDay:3};function f(a){let b=/^(\d{1,2}):(\d{2})$/.exec(String(a||"").trim());if(!b)return null;let c=Number(b[1]),d=Number(b[2]);return c>23||d>59?null:{hour:c,minute:d}}function g(a){return Math.max(1,Math.floor(24/a))}function h(a,b,c,d){let e="number"==typeof a?a:Number(a);return Number.isFinite(e)?Math.min(d,Math.max(c,e)):b}function i(a){let b=function(a){if(!a||!0!==a.enabled)return null;let b=f(a.anchor)||f(e.anchor),c=`${String(b.hour).padStart(2,"0")}:${String(b.minute).padStart(2,"0")}`,d=!function(a){if(!a||"string"!=typeof a)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:a}),!0}catch{return!1}}(a.timezone)?e.timezone:a.timezone,i=h(a.windowHours,e.windowHours,.5,24),j=Math.round(h(a.slotsPerDay,e.slotsPerDay,1,g(i)));return{enabled:!0,anchor:c,timezone:d,windowHours:i,slotsPerDay:j}}(a);if(!b)return[];let{hour:c,minute:d}=f(b.anchor),i=60*c+d;return Array.from({length:b.slotsPerDay},(a,c)=>{let d=Math.round(i+c*b.windowHours*60)%1440;return`${String(Math.floor(d/60)).padStart(2,"0")}:${String(d%60).padStart(2,"0")}`})}},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},56015:(a,b,c)=>{"use strict";c.d(b,{aB:()=>g,xE:()=>f});var d=c(24987);function e(a){if(!Array.isArray(a))return[];let b=new Set,c=[];for(let d of a){if("string"!=typeof d)continue;let a=d.trim();if(!a)continue;let e=a.toLowerCase();b.has(e)||(b.add(e),c.push(a))}return c}function f(a,b){if(1!==a&&!0!==a)return{restricted:!1,allow:[]};let c=[];if("string"==typeof b&&b)try{c=JSON.parse(b)}catch{c=[]}return{restricted:!0,allow:e(c)}}function g(a){let b=a||d.M0;return{accessRestricted:+!!b.restricted,accessAllow:JSON.stringify(b.restricted?e(b.allow):[])}}},56020:(a,b,c)=>{"use strict";c.d(b,{A:()=>l});var d=c(48249),e=c(67484),f=c(49885),g=c.n(f),h=c(50412),i=c(71404),j=c(54589);let k=[{value:"off",label:"Off",icon:"block"},{value:"reset",label:"On reset",icon:"bolt"},{value:"schedule",label:"Schedule",icon:"schedule"}];function l({isOpen:a,onClose:b,onSave:c,connection:f,reactive:g=!1,schedule:m=null}){let[n,o]=(0,e.useState)(()=>({mode:m?.enabled===!0?"schedule":!0===g?"reset":"off",anchor:m?.anchor||j.gy.anchor,timezone:(0,j.Vm)(),windowHours:String(m?.windowHours??j.gy.windowHours),slotsPerDay:String(m?.slotsPerDay??j.gy.slotsPerDay)})),p=Number(n.windowHours),q=Number(n.slotsPerDay),r=!!(0,j.fB)(n.anchor),s=Number.isFinite(p)&&p>=.5&&p<=24,t=s?(0,j.nz)(p):24,u=Number.isInteger(q)&&q>=1&&q<=t,v=r&&s&&u,w="schedule"!==n.mode||v,x=v?(0,j.JW)({enabled:!0,...n,windowHours:p,slotsPerDay:q}):[],y=x.length&&s?(()=>{let{hour:a,minute:b}=(0,j.fB)(n.anchor),c=Math.round(60*a+b+q*p*60)%1440;return`${String(Math.floor(c/60)).padStart(2,"0")}:${String(c%60).padStart(2,"0")}`})():"",z=a=>o(b=>({...b,...a}));return(0,d.jsx)(h.aF,{isOpen:a,onClose:b,title:"Auto-ping settings",size:"lg",footer:(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(h.$n,{variant:"secondary",onClick:b,children:"Cancel"}),(0,d.jsx)(h.$n,{onClick:()=>{w&&(c({reactive:"reset"===n.mode,schedule:"schedule"===n.mode?{enabled:!0,anchor:n.anchor,timezone:n.timezone,windowHours:p,slotsPerDay:q}:{enabled:!1}}),b())},disabled:!w,children:"Save"})]}),children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Configure automated quota pings",f?.name?` for ${f.name}`:""," — pick one mode."]}),(0,d.jsx)("div",{className:"grid grid-cols-3 gap-1 rounded-[10px] bg-surface-2 p-1",children:k.map(a=>{let b=n.mode===a.value;return(0,d.jsxs)("button",{type:"button",onClick:()=>z({mode:a.value}),className:(0,i.cn)("flex h-9 items-center justify-center gap-1.5 rounded-[8px] px-3 text-sm font-medium transition-all",b?"bg-surface text-text-main shadow-sm":"text-text-muted hover:text-text-main"),children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[15px] leading-none",children:a.icon}),(0,d.jsx)("span",{children:a.label})]},a.value)})}),"reset"===n.mode&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings right after the 5h quota window resets, so a new window starts immediately."}),"schedule"===n.mode&&(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsx)("p",{className:"text-xs text-text-muted",children:"Pings at fixed local times so the 5h windows align with your workday."}),(0,d.jsxs)("div",{className:"grid grid-cols-1 gap-4 sm:grid-cols-3",children:[(0,d.jsx)(h.pd,{label:"Anchor time",type:"time",value:n.anchor,onChange:a=>z({anchor:a.target.value}),error:r?"":"Use HH:MM",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Window (hours)",type:"number",min:"0.5",max:"24",step:"0.5",value:n.windowHours,onChange:a=>z({windowHours:a.target.value}),error:s?"":"0.5 – 24",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"}),(0,d.jsx)(h.pd,{label:"Pings per day",type:"number",min:"1",max:String(t),step:"1",value:n.slotsPerDay,onChange:a=>z({slotsPerDay:a.target.value}),error:u?"":`1 – ${t}`,hint:u?`Max ${t}`:"",inputClassName:"ring-1 ring-black/10 dark:ring-white/15"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-[10px] bg-surface-2 px-3 py-2.5",children:[(0,d.jsxs)("p",{className:"text-xs font-medium uppercase tracking-wide text-text-muted",children:["Daily slots (",n.timezone,")"]}),(0,d.jsx)("p",{className:"mt-1 text-sm font-medium text-text-main",children:x.join(" → ")}),(0,d.jsxs)("p",{className:"mt-1 text-xs text-text-muted",children:["Covers ",x[0]," – ",y,", then pauses until ",x[0]," next day."]})]})]})]})})}l.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onSave:g().func.isRequired,connection:g().object,reactive:g().bool,schedule:g().object}},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60396:(a,b,c)=>{"use strict";let d;c.r(b),c.d(b,{"405b7b833b5fbb4a342041e03e42294fe2a97a6aca":()=>aD});var e=c(95349),f=c(81200);c(70339),c(36888);let g=(a,b="algorithm.name")=>TypeError(`CryptoKey does not support this operation, its ${b} must be ${a}`);async function h(a,b,c){return b instanceof Uint8Array?crypto.subtle.importKey("raw",b,a.subtle,!1,[c]):(!function(a,b,c){let d=a.algorithm;if(d.name!==b.name)throw g(b.name);if(b.hash&&d.hash?.name!==b.hash)throw g(b.hash,"algorithm.hash");if(b.namedCurve&&d.namedCurve!==b.namedCurve)throw g(b.namedCurve,"algorithm.namedCurve");if(void 0!==b.length&&d.length!==b.length)throw g(b.length,"algorithm.length");if(c&&!a.usages.includes(c))throw TypeError(`CryptoKey does not support this operation, its usages must include ${c}.`)}(b,a.subtle,c),a.minRsaBits&&function(a,b){let{modulusLength:c}=b.algorithm;if("number"!=typeof c||c<2048)throw TypeError(`${a} requires key modulusLength to be 2048 bits or larger`)}(a.alg,b),b)}async function i(a,b,c,d){let e=await h(a,b,"verify");try{return await crypto.subtle.verify(a.signing,e,c,d)}catch{return!1}}class j extends Error{static code="ERR_JOSE_GENERIC";code="ERR_JOSE_GENERIC";constructor(a,b){super(a,b),this.name=this.constructor.name,Error.captureStackTrace?.(this,this.constructor)}}class k extends j{static code="ERR_JWT_CLAIM_VALIDATION_FAILED";code="ERR_JWT_CLAIM_VALIDATION_FAILED";claim;reason;payload;constructor(a,b,c="unspecified",d="unspecified"){super(a,{cause:{claim:c,reason:d,payload:b}}),this.claim=c,this.reason=d,this.payload=b}}class l extends j{static code="ERR_JWT_EXPIRED";code="ERR_JWT_EXPIRED";claim;reason;payload;constructor(a,b,c="unspecified",d="unspecified"){super(a,{cause:{claim:c,reason:d,payload:b}}),this.claim=c,this.reason=d,this.payload=b}}class m extends j{static code="ERR_JOSE_ALG_NOT_ALLOWED";code="ERR_JOSE_ALG_NOT_ALLOWED"}class n extends j{static code="ERR_JOSE_NOT_SUPPORTED";code="ERR_JOSE_NOT_SUPPORTED"}class o extends j{static code="ERR_JWS_INVALID";code="ERR_JWS_INVALID"}class p extends j{static code="ERR_JWT_INVALID";code="ERR_JWT_INVALID"}class q extends j{[Symbol.asyncIterator]=async function*(){};static code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";code="ERR_JWKS_MULTIPLE_MATCHING_KEYS";constructor(a="multiple matching keys found in the JSON Web Key Set",b){super(a,b)}}class r extends j{static code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";code="ERR_JWS_SIGNATURE_VERIFICATION_FAILED";constructor(a="signature verification failed",b){super(a,b)}}let s=[["verify"],["sign"]];function t(a){let b={name:"HMAC",hash:`SHA-${a}`};return{kty:["oct"],secret:!0,subtle:b,signing:b,usages:s}}function u(a,b){let c={name:b?"RSA-PSS":"RSASSA-PKCS1-v1_5",hash:`SHA-${a}`};return{kty:["RSA"],subtle:c,signing:b?{...c,saltLength:b}:c,usages:s,minRsaBits:2048}}function v(a,b){return{kty:["EC"],crv:a,subtle:{name:"ECDSA",namedCurve:a},signing:{name:"ECDSA",hash:`SHA-${b}`},usages:s}}function w(){let a={name:"Ed25519"};return{kty:["OKP"],crv:"Ed25519",subtle:a,signing:a,usages:s}}function x(a){let b={name:`ML-DSA-${a}`};return{kty:["AKP"],subtle:b,signing:b,usages:s}}let y=function(a){let b={__proto__:null};for(let c in a)b[c]={...a[c],alg:c};return b}({HS256:t(256),HS384:t(384),HS512:t(512),RS256:u(256),RS384:u(384),RS512:u(512),PS256:u(256,32),PS384:u(384,48),PS512:u(512,64),ES256:v("P-256",256),ES384:v("P-384",384),ES512:v("P-521",512),EdDSA:w(),Ed25519:w(),"ML-DSA-44":x(44),"ML-DSA-65":x(65),"ML-DSA-87":x(87)}),z=new TextEncoder,A=new TextDecoder,B=new TextDecoder("utf-8",{fatal:!0});function C(a){let b=new Uint8Array(a.length);for(let c=0;c<a.length;c++){let d=a.charCodeAt(c);if(d>127)throw TypeError("non-ASCII string encountered in encode()");b[c]=d}return b}let D="The input to be decoded is not correctly encoded.";function E(a){if(Uint8Array.fromBase64)try{return Uint8Array.fromBase64("string"==typeof a?a:A.decode(a),{alphabet:"base64url"})}catch(a){throw TypeError(D,{cause:a})}let b=a;if(b instanceof Uint8Array&&(b=A.decode(b)),b.includes("+")||b.includes("/"))throw TypeError(D);b=b.replace(/-/g,"+").replace(/_/g,"/");try{var c=b;if(Uint8Array.fromBase64)return Uint8Array.fromBase64(c);let a=atob(c),d=new Uint8Array(a.length);for(let b=0;b<a.length;b++)d[b]=a.charCodeAt(b);return d}catch{throw TypeError(D)}}function F(a){if("object"!=typeof a||null===a||"[object Object]"!==Object.prototype.toString.call(a))return!1;let b=Object.getPrototypeOf(a);if(null===b)return!0;let c=b;for(;null!==Object.getPrototypeOf(c);)c=Object.getPrototypeOf(c);return b===c}function G(a,b,c){try{return E(a)}catch{throw new c(`Failed to base64url decode the ${b}`)}}Symbol();let H={__proto__:null,b64:!0},I=(a,b,...c)=>(function(a,b,...c){if(c.length>2){let b=c.pop();a+=`one of type ${c.join(", ")}, or ${b}.`}else 2===c.length?a+=`one of type ${c[0]} or ${c[1]}.`:a+=`of type ${c[0]}.`;return null==b?a+=` Received ${b}`:"function"==typeof b&&b.name?a+=` Received function ${b.name}`:"object"==typeof b&&null!=b&&b.constructor?.name&&(a+=` Received an instance of ${b.constructor.name}`),a})(`Key for the ${a} algorithm must be `,b,...c),J=a=>{if(a?.[Symbol.toStringTag]==="CryptoKey")return!0;try{return a instanceof CryptoKey}catch{return!1}};async function K(a,b){if("RSA"===b.kty&&"oth"in b&&void 0!==b.oth)throw new n('RSA JWK "oth" (Other Primes Info) Parameter value is not supported');if(!a.kty.includes(b.kty))throw new n('Invalid or unsupported JWK "alg" (Algorithm) Parameter value');let c=a.resolve?.({kty:b.kty,crv:b.crv})??a.subtle,d=!!(b.d||b.priv),e={...b};return"AKP"!==e.kty&&delete e.alg,delete e.use,crypto.subtle.importKey("jwk",e,c,b.ext??!d,b.key_ops??a.usages[+!!d])}let L=a=>a[Symbol.toStringTag],M={__proto__:null,prime256v1:"P-256",secp384r1:"P-384",secp521r1:"P-521"};function N(a,b,c){let e=(d||=new WeakMap).get(a);return c&&(e?e[b]=c:d.set(a,{[b]:c})),c??e?.[b]}let O=async(a,b,c)=>N(a,c.alg)??N(a,c.alg,await K(c,{...b,alg:c.alg}));async function P(a,b,c){let d=function(a,b,c){let{alg:d,secret:e}=a,f="decrypt"===c||"sign"===c;if(e&&b instanceof Uint8Array)return[0,b];if(F(b)&&"string"==typeof b.kty){if(e?"oct"!==b.kty||"string"!=typeof b.k:!(f?"oct"!==b.kty&&("AKP"===b.kty&&"string"==typeof b.priv||"string"==typeof b.d):"oct"!==b.kty&&void 0===b.d&&void 0===b.priv))throw TypeError(e?'JSON Web Key for symmetric algorithms must have JWK "kty" (Key Type) equal to "oct" and the JWK "k" (Key Value) present':`JSON Web Key for this operation must be a ${f?"private":"public"} JWK`);return((a,b,c)=>{let{alg:d}=a;if(void 0!==b.use){let a="sign"===c||"verify"===c?"sig":"enc";if(b.use!==a)throw TypeError(`Invalid key for this operation, its "use" must be "${a}" when present`)}if(void 0!==b.alg&&b.alg!==d)throw TypeError(`Invalid key for this operation, its "alg" must be "${d}" when present`);if(Array.isArray(b.key_ops)){let d="encrypt"===c||"decrypt"===c?a.ops?.[+("encrypt"!==c)]:c;if(d&&!b.key_ops.includes(d))throw TypeError(`Invalid key for this operation, its "key_ops" must include "${d}" when present`)}})(a,b,c),[3,b]}if(!(J(b)||b?.[Symbol.toStringTag]==="KeyObject"))throw TypeError(e?I(d,b,"CryptoKey","KeyObject","JSON Web Key","Uint8Array"):I(d,b,"CryptoKey","KeyObject","JSON Web Key"));if(e){if("secret"!==b.type)throw TypeError(`${L(b)} instances for symmetric algorithms must be of type "secret"`)}else{if("secret"===b.type)throw TypeError(`${L(b)} instances for asymmetric algorithms must not be of type "secret"`);let a=f?"private":"public";if(("public"===b.type||"private"===b.type)&&b.type!==a){let d="sign"===c?"signing":"verify"===c?"verifying":`${c.slice(0,-1)}tion`;throw TypeError(`${L(b)} instances for asymmetric algorithm ${d} must be of type "${a}"`)}}return J(b)?[1,b]:[2,b]}(a,b,c);switch(d[0]){case 0:case 1:return d[1];case 3:{let b=d[1];if(b.k)return E(b.k);if(!Object.isFrozen(b)){let{key_ops:a}=b;Array.isArray(a)&&Object.freeze(a),Object.freeze(b)}return O(b,b,a)}case 2:{let b=d[1];if("secret"===b.type)return b.export();if("toCryptoKey"in b&&"function"==typeof b.toCryptoKey)return((a,b)=>{let c=N(a,b.alg);if(c)return c;let d="public"===a.type,e=b.usages[+!d],{asymmetricKeyType:f}=a,g=M[a.asymmetricKeyDetails?.namedCurve],h=b.resolve?.({crv:g,asymmetricKeyType:f})??b.subtle;return N(a,b.alg,a.toCryptoKey(h,d,e))})(b,a);return O(b,b.export({format:"jwk"}),a)}}}async function Q(a,b,c){let d,{protected:e,header:f,payload:g}=a,h={};if(e&&(h=function(a,b,c){let d;try{d=JSON.parse(B.decode(E(a)))}catch{throw new b(c)}if(!F(d))throw new b(c);return d}(e,o,"JWS Protected Header is invalid")),void 0!==f){if(!function(...a){let b=new Set;for(let c of a)if(c)for(let a of Object.keys(c)){if(b.has(a))return!1;b.add(a)}return!0}(h,f))throw new o("JWS Protected and JWS Unprotected Header Parameter names must be disjoint");d={...h,...f}}else d=h;let j=function(a,b,c,d,e){if(void 0!==e.crit&&d?.crit===void 0)throw new a('"crit" (Critical) Header Parameter MUST be integrity protected');if(!d||void 0===d.crit)return[];if(!Array.isArray(d.crit)||0===d.crit.length||d.crit.some(a=>"string"!=typeof a||0===a.length))throw new a('"crit" (Critical) Header Parameter MUST be an array of non-empty strings when present');let f=void 0===c?b:{__proto__:null,...c,...b};for(let b of d.crit){if(!(b in f))throw new n(`Extension Header Parameter "${b}" is not recognized`);if(!Object.hasOwn(e,b)||void 0===e[b])throw new a(`Extension Header Parameter "${b}" is missing`);if(f[b]&&(!Object.hasOwn(d,b)||void 0===d[b]))throw new a(`Extension Header Parameter "${b}" MUST be integrity protected`)}return d.crit}(o,H,b[1],h,d),k=!0;if(j.includes("b64")&&"boolean"!=typeof(k=h.b64))throw new o('The "b64" (base64url-encode payload) Header Parameter must be a boolean');let{alg:l}=d;if("string"!=typeof l||!l)throw new o('JWS "alg" (Algorithm) Header Parameter missing or invalid');if(b[0]&&!b[0].has(l))throw new m('"alg" (Algorithm) Header Parameter value not allowed');if(k){if("string"!=typeof g)throw new o("JWS Payload must be a string")}else if("string"!=typeof g&&!(g instanceof Uint8Array))throw new o("JWS Payload must be a string or an Uint8Array instance");let p=!1;"function"==typeof c&&(c=await c(h,a),p=!0);let q=function(a){let b=y[a];if(!b)throw new n(`alg ${a} is not supported either by JOSE or your javascript runtime`);return b}(l),s=function(...a){let b=new Uint8Array(a.reduce((a,{length:b})=>a+b,0)),c=0;for(let d of a)b.set(d,c),c+=d.length;return b}(void 0!==e?C(e):new Uint8Array,C("."),"string"==typeof g?k?b[2]??=function(a,b,c){try{return C(a)}catch{throw new c(`The ${b} is not a valid base64url string`)}}(g,"payload",o):z.encode(g):g),t=G(a.signature,"signature",o),u=await P(q,c,"verify");if(!await i(q,u,t,s))throw new r;return[k?G(g,"payload",o):"string"==typeof g?z.encode(g):g,h,k,u,p]}async function R(a,b,c){if(a instanceof Uint8Array&&(a=A.decode(a)),"string"!=typeof a)throw new o("Compact JWS must be a string or Uint8Array");let{0:d,1:e,2:f,length:g}=a.split(".");if(3!==g)throw new o("Invalid Compact JWS");return Q({payload:e,protected:d,signature:f},b,c)}let S={s:1,m:60,h:3600,d:86400,w:604800,y:0x1e187e0},T=/^(\+|\-)? ?(\d+|\d+\.\d+) ?(seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)(?: (ago|from now))?$/i,U="check_failed";function V(a){let b=T.exec(a);if(!b||b[4]&&b[1])throw TypeError("Invalid time period format");let c=Math.round(parseFloat(b[2])*S[b[3][0].toLowerCase()]);return"-"===b[1]||"ago"===b[4]?-c:c}function W(a,b){if(!Number.isFinite(b))throw TypeError(`Invalid ${a} input`);return b}let X=a=>a.includes("/")?a.toLowerCase():`application/${a.toLowerCase()}`;function Y(a,b,c=!1){let d=a[b];if(void 0!==d||c){if("number"!=typeof d)throw new k(`"${b}" claim must be a number`,a,b,"invalid");return d}}function Z(a,b){throw new k(`unexpected "${b}" claim value`,a,b,U)}async function $(a,b,c){let d=await R(a,[c&&function(a,b){if(void 0!==b&&(!Array.isArray(b)||b.some(a=>"string"!=typeof a)))throw TypeError(`"${a}" option must be an array of strings`);if(b)return new Set(b)}("algorithms",c.algorithms),c?.crit],b);if(!d[2])throw new p("JWTs MUST NOT use unencoded payload");let e={payload:function(a,b,c={}){var d,e;let f;try{f=JSON.parse(B.decode(b))}catch{}if(!F(f))throw new p("JWT Claims Set must be a top-level JSON object");let{typ:g}=c;if(g&&("string"!=typeof a.typ||X(a.typ)!==X(g)))throw new k('unexpected "typ" JWT header value',f,"typ",U);let{requiredClaims:h=[],issuer:i,subject:j,audience:m,maxTokenAge:n}=c,o=[...h];for(let a of(void 0!==n&&o.push("iat"),void 0!==m&&o.push("aud"),void 0!==j&&o.push("sub"),void 0!==i&&o.push("iss"),new Set(o.reverse())))if(!Object.hasOwn(f,a))throw new k(`missing required "${a}" claim`,f,a,"missing");void 0===i||(Array.isArray(i)?i:[i]).includes(f.iss)||Z(f,"iss"),void 0!==j&&f.sub!==j&&Z(f,"sub"),void 0===m||(d=f.aud,e="string"==typeof m?[m]:m,"string"==typeof d?e.includes(d):!!Array.isArray(d)&&e.some(a=>d.includes(a)))||Z(f,"aud");let{clockTolerance:q}=c,r=0;if("string"==typeof q)r=V(q);else if(void 0!==q){if("number"!=typeof q)throw TypeError("Invalid clockTolerance option type");r=q}W("clockTolerance option",r);let{currentDate:s}=c,t=W("currentDate option",Math.floor((s||new Date).getTime()/1e3)),u=Y(f,"iat",void 0!==n),v=Y(f,"nbf");if(void 0!==v&&v>t+r)throw new k('"nbf" claim timestamp check failed',f,"nbf",U);let w=Y(f,"exp");if(void 0!==w&&w<=t-r)throw new l('"exp" claim timestamp check failed',f,"exp",U);if(void 0!==n){let a=t-u;if(a-r>("number"==typeof n?n:V(n)))throw new l('"iat" claim timestamp check failed (too far in the past)',f,"iat",U);if(a<0-r)throw new k('"iat" claim timestamp check failed (it should be in the past)',f,"iat",U)}return f}(d[1],d[0],c),protectedHeader:d[1]};return"function"==typeof b?{...e,key:d[3]}:e}c(55511);"function"==typeof setImmediate||"object"==typeof scheduler&&"function"==typeof scheduler.postTask&&scheduler.postTask.bind(scheduler);var _=c(73024),aa=c.n(_),ab=c(76760),ac=c.n(ab),ad=c(77598),ae=c.n(ad),af=c(28817),ag=c(8689);c(56015),c(24987),c(67576);var ah=c(46737);c(93454),c(25129),c(24362);var ai=c(65003);(0,ai.U)("modelAliases"),(0,ai.U)("customModels"),(0,ai.U)("mitmAlias"),(0,ai.U)("modelCaps"),c(11015);var aj=c(94735);c(53471),global._pendingRequests||(global._pendingRequests={byModel:{},byAccount:{}}),global._lastErrorProvider||(global._lastErrorProvider={provider:"",ts:0}),global._statsEmitter||(global._statsEmitter=new aj.EventEmitter,global._statsEmitter.setMaxListeners(50)),global._pendingTimers||(global._pendingTimers={}),global._recentRing||(global._recentRing={items:[],initialized:!1}),global._connectionMapCache||(global._connectionMapCache={map:{},ts:0}),global._statsEmitTimers||(global._statsEmitTimers={pending:null,update:null}),global._pendingRequests,global._lastErrorProvider,global._pendingTimers,global._recentRing,global._connectionMapCache,global._statsEmitTimers,global._statsEmitter;var ak=c(37461),al=c(86734);let am=null,an=0;function ao(a,b){let c=a[b];return void 0===c||""===c.trim()?null:"true"===c.trim().toLowerCase()}async function ap(){if(am&&Date.now()-an<5e3)return am;try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,67576)),b=await a();am={enabled:function(a,b=process.env){let c=ao(b,"OBSERVABILITY_ENABLED");if(null!==c)return c;let d=ao(b,"ENABLE_REQUEST_LOGS");return null!==d?d:a?.enableObservability===!0}(b),maxRecords:b.observabilityMaxRecords||parseInt(process.env.OBSERVABILITY_MAX_RECORDS||String(200),10),batchSize:b.observabilityBatchSize||parseInt(process.env.OBSERVABILITY_BATCH_SIZE||String(20),10),flushIntervalMs:b.observabilityFlushIntervalMs||parseInt(process.env.OBSERVABILITY_FLUSH_INTERVAL_MS||String(5e3),10),maxJsonSize:1024*(b.observabilityMaxJsonSize||parseInt(process.env.OBSERVABILITY_MAX_JSON_SIZE||"5",10))}}catch{am={enabled:!1,maxRecords:200,batchSize:20,flushIntervalMs:5e3,maxJsonSize:5120}}return an=Date.now(),am}let aq=[],ar=null,as=!1;function at(a,b){let c=JSON.stringify(a||{});return c.length>b?{_truncated:!0,_originalSize:c.length,_preview:c.substring(0,200)}:a||{}}function au(a,b){let c=at(a,b);return c?._truncated&&a&&"object"==typeof a&&void 0!==a.tools?{...c,tools:at(a.tools,65536)}:c}async function av(){if(!as&&0!==aq.length){as=!0;try{for(;aq.length>0;){let a=aq.splice(0,aq.length),b=await (0,ag.c)(),c=await ap();b.transaction(()=>{for(let d of a){d.id||(d.id=function(a){let b=new Date().toISOString(),c=Math.random().toString(36).substring(2,8),d=a?a.replace(/[^a-zA-Z0-9-]/g,"-"):"unknown";return`${b}-${c}-${d}`}(d.model)),d.timestamp||(d.timestamp=new Date().toISOString()),d.request?.headers&&(d.request.headers=function(a){if(!a||"object"!=typeof a)return{};let b=["authorization","x-api-key","cookie","token","api-key"],c={...a};for(let a of Object.keys(c))b.some(b=>a.toLowerCase().includes(b))&&delete c[a];return c}(d.request.headers));let a={id:d.id,provider:d.provider||null,model:d.model||null,connectionId:d.connectionId||null,apiKey:d.apiKey||null,timestamp:d.timestamp,status:d.status||null,latency:d.latency||{},tokens:d.tokens||{},request:au(d.request,c.maxJsonSize),providerRequest:au(d.providerRequest,c.maxJsonSize),providerResponse:at(d.providerResponse,c.maxJsonSize),response:at(d.response,c.maxJsonSize),pxpipe:d.pxpipe||void 0,convoy:d.convoy||void 0};b.run("INSERT INTO requestDetails(id, timestamp, provider, model, connectionId, status, data) VALUES(?, ?, ?, ?, ?, ?, ?) ON CONFLICT(id) DO UPDATE SET timestamp = excluded.timestamp, provider = excluded.provider, model = excluded.model, connectionId = excluded.connectionId, status = excluded.status, data = excluded.data",[a.id,a.timestamp,a.provider,a.model,a.connectionId,a.status,(0,ak.s)(a)])}}),setImmediate(()=>{aw(b,c.maxRecords).catch(a=>console.error("[requestDetailsRepo] async prune failed:",a))})}}catch(a){console.error("[requestDetailsRepo] Batch write failed:",a)}finally{as=!1}}}async function aw(a,b){try{let c=a.get("SELECT COUNT(*) as c FROM requestDetails");c&&c.c>b&&a.run("DELETE FROM requestDetails WHERE id IN (SELECT id FROM requestDetails ORDER BY timestamp ASC LIMIT ?)",[c.c-b])}catch(a){console.error("[requestDetailsRepo] pruneOldRecords error:",a)}}let ax=async()=>{ar&&(clearTimeout(ar),ar=null),aq.length>0&&await av()};async function ay(a){return!!(await (0,ag.c)()).get("SELECT 1 FROM kv WHERE scope = ? AND key = ?",["revokedDashboardSessions",a])}(0,al.Bb)(ax);let az=new TextEncoder().encode(function(){if(process.env.JWT_SECRET)return process.env.JWT_SECRET;let a=ac().join(af.n,"jwt-secret");try{let b=aa().readFileSync(a,"utf8").trim();if(b)return b}catch{}try{aa().mkdirSync(af.n,{recursive:!0});let b=ae().randomBytes(32).toString("hex");return aa().writeFileSync(a,b,{mode:384}),b}catch{return"ezrouter-fallback-jwt-secret-key-32-chars-minimum"}}());async function aA(a){return await aC(a)!==null}async function aB(a){if("string"!=typeof a||!a)return null;try{let{payload:b}=await $(a,az,{algorithms:["HS256"]});return!0===b.authenticated&&Number.isFinite(b.exp)?b:null}catch{return null}}async function aC(a){let b=await aB(a);if(!b)return null;try{return await ay(ae().createHash("sha256").update(a).digest("hex"))?null:b}catch{return null}}async function aD(a){let b=(await (0,f.U)()).get("auth_token")?.value;return await aA(b)?"string"==typeof a&&a?{connections:(await (0,ah.getProviderConnections)({provider:a})).map(a=>({id:a.id,name:a.displayName||a.name||a.email||a.id,authType:a.authType,key:a.apiKey||a.accessToken||""}))}:{error:"Bad provider"}:{error:"Unauthorized"}}(0,c(89337).D)([aD]),(0,e.A)(aD,"405b7b833b5fbb4a342041e03e42294fe2a97a6aca",null)},60944:(a,b,c)=>{"use strict";a.exports=c(7553).vendored["react-rsc"].ReactServerDOMWebpackServer},61745:(a,b,c)=>{"use strict";c.d(b,{cI:()=>h,pH:()=>g,Ps:()=>f});function d(a,b){let c=process.env[a];if(null==c||""===c)return b;let d=parseInt(c,10);return Number.isFinite(d)&&d>0?d:b}function e(a,b){let c=process.env[a]?.trim().toLowerCase();return"true"===c||"1"===c||"false"!==c&&"0"!==c&&b}[...["model is not supported","model not supported","model not found","model does not exist","unknown model","invalid model","modelerror"].map(a=>({text:a,permanent:!0})),...[/\bmodel\s+\S+\s+is\s+not\s+supported\b/,/\bmodel\s+\S+\s+(?:does\s+not\s+exist|not\s+found)\b/].map(a=>({pattern:a,permanent:!0})),...[/upstream request failed:\s*\[invalid_request_error\]/].map(a=>({pattern:a,permanent:!0}))];let f=process.env.SEARXNG_URL?.trim()||"http://localhost:8888/search";d("STREAM_STALL_TIMEOUT_MS",36e4),d("STREAM_FIRST_CHUNK_TIMEOUT_MS",3e4),(()=>{let a=process.env.SSE_KEEPALIVE_MS;if(null!=a&&""!==a)return Number.isFinite(parseInt(a,10))})(),e("ALLOW_INSECURE_TLS_FALLBACK",!1)&&e("STRICT_SSL",!1),d("EMPTY_PEEK_DEADLINE_MS",45e3);let g=d("FETCH_CONNECT_TIMEOUT_MS",6e4);d("RESPONSE_BODY_TIMEOUT_MS",3e5),d("GEMINI_NATIVE_TTS_FETCH_TIMEOUT_MS",45e3);let h={429:{attempts:0,delayMs:0},502:{attempts:3,delayMs:3e3},503:{attempts:3,delayMs:2e3},504:{attempts:2,delayMs:3e3}}},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},65003:(a,b,c)=>{"use strict";c.d(b,{U:()=>f});var d=c(8689),e=c(37461);function f(a){return{async get(b,c=null){let f=(await (0,d.c)()).get("SELECT value FROM kv WHERE scope = ? AND key = ?",[a,b]);return f?(0,e.q)(f.value,c):c},async getAll(){let b=(await (0,d.c)()).all("SELECT key, value FROM kv WHERE scope = ?",[a]),c={};for(let a of b)c[a.key]=(0,e.q)(a.value);return c},async set(b,c){(await (0,d.c)()).run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,b,(0,e.s)(c)])},async setMany(b){let c=await (0,d.c)();c.transaction(()=>{for(let[d,f]of Object.entries(b))c.run("INSERT INTO kv(scope, key, value) VALUES(?, ?, ?) ON CONFLICT(scope, key) DO UPDATE SET value = excluded.value",[a,d,(0,e.s)(f)])})},async remove(b){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ? AND key = ?",[a,b])},async clear(){(await (0,d.c)()).run("DELETE FROM kv WHERE scope = ?",[a])}}}},65242:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>aw});var d=c(48249),e=c(67484),f=c(19099),g=c(2116),h=c.n(g),i=c(81220),j=c(29225),k=c(50412),l=c(92592),m=c(91431),n=c(25144),o=c(80212),p=c(24630),q=c(41739);let r=["none","low","medium","high"],s=["none","thinking"],t=["none","low","medium","high","max"],u=["none","low","medium","high","xhigh","max"],v={qoder:u,openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":u,"claude-budget":u,"gemini-level":["minimal","low","medium","high"],"gemini-budget":r,zai:s,qwen:r,kimi:t,opencode:t,deepseek:["none","high","max"],minimax:s,hunyuan:r,step:r,nous:r,meta:["minimal","low","medium","high","xhigh"],ollama:t},w=["none","minimal","low","medium","high","xhigh","max"],x=["none","low","medium","high","max"],y=[{pattern:"*gemini-4*",levels:["low","medium","high"]},{pattern:"*claude*4.6*",levels:x},{pattern:"*claude*4-6*",levels:x},{provider:"codex",pattern:"*gpt-6*",levels:w},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...w,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:w},{providers:["openai","codex"],pattern:"*gpt-5.6*",levels:["none","minimal","low","medium","high","xhigh","max","ultra"]},{pattern:"*codex*",levels:["low","medium","high","xhigh"]},{provider:"opencode",pattern:"*mimo*v2.6*",levels:["none","minimal","low","medium","high","xhigh","max"]},{pattern:"*mimo*v2.6*",levels:["none","low","medium","high","xhigh"]},{pattern:"*mimo*v2.5-pro*",levels:["none","low","medium","high","xhigh"]},{provider:"ollama",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"ollama-local",pattern:"*gpt-oss*",levels:["none","low","medium","high"]},{provider:"qoder",pattern:"*",levels:u},{provider:"codebuddy-cn",pattern:"deepseek-v4-pro",levels:["low","high","xhigh"]},{provider:"codebuddy-cn",pattern:"deepseek-v4.1-flash",levels:["low","high","max"]},{pattern:"*deepseek-v4.1-flash-free*",levels:["low","high","max"]},{pattern:"*deepseek-v4.*",levels:["none","low","medium","high","xhigh","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.3-flash",levels:["low","high","max"]},{provider:"codebuddy-cn",pattern:"glm-5.2",levels:["high","xhigh"]},{provider:"codebuddy-cn",pattern:"kimi-k2.8-preview",levels:["low","medium","high"]},{provider:"codebuddy-cn",pattern:"hy3",levels:["low","high"]},{provider:"codebuddy-cn",pattern:"hy4-preview",levels:["high"]},{provider:"codebuddy-intl",pattern:"deepseek-v4*",levels:["low","high","xhigh"]},{provider:"minimax-code",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code",pattern:"MiniMax-M3",levels:["none","high"]},{provider:"minimax-code-global",pattern:"MiniMax-M3.1*",levels:["low","medium","high","xhigh","max"]},{provider:"minimax-code-global",pattern:"MiniMax-M3",levels:["none","high"]},{pattern:"*glm-5.3",levels:["low","high","max"]}];function z(a,b){if("kiro"===a&&null===function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(b))return"reasoning";if(!b.includes("claude"))return null;let c=function(a){if("string"!=typeof a)return null;let b=a.toLowerCase().replace(/-/g,".").match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);return b?{major:Number(b[1]),minor:void 0===b[2]?null:Number(b[2])}:null}(a);if(!c)return null;let{major:d,minor:e}=c;return d<4||4===d&&(null===e||e<=5||null!==e&&e>=1e3)?null:"output_config"}(b))return null;let c=(0,n.nl)(a,b);if(!c.reasoning)return null;let d=String(b||"").replace(/\([^()]+\)\s*$/,""),e="codex"===a?(0,q.SM)("cx").find(a=>a.id===d)?.thinkingLevels:null,f=y.find(c=>(!c.providers||!a||c.providers.includes(a))&&(!c.provider||c.provider===a)&&(0,o.gH)(c.pattern,b)),g=(a?p.xq[a]?.thinkingFormat:null)||c.thinkingFormat,h=e||c.thinkingLevels||f?.levels||v[g]||r;return!1===c.thinkingCanDisable&&(h=h.filter(a=>"none"!==a)),h}var A=c(50377),B=c(29476),C=c(99258);function D({customModels:a=[],modelAliases:b={},providerAlias:c,builtInModels:d=[],type:e="llm",includeLegacyAliases:f=!0}){let g=new Set(d.map(a=>a.id)),h=new Set,i=[];for(let b of a){if(!b?.id||b.providerAlias!==c)continue;let a=b?.kind||b?.type||"llm";if(e&&a!==e||g.has(b.id))continue;let d=`${c}/${b.id}`;h.has(d)||(h.add(d),i.push({id:b.id,name:b.name||b.id,fullModel:d,source:"custom",type:a}))}if(!f)return i;let j=`${c}/`;for(let[a,c]of Object.entries(b||{})){if("string"!=typeof c||!c.startsWith(j))continue;let b=c.slice(j.length);!b||g.has(b)||h.has(c)||(h.add(c),i.push({id:b,alias:a,fullModel:c,source:"legacyAlias",type:e||"llm"}))}return i}var E=c(49885),F=c.n(E),G=c(74869),H=c(30389);function I({model:a,fullModel:b,alias:c,copied:e,onCopy:f,testStatus:g,isCustom:h,isFree:i,onDeleteAlias:j,onTest:l,isTesting:m,onDisable:n,caps:o,thinkingSuffix:p}){let{getPricing:q}=(0,G.e)(),r=p?`${b}(${p})`:b,s=b.includes("/")?b.slice(0,b.indexOf("/")):null,t=(0,H.M4)(o,q(s,a.id)),u="ok"===g?"#22c55e":"error"===g?"#ef4444":"slow"===g||"rate_limited"===g?"#f59e0b":void 0;return(0,d.jsx)("div",{className:`group w-full sm:w-auto min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===g?"border-green-500/40":"error"===g?"border-red-500/40":"slow"===g||"rate_limited"===g?"border-amber-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,d.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base mt-0.5 sm:mt-0",style:u?{color:u}:void 0,children:"ok"===g?"check_circle":"error"===g?"cancel":"slow"===g||"rate_limited"===g?"warning":"smart_toy"}),(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,d.jsx)("code",{className:"w-fit max-w-full break-all rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px] sm:truncate",children:r}),(0,d.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[a.name&&(0,d.jsx)("span",{className:"break-all sm:truncate text-[9px] italic text-text-muted/70",children:a.name}),(0,d.jsx)(k.nh,{caps:o,colorOverride:"text-text-muted/70",size:12}),t&&(0,d.jsx)("span",{className:"truncate text-[9px] text-text-muted/70",children:t})]})]}),(0,d.jsxs)("div",{className:"flex shrink-0 items-center gap-0.5 sm:gap-1",children:[l&&(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:l,disabled:m,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${m?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:m?{animation:"spin 1s linear infinite"}:void 0,children:m?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:m?"Testing...":"Test"})]}),(0,d.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,d.jsx)("button",{onClick:()=>f(r,`model-${a.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:e===`model-${a.id}`?"check":"content_copy"})}),(0,d.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:e===`model-${a.id}`?"Copied!":"Copy"})]}),h?(0,d.jsx)("button",{onClick:j,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):n?(0,d.jsx)("button",{onClick:n,className:"rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})]})})}function J({isOpen:a,onClose:b,connectionId:c,providerStorageAlias:f,existingIds:g,transformId:h,onImported:i}){let[j,l]=(0,e.useState)(!1),[m,n]=(0,e.useState)(""),[o,p]=(0,e.useState)(""),[q,r]=(0,e.useState)([]),[s,t]=(0,e.useState)(()=>new Set),[u,v]=(0,e.useState)(""),[w,x]=(0,e.useState)(!1),[y,z]=(0,e.useState)(null),A=(0,e.useMemo)(()=>q.map(a=>({...a,added:g?.has(a.id)===!0})),[q,g]),B=(0,e.useMemo)(()=>{let a=u.trim().toLowerCase();return a?A.filter(b=>b.id.toLowerCase().includes(a)||(b.name||"").toLowerCase().includes(a)):A},[A,u]),C=B.filter(a=>!a.added),D=C.length>0&&C.every(a=>s.has(a.id)),E=async()=>{if(!w&&0!==s.size){x(!0),n("");try{let a=await fetch("/api/models/custom/bulk",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:f,type:"llm",ids:[...s]})}),b=await a.json();if(!a.ok)return void n(b.error||"Import failed");z(b),i?.()}catch(a){n(a.message||"Network error")}finally{x(!1)}}};return(0,d.jsx)(k.aF,{isOpen:a,title:"Import Models from Provider",onClose:b,children:(0,d.jsx)("div",{className:"flex flex-col gap-3",children:y?(0,d.jsxs)(d.Fragment,{children:[(0,d.jsxs)("p",{className:"text-sm text-text-main",children:["Imported ",y.added," model",1===y.added?"":"s",y.skipped>0?`, ${y.skipped} already existed`:"","."]}),(0,d.jsx)(k.$n,{onClick:b,fullWidth:!0,children:"Done"})]}):(0,d.jsxs)(d.Fragment,{children:[m&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:m}),o&&!m&&(0,d.jsx)("p",{className:"text-xs text-amber-600 dark:text-amber-400 break-words",children:o}),j?(0,d.jsxs)("p",{className:"text-sm text-text-muted py-6 text-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-sm align-middle mr-1",style:{animation:"spin 1s linear infinite"},children:"progress_activity"}),"Fetching models from provider..."]}):q.length>0&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)("input",{type:"text",value:u,onChange:a=>v(a.target.value),placeholder:"Search models...",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"}),(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-1.5 text-xs text-text-muted hover:text-primary",children:[(0,d.jsx)("input",{type:"checkbox",checked:D,onChange:()=>{t(a=>{let b=new Set(a);if(D)for(let a of C)b.delete(a.id);else for(let a of C)b.add(a.id);return b})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),"Select All (",C.length," available",B.length!==A.length?`, ${B.length} shown`:"",")"]}),(0,d.jsxs)("div",{className:"flex max-h-72 flex-col gap-1 overflow-y-auto custom-scrollbar pr-1",children:[B.map(a=>(0,d.jsxs)("label",{className:`flex items-center gap-2 rounded-lg border px-2.5 py-1.5 text-xs ${a.added?"border-border opacity-50":"border-border hover:border-primary/40 cursor-pointer"}`,children:[(0,d.jsx)("input",{type:"checkbox",checked:a.added||s.has(a.id),disabled:a.added,onChange:()=>{var b;return b=a.id,void t(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"h-3.5 w-3.5 rounded border-gray-300 text-primary focus:ring-primary"}),(0,d.jsx)("span",{className:"min-w-0 flex-1 truncate font-mono",children:a.id}),a.name&&(0,d.jsx)("span",{className:"truncate text-text-muted/70 italic",children:a.name}),a.added&&(0,d.jsx)("span",{className:"shrink-0 text-[10px] text-text-muted",children:"added"})]},a.id)),0===B.length&&(0,d.jsx)("p",{className:"py-4 text-center text-xs text-text-muted",children:"No models match the search"})]}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{onClick:E,fullWidth:!0,disabled:0===s.size||w,children:w?"Importing...":`Import Selected (${s.size})`}),(0,d.jsx)(k.$n,{onClick:b,variant:"ghost",fullWidth:!0,disabled:w,children:"Cancel"})]})]}),!j&&0===q.length&&!m&&(0,d.jsx)(k.$n,{onClick:b,variant:"ghost",fullWidth:!0,children:"Close"})]})})})}function K({modelId:a,fullModel:b,copied:c,onCopy:e,onDeleteAlias:f,onTest:g,testStatus:h,isTesting:i}){let j="ok"===h?"#22c55e":"error"===h?"#ef4444":void 0;return(0,d.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===h?"border-green-500/50":"error"===h?"border-red-500/50":"border-border"} hover:bg-sidebar/50`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:j?{color:j}:void 0,children:"ok"===h?"check_circle":"error"===h?"cancel":"smart_toy"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:a}),(0,d.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,d.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:b}),(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:()=>e(b,`model-${a}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:c===`model-${a}`?"check":"content_copy"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:c===`model-${a}`?"Copied!":"Copy"})]}),g&&(0,d.jsxs)("div",{className:"relative group/btn",children:[(0,d.jsx)("button",{onClick:g,disabled:i,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",style:i?{animation:"spin 1s linear infinite"}:void 0,children:i?"progress_activity":"science"})}),(0,d.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i?"Testing...":"Test"})]})]})]}),(0,d.jsx)("button",{onClick:f,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function L({providerStorageAlias:a,providerDisplayAlias:b,modelAliases:c,customModels:f,copied:g,onCopy:h,onDeleteAlias:i,onAddCustomModel:j,onDeleteCustomModel:l,connections:m,isAnthropic:n,onModelsChanged:o,importSupported:p=!1}){let[q,r]=(0,e.useState)(""),[s,t]=(0,e.useState)(!1),[u,v]=(0,e.useState)(!1),[w,x]=(0,e.useState)(null),[y,z]=(0,e.useState)({}),A=async b=>{if(!w){x(b);try{let c=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${a}/${b}`})}),d=await c.json();z(a=>({...a,[b]:d.ok?"ok":"error"}))}catch{z(a=>({...a,[b]:"error"}))}finally{x(null)}}},B=D({customModels:f,modelAliases:c,providerAlias:a,type:"llm"}),C=async()=>{if(!q.trim()||s)return;let a=q.trim();if(B.some(b=>b.id===a))return void alert("Model already exists for this provider.");t(!0);try{await j(a),r("")}catch(a){console.log("Error adding model:",a)}finally{t(!1)}},E=m.find(a=>!1!==a.isActive)?.id||null,F=!!E&&!0===p,G=new Set(B.map(a=>a.id));return(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",n?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,d.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,d.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,d.jsx)("input",{id:"new-compatible-model-input",type:"text",value:q,onChange:a=>r(a.target.value),onKeyDown:a=>"Enter"===a.key&&C(),placeholder:n?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,d.jsx)(k.$n,{size:"sm",icon:"add",onClick:C,disabled:!q.trim()||s,children:s?"Adding...":"Add"}),(0,d.jsx)(k.$n,{size:"sm",variant:"secondary",icon:"download",onClick:()=>v(!0),disabled:!F,children:"Import from /models"})]}),!F&&(0,d.jsx)("p",{className:"text-xs text-text-muted",children:E?"Set a Base URL on the active connection to enable importing models.":"Add a connection to enable importing models."}),B.length>0&&(0,d.jsx)("div",{className:"flex flex-col gap-3",children:B.map(({id:c,alias:e,source:f})=>(0,d.jsx)(K,{modelId:c,fullModel:`${b}/${c}`,copied:g,onCopy:h,onDeleteAlias:()=>"custom"===f?l(c):i(e),onTest:m.length>0?()=>A(c):void 0,testStatus:y[c],isTesting:w===c},`${f}-${a}/${c}`))}),(0,d.jsx)(J,{isOpen:u,onClose:()=>v(!1),connectionId:E,providerStorageAlias:a,existingIds:G,onImported:o})]})}function M({isOpen:a,onClose:b,providerId:c,providerAlias:f,connections:g,customModels:h,disabledModelIds:i,onSaved:j}){let[l,m]=(0,e.useState)([]),[n,o]=(0,e.useState)(()=>new Set),[p,q]=(0,e.useState)(""),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)(!1),[v,w]=(0,e.useState)("");(0,e.useMemo)(()=>(g||[]).filter(a=>!1!==a.isActive&&a.id).map(a=>a.id),[g]);let x=(0,e.useMemo)(()=>(h||[]).filter(a=>a.providerAlias===f&&"llm"===(a.kind||a.type||"llm")).map(a=>({id:String(a.id).trim(),name:a.name||a.id})).filter(a=>a.id),[h,f]),y=(0,e.useMemo)(()=>{let a=p.trim().toLowerCase();return a?l.filter(b=>b.id.toLowerCase().includes(a)||b.name.toLowerCase().includes(a)):l},[l,p]),z=async()=>{u(!0),w("");try{let a=Array.from(n),c=await fetch("/api/models/enabled",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({providerAlias:f,ids:a})});if(!c.ok){let a=await c.json().catch(()=>({}));throw Error(a.error||`Failed to save (${c.status})`)}j?.(a),b()}catch(a){w(a?.message||"Failed to save visible models")}finally{u(!1)}};return(0,d.jsx)(k.aF,{isOpen:a,onClose:b,title:"Visible models",size:"lg",footer:null,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 p-4",children:[(0,d.jsxs)("div",{className:"flex items-start gap-2 rounded-lg border border-primary/20 bg-primary/8 px-2.5 py-2 text-xs text-text-muted",children:[(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-primary",style:{fontSize:"14px"},children:"info"}),(0,d.jsxs)("span",{children:["Only the checked models are exposed on ",(0,d.jsx)("code",{className:"font-mono",children:"/v1/models"}),". Leave everything unchecked to expose all of them. Custom models are always exposed."]})]}),(0,d.jsxs)("div",{className:"flex items-center gap-2",children:[(0,d.jsxs)("div",{className:"relative flex-1",children:[(0,d.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,d.jsx)("input",{type:"text",placeholder:"Search...",value:p,onChange:a=>q(a.target.value),className:"w-full rounded border border-border bg-surface py-1.5 pl-8 pr-3 text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:()=>o(new Set(l.map(a=>a.id))),disabled:r||t,children:"Select all"}),(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:()=>o(new Set),disabled:r||t,children:"Clear"})]}),v&&(0,d.jsx)("p",{className:"text-xs text-red-500 break-words",children:v}),r?(0,d.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"Loading models…"}):(0,d.jsxs)("div",{className:"max-h-[360px] overflow-y-auto rounded-lg border border-border",children:[y.map(a=>(0,d.jsxs)("label",{className:"flex cursor-pointer items-center gap-2 border-b border-border/50 px-3 py-2 last:border-b-0 hover:bg-sidebar/50",children:[(0,d.jsx)("input",{type:"checkbox",checked:n.has(a.id),onChange:()=>{var b;return b=a.id,void o(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"size-3.5 accent-primary cursor-pointer"}),(0,d.jsx)("span",{className:"truncate text-xs text-text-main",children:a.name}),(0,d.jsx)("code",{className:"truncate font-mono text-[11px] text-text-muted",children:a.id}),a.live&&!a.stale&&(0,d.jsx)("span",{className:"ml-auto shrink-0 rounded bg-primary/10 px-1.5 py-0.5 text-[10px] text-primary",children:"live"}),a.stale&&(0,d.jsx)("span",{className:"ml-auto shrink-0 rounded bg-amber-500/10 px-1.5 py-0.5 text-[10px] text-amber-600 dark:text-amber-400",children:"not in catalog"})]},a.id)),0===y.length&&(0,d.jsx)("p",{className:"py-6 text-center text-xs text-text-muted",children:"No models found"})]}),x.length>0&&(0,d.jsxs)("div",{className:"rounded-lg border border-border px-3 py-2",children:[(0,d.jsx)("p",{className:"mb-1 text-[11px] text-text-muted",children:"Always exposed (custom models)"}),(0,d.jsx)("div",{className:"flex flex-wrap gap-1.5",children:x.map(a=>(0,d.jsx)("span",{className:"rounded bg-sidebar px-1.5 py-0.5 font-mono text-[11px] text-text-muted",children:a.id},a.id))})]}),(0,d.jsxs)("div",{className:"flex items-center justify-between gap-2",children:[(0,d.jsx)("span",{className:"text-[11px] text-text-muted",children:0===n.size?"Nothing selected — all models stay visible.":`${n.size} of ${l.length} selected`}),(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{variant:"ghost",size:"sm",onClick:b,disabled:t,children:"Cancel"}),(0,d.jsx)(k.$n,{variant:"primary",size:"sm",onClick:z,loading:t,disabled:r,children:"Save"})]})]})]})})}I.propTypes={model:F().shape({id:F().string.isRequired}).isRequired,fullModel:F().string.isRequired,alias:F().string,copied:F().string,onCopy:F().func.isRequired,testStatus:F().oneOf(["ok","error","slow","rate_limited","not_tested"]),isCustom:F().bool,isFree:F().bool,onDeleteAlias:F().func,onTest:F().func,isTesting:F().bool,onDisable:F().func,caps:F().object,thinkingSuffix:F().string},F().string.isRequired,F().string.isRequired,F().string,F().func.isRequired,F().func.isRequired,F().func,F().oneOf(["ok","error"]),F().bool,F().string.isRequired,F().object.isRequired,F().arrayOf(F().object),F().string,F().func.isRequired,F().func.isRequired,F().func.isRequired,F().func.isRequired,J.propTypes={isOpen:F().bool.isRequired,onClose:F().func.isRequired,connectionId:F().string,providerStorageAlias:F().string.isRequired,existingIds:F().instanceOf(Set),transformId:F().func,onImported:F().func},K.propTypes={modelId:F().string.isRequired,fullModel:F().string.isRequired,copied:F().string,onCopy:F().func.isRequired,onDeleteAlias:F().func.isRequired,onTest:F().func,testStatus:F().string,isTesting:F().bool},L.propTypes={providerStorageAlias:F().string.isRequired,providerDisplayAlias:F().string.isRequired,modelAliases:F().object.isRequired,customModels:F().arrayOf(F().object),copied:F().string,onCopy:F().func.isRequired,onDeleteAlias:F().func.isRequired,onAddCustomModel:F().func.isRequired,onDeleteCustomModel:F().func.isRequired,connections:F().arrayOf(F().shape({id:F().string,isActive:F().bool})).isRequired,isAnthropic:F().bool,onModelsChanged:F().func,importSupported:F().bool},M.propTypes={isOpen:F().bool.isRequired,onClose:F().func.isRequired,providerId:F().string.isRequired,providerAlias:F().string.isRequired,connections:F().arrayOf(F().object),customModels:F().arrayOf(F().object),disabledModelIds:F().arrayOf(F().string),onSaved:F().func};var N=c(74429),O=c(74875);function P({until:a}){let[b,c]=(0,e.useState)("");return b?(0,d.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",b]}):null}P.propTypes={until:F().string.isRequired};var Q=c(26177),R=c(7859),S=c(94916);let T=["invalid_grant","refresh_token_expired","reauth_required","unrecoverable_refresh_error","refresh_token_reused","refresh_token_invalidated"];function U(a){if(!a||"string"!=typeof a)return!1;let b=a.toLowerCase();return T.some(a=>b.includes(a))}function V({connection:a,plan:b=null,proxyPools:c,isOAuth:f,isFirst:g,isLast:h,onMoveUp:i,onMoveDown:j,onToggleActive:l,onUpdateProxy:m,onEdit:n,onDelete:o,onReconnect:p=null,oneByOneStatus:q=null,autoPing:r=null,fastMode:s=null}){let[t,u]=(0,e.useState)(!1),v=(0,S.gr)(a.providerSpecificData?.quotaReserve),w=S.vP.filter(a=>v[a.id]).map(a=>`${a.label} ${v[a.id]}%`).join(" \xb7 "),[x,y]=(0,e.useState)(!1),[z,B]=(0,e.useState)(!1),C=(0,e.useRef)(null),D=(0,e.useRef)(null),[E,F]=(0,e.useState)(null),{copied:G,copy:H}=(0,A.C)(),I=`conn-id-${a.id}`,J=async()=>{if(s?.onToggle&&!z){B(!0);try{await s.onToggle(!s.on)}catch(a){console.error("Failed to toggle fast mode:",a)}finally{B(!1)}}},K=new Map((c||[]).map(a=>[a.id,a])),L=a.providerSpecificData?.proxyPoolId||null,M=L?K.get(L):null,T=a.providerSpecificData?.connectionProxyEnabled===!0&&!!a.providerSpecificData?.connectionProxyUrl,W=!!L||T,X=M?`Pool: ${M.name}`:L?`Pool: ${L} (inactive/missing)`:T?`Legacy: ${a.providerSpecificData?.connectionProxyUrl}`:"",Y=(()=>{if(!r)return"";let a=[];return(r.reactiveOn&&a.push("On reset"),r.scheduleOn&&a.push(`Scheduled (${r.scheduleSummary||"active"})`),a.length>0)?`Auto-ping active: ${a.join(" + ")}. Click to configure.`:"codex"===r.provider?"Auto-starts the next 5h Codex window after reset or on schedule. Click to configure.":"Auto-starts a new window on quota reset or fixed schedule. Click to configure."})(),Z="";if(M?.proxyUrl||a.providerSpecificData?.connectionProxyUrl){let b=M?.proxyUrl||a.providerSpecificData?.connectionProxyUrl;try{let a=new URL(b);Z=`${a.protocol}//${a.hostname}${a.port?`:${a.port}`:""}`}catch{Z=b}}let $=M?.noProxy||a.providerSpecificData?.connectionNoProxy||"",_="default";M?.isActive===!0?_="success":(L||T)&&(_="error");let aa=async a=>{y(!0);try{await m("__none__"===a?null:a)}finally{y(!1),u(!1)}},ab=a.authType||(f?"oauth":"apikey"),ac="oauth"===ab,ad="cookie"===ab,ae=a.name?.trim()||a.email?.trim()||a.displayName?.trim()||(ac?"OAuth Account":ad?"Cookie Account":"API Key"),af=a.name?.trim()&&a.email?.trim()&&a.name.trim()!==a.email.trim()?a.email.trim():a.name?.trim()&&a.displayName?.trim()&&a.name.trim()!==a.displayName.trim()?a.displayName.trim():null,ag=b?.trim(),ah=a.providerSpecificData?.chatgptPlanType?.trim(),ai="codex"===a.provider?ag&&"unknown"!==ag.toLowerCase()?ag:ah:null,[aj,ak]=(0,e.useState)(!1),al=(0,Q.kJ)(a),am="unavailable"!==a.testStatus||aj?a.testStatus:"active",an=(ac||ad)&&"unavailable"===a.testStatus&&function(a,b){if(401===a||403===a)return!0;if(!b||"string"!=typeof b)return!1;let c=b.toLowerCase();return c.includes("unauthorized")||c.includes("token")||c.includes("invalid api key")||c.includes("revoked")||c.includes("auth")||U(b)}(a.errorCode,a.lastError),ao=U(a.lastError)?"Auth expired — reconnect required":a.lastError,ap=()=>q?"queued"===q.state?"queued":"testing"===q.state?"testing":"success"===q.state?"success":"failed"===q.state?q.error?`failed: ${q.error}`:"failed":null:null;return(0,d.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===a.isActive?"opacity-60":""}`,children:[(0,d.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,d.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,d.jsx)("button",{onClick:i,disabled:g,className:`p-0.5 rounded ${g?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,d.jsx)("button",{onClick:j,disabled:h,className:`p-0.5 rounded ${h?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,d.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:ad?"cookie":ac?"lock":"key"}),(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"text-sm font-medium truncate",children:ae}),af&&(0,d.jsx)("p",{className:"text-xs text-text-muted truncate",children:af}),(0,d.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,d.jsx)(k.Ex,{variant:(0,O.g)(a.isActive,am),size:"sm",dot:!0,children:!1===a.isActive?"disabled":am||"Unknown"}),(0,d.jsx)(k.Ex,{variant:"default",size:"sm",children:ac?"OAuth":ad?"Cookie":"API Key"}),ai&&"unknown"!==ai.toLowerCase()&&(0,d.jsx)(k.Ex,{variant:"primary",size:"sm",children:ai}),W&&(0,d.jsx)(k.Ex,{variant:_,size:"sm",children:"Proxy"}),aj&&!1!==a.isActive&&(0,d.jsx)(P,{until:al}),a.lastError&&!1!==a.isActive&&(!a.lastErrorModel||aj||"active"!==am)&&(0,d.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:a.lastError,children:a.lastErrorModel?`[${a.lastErrorModel}] ${ao}`:ao}),(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["#",a.priority]}),(0,d.jsxs)("button",{type:"button",onClick:()=>H(a.id||"",I),title:"Copy connection ID — send it as the x-connection-id request header to pin requests to this account (falls back to other accounts when it is unavailable)",className:"flex items-center gap-0.5 rounded font-mono text-[11px] text-text-muted transition-colors hover:text-primary",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-xs",children:G===I?"check":"content_copy"}),G===I?"copied":`${(a.id||"").slice(0,8)}…`]}),w&&(0,d.jsx)(k.m_,{text:"Quota kept in reserve: requests move to the next account at this share",children:(0,d.jsx)(k.Ex,{variant:"default",size:"sm",icon:"savings",children:w})}),a.globalPriority&&(0,d.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",a.globalPriority]}),ap()&&(0,d.jsx)(k.Ex,{variant:q?"success"===q.state?"success":"failed"===q.state?"error":"testing"===q.state?"primary":"default":"default",size:"sm",children:ap()})]}),W&&(0,d.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,d.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:X,children:X}),Z&&(0,d.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:Z}),$&&(0,d.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,d.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,d.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(c||[]).length>0&&(0,d.jsxs)("div",{children:[(0,d.jsxs)("button",{ref:D,onClick:()=>{if(t)return void u(!1);let a=D.current?.getBoundingClientRect();if(!a)return void u(!0);let b=((c?.length||0)+1)*34+8,d=window.innerHeight-a.bottom,e=d<b&&a.top>d;F({position:"fixed",right:window.innerWidth-a.right,...e?{bottom:window.innerHeight-a.top+4,maxHeight:Math.max(a.top-8,120)}:{top:a.bottom+4,maxHeight:Math.max(d-8,120)}}),u(!0)},className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${W?"text-primary":"text-text-muted hover:text-primary"}`,disabled:x,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:x?"progress_activity":"lan"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),t&&(0,N.createPortal)((0,d.jsxs)("div",{ref:C,style:E,className:"z-50 max-w-[78vw] min-w-[160px] overflow-y-auto rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,d.jsx)("button",{onClick:()=>aa("__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"}),(c||[]).map(a=>(0,d.jsx)("button",{onClick:()=>aa(a.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${L===a.id?"text-primary font-medium":"text-text-main"}`,children:a.name},a.id))]}),document.body)]}),s&&(0,d.jsx)(k.m_,{text:"codex"===a.provider?s.on?"Fast mode ON — Codex requests on this account use the priority tier. Click to disable.":"Force fast mode — Codex requests on this account use the priority tier.":"Uses the provider's faster processing mode for this account at a higher token cost. Off by default.",children:(0,d.jsxs)("button",{type:"button",role:"switch","aria-label":"Fast mode","aria-checked":s.on,disabled:z,onClick:J,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 disabled:opacity-50 ${s.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:z?"progress_activity":"speed"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Fast"})]})}),r&&(0,d.jsx)(k.m_,{text:Y,children:(0,d.jsxs)("button",{onClick:r.onConfigure,className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${r.isActive?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),an&&p&&(0,d.jsxs)("button",{onClick:()=>p(a),className:"flex flex-col items-center rounded px-2 py-1 text-amber-600 hover:bg-amber-500/10 dark:text-amber-400 dark:hover:bg-amber-500/20 transition-colors",title:"Reconnect account",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"lock_reset"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight font-semibold",children:"Reconnect"})]}),r&&(0,d.jsx)(R.A,{connectionId:a.id,disabled:!1===a.isActive}),(0,d.jsxs)("button",{onClick:n,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,d.jsxs)("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,d.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,d.jsx)(k.lM,{size:"sm",checked:a.isActive??!0,onChange:l,title:a.isActive??!0?"Disable connection":"Enable connection"})]})]})}V.propTypes={connection:F().shape({id:F().string,name:F().string,email:F().string,displayName:F().string,modelLockUntil:F().string,testStatus:F().string,isActive:F().bool,lastError:F().string,priority:F().number,globalPriority:F().number}).isRequired,plan:F().string,proxyPools:F().arrayOf(F().shape({id:F().string,name:F().string,proxyUrl:F().string,noProxy:F().string,isActive:F().bool})),isOAuth:F().bool.isRequired,isFirst:F().bool.isRequired,isLast:F().bool.isRequired,onMoveUp:F().func.isRequired,onMoveDown:F().func.isRequired,onToggleActive:F().func.isRequired,onUpdateProxy:F().func,onEdit:F().func.isRequired,onDelete:F().func.isRequired,onReconnect:F().func,oneByOneStatus:F().shape({state:F().string,error:F().string}),autoPing:F().shape({isActive:F().bool,provider:F().string,reactiveOn:F().bool,scheduleOn:F().bool,scheduleSummary:F().string,onConfigure:F().func}),fastMode:F().shape({on:F().bool,onToggle:F().func})};var W=c(99829);function X({isOpen:a,providerId:b,providerName:c,onClose:f}){let[g,h]=(0,e.useState)([]),[i,j]=(0,e.useState)(!1),[l,m]=(0,e.useState)(null),n=async a=>{try{await navigator.clipboard.writeText(a.key),m(a.id),setTimeout(()=>m(b=>b===a.id?null:b),1500)}catch{}},o=async()=>{let a=g.filter(a=>a.key).map(a=>`${a.name}: ${a.key}`).join("\n");try{await navigator.clipboard.writeText(a),m("__all__"),setTimeout(()=>m(a=>"__all__"===a?null:a),1500)}catch{}},p=g.filter(a=>a.key);return(0,d.jsx)(k.aF,{isOpen:a,title:`Export Keys — ${c||b}`,onClose:f,children:(0,d.jsxs)("div",{className:"flex flex-col gap-3",children:[i&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"Loading…"}),!i&&0===p.length&&(0,d.jsx)("p",{className:"text-sm text-text-muted",children:"No keys stored for this provider."}),!i&&p.map(a=>(0,d.jsxs)("div",{className:"flex items-center gap-2 rounded-lg border border-border-subtle bg-sidebar px-3 py-2",children:[(0,d.jsxs)("div",{className:"min-w-0 flex-1",children:[(0,d.jsx)("p",{className:"truncate text-xs text-text-muted",children:a.name}),(0,d.jsx)("p",{className:"break-all text-sm font-mono text-text-main",children:a.key})]}),(0,d.jsx)("button",{onClick:()=>n(a),title:"Copy key",className:`shrink-0 rounded p-1.5 hover:bg-black/5 dark:hover:bg-white/5 ${l===a.id?"text-green-500":"text-text-muted hover:text-primary"}`,children:(0,d.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:l===a.id?"check":"content_copy"})})]},a.id)),!i&&p.length>0&&(0,d.jsxs)("div",{className:"flex gap-2",children:[(0,d.jsx)(k.$n,{size:"sm",icon:"__all__"===l?"check":"content_copy",onClick:o,children:"__all__"===l?"Copied":"Copy All"}),(0,d.jsx)(k.$n,{size:"sm",variant:"ghost",onClick:f,children:"Close"})]})]})})}W.callServer,W.findSourceMapURL;let Y=`name1|sk-key1
14
14
  name2|sk-key2
15
15
  sk-key-only-auto-named`,Z="__none__",$=()=>({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:Z,baseUrl:"",ollamaHostUrl:""}),_=()=>({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""});function aa({isOpen:a,provider:b,providerName:c,isCompatible:f,isAnthropic:g,providerNode:h,authType:i,authHint:j,website:m,proxyPools:n,error:o,existingNames:p,onSave:q,onBulkDone:r,onClose:s}){let t="ollama-local"===b,u="cookie"===i,v="xai"===b&&!u,w=u?"Cookie Value":"qoder"===b||"qoder-cn"===b?"Personal Access Token (PAT)":"API Key",x=l.Q2?.[b]?.baseUrlField||null,y="azure"===b,z="cloudflare-ai"===b,A="vertex"===b||"vertex-partner"===b,B="bedrock"===b,C=l.Q2?.[b]?.apiKeyOptionalWith||null,D=l.Q2?.[b]?.regions||null,E=l.Q2?.[b]?.defaultRegion||D?.[0]?.id||"",[F,G]=(0,e.useState)($),[H,I]=(0,e.useState)(_),[J,K]=(0,e.useState)({accountId:""}),[L,M]=(0,e.useState)({location:"global",reasoningEffort:"high"}),[N,O]=(0,e.useState)({profile:"",region:"",accessKeyId:"",sessionToken:""}),[P,Q]=(0,e.useState)(E),[R,S]=(0,e.useState)(!1),[T,U]=(0,e.useState)(null),[V,W]=(0,e.useState)(!1),X=z?`name1|sk-key1|acc123456
16
16
  name2|sk-key2|def789012