ekarouter 1.0.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 (242) hide show
  1. package/README.md +36 -0
  2. package/bin/cli.js +192 -0
  3. package/binaries/ekarouter-linux-amd64 +0 -0
  4. package/binaries/ekarouter-windows-amd64.exe +0 -0
  5. package/package.json +36 -0
  6. package/public/apple-touch-icon.png +0 -0
  7. package/public/assets/LoginView-CSzx0ltN.js +1 -0
  8. package/public/assets/OrangeSwitch-Dc_G3ztN.js +1 -0
  9. package/public/assets/QueryClientProvider-BjElddVn.js +1 -0
  10. package/public/assets/_id-BC10EHRw.js +4 -0
  11. package/public/assets/_id-CnBJVbQB.js +2 -0
  12. package/public/assets/api-lXjeGSiV.js +2 -0
  13. package/public/assets/bot-mZlhzHVu.js +1 -0
  14. package/public/assets/boxes-DXduN63I.js +1 -0
  15. package/public/assets/callback-D2O49UZw.js +2 -0
  16. package/public/assets/callback-pJodpDyd.js +1 -0
  17. package/public/assets/check-36OnHiEM.js +1 -0
  18. package/public/assets/chevron-down-DxUrtHFo.js +1 -0
  19. package/public/assets/chevron-right-CHJcvRU6.js +1 -0
  20. package/public/assets/circle-alert-CcGnUa7l.js +1 -0
  21. package/public/assets/cli-tools-DCOrwuor.js +21 -0
  22. package/public/assets/cloud-upload-D41DfGnv.js +1 -0
  23. package/public/assets/code-xml-BsvsUoDv.js +1 -0
  24. package/public/assets/combos-Df1jA7_R.js +1 -0
  25. package/public/assets/console-log-Bl-Kc0eo.js +2 -0
  26. package/public/assets/copy-B1k2VT2A.js +1 -0
  27. package/public/assets/createLucideIcon-CLdWFMku.js +1 -0
  28. package/public/assets/dialog-B56WVEML.js +41 -0
  29. package/public/assets/dist-yiyhte89.js +1 -0
  30. package/public/assets/endpoint-C-3fXtUc.js +36 -0
  31. package/public/assets/external-link-BYVStqz6.js +1 -0
  32. package/public/assets/eye-Cbs9C6DS.js +1 -0
  33. package/public/assets/eye-off-DIe2-cve.js +1 -0
  34. package/public/assets/file-text-BRzD_S8I.js +1 -0
  35. package/public/assets/flask-conical-CoRklKsr.js +1 -0
  36. package/public/assets/globe-hcLYcRzz.js +1 -0
  37. package/public/assets/hard-drive-Dakvr_if.js +1 -0
  38. package/public/assets/headerSearch-C758FsaX.js +1 -0
  39. package/public/assets/image-B10s4838.js +1 -0
  40. package/public/assets/jsx-runtime-B-hcVAMW.js +1 -0
  41. package/public/assets/key-BXUPFSjV.js +1 -0
  42. package/public/assets/kit-DGWILC5k.js +1 -0
  43. package/public/assets/laptop-D_8f9_v7.js +1 -0
  44. package/public/assets/layers-C_9oEa0w.js +1 -0
  45. package/public/assets/loader-circle-NEOay2w5.js +1 -0
  46. package/public/assets/lock-Chb45-Rn.js +1 -0
  47. package/public/assets/log-out-wyRkCSAT.js +1 -0
  48. package/public/assets/login-BuQTIKrL.js +1 -0
  49. package/public/assets/media-providers-C_wofVbG.js +1 -0
  50. package/public/assets/mic-D6DQAnIR.js +1 -0
  51. package/public/assets/network-D0tNT-6h.js +1 -0
  52. package/public/assets/pencil-CFgylVBP.js +1 -0
  53. package/public/assets/play-CPV0a6Tn.js +1 -0
  54. package/public/assets/playground-BIwkZcr_.js +67 -0
  55. package/public/assets/plus-qKI-KwZh.js +1 -0
  56. package/public/assets/preload-helper-CzRBhNKp.js +1 -0
  57. package/public/assets/providers-D8WoK8lA.js +1 -0
  58. package/public/assets/providersData-lrEpUDQM.js +1 -0
  59. package/public/assets/proxy-pools-BusHbtGD.js +5 -0
  60. package/public/assets/react-dom-8HkkFvw6.js +1 -0
  61. package/public/assets/refresh-cw-CHzni4H4.js +1 -0
  62. package/public/assets/routes-r_aF-Xnw.js +1 -0
  63. package/public/assets/search-BtJsgOj6.js +1 -0
  64. package/public/assets/server-CAbKLNFx.js +1 -0
  65. package/public/assets/settings-Tk-iCnFy.js +1 -0
  66. package/public/assets/shield-CMYlc0qf.js +1 -0
  67. package/public/assets/skills-D0d-ShKH.js +1 -0
  68. package/public/assets/spa-Bs7oEq98.js +10 -0
  69. package/public/assets/sparkles-DZ5Pl1vD.js +1 -0
  70. package/public/assets/styles-BSGa23zc.css +2 -0
  71. package/public/assets/terminal-BkaGpO2M.js +1 -0
  72. package/public/assets/theme-o081sJEj.js +1 -0
  73. package/public/assets/token-saver-DgfF_Mvq.js +1 -0
  74. package/public/assets/trash-2-D9HI9O7Q.js +1 -0
  75. package/public/assets/triangle-alert-DUFscLic.js +1 -0
  76. package/public/assets/upload--8EEkrQJ.js +1 -0
  77. package/public/assets/usage-D2lS5DQa.js +56 -0
  78. package/public/assets/useNavigate-D06Ztr27.js +1 -0
  79. package/public/assets/useQuery-BrM5_EQu.js +1 -0
  80. package/public/assets/utils-B6KiDbIe.js +1 -0
  81. package/public/assets/volume-2-DoDae9nb.js +1 -0
  82. package/public/assets/wifi-Bsq09YFd.js +1 -0
  83. package/public/assets/x-CGuQtexA.js +1 -0
  84. package/public/assets/zap-BS7lyU9U.js +1 -0
  85. package/public/favicon-16x16.png +0 -0
  86. package/public/favicon-32x32.png +0 -0
  87. package/public/favicon.ico +0 -0
  88. package/public/favicon.png +0 -0
  89. package/public/favicon.svg +3 -0
  90. package/public/icon-192.png +0 -0
  91. package/public/icon-512.png +0 -0
  92. package/public/icon.png +0 -0
  93. package/public/icons.svg +24 -0
  94. package/public/index.html +55 -0
  95. package/public/logo-icon-dark.svg +28 -0
  96. package/public/logo.png +0 -0
  97. package/public/providers/agentrouter.png +0 -0
  98. package/public/providers/alicode-intl.png +0 -0
  99. package/public/providers/alicode.png +0 -0
  100. package/public/providers/alims-intl.png +0 -0
  101. package/public/providers/alitp-intl.png +0 -0
  102. package/public/providers/amp.png +0 -0
  103. package/public/providers/anthropic-m.png +0 -0
  104. package/public/providers/anthropic.png +0 -0
  105. package/public/providers/antigravity.png +0 -0
  106. package/public/providers/api-airforce.png +0 -0
  107. package/public/providers/assemblyai.png +0 -0
  108. package/public/providers/aws-polly.png +0 -0
  109. package/public/providers/azure.png +0 -0
  110. package/public/providers/baidu.png +0 -0
  111. package/public/providers/bazaarlink.png +0 -0
  112. package/public/providers/black-forest-labs.png +0 -0
  113. package/public/providers/blackbox.png +0 -0
  114. package/public/providers/bluesminds.png +0 -0
  115. package/public/providers/brave-search.png +0 -0
  116. package/public/providers/bynara.svg +28 -0
  117. package/public/providers/byteplus.png +0 -0
  118. package/public/providers/cartesia.png +0 -0
  119. package/public/providers/cerebras.png +0 -0
  120. package/public/providers/chutes.png +0 -0
  121. package/public/providers/claude.png +0 -0
  122. package/public/providers/cline.png +0 -0
  123. package/public/providers/clinepass.png +0 -0
  124. package/public/providers/cloudflare-ai.png +0 -0
  125. package/public/providers/codebuddy-cn.png +0 -0
  126. package/public/providers/codebuddy-intl.png +0 -0
  127. package/public/providers/codex.png +0 -0
  128. package/public/providers/cohere.png +0 -0
  129. package/public/providers/comfyui.png +0 -0
  130. package/public/providers/commandcode.png +0 -0
  131. package/public/providers/continue.png +0 -0
  132. package/public/providers/copilot.png +0 -0
  133. package/public/providers/coqui.png +0 -0
  134. package/public/providers/cursor.png +0 -0
  135. package/public/providers/deepgram.png +0 -0
  136. package/public/providers/deepseek-tui.png +0 -0
  137. package/public/providers/deepseek.png +0 -0
  138. package/public/providers/devin-cli.png +0 -0
  139. package/public/providers/droid.png +0 -0
  140. package/public/providers/edge-tts.png +0 -0
  141. package/public/providers/elevenlabs.png +0 -0
  142. package/public/providers/exa.png +0 -0
  143. package/public/providers/fal-ai.png +0 -0
  144. package/public/providers/featherless.png +0 -0
  145. package/public/providers/firecrawl.png +0 -0
  146. package/public/providers/fireworks.png +0 -0
  147. package/public/providers/fish-audio.png +0 -0
  148. package/public/providers/gemini-cli.png +0 -0
  149. package/public/providers/gemini.png +0 -0
  150. package/public/providers/github.png +0 -0
  151. package/public/providers/gitlab.png +0 -0
  152. package/public/providers/glm-cn.png +0 -0
  153. package/public/providers/glm.png +0 -0
  154. package/public/providers/google-pse.png +0 -0
  155. package/public/providers/google-tts.png +0 -0
  156. package/public/providers/grok-cli.png +0 -0
  157. package/public/providers/grok-web.png +0 -0
  158. package/public/providers/groq.png +0 -0
  159. package/public/providers/hermes.png +0 -0
  160. package/public/providers/huggingface.png +0 -0
  161. package/public/providers/hyperbolic.png +0 -0
  162. package/public/providers/iflow.png +0 -0
  163. package/public/providers/inworld.png +0 -0
  164. package/public/providers/jcode.png +0 -0
  165. package/public/providers/jina-ai.png +0 -0
  166. package/public/providers/jina-reader.png +0 -0
  167. package/public/providers/kilo-gateway.png +0 -0
  168. package/public/providers/kilocode.png +0 -0
  169. package/public/providers/kimchi.png +0 -0
  170. package/public/providers/kimchi.svg +4 -0
  171. package/public/providers/kimi-coding.png +0 -0
  172. package/public/providers/kimi.png +0 -0
  173. package/public/providers/kiro.png +0 -0
  174. package/public/providers/linkup.png +0 -0
  175. package/public/providers/llm7.png +0 -0
  176. package/public/providers/local-device.png +0 -0
  177. package/public/providers/longcat.png +0 -0
  178. package/public/providers/mimo-free.png +0 -0
  179. package/public/providers/minimax-cn.png +0 -0
  180. package/public/providers/minimax.png +0 -0
  181. package/public/providers/mistral.png +0 -0
  182. package/public/providers/mmf.png +0 -0
  183. package/public/providers/morph.png +0 -0
  184. package/public/providers/nanobanana.png +0 -0
  185. package/public/providers/nara.svg +28 -0
  186. package/public/providers/nebius.png +0 -0
  187. package/public/providers/novita.png +0 -0
  188. package/public/providers/nvidia.png +0 -0
  189. package/public/providers/oai-cc.png +0 -0
  190. package/public/providers/oai-r.png +0 -0
  191. package/public/providers/ollama-local.png +0 -0
  192. package/public/providers/ollama.png +0 -0
  193. package/public/providers/openai.png +0 -0
  194. package/public/providers/openclaw.png +0 -0
  195. package/public/providers/opencode-go.png +0 -0
  196. package/public/providers/opencode.png +0 -0
  197. package/public/providers/opendesign.png +0 -0
  198. package/public/providers/openrouter.png +0 -0
  199. package/public/providers/perplexity-agent.png +0 -0
  200. package/public/providers/perplexity-web.png +0 -0
  201. package/public/providers/perplexity.png +0 -0
  202. package/public/providers/playht.png +0 -0
  203. package/public/providers/poolside.png +0 -0
  204. package/public/providers/qoder.png +0 -0
  205. package/public/providers/qwen.png +0 -0
  206. package/public/providers/recraft.png +0 -0
  207. package/public/providers/reka.png +0 -0
  208. package/public/providers/roo.png +0 -0
  209. package/public/providers/runwayml.png +0 -0
  210. package/public/providers/sambanova.png +0 -0
  211. package/public/providers/sdwebui.png +0 -0
  212. package/public/providers/searchapi.png +0 -0
  213. package/public/providers/searxng.png +0 -0
  214. package/public/providers/selfhosted-embedding.png +0 -0
  215. package/public/providers/selfhosted-stt.png +0 -0
  216. package/public/providers/selfhosted-tts.png +0 -0
  217. package/public/providers/serper.png +0 -0
  218. package/public/providers/siliconflow.png +0 -0
  219. package/public/providers/stability-ai.png +0 -0
  220. package/public/providers/tavily.png +0 -0
  221. package/public/providers/tencent.png +0 -0
  222. package/public/providers/together.png +0 -0
  223. package/public/providers/tokenrouter.png +0 -0
  224. package/public/providers/topaz.png +0 -0
  225. package/public/providers/tortoise.png +0 -0
  226. package/public/providers/trae.png +0 -0
  227. package/public/providers/venice.png +0 -0
  228. package/public/providers/vercel-ai-gateway.png +0 -0
  229. package/public/providers/vercel.png +0 -0
  230. package/public/providers/vertex-partner.png +0 -0
  231. package/public/providers/vertex.png +0 -0
  232. package/public/providers/volcengine-ark.png +0 -0
  233. package/public/providers/voyage-ai.png +0 -0
  234. package/public/providers/windsurf.png +0 -0
  235. package/public/providers/workbuddy.png +0 -0
  236. package/public/providers/xai.png +0 -0
  237. package/public/providers/xiaomi-mimo.png +0 -0
  238. package/public/providers/xiaomi-tokenplan.png +0 -0
  239. package/public/providers/xquik.png +0 -0
  240. package/public/providers/youcom.png +0 -0
  241. package/public/providers/zed.png +0 -0
  242. package/public/robots.txt +14 -0
@@ -0,0 +1,5 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as ee}from"./useQuery-BrM5_EQu.js";import{n as te}from"./QueryClientProvider-BjElddVn.js";import{n as r,r as i}from"./api-lXjeGSiV.js";import{t as a}from"./createLucideIcon-CLdWFMku.js";import{t as ne}from"./chevron-down-DxUrtHFo.js";import{t as o}from"./flask-conical-CoRklKsr.js";import{a as re,c as ie,d as ae,l as s,n as c,o as oe,r as se,s as l,t as u,u as d}from"./kit-DGWILC5k.js";import{t as ce}from"./network-D0tNT-6h.js";import{t as le}from"./pencil-CFgylVBP.js";import{t as ue}from"./plus-qKI-KwZh.js";import{t as de}from"./terminal-BkaGpO2M.js";import{t as fe}from"./trash-2-D9HI9O7Q.js";import{t as pe}from"./upload--8EEkrQJ.js";import{t as f}from"./utils-B6KiDbIe.js";import{n as me}from"./dist-yiyhte89.js";var he=a(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),ge=a(`rocket`,[[`path`,{d:`M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5`,key:`qeys4`}],[`path`,{d:`M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09`,key:`u4xsad`}],[`path`,{d:`M9 12a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.4 22.4 0 0 1-4 2z`,key:`676m9`}],[`path`,{d:`M9 12H4s.55-3.03 2-4c1.62-1.08 5 .05 5 .05`,key:`92ym6u`}]]),_e=a(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),p=e(t()),m=n();function h(){let e=te(),[t,n]=(0,p.useState)(!1),[a,h]=(0,p.useState)(!1),[g,_]=(0,p.useState)(!1),[ve,v]=(0,p.useState)(!1),[ye,y]=(0,p.useState)(!1),[be,b]=(0,p.useState)(!1),[x,S]=(0,p.useState)(null),[C,w]=(0,p.useState)(``),[T,E]=(0,p.useState)(`socks5`),[D,O]=(0,p.useState)(``),[k,A]=(0,p.useState)(``),[j,M]=(0,p.useState)(null),[N,P]=(0,p.useState)(null),[F,I]=(0,p.useState)(!1),[L,R]=(0,p.useState)(null),[z,B]=(0,p.useState)([]),[xe,V]=(0,p.useState)(!1),[H,U]=(0,p.useState)({accountId:``,apiToken:``,projectName:`cloudflare-relay`}),[W,G]=(0,p.useState)({vercelToken:``,projectName:`vercel-relay`}),[K,Se]=(0,p.useState)({denoToken:``,orgDomain:``,projectName:`deno-relay`}),[q,J]=(0,p.useState)(!1),Y=(0,p.useRef)(null);(0,p.useEffect)(()=>{let e=e=>{Y.current&&!Y.current.contains(e.target)&&_(!1)};return g&&document.addEventListener(`mousedown`,e),()=>document.removeEventListener(`mousedown`,e)},[g]);let X=ee({queryKey:[`proxy-pools`],queryFn:r.proxyPools,retry:!1}),Z=X.data??[],Q=()=>e.invalidateQueries({queryKey:[`proxy-pools`]}),Ce=Z.filter(e=>e.isActive).length,$=Z.length>0&&z.length===Z.length,we=()=>{B($?[]:Z.map(e=>e.id))},Te=e=>{B(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},Ee=async e=>{let t=!e.isActive;try{await r.updateProxyPool(e.id,{isActive:t}),Q()}catch{Q()}},De=async()=>{M(null);try{let e=D.split(`
2
+ `).map(e=>e.trim()).filter(Boolean);await r.createProxyPool({name:C.trim(),isActive:!0,data:{type:T,proxies:e}}),n(!1),w(``),O(``),Q()}catch(e){M(i(e))}},Oe=async()=>{if(x){M(null);try{let e=D.split(`
3
+ `).map(e=>e.trim()).filter(Boolean);await r.updateProxyPool(x.id,{name:C.trim(),data:{type:T,proxies:e}}),S(null),w(``),O(``),Q()}catch(e){M(i(e))}}},ke=e=>{S(e),w(e.name||``),E(e.type||`socks5`),O((e.proxies||[]).join(`
4
+ `)),M(null)},Ae=async e=>{try{await r.deleteProxyPool(e.id),B(t=>t.filter(t=>t!==e.id)),Q()}catch(e){alert(`Failed to delete: ${i(e)}`)}},je=async()=>{if(z.length){V(!0);try{for(let e of z)await r.deleteProxyPool(e).catch(()=>null);B([]),Q()}finally{V(!1)}}},Me=async e=>{P(e);try{await r.testProxyPool(e),Q()}catch(e){me.error(`Gagal menguji proxy pool: ${i(e)}`)}finally{P(null)}};return(0,m.jsxs)(`div`,{className:`space-y-6`,children:[(0,m.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,m.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,m.jsxs)(`div`,{className:`relative`,ref:Y,children:[(0,m.jsxs)(c,{size:`sm`,variant:`secondary`,onClick:()=>_(!g),icon:(0,m.jsx)(ge,{className:`h-3.5 w-3.5 text-orange-400`}),children:[(0,m.jsx)(`span`,{children:`Deploy Relay`}),(0,m.jsx)(ne,{className:`h-3.5 w-3.5 ml-0.5 text-zinc-400`})]}),g&&(0,m.jsxs)(`div`,{className:`absolute right-0 top-full z-50 mt-1 w-52 rounded-xl border border-[#2f3545] bg-[#1a1d25] p-1.5 shadow-2xl animate-in fade-in`,children:[(0,m.jsxs)(`button`,{type:`button`,onClick:()=>{v(!0),_(!1)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-xs text-zinc-200 hover:bg-white/5 transition-colors`,children:[(0,m.jsx)(he,{className:`h-4 w-4 text-orange-400`}),`Cloudflare Relay`]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>{y(!0),_(!1)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-xs text-zinc-200 hover:bg-white/5 transition-colors`,children:[(0,m.jsx)(_e,{className:`h-4 w-4 text-blue-400`}),`Vercel Relay`]}),(0,m.jsxs)(`button`,{type:`button`,onClick:()=>{b(!0),_(!1)},className:`flex w-full items-center gap-2 rounded-lg px-3 py-2 text-xs text-zinc-200 hover:bg-white/5 transition-colors`,children:[(0,m.jsx)(de,{className:`h-4 w-4 text-emerald-400`}),`Deno Relay`]})]})]}),(0,m.jsx)(c,{size:`sm`,variant:`secondary`,disabled:F||Z.length===0,onClick:async()=>{if(!(F||Z.length===0)){I(!0),R({current:0,total:Z.length});try{for(let e=0;e<Z.length;e++){let t=Z[e];t&&(R({current:e+1,total:Z.length}),await r.testProxyPool(t.id).catch(()=>null))}Q()}finally{I(!1),R(null)}}},icon:(0,m.jsx)(o,{className:f(`h-3.5 w-3.5 text-orange-400`,F&&`animate-spin`)}),children:F&&L?`Testing ${L.current}/${L.total}`:`Test All`}),(0,m.jsx)(c,{size:`sm`,variant:`secondary`,onClick:()=>{A(``),M(null),h(!0)},icon:(0,m.jsx)(pe,{className:`h-3.5 w-3.5`}),children:`Batch Import`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,onClick:()=>{w(``),E(`socks5`),O(``),M(null),n(!0)},icon:(0,m.jsx)(ue,{className:`h-3.5 w-3.5`}),children:`Add Proxy Pool`})]})}),(0,m.jsxs)(se,{padding:`md`,children:[(0,m.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center justify-between gap-3 border-b border-white/[0.06] pb-3.5`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-3`,children:[Z.length>0&&(0,m.jsxs)(`label`,{className:`flex items-center gap-2 text-xs text-zinc-400 hover:text-white cursor-pointer select-none`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:$,onChange:we,className:`h-4 w-4 rounded border-zinc-700 bg-zinc-800 text-orange-500 focus:ring-0 focus:ring-offset-0 cursor-pointer`}),(0,m.jsx)(`span`,{children:$?`Unselect all`:`Select all`})]}),(0,m.jsxs)(u,{variant:`default`,size:`sm`,children:[`Total: `,Z.length]}),(0,m.jsxs)(u,{variant:`success`,size:`sm`,dot:!0,children:[`Active: `,Ce]})]}),z.length>0&&(0,m.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,m.jsxs)(`span`,{className:`text-xs font-medium text-orange-400`,children:[z.length,` selected`]}),(0,m.jsx)(`button`,{type:`button`,onClick:je,disabled:xe,className:`px-2.5 py-1 rounded-md text-xs font-medium text-red-400 hover:bg-red-500/10 transition-colors disabled:opacity-50`,children:`Delete Selected`})]})]}),X.isLoading&&(0,m.jsx)(ie,{label:`Loading proxy pools...`}),X.isError&&(0,m.jsx)(oe,{message:i(X.error),onRetry:()=>X.refetch()}),X.isSuccess&&Z.length===0&&(0,m.jsx)(re,{icon:(0,m.jsx)(ce,{className:`h-8 w-8 text-zinc-500`}),label:`No proxy pool entries yet`,description:`Create a proxy pool entry, then assign it to connections.`,action:(0,m.jsx)(c,{size:`sm`,variant:`primary`,onClick:()=>n(!0),icon:(0,m.jsx)(ue,{className:`h-3.5 w-3.5`}),children:`Add Proxy Pool`})}),Z.length>0&&(0,m.jsx)(`div`,{className:`divide-y divide-white/[0.05]`,children:Z.map(e=>(0,m.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between py-3.5 px-2 hover:bg-white/[0.02] rounded-xl transition-colors gap-3`,children:[(0,m.jsxs)(`div`,{className:`flex items-start gap-3 min-w-0 flex-1`,children:[(0,m.jsx)(`input`,{type:`checkbox`,checked:z.includes(e.id),onChange:()=>Te(e.id),className:`mt-1 h-4 w-4 shrink-0 rounded border-zinc-700 bg-zinc-800 text-orange-500 focus:ring-0 cursor-pointer`}),(0,m.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,m.jsxs)(`div`,{className:`flex items-center gap-2 flex-wrap`,children:[(0,m.jsx)(`p`,{className:`font-semibold text-sm text-white truncate max-w-sm`,children:e.name}),(0,m.jsx)(u,{variant:e.testStatus===`error`||e.lastError?`danger`:e.isActive?`success`:`default`,size:`sm`,dot:e.isActive&&e.testStatus!==`error`,children:e.testStatus===`error`?`error`:e.isActive?`active`:`inactive`}),e.type&&(0,m.jsx)(u,{variant:`default`,size:`sm`,children:e.type===`vercel`?`vercel relay`:e.type===`cloudflare`?`cloudflare relay`:e.type===`deno`?`deno relay`:e.type}),(0,m.jsxs)(u,{variant:`purple`,size:`sm`,children:[e.boundConnectionCount??e.count??0,` bound`]})]}),(0,m.jsx)(`p`,{className:`font-mono text-xs text-zinc-400 truncate mt-1`,children:e.proxies?.[0]||e.proxyUrl||`—`}),(0,m.jsxs)(`p`,{className:`text-[11px] text-zinc-500 mt-0.5 flex items-center gap-1.5 flex-wrap`,children:[(0,m.jsxs)(`span`,{children:[`Last tested:`,` `,e.lastTestedAt?new Date(e.lastTestedAt).toLocaleString():`Never`]}),e.latencyMs!=null&&e.latencyMs>0&&(0,m.jsxs)(`span`,{className:`font-mono text-zinc-400`,children:[`· `,e.latencyMs,`ms`]}),e.lastError&&(0,m.jsxs)(`span`,{className:`text-rose-400 font-medium font-mono`,children:[`· `,e.lastError]})]})]})]}),(0,m.jsxs)(`div`,{className:`flex items-center justify-end gap-1.5 shrink-0`,children:[(0,m.jsx)(ae,{size:`sm`,checked:e.isActive===!0,onChange:()=>Ee(e),title:e.isActive?`Disable pool`:`Enable pool`}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Me(e.id),disabled:N===e.id,className:`p-1.5 rounded-lg text-zinc-400 hover:text-orange-400 hover:bg-white/[0.06] transition-colors`,title:`Test Proxy`,children:(0,m.jsx)(o,{className:f(`h-4 w-4`,N===e.id&&`animate-spin text-orange-400`)})}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>ke(e),className:`p-1.5 rounded-lg text-zinc-400 hover:text-white hover:bg-white/[0.06] transition-colors`,title:`Edit Proxy Pool`,children:(0,m.jsx)(le,{className:`h-4 w-4`})}),(0,m.jsx)(`button`,{type:`button`,onClick:()=>Ae(e),className:`p-1.5 rounded-lg text-zinc-400 hover:text-red-400 hover:bg-red-500/10 transition-colors`,title:`Delete Proxy Pool`,children:(0,m.jsx)(fe,{className:`h-4 w-4`})})]})]},e.id))})]}),(0,m.jsx)(s,{open:t,onClose:()=>n(!1),title:`Add Proxy Pool`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,m.jsx)(l,{label:`Pool Name`,placeholder:`Nama`,value:C,onChange:e=>w(e.target.value)}),(0,m.jsxs)(d,{label:`Type`,value:T,onChange:e=>E(e.target.value),children:[(0,m.jsx)(`option`,{value:`socks5`,children:`socks5`}),(0,m.jsx)(`option`,{value:`http`,children:`http`}),(0,m.jsx)(`option`,{value:`cloudflare`,children:`cloudflare relay`}),(0,m.jsx)(`option`,{value:`vercel`,children:`vercel relay`}),(0,m.jsx)(`option`,{value:`deno`,children:`deno relay`})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,m.jsx)(`label`,{className:`text-xs font-medium text-white`,children:`Proxy URLs`}),(0,m.jsx)(`textarea`,{rows:4,value:D,onChange:e=>O(e.target.value),placeholder:`URL`,className:`focus-ring w-full rounded-[8px] border border-[#2e3444] bg-[#14161e] p-3 font-mono text-xs text-white placeholder:text-zinc-500`})]}),j&&(0,m.jsx)(`p`,{className:`font-mono text-xs text-red-400`,children:j}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>n(!1),children:`Batal`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,onClick:De,disabled:!C.trim(),children:`Simpan`})]})]})}),(0,m.jsx)(s,{open:!!x,onClose:()=>S(null),title:`Edit Proxy Pool`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3.5`,children:[(0,m.jsx)(l,{label:`Pool Name`,value:C,onChange:e=>w(e.target.value)}),(0,m.jsxs)(d,{label:`Type`,value:T,onChange:e=>E(e.target.value),children:[(0,m.jsx)(`option`,{value:`socks5`,children:`socks5`}),(0,m.jsx)(`option`,{value:`http`,children:`http`}),(0,m.jsx)(`option`,{value:`cloudflare`,children:`cloudflare relay`}),(0,m.jsx)(`option`,{value:`vercel`,children:`vercel relay`}),(0,m.jsx)(`option`,{value:`deno`,children:`deno relay`})]}),(0,m.jsxs)(`div`,{className:`flex flex-col gap-1.5`,children:[(0,m.jsx)(`label`,{className:`text-xs font-medium text-white`,children:`Proxy URLs`}),(0,m.jsx)(`textarea`,{rows:4,value:D,onChange:e=>O(e.target.value),className:`focus-ring w-full rounded-[8px] border border-[#2e3444] bg-[#14161e] p-3 font-mono text-xs text-white placeholder:text-zinc-500`})]}),j&&(0,m.jsx)(`p`,{className:`font-mono text-xs text-red-400`,children:j}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>S(null),children:`Cancel`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,onClick:Oe,disabled:!C.trim(),children:`Save Changes`})]})]})}),(0,m.jsx)(s,{open:a,onClose:()=>h(!1),title:`Batch Import Proxies`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsx)(`p`,{className:`text-xs text-zinc-400`,children:`Paste multiple proxy URLs, one per line (supports http, https, socks5).`}),(0,m.jsx)(`textarea`,{rows:6,value:k,onChange:e=>A(e.target.value),placeholder:`URL`,className:`focus-ring w-full rounded-[8px] border border-[#2e3444] bg-[#14161e] p-3 font-mono text-xs text-white placeholder:text-zinc-500`}),j&&(0,m.jsx)(`p`,{className:`font-mono text-xs text-red-400`,children:j}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>h(!1),children:`Batal`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,onClick:async()=>{let e=k.split(`
5
+ `).map(e=>e.trim()).filter(Boolean);if(e.length){M(null);try{for(let t=0;t<e.length;t++){let n=e[t];await r.createProxyPool({name:`Imported Pool ${t+1}`,isActive:!0,data:{type:`socks5`,proxies:[n]}})}h(!1),A(``),Q()}catch(e){M(i(e))}}},disabled:!k.trim(),children:`Import`})]})]})}),(0,m.jsx)(s,{open:ve,onClose:()=>v(!1),title:`Deploy Cloudflare Relay`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsx)(l,{label:`Account ID`,placeholder:`ID`,value:H.accountId,onChange:e=>U({...H,accountId:e.target.value})}),(0,m.jsx)(l,{label:`API Token`,type:`password`,placeholder:`Token`,value:H.apiToken,onChange:e=>U({...H,apiToken:e.target.value})}),(0,m.jsx)(l,{label:`Worker Name`,placeholder:`Nama`,value:H.projectName,onChange:e=>U({...H,projectName:e.target.value})}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>v(!1),children:`Batal`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,disabled:!H.accountId||!H.apiToken||q,loading:q,onClick:async()=>{J(!0);try{await r.createProxyPool({name:H.projectName,isActive:!0,data:{type:`cloudflare`,proxies:[`https://${H.projectName}.workers.dev`]}}),v(!1),Q()}finally{J(!1)}},children:`Deploy`})]})]})}),(0,m.jsx)(s,{open:ye,onClose:()=>y(!1),title:`Deploy Vercel Relay`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsx)(l,{label:`Vercel Token`,type:`password`,placeholder:`Token`,value:W.vercelToken,onChange:e=>G({...W,vercelToken:e.target.value})}),(0,m.jsx)(l,{label:`Project Name`,placeholder:`Nama`,value:W.projectName,onChange:e=>G({...W,projectName:e.target.value})}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>y(!1),children:`Batal`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,disabled:!W.vercelToken||q,loading:q,onClick:async()=>{J(!0);try{await r.createProxyPool({name:W.projectName,isActive:!0,data:{type:`vercel`,proxies:[`https://${W.projectName}.vercel.app`]}}),y(!1),Q()}finally{J(!1)}},children:`Deploy`})]})]})}),(0,m.jsx)(s,{open:be,onClose:()=>b(!1),title:`Deploy Deno Relay`,size:`md`,children:(0,m.jsxs)(`div`,{className:`flex flex-col gap-3`,children:[(0,m.jsx)(l,{label:`Deno Token`,type:`password`,placeholder:`Token`,value:K.denoToken,onChange:e=>Se({...K,denoToken:e.target.value})}),(0,m.jsx)(l,{label:`Project Name`,placeholder:`Nama`,value:K.projectName,onChange:e=>Se({...K,projectName:e.target.value})}),(0,m.jsxs)(`div`,{className:`mt-2 flex justify-end gap-2`,children:[(0,m.jsx)(c,{size:`sm`,variant:`outline`,onClick:()=>b(!1),children:`Batal`}),(0,m.jsx)(c,{size:`sm`,variant:`primary`,disabled:!K.denoToken||q,loading:q,onClick:async()=>{J(!0);try{await r.createProxyPool({name:K.projectName,isActive:!0,data:{type:`deno`,proxies:[`https://${K.projectName}.deno.dev`]}}),b(!1),Q()}finally{J(!1)}},children:`Deploy`})]})]})})]})}export{h as component};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./jsx-runtime-B-hcVAMW.js";var n=t((t=>{var n=e();function r(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function i(){}var a={d:{f:i,r:function(){throw Error(r(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},o=Symbol.for(`react.portal`);function s(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var c=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,t.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(r(299));return s(e,t,null,n)},t.flushSync=function(e){var t=c.T,n=a.p;try{if(c.T=null,a.p=2,e)return e()}finally{c.T=t,a.p=n,a.d.f()}},t.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,a.d.C(e,t))},t.prefetchDNS=function(e){typeof e==`string`&&a.d.D(e)},t.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin),i=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?a.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:i,fetchPriority:o}):n===`script`&&a.d.X(e,{crossOrigin:r,integrity:i,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},t.preinitModule=function(e,t){if(typeof e==`string`)if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=l(t.as,t.crossOrigin);a.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??a.d.M(e)},t.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=l(n,t.crossOrigin);a.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},t.preloadModule=function(e,t){if(typeof e==`string`)if(t){var n=l(t.as,t.crossOrigin);a.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else a.d.m(e)},t.requestFormReset=function(e){a.d.r(e)},t.unstable_batchedUpdates=function(e,t){return e(t)},t.useFormState=function(e,t,n){return c.H.useFormState(e,t,n)},t.useFormStatus=function(){return c.H.useHostTransitionStatus()},t.version=`19.2.8`})),r=t(((e,t)=>{function r(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(r)}catch(e){console.error(e)}}r(),t.exports=n()}));export{r as t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./jsx-runtime-B-hcVAMW.js";import{t}from"./useNavigate-D06Ztr27.js";var n=e(),r=()=>(0,n.jsx)(t,{to:`/providers`,replace:!0});export{r as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`server`,[[`rect`,{width:`20`,height:`8`,x:`2`,y:`2`,rx:`2`,ry:`2`,key:`ngkwjq`}],[`rect`,{width:`20`,height:`8`,x:`2`,y:`14`,rx:`2`,ry:`2`,key:`iecqi9`}],[`line`,{x1:`6`,x2:`6.01`,y1:`6`,y2:`6`,key:`16zg32`}],[`line`,{x1:`6`,x2:`6.01`,y1:`18`,y2:`18`,key:`nzw8ys`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{t as r}from"./useQuery-BrM5_EQu.js";import{n as ee}from"./QueryClientProvider-BjElddVn.js";import{n as i}from"./api-lXjeGSiV.js";import{t as a}from"./createLucideIcon-CLdWFMku.js";import{n as te,t as ne}from"./log-out-wyRkCSAT.js";import{t as re}from"./check-36OnHiEM.js";import{t as ie}from"./chevron-down-DxUrtHFo.js";import{n as ae,t as oe}from"./lock-Chb45-Rn.js";import{t as se}from"./globe-hcLYcRzz.js";import{t as ce}from"./laptop-D_8f9_v7.js";import{a as le,i as ue,n as o,t as de}from"./theme-o081sJEj.js";import{n as fe,t as pe}from"./wifi-Bsq09YFd.js";import{t as me}from"./shield-CMYlc0qf.js";import{t as he}from"./upload--8EEkrQJ.js";import{t as s}from"./utils-B6KiDbIe.js";import{t as c}from"./OrangeSwitch-Dc_G3ztN.js";import{i as l,n as ge,r as u,t as d}from"./dialog-B56WVEML.js";var _e=a(`contrast`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 18a6 6 0 0 0 0-12v12z`,key:`j4l70d`}]]),ve=a(`git-fork`,[[`circle`,{cx:`12`,cy:`18`,r:`3`,key:`1mpf1b`}],[`circle`,{cx:`6`,cy:`6`,r:`3`,key:`1lh9wr`}],[`circle`,{cx:`18`,cy:`6`,r:`3`,key:`1h7g24`}],[`path`,{d:`M18 9v2c0 .6-.4 1-1 1H7c-.6 0-1-.4-1-1V9`,key:`1uq4wg`}],[`path`,{d:`M12 12v3`,key:`158kv8`}]]),f=e(t(),1),p=n(),m=[{code:`en`,name:`English (US)`,flag:`🇺🇸`,label:`US`},{code:`id`,name:`Bahasa Indonesia`,flag:`🇮🇩`,label:`ID`},{code:`zh-CN`,name:`简体中文`,flag:`🇨🇳`,label:`CN`},{code:`zh-TW`,name:`繁體中文`,flag:`🇹🇼`,label:`TW`},{code:`ja`,name:`日本語`,flag:`🇯🇵`,label:`JP`},{code:`ko`,name:`한국어`,flag:`🇰🇷`,label:`KR`},{code:`es`,name:`Español`,flag:`🇪🇸`,label:`ES`},{code:`fr`,name:`Français`,flag:`🇫🇷`,label:`FR`},{code:`de`,name:`Deutsch`,flag:`🇩🇪`,label:`DE`},{code:`ru`,name:`Русский`,flag:`🇷🇺`,label:`RU`},{code:`vi`,name:`Tiếng Việt`,flag:`🇻🇳`,label:`VN`},{code:`ar`,name:`العربية`,flag:`🇸🇦`,label:`SA`}];function ye(){let e=ee(),[t,n]=(0,f.useState)(o);(0,f.useEffect)(()=>{n(o())},[]);let[a,ye]=(0,f.useState)(`en`),[h,g]=(0,f.useState)(!1),[be,_]=(0,f.useState)(!1),[v,y]=(0,f.useState)({current:``,new:``,confirm:``}),[b,x]=(0,f.useState)({type:``,message:``}),[S,xe]=(0,f.useState)(!1),[C,Se]=(0,f.useState)(!1),[w,T]=(0,f.useState)(`saml`),[Ce,E]=(0,f.useState)(`password`),[D,O]=(0,f.useState)({samlEntryPoint:``,samlIssuer:`urn:ekarouter:sp`,samlCert:``,samlLoginLabel:`Sign in with SAML SSO`,samlAttributeEmail:`email`}),[k,A]=(0,f.useState)({oidcIssuerUrl:``,oidcClientId:``,oidcClientSecret:``,oidcScopes:`openid profile email`,oidcLoginLabel:`Sign in with OIDC`}),[j,M]=(0,f.useState)({type:``,message:``}),[N,P]=(0,f.useState)(!1),[F,I]=(0,f.useState)(`fill-first`),[L,R]=(0,f.useState)(3),[z,B]=(0,f.useState)(`fallback`),[V,H]=(0,f.useState)(1),[we,Te]=(0,f.useState)(!1),[U,Ee]=(0,f.useState)(``),[De,Oe]=(0,f.useState)(``),[ke,Ae]=(0,f.useState)(!1),[W,G]=(0,f.useState)({type:``,message:``}),[je,Me]=(0,f.useState)(!1),[Ne,K]=(0,f.useState)(!1),[Pe,q]=(0,f.useState)(!1),[J,Y]=(0,f.useState)({type:``,message:``}),[Fe,Ie]=(0,f.useState)(null),X=(0,f.useRef)(null),Z=r({queryKey:[`settings`],queryFn:i.settings,retry:!1}),Le=r({queryKey:[`version`],queryFn:i.version,retry:!1});(0,f.useEffect)(()=>{if(Z.data){let e=Z.data;typeof e.requireLogin==`boolean`&&_(e.requireLogin),typeof e.fallbackStrategy==`string`&&I(e.fallbackStrategy===`round-robin`?`round-robin`:`fill-first`),typeof e.stickyRoundRobinLimit==`number`&&R(e.stickyRoundRobinLimit),typeof e.comboStrategy==`string`&&B(e.comboStrategy===`round-robin`?`round-robin`:`fallback`),typeof e.comboStickyRoundRobinLimit==`number`&&H(e.comboStickyRoundRobinLimit),typeof e.outboundProxyEnabled==`boolean`&&Te(e.outboundProxyEnabled),typeof e.outboundProxyUrl==`string`&&Ee(e.outboundProxyUrl),typeof e.outboundNoProxy==`string`&&Oe(e.outboundNoProxy),typeof e.enableObservability==`boolean`&&Me(e.enableObservability),typeof e.authMode==`string`&&(E(e.authMode),e.authMode!==`password`&&Se(!0)),typeof e.ssoType==`string`&&T(e.ssoType),typeof e.samlEntryPoint==`string`&&O(t=>({...t,samlEntryPoint:e.samlEntryPoint})),typeof e.samlIssuer==`string`&&O(t=>({...t,samlIssuer:e.samlIssuer})),typeof e.samlCert==`string`&&O(t=>({...t,samlCert:e.samlCert})),typeof e.oidcIssuerUrl==`string`&&A(t=>({...t,oidcIssuerUrl:e.oidcIssuerUrl})),typeof e.oidcClientId==`string`&&A(t=>({...t,oidcClientId:e.oidcClientId}))}},[Z.data]);let Re=e=>{n(e),localStorage.setItem(`ekarouter-theme`,e),de(e)},Q=e=>{Ie(e),setTimeout(()=>Ie(null),2e3)},$=async t=>{try{await i.updateSettings(t),e.invalidateQueries({queryKey:[`settings`]}),Q(`Settings updated`)}catch(e){console.error(e)}},ze=async e=>{if(e.preventDefault(),x({type:``,message:``}),v.new!==v.confirm){x({type:`error`,message:`New passwords do not match`});return}xe(!0);try{await i.resetPassword(v.current,v.new),x({type:`success`,message:`Password updated successfully`}),y({current:``,new:``,confirm:``})}catch(e){let t=e instanceof Error?e.message:`Failed to update password`;x({type:`error`,message:t})}finally{xe(!1)}},Be=async()=>{try{Y({type:``,message:``});let e=await i.exportDatabase(),t=new Blob([JSON.stringify(e,null,2)],{type:`application/json`}),n=URL.createObjectURL(t),r=document.createElement(`a`);r.href=n,r.download=`ekarouter-backup-${new Date().toISOString().slice(0,10)}.json`,r.click(),URL.revokeObjectURL(n),Y({type:`success`,message:`Backup downloaded successfully`})}catch(e){Y({type:`error`,message:e instanceof Error?e.message:`Export failed`})}},Ve=async t=>{let n=t.target.files?.[0];if(n)try{Y({type:``,message:``});let t=await n.text(),r=JSON.parse(t);await i.importDatabase(r),Y({type:`success`,message:`Database imported successfully`}),e.invalidateQueries()}catch(e){Y({type:`error`,message:e instanceof Error?e.message:`Import failed`})}finally{X.current&&(X.current.value=``)}},He=async()=>{Ae(!0),G({type:``,message:``});try{let e=await i.testProxy({proxyUrl:U});e.success?G({type:`success`,message:e.message||`Proxy connection successful`}):G({type:`error`,message:e.message||`Proxy test failed`})}catch(e){G({type:`error`,message:e instanceof Error?e.message:`Proxy test failed`})}finally{Ae(!1)}},Ue=async()=>{P(!0),M({type:``,message:``});try{let e={authMode:Ce,ssoType:w,...w===`saml`?D:k};await $(e),M({type:`success`,message:`SSO settings saved successfully`})}catch{M({type:`error`,message:`Failed to save SSO settings`})}finally{P(!1)}},We=async()=>{q(!0);try{await i.shutdown()}catch{}q(!1),K(!1),Q(`Shutdown signal sent`)},Ge=async()=>{try{await i.logout(),window.location.assign(`/login`)}catch{window.location.assign(`/login`)}},Ke=m.find(e=>e.code===a)||m[0],qe=Le.data?.currentVersion||Le.data?.version||`0.5.75`;return(0,p.jsxs)(`div`,{className:`max-w-2xl mx-auto px-4 sm:px-0 py-2 space-y-6`,children:[Fe&&(0,p.jsxs)(`div`,{className:`fixed bottom-6 right-6 z-50 flex items-center gap-1.5 rounded-xl border border-emerald-800/60 bg-emerald-950/90 px-3.5 py-2 text-xs font-medium text-emerald-400 shadow-lg backdrop-blur`,children:[(0,p.jsx)(re,{className:`h-3.5 w-3.5`}),Fe]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-emerald-500/10 text-emerald-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(ce,{className:`h-5 w-5 text-emerald-500`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h2`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Local Mode`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400`,children:`Running on your machine`})]})]}),(0,p.jsx)(`div`,{suppressHydrationWarning:!0,className:`inline-flex p-1 rounded-lg bg-[#12141c] border border-[#282d3b] self-start sm:self-auto`,children:[`light`,`dark`,`system`].map(e=>(0,p.jsxs)(`button`,{type:`button`,suppressHydrationWarning:!0,onClick:()=>Re(e),className:s(`flex items-center justify-center gap-1.5 px-3 py-1.5 rounded-md text-xs font-medium transition-colors cursor-pointer capitalize`,t===e?`bg-[#252a38] text-white shadow-sm`:`text-zinc-400 hover:text-zinc-200`),children:[e===`light`&&(0,p.jsx)(ue,{className:`h-3.5 w-3.5`}),e===`dark`&&(0,p.jsx)(le,{className:`h-3.5 w-3.5`}),e===`system`&&(0,p.jsx)(_e,{className:`h-3.5 w-3.5`}),(0,p.jsx)(`span`,{children:e})]},e))})]}),(0,p.jsxs)(`div`,{className:`pt-3 border-t border-[#232938] space-y-3`,children:[(0,p.jsxs)(`div`,{className:`rounded-lg bg-[#12141c] border border-[#232938] p-3.5`,children:[(0,p.jsx)(`p`,{className:`font-medium text-xs sm:text-sm text-white`,children:`Database Location`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 font-mono mt-0.5 break-all`,children:`~/.9router/db/data.sqlite`})]}),(0,p.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2.5`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:Be,className:`flex items-center gap-1.5 rounded-lg border border-[#282d3b] bg-[#14161f] px-3.5 py-2 text-xs font-medium text-zinc-200 hover:bg-[#1f2433] hover:text-white transition-colors cursor-pointer`,children:[(0,p.jsx)(ae,{className:`h-3.5 w-3.5`}),(0,p.jsx)(`span`,{children:`Download Backup`})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>X.current?.click(),className:`flex items-center gap-1.5 rounded-lg border border-[#282d3b] bg-[#14161f] px-3.5 py-2 text-xs font-medium text-zinc-200 hover:bg-[#1f2433] hover:text-white transition-colors cursor-pointer`,children:[(0,p.jsx)(he,{className:`h-3.5 w-3.5`}),(0,p.jsx)(`span`,{children:`Import Backup`})]}),(0,p.jsx)(`input`,{ref:X,type:`file`,accept:`.json,application/json`,onChange:Ve,className:`hidden`})]}),J.message&&(0,p.jsx)(`p`,{className:s(`text-xs`,J.type===`error`?`text-red-400`:`text-emerald-400`),children:J.message})]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-3`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(se,{className:`h-5 w-5 text-blue-500`})}),(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Language`})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:()=>g(!0),className:`w-full rounded-lg bg-[#12141c] border border-[#232938] p-3 flex items-center justify-between hover:border-orange-500/50 transition-colors cursor-pointer`,children:[(0,p.jsx)(`span`,{className:`text-xs sm:text-sm text-zinc-400`,children:`Display language`}),(0,p.jsx)(`span`,{className:`text-xs font-bold text-white px-2 py-0.5 rounded bg-[#1f2433] border border-[#2e3547]`,children:Ke.label})]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-red-500/10 text-red-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(me,{className:`h-5 w-5 text-red-500`})}),(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Security`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm text-white`,children:`Require login`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`When ON, access requires password. When OFF, access without login.`})]}),(0,p.jsx)(c,{checked:be,onCheckedChange:e=>{_(e),$({requireLogin:e})}})]}),(0,p.jsxs)(`form`,{onSubmit:ze,className:`space-y-3 pt-3 border-t border-[#232938]`,children:[(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Current Password`}),(0,p.jsx)(`input`,{type:`password`,placeholder:`Password`,value:v.current,onChange:e=>y(t=>({...t,current:e.target.value})),className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`grid grid-cols-1 sm:grid-cols-2 gap-3`,children:[(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`New Password`}),(0,p.jsx)(`input`,{type:`password`,placeholder:`Password`,value:v.new,onChange:e=>y(t=>({...t,new:e.target.value})),className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Confirm New Password`}),(0,p.jsx)(`input`,{type:`password`,placeholder:`Konfirmasi`,value:v.confirm,onChange:e=>y(t=>({...t,confirm:e.target.value})),className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]})]}),b.message&&(0,p.jsx)(`p`,{className:s(`text-xs`,b.type===`error`?`text-red-400`:`text-emerald-400`),children:b.message}),(0,p.jsx)(`button`,{type:`submit`,disabled:S,className:`rounded-lg bg-[#f0643b] px-4 py-2 text-xs font-medium text-white hover:bg-[#e0542b] transition-colors cursor-pointer disabled:opacity-50`,children:S?`Updating…`:`Update Password`})]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>Se(!C),className:`w-full flex items-center justify-between text-left cursor-pointer`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-indigo-500/10 text-indigo-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(oe,{className:`h-5 w-5 text-indigo-500`})}),(0,p.jsxs)(`div`,{children:[(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Single Sign-On (SSO)`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Optional SSO via Okta, Entra ID, Keycloak, or OIDC`})]})]}),(0,p.jsx)(ie,{className:s(`h-4 w-4 text-zinc-400 transition-transform duration-200`,C&&`rotate-180`)})]}),C&&(0,p.jsxs)(`div`,{className:`pt-4 mt-4 border-t border-[#232938] space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex p-1 rounded-lg bg-[#12141c] border border-[#282d3b]`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>T(`saml`),className:s(`flex-1 py-1.5 px-3 rounded-md text-xs font-medium transition-all text-center cursor-pointer`,w===`saml`?`bg-[#252a38] text-white shadow-sm`:`text-zinc-400 hover:text-zinc-200`),children:`SAML 2.0`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>T(`oidc`),className:s(`flex-1 py-1.5 px-3 rounded-md text-xs font-medium transition-all text-center cursor-pointer`,w===`oidc`?`bg-[#252a38] text-white shadow-sm`:`text-zinc-400 hover:text-zinc-200`),children:`OIDC`})]}),(0,p.jsxs)(`div`,{className:`space-y-1.5`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Auth Mode`}),(0,p.jsx)(`div`,{className:`grid grid-cols-1 sm:grid-cols-3 gap-2`,children:[{id:`password`,title:`Password only`,desc:`Keep legacy password login.`},{id:`sso`,title:`SSO only`,desc:`Require SSO for portal access.`},{id:`both`,title:`Both`,desc:`Allow password or SSO login.`}].map(e=>(0,p.jsxs)(`button`,{type:`button`,onClick:()=>E(e.id),className:s(`text-left rounded-lg border p-2.5 transition-colors cursor-pointer`,Ce===e.id?`border-[#f0643b] bg-[#f0643b]/10 text-white`:`border-[#282d3b] bg-[#12141c] text-zinc-400 hover:border-zinc-500`),children:[(0,p.jsx)(`p`,{className:`font-medium text-xs text-white`,children:e.title}),(0,p.jsx)(`p`,{className:`text-[11px] text-zinc-400 mt-0.5`,children:e.desc})]},e.id))})]}),w===`saml`?(0,p.jsxs)(`div`,{className:`space-y-3`,children:[(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`SSO Service URL (samlEntryPoint)`}),(0,p.jsx)(`input`,{type:`text`,value:D.samlEntryPoint,onChange:e=>O(t=>({...t,samlEntryPoint:e.target.value})),placeholder:`https://...`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`SP Entity ID / Audience`}),(0,p.jsx)(`input`,{type:`text`,value:D.samlIssuer,onChange:e=>O(t=>({...t,samlIssuer:e.target.value})),placeholder:`URN`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`IdP X.509 Certificate (samlCert)`}),(0,p.jsx)(`textarea`,{rows:3,value:D.samlCert,onChange:e=>O(t=>({...t,samlCert:e.target.value})),placeholder:`Sertifikat`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] p-2.5 text-xs font-mono text-white focus:border-orange-500 focus:outline-none`})]})]}):(0,p.jsxs)(`div`,{className:`space-y-3`,children:[(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Issuer URL`}),(0,p.jsx)(`input`,{type:`text`,value:k.oidcIssuerUrl,onChange:e=>A(t=>({...t,oidcIssuerUrl:e.target.value})),placeholder:`https://...`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]}),(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Client ID`}),(0,p.jsx)(`input`,{type:`text`,value:k.oidcClientId,onChange:e=>A(t=>({...t,oidcClientId:e.target.value})),placeholder:`ID`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`})]})]}),j.message&&(0,p.jsx)(`p`,{className:s(`text-xs`,j.type===`error`?`text-red-400`:`text-emerald-400`),children:j.message}),(0,p.jsx)(`button`,{type:`button`,disabled:N,onClick:Ue,className:`rounded-lg bg-[#f0643b] px-4 py-2 text-xs font-medium text-white hover:bg-[#e0542b] transition-colors cursor-pointer disabled:opacity-50`,children:N?`Saving…`:`Save SSO Settings`})]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-blue-500/10 text-blue-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(ve,{className:`h-5 w-5 text-blue-500`})}),(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Routing Strategy`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm text-white`,children:`Round Robin`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Cycle through accounts to distribute load`})]}),(0,p.jsx)(c,{checked:F===`round-robin`,onCheckedChange:e=>{let t=e?`round-robin`:`fill-first`;I(t),$({fallbackStrategy:t})}})]}),F===`round-robin`&&(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-2 border-t border-[#232938]`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-xs sm:text-sm text-white`,children:`Sticky Limit`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400`,children:`Calls per account before switching`})]}),(0,p.jsx)(`input`,{type:`number`,min:`1`,max:`20`,value:L,onChange:e=>{let t=Number(e.target.value)||1;R(t),$({stickyRoundRobinLimit:t})},className:`w-16 rounded-lg border border-[#2f3545] bg-[#12141c] p-1.5 text-center text-xs text-white`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-3 border-t border-[#232938]`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm text-white`,children:`Combo Round Robin`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Cycle through providers in combos instead of always starting with first`})]}),(0,p.jsx)(c,{checked:z===`round-robin`,onCheckedChange:e=>{let t=e?`round-robin`:`fallback`;B(t),$({comboStrategy:t})}})]}),z===`round-robin`&&(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4 pt-2 border-t border-[#232938]`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-xs sm:text-sm text-white`,children:`Combo Sticky Limit`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400`,children:`Calls per combo model before switching`})]}),(0,p.jsx)(`input`,{type:`number`,min:`1`,max:`20`,value:V,onChange:e=>{let t=Number(e.target.value)||1;H(t),$({comboStickyRoundRobinLimit:t})},className:`w-16 rounded-lg border border-[#2f3545] bg-[#12141c] p-1.5 text-center text-xs text-white`})]}),(0,p.jsxs)(`p`,{className:`text-xs text-zinc-400 italic pt-3 border-t border-[#232938]`,children:[F===`round-robin`?`Currently distributing requests across all available accounts with ${L} calls per account.`:`Currently using accounts in priority order (Fill First).`,z===`round-robin`?` Combos rotate after ${V} call${V===1?``:`s`} per model.`:` Combos always start with their first model.`]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-purple-500/10 text-purple-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(pe,{className:`h-5 w-5 text-purple-500`})}),(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Network`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm text-white`,children:`Outbound Proxy`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Enable proxy for OAuth + provider outbound requests.`})]}),(0,p.jsx)(c,{checked:we,onCheckedChange:e=>{Te(e),$({outboundProxyEnabled:e})}})]}),we&&(0,p.jsxs)(`div`,{className:`space-y-3 pt-3 border-t border-[#232938]`,children:[(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`Proxy URL`}),(0,p.jsx)(`input`,{type:`text`,value:U,onChange:e=>Ee(e.target.value),placeholder:`http://...`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`}),(0,p.jsx)(`p`,{className:`text-[11px] text-zinc-500`,children:`Kosongkan jika memakai proxy env.`})]}),(0,p.jsxs)(`div`,{className:`space-y-1`,children:[(0,p.jsx)(`label`,{className:`text-xs font-medium text-zinc-300`,children:`No Proxy`}),(0,p.jsx)(`input`,{type:`text`,value:De,onChange:e=>Oe(e.target.value),placeholder:`Bypass`,className:`w-full rounded-xl border border-[#2f3545] bg-[#12141c] px-3.5 py-2 text-xs text-white focus:border-orange-500 focus:outline-none`}),(0,p.jsx)(`p`,{className:`text-[11px] text-zinc-500`,children:`Pisahkan hostname dengan koma.`})]}),W.message&&(0,p.jsx)(`p`,{className:s(`text-xs`,W.type===`error`?`text-red-400`:`text-emerald-400`),children:W.message}),(0,p.jsxs)(`div`,{className:`flex items-center gap-2 pt-1`,children:[(0,p.jsx)(`button`,{type:`button`,disabled:ke,onClick:He,className:`rounded-lg border border-[#282d3b] bg-[#14161f] px-3.5 py-2 text-xs font-medium text-zinc-200 hover:bg-[#1f2433] hover:text-white transition-colors cursor-pointer disabled:opacity-50`,children:ke?`Testing…`:`Test proxy URL`}),(0,p.jsx)(`button`,{type:`button`,onClick:()=>void $({outboundProxyUrl:U,outboundNoProxy:De}),className:`rounded-lg bg-[#f0643b] px-4 py-2 text-xs font-medium text-white hover:bg-[#e0542b] transition-colors cursor-pointer`,children:`Apply`})]})]})]}),(0,p.jsxs)(`div`,{className:`rounded-2xl border border-[#232938] bg-[#161821] p-5 shadow-sm space-y-4`,children:[(0,p.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,p.jsx)(`div`,{className:`size-10 rounded-lg bg-orange-500/10 text-orange-500 flex items-center justify-center shrink-0`,children:(0,p.jsx)(te,{className:`h-5 w-5 text-orange-500`})}),(0,p.jsx)(`h3`,{className:`text-base sm:text-lg font-semibold text-white`,children:`Observability`})]}),(0,p.jsxs)(`div`,{className:`flex items-center justify-between gap-4`,children:[(0,p.jsxs)(`div`,{className:`min-w-0 flex-1`,children:[(0,p.jsx)(`p`,{className:`font-medium text-sm text-white`,children:`Enable Observability`}),(0,p.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Record request details for inspection in the logs view`})]}),(0,p.jsx)(c,{checked:je,onCheckedChange:e=>{Me(e),$({enableObservability:e})}})]})]}),(0,p.jsxs)(`div`,{className:`flex flex-col sm:flex-row gap-3 pt-2`,children:[(0,p.jsxs)(`button`,{type:`button`,onClick:()=>K(!0),className:`flex-1 flex items-center justify-center gap-2 rounded-xl border border-red-500/40 bg-transparent py-2.5 text-xs sm:text-sm font-medium text-red-400 hover:bg-red-500/10 hover:border-red-500/60 transition-colors cursor-pointer`,children:[(0,p.jsx)(fe,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{children:`Shutdown`})]}),(0,p.jsxs)(`button`,{type:`button`,onClick:Ge,className:`flex-1 flex items-center justify-center gap-2 rounded-xl border border-[#282d3b] bg-transparent py-2.5 text-xs sm:text-sm font-medium text-zinc-300 hover:bg-[#1a1d26] hover:text-white transition-colors cursor-pointer`,children:[(0,p.jsx)(ne,{className:`h-4 w-4`}),(0,p.jsx)(`span`,{children:`Logout`})]})]}),(0,p.jsx)(`div`,{className:`text-center text-xs text-zinc-500 py-3`,children:(0,p.jsxs)(`p`,{children:[`9Router Proxy v`,qe]})}),(0,p.jsx)(d,{open:h,onOpenChange:g,children:(0,p.jsxs)(ge,{className:`border-[#282d3b] bg-[#14161b] text-white sm:max-w-lg`,children:[(0,p.jsx)(u,{children:(0,p.jsx)(l,{className:`text-base font-semibold text-white`,children:`Select Display Language`})}),(0,p.jsx)(`div`,{className:`grid grid-cols-2 sm:grid-cols-3 gap-2.5 pt-2 max-h-[60vh] overflow-y-auto pr-1`,children:m.map(e=>{let t=a===e.code;return(0,p.jsxs)(`button`,{type:`button`,onClick:()=>{ye(e.code),i.setLocale(e.code),g(!1),Q(`Language set to ${e.name}`)},className:s(`flex flex-col items-center justify-center gap-1.5 p-3 rounded-xl border transition-all cursor-pointer`,t?`border-[#f0643b] bg-[#f0643b]/10 text-white ring-1 ring-[#f0643b]`:`border-[#282d3b] bg-[#1a1d26] text-zinc-400 hover:bg-[#232838] hover:text-white`),children:[(0,p.jsx)(`span`,{className:`text-2xl`,children:e.flag}),(0,p.jsx)(`span`,{className:`text-xs font-medium text-center`,children:e.name})]},e.code)})})]})}),(0,p.jsx)(d,{open:Ne,onOpenChange:K,children:(0,p.jsxs)(ge,{className:`border-[#282d3b] bg-[#14161b] text-white sm:max-w-md`,children:[(0,p.jsx)(u,{children:(0,p.jsx)(l,{className:`text-base font-semibold text-white`,children:`Close Proxy Server`})}),(0,p.jsxs)(`div`,{className:`space-y-4 pt-2`,children:[(0,p.jsx)(`p`,{className:`text-xs text-zinc-300`,children:`Are you sure you want to shut down the proxy server? Running connections will be terminated.`}),(0,p.jsxs)(`div`,{className:`flex items-center justify-end gap-2 pt-2`,children:[(0,p.jsx)(`button`,{type:`button`,onClick:()=>K(!1),className:`rounded-xl border border-[#282d3b] bg-[#1a1d26] px-4 py-2 text-xs font-medium text-zinc-300 hover:bg-[#232838] hover:text-white transition-colors cursor-pointer`,children:`Cancel`}),(0,p.jsx)(`button`,{type:`button`,disabled:Pe,onClick:We,className:`rounded-xl bg-red-600 px-4 py-2 text-xs font-medium text-white hover:bg-red-700 transition-colors cursor-pointer disabled:opacity-50`,children:Pe?`Shutting down…`:`Close Proxy`})]})]})]})})]})}var h=ye;export{h as component};
@@ -0,0 +1 @@
1
+ import{t as e}from"./createLucideIcon-CLdWFMku.js";var t=e(`shield`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}]]);export{t};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,t as n}from"./jsx-runtime-B-hcVAMW.js";import{n as r,t as i}from"./api-lXjeGSiV.js";import{t as a}from"./createLucideIcon-CLdWFMku.js";import{t as o}from"./boxes-DXduN63I.js";import{t as s}from"./check-36OnHiEM.js";import{t as c}from"./copy-B1k2VT2A.js";import{t as l}from"./external-link-BYVStqz6.js";import{t as u}from"./globe-hcLYcRzz.js";import{t as d}from"./hard-drive-Dakvr_if.js";import{t as f}from"./image-B10s4838.js";import{t as p}from"./mic-D6DQAnIR.js";import{t as m}from"./network-D0tNT-6h.js";import{t as h}from"./search-BtJsgOj6.js";import{t as g}from"./volume-2-DoDae9nb.js";var _=a(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),v=a(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]),y=a(`video`,[[`path`,{d:`m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5`,key:`ftymec`}],[`rect`,{x:`2`,y:`6`,width:`14`,height:`12`,rx:`2`,key:`158x01`}]]),b=e(t(),1),x=n();function S(){let[e,t]=(0,b.useState)(null),[n,a]=(0,b.useState)(!1),[S,C]=(0,b.useState)([]),[w,T]=(0,b.useState)(``),E=i||(typeof window<`u`&&window.location.origin?window.location.origin:``);(0,b.useEffect)(()=>{r.skills().then(e=>{e&&Array.isArray(e.skills)&&(C(e.skills),T(e.entrySkill||``))}).catch(()=>{let e=[{id:`9router`,name:`9Router (Entry)`,description:`Setup + index of all capabilities. Start here — covers base URL, auth, model discovery, and links to every capability skill.`,isEntry:!0,icon:`hub`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router/SKILL.md`,localUrl:`${E}/skills/9router/SKILL.md`},{id:`9router-chat`,name:`Chat / Code-gen`,description:`Chat / code-gen via OpenAI or Anthropic format with streaming.`,endpoint:`/v1/chat/completions`,icon:`chat`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-chat/SKILL.md`,localUrl:`${E}/skills/9router-chat/SKILL.md`},{id:`9router-image`,name:`Image Generation`,description:`Text-to-image via DALL-E, Imagen, FLUX, MiniMax, SDWebUI…`,endpoint:`/v1/images/generations`,icon:`image`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-image/SKILL.md`,localUrl:`${E}/skills/9router-image/SKILL.md`},{id:`9router-video`,name:`Video Generation`,description:`Video generation via xAI Grok Imagine, Luma, RunwayML…`,endpoint:`/v1/videos/generations`,icon:`videocam`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-video/SKILL.md`,localUrl:`${E}/skills/9router-video/SKILL.md`},{id:`9router-tts`,name:`Text-to-Speech`,description:`OpenAI / ElevenLabs / Edge / Google / Deepgram voices.`,endpoint:`/v1/audio/speech`,icon:`record_voice_over`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-tts/SKILL.md`,localUrl:`${E}/skills/9router-tts/SKILL.md`},{id:`9router-stt`,name:`Speech-to-Text`,description:`Transcribe audio via OpenAI Whisper, Groq, Gemini, Deepgram, AssemblyAI…`,endpoint:`/v1/audio/transcriptions`,icon:`mic`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-stt/SKILL.md`,localUrl:`${E}/skills/9router-stt/SKILL.md`},{id:`9router-embeddings`,name:`Embeddings`,description:`Vectors for RAG / semantic search via OpenAI, Gemini, Mistral…`,endpoint:`/v1/embeddings`,icon:`scatter_plot`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-embeddings/SKILL.md`,localUrl:`${E}/skills/9router-embeddings/SKILL.md`},{id:`9router-web-search`,name:`Web Search`,description:`Web and X search via Tavily / Exa / Brave / Serper / SearXNG / Google PSE.`,endpoint:`/v1/search`,icon:`search`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-web-search/SKILL.md`,localUrl:`${E}/skills/9router-web-search/SKILL.md`},{id:`9router-web-fetch`,name:`Web Fetch`,description:`URL → markdown / text / HTML via Firecrawl, Jina, Tavily, Exa.`,endpoint:`/v1/web/fetch`,icon:`language`,rawUrl:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router-web-fetch/SKILL.md`,localUrl:`${E}/skills/9router-web-fetch/SKILL.md`}];C(e)})},[]);let D=(e,n)=>{navigator.clipboard.writeText(e),t(n),setTimeout(()=>t(null),1500)},O=e=>{switch(e){case`chat`:return(0,x.jsx)(v,{className:`h-5 w-5`});case`image`:return(0,x.jsx)(f,{className:`h-5 w-5`});case`videocam`:return(0,x.jsx)(y,{className:`h-5 w-5`});case`record_voice_over`:return(0,x.jsx)(g,{className:`h-5 w-5`});case`mic`:return(0,x.jsx)(p,{className:`h-5 w-5`});case`scatter_plot`:return(0,x.jsx)(m,{className:`h-5 w-5`});case`search`:return(0,x.jsx)(h,{className:`h-5 w-5`});case`language`:return(0,x.jsx)(u,{className:`h-5 w-5`});default:return(0,x.jsx)(o,{className:`h-5 w-5`})}},k=n?w||`${E}/skills/9router/SKILL.md`:`https://raw.githubusercontent.com/dresar/ekarouterv1/refs/heads/main/skills/9router/SKILL.md`;return(0,x.jsxs)(`div`,{className:`space-y-6`,children:[(0,x.jsx)(`div`,{className:`flex items-center justify-end`,children:(0,x.jsxs)(`div`,{className:`flex items-center gap-1.5 rounded-xl border border-[#242834] bg-[#161920] p-1`,children:[(0,x.jsxs)(`button`,{type:`button`,onClick:()=>a(!1),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${n?`text-zinc-400 hover:text-white`:`bg-orange-500 text-white`}`,children:[(0,x.jsx)(u,{className:`h-3.5 w-3.5`}),`GitHub Raw`]}),(0,x.jsxs)(`button`,{type:`button`,onClick:()=>a(!0),className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${n?`bg-orange-500 text-white`:`text-zinc-400 hover:text-white`}`,children:[(0,x.jsx)(d,{className:`h-3.5 w-3.5`}),`Local Server`]})]})}),(0,x.jsxs)(`div`,{className:`rounded-2xl border border-orange-500/30 bg-orange-500/5 p-5 shadow-sm space-y-3`,children:[(0,x.jsxs)(`div`,{className:`flex items-center justify-between gap-2`,children:[(0,x.jsx)(`span`,{className:`text-xs font-semibold text-orange-400 uppercase tracking-wider`,children:`Paste this to your AI:`}),(0,x.jsxs)(`button`,{type:`button`,onClick:()=>D(`Read this skill and use it: ${k}`,`entry-card`),className:`inline-flex items-center gap-1.5 rounded-lg bg-orange-500 px-3 py-1.5 text-xs font-semibold text-white hover:bg-orange-600 transition-colors cursor-pointer`,children:[e===`entry-card`?(0,x.jsx)(s,{className:`h-3.5 w-3.5`}):(0,x.jsx)(c,{className:`h-3.5 w-3.5`}),e===`entry-card`?`Copied!`:`Copy Prompt`]})]}),(0,x.jsxs)(`div`,{className:`rounded-xl border border-orange-500/20 bg-[#12141a] px-3.5 py-2.5 font-mono text-xs text-zinc-300 break-all select-all`,children:[`Read this skill and use it: `,k]})]}),(0,x.jsx)(`div`,{className:`space-y-3`,children:S.map(t=>{let r=n?t.localUrl:t.rawUrl;return(0,x.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 rounded-2xl border p-5 shadow-sm transition-all ${t.isEntry?`border-orange-500/40 bg-orange-500/5 hover:border-orange-500/60`:`border-[#242834] bg-[#1a1d24] hover:border-[#2f3545]`}`,children:[(0,x.jsxs)(`div`,{className:`flex items-start gap-3.5 min-w-0`,children:[(0,x.jsx)(`div`,{className:`flex h-10 w-10 shrink-0 items-center justify-center rounded-xl border ${t.isEntry?`border-orange-500/40 bg-orange-500/20 text-orange-400`:`border-[#2e3342] bg-[#20242e] text-zinc-300`}`,children:O(t.icon)}),(0,x.jsxs)(`div`,{className:`min-w-0 space-y-1`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-2.5 flex-wrap`,children:[(0,x.jsx)(`h3`,{className:`text-sm font-semibold text-white`,children:t.name}),t.isEntry&&(0,x.jsx)(`span`,{className:`rounded-md bg-orange-500/20 border border-orange-500/40 px-2 py-0.5 text-[10px] font-bold text-orange-400`,children:`START HERE`}),t.endpoint&&(0,x.jsx)(`code`,{className:`rounded bg-[#14161b] border border-[#282d3b] px-2 py-0.5 font-mono text-[10px] text-zinc-400`,children:t.endpoint})]}),(0,x.jsx)(`p`,{className:`text-xs text-zinc-400 leading-relaxed`,children:t.description}),(0,x.jsxs)(`a`,{href:r,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1 text-[11px] text-zinc-500 hover:text-orange-400 truncate max-w-full pt-0.5`,children:[(0,x.jsx)(`span`,{className:`truncate`,children:r}),(0,x.jsx)(l,{className:`h-3 w-3 shrink-0`})]})]})]}),(0,x.jsx)(`div`,{className:`flex items-center gap-2 shrink-0 self-end sm:self-center`,children:(0,x.jsxs)(`button`,{type:`button`,onClick:()=>D(r,t.id),className:`inline-flex items-center gap-1.5 rounded-xl border border-[#2f3545] bg-[#222632] px-3.5 py-1.5 text-xs font-medium text-zinc-300 hover:bg-[#282d3c] hover:text-white transition-colors cursor-pointer`,children:[e===t.id?(0,x.jsx)(s,{className:`h-3.5 w-3.5 text-emerald-400`}):(0,x.jsx)(c,{className:`h-3.5 w-3.5`}),(0,x.jsx)(`span`,{children:e===t.id?`Copied!`:`Copy Link`})]})})]},t.id)})}),(0,x.jsxs)(`div`,{className:`flex flex-col sm:flex-row sm:items-center justify-between gap-4 rounded-2xl border border-[#242834] bg-[#161920] p-5`,children:[(0,x.jsxs)(`div`,{className:`flex items-center gap-3`,children:[(0,x.jsx)(_,{className:`h-5 w-5 text-zinc-400`}),(0,x.jsxs)(`div`,{children:[(0,x.jsx)(`h2`,{className:`text-sm font-semibold text-white`,children:`More Agent Skills & Examples`}),(0,x.jsx)(`p`,{className:`text-xs text-zinc-400 mt-0.5`,children:`Browse SKILL.md documentation, curl examples, and AI setup guides on GitHub.`})]})]}),(0,x.jsxs)(`a`,{href:`https://github.com/dresar/ekarouterv1/tree/main/skills`,target:`_blank`,rel:`noreferrer`,className:`inline-flex items-center gap-1.5 rounded-xl border border-[#2f3545] bg-[#20242e] px-4 py-2 text-xs font-semibold text-white hover:bg-[#282d3c] transition-colors self-start sm:self-auto`,children:[(0,x.jsx)(`span`,{children:`View on GitHub`}),(0,x.jsx)(l,{className:`h-3.5 w-3.5`})]})]})]})}var C=S;export{C as component};