@fudrouter/fsrouter 0.6.71 → 0.6.73

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 (439) hide show
  1. package/dist/open-sse/config/appConstants.js +23 -79
  2. package/dist/open-sse/config/cliFingerprints.js +1 -1
  3. package/dist/open-sse/config/errorConfig.js +0 -11
  4. package/dist/open-sse/config/grokCli.js +10 -0
  5. package/dist/open-sse/config/kiroConstants.js +99 -46
  6. package/dist/open-sse/config/runtimeConfig.js +2 -0
  7. package/dist/open-sse/config/ttsModels.js +2 -0
  8. package/dist/open-sse/executors/antigravity.js +250 -164
  9. package/dist/open-sse/executors/base.js +16 -11
  10. package/dist/open-sse/executors/codex.js +269 -1108
  11. package/dist/open-sse/executors/commandCode.js +1 -1
  12. package/dist/open-sse/executors/commandcode.js +10 -4
  13. package/dist/open-sse/executors/cursor.js +96 -203
  14. package/dist/open-sse/executors/default.js +146 -244
  15. package/dist/open-sse/executors/github.js +128 -73
  16. package/dist/open-sse/executors/grok-cli.js +527 -94
  17. package/dist/open-sse/executors/grok-web.js +5 -7
  18. package/dist/open-sse/executors/index.js +12 -0
  19. package/dist/open-sse/executors/kiro.js +150 -61
  20. package/dist/open-sse/executors/opencode-go.js +12 -4
  21. package/dist/open-sse/executors/opencode.js +1 -1
  22. package/dist/open-sse/executors/perplexity-web.js +20 -96
  23. package/dist/open-sse/executors/qoder.js +28 -18
  24. package/dist/open-sse/executors/vertex.js +53 -7
  25. package/dist/open-sse/executors/xiaomi-tokenplan.js +6 -5
  26. package/dist/open-sse/handlers/chatCore/nonStreamingHandler.js +97 -85
  27. package/dist/open-sse/handlers/chatCore/requestDetail.js +32 -8
  28. package/dist/open-sse/handlers/chatCore/sseToJsonHandler.js +13 -7
  29. package/dist/open-sse/handlers/chatCore/streamingHandler.js +74 -25
  30. package/dist/open-sse/handlers/chatCore.js +35 -41
  31. package/dist/open-sse/handlers/embeddingProviders/index.js +1 -0
  32. package/dist/open-sse/handlers/embeddingProviders/openai.js +8 -16
  33. package/dist/open-sse/handlers/imageProviders/blackForestLabs.js +2 -21
  34. package/dist/open-sse/handlers/imageProviders/cloudflareAi.js +2 -30
  35. package/dist/open-sse/handlers/imageProviders/codex.js +2 -20
  36. package/dist/open-sse/handlers/imageProviders/comfyui.js +5 -18
  37. package/dist/open-sse/handlers/imageProviders/falAi.js +2 -22
  38. package/dist/open-sse/handlers/imageProviders/gemini.js +2 -16
  39. package/dist/open-sse/handlers/imageProviders/huggingface.js +2 -17
  40. package/dist/open-sse/handlers/imageProviders/index.js +3 -4
  41. package/dist/open-sse/handlers/imageProviders/leonardo.js +1 -1
  42. package/dist/open-sse/handlers/imageProviders/nanobanana.js +4 -23
  43. package/dist/open-sse/handlers/imageProviders/openai.js +15 -43
  44. package/dist/open-sse/handlers/imageProviders/runwayml.js +2 -26
  45. package/dist/open-sse/handlers/imageProviders/sdwebui.js +4 -20
  46. package/dist/open-sse/handlers/imageProviders/stabilityAi.js +2 -26
  47. package/dist/open-sse/handlers/imageProviders/weavy.js +1 -1
  48. package/dist/open-sse/handlers/search/chatSearch.js +60 -14
  49. package/dist/open-sse/handlers/ttsProviders/gemini.js +14 -3
  50. package/dist/open-sse/handlers/ttsProviders/index.js +4 -2
  51. package/dist/open-sse/handlers/ttsProviders/openai.js +4 -1
  52. package/dist/open-sse/handlers/ttsProviders/openrouter.js +7 -4
  53. package/dist/open-sse/handlers/videoCore.js +166 -0
  54. package/dist/open-sse/handlers/videoProviders/weavy.js +1 -1
  55. package/dist/open-sse/mcp-server/catalog.js +1 -1
  56. package/dist/open-sse/mcp-server/server.js +2 -2
  57. package/dist/open-sse/mcp-server/tools/advancedTools.js +2 -2
  58. package/dist/open-sse/mcp-server/tools/agentSkillTools.js +1 -1
  59. package/dist/open-sse/mcp-server/tools/compressionTools.js +4 -4
  60. package/dist/open-sse/mcp-server/tools/gamificationTools.js +10 -10
  61. package/dist/open-sse/mcp-server/tools/githubSkillTools.js +1 -1
  62. package/dist/open-sse/mcp-server/tools/memoryTools.js +3 -3
  63. package/dist/open-sse/mcp-server/tools/notionTools.js +2 -2
  64. package/dist/open-sse/mcp-server/tools/obsidianTools.js +2 -2
  65. package/dist/open-sse/mcp-server/tools/pickFastestModel.js +1 -1
  66. package/dist/open-sse/mcp-server/tools/pluginTools.js +4 -4
  67. package/dist/open-sse/mcp-server/tools/skillTools.js +2 -2
  68. package/dist/open-sse/providers/capabilities.js +24 -4
  69. package/dist/open-sse/providers/registry/alicode-intl.js +1 -1
  70. package/dist/open-sse/providers/registry/anthropic.js +1 -8
  71. package/dist/open-sse/providers/registry/codex.js +0 -9
  72. package/dist/open-sse/providers/registry/cohere.js +0 -2
  73. package/dist/open-sse/providers/registry/gemini.js +0 -2
  74. package/dist/open-sse/providers/registry/github.js +9 -6
  75. package/dist/open-sse/providers/registry/grok-cli.js +28 -18
  76. package/dist/open-sse/providers/registry/index.js +74 -80
  77. package/dist/open-sse/providers/registry/kiro.js +12 -0
  78. package/dist/open-sse/providers/registry/mistral.js +0 -3
  79. package/dist/open-sse/providers/registry/openai.js +0 -3
  80. package/dist/open-sse/providers/registry/perplexity.js +0 -2
  81. package/dist/open-sse/providers/registry/xai.js +5 -3
  82. package/dist/open-sse/rtk/autodetect.js +10 -2
  83. package/dist/open-sse/rtk/caveman.js +2 -93
  84. package/dist/open-sse/rtk/cavemanPrompts.js +34 -2
  85. package/dist/open-sse/rtk/constants.js +7 -2
  86. package/dist/open-sse/rtk/headroom.js +133 -0
  87. package/dist/open-sse/rtk/ponytail.js +1 -1
  88. package/dist/open-sse/rtk/registry.js +2 -0
  89. package/dist/open-sse/services/accountFallback.js +0 -108
  90. package/dist/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
  91. package/dist/open-sse/services/combo/quotaShareStrategy.js +1 -1
  92. package/dist/open-sse/services/combo/resolveAutoStrategy.js +1 -1
  93. package/dist/open-sse/services/combo/sessionStickiness.js +1 -1
  94. package/dist/open-sse/services/combo/targetSorters.js +2 -2
  95. package/dist/open-sse/services/combo/validateQuality.js +1 -1
  96. package/dist/open-sse/services/comboConfig.js +1 -1
  97. package/dist/open-sse/services/emergencyFallback.js +1 -1
  98. package/dist/open-sse/services/grokCliModels.js +127 -0
  99. package/dist/open-sse/services/model.js +7 -1
  100. package/dist/open-sse/services/provider.js +1 -1
  101. package/dist/open-sse/services/proxyAutoSelector.js +1 -1
  102. package/dist/open-sse/services/tokenRefresh/providers.js +3 -3
  103. package/dist/open-sse/services/usage/codex.js +148 -214
  104. package/dist/open-sse/services/usage/grok-cli.js +61 -7
  105. package/dist/open-sse/services/usage/misc.js +0 -19
  106. package/dist/open-sse/services/usage.js +0 -2
  107. package/dist/open-sse/translator/concerns/paramSupport.js +2 -2
  108. package/dist/open-sse/translator/concerns/thinkingUnified.js +6 -0
  109. package/dist/open-sse/translator/index.js +97 -59
  110. package/dist/open-sse/translator/request/claude-to-kiro.js +67 -40
  111. package/dist/open-sse/translator/request/openai-responses.js +1 -0
  112. package/dist/open-sse/translator/request/openai-to-commandcode.js +0 -4
  113. package/dist/open-sse/translator/request/openai-to-kiro.js +49 -20
  114. package/dist/open-sse/translator/response/commandcode-to-openai.js +0 -4
  115. package/dist/open-sse/utils/bypassHandler.js +18 -3
  116. package/dist/open-sse/utils/claudeCloaking.js +15 -5
  117. package/dist/open-sse/utils/cursorImages.js +1 -1
  118. package/dist/open-sse/utils/error.js +0 -17
  119. package/dist/open-sse/utils/keepaliveThreshold.js +4 -4
  120. package/dist/open-sse/utils/kiroSessionReplay.js +125 -0
  121. package/dist/open-sse/utils/noThinkingAlias.js +1 -1
  122. package/dist/open-sse/utils/proxyFetch.js +0 -1
  123. package/dist/open-sse/utils/reasoningContentInjector.js +4 -7
  124. package/dist/open-sse/utils/responsesStatePolicy.js +1 -1
  125. package/dist/open-sse/utils/responsesStreamHelpers.js +1 -0
  126. package/dist/open-sse/utils/sessionManager.js +49 -22
  127. package/dist/open-sse/utils/stream.js +54 -77
  128. package/dist/open-sse/utils/streamHandler.js +19 -15
  129. package/dist/open-sse/utils/streamHelpers.js +2 -17
  130. package/dist/open-sse/utils/usageTracking.js +103 -12
  131. package/open-sse/config/appConstants.js +23 -79
  132. package/open-sse/config/errorConfig.js +0 -11
  133. package/open-sse/config/grokCli.js +10 -0
  134. package/open-sse/config/kiroConstants.js +99 -46
  135. package/open-sse/config/runtimeConfig.js +2 -0
  136. package/open-sse/config/ttsModels.js +2 -0
  137. package/open-sse/executors/antigravity.js +250 -164
  138. package/open-sse/executors/base.js +16 -11
  139. package/open-sse/executors/codex.js +269 -1108
  140. package/open-sse/executors/commandcode.js +10 -4
  141. package/open-sse/executors/cursor.js +96 -203
  142. package/open-sse/executors/default.js +146 -244
  143. package/open-sse/executors/github.js +128 -73
  144. package/open-sse/executors/grok-cli.js +527 -94
  145. package/open-sse/executors/grok-web.js +5 -7
  146. package/open-sse/executors/index.js +12 -0
  147. package/open-sse/executors/kiro.js +150 -61
  148. package/open-sse/executors/opencode-go.js +12 -4
  149. package/open-sse/executors/opencode.js +1 -1
  150. package/open-sse/executors/perplexity-web.js +20 -96
  151. package/open-sse/executors/qoder.js +28 -18
  152. package/open-sse/executors/vertex.js +53 -7
  153. package/open-sse/executors/xiaomi-tokenplan.js +6 -5
  154. package/open-sse/handlers/chatCore/nonStreamingHandler.js +97 -85
  155. package/open-sse/handlers/chatCore/requestDetail.js +32 -8
  156. package/open-sse/handlers/chatCore/sseToJsonHandler.js +13 -7
  157. package/open-sse/handlers/chatCore/streamingHandler.js +74 -25
  158. package/open-sse/handlers/chatCore.js +35 -41
  159. package/open-sse/handlers/embeddingProviders/index.js +1 -0
  160. package/open-sse/handlers/embeddingProviders/openai.js +8 -16
  161. package/open-sse/handlers/imageProviders/blackForestLabs.js +2 -21
  162. package/open-sse/handlers/imageProviders/cloudflareAi.js +2 -30
  163. package/open-sse/handlers/imageProviders/codex.js +2 -20
  164. package/open-sse/handlers/imageProviders/comfyui.js +5 -18
  165. package/open-sse/handlers/imageProviders/falAi.js +2 -22
  166. package/open-sse/handlers/imageProviders/gemini.js +2 -16
  167. package/open-sse/handlers/imageProviders/huggingface.js +2 -17
  168. package/open-sse/handlers/imageProviders/index.js +3 -4
  169. package/open-sse/handlers/imageProviders/leonardo.js +1 -1
  170. package/open-sse/handlers/imageProviders/nanobanana.js +4 -23
  171. package/open-sse/handlers/imageProviders/openai.js +15 -43
  172. package/open-sse/handlers/imageProviders/runwayml.js +2 -26
  173. package/open-sse/handlers/imageProviders/sdwebui.js +4 -20
  174. package/open-sse/handlers/imageProviders/stabilityAi.js +2 -26
  175. package/open-sse/handlers/imageProviders/weavy.js +1 -1
  176. package/open-sse/handlers/search/chatSearch.js +60 -14
  177. package/open-sse/handlers/ttsProviders/gemini.js +14 -3
  178. package/open-sse/handlers/ttsProviders/index.js +4 -2
  179. package/open-sse/handlers/ttsProviders/openai.js +4 -1
  180. package/open-sse/handlers/ttsProviders/openrouter.js +7 -4
  181. package/open-sse/handlers/videoCore.js +166 -0
  182. package/open-sse/handlers/videoProviders/weavy.js +1 -1
  183. package/open-sse/mcp-server/audit.js +1 -1
  184. package/open-sse/mcp-server/catalog.js +2 -2
  185. package/open-sse/mcp-server/descriptionCompressor.js +1 -1
  186. package/open-sse/mcp-server/mcpCallerIdentity.js +1 -1
  187. package/open-sse/mcp-server/schemas/tools.js +1 -1
  188. package/open-sse/mcp-server/server.js +4 -4
  189. package/open-sse/mcp-server/tools/advancedTools.js +5 -5
  190. package/open-sse/mcp-server/tools/agentSkillTools.js +1 -1
  191. package/open-sse/mcp-server/tools/compressionTools.js +4 -4
  192. package/open-sse/mcp-server/tools/gamificationTools.js +10 -10
  193. package/open-sse/mcp-server/tools/githubSkillTools.js +1 -1
  194. package/open-sse/mcp-server/tools/memoryTools.js +3 -3
  195. package/open-sse/mcp-server/tools/notionTools.js +2 -2
  196. package/open-sse/mcp-server/tools/obsidianTools.js +2 -2
  197. package/open-sse/mcp-server/tools/pickFastestModel.js +3 -3
  198. package/open-sse/mcp-server/tools/pluginTools.js +4 -4
  199. package/open-sse/mcp-server/tools/skillTools.js +2 -2
  200. package/open-sse/providers/capabilities.js +24 -4
  201. package/open-sse/providers/registry/alicode-intl.js +1 -1
  202. package/open-sse/providers/registry/anthropic.js +1 -8
  203. package/open-sse/providers/registry/codex.js +0 -9
  204. package/open-sse/providers/registry/cohere.js +0 -2
  205. package/open-sse/providers/registry/gemini.js +0 -2
  206. package/open-sse/providers/registry/github.js +9 -6
  207. package/open-sse/providers/registry/grok-cli.js +28 -18
  208. package/open-sse/providers/registry/index.js +74 -80
  209. package/open-sse/providers/registry/kiro.js +12 -0
  210. package/open-sse/providers/registry/mistral.js +0 -3
  211. package/open-sse/providers/registry/openai.js +0 -3
  212. package/open-sse/providers/registry/perplexity.js +0 -2
  213. package/open-sse/providers/registry/xai.js +5 -3
  214. package/open-sse/rtk/autodetect.js +10 -2
  215. package/open-sse/rtk/caveman.js +2 -93
  216. package/open-sse/rtk/cavemanPrompts.js +34 -2
  217. package/open-sse/rtk/constants.js +7 -2
  218. package/open-sse/rtk/headroom.js +133 -0
  219. package/open-sse/rtk/ponytail.js +1 -1
  220. package/open-sse/rtk/registry.js +2 -0
  221. package/open-sse/services/accountFallback.js +0 -108
  222. package/open-sse/services/combo/quotaExhaustionCutoff.js +2 -2
  223. package/open-sse/services/combo/quotaShareStrategy.js +1 -1
  224. package/open-sse/services/combo/resolveAutoStrategy.js +1 -1
  225. package/open-sse/services/combo/sessionStickiness.js +1 -1
  226. package/open-sse/services/combo/shadowRouting.js +1 -1
  227. package/open-sse/services/combo/targetSorters.js +4 -4
  228. package/open-sse/services/combo/validateQuality.js +1 -1
  229. package/open-sse/services/evalRouting.js +1 -1
  230. package/open-sse/services/grokCliModels.js +127 -0
  231. package/open-sse/services/model.js +7 -1
  232. package/open-sse/services/modelCapabilities.js +1 -1
  233. package/open-sse/services/modelFamilyFallback.js +1 -1
  234. package/open-sse/services/provider.js +1 -1
  235. package/open-sse/services/providerCooldownTracker.js +1 -1
  236. package/open-sse/services/rateLimitManager.js +1 -1
  237. package/open-sse/services/tokenRefresh/providers.js +3 -3
  238. package/open-sse/services/usage/codex.js +148 -214
  239. package/open-sse/services/usage/grok-cli.js +61 -7
  240. package/open-sse/services/usage/misc.js +0 -19
  241. package/open-sse/services/usage.js +0 -2
  242. package/open-sse/translator/concerns/paramSupport.js +2 -2
  243. package/open-sse/translator/concerns/thinkingUnified.js +6 -0
  244. package/open-sse/translator/index.js +97 -59
  245. package/open-sse/translator/request/claude-to-kiro.js +67 -40
  246. package/open-sse/translator/request/openai-responses.js +1 -0
  247. package/open-sse/translator/request/openai-to-commandcode.js +0 -4
  248. package/open-sse/translator/request/openai-to-kiro.js +49 -20
  249. package/open-sse/translator/response/commandcode-to-openai.js +0 -4
  250. package/open-sse/utils/bypassHandler.js +18 -3
  251. package/open-sse/utils/claudeCloaking.js +15 -5
  252. package/open-sse/utils/error.js +0 -17
  253. package/open-sse/utils/kiroSessionReplay.js +125 -0
  254. package/open-sse/utils/logger.js +1 -1
  255. package/open-sse/utils/proxyFetch.js +0 -1
  256. package/open-sse/utils/reasoningContentInjector.js +4 -7
  257. package/open-sse/utils/responsesStreamHelpers.js +1 -0
  258. package/open-sse/utils/sessionManager.js +49 -22
  259. package/open-sse/utils/stream.js +54 -77
  260. package/open-sse/utils/streamHandler.js +19 -15
  261. package/open-sse/utils/streamHelpers.js +2 -17
  262. package/open-sse/utils/usageTracking.js +103 -12
  263. package/package.json +4 -7
  264. package/public/assets/{EndpointPageClient.CGB3HjDe.js → EndpointPageClient.LyNNvZ4z.js} +3 -3
  265. package/public/assets/{Loading.BhEzHe-X.js → Loading.Bj-WGl4k.js} +1 -1
  266. package/public/assets/{NoAuthProxyCard.Buvt0BVH.js → NoAuthProxyCard.qAv57b-0.js} +1 -1
  267. package/public/assets/{index.B-zMpSp_.js → index.CShjRV_B.js} +41 -41
  268. package/public/assets/{page.BINfJPNt.js → page.1qjqvrwX.js} +1 -1
  269. package/public/assets/{page.CfDkX9XZ.js → page.BSLJ4tx5.js} +1 -1
  270. package/public/assets/{page.D6TULIkh.js → page.BbO1pspY.js} +1 -1
  271. package/public/assets/page.BdmJ3yY3.js +5 -0
  272. package/public/assets/{page.Amtgxj_r.js → page.BnmTC5jG.js} +1 -1
  273. package/public/assets/{page.3QwV1pLl.js → page.C72FTTJr.js} +1 -1
  274. package/public/assets/{page.CdbMx9XI.js → page.CPZav1_c.js} +1 -1
  275. package/public/assets/{page.BONoTspJ.js → page.CQlVGoXg.js} +1 -1
  276. package/public/assets/{page.DgnlzpNx.js → page.CSs3-gdt.js} +1 -1
  277. package/public/assets/{page.BV28PqHr.js → page.CXd_R9yU.js} +1 -1
  278. package/public/assets/{page.5Aj6RvuD.js → page.CbkENBd5.js} +1 -1
  279. package/public/assets/{page.BAjUiqtJ.js → page.ChX1NqmC.js} +1 -1
  280. package/public/assets/page.Cj5h09Zo.js +1 -0
  281. package/public/assets/{page.CB__T51y.js → page.CnTop8Zt.js} +1 -1
  282. package/public/assets/{page.BMf0BFTW.js → page.CssmrzTT.js} +1 -1
  283. package/public/assets/{page.CVu_9TAu.js → page.CsxWmPoI.js} +1 -1
  284. package/public/assets/{page.ClXnUNhb.js → page.CzlQTyAL.js} +1 -1
  285. package/public/assets/{page.DAgwiopx.js → page.D1oKew1j.js} +1 -1
  286. package/public/assets/{page.BIG_uMBA.js → page.D5gj98Oe.js} +1 -1
  287. package/public/assets/{page.BW6Rv-_k.js → page.DBhu4Arl.js} +1 -1
  288. package/public/assets/page.DD_czjjP.js +1 -0
  289. package/public/assets/{page.BmOXfa4k.js → page.DPyOkPVo.js} +1 -1
  290. package/public/assets/{page.CTdMdgI4.js → page.DUI8kqOY.js} +1 -1
  291. package/public/assets/{page.BdPGDnx0.js → page.DVIHRbxB.js} +1 -1
  292. package/public/assets/{page.B9r7QI90.js → page.DX4Nno6M.js} +1 -1
  293. package/public/assets/{page.BCPmNscX.js → page.Dh5f0XJC.js} +1 -1
  294. package/public/assets/{page.u7XFxplU.js → page.DibhF7f-.js} +1 -1
  295. package/public/assets/{page.CDVZIbSe.js → page.DxMDTbSx.js} +1 -1
  296. package/public/assets/{page.Bb3E5EzI.js → page.Dx_GRRdT.js} +1 -1
  297. package/public/assets/{page.DhcizW_i.js → page.DzZLqI5Q.js} +1 -1
  298. package/public/assets/{page.CF5pD5lz.js → page.Ir7KvKcF.js} +1 -1
  299. package/public/assets/{page.Bj0au_ka.js → page.O2ddJYoT.js} +3 -3
  300. package/public/assets/{page.DIrcssm-.js → page.Qkkv8roc.js} +1 -1
  301. package/public/assets/{page.CrzjUbZg.js → page.i4KDuWcM.js} +1 -1
  302. package/public/assets/{page.1gncE-Vr.js → page.sOFOrxqq.js} +1 -1
  303. package/public/assets/{page.DskvkVIF.js → page.vla5Mzki.js} +1 -1
  304. package/public/index.html +1 -1
  305. package/public/assets/EndpointPageClient.Cee8kfmV.js +0 -6
  306. package/public/assets/EndpointPageClient.DdAfxJoK.js +0 -6
  307. package/public/assets/EndpointPageClient.GpJ_FKds.js +0 -6
  308. package/public/assets/Loading.DFkQ-Ly9.js +0 -1
  309. package/public/assets/Loading.DaQG3sHF.js +0 -1
  310. package/public/assets/Loading.QMOYJhLu.js +0 -1
  311. package/public/assets/NoAuthProxyCard.C18iZ3Fk.js +0 -89
  312. package/public/assets/NoAuthProxyCard.DyEjms20.js +0 -89
  313. package/public/assets/NoAuthProxyCard.VRP7gDcs.js +0 -89
  314. package/public/assets/index.CoYbjSIL.js +0 -89
  315. package/public/assets/index.DQDDDpp7.js +0 -89
  316. package/public/assets/index.KMEObSAk.js +0 -89
  317. package/public/assets/page.A7FRfarX.js +0 -1
  318. package/public/assets/page.B1a01Vfg.js +0 -1
  319. package/public/assets/page.B7h6EPVo.js +0 -1
  320. package/public/assets/page.BBMJAyy7.js +0 -1
  321. package/public/assets/page.BBSUQskO.js +0 -64
  322. package/public/assets/page.BFENid_V.js +0 -31
  323. package/public/assets/page.BJzBUr1v.js +0 -2
  324. package/public/assets/page.BKM5Up2Y.js +0 -1
  325. package/public/assets/page.BLUEyope.js +0 -1
  326. package/public/assets/page.BMeBT03D.js +0 -5
  327. package/public/assets/page.BQwH91-m.js +0 -1
  328. package/public/assets/page.BRgXbpJe.js +0 -1
  329. package/public/assets/page.BXq7Sixg.js +0 -1
  330. package/public/assets/page.Bbf1xxJj.js +0 -1
  331. package/public/assets/page.BcuklMLO.js +0 -2
  332. package/public/assets/page.Bi5OEfgq.js +0 -1
  333. package/public/assets/page.Bi9gIWN0.js +0 -1
  334. package/public/assets/page.BiLGOe6j.js +0 -1
  335. package/public/assets/page.BicDCwTa.js +0 -1
  336. package/public/assets/page.Bjd38gaf.js +0 -1
  337. package/public/assets/page.Bqk4tX-5.js +0 -1
  338. package/public/assets/page.BrrSjbBJ.js +0 -1
  339. package/public/assets/page.BsUeE2Y_.js +0 -1
  340. package/public/assets/page.BthVvW1e.js +0 -64
  341. package/public/assets/page.BxAWh20c.js +0 -1
  342. package/public/assets/page.C-2GmPmS.js +0 -4
  343. package/public/assets/page.C27wrrub.js +0 -1
  344. package/public/assets/page.C3FwsCq_.js +0 -23
  345. package/public/assets/page.C4RMU4Xv.js +0 -23
  346. package/public/assets/page.C7SC9vwX.js +0 -1
  347. package/public/assets/page.C8gTAwsH.js +0 -5
  348. package/public/assets/page.CECQKY1y.js +0 -5
  349. package/public/assets/page.CEN8xgCA.js +0 -1
  350. package/public/assets/page.CHG9mx5l.js +0 -1
  351. package/public/assets/page.CMUOu9fe.js +0 -1
  352. package/public/assets/page.CRex977Y.js +0 -5
  353. package/public/assets/page.CUsb0F5t.js +0 -1
  354. package/public/assets/page.CXE5AWV3.js +0 -1
  355. package/public/assets/page.CXIP8Wzi.js +0 -4
  356. package/public/assets/page.CXOuLQhq.js +0 -1
  357. package/public/assets/page.CXPMjDX9.js +0 -1
  358. package/public/assets/page.CXPPlybJ.js +0 -6
  359. package/public/assets/page.CYfjd9SF.js +0 -1
  360. package/public/assets/page.CZtbttgE.js +0 -1
  361. package/public/assets/page.CbOSwuwi.js +0 -1
  362. package/public/assets/page.CbWWyTC4.js +0 -1
  363. package/public/assets/page.CfXJWUgA.js +0 -1
  364. package/public/assets/page.CfdTLncK.js +0 -1
  365. package/public/assets/page.ChqEg6y-.js +0 -1
  366. package/public/assets/page.CmbatQd6.js +0 -4
  367. package/public/assets/page.Cp7XaHGI.js +0 -1
  368. package/public/assets/page.CqR-Z0pY.js +0 -1
  369. package/public/assets/page.CsLBZFbk.js +0 -1
  370. package/public/assets/page.CyqTG9Kn.js +0 -2
  371. package/public/assets/page.CzKSjT-r.js +0 -1
  372. package/public/assets/page.D1S50DvR.js +0 -1
  373. package/public/assets/page.D3b1o69R.js +0 -5
  374. package/public/assets/page.D5B_p_2E.js +0 -31
  375. package/public/assets/page.D8X-8LSd.js +0 -2
  376. package/public/assets/page.DA2dX7iN.js +0 -1
  377. package/public/assets/page.DBNjxgJS.js +0 -6
  378. package/public/assets/page.DEBBy5qz.js +0 -1
  379. package/public/assets/page.DEOXc6iv.js +0 -6
  380. package/public/assets/page.DG46DZcu.js +0 -1
  381. package/public/assets/page.DGAKp9YS.js +0 -1
  382. package/public/assets/page.DGico7sP.js +0 -1
  383. package/public/assets/page.DHBHS2oS.js +0 -1
  384. package/public/assets/page.DKdtfq8E.js +0 -2
  385. package/public/assets/page.DKj8qFYb.js +0 -1
  386. package/public/assets/page.DNofNt4p.js +0 -1
  387. package/public/assets/page.DVdv-E5d.js +0 -1
  388. package/public/assets/page.Da-kutqN.js +0 -1
  389. package/public/assets/page.DaW7T6nt.js +0 -1
  390. package/public/assets/page.DhPzWwGm.js +0 -1
  391. package/public/assets/page.Dju6Kwa5.js +0 -1
  392. package/public/assets/page.Dlh3Q_rt.js +0 -1
  393. package/public/assets/page.DmNhmYKk.js +0 -64
  394. package/public/assets/page.Dmvhu2ua.js +0 -1
  395. package/public/assets/page.Dp30ZzXE.js +0 -1
  396. package/public/assets/page.DsY8qNEU.js +0 -1
  397. package/public/assets/page.DtGEStU7.js +0 -1
  398. package/public/assets/page.DuXsnK8A.js +0 -1
  399. package/public/assets/page.DwU6Ubqf.js +0 -1
  400. package/public/assets/page.FmrKiZlG.js +0 -2
  401. package/public/assets/page.GSAm83Cv.js +0 -6
  402. package/public/assets/page.IgH-AWcu.js +0 -1
  403. package/public/assets/page.Ii8wGSnt.js +0 -1
  404. package/public/assets/page.KtURQA9Q.js +0 -1
  405. package/public/assets/page.NFGJtdfx.js +0 -1
  406. package/public/assets/page.QPaIzKAa.js +0 -1
  407. package/public/assets/page.QuBXfL80.js +0 -1
  408. package/public/assets/page.S02TdGZT.js +0 -1
  409. package/public/assets/page.V3CmUOJF.js +0 -1
  410. package/public/assets/page.VClP2n2B.js +0 -1
  411. package/public/assets/page.Vo9Oe8DJ.js +0 -1
  412. package/public/assets/page.WIMFvXoG.js +0 -1
  413. package/public/assets/page.XUya1XZj.js +0 -23
  414. package/public/assets/page.XqKIvnmq.js +0 -31
  415. package/public/assets/page.aAUPKg0H.js +0 -1
  416. package/public/assets/page.aRQdaBbf.js +0 -1
  417. package/public/assets/page.e-Zxfi03.js +0 -1
  418. package/public/assets/page.e-cA5aB5.js +0 -6
  419. package/public/assets/page.eNXd9f58.js +0 -6
  420. package/public/assets/page.gj2B5h2d.js +0 -1
  421. package/public/assets/page.gvZgqycR.js +0 -1
  422. package/public/assets/page.jvowBQYJ.js +0 -1
  423. package/public/assets/page.k_WzlZwU.js +0 -5
  424. package/public/assets/page.qK1RUb_S.js +0 -1
  425. package/public/assets/page.ryYPRTww.js +0 -1
  426. package/public/assets/page.xm98_0dX.js +0 -5
  427. package/public/assets/page.yjCJ-4Uh.js +0 -1
  428. package/public/providers/agentrouter.webp +0 -0
  429. package/public/providers/codebuddy-cn.webp +0 -0
  430. package/public/providers/gigachat.webp +0 -0
  431. package/public/providers/heroku.webp +0 -0
  432. package/public/providers/kimchi.webp +0 -0
  433. package/public/providers/llamagate.webp +0 -0
  434. package/public/providers/mimo-free.webp +0 -0
  435. package/public/providers/nanogpt.webp +0 -0
  436. package/public/providers/nscale.webp +0 -0
  437. package/public/providers/ovhcloud.webp +0 -0
  438. package/public/providers/predibase.webp +0 -0
  439. package/public/providers/zcode.webp +0 -0
@@ -1,5 +0,0 @@
1
- import{u as kn,j as h,B as Je,C as In,M as An}from"./index.B-zMpSp_.js";import{b as a,W as U,c as Te}from"./router.Cjj1--8t.js";import{C as Jt,I as Tn,M as On}from"./NoAuthProxyCard.VRP7gDcs.js";import{C as Lt}from"./Loading.BhEzHe-X.js";import"./zustand.akaTi5uX.js";function Ln(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a.useMemo(()=>r=>{t.forEach(o=>o(r))},t)}const nt=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Se(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function bt(e){return"nodeType"in e}function X(e){var t,n;return e?Se(e)?e:bt(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function xt(e){const{Document:t}=X(e);return e instanceof t}function Ue(e){return Se(e)?!1:e instanceof X(e).HTMLElement}function Qt(e){return e instanceof X(e).SVGElement}function Re(e){return e?Se(e)?e.document:bt(e)?xt(e)?e:Ue(e)||Qt(e)?e.ownerDocument:document:document:document}const re=nt?a.useLayoutEffect:a.useEffect;function wt(e){const t=a.useRef(e);return re(()=>{t.current=e}),a.useCallback(function(){for(var n=arguments.length,r=new Array(n),o=0;o<n;o++)r[o]=arguments[o];return t.current==null?void 0:t.current(...r)},[])}function zn(){const e=a.useRef(null),t=a.useCallback((r,o)=>{e.current=setInterval(r,o)},[]),n=a.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function Pe(e,t){t===void 0&&(t=[e]);const n=a.useRef(e);return re(()=>{n.current!==e&&(n.current=e)},t),n}function Xe(e,t){const n=a.useRef();return a.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function Qe(e){const t=wt(e),n=a.useRef(null),r=a.useCallback(o=>{o!==n.current&&(t==null||t(o,n.current)),n.current=o},[]);return[n,r]}function ht(e){const t=a.useRef();return a.useEffect(()=>{t.current=e},[e]),t.current}let ct={};function We(e,t){return a.useMemo(()=>{if(t)return t;const n=ct[e]==null?0:ct[e]+1;return ct[e]=n,e+"-"+n},[e,t])}function Zt(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];return r.reduce((s,i)=>{const l=Object.entries(i);for(const[c,u]of l){const f=s[c];f!=null&&(s[c]=f+e*u)}return s},{...t})}}const De=Zt(1),Be=Zt(-1);function Pn(e){return"clientX"in e&&"clientY"in e}function yt(e){if(!e)return!1;const{KeyboardEvent:t}=X(e.target);return t&&e instanceof t}function Bn(e){if(!e)return!1;const{TouchEvent:t}=X(e.target);return t&&e instanceof t}function gt(e){if(Bn(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return Pn(e)?{x:e.clientX,y:e.clientY}:null}const Fe=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Fe.Translate.toString(e),Fe.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),zt="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Fn(e){return e.matches(zt)?e:e.querySelector(zt)}const $n={display:"none"};function Un(e){let{id:t,value:n}=e;return U.createElement("div",{id:t,style:$n},n)}function Xn(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const o={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return U.createElement("div",{id:t,style:o,role:"status","aria-live":r,"aria-atomic":!0},n)}function Wn(){const[e,t]=a.useState("");return{announce:a.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const en=a.createContext(null);function Yn(e){const t=a.useContext(en);a.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function Hn(){const[e]=a.useState(()=>new Set),t=a.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[a.useCallback(r=>{let{type:o,event:s}=r;e.forEach(i=>{var l;return(l=i[o])==null?void 0:l.call(i,s)})},[e]),t]}const Kn={draggable:`
2
- To pick up a draggable item, press the space bar.
3
- While dragging, use the arrow keys to move the item.
4
- Press space again to drop the item in its new position, or press escape to cancel.
5
- `},Vn={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function _n(e){let{announcements:t=Vn,container:n,hiddenTextDescribedById:r,screenReaderInstructions:o=Kn}=e;const{announce:s,announcement:i}=Wn(),l=We("DndLiveRegion"),[c,u]=a.useState(!1);if(a.useEffect(()=>{u(!0)},[]),Yn(a.useMemo(()=>({onDragStart(d){let{active:g}=d;s(t.onDragStart({active:g}))},onDragMove(d){let{active:g,over:p}=d;t.onDragMove&&s(t.onDragMove({active:g,over:p}))},onDragOver(d){let{active:g,over:p}=d;s(t.onDragOver({active:g,over:p}))},onDragEnd(d){let{active:g,over:p}=d;s(t.onDragEnd({active:g,over:p}))},onDragCancel(d){let{active:g,over:p}=d;s(t.onDragCancel({active:g,over:p}))}}),[s,t])),!c)return null;const f=U.createElement(U.Fragment,null,U.createElement(Un,{id:r,value:o.draggable}),U.createElement(Xn,{id:l,announcement:i}));return n?Te.createPortal(f,n):f}var L;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(L||(L={}));function Ze(){}function Pt(e,t){return a.useMemo(()=>({sensor:e,options:t??{}}),[e,t])}function qn(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return a.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const Z=Object.freeze({x:0,y:0});function tn(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function nn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function Gn(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Bt(e){let{left:t,top:n,height:r,width:o}=e;return[{x:t,y:n},{x:t+o,y:n},{x:t,y:n+r},{x:t+o,y:n+r}]}function rn(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}function Ft(e,t,n){return t===void 0&&(t=e.left),n===void 0&&(n=e.top),{x:t+e.width*.5,y:n+e.height*.5}}const Jn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Ft(t,t.left,t.top),s=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const u=tn(Ft(c),o);s.push({id:l,data:{droppableContainer:i,value:u}})}}return s.sort(nn)},Qn=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=Bt(t),s=[];for(const i of r){const{id:l}=i,c=n.get(l);if(c){const u=Bt(c),f=o.reduce((g,p,R)=>g+tn(u[R],p),0),d=Number((f/4).toFixed(4));s.push({id:l,data:{droppableContainer:i,value:d}})}}return s.sort(nn)};function Zn(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),o=Math.min(t.left+t.width,e.left+e.width),s=Math.min(t.top+t.height,e.top+e.height),i=o-r,l=s-n;if(r<o&&n<s){const c=t.width*t.height,u=e.width*e.height,f=i*l,d=f/(c+u-f);return Number(d.toFixed(4))}return 0}const er=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const o=[];for(const s of r){const{id:i}=s,l=n.get(i);if(l){const c=Zn(l,t);c>0&&o.push({id:i,data:{droppableContainer:s,value:c}})}}return o.sort(Gn)};function tr(e,t,n){return{...e,scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1}}function on(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:Z}function nr(e){return function(n){for(var r=arguments.length,o=new Array(r>1?r-1:0),s=1;s<r;s++)o[s-1]=arguments[s];return o.reduce((i,l)=>({...i,top:i.top+e*l.y,bottom:i.bottom+e*l.y,left:i.left+e*l.x,right:i.right+e*l.x}),{...n})}}const rr=nr(1);function or(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function sr(e,t,n){const r=or(t);if(!r)return e;const{scaleX:o,scaleY:s,x:i,y:l}=r,c=e.left-i-(1-o)*parseFloat(n),u=e.top-l-(1-s)*parseFloat(n.slice(n.indexOf(" ")+1)),f=o?e.width/o:e.width,d=s?e.height/s:e.height;return{width:f,height:d,top:u,right:c+f,bottom:u+d,left:c}}const ir={ignoreTransform:!1};function Ee(e,t){t===void 0&&(t=ir);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:u,transformOrigin:f}=X(e).getComputedStyle(e);u&&(n=sr(n,u,f))}const{top:r,left:o,width:s,height:i,bottom:l,right:c}=n;return{top:r,left:o,width:s,height:i,bottom:l,right:c}}function $t(e){return Ee(e,{ignoreTransform:!0})}function ar(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function lr(e,t){return t===void 0&&(t=X(e).getComputedStyle(e)),t.position==="fixed"}function cr(e,t){t===void 0&&(t=X(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(o=>{const s=t[o];return typeof s=="string"?n.test(s):!1})}function rt(e,t){const n=[];function r(o){if(t!=null&&n.length>=t||!o)return n;if(xt(o)&&o.scrollingElement!=null&&!n.includes(o.scrollingElement))return n.push(o.scrollingElement),n;if(!Ue(o)||Qt(o)||n.includes(o))return n;const s=X(e).getComputedStyle(o);return o!==e&&cr(o,s)&&n.push(o),lr(o,s)?n:r(o.parentNode)}return e?r(e):n}function sn(e){const[t]=rt(e,1);return t??null}function ut(e){return!nt||!e?null:Se(e)?e:bt(e)?xt(e)||e===Re(e).scrollingElement?window:Ue(e)?e:null:null}function an(e){return Se(e)?e.scrollX:e.scrollLeft}function ln(e){return Se(e)?e.scrollY:e.scrollTop}function pt(e){return{x:an(e),y:ln(e)}}var z;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(z||(z={}));function cn(e){return!nt||!e?!1:e===document.scrollingElement}function un(e){const t={x:0,y:0},n=cn(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},o=e.scrollTop<=t.y,s=e.scrollLeft<=t.x,i=e.scrollTop>=r.y,l=e.scrollLeft>=r.x;return{isTop:o,isLeft:s,isBottom:i,isRight:l,maxScroll:r,minScroll:t}}const ur={x:.2,y:.2};function dr(e,t,n,r,o){let{top:s,left:i,right:l,bottom:c}=n;r===void 0&&(r=10),o===void 0&&(o=ur);const{isTop:u,isBottom:f,isLeft:d,isRight:g}=un(e),p={x:0,y:0},R={x:0,y:0},m={height:t.height*o.y,width:t.width*o.x};return!u&&s<=t.top+m.height?(p.y=z.Backward,R.y=r*Math.abs((t.top+m.height-s)/m.height)):!f&&c>=t.bottom-m.height&&(p.y=z.Forward,R.y=r*Math.abs((t.bottom-m.height-c)/m.height)),!g&&l>=t.right-m.width?(p.x=z.Forward,R.x=r*Math.abs((t.right-m.width-l)/m.width)):!d&&i<=t.left+m.width&&(p.x=z.Backward,R.x=r*Math.abs((t.left+m.width-i)/m.width)),{direction:p,speed:R}}function fr(e){if(e===document.scrollingElement){const{innerWidth:s,innerHeight:i}=window;return{top:0,left:0,right:s,bottom:i,width:s,height:i}}const{top:t,left:n,right:r,bottom:o}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:o,width:e.clientWidth,height:e.clientHeight}}function dn(e){return e.reduce((t,n)=>De(t,pt(n)),Z)}function hr(e){return e.reduce((t,n)=>t+an(n),0)}function gr(e){return e.reduce((t,n)=>t+ln(n),0)}function pr(e,t){if(t===void 0&&(t=Ee),!e)return;const{top:n,left:r,bottom:o,right:s}=t(e);sn(e)&&(o<=0||s<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const vr=[["x",["left","right"],hr],["y",["top","bottom"],gr]];class Ct{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=rt(n),o=dn(r);this.rect={...t},this.width=t.width,this.height=t.height;for(const[s,i,l]of vr)for(const c of i)Object.defineProperty(this,c,{get:()=>{const u=l(r),f=o[s]-u;return this.rect[c]+f},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class Oe{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var o;(o=this.target)==null||o.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function mr(e){const{EventTarget:t}=X(e);return e instanceof t?e:Re(e)}function dt(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(n**2+r**2)>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var J;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(J||(J={}));function Ut(e){e.preventDefault()}function br(e){e.stopPropagation()}var M;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(M||(M={}));const fn={start:[M.Space,M.Enter],cancel:[M.Esc],end:[M.Space,M.Enter,M.Tab]},xr=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case M.Right:return{...n,x:n.x+25};case M.Left:return{...n,x:n.x-25};case M.Down:return{...n,y:n.y+25};case M.Up:return{...n,y:n.y-25}}};class Dt{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new Oe(Re(n)),this.windowListeners=new Oe(X(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(J.Resize,this.handleCancel),this.windowListeners.add(J.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(J.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&pr(r),n(Z)}handleKeyDown(t){if(yt(t)){const{active:n,context:r,options:o}=this.props,{keyboardCodes:s=fn,coordinateGetter:i=xr,scrollBehavior:l="smooth"}=o,{code:c}=t;if(s.end.includes(c)){this.handleEnd(t);return}if(s.cancel.includes(c)){this.handleCancel(t);return}const{collisionRect:u}=r.current,f=u?{x:u.left,y:u.top}:Z;this.referenceCoordinates||(this.referenceCoordinates=f);const d=i(t,{active:n,context:r.current,currentCoordinates:f});if(d){const g=Be(d,f),p={x:0,y:0},{scrollableAncestors:R}=r.current;for(const m of R){const x=t.code,{isTop:S,isRight:D,isLeft:y,isBottom:N,maxScroll:v,minScroll:w}=un(m),b=fr(m),E={x:Math.min(x===M.Right?b.right-b.width/2:b.right,Math.max(x===M.Right?b.left:b.left+b.width/2,d.x)),y:Math.min(x===M.Down?b.bottom-b.height/2:b.bottom,Math.max(x===M.Down?b.top:b.top+b.height/2,d.y))},T=x===M.Right&&!D||x===M.Left&&!y,O=x===M.Down&&!N||x===M.Up&&!S;if(T&&E.x!==d.x){const k=m.scrollLeft+g.x,W=x===M.Right&&k<=v.x||x===M.Left&&k>=w.x;if(W&&!g.y){m.scrollTo({left:k,behavior:l});return}W?p.x=m.scrollLeft-k:p.x=x===M.Right?m.scrollLeft-v.x:m.scrollLeft-w.x,p.x&&m.scrollBy({left:-p.x,behavior:l});break}else if(O&&E.y!==d.y){const k=m.scrollTop+g.y,W=x===M.Down&&k<=v.y||x===M.Up&&k>=w.y;if(W&&!g.x){m.scrollTo({top:k,behavior:l});return}W?p.y=m.scrollTop-k:p.y=x===M.Down?m.scrollTop-v.y:m.scrollTop-w.y,p.y&&m.scrollBy({top:-p.y,behavior:l});break}}this.handleMove(t,De(Be(d,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Dt.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=fn,onActivation:o}=t,{active:s}=n;const{code:i}=e.nativeEvent;if(r.start.includes(i)){const l=s.activatorNode.current;return l&&e.target!==l?!1:(e.preventDefault(),o==null||o({event:e.nativeEvent}),!0)}return!1}}];function Xt(e){return!!(e&&"distance"in e)}function Wt(e){return!!(e&&"delay"in e)}class St{constructor(t,n,r){var o;r===void 0&&(r=mr(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:s}=t,{target:i}=s;this.props=t,this.events=n,this.document=Re(i),this.documentListeners=new Oe(this.document),this.listeners=new Oe(r),this.windowListeners=new Oe(X(i)),this.initialCoordinates=(o=gt(s))!=null?o:Z,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(J.Resize,this.handleCancel),this.windowListeners.add(J.DragStart,Ut),this.windowListeners.add(J.VisibilityChange,this.handleCancel),this.windowListeners.add(J.ContextMenu,Ut),this.documentListeners.add(J.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(Wt(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Xt(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:o}=this.props;o(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(J.Click,br,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(J.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:o,props:s}=this,{onMove:i,options:{activationConstraint:l}}=s;if(!o)return;const c=(n=gt(t))!=null?n:Z,u=Be(o,c);if(!r&&l){if(Xt(l)){if(l.tolerance!=null&&dt(u,l.tolerance))return this.handleCancel();if(dt(u,l.distance))return this.handleStart()}if(Wt(l)&&dt(u,l.tolerance))return this.handleCancel();this.handlePending(l,u);return}t.cancelable&&t.preventDefault(),i(c)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===M.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const wr={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class Rt extends St{constructor(t){const{event:n}=t,r=Re(n.target);super(t,wr,r)}}Rt.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const yr={move:{name:"mousemove"},end:{name:"mouseup"}};var vt;(function(e){e[e.RightClick=2]="RightClick"})(vt||(vt={}));class Cr extends St{constructor(t){super(t,yr,Re(t.event.target))}}Cr.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===vt.RightClick?!1:(r==null||r({event:n}),!0)}}];const ft={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Dr extends St{constructor(t){super(t,ft)}static setup(){return window.addEventListener(ft.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(ft.move.name,t)};function t(){}}}Dr.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:o}=n;return o.length>1?!1:(r==null||r({event:n}),!0)}}];var Le;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(Le||(Le={}));var et;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(et||(et={}));function Sr(e){let{acceleration:t,activator:n=Le.Pointer,canScroll:r,draggingRect:o,enabled:s,interval:i=5,order:l=et.TreeOrder,pointerCoordinates:c,scrollableAncestors:u,scrollableAncestorRects:f,delta:d,threshold:g}=e;const p=Er({delta:d,disabled:!s}),[R,m]=zn(),x=a.useRef({x:0,y:0}),S=a.useRef({x:0,y:0}),D=a.useMemo(()=>{switch(n){case Le.Pointer:return c?{top:c.y,bottom:c.y,left:c.x,right:c.x}:null;case Le.DraggableRect:return o}},[n,o,c]),y=a.useRef(null),N=a.useCallback(()=>{const w=y.current;if(!w)return;const b=x.current.x*S.current.x,E=x.current.y*S.current.y;w.scrollBy(b,E)},[]),v=a.useMemo(()=>l===et.TreeOrder?[...u].reverse():u,[l,u]);a.useEffect(()=>{if(!s||!u.length||!D){m();return}for(const w of v){if((r==null?void 0:r(w))===!1)continue;const b=u.indexOf(w),E=f[b];if(!E)continue;const{direction:T,speed:O}=dr(w,E,D,t,g);for(const k of["x","y"])p[k][T[k]]||(O[k]=0,T[k]=0);if(O.x>0||O.y>0){m(),y.current=w,R(N,i),x.current=O,S.current=T;return}}x.current={x:0,y:0},S.current={x:0,y:0},m()},[t,N,r,m,s,i,JSON.stringify(D),JSON.stringify(p),R,u,v,f,JSON.stringify(g)])}const Rr={x:{[z.Backward]:!1,[z.Forward]:!1},y:{[z.Backward]:!1,[z.Forward]:!1}};function Er(e){let{delta:t,disabled:n}=e;const r=ht(t);return Xe(o=>{if(n||!r||!o)return Rr;const s={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[z.Backward]:o.x[z.Backward]||s.x===-1,[z.Forward]:o.x[z.Forward]||s.x===1},y:{[z.Backward]:o.y[z.Backward]||s.y===-1,[z.Forward]:o.y[z.Forward]||s.y===1}}},[n,t,r])}function Nr(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return Xe(o=>{var s;return t==null?null:(s=r??o)!=null?s:null},[r,t])}function Mr(e,t){return a.useMemo(()=>e.reduce((n,r)=>{const{sensor:o}=r,s=o.activators.map(i=>({eventName:i.eventName,handler:t(i.handler,r)}));return[...n,...s]},[]),[e,t])}var $e;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})($e||($e={}));var mt;(function(e){e.Optimized="optimized"})(mt||(mt={}));const Yt=new Map;function jr(e,t){let{dragging:n,dependencies:r,config:o}=t;const[s,i]=a.useState(null),{frequency:l,measure:c,strategy:u}=o,f=a.useRef(e),d=x(),g=Pe(d),p=a.useCallback(function(S){S===void 0&&(S=[]),!g.current&&i(D=>D===null?S:D.concat(S.filter(y=>!D.includes(y))))},[g]),R=a.useRef(null),m=Xe(S=>{if(d&&!n)return Yt;if(!S||S===Yt||f.current!==e||s!=null){const D=new Map;for(let y of e){if(!y)continue;if(s&&s.length>0&&!s.includes(y.id)&&y.rect.current){D.set(y.id,y.rect.current);continue}const N=y.node.current,v=N?new Ct(c(N),N):null;y.rect.current=v,v&&D.set(y.id,v)}return D}return S},[e,s,n,d,c]);return a.useEffect(()=>{f.current=e},[e]),a.useEffect(()=>{d||p()},[n,d]),a.useEffect(()=>{s&&s.length>0&&i(null)},[JSON.stringify(s)]),a.useEffect(()=>{d||typeof l!="number"||R.current!==null||(R.current=setTimeout(()=>{p(),R.current=null},l))},[l,d,p,...r]),{droppableRects:m,measureDroppableContainers:p,measuringScheduled:s!=null};function x(){switch(u){case $e.Always:return!1;case $e.BeforeDragging:return n;default:return!n}}}function hn(e,t){return Xe(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function kr(e,t){return hn(e,t)}function Ir(e){let{callback:t,disabled:n}=e;const r=wt(t),o=a.useMemo(()=>{if(n||typeof window>"u"||typeof window.MutationObserver>"u")return;const{MutationObserver:s}=window;return new s(r)},[r,n]);return a.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function ot(e){let{callback:t,disabled:n}=e;const r=wt(t),o=a.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:s}=window;return new s(r)},[n]);return a.useEffect(()=>()=>o==null?void 0:o.disconnect(),[o]),o}function Ar(e){return new Ct(Ee(e),e)}function Ht(e,t,n){t===void 0&&(t=Ar);const[r,o]=a.useState(null);function s(){o(c=>{if(!e)return null;if(e.isConnected===!1){var u;return(u=c??n)!=null?u:null}const f=t(e);return JSON.stringify(c)===JSON.stringify(f)?c:f})}const i=Ir({callback(c){if(e)for(const u of c){const{type:f,target:d}=u;if(f==="childList"&&d instanceof HTMLElement&&d.contains(e)){s();break}}}}),l=ot({callback:s});return re(()=>{s(),e?(l==null||l.observe(e),i==null||i.observe(document.body,{childList:!0,subtree:!0})):(l==null||l.disconnect(),i==null||i.disconnect())},[e]),r}function Tr(e){const t=hn(e);return on(e,t)}const Kt=[];function Or(e){const t=a.useRef(e),n=Xe(r=>e?r&&r!==Kt&&e&&t.current&&e.parentNode===t.current.parentNode?r:rt(e):Kt,[e]);return a.useEffect(()=>{t.current=e},[e]),n}function Lr(e){const[t,n]=a.useState(null),r=a.useRef(e),o=a.useCallback(s=>{const i=ut(s.target);i&&n(l=>l?(l.set(i,pt(i)),new Map(l)):null)},[]);return a.useEffect(()=>{const s=r.current;if(e!==s){i(s);const l=e.map(c=>{const u=ut(c);return u?(u.addEventListener("scroll",o,{passive:!0}),[u,pt(u)]):null}).filter(c=>c!=null);n(l.length?new Map(l):null),r.current=e}return()=>{i(e),i(s)};function i(l){l.forEach(c=>{const u=ut(c);u==null||u.removeEventListener("scroll",o)})}},[o,e]),a.useMemo(()=>e.length?t?Array.from(t.values()).reduce((s,i)=>De(s,i),Z):dn(e):Z,[e,t])}function Vt(e,t){t===void 0&&(t=[]);const n=a.useRef(null);return a.useEffect(()=>{n.current=null},t),a.useEffect(()=>{const r=e!==Z;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?Be(e,n.current):Z}function zr(e){a.useEffect(()=>{if(!nt)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function Pr(e,t){return a.useMemo(()=>e.reduce((n,r)=>{let{eventName:o,handler:s}=r;return n[o]=i=>{s(i,t)},n},{}),[e,t])}function gn(e){return a.useMemo(()=>e?ar(e):null,[e])}const _t=[];function Br(e,t){t===void 0&&(t=Ee);const[n]=e,r=gn(n?X(n):null),[o,s]=a.useState(_t);function i(){s(()=>e.length?e.map(c=>cn(c)?r:new Ct(t(c),c)):_t)}const l=ot({callback:i});return re(()=>{l==null||l.disconnect(),i(),e.forEach(c=>l==null?void 0:l.observe(c))},[e]),o}function Fr(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return Ue(t)?t:e}function $r(e){let{measure:t}=e;const[n,r]=a.useState(null),o=a.useCallback(u=>{for(const{target:f}of u)if(Ue(f)){r(d=>{const g=t(f);return d?{...d,width:g.width,height:g.height}:g});break}},[t]),s=ot({callback:o}),i=a.useCallback(u=>{const f=Fr(u);s==null||s.disconnect(),f&&(s==null||s.observe(f)),r(f?t(f):null)},[t,s]),[l,c]=Qe(i);return a.useMemo(()=>({nodeRef:l,rect:n,setRef:c}),[n,l,c])}const Ur=[{sensor:Rt,options:{}},{sensor:Dt,options:{}}],Xr={current:{}},Ge={draggable:{measure:$t},droppable:{measure:$t,strategy:$e.WhileDragging,frequency:mt.Optimized},dragOverlay:{measure:Ee}};class ze extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const Wr={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new ze,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Ze},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:Ge,measureDroppableContainers:Ze,windowRect:null,measuringScheduled:!1},Yr={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Ze,draggableNodes:new Map,over:null,measureDroppableContainers:Ze},st=a.createContext(Yr),pn=a.createContext(Wr);function Hr(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new ze}}}function Kr(e,t){switch(t.type){case L.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case L.DragMove:return e.draggable.active==null?e:{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case L.DragEnd:case L.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case L.RegisterDroppable:{const{element:n}=t,{id:r}=n,o=new ze(e.droppable.containers);return o.set(r,n),{...e,droppable:{...e.droppable,containers:o}}}case L.SetDroppableDisabled:{const{id:n,key:r,disabled:o}=t,s=e.droppable.containers.get(n);if(!s||r!==s.key)return e;const i=new ze(e.droppable.containers);return i.set(n,{...s,disabled:o}),{...e,droppable:{...e.droppable,containers:i}}}case L.UnregisterDroppable:{const{id:n,key:r}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const s=new ze(e.droppable.containers);return s.delete(n),{...e,droppable:{...e.droppable,containers:s}}}default:return e}}function Vr(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:o}=a.useContext(st),s=ht(r),i=ht(n==null?void 0:n.id);return a.useEffect(()=>{if(!t&&!r&&s&&i!=null){if(!yt(s)||document.activeElement===s.target)return;const l=o.get(i);if(!l)return;const{activatorNode:c,node:u}=l;if(!c.current&&!u.current)return;requestAnimationFrame(()=>{for(const f of[c.current,u.current]){if(!f)continue;const d=Fn(f);if(d){d.focus();break}}})}},[r,t,o,i,s]),null}function _r(e,t){let{transform:n,...r}=t;return e!=null&&e.length?e.reduce((o,s)=>s({transform:o,...r}),n):n}function qr(e){return a.useMemo(()=>({draggable:{...Ge.draggable,...e==null?void 0:e.draggable},droppable:{...Ge.droppable,...e==null?void 0:e.droppable},dragOverlay:{...Ge.dragOverlay,...e==null?void 0:e.dragOverlay}}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function Gr(e){let{activeNode:t,measure:n,initialRect:r,config:o=!0}=e;const s=a.useRef(!1),{x:i,y:l}=typeof o=="boolean"?{x:o,y:o}:o;re(()=>{if(!i&&!l||!t){s.current=!1;return}if(s.current||!r)return;const u=t==null?void 0:t.node.current;if(!u||u.isConnected===!1)return;const f=n(u),d=on(f,r);if(i||(d.x=0),l||(d.y=0),s.current=!0,Math.abs(d.x)>0||Math.abs(d.y)>0){const g=sn(u);g&&g.scrollBy({top:d.y,left:d.x})}},[t,i,l,r,n])}const vn=a.createContext({...Z,scaleX:1,scaleY:1});var pe;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(pe||(pe={}));const Jr=a.memo(function(t){var n,r,o,s;let{id:i,accessibility:l,autoScroll:c=!0,children:u,sensors:f=Ur,collisionDetection:d=er,measuring:g,modifiers:p,...R}=t;const m=a.useReducer(Kr,void 0,Hr),[x,S]=m,[D,y]=Hn(),[N,v]=a.useState(pe.Uninitialized),w=N===pe.Initialized,{draggable:{active:b,nodes:E,translate:T},droppable:{containers:O}}=x,k=b!=null?E.get(b):null,W=a.useRef({initial:null,translated:null}),Y=a.useMemo(()=>{var B;return b!=null?{id:b,data:(B=k==null?void 0:k.data)!=null?B:Xr,rect:W}:null},[b,k]),H=a.useRef(null),[C,j]=a.useState(null),[A,oe]=a.useState(null),F=Pe(R,Object.values(R)),Q=We("DndDescribedBy",i),Ye=a.useMemo(()=>O.getEnabled(),[O]),$=qr(g),{droppableRects:se,measureDroppableContainers:ve,measuringScheduled:Ne}=jr(Ye,{dragging:w,dependencies:[T.x,T.y],config:$.droppable}),q=Nr(E,b),He=a.useMemo(()=>A?gt(A):null,[A]),ce=jn(),ie=kr(q,$.draggable.measure);Gr({activeNode:b!=null?E.get(b):null,config:ce.layoutShiftCompensation,initialRect:ie,measure:$.draggable.measure});const I=Ht(q,$.draggable.measure,ie),Me=Ht(q?q.parentElement:null),ee=a.useRef({activatorEvent:null,active:null,activeNode:q,collisionRect:null,collisions:null,droppableRects:se,draggableNodes:E,draggingNode:null,draggingNodeRect:null,droppableContainers:O,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),me=O.getNodeFor((n=ee.current.over)==null?void 0:n.id),ae=$r({measure:$.dragOverlay.measure}),be=(r=ae.nodeRef.current)!=null?r:q,xe=w?(o=ae.rect)!=null?o:I:null,Nt=!!(ae.nodeRef.current&&ae.rect),Mt=Tr(Nt?null:I),it=gn(be?X(be):null),ue=Or(w?me??q:null),Ke=Br(ue),Ve=_r(p,{transform:{x:T.x-Mt.x,y:T.y-Mt.y,scaleX:1,scaleY:1},activatorEvent:A,active:Y,activeNodeRect:I,containerNodeRect:Me,draggingNodeRect:xe,over:ee.current.over,overlayNodeRect:ae.rect,scrollableAncestors:ue,scrollableAncestorRects:Ke,windowRect:it}),jt=He?De(He,T):null,kt=Lr(ue),Cn=Vt(kt),Dn=Vt(kt,[I]),we=De(Ve,Cn),ye=xe?rr(xe,Ve):null,je=Y&&ye?d({active:Y,collisionRect:ye,droppableRects:se,droppableContainers:Ye,pointerCoordinates:jt}):null,It=rn(je,"id"),[de,At]=a.useState(null),Sn=Nt?Ve:De(Ve,Dn),Rn=tr(Sn,(s=de==null?void 0:de.rect)!=null?s:null,I),at=a.useRef(null),Tt=a.useCallback((B,K)=>{let{sensor:V,options:fe}=K;if(H.current==null)return;const G=E.get(H.current);if(!G)return;const _=B.nativeEvent,te=new V({active:H.current,activeNode:G,event:_,options:fe,context:ee,onAbort(P){if(!E.get(P))return;const{onDragAbort:ne}=F.current,le={id:P};ne==null||ne(le),D({type:"onDragAbort",event:le})},onPending(P,he,ne,le){if(!E.get(P))return;const{onDragPending:Ie}=F.current,ge={id:P,constraint:he,initialCoordinates:ne,offset:le};Ie==null||Ie(ge),D({type:"onDragPending",event:ge})},onStart(P){const he=H.current;if(he==null)return;const ne=E.get(he);if(!ne)return;const{onDragStart:le}=F.current,ke={activatorEvent:_,active:{id:he,data:ne.data,rect:W}};Te.unstable_batchedUpdates(()=>{le==null||le(ke),v(pe.Initializing),S({type:L.DragStart,initialCoordinates:P,active:he}),D({type:"onDragStart",event:ke}),j(at.current),oe(_)})},onMove(P){S({type:L.DragMove,coordinates:P})},onEnd:Ce(L.DragEnd),onCancel:Ce(L.DragCancel)});at.current=te;function Ce(P){return async function(){const{active:ne,collisions:le,over:ke,scrollAdjustedTranslate:Ie}=ee.current;let ge=null;if(ne&&Ie){const{cancelDrop:Ae}=F.current;ge={activatorEvent:_,active:ne,collisions:le,delta:Ie,over:ke},P===L.DragEnd&&typeof Ae=="function"&&await Promise.resolve(Ae(ge))&&(P=L.DragCancel)}H.current=null,Te.unstable_batchedUpdates(()=>{S({type:P}),v(pe.Uninitialized),At(null),j(null),oe(null),at.current=null;const Ae=P===L.DragEnd?"onDragEnd":"onDragCancel";if(ge){const lt=F.current[Ae];lt==null||lt(ge),D({type:Ae,event:ge})}})}}},[E]),En=a.useCallback((B,K)=>(V,fe)=>{const G=V.nativeEvent,_=E.get(fe);if(H.current!==null||!_||G.dndKit||G.defaultPrevented)return;const te={active:_};B(V,K.options,te)===!0&&(G.dndKit={capturedBy:K.sensor},H.current=fe,Tt(V,K))},[E,Tt]),Ot=Mr(f,En);zr(f),re(()=>{I&&N===pe.Initializing&&v(pe.Initialized)},[I,N]),a.useEffect(()=>{const{onDragMove:B}=F.current,{active:K,activatorEvent:V,collisions:fe,over:G}=ee.current;if(!K||!V)return;const _={active:K,activatorEvent:V,collisions:fe,delta:{x:we.x,y:we.y},over:G};Te.unstable_batchedUpdates(()=>{B==null||B(_),D({type:"onDragMove",event:_})})},[we.x,we.y]),a.useEffect(()=>{const{active:B,activatorEvent:K,collisions:V,droppableContainers:fe,scrollAdjustedTranslate:G}=ee.current;if(!B||H.current==null||!K||!G)return;const{onDragOver:_}=F.current,te=fe.get(It),Ce=te&&te.rect.current?{id:te.id,rect:te.rect.current,data:te.data,disabled:te.disabled}:null,P={active:B,activatorEvent:K,collisions:V,delta:{x:G.x,y:G.y},over:Ce};Te.unstable_batchedUpdates(()=>{At(Ce),_==null||_(P),D({type:"onDragOver",event:P})})},[It]),re(()=>{ee.current={activatorEvent:A,active:Y,activeNode:q,collisionRect:ye,collisions:je,droppableRects:se,draggableNodes:E,draggingNode:be,draggingNodeRect:xe,droppableContainers:O,over:de,scrollableAncestors:ue,scrollAdjustedTranslate:we},W.current={initial:xe,translated:ye}},[Y,q,je,ye,E,be,xe,se,O,de,ue,we]),Sr({...ce,delta:T,draggingRect:ye,pointerCoordinates:jt,scrollableAncestors:ue,scrollableAncestorRects:Ke});const Nn=a.useMemo(()=>({active:Y,activeNode:q,activeNodeRect:I,activatorEvent:A,collisions:je,containerNodeRect:Me,dragOverlay:ae,draggableNodes:E,droppableContainers:O,droppableRects:se,over:de,measureDroppableContainers:ve,scrollableAncestors:ue,scrollableAncestorRects:Ke,measuringConfiguration:$,measuringScheduled:Ne,windowRect:it}),[Y,q,I,A,je,Me,ae,E,O,se,de,ve,ue,Ke,$,Ne,it]),Mn=a.useMemo(()=>({activatorEvent:A,activators:Ot,active:Y,activeNodeRect:I,ariaDescribedById:{draggable:Q},dispatch:S,draggableNodes:E,over:de,measureDroppableContainers:ve}),[A,Ot,Y,I,S,Q,E,de,ve]);return U.createElement(en.Provider,{value:y},U.createElement(st.Provider,{value:Mn},U.createElement(pn.Provider,{value:Nn},U.createElement(vn.Provider,{value:Rn},u)),U.createElement(Vr,{disabled:(l==null?void 0:l.restoreFocus)===!1})),U.createElement(_n,{...l,hiddenTextDescribedById:Q}));function jn(){const B=(C==null?void 0:C.autoScrollEnabled)===!1,K=typeof c=="object"?c.enabled===!1:c===!1,V=w&&!B&&!K;return typeof c=="object"?{...c,enabled:V}:{enabled:V}}}),Qr=a.createContext(null),qt="button",Zr="Draggable";function eo(e){let{id:t,data:n,disabled:r=!1,attributes:o}=e;const s=We(Zr),{activators:i,activatorEvent:l,active:c,activeNodeRect:u,ariaDescribedById:f,draggableNodes:d,over:g}=a.useContext(st),{role:p=qt,roleDescription:R="draggable",tabIndex:m=0}=o??{},x=(c==null?void 0:c.id)===t,S=a.useContext(x?vn:Qr),[D,y]=Qe(),[N,v]=Qe(),w=Pr(i,t),b=Pe(n);re(()=>(d.set(t,{id:t,key:s,node:D,activatorNode:N,data:b}),()=>{const T=d.get(t);T&&T.key===s&&d.delete(t)}),[d,t]);const E=a.useMemo(()=>({role:p,tabIndex:m,"aria-disabled":r,"aria-pressed":x&&p===qt?!0:void 0,"aria-roledescription":R,"aria-describedby":f.draggable}),[r,p,m,x,R,f.draggable]);return{active:c,activatorEvent:l,activeNodeRect:u,attributes:E,isDragging:x,listeners:r?void 0:w,node:D,over:g,setNodeRef:y,setActivatorNodeRef:v,transform:S}}function to(){return a.useContext(pn)}const no="Droppable",ro={timeout:25};function oo(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:o}=e;const s=We(no),{active:i,dispatch:l,over:c,measureDroppableContainers:u}=a.useContext(st),f=a.useRef({disabled:n}),d=a.useRef(!1),g=a.useRef(null),p=a.useRef(null),{disabled:R,updateMeasurementsFor:m,timeout:x}={...ro,...o},S=Pe(m??r),D=a.useCallback(()=>{if(!d.current){d.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{u(Array.isArray(S.current)?S.current:[S.current]),p.current=null},x)},[x]),y=ot({callback:D,disabled:R||!i}),N=a.useCallback((E,T)=>{y&&(T&&(y.unobserve(T),d.current=!1),E&&y.observe(E))},[y]),[v,w]=Qe(N),b=Pe(t);return a.useEffect(()=>{!y||!v.current||(y.disconnect(),d.current=!1,y.observe(v.current))},[v,y]),a.useEffect(()=>(l({type:L.RegisterDroppable,element:{id:r,key:s,disabled:n,node:v,rect:g,data:b}}),()=>l({type:L.UnregisterDroppable,key:s,id:r})),[r]),a.useEffect(()=>{n!==f.current.disabled&&(l({type:L.SetDroppableDisabled,id:r,key:s,disabled:n}),f.current.disabled=n)},[r,s,n,l]),{active:i,rect:g,isOver:(c==null?void 0:c.id)===r,node:v,over:c,setNodeRef:w}}function Et(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function so(e,t){return e.reduce((n,r,o)=>{const s=t.get(r);return s&&(n[o]=s),n},Array(e.length))}function _e(e){return e!==null&&e>=0}function io(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function ao(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const mn=e=>{let{rects:t,activeIndex:n,overIndex:r,index:o}=e;const s=Et(t,r,n),i=t[o],l=s[o];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}},qe={scaleX:1,scaleY:1},lo=e=>{var t;let{activeIndex:n,activeNodeRect:r,index:o,rects:s,overIndex:i}=e;const l=(t=s[n])!=null?t:r;if(!l)return null;if(o===n){const u=s[i];return u?{x:0,y:n<i?u.top+u.height-(l.top+l.height):u.top-l.top,...qe}:null}const c=co(s,o,n);return o>n&&o<=i?{x:0,y:-l.height-c,...qe}:o<n&&o>=i?{x:0,y:l.height+c,...qe}:{x:0,y:0,...qe}};function co(e,t,n){const r=e[t],o=e[t-1],s=e[t+1];return r?n<t?o?r.top-(o.top+o.height):s?s.top-(r.top+r.height):0:s?s.top-(r.top+r.height):o?r.top-(o.top+o.height):0:0}const bn="Sortable",xn=U.createContext({activeIndex:-1,containerId:bn,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:mn,disabled:{draggable:!1,droppable:!1}});function uo(e){let{children:t,id:n,items:r,strategy:o=mn,disabled:s=!1}=e;const{active:i,dragOverlay:l,droppableRects:c,over:u,measureDroppableContainers:f}=to(),d=We(bn,n),g=l.rect!==null,p=a.useMemo(()=>r.map(w=>typeof w=="object"&&"id"in w?w.id:w),[r]),R=i!=null,m=i?p.indexOf(i.id):-1,x=u?p.indexOf(u.id):-1,S=a.useRef(p),D=!io(p,S.current),y=x!==-1&&m===-1||D,N=ao(s);re(()=>{D&&R&&f(p)},[D,p,R,f]),a.useEffect(()=>{S.current=p},[p]);const v=a.useMemo(()=>({activeIndex:m,containerId:d,disabled:N,disableTransforms:y,items:p,overIndex:x,useDragOverlay:g,sortedRects:so(p,c),strategy:o}),[m,d,N.draggable,N.droppable,y,p,x,c,g,o]);return U.createElement(xn.Provider,{value:v},t)}const fo=e=>{let{id:t,items:n,activeIndex:r,overIndex:o}=e;return Et(n,r,o).indexOf(t)},ho=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:o,items:s,newIndex:i,previousItems:l,previousContainerId:c,transition:u}=e;return!u||!r||l!==s&&o===i?!1:n?!0:i!==o&&t===c},go={duration:200,easing:"ease"},wn="transform",po=Fe.Transition.toString({property:wn,duration:0,easing:"linear"}),vo={roleDescription:"sortable"};function mo(e){let{disabled:t,index:n,node:r,rect:o}=e;const[s,i]=a.useState(null),l=a.useRef(n);return re(()=>{if(!t&&n!==l.current&&r.current){const c=o.current;if(c){const u=Ee(r.current,{ignoreTransform:!0}),f={x:c.left-u.left,y:c.top-u.top,scaleX:c.width/u.width,scaleY:c.height/u.height};(f.x||f.y)&&i(f)}}n!==l.current&&(l.current=n)},[t,n,r,o]),a.useEffect(()=>{s&&i(null)},[s]),s}function bo(e){let{animateLayoutChanges:t=ho,attributes:n,disabled:r,data:o,getNewIndex:s=fo,id:i,strategy:l,resizeObserverConfig:c,transition:u=go}=e;const{items:f,containerId:d,activeIndex:g,disabled:p,disableTransforms:R,sortedRects:m,overIndex:x,useDragOverlay:S,strategy:D}=a.useContext(xn),y=xo(r,p),N=f.indexOf(i),v=a.useMemo(()=>({sortable:{containerId:d,index:N,items:f},...o}),[d,o,N,f]),w=a.useMemo(()=>f.slice(f.indexOf(i)),[f,i]),{rect:b,node:E,isOver:T,setNodeRef:O}=oo({id:i,data:v,disabled:y.droppable,resizeObserverConfig:{updateMeasurementsFor:w,...c}}),{active:k,activatorEvent:W,activeNodeRect:Y,attributes:H,setNodeRef:C,listeners:j,isDragging:A,over:oe,setActivatorNodeRef:F,transform:Q}=eo({id:i,data:v,attributes:{...vo,...n},disabled:y.draggable}),Ye=Ln(O,C),$=!!k,se=$&&!R&&_e(g)&&_e(x),ve=!S&&A,Ne=ve&&se?Q:null,He=se?Ne??(l??D)({rects:m,activeNodeRect:Y,activeIndex:g,overIndex:x,index:N}):null,ce=_e(g)&&_e(x)?s({id:i,items:f,activeIndex:g,overIndex:x}):N,ie=k==null?void 0:k.id,I=a.useRef({activeId:ie,items:f,newIndex:ce,containerId:d}),Me=f!==I.current.items,ee=t({active:k,containerId:d,isDragging:A,isSorting:$,id:i,index:N,items:f,newIndex:I.current.newIndex,previousItems:I.current.items,previousContainerId:I.current.containerId,transition:u,wasDragging:I.current.activeId!=null}),me=mo({disabled:!ee,index:N,node:E,rect:b});return a.useEffect(()=>{$&&I.current.newIndex!==ce&&(I.current.newIndex=ce),d!==I.current.containerId&&(I.current.containerId=d),f!==I.current.items&&(I.current.items=f)},[$,ce,d,f]),a.useEffect(()=>{if(ie===I.current.activeId)return;if(ie!=null&&I.current.activeId==null){I.current.activeId=ie;return}const be=setTimeout(()=>{I.current.activeId=ie},50);return()=>clearTimeout(be)},[ie]),{active:k,activeIndex:g,attributes:H,data:v,rect:b,index:N,newIndex:ce,items:f,isOver:T,isSorting:$,isDragging:A,listeners:j,node:E,overIndex:x,over:oe,setNodeRef:Ye,setActivatorNodeRef:F,setDroppableNodeRef:O,setDraggableNodeRef:C,transform:me??He,transition:ae()};function ae(){if(me||Me&&I.current.newIndex===N)return po;if(!(ve&&!yt(W)||!u)&&($||ee))return Fe.Transition.toString({...u,property:wn})}}function xo(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function tt(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const wo=[M.Down,M.Right,M.Up,M.Left],yo=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:o,droppableContainers:s,over:i,scrollableAncestors:l}}=t;if(wo.includes(e.code)){if(e.preventDefault(),!n||!r)return;const c=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;const g=o.get(d.id);if(g)switch(e.code){case M.Down:r.top<g.top&&c.push(d);break;case M.Up:r.top>g.top&&c.push(d);break;case M.Left:r.left>g.left&&c.push(d);break;case M.Right:r.left<g.left&&c.push(d);break}});const u=Qn({collisionRect:r,droppableRects:o,droppableContainers:c});let f=rn(u,"id");if(f===(i==null?void 0:i.id)&&u.length>1&&(f=u[1].id),f!=null){const d=s.get(n.id),g=s.get(f),p=g?o.get(g.id):null,R=g==null?void 0:g.node.current;if(R&&p&&d&&g){const x=rt(R).some((w,b)=>l[b]!==w),S=yn(d,g),D=Co(d,g),y=x||!S?{x:0,y:0}:{x:D?r.width-p.width:0,y:D?r.height-p.height:0},N={x:p.left,y:p.top};return y.x&&y.y?N:Be(N,y)}}}};function yn(e,t){return!tt(e)||!tt(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function Co(e,t){return!tt(e)||!tt(t)||!yn(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}function Do(e,t,n){const r={...e};return t.top+e.y<=n.top?r.y=n.top-t.top:t.bottom+e.y>=n.top+n.height&&(r.y=n.top+n.height-t.bottom),t.left+e.x<=n.left?r.x=n.left-t.left:t.right+e.x>=n.left+n.width&&(r.x=n.left+n.width-t.right),r}const So=e=>{let{containerNodeRect:t,draggingNodeRect:n,transform:r}=e;return!n||!t?r:Do(r,n,t)},Ro=e=>{let{transform:t}=e;return{...t,x:0}},Eo=/^[a-zA-Z0-9_.\-]+$/;function Oo(){const[e,t]=a.useState([]),[n,r]=a.useState(!0),[o,s]=a.useState(!1),[i,l]=a.useState(null),[c,u]=a.useState([]),[f,d]=a.useState({}),[g,p]=a.useState(null),{copied:R,copy:m}=kn();a.useEffect(()=>{x()},[]);const x=async()=>{try{const[v,w,b]=await Promise.all([fetch("/api/combos"),fetch("/api/providers"),fetch("/api/settings")]),E=await v.json(),T=await w.json(),O=b.ok?await b.json():{};v.ok&&t((E.combos||[]).filter(k=>!k.kind)),w.ok&&u(T.connections||[]),d(O.comboStrategies||{})}catch(v){console.log("Error fetching data:",v)}finally{r(!1)}},S=async v=>{try{const w=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(v)});if(w.ok)await x(),s(!1);else{const b=await w.json();alert(b.error||"Failed to create combo")}}catch(w){console.log("Error creating combo:",w)}},D=async(v,w)=>{try{const b=await fetch(`/api/combos/${v}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(w)});if(b.ok)await x(),l(null);else{const E=await b.json();alert(E.error||"Failed to update combo")}}catch(b){console.log("Error updating combo:",b)}},y=async v=>{p({title:"Delete Combo",message:"Delete this combo?",onConfirm:async()=>{p(null);try{(await fetch(`/api/combos/${v}`,{method:"DELETE"})).ok&&t(e.filter(b=>b.id!==v))}catch(w){console.log("Error deleting combo:",w)}}})},N=async(v,w)=>{try{const b={...f};w&&w!=="fallback"?b[v]={fallbackStrategy:w}:delete b[v],await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({comboStrategies:b})}),d(b)}catch(b){console.log("Error updating combo strategy:",b)}};return n?h.jsxs("div",{className:"flex flex-col gap-6",children:[h.jsx(Lt,{}),h.jsx(Lt,{})]}):h.jsxs("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[h.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsxs("div",{className:"min-w-0",children:[h.jsx("h1",{className:"text-2xl font-semibold",children:"Combos"}),h.jsx("p",{className:"text-sm text-text-muted mt-1",children:"Create model combos with fallback support"})]}),h.jsx(Je,{icon:"add",onClick:()=>s(!0),className:"w-full sm:w-auto",children:"Create Combo"})]}),e.length===0?h.jsx(Jt,{children:h.jsxs("div",{className:"text-center py-12",children:[h.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 rounded-full bg-primary/10 text-primary mb-4",children:h.jsx("span",{className:"material-symbols-outlined text-[32px]",children:"layers"})}),h.jsx("p",{className:"text-text-main font-medium mb-1",children:"No combos yet"}),h.jsx("p",{className:"text-sm text-text-muted mb-4",children:"Create model combos with fallback support"}),h.jsx(Je,{icon:"add",onClick:()=>s(!0),className:"w-full sm:w-auto",children:"Create Combo"})]})}):h.jsx("div",{className:"flex flex-col gap-4",children:e.map(v=>{var w;return h.jsx(No,{combo:v,copied:R,onCopy:m,onEdit:()=>l(v),onDelete:()=>y(v.id),currentStrategy:((w=f[v.name])==null?void 0:w.fallbackStrategy)||"fallback",onUpdateStrategy:b=>N(v.name,b)},v.id)})}),h.jsx(Gt,{isOpen:o,onClose:()=>s(!1),onSave:S,activeProviders:c},"create"),h.jsx(Gt,{isOpen:!!i,combo:i,onClose:()=>l(null),onSave:v=>D(i.id,v),activeProviders:c},(i==null?void 0:i.id)||"new"),h.jsx(In,{isOpen:!!g,onClose:()=>p(null),onConfirm:g==null?void 0:g.onConfirm,title:(g==null?void 0:g.title)||"Confirm",message:g==null?void 0:g.message,variant:"danger"})]})}function No({combo:e,copied:t,onCopy:n,onEdit:r,onDelete:o,currentStrategy:s,onUpdateStrategy:i}){return h.jsx(Jt,{padding:"sm",className:"group",children:h.jsxs("div",{className:"flex min-w-0 flex-col gap-3 sm:flex-row sm:items-center sm:justify-between",children:[h.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3 sm:items-center",children:[h.jsx("div",{className:"size-8 rounded-lg bg-primary/10 flex items-center justify-center shrink-0",children:h.jsx("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"})}),h.jsxs("div",{className:"min-w-0 flex-1",children:[h.jsx("code",{className:"block truncate font-mono text-sm font-medium",children:e.name}),h.jsxs("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1",children:[e.models.length===0?h.jsx("span",{className:"text-xs text-text-muted italic",children:"No models"}):e.models.slice(0,3).map((l,c)=>h.jsx("code",{className:"max-w-full truncate rounded bg-black/5 px-1.5 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[220px]",children:l},c)),e.models.length>3&&h.jsxs("span",{className:"text-[10px] text-text-muted",children:["+",e.models.length-3," more"]})]})]})]}),h.jsxs("div",{className:"flex w-full flex-col gap-2 sm:w-auto sm:flex-row sm:items-center sm:gap-3 sm:shrink-0",children:[h.jsxs("div",{className:"flex items-center justify-between gap-1.5 rounded-lg bg-black/[0.02] px-2 py-1 dark:bg-white/[0.02] sm:justify-start sm:bg-transparent sm:px-0 sm:py-0 sm:dark:bg-transparent",children:[h.jsx("span",{className:"text-xs text-text-muted font-medium mr-1",children:"Strategy:"}),h.jsxs("select",{value:s,onChange:l=>i(l.target.value),className:"text-xs font-medium rounded border border-black/10 bg-transparent py-1 px-2 outline-none dark:border-white/10 dark:bg-black/20 text-text-main cursor-pointer",children:[h.jsx("option",{value:"fallback",className:"dark:bg-zinc-900",children:"Fallback (Priority)"}),h.jsx("option",{value:"round-robin",className:"dark:bg-zinc-900",children:"Round Robin"}),h.jsx("option",{value:"fusion",className:"dark:bg-zinc-900",children:"Fusion (Synthesis)"})]})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-1 sm:flex",children:[h.jsxs("button",{onClick:l=>{l.stopPropagation(),n(e.name,`combo-${e.id}`)},className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Copy combo name",children:[h.jsx("span",{className:"material-symbols-outlined text-[18px]",children:t===`combo-${e.id}`?"check":"content_copy"}),h.jsx("span",{className:"text-[10px] leading-tight",children:"Copy"})]}),h.jsxs("button",{onClick:r,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted transition-colors hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",title:"Edit",children:[h.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),h.jsx("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),h.jsxs("button",{onClick:o,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 transition-colors hover:bg-red-500/10",title:"Delete",children:[h.jsx("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),h.jsx("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]})]})]})})}function Mo({id:e,index:t,model:n,isFirst:r,isLast:o,onEdit:s,onMoveUp:i,onMoveDown:l,onRemove:c}){const{attributes:u,listeners:f,setNodeRef:d,transform:g,isDragging:p}=bo({id:e}),R={transform:Fe.Transform.toString(g),opacity:p?.4:1,zIndex:p?999:void 0},[m,x]=a.useState(!1),[S,D]=a.useState(n),y=()=>{const v=S.trim();v&&v!==n?s(v):D(n),x(!1)},N=v=>{v.key==="Enter"&&y(),v.key==="Escape"&&(D(n),x(!1))};return h.jsxs("div",{ref:d,style:R,className:`group flex min-w-0 items-center gap-1.5 rounded-md px-2 py-1 bg-black/[0.02] hover:bg-black/[0.04] dark:bg-white/[0.02] dark:hover:bg-white/[0.04] transition-colors ${p?"shadow-md ring-1 ring-primary/30":""}`,children:[h.jsx("button",{...u,...f,type:"button",className:"cursor-grab touch-none p-0.5 rounded text-text-muted hover:text-primary active:cursor-grabbing shrink-0",title:"Drag to reorder",children:h.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor",children:[h.jsx("circle",{cx:"9",cy:"4",r:"2"}),h.jsx("circle",{cx:"15",cy:"4",r:"2"}),h.jsx("circle",{cx:"9",cy:"12",r:"2"}),h.jsx("circle",{cx:"15",cy:"12",r:"2"}),h.jsx("circle",{cx:"9",cy:"20",r:"2"}),h.jsx("circle",{cx:"15",cy:"20",r:"2"})]})}),h.jsx("span",{className:"text-[10px] font-medium text-text-muted w-3 text-center shrink-0",children:t+1}),m?h.jsx("input",{autoFocus:!0,value:S,onChange:v=>D(v.target.value),onBlur:y,onKeyDown:N,className:"min-w-0 flex-1 rounded border border-primary/40 bg-white px-1.5 py-0.5 font-mono text-xs text-text-main outline-none dark:bg-black/20"}):h.jsx("div",{className:"min-w-0 flex-1 cursor-text truncate rounded px-1.5 py-0.5 font-mono text-xs text-text-main hover:bg-black/5 dark:hover:bg-white/5",onClick:()=>x(!0),title:"Click to edit",children:n}),h.jsxs("div",{className:"flex shrink-0 items-center gap-0.5",children:[h.jsx("button",{onClick:i,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move up",children:h.jsx("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_upward"})}),h.jsx("button",{onClick:l,disabled:o,className:`p-0.5 rounded ${o?"text-text-muted/20 cursor-not-allowed":"text-text-muted hover:text-primary hover:bg-black/5 dark:hover:bg-white/5"}`,title:"Move down",children:h.jsx("span",{className:"material-symbols-outlined text-[12px]",children:"arrow_downward"})})]}),h.jsx("button",{onClick:c,className:"p-0.5 hover:bg-red-500/10 rounded text-text-muted hover:text-red-500 transition-all",title:"Remove",children:h.jsx("span",{className:"material-symbols-outlined text-[12px]",children:"close"})})]})}function Gt({isOpen:e,combo:t,onClose:n,onSave:r,activeProviders:o,kindFilter:s=null}){const[i,l]=a.useState((t==null?void 0:t.name)||""),[c,u]=a.useState((t==null?void 0:t.models)||[]),[f,d]=a.useState(!1),[g,p]=a.useState(!1),[R,m]=a.useState(""),[x,S]=a.useState({}),D=qn(Pt(Rt,{activationConstraint:{distance:5}}),Pt(Dt,{coordinateGetter:yo})),y=c.map((C,j)=>({uid:`item-${j}`,model:C})),N=C=>{const{active:j,over:A}=C;if(A&&j.id!==A.id){const oe=y.findIndex(Q=>Q.uid===j.id),F=y.findIndex(Q=>Q.uid===A.id);oe!==-1&&F!==-1&&u(Q=>Et(Q,oe,F))}},v=async()=>{try{const C=await fetch("/api/models/alias");if(!C.ok)return;const j=await C.json();S(j.aliases||{})}catch(C){console.error("Error fetching modal data:",C)}};a.useEffect(()=>{e&&v()},[e]);const w=C=>C.trim()?Eo.test(C)?(m(""),!0):(m("Only letters, numbers, -, _ and . allowed"),!1):(m("Name is required"),!1),b=C=>{const j=C.target.value;l(j),j?w(j):m("")},E=C=>{c.includes(C.value)||u([...c,C.value])},T=C=>{u(c.filter(j=>j!==C.value))},O=C=>{u(c.filter((j,A)=>A!==C))},k=C=>{if(C===0)return;const j=[...c];[j[C-1],j[C]]=[j[C],j[C-1]],u(j)},W=C=>{if(C===c.length-1)return;const j=[...c];[j[C],j[C+1]]=[j[C+1],j[C]],u(j)},Y=async()=>{w(i)&&(p(!0),await r({name:i.trim(),models:c}),p(!1))},H=!!t;return h.jsxs(h.Fragment,{children:[h.jsx(An,{isOpen:e,onClose:n,title:H?"Edit Combo":"Create Combo",children:h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsxs("div",{children:[h.jsx(Tn,{label:"Combo Name",value:i,onChange:b,placeholder:"my-combo",error:R}),h.jsx("p",{className:"text-[10px] text-text-muted mt-0.5",children:"Only letters, numbers, -, _ and . allowed"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"text-sm font-medium mb-1.5 block",children:"Models"}),c.length===0?h.jsxs("div",{className:"text-center py-4 border border-dashed border-black/10 dark:border-white/10 rounded-lg bg-black/[0.01] dark:bg-white/[0.01]",children:[h.jsx("span",{className:"material-symbols-outlined text-text-muted text-xl mb-1",children:"layers"}),h.jsx("p",{className:"text-xs text-text-muted",children:"No models added yet"})]}):h.jsx(Jr,{sensors:D,collisionDetection:Jn,onDragEnd:N,modifiers:[Ro,So],children:h.jsx(uo,{items:y.map(C=>C.uid),strategy:lo,children:h.jsx("div",{className:"flex max-h-[55vh] min-w-0 flex-col gap-1 overflow-y-auto sm:max-h-[350px]",children:y.map(({uid:C,model:j},A)=>h.jsx(Mo,{id:C,index:A,model:j,isFirst:A===0,isLast:A===y.length-1,onEdit:oe=>{const F=[...c];F[A]=oe,u(F)},onMoveUp:()=>k(A),onMoveDown:()=>W(A),onRemove:()=>O(A)},C))})})}),h.jsxs("button",{onClick:()=>d(!0),className:"w-full mt-2 py-2 border border-dashed border-black/10 dark:border-white/10 rounded-lg text-xs text-primary font-medium hover:text-primary hover:border-primary/50 transition-colors flex items-center justify-center gap-1",children:[h.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"add"}),"Add Model"]})]}),h.jsxs("div",{className:"flex flex-col gap-2 pt-1 sm:flex-row",children:[h.jsx(Je,{onClick:n,variant:"ghost",fullWidth:!0,size:"sm",children:"Cancel"}),h.jsx(Je,{onClick:Y,fullWidth:!0,size:"sm",disabled:!i.trim()||!!R||g,children:g?"Saving...":H?"Save":"Create"})]})]})}),h.jsx(On,{isOpen:f,onClose:()=>d(!1),onSelect:E,onDeselect:T,activeProviders:o,modelAliases:x,title:"Add Model to Combo",kindFilter:s,addedModelValues:c,closeOnSelect:!1})]})}export{Oo as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./index.KMEObSAk.js";import"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function i(){return e.jsxs("div",{className:"flex flex-col h-full min-h-0",children:[e.jsxs("div",{className:"flex items-center justify-between px-5 py-3 border-b border-border-subtle shrink-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"flex items-center justify-center size-8 rounded-lg bg-primary/10",children:e.jsx("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"menu_book"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-sm font-semibold text-text-main",children:"API Reference"}),e.jsx("p",{className:"text-xs text-text-muted",children:"Image & Video Generation — all providers, models, and parameters"})]})]}),e.jsxs("a",{href:"/image-video-docs.html",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium text-text-muted hover:text-text-main hover:bg-surface-2 transition-all",children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:"open_in_new"}),"Open in new tab"]})]}),e.jsx("iframe",{src:"/image-video-docs.html",className:"flex-1 w-full border-0 min-h-0",title:"Image & Video API Reference"})]})}export{i as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./index.KMEObSAk.js";import{b as n}from"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function j(){const[o,p]=n.useState("tts"),[x,h]=n.useState(""),[t,s]=n.useState(null),[i,r]=n.useState(!1),u=async()=>{r(!0);try{const a=await fetch("/api/audio/speech",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({input:x,model:"tts-1",voice:"alloy"})});if(a.ok){const c=await a.blob();s({audio:URL.createObjectURL(c)})}else s({error:await a.text()})}catch(a){s({error:a.message})}r(!1)},m=async a=>{const c=a.target.files[0];if(!c)return;r(!0);const l=new FormData;l.append("file",c),l.append("model","whisper-1");try{const d=await fetch("/api/audio/transcriptions",{method:"POST",body:l});s(await d.json())}catch(d){s({error:d.message})}r(!1)};return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"Audio"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("button",{onClick:()=>p("tts"),className:`px-4 py-2 rounded-lg ${o==="tts"?"bg-primary text-white":"bg-black/5"}`,children:"Text to Speech"}),e.jsx("button",{onClick:()=>p("stt"),className:`px-4 py-2 rounded-lg ${o==="stt"?"bg-primary text-white":"bg-black/5"}`,children:"Speech to Text"})]}),o==="tts"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("textarea",{className:"w-full p-3 rounded-lg border h-40",placeholder:"Enter text to convert to speech...",value:x,onChange:a=>h(a.target.value)}),e.jsx("button",{onClick:u,disabled:i,className:"px-4 py-2 bg-primary text-white rounded-lg",children:i?"Generating...":"Generate Speech"}),(t==null?void 0:t.audio)&&e.jsx("audio",{controls:!0,src:t.audio,className:"w-full"})]}),o==="stt"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("input",{type:"file",accept:"audio/*",onChange:m,className:"block"}),i&&e.jsx("p",{children:"Transcribing..."})]}),(t==null?void 0:t.error)&&e.jsx("p",{className:"text-red-500",children:t.error}),(t==null?void 0:t.text)&&e.jsx("pre",{className:"p-4 bg-black/5 rounded-lg text-sm",children:t.text})]})}export{j as default};
@@ -1 +0,0 @@
1
- import{I,H as B,j as e,B as E,g as A,P as z}from"./index.CoYbjSIL.js";import{h as _,d as M,b,L as T}from"./router.Cjj1--8t.js";import{A as R,C as D,B as j,T as F}from"./NoAuthProxyCard.Buvt0BVH.js";import"./zustand.akaTi5uX.js";const K=new Set([]),L={image:"image-combo",tts:"tts-combo"};function P(s){const o=Object.entries(s).some(([i,d])=>i.startsWith("modelLock_")&&d&&new Date(d).getTime()>Date.now());return s.testStatus==="unavailable"&&!o?"active":s.testStatus}function $({provider:s,kind:o,connections:i,isCustom:d,onToggle:l}){var C;const n=A[s.id],y=!!(n!=null&&n.noAuth),p=i.filter(a=>a.provider===s.id),v=p.filter(a=>{const x=P(a);return x==="active"||x==="success"}).length,h=p.filter(a=>{const x=P(a);return x==="error"||x==="expired"||x==="unavailable"}).length,m=p.length,r=m>0&&p.every(a=>a.isActive===!1),u=a=>{a.preventDefault(),a.stopPropagation(),l&&l(s.id,r)},k=()=>y?e.jsx(j,{variant:"success",size:"sm",children:"Ready"}):r?e.jsx(j,{variant:"default",size:"sm",children:"Disabled"}):m===0?e.jsx("span",{className:"text-xs text-text-muted",children:"No connections"}):e.jsxs(e.Fragment,{children:[v>0&&e.jsxs(j,{variant:"success",size:"sm",dot:!0,children:[v," Connected"]}),h>0&&e.jsxs(j,{variant:"error",size:"sm",dot:!0,children:[h," Error"]}),v===0&&h===0&&e.jsxs(j,{variant:"default",size:"sm",children:[m," Added"]})]});return e.jsx(T,{to:`/dashboard/media-providers/${o}/${s.id}`,className:"group",children:e.jsx(D,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${r?"opacity-50":""}`,children:e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${((C=s.color)==null?void 0:C.length)>7?s.color:(s.color??"#888")+"15"}`},children:e.jsx(z,{src:`/providers/${s.id}.png`,alt:s.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:s.textIcon||s.id.slice(0,2).toUpperCase(),fallbackColor:s.color})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[d&&e.jsx(j,{variant:"default",size:"sm",children:"Custom"}),k()]})]})]}),m>0&&e.jsx("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:u,children:e.jsx(F,{size:"sm",checked:!r,onChange:()=>{},title:r?"Enable provider":"Disable provider"})})]})})})}function U({combos:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-2",children:s.map(o=>e.jsx(T,{to:`/dashboard/media-providers/combo/${o.id}`,children:e.jsx(D,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),e.jsx("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:o.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[o.models.slice(0,6).map((i,d)=>{const l=typeof i=="string"?i.split("/")[0]:"",n=A[l];return e.jsx("div",{title:(n==null?void 0:n.name)||i,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${(n==null?void 0:n.color)??"#888"}15`},children:e.jsx(z,{src:`/providers/${l}.png`,alt:(n==null?void 0:n.name)||l,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:(n==null?void 0:n.textIcon)||l.slice(0,2).toUpperCase(),fallbackColor:n==null?void 0:n.color})},`${i}-${d}`)}),o.models.length>6&&e.jsxs("span",{className:"text-[10px] text-text-muted ml-1",children:["+",o.models.length-6]})]}),e.jsx("span",{className:"text-[11px] text-text-muted shrink-0",children:o.models.length}),e.jsx("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},o.id))})}function q(){const{kind:s}=_(),o=M(),[i,d]=b.useState([]),[l,n]=b.useState([]),[y,p]=b.useState([]),[v,h]=b.useState(!1);b.useEffect(()=>{(s==="webSearch"||s==="webFetch")&&o("/dashboard/media-providers/web")},[s,o]);const m=I.find(t=>t.id===s),r=s==="embedding",u=K.has(s);if(b.useEffect(()=>{m&&(fetch("/api/providers",{cache:"no-store"}).then(t=>t.json()).then(t=>d(t.connections||[])).catch(()=>{}),r&&fetch("/api/provider-nodes",{cache:"no-store"}).then(t=>t.json()).then(t=>n((t.nodes||[]).filter(c=>c.type==="custom-embedding"))).catch(()=>{}),u&&fetch("/api/combos",{cache:"no-store"}).then(t=>t.json()).then(t=>p(t.combos||[])).catch(()=>{}))},[r,u,m]),!m)return null;const k=B(s),C=y.filter(t=>t.kind===s),a=l.map(t=>({id:t.id,name:t.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),x=[...k,...a],S=async(t,c)=>{const w=i.filter(f=>f.provider===t);d(f=>f.map(g=>g.provider===t?{...g,isActive:c}:g)),await Promise.allSettled(w.map(f=>fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:c})})))},O=async()=>{const t=L[s]||`${s}-combo`;let c=t,w=1;const f=new Set(y.map(N=>N.name));for(;f.has(c);)c=`${t}-${w++}`;const g=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c,models:[],kind:s})});if(g.ok){const N=await g.json();o(`/dashboard/media-providers/combo/${N.id}`)}else{const N=await g.json();alert(N.error||"Failed to create combo")}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[(r||u)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u&&e.jsx(E,{size:"sm",icon:"add",onClick:O,children:"Create Combo"}),r&&e.jsx(E,{size:"sm",icon:"add",onClick:()=>h(!0),children:"Add Custom Embedding"})]}),u&&C.length>0&&e.jsx(U,{combos:C}),x.length===0?e.jsxs("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",e.jsx("strong",{children:m.label})," yet."]}):e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[k.map(t=>e.jsx($,{provider:t,kind:s,connections:i,onToggle:S},t.id)),a.map(t=>e.jsx($,{provider:t,kind:s,connections:i,isCustom:!0,onToggle:S},t.id))]}),r&&e.jsx(R,{isOpen:v,onClose:()=>h(!1),onCreated:t=>{n(c=>[...c,t]),h(!1)}})]})}export{q as default};
@@ -1 +0,0 @@
1
- import{j as e,u}from"./index.KMEObSAk.js";import{C as l,B as d}from"./NoAuthProxyCard.DyEjms20.js";import"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";const c="nexusrouters/fsrouter",m="main",x="skills",h=`https://github.com/${c}`,f=`https://raw.githubusercontent.com/${c}/refs/heads/${m}/${x}`,b=`https://github.com/${c}/blob/${m}/${x}`,n=[{id:"fsrouter",name:"FSRouter (Entry)",description:"Setup + index of all capabilities. Start here — covers base URL, auth, model discovery, and links to every capability skill.",endpoint:null,icon:"hub",isEntry:!0},{id:"fsrouter-chat",name:"Chat",description:"Chat / code-gen via OpenAI or Anthropic format with streaming.",endpoint:"/v1/chat/completions",icon:"chat"},{id:"fsrouter-image",name:"Image Generation",description:"Text-to-image via DALL-E, Imagen, FLUX, MiniMax, SDWebUI…",endpoint:"/v1/images/generations",icon:"image"},{id:"fsrouter-tts",name:"Text-to-Speech",description:"OpenAI / ElevenLabs / Edge / Google / Deepgram voices.",endpoint:"/v1/audio/speech",icon:"record_voice_over"},{id:"fsrouter-stt",name:"Speech-to-Text",description:"Transcribe audio via OpenAI Whisper, Groq, Gemini, Deepgram, AssemblyAI…",endpoint:"/v1/audio/transcriptions",icon:"mic"},{id:"fsrouter-embeddings",name:"Embeddings",description:"Vectors for RAG / semantic search via OpenAI, Gemini, Mistral…",endpoint:"/v1/embeddings",icon:"scatter_plot"},{id:"fsrouter-web-search",name:"Web Search",description:"Tavily / Exa / Brave / Serper / SearXNG / Google PSE / You.com.",endpoint:"/v1/search",icon:"search"},{id:"fsrouter-web-fetch",name:"Web Fetch",description:"URL → markdown / text / HTML via Firecrawl, Jina, Tavily, Exa.",endpoint:"/v1/web/fetch",icon:"language"},{id:"using-superpowers",name:"Using Superpowers",description:"Use when starting any conversation — establishes how to find and use skills before ANY response.",endpoint:null,icon:"bolt"},{id:"multi-brain",name:"Multi-Brain Memory",description:"Share work and memory across Claude Code, OpenCode, Codex, and other agents via a two-level memory index.",endpoint:null,icon:"memory"}];function o(t){return`${f}/${t}/SKILL.md`}function g(t){return`${b}/${t}/SKILL.md`}function p({value:t,label:i="Copy link"}){const{copied:r,copy:s}=u(2e3);return e.jsxs("button",{onClick:()=>s(t),className:"px-2 py-1 rounded-md bg-primary text-white text-[11px] font-medium hover:bg-primary/90 transition-colors cursor-pointer shrink-0 inline-flex items-center gap-1",title:t,children:[e.jsx("span",{className:"material-symbols-outlined text-[12px]",children:r?"check":"content_copy"}),r?"Copied!":i]})}function a({skill:t}){const i=o(t.id);return e.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-[14px] border shadow-[var(--shadow-soft)] transition-colors ${t.isEntry?"border-primary/40 bg-primary/5":"border-border-subtle bg-surface hover:bg-surface-2"}`,children:[e.jsx("div",{className:`size-9 rounded-lg flex items-center justify-center shrink-0 ${t.isEntry?"bg-primary text-white":"bg-primary/10 text-primary"}`,children:e.jsx("span",{className:"material-symbols-outlined text-[18px]",children:t.icon})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsx("h3",{className:"font-semibold text-sm text-text-main",children:t.name}),t.isEntry&&e.jsx(d,{variant:"primary",size:"sm",children:"START HERE"}),t.endpoint&&e.jsx(d,{variant:"default",size:"sm",children:e.jsx("code",{className:"text-[10px]",children:t.endpoint})})]}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:t.description}),e.jsxs("a",{href:g(t.id),target:"_blank",rel:"noreferrer",className:"text-[11px] text-text-muted hover:text-primary mt-1 inline-flex items-center gap-1 break-all",children:[i,e.jsx("span",{className:"material-symbols-outlined text-[12px]",children:"open_in_new"})]})]}),e.jsx(p,{value:i})]})}const y=["fsrouter-chat","fsrouter-image","fsrouter-tts","fsrouter-stt","fsrouter-embeddings","fsrouter-web-search","fsrouter-web-fetch"],j=["using-superpowers","multi-brain"];function L(){const t=n.find(s=>s.isEntry),i=n.filter(s=>y.includes(s.id)),r=n.filter(s=>j.includes(s.id));return e.jsxs("div",{className:"max-w-4xl mx-auto space-y-8",children:[e.jsx("div",{children:e.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[e.jsx("div",{className:"size-10 rounded-xl bg-primary/10 flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-primary text-[22px]",children:"extension"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold text-text-main",children:"Agent Skills"}),e.jsx("p",{className:"text-sm text-text-muted",children:"Raw SKILL.md URLs to paste into any AI agent or coding assistant."})]})]})}),e.jsxs(l,{padding:"md",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px] text-primary",children:"rocket_launch"}),e.jsx("span",{className:"text-xs font-semibold text-text-main uppercase tracking-wide",children:"Quick Start — Paste this to your AI"})]}),e.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[e.jsxs("div",{className:"flex-1 px-3 py-2 rounded-lg bg-surface-2 font-mono text-[12px] text-text-main border border-border-subtle min-w-0 break-all",children:["Read this skill and use it: ",o("fsrouter")]}),e.jsx(p,{value:`Read this skill and use it: ${o("fsrouter")}`,label:"Copy prompt"})]}),e.jsx("p",{className:"text-[11px] text-text-muted mt-2",children:"This entry skill covers setup, authentication, model discovery, and links to all capability skills below."})]}),t&&e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider px-1",children:"Entry Point"}),e.jsx(a,{skill:t})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider px-1",children:"API Capabilities"}),e.jsx("div",{className:"space-y-2",children:i.map(s=>e.jsx(a,{skill:s},s.id))})]}),e.jsxs("section",{className:"space-y-2",children:[e.jsx("h2",{className:"text-xs font-semibold text-text-muted uppercase tracking-wider px-1",children:"Agent Workflow"}),e.jsx("div",{className:"space-y-2",children:r.map(s=>e.jsx(a,{skill:s},s.id))})]}),e.jsx(l,{padding:"md",children:e.jsxs("div",{className:"flex items-center justify-between gap-3 flex-wrap",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main",children:"Browse on GitHub"}),e.jsx("p",{className:"text-xs text-text-muted mt-0.5",children:"View source, README, and full skill documentation."})]}),e.jsxs("a",{href:`${h}/tree/master/skills`,target:"_blank",rel:"noreferrer",className:"text-sm text-primary hover:underline inline-flex items-center gap-1 shrink-0",children:[e.jsx("span",{className:"material-symbols-outlined text-[16px]",children:"open_in_new"}),"View on GitHub"]})]})})]})}export{L as default};
@@ -1,2 +0,0 @@
1
- import{j as t}from"./index.DQDDDpp7.js";import{b as a}from"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function g(){const[s,u]=a.useState(""),[n,i]=a.useState(""),[r,l]=a.useState(null),[o,c]=a.useState(!1),d=async()=>{c(!0);try{const e=await fetch("/api/rerank",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:s,documents:n.split(`
2
- `).filter(Boolean)})});l(await e.json())}catch(e){l({error:e.message})}c(!1)};return t.jsxs("div",{className:"space-y-6 p-6",children:[t.jsx("h1",{className:"text-2xl font-bold",children:"Rerank"}),t.jsx("p",{className:"text-text-muted",children:"Rerank documents by relevance using Cohere-compatible API"}),t.jsx("input",{className:"w-full p-3 rounded-lg border",placeholder:"Query",value:s,onChange:e=>u(e.target.value)}),t.jsx("textarea",{className:"w-full p-3 rounded-lg border h-40",placeholder:"Documents (one per line)",value:n,onChange:e=>i(e.target.value)}),t.jsx("button",{onClick:d,disabled:o,className:"px-4 py-2 bg-primary text-white rounded-lg",children:o?"Reranking...":"Rerank"}),r&&t.jsx("pre",{className:"p-4 bg-black/5 rounded-lg text-sm overflow-auto",children:JSON.stringify(r,null,2)})]})}export{g as default};
@@ -1 +0,0 @@
1
- import{j as a}from"./index.KMEObSAk.js";import{b as e}from"./router.Cjj1--8t.js";import{g as m}from"./machine.CagOtseJ.js";import{A as c}from"./EndpointPageClient.GpJ_FKds.js";import"./zustand.akaTi5uX.js";import"./NoAuthProxyCard.DyEjms20.js";import"./Loading.DFkQ-Ly9.js";function h(){const[i,s]=e.useState(null),[n,r]=e.useState(!0);return e.useEffect(()=>{let t=!0;return m().then(o=>{t&&(s(o),r(!1))}).catch(()=>{t&&r(!1)}),()=>{t=!1}},[]),n?a.jsx("div",{className:"text-text-muted text-sm py-12 text-center",children:"Loading..."}):a.jsx(c,{machineId:i})}export{h as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./index.CoYbjSIL.js";import{b as r}from"./router.Cjj1--8t.js";import{C as j}from"./Loading.QMOYJhLu.js";import"./zustand.akaTi5uX.js";function P(){return e.jsx(r.Suspense,{fallback:e.jsx(j,{}),children:e.jsx(y,{})})}function y(){const[a,h]=r.useState([]),[p,b]=r.useState(!0),[s,f]=r.useState(""),[o,n]=r.useState(null),[i,d]=r.useState(!1),[l,c]=r.useState(""),[x,m]=r.useState(null);r.useEffect(()=>{fetch("/api/media-providers/webSearch").then(t=>t.json()).then(t=>{h(Array.isArray(t)?t:[]),t.length>0&&c(t[0].id)}).catch(()=>{}).finally(()=>b(!1))},[]);const u=async()=>{if(s.trim()){d(!0),m(null),n(null);try{const t=await fetch("/api/media/webSearch",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({query:s,providerId:l||void 0})});if(!t.ok)throw new Error(`HTTP ${t.status}`);const g=await t.json();n(g)}catch(t){m(t.message)}finally{d(!1)}}};return e.jsxs("div",{className:"flex min-w-0 flex-col gap-6 px-1 sm:px-0",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-[28px] text-primary",children:"search"}),e.jsx("h1",{className:"text-xl font-semibold text-text-main",children:"Search"})]}),e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Search Providers"}),p?e.jsx("p",{className:"text-xs text-text-muted",children:"Loading providers..."}):a.length===0?e.jsx("p",{className:"text-xs text-text-muted",children:"No search providers configured. Add one in Media Providers."}):e.jsx("div",{className:"flex flex-wrap gap-2",children:a.map(t=>e.jsx("button",{onClick:()=>c(t.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-colors cursor-pointer ${l===t.id?"bg-primary/10 text-primary border border-primary/30":"bg-surface-2 text-text-muted hover:text-text-main border border-transparent"}`,children:t.name||t.id},t.id))})]}),e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Test Search"}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("input",{type:"text",value:s,onChange:t=>f(t.target.value),onKeyDown:t=>t.key==="Enter"&&u(),placeholder:"Enter search query...",className:"flex-1 rounded-lg border border-border-subtle bg-surface-2 px-3 py-2 text-sm text-text-main placeholder:text-text-muted/50 focus:outline-none focus:ring-1 focus:ring-primary/50"}),e.jsx("button",{onClick:u,disabled:i||!s.trim(),className:"px-4 py-2 rounded-lg bg-primary text-white text-sm font-medium hover:bg-primary/90 disabled:opacity-50 transition-colors cursor-pointer",children:i?"Searching...":"Search"})]})]}),x&&e.jsx("div",{className:"rounded-xl border border-red-500/30 bg-red-500/10 p-4",children:e.jsx("p",{className:"text-sm text-red-400",children:x})}),o&&e.jsxs("div",{className:"rounded-xl border border-border-subtle bg-surface p-4",children:[e.jsx("h2",{className:"text-sm font-semibold text-text-main mb-3",children:"Results"}),e.jsx("pre",{className:"text-xs text-text-muted overflow-auto max-h-96 bg-surface-2 rounded-lg p-3 font-mono whitespace-pre-wrap",children:JSON.stringify(o,null,2)})]})]})}export{P as default};
@@ -1 +0,0 @@
1
- import{j as o}from"./index.B-zMpSp_.js";import{b as r}from"./router.Cjj1--8t.js";import{g as a}from"./machine.CagOtseJ.js";import{A as i}from"./EndpointPageClient.Cee8kfmV.js";import"./zustand.akaTi5uX.js";import"./NoAuthProxyCard.VRP7gDcs.js";import"./Loading.BhEzHe-X.js";function d(){const[t,e]=r.useState("");return r.useEffect(()=>{a().then(e)},[]),t?o.jsx(i,{machineId:t}):null}export{d as default};
@@ -1 +0,0 @@
1
- import{I,H as B,j as e,B as E,g as A,P as z}from"./index.B-zMpSp_.js";import{h as _,d as M,b,L as T}from"./router.Cjj1--8t.js";import{A as R,C as D,B as j,T as F}from"./NoAuthProxyCard.VRP7gDcs.js";import"./zustand.akaTi5uX.js";const K=new Set([]),L={image:"image-combo",tts:"tts-combo"};function P(s){const o=Object.entries(s).some(([i,d])=>i.startsWith("modelLock_")&&d&&new Date(d).getTime()>Date.now());return s.testStatus==="unavailable"&&!o?"active":s.testStatus}function $({provider:s,kind:o,connections:i,isCustom:d,onToggle:l}){var C;const n=A[s.id],y=!!(n!=null&&n.noAuth),p=i.filter(a=>a.provider===s.id),v=p.filter(a=>{const x=P(a);return x==="active"||x==="success"}).length,h=p.filter(a=>{const x=P(a);return x==="error"||x==="expired"||x==="unavailable"}).length,m=p.length,r=m>0&&p.every(a=>a.isActive===!1),u=a=>{a.preventDefault(),a.stopPropagation(),l&&l(s.id,r)},k=()=>y?e.jsx(j,{variant:"success",size:"sm",children:"Ready"}):r?e.jsx(j,{variant:"default",size:"sm",children:"Disabled"}):m===0?e.jsx("span",{className:"text-xs text-text-muted",children:"No connections"}):e.jsxs(e.Fragment,{children:[v>0&&e.jsxs(j,{variant:"success",size:"sm",dot:!0,children:[v," Connected"]}),h>0&&e.jsxs(j,{variant:"error",size:"sm",dot:!0,children:[h," Error"]}),v===0&&h===0&&e.jsxs(j,{variant:"default",size:"sm",children:[m," Added"]})]});return e.jsx(T,{to:`/dashboard/media-providers/${o}/${s.id}`,className:"group",children:e.jsx(D,{padding:"xs",className:`h-full hover:bg-black/[0.01] dark:hover:bg-white/[0.01] transition-colors cursor-pointer ${r?"opacity-50":""}`,children:e.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("div",{className:"size-8 rounded-lg flex items-center justify-center shrink-0",style:{backgroundColor:`${((C=s.color)==null?void 0:C.length)>7?s.color:(s.color??"#888")+"15"}`},children:e.jsx(z,{src:`/providers/${s.id}.png`,alt:s.name,size:30,className:"object-contain rounded-lg max-w-[30px] max-h-[30px]",fallbackText:s.textIcon||s.id.slice(0,2).toUpperCase(),fallbackColor:s.color})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("h3",{className:"font-semibold text-sm",children:s.name}),e.jsxs("div",{className:"flex items-center gap-2 mt-0.5 flex-wrap",children:[d&&e.jsx(j,{variant:"default",size:"sm",children:"Custom"}),k()]})]})]}),m>0&&e.jsx("div",{className:"shrink-0 opacity-100 transition-opacity sm:opacity-0 sm:group-hover:opacity-100",onClick:u,children:e.jsx(F,{size:"sm",checked:!r,onChange:()=>{},title:r?"Enable provider":"Disable provider"})})]})})})}function U({combos:s}){return s.length===0?null:e.jsx("div",{className:"flex flex-col gap-2",children:s.map(o=>e.jsx(T,{to:`/dashboard/media-providers/combo/${o.id}`,children:e.jsx(D,{padding:"xs",className:"hover:bg-black/[0.02] dark:hover:bg-white/[0.02] transition-colors cursor-pointer",children:e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-primary text-[18px]",children:"layers"}),e.jsx("code",{className:"text-sm font-mono font-medium flex-1 truncate",children:o.name}),e.jsxs("div",{className:"flex flex-wrap items-center gap-1 sm:shrink-0",children:[o.models.slice(0,6).map((i,d)=>{const l=typeof i=="string"?i.split("/")[0]:"",n=A[l];return e.jsx("div",{title:(n==null?void 0:n.name)||i,className:"size-5 rounded flex items-center justify-center",style:{backgroundColor:`${(n==null?void 0:n.color)??"#888"}15`},children:e.jsx(z,{src:`/providers/${l}.png`,alt:(n==null?void 0:n.name)||l,size:18,className:"object-contain rounded max-w-[18px] max-h-[18px]",fallbackText:(n==null?void 0:n.textIcon)||l.slice(0,2).toUpperCase(),fallbackColor:n==null?void 0:n.color})},`${i}-${d}`)}),o.models.length>6&&e.jsxs("span",{className:"text-[10px] text-text-muted ml-1",children:["+",o.models.length-6]})]}),e.jsx("span",{className:"text-[11px] text-text-muted shrink-0",children:o.models.length}),e.jsx("span",{className:"material-symbols-outlined text-text-muted text-[16px]",children:"chevron_right"})]})})},o.id))})}function q(){const{kind:s}=_(),o=M(),[i,d]=b.useState([]),[l,n]=b.useState([]),[y,p]=b.useState([]),[v,h]=b.useState(!1);b.useEffect(()=>{(s==="webSearch"||s==="webFetch")&&o("/dashboard/media-providers/web")},[s,o]);const m=I.find(t=>t.id===s),r=s==="embedding",u=K.has(s);if(b.useEffect(()=>{m&&(fetch("/api/providers",{cache:"no-store"}).then(t=>t.json()).then(t=>d(t.connections||[])).catch(()=>{}),r&&fetch("/api/provider-nodes",{cache:"no-store"}).then(t=>t.json()).then(t=>n((t.nodes||[]).filter(c=>c.type==="custom-embedding"))).catch(()=>{}),u&&fetch("/api/combos",{cache:"no-store"}).then(t=>t.json()).then(t=>p(t.combos||[])).catch(()=>{}))},[r,u,m]),!m)return null;const k=B(s),C=y.filter(t=>t.kind===s),a=l.map(t=>({id:t.id,name:t.name||"Custom Embedding",color:"#6366F1",textIcon:"CE"})),x=[...k,...a],S=async(t,c)=>{const w=i.filter(f=>f.provider===t);d(f=>f.map(g=>g.provider===t?{...g,isActive:c}:g)),await Promise.allSettled(w.map(f=>fetch(`/api/providers/${f.id}`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({isActive:c})})))},O=async()=>{const t=L[s]||`${s}-combo`;let c=t,w=1;const f=new Set(y.map(N=>N.name));for(;f.has(c);)c=`${t}-${w++}`;const g=await fetch("/api/combos",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:c,models:[],kind:s})});if(g.ok){const N=await g.json();o(`/dashboard/media-providers/combo/${N.id}`)}else{const N=await g.json();alert(N.error||"Failed to create combo")}};return e.jsxs("div",{className:"flex flex-col gap-6",children:[(r||u)&&e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[u&&e.jsx(E,{size:"sm",icon:"add",onClick:O,children:"Create Combo"}),r&&e.jsx(E,{size:"sm",icon:"add",onClick:()=>h(!0),children:"Add Custom Embedding"})]}),u&&C.length>0&&e.jsx(U,{combos:C}),x.length===0?e.jsxs("div",{className:"text-center py-12 border border-dashed border-border rounded-xl text-text-muted text-sm",children:["No providers support ",e.jsx("strong",{children:m.label})," yet."]}):e.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4",children:[k.map(t=>e.jsx($,{provider:t,kind:s,connections:i,onToggle:S},t.id)),a.map(t=>e.jsx($,{provider:t,kind:s,connections:i,isCustom:!0,onToggle:S},t.id))]}),r&&e.jsx(R,{isOpen:v,onClose:()=>h(!1),onCreated:t=>{n(c=>[...c,t]),h(!1)}})]})}export{q as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./index.DQDDDpp7.js";import{b as o}from"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function u(){const[i,n]=o.useState({}),l=t=>{navigator.clipboard.writeText(t),n(r=>({...r,[t]:!0})),setTimeout(()=>{n(r=>({...r,[t]:!1}))},1500)},a=({value:t,text:r="Copy",className:d=""})=>{const s=i[t];return e.jsxs("button",{type:"button",onClick:()=>l(t),className:`text-xs px-3 py-1 rounded cursor-pointer transition-all duration-150 flex items-center gap-1 border font-semibold shrink-0 ${s?"text-green-400 bg-green-500/10 border-green-500/20":"text-white/50 hover:text-white bg-white/5 hover:bg-white/10 border-transparent"} ${d}`,children:[e.jsx("span",{className:"material-symbols-outlined text-[14px]",children:s?"check":"content_copy"}),s?"Copied":r]})};return e.jsxs("div",{className:"max-w-3xl mx-auto py-8 px-4 text-white space-y-8",children:[e.jsxs("div",{className:"flex items-center justify-between border-b border-white/10 pb-5",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"material-symbols-outlined text-primary text-[28px]",children:"auto_stories"}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-xl font-bold",children:"Panduan Lengkap Deploy Temp Mail"}),e.jsx("p",{className:"text-xs text-white/50 mt-0.5",children:"Panduan integrasi Cloudflare Worker & D1 Database untuk fsrouter"})]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx("a",{href:"/dashboard/automation",className:"px-3.5 py-1.5 rounded-lg bg-white/5 border border-white/10 text-xs font-semibold hover:bg-white/10 transition-colors cursor-pointer",children:"Kembali ke Dashboard"})})]}),e.jsxs("div",{className:"space-y-6 text-sm leading-relaxed text-white/80",children:[e.jsxs("div",{className:"bg-primary/5 border border-primary/20 rounded-xl p-4 text-xs text-primary/95 flex items-start gap-3",children:[e.jsx("span",{className:"material-symbols-outlined shrink-0 mt-0.5",children:"lightbulb"}),e.jsxs("p",{children:[e.jsx("strong",{children:"Info Penting:"})," Panduan ini ditujukan jika Anda ingin melakukan deployment secara manual ke Cloudflare menggunakan CLI. Jika Anda ingin setup otomatis, silakan kembali ke Dashboard dan gunakan form ",e.jsx("strong",{children:"⚡ Auto Deploy (Cloudflare)"})," untuk setup 1-klik."]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"1"}),"Prasyarat & Login Cloudflare"]}),e.jsx("p",{children:"Pastikan Node.js telah terinstal di komputer Anda. Buka terminal lalu autentikasikan akun Cloudflare Anda menggunakan Wrangler CLI:"}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler login"}),e.jsx(a,{value:"npx wrangler login"})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"2"}),"Masuk Folder & Install Dependencies"]}),e.jsx("p",{children:"Buka terminal pada direktori worker lokal Anda (`tempmail`) lalu install package dependencies:"}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"cd /home/data/Project/fsrouter/tempmail && npm install"}),e.jsx(a,{value:"cd /home/data/Project/fsrouter/tempmail && npm install"})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"3"}),"Buat Database Cloudflare D1"]}),e.jsxs("p",{children:["Buat database baru bernama ",e.jsx("code",{children:"tempmail"})," pada Cloudflare D1 untuk menyimpan data kotak surat dan isi pesan:"]}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler d1 create tempmail"}),e.jsx(a,{value:"npx wrangler d1 create tempmail"})]}),e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-lg p-3.5 text-xs text-amber-300 flex items-start gap-2.5",children:[e.jsx("span",{className:"material-symbols-outlined shrink-0 mt-0.5",children:"warning"}),e.jsxs("span",{children:["Perintah di atas akan menghasilkan **database_id** (UUID). Salin ID tersebut, kemudian buka berkas ",e.jsx("code",{className:"bg-white/10 px-1 py-0.5 rounded font-mono text-white",children:"wrangler.jsonc"})," di folder proyek tempmail Anda, ganti nilai ",e.jsx("code",{children:"database_id"})," di baris terbawah dengan ID baru Anda."]})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"4"}),"Jalankan Migrasi Database D1"]}),e.jsx("p",{children:"Buat struktur tabel database yang diperlukan dengan menerapkan migrasi database baik secara lokal maupun langsung di Cloudflare:"}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler d1 migrations apply tempmail --remote"}),e.jsx(a,{value:"npx wrangler d1 migrations apply tempmail --remote"})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"5"}),"Buat API Access Key untuk fsrouter"]}),e.jsx("p",{children:"fsrouter berkomunikasi dengan Worker menggunakan API Key yang aman. Jalankan perintah SQL berikut untuk mendaftarkan fsrouter admin ke database D1 Anda:"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all overflow-hidden text-ellipsis",children:`npx wrangler d1 execute tempmail --remote --command="INSERT OR IGNORE INTO chats (chat_id, username, first_name, last_name, created_at, updated_at) VALUES ('fsrouter', 'fsrouter_admin', 'FSRouter', 'Admin', datetime('now'), datetime('now')); INSERT OR REPLACE INTO api_access (user_id, api_key, quota_daily, quota_used, quota_date, granted_by, granted_at, expires_at) VALUES ('fsrouter', 'tm_YOUR_SECURE_API_KEY', 0, 0, strftime('%Y-%m-%d', 'now'), 'admin', datetime('now'), '2099-12-31T23:59:59Z');"`}),e.jsx(a,{value:`npx wrangler d1 execute tempmail --remote --command="INSERT OR IGNORE INTO chats (chat_id, username, first_name, last_name, created_at, updated_at) VALUES ('fsrouter', 'fsrouter_admin', 'FSRouter', 'Admin', datetime('now'), datetime('now')); INSERT OR REPLACE INTO api_access (user_id, api_key, quota_daily, quota_used, quota_date, granted_by, granted_at, expires_at) VALUES ('fsrouter', 'tm_YOUR_SECURE_API_KEY', 0, 0, strftime('%Y-%m-%d', 'now'), 'admin', datetime('now'), '2099-12-31T23:59:59Z');"`})]}),e.jsxs("div",{className:"bg-amber-500/10 border border-amber-500/20 rounded-lg p-3.5 text-xs text-amber-300 flex items-start gap-2.5",children:[e.jsx("span",{className:"material-symbols-outlined shrink-0 mt-0.5",children:"info"}),e.jsxs("span",{children:["Ganti ",e.jsx("code",{children:"tm_YOUR_SECURE_API_KEY"})," dengan API Key acak pilihan Anda (misalnya menggunakan format ",e.jsx("code",{children:"tm_"})," diikuti oleh karakter hex acak). Salin API Key ini ke pengaturan fsrouter Anda."]})]})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"6"}),"Atur Secret Tokens (Telegram & Webhook)"]}),e.jsx("p",{children:"Simpan token bot Telegram dan webhook secret ke dalam Cloudflare secret variables secara aman:"}),e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler secret put TELEGRAM_BOT_TOKEN"}),e.jsx(a,{value:"npx wrangler secret put TELEGRAM_BOT_TOKEN"})]}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler secret put TELEGRAM_WEBHOOK_SECRET"}),e.jsx(a,{value:"npx wrangler secret put TELEGRAM_WEBHOOK_SECRET"})]})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"7"}),"Deploy ke Cloudflare Workers"]}),e.jsxs("p",{children:["Buka file ",e.jsx("code",{className:"bg-white/10 px-1 py-0.5 rounded font-mono text-white",children:"wrangler.jsonc"}),", sesuaikan parameter ",e.jsx("code",{children:"vars"})," (domain, base URL) agar sesuai dengan domain milik Anda. Setelah itu, deploy ke Cloudflare:"]}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:"npx wrangler deploy"}),e.jsx(a,{value:"npx wrangler deploy"})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"8"}),"Daftarkan Webhook Telegram Bot (Opsional)"]}),e.jsx("p",{children:"Daftarkan URL domain worker Anda ke API Telegram agar bot Anda dapat menerima chat command secara instan:"}),e.jsxs("div",{className:"flex items-center justify-between bg-white/5 p-3 rounded-lg border border-white/10 font-mono text-xs text-amber-300 gap-4",children:[e.jsx("span",{className:"break-all",children:`curl -X POST "https://api.telegram.org/bot<BOT_TOKEN>/setWebhook" -H "Content-Type: application/json" -d '{"url":"https://<worker-host>/telegram/webhook","secret_token":"<WEBHOOK_SECRET>"}'`}),e.jsx(a,{value:`curl -X POST "https://api.telegram.org/bot<BOT_TOKEN>/setWebhook" -H "Content-Type: application/json" -d '{"url":"https://<worker-host>/telegram/webhook","secret_token":"<WEBHOOK_SECRET>"}'`})]})]}),e.jsxs("div",{className:"bg-neutral-900 border border-white/5 rounded-xl p-6 space-y-4",children:[e.jsxs("h4",{className:"text-base font-bold text-white flex items-center gap-2",children:[e.jsx("span",{className:"bg-primary/20 text-primary w-6 h-6 rounded-full flex items-center justify-center text-xs",children:"9"}),"Konfigurasi Cloudflare Email Routing & DNS (Paling Penting!)"]}),e.jsx("p",{children:"Ini adalah langkah krusial agar email dapat diterima dan diproses oleh Worker yang telah dideploy. Masuk ke panel Cloudflare Anda, lalu ikuti panduan berikut:"}),e.jsxs("div",{className:"space-y-4 border-l-2 border-primary/30 pl-4 mt-2",children:[e.jsxs("div",{children:[e.jsxs("h5",{className:"font-bold text-white text-xs flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),"Bagian A: Sinkronkan dan Kunci Rekaman DNS"]}),e.jsxs("p",{className:"text-xs text-white/70 mt-1",children:["Jika status DNS Anda tertulis ",e.jsx("code",{className:"bg-white/10 text-white px-1 rounded",children:"Not configured"})," atau ada rekaman dengan status ",e.jsx("code",{className:"bg-amber-500/10 text-amber-300 px-1 rounded border border-amber-500/20",children:"Unlocked"})," (misalnya TXT SPF):"]}),e.jsxs("ul",{className:"list-disc list-inside text-xs text-white/70 mt-1.5 space-y-1 ml-2",children:[e.jsxs("li",{children:["Buka menu ",e.jsx("strong",{children:"Email Routing"})," di panel domain Cloudflare Anda."]}),e.jsx("li",{children:"Pilih tab **`Settings`** di sebelah atas."}),e.jsx("li",{children:"Di sebelah kanan judul **`DNS records`**, klik tombol **`Lock`** (ikon gembok). Cloudflare akan otomatis mengunci dan menerapkan semua MX dan TXT records yang dibutuhkan untuk rute email."})]})]}),e.jsxs("div",{children:[e.jsxs("h5",{className:"font-bold text-white text-xs flex items-center gap-1.5",children:[e.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-primary"}),"Bagian B: Buat Aturan Rute Catch-All"]}),e.jsx("p",{className:"text-xs text-white/70 mt-1",children:"Agar semua email masuk diteruskan ke database Worker Anda:"}),e.jsxs("ul",{className:"list-disc list-inside text-xs text-white/70 mt-1.5 space-y-1 ml-2",children:[e.jsx("li",{children:"Klik tab **`Routing rules`** (tab ketiga dari kiri)."}),e.jsx("li",{children:"Scroll ke bawah ke bagian **Catch-all address**."}),e.jsx("li",{children:"Klik **Edit** / **Configure**."}),e.jsx("li",{children:"Pada kolom **Action** (Aksi), pilih opsi **`Send to a Worker`** (Kirim ke Worker)."}),e.jsx("li",{children:"Pada kolom **Destination** (Worker tujuan), pilih nama Worker yang baru saja dideploy (contohnya: **`tempmail-pixelnest`**)."}),e.jsx("li",{children:"Klik **Save** untuk menyimpan aturan perutean."})]})]})]})]})]})]})}export{u as default};
@@ -1 +0,0 @@
1
- import{g as v,j as e,B as c,m as j}from"./index.KMEObSAk.js";import{d as N,b as u,L as h}from"./router.Cjj1--8t.js";import{C as p,S as k,I as x,T as A}from"./NoAuthProxyCard.DyEjms20.js";import"./zustand.akaTi5uX.js";const P=Object.values(v).map(a=>({value:a.id,label:a.name})),S=Object.values(j).map(a=>({value:a.id,label:a.name}));function E(){const a=N(),[b,m]=u.useState(!1),[t,y]=u.useState({provider:"",authMethod:"api_key",apiKey:"",displayName:"",isActive:!0}),[s,n]=u.useState({}),i=(r,o)=>{y(l=>({...l,[r]:o})),s[r]&&n(l=>({...l,[r]:null}))},f=()=>{const r={};return t.provider||(r.provider="Please select a provider"),t.authMethod==="api_key"&&!t.apiKey&&(r.apiKey="API Key is required"),n(r),Object.keys(r).length===0},g=async r=>{if(r.preventDefault(),!!f()){m(!0);try{const o=await fetch("/api/providers",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(o.ok)a("/dashboard/providers");else{const l=await o.json();n({submit:l.error||"Failed to create provider"})}}catch{n({submit:"An error occurred. Please try again."})}finally{m(!1)}}},d=v[t.provider];return e.jsxs("div",{className:"max-w-2xl mx-auto",children:[e.jsxs("div",{className:"mb-8",children:[e.jsxs(h,{to:"/dashboard/providers",className:"inline-flex items-center gap-1 text-sm text-text-muted hover:text-primary transition-colors mb-4",children:[e.jsx("span",{className:"material-symbols-outlined text-lg",children:"arrow_back"}),"Back to Providers"]}),e.jsx("h1",{className:"text-3xl font-semibold tracking-tight",children:"Add New Provider"}),e.jsx("p",{className:"text-text-muted mt-2",children:"Configure a new AI provider to use with your applications."})]}),e.jsx(p,{children:e.jsxs("form",{onSubmit:g,className:"flex flex-col gap-6",children:[e.jsx(k,{label:"Provider",options:P,value:t.provider,onChange:r=>i("provider",r.target.value),placeholder:"Select a provider",error:s.provider,required:!0}),d&&e.jsxs(p.Section,{className:"flex items-center gap-3",children:[e.jsx("div",{className:"size-10 rounded-lg flex items-center justify-center bg-bg border border-border",children:e.jsx("span",{className:"material-symbols-outlined text-xl",style:{color:d.color},children:d.icon})}),e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:d.name}),e.jsx("p",{className:"text-sm text-text-muted",children:"Selected provider"})]})]}),e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsxs("label",{className:"text-sm font-medium",children:["Authentication Method ",e.jsx("span",{className:"text-red-500",children:"*"})]}),e.jsx("div",{className:"flex gap-3",children:S.map(r=>e.jsxs("button",{type:"button",onClick:()=>i("authMethod",r.value),className:`flex-1 flex items-center justify-center gap-2 p-4 rounded-lg border transition-all ${t.authMethod===r.value?"border-primary bg-primary/5 text-primary":"border-border hover:border-primary/50"}`,children:[e.jsx("span",{className:"material-symbols-outlined",children:r.value==="api_key"?"key":"lock"}),e.jsx("span",{className:"font-medium",children:r.label})]},r.value))})]}),t.authMethod==="api_key"&&e.jsx(x,{label:"API Key",type:"password",placeholder:"Enter your API key",value:t.apiKey,onChange:r=>i("apiKey",r.target.value),error:s.apiKey,hint:"Your API key will be encrypted and stored securely.",required:!0}),t.authMethod==="oauth2"&&e.jsxs(p.Section,{children:[e.jsx("p",{className:"text-sm text-text-muted mb-4",children:"Connect your account using OAuth2 authentication."}),e.jsx(c,{type:"button",variant:"secondary",icon:"link",children:"Connect with OAuth2"})]}),e.jsx(x,{label:"Display Name",placeholder:"e.g., Production API, Dev Environment",value:t.displayName,onChange:r=>i("displayName",r.target.value),hint:"Optional. A friendly name to identify this configuration."}),e.jsx(A,{checked:t.isActive,onChange:r=>i("isActive",r),label:"Active",description:"Enable this provider for use in your applications"}),s.submit&&e.jsx("div",{className:"p-4 rounded-lg bg-red-50 dark:bg-red-900/20 border border-red-200 dark:border-red-800 text-red-600 dark:text-red-400 text-sm",children:s.submit}),e.jsxs("div",{className:"flex gap-3 pt-4 border-t border-border",children:[e.jsx(h,{to:"/dashboard/providers",className:"flex-1",children:e.jsx(c,{type:"button",variant:"ghost",fullWidth:!0,children:"Cancel"})}),e.jsx(c,{type:"submit",loading:b,fullWidth:!0,className:"flex-1",children:"Create Provider"})]})]})})]})}export{E as default};
@@ -1 +0,0 @@
1
- import{j as e}from"./index.CoYbjSIL.js";import{b as n}from"./router.Cjj1--8t.js";import"./zustand.akaTi5uX.js";function x(){const[s,a]=n.useState(null),[c,r]=n.useState(!1),i=async m=>{const o=m.target.files[0];if(!o)return;r(!0);const l=new FormData;l.append("file",o);try{const t=await fetch("/api/ocr",{method:"POST",body:l});a(await t.json())}catch(t){a({error:t.message})}r(!1)};return e.jsxs("div",{className:"space-y-6 p-6",children:[e.jsx("h1",{className:"text-2xl font-bold",children:"OCR"}),e.jsx("p",{className:"text-text-muted",children:"Extract text from images using Mistral OCR API"}),e.jsx("input",{type:"file",accept:"image/*,.pdf",onChange:i,className:"block"}),c&&e.jsx("p",{children:"Processing..."}),s&&e.jsx("pre",{className:"p-4 bg-black/5 rounded-lg text-sm overflow-auto max-h-96",children:JSON.stringify(s,null,2)})]})}export{x as default};
@@ -1 +0,0 @@
1
- import{j as e,B as h}from"./index.KMEObSAk.js";import{b as r}from"./router.Cjj1--8t.js";import"./NoAuthProxyCard.DyEjms20.js";import"./zustand.akaTi5uX.js";function R(){const[l,s]=r.useState(!1),[c,a]=r.useState(""),[o,m]=r.useState(""),i=r.useRef(null),f=()=>{window.location.href="/api/db"},b=()=>{i.current&&i.current.click()},g=async n=>{const t=n.target.files[0];if(t){if(!t.name.endsWith(".fud")&&!t.name.endsWith(".json")){a("Format file tidak didukung. Harap gunakan file berekstensi .fud");return}if(!window.confirm("PERINGATAN: Memulihkan database akan MENIMPA semua data, pengaturan, dan provider saat ini! Server akan di-restart otomatis. Lanjutkan?")){n.target.value="";return}a(""),m(""),s(!0);try{const d=new FileReader;d.onload=async j=>{try{const x=j.target.result,k=JSON.parse(x),u=await fetch("/api/db",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(k)}),p=await u.json();u.ok&&p.success?(m("Restore berhasil! Server sedang merestart, harap tunggu beberapa saat..."),setTimeout(()=>{window.location.reload()},5e3)):(a(p.error||"Gagal melakukan restore."),s(!1))}catch{a("File backup corrupt atau tidak valid."),s(!1)}},d.readAsText(t)}catch{a("Gagal membaca file."),s(!1)}n.target.value=""}};return e.jsxs("div",{className:"max-w-4xl mx-auto p-4 space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-1",children:[e.jsxs("h1",{className:"text-2xl font-bold text-text-main flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-[28px] text-primary",children:"backup"}),"Backup & Restore"]}),e.jsx("p",{className:"text-xs text-text-muted",children:"Amankan seluruh data FSRouter Anda ke dalam satu file .fud, atau pulihkan data dari file backup sebelumnya."})]}),c&&e.jsxs("div",{className:"p-4 bg-red-500/10 border border-red-500/20 text-red-500 text-sm rounded-lg flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-sm",children:"error"}),c]}),o&&e.jsxs("div",{className:"p-4 bg-green-500/10 border border-green-500/20 text-green-500 text-sm rounded-lg flex items-center gap-2",children:[e.jsx("span",{className:"material-symbols-outlined text-sm",children:"check_circle"}),o]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[e.jsxs("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 text-text-main",children:[e.jsx("div",{className:"size-10 rounded-full bg-blue-500/10 text-blue-500 flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-xl",children:"cloud_download"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Buat Backup"}),e.jsx("p",{className:"text-[11px] text-text-muted",children:"Simpan data ke perangkat Anda"})]})]}),e.jsxs("div",{className:"text-xs text-text-muted leading-relaxed flex-1",children:[e.jsx("p",{className:"mb-2",children:"File backup (.fud) berisi keseluruhan state sistem:"}),e.jsxs("ul",{className:"list-disc list-inside space-y-1 ml-1",children:[e.jsx("li",{children:"Konfigurasi Providers & Endpoint"}),e.jsx("li",{children:"Riwayat Penggunaan & Limits"}),e.jsx("li",{children:"Akun Otomatis & FSmail"}),e.jsx("li",{children:"Proxy Pools & Identitas Perangkat"})]})]}),e.jsx(h,{variant:"primary",fullWidth:!0,onClick:f,icon:"download",children:"Download Backup (.fud)"})]}),e.jsxs("div",{className:"p-6 rounded-[14px] border border-border-subtle bg-surface flex flex-col gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3 text-text-main",children:[e.jsx("div",{className:"size-10 rounded-full bg-amber-500/10 text-amber-500 flex items-center justify-center",children:e.jsx("span",{className:"material-symbols-outlined text-xl",children:"restore"})}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-sm font-semibold",children:"Pulihkan Backup"}),e.jsx("p",{className:"text-[11px] text-text-muted",children:"Timpa data dari file .fud"})]})]}),e.jsxs("div",{className:"text-xs text-text-muted leading-relaxed flex-1",children:[e.jsx("p",{className:"mb-2 text-amber-500/90 font-medium",children:"Perhatian sebelum memulihkan:"}),e.jsx("p",{children:"Proses restore akan menghapus dan menimpa database yang berjalan saat ini dengan database yang ada di file backup. FSRouter akan melakukan restart layanan setelah proses restore selesai."})]}),e.jsx("input",{type:"file",accept:".fud,.json",ref:i,onChange:g,className:"hidden"}),e.jsx(h,{variant:"secondary",fullWidth:!0,onClick:b,disabled:l,icon:l?"sync":"upload",children:l?"Sedang Memulihkan...":"Pilih File & Restore"})]})]})]})}export{R as default};