@techysy/10router 1.5.1 → 1.6.0

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 (662) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/prerender-manifest.json +18 -18
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page.js.nft.json +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +2 -2
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js.nft.json +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page.js.nft.json +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page.js.nft.json +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page.js.nft.json +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page.js.nft.json +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page.js.nft.json +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/experimental/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js +2 -2
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page.js.nft.json +1 -1
  28. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js +1 -1
  30. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page.js.nft.json +1 -1
  31. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  32. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js +1 -1
  33. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page.js.nft.json +1 -1
  34. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js +1 -1
  36. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page.js.nft.json +1 -1
  37. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  38. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js +1 -1
  39. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page.js.nft.json +1 -1
  40. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  41. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js +1 -1
  42. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page.js.nft.json +1 -1
  43. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  44. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  45. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page.js.nft.json +1 -1
  46. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  47. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +3 -3
  48. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js.nft.json +1 -1
  49. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  50. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  51. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page.js.nft.json +1 -1
  52. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  53. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  54. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page.js.nft.json +1 -1
  55. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  56. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  57. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page.js.nft.json +1 -1
  58. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  59. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  60. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page.js.nft.json +1 -1
  61. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  62. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  63. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page.js.nft.json +1 -1
  64. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  65. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js +1 -1
  66. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page.js.nft.json +1 -1
  67. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  68. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  69. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page.js.nft.json +1 -1
  70. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  71. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js +1 -1
  72. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page.js.nft.json +1 -1
  73. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  74. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  75. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page.js.nft.json +1 -1
  76. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  77. package/app/.next-cli-build/server/app/_global-error/page.js.nft.json +1 -1
  78. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  79. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  80. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  81. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  82. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  83. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  84. package/app/.next-cli-build/server/app/_not-found/page.js +1 -1
  85. package/app/.next-cli-build/server/app/_not-found/page.js.nft.json +1 -1
  86. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  87. package/app/.next-cli-build/server/app/_not-found.html +2 -2
  88. package/app/.next-cli-build/server/app/_not-found.rsc +6 -6
  89. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +6 -6
  90. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +6 -6
  91. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +2 -2
  92. package/app/.next-cli-build/server/app/api/auth/login/route.js +1 -1
  93. package/app/.next-cli-build/server/app/api/auth/login/route.js.nft.json +1 -1
  94. package/app/.next-cli-build/server/app/api/auth/logout/route.js.nft.json +1 -1
  95. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js +1 -1
  96. package/app/.next-cli-build/server/app/api/auth/oidc/callback/route.js.nft.json +1 -1
  97. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js +1 -1
  98. package/app/.next-cli-build/server/app/api/auth/oidc/start/route.js.nft.json +1 -1
  99. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js +1 -1
  100. package/app/.next-cli-build/server/app/api/auth/oidc/test/route.js.nft.json +1 -1
  101. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js +1 -1
  102. package/app/.next-cli-build/server/app/api/auth/reset-password/route.js.nft.json +1 -1
  103. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js +1 -1
  104. package/app/.next-cli-build/server/app/api/auth/saml/acs/route.js.nft.json +1 -1
  105. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js +1 -1
  106. package/app/.next-cli-build/server/app/api/auth/saml/metadata/route.js.nft.json +1 -1
  107. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js +1 -1
  108. package/app/.next-cli-build/server/app/api/auth/saml/start/route.js.nft.json +1 -1
  109. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js +1 -1
  110. package/app/.next-cli-build/server/app/api/auth/saml/test/route.js.nft.json +1 -1
  111. package/app/.next-cli-build/server/app/api/auth/status/route.js +1 -1
  112. package/app/.next-cli-build/server/app/api/auth/status/route.js.nft.json +1 -1
  113. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js +1 -1
  114. package/app/.next-cli-build/server/app/api/auth/verify-password/route.js.nft.json +1 -1
  115. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js +1 -1
  116. package/app/.next-cli-build/server/app/api/cli-tools/all-statuses/route.js.nft.json +1 -1
  117. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js +1 -1
  118. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/alias/route.js.nft.json +1 -1
  119. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js +1 -1
  120. package/app/.next-cli-build/server/app/api/cli-tools/antigravity-mitm/route.js.nft.json +1 -1
  121. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js +1 -1
  122. package/app/.next-cli-build/server/app/api/cli-tools/claude-profiles/route.js.nft.json +1 -1
  123. package/app/.next-cli-build/server/app/api/cli-tools/claude-settings/route.js.nft.json +1 -1
  124. package/app/.next-cli-build/server/app/api/cli-tools/cline-settings/route.js.nft.json +1 -1
  125. package/app/.next-cli-build/server/app/api/cli-tools/codex-profiles/route.js.nft.json +1 -1
  126. package/app/.next-cli-build/server/app/api/cli-tools/codex-settings/route.js.nft.json +1 -1
  127. package/app/.next-cli-build/server/app/api/cli-tools/copilot-settings/route.js.nft.json +1 -1
  128. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-registry/route.js.nft.json +1 -1
  129. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  130. package/app/.next-cli-build/server/app/api/cli-tools/cowork-mcp-tools/route.js.nft.json +1 -1
  131. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  132. package/app/.next-cli-build/server/app/api/cli-tools/cowork-settings/route.js.nft.json +1 -1
  133. package/app/.next-cli-build/server/app/api/cli-tools/deepseek-tui-settings/route.js.nft.json +1 -1
  134. package/app/.next-cli-build/server/app/api/cli-tools/devin-settings/route.js.nft.json +1 -1
  135. package/app/.next-cli-build/server/app/api/cli-tools/droid-settings/route.js.nft.json +1 -1
  136. package/app/.next-cli-build/server/app/api/cli-tools/grok-build-settings/route.js.nft.json +1 -1
  137. package/app/.next-cli-build/server/app/api/cli-tools/hermes-settings/route.js.nft.json +1 -1
  138. package/app/.next-cli-build/server/app/api/cli-tools/jcode-settings/route.js.nft.json +1 -1
  139. package/app/.next-cli-build/server/app/api/cli-tools/kilo-settings/route.js.nft.json +1 -1
  140. package/app/.next-cli-build/server/app/api/cli-tools/openclaw-settings/route.js.nft.json +1 -1
  141. package/app/.next-cli-build/server/app/api/cli-tools/opencode-settings/route.js.nft.json +1 -1
  142. package/app/.next-cli-build/server/app/api/combos/[id]/route.js +1 -1
  143. package/app/.next-cli-build/server/app/api/combos/[id]/route.js.nft.json +1 -1
  144. package/app/.next-cli-build/server/app/api/combos/route.js +1 -1
  145. package/app/.next-cli-build/server/app/api/combos/route.js.nft.json +1 -1
  146. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js +1 -1
  147. package/app/.next-cli-build/server/app/api/external-quota/[source]/route.js.nft.json +1 -1
  148. package/app/.next-cli-build/server/app/api/gateway-probe/route.js.nft.json +1 -1
  149. package/app/.next-cli-build/server/app/api/headroom/extras/route.js.nft.json +1 -1
  150. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js +1 -1
  151. package/app/.next-cli-build/server/app/api/headroom/proxy/[...path]/route.js.nft.json +1 -1
  152. package/app/.next-cli-build/server/app/api/headroom/restart/route.js +1 -1
  153. package/app/.next-cli-build/server/app/api/headroom/restart/route.js.nft.json +1 -1
  154. package/app/.next-cli-build/server/app/api/headroom/start/route.js +1 -1
  155. package/app/.next-cli-build/server/app/api/headroom/start/route.js.nft.json +1 -1
  156. package/app/.next-cli-build/server/app/api/headroom/status/route.js +1 -1
  157. package/app/.next-cli-build/server/app/api/headroom/status/route.js.nft.json +1 -1
  158. package/app/.next-cli-build/server/app/api/headroom/stop/route.js.nft.json +1 -1
  159. package/app/.next-cli-build/server/app/api/health/route.js.nft.json +1 -1
  160. package/app/.next-cli-build/server/app/api/init/route.js.nft.json +1 -1
  161. package/app/.next-cli-build/server/app/api/keys/[id]/route.js +1 -1
  162. package/app/.next-cli-build/server/app/api/keys/[id]/route.js.nft.json +1 -1
  163. package/app/.next-cli-build/server/app/api/keys/rotate/route.js +1 -1
  164. package/app/.next-cli-build/server/app/api/keys/rotate/route.js.nft.json +1 -1
  165. package/app/.next-cli-build/server/app/api/keys/route.js +1 -1
  166. package/app/.next-cli-build/server/app/api/keys/route.js.nft.json +1 -1
  167. package/app/.next-cli-build/server/app/api/locale/route.js.nft.json +1 -1
  168. package/app/.next-cli-build/server/app/api/mcp/[plugin]/message/route.js.nft.json +1 -1
  169. package/app/.next-cli-build/server/app/api/mcp/[plugin]/sse/route.js.nft.json +1 -1
  170. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js +1 -1
  171. package/app/.next-cli-build/server/app/api/media-providers/tts/deepgram/voices/route.js.nft.json +1 -1
  172. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js +1 -1
  173. package/app/.next-cli-build/server/app/api/media-providers/tts/elevenlabs/voices/route.js.nft.json +1 -1
  174. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js +1 -1
  175. package/app/.next-cli-build/server/app/api/media-providers/tts/inworld/voices/route.js.nft.json +1 -1
  176. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js +1 -1
  177. package/app/.next-cli-build/server/app/api/media-providers/tts/minimax/voices/route.js.nft.json +1 -1
  178. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js +1 -1
  179. package/app/.next-cli-build/server/app/api/media-providers/tts/voices/route.js.nft.json +1 -1
  180. package/app/.next-cli-build/server/app/api/models/alias/route.js +1 -1
  181. package/app/.next-cli-build/server/app/api/models/alias/route.js.nft.json +1 -1
  182. package/app/.next-cli-build/server/app/api/models/availability/route.js +1 -1
  183. package/app/.next-cli-build/server/app/api/models/availability/route.js.nft.json +1 -1
  184. package/app/.next-cli-build/server/app/api/models/caps/route.js +1 -1
  185. package/app/.next-cli-build/server/app/api/models/caps/route.js.nft.json +1 -1
  186. package/app/.next-cli-build/server/app/api/models/custom/bulk/route.js.nft.json +1 -1
  187. package/app/.next-cli-build/server/app/api/models/custom/route.js +1 -1
  188. package/app/.next-cli-build/server/app/api/models/custom/route.js.nft.json +1 -1
  189. package/app/.next-cli-build/server/app/api/models/disabled/route.js +1 -1
  190. package/app/.next-cli-build/server/app/api/models/disabled/route.js.nft.json +1 -1
  191. package/app/.next-cli-build/server/app/api/models/route.js +1 -1
  192. package/app/.next-cli-build/server/app/api/models/route.js.nft.json +1 -1
  193. package/app/.next-cli-build/server/app/api/models/test/route.js +1 -1
  194. package/app/.next-cli-build/server/app/api/models/test/route.js.nft.json +1 -1
  195. package/app/.next-cli-build/server/app/api/network/egress-region/route.js.nft.json +1 -1
  196. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  197. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js.nft.json +1 -1
  198. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js +1 -1
  199. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/bulk-import/route.js.nft.json +1 -1
  200. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/checkin/route.js.nft.json +1 -1
  201. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/claim-compensation/route.js.nft.json +1 -1
  202. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js +1 -1
  203. package/app/.next-cli-build/server/app/api/oauth/codebuddy-cn/export/route.js.nft.json +1 -1
  204. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  205. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js.nft.json +1 -1
  206. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  207. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js.nft.json +1 -1
  208. package/app/.next-cli-build/server/app/api/oauth/cursor/auto-import/route.js.nft.json +1 -1
  209. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js +1 -1
  210. package/app/.next-cli-build/server/app/api/oauth/cursor/import/route.js.nft.json +1 -1
  211. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js +1 -1
  212. package/app/.next-cli-build/server/app/api/oauth/gitlab/pat/route.js.nft.json +1 -1
  213. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js +1 -1
  214. package/app/.next-cli-build/server/app/api/oauth/iflow/cookie/route.js.nft.json +1 -1
  215. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js +1 -1
  216. package/app/.next-cli-build/server/app/api/oauth/kiro/api-key/route.js.nft.json +1 -1
  217. package/app/.next-cli-build/server/app/api/oauth/kiro/auto-import/route.js.nft.json +1 -1
  218. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js +1 -1
  219. package/app/.next-cli-build/server/app/api/oauth/kiro/import/route.js.nft.json +1 -1
  220. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js +1 -1
  221. package/app/.next-cli-build/server/app/api/oauth/kiro/import-cli-proxy/route.js.nft.json +1 -1
  222. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js +1 -1
  223. package/app/.next-cli-build/server/app/api/oauth/kiro/social-authorize/route.js.nft.json +1 -1
  224. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js +1 -1
  225. package/app/.next-cli-build/server/app/api/oauth/kiro/social-exchange/route.js.nft.json +1 -1
  226. package/app/.next-cli-build/server/app/api/oauth/qoder/checkin/route.js.nft.json +1 -1
  227. package/app/.next-cli-build/server/app/api/oauth/qoder-cn/checkin/route.js.nft.json +1 -1
  228. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js +1 -1
  229. package/app/.next-cli-build/server/app/api/oauth/transfer/export/route.js.nft.json +1 -1
  230. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js +1 -1
  231. package/app/.next-cli-build/server/app/api/oauth/transfer/import/route.js.nft.json +1 -1
  232. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js +1 -1
  233. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/api-key/route.js.nft.json +1 -1
  234. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js +1 -1
  235. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/auto-import/route.js.nft.json +1 -1
  236. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-kill/route.js.nft.json +1 -1
  237. package/app/.next-cli-build/server/app/api/oauth/xiaomi-mimo/desktop-status/route.js.nft.json +1 -1
  238. package/app/.next-cli-build/server/app/api/oauth/zed/auto-import/route.js.nft.json +1 -1
  239. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js +1 -1
  240. package/app/.next-cli-build/server/app/api/oauth/zed/import/route.js.nft.json +1 -1
  241. package/app/.next-cli-build/server/app/api/pricing/route.js +1 -1
  242. package/app/.next-cli-build/server/app/api/pricing/route.js.nft.json +1 -1
  243. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js +1 -1
  244. package/app/.next-cli-build/server/app/api/provider-nodes/[id]/route.js.nft.json +1 -1
  245. package/app/.next-cli-build/server/app/api/provider-nodes/route.js +1 -1
  246. package/app/.next-cli-build/server/app/api/provider-nodes/route.js.nft.json +1 -1
  247. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js +1 -1
  248. package/app/.next-cli-build/server/app/api/provider-nodes/validate/route.js.nft.json +1 -1
  249. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js +1 -1
  250. package/app/.next-cli-build/server/app/api/providers/[id]/models/route.js.nft.json +1 -1
  251. package/app/.next-cli-build/server/app/api/providers/[id]/route.js +1 -1
  252. package/app/.next-cli-build/server/app/api/providers/[id]/route.js.nft.json +1 -1
  253. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js +1 -1
  254. package/app/.next-cli-build/server/app/api/providers/[id]/test/route.js.nft.json +1 -1
  255. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js +1 -1
  256. package/app/.next-cli-build/server/app/api/providers/[id]/test-models/route.js.nft.json +1 -1
  257. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  258. package/app/.next-cli-build/server/app/api/providers/client/route.js.nft.json +1 -1
  259. package/app/.next-cli-build/server/app/api/providers/kilo/free-models/route.js.nft.json +1 -1
  260. package/app/.next-cli-build/server/app/api/providers/route.js +1 -1
  261. package/app/.next-cli-build/server/app/api/providers/route.js.nft.json +1 -1
  262. package/app/.next-cli-build/server/app/api/providers/suggested-models/route.js.nft.json +1 -1
  263. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js +1 -1
  264. package/app/.next-cli-build/server/app/api/providers/test-batch/route.js.nft.json +1 -1
  265. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  266. package/app/.next-cli-build/server/app/api/providers/validate/route.js.nft.json +1 -1
  267. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js +1 -1
  268. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/route.js.nft.json +1 -1
  269. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js +1 -1
  270. package/app/.next-cli-build/server/app/api/proxy-pools/[id]/test/route.js.nft.json +1 -1
  271. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js +1 -1
  272. package/app/.next-cli-build/server/app/api/proxy-pools/cloudflare-deploy/route.js.nft.json +1 -1
  273. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js +1 -1
  274. package/app/.next-cli-build/server/app/api/proxy-pools/deno-deploy/route.js.nft.json +1 -1
  275. package/app/.next-cli-build/server/app/api/proxy-pools/route.js +1 -1
  276. package/app/.next-cli-build/server/app/api/proxy-pools/route.js.nft.json +1 -1
  277. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js +1 -1
  278. package/app/.next-cli-build/server/app/api/proxy-pools/vercel-deploy/route.js.nft.json +1 -1
  279. package/app/.next-cli-build/server/app/api/pxpipe/health/route.js.nft.json +1 -1
  280. package/app/.next-cli-build/server/app/api/pxpipe/install/route.js.nft.json +1 -1
  281. package/app/.next-cli-build/server/app/api/pxpipe/logs/route.js.nft.json +1 -1
  282. package/app/.next-cli-build/server/app/api/pxpipe/restart/route.js.nft.json +1 -1
  283. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js +1 -1
  284. package/app/.next-cli-build/server/app/api/pxpipe/start/route.js.nft.json +1 -1
  285. package/app/.next-cli-build/server/app/api/pxpipe/stats/route.js.nft.json +1 -1
  286. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js +1 -1
  287. package/app/.next-cli-build/server/app/api/pxpipe/status/route.js.nft.json +1 -1
  288. package/app/.next-cli-build/server/app/api/pxpipe/stop/route.js.nft.json +1 -1
  289. package/app/.next-cli-build/server/app/api/security/status/route.js +1 -1
  290. package/app/.next-cli-build/server/app/api/security/status/route.js.nft.json +1 -1
  291. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js +1 -1
  292. package/app/.next-cli-build/server/app/api/settings/database/import-usage/route.js.nft.json +1 -1
  293. package/app/.next-cli-build/server/app/api/settings/database/route.js +1 -1
  294. package/app/.next-cli-build/server/app/api/settings/database/route.js.nft.json +1 -1
  295. package/app/.next-cli-build/server/app/api/settings/proxy-test/route.js.nft.json +1 -1
  296. package/app/.next-cli-build/server/app/api/settings/require-login/route.js +1 -1
  297. package/app/.next-cli-build/server/app/api/settings/require-login/route.js.nft.json +1 -1
  298. package/app/.next-cli-build/server/app/api/settings/route.js +2 -2
  299. package/app/.next-cli-build/server/app/api/settings/route.js.nft.json +1 -1
  300. package/app/.next-cli-build/server/app/api/shutdown/route.js.nft.json +1 -1
  301. package/app/.next-cli-build/server/app/api/tags/route.js.nft.json +1 -1
  302. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js +1 -1
  303. package/app/.next-cli-build/server/app/api/translator/console-logs/route.js.nft.json +1 -1
  304. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js +2 -2
  305. package/app/.next-cli-build/server/app/api/translator/console-logs/stream/route.js.nft.json +1 -1
  306. package/app/.next-cli-build/server/app/api/translator/load/route.js.nft.json +1 -1
  307. package/app/.next-cli-build/server/app/api/translator/save/route.js.nft.json +1 -1
  308. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  309. package/app/.next-cli-build/server/app/api/translator/send/route.js.nft.json +1 -1
  310. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  311. package/app/.next-cli-build/server/app/api/translator/translate/route.js.nft.json +1 -1
  312. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js +1 -1
  313. package/app/.next-cli-build/server/app/api/tunnel/disable/route.js.nft.json +1 -1
  314. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js +1 -1
  315. package/app/.next-cli-build/server/app/api/tunnel/enable/route.js.nft.json +1 -1
  316. package/app/.next-cli-build/server/app/api/tunnel/status/route.js +1 -1
  317. package/app/.next-cli-build/server/app/api/tunnel/status/route.js.nft.json +1 -1
  318. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js +1 -1
  319. package/app/.next-cli-build/server/app/api/tunnel/tailscale-check/route.js.nft.json +1 -1
  320. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  321. package/app/.next-cli-build/server/app/api/tunnel/tailscale-disable/route.js.nft.json +1 -1
  322. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  323. package/app/.next-cli-build/server/app/api/tunnel/tailscale-enable/route.js.nft.json +1 -1
  324. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js +1 -1
  325. package/app/.next-cli-build/server/app/api/tunnel/tailscale-install/route.js.nft.json +1 -1
  326. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js +1 -1
  327. package/app/.next-cli-build/server/app/api/usage/[connectionId]/claude-reset/route.js.nft.json +1 -1
  328. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  329. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js.nft.json +1 -1
  330. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  331. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js.nft.json +1 -1
  332. package/app/.next-cli-build/server/app/api/usage/chart/route.js +1 -1
  333. package/app/.next-cli-build/server/app/api/usage/chart/route.js.nft.json +1 -1
  334. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js +1 -1
  335. package/app/.next-cli-build/server/app/api/usage/dashboard/route.js.nft.json +1 -1
  336. package/app/.next-cli-build/server/app/api/usage/history/route.js +1 -1
  337. package/app/.next-cli-build/server/app/api/usage/history/route.js.nft.json +1 -1
  338. package/app/.next-cli-build/server/app/api/usage/logs/route.js +1 -1
  339. package/app/.next-cli-build/server/app/api/usage/logs/route.js.nft.json +1 -1
  340. package/app/.next-cli-build/server/app/api/usage/providers/route.js +1 -1
  341. package/app/.next-cli-build/server/app/api/usage/providers/route.js.nft.json +1 -1
  342. package/app/.next-cli-build/server/app/api/usage/quotas/route.js +1 -1
  343. package/app/.next-cli-build/server/app/api/usage/quotas/route.js.nft.json +1 -1
  344. package/app/.next-cli-build/server/app/api/usage/request-details/route.js +1 -1
  345. package/app/.next-cli-build/server/app/api/usage/request-details/route.js.nft.json +1 -1
  346. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js +1 -1
  347. package/app/.next-cli-build/server/app/api/usage/request-logs/route.js.nft.json +1 -1
  348. package/app/.next-cli-build/server/app/api/usage/stats/route.js +1 -1
  349. package/app/.next-cli-build/server/app/api/usage/stats/route.js.nft.json +1 -1
  350. package/app/.next-cli-build/server/app/api/usage/stream/route.js +1 -1
  351. package/app/.next-cli-build/server/app/api/usage/stream/route.js.nft.json +1 -1
  352. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js +1 -1
  353. package/app/.next-cli-build/server/app/api/v1/api/chat/route.js.nft.json +1 -1
  354. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js +1 -1
  355. package/app/.next-cli-build/server/app/api/v1/audio/speech/route.js.nft.json +1 -1
  356. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js +1 -1
  357. package/app/.next-cli-build/server/app/api/v1/audio/transcriptions/route.js.nft.json +1 -1
  358. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js +1 -1
  359. package/app/.next-cli-build/server/app/api/v1/audio/voices/route.js.nft.json +1 -1
  360. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js +1 -1
  361. package/app/.next-cli-build/server/app/api/v1/chat/completions/route.js.nft.json +1 -1
  362. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js +1 -1
  363. package/app/.next-cli-build/server/app/api/v1/embeddings/route.js.nft.json +1 -1
  364. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js +2 -2
  365. package/app/.next-cli-build/server/app/api/v1/images/generations/route.js.nft.json +1 -1
  366. package/app/.next-cli-build/server/app/api/v1/messages/count_tokens/route.js.nft.json +1 -1
  367. package/app/.next-cli-build/server/app/api/v1/messages/route.js +1 -1
  368. package/app/.next-cli-build/server/app/api/v1/messages/route.js.nft.json +1 -1
  369. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js +1 -1
  370. package/app/.next-cli-build/server/app/api/v1/models/[kind]/route.js.nft.json +1 -1
  371. package/app/.next-cli-build/server/app/api/v1/models/info/route.js +1 -1
  372. package/app/.next-cli-build/server/app/api/v1/models/info/route.js.nft.json +1 -1
  373. package/app/.next-cli-build/server/app/api/v1/models/route.js +1 -1
  374. package/app/.next-cli-build/server/app/api/v1/models/route.js.nft.json +1 -1
  375. package/app/.next-cli-build/server/app/api/v1/rerank/route.js +1 -1
  376. package/app/.next-cli-build/server/app/api/v1/rerank/route.js.nft.json +1 -1
  377. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js +1 -1
  378. package/app/.next-cli-build/server/app/api/v1/responses/compact/route.js.nft.json +1 -1
  379. package/app/.next-cli-build/server/app/api/v1/responses/route.js +1 -1
  380. package/app/.next-cli-build/server/app/api/v1/responses/route.js.nft.json +1 -1
  381. package/app/.next-cli-build/server/app/api/v1/route.js +1 -1
  382. package/app/.next-cli-build/server/app/api/v1/route.js.nft.json +1 -1
  383. package/app/.next-cli-build/server/app/api/v1/search/route.js +1 -1
  384. package/app/.next-cli-build/server/app/api/v1/search/route.js.nft.json +1 -1
  385. package/app/.next-cli-build/server/app/api/v1/systemone/route.js +1 -1
  386. package/app/.next-cli-build/server/app/api/v1/systemone/route.js.nft.json +1 -1
  387. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js +1 -1
  388. package/app/.next-cli-build/server/app/api/v1/videos/[id]/route.js.nft.json +1 -1
  389. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js +1 -1
  390. package/app/.next-cli-build/server/app/api/v1/videos/edits/route.js.nft.json +1 -1
  391. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js +1 -1
  392. package/app/.next-cli-build/server/app/api/v1/videos/extensions/route.js.nft.json +1 -1
  393. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js +1 -1
  394. package/app/.next-cli-build/server/app/api/v1/videos/generations/route.js.nft.json +1 -1
  395. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js +1 -1
  396. package/app/.next-cli-build/server/app/api/v1/web/fetch/route.js.nft.json +1 -1
  397. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js +1 -1
  398. package/app/.next-cli-build/server/app/api/v1beta/models/[...path]/route.js.nft.json +1 -1
  399. package/app/.next-cli-build/server/app/api/v1beta/models/route.js +1 -1
  400. package/app/.next-cli-build/server/app/api/v1beta/models/route.js.nft.json +1 -1
  401. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  402. package/app/.next-cli-build/server/app/api/version/route.js.nft.json +1 -1
  403. package/app/.next-cli-build/server/app/api/version/shell-update/route.js.nft.json +1 -1
  404. package/app/.next-cli-build/server/app/api/version/shutdown/route.js +1 -1
  405. package/app/.next-cli-build/server/app/api/version/shutdown/route.js.nft.json +1 -1
  406. package/app/.next-cli-build/server/app/api/version/update/route.js +1 -1
  407. package/app/.next-cli-build/server/app/api/version/update/route.js.nft.json +1 -1
  408. package/app/.next-cli-build/server/app/callback/page.js +1 -1
  409. package/app/.next-cli-build/server/app/callback/page.js.nft.json +1 -1
  410. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  411. package/app/.next-cli-build/server/app/callback.html +2 -2
  412. package/app/.next-cli-build/server/app/callback.rsc +6 -6
  413. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +6 -6
  414. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +2 -2
  415. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +6 -6
  416. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +2 -2
  417. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +8 -8
  418. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +8 -8
  419. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +8 -8
  420. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +2 -2
  421. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +2 -2
  422. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +8 -8
  423. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +8 -8
  424. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  425. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +2 -2
  426. package/app/.next-cli-build/server/app/dashboard/combos.html +2 -2
  427. package/app/.next-cli-build/server/app/dashboard/combos.rsc +8 -8
  428. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +8 -8
  429. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +8 -8
  430. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +2 -2
  431. package/app/.next-cli-build/server/app/dashboard/endpoint.html +2 -2
  432. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +8 -8
  433. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +8 -8
  434. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  435. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +2 -2
  436. package/app/.next-cli-build/server/app/dashboard/experimental.html +2 -2
  437. package/app/.next-cli-build/server/app/dashboard/experimental.rsc +8 -8
  438. package/app/.next-cli-build/server/app/dashboard/experimental.segments/!KGRhc2hib2FyZCk/dashboard/experimental/__PAGE__.segment.rsc +8 -8
  439. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_full.segment.rsc +8 -8
  440. package/app/.next-cli-build/server/app/dashboard/experimental.segments/_tree.segment.rsc +2 -2
  441. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +2 -2
  442. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +8 -8
  443. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +8 -8
  444. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +8 -8
  445. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +2 -2
  446. package/app/.next-cli-build/server/app/dashboard/mitm.html +2 -2
  447. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +8 -8
  448. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +8 -8
  449. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +8 -8
  450. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +2 -2
  451. package/app/.next-cli-build/server/app/dashboard/profile.html +2 -2
  452. package/app/.next-cli-build/server/app/dashboard/profile.rsc +8 -8
  453. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +8 -8
  454. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +8 -8
  455. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +2 -2
  456. package/app/.next-cli-build/server/app/dashboard/providers/new.html +2 -2
  457. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +8 -8
  458. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +8 -8
  459. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +8 -8
  460. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +2 -2
  461. package/app/.next-cli-build/server/app/dashboard/providers.html +2 -2
  462. package/app/.next-cli-build/server/app/dashboard/providers.rsc +8 -8
  463. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +8 -8
  464. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +8 -8
  465. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +2 -2
  466. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +2 -2
  467. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +8 -8
  468. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +8 -8
  469. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +8 -8
  470. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +2 -2
  471. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +2 -2
  472. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +8 -8
  473. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +8 -8
  474. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +8 -8
  475. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +2 -2
  476. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  477. package/app/.next-cli-build/server/app/dashboard/quota.rsc +9 -9
  478. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +9 -9
  479. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +9 -9
  480. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +2 -2
  481. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js +1 -1
  482. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page.js.nft.json +1 -1
  483. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  484. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +2 -2
  485. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +6 -6
  486. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +6 -6
  487. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +2 -2
  488. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +6 -6
  489. package/app/.next-cli-build/server/app/dashboard/skills.html +2 -2
  490. package/app/.next-cli-build/server/app/dashboard/skills.rsc +8 -8
  491. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +8 -8
  492. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +8 -8
  493. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +2 -2
  494. package/app/.next-cli-build/server/app/dashboard/token-saver.html +2 -2
  495. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +8 -8
  496. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +8 -8
  497. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +8 -8
  498. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +2 -2
  499. package/app/.next-cli-build/server/app/dashboard/translator.html +2 -2
  500. package/app/.next-cli-build/server/app/dashboard/translator.rsc +8 -8
  501. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +8 -8
  502. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +8 -8
  503. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +2 -2
  504. package/app/.next-cli-build/server/app/dashboard/usage.html +2 -2
  505. package/app/.next-cli-build/server/app/dashboard/usage.rsc +8 -8
  506. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +8 -8
  507. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +8 -8
  508. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +2 -2
  509. package/app/.next-cli-build/server/app/dashboard.html +2 -2
  510. package/app/.next-cli-build/server/app/dashboard.rsc +8 -8
  511. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +8 -8
  512. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +8 -8
  513. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +2 -2
  514. package/app/.next-cli-build/server/app/favicon.ico/route.js.nft.json +1 -1
  515. package/app/.next-cli-build/server/app/index.html +1 -1
  516. package/app/.next-cli-build/server/app/index.rsc +6 -6
  517. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +6 -6
  518. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +6 -6
  519. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +2 -2
  520. package/app/.next-cli-build/server/app/landing/page.js +1 -1
  521. package/app/.next-cli-build/server/app/landing/page.js.nft.json +1 -1
  522. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  523. package/app/.next-cli-build/server/app/landing.html +2 -2
  524. package/app/.next-cli-build/server/app/landing.rsc +7 -7
  525. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +7 -7
  526. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +2 -2
  527. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +7 -7
  528. package/app/.next-cli-build/server/app/login/page.js +1 -1
  529. package/app/.next-cli-build/server/app/login/page.js.nft.json +1 -1
  530. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  531. package/app/.next-cli-build/server/app/login.html +2 -2
  532. package/app/.next-cli-build/server/app/login.rsc +7 -7
  533. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +7 -7
  534. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +2 -2
  535. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +7 -7
  536. package/app/.next-cli-build/server/app/manifest.webmanifest/route.js.nft.json +1 -1
  537. package/app/.next-cli-build/server/app/page.js +1 -1
  538. package/app/.next-cli-build/server/app/page.js.nft.json +1 -1
  539. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  540. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  541. package/app/.next-cli-build/server/chunks/1329.js +1 -1
  542. package/app/.next-cli-build/server/chunks/1806.js +1 -1
  543. package/app/.next-cli-build/server/chunks/{9417.js → 1819.js} +2 -2
  544. package/app/.next-cli-build/server/chunks/1884.js +1 -1
  545. package/app/.next-cli-build/server/chunks/2132.js +1 -1
  546. package/app/.next-cli-build/server/chunks/2154.js +1 -0
  547. package/app/.next-cli-build/server/chunks/2557.js +4 -4
  548. package/app/.next-cli-build/server/chunks/2812.js +1 -1
  549. package/app/.next-cli-build/server/chunks/318.js +10 -8
  550. package/app/.next-cli-build/server/chunks/3217.js +1 -0
  551. package/app/.next-cli-build/server/chunks/3267.js +1 -0
  552. package/app/.next-cli-build/server/chunks/3500.js +2 -2
  553. package/app/.next-cli-build/server/chunks/3535.js +1 -1
  554. package/app/.next-cli-build/server/chunks/3792.js +1 -1
  555. package/app/.next-cli-build/server/chunks/3943.js +1 -1
  556. package/app/.next-cli-build/server/chunks/3962.js +1 -1
  557. package/app/.next-cli-build/server/chunks/4123.js +1 -1
  558. package/app/.next-cli-build/server/chunks/4386.js +1 -0
  559. package/app/.next-cli-build/server/chunks/447.js +1 -0
  560. package/app/.next-cli-build/server/chunks/4575.js +1 -1
  561. package/app/.next-cli-build/server/chunks/4692.js +1 -1
  562. package/app/.next-cli-build/server/chunks/4775.js +1 -1
  563. package/app/.next-cli-build/server/chunks/{2112.js → 4906.js} +1 -1
  564. package/app/.next-cli-build/server/chunks/4927.js +4 -4
  565. package/app/.next-cli-build/server/chunks/5210.js +15 -13
  566. package/app/.next-cli-build/server/chunks/539.js +1 -1
  567. package/app/.next-cli-build/server/chunks/5598.js +1 -0
  568. package/app/.next-cli-build/server/chunks/5615.js +1 -1
  569. package/app/.next-cli-build/server/chunks/5625.js +1 -0
  570. package/app/.next-cli-build/server/chunks/5663.js +1 -0
  571. package/app/.next-cli-build/server/chunks/5757.js +1 -1
  572. package/app/.next-cli-build/server/chunks/5781.js +1 -1
  573. package/app/.next-cli-build/server/chunks/6070.js +1 -1
  574. package/app/.next-cli-build/server/chunks/615.js +1 -1
  575. package/app/.next-cli-build/server/chunks/6306.js +1 -1
  576. package/app/.next-cli-build/server/chunks/6326.js +1 -1
  577. package/app/.next-cli-build/server/chunks/6492.js +1 -1
  578. package/app/.next-cli-build/server/chunks/6763.js +1 -1
  579. package/app/.next-cli-build/server/chunks/6790.js +1 -1
  580. package/app/.next-cli-build/server/chunks/6877.js +1 -1
  581. package/app/.next-cli-build/server/chunks/6922.js +1 -1
  582. package/app/.next-cli-build/server/chunks/6956.js +1 -1
  583. package/app/.next-cli-build/server/chunks/6960.js +2 -2
  584. package/app/.next-cli-build/server/chunks/7067.js +1 -1
  585. package/app/.next-cli-build/server/chunks/7122.js +1 -1
  586. package/app/.next-cli-build/server/chunks/7247.js +1 -1
  587. package/app/.next-cli-build/server/chunks/7274.js +4 -4
  588. package/app/.next-cli-build/server/chunks/7322.js +2 -2
  589. package/app/.next-cli-build/server/chunks/7729.js +1 -0
  590. package/app/.next-cli-build/server/chunks/8145.js +1 -1
  591. package/app/.next-cli-build/server/chunks/8172.js +2 -2
  592. package/app/.next-cli-build/server/chunks/8318.js +1 -1
  593. package/app/.next-cli-build/server/chunks/8370.js +2 -2
  594. package/app/.next-cli-build/server/chunks/8499.js +3 -3
  595. package/app/.next-cli-build/server/chunks/8595.js +1 -1
  596. package/app/.next-cli-build/server/chunks/8689.js +1 -1
  597. package/app/.next-cli-build/server/chunks/8749.js +1 -1
  598. package/app/.next-cli-build/server/chunks/8775.js +1 -1
  599. package/app/.next-cli-build/server/chunks/8895.js +8 -8
  600. package/app/.next-cli-build/server/chunks/8920.js +1 -1
  601. package/app/.next-cli-build/server/chunks/9046.js +1 -1
  602. package/app/.next-cli-build/server/chunks/9154.js +1 -1
  603. package/app/.next-cli-build/server/chunks/9489.js +3 -2
  604. package/app/.next-cli-build/server/chunks/9601.js +1 -1
  605. package/app/.next-cli-build/server/chunks/9609.js +1 -1
  606. package/app/.next-cli-build/server/chunks/9628.js +1 -1
  607. package/app/.next-cli-build/server/chunks/976.js +1 -1
  608. package/app/.next-cli-build/server/instrumentation.js.nft.json +1 -1
  609. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  610. package/app/.next-cli-build/server/middleware.js +5 -5
  611. package/app/.next-cli-build/server/middleware.js.nft.json +1 -1
  612. package/app/.next-cli-build/server/pages/404.html +2 -2
  613. package/app/.next-cli-build/server/pages/500.html +1 -1
  614. package/app/.next-cli-build/static/chunks/1243-72ef45af27dc7a4a.js +3 -0
  615. package/app/.next-cli-build/static/chunks/1321-77ba328dd4d69fdb.js +1 -0
  616. package/app/.next-cli-build/static/chunks/5497-ec8a6308121a2b70.js +7 -0
  617. package/app/.next-cli-build/static/chunks/{9749-80768075d38162d1.js → 9749-1f31c98804847f2a.js} +8 -8
  618. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-8f6aadfc8bf2eb7b.js +1 -0
  619. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/experimental/{page-7ee730e7a1ddb6e5.js → page-01bf0e3f4117f6c1.js} +1 -1
  620. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/media-providers/[kind]/[id]/{page-bce04d7851a6bf65.js → page-6db03f8140121a40.js} +10 -10
  621. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/profile/{page-7c9d46f8c09d480e.js → page-73d4979c8eec774c.js} +1 -1
  622. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-a6b07fa9d0712cee.js +14 -0
  623. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/{page-ceb259d31ded818a.js → page-1e4e3f6f20152da1.js} +1 -1
  624. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c77260f73f62aa0e.js +1 -0
  625. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-db46cbc3bf22d61a.js +1 -0
  626. package/app/.next-cli-build/static/chunks/app/landing/page-c6c3a32dd06bc907.js +1 -0
  627. package/app/.next-cli-build/static/css/17275fac82e1641e.css +1 -0
  628. package/app/package.json +71 -71
  629. package/app/public/donate/alipay.svg +1 -0
  630. package/app/public/donate/ifdian.svg +1 -0
  631. package/app/public/donate/wechat.svg +1 -0
  632. package/app/public/i18n/changelog/en.md +513 -477
  633. package/app/public/i18n/changelog/zh-CN.md +511 -475
  634. package/app/public/i18n/changelog/zh-TW.md +513 -477
  635. package/app/public/i18n/literals/zh-CN.json +2107 -2063
  636. package/app/public/i18n/literals/zh-TW.json +951 -907
  637. package/app/public/providers/alitp-intl.png +0 -0
  638. package/app/public/providers/alitp.png +0 -0
  639. package/app/public/providers/inception.png +0 -0
  640. package/app/src/mitm/server.js +12 -12
  641. package/app/src/shared/services/quotaAutoPing.js +345 -313
  642. package/app/src/sse/services/codebuddyCheckin.js +687 -890
  643. package/app/src/sse/services/minimaxCheckin.js +340 -0
  644. package/package.json +61 -61
  645. package/app/.next-cli-build/server/chunks/3599.js +0 -1
  646. package/app/.next-cli-build/server/chunks/6593.js +0 -1
  647. package/app/.next-cli-build/server/chunks/7070.js +0 -1
  648. package/app/.next-cli-build/server/chunks/7252.js +0 -1
  649. package/app/.next-cli-build/server/chunks/8672.js +0 -1
  650. package/app/.next-cli-build/server/chunks/8972.js +0 -1
  651. package/app/.next-cli-build/server/chunks/939.js +0 -1
  652. package/app/.next-cli-build/static/chunks/1243-acdc1dcbfcd9336d.js +0 -3
  653. package/app/.next-cli-build/static/chunks/1321-f4736e33b06bb9d6.js +0 -1
  654. package/app/.next-cli-build/static/chunks/5497-f54b1274c2141bf0.js +0 -7
  655. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/combos/page-14745e08d1edafb2.js +0 -1
  656. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/page-244e20b305c911c6.js +0 -14
  657. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/quota/page-c70550b49f94cbc4.js +0 -1
  658. package/app/.next-cli-build/static/chunks/app/(dashboard)/layout-cefb3cbfe469dd51.js +0 -1
  659. package/app/.next-cli-build/static/chunks/app/landing/page-38924391f8649361.js +0 -1
  660. package/app/.next-cli-build/static/css/cd8cdc4426ba0a3b.css +0 -1
  661. /package/app/.next-cli-build/static/{4BxfiRlz5UJXZcUl6uinS → 1q0xTGDYtD52dGw4uiY4-}/_buildManifest.js +0 -0
  662. /package/app/.next-cli-build/static/{4BxfiRlz5UJXZcUl6uinS → 1q0xTGDYtD52dGw4uiY4-}/_ssgManifest.js +0 -0
@@ -1,3 +1,3 @@
1
- exports.id=7322,exports.ids=[7322],exports.modules={3341:(a,b,c)=>{"use strict";c.d(b,{Y:()=>f,Z:()=>e});var d=c(67960);async function e(a){if(!a)return!1;try{return(await fetch(`${a}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(d.Iv)})).ok}catch{return!1}}async function f(...a){let b=a.filter(Boolean).map(e);return!!b.length&&new Promise(a=>{let c=b.length;b.forEach(b=>b.then(b=>{b?a(!0):0==--c&&a(!1)}))})}},3633:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}},8127:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}},43173:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{default:()=>u});var e=c(48249),f=c(67484),g=c(49885),h=c.n(g),i=c(94579),j=c(50377),k=c(67960);c(3341);var l=c(91937),m=c(80392),n=c(8127),o=c(78420),p=c(3633),q=c(99258),r=a([i,m]);function s(a){return a>=1e9?`${(a/1e9).toFixed(1)}B`:a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function t(a){if(!a||"string"!=typeof a)return a;let b=/^(.*?)((?:\s*\(rotated\))*)$/.exec(a),c=(0,q.Tl)(b[1]),d=(b[2].match(/\(rotated\)/g)||[]).length;return d?`${c} ${Array.from({length:d},()=>(0,q.Tl)("(rotated)")).join(" ")}`:c}function u({machineId:a}){let[b,c]=(0,f.useState)([]),[d,g]=(0,f.useState)(!0),[h,r]=(0,f.useState)(!1),[v,w]=(0,f.useState)(""),[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(null),[B,C]=(0,f.useState)(""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),[H,I]=(0,f.useState)(""),[J,K]=(0,f.useState)(""),[L,M]=(0,f.useState)(!1),[N,O]=(0,f.useState)(null),[P,Q]=(0,f.useState)(null),[R,S]=(0,f.useState)(!1),[T,U]=(0,f.useState)(!0),[V,W]=(0,f.useState)(!1),[X,Y]=(0,f.useState)(!1),Z=(0,f.useRef)(!1),[$,_]=(0,f.useState)(null),[aa,ab]=(0,f.useState)(!0),[ac,ad]=(0,f.useState)(!0),[ae,af]=(0,f.useState)(!1),[ag,ah]=(0,f.useState)(!0),[ai,aj]=(0,f.useState)(!1),[ak,al]=(0,f.useState)(!1),[am,an]=(0,f.useState)(""),[ao,ap]=(0,f.useState)(""),[aq,ar]=(0,f.useState)(!1),[as,at]=(0,f.useState)(""),[au,av]=(0,f.useState)(null),[aw,ax]=(0,f.useState)(!1),[ay,az]=(0,f.useState)(!1),[aA,aB]=(0,f.useState)(!1),[aC,aD]=(0,f.useState)(!1),[aE,aF]=(0,f.useState)(""),[aG,aH]=(0,f.useState)(!1),[aI,aJ]=(0,f.useState)(""),[aK,aL]=(0,f.useState)(null),[aM,aN]=(0,f.useState)(""),[aO,aP]=(0,f.useState)(""),[aQ,aR]=(0,f.useState)(null),[aS,aT]=(0,f.useState)(!1),[aU,aV]=(0,f.useState)([]),[aW,aX]=(0,f.useState)(""),[aY,aZ]=(0,f.useState)(!1),[a$,a_]=(0,f.useState)(!1),[a0,a1]=(0,f.useState)(!1),a2=(0,f.useRef)(null);(0,f.useRef)(0),(0,f.useRef)(0),(0,f.useRef)(!1),(0,f.useRef)(!1),(0,f.useRef)(!1),(0,f.useRef)(!1);let[a3,a4]=(0,f.useState)(!1),[a5,a6]=(0,f.useState)(!1),[a7,a8]=(0,f.useState)(new Set),[a9,ba]=(0,f.useState)(!1),{copied:bb,copy:bc}=(0,j.C)(),bd=!aa||!ac,be=aa?"Set a dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,f.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=k.t6&&d(!1))},[]);let bf=async a=>{try{await l.A.getState().patchSettings({tunnelDashboardAccess:a})&&af(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},bg=async a=>{try{await l.A.getState().patchSettings({requireApiKey:a})&&S(a)}catch(a){console.log("Error updating requireApiKey:",a)}},bh=async a=>{try{await l.A.getState().patchSettings({dailyTokenLimitEnabled:a})&&U(a)}catch(a){console.log("Error updating dailyTokenLimitEnabled:",a)}},bi=async a=>{try{let b=await l.A.getState().patchSettings({apiKeyRotation:a});return b&&W(a),!!b}catch(a){return console.log("Error updating apiKeyRotation:",a),!1}},bj=async()=>{if(!Z.current){Z.current=!0,Q(null),Y(!0);try{let a=await fetch("/api/keys/rotate",{method:"POST"});if(a.ok){let b=await a.json(),d=await fetch("/api/keys");if(d.ok){let a=await d.json();c(a.keys||[])}_(b)}}catch(a){console.log("Error rotating keys:",a)}finally{Y(!1),Z.current=!1}}},bk=async()=>{try{let a=async()=>{let a=await fetch("/api/keys");return a.ok&&(await a.json()).keys||[]},b=await a();if(0===b.length)try{(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok&&(b=await a())}catch{}c(b)}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},bl=async(...a)=>{ar(!0),at("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<k.Cp;){if(await new Promise(a=>setTimeout(a,k.Hx)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return aj(!0),ar(!1),at(""),!0;if((Date.now()-c)%1e4<k.Hx)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return av({type:"error",message:(0,q.Tl)("Tunnel process stopped unexpectedly.")}),ar(!1),at(""),!1}}catch{}}return av({type:"error",message:(0,q.Tl)("Tunnel created but not reachable. Please try again.")}),ar(!1),at(""),!1},bm=async()=>{ax(!1),ar(!0),av(null),at("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?at(`Downloading cloudflared... ${c.download.progress}%`):a&&at("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void av({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void av({type:"error",message:(0,q.Tl)("No tunnel URL returned")});an(d),ap(c.publicUrl||""),await bl(c.publicUrl,d)}catch(a){av({type:"error",message:a.message})}finally{a=!1,ar(!1),at("")}},bn=async()=>{ar(!0),av(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(aj(!1),an(""),az(!1),av({type:"success",message:(0,q.Tl)("Tunnel disabled")})):av({type:"error",message:b.error||(0,q.Tl)("Failed to disable tunnel")})}catch(a){av({type:"error",message:a.message})}finally{ar(!1)}},bo=async()=>{aR(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aR(b.installed),b}}catch{}return aR(!1),{installed:!1}},bp=async()=>{aT(!0),aL(null),aV([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:aW})});aX("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)aV(a=>[...a.slice(-50),d.message]);else if("done"===c){aR(!0),aT(!1),a_(!1),bt();return}else"error"===c&&aL({type:"error",message:d.error||(0,q.Tl)("Install failed")})}}}catch(a){aL({type:"error",message:a.message})}finally{aT(!1)}},bq=async a=>{aJ((0,q.Tl)("Waiting for Tailscale ready..."));let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<k.Cp;){await new Promise(a=>setTimeout(a,k.Hx));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},br=(a,b)=>{aN(a),aP(b)},bs=()=>{aN(""),aP("")},bt=async()=>{a_(!1),aZ(!0),aH(!0),aL(null),aJ("Connecting..."),bs();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aF(b.tunnelUrl||"");let a=await bq(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")});return}if(b.needsLogin&&b.authUrl){br(b.authUrl,(0,q.Tl)("Open Login Page")),aJ((0,q.Tl)('Login required — click "Open Login Page" to continue'));for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bs(),aJ((0,q.Tl)("Starting funnel..."));let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aF(b.tunnelUrl||"");let a=await bq(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")})}else b.funnelNotEnabled&&b.enableUrl?await bu(b.enableUrl):aL({type:"error",message:b.error||(0,q.Tl)("Failed to start funnel")});return}}catch{}}bs(),aL({type:"error",message:(0,q.Tl)("Login timed out. Please try again.")});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bu(b.enableUrl);aL({type:"error",message:b.error||(0,q.Tl)("Failed to connect")})}catch(a){aL({type:"error",message:a.message})}finally{aH(!1),aZ(!1),aJ(""),bs()}},bu=async a=>{br(a,(0,q.Tl)("Open Funnel Settings")),aJ((0,q.Tl)('Click "Open Funnel Settings" to enable Funnel...'));for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bs(),aF(b.tunnelUrl||"");let a=await bq(b.tunnelUrl);aB(!0),aL(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")});return}if(b.funnelNotEnabled)continue;if(b.error){bs(),aL({type:"error",message:b.error});return}}catch{}}bs(),aL({type:"error",message:(0,q.Tl)("Timed out waiting for Funnel to be enabled.")})},bv=async()=>{aH(!0),aL(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(aB(!1),aF(""),a1(!1),aL({type:"success",message:(0,q.Tl)("Tailscale disabled")})):aL({type:"error",message:b.error||(0,q.Tl)("Failed to disable Tailscale")})}catch(a){aL({type:"error",message:a.message})}finally{aH(!1)}},bw=async()=>{aL(null),aV([]);let a=await bo();a?.installed&&a?.hasCachedPassword?bt():a_(!0)},bx=async()=>{if(v.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.trim(),dailyTokenLimit:x.trim()?Number(x.trim()):void 0})}),b=await a.json();a.ok&&(O(b.key),await bk(),w(""),y(""),r(!1))}catch(a){console.log("Error creating key:",a)}},by=async()=>{if(z){E(!0);try{(await fetch(`/api/keys/${z.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dailyTokenLimit:B.trim()?Number(B.trim()):null})})).ok&&(A(null),await bk())}catch(a){console.log("Error saving daily limit:",a)}finally{E(!1)}}},bz=async()=>{if(F){M(!0);try{let a=H.split(/[\n,]/).map(a=>a.trim()).filter(Boolean),b=J.split(/[\n,]/).map(a=>a.trim()).filter(Boolean);(await fetch(`/api/keys/${F.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedModels:a.length>0?a:null,allowedCombos:b.length>0?b:null})})).ok&&(G(null),await bk())}catch(a){console.log("Error saving key access control:",a)}finally{M(!1)}}},bA=async a=>{Q({title:(0,q.Tl)("Delete API Key"),message:(0,q.Tl)("Delete this API key?"),onConfirm:async()=>{Q(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),a8(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bB=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[bC,bD]=(0,f.useState)("/v1");return d?(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsx)(i.Qv,{}),(0,e.jsx)(i.Qv,{})]}):(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsxs)(i.Zp,{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),(0,q.Tl)("API Endpoint")]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(m.A,{label:(0,q.Tl)("Local"),url:bC,copyId:"local_url",copied:bb,onCopy:bc}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${ai?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),ai&&!aq&&ak?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.pd,{value:`${ao||am}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>bc(`${ao||am}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===bb?"check":"content_copy"})}),(0,e.jsx)("button",{onClick:()=>az(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tunnel"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!ai||aq||ak?aq?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),as||(0,q.Tl)("Creating tunnel...")]}),(0,e.jsx)("button",{onClick:()=>{ar(!1),at("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):au?.type==="error"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),au.message]}),(0,e.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>ax(!0),children:(0,q.Tl)("Enable")})]}):ag?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,e.jsx)("button",{onClick:()=>ah(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,e.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{bd?av({type:"error",message:`${(0,q.Tl)("Security required")}: ${be}`}):R?ax(!0):av({type:"error",message:(0,q.Tl)('Security required: Enable "Require API key" before activating the tunnel.')})},children:(0,q.Tl)("Enable")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a3?(0,q.Tl)("Tunnel reconnecting..."):(0,q.Tl)("Tunnel checking...")]}),(0,e.jsx)("button",{onClick:()=>az(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tunnel"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${aA?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),aA&&!aG&&aC?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.pd,{value:`${aE}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>bc(`${aE}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===bb?"check":"content_copy"})}),(0,e.jsx)("button",{onClick:()=>a1(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tailscale"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!aA||aG||aC?aG||aY?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aI||(0,q.Tl)("Connecting...")]}),aM&&(0,e.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aM,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aO||(0,q.Tl)("Open")}),(0,e.jsx)("button",{onClick:()=>{aH(!1),aZ(!1),aJ(""),bs()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aK?.type==="error"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aK.message]}),(0,e.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:bw,children:(0,q.Tl)("Enable")})]}):(0,e.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{bd?aL({type:"error",message:`${(0,q.Tl)("Security required")}: ${be}`}):bw()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:(0,q.Tl)("Enable")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),a5?(0,q.Tl)("Tailscale reconnecting..."):(0,q.Tl)("Tailscale checking...")]}),(0,e.jsx)("button",{onClick:()=>a1(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tailscale"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),bd&&!ai&&!aA&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(p.A,{message:be,action:{label:(0,q.Tl)("Open settings"),href:"/dashboard/profile"}})}),(ai||aA)&&(0,e.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!R&&(0,e.jsx)(p.A,{message:(0,q.Tl)("Require API key is disabled — your endpoint is publicly accessible without authentication."),action:{label:(0,q.Tl)("Enable"),href:"#require-api-key"}}),(!aa||!ac)&&(0,e.jsx)(p.A,{message:aa?(0,q.Tl)("No dashboard password is set — set one on the Settings page."):(0,q.Tl)("Require login is disabled — anyone can access your dashboard via tunnel."),action:{label:aa?(0,q.Tl)("Change password"):(0,q.Tl)("Enable"),href:"/dashboard/profile"}})]}),(ai||aA)&&(0,e.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,e.jsx)(i.lM,{checked:ae,onChange:()=>bf(!ae)}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("p",{className:"font-medium text-sm",children:(0,q.Tl)("Allow dashboard access via tunnel")}),(0,e.jsx)(o.A,{text:(0,q.Tl)("When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked.")})]})]})]}),(0,e.jsxs)(i.Zp,{id:"require-api-key",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),(0,q.Tl)("API Keys")]}),(0,e.jsx)(i.$n,{icon:"add",onClick:()=>r(!0),children:(0,q.Tl)("Create Key")})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:(0,q.Tl)("Require API key")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Requests without a valid key will be rejected")})]}),(0,e.jsx)(i.lM,{checked:R,onChange:a=>{a?bg(!0):Q({title:(0,q.Tl)("Disable API key requirement?"),message:(0,q.Tl)("Requests without a valid key will be accepted while this is off. You can re-enable it at any time."),onConfirm:()=>bg(!1)})}})]}),a9&&!R&&(0,e.jsx)("div",{className:"mb-4 -mt-2",children:(0,e.jsx)(p.A,{message:(0,q.Tl)("Endpoint is exposed without an API key.")})}),(0,e.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:(0,q.Tl)("Daily token limits")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Master switch for the per-key daily token caps. Turning this off stops enforcement but keeps every key's configured limit.")})]}),(0,e.jsx)(i.lM,{checked:T,onChange:bh})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between py-4 mb-4 border-b border-border gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("p",{className:"font-medium flex items-center gap-2",children:[(0,q.Tl)("Key secret rotation"),(0,e.jsx)("span",{className:"text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,q.Tl)("Experimental")})]}),(0,e.jsx)("p",{className:"text-sm text-text-muted truncate",children:(0,q.Tl)("Sign new keys with an auto-generated secret instead of the built-in one")})]}),(0,e.jsx)(o.A,{text:(0,q.Tl)("When enabled, the HMAC secret used for API key CRC is auto-generated to the data directory (api-key-secret, mode 0600) — or set API_KEY_SECRET to pin your own (env always wins). Existing keys keep working only if they were issued under the same secret; enabling invalidates previously issued keys, and Re-issue all keys re-creates every stored key under the current secret so clients can be updated in one step.")})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[V&&(0,e.jsx)(i.$n,{size:"xs",onClick:()=>Q({title:(0,q.Tl)("Re-issue all API keys?"),message:(0,q.Tl)("Every existing key will be replaced with a new one signed under the current secret. All clients using old keys will stop working until updated. This cannot be undone."),onConfirm:bj}),disabled:X,children:X?(0,q.Tl)("Rotating…"):(0,q.Tl)("Rotate all")}),(0,e.jsx)(i.lM,{checked:V,onChange:a=>{a?Q({title:(0,q.Tl)("Enable key secret rotation?"),message:(0,q.Tl)("New keys will be signed with an auto-generated secret. Keys issued BEFORE enabling will stop validating and cannot be restored — re-create them and update every client. This cannot be undone silently."),onConfirm:()=>bi(!0)}):Q({title:(0,q.Tl)("Disable key secret rotation?"),message:(0,q.Tl)("New keys will be signed with the built-in secret again. Keys issued while rotation was enabled will stop validating — re-create them and update every client."),onConfirm:()=>bi(!1)})}})]})]}),0===b.length?(0,e.jsxs)("div",{className:"text-center py-12",children:[(0,e.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,e.jsx)("p",{className:"text-text-main font-medium mb-1",children:(0,q.Tl)("No API keys yet")}),(0,e.jsx)("p",{className:"text-sm text-text-muted mb-4",children:(0,q.Tl)("Create your first API key to get started")}),(0,e.jsx)(i.$n,{icon:"add",onClick:()=>r(!0),children:(0,q.Tl)("Create Key")})]}):(0,e.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,e.jsxs)("div",{className:`group flex flex-col sm:flex-row sm:items-center justify-between py-3 gap-2 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:t(a.name)}),(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,e.jsx)("code",{className:"text-xs text-text-muted font-mono",children:a7.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,e.jsx)("button",{onClick:()=>{var b;return b=a.id,void a8(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:a7.has(a.id)?(0,q.Tl)("Hide key"):(0,q.Tl)("Show key"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:a7.has(a.id)?"visibility_off":"visibility"})}),(0,e.jsx)("button",{onClick:()=>bc(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:bb===a.id?"check":"content_copy"})})]}),(0,e.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[(0,q.Tl)("Created")," ",new Date(a.createdAt).toLocaleDateString()]}),a.dailyTokenLimit?(0,e.jsxs)("p",{className:`text-xs mt-1 ${(a.todayTokens||0)>=a.dailyTokenLimit?"text-red-500":"text-text-muted"}`,children:[(0,q.Tl)("Today"),": ",s(a.todayTokens||0)," / ",s(a.dailyTokenLimit)," ",(0,q.Tl)("tokens"),(a.todayTokens||0)>=a.dailyTokenLimit?` — ${(0,q.Tl)("Limit reached")}`:""]}):null,a.allowedModels?.length||a.allowedCombos?.length?(0,e.jsxs)("p",{className:"text-xs text-primary mt-1 flex items-center gap-1",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"tune"}),(0,q.Tl)("Allowed"),": ",[a.allowedModels?.length?`${a.allowedModels.length} ${(0,q.Tl)("models")}`:null,a.allowedCombos?.length?`${a.allowedCombos.length} ${(0,q.Tl)("combos")}`:null].filter(Boolean).join(" \xb7 ")]}):null,!1===a.isActive&&(0,e.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:(0,q.Tl)("Paused")})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 self-end sm:self-auto shrink-0",children:[(0,e.jsx)("button",{onClick:()=>{G(a),I(a.allowedModels?.join("\n")||""),K(a.allowedCombos?.join("\n")||"")},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:(0,q.Tl)("Allowed Models & Combos"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,e.jsx)("button",{onClick:()=>{A(a),C(a.dailyTokenLimit?String(a.dailyTokenLimit):"")},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:(0,q.Tl)("Edit Daily Token Limit"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a.dailyTokenLimit?"edit_calendar":"calendar_month"})}),(0,e.jsx)(i.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?Q({title:(0,q.Tl)("Pause API Key"),message:`${(0,q.Tl)("Pause API key")} "${a.name}"?
1
+ exports.id=7322,exports.ids=[7322],exports.modules={3341:(a,b,c)=>{"use strict";c.d(b,{Y:()=>f,Z:()=>e});var d=c(67960);async function e(a){if(!a)return!1;try{return(await fetch(`${a}/api/health`,{mode:"cors",cache:"no-store",signal:AbortSignal.timeout(d.Iv)})).ok}catch{return!1}}async function f(...a){let b=a.filter(Boolean).map(e);return!!b.length&&new Promise(a=>{let c=b.length;b.forEach(b=>b.then(b=>{b?a(!0):0==--c&&a(!1)}))})}},3633:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({message:a,action:b}){return(0,d.jsxs)("div",{className:"flex items-center gap-2 px-3 py-2 rounded-lg bg-amber-500/10 border border-amber-500/20 text-amber-700 dark:text-amber-400",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[16px] shrink-0 mt-0.5",children:"warning"}),(0,d.jsx)("p",{className:"text-xs flex-1",children:a}),b&&(0,d.jsx)("a",{href:b.href,className:"text-xs font-medium underline shrink-0 hover:opacity-80",onClick:b.href.startsWith("#")?a=>{a.preventDefault(),document.getElementById(b.href.slice(1))?.scrollIntoView({behavior:"smooth"})}:void 0,children:b.label})]})}},8127:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({status:a,className:b=""}){return(0,d.jsx)("div",{className:`p-2 rounded text-sm ${b} ${"success"===a.type?"bg-green-500/10 text-green-600 dark:text-green-400":"warning"===a.type?"bg-yellow-500/10 text-yellow-600 dark:text-yellow-400":"info"===a.type?"bg-blue-500/10 text-blue-600 dark:text-blue-400":"bg-red-500/10 text-red-600 dark:text-red-400"}`,children:a.message.split(/(https?:\/\/[^\s]+)/g).map((a,b)=>/^https?:\/\//.test(a)?(0,d.jsx)("a",{href:a,target:"_blank",rel:"noreferrer",className:"underline font-medium",children:a},b):a)})}},43173:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{default:()=>u});var e=c(48249),f=c(67484),g=c(49885),h=c.n(g),i=c(94579),j=c(50377),k=c(67960);c(3341);var l=c(91937),m=c(80392),n=c(8127),o=c(78420),p=c(3633),q=c(99258),r=a([i,m]);function s(a){return a>=1e9?`${(a/1e9).toFixed(1)}B`:a>=1e6?`${(a/1e6).toFixed(1)}M`:a>=1e3?`${(a/1e3).toFixed(1)}K`:String(a)}function t(a){if(!a||"string"!=typeof a)return a;let b=/^(.*?)((?:\s*\(rotated\))*)$/.exec(a),c=(0,q.Tl)(b[1]),d=(b[2].match(/\(rotated\)/g)||[]).length;return d?`${c} ${Array.from({length:d},()=>(0,q.Tl)("(rotated)")).join(" ")}`:c}function u({machineId:a}){let[b,c]=(0,f.useState)([]),[d,g]=(0,f.useState)(!0),[h,r]=(0,f.useState)(!1),[v,w]=(0,f.useState)(""),[x,y]=(0,f.useState)(""),[z,A]=(0,f.useState)(null),[B,C]=(0,f.useState)(""),[D,E]=(0,f.useState)(!1),[F,G]=(0,f.useState)(null),[H,I]=(0,f.useState)([]),[J,K]=(0,f.useState)([]),[L,M]=(0,f.useState)(""),[N,O]=(0,f.useState)(!1),[P,Q]=(0,f.useState)(!1),[R,S]=(0,f.useState)([]),[T,U]=(0,f.useState)([]),[V,W]=(0,f.useState)(null),[X,Y]=(0,f.useState)(null),[Z,$]=(0,f.useState)(!1),[_,aa]=(0,f.useState)(!0),[ab,ac]=(0,f.useState)(!1),[ad,ae]=(0,f.useState)(!1),af=(0,f.useRef)(!1),[ag,ah]=(0,f.useState)(null),[ai,aj]=(0,f.useState)(!0),[ak,al]=(0,f.useState)(!0),[am,an]=(0,f.useState)(!1),[ao,ap]=(0,f.useState)(!0),[aq,ar]=(0,f.useState)(!1),[as,at]=(0,f.useState)(!1),[au,av]=(0,f.useState)(""),[aw,ax]=(0,f.useState)(""),[ay,az]=(0,f.useState)(!1),[aA,aB]=(0,f.useState)(""),[aC,aD]=(0,f.useState)(null),[aE,aF]=(0,f.useState)(!1),[aG,aH]=(0,f.useState)(!1),[aI,aJ]=(0,f.useState)(!1),[aK,aL]=(0,f.useState)(!1),[aM,aN]=(0,f.useState)(""),[aO,aP]=(0,f.useState)(!1),[aQ,aR]=(0,f.useState)(""),[aS,aT]=(0,f.useState)(null),[aU,aV]=(0,f.useState)(""),[aW,aX]=(0,f.useState)(""),[aY,aZ]=(0,f.useState)(null),[a$,a_]=(0,f.useState)(!1),[a0,a1]=(0,f.useState)([]),[a2,a3]=(0,f.useState)(""),[a4,a5]=(0,f.useState)(!1),[a6,a7]=(0,f.useState)(!1),[a8,a9]=(0,f.useState)(!1),ba=(0,f.useRef)(null);(0,f.useRef)(0),(0,f.useRef)(0),(0,f.useRef)(!1),(0,f.useRef)(!1),(0,f.useRef)(!1),(0,f.useRef)(!1);let[bb,bc]=(0,f.useState)(!1),[bd,be]=(0,f.useState)(!1),[bf,bg]=(0,f.useState)(new Set),[bh,bi]=(0,f.useState)(!1),{copied:bj,copy:bk}=(0,j.C)(),bl=!ai||!ak,bm=ai?"Set a dashboard password before activating the tunnel.":'Enable "Require login" and set a custom password before activating the tunnel.';(0,f.useCallback)((a,b,c,d,e,f)=>{b.current?(c.current=0,d(!0),e.current||(e.current=!0,f(!0))):(c.current+=1,c.current>=k.t6&&d(!1))},[]);let bn=async a=>{try{await l.A.getState().patchSettings({tunnelDashboardAccess:a})&&an(a)}catch(a){console.log("Error updating tunnelDashboardAccess:",a)}},bo=async a=>{try{await l.A.getState().patchSettings({requireApiKey:a})&&$(a)}catch(a){console.log("Error updating requireApiKey:",a)}},bp=async a=>{try{await l.A.getState().patchSettings({dailyTokenLimitEnabled:a})&&aa(a)}catch(a){console.log("Error updating dailyTokenLimitEnabled:",a)}},bq=async a=>{try{let b=await l.A.getState().patchSettings({apiKeyRotation:a});return b&&ac(a),!!b}catch(a){return console.log("Error updating apiKeyRotation:",a),!1}},br=async()=>{if(!af.current){af.current=!0,Y(null),ae(!0);try{let a=await fetch("/api/keys/rotate",{method:"POST"});if(a.ok){let b=await a.json(),d=await fetch("/api/keys");if(d.ok){let a=await d.json();c(a.keys||[])}ah(b)}}catch(a){console.log("Error rotating keys:",a)}finally{ae(!1),af.current=!1}}},bs=async()=>{try{let a=async()=>{let a=await fetch("/api/keys");return a.ok&&(await a.json()).keys||[]},b=await a();if(0===b.length)try{(await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:"Default Key"})})).ok&&(b=await a())}catch{}c(b)}catch(a){console.log("Error fetching data:",a)}finally{g(!1)}},bt=async(...a)=>{az(!0),aB("Waiting for tunnel ready...");let b=a.filter(Boolean).map(a=>`${a}/api/health`),c=Date.now();for(;Date.now()-c<k.Cp;){if(await new Promise(a=>setTimeout(a,k.Hx)),await Promise.any(b.map(async a=>{if((await fetch(a,{mode:"cors",cache:"no-store"})).ok)return!0;throw Error("not ready")})).catch(()=>!1))return ar(!0),az(!1),aB(""),!0;if((Date.now()-c)%1e4<k.Hx)try{let a=await fetch("/api/tunnel/status");if(a.ok){let b=await a.json();if(!b.tunnel?.enabled)return aD({type:"error",message:(0,q.Tl)("Tunnel process stopped unexpectedly.")}),az(!1),aB(""),!1}}catch{}}return aD({type:"error",message:(0,q.Tl)("Tunnel created but not reachable. Please try again.")}),az(!1),aB(""),!1},bu=async()=>{aF(!1),az(!0),aD(null),aB("Creating tunnel...");let a=!0;(async()=>{for(;a;){try{let b=await fetch("/api/tunnel/status");if(b.ok){let c=await b.json();c.download?.downloading?aB(`Downloading cloudflared... ${c.download.progress}%`):a&&aB("Creating tunnel...")}}catch{}await new Promise(a=>setTimeout(a,1e3))}})();try{let b=await fetch("/api/tunnel/enable",{method:"POST"});a=!1;let c=await b.json();if(!b.ok)return void aD({type:"error",message:c.error||"Failed to enable tunnel"});let d=c.tunnelUrl;if(!d)return void aD({type:"error",message:(0,q.Tl)("No tunnel URL returned")});av(d),ax(c.publicUrl||""),await bt(c.publicUrl,d)}catch(a){aD({type:"error",message:a.message})}finally{a=!1,az(!1),aB("")}},bv=async()=>{az(!0),aD(null);try{let a=await fetch("/api/tunnel/disable",{method:"POST"}),b=await a.json();a.ok?(ar(!1),av(""),aH(!1),aD({type:"success",message:(0,q.Tl)("Tunnel disabled")})):aD({type:"error",message:b.error||(0,q.Tl)("Failed to disable tunnel")})}catch(a){aD({type:"error",message:a.message})}finally{az(!1)}},bw=async()=>{aZ(null);try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok){let b=await a.json();return aZ(b.installed),b}}catch{}return aZ(!1),{installed:!1}},bx=async()=>{a_(!0),aT(null),a1([]);try{let a=await fetch("/api/tunnel/tailscale-install",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({sudoPassword:a2})});a3("");let b=a.body.getReader(),c=new TextDecoder,d="";for(;;){let{done:a,value:e}=await b.read();if(a)break;let f=(d+=c.decode(e,{stream:!0})).split("\n\n");for(let a of(d=f.pop()||"",f)){let b=a.split("\n"),c="progress",d=null;for(let a of b)if(a.startsWith("event: ")&&(c=a.slice(7).trim()),a.startsWith("data: "))try{d=JSON.parse(a.slice(6))}catch{}if(d)if("progress"===c)a1(a=>[...a.slice(-50),d.message]);else if("done"===c){aZ(!0),a_(!1),a7(!1),bB();return}else"error"===c&&aT({type:"error",message:d.error||(0,q.Tl)("Install failed")})}}}catch(a){aT({type:"error",message:a.message})}finally{a_(!1)}},by=async a=>{aR((0,q.Tl)("Waiting for Tailscale ready..."));let b=`${a}/api/health`,c=Date.now();for(;Date.now()-c<k.Cp;){await new Promise(a=>setTimeout(a,k.Hx));try{let a=await fetch(b,{mode:"no-cors",cache:"no-store"});if(a.ok||"opaque"===a.type)return!0}catch{}}return!1},bz=(a,b)=>{aV(a),aX(b)},bA=()=>{aV(""),aX("")},bB=async()=>{a7(!1),a5(!0),aP(!0),aT(null),aR("Connecting..."),bA();try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aN(b.tunnelUrl||"");let a=await by(b.tunnelUrl);aJ(!0),aT(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")});return}if(b.needsLogin&&b.authUrl){bz(b.authUrl,(0,q.Tl)("Open Login Page")),aR((0,q.Tl)('Login required — click "Open Login Page" to continue'));for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-check");if(a.ok&&(await a.json()).loggedIn){bA(),aR((0,q.Tl)("Starting funnel..."));let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){aN(b.tunnelUrl||"");let a=await by(b.tunnelUrl);aJ(!0),aT(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")})}else b.funnelNotEnabled&&b.enableUrl?await bC(b.enableUrl):aT({type:"error",message:b.error||(0,q.Tl)("Failed to start funnel")});return}}catch{}}bA(),aT({type:"error",message:(0,q.Tl)("Login timed out. Please try again.")});return}if(b.funnelNotEnabled&&b.enableUrl)return void await bC(b.enableUrl);aT({type:"error",message:b.error||(0,q.Tl)("Failed to connect")})}catch(a){aT({type:"error",message:a.message})}finally{aP(!1),a5(!1),aR(""),bA()}},bC=async a=>{bz(a,(0,q.Tl)("Open Funnel Settings")),aR((0,q.Tl)('Click "Open Funnel Settings" to enable Funnel...'));for(let a=0;a<40;a++){await new Promise(a=>setTimeout(a,3e3));try{let a=await fetch("/api/tunnel/tailscale-enable",{method:"POST"}),b=await a.json();if(a.ok&&b.success){bA(),aN(b.tunnelUrl||"");let a=await by(b.tunnelUrl);aJ(!0),aT(a?null:{type:"warning",message:(0,q.Tl)("Connected but not reachable yet.")});return}if(b.funnelNotEnabled)continue;if(b.error){bA(),aT({type:"error",message:b.error});return}}catch{}}bA(),aT({type:"error",message:(0,q.Tl)("Timed out waiting for Funnel to be enabled.")})},bD=async()=>{aP(!0),aT(null);try{let a=await fetch("/api/tunnel/tailscale-disable",{method:"POST"}),b=await a.json();a.ok?(aJ(!1),aN(""),a9(!1),aT({type:"success",message:(0,q.Tl)("Tailscale disabled")})):aT({type:"error",message:b.error||(0,q.Tl)("Failed to disable Tailscale")})}catch(a){aT({type:"error",message:a.message})}finally{aP(!1)}},bE=async()=>{aT(null),a1([]);let a=await bw();a?.installed&&a?.hasCachedPassword?bB():a7(!0)},bF=async()=>{if(v.trim())try{let a=await fetch("/api/keys",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:v.trim(),dailyTokenLimit:x.trim()?Number(x.trim()):void 0})}),b=await a.json();a.ok&&(W(b.key),await bs(),w(""),y(""),r(!1))}catch(a){console.log("Error creating key:",a)}},bG=async()=>{if(z){E(!0);try{(await fetch(`/api/keys/${z.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({dailyTokenLimit:B.trim()?Number(B.trim()):null})})).ok&&(A(null),await bs())}catch(a){console.log("Error saving daily limit:",a)}finally{E(!1)}}},bH=async a=>{G(a);let b=a.allowedModels||[];if(I(b.filter(a=>!a.includes("*"))),M(b.filter(a=>a.includes("*")).join(", ")),K(a.allowedCombos||[]),0===R.length||0===T.length)try{let[a,b]=await Promise.all([fetch("/api/providers",{cache:"no-store"}),fetch("/api/combos",{cache:"no-store"})]);if(a.ok){let b=await a.json();S(b.connections||[])}if(b.ok){let a=await b.json();U((a.combos||[]).map(a=>a.name))}}catch{}},bI=async()=>{if(F){O(!0);try{let a=L.split(/[\n,]/).map(a=>a.trim()).filter(Boolean),b=[...H,...a];(await fetch(`/api/keys/${F.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({allowedModels:b.length>0?b:null,allowedCombos:J.length>0?J:null})})).ok&&(G(null),await bs())}catch(a){console.log("Error saving key access control:",a)}finally{O(!1)}}},bJ=async a=>{Y({title:(0,q.Tl)("Delete API Key"),message:(0,q.Tl)("Delete this API key?"),onConfirm:async()=>{Y(null);try{(await fetch(`/api/keys/${a}`,{method:"DELETE"})).ok&&(c(b.filter(b=>b.id!==a)),bg(b=>{let c=new Set(b);return c.delete(a),c}))}catch(a){console.log("Error deleting key:",a)}}})},bK=async(a,b)=>{try{(await fetch(`/api/keys/${a}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:b})})).ok&&c(c=>c.map(c=>c.id===a?{...c,isActive:b}:c))}catch(a){console.log("Error toggling key:",a)}},[bL,bM]=(0,f.useState)("/v1");return d?(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsx)(i.Qv,{}),(0,e.jsx)(i.Qv,{})]}):(0,e.jsxs)("div",{className:"flex flex-col gap-8",children:[(0,e.jsxs)(i.Zp,{children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold mb-4 flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"api"}),(0,q.Tl)("API Endpoint")]}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)(m.A,{label:(0,q.Tl)("Local"),url:bL,copyId:"local_url",copied:bj,onCopy:bk}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${aq?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tunnel"}),aq&&!ay&&as?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.pd,{value:`${aw||au}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>bk(`${aw||au}/v1`,"tunnel_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tunnel_url"===bj?"check":"content_copy"})}),(0,e.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tunnel"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!aq||ay||as?ay?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aA||(0,q.Tl)("Creating tunnel...")]}),(0,e.jsx)("button",{onClick:()=>{az(!1),aB("")},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aC?.type==="error"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aC.message]}),(0,e.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>aF(!0),children:(0,q.Tl)("Enable")})]}):ao?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Checking..."]}),(0,e.jsx)("button",{onClick:()=>ap(!1),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):(0,e.jsx)(i.$n,{size:"sm",icon:"cloud_upload",onClick:()=>{bl?aD({type:"error",message:`${(0,q.Tl)("Security required")}: ${bm}`}):Z?aF(!0):aD({type:"error",message:(0,q.Tl)('Security required: Enable "Require API key" before activating the tunnel.')})},children:(0,q.Tl)("Enable")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),bb?(0,q.Tl)("Tunnel reconnecting..."):(0,q.Tl)("Tunnel checking...")]}),(0,e.jsx)("button",{onClick:()=>aH(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tunnel"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${aI?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:"Tailscale"}),aI&&!aO&&aK?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(i.pd,{value:`${aM}/v1`,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>bk(`${aM}/v1`,"ts_url"),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"ts_url"===bj?"check":"content_copy"})}),(0,e.jsx)("button",{onClick:()=>a9(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tailscale"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):!aI||aO||aK?aO||a4?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-border bg-surface text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),aQ||(0,q.Tl)("Connecting...")]}),aU&&(0,e.jsx)(i.$n,{size:"sm",icon:"open_in_new",onClick:()=>window.open(aU,"tailscale_auth","width=600,height=700,noopener,noreferrer"),children:aW||(0,q.Tl)("Open")}),(0,e.jsx)("button",{onClick:()=>{aP(!1),a5(!1),aR(""),bA()},className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Stop"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]}):aS?.type==="error"?(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-red-300 dark:border-red-800 bg-red-500/5 text-sm text-red-600 dark:text-red-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-sm",children:"error"}),aS.message]}),(0,e.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:bE,children:(0,q.Tl)("Enable")})]}):(0,e.jsx)(i.$n,{size:"sm",icon:"vpn_lock",onClick:()=>{bl?aT({type:"error",message:`${(0,q.Tl)("Security required")}: ${bm}`}):bE()},className:"bg-linear-to-r from-indigo-500 to-purple-500 hover:from-indigo-600 hover:to-purple-600 text-white!",children:(0,q.Tl)("Enable")}):(0,e.jsxs)(e.Fragment,{children:[(0,e.jsxs)("div",{className:"flex-1 flex items-center gap-2 px-3 py-1.5 rounded border border-amber-300 dark:border-amber-800 bg-amber-500/5 text-sm text-amber-600 dark:text-amber-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),bd?(0,q.Tl)("Tailscale reconnecting..."):(0,q.Tl)("Tailscale checking...")]}),(0,e.jsx)("button",{onClick:()=>a9(!0),className:"p-2 hover:bg-red-500/10 rounded text-red-500 transition-colors shrink-0",title:(0,q.Tl)("Disable Tailscale"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"power_settings_new"})})]})]})]}),bl&&!aq&&!aI&&(0,e.jsx)("div",{className:"mt-4",children:(0,e.jsx)(p.A,{message:bm,action:{label:(0,q.Tl)("Open settings"),href:"/dashboard/profile"}})}),(aq||aI)&&(0,e.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[!Z&&(0,e.jsx)(p.A,{message:(0,q.Tl)("Require API key is disabled — your endpoint is publicly accessible without authentication."),action:{label:(0,q.Tl)("Enable"),href:"#require-api-key"}}),(!ai||!ak)&&(0,e.jsx)(p.A,{message:ai?(0,q.Tl)("No dashboard password is set — set one on the Settings page."):(0,q.Tl)("Require login is disabled — anyone can access your dashboard via tunnel."),action:{label:ai?(0,q.Tl)("Change password"):(0,q.Tl)("Enable"),href:"/dashboard/profile"}})]}),(aq||aI)&&(0,e.jsxs)("div",{className:"mt-4 pt-4 border-t border-border flex items-center gap-3",children:[(0,e.jsx)(i.lM,{checked:am,onChange:()=>bn(!am)}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("p",{className:"font-medium text-sm",children:(0,q.Tl)("Allow dashboard access via tunnel")}),(0,e.jsx)(o.A,{text:(0,q.Tl)("When enabled, the dashboard can be accessed through your tunnel or Tailscale URL (login still required). When disabled, dashboard access via tunnel/Tailscale is completely blocked.")})]})]})]}),(0,e.jsxs)(i.Zp,{id:"require-api-key",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between mb-4",children:[(0,e.jsxs)("h2",{className:"text-lg font-semibold flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"vpn_key"}),(0,q.Tl)("API Keys")]}),(0,e.jsx)(i.$n,{icon:"add",onClick:()=>r(!0),children:(0,q.Tl)("Create Key")})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:(0,q.Tl)("Require API key")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Requests without a valid key will be rejected")})]}),(0,e.jsx)(i.lM,{checked:Z,onChange:a=>{a?bo(!0):Y({title:(0,q.Tl)("Disable API key requirement?"),message:(0,q.Tl)("Requests without a valid key will be accepted while this is off. You can re-enable it at any time."),onConfirm:()=>bo(!1)})}})]}),bh&&!Z&&(0,e.jsx)("div",{className:"mb-4 -mt-2",children:(0,e.jsx)(p.A,{message:(0,q.Tl)("Endpoint is exposed without an API key.")})}),(0,e.jsxs)("div",{className:"flex items-center justify-between pb-4 mb-4 border-b border-border",children:[(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"font-medium",children:(0,q.Tl)("Daily token limits")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Master switch for the per-key daily token caps. Turning this off stops enforcement but keeps every key's configured limit.")})]}),(0,e.jsx)(i.lM,{checked:_,onChange:bp})]}),(0,e.jsxs)("div",{className:"flex items-center justify-between py-4 mb-4 border-b border-border gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 min-w-0",children:[(0,e.jsxs)("div",{className:"min-w-0",children:[(0,e.jsxs)("p",{className:"font-medium flex items-center gap-2",children:[(0,q.Tl)("Key secret rotation"),(0,e.jsx)("span",{className:"text-[10px] uppercase tracking-wide px-1.5 py-0.5 rounded bg-amber-500/10 text-amber-600 dark:text-amber-400",children:(0,q.Tl)("Experimental")})]}),(0,e.jsx)("p",{className:"text-sm text-text-muted truncate",children:(0,q.Tl)("Sign new keys with an auto-generated secret instead of the built-in one")})]}),(0,e.jsx)(o.A,{text:(0,q.Tl)("When enabled, the HMAC secret used for API key CRC is auto-generated to the data directory (api-key-secret, mode 0600) — or set API_KEY_SECRET to pin your own (env always wins). Existing keys keep working only if they were issued under the same secret; enabling invalidates previously issued keys, and Re-issue all keys re-creates every stored key under the current secret so clients can be updated in one step.")})]}),(0,e.jsxs)("div",{className:"flex shrink-0 items-center gap-2",children:[ab&&(0,e.jsx)(i.$n,{size:"xs",onClick:()=>Y({title:(0,q.Tl)("Re-issue all API keys?"),message:(0,q.Tl)("Every existing key will be replaced with a new one signed under the current secret. All clients using old keys will stop working until updated. This cannot be undone."),onConfirm:br}),disabled:ad,children:ad?(0,q.Tl)("Rotating…"):(0,q.Tl)("Rotate all")}),(0,e.jsx)(i.lM,{checked:ab,onChange:a=>{a?Y({title:(0,q.Tl)("Enable key secret rotation?"),message:(0,q.Tl)("New keys will be signed with an auto-generated secret. Keys issued BEFORE enabling will stop validating and cannot be restored — re-create them and update every client. This cannot be undone silently."),onConfirm:()=>bq(!0)}):Y({title:(0,q.Tl)("Disable key secret rotation?"),message:(0,q.Tl)("New keys will be signed with the built-in secret again. Keys issued while rotation was enabled will stop validating — re-create them and update every client."),onConfirm:()=>bq(!1)})}})]})]}),0===b.length?(0,e.jsxs)("div",{className:"text-center py-12",children:[(0,e.jsx)("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"vpn_key"})}),(0,e.jsx)("p",{className:"text-text-main font-medium mb-1",children:(0,q.Tl)("No API keys yet")}),(0,e.jsx)("p",{className:"text-sm text-text-muted mb-4",children:(0,q.Tl)("Create your first API key to get started")}),(0,e.jsx)(i.$n,{icon:"add",onClick:()=>r(!0),children:(0,q.Tl)("Create Key")})]}):(0,e.jsx)("div",{className:"flex flex-col",children:b.map(a=>{var b;return(0,e.jsxs)("div",{className:`group flex flex-col sm:flex-row sm:items-center justify-between py-3 gap-2 border-b border-black/[0.03] dark:border-white/[0.03] last:border-b-0 ${!1===a.isActive?"opacity-60":""}`,children:[(0,e.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,e.jsx)("p",{className:"text-sm font-medium",children:t(a.name)}),(0,e.jsxs)("div",{className:"flex items-center gap-2 mt-1",children:[(0,e.jsx)("code",{className:"text-xs text-text-muted font-mono",children:bf.has(a.id)?a.key:(b=a.key)&&!(b.length<=10)?b.slice(0,6)+"•".repeat(b.length-10)+b.slice(-4):b||""}),(0,e.jsx)("button",{onClick:()=>{var b;return b=a.id,void bg(a=>{let c=new Set(a);return c.has(b)?c.delete(b):c.add(b),c})},className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:bf.has(a.id)?(0,q.Tl)("Hide key"):(0,q.Tl)("Show key"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:bf.has(a.id)?"visibility_off":"visibility"})}),(0,e.jsx)("button",{onClick:()=>bk(a.key,a.id),className:"p-1 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:bj===a.id?"check":"content_copy"})})]}),(0,e.jsxs)("p",{className:"text-xs text-text-muted mt-1",children:[(0,q.Tl)("Created")," ",new Date(a.createdAt).toLocaleDateString()]}),a.dailyTokenLimit?(0,e.jsxs)("p",{className:`text-xs mt-1 ${(a.todayTokens||0)>=a.dailyTokenLimit?"text-red-500":"text-text-muted"}`,children:[(0,q.Tl)("Today"),": ",s(a.todayTokens||0)," / ",s(a.dailyTokenLimit)," ",(0,q.Tl)("tokens"),(a.todayTokens||0)>=a.dailyTokenLimit?` — ${(0,q.Tl)("Limit reached")}`:""]}):null,a.allowedModels?.length||a.allowedCombos?.length?(0,e.jsxs)("p",{className:"text-xs text-primary mt-1 flex items-center gap-1",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-[13px]",children:"tune"}),(0,q.Tl)("Allowed"),": ",[a.allowedModels?.length?`${a.allowedModels.length} ${(0,q.Tl)("models")}`:null,a.allowedCombos?.length?`${a.allowedCombos.length} ${(0,q.Tl)("combos")}`:null].filter(Boolean).join(" \xb7 ")]}):null,!1===a.isActive&&(0,e.jsx)("p",{className:"text-xs text-orange-500 mt-1",children:(0,q.Tl)("Paused")})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1.5 self-end sm:self-auto shrink-0",children:[(0,e.jsx)("button",{onClick:()=>bH(a),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:(0,q.Tl)("Allowed Models & Combos"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"tune"})}),(0,e.jsx)("button",{onClick:()=>{A(a),C(a.dailyTokenLimit?String(a.dailyTokenLimit):"")},className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-all",title:(0,q.Tl)("Edit Daily Token Limit"),children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:a.dailyTokenLimit?"edit_calendar":"calendar_month"})}),(0,e.jsx)(i.lM,{size:"sm",checked:a.isActive??!0,onChange:b=>{a.isActive&&!b?Y({title:(0,q.Tl)("Pause API Key"),message:`${(0,q.Tl)("Pause API key")} "${a.name}"?
2
2
 
3
- ${(0,q.Tl)("This key will stop working immediately but can be resumed later.")}`,onConfirm:async()=>{Q(null),bB(a.id,b)}}):bB(a.id,b)},title:a.isActive?(0,q.Tl)("Pause key"):(0,q.Tl)("Resume key")}),(0,e.jsx)("button",{onClick:()=>bA(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,e.jsx)(i.aF,{isOpen:h,title:(0,q.Tl)("Create API Key"),onClose:()=>{r(!1),w(""),y("")},children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)(i.pd,{label:(0,q.Tl)("Key Name"),value:v,onChange:a=>w(a.target.value),placeholder:(0,q.Tl)("Production Key")}),(0,e.jsx)(i.pd,{label:(0,q.Tl)("Daily Token Limit"),type:"number",min:"0",value:x,onChange:a=>y(a.target.value),placeholder:(0,q.Tl)("e.g. 100000000 — empty means unlimited")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bx,fullWidth:!0,disabled:!v.trim(),children:(0,q.Tl)("Create")}),(0,e.jsx)(i.$n,{onClick:()=>{r(!1),w(""),y("")},variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:!!z,title:`${(0,q.Tl)("Edit Daily Token Limit")}${z?` — ${t(z.name)}`:""}`,onClose:()=>A(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)(i.pd,{label:(0,q.Tl)("Daily Token Limit"),type:"number",min:"0",value:B,onChange:a=>C(a.target.value),placeholder:(0,q.Tl)("e.g. 100000000 — empty means unlimited"),hint:(0,q.Tl)("Leave empty to remove the limit.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:by,fullWidth:!0,disabled:D,children:(0,q.Tl)("Save")}),(0,e.jsx)(i.$n,{onClick:()=>A(null),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:!!F,title:`${(0,q.Tl)("Allowed Models & Combos")}${F?` — ${t(F.name)}`:""}`,onClose:()=>G(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-xs text-text-muted",children:(0,q.Tl)("Restrict this key to specific models or combos. Leave empty for unrestricted access.")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-text-muted",children:(0,q.Tl)("Allowed Models (one per line or comma-separated)")}),(0,e.jsx)("textarea",{rows:4,value:H,onChange:a=>I(a.target.value),placeholder:"claude-3-5-sonnet, gpt-4o, anthropic/*",className:"w-full text-xs font-mono p-2.5 rounded-lg border border-border bg-surface-2 focus:outline-none focus:border-primary resize-y"})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-text-muted",children:(0,q.Tl)("Allowed Combos (one per line or comma-separated)")}),(0,e.jsx)("textarea",{rows:3,value:J,onChange:a=>K(a.target.value),placeholder:"smart-coding, fallback-claude",className:"w-full text-xs font-mono p-2.5 rounded-lg border border-border bg-surface-2 focus:outline-none focus:border-primary resize-y"})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bz,fullWidth:!0,disabled:L,children:(0,q.Tl)("Save")}),(0,e.jsx)(i.$n,{onClick:()=>G(null),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:!!$,title:(0,q.Tl)("Keys Re-issued"),onClose:()=>_(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,e.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:(0,q.Tl)("Save these keys now — shown only once")}),(0,e.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:(0,q.Tl)("Old keys no longer work. Update every client with the new values below.")})]}),(0,e.jsx)("div",{className:"flex flex-col gap-2 max-h-72 overflow-y-auto",children:($?.rotated||[]).map(a=>(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-text-muted",children:t(a.name)}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.pd,{value:a.key,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,e.jsx)(i.$n,{variant:"secondary",icon:bb===`rot_${a.id}`?"check":"content_copy",onClick:()=>bc(a.key,`rot_${a.id}`),children:bb===`rot_${a.id}`?"Copied!":"Copy"})]})]},a.id))}),(0,e.jsx)(i.$n,{onClick:()=>_(null),fullWidth:!0,children:(0,q.Tl)("Done")})]})}),(0,e.jsx)(i.aF,{isOpen:!!N,title:(0,q.Tl)("API Key Created"),onClose:()=>O(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,e.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:(0,q.Tl)("Save this key now!")}),(0,e.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:(0,q.Tl)("This is the only time you will see this key. Store it securely.")})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.pd,{value:N||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)(i.$n,{variant:"secondary",icon:"created_key"===bb?"check":"content_copy",onClick:()=>bc(N,"created_key"),children:"created_key"===bb?(0,q.Tl)("Copied!"):(0,q.Tl)("Copy")})]}),(0,e.jsx)(i.$n,{onClick:()=>O(null),fullWidth:!0,children:(0,q.Tl)("Done")})]})}),(0,e.jsx)(i.aF,{isOpen:aw,title:(0,q.Tl)("Enable Tunnel"),onClose:()=>ax(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:(0,q.Tl)("Cloudflare Tunnel")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Expose your local 10Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere.")})]})]})}),(0,e.jsx)("div",{className:"grid grid-cols-2 gap-3",children:k.oX.map(a=>(0,e.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,e.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,e.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,e.jsx)("p",{className:"text-xs text-text-muted",children:(0,q.Tl)("Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bm,fullWidth:!0,children:(0,q.Tl)("Start Tunnel")}),(0,e.jsx)(i.$n,{onClick:()=>ax(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:ay,title:(0,q.Tl)("Disable Tunnel"),onClose:()=>!aq&&az(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bn,fullWidth:!0,disabled:aq,variant:"danger",children:aq?"Disabling...":"Disable"}),(0,e.jsx)(i.$n,{onClick:()=>az(!1),variant:"ghost",fullWidth:!0,disabled:aq,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:a$,title:(0,q.Tl)("Tailscale Funnel"),onClose:()=>{aS||(a_(!1),aX(""),aL(null))},children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aQ&&(0,e.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),(0,q.Tl)("Checking...")]}),!1===aQ&&!aS&&(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bp,fullWidth:!0,children:(0,q.Tl)("Install Tailscale")}),(0,e.jsx)(i.$n,{onClick:()=>a_(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]}),aS&&(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),aU.length>0&&(0,e.jsx)("div",{ref:a2,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:aU.map((a,b)=>(0,e.jsx)("div",{children:a},b))})]}),!0===aQ&&!aS&&(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:()=>bt(),fullWidth:!0,children:(0,q.Tl)("Connect")}),(0,e.jsx)(i.$n,{onClick:()=>a_(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]}),aK&&(0,e.jsx)(n.A,{status:aK})]})}),(0,e.jsx)(i.aF,{isOpen:a0,title:(0,q.Tl)("Disable Tailscale"),onClose:()=>!aG&&a1(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bv,fullWidth:!0,disabled:aG,variant:"danger",children:aG?"Disabling...":"Disable"}),(0,e.jsx)(i.$n,{onClick:()=>a1(!1),variant:"ghost",fullWidth:!0,disabled:aG,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.uo,{isOpen:!!P,onClose:()=>Q(null),onConfirm:()=>{let a=P?.onConfirm;Q(null),a?.()},title:P?.title||"Confirm",message:P?.message,variant:"danger"})]})}[i,m]=r.then?(await r)():r,u.propTypes={machineId:h().string.isRequired},d()}catch(a){d(a)}})},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"F:\\\\Files\\\\GitHub Files\\\\10router\\\\src\\\\app\\\\(dashboard)\\\\dashboard\\\\endpoint\\\\EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"F:\\Files\\GitHub Files\\10router\\src\\app\\(dashboard)\\dashboard\\endpoint\\EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},61389:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>k,Nv:()=>m,RL:()=>j,ev:()=>l,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>i});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=5,j=1e4,k=5e3,l=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],m=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},78420:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}},80392:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>h});var e=c(48249),f=c(94579),g=a([f]);function h({label:a,url:b,copyId:c,copied:d,onCopy:g,badge:i,actions:j}){return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===i||"TS"===i?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,e.jsx)(f.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>g(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d===c?"check":"content_copy"})}),j]})}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},85357:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
3
+ ${(0,q.Tl)("This key will stop working immediately but can be resumed later.")}`,onConfirm:async()=>{Y(null),bK(a.id,b)}}):bK(a.id,b)},title:a.isActive?(0,q.Tl)("Pause key"):(0,q.Tl)("Resume key")}),(0,e.jsx)("button",{onClick:()=>bJ(a.id),className:"p-2 hover:bg-red-500/10 rounded text-red-500 opacity-100 sm:opacity-0 sm:group-hover:opacity-100 transition-all",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"})})]})]},a.id)})})]}),(0,e.jsx)(i.aF,{isOpen:h,title:(0,q.Tl)("Create API Key"),onClose:()=>{r(!1),w(""),y("")},children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)(i.pd,{label:(0,q.Tl)("Key Name"),value:v,onChange:a=>w(a.target.value),placeholder:(0,q.Tl)("Production Key")}),(0,e.jsx)(i.pd,{label:(0,q.Tl)("Daily Token Limit"),type:"number",min:"0",value:x,onChange:a=>y(a.target.value),placeholder:(0,q.Tl)("e.g. 100000000 — empty means unlimited")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bF,fullWidth:!0,disabled:!v.trim(),children:(0,q.Tl)("Create")}),(0,e.jsx)(i.$n,{onClick:()=>{r(!1),w(""),y("")},variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:!!z,title:`${(0,q.Tl)("Edit Daily Token Limit")}${z?` — ${t(z.name)}`:""}`,onClose:()=>A(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)(i.pd,{label:(0,q.Tl)("Daily Token Limit"),type:"number",min:"0",value:B,onChange:a=>C(a.target.value),placeholder:(0,q.Tl)("e.g. 100000000 — empty means unlimited"),hint:(0,q.Tl)("Leave empty to remove the limit.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bG,fullWidth:!0,disabled:D,children:(0,q.Tl)("Save")}),(0,e.jsx)(i.$n,{onClick:()=>A(null),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:!!F,title:`${(0,q.Tl)("Allowed Models & Combos")}${F?` — ${t(F.name)}`:""}`,onClose:()=>G(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-xs text-text-muted",children:(0,q.Tl)("Restrict this key to specific models or combos. Leave empty for unrestricted access.")}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsxs)("div",{className:"flex items-center justify-between",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-text-muted",children:(0,q.Tl)("Allowed Models")}),(0,e.jsx)(i.$n,{size:"sm",variant:"secondary",icon:"add",onClick:()=>Q(!0),children:(0,q.Tl)("Pick models")})]}),H.length>0?(0,e.jsx)("div",{className:"flex flex-wrap gap-1.5 max-h-32 overflow-y-auto rounded-lg border border-border bg-surface-2 p-2",children:H.map(a=>(0,e.jsxs)("span",{className:"inline-flex items-center gap-1 rounded-full bg-primary/10 border border-primary/30 pl-2 pr-1 py-0.5 text-[11px] font-mono text-primary",children:[a,(0,e.jsx)("button",{onClick:()=>I(b=>b.filter(b=>b!==a)),className:"rounded-full p-0.5 hover:bg-primary/20 transition-colors",title:(0,q.Tl)("Remove"),children:(0,e.jsx)("span",{className:"material-symbols-outlined leading-none",style:{fontSize:"12px"},children:"close"})})]},a))}):(0,e.jsx)("p",{className:"text-[11px] text-text-muted italic",children:(0,q.Tl)("No models selected — unrestricted unless combos or patterns are set.")})]}),(0,e.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,e.jsx)("label",{className:"text-xs font-medium text-text-muted",children:(0,q.Tl)("Allowed Combos")}),T.length>0?(0,e.jsx)("div",{className:"flex flex-wrap gap-x-4 gap-y-1.5 rounded-lg border border-border bg-surface-2 p-2 max-h-28 overflow-y-auto",children:T.map(a=>(0,e.jsxs)("label",{className:"flex items-center gap-1.5 text-xs cursor-pointer select-none",children:[(0,e.jsx)("input",{type:"checkbox",className:"w-3.5 h-3.5 rounded border-border accent-primary cursor-pointer",checked:J.includes(a),onChange:b=>K(c=>b.target.checked?[...c,a]:c.filter(b=>b!==a))}),(0,e.jsx)("span",{className:"font-mono",children:a})]},a))}):(0,e.jsx)("p",{className:"text-[11px] text-text-muted italic",children:(0,q.Tl)("No combos yet.")})]}),(0,e.jsxs)("details",{className:"group",children:[(0,e.jsxs)("summary",{className:"cursor-pointer text-xs font-medium text-text-muted hover:text-text-main transition-colors select-none list-none flex items-center gap-1",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-[14px] transition-transform group-open:rotate-90",children:"chevron_right"}),(0,q.Tl)("Wildcard patterns (advanced)")]}),(0,e.jsxs)("div",{className:"mt-2 flex flex-col gap-1.5",children:[(0,e.jsx)("textarea",{rows:2,value:L,onChange:a=>M(a.target.value),placeholder:"anthropic/*, *claude*",className:"w-full text-xs font-mono p-2.5 rounded-lg border border-border bg-surface-2 focus:outline-none focus:border-primary resize-y"}),(0,e.jsx)("p",{className:"text-[11px] text-text-muted",children:(0,q.Tl)("Patterns like anthropic/* or *claude* match whole providers/families. One per line or comma-separated.")})]})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bI,fullWidth:!0,disabled:N,children:(0,q.Tl)("Save")}),(0,e.jsx)(i.$n,{onClick:()=>G(null),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),P&&(0,e.jsx)(i.rq,{isOpen:P,onClose:()=>Q(!1),onSelect:a=>{let b=a?.value;!b||a?.isPlaceholder||(T.includes(b)?K(a=>a.includes(b)?a:[...a,b]):I(a=>a.includes(b)?a:[...a,b]))},onDeselect:a=>{let b=a?.value;b&&(T.includes(b)?K(a=>a.filter(a=>a!==b)):I(a=>a.filter(a=>a!==b)))},activeProviders:R,title:(0,q.Tl)("Pick allowed models"),addedModelValues:[...H,...J],closeOnSelect:!1}),(0,e.jsx)(i.aF,{isOpen:!!ag,title:(0,q.Tl)("Keys Re-issued"),onClose:()=>ah(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,e.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:(0,q.Tl)("Save these keys now — shown only once")}),(0,e.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:(0,q.Tl)("Old keys no longer work. Update every client with the new values below.")})]}),(0,e.jsx)("div",{className:"flex flex-col gap-2 max-h-72 overflow-y-auto",children:(ag?.rotated||[]).map(a=>(0,e.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,e.jsx)("p",{className:"text-xs font-medium text-text-muted",children:t(a.name)}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.pd,{value:a.key,readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,e.jsx)(i.$n,{variant:"secondary",icon:bj===`rot_${a.id}`?"check":"content_copy",onClick:()=>bk(a.key,`rot_${a.id}`),children:bj===`rot_${a.id}`?"Copied!":"Copy"})]})]},a.id))}),(0,e.jsx)(i.$n,{onClick:()=>ah(null),fullWidth:!0,children:(0,q.Tl)("Done")})]})}),(0,e.jsx)(i.aF,{isOpen:!!V,title:(0,q.Tl)("API Key Created"),onClose:()=>W(null),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsxs)("div",{className:"bg-yellow-50 dark:bg-yellow-900/20 border border-yellow-200 dark:border-yellow-800 rounded-lg p-4",children:[(0,e.jsx)("p",{className:"text-sm text-yellow-800 dark:text-yellow-200 mb-2 font-medium",children:(0,q.Tl)("Save this key now!")}),(0,e.jsx)("p",{className:"text-sm text-yellow-700 dark:text-yellow-300",children:(0,q.Tl)("This is the only time you will see this key. Store it securely.")})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.pd,{value:V||"",readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)(i.$n,{variant:"secondary",icon:"created_key"===bj?"check":"content_copy",onClick:()=>bk(V,"created_key"),children:"created_key"===bj?(0,q.Tl)("Copied!"):(0,q.Tl)("Copy")})]}),(0,e.jsx)(i.$n,{onClick:()=>W(null),fullWidth:!0,children:(0,q.Tl)("Done")})]})}),(0,e.jsx)(i.aF,{isOpen:aE,title:(0,q.Tl)("Enable Tunnel"),onClose:()=>aF(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("div",{className:"bg-surface-2 border border-border-subtle rounded-lg p-4",children:(0,e.jsxs)("div",{className:"flex items-start gap-3",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-primary",children:"cloud_upload"}),(0,e.jsxs)("div",{children:[(0,e.jsx)("p",{className:"text-sm text-text-main font-medium mb-1",children:(0,q.Tl)("Cloudflare Tunnel")}),(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("Expose your local 10Router to the internet. No port forwarding, no static IP needed. Share endpoint URL with your team or use it in Cursor, Cline, and other AI tools from anywhere.")})]})]})}),(0,e.jsx)("div",{className:"grid grid-cols-2 gap-3",children:k.oX.map(a=>(0,e.jsxs)("div",{className:"flex flex-col items-center text-center p-3 rounded-lg bg-sidebar/50",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-xl text-primary mb-1",children:a.icon}),(0,e.jsx)("p",{className:"text-xs font-semibold",children:a.title}),(0,e.jsx)("p",{className:"text-xs text-text-muted",children:a.desc})]},a.title))}),(0,e.jsx)("p",{className:"text-xs text-text-muted",children:(0,q.Tl)("Requires outbound port 7844 (TCP/UDP). Connection may take 10-30s.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bu,fullWidth:!0,children:(0,q.Tl)("Start Tunnel")}),(0,e.jsx)(i.$n,{onClick:()=>aF(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:aG,title:(0,q.Tl)("Disable Tunnel"),onClose:()=>!ay&&aH(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:(0,q.Tl)("The Cloudflare tunnel will be disconnected. Remote access via tunnel URL will stop working.")}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bv,fullWidth:!0,disabled:ay,variant:"danger",children:ay?"Disabling...":"Disable"}),(0,e.jsx)(i.$n,{onClick:()=>aH(!1),variant:"ghost",fullWidth:!0,disabled:ay,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.aF,{isOpen:a6,title:(0,q.Tl)("Tailscale Funnel"),onClose:()=>{a$||(a7(!1),a3(""),aT(null))},children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[null===aY&&(0,e.jsxs)("p",{className:"text-sm text-text-muted flex items-center gap-2",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),(0,q.Tl)("Checking...")]}),!1===aY&&!a$&&(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale is not installed. Install it to enable Funnel."}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bx,fullWidth:!0,children:(0,q.Tl)("Install Tailscale")}),(0,e.jsx)(i.$n,{onClick:()=>a7(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]}),a$&&(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-text-muted",children:[(0,e.jsx)("span",{className:"material-symbols-outlined animate-spin text-sm",children:"progress_activity"}),"Installing Tailscale..."]}),a0.length>0&&(0,e.jsx)("div",{ref:ba,className:"bg-black/5 dark:bg-white/5 rounded p-2 max-h-40 overflow-y-auto font-mono text-xs text-text-muted",children:a0.map((a,b)=>(0,e.jsx)("div",{children:a},b))})]}),!0===aY&&!a$&&(0,e.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[(0,e.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"check_circle"}),"Tailscale installed"]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:()=>bB(),fullWidth:!0,children:(0,q.Tl)("Connect")}),(0,e.jsx)(i.$n,{onClick:()=>a7(!1),variant:"ghost",fullWidth:!0,children:(0,q.Tl)("Cancel")})]})]}),aS&&(0,e.jsx)(n.A,{status:aS})]})}),(0,e.jsx)(i.aF,{isOpen:a8,title:(0,q.Tl)("Disable Tailscale"),onClose:()=>!aO&&a9(!1),children:(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)("p",{className:"text-sm text-text-muted",children:"Tailscale Funnel will be stopped. Remote access via Tailscale URL will stop working."}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsx)(i.$n,{onClick:bD,fullWidth:!0,disabled:aO,variant:"danger",children:aO?"Disabling...":"Disable"}),(0,e.jsx)(i.$n,{onClick:()=>a9(!1),variant:"ghost",fullWidth:!0,disabled:aO,children:(0,q.Tl)("Cancel")})]})]})}),(0,e.jsx)(i.uo,{isOpen:!!X,onClose:()=>Y(null),onConfirm:()=>{let a=X?.onConfirm;Y(null),a?.()},title:X?.title||"Confirm",message:X?.message,variant:"danger"})]})}[i,m]=r.then?(await r)():r,u.propTypes={machineId:h().string.isRequired},d()}catch(a){d(a)}})},51747:(a,b,c)=>{"use strict";c.d(b,{default:()=>d});let d=(0,c(77943).registerClientReference)(function(){throw Error("Attempted to call the default export of \"F:\\\\Files\\\\GitHub Files\\\\10router\\\\src\\\\app\\\\(dashboard)\\\\dashboard\\\\endpoint\\\\EndpointPageClient.js\" from the server, but it's on the client. It's not possible to invoke a client function from the server, it can only be rendered as a Component or passed to props of a Client Component.")},"F:\\Files\\GitHub Files\\10router\\src\\app\\(dashboard)\\dashboard\\endpoint\\EndpointPageClient.js","default")},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},61389:(a,b,c)=>{Promise.resolve().then(c.bind(c,51747))},67960:(a,b,c)=>{"use strict";c.d(b,{Cp:()=>g,Hx:()=>f,Iv:()=>k,Nv:()=>m,RL:()=>j,ev:()=>l,fl:()=>h,hT:()=>d,oX:()=>e,t6:()=>i});let d=["zh-CN","zh-TW"],e=[{icon:"public",title:"Access Anywhere",desc:"Use your API from any network"},{icon:"group",title:"Share Endpoint",desc:"Share URL with team members"},{icon:"code",title:"Use in Cursor/Cline",desc:"Connect AI tools remotely"},{icon:"lock",title:"Encrypted",desc:"End-to-end TLS via Cloudflare"}],f=2e3,g=3e5,h=5e3,i=5,j=1e4,k=5e3,l=[{id:"lite",label:"Lite",desc:"Drop filler, keep grammar"},{id:"full",label:"Full",desc:"Drop articles, fragments OK"},{id:"ultra",label:"Ultra",desc:"Telegraphic, max compression"},{id:"wenyan-lite",label:"文 Lite",desc:"Classical Chinese, light compression",wenyan:!0},{id:"wenyan",label:"文 Full",desc:"Maximum 文言文, 80-90% reduction",wenyan:!0},{id:"wenyan-ultra",label:"文 Ultra",desc:"Extreme classical compression",wenyan:!0}],m=[{id:"lite",label:"Lite",desc:"Build asked, name lazier option"},{id:"full",label:"Full",desc:"Ladder enforced: stdlib/native first"},{id:"ultra",label:"Ultra",desc:"YAGNI extremist, deletion first"}]},78420:(a,b,c)=>{"use strict";c.d(b,{A:()=>e});var d=c(48249);function e({text:a}){return(0,d.jsxs)("span",{className:"relative group inline-flex items-center",children:[(0,d.jsx)("span",{className:"material-symbols-outlined text-[14px] text-text-muted cursor-help",children:"help"}),(0,d.jsx)("span",{className:"pointer-events-none absolute left-5 top-1/2 -translate-y-1/2 z-50 w-64 rounded bg-gray-900 dark:bg-gray-800 text-white text-xs px-2.5 py-1.5 opacity-0 group-hover:opacity-100 transition-opacity shadow-lg",children:a})]})}},80392:(a,b,c)=>{"use strict";c.a(a,async(a,d)=>{try{c.d(b,{A:()=>h});var e=c(48249),f=c(94579),g=a([f]);function h({label:a,url:b,copyId:c,copied:d,onCopy:g,badge:i,actions:j}){return(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)("span",{className:`text-xs font-mono px-1.5 py-0.5 rounded shrink-0 min-w-[88px] text-center ${"CF"===i||"TS"===i?"bg-primary/10 text-primary":"bg-surface-2 text-text-muted"}`,children:a}),(0,e.jsx)(f.pd,{value:b,readOnly:!0,className:"flex-1 font-mono text-sm"}),(0,e.jsx)("button",{onClick:()=>g(b,c),className:"p-2 hover:bg-black/5 dark:hover:bg-white/5 rounded text-text-muted hover:text-primary transition-colors shrink-0",children:(0,e.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:d===c?"check":"content_copy"})}),j]})}f=(g.then?(await g)():g)[0],d()}catch(a){d(a)}})},85357:(a,b,c)=>{Promise.resolve().then(c.bind(c,43173))},87250:(a,b,c)=>{"use strict";c.d(b,{D:()=>e});var d=c(54603);async function e(){return await (0,d.Xj)()}}};
@@ -0,0 +1 @@
1
+ "use strict";exports.id=7729,exports.ids=[4575,6956,7729],exports.modules={31480:(a,b,c)=>{c.d(b,{K$:()=>m,zP:()=>l});var d=c(77598),e=c(46956);let f="I*7Cf%WZ#S&%1RlZJ&C2",g={"minimax-code":{agent:"https://agent.minimaxi.com",platform:"https://www.minimaxi.com",lang:"zh"},"minimax-code-global":{agent:"https://agent.minimax.io",platform:"https://platform.minimax.io",lang:"en"}},h=a=>(0,d.createHash)("md5").update(a).digest("hex"),i=a=>a&&"object"==typeof a&&!Array.isArray(a)?a:void 0,j=a=>"number"==typeof a&&Number.isFinite(a)?a:void 0,k=(a,b)=>"string"==typeof a?.[b]&&a[b].trim()?a[b].trim():void 0;function l(a,b,{access:c,userID:d,body:e,now:g=Date.now(),tzOffsetSec:i=-60*new Date().getTimezoneOffset()}={}){let j=new URL(b,a.agent);j.search=new URLSearchParams({device_platform:"mcode",biz_id:"3",app_id:"3001",version_code:"22201",unix:String(g),timezone_offset:String(i),sys_language:a.lang,lang:a.lang,device_id:"0",os_name:process.platform,browser_name:"mcode",user_id:String(d??"").trim()||"0",client:"mcode"}).toString();let k=j.pathname+j.search,m=Math.floor(g/1e3),n=void 0===e?void 0:JSON.stringify(e),o={Accept:"application/json","Content-Type":"application/json","User-Agent":"MiniMaxCode",Authorization:`Bearer ${c}`,yy:void 0===n?h(`${encodeURIComponent(k)}_{}${h(String(g))}ooui`):h(`${encodeURIComponent(k)}_${n}${h(String(g))}ooui`),"x-timestamp":String(m),"x-signature":void 0===n?h(`${m}${f}`):h(`${m}${f}${n}`)};return{url:j.toString(),init:{method:void 0===n?"GET":"POST",headers:o,...void 0===n?{}:{body:n}}}}async function m(a,b,c=null,d=null){let f=g[b];if(!f||!a)return{message:`Usage API not implemented for ${b}`};let h={},n=null;try{let b=d?.opGroupId,g=await (0,e.proxyAwareFetch)(`${f.platform}/v1/api/openplatform/coding_plan/remains`,{headers:{Accept:"application/json",Authorization:`Bearer ${a}`,...b?{"X-Group-Id":b}:{}},signal:AbortSignal.timeout(15e3)},c);if(401===g.status||403===g.status)return{message:"MiniMax Code session expired or unauthorized. Please re-authenticate."};if(g.ok){let a=await g.json().catch(()=>null);for(let b of function(a){let b=i(a?.base_resp);if(b&&"number"==typeof b.status_code&&0!==b.status_code)throw Error(k(b,"status_msg")??`MiniMax said ${b.status_code}`);if(!b&&!Array.isArray(a?.model_remains))throw Error("no plan in the reply");let c=a=>a<1e12?1e3*a:a,d=a=>0===j(a),e=[];for(let b of Array.isArray(a.model_remains)?a.model_remains:[]){let a=String(b?.model_name??"").trim();if(!a||3===j(b.current_interval_status)&&3===j(b.current_weekly_status)&&d(b.current_interval_total_count)&&d(b.current_weekly_total_count))continue;let f="general"===a.toLowerCase();for(let d of[{left:j(b.current_interval_remaining_percent),status:j(b.current_interval_status)??0,start:j(b.start_time)??0,end:j(b.end_time)??0,week:!1},{left:j(b.current_weekly_remaining_percent),status:j(b.current_weekly_status)??0,start:j(b.weekly_start_time)??0,end:j(b.weekly_end_time)??0,week:!0}]){if(3===d.status||void 0===d.left&&2!==d.status)continue;let b=2===d.status?0:Math.max(0,Math.min(100,d.left)),g=0;d.start>0&&d.end>d.start?g=c(d.end)-c(d.start):d.week&&(g=6048e5);let h=d.week?"7 days":g>864e5&&g%864e5==0?`${g/864e5} days`:g>=36e5&&g%36e5==0?`${g/36e5} hours`:g>0?`${Math.floor(g/6e4)} minutes`:"Allowance",i=f?h:`${a[0].toUpperCase()+a.slice(1)} \xb7 ${h}`;e.push({name:i,used:100-b,total:100,remaining:b,remainingPercentage:b,resetAt:d.end>0?new Date(c(d.end)).toISOString():null,recurring:!0})}}return e}(a))h[b.name]=b}}catch(a){n=a}try{let b=d?.realUserID,{url:g,init:j}=l(f,"/matrix/api/v1/commerce/get_membership_info",{access:a,userID:b,body:{}}),m=await (0,e.proxyAwareFetch)(g,j,c);if(m.ok){let a=await m.json().catch(()=>null),b=i(a?.data),c=i(a?.op_credit_summary)??i(b?.op_credit_summary),d=k(c,"total_remaining_amount")??k(a,"opcredit_balance")??k(b,"opcredit_balance");if(void 0!==d){let a=Number(d);h.Credits={name:"Credits",used:0,total:Number.isFinite(a)?a:0,remaining:Number.isFinite(a)?a:0,isCreditBalance:!0,currency:"credits"}}}}catch{}return 0===Object.keys(h).length?n?{message:`MiniMax Code usage fetch failed: ${n.message}`}:{message:"No active MiniMax Code subscription found."}:{quotas:h}}},46956:(a,b,c)=>{c.d(b,{proxyAwareFetch:()=>r});var d=c(27910),e=c(8735);let f=globalThis.fetch,g=new Map;function h(a,b){let c=e.v1.directFallbackTimeoutMs;if(b?.signal)return f(a,b);let d=new AbortController,g=setTimeout(()=>d.abort(Error(`fetch connect timeout (${c}ms)`)),c);return f(a,{...b,signal:d.signal}).finally(()=>clearTimeout(g))}let i=new Map,j=["cloudcode-pa.googleapis.com","daily-cloudcode-pa.googleapis.com","api.individual.githubcopilot.com","q.us-east-1.amazonaws.com","codewhisperer.us-east-1.amazonaws.com","api2.cursor.sh"],k=["8.8.8.8","8.8.4.4"];function l(a){return null==a?"":String(a).trim()}async function m(a){let b=i.get(a);if(b&&Date.now()<b.expiry)return b.ip;try{let b=await Promise.resolve().then(c.t.bind(c,14985,23)),{promisify:d}=await Promise.resolve().then(c.t.bind(c,28354,23)),f=new b.Resolver;f.setServers(k);let g=d(f.resolve4.bind(f)),h=await g(a);return i.set(a,{ip:h[0],expiry:Date.now()+e.v1.dnsCacheTtlMs}),h[0]}catch(b){return console.warn(`[ProxyFetch] DNS resolve failed for ${a}:`,b.message),null}}function n(a,b){let c,d=l(b);if(!d)return!1;try{c=new URL(a).hostname.toLowerCase()}catch{return!1}return d.split(",").map(a=>a.trim().toLowerCase()).filter(Boolean).some(a=>"*"===a||(a.startsWith(".")?c.endsWith(a)||c===a.slice(1):c===a||c.endsWith(`.${a}`)))}function o(a){let b=l(a);return b?/^[a-z][a-z0-9+.-]*:\/\//i.test(b)?b:`http://${b}`:null}async function p(a){let b=o(a);if(!b)return null;if(!g.has(b)){g.size>=e.v1.proxyDispatchersMaxSize&&g.delete(g.keys().next().value);let{ProxyAgent:a}=await c.e(3433).then(c.t.bind(c,3433,19));g.set(b,new a({uri:b}))}return g.get(b)}async function q(a,b,f){let g=await Promise.resolve().then(c.t.bind(c,55591,23)),h=await Promise.resolve().then(c.t.bind(c,91645,23)),i=g.default??g,j=h.default??h;return new Promise((c,g)=>{let h=new j.Socket,k=!1,l=(a,b)=>{k||(k=!0,clearTimeout(m),o(),a(b))},m=setTimeout(()=>{h.destroy(),l(g,Error(`[ProxyFetch] MITM bypass connect timeout after ${e.v1.directFallbackTimeoutMs}ms`))},e.v1.directFallbackTimeoutMs),n=()=>{h.destroy(),l(g,Error("[ProxyFetch] MITM bypass request aborted"))},o=()=>{f.signal&&f.signal.removeEventListener("abort",n)};if(f.signal){if(f.signal.aborted)return void n();f.signal.addEventListener("abort",n,{once:!0})}h.connect(443,b,()=>{let b={socket:h,servername:a.hostname,path:a.pathname+a.search,method:f.method||"POST",headers:{...f.headers,Host:a.hostname}},e=i.request(b,a=>{let b={ok:a.statusCode>=200&&a.statusCode<300,status:a.statusCode,statusText:a.statusMessage,headers:new Map(Object.entries(a.headers)),body:d.Readable.toWeb(a),text:async()=>{let b=[];for await(let c of a)b.push(c);return Buffer.concat(b).toString()},json:async()=>JSON.parse(await b.text())};l(c,b)});e.on("error",a=>l(g,a)),f.body&&e.write("string"==typeof f.body?f.body:JSON.stringify(f.body)),e.end()}),h.on("error",a=>l(g,a))})}async function r(a,b={},c=null){let d="string"==typeof a?a:a.toString(),e=l(c?.vercelRelayUrl);if(e){let a=new URL(d),c={...b.headers,"x-relay-target":`${a.protocol}//${a.host}`,"x-relay-path":`${a.pathname}${a.search}`};return f(e,{...b,headers:c})}let g=function(a,b){if(b?.enabled!==!0&&b?.connectionProxyEnabled!==!0)return null;let c=l(b?.url??b?.connectionProxyUrl);if(!c)return null;let d=l(b?.noProxy??b?.connectionNoProxy);return d&&n(a,d)?null:o(c)}(d,c),i=g?null:o(function(a){let b;if(n(a,process.env.NO_PROXY||process.env.no_proxy))return null;try{b=new URL(a).protocol}catch{return null}return"https:"===b?process.env.HTTPS_PROXY||process.env.https_proxy||process.env.ALL_PROXY||process.env.all_proxy:process.env.HTTP_PROXY||process.env.http_proxy||process.env.ALL_PROXY||process.env.all_proxy}(d)),k=g||i;if(function(a){try{let b=new URL(a).hostname;return j.some(a=>b.includes(a))}catch{return!1}}(d)){if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}console.warn(`[ProxyFetch] Proxy failed, falling back to direct bypass: ${a.message}`)}try{let a=new URL(d),c=await m(a.hostname);if(c)return await q(a,c,b)}catch(a){console.warn(`[ProxyFetch] MITM bypass failed: ${a.message}`)}if(k)return h(d,b)}if(k)try{let c=await p(k);return await f(a,{...b,dispatcher:c})}catch(a){if(c?.strictProxy===!0)throw Error(`[ProxyFetch] Proxy required but failed (strictProxy=true): ${a.message}`);if(c?.onProxyFallback)try{c.onProxyFallback(a)}catch{}return console.warn(`[ProxyFetch] Proxy failed, falling back to direct: ${a.message}`),h(d,b)}let s=c?.proxyPoolId||c?.enabled===!0||c?.connectionProxyEnabled===!0||!!l(c?.url??c?.connectionProxyUrl);if(c?.strictProxy===!0&&s)throw Error("[ProxyFetch] Proxy required but none resolved (strictProxy=true)");return f(a,b)}async function s(a,b={}){return r(a,b,null)}globalThis.fetch!==s&&(globalThis.fetch=s)},80110:(a,b,c)=>{c.r(b),c.d(b,{checkinOneMinimax:()=>s,isEligibleMinimaxConnection:()=>q,msUntilNextTick:()=>j,runMinimaxCheckinTick:()=>t,startMinimaxCheckin:()=>w,stopMinimaxCheckin:()=>x});var d=c(87886),e=c(31480);let f=new Set(["minimax-code","minimax-code-global"]),g=!1,h=null,i=null;function j(a=Date.now(),b=Math.random){return Math.max(72e5+Math.floor(6e5*b()),1e3)}async function k(){try{let{getSettings:a}=await Promise.resolve().then(c.bind(c,70321));return await a()||{}}catch{return{}}}async function l(){if(i)return i;let a=await k(),b=a?.minimaxDailyDone;return i=b&&"object"==typeof b&&!Array.isArray(b)?{...b}:{}}function m(a=Date.now()){let b=new Date(a),c=a=>String(a).padStart(2,"0");return`${b.getFullYear()}-${c(b.getMonth()+1)}-${c(b.getDate())}`}function n(a){let b="minimax-code-global"===a.provider?"MiniMax Global":"MiniMax Code",c=a.name||a.displayName||a.email||`${String(a.id||"?").slice(0,8)}…`;return`${b}: ${c}`}function o(a){let b=Math.max(0,Math.round(a/1e3));if(b<60)return`${b}s`;let c=Math.round(b/60);return c<60?`${c}m`:`${Math.floor(c/60)}h${String(c%60).padStart(2,"0")}m`}async function p(){if(!i)return;let a=m(),b={};for(let[c,d]of Object.entries(i))d===a&&(b[c]=d);try{let{updateSettings:a}=await Promise.resolve().then(c.bind(c,70321));for(let c of(await a({minimaxDailyDone:b}),Object.keys(i)))delete i[c];Object.assign(i,b)}catch(a){d.warn("MINIMAX_CHECKIN",`Persist daily-done map failed: ${a?.message??String(a)}`)}}function q(a){if(!a||!1===a.isActive||!f.has(a.provider))return!1;let b=a.accessToken;return"string"==typeof b&&b.trim().length>0}function r(a,b,c){let d="minimax-code-global"===a.provider?{agent:"https://agent.minimax.io",lang:"en"}:{agent:"https://agent.minimax.cn",lang:"zh"};return(0,e.zP)(d,b,{access:a.accessToken,userID:a.providerSpecificData?.realUserID,body:c})}async function s(a,b={}){let c=b.fetch||fetch,d=a.accessToken,e={connectionId:a.id,account:a.name||a.email||a.id,provider:a.provider};if(!d)return{...e,status:"failed",error:"Token unavailable"};try{let{url:b,init:d}=r(a,"/minimax-cloud/api/v1/signin/status"),f=await c(b,{...d,signal:AbortSignal.timeout(15e3)});if(401===f.status||403===f.status)return{...e,status:"failed",error:`Authentication failed (${f.status})`};if(!f.ok)return{...e,status:"failed",error:`Status check failed: HTTP ${f.status}`};let g=await f.json().catch(()=>null),h=g?.base_resp;if(!g||h&&0!==h.status_code)return{...e,status:"failed",error:`Status check error: ${h?.status_msg||"unknown"}`};let i=(g?.data?.days||[]).find(a=>a.is_today);if(i&&3===i.status)return{...e,status:"already",message:`今日第 ${i.day_no||1} 天已签到(+${(i.points||0)+(i.bonus_points||0)} 积分)`,claimedAmount:0};let{url:j,init:k}=r(a,"/minimax-cloud/api/v1/signin/claim",{}),l=await c(j,{...k,signal:AbortSignal.timeout(15e3)});if(401===l.status||403===l.status)return{...e,status:"failed",error:`Authentication failed (${l.status})`};if(!l.ok)return{...e,status:"failed",error:`Claim failed: HTTP ${l.status}`};let m=await l.json().catch(()=>null),n=m?.base_resp;if(!m||n&&0!==n.status_code)return{...e,status:"failed",error:`Claim error: ${n?.status_msg||"unknown"}`};let o=m.data||{},p=Number(o.points)||(i?.points||0)+(i?.bonus_points||0);if(2===o.claim_result)return{...e,status:"already",message:`今日已领取(+${p} 积分)`,claimedAmount:0};return{...e,status:"checked-in",message:`签到成功第 ${o.day_no||1} 天(+${p} 积分)`,claimedAmount:p}}catch(a){return{...e,status:"failed",error:a?.message||"Network error"}}}async function t(a={}){let{getProviderConnections:b}=await Promise.resolve().then(c.bind(c,70321)),e=(await b()).filter(b=>q(b)&&(!a.provider||b.provider===a.provider));if(0===e.length)return d.debug("MINIMAX_CHECKIN","Tick: no eligible MiniMax connections"),[];d.debug("MINIMAX_CHECKIN",`领取轮次开始:${e.map(a=>n(a)).join("、")}`);let f=a.doneMap||await l(),g=m(a.nowMs),h=[];for(let b of e)try{if(a.skipIfCheckedToday&&f[b.id]===g){d.debug("MINIMAX_CHECKIN",`${n(b)}:今日已确认完成,跳过`),h.push({connectionId:b.id,account:b.name||b.email||b.id,provider:b.provider,status:"already",memoized:!0});continue}let c=a.checkinConnection||s,e=await c(b,{...a,doneMap:f});h.push(e),"checked-in"===e.status?(f[b.id]=g,d.info("MINIMAX_CHECKIN",`${n(b)} 签到成功 +${e.claimedAmount} 积分`)):"already"===e.status?(f[b.id]=g,d.debug("MINIMAX_CHECKIN",`${n(b)}:${e.message||"今日已签"}`)):d.warn("MINIMAX_CHECKIN",`${n(b)} 签到失败:${e.error||e.status}`)}catch(a){h.push({connectionId:b.id,account:b.name||b.id,provider:b.provider,status:"failed",error:a?.message||String(a)}),d.warn("MINIMAX_CHECKIN",`${n(b)} 签到异常:${a?.message||a}`)}let i=h.filter(a=>"checked-in"===a.status),j=h.filter(a=>"failed"===a.status),k=h.length-i.length-j.length,o=i.reduce((a,b)=>a+(b.claimedAmount||0),0),r=`签到汇总:成功 ${i.length}(+${o} 积分)、已签 ${k}、失败 ${j.length}`;return i.length>0||j.length>0?d.info("MINIMAX_CHECKIN",r):d.debug("MINIMAX_CHECKIN",r),await p(),h}async function u(a){try{let b=await k();if(!0!==b.minimaxCheckin)return void d.debug("MINIMAX_CHECKIN",`Scheduled ${a}: setting off, skipping`);let c=await l();await t({skipIfCheckedToday:!0,doneMap:c}),await p()}catch(b){d.warn("MINIMAX_CHECKIN",`定时签到(${a})失败:${b?.message??String(b)}`)}}function v(){h&&(clearTimeout(h),h=null)}function w(a={}){let b;if(g)return!1;if("phase-production-build"===(b=process.env.NEXT_PHASE||"")||"phase-export"===b||"phase-static"===b)return d.debug("MINIMAX_CHECKIN","Skip start outside long-running server runtime"),!1;g=!0,!0!==a.skipBoot&&u("boot");let c=function a(){if(!g)return 0;let b=j();return v(),(h=setTimeout(()=>{u("tick").finally(()=>a())},b))&&"function"==typeof h.unref&&h.unref(),d.debug("MINIMAX_CHECKIN",`下次签到约 ${o(b)} 后`),b}();return d.info("MINIMAX_CHECKIN",`每日签到调度已启动(全天轮询)— 下次约 ${o(c)} 后`),!0}function x(){v(),g&&(g=!1,d.info("MINIMAX_CHECKIN","Scheduler stopped"))}},87886:(a,b,c)=>{c.r(b),c.d(b,{debug:()=>o,error:()=>r,errorLine:()=>l,fmtThink:()=>m,info:()=>p,line:()=>k,maskKey:()=>v,nextTag:()=>i,request:()=>s,response:()=>t,stream:()=>u,tagForSession:()=>j,warn:()=>q});let d={DEBUG:0,INFO:1,WARN:2,ERROR:3},e=d[process.env.LOG_LEVEL?.toUpperCase?.()]??d.INFO;function f(){return new Date().toLocaleTimeString("en-US",{hour12:!1})}let g=["\uD83D\uDFE2","\uD83D\uDD35","\uD83D\uDFE3","\uD83D\uDFE1","\uD83D\uDFE0","\uD83D\uDD34","⚪","\uD83D\uDFE4"],h=0;function i(){let a=g[h%g.length];return h++,a}function j(a){if(!a)return i();let b=0;for(let c=0;c<a.length;c++)b=31*b+a.charCodeAt(c)|0;return g[Math.abs(b)%g.length]}function k(a,b,c){e>d.INFO||console.log(`[${f()}] ${a} ${b} ${c}`)}function l(a,b,c){console.log(`[${f()}] ${a} ${b} ${c}`)}function m(a){return a&&a.mode?"none"===a.mode?"off":"auto"===a.mode?"auto":"budget"===a.mode?a.budget>=1e3?`${Math.round(a.budget/1e3)}k`:`${a.budget}`:"level"===a.mode?a.level:null:null}function n(a){if(!a)return"";if("string"==typeof a)return a;try{return JSON.stringify(a)}catch{return String(a)}}function o(a,b,c){if(e<=d.DEBUG){let d=c?` ${n(c)}`:"";console.log(`[${f()}] 🔍 [${a}] ${b}${d}`)}}function p(a,b,c){if(e<=d.INFO){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ℹ️ [${a}] ${b}${d}`)}}function q(a,b,c){if(e<=d.WARN){let d=c?` ${n(c)}`:"";console.warn(`[${f()}] ⚠️ [${a}] ${b}${d}`)}}function r(a,b,c){if(e<=d.ERROR){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ❌ [${a}] ${b}${d}`)}}function s(a,b,c){let d=c?` ${n(c)}`:"";console.log(`\x1b[36m[${f()}] 📥 ${a} ${b}${d}\x1b[0m`)}function t(a,b,c){let d=c?` ${n(c)}`:"";console.log(`[${f()}] ${a<400?"\uD83D\uDCE4":"\uD83D\uDCA5"} ${a} (${b}ms)${d}`)}function u(a,b){let c=b?` ${n(b)}`:"";console.log(`[${f()}] 🌊 [STREAM] ${a}${c}`)}function v(a){return!a||a.length<8?"***":`${a.slice(0,4)}...${a.slice(-4)}`}}};
@@ -1 +1 @@
1
- exports.id=8145,exports.ids=[3662,8145],exports.modules={2186:(a,b,c)=>{"use strict";c.d(b,{e3:()=>f,e5:()=>e,nF:()=>d});let d="x-10r-cli-token";function e(a){return a.headers.get(d)||a.headers.get("x-9r-cli-token")||null}function f(a){return a.headers.get("x-10r-password")||a.headers.get("x-9r-password")||null}},3662:(a,b,c)=>{"use strict";c.d(b,{$e:()=>i,AZ:()=>m,Dt:()=>k,EQ:()=>f,LY:()=>d,O:()=>e,X8:()=>j,fh:()=>h,qS:()=>o,t2:()=>l,wf:()=>g,yD:()=>n});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Not found (wrong endpoint path, or the model does not exist)",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=864e5,j={short:6e4,long:6e5},k=3e5,l=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"unapproved channel",channelScope:!0,cooldownMs:j.short},{text:"illegal api invocation",channelScope:!0,cooldownMs:j.short},{text:"improperly formed request",cooldownMs:12e4},{text:"mimo desktop account",cooldownMs:0},{text:"11133",cooldownMs:0},{text:"rejected by the model provider",cooldownMs:0},{text:"请求体积已达极端量级",cooldownMs:0},{text:"extreme-size backstop",cooldownMs:0},{text:"real-name verification",cooldownMs:0},{text:"realname verification",cooldownMs:0},{text:"bind your alibaba cloud account",cooldownMs:0},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}],m=/real-name verification|realname|\bface verification\b|实名认证|bind your alibaba cloud account/i,n={"stepfun-plan-cn":"StepFun CN 的 Step Plan 免费套餐要求账号先完成实名(人脸)核验,未完成时上游一律拒绝,与本机额度、与 10Router 都无关。出路:1. 打开 https://account.stepfun.com/security?action=realname 完成人脸核验后重试(推荐);2. 或改用按量计费的 stepfun-cn 渠道(扣现金/代金券,无实名要求)。该账号不会被锁定,但在实名完成前每次调用都会得到这条提示。",modelscope:"ModelScope 魔搭要求账号先绑定阿里云账号(实名认证)才能使用免费推理 API。出路:打开 https://modelscope.cn/my/account 完成第三方账号「阿里云」绑定后重试。"},o="上游要求该账号先完成实名认证(real-name verification),未完成前所有调用都会被拒绝;请按上游提示的地址完成核验后重试。"},21350:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>R,GET:()=>P,POST:()=>Q});var d=c(49796),e=c(23211),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c.n(l),n=c(28286),o=c(30869),p=c(54603),q=c(2186),r=c(24424);let s=o.h0.appPort,t=`http://localhost:${s}/api/mcp/`,u=null,v=async()=>(u||(u=await (0,p.Xj)("9r-cli-auth")),u),w=async a=>{let b=await v();for(let c of a)"string"==typeof c?.url&&c.url.startsWith(t)&&(c.headers={...c.headers||{},[q.nF]:b});return a},x="gateway",y={coworkEgressAllowedHosts:["*"],disabledBuiltinTools:[],isLocalDevMcpEnabled:!0,isDesktopExtensionEnabled:!0,isDesktopExtensionDirectoryEnabled:!0,isDesktopExtensionSignatureRequired:!1,isClaudeCodeForDesktopEnabled:!0,disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0},z=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},A=async()=>{let a=z();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},B=()=>z()[0],C=async()=>i().join(await A(),"configLibrary"),D=()=>i().join(B(),"configLibrary"),E=async()=>i().join(await C(),"_meta.json"),F=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},G=()=>i().join(F(),"claude_desktop_config.json"),H=async()=>{try{let a=(await g().readFile(G(),"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(a)||{}}catch(a){return{}}},I=async a=>{await g().mkdir(F(),{recursive:!0}),await g().writeFile(G(),JSON.stringify(a,null,2))},J=async()=>{let a=await H();return"3p"!==a.deploymentMode&&(a.deploymentMode="3p",await I(a),!0)},K=async()=>{let a=await H();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await I(a)},L=async()=>{for(let a of[...z(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},M=async a=>{try{let b=(await g().readFile(a,"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(b)}catch(a){return null}},N=async()=>{let a=i().join(D(),"_meta.json"),b=await M(a);if(!b||!b.appliedId){let c=await M(await E());if(c?.appliedId)b=c;else{let a=m().randomUUID();b={appliedId:a,entries:[{id:a,name:"Default"}]}}await g().mkdir(D(),{recursive:!0}),await g().writeFile(a,JSON.stringify(b,null,2))}return b};async function O(a){let b=i().join(B(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(B(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function P(){try{if(!await L())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await M(await E()),b=a?.appliedId||null,c=await C(),d=b?i().join(c,`${b}.json`):null,f=d?await M(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider===x&&g),l=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name)),m=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,has10Router:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=n.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:m,customPlugins:o},defaultPlugins:n.DEFAULT_PLUGINS,localStdioPlugins:n.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function Q(a){try{let{baseUrl:b,apiKey:c,models:d,plugins:f,localPlugins:h,customPlugins:j}=await a.json();if(!b||!c)return e.NextResponse.json({error:"baseUrl and apiKey are required"},{status:400});let k=Array.isArray(d)?d.filter(a=>"string"==typeof a&&a.trim()):[];if(0===k.length)return e.NextResponse.json({error:"At least one model is required"},{status:400});let l=Array.isArray(f)?f:n.DEFAULT_PLUGINS,m=Array.isArray(h)?h:[],o=(Array.isArray(j)?j:[]).filter(a=>a?.url),p=await w((a=>{let b=Array.isArray(a)?a:[],c=[];for(let a of b){let b=n.LOCAL_STDIO_PLUGINS.find(b=>b.name===a);if(!b)continue;let d={name:b.name,url:`http://localhost:${s}/api/mcp/${b.name}/sse`,transport:"sse"};if(Array.isArray(b.toolNames)&&b.toolNames.length>0){let a=`${b.name}-`,c={};for(let d of b.toolNames)c[d]="allow",c[`${a}${d}`]="allow";d.toolPolicy=c}c.push(d)}return c})(m)),q=await w((a=>{if(!Array.isArray(a))return[];let b=[];for(let c of a)c?.name&&c?.url&&b.push({name:c.name,url:c.url,transport:c.transport||"sse",custom:!0});return b})(o)),r=[...(0,n.buildManagedMcpServers)(l),...p,...q],t=await J(),u=await N(),v=i().join(D(),`${u.appliedId}.json`),z={...y,inferenceProvider:x,inferenceGatewayBaseUrl:b,inferenceGatewayApiKey:c,inferenceModels:k.map(a=>({name:a}))};r.length>0&&(z.managedMcpServers=r),await g().writeFile(v,JSON.stringify(z,null,2));let A=null;try{A=await O(r)}catch(a){A={error:a.message}}try{await K()}catch{}return e.NextResponse.json({success:!0,bootstrapped:t,message:t?"Cowork enabled (3p mode set). Quit & reopen Claude Desktop.":"Cowork settings applied. Quit & reopen Claude Desktop.",configPath:v,skipApprovals:A,localMcp:{applied:m,via:"3p-sse-bridge"}})}catch(a){return console.log("Error applying cowork settings:",a),e.NextResponse.json({error:"Failed to apply cowork settings"},{status:500})}}async function R(){try{let a=await M(await E());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await C(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await O([])}catch{}try{await K()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,r.D)([P,Q,R]),(0,d.A)(P,"00cd7af78b5f71e55505381877e719986ae646f60d",null),(0,d.A)(Q,"40657366bc36ca8d7acf94798f7945bd1416fe649a",null),(0,d.A)(R,"003fbffc8c0f0a0ef7e50c699151b9cf610eb311fe",null)},28286:a=>{"use strict";a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},30869:(a,b,c)=>{"use strict";c.d(b,{Nu:()=>h,UY:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>i,oc:()=>k,vQ:()=>g});var d=c(39006),e=c(40615),f=c(81329);let g={name:"10Router",description:"AI Infrastructure Management",version:d.rE},h={repoUrl:"https://github.com/techysy/10router",donateUrl:"https://raw.githubusercontent.com/techysy/10router/refs/heads/main/donate.json",changelogUrlBase:"https://raw.githubusercontent.com/techysy/10router/refs/heads/main/public/i18n/changelog/",changelogUrlFallbackBase:"https://gitee.com/techysy/10router/raw/main/public/i18n/changelog/"},i={npmPackageName:"@techysy/10router",installCmd:"npm i -g @techysy/10router",installCmdLatest:"npm i -g @techysy/10router@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},j={maxLines:200,pollIntervalMs:1e3},k={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.5",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{"use strict";a.exports={rE:"1.5.1"}},49120:(a,b,c)=>{"use strict";c.d(b,{jL:()=>l,nJ:()=>p,ok:()=>o});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="10router",k="9router",l={main:"db.json",usage:"usage.json",disabled:"disabledModels.json",details:"request-details.json"};function m(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),k):g().join(i().homedir(),`.${k}`)}function n(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function o(){let a=process.env.DATA_DIR;if(!a)return!function(){try{let a=m(),b=n();if(!e().existsSync(a)||e().existsSync(g().join(b,"db","data.sqlite"))||Object.values(l).some(a=>e().existsSync(g().join(b,a))))return;e().cpSync(a,b,{recursive:!0,force:!1}),console.log(`[migration] copied legacy data dir ${a} → ${b}`)}catch(a){console.warn(`[migration] failed to migrate ${m()} → ${n()}: ${a?.message}`)}}(),n();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),n();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),n();throw b}}let p=o()},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},78335:()=>{},96487:()=>{}};
1
+ exports.id=8145,exports.ids=[3662,8145],exports.modules={2186:(a,b,c)=>{"use strict";c.d(b,{e3:()=>f,e5:()=>e,nF:()=>d});let d="x-10r-cli-token";function e(a){return a.headers.get(d)||a.headers.get("x-9r-cli-token")||null}function f(a){return a.headers.get("x-10r-password")||a.headers.get("x-9r-password")||null}},3662:(a,b,c)=>{"use strict";c.d(b,{$e:()=>i,AZ:()=>m,Dt:()=>k,EQ:()=>f,LY:()=>d,O:()=>e,X8:()=>j,fh:()=>h,qS:()=>o,t2:()=>l,wf:()=>g,yD:()=>n});let d={400:{type:"invalid_request_error",code:"bad_request"},401:{type:"authentication_error",code:"invalid_api_key"},402:{type:"billing_error",code:"payment_required"},403:{type:"permission_error",code:"insufficient_quota"},404:{type:"invalid_request_error",code:"model_not_found"},406:{type:"invalid_request_error",code:"model_not_supported"},429:{type:"rate_limit_error",code:"rate_limit_exceeded"},500:{type:"server_error",code:"internal_server_error"},502:{type:"server_error",code:"bad_gateway"},503:{type:"server_error",code:"service_unavailable"},504:{type:"server_error",code:"gateway_timeout"}},e={400:"Bad request",401:"Invalid API key provided",402:"Payment required",403:"You exceeded your current quota",404:"Not found (wrong endpoint path, or the model does not exist)",406:"Model not supported",429:"Rate limit exceeded",500:"Internal server error",502:"Bad gateway - upstream provider error",503:"Service temporarily unavailable",504:"Gateway timeout"},f={base:2e3,max:3e5,maxLevel:15},g=3e4,h=18e5,i=864e5,j={short:6e4,long:6e5},k=3e5,l=[{provider:"codex",text:"model is not supported when using codex with a chatgpt account",cooldownMs:18e5},{text:"no credentials",cooldownMs:12e4},{text:"request not allowed",cooldownMs:5e3},{text:"unapproved channel",channelScope:!0,cooldownMs:j.short},{text:"illegal api invocation",channelScope:!0,cooldownMs:j.short},{text:"improperly formed request",cooldownMs:12e4},{text:"mimo desktop account",cooldownMs:0},{text:"11133",cooldownMs:0},{text:"rejected by the model provider",cooldownMs:0},{text:"请求体积已达极端量级",cooldownMs:0},{text:"extreme-size backstop",cooldownMs:0},{text:"real-name verification",cooldownMs:0},{text:"realname verification",cooldownMs:0},{text:"bind your alibaba cloud account",cooldownMs:0},{text:"rate limit",backoff:!0},{text:"too many requests",backoff:!0},{text:"quota exceeded",backoff:!0},{text:"capacity",backoff:!0},{text:"overloaded",backoff:!0},{status:401,cooldownMs:12e4},{status:402,cooldownMs:12e4},{status:403,cooldownMs:12e4},{status:404,cooldownMs:12e4},{status:429,backoff:!0}],m=/real-name verification|realname|\bface verification\b|实名认证|bind your alibaba cloud account/i,n={"stepfun-plan-cn":"StepFun CN 的 Step Plan 免费套餐要求账号先完成实名(人脸)核验,未完成时上游一律拒绝,与本机额度、与 10Router 都无关。出路:1. 打开 https://account.stepfun.com/security?action=realname 完成人脸核验后重试(推荐);2. 或改用按量计费的 stepfun-cn 渠道(扣现金/代金券,无实名要求)。该账号不会被锁定,但在实名完成前每次调用都会得到这条提示。",modelscope:"ModelScope 魔搭要求账号先绑定阿里云账号(实名认证)才能使用免费推理 API。出路:打开 https://modelscope.cn/my/account 完成第三方账号「阿里云」绑定后重试。"},o="上游要求该账号先完成实名认证(real-name verification),未完成前所有调用都会被拒绝;请按上游提示的地址完成核验后重试。"},21350:(a,b,c)=>{"use strict";c.r(b),c.d(b,{DELETE:()=>R,GET:()=>P,POST:()=>Q});var d=c(49796),e=c(23211),f=c(79748),g=c.n(f),h=c(33873),i=c.n(h),j=c(21820),k=c.n(j),l=c(55511),m=c.n(l),n=c(28286),o=c(30869),p=c(54603),q=c(2186),r=c(24424);let s=o.h0.appPort,t=`http://localhost:${s}/api/mcp/`,u=null,v=async()=>(u||(u=await (0,p.Xj)("9r-cli-auth")),u),w=async a=>{let b=await v();for(let c of a)"string"==typeof c?.url&&c.url.startsWith(t)&&(c.headers={...c.headers||{},[q.nF]:b});return a},x="gateway",y={coworkEgressAllowedHosts:["*"],disabledBuiltinTools:[],isLocalDevMcpEnabled:!0,isDesktopExtensionEnabled:!0,isDesktopExtensionDirectoryEnabled:!0,isDesktopExtensionSignatureRequired:!1,isClaudeCodeForDesktopEnabled:!0,disableEssentialTelemetry:!0,disableNonessentialTelemetry:!0,disableNonessentialServices:!0},z=()=>{if("darwin"===k().platform()){let a=i().join(k().homedir(),"Library","Application Support");return[i().join(a,"Claude-3p"),i().join(a,"Claude")]}if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return[i().join(a,"Claude-3p"),i().join(b,"Claude-3p"),i().join(a,"Claude"),i().join(b,"Claude")]}return[i().join(k().homedir(),".config","Claude-3p"),i().join(k().homedir(),".config","Claude")]},A=async()=>{let a=z();for(let b of a)try{return await g().access(i().join(b,"configLibrary")),b}catch{}return a[0]},B=()=>z()[0],C=async()=>i().join(await A(),"configLibrary"),D=()=>i().join(B(),"configLibrary"),E=async()=>i().join(await C(),"_meta.json"),F=()=>{if("darwin"===k().platform())return i().join(k().homedir(),"Library","Application Support","Claude");if("win32"===k().platform()){let a=process.env.APPDATA||i().join(k().homedir(),"AppData","Roaming");return i().join(a,"Claude")}return i().join(k().homedir(),".config","Claude")},G=()=>i().join(F(),"claude_desktop_config.json"),H=async()=>{try{let a=(await g().readFile(G(),"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(a)||{}}catch(a){return{}}},I=async a=>{await g().mkdir(F(),{recursive:!0}),await g().writeFile(G(),JSON.stringify(a,null,2))},J=async()=>{let a=await H();return"3p"!==a.deploymentMode&&(a.deploymentMode="3p",await I(a),!0)},K=async()=>{let a=await H();if(!a.mcpServers||"object"!=typeof a.mcpServers)return;let b=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name));for(let c of Object.keys(a.mcpServers))b.has(c)&&delete a.mcpServers[c];0===Object.keys(a.mcpServers).length&&delete a.mcpServers,await I(a)},L=async()=>{for(let a of[...z(),...(()=>{if("darwin"===k().platform())return["/Applications/Claude.app",i().join(k().homedir(),"Applications","Claude.app")];if("win32"===k().platform()){let a=process.env.LOCALAPPDATA||i().join(k().homedir(),"AppData","Local"),b=process.env.ProgramFiles||"C:\\Program Files";return[i().join(a,"AnthropicClaude"),i().join(b,"Claude"),i().join(b,"AnthropicClaude")]}return[]})()])try{return await g().access(a),!0}catch{}return!1},M=async a=>{try{let b=(await g().readFile(a,"utf-8")).replace(/,(\s*[}\]])/g,"$1");return JSON.parse(b)}catch(a){return null}},N=async()=>{let a=i().join(D(),"_meta.json"),b=await M(a);if(!b||!b.appliedId){let c=await M(await E());if(c?.appliedId)b=c;else{let a=m().randomUUID();b={appliedId:a,entries:[{id:a,name:"Default"}]}}await g().mkdir(D(),{recursive:!0}),await g().writeFile(a,JSON.stringify(b,null,2))}return b};async function O(a){let b=i().join(B(),"config.json"),c={};try{c=JSON.parse(await g().readFile(b,"utf-8"))||{}}catch(a){if("ENOENT"!==a.code)return{error:a.code}}let d={};for(let b of a)b?.name&&(d[b.name]=!0);return c.operonSkipMcpApprovals=d,await g().mkdir(B(),{recursive:!0}),await g().writeFile(b,JSON.stringify(c,null,2)),{written:Object.keys(d).length}}async function P(){try{if(!await L())return e.NextResponse.json({installed:!1,config:null,message:"Claude Desktop (Cowork mode) not detected"});let a=await M(await E()),b=a?.appliedId||null,c=await C(),d=b?i().join(c,`${b}.json`):null,f=d?await M(d):null,g=f?.inferenceGatewayBaseUrl||null,h=Array.isArray(f?.inferenceModels)?f.inferenceModels.map(a=>"string"==typeof a?a:a?.name).filter(Boolean):[],j=Array.isArray(f?.managedMcpServers)?f.managedMcpServers:[],k=!!(f?.inferenceProvider===x&&g),l=new Set(n.LOCAL_STDIO_PLUGINS.map(a=>a.name)),m=j.filter(a=>l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>a.name),o=j.filter(a=>a.custom||!l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/")).map(a=>({name:a.name,url:a.url,transport:a.transport,custom:!0}));return e.NextResponse.json({installed:!0,config:f,has10Router:k,configPath:d,cowork:{appliedId:b,baseUrl:g,models:h,provider:f?.inferenceProvider||null,plugins:j.filter(a=>!a.custom&&!(l.has(a.name)&&"string"==typeof a.url&&a.url.includes("/api/mcp/"))).map(a=>{let b=a.toolPolicy?Object.keys(a.toolPolicy):[],c=`${a.name}-`,d=new Set;for(let a of b){let b=a;for(;b.startsWith(c);)b=b.slice(c.length);d.add(b)}let e=n.DEFAULT_PLUGINS.find(b=>b.name===a.name),f=e&&Array.isArray(e.toolNames)?e.toolNames:Array.from(d);return{name:a.name,url:a.url,transport:a.transport,oauth:!!a.oauth,toolNames:f}}),localPlugins:m,customPlugins:o},defaultPlugins:n.DEFAULT_PLUGINS,localStdioPlugins:n.LOCAL_STDIO_PLUGINS})}catch(a){return console.log("Error reading cowork settings:",a),e.NextResponse.json({error:"Failed to read cowork settings"},{status:500})}}async function Q(a){try{let{baseUrl:b,apiKey:c,models:d,plugins:f,localPlugins:h,customPlugins:j}=await a.json();if(!b||!c)return e.NextResponse.json({error:"baseUrl and apiKey are required"},{status:400});let k=Array.isArray(d)?d.filter(a=>"string"==typeof a&&a.trim()):[];if(0===k.length)return e.NextResponse.json({error:"At least one model is required"},{status:400});let l=Array.isArray(f)?f:n.DEFAULT_PLUGINS,m=Array.isArray(h)?h:[],o=(Array.isArray(j)?j:[]).filter(a=>a?.url),p=await w((a=>{let b=Array.isArray(a)?a:[],c=[];for(let a of b){let b=n.LOCAL_STDIO_PLUGINS.find(b=>b.name===a);if(!b)continue;let d={name:b.name,url:`http://localhost:${s}/api/mcp/${b.name}/sse`,transport:"sse"};if(Array.isArray(b.toolNames)&&b.toolNames.length>0){let a=`${b.name}-`,c={};for(let d of b.toolNames)c[d]="allow",c[`${a}${d}`]="allow";d.toolPolicy=c}c.push(d)}return c})(m)),q=await w((a=>{if(!Array.isArray(a))return[];let b=[];for(let c of a)c?.name&&c?.url&&b.push({name:c.name,url:c.url,transport:c.transport||"sse",custom:!0});return b})(o)),r=[...(0,n.buildManagedMcpServers)(l),...p,...q],t=await J(),u=await N(),v=i().join(D(),`${u.appliedId}.json`),z={...y,inferenceProvider:x,inferenceGatewayBaseUrl:b,inferenceGatewayApiKey:c,inferenceModels:k.map(a=>({name:a}))};r.length>0&&(z.managedMcpServers=r),await g().writeFile(v,JSON.stringify(z,null,2));let A=null;try{A=await O(r)}catch(a){A={error:a.message}}try{await K()}catch{}return e.NextResponse.json({success:!0,bootstrapped:t,message:t?"Cowork enabled (3p mode set). Quit & reopen Claude Desktop.":"Cowork settings applied. Quit & reopen Claude Desktop.",configPath:v,skipApprovals:A,localMcp:{applied:m,via:"3p-sse-bridge"}})}catch(a){return console.log("Error applying cowork settings:",a),e.NextResponse.json({error:"Failed to apply cowork settings"},{status:500})}}async function R(){try{let a=await M(await E());if(!a?.appliedId)return e.NextResponse.json({success:!0,message:"No active config to reset"});let b=i().join(await C(),`${a.appliedId}.json`);try{await g().writeFile(b,JSON.stringify({},null,2))}catch(a){if("ENOENT"!==a.code)throw a}try{await O([])}catch{}try{await K()}catch{}return e.NextResponse.json({success:!0,message:"Cowork config reset"})}catch(a){return console.log("Error resetting cowork settings:",a),e.NextResponse.json({error:"Failed to reset cowork settings"},{status:500})}}(0,r.D)([P,Q,R]),(0,d.A)(P,"00cd7af78b5f71e55505381877e719986ae646f60d",null),(0,d.A)(Q,"40657366bc36ca8d7acf94798f7945bd1416fe649a",null),(0,d.A)(R,"003fbffc8c0f0a0ef7e50c699151b9cf610eb311fe",null)},28286:a=>{"use strict";a.exports={DEFAULT_PLUGINS:[{name:"exa",title:"Exa",description:"Real-time web search and code documentation",url:"https://mcp.exa.ai/mcp",transport:"http",oauth:!1,toolNames:["web_search_exa","web_fetch_exa"]},{name:"tavily",title:"Tavily",description:"Real-time web search optimized for LLM agents",url:"https://mcp.tavily.com/mcp",transport:"http",oauth:!0,toolNames:["tavily_search","tavily_extract","tavily_crawl","tavily_map"]}],LOCAL_STDIO_PLUGINS:[{name:"browsermcp",title:"Browser MCP",description:"Control your running Chrome (requires Chrome extension)",extensionUrl:"https://chromewebstore.google.com/detail/browser-mcp-automate-your/bjfgambnhccakkhmkepdoekmckoijdlc",command:"npx",args:["-y","@browsermcp/mcp@latest"],toolNames:["browser_navigate","browser_snapshot","browser_click","browser_type","browser_screenshot","browser_get_console_logs","browser_wait","browser_press_key","browser_go_back","browser_go_forward"]}],buildManagedMcpServers:function(a){let b=Array.isArray(a)?a:[],c=[],d=new Set;for(let a of b){if(!a?.name||!a?.url||d.has(a.name))continue;d.add(a.name);let b={name:a.name,url:a.url,transport:a.transport||(/\/sse(\b|\/)/i.test(a.url)?"sse":"http")};if(a.oauth&&(b.oauth=!0),Array.isArray(a.toolNames)&&a.toolNames.length>0){let c=`${a.name}-`,d=new Set;for(let b of a.toolNames){if("string"!=typeof b||!b)continue;let a=b;for(;a.startsWith(c);)a=a.slice(c.length);d.add(a)}let e={};for(let a of d)e[a]="allow",e[`${c}${a}`]="allow";b.toolPolicy=e}c.push(b)}return c}}},30869:(a,b,c)=>{"use strict";c.d(b,{Nu:()=>h,UY:()=>j,eh:()=>f.eh,fg:()=>e.fg,h0:()=>i,oc:()=>k,vQ:()=>g});var d=c(39006),e=c(40615),f=c(81329);let g={name:"10Router",description:"AI Infrastructure Management",version:d.rE},h={repoUrl:"https://github.com/techysy/10router",donateUrl:"https://raw.githubusercontent.com/techysy/10router/refs/heads/main/donate.json",announcementsUrl:"https://raw.githubusercontent.com/techysy/10router/refs/heads/main/announcements.json",announcementsUrlFallback:"https://gitee.com/techysy/10router/raw/main/announcements.json",changelogUrlBase:"https://raw.githubusercontent.com/techysy/10router/refs/heads/main/public/i18n/changelog/",changelogUrlFallbackBase:"https://gitee.com/techysy/10router/raw/main/public/i18n/changelog/"},i={npmPackageName:"@techysy/10router",installCmd:"npm i -g @techysy/10router",installCmdLatest:"npm i -g @techysy/10router@latest --prefer-online",shutdownCountdownSec:3,exitDelayMs:500,statusPort:20129,statusPollIntervalMs:1e3,statusLogTailLines:8,installRetries:3,installRetryDelayMs:5e3,lingerAfterDoneMs:3e4,waitForExitMinMs:5e3,waitForExitMaxMs:2e4,waitForExitCheckMs:500,appPort:20128},j={maxLines:200,pollIntervalMs:1e3},k={tickIntervalMs:6e4,pingLeadMs:5e3,refreshAheadMs:3e5,failureCooldownMs:9e5,providers:{claude:{settingsKey:"claudeAutoPing",quotaKey:"session (5h)",pingModel:"claude-haiku-4-5-20251001",pingText:"hi",pingMaxTokens:1},codex:{settingsKey:"codexAutoPing",quotaKey:"session",pingWhenResetAtSlides:!0,resetAtDriftMs:3e4,minPingIntervalMs:6e5,skipWhenBlockingQuotaExhausted:!0,pingModel:"gpt-5.6-terra",pingText:"hi",pingInstructions:"Reply with OK.",pingReasoningEffort:"none"}}}},39006:a=>{"use strict";a.exports={rE:"1.6.0"}},49120:(a,b,c)=>{"use strict";c.d(b,{jL:()=>l,nJ:()=>p,ok:()=>o});var d=c(73024),e=c.n(d),f=c(33873),g=c.n(f),h=c(21820),i=c.n(h);let j="10router",k="9router",l={main:"db.json",usage:"usage.json",disabled:"disabledModels.json",details:"request-details.json"};function m(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),k):g().join(i().homedir(),`.${k}`)}function n(){return"win32"===process.platform?g().join(process.env.APPDATA||g().join(i().homedir(),"AppData","Roaming"),j):g().join(i().homedir(),`.${j}`)}function o(){let a=process.env.DATA_DIR;if(!a)return!function(){try{let a=m(),b=n();if(!e().existsSync(a)||e().existsSync(g().join(b,"db","data.sqlite"))||Object.values(l).some(a=>e().existsSync(g().join(b,a))))return;e().cpSync(a,b,{recursive:!0,force:!1}),console.log(`[migration] copied legacy data dir ${a} → ${b}`)}catch(a){console.warn(`[migration] failed to migrate ${m()} → ${n()}: ${a?.message}`)}}(),n();if("win32"===process.platform&&/^\//.test(a))return console.warn(`[DATA_DIR] '${a}' is a Unix path on Windows → fallback to default`),n();try{return e().mkdirSync(a,{recursive:!0}),a}catch(b){if(b?.code==="EACCES"||b?.code==="EPERM")return console.warn(`[DATA_DIR] '${a}' not writable → fallback ~/.${j}`),n();throw b}}let p=o()},54603:(a,b,c)=>{"use strict";c.d(b,{Xj:()=>q});var d=c(19713),e=c(73024),f=c.n(e),g=c(76760),h=c.n(g),i=c(77598),j=c.n(i),k=c(49120);let l=h().join(k.nJ,"machine-id"),m=h().join(k.nJ,"auth"),n=h().join(m,"cli-secret"),o=null,p=null;async function q(a=null){let b=a||process.env.MACHINE_ID_SALT||"endpoint-proxy-salt",c=function(){if(o)return o;try{if(o=f().readFileSync(l,"utf8").trim())return o}catch{}try{o=(0,d.machineIdSync)()}catch{o=j().randomUUID()}try{f().mkdirSync(k.nJ,{recursive:!0}),f().writeFileSync(l,o,{mode:384})}catch{}return o}(),e="9r-cli-auth"===b?function(){if(p)return p;try{if(p=f().readFileSync(n,"utf8").trim())return p}catch{}p=j().randomBytes(32).toString("hex");try{f().mkdirSync(m,{recursive:!0}),f().writeFileSync(n,p,{mode:384})}catch{}return p}():"";return j().createHash("sha256").update(c+b+e).digest("hex").substring(0,16)}},78335:()=>{},96487:()=>{}};