@amir83nasr/10router 0.1.16 → 0.1.18

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 (240) hide show
  1. package/.next/BUILD_ID +1 -1
  2. package/.next/app-path-routes-manifest.json +5 -5
  3. package/.next/build-manifest.json +2 -2
  4. package/.next/prerender-manifest.json +3 -3
  5. package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page.js +1 -1
  6. package/.next/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  7. package/.next/server/app/(dashboard)/dashboard/cli-tools/page.js +1 -1
  8. package/.next/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  9. package/.next/server/app/(dashboard)/dashboard/combos/page.js +1 -1
  10. package/.next/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  11. package/.next/server/app/(dashboard)/dashboard/console-log/page.js +1 -1
  12. package/.next/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  13. package/.next/server/app/(dashboard)/dashboard/endpoint/page.js +1 -1
  14. package/.next/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  15. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page.js +1 -1
  16. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/[id]/page_client-reference-manifest.js +1 -1
  17. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page.js +1 -1
  18. package/.next/server/app/(dashboard)/dashboard/media-providers/systemone/page_client-reference-manifest.js +1 -1
  19. package/.next/server/app/(dashboard)/dashboard/page.js +1 -1
  20. package/.next/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  21. package/.next/server/app/(dashboard)/dashboard/profile/page.js +1 -1
  22. package/.next/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  23. package/.next/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  24. package/.next/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  25. package/.next/server/app/(dashboard)/dashboard/providers/new/page.js +1 -1
  26. package/.next/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  27. package/.next/server/app/(dashboard)/dashboard/providers/page.js +1 -1
  28. package/.next/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  29. package/.next/server/app/(dashboard)/dashboard/proxy-pools/page.js +1 -1
  30. package/.next/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  31. package/.next/server/app/(dashboard)/dashboard/pxpipe/page.js +1 -1
  32. package/.next/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  33. package/.next/server/app/(dashboard)/dashboard/quota/page.js +1 -1
  34. package/.next/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  35. package/.next/server/app/(dashboard)/dashboard/token-saver/page.js +1 -1
  36. package/.next/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  37. package/.next/server/app/(dashboard)/dashboard/usage/page.js +1 -1
  38. package/.next/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  39. package/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
  40. package/.next/server/app/_global-error.html +1 -1
  41. package/.next/server/app/_global-error.rsc +1 -1
  42. package/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  43. package/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  44. package/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  45. package/.next/server/app/_not-found/page.js +1 -1
  46. package/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
  47. package/.next/server/app/_not-found.html +1 -1
  48. package/.next/server/app/_not-found.rsc +5 -5
  49. package/.next/server/app/_not-found.segments/_full.segment.rsc +5 -5
  50. package/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +5 -5
  51. package/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  52. package/.next/server/app/api/cli-tools/all-statuses/route.js +1 -1
  53. package/.next/server/app/api/cli-tools/claude-settings/route.js +1 -1
  54. package/.next/server/app/api/cli-tools/codex-settings/route.js +1 -1
  55. package/.next/server/app/api/cli-tools/cowork-mcp-registry/route.js +1 -1
  56. package/.next/server/app/api/cli-tools/cowork-mcp-tools/route.js +1 -1
  57. package/.next/server/app/api/cli-tools/cowork-settings/route.js +1 -1
  58. package/.next/server/app/api/cli-tools/dsh-settings/route.js +1 -1
  59. package/.next/server/app/api/cli-tools/opencode-settings/route.js +1 -1
  60. package/.next/server/app/api/models/route.js +1 -1
  61. package/.next/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  62. package/.next/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  63. package/.next/server/app/api/oauth/codex/import-token/route.js +1 -1
  64. package/.next/server/app/api/providers/[id]/models/route.js +1 -1
  65. package/.next/server/app/api/providers/[id]/test/route.js +1 -1
  66. package/.next/server/app/api/providers/client/route.js +1 -1
  67. package/.next/server/app/api/providers/route.js +1 -1
  68. package/.next/server/app/api/providers/test-batch/route.js +1 -1
  69. package/.next/server/app/api/providers/validate/route.js +1 -1
  70. package/.next/server/app/api/settings/route.js +1 -1
  71. package/.next/server/app/api/translator/console-logs/route.js +1 -1
  72. package/.next/server/app/api/translator/console-logs/stream/route.js +1 -1
  73. package/.next/server/app/api/translator/send/route.js +1 -1
  74. package/.next/server/app/api/translator/translate/route.js +1 -1
  75. package/.next/server/app/api/tunnel/disable/route.js +1 -1
  76. package/.next/server/app/api/tunnel/enable/route.js +1 -1
  77. package/.next/server/app/api/tunnel/tailscale-disable/route.js +1 -1
  78. package/.next/server/app/api/tunnel/tailscale-enable/route.js +1 -1
  79. package/.next/server/app/api/tunnel/tailscale-install/route.js +2 -2
  80. package/.next/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  81. package/.next/server/app/api/usage/[connectionId]/route.js +1 -1
  82. package/.next/server/app/api/v1/api/chat/route.js +1 -1
  83. package/.next/server/app/api/v1/audio/speech/route.js +1 -1
  84. package/.next/server/app/api/v1/audio/transcriptions/route.js +1 -1
  85. package/.next/server/app/api/v1/chat/completions/route.js +1 -1
  86. package/.next/server/app/api/v1/embeddings/route.js +1 -1
  87. package/.next/server/app/api/v1/images/generations/route.js +1 -1
  88. package/.next/server/app/api/v1/messages/route.js +1 -1
  89. package/.next/server/app/api/v1/models/[...model]/route.js +1 -1
  90. package/.next/server/app/api/v1/models/route.js +1 -1
  91. package/.next/server/app/api/v1/responses/compact/route.js +1 -1
  92. package/.next/server/app/api/v1/responses/route.js +1 -1
  93. package/.next/server/app/api/v1/route.js +1 -1
  94. package/.next/server/app/api/v1/search/route.js +1 -1
  95. package/.next/server/app/api/v1/systemone/route.js +1 -1
  96. package/.next/server/app/api/v1/videos/[id]/route.js +1 -1
  97. package/.next/server/app/api/v1/videos/edits/route.js +1 -1
  98. package/.next/server/app/api/v1/videos/extensions/route.js +1 -1
  99. package/.next/server/app/api/v1/videos/generations/route.js +1 -1
  100. package/.next/server/app/api/v1/web/fetch/route.js +1 -1
  101. package/.next/server/app/api/v1beta/models/[...path]/route.js +1 -1
  102. package/.next/server/app/api/version/route.js +1 -1
  103. package/.next/server/app/callback/page.js +1 -1
  104. package/.next/server/app/callback/page_client-reference-manifest.js +1 -1
  105. package/.next/server/app/callback.html +1 -1
  106. package/.next/server/app/callback.rsc +5 -5
  107. package/.next/server/app/callback.segments/_full.segment.rsc +5 -5
  108. package/.next/server/app/callback.segments/_tree.segment.rsc +1 -1
  109. package/.next/server/app/callback.segments/callback/__PAGE__.segment.rsc +5 -5
  110. package/.next/server/app/dashboard/cli-tools.html +1 -1
  111. package/.next/server/app/dashboard/cli-tools.rsc +8 -8
  112. package/.next/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +7 -7
  113. package/.next/server/app/dashboard/cli-tools.segments/_full.segment.rsc +8 -8
  114. package/.next/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  115. package/.next/server/app/dashboard/combos.html +1 -1
  116. package/.next/server/app/dashboard/combos.rsc +7 -7
  117. package/.next/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +7 -7
  118. package/.next/server/app/dashboard/combos.segments/_full.segment.rsc +7 -7
  119. package/.next/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  120. package/.next/server/app/dashboard/endpoint.html +1 -1
  121. package/.next/server/app/dashboard/endpoint.rsc +8 -8
  122. package/.next/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +7 -7
  123. package/.next/server/app/dashboard/endpoint.segments/_full.segment.rsc +8 -8
  124. package/.next/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  125. package/.next/server/app/dashboard/media-providers/systemone.html +1 -1
  126. package/.next/server/app/dashboard/media-providers/systemone.rsc +7 -7
  127. package/.next/server/app/dashboard/media-providers/systemone.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/systemone/__PAGE__.segment.rsc +7 -7
  128. package/.next/server/app/dashboard/media-providers/systemone.segments/_full.segment.rsc +7 -7
  129. package/.next/server/app/dashboard/media-providers/systemone.segments/_tree.segment.rsc +1 -1
  130. package/.next/server/app/dashboard/profile.html +1 -1
  131. package/.next/server/app/dashboard/profile.rsc +7 -7
  132. package/.next/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +7 -7
  133. package/.next/server/app/dashboard/profile.segments/_full.segment.rsc +7 -7
  134. package/.next/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  135. package/.next/server/app/dashboard/providers/new.html +1 -1
  136. package/.next/server/app/dashboard/providers/new.rsc +7 -7
  137. package/.next/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +7 -7
  138. package/.next/server/app/dashboard/providers/new.segments/_full.segment.rsc +7 -7
  139. package/.next/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  140. package/.next/server/app/dashboard/providers.html +1 -1
  141. package/.next/server/app/dashboard/providers.rsc +7 -7
  142. package/.next/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +7 -7
  143. package/.next/server/app/dashboard/providers.segments/_full.segment.rsc +7 -7
  144. package/.next/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  145. package/.next/server/app/dashboard/proxy-pools.html +1 -1
  146. package/.next/server/app/dashboard/proxy-pools.rsc +7 -7
  147. package/.next/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +7 -7
  148. package/.next/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +7 -7
  149. package/.next/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  150. package/.next/server/app/dashboard/pxpipe.html +1 -1
  151. package/.next/server/app/dashboard/pxpipe.rsc +6 -6
  152. package/.next/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  153. package/.next/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  154. package/.next/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  155. package/.next/server/app/dashboard/quota.html +2 -2
  156. package/.next/server/app/dashboard/quota.rsc +8 -8
  157. package/.next/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +8 -8
  158. package/.next/server/app/dashboard/quota.segments/_full.segment.rsc +8 -8
  159. package/.next/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  160. package/.next/server/app/dashboard/settings/pricing/page.js +1 -1
  161. package/.next/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  162. package/.next/server/app/dashboard/settings/pricing.html +1 -1
  163. package/.next/server/app/dashboard/settings/pricing.rsc +5 -5
  164. package/.next/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +5 -5
  165. package/.next/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  166. package/.next/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +5 -5
  167. package/.next/server/app/dashboard/token-saver.html +1 -1
  168. package/.next/server/app/dashboard/token-saver.rsc +6 -6
  169. package/.next/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  170. package/.next/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  171. package/.next/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  172. package/.next/server/app/dashboard/usage.html +2 -2
  173. package/.next/server/app/dashboard/usage.rsc +7 -7
  174. package/.next/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +7 -7
  175. package/.next/server/app/dashboard/usage.segments/_full.segment.rsc +7 -7
  176. package/.next/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  177. package/.next/server/app/dashboard.html +1 -1
  178. package/.next/server/app/dashboard.rsc +8 -8
  179. package/.next/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +7 -7
  180. package/.next/server/app/dashboard.segments/_full.segment.rsc +8 -8
  181. package/.next/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  182. package/.next/server/app/index.html +1 -1
  183. package/.next/server/app/index.rsc +5 -5
  184. package/.next/server/app/index.segments/__PAGE__.segment.rsc +5 -5
  185. package/.next/server/app/index.segments/_full.segment.rsc +5 -5
  186. package/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  187. package/.next/server/app/landing/page.js +1 -1
  188. package/.next/server/app/landing/page_client-reference-manifest.js +1 -1
  189. package/.next/server/app/landing.html +1 -1
  190. package/.next/server/app/landing.rsc +5 -5
  191. package/.next/server/app/landing.segments/_full.segment.rsc +5 -5
  192. package/.next/server/app/landing.segments/_tree.segment.rsc +1 -1
  193. package/.next/server/app/landing.segments/landing/__PAGE__.segment.rsc +5 -5
  194. package/.next/server/app/login/page.js +1 -1
  195. package/.next/server/app/login/page_client-reference-manifest.js +1 -1
  196. package/.next/server/app/login.html +1 -1
  197. package/.next/server/app/login.rsc +5 -5
  198. package/.next/server/app/login.segments/_full.segment.rsc +5 -5
  199. package/.next/server/app/login.segments/_tree.segment.rsc +1 -1
  200. package/.next/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  201. package/.next/server/app/page.js +1 -1
  202. package/.next/server/app/page_client-reference-manifest.js +1 -1
  203. package/.next/server/app-paths-manifest.json +5 -5
  204. package/.next/server/chunks/1003.js +1 -1
  205. package/.next/server/chunks/1649.js +1 -1
  206. package/.next/server/chunks/1751.js +1 -1
  207. package/.next/server/chunks/2143.js +1 -1
  208. package/.next/server/chunks/2151.js +1 -1
  209. package/.next/server/chunks/2282.js +3 -3
  210. package/.next/server/chunks/2531.js +1 -1
  211. package/.next/server/chunks/2801.js +1 -1
  212. package/.next/server/chunks/3671.js +1 -1
  213. package/.next/server/chunks/6343.js +3 -3
  214. package/.next/server/chunks/6617.js +1 -1
  215. package/.next/server/chunks/7591.js +1 -1
  216. package/.next/server/chunks/7904.js +1 -1
  217. package/.next/server/chunks/9429.js +1 -1
  218. package/.next/server/middleware-build-manifest.js +1 -1
  219. package/.next/server/pages/404.html +1 -1
  220. package/.next/server/pages/500.html +1 -1
  221. package/.next/server/server-reference-manifest.js +1 -1
  222. package/.next/server/server-reference-manifest.json +1 -1
  223. package/.next/static/chunks/1660-084df607ff4f889d.js +1 -0
  224. package/.next/static/chunks/{6770-e2921b2ce695ed57.js → 6770-9e948c92e87956c4.js} +1 -1
  225. package/CHANGELOG.md +11 -0
  226. package/open-sse/config/opencodeGo.js +3 -2
  227. package/open-sse/executors/opencode-go.js +7 -0
  228. package/open-sse/executors/opencode.js +20 -0
  229. package/open-sse/handlers/chatCore.js +7 -14
  230. package/open-sse/providers/capabilities.js +30 -0
  231. package/open-sse/providers/models/helpers.js +14 -0
  232. package/open-sse/providers/registry/opencode-go.js +116 -31
  233. package/open-sse/services/lazyRuntime.js +110 -0
  234. package/open-sse/services/opencodeTlsClient.js +91 -0
  235. package/open-sse/services/provider.js +27 -0
  236. package/open-sse/utils/writableDataDir.js +32 -0
  237. package/package.json +1 -1
  238. package/.next/static/chunks/1660-c4c1cfa3cb7c9b2e.js +0 -1
  239. /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_buildManifest.js +0 -0
  240. /package/.next/static/{EsP8l_VAPRRfBiiJPJqQe → PyHCF87rmgiD0pV5fDUOP}/_ssgManifest.js +0 -0
@@ -1 +1 @@
1
- (()=>{var a={};a.id=3471,a.ids=[3471],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},18142:(a,b,c)=>{"use strict";c.d(b,{YW:()=>d.Page,pV:()=>d.CardGrid,wn:()=>d.Section,zY:()=>d.PageHeader}),c(73865),c(55204);var d=c(19509)},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30699:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u={children:["",{children:["(dashboard)",{children:["dashboard",{children:["profile",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,68519))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx"]}]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/profile/page",pathname:"/dashboard/profile",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47105:(a,b,c)=>{Promise.resolve().then(c.bind(c,68519))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60257:(a,b,c)=>{Promise.resolve().then(c.bind(c,99705))},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68519:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx\" 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.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx","default")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")},99705:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>r});var d=c(86240),e=c(70433),f=c(4271),g=c(63265),h=c(81501),i=c(83777),j=c(67209),k=c(36447),l=c(28907),m=c(70047),n=c(18142),o=c(59263),p=c(70369),q=c(99902);function r(){let a=(0,o.c)(),[b,c]=(0,e.useState)({fallbackStrategy:"fill-first"}),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)({current:"",new:"",confirm:""}),[v,w]=(0,e.useState)({type:"",message:""}),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)({type:"",message:""}),[D,E]=(0,e.useState)({open:!1,mode:"",password:""}),F=(0,e.useRef)(null),G=(0,e.useRef)(null),[H,I]=(0,e.useState)({outboundProxyEnabled:!1,outboundProxyPoolId:"",outboundProxyUrl:"",outboundNoProxy:""}),[J,K]=(0,e.useState)([]),[L,M]=(0,e.useState)({type:"",message:""}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),T=async a=>{if(a.preventDefault(),!0===b.outboundProxyEnabled){O(!0),M({type:"",message:""});try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyPoolId:H.outboundProxyPoolId||"",outboundProxyUrl:H.outboundProxyUrl,outboundNoProxy:H.outboundNoProxy})}),b=await a.json();a.ok?(c(a=>({...a,...b})),I(a=>({...a,outboundProxyPoolId:b?.outboundProxyPoolId??a.outboundProxyPoolId})),M({type:"success",message:"Proxy settings applied"})):M({type:"error",message:b.error||"Failed to update proxy settings"})}catch(a){M({type:"error",message:"An error occurred"})}finally{O(!1)}}},U=async()=>{if(!0!==b.outboundProxyEnabled)return;let a=(H.outboundProxyPoolId||"").trim(),c=(H.outboundProxyUrl||"").trim(),d=J.find(b=>b.id===a),e=a&&d?d.proxyUrl:c;if(a&&!d)return void M({type:"error",message:"Selected proxy pool no longer exists"});if(!e)return void M({type:"error",message:"Please select a proxy pool or enter a Proxy URL to test"});Q(!0),M({type:"",message:""});try{let a=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),b=await a.json();a.ok&&b?.ok?M({type:"success",message:`Proxy test OK (${b.status}) in ${b.elapsedMs}ms`}):M({type:"error",message:b?.error||"Proxy test failed"})}catch(a){M({type:"error",message:"An error occurred"})}finally{Q(!1)}},V=async a=>{O(!0),M({type:"",message:""});try{let b=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:a})}),d=await b.json();b.ok?(c(a=>({...a,...d})),I(a=>({...a,outboundProxyEnabled:d?.outboundProxyEnabled===!0})),M({type:"success",message:a?"Proxy enabled":"Proxy disabled"})):M({type:"error",message:d.error||"Failed to update proxy settings"})}catch(a){M({type:"error",message:"An error occurred"})}finally{O(!1)}},W=async a=>{if(a.preventDefault(),t.new!==t.confirm)return void w({type:"error",message:"Passwords do not match"});y(!0),w({type:"",message:""});try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:t.current,newPassword:t.new})}),b=await a.json();a.ok?(w({type:"success",message:"Password updated successfully"}),u({current:"",new:"",confirm:""})):w({type:"error",message:b.error||"Failed to update password"})}catch(a){w({type:"error",message:"An error occurred"})}finally{y(!1)}},X=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:a})})).ok&&c(b=>({...b,fallbackStrategy:a}))}catch(a){console.error("Failed to update settings:",a)}},Y=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:a})})).ok&&c(b=>({...b,comboStrategy:a}))}catch(a){console.error("Failed to update combo strategy:",a)}},Z=async a=>{let b=parseInt(a);if(!isNaN(b)&&!(b<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:b})})).ok&&c(a=>({...a,stickyRoundRobinLimit:b}))}catch(a){console.error("Failed to update sticky limit:",a)}},$=async a=>{let b=parseInt(a);if(!isNaN(b)&&!(b<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:b})})).ok&&c(a=>({...a,comboStickyRoundRobinLimit:b}))}catch(a){console.error("Failed to update combo sticky limit:",a)}},_=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:a})})).ok&&c(b=>({...b,requireLogin:a}))}catch(a){console.error("Failed to update require login:",a)}},aa=async()=>{try{let a=await fetch("/api/settings");if(!a.ok)return;let b=await a.json();c(b)}catch(a){console.error("Failed to reload settings:",a)}},ab=async a=>{A(!0),C({type:"",message:""});try{let b=await fetch("/api/settings/database",{headers:{"x-10r-password":a}});if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error||"Failed to export database")}let c=await b.json(),d=JSON.stringify(c,null,2),e=new Blob([d],{type:"application/json"}),f=URL.createObjectURL(e),g=document.createElement("a"),h=new Date().toISOString().replace(/[.:]/g,"-");g.href=f,g.download=`10router-backup-${h}.json`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f),C({type:"success",message:"Database backup downloaded"})}catch(a){C({type:"error",message:a.message||"Failed to export database"})}finally{A(!1)}},ac=async a=>{let b=F.current;if(b){A(!0);try{let c=await b.text(),d=JSON.parse(c),e=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...d,password:a})}),f=await e.json().catch(()=>({}));if(!e.ok)throw Error(f.error||"Failed to import database");await aa(),C({type:"success",message:"Database imported successfully"})}catch(a){C({type:"error",message:a.message||"Invalid backup file"})}finally{F.current=null,A(!1)}}},ad=async()=>{let{mode:a,password:b}=D;E({open:!1,mode:"",password:""}),"export"===a?await ab(b):"import"===a&&await ac(b)},ae=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsxs)(n.YW,{width:"narrow",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"computer",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Local Mode"}),(0,d.jsx)(f.BT,{children:"Running on your machine"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,d.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-background border border-border gap-2",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground font-mono break-all",children:"~/.10router/db/data.sqlite"})]})}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,d.jsxs)(g.$,{variant:"secondary",onClick:()=>E({open:!0,mode:"export",password:""}),disabled:z,className:"w-full sm:w-auto",children:[z?(0,d.jsx)(k.A,{className:"animate-spin"}):(0,d.jsx)(l.default,{name:"download"}),"Download Backup"]}),(0,d.jsxs)(g.$,{variant:"outline",onClick:()=>G.current?.click(),disabled:z,className:"w-full sm:w-auto",children:[(0,d.jsx)(l.default,{name:"upload"}),"Import Backup"]}),(0,d.jsx)("input",{ref:G,type:"file",accept:"application/json,.json",className:"hidden",onChange:a=>{let b=a.target.files?.[0];G.current&&(G.current.value=""),b&&(F.current=b,C({type:"",message:""}),E({open:!0,mode:"import",password:""}))}})]}),B.message&&(0,d.jsx)("p",{className:`text-sm ${"error"===B.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:B.message})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"shield",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Security"}),(0,d.jsx)(f.BT,{children:"Login and password settings"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,d.jsx)(p.d,{checked:!0===b.requireLogin,onCheckedChange:()=>_(!b.requireLogin),disabled:r})]}),!0===b.requireLogin&&(0,d.jsxs)("form",{onSubmit:W,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[b.hasPassword&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Enter current password",value:t.current,onChange:a=>u({...t,current:a.target.value}),required:!0})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Enter new password",value:t.new,onChange:a=>u({...t,new:a.target.value}),required:!0})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Confirm new password",value:t.confirm,onChange:a=>u({...t,confirm:a.target.value}),required:!0})]})]}),v.message&&(0,d.jsx)("p",{className:`text-xs sm:text-sm ${"error"===v.type?"text-red-500":"text-green-500"}`,children:v.message}),(0,d.jsx)("div",{className:"pt-2",children:(0,d.jsxs)(g.$,{type:"submit",disabled:x,className:"w-full sm:w-auto",children:[x&&(0,d.jsx)(k.A,{className:"animate-spin"}),b.hasPassword?"Update Password":"Set Password"]})})]})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"route",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Routing Strategy"}),(0,d.jsx)(f.BT,{children:"How requests distribute across accounts"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Cycle through accounts to distribute load"})]}),(0,d.jsx)(p.d,{checked:"round-robin"===b.fallbackStrategy,onCheckedChange:()=>X("round-robin"===b.fallbackStrategy?"fill-first":"round-robin"),disabled:r})]}),"round-robin"===b.fallbackStrategy&&(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Calls per account before switching"})]}),(0,d.jsx)(h.p,{type:"number",min:"1",max:"10",value:b.stickyRoundRobinLimit||3,onChange:a=>Z(a.target.value),disabled:r,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,d.jsx)(p.d,{checked:"round-robin"===b.comboStrategy,onCheckedChange:()=>Y("round-robin"===b.comboStrategy?"fallback":"round-robin"),disabled:r})]}),"round-robin"===b.comboStrategy&&(0,d.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Calls per combo model before switching"})]}),(0,d.jsx)(h.p,{type:"number",min:"1",max:"100",value:b.comboStickyRoundRobinLimit||1,onChange:a=>$(a.target.value),disabled:r,className:"w-20 text-center"})]}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground italic pt-2 border-t border-border/50",children:["round-robin"===b.fallbackStrategy?`Currently distributing requests across all available accounts with ${b.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===b.comboStrategy?` Combos rotate after ${b.comboStickyRoundRobinLimit||1} call${1===(b.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"wifi",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Network"}),(0,d.jsx)(f.BT,{children:"Outbound proxy for provider requests"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,d.jsx)(p.d,{checked:!0===b.outboundProxyEnabled,onCheckedChange:()=>V(!0!==b.outboundProxyEnabled),disabled:r||N})]}),!0===b.outboundProxyEnabled&&(0,d.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Proxy Pool"}),(0,d.jsxs)(i.l6,{value:H.outboundProxyPoolId||"__manual__",onValueChange:a=>I(b=>({...b,outboundProxyPoolId:"__manual__"===a?"":a})),disabled:r||N,children:[(0,d.jsx)(i.bq,{className:"w-full",children:(0,d.jsx)(i.yv,{placeholder:"Select an option"})}),(0,d.jsxs)(i.gC,{children:[(0,d.jsx)(i.eb,{value:"__manual__",children:"Manual URL (below)"}),J.filter(a=>"http"===(a?.type||"http")).map(a=>(0,d.jsx)(i.eb,{value:String(a.id),children:a.name},a.id))]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"An HTTP pool overrides the manual URL. Relay pools can't be a global proxy."}),0===J.filter(a=>"http"===(a?.type||"http")).length&&(0,d.jsxs)("p",{className:"text-xs text-amber-500",children:["No HTTP proxy pools yet —"," ",(0,d.jsx)("a",{href:"/dashboard/proxy-pools",className:"underline",children:"create one in Proxy Pools"}),"."]})]})}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,d.jsx)(h.p,{placeholder:"http://127.0.0.1:7897",value:H.outboundProxyUrl,onChange:a=>I(b=>({...b,outboundProxyUrl:a.target.value})),disabled:r||N||!!H.outboundProxyPoolId}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:H.outboundProxyPoolId?"Using the selected pool — clear it to edit the URL.":"Leave empty to inherit existing env proxy (if any)."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,d.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,d.jsx)(h.p,{placeholder:"localhost,127.0.0.1",value:H.outboundNoProxy,onChange:a=>I(b=>({...b,outboundNoProxy:a.target.value})),disabled:r||N||!!H.outboundProxyPoolId}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:H.outboundProxyPoolId?"Using the pool's No Proxy — clear the pool to edit.":"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,d.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,d.jsxs)(g.$,{type:"button",variant:"secondary",disabled:r||N||P,onClick:U,className:"w-full sm:w-auto",children:[P&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Test proxy URL"]}),(0,d.jsxs)(g.$,{type:"submit",disabled:N,className:"w-full sm:w-auto",children:[N&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Apply"]})]})]}),L.message&&(0,d.jsx)("p",{className:`text-xs sm:text-sm ${"error"===L.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:L.message})]})})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,d.jsxs)(g.$,{variant:"outline",onClick:()=>a.open(),className:"flex-1 text-red-500 border-red-200 hover:text-red-500 hover:bg-red-50 hover:border-red-300",children:[(0,d.jsx)(l.default,{name:"power_settings_new"}),"Shutdown"]}),(0,d.jsxs)(g.$,{variant:"outline",onClick:ae,className:"flex-1 hover:text-red-500 hover:bg-red-50 hover:border-red-300",children:[(0,d.jsx)(l.default,{name:"logout"}),"Logout"]})]}),(0,d.jsxs)("div",{className:"text-center text-xs sm:text-sm text-muted-foreground py-4",children:[(0,d.jsxs)("p",{children:[q.vQ.name," v",q.vQ.version]}),(0,d.jsx)("p",{className:"mt-1",children:R?"Remote Mode":"Local Mode - All data stored on your machine"})]})]}),(0,d.jsx)(m.default,{isOpen:a.confirmOpen||a.stopped||a.timedOut,onClose:a.reset,onConfirm:a.confirm,shuttingDown:a.shuttingDown,stopped:a.stopped,timedOut:a.timedOut}),(0,d.jsx)(j.lG,{open:D.open,onOpenChange:a=>{a||E({open:!1,mode:"",password:""})},children:(0,d.jsxs)(j.Cf,{className:"max-w-sm",children:[(0,d.jsx)(j.c7,{children:(0,d.jsx)(j.L3,{children:"Confirm Password"})}),(0,d.jsxs)("div",{className:"max-h-[calc(85vh-100px)] overflow-y-auto p-4",children:[(0,d.jsxs)("p",{className:"text-muted-foreground mb-3 text-sm",children:["Enter your current password to ","export"===D.mode?"export":"import"," the database."]}),(0,d.jsx)(h.p,{type:"password",value:D.password,onChange:a=>E(b=>({...b,password:a.target.value})),onKeyDown:a=>{"Enter"===a.key&&D.password&&ad()},placeholder:"Current password",autoFocus:!0})]}),(0,d.jsxs)(j.Es,{children:[(0,d.jsx)(g.$,{variant:"ghost",onClick:()=>E({open:!1,mode:"",password:""}),disabled:z,children:"Cancel"}),(0,d.jsxs)(g.$,{onClick:ad,disabled:z||!D.password,children:[z&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Confirm"]})]})]})})]})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,1751,7156,2339,6461,4301,1649,9018,2801],()=>b(b.s=30699));module.exports=c})();
1
+ (()=>{var a={};a.id=3471,a.ids=[3471],a.modules={643:a=>{"use strict";a.exports=require("node:perf_hooks")},1708:a=>{"use strict";a.exports=require("node:process")},3295:a=>{"use strict";a.exports=require("next/dist/server/app-render/after-task-async-storage.external.js")},4573:a=>{"use strict";a.exports=require("node:buffer")},7066:a=>{"use strict";a.exports=require("node:tty")},8128:a=>{"use strict";a.exports=require("next/dist/server/runtime-reacts.external.js")},10846:a=>{"use strict";a.exports=require("next/dist/compiled/next-server/app-page.runtime.prod.js")},14985:a=>{"use strict";a.exports=require("dns")},16698:a=>{"use strict";a.exports=require("node:async_hooks")},18142:(a,b,c)=>{"use strict";c.d(b,{YW:()=>d.Page,pV:()=>d.CardGrid,wn:()=>d.Section,zY:()=>d.PageHeader}),c(73865),c(55204);var d=c(19509)},19121:a=>{"use strict";a.exports=require("next/dist/server/app-render/action-async-storage.external.js")},21820:a=>{"use strict";a.exports=require("os")},27910:a=>{"use strict";a.exports=require("stream")},28354:a=>{"use strict";a.exports=require("util")},29021:a=>{"use strict";a.exports=require("fs")},29294:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-async-storage.external.js")},30699:(a,b,c)=>{"use strict";c.r(b),c.d(b,{__next_app__:()=>w,handler:()=>y,routeModule:()=>x});var d=c(26720),e=c(29966),f=c(36243),g=c(70310),h={};for(let a in g)0>["default","__next_app__","routeModule","handler"].indexOf(a)&&(h[a]=()=>g[a]);c.d(b,h);let i=(0,d.p)(()=>Promise.resolve().then(c.bind(c,79452))),j=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),k=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),l=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),m=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),n=(0,d.p)(()=>Promise.resolve().then(c.bind(c,11089))),o=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),p=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,2808,23))),q=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,8329,23))),r=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,41580,23))),s=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),t=(0,d.p)(()=>Promise.resolve().then(c.t.bind(c,67694,23))),u={children:["",{children:["(dashboard)",{children:["dashboard",{children:["profile",{children:["__PAGE__",{},{page:[(0,d.p)(()=>Promise.resolve().then(c.bind(c,68519))),"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx"]}]},{"global-error":[t,"next/dist/client/components/builtin/global-error.js"]},[]]},{"global-error":[s,"next/dist/client/components/builtin/global-error.js"]},[]]},{layout:[n,"/home/runner/work/10Router/10Router/src/app/(dashboard)/layout.tsx"],"global-error":[o,"next/dist/client/components/builtin/global-error.js"],"not-found":[p,"next/dist/client/components/builtin/not-found.js"],forbidden:[q,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[r,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]},{layout:[i,"/home/runner/work/10Router/10Router/src/app/layout.tsx"],"global-error":[j,"next/dist/client/components/builtin/global-error.js"],"not-found":[k,"next/dist/client/components/builtin/not-found.js"],forbidden:[l,"next/dist/client/components/builtin/forbidden.js"],unauthorized:[m,"next/dist/client/components/builtin/unauthorized.js"],metadata:{icon:[],apple:[],openGraph:[],twitter:[],manifest:"/manifest.webmanifest"}},[]]}.children,v=(0,e.H)({tree:u,page:"/(dashboard)/dashboard/profile/page",pathname:"/dashboard/profile",require:c,loadChunk:()=>Promise.resolve(),interopDefault:f.T}),w=v.__next_app__,x=v.routeModule,y=v.handler},31421:a=>{"use strict";a.exports=require("node:child_process")},32467:a=>{"use strict";a.exports=require("node:http2")},33873:a=>{"use strict";a.exports=require("path")},34589:a=>{"use strict";a.exports=require("node:assert")},37067:a=>{"use strict";a.exports=require("node:http")},37540:a=>{"use strict";a.exports=require("node:console")},38522:a=>{"use strict";a.exports=require("node:zlib")},40610:a=>{"use strict";a.exports=require("node:dns")},41025:a=>{"use strict";a.exports=require("next/dist/server/app-render/dynamic-access-async-storage.external.js")},41692:a=>{"use strict";a.exports=require("node:tls")},41792:a=>{"use strict";a.exports=require("node:querystring")},46060:a=>{"use strict";a.exports=require("next/dist/shared/lib/no-fallback-error.external.js")},46293:a=>{"use strict";a.exports=require("sql.js")},47105:(a,b,c)=>{Promise.resolve().then(c.bind(c,68519))},48161:a=>{"use strict";a.exports=require("node:os")},51455:a=>{"use strict";a.exports=require("node:fs/promises")},53053:a=>{"use strict";a.exports=require("node:diagnostics_channel")},55511:a=>{"use strict";a.exports=require("crypto")},55591:a=>{"use strict";a.exports=require("https")},57075:a=>{"use strict";a.exports=require("node:stream")},57975:a=>{"use strict";a.exports=require("node:util")},60257:(a,b,c)=>{Promise.resolve().then(c.bind(c,99705))},63033:a=>{"use strict";a.exports=require("next/dist/server/app-render/work-unit-async-storage.external.js")},68519:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>d});let d=(0,c(35062).registerClientReference)(function(){throw Error("Attempted to call the default export of \"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx\" 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.")},"/home/runner/work/10Router/10Router/src/app/(dashboard)/dashboard/profile/page.tsx","default")},71553:a=>{"use strict";a.exports=require("node:dns/promises")},71622:a=>{"use strict";a.exports=import("open")},73024:a=>{"use strict";a.exports=require("node:fs")},73136:a=>{"use strict";a.exports=require("node:url")},73429:a=>{"use strict";a.exports=require("node:util/types")},73496:a=>{"use strict";a.exports=require("http2")},74075:a=>{"use strict";a.exports=require("zlib")},75919:a=>{"use strict";a.exports=require("node:worker_threads")},76760:a=>{"use strict";a.exports=require("node:path")},77030:a=>{"use strict";a.exports=require("node:net")},77598:a=>{"use strict";a.exports=require("node:crypto")},78474:a=>{"use strict";a.exports=require("node:events")},79551:a=>{"use strict";a.exports=require("url")},79646:a=>{"use strict";a.exports=require("child_process")},79868:a=>{"use strict";a.exports=require("node:sqlite")},81630:a=>{"use strict";a.exports=require("http")},81787:a=>{"use strict";a.exports=require("bun:sqlite")},87997:a=>{"use strict";a.exports=require("node:timers")},91645:a=>{"use strict";a.exports=require("net")},94735:a=>{"use strict";a.exports=require("events")},99705:(a,b,c)=>{"use strict";c.r(b),c.d(b,{default:()=>r});var d=c(86240),e=c(70433),f=c(4271),g=c(63265),h=c(81501),i=c(83777),j=c(67209),k=c(36447),l=c(28907),m=c(70047),n=c(18142),o=c(59263),p=c(70369),q=c(99902);function r(){let a=(0,o.c)(),[b,c]=(0,e.useState)({fallbackStrategy:"fill-first"}),[r,s]=(0,e.useState)(!0),[t,u]=(0,e.useState)({current:"",new:"",confirm:""}),[v,w]=(0,e.useState)({type:"",message:""}),[x,y]=(0,e.useState)(!1),[z,A]=(0,e.useState)(!1),[B,C]=(0,e.useState)({type:"",message:""}),[D,E]=(0,e.useState)({open:!1,mode:"",password:""}),F=(0,e.useRef)(null),G=(0,e.useRef)(null),[H,I]=(0,e.useState)({outboundProxyEnabled:!1,outboundProxyPoolId:"",outboundProxyUrl:"",outboundNoProxy:""}),[J,K]=(0,e.useState)([]),[L,M]=(0,e.useState)({type:"",message:""}),[N,O]=(0,e.useState)(!1),[P,Q]=(0,e.useState)(!1),[R,S]=(0,e.useState)(!1),T=async a=>{if(a.preventDefault(),!0===b.outboundProxyEnabled){O(!0),M({type:"",message:""});try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyPoolId:H.outboundProxyPoolId||"",outboundProxyUrl:H.outboundProxyUrl,outboundNoProxy:H.outboundNoProxy})}),b=await a.json();a.ok?(c(a=>({...a,...b})),I(a=>({...a,outboundProxyPoolId:b?.outboundProxyPoolId??a.outboundProxyPoolId})),M({type:"success",message:"Proxy settings applied"})):M({type:"error",message:b.error||"Failed to update proxy settings"})}catch(a){M({type:"error",message:"An error occurred"})}finally{O(!1)}}},U=async()=>{if(!0!==b.outboundProxyEnabled)return;let a=(H.outboundProxyPoolId||"").trim(),c=(H.outboundProxyUrl||"").trim(),d=J.find(b=>b.id===a),e=a&&d?d.proxyUrl:c;if(a&&!d)return void M({type:"error",message:"Selected proxy pool no longer exists"});if(!e)return void M({type:"error",message:"Please select a proxy pool or enter a Proxy URL to test"});Q(!0),M({type:"",message:""});try{let a=await fetch("/api/settings/proxy-test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({proxyUrl:e})}),b=await a.json();a.ok&&b?.ok?M({type:"success",message:`Proxy test OK (${b.status}) in ${b.elapsedMs}ms`}):M({type:"error",message:b?.error||"Proxy test failed"})}catch(a){M({type:"error",message:"An error occurred"})}finally{Q(!1)}},V=async a=>{O(!0),M({type:"",message:""});try{let b=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({outboundProxyEnabled:a})}),d=await b.json();b.ok?(c(a=>({...a,...d})),I(a=>({...a,outboundProxyEnabled:d?.outboundProxyEnabled===!0})),M({type:"success",message:a?"Proxy enabled":"Proxy disabled"})):M({type:"error",message:d.error||"Failed to update proxy settings"})}catch(a){M({type:"error",message:"An error occurred"})}finally{O(!1)}},W=async a=>{if(a.preventDefault(),t.new!==t.confirm)return void w({type:"error",message:"Passwords do not match"});y(!0),w({type:"",message:""});try{let a=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({currentPassword:t.current,newPassword:t.new})}),b=await a.json();a.ok?(w({type:"success",message:"Password updated successfully"}),u({current:"",new:"",confirm:""})):w({type:"error",message:b.error||"Failed to update password"})}catch(a){w({type:"error",message:"An error occurred"})}finally{y(!1)}},X=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({fallbackStrategy:a})})).ok&&c(b=>({...b,fallbackStrategy:a}))}catch(a){console.error("Failed to update settings:",a)}},Y=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategy:a})})).ok&&c(b=>({...b,comboStrategy:a}))}catch(a){console.error("Failed to update combo strategy:",a)}},Z=async a=>{let b=parseInt(a);if(!isNaN(b)&&!(b<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({stickyRoundRobinLimit:b})})).ok&&c(a=>({...a,stickyRoundRobinLimit:b}))}catch(a){console.error("Failed to update sticky limit:",a)}},$=async a=>{let b=parseInt(a);if(!isNaN(b)&&!(b<1))try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStickyRoundRobinLimit:b})})).ok&&c(a=>({...a,comboStickyRoundRobinLimit:b}))}catch(a){console.error("Failed to update combo sticky limit:",a)}},_=async a=>{try{(await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({requireLogin:a})})).ok&&c(b=>({...b,requireLogin:a}))}catch(a){console.error("Failed to update require login:",a)}},aa=async()=>{try{let a=await fetch("/api/settings");if(!a.ok)return;let b=await a.json();c(b)}catch(a){console.error("Failed to reload settings:",a)}},ab=async a=>{A(!0),C({type:"",message:""});try{let b=await fetch("/api/settings/database",{headers:{"x-10r-password":a}});if(!b.ok){let a=await b.json().catch(()=>({}));throw Error(a.error||"Failed to export database")}let c=await b.json(),d=JSON.stringify(c,null,2),e=new Blob([d],{type:"application/json"}),f=URL.createObjectURL(e),g=document.createElement("a"),h=new Date().toISOString().replace(/[.:]/g,"-");g.href=f,g.download=`10router-backup-${h}.json`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(f),C({type:"success",message:"Database backup downloaded"})}catch(a){C({type:"error",message:a.message||"Failed to export database"})}finally{A(!1)}},ac=async a=>{let b=F.current;if(b){A(!0);try{let c=await b.text(),d=JSON.parse(c),e=await fetch("/api/settings/database",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({...d,password:a})}),f=await e.json().catch(()=>({}));if(!e.ok)throw Error(f.error||"Failed to import database");await aa(),C({type:"success",message:"Database imported successfully"})}catch(a){C({type:"error",message:a.message||"Invalid backup file"})}finally{F.current=null,A(!1)}}},ad=async()=>{let{mode:a,password:b}=D;E({open:!1,mode:"",password:""}),"export"===a?await ab(b):"import"===a&&await ac(b)},ae=async()=>{try{(await fetch("/api/auth/logout",{method:"POST"})).ok&&window.location.assign("/login")}catch(a){console.error("Failed to logout:",a)}};return(0,d.jsxs)(n.YW,{width:"narrow",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"computer",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Local Mode"}),(0,d.jsx)(f.BT,{children:"Running on your machine"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-3 pt-4 border-t border-border",children:[(0,d.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between p-3 rounded-lg bg-background border border-border gap-2",children:(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Database Location"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground font-mono break-all",children:"~/.10router/db/data.sqlite"})]})}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,d.jsxs)(g.$,{variant:"secondary",onClick:()=>E({open:!0,mode:"export",password:""}),disabled:z,className:"w-full sm:w-auto",children:[z?(0,d.jsx)(k.A,{className:"animate-spin"}):(0,d.jsx)(l.default,{name:"download"}),"Download Backup"]}),(0,d.jsxs)(g.$,{variant:"outline",onClick:()=>G.current?.click(),disabled:z,className:"w-full sm:w-auto",children:[(0,d.jsx)(l.default,{name:"upload"}),"Import Backup"]}),(0,d.jsx)("input",{ref:G,type:"file",accept:"application/json,.json",className:"hidden",onChange:a=>{let b=a.target.files?.[0];G.current&&(G.current.value=""),b&&(F.current=b,C({type:"",message:""}),E({open:!0,mode:"import",password:""}))}})]}),B.message&&(0,d.jsx)("p",{className:`text-sm ${"error"===B.type?"text-red-500":"text-green-600 dark:text-green-400"}`,children:B.message})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"shield",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Security"}),(0,d.jsx)(f.BT,{children:"Login and password settings"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Require login"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"When ON, dashboard requires password. When OFF, access without login."})]}),(0,d.jsx)(p.d,{checked:!0===b.requireLogin,onCheckedChange:()=>_(!b.requireLogin),disabled:r})]}),!0===b.requireLogin&&(0,d.jsxs)("form",{onSubmit:W,className:"flex flex-col gap-4 pt-4 border-t border-border/50",children:[b.hasPassword&&(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Current Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Enter current password",value:t.current,onChange:a=>u({...t,current:a.target.value}),required:!0})]}),(0,d.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"New Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Enter new password",value:t.new,onChange:a=>u({...t,new:a.target.value}),required:!0})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"text-xs sm:text-sm font-medium",children:"Confirm New Password"}),(0,d.jsx)(h.p,{type:"password",placeholder:"Confirm new password",value:t.confirm,onChange:a=>u({...t,confirm:a.target.value}),required:!0})]})]}),v.message&&(0,d.jsx)("p",{className:`text-xs sm:text-sm ${"error"===v.type?"text-red-500":"text-green-500"}`,children:v.message}),(0,d.jsx)("div",{className:"pt-2",children:(0,d.jsxs)(g.$,{type:"submit",disabled:x,className:"w-full sm:w-auto",children:[x&&(0,d.jsx)(k.A,{className:"animate-spin"}),b.hasPassword?"Update Password":"Set Password"]})})]})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"route",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Routing Strategy"}),(0,d.jsx)(f.BT,{children:"How requests distribute across accounts"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Round Robin"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Cycle through accounts to distribute load"})]}),(0,d.jsx)(p.d,{checked:"round-robin"===b.fallbackStrategy,onCheckedChange:()=>X("round-robin"===b.fallbackStrategy?"fill-first":"round-robin"),disabled:r})]}),"round-robin"===b.fallbackStrategy&&(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-2 border-t border-border/50",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Sticky Limit"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Calls per account before switching"})]}),(0,d.jsx)(h.p,{type:"number",min:"1",max:"10",value:b.stickyRoundRobinLimit||3,onChange:a=>Z(a.target.value),disabled:r,className:"w-16 sm:w-20 text-center shrink-0"})]}),(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4 pt-4 border-t border-border/50",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Combo Round Robin"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Cycle through providers in combos instead of always starting with first"})]}),(0,d.jsx)(p.d,{checked:"round-robin"===b.comboStrategy,onCheckedChange:()=>Y("round-robin"===b.comboStrategy?"fallback":"round-robin"),disabled:r})]}),"round-robin"===b.comboStrategy&&(0,d.jsxs)("div",{className:"flex items-center justify-between pt-2 border-t border-border/50",children:[(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"font-medium",children:"Combo Sticky Limit"}),(0,d.jsx)("p",{className:"text-sm text-muted-foreground",children:"Calls per combo model before switching"})]}),(0,d.jsx)(h.p,{type:"number",min:"1",max:"100",value:b.comboStickyRoundRobinLimit||1,onChange:a=>$(a.target.value),disabled:r,className:"w-20 text-center"})]}),(0,d.jsxs)("p",{className:"text-xs text-muted-foreground italic pt-2 border-t border-border/50",children:["round-robin"===b.fallbackStrategy?`Currently distributing requests across all available accounts with ${b.stickyRoundRobinLimit||3} calls per account.`:"Currently using accounts in priority order (Fill First).","round-robin"===b.comboStrategy?` Combos rotate after ${b.comboStickyRoundRobinLimit||1} call${1===(b.comboStickyRoundRobinLimit||1)?"":"s"} per model.`:" Combos always start with their first model."]})]})})]}),(0,d.jsxs)(f.Zp,{children:[(0,d.jsx)(f.aR,{children:(0,d.jsxs)("div",{className:"flex items-center gap-3",children:[(0,d.jsx)("div",{className:"p-2 rounded-[10px] bg-background text-muted-foreground",children:(0,d.jsx)(l.default,{name:"wifi",className:"text-[20px]"})}),(0,d.jsxs)("div",{children:[(0,d.jsx)(f.ZB,{children:"Network"}),(0,d.jsx)(f.BT,{children:"Outbound proxy for provider requests"})]})]})}),(0,d.jsx)(f.Wu,{children:(0,d.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,d.jsxs)("div",{className:"flex items-start sm:items-center justify-between gap-4",children:[(0,d.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,d.jsx)("p",{className:"font-medium text-sm sm:text-base",children:"Outbound Proxy"}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:"Enable proxy for OAuth + provider outbound requests."})]}),(0,d.jsx)(p.d,{checked:!0===b.outboundProxyEnabled,onCheckedChange:()=>V(!0!==b.outboundProxyEnabled),disabled:r||N})]}),!0===b.outboundProxyEnabled&&(0,d.jsxs)("form",{onSubmit:T,className:"flex flex-col gap-4 pt-2 border-t border-border/50",children:[(0,d.jsx)("div",{className:"flex flex-col gap-2",children:(0,d.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,d.jsx)("label",{className:"text-sm font-medium text-foreground",children:"Proxy Pool"}),(0,d.jsxs)(i.l6,{value:H.outboundProxyPoolId||"__manual__",onValueChange:a=>I(b=>({...b,outboundProxyPoolId:"__manual__"===a?"":a})),disabled:r||N,children:[(0,d.jsx)(i.bq,{className:"w-full",children:(0,d.jsx)(i.yv,{placeholder:"Select an option"})}),(0,d.jsxs)(i.gC,{children:[(0,d.jsx)(i.eb,{value:"__manual__",children:"Manual URL (below)"}),J.filter(a=>"http"===(a?.type||"http")).map(a=>(0,d.jsx)(i.eb,{value:String(a.id),children:a.name},a.id))]})]}),(0,d.jsx)("p",{className:"text-xs text-muted-foreground",children:"An HTTP pool overrides the manual URL. Relay pools can't be a global proxy."}),0===J.filter(a=>"http"===(a?.type||"http")).length&&(0,d.jsxs)("p",{className:"text-xs text-amber-500",children:["No HTTP proxy pools yet —"," ",(0,d.jsx)("a",{href:"/dashboard/proxy-pools",className:"underline",children:"create one in Proxy Pools"}),"."]})]})}),(0,d.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,d.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"Proxy URL"}),(0,d.jsx)(h.p,{placeholder:"http://127.0.0.1:7897",value:H.outboundProxyUrl,onChange:a=>I(b=>({...b,outboundProxyUrl:a.target.value})),disabled:r||N||!!H.outboundProxyPoolId}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:H.outboundProxyPoolId?"Using the selected pool — clear it to edit the URL.":"Leave empty to inherit existing env proxy (if any)."})]}),(0,d.jsxs)("div",{className:"flex flex-col gap-2 pt-2 border-t border-border/50",children:[(0,d.jsx)("label",{className:"font-medium text-sm sm:text-base",children:"No Proxy"}),(0,d.jsx)(h.p,{placeholder:"localhost,127.0.0.1",value:H.outboundNoProxy,onChange:a=>I(b=>({...b,outboundNoProxy:a.target.value})),disabled:r||N||!!H.outboundProxyPoolId}),(0,d.jsx)("p",{className:"text-xs sm:text-sm text-muted-foreground",children:H.outboundProxyPoolId?"Using the pool's No Proxy — clear the pool to edit.":"Comma-separated hostnames/domains to bypass the proxy."})]}),(0,d.jsxs)("div",{className:"pt-2 border-t border-border/50 flex flex-col sm:flex-row items-stretch sm:items-center gap-2",children:[(0,d.jsxs)(g.$,{type:"button",variant:"secondary",disabled:r||N||P,onClick:U,className:"w-full sm:w-auto",children:[P&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Test proxy URL"]}),(0,d.jsxs)(g.$,{type:"submit",disabled:N,className:"w-full sm:w-auto",children:[N&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Apply"]})]})]}),L.message&&(0,d.jsx)("p",{className:`text-xs sm:text-sm ${"error"===L.type?"text-red-500":"text-green-500"} pt-2 border-t border-border/50`,children:L.message})]})})]}),(0,d.jsxs)("div",{className:"flex flex-col sm:flex-row gap-2",children:[(0,d.jsxs)(g.$,{variant:"outline",onClick:()=>a.open(),className:"flex-1 text-red-500 border-red-200 hover:text-red-500 hover:bg-red-50 hover:border-red-300",children:[(0,d.jsx)(l.default,{name:"power_settings_new"}),"Shutdown"]}),(0,d.jsxs)(g.$,{variant:"outline",onClick:ae,className:"flex-1 hover:text-red-500 hover:bg-red-50 hover:border-red-300",children:[(0,d.jsx)(l.default,{name:"logout"}),"Logout"]})]}),(0,d.jsxs)("div",{className:"text-center text-xs sm:text-sm text-muted-foreground py-4",children:[(0,d.jsxs)("p",{children:[q.vQ.name," v",q.vQ.version]}),(0,d.jsx)("p",{className:"mt-1",children:R?"Remote Mode":"Local Mode - All data stored on your machine"})]})]}),(0,d.jsx)(m.default,{isOpen:a.confirmOpen||a.stopped||a.timedOut,onClose:a.reset,onConfirm:a.confirm,shuttingDown:a.shuttingDown,stopped:a.stopped,timedOut:a.timedOut}),(0,d.jsx)(j.lG,{open:D.open,onOpenChange:a=>{a||E({open:!1,mode:"",password:""})},children:(0,d.jsxs)(j.Cf,{className:"max-w-sm",children:[(0,d.jsx)(j.c7,{children:(0,d.jsx)(j.L3,{children:"Confirm Password"})}),(0,d.jsxs)("div",{className:"max-h-[calc(85vh-100px)] overflow-y-auto p-4",children:[(0,d.jsxs)("p",{className:"text-muted-foreground mb-3 text-sm",children:["Enter your current password to ","export"===D.mode?"export":"import"," the database."]}),(0,d.jsx)(h.p,{type:"password",value:D.password,onChange:a=>E(b=>({...b,password:a.target.value})),onKeyDown:a=>{"Enter"===a.key&&D.password&&ad()},placeholder:"Current password",autoFocus:!0})]}),(0,d.jsxs)(j.Es,{children:[(0,d.jsx)(g.$,{variant:"ghost",onClick:()=>E({open:!1,mode:"",password:""}),disabled:z,children:"Cancel"}),(0,d.jsxs)(g.$,{onClick:ad,disabled:z||!D.password,children:[z&&(0,d.jsx)(k.A,{className:"animate-spin"}),"Confirm"]})]})]})})]})}}};var b=require("../../../../webpack-runtime.js");b.C(a);var c=b.X(0,[1316,1238,7963,8569,7257,6009,9817,7535,1751,7156,2339,6461,4301,1649,9018,2801],()=>b(b.s=30699));module.exports=c})();